/* ============================================================
   Sistem BK Sekolah — desain formal kedinasan
   Hijau tua + emas, serif elegan, rapi dan berwibawa
   ============================================================ */

:root {
  --hijau-950: #06281c;
  --hijau-900: #0a3d2c;
  --hijau-800: #0e4f37;
  --hijau-700: #126a4a;
  --hijau-600: #1a7f5a;
  --emas-600: #a87f16;
  --emas-500: #c9a227;
  --emas-400: #d9b84a;
  --emas-100: #f6efd8;

  --ivory: #f5f3ec;
  --white: #ffffff;
  --ink: #21302a;
  --muted: #67736d;
  --line: #e3dfd1;

  --ok: #1e7f4f;
  --ok-bg: #e7f5ec;
  --warn: #a86a12;
  --warn-bg: #fbf1dc;
  --danger: #b3261e;
  --danger-bg: #fbe9e7;
  --info: #2563a8;
  --info-bg: #e8f1fb;

  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --shadow: 0 2px 10px rgba(20, 40, 30, 0.06);
  --shadow-lg: 0 14px 40px -12px rgba(10, 40, 28, 0.25);
  --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scrollbar-color: rgba(14, 79, 55, 0.35) transparent; }

body {
  font-family: var(--sans);
  background: var(--ivory);
  color: var(--ink);
  min-height: 100vh;
  font-size: 14.5px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--hijau-700); text-decoration: none; }
a:hover { color: var(--hijau-900); }

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

/* ============ Sidebar ============ */
.sidebar {
  width: 264px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--hijau-950) 0%, var(--hijau-900) 45%, var(--hijau-800) 100%);
  color: #eef4ef;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid rgba(201, 162, 39, 0.35);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 20px 20px;
  border-bottom: 1px solid rgba(201, 162, 39, 0.25);
}

.sidebar-brand img { width: 46px; height: auto; }

.sidebar-brand-text .kementrian {
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--emas-400);
  font-weight: 600;
  display: block;
}

.sidebar-brand-text .sekolah {
  font-family: var(--serif);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
  display: block;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-section {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(230, 240, 233, 0.45);
  padding: 14px 12px 6px;
  font-weight: 600;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  color: rgba(238, 244, 239, 0.82);
  font-size: 13.5px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}

.nav-link svg { flex-shrink: 0; color: var(--emas-400); }

.nav-link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.nav-link.active {
  background: rgba(201, 162, 39, 0.16);
  color: #fff;
  border-left-color: var(--emas-500);
  font-weight: 600;
}

.sidebar-foot {
  padding: 16px 20px;
  border-top: 1px solid rgba(201, 162, 39, 0.25);
  font-size: 11px;
  color: rgba(230, 240, 233, 0.5);
  line-height: 1.5;
}

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

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-title h1 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--hijau-900);
  letter-spacing: -0.01em;
}

.topbar-title .crumb {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.topbar-right { display: flex; align-items: center; gap: 14px; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ivory);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px 6px 6px;
}

.user-chip .avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--hijau-700), var(--hijau-900));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
}

.user-chip .meta .name { font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.user-chip .meta .role { font-size: 10.5px; color: var(--muted); text-transform: capitalize; }

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid #f3cdca;
  border-radius: 9px;
  padding: 8px 13px;
  transition: all 0.2s ease;
}

