/* Стили для админ панели */

.admin-container {
    display: flex;
    height: 100vh;
    background: var(--bg-secondary);
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100%;
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    transition: all 0.2s;
    position: relative;
}

.nav-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--bg-secondary);
    color: var(--primary-color);
    font-weight: 500;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-color);
}

.nav-icon {
    font-size: 1.25rem;
    margin-right: 0.75rem;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.user-info {
    margin-bottom: 1rem;
}

.user-name {
    font-weight: 500;
    color: var(--text-primary);
}

.user-email {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content-header {
    background: var(--bg-primary);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.content-header h1 {
    font-size: 1.5rem;
    margin: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.content-body {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* Dashboard Cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.green {
    background: rgba(16, 185, 129, 0.1);
}

.stat-icon.yellow {
    background: rgba(245, 158, 11, 0.1);
}

.stat-icon.red {
    background: rgba(239, 68, 68, 0.1);
}

.stat-icon.blue {
    background: rgba(59, 130, 246, 0.1);
}

.stat-value {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Tables */
.table-container {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

/* Общий стиль для таблиц в админке */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.table-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.table-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

.table-wrapper {
    overflow-x: auto;
}

/* Таблица запросов на одобрение (чуть более широкие отступы между столбцами) */
.approvals-table thead th {
    padding: 0.75rem 1.25rem;
    white-space: nowrap;
}

.approvals-table tbody td {
    padding: 0.6rem 1.25rem;
    vertical-align: middle;
    font-size: 0.9rem;
}

/* Красивое отображение колонок в таблице запросов */
.approvals-table td:nth-child(1) { /* Дата */
    white-space: nowrap;
    color: #6b7280;
}

.approvals-table td:nth-child(2) { /* Тип */
    white-space: nowrap;
}

.approvals-table td:nth-child(3) { /* Объект */
    white-space: nowrap;
}

.approvals-table td:nth-child(4) { /* Описание */
    max-width: 420px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.approvals-table td:nth-child(5) { /* Статус */
    white-space: nowrap;
}

.approvals-table td:nth-child(6) { /* Модератор */
    white-space: nowrap;
}

.approvals-table td:nth-child(7) { /* Действия */
    white-space: nowrap;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    padding: 0.5rem;
    font-size: 1rem;
    min-width: auto;
}

/* Filters */
.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Унифицированный стиль селектов-фильтров (в т.ч. на странице запросов) */
.filter-select {
    padding: 0.4rem 0.9rem;
    border-radius: 9999px;
    border: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-primary);
    background: var(--bg-primary);
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px rgba(59,130,246,0.15);
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Map */
#map {
    height: 500px;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 70px;
    }
    
    .sidebar-header h2,
    .nav-item span:not(.nav-icon),
    .user-info,
    .sidebar-footer button span {
        display: none;
    }
    
    .nav-icon {
        margin: 0;
    }
    
    .main-content {
        margin-left: 70px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    font-size: 1.5rem;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Цветные строки таблицы участков по статусу */
.land-row-available { background: rgba(16,185,129,0.08); transition: background .3s; }
.land-row-reserved { background: rgba(245,158,11,0.10); transition: background .3s; }
.land-row-sold { background: rgba(239,68,68,0.10); transition: background .3s; }
.land-row-available:hover { background: rgba(16,185,129,0.18); }
.land-row-reserved:hover { background: rgba(245,158,11,0.20); }
.land-row-sold:hover { background: rgba(239,68,68,0.20); }

/* Цветные селекты статуса (постоянная окраска) */
.status-select { border: 1px solid var(--border-color); border-radius: 6px; padding: 4px 8px; font-size: 13px; cursor: pointer; transition: background .25s, color .25s, border-color .25s; }
.status-select.available { background: rgba(16,185,129,0.18); color: #047857; border-color: rgba(16,185,129,0.4); }
.status-select.reserved { background: rgba(245,158,11,0.22); color: #92400e; border-color: rgba(245,158,11,0.45); }
.status-select.sold { background: rgba(239,68,68,0.22); color: #7f1d1d; border-color: rgba(239,68,68,0.45); }
.status-select.available:focus { box-shadow: 0 0 0 2px rgba(16,185,129,0.35); }
.status-select.reserved:focus { box-shadow: 0 0 0 2px rgba(245,158,11,0.35); }
.status-select.sold:focus { box-shadow: 0 0 0 2px rgba(239,68,68,0.35); }

/* Анимация для блока "1 онлайн" */
.online-users {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #1d4ed8; /* насыщённый синий текст */
    background-color: rgba(59,130,246,0.10);
    animation: onlineBlink 1.4s ease-in-out infinite;
}

/* Кнопка с именем владельца в таблице участков */
.owner-pill {
    border: none;
    background: transparent;
    padding: 4px 10px;
    border-radius: 9999px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    color: #111827; /* почти чёрный текст */
    transition: background-color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

.owner-pill:hover {
    background: rgba(59,130,246,0.06); /* лёгкий фон при hover */
    box-shadow: 0 1px 4px rgba(15,23,42,0.18);
    transform: translateY(-1px);
}

/* Кнопка суммы "Оплачено" в таблице участков */
.paid-pill {
    border: none;
    background: transparent;
    padding: 4px 10px;
    border-radius: 9999px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    color: #047857; /* тёмно-зелёный текст, ассоциация с деньгами */
    transition: background-color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

.paid-pill:hover {
    background: rgba(16,185,129,0.08); /* лёгкий зелёный фон при hover */
    box-shadow: 0 1px 4px rgba(16,185,129,0.25);
    transform: translateY(-1px);
}

@keyframes onlineBlink {
    0%, 100% {
        background-color: rgba(59,130,246,0.10);
    }
    50% {
        background-color: rgba(59,130,246,0.35);
    }
}