/* ==========================================================================
   SIBUKA - Sistem Informasi SMP SATAP BUKAKA
   Tema: navy & biru sekolah (formal, tegas, bersih)
   ========================================================================== */

:root {
    --navy-900: #0b2138;
    --navy-800: #0f2a4a;
    --navy-700: #16375e;
    --navy-600: #1d4675;
    --blue-600: #1d4ed8;
    --blue-500: #2563eb;
    --blue-400: #3b82f6;
    --blue-100: #dbeafe;
    --sky-50: #eff6ff;
    --ink: #14243b;
    --ink-soft: #4a5b74;
    --ink-mute: #77869d;
    --line: #e2e8f2;
    --bg: #f4f7fc;
    --white: #ffffff;
    --green: #0f9d58;
    --amber: #d97706;
    --sky: #0284c7;
    --violet: #6d28d9;
    --red: #dc2626;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 42, 74, .06), 0 1px 3px rgba(15, 42, 74, .06);
    --shadow: 0 8px 24px rgba(15, 42, 74, .08);
    --shadow-lg: 0 18px 44px rgba(15, 42, 74, .12);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

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

h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.25; font-weight: 700; color: var(--ink); }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; color: var(--ink-soft); }
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
small { font-size: .82rem; }
img { max-width: 100%; }