.btn-logout:hover { background: var(--danger); color: #fff; }

.content { padding: 26px 28px 48px; max-width: 1200px; width: 100%; }

/* ============ Flash messages ============ */
.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-radius: 12px;
  margin-bottom: 18px;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid;
  animation: fade-in 0.35s ease both;
}
.flash-success { background: var(--ok-bg); border-color: #c4e6d2; color: var(--ok); }
.flash-error { background: var(--danger-bg); border-color: #f3cdca; color: var(--danger); }
.flash-info { background: var(--info-bg); border-color: #c9ddf5; color: var(--info); }

@keyframes fade-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ============ Cards & stats ============ */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfaf5, #ffffff);
}

.card-head h3 {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--hijau-900);
}

.card-body { padding: 20px; }
.card-body.flush { padding: 0; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 4px solid var(--emas-500);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.stat-card .icon {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 22px;
  flex-shrink: 0;
  color: #fff;
}

.stat-card .icon.hijau { background: linear-gradient(135deg, var(--hijau-600), var(--hijau-900)); }
.stat-card .icon.emas { background: linear-gradient(135deg, var(--emas-400), var(--emas-600)); }
.stat-card .icon.merah { background: linear-gradient(135deg, #d85a52, #a3251d); }
.stat-card .icon.biru { background: linear-gradient(135deg, #4d8fd6, #1f4f8f); }

.stat-card .value { font-family: var(--serif); font-size: 27px; font-weight: 800; color: var(--hijau-900); line-height: 1.1; }
.stat-card .label { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

/* ============ Tables ============ */
.table-wrap { overflow-x: auto; }

table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.table thead th {
  background: #f1eee2;
  color: var(--hijau-900);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  text-align: left;
  padding: 12px 14px;
  border-bottom: 2px solid var(--emas-500);
  white-space: nowrap;
}

.table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.table tbody tr { transition: background 0.15s ease; }
.table tbody tr:hover { background: #faf8f1; }

.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ============ Badges ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 4px 11px;
  white-space: nowrap;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.emas { background: var(--emas-100); color: var(--emas-600); }

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 10px;
  padding: 10px 18px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--hijau-700), var(--hijau-900));
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(10, 61, 44, 0.55);
}
.btn-primary:hover { filter: brightness(1.12); transform: translateY(-1px); }

.btn-gold {
  background: linear-gradient(135deg, var(--emas-400), var(--emas-600));
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(168, 127, 22, 0.55);
}
.btn-gold:hover { filter: brightness(1.08); transform: translateY(-1px); }

.btn-ghost {
  background: var(--white);
  border-color: var(--line);
  color: var(--hijau-900);
}
.btn-ghost:hover { border-color: var(--hijau-600); background: #f4faf6; }

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: #f3cdca;
}
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-xs { padding: 4px 9px; font-size: 11px; border-radius: 7px; }

/* ============ Forms ============ */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 18px; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 12px; font-weight: 700; color: var(--hijau-900); margin-bottom: 6px; letter-spacing: 0.02em; }
.form-row label .req { color: var(--danger); }

.input, .select, .textarea {
  width: 100%;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d8d4c4;
  border-radius: 10px;
  padding: 10px 13px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--hijau-600);
  box-shadow: 0 0 0 4px rgba(26, 127, 90, 0.12);
}

.textarea { min-height: 84px; resize: vertical; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.filter-bar .input, .filter-bar .select { width: auto; min-width: 160px; }
.filter-bar .input.cari { flex: 1; min-width: 200px; }

/* ============ Grafik tren alpa ============ */
.trend-chart {
  width: 100%;
  min-height: 260px;
}

.trend-svg {
  width: 100%;
  height: auto;
  display: block;
}

.trend-grid {
  stroke: #e8e2d2;
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.trend-ylbl {
  font-size: 11px;
  fill: var(--muted);
  font-family: var(--sans);
}

.trend-xlbl {
  font-size: 11px;
  fill: var(--muted);
  font-family: var(--sans);
}

.trend-area {
  fill: rgba(184, 134, 11, 0.10);
}

.trend-line {
  fill: none;
  stroke: var(--emas-500);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-line-before {
  fill: none;
  stroke: #8a8577;
  stroke-width: 2;
  stroke-dasharray: 6 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-dot {
  fill: var(--emas-500);
  stroke: #fff;
  stroke-width: 1.5;
}

.trend-dot-before {
  fill: #fff;
  stroke: #8a8577;
  stroke-width: 1.5;
}

.trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-item .sw {
  display: inline-block;
  width: 22px;
  height: 0;
  border-top: 3px solid;
}

.legend-item .sw-main {
  border-color: var(--emas-500);
}

.legend-item .sw-before {
  border-color: #8a8577;
  border-top-style: dashed;
  border-top-width: 2px;
}

.trend-note {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--muted);
}

.trend-range {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--sans);
  font-weight: 500;
  margin-left: 8px;
}

.trend-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.trend-subtitle {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--hijau-900);
  margin-bottom: 6px;
}

@media (max-width: 900px) {
  .trend-duo {
    grid-template-columns: 1fr;
  }
}

/* ============ Pagination ============ */
.pagination {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  padding: 16px 20px;
  flex-wrap: wrap;
}

.page-link {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--hijau-900);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.page-link:hover { border-color: var(--hijau-600); }
.page-link.active { background: var(--hijau-800); color: #fff; border-color: var(--hijau-800); }
.page-info { font-size: 12.5px; color: var(--muted); margin-right: auto; }

/* ============ Dashboard ============ */
.hero-panel {
  background: linear-gradient(120deg, var(--hijau-950) 0%, var(--hijau-800) 70%, var(--hijau-700) 100%);
  border-radius: var(--radius);
  color: #f2f7f3;
  padding: 28px 30px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.hero-panel::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 162, 39, 0.35), transparent 70%);
}

.hero-panel h2 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
}

.hero-panel p { color: rgba(242, 247, 243, 0.75); font-size: 13.5px; max-width: 56ch; }
.hero-panel .tgl { font-size: 12px; color: var(--emas-400); font-weight: 600; }

.alert-table td.alpa { font-weight: 800; font-variant-numeric: tabular-nums; }

/* ============ Detail siswa ============ */
.profile-card {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  padding: 24px;
  flex-wrap: wrap;
}

.profile-photo {
  width: 108px;
  height: 108px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--hijau-600), var(--hijau-900));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 40px;
  font-weight: 800;
  font-family: var(--serif);
  flex-shrink: 0;
  border: 3px solid var(--emas-500);
}

