/* =====================================================================
   SIPANDU CERDAS — Modern Admin Theme
   Modernized SARPRAS-style: light sidebar + top navbar + soft panels
   ===================================================================== */

:root {
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-primary-soft: #e0e9ff;
    --color-info: #0ea5e9;
    --color-info-soft: #cffafe;
    --color-success: #10b981;
    --color-success-soft: #d1fae5;
    --color-warning: #f59e0b;
    --color-warning-soft: #fef3c7;
    --color-danger: #ef4444;
    --color-danger-soft: #fee2e2;
    --color-pink: #ec4899;
    --color-pink-soft: #fce7f3;
    --color-purple: #8b5cf6;
    --color-purple-soft: #ede9fe;

    --color-bg: #f1f5f9;
    --color-card: #ffffff;
    --color-text: #0f172a;
    --color-muted: #64748b;
    --color-border: #e2e8f0;

    --sidebar-bg: #ffffff;
    --sidebar-border: #e2e8f0;
    --sidebar-fg: #475569;
    --sidebar-active: var(--color-primary);

    --sidebar-width: 264px;
    --sidebar-width-collapsed: 76px;
    --navbar-height: 60px;

    --shadow-card: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 18px rgba(15, 23, 42, .04);
    --shadow-pop: 0 8px 24px rgba(15, 23, 42, .08);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
}

html, body { height: 100%; }

body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
}

/* ---------- Auth pages ---------- */
.auth-body {
    min-height: 100vh;
    background: linear-gradient(160deg, #dbeafe 0%, #e0f2fe 40%, #f0f9ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.auth-wrapper { width: 100%; max-width: 440px; }
.auth-card {
    background: #fff;
    border-radius: 20px;
    padding: 40px 36px 36px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, .06), 0 1px 3px rgba(0, 0, 0, .04);
    border: 1px solid rgba(226, 232, 240, .6);
}
.auth-brand { text-align: center; margin-bottom: 28px; }
.auth-logo {
    width: 80px; height: 80px; border-radius: 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
    overflow: hidden;
}
.auth-logo img {
    width: 64px; height: 64px;
    object-fit: contain;
}
.auth-title {
    font-size: 22px;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 6px;
    letter-spacing: .3px;
}
.auth-subtitle {
    color: #64748b;
    font-size: 13px;
    margin: 0;
    line-height: 1.5;
}
.auth-footer {
    font-size: 12px;
    color: #94a3b8;
}

/* Auth form overrides */
.auth-card .form-label {
    font-weight: 600;
    color: #1e293b;
    font-size: 13.5px;
    margin-bottom: 6px;
}
.auth-card .form-control {
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    padding: .6rem .9rem;
    font-size: 14px;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}
.auth-card .form-control:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .1);
}
.auth-card .input-group-text {
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #94a3b8;
    font-size: 16px;
}

/* Captcha styling */
.captcha-box {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}
.captcha-question {
    background: #f1f5f9;
    padding: 10px 16px;
    font-weight: 700;
    font-size: 15px;
    color: #334155;
    white-space: nowrap;
    border-right: 1px solid #e2e8f0;
    letter-spacing: 1px;
}
.captcha-box .form-control {
    border: 0;
    border-radius: 0;
    box-shadow: none !important;
}
.captcha-box .form-control:focus {
    border: 0;
    box-shadow: none !important;
}
.captcha-hint {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 6px;
}

/* Login button gradient */
.btn-login {
    background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
    border: 0;
    color: #fff;
    border-radius: 12px;
    padding: .7rem 1rem;
    font-size: 15px;
    font-weight: 700;
    width: 100%;
    transition: opacity .2s, transform .05s;
    box-shadow: 0 4px 14px rgba(37, 99, 235, .25);
}
.btn-login:hover {
    opacity: .92;
    color: #fff;
}
.btn-login:active {
    transform: translateY(1px);
    color: #fff;
}

/* ---------- App shell ---------- */
.app-shell {
    display: flex;
    min-height: 100vh;
    background: var(--color-bg);
}

/* ---------- Sidebar ---------- */
.app-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-fg);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid var(--sidebar-border);
    transition: width .2s ease;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.app-sidebar::-webkit-scrollbar { width: 6px; }
.app-sidebar::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }

