:root {
    --bg: #0B1220;
    --surface: #141C2E;
    --border: rgba(255,255,255,.08);
    --accent: #FF6A3D;
    --accent-hover: #FF8259;
    --text: #FFFFFF;
    --text-muted: rgba(255,255,255,.55);
    --success: #22C55E;
    --warning: #F5A524;
    --danger: #EF4444;
    --radius: 14px;
}
* { box-sizing: border-box; }
body {
    background: var(--bg); color: var(--text); margin: 0;
    font-family: -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--accent); }
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: var(--surface); border-right: 1px solid var(--border); padding: 20px 14px; flex-shrink: 0; }
.sidebar-brand { font-size: 20px; font-weight: 800; margin-bottom: 24px; padding: 0 8px; }
.sidebar-brand span { color: var(--accent); }
.sidebar-link {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
    color: var(--text-muted); text-decoration: none; font-size: 14px; font-weight: 600; margin-bottom: 2px;
}
.sidebar-link:hover { background: rgba(255,255,255,.05); color: var(--text); }
.sidebar-link.active { background: var(--accent); color: #fff; }
.main { flex: 1; padding: 28px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-card { display: flex; flex-direction: column; gap: 6px; }
.stat-value { font-size: 28px; font-weight: 800; }
.stat-label { font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.icon-badge {
    width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: #fff; margin-bottom: 10px;
}
.icon-badge-blue { background: linear-gradient(135deg, #3B82F6, #2563EB); }
.icon-badge-green { background: linear-gradient(135deg, #22C55E, #16A34A); }
.icon-badge-orange { background: linear-gradient(135deg, #FF8259, #FF6A3D); }
.icon-badge-purple { background: linear-gradient(135deg, #A78BFA, #7C3AED); }
.icon-badge-pink { background: linear-gradient(135deg, #F472B6, #DB2777); }
.avatar-badge {
    width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}
.gradient-stat {
    position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px; background: var(--surface);
}
.gradient-stat::before {
    content: ""; position: absolute; inset: 0; opacity: .16; z-index: 0;
}
.gradient-stat-blue::before { background: linear-gradient(135deg, #3B82F6, transparent 70%); }
.gradient-stat-orange::before { background: linear-gradient(135deg, #FF6A3D, transparent 70%); }
.gradient-stat-purple::before { background: linear-gradient(135deg, #7C3AED, transparent 70%); }
.gradient-stat-green::before { background: linear-gradient(135deg, #16A34A, transparent 70%); }
.gradient-stat > * { position: relative; z-index: 1; }
.quick-tile {
    display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent);
    text-decoration: none; color: var(--text);
}
.quick-tile:hover { background: rgba(255,255,255,.03); }
.quick-tile-label { font-weight: 700; font-size: 14px; }
.topbar-search {
    display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.04); border: 1px solid var(--border);
    border-radius: 10px; padding: 8px 14px; color: var(--text-muted); font-size: 13px; width: 260px;
}
.topbar-icon-btn {
    width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.04); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center; color: var(--text-muted); position: relative;
}
.topbar-icon-btn .dot { position: absolute; top: -2px; right: -2px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: 10px; border: none; font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.form-control {
    width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
    background: rgba(255,255,255,.04); color: var(--text); font-size: 14px;
}
.form-control:focus { outline: none; border-color: var(--accent); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-pending { background: rgba(245,165,36,.15); color: var(--warning); }
.badge-approved, .badge-resolved, .badge-checked_in { background: rgba(34,197,94,.15); color: var(--success); }
.badge-denied, .badge-closed { background: rgba(239,68,68,.15); color: var(--danger); }
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.flash-success { background: rgba(34,197,94,.12); color: var(--success); }
.flash-error { background: rgba(239,68,68,.12); color: var(--danger); }
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { max-width: 420px; width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; }

/* ---------- Responsive / mobile ---------- */
.mobile-menu-btn { display: none; background: none; border: none; color: var(--text); font-size: 22px; cursor: pointer; }
.sidebar-overlay { display: none; }

@media (max-width: 768px) {
    .app-shell { position: relative; overflow-x: hidden; }
    .sidebar {
        position: fixed; top: 0; left: 0; height: 100vh; z-index: 1000;
        transform: translateX(-100%); transition: transform .2s ease;
        width: 240px; max-width: 80vw; overflow-y: auto;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay {
        display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 999;
    }
    .sidebar-overlay.open { display: block; }
    .main { padding: 16px; width: 100%; }
    .mobile-menu-btn { display: inline-block; }
    .topbar { flex-wrap: wrap; gap: 10px; }
    .topbar-search { display: none; }

    /* Any grid that was hard-coded to 3-5 columns collapses to 1 on phones */
    [style*="grid-template-columns:repeat(3"],
    [style*="grid-template-columns:repeat(4"],
    [style*="grid-template-columns:repeat(5"],
    [style*="grid-template-columns: 1.5fr"],
    [style*="grid-template-columns:1.5fr"],
    [style*="grid-template-columns: 2fr"],
    [style*="grid-template-columns:2fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Tables scroll horizontally within their own card instead of
       breaking the page layout or hiding columns off-screen. */
    .card { overflow-x: auto; }
    table { min-width: 480px; }
}
