/* =====================================================================
   SISTEM BUKU INDUK SISWA — Design Tokens
   Palet   : Navy formal (#152A47) + emas aksen (#B8902E) — kesan resmi
             layaknya dokumen kependidikan, bukan tema admin generik.
   Tipografi: Plus Jakarta Sans (UI/antarmuka), Lora (dokumen cetak resmi)
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Lora:wght@500;600;700&family=JetBrains+Mono:wght@500&display=swap');

:root {
  --navy-900: #101E33;
  --navy-800: #152A47;
  --navy-700: #1D3A61;
  --navy-100: #E9EEF5;
  --gold-600: #B8902E;
  --gold-100: #FBF3DF;
  --ink: #1F2734;
  --ink-muted: #64748B;
  --bg: #F4F5F8;
  --surface: #FFFFFF;
  --line: #E4E7EC;
  --success: #2E7D5B;
  --success-bg: #E4F3EC;
  --danger: #B3432B;
  --danger-bg: #FBEAE5;
  --info: #2563A8;
  --info-bg: #E7F0FA;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16,30,51,0.04), 0 4px 16px rgba(16,30,51,0.06);
}

* { box-sizing: border-box; }

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14.5px;
}

.font-doc { font-family: 'Lora', Georgia, serif; }
.font-mono { font-family: 'JetBrains Mono', monospace; }

a { text-decoration: none; }

/* ---------- Layout shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-800) 100%);
  color: #fff;
  min-height: 100vh;
  position: sticky;
  top: 0;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand .school-name {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
}
.sidebar-brand .app-label {
  font-size: 11.5px;
  color: var(--gold-100);
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .85;
}

.sidebar-nav { padding: 14px 12px; flex: 1; }
.sidebar-nav .nav-section {
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin: 16px 10px 6px;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.82);
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: background .15s ease;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-nav a.active {
  background: var(--gold-600);
  color: var(--navy-900);
  font-weight: 700;
}
.sidebar-nav a .bi { font-size: 16px; width: 18px; text-align: center; }

.sidebar-foot {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12.5px;
  color: rgba(255,255,255,0.55);
}

.main-content { flex: 1; min-width: 0; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .page-title { font-weight: 700; font-size: 18px; color: var(--navy-900); }
.topbar .page-desc { font-size: 12.5px; color: var(--ink-muted); }

.content-area { padding: 24px; }

/* ---------- Cards ---------- */
.card-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-panel .card-panel-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-panel .card-panel-head h6 { margin: 0; font-weight: 700; color: var(--navy-900); }
.card-panel .card-panel-body { padding: 20px; }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold-600);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.stat-card .stat-value { font-size: 26px; font-weight: 800; color: var(--navy-900); line-height: 1.1; }
.stat-card .stat-label { font-size: 12.5px; color: var(--ink-muted); margin-top: 4px; }

/* ---------- Buttons ---------- */
.btn-navy {
  background: var(--navy-800); border-color: var(--navy-800); color: #fff;
}
.btn-navy:hover { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }
.btn-gold {
  background: var(--gold-600); border-color: var(--gold-600); color: #fff;
}
.btn-gold:hover { background: #9c7a26; border-color: #9c7a26; color: #fff; }
.btn-outline-navy { border: 1px solid var(--navy-800); color: var(--navy-800); background: transparent; }
.btn-outline-navy:hover { background: var(--navy-800); color: #fff; }

/* ---------- Tables ---------- */
.table-clean thead th {
  background: var(--navy-100);
  color: var(--navy-900);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 700;
  border-bottom: none;
  padding: 10px 14px;
}
.table-clean tbody td { padding: 11px 14px; vertical-align: middle; border-color: var(--line); }
.table-clean tbody tr:hover { background: #FAFBFD; }

/* ---------- Badges ---------- */
.badge-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .02em;
}
.badge-aktif { background: var(--success-bg); color: var(--success); }
.badge-lulus { background: var(--info-bg); color: var(--info); }
.badge-keluar { background: var(--danger-bg); color: var(--danger); }
.badge-pindah { background: var(--gold-100); color: #8a6a1f; }

/* ---------- Forms ---------- */
.form-label { font-weight: 600; font-size: 13px; color: var(--navy-900); }
.form-control:focus, .form-select:focus {
  border-color: var(--navy-700);
  box-shadow: 0 0 0 3px rgba(21,42,71,0.12);
}
.section-divider {
  font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--gold-600); margin: 22px 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--gold-100);
}
.section-divider:first-child { margin-top: 0; }

/* ---------- Login page ---------- */
.login-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 20% 20%, var(--navy-700), var(--navy-900) 65%);
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 380px; background: var(--surface); border-radius: 14px;
  padding: 34px 32px; box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.login-seal {
  width: 56px; height: 56px; border-radius: 50%; background: var(--gold-600); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800;
  margin: 0 auto 14px;
}

/* ---------- Print (Buku Induk resmi) ---------- */
.doc-sheet {
  background: #fff; max-width: 900px; margin: 0 auto; padding: 40px 48px;
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.doc-kop { display: flex; align-items: center; gap: 16px; border-bottom: 3px double var(--navy-900); padding-bottom: 14px; margin-bottom: 22px; }
.doc-kop img { width: 64px; height: 64px; object-fit: contain; }
.doc-kop .doc-kop-text { text-align: center; flex: 1; font-family: 'Lora', serif; }
.doc-kop .doc-kop-text .nama-sekolah { font-size: 19px; font-weight: 700; color: var(--navy-900); }
.doc-kop .doc-kop-text .alamat-sekolah { font-size: 12px; color: var(--ink-muted); }
.doc-title { text-align: center; font-family: 'Lora', serif; font-weight: 700; font-size: 16px; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 22px; text-decoration: underline; text-underline-offset: 6px; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.doc-table td, .doc-table th { border: 1px solid #C7CDD6; padding: 7px 10px; }
.doc-table td.label { background: #FAFBFC; width: 34%; font-weight: 600; color: var(--navy-900); }
.doc-photo-box { width: 110px; height: 140px; border: 1px solid #C7CDD6; display: flex; align-items: center; justify-content: center; color: var(--ink-muted); font-size: 11px; text-align:center; overflow: hidden; }
.doc-photo-box img { width: 100%; height: 100%; object-fit: cover; }
.doc-signature { display: flex; justify-content: flex-end; margin-top: 40px; font-family: 'Lora', serif; }
.doc-signature .sign-block { text-align: center; width: 240px; }
.doc-signature .sign-space { height: 70px; }

@media print {
  .no-print { display: none !important; }
  .doc-sheet { border: none; box-shadow: none; max-width: 100%; padding: 0; }
  body { background: #fff; }
}