.profile-info h3 { font-family: var(--serif); font-size: 21px; color: var(--hijau-900); margin-bottom: 4px; }
.profile-info .sub { color: var(--muted); font-size: 13px; margin-bottom: 12px; }

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px 22px;
}

.profile-grid .item { display: flex; gap: 8px; font-size: 13.5px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.profile-grid .item .k { color: var(--muted); min-width: 110px; }

.summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.summary-box {
  background: #fbfaf5;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  text-align: center;
}

.summary-box .v { font-family: var(--serif); font-size: 24px; font-weight: 800; }
.summary-box .v.alpa { color: var(--danger); }
.summary-box .v.hadir { color: var(--ok); }
.summary-box .v.sakit { color: var(--warn); }
.summary-box .v.izin { color: var(--info); }
.summary-box .l { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

/* ============ Filter pilihan siswa (jurusan / tingkat / kelas) ============ */
.siswa-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  background: #fbfaf5;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.siswa-filter-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--hijau-900);
  margin-right: 2px;
  white-space: nowrap;
}

.siswa-filter .select { width: auto; min-width: 170px; }

.siswa-filter-count {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}

/* ============ Data siswa per jurusan / tingkat / kelas ============ */
.jurusan-block {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 5px solid var(--emas-500);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 22px;
}

.jurusan-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: linear-gradient(180deg, #fbfaf5, #f3f0e2);
  border-bottom: 1px solid var(--line);
}

.jurusan-badge {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--hijau-700), var(--hijau-900));
  border-radius: 9px;
  padding: 6px 12px;
  letter-spacing: 0.04em;
}

.jurusan-nama {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--hijau-900);
}

.jurusan-jml {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 13px;
}

.tingkat-block {
  padding: 10px 20px 16px;
}

.tingkat-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 8px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
}

.tingkat-label {
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--emas-600);
}

.tingkat-jml {
  font-size: 11.5px;
  color: var(--muted);
  margin-left: auto;
}

.kelas-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.kelas-group[open] {
  border-color: rgba(201, 162, 39, 0.6);
  box-shadow: 0 6px 18px -10px rgba(10, 40, 28, 0.25);
}

.kelas-group summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background 0.15s ease;
}

.kelas-group summary::-webkit-details-marker { display: none; }

.kelas-group summary:hover { background: #faf8f1; }

.kelas-chev {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--emas-100);
  color: var(--emas-600);
  flex-shrink: 0;
  transition: transform 0.2s ease, background 0.2s ease;
}

.kelas-group[open] .kelas-chev { transform: rotate(90deg); background: var(--emas-500); color: #fff; }

.kelas-chev svg { width: 13px; height: 13px; }

.kelas-nama {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--hijau-900);
}

