/* ==========================================================
   style.css - tema tampilan aplikasi
   ========================================================== */
:root {
    --primary: #1D4ED8;
    --primary-dark: #1E3A8A;
    --accent: #FACC15;
    --body-bg: #F3F6FC;
    --font: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-head: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --sidebar-bg: #0B1736;
    --nav-bg: #1E3A8A;
    --sidebar-text: rgba(255,255,255,.78);
    --sidebar-strong: #ffffff;
    --sidebar-muted: rgba(255,255,255,.45);
    --sidebar-hover: rgba(255,255,255,.08);
    --sidebar-border: rgba(255,255,255,.08);
}

body {
    background: var(--body-bg);
    color: #1f2937;
    font-family: var(--font);
    font-size: .94rem;
}
h1, h2, h3, .h4, .stat-value, .brand strong { font-family: var(--font-head); }

.btn-primary { --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary); --bs-btn-hover-bg: var(--primary-dark); --bs-btn-hover-border-color: var(--primary-dark); --bs-btn-active-bg: var(--primary-dark); --bs-btn-active-border-color: var(--primary-dark); }
.btn-outline-primary { --bs-btn-color: var(--primary); --bs-btn-border-color: var(--primary); --bs-btn-hover-bg: var(--primary); --bs-btn-hover-border-color: var(--primary); --bs-btn-active-bg: var(--primary-dark); }
.page-link { color: var(--primary); }
.page-item.active .page-link { background: var(--primary); border-color: var(--primary); }
a { color: var(--primary); }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--primary) 20%, transparent); }