.app-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    height: var(--navbar-height);
    border-bottom: 1px solid var(--sidebar-border);
    color: var(--color-text);
}
.brand-logo {
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.brand-logo img {
    width: 44px; height: 44px;
    object-fit: contain;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-title { font-weight: 800; letter-spacing: .3px; line-height: 1.1; font-size: 15px; }
.brand-subtitle { font-size: 10px; color: var(--color-muted); text-transform: uppercase; letter-spacing: 1.5px; margin-top: 2px; }

/* User card on sidebar */
.app-sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px 12px;
    border-bottom: 1px solid var(--sidebar-border);
}
.app-sidebar-user .avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-warning) 0%, #fb923c 100%);
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}
.app-sidebar-user .info { min-width: 0; }
.app-sidebar-user .name { font-weight: 600; font-size: 13px; color: var(--color-text); line-height: 1.1; }
.app-sidebar-user .role { font-size: 11px; color: var(--color-muted); margin-top: 2px; }

/* Section heading */
.app-sidebar-heading {
    padding: 14px 22px 6px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #94a3b8;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Nav */
.app-sidebar-nav { padding: 4px 12px; flex: 1 0 auto; }
.app-sidebar-nav .nav { gap: 2px; }
.app-sidebar-nav .nav-link {
    color: var(--sidebar-fg);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13.5px;
    font-weight: 500;
    transition: background .15s, color .15s;
    position: relative;
}
.app-sidebar-nav .nav-link i.menu-icon {
    font-size: 17px;
    width: 22px;
    text-align: center;
    color: #94a3b8;
    flex-shrink: 0;
}
.app-sidebar-nav .nav-link:hover {
    background: #f1f5f9;
    color: var(--color-primary);
    text-decoration: none;
}
.app-sidebar-nav .nav-link:hover i.menu-icon { color: var(--color-primary); }
.app-sidebar-nav .nav-link.active {
    background: var(--color-primary-soft);
    color: var(--color-primary);
    font-weight: 600;
}
.app-sidebar-nav .nav-link.active i.menu-icon { color: var(--color-primary); }
.app-sidebar-nav .nav-link.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    height: 22px;
    width: 3px;
    background: var(--color-primary);
    border-radius: 0 3px 3px 0;
}
.app-sidebar-nav .menu-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-sidebar-nav .nav-link .badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 7px;
    line-height: 1;
    border-radius: 999px;
}
.app-sidebar-nav .menu-caret {
    margin-left: auto;
    font-size: 11px;
    color: #94a3b8;
    transition: transform .2s;
}
.app-sidebar-nav .nav-group.open > .nav-link .menu-caret {
    transform: rotate(90deg);
}
.app-sidebar-nav .submenu {
    list-style: none;
    padding: 2px 0 6px 36px;
    margin: 0 0 2px;
    display: none;
}
.app-sidebar-nav .nav-group.open > .submenu { display: block; }
.app-sidebar-nav .submenu .nav-link {
    padding: 7px 10px;
    font-size: 13px;
    font-weight: 400;
    color: #64748b;
    border-radius: var(--radius-sm);
}
.app-sidebar-nav .submenu .nav-link::before { content: none; }
.app-sidebar-nav .submenu .nav-link.active {
    background: transparent;
    color: var(--color-primary);
    font-weight: 600;
}
.app-sidebar-nav .submenu .nav-link.active::after {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--color-primary);
    transform: translateY(-50%);
}

