/* ============================================================
   PANEL ADMINISTRATIVO — Eggbrunch & Chill Queens
   Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
    --primary: #1E293B;
    --primary-light: #334155;
    --primary-hover: #475569;
    --accent: #2563EB;
    --accent-soft: #DBEAFE;
    --success: #059669;
    --success-bg: #D1FAE5;
    --danger: #DC2626;
    --danger-bg: #FEE2E2;
    --bg: #F7F8FA;
    --card: #FFFFFF;
    --text: #0F172A;
    --text-sec: #64748B;
    --text-muted: #94A3B8;
    --border: #E2E8F0;
    --sidebar-w: 220px;
}

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

body {
    font-family: 'DM Sans', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ---- LAYOUT ---- */
.layout { display: flex; min-height: 100vh; }

/* ---- SIDEBAR ---- */
.sidebar {
    width: var(--sidebar-w);
    background: var(--primary);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-logo {
    padding: 22px 18px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo-icon {
    width: 34px; height: 34px;
    border-radius: 8px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: white;
}

.sidebar-logo-text { color: white; font-size: 13px; font-weight: 700; }
.sidebar-logo-sub { color: rgba(255,255,255,0.4); font-size: 10px; font-weight: 500; }

.sidebar-nav { padding: 10px 8px; flex: 1; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border-radius: 7px;
    border: none;
    cursor: pointer;
    background: transparent;
    color: rgba(255,255,255,0.5);
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    margin-bottom: 2px;
    transition: all 0.15s;
}

.nav-item:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7); }
.nav-item.active { background: rgba(255,255,255,0.12); color: white; font-weight: 600; }

.nav-item-icon { font-size: 15px; width: 20px; text-align: center; }

.nav-sub {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px 8px 42px;
    border-radius: 7px;
    border: none;
    cursor: pointer;
    background: transparent;
    color: rgba(255,255,255,0.45);
    font-size: 12px;
    font-weight: 400;
    text-align: left;
    text-decoration: none;
    margin-bottom: 1px;
    transition: all 0.15s;
}

.nav-sub:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7); }
.nav-sub.active { background: rgba(255,255,255,0.12); color: white; font-weight: 600; }

.nav-module-header {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border-radius: 7px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.5);
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    margin-top: 4px;
}

.nav-module-header:hover { background: rgba(255,255,255,0.05); }
.nav-module-header .arrow { margin-left: auto; font-size: 10px; color: rgba(255,255,255,0.3); }

.nav-disabled {
    color: rgba(255,255,255,0.2) !important;
    cursor: default !important;
}
.nav-disabled:hover { background: transparent !important; color: rgba(255,255,255,0.2) !important; }

.nav-badge {
    margin-left: auto;
    font-size: 9px;
    color: rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.06);
    padding: 2px 6px;
    border-radius: 4px;
}

.sidebar-footer {
    padding: 14px 18px;
    border-top: 1px solid rgba(255,255,255,0.07);
}

.sync-status {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.sync-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #34D399;
}

.sync-text { color: rgba(255,255,255,0.5); font-size: 10px; }
.sync-date { color: rgba(255,255,255,0.25); font-size: 9px; }

/* ---- MAIN CONTENT ---- */
.main { flex: 1; margin-left: var(--sidebar-w); }

.topbar {
    padding: 14px 28px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title { font-size: 18px; font-weight: 700; color: var(--text); margin: 0; }
.topbar-subtitle { font-size: 11px; color: var(--text-sec); margin: 3px 0 0; }

.topbar-filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }

.filter-group { display: flex; flex-direction: column; gap: 3px; }
.filter-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.filter-select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card);
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    outline: none;
    min-width: 180px;
}

.filter-select:focus { border-color: var(--accent); }

.content { padding: 22px 28px; max-width: 1100px; }

/* ---- KPI CARDS ---- */
.kpi-row { display: flex; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }

.kpi-card {
    background: var(--card);
    border-radius: 12px;
    padding: 20px 22px;
    border: 1px solid var(--border);
    flex: 1;
    min-width: 175px;
}

.kpi-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}

.kpi-value { font-size: 26px; font-weight: 700; color: var(--text); }
.kpi-suffix { font-size: 16px; font-weight: 500; color: var(--text-sec); margin-left: 4px; }

.kpi-changes { margin-top: 10px; display: flex; gap: 10px; flex-wrap: wrap; }

.kpi-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

.kpi-badge.up { color: var(--success); background: var(--success-bg); }
.kpi-badge.down { color: var(--danger); background: var(--danger-bg); }

/* ---- CHART CARDS ---- */
.chart-card {
    background: var(--card);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

.chart-title { font-size: 15px; font-weight: 700; color: var(--text); }
.chart-subtitle { font-size: 12px; color: var(--text-sec); margin-top: 2px; }
.chart-header { margin-bottom: 16px; }
.chart-container { position: relative; width: 100%; }

/* ---- SECTION DIVIDER ---- */
.section-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 28px 0 20px;
}

.section-divider-text {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.section-divider-line { flex: 1; height: 1px; background: var(--border); }

/* ---- DATA TABLE ---- */
.data-table-wrap {
    background: var(--card);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 20px;
}

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }

.data-table thead tr { border-bottom: 2px solid var(--border); }

.data-table th {
    padding: 12px 14px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.data-table td {
    padding: 11px 14px;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover { background: var(--bg); }

.data-table .text-right { text-align: right; }
.data-table .text-left { text-align: left; }
.data-table .bold { font-weight: 600; }
.data-table .mono { font-variant-numeric: tabular-nums; }

.data-table .row-highlight { background: rgba(37, 99, 235, 0.04); }
.data-table .row-highlight td { font-weight: 700; color: var(--accent); }

.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

/* ---- LOGIN ---- */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}

.login-box {
    background: var(--card);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 380px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    justify-content: center;
}

.login-logo-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    color: white;
}

.login-logo-text { font-size: 18px; font-weight: 700; color: var(--text); }

.login-field { margin-bottom: 16px; }

.login-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-sec);
    margin-bottom: 6px;
}

.login-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 14px;
    color: var(--text);
    outline: none;
    font-family: inherit;
}

.login-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.login-btn {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: none;
    background: var(--accent);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    margin-top: 8px;
    transition: background 0.15s;
}

.login-btn:hover { background: #1D4ED8; }

.login-error {
    background: var(--danger-bg);
    color: var(--danger);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .sidebar { width: 100%; position: relative; height: auto; }
    .main { margin-left: 0; }
    .kpi-row { flex-direction: column; }
    .topbar { flex-direction: column; align-items: stretch; }
}
