/* ═══════════════════════════════════════════════════════════════
   Super Admin Panel — Design Tokens & Layout
   Theme: Dark with Blue accent (#1E40AF) instead of Orange
   ═══════════════════════════════════════════════════════════════ */

:root {
    --sa-bg-page: #0A0A0B;
    --sa-bg-elevated: #1A1A1D;
    --sa-bg-interactive: #2A2A2E;
    --sa-bg-hover: #333338;
    --sa-border: #2A2A2E;
    --sa-border-subtle: #1F1F23;

    --sa-text-primary: #FAFAFA;
    --sa-text-secondary: #A1A1AA;
    --sa-text-tertiary: #71717A;

    --sa-blue-primary: #1E40AF;
    --sa-blue-light: #3B82F6;
    --sa-blue-dark: #1E3A8A;
    --sa-blue-bg: rgba(30, 64, 175, 0.12);

    --sa-success: #22C55E;
    --sa-warning: #F59E0B;
    --sa-danger: #EF4444;
    --sa-info: #3B82F6;

    --sa-sidebar-width: 260px;
}

/* ── LAYOUT ── */
.sa-layout {
    display: flex;
    min-height: 100vh;
    background: var(--sa-bg-page);
    color: var(--sa-text-primary);
}

/* ── SIDEBAR ── */
.sa-sidebar {
    width: var(--sa-sidebar-width);
    min-height: 100vh;
    background: var(--sa-bg-elevated);
    border-right: 1px solid var(--sa-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
}

.sa-sidebar__logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    border-bottom: 1px solid var(--sa-border);
}

.sa-sidebar__logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--sa-blue-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sa-sidebar__logo-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--sa-text-primary);
    display: block;
}

.sa-sidebar__logo-sub {
    font-size: 11px;
    color: var(--sa-blue-light);
    font-weight: 500;
    display: block;
}

/* ── NAV ── */
.sa-sidebar__nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 8px;
}

.sa-nav-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sa-text-tertiary);
    padding: 16px 12px 6px;
}

.sa-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--sa-text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s ease;
    margin-bottom: 2px;
}

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

.sa-nav-item--active {
    background: var(--sa-blue-bg) !important;
    color: var(--sa-blue-light) !important;
}

.sa-nav-item i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ── USER ── */
.sa-sidebar__user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    border-top: 1px solid var(--sa-border);
}

.sa-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--sa-blue-bg);
    color: var(--sa-blue-light);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sa-user-info {
    flex: 1;
    min-width: 0;
}

.sa-user-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--sa-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sa-user-role {
    display: block;
    font-size: 11px;
    color: var(--sa-blue-light);
}

.sa-sidebar__user button {
    background: none;
    border: none;
    color: var(--sa-text-tertiary);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.sa-sidebar__user button:hover {
    background: var(--sa-bg-interactive);
    color: var(--sa-danger);
}

/* ── MAIN ── */
.sa-main {
    flex: 1;
    margin-left: var(--sa-sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── MOBILE ── */
.sa-mobile-bar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--sa-bg-elevated);
    border-bottom: 1px solid var(--sa-border);
}

.sa-mobile-bar__title {
    font-size: 15px;
    font-weight: 700;
}

.sa-mobile-toggle {
    background: none;
    border: none;
    color: var(--sa-text-primary);
    cursor: pointer;
    padding: 6px;
}

.sa-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

/* ── TOPBAR ── */
.sa-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px 0;
    gap: 16px;
    flex-wrap: wrap;
}

.sa-topbar__left { flex: 1; min-width: 200px; }

.sa-topbar__title {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    color: var(--sa-text-primary);
}

.sa-topbar__subtitle {
    font-size: 13px;
    color: var(--sa-text-tertiary);
    margin: 4px 0 0;
}

