/* ==================== PROMOSTAFF PRO — палитра как на лэндинге ==================== */

:root {
    /* Лэндинг: акцент #F5A623, Telegram #26A5E4, Max #8B5CF6, текст #111 / #666 */
    --primary: #F5A623;
    --primary-dark: #D97706;
    --primary-light: #FBBF24;
    --secondary: #26A5E4;
    --accent-max: #8B5CF6;
    --success: #06D6A0;
    --danger: #EF476F;
    --warning: #F5A623;
    --info: #26A5E4;

    --bg-page: #F8F8FA;
    --bg-card: #FFFFFF;
    --bg-sidebar: rgba(255, 255, 255, 0.96);

    --text-primary: #111111;
    --text-secondary: #666666;
    --text-muted: #888888;

    --border: #EEEEEE;
    --border-dark: #DDDDDD;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    
    --radius: 12px;
    --radius-sm: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ==================== НАВИГАЦИЯ ==================== */
.navbar {
    background: var(--bg-sidebar);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.navbar-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #F5A623, #26A5E4);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
}

.navbar-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.navbar-title .brand-accent {
    color: var(--primary);
}

.navbar-menu {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.nav-link {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover {
    background: rgba(245, 166, 35, 0.08);
    color: var(--primary);
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(245, 166, 35, 0.2), rgba(38, 165, 228, 0.12));
    color: var(--text-primary);
    border: 1px solid rgba(245, 166, 35, 0.35);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.logout-btn {
    background: none;
    border: 1px solid transparent;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.4rem 0.65rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    text-decoration: none;
}

.logout-btn:hover {
    background: #E9ECEF;
    color: var(--danger);
}

/* ==================== КАРТОЧКИ ==================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

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

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 1.25rem;
}

/* ==================== СТАТИСТИКА (светлые карточки) ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(245, 166, 35, 0.45);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: linear-gradient(135deg, rgba(245, 166, 35, 0.15), rgba(38, 165, 228, 0.12));
}

.stat-info h3 {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

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

.stat-trend {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    border-radius: 20px;
    font-weight: 500;
}

.stat-trend.up {
    background: #E6F9F0;
    color: #06D6A0;
}

.stat-trend.down {
    background: #FEE8EC;
    color: #EF476F;
}

.stat-trend.neutral {
    background: #E9ECEF;
    color: #6C757D;
}

/* ==================== ТАБЛИЦЫ ==================== */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    padding: 0.75rem 1rem;
    background: #F8F9FA;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.8rem;
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.table tr:hover {
    background: #F8F9FA;
}

/* ==================== БЕЙДЖИ ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
}

.badge-blue {
    background: #E8F0FE;
    color: #4361EE;
}

.badge-green {
    background: #E6F9F0;
    color: #06D6A0;
}

.badge-orange {
    background: #FEF4E6;
    color: #F9C74F;
}

.badge-purple {
    background: #F0E8FE;
    color: #9C89B8;
}

.badge-red {
    background: #FEE8EC;
    color: #EF476F;
}

.badge-success {
    background: #E6F9F0;
    color: #06D6A0;
}

.badge-warning {
    background: #FEF4E6;
    color: #F9C74F;
}

.badge-danger {
    background: #FEE8EC;
    color: #EF476F;
}

.badge-gray {
    background: #E9ECEF;
    color: #6C757D;
}

/* ==================== АВАТАРКИ ==================== */
.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #E8F0FE, #D0E4FE);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--primary);
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

.user-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ==================== РЕЙТИНГ ==================== */
.stars {
    color: #F9C74F;
    font-size: 0.8rem;
}

.rating-value {
    margin-left: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* ==================== КНОПКИ ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #F5A623, #E8940A);
    color: #111111;
    font-weight: 600;
}

.btn-primary:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-dark);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--text-primary);
    background: rgba(245, 166, 35, 0.06);
}

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 1rem;
}

.btn-icon:hover {
    background: #E9ECEF;
}

.btn-icon.success:hover {
    color: #06D6A0;
}

.btn-icon.danger:hover {
    color: #EF476F;
}

/* ==================== ФИЛЬТРЫ ==================== */
.filters-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.filters-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filter-group label {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.filter-group input,
.filter-group select {
    padding: 0.5rem 0.75rem;
    background: white;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.8rem;
    min-width: 150px;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--primary);
}

