:root {
    --bg: #07111f;
    --bg-alt: #0c1729;
    --panel: rgba(10, 19, 35, 0.78);
    --panel-border: rgba(148, 163, 184, 0.12);
    --text: #e5eefc;
    --muted: #8da2c0;
    --primary: #7c3aed;
    --primary-2: #22d3ee;
    --success: #22c55e;
    --info: #38bdf8;
    --danger: #f97316;
    --neutral: #94a3b8;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(124, 58, 237, 0.22), transparent 28%),
        radial-gradient(circle at top right, rgba(34, 211, 238, 0.14), transparent 24%),
        linear-gradient(160deg, #050c17 0%, #08111f 45%, #0a1526 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

code {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 2px 7px;
}

.glass-card {
    background: var(--panel);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow);
}

.auth-page {
    display: grid;
    place-items: center;
    padding: 32px;
}

.auth-shell {
    width: min(100%, 520px);
}

.auth-panel {
    border-radius: 28px;
    padding: 38px;
}

.brand-block h1,
.topbar h1,
.panel-header h2 {
    margin: 8px 0 10px;
    line-height: 1.1;
}

.brand-block h1,
.topbar h1 {
    font-size: clamp(2rem, 4vw, 3rem);
}

.brand-block p,
.topbar p,
.panel-header p,
.sidebar-subtitle,
.stat-meta,
.auth-hint,
.sidebar-footer,
.empty-state {
    color: var(--muted);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #b8c8e8;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.75rem;
    font-weight: 700;
}

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

.auth-form label {
    display: grid;
    gap: 8px;
}

.auth-form span {
    font-size: 0.95rem;
    color: #c7d7f5;
}


input,
select {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.8);
    color: var(--text);
    border-radius: 16px;
    padding: 15px 16px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 48px;
    cursor: pointer;
    background-image:
        linear-gradient(45deg, transparent 50%, #8fd5ff 50%),
        linear-gradient(135deg, #8fd5ff 50%, transparent 50%),
        linear-gradient(180deg, rgba(124, 58, 237, 0.16), rgba(34, 211, 238, 0.08));
    background-position:
        calc(100% - 22px) calc(50% - 2px),
        calc(100% - 16px) calc(50% - 2px),
        0 0;
    background-size: 6px 6px, 6px 6px, 100% 100%;
    background-repeat: no-repeat;
}

input:focus,
select:focus {
    border-color: rgba(34, 211, 238, 0.55);
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12), 0 10px 24px rgba(0, 0, 0, 0.14);
    transform: translateY(-1px);
}

select:hover {
    border-color: rgba(124, 58, 237, 0.34);
    background-color: rgba(17, 27, 47, 0.96);
}

select option {
    background: #0f172a;
    color: #e5eefc;
}

.btn {
    border: 0;
    border-radius: 16px;
    padding: 14px 18px;
    font-size: 0.98rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: white;
    box-shadow: 0 14px 30px rgba(34, 211, 238, 0.18);
}

.btn-block {
    width: 100%;
}

.alert {
    margin-top: 22px;
    border-radius: 16px;
    padding: 14px 16px;
    font-weight: 600;
}

.alert-error {
    background: rgba(249, 115, 22, 0.12);
    border: 1px solid rgba(249, 115, 22, 0.24);
    color: #ffd6c2;
}

.auth-hint {
    margin-top: 20px;
    line-height: 1.7;
    font-size: 0.95rem;
}

.app-shell {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    min-height: 100vh;
    gap: 24px;
    padding: 24px;
}

.sidebar {
    border-radius: 28px;
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.logo-mark {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    font-weight: 800;
    font-size: 1.4rem;
    margin-bottom: 16px;
}

.sidebar-title {
    font-size: 1.2rem;
    font-weight: 800;
}

.sidebar-nav {
    display: grid;
    gap: 10px;
    margin: 32px 0;
}

.sidebar-nav a {
    padding: 14px 16px;
    border-radius: 16px;
    color: #c7d7f5;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
}

.sidebar-nav a.active,
.sidebar-nav a:hover {
    background: rgba(124, 58, 237, 0.16);
    border-color: rgba(124, 58, 237, 0.32);
}

.main-content {
    display: grid;
    gap: 24px;
}

.topbar {
    padding: 14px 4px 6px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.stat-card {
    border-radius: var(--radius);
    padding: 22px;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    inset: auto -20px -20px auto;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    opacity: 0.15;
    background: currentColor;
    filter: blur(10px);
}

.accent-purple { color: #a78bfa; }
.accent-green { color: #4ade80; }
.accent-blue { color: #38bdf8; }
.accent-red { color: #fb923c; }

.stat-label,
.stat-meta {
    display: block;
}

.stat-label {
    color: #c6d7f7;
    font-size: 0.92rem;
    margin-bottom: 12px;
}

.stat-value {
    display: block;
    color: #ffffff;
    font-size: clamp(2rem, 4vw, 2.8rem);
    margin-bottom: 10px;
}

.chart-grid {
    display: grid;
    grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
    gap: 18px;
}

.panel {
    border-radius: 28px;
    padding: 22px;
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.chart-wrap {
    position: relative;
    height: 340px;
}

.chart-wrap.large {
    height: 360px;
}

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

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

thead th {
    text-align: left;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8ea5c6;
    padding: 14px 14px 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

tbody td {
    padding: 15px 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    color: #e6eefb;
    vertical-align: top;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.025);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.badge-success {
    background: rgba(34, 197, 94, 0.15);
    color: #8df0b0;
    border-color: rgba(34, 197, 94, 0.22);
}

.badge-info {
    background: rgba(56, 189, 248, 0.16);
    color: #b5eafe;
    border-color: rgba(56, 189, 248, 0.22);
}

.badge-danger {
    background: rgba(249, 115, 22, 0.16);
    color: #ffd1b3;
    border-color: rgba(249, 115, 22, 0.22);
}

.badge-neutral {
    background: rgba(148, 163, 184, 0.14);
    color: #d7e0ea;
    border-color: rgba(148, 163, 184, 0.2);
}

.empty-state {
    text-align: center;
    padding: 30px !important;
}

@media (max-width: 1200px) {
    .stats-grid,
    .chart-grid {
        grid-template-columns: 1fr 1fr;
    }

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

    .filters-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

@media (max-width: 960px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        gap: 24px;
    }

    .sidebar-nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .panel-header,
    .panel-header.compact {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 720px) {
    .auth-page,
    .app-shell {
        padding: 14px;
    }

    .auth-panel,
    .panel,
    .sidebar,
    .stat-card {
        padding: 18px;
        border-radius: 22px;
    }

    .stats-grid,
    .chart-grid,
    .sidebar-nav,
    .filters-grid {
        grid-template-columns: 1fr;
    }

    .topbar-actions,
    .filters-actions {
        width: 100%;
    }

    .topbar-actions .btn,
    .filters-actions .btn {
        flex: 1 1 100%;
        text-align: center;
    }

    .chart-wrap,
    .chart-wrap.large {
        height: 300px;
    }
}


.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    color: #dbe7ff;
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.btn-secondary:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.filter-panel {
    padding: 24px;
    background:
        linear-gradient(180deg, rgba(14, 24, 44, 0.92), rgba(10, 19, 35, 0.88)),
        radial-gradient(circle at top right, rgba(34, 211, 238, 0.08), transparent 32%);
}

.panel-header.compact {
    align-items: center;
    margin-bottom: 22px;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.14);
    color: #d7e4fb;
    font-size: 0.92rem;
    white-space: nowrap;
}

.live-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.14);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    gap: 16px;
    align-items: end;
}

.filters-grid label {
    display: grid;
    gap: 9px;
}

.filters-grid label span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #c7d7f5;
    font-size: 0.9rem;
    font-weight: 600;
}

.filters-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.table-actions {
    color: var(--muted);
    font-size: 0.92rem;
}
/* === Modern Select Wrapper === */
.select-wrapper {
    position: relative;
    width: 100%;
}

/* Hide default arrow */
.select-wrapper select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    width: 100%;
    padding: 12px 40px 12px 14px;

    background: linear-gradient(145deg, #1e293b, #0f172a);
    color: #e5e7eb;

    border: 1px solid #334155;
    border-radius: 10px;

    font-size: 14px;
    font-weight: 500;

    cursor: pointer;
    transition: all 0.2s ease;
}

/* Hover */
.select-wrapper select:hover {
    border-color: #0ea5e9;
}

/* Focus */
.select-wrapper select:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 2px rgba(14,165,233,0.3);
}

/* Custom arrow */
.select-wrapper::after {
    content: "▾";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    font-size: 14px;
}

/* Dropdown options (limited styling support) */
select option {
    background: #0f172a;
    color: #e5e7eb;
}