/* ---------- Layout sidebar ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 250px; flex-shrink: 0; background: var(--sidebar-bg); color: var(--sidebar-text);
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 1040;
    border-right: 1px solid var(--sidebar-border);
}
.sidebar .brand { display: flex; gap: .7rem; align-items: center; padding: 1.25rem 1.2rem; border-bottom: 1px solid var(--sidebar-border); }
.sidebar .brand img { width: 40px; height: 40px; }
.sidebar .brand strong { display: block; font-size: 1.08rem; line-height: 1.1; color: var(--sidebar-strong); }
.sidebar .brand small { color: var(--sidebar-muted); font-size: .74rem; }
.sidebar .nav { padding: .8rem .7rem; }
.sidebar .nav-section { text-transform: uppercase; font-size: .68rem; letter-spacing: .08em; color: var(--sidebar-muted); margin: 1rem .6rem .35rem; }
.sidebar .nav-link { color: var(--sidebar-text); border-radius: .5rem; padding: .55rem .8rem; display: flex; gap: .65rem; align-items: center; margin-bottom: 2px; }
.sidebar .nav-link:hover { background: var(--sidebar-hover); color: var(--sidebar-strong); }
.sidebar .nav-link.active { background: var(--primary); color: #fff; box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 35%, transparent); }
.sidebar-foot { margin-top: auto; padding: .7rem; border-top: 1px solid var(--sidebar-border); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    display: flex; align-items: center; gap: .8rem; padding: .8rem 1.5rem; background: #fff;
    border-bottom: 1px solid #e5e7eb; position: sticky; top: 0; z-index: 1030;
}
.topbar-title { font-weight: 600; font-size: 1.05rem; }
.clock { font-size: .85rem; color: #6b7280; font-variant-numeric: tabular-nums; }
.content { padding: 1.5rem; flex: 1; }
.app-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; padding: .9rem 1.5rem; font-size: .8rem; color: #6b7280; border-top: 1px solid #e5e7eb; background: #fff; }
.js-off { color: #b91c1c; }
.js-on { color: #15803d; }
.sidebar-backdrop { display: none; }

@media (max-width: 991.98px) {
    .sidebar { position: fixed; left: -260px; transition: left .25s; }
    body.sidebar-open .sidebar { left: 0; }
    body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 1035; }
    .content { padding: 1rem; }
    .topbar { padding: .7rem 1rem; }
}

/* ---------- Layout topnav ---------- */
.layout-topnav .app-navbar { background: var(--nav-bg); box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.layout-topnav .app-navbar .nav-link { color: rgba(255,255,255,.82); }
.layout-topnav .app-navbar .nav-link.active, .layout-topnav .app-navbar .nav-link:hover { color: #fff; }
.layout-topnav .dropdown-item.active { background: var(--primary); }
.page-band { background: linear-gradient(120deg, var(--primary), var(--primary-dark)); color: #fff; padding: 1.4rem 0 3.6rem; }
.page-band-title { font-size: 1.45rem; margin: 0; }
.layout-topnav .content { margin-top: -2.6rem; padding: 0 .75rem 1.5rem; }
.layout-topnav .app-footer { background: transparent; border: 0; }

/* ---------- Komponen ---------- */
.welcome {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    background: linear-gradient(120deg, var(--primary), var(--primary-dark)); color: #fff;
    border-radius: 1rem; padding: 1.4rem 1.6rem; margin-bottom: 1.2rem; overflow: hidden;
}
.welcome h2 { font-size: 1.35rem; margin: 0 0 .25rem; }
.welcome p { margin: 0; opacity: .88; }
.welcome-icon { font-size: 3.6rem; opacity: .35; }
.layout-topnav .welcome { background: #fff; color: #1f2937; border: 1px solid #e5e7eb; }
.layout-topnav .welcome-icon { color: var(--primary); opacity: .5; }

.stat-card { background: #fff; border-radius: .9rem; padding: 1.05rem 1.1rem; display: flex; gap: .9rem; align-items: center; border: 1px solid #e8ebf0; height: 100%; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.stat-icon { width: 48px; height: 48px; border-radius: .8rem; display: grid; place-items: center; font-size: 1.35rem; flex-shrink: 0; }
.stat-label { font-size: .78rem; color: #6b7280; text-transform: uppercase; letter-spacing: .03em; }
.stat-value { font-size: 1.35rem; font-weight: 700; line-height: 1.2; word-break: break-word; }
.stat-error { color: #b91c1c; }
.stat-primary .stat-icon { background: color-mix(in srgb, var(--primary) 14%, #fff); color: var(--primary); }
.stat-accent .stat-icon { background: color-mix(in srgb, var(--accent) 18%, #fff); color: color-mix(in srgb, var(--accent) 80%, #000); }
.stat-success .stat-icon { background: #dcfce7; color: #15803d; }
.stat-danger .stat-icon { background: #fee2e2; color: #b91c1c; }
.stat-warning .stat-icon { background: #fef3c7; color: #b45309; }
.stat-info .stat-icon { background: #e0f2fe; color: #0369a1; }

.panel { border: 1px solid #e8ebf0; border-radius: .9rem; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.panel > .card-header { background: #fff; border-bottom: 1px solid #eef0f4; font-weight: 600; padding: .9rem 1.1rem; border-radius: .9rem .9rem 0 0; }
.panel > .card-header .bi { color: var(--primary); }
.chart-box { position: relative; height: 280px; }
.data-table thead th, .table thead th { font-size: .76rem; text-transform: uppercase; letter-spacing: .03em; color: #6b7280; background: #f8fafc; white-space: nowrap; }
.search-bar .input-group-text { background: #fff; }

/* ---------- Halaman login ---------- */
.login-page { background: var(--body-bg); }
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-side {
    background: linear-gradient(140deg, var(--primary), var(--primary-dark)); color: #fff;
    padding: 4rem 3.5rem; display: flex; flex-direction: column; justify-content: center;
}
.login-logo { width: 72px; height: 72px; margin-bottom: 1.4rem; background: #fff; border-radius: 1rem; padding: 8px; }
.login-side h1 { font-size: 2.3rem; font-weight: 700; margin-bottom: .5rem; }
.login-side .lead { opacity: .9; max-width: 30rem; }
.login-points { list-style: none; padding: 0; margin: 1.6rem 0 0; }
.login-points li { margin-bottom: .6rem; opacity: .92; }
.login-points .bi { color: var(--accent); margin-right: .5rem; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 2rem 1.2rem; }
.login-form .card { width: 100%; max-width: 420px; border-radius: 1rem; }
@media (max-width: 991.98px) {
    .login-wrap { grid-template-columns: 1fr; }
    .login-side { padding: 2.2rem 1.6rem; }
    .login-side h1 { font-size: 1.7rem; }
    .login-points { display: none; }
}