/* ==================== ПАГИНАЦИЯ ==================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.page-link {
    padding: 0.4rem 0.75rem;
    background: white;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
}

.page-link.active {
    background: linear-gradient(135deg, #F5A623, #E8940A);
    border-color: var(--primary-dark);
    color: #111111;
}

.page-link:hover {
    background: rgba(245, 166, 35, 0.1);
    border-color: var(--primary);
    color: var(--text-primary);
}

/* ==================== АЛАРТЫ ==================== */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.8rem;
}

.alert-success {
    background: #E6F9F0;
    border-left: 4px solid #06D6A0;
    color: #06D6A0;
}

.alert-error {
    background: #FEE8EC;
    border-left: 4px solid #EF476F;
    color: #EF476F;
}

.alert-warning {
    background: #FEF4E6;
    border-left: 4px solid #F9C74F;
    color: #F9C74F;
}

.alert-info {
    background: #E8F0FE;
    border-left: 4px solid #4361EE;
    color: #4361EE;
}

/* ==================== ПУСТЫЕ СОСТОЯНИЯ ==================== */
.empty-state {
    padding: 3rem;
    text-align: center;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* ==================== АДАПТИВ ==================== */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .filters-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group input,
    .filter-group select {
        min-width: auto;
    }
    
    /* Раньше меню полностью скрывалось — не было доступа к разделам (в т.ч. «Агентство»). */
    .navbar-container {
        flex-wrap: wrap;
        row-gap: 0.5rem;
    }
    .navbar-menu {
        display: flex;
        flex-wrap: wrap;
        gap: 0.2rem;
        width: 100%;
        order: 3;
        justify-content: flex-start;
        padding-top: 0.5rem;
        border-top: 1px solid var(--border);
    }
    .nav-link {
        padding: 0.35rem 0.65rem;
        font-size: 0.875rem;
    }
}

/* ==================== Вход (как на лэндинге) ==================== */
.page-auth {
    max-width: 520px;
    margin: 0 auto;
}

.page-auth .auth-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.75rem 1.75rem 1.5rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.page-auth .auth-card::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 4px;
    background: linear-gradient(90deg, #F5A623, #26A5E4);
}

.page-auth h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.page-auth h2 .brand-accent {
    color: var(--primary);
}

.page-auth .text-muted {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.page-auth label {
    display: grid;
    gap: 0.35rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.page-auth input[type="text"],
.page-auth input[type="password"] {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border-dark);
    border-radius: 10px;
    font-size: 0.95rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.page-auth input:focus {
    outline: none;
    border-color: rgba(245, 166, 35, 0.7);
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.15);
}

.page-auth .btn-primary {
    border-radius: 40px;
    padding: 0.65rem 1.5rem;
    justify-content: center;
    width: 100%;
    margin-top: 0.25rem;
}

.page-auth .auth-hint {
    margin-top: 14px;
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

.page-auth .auth-form {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

/* ==================== Дашборд (как на лэндинге) ==================== */
.dash {
    max-width: 1120px;
    margin: 0 auto;
}

.dash-hero {
    background: linear-gradient(135deg, #ffffff 0%, #f8f8fa 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.75rem 1.75rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.04);
}

.dash-kicker {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 0 0.35rem;
}

.dash-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
    line-height: 1.2;
}

.dash-sub {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 42rem;
    line-height: 1.55;
}

.dash-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.dash-metric {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.1rem 1.2rem;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.03);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.dash-metric:hover {
    border-color: rgba(245, 166, 35, 0.35);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.dash-metric-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0 0 0.35rem;
}

.dash-metric-value {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.35rem;
    letter-spacing: -0.02em;
}

.dash-metric-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

.dash-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.dash-shortcuts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.dash-tile {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.15rem 1.2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, transform 0.12s, box-shadow 0.15s;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.03);
}

.dash-tile:hover {
    border-color: rgba(38, 165, 228, 0.45);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

.dash-tile-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.dash-tile-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

@media (max-width: 900px) {
    .dash-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
    .dash-shortcuts {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 560px) {
    .dash-metrics,
    .dash-shortcuts {
        grid-template-columns: 1fr;
    }
}