/* Sidebar footer */
.app-sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--sidebar-border);
    margin-top: auto;
}
.btn-sidebar-collapse {
    background: #f1f5f9;
    color: var(--color-muted);
    border: 0;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 16px;
    width: 100%;
    transition: background .15s;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-sidebar-collapse:hover { background: #e2e8f0; color: var(--color-text); }
.btn-sidebar-collapse i { transition: transform .2s; }

/* Collapsed (rail) state on desktop */
.app-shell.sidebar-collapsed .app-sidebar { width: var(--sidebar-width-collapsed); }
.app-shell.sidebar-collapsed .app-sidebar .brand-text,
.app-shell.sidebar-collapsed .app-sidebar-user .info,
.app-shell.sidebar-collapsed .app-sidebar-heading,
.app-shell.sidebar-collapsed .app-sidebar-nav .menu-label,
.app-shell.sidebar-collapsed .app-sidebar-nav .menu-caret,
.app-shell.sidebar-collapsed .app-sidebar-nav .submenu,
.app-shell.sidebar-collapsed .btn-sidebar-collapse span { display: none !important; }
.app-shell.sidebar-collapsed .app-sidebar-brand { padding: 14px; justify-content: center; }
.app-shell.sidebar-collapsed .app-sidebar-user { justify-content: center; padding: 14px; }
.app-shell.sidebar-collapsed .app-sidebar-nav .nav-link {
    justify-content: center;
    padding: 10px 8px;
}
.app-shell.sidebar-collapsed .app-sidebar-nav .nav-link .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 9px;
    padding: 2px 5px;
}
.app-shell.sidebar-collapsed .btn-sidebar-collapse i { transform: rotate(180deg); }

/* ---------- Main area ---------- */
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---------- Top navbar ---------- */
.app-navbar {
    height: var(--navbar-height);
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    padding: 0 22px;
    display: flex; align-items: center; gap: 16px;
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 1px 0 rgba(15, 23, 42, .02);
}
.btn-sidebar-toggle {
    background: transparent;
    border: 0;
    color: var(--color-muted);
    width: 38px; height: 38px;
    border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 20px;
    transition: background .15s, color .15s;
}
.btn-sidebar-toggle:hover { background: #f1f5f9; color: var(--color-text); }

.app-navbar-title h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
    line-height: 1.1;
}
.app-navbar-title .breadcrumb-text {
    font-size: 12px;
    color: var(--color-muted);
    margin-left: 8px;
}

.app-navbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.navbar-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--color-primary);
    color: #fff;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

/* User dropdown */
.app-user-btn {
    text-decoration: none;
    color: inherit;
    padding: 6px 12px 6px 6px;
    border-radius: 999px;
    background: transparent;
    border: 1px solid transparent;
    transition: background .15s, border-color .15s;
}
.app-user-btn:hover { background: #f8fafc; border-color: var(--color-border); }
.app-user-btn::after { display: none; }
.app-user-btn .user-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), #60a5fa);
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}
.app-user-btn .user-meta .name {
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.1;
    font-size: 13px;
}
.app-user-btn .user-meta .role {
    font-size: 11px;
    color: var(--color-muted);
}
.app-user-btn .caret {
    margin-left: 4px;
    color: #94a3b8;
    font-size: 12px;
    transition: transform .2s;
}
.app-user-btn[aria-expanded="true"] .caret { transform: rotate(180deg); }

.dropdown-menu {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-pop);
    padding: 8px;
}
.dropdown-menu .dropdown-item {
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 13px;
}
.dropdown-menu .dropdown-item:hover { background: var(--color-primary-soft); color: var(--color-primary); }
.dropdown-menu .dropdown-item.text-danger:hover { background: var(--color-danger-soft); color: var(--color-danger); }
.dropdown-divider { margin: 6px 0; border-color: var(--color-border); }
.dropdown-item-text { padding: 4px 12px; font-size: 12px; }

/* ---------- Page header ---------- */
.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}
.page-header h1.page-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    color: var(--color-text);
    line-height: 1.1;
}
.page-header .page-subtitle {
    font-size: 13px;
    color: var(--color-muted);
    margin-left: 10px;
    font-weight: 400;
}
.page-header .page-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12px;
    color: var(--color-muted);
    box-shadow: var(--shadow-card);
}
.page-header .page-meta i { color: var(--color-primary); }

/* ---------- Footer ---------- */
.app-footer {
    background: transparent;
    color: var(--color-muted);
    font-size: 12px;
    padding: 18px 22px;
}

/* ---------- Cards / Panels ---------- */
.card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    background: #fff;
}
.card-header {
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    padding: 14px 20px;
    font-weight: 600;
    font-size: 14px;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 10px;
}
.card-header > .card-tools {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.card-header > .card-tools .btn-tool {
    width: 26px; height: 26px;
    border-radius: 7px;
    background: transparent;
    color: #94a3b8;
    border: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px;
    transition: background .15s, color .15s;
}
.card-header > .card-tools .btn-tool:hover {
    background: #f1f5f9;
    color: var(--color-text);
}
.card-body { padding: 18px 20px; }

/* ---------- Buttons ---------- */
.btn {
    border-radius: 10px;
    font-weight: 600;
    padding: .5rem .95rem;
    font-size: 13px;
    transition: background .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: .35rem .7rem; font-size: 12px; border-radius: 8px; }
.btn-primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, .18);
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
}
.btn-outline-primary { color: var(--color-primary); border-color: var(--color-primary); }
.btn-outline-primary:hover { background: var(--color-primary); border-color: var(--color-primary); }
.btn-link { color: var(--color-primary); text-decoration: none; }
.btn-link:hover { color: var(--color-primary-hover); text-decoration: underline; }

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-hover); text-decoration: underline; }

