/* =====================================================
   SYSADMIN BOOK STORE - Admin Console Style
   ===================================================== */
:root {
    --sidebar-w: 248px;
    --bg-app: #f4f6fb;
    --bg-sidebar: #0f172a;
    --bg-sidebar-hover: #1e293b;
    --accent: #0ea5e9;
    --accent-soft: #e0f2fe;
    --text-muted: #64748b;
    --border: #e5e7eb;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --radius: 12px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    font-family: 'Inter', 'Sarabun', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background: var(--bg-app);
    color: #0f172a;
    margin: 0;
}

/* ---------- Layout shell ---------- */
.app-shell {
    display: flex;
    min-height: 100vh;
}
.app-sidebar {
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    color: #cbd5e1;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    transition: transform .25s ease;
}
.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* ---------- Sidebar ---------- */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 22px 16px;
    color: #fff;
    border-bottom: 1px solid #1e293b;
}
.sidebar-brand i { font-size: 28px; color: var(--accent); }
.brand-title { font-weight: 800; letter-spacing: 1px; line-height: 1; }
.brand-sub { font-size: 11px; color: #94a3b8; letter-spacing: 2px; }

.sidebar-menu {
    list-style: none;
    padding: 12px 12px 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}
.sidebar-menu li.menu-section {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 18px 14px 6px;
    font-weight: 600;
}
.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #cbd5e1;
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    margin: 2px 0;
    transition: all .15s ease;
}
.sidebar-menu a i { font-size: 18px; width: 22px; }
.sidebar-menu a:hover {
    background: var(--bg-sidebar-hover);
    color: #fff;
}
.sidebar-menu li.active > a {
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
    color: #fff;
    box-shadow: 0 4px 12px rgba(14,165,233,.35);
}
.sidebar-footer { padding: 16px 22px; border-top: 1px solid #1e293b; }

/* ---------- Topbar ---------- */
.topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    position: sticky;
    top: 0;
    z-index: 10;
}
.avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center; justify-content: center;
    font-weight: 700;
}

/* ---------- Content ---------- */
.app-content { padding: 24px; }

/* ---------- Cards / Stats ---------- */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.card-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}
.stat-card {
    border-radius: var(--radius);
    padding: 20px;
    background: #fff;
    border: 1px solid var(--border);
    display: flex; align-items: center; gap: 16px;
    transition: transform .15s ease, box-shadow .15s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15,23,42,.06);
}
.stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 26px;
}
.stat-icon.bg-primary-soft { background: var(--accent-soft); color: var(--accent); }
.stat-icon.bg-success-soft { background: #d1fae5; color: var(--success); }
.stat-icon.bg-warning-soft { background: #fef3c7; color: var(--warning); }
.stat-icon.bg-danger-soft  { background: #fee2e2; color: var(--danger); }
.stat-card .label { color: var(--text-muted); font-size: 13px; }
.stat-card .value { font-size: 26px; font-weight: 700; line-height: 1.1; }

/* ---------- Table ---------- */
.table { vertical-align: middle; }
.table thead th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    background: #f8fafc;
}
.code-pill {
    background: #0f172a;
    color: #e0f2fe;
    padding: 4px 10px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 12px;
}

/* ---------- Public Redeem Page ---------- */
.redeem-shell {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
.redeem-card {
    background: #fff;
    border-radius: 18px;
    padding: 36px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 30px 60px rgba(2,6,23,.45);
}
.redeem-brand {
    display: flex; align-items: center; gap: 10px;
    color: #0ea5e9; font-weight: 800; letter-spacing: 1px;
    margin-bottom: 24px;
}

/* ---------- Login Page ---------- */
.login-shell {
    min-height: 100vh;
    background: radial-gradient(at 20% 20%, #1e3a8a 0%, #0f172a 60%);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px rgba(2,6,23,.5);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .app-sidebar {
        position: fixed; left: 0; top: 0; z-index: 1000;
        transform: translateX(-100%);
    }
    .app-sidebar.open { transform: translateX(0); }
    .app-content { padding: 16px; }
}