.kelas-chip {
  font-size: 11px;
  font-weight: 700;
  color: var(--hijau-700);
  background: var(--ok-bg);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

.kelas-chip.warn { color: var(--warn); background: var(--warn-bg); }
.kelas-chip.ok { color: var(--ok); background: var(--ok-bg); }

.kelas-walas {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}

.kelas-walas svg {
  width: 14px;
  height: 14px;
  color: var(--hijau-700);
  flex-shrink: 0;
}

.kelas-walas strong {
  color: var(--hijau-900);
  font-weight: 700;
}

.kelas-total {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.kelas-group .table-wrap { border-top: 1px solid var(--line); }

.group-summary {
  display: flex;
  gap: 22px;
  justify-content: center;
  padding: 6px 0 10px;
  font-size: 12.5px;
  color: var(--muted);
}

.group-summary strong { font-family: var(--serif); font-size: 16px; color: var(--hijau-900); }

/* ============ Login (split: hero kiri + form kanan) ============ */
.login-body {
  min-height: 100vh;
  display: flex;
  padding: 0;
  background: var(--white);
}

.login-split {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* --- Panel kiri: hero gerbang --- */
.login-hero {
  position: relative;
  flex: 1.25;
  min-width: 0;
  overflow: hidden;
  color: #fff;
  display: flex;
  align-items: flex-end;
  padding: 44px 46px;
  background: var(--hijau-950);
}

.login-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
  animation: hero-zoom 14s ease-out both;
}

@keyframes hero-zoom { from { transform: scale(1.12); } to { transform: scale(1.02); } }

.login-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(200deg, rgba(6, 40, 28, 0.10) 0%, rgba(6, 40, 28, 0.55) 55%, rgba(4, 26, 18, 0.94) 100%);
}

.login-hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow-y: auto;
}

.login-hero-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(230, 240, 233, 0.22);
  margin-bottom: auto;
}

.login-hero-brand img {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #fff;
  padding: 5px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.login-hero-brand .kementrian {
  display: block;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--emas-400);
  font-weight: 700;
}

.login-hero-brand .sekolah {
  display: block;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 800;
  line-height: 1.25;
  margin-top: 3px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.login-hero-mid {
  max-width: 460px;
  padding: 40px 0 34px;
}

.login-hero-mid .hero-eyebrow {
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--emas-400);
  font-weight: 700;
  margin-bottom: 14px;
}

.login-hero-mid h1 {
  font-family: var(--serif);
  font-size: clamp(30px, 3.4vw, 44px);
  font-weight: 800;
  line-height: 1.18;
  margin-bottom: 16px;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.5);
}

.login-hero-mid p {
  font-size: 14.5px;
  line-height: 1.75;
  color: rgba(242, 247, 243, 0.85);
  max-width: 46ch;
}

.login-hero-foot {
  display: flex;
  gap: 34px;
  flex-wrap: wrap;
}

.login-hero-foot .hero-foot-item strong {
  display: block;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 800;
  color: var(--emas-400);
  line-height: 1.2;
}

.login-hero-foot .hero-foot-item span {
  font-size: 11.5px;
  color: rgba(242, 247, 243, 0.72);
  letter-spacing: 0.04em;
}

/* --- Panel kanan: form --- */
.login-panel {
  flex: 1;
  min-width: 0;
  display: grid;
  place-items: center;
  padding: 40px 32px;
  background:
    radial-gradient(700px 400px at 110% -5%, rgba(201, 162, 39, 0.12), transparent 60%),
    radial-gradient(600px 500px at -10% 110%, rgba(18, 106, 74, 0.08), transparent 60%),
    linear-gradient(180deg, #fdfcf8, #f6f4ec);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.97);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid rgba(201, 162, 39, 0.35);
  animation: rise 0.5s ease both;
}

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.login-head {
  background: linear-gradient(135deg, var(--hijau-900), var(--hijau-800));
  text-align: center;
  padding: 28px 24px 22px;
  color: #fff;
  border-bottom: 4px solid var(--emas-500);
}

.login-head-logo img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #fff;
  padding: 4px;
  margin-bottom: 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.login-head .instansi { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--emas-400); font-weight: 700; }
.login-head h1 { font-family: var(--serif); font-size: 21px; margin-top: 6px; font-weight: 700; }
.login-head p { font-size: 12px; color: rgba(255,255,255,0.7); margin-top: 4px; }

.login-body-form { padding: 26px 28px 30px; }

.login-field { margin-bottom: 16px; }
.login-field label { display: block; font-size: 12px; font-weight: 700; color: var(--hijau-900); margin-bottom: 7px; }

.login-input-wrap {
  position: relative;
}

.login-input-wrap svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--hijau-700);
  pointer-events: none;
}