/* ---------- Stat cards ---------- */
.stat-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 18px 22px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: relative;
    overflow: hidden;
    min-height: 90px;
    transition: transform .15s, box-shadow .15s;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(15, 23, 42, .08);
}
.stat-card .stat-meta { display: flex; flex-direction: column; min-width: 0; }
.stat-card .label {
    color: var(--color-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}
.stat-card .value {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.1;
    margin-top: 4px;
    color: var(--color-text);
}
.stat-card .desc {
    font-size: 12px;
    color: var(--color-muted);
    margin-top: 4px;
}
.stat-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 26px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .12);
}
.stat-icon.bg-primary-grad   { background: linear-gradient(135deg, var(--color-primary) 0%, #60a5fa 100%); }
.stat-icon.bg-info-grad      { background: linear-gradient(135deg, var(--color-info) 0%, #38bdf8 100%); }
.stat-icon.bg-success-grad   { background: linear-gradient(135deg, var(--color-success) 0%, #34d399 100%); }
.stat-icon.bg-warning-grad   { background: linear-gradient(135deg, var(--color-warning) 0%, #fbbf24 100%); }
.stat-icon.bg-danger-grad    { background: linear-gradient(135deg, var(--color-danger) 0%, #f87171 100%); }
.stat-icon.bg-pink-grad      { background: linear-gradient(135deg, var(--color-pink) 0%, #f472b6 100%); }
.stat-icon.bg-purple-grad    { background: linear-gradient(135deg, var(--color-purple) 0%, #a78bfa 100%); }

.stat-icon.bg-primary-soft { background: var(--color-primary-soft); color: var(--color-primary); box-shadow: none; }
.stat-icon.bg-success-soft { background: var(--color-success-soft); color: var(--color-success); box-shadow: none; }
.stat-icon.bg-warning-soft { background: var(--color-warning-soft); color: var(--color-warning); box-shadow: none; }
.stat-icon.bg-danger-soft  { background: var(--color-danger-soft); color: var(--color-danger); box-shadow: none; }

/* ---------- Hero / welcome banner ---------- */
.welcome-banner {
    background: linear-gradient(135deg, #2563eb 0%, #6366f1 60%, #8b5cf6 100%);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 22px 26px;
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
    position: relative;
    overflow: hidden;
}
.welcome-banner::after {
    content: '';
    position: absolute;
    inset: auto -40px -60px auto;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
}
.welcome-banner .greet { font-size: 12px; opacity: .85; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700; }
.welcome-banner h2 { font-size: 22px; font-weight: 800; margin: 4px 0 4px; }
.welcome-banner p { font-size: 13px; opacity: .9; margin: 0; }
.welcome-banner .icon-wrap {
    width: 64px; height: 64px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .18);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 30px;
    backdrop-filter: blur(4px);
    flex-shrink: 0;
}
.welcome-banner .badge {
    background: rgba(255, 255, 255, .2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .35);
}
.welcome-banner .info > div { position: relative; z-index: 1; }
.welcome-banner .actions { position: relative; z-index: 1; display: flex; gap: 8px; flex-wrap: wrap; }
.welcome-banner .btn { background: rgba(255, 255, 255, .22); border-color: rgba(255, 255, 255, .35); color: #fff; }
.welcome-banner .btn:hover { background: rgba(255, 255, 255, .35); color: #fff; }

/* ---------- Tables / DataTables ---------- */
.table { vertical-align: middle; color: var(--color-text); margin-bottom: 0; }
.table > :not(caption) > * > * { padding: 12px 14px; }
.table > thead > tr > th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 1px solid var(--color-border);
}
.table > tbody > tr { border-color: var(--color-border); }
.table > tbody > tr:hover { background: #f8fafc; }
.table-bordered > :not(caption) > * { border-color: var(--color-border); }

table.dataTable thead th {
    background: #f8fafc !important;
    color: #475569 !important;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: .5px;
    border-bottom-color: var(--color-border) !important;
}
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border-radius: 8px;
    border: 1px solid var(--color-border);
    padding: 5px 12px;
    background: #fff;
    font-size: 13px;
}
.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 8px !important;
    margin: 0 2px;
    padding: 4px 10px !important;
    border: 1px solid var(--color-border) !important;
    background: #fff !important;
    color: var(--color-text) !important;
    font-size: 12px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--color-primary-soft) !important;
    border-color: var(--color-primary-soft) !important;
    color: var(--color-primary) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
    color: #fff !important;
}
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    margin-top: 14px;
    padding: 0 4px;
    font-size: 12.5px;
    color: var(--color-muted);
}
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_length { padding: 0 4px; margin-bottom: 12px; font-size: 12.5px; color: var(--color-muted); }

/* ---------- Badges ---------- */
.badge {
    font-weight: 600;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    letter-spacing: .2px;
}
.badge.bg-primary { background-color: var(--color-primary) !important; }
.badge.bg-success { background-color: var(--color-success) !important; }
.badge.bg-warning { background-color: var(--color-warning) !important; color: #fff !important; }
.badge.bg-danger  { background-color: var(--color-danger) !important; }
.badge.bg-info    { background-color: var(--color-info) !important; }
.badge.bg-secondary { background-color: #94a3b8 !important; }

/* ---------- Forms ---------- */
.form-label { font-weight: 600; color: #334155; font-size: 13px; }
.form-control, .form-select {
    border-radius: 9px;
    border: 1px solid var(--color-border);
    padding: .55rem .85rem;
    font-size: 13.5px;
    color: var(--color-text);
    background: #fff;
}
.form-control:focus, .form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
.input-group-text {
    border-radius: 9px;
    background: #f8fafc;
    border-color: var(--color-border);
    color: var(--color-muted);
    font-size: 13px;
}

/* ---------- Alerts ---------- */
.alert {
    border-radius: var(--radius);
    border: 1px solid transparent;
    padding: 12px 16px;
    font-size: 13.5px;
}
.alert-success { background: var(--color-success-soft); color: #065f46; border-color: #a7f3d0; }
.alert-danger  { background: var(--color-danger-soft); color: #991b1b; border-color: #fecaca; }
.alert-warning { background: var(--color-warning-soft); color: #92400e; border-color: #fde68a; }
.alert-info    { background: var(--color-info-soft); color: #155e75; border-color: #a5f3fc; }

/* ---------- Photo preview / gallery ---------- */
.photo-preview {
    width: 100%;
    max-width: 280px;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px dashed var(--color-border);
}
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}
.photo-gallery .photo-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 4 / 3;
    border: 1px solid var(--color-border);
    background: #f1f5f9;
}
.photo-gallery .photo-item img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .2s;
}
.photo-gallery .photo-item:hover img { transform: scale(1.04); }
.photo-gallery .photo-item .photo-actions {
    position: absolute; inset: auto 0 0 0;
    padding: 6px 8px;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.6) 100%);
    display: flex; gap: 4px; justify-content: flex-end;
}

/* ---------- Filter bar ---------- */
.filter-bar {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-card);
}

/* ---------- Util ---------- */
.text-primary-soft { color: var(--color-primary); }
.bg-primary-soft { background: var(--color-primary-soft); }

/* ---------- Mobile responsive ---------- */
@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed; left: -300px; z-index: 1050;
        transition: left .25s ease;
        height: 100vh;
    }
    .app-shell.sidebar-open .app-sidebar { left: 0; box-shadow: 0 0 30px rgba(0,0,0,.2); }
    .app-shell.sidebar-open::before {
        content: ''; position: fixed; inset: 0; background: rgba(15, 23, 42, .55);
        z-index: 1040;
        backdrop-filter: blur(2px);
    }
    .app-shell.sidebar-collapsed .app-sidebar { width: var(--sidebar-width); }
    .app-shell.sidebar-collapsed .app-sidebar-nav .nav-link { justify-content: flex-start; padding: 9px 12px; }
    .app-shell.sidebar-collapsed .brand-text,
    .app-shell.sidebar-collapsed .app-sidebar-user .info,
    .app-shell.sidebar-collapsed .app-sidebar-heading,
    .app-shell.sidebar-collapsed .app-sidebar-nav .menu-label,
    .app-shell.sidebar-collapsed .app-sidebar-nav .menu-caret,
    .app-shell.sidebar-collapsed .app-sidebar-nav .submenu,
    .app-shell.sidebar-collapsed .btn-sidebar-collapse span { display: revert !important; }
    .app-shell.sidebar-collapsed .btn-sidebar-collapse i { transform: none; }
}

@media (max-width: 767.98px) {
    body { font-size: 13.5px; }
    .stat-card { padding: 14px 16px; gap: 10px; min-height: 76px; }
    .stat-icon { width: 44px; height: 44px; font-size: 20px; border-radius: 12px; }
    .stat-card .value { font-size: 22px; }
    .stat-card .label { font-size: 10px; }

    .app-navbar { padding: 0 12px; gap: 8px; }
    .app-navbar-title h1 { font-size: 14px; }
    .app-navbar-title .breadcrumb-text { display: none; }

    .page-header { margin-bottom: 12px; }
    .page-header h1.page-title { font-size: 18px; }
    .page-header .page-subtitle { display: block; margin-left: 0; margin-top: 2px; }

    .card-header { padding: 12px 14px; font-size: 13px; }
    .card-body { padding: 14px 16px; }
    main.container-fluid { padding-left: 14px !important; padding-right: 14px !important; padding-top: 18px !important; }

    .table { font-size: 13px; }
    .table > :not(caption) > * > * { padding: 9px 11px; }

    h2.h5 { font-size: 16px; }

    .photo-gallery {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 8px;
    }

    .welcome-banner { padding: 16px 18px; gap: 12px; }
    .welcome-banner h2 { font-size: 18px; }
    .welcome-banner .icon-wrap { width: 50px; height: 50px; font-size: 24px; }

    .app-user-btn .user-meta { display: none !important; }
}

@media (max-width: 575.98px) {
    .btn { padding: .45rem .8rem; font-size: 12.5px; }
    .btn-sm { padding: .3rem .6rem; font-size: 11.5px; }
    .badge { padding: 4px 8px; font-size: 10px; }
    .navbar-pill { display: none; }
}

/* ---------- Sarpras By Sekolah: folder button ---------- */
.btn-folder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--color-success) 0%, #34d399 100%);
    color: #fff;
    font-size: 18px;
    border: 0;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(16, 185, 129, .25);
    transition: transform .15s, box-shadow .15s, filter .15s;
}
.btn-folder:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, .35);
    filter: brightness(1.05);
}
.btn-folder:active { transform: translateY(0); }

/* ---------- Sidebar: menu badge (DETAIL pill) ---------- */
.app-sidebar-nav .menu-badge {
    background: var(--color-success);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .04em;
    padding: 3px 7px;
    line-height: 1;
    border-radius: 6px;
    margin-right: 6px;
    text-transform: uppercase;
}

/* ---------- Sarpras detail tabs ---------- */
.sarpras-tabs.nav-tabs {
    border-bottom: 1px solid var(--color-border);
    gap: 2px;
}
.sarpras-tabs.nav-tabs .nav-link {
    border: 0;
    border-radius: 10px 10px 0 0;
    color: var(--color-text);
    font-weight: 500;
    padding: 10px 14px;
    background: transparent;
    transition: background .15s, color .15s;
}
.sarpras-tabs.nav-tabs .nav-link:hover {
    background: var(--color-primary-soft);
    color: var(--color-primary);
}
.sarpras-tabs.nav-tabs .nav-link.active {
    background: #fff;
    color: var(--color-primary);
    font-weight: 600;
    border-bottom: 2px solid var(--color-primary);
    box-shadow: 0 -2px 6px rgba(15, 23, 42, .04);
}

/* ---------- Print friendly ---------- */
@media print {
    .app-sidebar, .app-navbar, .btn, .filter-bar, .app-footer { display: none !important; }
    .app-shell { display: block; }
    .app-main { width: 100%; }
    .card { box-shadow: none; border-color: #ddd; }
    body { background: #fff; }
}