.sa-topbar__right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── CONTENT ── */
.sa-content {
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ── KPI CARDS ── */
.sa-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.sa-kpi-card {
    background: var(--sa-bg-elevated);
    border: 1px solid var(--sa-border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sa-kpi-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sa-kpi-card__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sa-kpi-card__icon i {
    width: 20px;
    height: 20px;
}

.sa-kpi-card__value {
    font-size: 28px;
    font-weight: 800;
    color: var(--sa-text-primary);
    line-height: 1;
}

.sa-kpi-card__label {
    font-size: 12px;
    color: var(--sa-text-tertiary);
    font-weight: 500;
}

.sa-kpi-card__change {
    font-size: 12px;
    font-weight: 600;
}

.sa-kpi-card__change--up { color: var(--sa-success); }
.sa-kpi-card__change--down { color: var(--sa-danger); }

/* ── PANELS ── */
.sa-panel {
    background: var(--sa-bg-elevated);
    border: 1px solid var(--sa-border);
    border-radius: 12px;
    overflow: hidden;
}

.sa-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--sa-border);
}

.sa-panel__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--sa-text-primary);
    margin: 0;
}

.sa-panel__body {
    padding: 20px;
}

/* ── BUTTONS ── */
.sa-btn-primary {
    background: var(--sa-blue-primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s ease;
}

.sa-btn-primary:hover {
    background: var(--sa-blue-light);
}

.sa-btn-outline {
    background: transparent;
    color: var(--sa-text-secondary);
    border: 1px solid var(--sa-border);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.sa-btn-outline:hover {
    background: var(--sa-bg-interactive);
    color: var(--sa-text-primary);
}

.sa-icon-btn {
    background: none;
    border: 1px solid var(--sa-border);
    color: var(--sa-text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sa-icon-btn:hover {
    background: var(--sa-bg-interactive);
    color: var(--sa-text-primary);
}

/* ── SEARCH ── */
.sa-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--sa-bg-interactive);
    border: 1px solid var(--sa-border);
    border-radius: 8px;
    padding: 0 12px;
    min-width: 240px;
}

.sa-search i {
    width: 16px;
    height: 16px;
    color: var(--sa-text-tertiary);
}

.sa-search input {
    background: none;
    border: none;
    color: var(--sa-text-primary);
    font-size: 13px;
    padding: 8px 0;
    width: 100%;
    outline: none;
}

.sa-search input::placeholder {
    color: var(--sa-text-tertiary);
}

/* ── BADGES ── */
.sa-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.sa-badge--success { background: rgba(34,197,94,0.12); color: #22C55E; }
.sa-badge--warning { background: rgba(245,158,11,0.12); color: #F59E0B; }
.sa-badge--danger { background: rgba(239,68,68,0.12); color: #EF4444; }
.sa-badge--info { background: rgba(59,130,246,0.12); color: #3B82F6; }
.sa-badge--neutral { background: var(--sa-bg-interactive); color: var(--sa-text-secondary); }

/* ── TABLE ── */
.sa-table {
    width: 100%;
    border-collapse: collapse;
}

.sa-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--sa-text-tertiary);
    padding: 12px 16px;
    border-bottom: 1px solid var(--sa-border);
}

.sa-table td {
    padding: 14px 16px;
    font-size: 13px;
    color: var(--sa-text-secondary);
    border-bottom: 1px solid var(--sa-border-subtle);
}

.sa-table tr:hover td {
    background: var(--sa-bg-interactive);
}

.sa-table td:first-child {
    color: var(--sa-text-primary);
    font-weight: 500;
}

/* ── EMPTY STATE ── */
.sa-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--sa-text-tertiary);
}

.sa-empty__icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--sa-bg-interactive);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

/* ── TABS ── */
.sa-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--sa-border);
    padding: 0 20px;
}

.sa-tab {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--sa-text-tertiary);
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
}

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

.sa-tab--active {
    color: var(--sa-blue-light);
    border-bottom-color: var(--sa-blue-light);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .sa-sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    .sa-sidebar--open {
        transform: translateX(0);
    }

    .sa-sidebar--open + .sa-sidebar-overlay {
        display: block;
    }

    .sa-main {
        margin-left: 0;
    }

    .sa-mobile-bar {
        display: flex;
    }

    .sa-topbar {
        padding: 16px 16px 0;
    }

    .sa-content {
        padding: 16px;
    }

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