.login-input {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  border: 1px solid #d8d4c4;
  border-radius: 11px;
  padding: 12px 14px 12px 40px;
  outline: none;
  transition: all 0.2s ease;
}

.login-input:focus { border-color: var(--hijau-600); box-shadow: 0 0 0 4px rgba(26, 127, 90, 0.12); }

.login-btn {
  width: 100%;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--hijau-700), var(--hijau-900));
  border: none;
  border-radius: 11px;
  padding: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 10px 24px -10px rgba(10, 61, 44, 0.6);
}

.login-btn:hover { filter: brightness(1.12); transform: translateY(-1px); }

.login-foot { text-align: center; font-size: 11.5px; color: var(--muted); margin-top: 16px; }

/* --- Responsive login --- */
@media (max-width: 860px) {
  .login-split { flex-direction: column; }
  .login-hero {
    flex: none;
    min-height: 240px;
    align-items: flex-end;
    padding: 26px 28px;
  }
  .login-hero-brand img { width: 46px; height: 46px; }
  .login-hero-brand .sekolah { font-size: 15px; }
  .login-hero-mid { padding: 20px 0 0; max-width: 100%; }
  .login-hero-mid h1 { font-size: 24px; }
  .login-hero-mid p, .login-hero-foot { display: none; }
  .login-panel { padding: 28px 20px 44px; }
}

/* ============ Print letters (surat kedinasan) ============ */
.letter-page {
  max-width: 820px;
  margin: 0 auto;
  background: #fff;
  padding: 46px 58px;
  font-family: "Times New Roman", Times, serif;
  font-size: 12.5pt;
  color: #111;
  line-height: 1.65;
  box-shadow: var(--shadow-lg);
}

.letter-kop { text-align: center; margin-bottom: 4px; }
.letter-kop .baris1 { font-size: 11pt; font-weight: 700; letter-spacing: 0.06em; }
.letter-kop .baris2 { font-size: 12.5pt; font-weight: 700; letter-spacing: 0.04em; }
.letter-kop .sekolah { font-size: 16pt; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.letter-kop .alamat { font-size: 10pt; }

.letter-kop-wrap { display: flex; align-items: center; justify-content: center; gap: 16px; padding-bottom: 6px; }
.letter-kop-wrap img { width: 74px; height: auto; }
.letter-kop-text { text-align: center; }

.letter-rule { border: none; border-top: 2.5px solid #111; margin: 6px 0 0; }
.letter-rule.thin { border-top-width: 1px; margin-top: 2px; }

.letter-meta { display: flex; justify-content: flex-end; gap: 70px; font-size: 12pt; margin: 18px 0 4px; }
.letter-meta .col .lbl { display: inline-block; min-width: 74px; }
.letter-meta .col .val { display: inline-block; }

.letter-perihal { margin: 8px 0 18px; }
.letter-perihal .row { display: flex; }
.letter-perihal .row .lbl { min-width: 74px; }

.letter-address { margin-bottom: 14px; }
.letter-body p { text-align: justify; margin-bottom: 10px; text-indent: 0; }
.letter-body p.alinea { text-indent: 42px; }

.letter-title { text-align: center; font-weight: 700; text-decoration: underline; font-size: 13pt; margin: 6px 0 14px; }

.letter-points { margin: 8px 0 14px 28px; }
.letter-points li { margin-bottom: 7px; text-align: justify; }

.letter-signs { display: flex; justify-content: space-between; gap: 40px; margin-top: 26px; }
.letter-signs .sign { text-align: center; font-size: 12pt; }
.letter-signs .sign .gap { height: 74px; }
.letter-signs .sign .u { text-decoration: underline; font-weight: 700; }

.letter-printbar {
  max-width: 820px;
  margin: 18px auto;
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform 0.25s ease; }
  .sidebar.open { transform: translateX(0); }
  .content { padding: 18px 16px 40px; }
  .topbar { padding: 12px 16px; }
  .letter-page { padding: 30px 26px; box-shadow: none; }
  .kelas-group summary { flex-wrap: wrap; row-gap: 6px; }
  .kelas-walas { width: 100%; }
  .kelas-total { margin-left: 0; width: 100%; }
  .jurusan-head { flex-wrap: wrap; }
  .jurusan-jml { margin-left: auto; }
}

@media (max-width: 560px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .topbar-right .user-chip { display: none; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
