/* ===========================
   FOXCLAB DASHBOARD STYLES
   Based on foxclab.ru design
   =========================== */

/* ===========================
   VARIABLES & RESET
   =========================== */

:root {
    /* Colors - Foxclab Brand Theme */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-card: #ffffff;
    --bg-card-hover: #fafafa;

    /* Peachy/Warm Colors from foxclab.ru */
    --accent-peachy: #f9d3b6;
    --accent-peachy-hover: #f7c39e;
    --accent-peachy-light: #fce4cf;

    /* Secondary Accents */
    --accent-cyan: #e1f3f9;
    --accent-pink: #f9d3d5;
    --accent-green: #dfefc6;
    --accent-red: #c42b33;

    /* Text Colors */
    --text-primary: #000000;
    --text-secondary: #6d6e6e;
    --text-muted: #adadad;

    /* Border Colors */
    --border-light: #e0e0e0;
    --border-medium: #cccccc;
    --border-dark: #999999;

    /* Spacing Scale (8px base) */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 90px;
    --radius-full: 3000px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);

    /* Transitions */
    --transition-fast: 0.1s ease-in-out;
    --transition-normal: 0.2s ease-in-out;
    --transition-slow: 0.3s ease-in-out;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Manrope', 'Geometria', 'Circe', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===========================
   CONTAINER
   =========================== */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* ===========================
   HEADER
   =========================== */

.header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    padding: var(--spacing-md) 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-xl);
}

.logo {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.logo-text {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    line-height: 1;
}

.logo-subtitle {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.nav {
    display: flex;
    gap: var(--spacing-xs);
    flex: 1;
    justify-content: center;
}

.nav-link {
    padding: 10px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    border-radius: var(--radius-xl);
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.nav-link.active {
    background: var(--accent-peachy);
    color: var(--text-primary);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-peachy), var(--accent-peachy-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.btn-logout {
    padding: 10px 16px;
    background: transparent;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-xl);
    font-size: 18px;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-logout:hover {
    background: var(--accent-peachy-light);
    border-color: var(--accent-peachy);
    transform: scale(1.05);
}

.btn-logout:active {
    transform: scale(0.95);
}

/* ===========================
   MAIN CONTENT
   =========================== */

.main {
    padding: var(--spacing-2xl) 0;
    min-height: calc(100vh - 200px);
}

/* ===========================
   PAGE HEADER
   =========================== */

.page-header {
    margin-bottom: var(--spacing-xl);
}

.page-title {
    font-size: 42px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: -1px;
}

.page-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ===========================
   STATS GRID
   =========================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-2xl);
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    display: flex;
    gap: var(--spacing-md);
    align-items: flex-start;
    transition: all var(--transition-normal);
    border: 2px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--accent-peachy-light), transparent);
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-peachy);
}

.stat-card:hover::before {
    opacity: 0.3;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent-peachy), var(--accent-peachy-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 4px;
}

.stat-change {
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.stat-change.positive {
    color: #2e7d32;
}

.stat-change.positive::before {
    content: "▲";
    font-size: 10px;
}

.stat-change.negative {
    color: var(--accent-red);
}

.stat-change.negative::before {
    content: "▼";
    font-size: 10px;
}

.stat-change.neutral {
    color: var(--text-secondary);
}

/* ===========================
   FILTERS SECTION
   =========================== */

.filters-section {
    margin-bottom: var(--spacing-2xl);
}

.filters-panel {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 2px solid var(--border-light);
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    min-width: 150px;
}

.filter-group.date-range {
    display: flex;
    flex-direction: row;
    gap: var(--spacing-sm);
    align-items: flex-end;
}

.filter-group.date-range .filter-input {
    min-width: 150px;
}

.filter-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-input,
.filter-select {
    padding: 10px 14px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: all var(--transition-fast);
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--accent-peachy);
    background: var(--bg-secondary);
}

.btn-secondary {
    padding: 10px 20px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-xl);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.btn-secondary:hover {
    background: var(--border-medium);
    transform: translateY(-2px);
}

/* ===========================
   DATA SECTIONS
   =========================== */

.data-section {
    margin-bottom: var(--spacing-2xl);
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

/* ===========================
   LOCAL FILTERS
   =========================== */

.local-filters {
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    align-items: flex-end;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================
   CONTROLS PANEL
   =========================== */

.controls-panel {
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.search-box {
    display: flex;
    gap: var(--spacing-sm);
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-xl);
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: all var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-peachy);
    box-shadow: 0 0 0 3px rgba(249, 211, 182, 0.2);
}

.btn-search {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: var(--radius-xl);
    background: var(--accent-peachy);
    font-size: 18px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-search:hover {
    background: var(--accent-peachy-hover);
    transform: scale(1.05);
}

.filters {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.filter-select {
    padding: 12px 16px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-xl);
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-peachy);
    box-shadow: 0 0 0 3px rgba(249, 211, 182, 0.2);
}

.btn-primary {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-xl);
    background: var(--accent-peachy);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    background: var(--accent-peachy-hover);
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

/* ===========================
   TABLE
   =========================== */

.table-container {
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table-scrollable {
    max-height: 600px;
    overflow-y: auto;
}

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

.data-table thead {
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th {
    padding: var(--spacing-md);
    text-align: left;
    font-weight: 700;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-light);
}

.data-table td {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
    color: var(--text-primary);
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--bg-secondary);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.text-center {
    text-align: center;
}

/* ===========================
   ANALYTICS SECTION
   =========================== */

.analytics-section {
    margin-bottom: var(--spacing-2xl);
    display: none; /* Hidden for now */
}

.section-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: var(--spacing-lg);
}

.chart-card {
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: all var(--transition-normal);
}

.chart-card:hover {
    border-color: var(--accent-peachy);
    box-shadow: var(--shadow-md);
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.chart-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.chart-legend {
    display: flex;
    gap: var(--spacing-md);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 13px;
    color: var(--text-secondary);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.chart-container {
    position: relative;
    height: 300px;
}

/* ===========================
   FOOTER
   =========================== */

.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
    padding: var(--spacing-lg) 0;
    margin-top: var(--spacing-2xl);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-lg);
}

.footer-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    gap: var(--spacing-lg);
}

.footer-link {
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */

@media screen and (max-width: 1199px) {
    .page-title {
        font-size: 36px;
    }

    .section-title {
        font-size: 24px;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 959px) {
    .header-content {
        gap: var(--spacing-md);
    }

    .nav {
        gap: 4px;
    }

    .nav-link {
        padding: 8px 16px;
        font-size: 12px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 639px) {
    .container {
        padding: 0 var(--spacing-md);
    }

    .header-content {
        flex-wrap: wrap;
    }

    .logo-text {
        font-size: 24px;
    }

    .nav {
        width: 100%;
        overflow-x: auto;
        justify-content: flex-start;
    }

    .nav-link {
        white-space: nowrap;
    }

    .page-title {
        font-size: 28px;
    }

    .section-title {
        font-size: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .controls-panel {
        padding: var(--spacing-md);
    }

    .filters {
        flex-direction: column;
    }

    .filter-select,
    .btn-primary {
        width: 100%;
    }

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

    .data-table {
        min-width: 800px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
}

/* ===========================
   UTILITIES
   =========================== */

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-light);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