/* ------------------------------- Tombol -------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .62rem 1.1rem; border-radius: var(--radius-sm); border: 1px solid transparent;
    font-size: .92rem; font-weight: 600; cursor: pointer; text-decoration: none;
    transition: transform .12s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
    line-height: 1.2; font-family: inherit;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--navy-700), var(--blue-600)); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { box-shadow: var(--shadow); }
.btn-light { background: #fff; color: var(--navy-700); border-color: var(--line); }
.btn-light:hover { background: var(--sky-50); border-color: var(--blue-100); }
.btn-ghost { background: rgba(255, 255, 255, .08); color: #dce8f7; border-color: rgba(255, 255, 255, .18); }
.btn-ghost:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.btn-outline { background: transparent; color: var(--blue-600); border-color: var(--blue-400); }
.btn-outline:hover { background: var(--sky-50); }
.btn-danger { background: #fff; color: var(--red); border-color: #fbd5d5; }
.btn-danger:hover { background: #fef2f2; }
.btn-sm { padding: .38rem .7rem; font-size: .82rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .55; pointer-events: none; }
.icon-btn {
    width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line);
    background: #fff; display: none; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.icon-btn svg { width: 22px; height: 22px; fill: var(--navy-700); }

/* ------------------------------- Kerangka ------------------------------ */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 264px; flex: 0 0 264px; background: linear-gradient(180deg, var(--navy-900), var(--navy-800) 55%, var(--navy-700));
    color: #cfe0f4; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar-brand { display: flex; align-items: center; gap: .7rem; padding: 1.2rem 1.15rem; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.brand-mark {
    width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--blue-500), #60a5fa); color: #fff; font-weight: 800; font-size: 1.15rem;
    box-shadow: 0 6px 16px rgba(37, 99, 235, .35);
}
/* Emblem sekolah pada sidebar aplikasi (menggantikan lencana huruf "S") */
.sidebar-brand .brand-mark-img {
    width: 42px;
    height: 42px;
    display: block;
    flex: 0 0 42px;
    object-fit: contain;
    /* Emblem berlatar transparan: beri cahaya tipis agar tetap jelas di sidebar gelap. */
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, .3)) drop-shadow(0 3px 7px rgba(4, 16, 30, .35));
}
/* Emblem sekolah pada kartu login (ukuran disamakan dengan lencana huruf "S" sebelumnya) */
.auth-brand .brand-emblem {
    width: 46px;
    height: 46px;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 3px 7px rgba(15, 42, 74, .22));
}
.brand-text strong { display: block; color: #fff; font-size: 1.06rem; letter-spacing: .5px; }
.brand-text small { color: #9fb8d6; font-size: .72rem; letter-spacing: .3px; }
.sidebar-nav { padding: .8rem .6rem; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav-link {
    display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem; border-radius: 10px;
    color: #c3d6ee; font-size: .89rem; font-weight: 500; text-decoration: none; transition: background .15s ease, color .15s ease;
}
.nav-link:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.nav-link.active { background: linear-gradient(135deg, var(--blue-500), var(--blue-600)); color: #fff; box-shadow: 0 6px 16px rgba(37, 99, 235, .3); }
.nav-link svg { width: 18px; height: 18px; fill: currentColor; flex: 0 0 18px; opacity: .95; }
.sidebar-foot {
    padding: .9rem;
    border-top: 1px solid rgba(255, 255, 255, .08);
    display: flex; flex-direction: column; gap: .6rem;
}
.user-chip {
    display: flex; align-items: center; gap: .6rem;
    padding: .42rem .5rem; border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .04);
    text-decoration: none; transition: background .15s ease, border-color .15s ease;
}
.user-chip:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .26); text-decoration: none; }
.user-chip .user-meta { min-width: 0; }
.user-chip .user-edit { margin-left: auto; opacity: .7; flex: 0 0 auto; }
.user-chip .user-edit svg { width: 15px; height: 15px; fill: #cfe0f4; display: block; }
.avatar { width: 36px; height: 36px; border-radius: 10px; background: rgba(255, 255, 255, .14); display: grid; place-items: center; font-weight: 700; color: #fff; overflow: hidden; flex: 0 0 36px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-meta strong { display: block; color: #fff; font-size: .86rem; line-height: 1.2; }
.user-meta small { color: #9fb8d6; font-size: .74rem; }
.sidebar-backdrop { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
    padding: .85rem 1.4rem; display: flex; align-items: center; gap: 1rem; position: sticky; top: 0; z-index: 20;
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 1.18rem; margin: 0; }
.topbar-title p { margin: .1rem 0 0; font-size: .8rem; color: var(--ink-mute); }
.content { padding: 1.4rem; flex: 1; }
.app-foot {
    display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    padding: 1rem 1.4rem; border-top: 1px solid var(--line); color: var(--ink-mute); font-size: .78rem; background: #fff;
}

/* ------------------------------- Kartu --------------------------------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 1.25rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.15rem; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { margin: 0; }
.card-head p { margin: .15rem 0 0; font-size: .82rem; color: var(--ink-mute); }
.card-body { padding: 1.15rem; }
.card-foot { padding: .85rem 1.15rem; border-top: 1px solid var(--line); display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

.grid { display: grid; gap: 1.1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-side { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }

.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.05rem 1.1rem; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: .5rem; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.stat-label { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-mute); font-weight: 700; }
.stat-value { font-size: 1.85rem; font-weight: 800; line-height: 1; color: var(--navy-800); }
.stat-note { font-size: .78rem; color: var(--ink-mute); }
.stat-ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 1.15rem; background: var(--sky-50); }
.stat-ico.blue { background: #e8f0fe; }
.stat-ico.green { background: #e7f7ee; }
.stat-ico.amber { background: #fdf3e3; }
.stat-ico.red { background: #fdeaea; }
.stat-ico.violet { background: #f1ebfe; }

/* ------------------------------- Tabel --------------------------------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.data th, table.data td { padding: .68rem .8rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data thead th { background: var(--sky-50); color: var(--navy-700); font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
table.data tbody tr:hover { background: #fafcff; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .aksi { display: flex; gap: .35rem; flex-wrap: wrap; }
.empty-state { text-align: center; padding: 2.2rem 1.2rem; color: var(--ink-mute); }
.empty-icon { font-size: 2.2rem; margin-bottom: .4rem; }
.empty-state h2, .empty-state h3 { color: var(--ink); }

/* ------------------------------- Badge --------------------------------- */
.badge { display: inline-block; padding: .2rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 700; border: 1px solid transparent; white-space: nowrap; }
.badge-hadir { background: #e7f7ee; color: #0b7c46; border-color: #c6ecd8; }
.badge-terlambat { background: #fdf3e3; color: #a35a06; border-color: #f7e0bd; }
.badge-izin { background: #e6f3fd; color: #0369a1; border-color: #c4e3f8; }
.badge-sakit { background: #f1ebfe; color: #5b21b6; border-color: #ddd0fb; }
.badge-alpa { background: #fdeaea; color: #b91c1c; border-color: #f8cccc; }
.badge-netral { background: #eef2f7; color: var(--ink-soft); border-color: #dfe6ef; }
.badge-info { background: var(--blue-100); color: var(--navy-700); border-color: #c7ddfb; }

/* ------------------------------- Form ---------------------------------- */
.form-grid { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field label { font-size: .82rem; font-weight: 600; color: var(--ink-soft); }
.field .hint { font-size: .75rem; color: var(--ink-mute); }
input[type=text], input[type=password], input[type=date], input[type=time], input[type=number], input[type=email], select, textarea {
    width: 100%; padding: .58rem .7rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
    font-size: .9rem; font-family: inherit; color: var(--ink); background: #fff; transition: border .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue-400); box-shadow: 0 0 0 3px rgba(59, 130, 246, .16); }
textarea { min-height: 110px; resize: vertical; }
.filter-bar { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); align-items: end; }
.filter-bar .field { gap: .25rem; }
.actions-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

/* ------------------------------- Alert --------------------------------- */
.alert { padding: .75rem 1rem; border-radius: var(--radius-sm); border: 1px solid; font-size: .89rem; margin-bottom: 1rem; }
.alert-ok { background: #e7f7ee; border-color: #c6ecd8; color: #0b6b3e; }
.alert-error { background: #fdeaea; border-color: #f8cccc; color: #a91d1d; }
.alert-warn { background: #fdf7e6; border-color: #f6e3b4; color: #92600a; }
.alert-info { background: var(--sky-50); border-color: var(--blue-100); color: var(--navy-700); }

/* ------------------------------- Grafik -------------------------------- */
.chart { display: flex; flex-direction: column; gap: .7rem; }
.chart-row { display: grid; grid-template-columns: 92px 1fr 46px; align-items: center; gap: .6rem; font-size: .84rem; }
.chart-track { background: #eef3fa; border-radius: 999px; height: 12px; overflow: hidden; }
.chart-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--navy-600), var(--blue-400)); }
.chart-fill.green { background: linear-gradient(90deg, #0f9d58, #4ade80); }
.chart-fill.amber { background: linear-gradient(90deg, #d97706, #fbbf24); }
.chart-fill.violet { background: linear-gradient(90deg, #6d28d9, #a78bfa); }
.chart-fill.red { background: linear-gradient(90deg, #dc2626, #fca5a5); }
.chart-fill.sky { background: linear-gradient(90deg, #0284c7, #7dd3fc); }
.chart-val { text-align: right; font-weight: 700; color: var(--navy-700); font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; gap: .5rem .9rem; font-size: .8rem; color: var(--ink-soft); }
.legend span.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; }

/* ------------------------------- Login --------------------------------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
    background: radial-gradient(1000px 500px at 15% 10%, #e8f0fe 0%, transparent 60%), linear-gradient(160deg, var(--navy-900), var(--navy-700) 60%, var(--blue-600)); }
.auth-card { width: 100%; max-width: 420px; background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); padding: 1.8rem; }
.auth-brand { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.2rem; }
.auth-brand .brand-text strong { color: var(--ink); }
.auth-brand .brand-text small { color: var(--ink-mute); }
.auth-foot { margin-top: 1.1rem; font-size: .8rem; color: var(--ink-mute); text-align: center; }

/* --------------------------- Halaman publik ---------------------------- */
.public-header { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.public-header-inner { max-width: 1160px; margin: 0 auto; padding: .8rem 1.2rem; display: flex; align-items: center; gap: 1rem; }
.public-brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; }
.public-brand .brand-text strong { color: var(--navy-800); }
.public-brand .brand-text small { color: var(--ink-mute); }
.public-nav { display: flex; gap: .35rem; margin-left: auto; flex-wrap: wrap; }
.public-nav a { padding: .45rem .8rem; border-radius: 9px; color: var(--ink-soft); font-weight: 600; font-size: .88rem; }
.public-nav a:hover, .public-nav a.active { background: var(--sky-50); color: var(--blue-600); text-decoration: none; }
.public-header .btn { margin-left: .3rem; white-space: nowrap; }

.hero { position: relative; overflow: hidden; color: #fff;
    background: linear-gradient(150deg, var(--navy-900) 0%, var(--navy-700) 45%, var(--blue-600) 100%); }
.hero::after { content: ""; position: absolute; inset: 0;
    background: radial-gradient(620px 320px at 88% 12%, rgba(255, 255, 255, .16), transparent 62%),
                radial-gradient(520px 300px at 8% 92%, rgba(96, 165, 250, .28), transparent 60%); }
.hero-inner { position: relative; z-index: 1; max-width: 1160px; margin: 0 auto; padding: 4rem 1.2rem 3.4rem;
    display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .95fr); gap: 2.4rem; align-items: center; }
.hero h1 { font-size: 3.1rem; letter-spacing: .06em; margin: 0 0 .2rem; color: #fff; }
.hero h2 { font-size: 1.22rem; font-weight: 600; color: #dbeafe; margin: 0 0 .9rem; }
.hero .tagline { display: inline-block; padding: .3rem .8rem; border-radius: 999px; background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .22); font-size: .82rem; font-weight: 600; margin-bottom: 1.1rem; }
.hero p.lead { color: #dbeafe; font-size: 1rem; max-width: 46ch; }
.hero-actions { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.3rem; }
.hero .btn-light { background: #fff; color: var(--navy-800); }
.hero .btn-outline { color: #fff; border-color: rgba(255, 255, 255, .55); }
.hero .btn-outline:hover { background: rgba(255, 255, 255, .14); }
.hero-card { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); border-radius: 18px; padding: 1.2rem; backdrop-filter: blur(6px); }
.hero-card h3 { color: #fff; font-size: .95rem; margin-bottom: .7rem; }
.hero-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.hero-list li { display: flex; gap: .6rem; align-items: flex-start; font-size: .87rem; color: #e5eefb; }
.hero-list .tick { color: #86efac; font-weight: 700; }

.section { padding: 3.2rem 1.2rem; }
.section.alt { background: #fff; }
.section-inner { max-width: 1160px; margin: 0 auto; }
.section-head { max-width: 62ch; margin-bottom: 1.9rem; }
.section-head h2 { font-size: 1.7rem; margin-bottom: .35rem; }
.section-head p { margin: 0; }
.eyebrow { display: inline-block; font-size: .76rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--blue-600); margin-bottom: .5rem; }

.info-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease; }
.info-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.info-card .ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; background: var(--sky-50); margin-bottom: .85rem; }
.info-card h3 { font-size: 1rem; }
.info-card p { font-size: .88rem; margin: 0; }

.access-card { border-left: 4px solid var(--blue-500); background: #fff; border-radius: var(--radius); padding: 1.15rem 1.2rem; box-shadow: var(--shadow-sm); }
.access-card h3 { font-size: .95rem; color: var(--navy-700); }
.access-card p { font-size: .87rem; margin: 0; }

.announce { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: .45rem; }
.announce-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.announce-head h3 { margin: 0; font-size: 1rem; }
.announce p { font-size: .88rem; margin: 0; color: var(--ink-soft); white-space: pre-line; }
.announce time { font-size: .76rem; color: var(--ink-mute); }

.public-footer { background: var(--navy-900); color: #a9c0da; padding: 1.6rem 1.2rem; }
.public-footer-inner { max-width: 1160px; margin: 0 auto; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .84rem; }
.public-footer strong { color: #fff; display: block; }
.public-footer .tagline { font-size: .8rem; color: #8fb0d4; }

/* --------------------------- Scan kamera ------------------------------- */
.scan-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 1.2rem; }
.cam-frame { position: relative; background: #061424; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; display: grid; place-items: center; }
.cam-frame video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-frame .cam-hint { color: #b9cde4; font-size: .86rem; padding: 1rem; text-align: center; }
.cam-reticle { position: absolute; inset: 12%; border: 2px dashed rgba(255, 255, 255, .55); border-radius: 14px; pointer-events: none; }
.scan-result { border-radius: var(--radius); border: 1px solid var(--line); padding: 1rem; background: #fff; }
.scan-result.ok { border-color: #c6ecd8; background: #f4fdf8; }
.scan-result.warn { border-color: #f7e0bd; background: #fffbf3; }
.scan-result.err { border-color: #f8cccc; background: #fef5f5; }
.scan-result h3 { font-size: 1rem; margin-bottom: .2rem; }
.scan-result p { margin: 0; font-size: .87rem; }
.scan-list { max-height: 380px; overflow-y: auto; }
.big-status { font-size: 1.05rem; font-weight: 800; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; }
.token-box { background: var(--sky-50); border: 1px dashed var(--blue-100); border-radius: 10px; padding: .5rem .7rem; display: inline-block; }

/* --------------------------- Kartu QR cetak ---------------------------- */
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.qr-card { border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem; background: #fff; text-align: center; page-break-inside: avoid; }
.qr-card .qr-holder { display: grid; place-items: center; margin-bottom: .6rem; min-height: 140px; }
.qr-card .qr-holder img, .qr-card .qr-holder canvas { display: block; }
.qr-card h3 { font-size: .95rem; margin-bottom: .1rem; }
.qr-card .meta { font-size: .78rem; color: var(--ink-mute); }
.qr-head { border-bottom: 1px dashed var(--line); padding-bottom: .5rem; margin-bottom: .6rem; font-size: .8rem; font-weight: 700; color: var(--navy-700); }
.qr-head small { display: block; font-weight: 500; color: var(--ink-mute); font-size: .7rem; }

/* --------------------------- Tab / segmented --------------------------- */
.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs a { padding: .45rem .85rem; border-radius: 999px; font-size: .86rem; font-weight: 600; background: #fff; border: 1px solid var(--line); color: var(--ink-soft); }
.tabs a.active { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }
.tabs a:hover { text-decoration: none; border-color: var(--blue-400); color: var(--blue-600); }
.tabs a.active:hover { color: #fff; }

.pagination { display: flex; gap: .3rem; flex-wrap: wrap; align-items: center; justify-content: center; margin-top: 1rem; }
.pagination a, .pagination span { padding: .35rem .7rem; border: 1px solid var(--line); border-radius: 8px; font-size: .84rem; background: #fff; }
.pagination span.cur { background: var(--navy-700); border-color: var(--navy-700); color: #fff; font-weight: 700; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 .9rem 1.2rem; border-left: 2px solid var(--line); }
.timeline li:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: .35rem; width: 10px; height: 10px; border-radius: 50%; background: var(--blue-500); }
.timeline strong { display: block; font-size: .9rem; }
.timeline small { color: var(--ink-mute); font-size: .78rem; }

/* --------------------------- Responsif --------------------------------- */
@media (max-width: 1080px) {
    .hero-inner { grid-template-columns: 1fr; padding-top: 3rem; }
    .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .grid-side { grid-template-columns: 1fr; }
    .scan-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .icon-btn { display: inline-flex; }
    .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 60; transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
    body.nav-open .sidebar { transform: translateX(0); }
    .sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(9, 24, 42, .48); z-index: 55; }
    body.nav-open .sidebar-backdrop { display: block; }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .public-nav { order: 3; width: 100%; margin-left: 0; }
    .public-header-inner { flex-wrap: wrap; }
}
@media (max-width: 640px) {
    .content { padding: 1rem; }
    .topbar { padding: .7rem .9rem; }
    .app-foot { padding: .9rem; }
    .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .grid { gap: 1rem; }
    .hero h1 { font-size: 2.3rem; }
    .hero-inner { padding: 2.4rem 1rem 2.2rem; gap: 1.6rem; }
    .section { padding: 2.2rem 1rem; }
    .stat-value { font-size: 1.6rem; }
    .topbar-right { display: none; }
    .chart-row { grid-template-columns: 78px 1fr 40px; }
}

/* --------------------------- Cetak ------------------------------------- */
@media print {
    .sidebar, .topbar, .app-foot, .no-print, .btn { display: none !important; }
    body, .main, .content { background: #fff; padding: 0; margin: 0; }
    .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
    .qr-grid { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
    a { color: #000; text-decoration: none; }
}

/* ==========================================================================
   Jam digital real time (WITA / Bolaang Mongondow Timur)
   - .jam-digital-dalam : DI DALAM sidebar, ikut alur tata letak (layar lebar).
     Karena berada di alur normal, jam ini tidak mungkin menutupi tombol Keluar.
   - .jam-digital-luar  : mengambang di kiri bawah, hanya dipakai pada layar
     sempit (<=900px) ketika sidebar berubah menjadi laci dan pada halaman
     publik (beranda, jadwal, informasi, login) yang tidak punya sidebar.
   ========================================================================== */
.jam-digital {
    position: fixed;
    left: .85rem;
    bottom: .5rem;
    z-index: 46;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .36rem .68rem;
    border-radius: 12px;
    background: rgba(9, 28, 48, .72);
    border: 1px solid rgba(255, 255, 255, .2);
    box-shadow: 0 8px 22px rgba(4, 16, 30, .3);
    backdrop-filter: blur(6px);
    pointer-events: none;
    line-height: 1.1;
    max-width: calc(100% - 1.7rem);
}
/* Di layar lebar jam mengambang disembunyikan (sudah ada jam di dalam sidebar). */
.jam-digital-luar { display: none; }
.jam-digital-dalam {
    position: static;
    left: auto;
    bottom: auto;
    width: 100%;
    justify-content: center;
    margin-top: .15rem;
    padding: .45rem .5rem;
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .14);
    box-shadow: none;
    backdrop-filter: none;
}
.jam-digital .jd-jam {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .96rem;
    font-weight: 700;
    letter-spacing: .06em;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
}
.jam-digital .jd-detail { display: flex; flex-direction: column; }
.jam-digital .jd-tgl { font-size: .7rem; color: #cfe0f4; }
.jam-digital .jd-zona { font-size: .62rem; letter-spacing: .06em; color: #8fb0d4; text-transform: uppercase; }

@media (max-width: 640px) {
    .jam-digital { left: .65rem; bottom: .6rem; padding: .35rem .6rem; gap: .45rem; }
    .jam-digital .jd-jam { font-size: .92rem; }
    .jam-digital .jd-tgl { font-size: .64rem; }
    .jam-digital .jd-zona { font-size: .56rem; }
    /* Jam di dalam sidebar: tetap ikut alur, jangan dipindahkan ke mengambang. */
    .jam-digital-dalam { position: static; left: auto; bottom: auto; width: 100%; }
}
@media (max-width: 900px) {
    /* Sidebar menjadi laci: pakai jam mengambang di kiri bawah,
       sedangkan jam di dalam sidebar tampil saat laci dibuka. */
    .jam-digital-luar { display: flex; }
    .jam-digital-dalam { display: none; }
}
@media print {
    .jam-digital { display: none; }
}

/* ==========================================================================
   Informasi / Pengumuman: gambar kegiatan
   ========================================================================== */
.info-banner {
    display: block;
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: var(--radius) var(--radius) 0 0;
    background: #eef3fa;
}
.announce-gambar { padding-top: 0; }
.announce-foto {
    display: block;
    margin: -.1rem -1.2rem .9rem;
    overflow: hidden;
    border-radius: var(--radius) var(--radius) 0 0;
    background: #eef3fa;
}
.announce-foto img {
    display: block;
    width: 100%;
    height: 190px;
    object-fit: cover;
    transition: transform .35s ease;
}
.announce-foto:hover img { transform: scale(1.04); }
.announce-foto:hover { text-decoration: none; }
.thumb {
    width: 82px;
    height: 58px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
    display: block;
    background: #eef3fa;
}
.gambar-pratinjau {
    display: flex;
    align-items: center;
    gap: .9rem;
    flex-wrap: wrap;
    margin-top: .6rem;
    padding: .6rem;
    border: 1px dashed var(--line);
    border-radius: 10px;
    background: #fafcff;
}
.gambar-pratinjau img {
    width: 150px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
    display: block;
}
input[type=file] {
    padding: .5rem .6rem;
    border: 1px dashed var(--line);
    border-radius: var(--radius-sm);
    background: #fafcff;
    font-size: .86rem;
    width: 100%;
}
@media (max-width: 640px) {
    .announce-foto img { height: 160px; }
    .thumb { width: 64px; height: 46px; }
}

/* ==========================================================================
   Ruang Kolaborasi - percakapan dua panel (gaya aplikasi pesan)
   Panel kiri: daftar percakapan  |  Panel kanan: percakapan terpilih
   ========================================================================== */
.kolab-app {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 1.15rem;
    align-items: start;
}
.kolab-panel,
.kolab-chat {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.kolab-panel { display: flex; flex-direction: column; max-height: calc(100vh - 190px); min-height: 520px; }
.kolab-panel-head {
    display: flex; flex-direction: column; gap: .7rem;
    padding: 1rem 1rem .8rem;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #f7fafd, #ffffff);
}
.kolab-panel-title h2 { font-size: 1.05rem; margin: 0 0 .15rem; }
.kolab-panel-title p { margin: 0; font-size: .78rem; color: var(--ink-mute); }
.kolab-panel-title .kolab-judul { font-size: .74rem; color: var(--navy-700); font-weight: 600; margin: .1rem 0 .25rem; }
.kolab-cari-form { display: flex; gap: .4rem; }
.kolab-cari-form input { flex: 1; min-width: 0; }
.kolab-filter { display: flex; gap: .3rem; flex-wrap: wrap; }
.kolab-filter a {
    padding: .28rem .6rem; border-radius: 999px; border: 1px solid var(--line);
    background: #fff; font-size: .76rem; font-weight: 600; color: var(--ink-soft);
}
.kolab-filter a:hover { text-decoration: none; border-color: var(--blue-400); color: var(--blue-600); }
.kolab-filter a.active { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }

.kolab-items { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.kolab-items > li { border-bottom: 1px solid var(--line); }
.kolab-items > li:last-child { border-bottom: 0; }
.kolab-item {
    display: flex; gap: .7rem; padding: .8rem .9rem; text-decoration: none; color: inherit;
    transition: background .15s ease, box-shadow .15s ease;
}
.kolab-item:hover { background: var(--sky-50); text-decoration: none; }
.kolab-item.aktif { background: #eef4fd; box-shadow: inset 3px 0 0 var(--blue-500); }
.ki-avatar {
    width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%;
    display: grid; place-items: center; font-weight: 800; font-size: .95rem;
    background: linear-gradient(135deg, var(--navy-700), var(--blue-500)); color: #fff;
}
.ki-body { display: flex; flex-direction: column; gap: .12rem; min-width: 0; flex: 1; }
.ki-top { display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; }
.ki-top strong { font-size: .9rem; color: var(--ink); }
.ki-top time { font-size: .72rem; color: var(--ink-mute); white-space: nowrap; }
.ki-sub { font-size: .8rem; color: var(--navy-700); font-weight: 600; }
.ki-last { font-size: .78rem; color: var(--ink-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ki-tags { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .2rem; }
.ki-tags .badge { font-size: .68rem; padding: .12rem .45rem; }
.kolab-kosong-panel { padding: 1.2rem 1rem; display: flex; flex-direction: column; gap: .3rem; }
.kolab-kosong-panel small { color: var(--ink-mute); }

.kolab-kelas { border-top: 1px solid var(--line); padding: .7rem .9rem; background: #fafcff; }
.kolab-kelas summary { cursor: pointer; font-size: .84rem; font-weight: 700; color: var(--navy-700); }
.kolab-kelas form { display: flex; flex-direction: column; gap: .55rem; margin-top: .7rem; }
.kolab-kelas form textarea { min-height: 70px; }

.kolab-chat { display: flex; flex-direction: column; min-height: 520px; max-height: calc(100vh - 190px); }
.chat-head {
    display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
    padding: .8rem 1rem; border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #f7fafd, #ffffff);
}
.chat-back {
    display: none; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line);
    background: #fff; color: var(--navy-700); font-size: 1rem; line-height: 1; text-align: center;
    padding-top: .35rem; flex: 0 0 32px;
}
.chat-back:hover { text-decoration: none; background: var(--sky-50); }
.chat-avatar {
    width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%;
    display: grid; place-items: center; overflow: hidden;
    background: linear-gradient(135deg, var(--navy-700), var(--blue-500)); color: #fff;
    font-weight: 800; font-size: 1rem;
}
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-ident { display: flex; flex-direction: column; min-width: 0; }
.chat-ident strong { font-size: .96rem; }
.chat-ident small { font-size: .76rem; color: var(--ink-mute); }
.chat-tags { display: flex; gap: .3rem; flex-wrap: wrap; }
.chat-actions { margin-left: auto; display: flex; gap: .45rem; flex-wrap: wrap; }
.chat-actions form { margin: 0; }

.chat-topic { padding: .7rem 1rem 0; }
.chat-topic h3 { font-size: .98rem; margin: 0 0 .15rem; }
.chat-topic p { margin: 0; font-size: .76rem; color: var(--ink-mute); }

.chat-stream {
    flex: 1; overflow-y: auto; padding: 1rem;
    display: flex; flex-direction: column; gap: .65rem;
    background:
        radial-gradient(circle at 12% 0%, #eef4fd 0%, transparent 45%),
        #fbfdff;
}
.chat-row { display: flex; }
.chat-row.sendiri { justify-content: flex-end; }
.chat-row.lawan { justify-content: flex-start; }
.chat-bubble {
    display: flex; flex-direction: column; gap: .2rem;
    max-width: min(78%, 560px); padding: .6rem .8rem;
    border-radius: 14px; border: 1px solid var(--line);
    background: #fff; box-shadow: var(--shadow-sm);
}
.chat-row.sendiri .chat-bubble {
    background: linear-gradient(135deg, var(--navy-700), var(--blue-600));
    border-color: transparent; color: #fff;
    border-bottom-right-radius: 5px;
}
.chat-row.lawan .chat-bubble { border-bottom-left-radius: 5px; }
.cb-nama { font-size: .74rem; font-weight: 800; color: var(--navy-700); display: flex; gap: .35rem; align-items: baseline; }
.cb-nama small { font-weight: 500; font-size: .68rem; color: var(--ink-mute); }
.chat-row.sendiri .cb-nama, .chat-row.sendiri .cb-nama small { color: #dbeafe; }
.cb-teks { font-size: .88rem; line-height: 1.55; color: var(--ink); }
.chat-row.sendiri .cb-teks { color: #fff; }
.chat-bubble time { font-size: .68rem; color: var(--ink-mute); align-self: flex-end; }
.chat-row.sendiri .chat-bubble time { color: #cfe0f4; }

.chat-note {
    align-self: stretch; padding: .7rem .85rem; border-radius: 12px;
    background: #f4fcf7; border: 1px solid #c6ecd8; border-left: 4px solid var(--green);
}
.chat-note.kosong { background: #fafcff; border-color: var(--line); border-left-color: var(--blue-400); }
.chat-note .cn-label {
    display: block; font-size: .7rem; font-weight: 800; letter-spacing: .06em;
    text-transform: uppercase; color: #0b7c46; margin-bottom: .25rem;
}
.chat-note.kosong .cn-label { color: var(--navy-700); }
.chat-note p { margin: 0; font-size: .88rem; color: var(--ink); }
.chat-note small { color: var(--ink-mute); font-size: .72rem; }

.chat-tindak { border-top: 1px solid var(--line); padding: .7rem 1rem; background: #fafcff; }
.chat-tindak summary { cursor: pointer; font-size: .84rem; font-weight: 700; color: var(--navy-700); }
.chat-tindak form { display: flex; flex-direction: column; gap: .5rem; margin-top: .6rem; }
.chat-tindak textarea { min-height: 76px; }

.chat-compose {
    display: flex; gap: .6rem; align-items: flex-end;
    padding: .8rem 1rem; border-top: 1px solid var(--line); background: #fff;
}
.chat-compose textarea { min-height: 46px; max-height: 140px; resize: vertical; }
.chat-compose textarea { flex: 1; }
.chat-compose .btn { white-space: nowrap; }
.chat-compose-baru { padding: 1rem; overflow-y: auto; }
.kolab-empty {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .3rem; padding: 2rem 1.2rem; text-align: center;
}
.kolab-empty h3 { font-size: 1rem; margin: .3rem 0 0; }
.kolab-empty p { font-size: .86rem; max-width: 42ch; margin: 0; }
.kolab-meta { color: var(--ink-mute); font-size: .76rem; }

@media (max-width: 1080px) {
    .kolab-app { grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); }
}
@media (max-width: 900px) {
    .kolab-app { grid-template-columns: 1fr; }
    .kolab-panel, .kolab-chat { max-height: none; min-height: 0; }
    /* Pada layar ponsel: daftar percakapan disembunyikan saat percakapan dibuka. */
    .kolab-app.ada-isi .kolab-panel { display: none; }
    .chat-back { display: inline-block; }
    .chat-bubble { max-width: 88%; }
}

/* ---------------------- Perangkat Ajar (guru & publik) ---------------- */
.denah-mapel { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }
.perangkat-item {
    display: flex; align-items: center; gap: .9rem;
    padding: .8rem .9rem; margin: 0;
    border-bottom: 1px solid var(--line);
}
.perangkat-item:last-child { border-bottom: 0; }
.perangkat-ikon {
    width: 44px; height: 44px; flex: 0 0 44px;
    border-radius: 11px; display: grid; place-items: center;
    font-size: .68rem; font-weight: 800; letter-spacing: .04em;
    background: var(--sky-50); color: var(--navy-700); border: 1px solid var(--blue-100);
}
.perangkat-ikon.pdf { background: #fdeaea; color: #b91c1c; border-color: #f8cccc; }
.perangkat-ikon.docx { background: #e8f0fe; color: #1d4ed8; border-color: #c7ddfb; }
.perangkat-ikon.pptx { background: #fdf3e3; color: #a35a06; border-color: #f7e0bd; }
.perangkat-ikon.xlsx { background: #e7f7ee; color: #0b7c46; border-color: #c6ecd8; }
.perangkat-isi { flex: 1; min-width: 0; }
.perangkat-isi strong { display: block; color: var(--navy-800); }
.perangkat-isi small { color: var(--ink-mute); font-size: .78rem; }
.guru-kartu { display: block; text-decoration: none; color: inherit; }
.guru-kartu:hover { text-decoration: none; }
.guru-kartu-card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1rem 1.05rem; box-shadow: var(--shadow-sm);
    display: flex; flex-direction: row; align-items: stretch; gap: 1rem;
    transition: transform .15s ease, box-shadow .15s ease;
    height: 100%;
}
.guru-kartu:hover .guru-kartu-card { transform: translateY(-2px); box-shadow: var(--shadow); }
.guru-kartu-card strong { color: var(--navy-800); font-size: .98rem; }
.guru-kartu-card small { color: var(--ink-mute); font-size: .78rem; }
.guru-kartu-isi { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .45rem; }
/* Ukuran foto kartu disamakan dengan foto pada halaman detail guru (74 x 99 px). */
.guru-kartu-foto { flex: 0 0 74px; width: 74px; }
.guru-kartu-foto .foto-3x4 { border-width: 3px; border-radius: 10px; }
.guru-kartu-foto .foto-kosong { font-size: 1.1rem; border-width: 3px; border-radius: 10px; }

/* ---------------------- Foto profil rasio 3:4 (pas foto) ---------------- */
.foto-3x4 {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    height: auto;
    object-fit: cover;
    object-position: 50% 22%;
    border-radius: 14px;
    background: linear-gradient(160deg, #eef4fd, #dbe7f7);
    /* Bingkai putih + garis tipis: sudut foto tidak lagi tajam/kaku. */
    padding: 4px;
    box-shadow: inset 0 0 0 1px rgba(15, 42, 74, .12), 0 6px 16px rgba(9, 28, 48, .12);
}
img.foto-3x4 {
    /* padding di atas tidak dipakai gambar: bingkai dibuat lewat outline lembut */
    padding: 0;
    border: 4px solid #fff;
    box-shadow: 0 0 0 1px rgba(15, 42, 74, .12), 0 6px 16px rgba(9, 28, 48, .12);
}
.foto-kosong {
    display: grid; place-content: center; justify-items: center; gap: .15rem;
    color: var(--navy-700); font-weight: 800; font-size: 1.6rem;
    border: 4px solid #fff; text-align: center;
}
.foto-kosong small { font-size: .62rem; font-weight: 600; color: var(--ink-mute); letter-spacing: .02em; }

/* ---------------- Halaman publik: kepala profil guru (foto 3:4) ---------- */
.guru-profil-head { display: flex; gap: 1.35rem; align-items: flex-start; }
.guru-profil-foto { flex: 0 0 74px; width: 74px; }
.guru-profil-foto .foto-3x4 { border-width: 3px; border-radius: 10px; }
.guru-profil-foto .foto-kosong { font-size: 1.1rem; border-width: 3px; border-radius: 10px; }
.guru-profil-isi { flex: 1; min-width: 0; }

/* ------------------------- Halaman Profil Saya -------------------------- */
.profil-foto-grid { display: flex; gap: 1.35rem; align-items: flex-start; flex-wrap: wrap; }
.foto-bingkai { flex: 0 0 160px; width: 160px; display: flex; flex-direction: column; gap: .45rem; }
.foto-bingkai .foto-ket { text-align: center; color: var(--ink-mute); font-size: .72rem; }
.profil-foto-aksi { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: .7rem; align-items: flex-start; }
.profil-foto-aksi form { width: 100%; }

@media (max-width: 640px) {
    .guru-kartu-card { gap: .8rem; }
    .guru-kartu-foto { flex: 0 0 66px; width: 66px; }
    .guru-profil-head { flex-direction: column; }
    .guru-profil-foto { flex: 0 0 auto; width: 66px; }
    .foto-bingkai { flex: 0 0 132px; width: 132px; }
}


/* ==========================================================================
   DASHBOARD KEPALA SEKOLAH / ADMIN — "Ruang Kendali" (tema sinematik)
   Diminta user 23/11/2026 mengikuti konsep gambar referensi: latar gelap
   bergradasi marun → indigo → biru baja, tipografi judul besar, kartu kaca,
   foto sekolah berbingkai, dan diagram presentasi (donut, tren, per kelas).
   Kelas ini hanya dipakai bila page_header() diberi body class "dash-kepsek",
   jadi dashboard guru & siswa tetap memakai tema terang.
   ========================================================================== */
body.dash-kepsek {
    --cin-garis: rgba(255, 255, 255, .13);
    --cin-teks: #f4eef9;
    --cin-redup: #bcaecb;
    --cin-kaca: linear-gradient(160deg, rgba(20, 15, 33, .82), rgba(18, 19, 40, .66));
    background:
        radial-gradient(900px 520px at 12% 0%, rgba(185, 58, 94, .34), transparent 62%),
        radial-gradient(760px 460px at 92% 12%, rgba(96, 165, 250, .26), transparent 60%),
        linear-gradient(160deg, #150c1c 0%, #241430 38%, #1f2b4c 76%, #131b32 100%);
    background-attachment: fixed;
    color: var(--cin-teks);
}

/* --------------------------- Kerangka halaman -------------------------- */
body.dash-kepsek .sidebar {
    background: linear-gradient(180deg, #170d20 0%, #241334 52%, #2c2350 100%);
}
body.dash-kepsek .nav-link.active {
    background: linear-gradient(135deg, #8c2e4c, #3b6bb5);
    box-shadow: 0 8px 20px rgba(140, 46, 76, .38);
}
body.dash-kepsek .topbar {
    background: rgba(18, 11, 26, .74);
    border-bottom: 1px solid rgba(255, 255, 255, .10);
    backdrop-filter: blur(14px) saturate(140%);
}
body.dash-kepsek .topbar-title h1 { color: #fff; }
body.dash-kepsek .topbar-title p { color: #b0a2c2; }
body.dash-kepsek .app-foot {
    background: rgba(12, 7, 18, .55);
    border-top: 1px solid rgba(255, 255, 255, .08);
    color: #a99bbb;
}
body.dash-kepsek h1, body.dash-kepsek h2, body.dash-kepsek h3, body.dash-kepsek h4 { color: #fff; }

/* ------------------------------- Kartu --------------------------------- */
body.dash-kepsek .card,
body.dash-kepsek .stat {
    background: var(--cin-kaca);
    border: 1px solid var(--cin-garis);
    box-shadow: 0 18px 40px rgba(6, 2, 14, .38), inset 0 1px 0 rgba(255, 255, 255, .10);
    backdrop-filter: blur(10px) saturate(130%);
    color: var(--cin-teks);
}
body.dash-kepsek .card-head,
body.dash-kepsek .card-foot { border-color: rgba(255, 255, 255, .10); }
body.dash-kepsek .card-head p,
body.dash-kepsek .card-body p,
body.dash-kepsek .stat-note { color: #b9a9c9; }
body.dash-kepsek .stat-label { color: #b0a2c2; }
body.dash-kepsek .stat-value { color: #fff; }
body.dash-kepsek .stat-ico { background: rgba(255, 255, 255, .10); }
body.dash-kepsek .card strong,
body.dash-kepsek .stat strong,
body.dash-kepsek .panel-diagram strong,
body.dash-kepsek .timeline strong { color: #fff; }
body.dash-kepsek .btn-light {
    background: rgba(255, 255, 255, .10);
    border-color: rgba(255, 255, 255, .20);
    color: #f4eef9;
}
body.dash-kepsek .btn-light:hover { background: rgba(255, 255, 255, .18); }
body.dash-kepsek .btn-primary { background: linear-gradient(135deg, #b93a5e, #3b6bb5); }
body.dash-kepsek .mono { color: #cdc0dc; }
body.dash-kepsek .empty-state { color: #a99bbb; }
body.dash-kepsek a { color: #f5c2d2; }
body.dash-kepsek a:hover { color: #ffe1ea; }

/* -------------------------------- Tabel -------------------------------- */
body.dash-kepsek table.data th,
body.dash-kepsek table.data td { border-bottom-color: rgba(255, 255, 255, .09); color: #e8ddf2; }
body.dash-kepsek table.data thead th { background: rgba(255, 255, 255, .08); color: #d6c9e6; }
body.dash-kepsek table.data tbody tr:hover { background: rgba(255, 255, 255, .05); }

/* -------------------------------- Badge -------------------------------- */
body.dash-kepsek .badge-hadir { background: rgba(74, 222, 128, .18); color: #86efac; border-color: rgba(74, 222, 128, .34); }
body.dash-kepsek .badge-terlambat { background: rgba(251, 191, 36, .18); color: #fcd34d; border-color: rgba(251, 191, 36, .34); }
body.dash-kepsek .badge-izin { background: rgba(56, 189, 248, .18); color: #7dd3fc; border-color: rgba(56, 189, 248, .34); }
body.dash-kepsek .badge-sakit { background: rgba(192, 132, 252, .18); color: #d8b4fe; border-color: rgba(192, 132, 252, .34); }
body.dash-kepsek .badge-alpa { background: rgba(251, 113, 133, .18); color: #fda4af; border-color: rgba(251, 113, 133, .34); }
body.dash-kepsek .badge-netral { background: rgba(255, 255, 255, .12); color: #e2d7ee; border-color: rgba(255, 255, 255, .18); }
body.dash-kepsek .badge-info { background: rgba(96, 165, 250, .20); color: #bfdbfe; border-color: rgba(96, 165, 250, .34); }

/* --------------------------- Alert & grafik batang --------------------- */
body.dash-kepsek .alert-ok { background: rgba(16, 185, 129, .16); border-color: rgba(74, 222, 128, .34); color: #d3f7e7; }
body.dash-kepsek .alert-error { background: rgba(220, 38, 38, .20); border-color: rgba(248, 160, 160, .40); color: #ffd9d9; }
body.dash-kepsek .alert-warn { background: rgba(217, 119, 6, .18); border-color: rgba(251, 191, 36, .34); color: #fde8bf; }
body.dash-kepsek .alert-info { background: rgba(56, 189, 248, .14); border-color: rgba(56, 189, 248, .32); color: #d6ecfd; }
body.dash-kepsek .chart-row { color: #d6c9e6; }
body.dash-kepsek .chart-track { background: rgba(255, 255, 255, .12); }
body.dash-kepsek .chart-val { color: #fff; }
body.dash-kepsek .chart-fill.green { background: linear-gradient(90deg, #34d399, #a7f3d0); }
body.dash-kepsek .chart-fill.amber { background: linear-gradient(90deg, #f59e0b, #fde68a); }
body.dash-kepsek .chart-fill.sky { background: linear-gradient(90deg, #38bdf8, #bae6fd); }
body.dash-kepsek .chart-fill.violet { background: linear-gradient(90deg, #a855f7, #e9d5ff); }
body.dash-kepsek .chart-fill.red { background: linear-gradient(90deg, #f43f5e, #fecdd3); }
body.dash-kepsek .timeline li { border-left-color: rgba(255, 255, 255, .14); }
body.dash-kepsek .timeline li::before { background: #ff9dbb; }
body.dash-kepsek .timeline small { color: #a99bbb; }

/* ======================= Panggung / hero ruang kendali ================== */
.kh-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
    gap: 1.6rem;
    align-items: center;
    padding: 1.75rem 1.85rem;
    border-radius: 22px;
    margin-bottom: 1.2rem;
    background: linear-gradient(125deg, #571a33 0%, #3a2050 42%, #1f2c52 76%, #182444 100%);
    border: 1px solid rgba(255, 255, 255, .16);
    box-shadow: 0 26px 60px rgba(8, 2, 16, .48), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.kh-hero::before {
    content: "";
    position: absolute;
    top: -45%; right: -8%;
    width: 58%; height: 190%;
    background: radial-gradient(closest-side, rgba(255, 255, 255, .22), transparent 72%);
    pointer-events: none;
}
.kh-hero::after {
    content: "";
    position: absolute;
    bottom: -60%; left: -12%;
    width: 55%; height: 150%;
    background: radial-gradient(closest-side, rgba(56, 189, 248, .34), transparent 72%);
    pointer-events: none;
}
.kh-teks, .kh-foto { position: relative; z-index: 1; }
.kh-eyebrow {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0 0 .45rem;
    font-size: .71rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #f0d3e2;
}
.kh-nadi {
    width: 8px; height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 4px rgba(74, 222, 128, .22), 0 0 12px rgba(74, 222, 128, .85);
    animation: nadiKedip 1.8s ease-in-out infinite;
}
@keyframes nadiKedip {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .55; transform: scale(.82); }
}
.kh-judul {
    margin: .1rem 0 .55rem;
    font-size: clamp(1.6rem, 3.2vw, 2.45rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -.01em;
    color: #fff;
}
.kh-judul span {
    display: block;
    background: linear-gradient(92deg, #ffe2ea 0%, #ffb0c8 45%, #c7dcff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.kh-sub {
    margin: 0 0 1.1rem;
    max-width: 46ch;
    font-size: .93rem;
    line-height: 1.6;
    color: #fdf4f9;
}
.kh-angka {
    display: flex;
    flex-wrap: wrap;
    gap: .9rem 1.6rem;
    margin: 0 0 1.2rem;
    padding: .85rem 1.1rem;
    border-radius: 14px;
    background: rgba(12, 6, 20, .28);
    border: 1px solid rgba(255, 255, 255, .14);
}
.kh-angka div { display: flex; flex-direction: column; gap: .18rem; }
.kh-angka dt {
    margin: 0;
    font-size: .67rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #dccbe8;
}
.kh-angka dd {
    margin: 0;
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    font-variant-numeric: tabular-nums;
}
.kh-angka dd small { font-size: .82rem; font-weight: 700; color: #ffc7d8; margin-left: .1rem; }
.kh-aksi { display: flex; flex-wrap: wrap; gap: .7rem; }
.kh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .62rem 1.1rem;
    border-radius: 11px;
    border: 1px solid transparent;
    font-size: .88rem;
    font-weight: 700;
    font-family: inherit;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.kh-btn:hover { text-decoration: none; }
.kh-btn-utama {
    background: linear-gradient(135deg, #ffe1ea, #ffb3c9);
    color: #4a1226;
    box-shadow: 0 12px 26px rgba(255, 150, 180, .28);
}
.kh-btn-utama:hover { transform: translateY(-1px); box-shadow: 0 16px 32px rgba(255, 150, 180, .40); color: #4a1226; }
.kh-btn-garis { background: rgba(255, 255, 255, .10); border-color: rgba(255, 255, 255, .34); color: #fff; }
.kh-btn-garis:hover { background: rgba(255, 255, 255, .20); color: #fff; }
.kh-btn-kecil { padding: .45rem .85rem; font-size: .79rem; }

.kh-foto {
    margin: 0;
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, .22);
    box-shadow: 0 18px 40px rgba(6, 2, 14, .45);
}
.kh-foto img {
    display: block;
    width: 100%;
    height: 214px;
    object-fit: cover;
    object-position: 32% 62%;
}
.kh-foto figcaption {
    position: absolute;
    inset: auto 0 0 0;
    display: flex;
    flex-direction: column;
    gap: .1rem;
    padding: .7rem .85rem;
    background: linear-gradient(180deg, rgba(10, 5, 16, 0), rgba(10, 5, 16, .88));
    font-size: .74rem;
}
.kh-foto figcaption strong { color: #fff; font-size: .86rem; }
.kh-foto figcaption span { color: #ddcfeb; }

/* ------------------- Tiga kartu pintas (gaya referensi) ---------------- */
.kh-kartu {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.kh-kartu-item {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    padding: 1rem 1.1rem;
    border-radius: 16px;
    background: var(--cin-kaca);
    border: 1px solid var(--cin-garis);
    box-shadow: 0 16px 34px rgba(6, 2, 14, .32), inset 0 1px 0 rgba(255, 255, 255, .10);
    text-decoration: none;
    transition: transform .16s ease, border-color .16s ease, box-shadow .2s ease;
}
.kh-kartu-item:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, .26);
    box-shadow: 0 22px 42px rgba(6, 2, 14, .45);
    text-decoration: none;
}
.kh-ikon {
    width: 42px; height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 180, 205, .30), rgba(120, 160, 255, .26));
    border: 1px solid rgba(255, 255, 255, .22);
    color: #ffe3ec;
}
.kh-ikon svg { width: 22px; height: 22px; }
.kh-kartu-teks { display: flex; flex-direction: column; gap: .18rem; min-width: 0; }
.kh-kartu-teks strong { color: #fff; font-size: .94rem; }
.kh-kartu-teks small { color: #c3b3d3; font-size: .79rem; line-height: 1.45; }

/* ===================== Diagram presentasi kehadiran ==================== */
.diagram-section { margin-bottom: 1.35rem; }
.diagram-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: .9rem;
}
.diagram-head h2 { margin: 0 0 .15rem; font-size: 1.22rem; }
.diagram-head p { margin: 0; font-size: .83rem; color: #b9a9c9; }
.diagram-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.1rem;
    margin-bottom: 1.1rem;
}
.panel-diagram {
    display: flex;
    flex-direction: column;
    gap: .85rem;
    padding: 1.15rem 1.2rem;
    border-radius: 18px;
    background: var(--cin-kaca);
    border: 1px solid var(--cin-garis);
    box-shadow: 0 18px 40px rgba(6, 2, 14, .34), inset 0 1px 0 rgba(255, 255, 255, .10);
    backdrop-filter: blur(10px) saturate(130%);
}
.panel-diagram-head { display: flex; align-items: center; justify-content: space-between; gap: .7rem; }
.panel-diagram-head h3 { margin: 0; font-size: .98rem; }
.panel-lencana {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: .2rem .55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .18);
    color: #e4d6ef;
    white-space: nowrap;
}
.donut { display: grid; place-items: center; }
.donut-svg { width: 100%; max-width: 200px; height: auto; }
.donut-jalur { stroke: rgba(255, 255, 255, .10); }
.donut-angka { fill: #fff; font-size: 25px; font-weight: 800; font-family: inherit; font-variant-numeric: tabular-nums; }
.donut-ket { fill: #b9a9c9; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; }
.legenda-donut {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .45rem .9rem;
}
.legenda-donut li { display: flex; align-items: center; gap: .45rem; font-size: .82rem; color: #d6c9e6; }
.legenda-donut .titik { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 3px; }
.legenda-donut .legenda-label { flex: 1; min-width: 0; }
.legenda-donut strong { font-size: .86rem; }
.legenda-donut small { font-size: .72rem; color: #a99bbb; }
.legenda-guru { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tren-svg { display: block; width: 100%; height: auto; }
.tren-bantu { stroke: rgba(255, 255, 255, .10); stroke-width: 1; stroke-dasharray: 4 6; }
.tren-area { fill: rgba(255, 166, 192, .20); }
.tren-garis { fill: none; stroke: #ffb3c9; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.tren-titik { fill: #ffe1ea; stroke: #b93a5e; stroke-width: 2; }
.tren-label { fill: #b9a9c9; font-size: 9.5px; }
.bar-tumpuk {
    display: flex;
    gap: 2px;
    height: 14px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, .10);
}
.bar-tumpuk span { display: block; height: 100%; }
.panel-catatan { margin: 0; font-size: .8rem; color: #b9a9c9; }
.panel-catatan strong { color: #fff; }
.bagian-judul { margin: 0 0 .8rem; font-size: 1.05rem; }

/* Di layar lebar bingkai foto dibuat setinggi panggung (seperti potret pada
   konsep referensi) supaya tidak ada ruang kosong di bawahnya. */
@media (min-width: 1081px) {
    .kh-foto { align-self: stretch; }
    .kh-foto img { height: 100%; min-height: 250px; }
}
@media (max-width: 1080px) {
    .kh-hero { grid-template-columns: 1fr; gap: 1.2rem; }
    .kh-foto img { height: 190px; }
    .kh-kartu { grid-template-columns: 1fr; }
    .diagram-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .kh-hero { padding: 1.25rem 1.15rem; border-radius: 18px; }
    .kh-angka { gap: .8rem 1.2rem; padding: .75rem .85rem; }
    .kh-angka dd { font-size: 1.4rem; }
    .kh-btn { width: 100%; }
    .legenda-donut, .legenda-guru { grid-template-columns: 1fr; }
    .panel-diagram { padding: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
    .kh-nadi { animation: none; }
    .kh-kartu-item, .kh-btn { transition: none; }
}

/* --------------------------------------------------------------------------
   Penjaga gulir mendatar: grid dengan "1fr" masih punya lebar minimum
   (min-content), sehingga tabel lebar bisa mendorong halaman melebihi layar
   ponsel. Grid satu kolom harus memakai minmax(0, 1fr).
   -------------------------------------------------------------------------- */
.card, .stat, .panel-diagram, .kh-kartu-item { min-width: 0; }
@media (max-width: 1080px) {
    .grid-side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
    .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: minmax(0, 1fr); }
}
