:root {
    --brand: #1f6feb;
    --brand-dark: #14233b;
    --sidebar-w: 250px;
    --topbar-h: 56px;
    --bg: #f4f6fa;
}

* { font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }

body { background: var(--bg); color: #1f2733; margin: 0; }

/* ---------- Top bar ---------- */
.topbar {
    position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h);
    background: var(--brand-dark); display: flex; align-items: center;
    justify-content: space-between; padding: 0 1rem; z-index: 1030;
}
.topbar .navbar-brand { color: #fff; letter-spacing: .2px; }
.btn-toggle { color: #cdd7e5; background: transparent; border: none; }
.btn-toggle:hover { color: #fff; }

/* ---------- Sidebar ---------- */
.app-body { display: flex; padding-top: var(--topbar-h); min-height: 100vh; }
.sidebar {
    width: var(--sidebar-w); background: #1b2638; color: #aeb9c9;
    position: fixed; top: var(--topbar-h); bottom: 0; left: 0; overflow-y: auto;
    transition: transform .2s ease; z-index: 1020; padding-bottom: 2rem;
}
.sidebar .nav-link {
    color: #aeb9c9; padding: .55rem 1.25rem; display: flex; align-items: center;
    gap: .7rem; font-size: .92rem; border-left: 3px solid transparent;
}
.sidebar .nav-link:hover { background: #232f44; color: #fff; }
.sidebar .nav-link.active { background: #232f44; color: #fff; border-left-color: var(--brand); }
.sidebar .nav-link i { width: 1.1rem; text-align: center; font-size: 1rem; }
.nav-section {
    text-transform: uppercase; font-size: .7rem; letter-spacing: .08em;
    color: #5d6b80; padding: 1rem 1.25rem .35rem; font-weight: 600;
}

/* ---------- Content ---------- */
.content { flex: 1; margin-left: var(--sidebar-w); padding: 1.5rem 1.75rem; transition: margin .2s ease; max-width: 100%; }

/* Collapsed (desktop) */
body.sidebar-collapsed .sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); }
body.sidebar-collapsed .content { margin-left: 0; }

/* Mobile: sidebar slides over content */
@media (max-width: 768px) {
    .sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); }
    .content { margin-left: 0; }
    body.sidebar-open .sidebar { transform: translateX(0); box-shadow: 0 0 30px rgba(0,0,0,.4); }
}

/* ---------- Cards / tables / buttons ---------- */
.card { border: none; border-radius: .6rem; }
.card .card-title { font-weight: 600; }
h4 { font-weight: 600; }
.table > thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: #6b7686; border-bottom-width: 2px; }
.table td { font-size: .9rem; }
.btn { border-radius: .45rem; }
.btn-primary { background: var(--brand); border-color: var(--brand); }
.dashboard-card { transition: transform .12s ease, box-shadow .12s ease; }
.dashboard-card:hover { transform: translateY(-2px); box-shadow: 0 .5rem 1rem rgba(0,0,0,.08) !important; }
.display-6 { font-weight: 700; }

/* ---------- Login page ---------- */
body.login-page { background: linear-gradient(135deg, #14233b 0%, #1f6feb 100%); min-height: 100vh; }
.login-shell { min-height: 100vh; width: 100%; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.login-card { width: 100%; max-width: 420px; border-radius: .75rem; }
.login-shell h3 { color: var(--brand-dark); font-weight: 700; }

/* DataTables tweaks */
.dataTables_wrapper .row { align-items: center; margin: 0; }
div.dataTables_filter input { border-radius: .45rem; }
