/* ===== Variables ===== */
:root {
    --sidebar-width: 220px;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #0d6efd;
    --topbar-height: 56px;
    --body-bg: #f1f5f9;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ===== Reset ===== */
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
       background: var(--body-bg); font-size: 14px; }

/* ===== Sidebar ===== */
.wrapper { display: flex; min-height: 100vh; }
.main-sidebar {
    width: var(--sidebar-width); background: var(--sidebar-bg);
    color: #cbd5e1; display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 1000;
    transition: transform 0.3s;
}
.sidebar-brand {
    height: var(--topbar-height); display: flex; align-items: center;
    gap: 10px; padding: 0 16px; font-size: 16px; font-weight: 700; color: #fff;
    border-bottom: 1px solid #334155;
}
.brand-icon { font-size: 24px; color: var(--sidebar-active); }
.sidebar-nav { padding: 12px 0; flex: 1; overflow-y: auto; }
.sidebar-nav .nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 20px; color: #94a3b8; text-decoration: none;
    font-size: 13.5px; transition: all 0.15s; border-left: 3px solid transparent;
}
.sidebar-nav .nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-nav .nav-item.active {
    background: rgba(13,110,253,0.15); color: #fff;
    border-left-color: var(--sidebar-active);
}
.sidebar-nav .nav-item i { font-size: 18px; width: 22px; text-align: center; }

/* ===== Main Content ===== */
.main-content {
    margin-left: var(--sidebar-width); flex: 1; min-height: 100vh;
    display: flex; flex-direction: column;
}
.top-bar {
    height: var(--topbar-height); background: #fff;
    display: flex; align-items: center; padding: 0 20px;
    border-bottom: 1px solid #e2e8f0; position: sticky; top: 0; z-index: 100;
}
.btn-toggle-sidebar {
    background: none; border: none; font-size: 20px;
    color: #64748b; cursor: pointer; margin-right: 12px;
}
.top-bar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.admin-name { color: #64748b; font-size: 13px; }
.content-wrapper { padding: 24px; flex: 1; }

/* ===== Page Header ===== */
.page-header { margin-bottom: 20px; }
.page-header h3 { margin: 0 0 2px 0; font-weight: 700; font-size: 20px; }

/* ===== Stat Cards ===== */
.stat-card {
    background: #fff; border-radius: 10px; padding: 20px;
    display: flex; align-items: center; gap: 16px;
    box-shadow: var(--card-shadow); transition: transform 0.15s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-icon {
    width: 48px; height: 48px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: #fff;
}
.stat-value { font-size: 24px; font-weight: 700; color: #1e293b; }
.stat-label { font-size: 12px; color: #94a3b8; margin-top: 2px; }

.stat-primary .stat-icon { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.stat-success .stat-icon { background: linear-gradient(135deg, #22c55e, #16a34a); }
.stat-warning .stat-icon { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-info .stat-icon { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.stat-danger .stat-icon { background: linear-gradient(135deg, #ef4444, #dc2626); }
.stat-purple .stat-icon { background: linear-gradient(135deg, #a855f7, #7c3aed); }
.stat-cyan .stat-icon { background: linear-gradient(135deg, #67e8f9, #06b6d4); }
.stat-orange .stat-icon { background: linear-gradient(135deg, #fb923c, #ea580c); }

/* ===== Cards ===== */
.card { border: none; border-radius: 10px; box-shadow: var(--card-shadow); }
.card-header { font-weight: 600; font-size: 14px; background: #fff; border-bottom: 1px solid #f1f5f9; }

/* ===== Table ===== */
.table { font-size: 13px; }
.table th { font-weight: 600; color: #64748b; font-size: 12px; text-transform: uppercase; letter-spacing: 0.3px; border-bottom-width: 1px; }
.table td { vertical-align: middle; }
.card-key-cell { font-size: 12px; cursor: pointer; }

/* ===== Login Page ===== */
.login-page { background: var(--sidebar-bg); }
.login-container { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card {
    background: #fff; border-radius: 16px; padding: 40px;
    width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-header { text-align: center; margin-bottom: 30px; }
.login-logo { font-size: 48px; color: var(--sidebar-active); }
.login-header h2 { margin: 12px 0 4px; font-weight: 700; }
.login-footer { text-align: center; margin-top: 20px; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .main-sidebar { transform: translateX(-100%); }
    .main-sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .content-wrapper { padding: 16px; }
}

/* ===== Toast ===== */
.toast-container { z-index: 9999; }

/* ===== Misc ===== */
code { font-size: 12px; }
.badge { font-weight: 500; }
.pagination { margin: 0; }
