/* =========================================================
   LMS Sekolah — Tema Biru Muda Gradasi
   ========================================================= */
:root {
  --sky-50:  #f2f9ff;
  --sky-100: #e3f3ff;
  --sky-200: #c4e6ff;
  --sky-300: #9dd5fd;
  --sky-400: #6cc0f8;
  --sky-500: #3fa9f0;
  --sky-600: #238fd8;
  --sky-700: #1771b0;
  --navy:    #0d3b66;
  --ink:     #1f3550;
  --muted:   #6a819b;
  --line:    #d7eafa;
  --body-green: #e9f8ec;
  --grad-body:    linear-gradient(160deg, #eaf8ed 0%, #d9f2df 55%, #c8ecd2 100%);
  --grad-main:    linear-gradient(135deg, #8fd3ff 0%, #5db8f5 45%, #3a9ee8 100%);
  --grad-soft:    linear-gradient(135deg, #f4faff 0%, #e2f2ff 100%);
  --grad-sidebar: linear-gradient(180deg, #d7efff 0%, #bfe4ff 45%, #e9f6ff 100%);
  --radius: 14px;
  --shadow: 0 6px 22px rgba(35, 143, 216, .10);
  --bs-primary: #3fa9f0;
  --bs-primary-rgb: 63, 169, 240;
  --bs-link-color: #1d84cc;
  --bs-link-color-rgb: 29, 132, 204;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--grad-body) fixed;
  font-size: .925rem;
}

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 270px; flex-shrink: 0;
  background: var(--grad-sidebar);
  border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 18px 14px 30px;
  z-index: 1040;
}
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { padding: 24px; flex: 1; }
.app-footer { padding: 14px 24px; color: var(--muted); font-size: .8rem; }

/* ---------- Brand ---------- */
.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; margin-bottom: 14px;
  background: rgba(255,255,255,.65);
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(35,143,216,.08);
}
.brand img { width: 44px; height: 44px; object-fit: contain; border-radius: 10px; background: #fff; padding: 3px; }
.brand-name { font-weight: 800; color: var(--navy); line-height: 1.2; font-size: .95rem; }
.brand-sub { font-size: .72rem; color: var(--muted); }

/* ---------- Sidebar nav ---------- */
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item, .nav-sub {
  display: flex; align-items: center; gap: 11px;
  width: 100%; border: 0; background: transparent; text-align: left;
  padding: 10px 12px; border-radius: 11px;
  color: var(--navy); font-weight: 600; text-decoration: none;
  transition: background .15s, color .15s, transform .15s;
}
.nav-item i:first-child, .nav-sub i:first-child { font-size: 1.08rem; width: 20px; text-align: center; color: var(--sky-600); }
.nav-item:hover, .nav-sub:hover { background: rgba(255,255,255,.7); color: var(--sky-700); }
.nav-item.active, .nav-sub.active {
  background: var(--grad-main); color: #fff;
  box-shadow: 0 6px 16px rgba(58,158,232,.35);
}
.nav-item.active i, .nav-sub.active i { color: #fff !important; }
.nav-group .caret { margin-left: auto; font-size: .75rem; transition: transform .2s; }
.nav-group[aria-expanded="true"] .caret { transform: rotate(180deg); }
.nav-sub { padding: 8px 12px 8px 22px; font-weight: 500; font-size: .875rem; }
.nav-sub i:first-child { font-size: .95rem; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 1020;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 24px;
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.page-title { font-size: 1.2rem; font-weight: 800; margin: 0; color: var(--navy); }
.btn-icon { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 5px 10px; font-size: 1.2rem; }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); background: #fff; border-radius: 40px;
  padding: 4px 14px 4px 4px; color: var(--ink);
}
.user-chip small { color: var(--muted); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
  background: var(--grad-main); color: #fff; font-weight: 700;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Cards ---------- */
.card {
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); background: #fff;
}
.card-header {
  background: var(--grad-soft); border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0 !important;
  font-weight: 700; color: var(--navy); padding: 14px 18px;
}
.stat-card {
  border-radius: var(--radius); padding: 18px; color: #fff; position: relative; overflow: hidden;
  background: var(--grad-main); box-shadow: 0 10px 24px rgba(58,158,232,.25);
}
.stat-card.alt  { background: linear-gradient(135deg, #a5e1ff 0%, #57c0f0 100%); }
.stat-card.alt2 { background: linear-gradient(135deg, #b9e3ff 0%, #4ea3e6 100%); }
.stat-card.alt3 { background: linear-gradient(135deg, #9fdcf7 0%, #2f9ad8 100%); }
.stat-card .label { font-size: .8rem; opacity: .92; font-weight: 600; }
.stat-card .value { font-size: 1.75rem; font-weight: 800; line-height: 1.2; }
.stat-card i { position: absolute; right: 14px; bottom: 4px; font-size: 3.2rem; opacity: .25; }
.welcome {
  border-radius: var(--radius); padding: 22px 24px; margin-bottom: 20px;
  background: var(--grad-main); color: #fff; box-shadow: 0 10px 28px rgba(58,158,232,.28);
}
.welcome h2 { font-weight: 800; font-size: 1.35rem; margin: 0 0 4px; }

/* ---------- Buttons ---------- */
.btn { border-radius: 10px; font-weight: 600; }
.btn-primary {
  background: linear-gradient(135deg, #5fbcf6 0%, #2f98e2 100%);
  border: 0; box-shadow: 0 4px 12px rgba(47,152,226,.3);
}
.btn-primary:hover, .btn-primary:focus { background: linear-gradient(135deg, #48b0f2 0%, #1f87d1 100%); }
.btn-light-blue { background: var(--sky-100); color: var(--sky-700); border: 1px solid var(--sky-200); }
.btn-light-blue:hover { background: var(--sky-200); color: var(--navy); }
.btn-xs { padding: 3px 8px; font-size: .78rem; border-radius: 8px; }

/* ---------- Tables ---------- */
.table { --bs-table-hover-bg: #f1f9ff; margin-bottom: 0; }
.table thead th {
  background: var(--sky-50); color: var(--navy); font-weight: 700; font-size: .8rem;
  text-transform: uppercase; letter-spacing: .03em; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { vertical-align: middle; border-color: #edf5fc; }
.table .actions { white-space: nowrap; text-align: right; }
audio.audio-mini { height: 32px; width: 210px; max-width: 100%; vertical-align: middle; }
.thumb { width: 38px; height: 38px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

/* ---------- Forms ---------- */
.form-control, .form-select { border-radius: 10px; border-color: #cfe5f7; }
.form-control:focus, .form-select:focus { border-color: var(--sky-400); box-shadow: 0 0 0 .2rem rgba(63,169,240,.2); }
.form-label { font-weight: 600; color: var(--navy); font-size: .85rem; }
.form-check-input:checked { background-color: var(--sky-500); border-color: var(--sky-500); }
.req::after { content: ' *'; color: #e05a5a; }

/* ---------- Badges ---------- */
.badge { font-weight: 600; padding: .42em .7em; border-radius: 8px; }
.badge-soft-primary { background: #dcefff; color: #1771b0; }
.badge-soft-success { background: #ddf6ea; color: #157a4a; }
.badge-soft-warning { background: #fff2d6; color: #946200; }
.badge-soft-danger  { background: #ffe1e1; color: #b22a2a; }
.badge-soft-secondary { background: #eef2f6; color: #4c5d70; }
.badge-soft-info { background: #dcf6ff; color: #0b6e8f; }

/* ---------- Permission matrix ---------- */
.perm-table td, .perm-table th { text-align: center; }
.perm-table td:first-child, .perm-table th:first-child { text-align: left; }
.perm-group td { background: var(--sky-100) !important; font-weight: 800; color: var(--navy); }
.perm-fn { display: inline-flex; align-items: center; gap: 4px; margin: 2px 6px; font-size: .8rem; white-space: nowrap; }

/* ---------- Empty / misc ---------- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state i { font-size: 3.4rem; color: var(--sky-400); }
.empty-state h4 { color: var(--navy); font-weight: 800; margin-top: 10px; }
.list-clean { list-style: none; padding: 0; margin: 0; }
.list-clean li { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.list-clean li:last-child { border-bottom: 0; }
.logo-preview { width: 120px; height: 120px; object-fit: contain; border-radius: 16px; background: var(--grad-soft); border: 1px dashed var(--sky-300); padding: 10px; }

/* ---------- Auth pages ---------- */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: linear-gradient(135deg, #d4efff 0%, #8fd0fb 45%, #4aa8ee 100%);
}
.auth-card {
  width: 100%; max-width: 420px; background: rgba(255,255,255,.93);
  border-radius: 22px; padding: 34px 30px; box-shadow: 0 20px 60px rgba(13,59,102,.2);
}
.auth-card .logo { width: 82px; height: 82px; object-fit: contain; display: block; margin: 0 auto 12px; }
.auth-card h1 { font-size: 1.35rem; font-weight: 800; text-align: center; color: var(--navy); margin-bottom: 2px; }

/* ---------- Responsive ---------- */
.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .25s; box-shadow: 0 0 40px rgba(0,0,0,.15); }
  .sidebar.show { transform: none; }
  .sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(13,59,102,.3); z-index: 1030; }
  .content { padding: 16px; }
  .topbar { padding: 12px 16px; }
}
@media print {
  .sidebar, .topbar, .app-footer, .no-print { display: none !important; }
  .content { padding: 0; }
}

/* ---------- Pagination & misc ---------- */
.pagination { --bs-pagination-active-bg: #3fa9f0; --bs-pagination-active-border-color: #3fa9f0; --bs-pagination-color: #1d84cc; --bs-pagination-border-radius: 10px; }
.alert { border-radius: 12px; }
.alert-info { background: #e3f3ff; border-color: #c4e6ff; color: #0d3b66; }
a.text-decoration-none .stat-card { transition: transform .15s; }
a.text-decoration-none:hover .stat-card { transform: translateY(-2px); }

/* ---------- Area body hijau muda ---------- */
.main { background: var(--grad-body); }
.topbar { background: rgba(244, 252, 245, .85); border-bottom-color: #cdebd3; }
.app-footer { color: #5f8a68; }
.card { border-color: #d3eedb; }
.table { --bs-table-hover-bg: #f1fbf3; }
.empty-state i { color: #5cc177; }

/* ---------- Halaman scan (presensi / kasir / sirkulasi) ---------- */
.scan-input-wrap { position: relative; }
.scan-input-wrap i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-size: 1.5rem; color: var(--sky-500); }
.scan-input-wrap input { padding-left: 54px; height: 60px; font-size: 1.15rem; border: 2px dashed var(--sky-300); background: #f7fcff; }
.scan-input-wrap input:focus { border-style: solid; }
.scan-result {
  display: flex; align-items: center; gap: 18px; padding: 20px; border-radius: 18px; min-height: 130px;
  transition: background .25s, border-color .25s; border: 2px solid transparent;
}
.scan-result.idle    { background: var(--sky-50); border-color: var(--sky-200); color: var(--muted); }
.scan-result.success { background: #e3f7e9; border-color: #8fd6a5; }
.scan-result.warning { background: #fff5dc; border-color: #f2cf73; }
.scan-result.danger  { background: #ffe6e6; border-color: #f2a1a1; }
.scan-result.info    { background: #e3f3ff; border-color: #9dd5fd; }
.scan-avatar {
  width: 86px; height: 86px; border-radius: 18px; flex-shrink: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center; font-size: 2.6rem;
  background: #fff; color: var(--sky-500); box-shadow: 0 4px 14px rgba(13,59,102,.08);
}
.scan-avatar img { width: 100%; height: 100%; object-fit: cover; }
.scan-result.success .scan-avatar i { color: #1f9d55; }
.scan-result.danger .scan-avatar i { color: #c0392b; }
.scan-name { font-size: 1.4rem; font-weight: 800; color: var(--navy); line-height: 1.2; }
.scan-meta { color: var(--muted); font-size: .9rem; }
.scan-msg { font-weight: 600; margin-top: 4px; }
.scan-time { text-align: center; font-size: 2rem; font-weight: 800; color: var(--navy); line-height: 1; }
.scan-time small { display: block; font-size: .75rem; font-weight: 600; color: var(--muted); }
.scan-new { animation: flashIn 1.2s ease; }
@keyframes flashIn { from { background: #e3f7e9; } to { background: #fff; } }
.content:fullscreen { background: var(--grad-body); padding: 32px; overflow: auto; }
.member-box { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 14px; background: var(--sky-50); border: 1px solid var(--sky-200); }
.member-box img, .member-box .ph { width: 60px; height: 60px; border-radius: 12px; object-fit: cover; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; color: var(--sky-500); }
.total-box { background: var(--grad-main); color: #fff; border-radius: 16px; padding: 16px 20px; }
.total-box .val { font-size: 2rem; font-weight: 800; }

/* ---------- Kartu QR (cetak) ---------- */
.id-cards { display: flex; flex-wrap: wrap; gap: 14px; }
.id-card {
  width: 85.6mm; height: 54mm; border-radius: 3.5mm; overflow: hidden; position: relative; background: #fff;
  border: 1px solid #cfe5f7; box-shadow: 0 4px 14px rgba(13,59,102,.10);
  display: flex; flex-direction: column; break-inside: avoid; page-break-inside: avoid;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.id-card .ic-head { background: linear-gradient(135deg, #8fd3ff 0%, #3a9ee8 100%); color: #fff; display: flex; align-items: center; gap: 2mm; padding: 2mm 3mm; height: 12mm; }
.id-card .ic-head img { width: 8mm; height: 8mm; object-fit: contain; background: #fff; border-radius: 1.5mm; padding: .5mm; }
.id-card .ic-school { font-weight: 800; font-size: 2.9mm; line-height: 1.15; }
.id-card .ic-sub { font-size: 2.1mm; opacity: .9; }
.id-card .ic-body { flex: 1; display: flex; gap: 3mm; padding: 2.5mm 3mm; align-items: center; }
.id-card .ic-photo { width: 17mm; height: 22mm; border-radius: 2mm; object-fit: cover; background: #e3f3ff; display: flex; align-items: center; justify-content: center; color: #3fa9f0; font-size: 8mm; flex-shrink: 0; }
.id-card .ic-info { flex: 1; min-width: 0; }
.id-card .ic-type { display: inline-block; font-size: 2mm; font-weight: 700; padding: .4mm 1.6mm; border-radius: 1mm; background: #e3f7e9; color: #157a4a; text-transform: uppercase; letter-spacing: .1mm; }
.id-card .ic-name { font-weight: 800; font-size: 3.4mm; color: #0d3b66; line-height: 1.15; margin: .8mm 0; word-wrap: break-word; }
.id-card .ic-line { font-size: 2.4mm; color: #4c5d70; line-height: 1.35; }
.id-card .ic-qr { width: 25mm; height: 25mm; flex-shrink: 0; }
.id-card .ic-qr svg, .id-card .ic-qr img { width: 100%; height: 100%; display: block; }
.id-card .ic-code { position: absolute; bottom: 1.2mm; right: 3mm; font-family: monospace; font-size: 1.9mm; color: #6a819b; }
@media print {
  /* @page untuk kartu QR ada di halaman kartu_qr */
  body, .main { background: #fff !important; }
  .id-cards { gap: 4mm; }
  .id-card { box-shadow: none; border: .2mm solid #9fc7e6; }
}

/* ---------- Dropdown dengan pencarian (Tom Select) ---------- */
.ts-wrapper.form-select, .ts-wrapper.single .ts-control { border-radius: 10px; }
.ts-wrapper .ts-control { border-color: #cfe5f7; min-height: 38px; }
.ts-wrapper.focus .ts-control { border-color: var(--sky-400); box-shadow: 0 0 0 .2rem rgba(63,169,240,.2); }
.ts-dropdown { border-radius: 10px; border-color: #cfe5f7; box-shadow: 0 10px 24px rgba(13,59,102,.12); z-index: 1060; }
.ts-dropdown .active { background: var(--sky-100); color: var(--navy); }
.ts-dropdown .option .highlight { background: #fff2b3; border-radius: 3px; }
.ts-dropdown .no-results { padding: 8px 12px; color: var(--muted); }

/* ---------- Jadwal guru & Monitoring KBM ---------- */
.jadwal-grid th { background: var(--sky-50); }
.jadwal-grid td { min-width: 130px; vertical-align: top; }
.jadwal-grid .slot { background: linear-gradient(135deg, #e3f3ff, #f2f9ff); border: 1px solid var(--sky-200); border-radius: 10px; padding: 6px 8px; margin-bottom: 4px; }
.text-navy { color: var(--navy); }
.kbm-day { background: rgba(255,255,255,.75); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 0 6px; height: 100%; }
.kbm-day.today { border: 2px solid var(--sky-500); box-shadow: 0 6px 18px rgba(63,169,240,.18); }
.kbm-day-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; color: var(--navy); border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.kbm-day.today .kbm-day-head { background: var(--grad-main); color: #fff; border-radius: 12px 12px 0 0; }
.kbm-slot { position: relative; margin: 0 8px 8px; padding: 8px 10px; border-radius: 12px; border: 1px solid; font-size: .85rem; }
.kbm-badge { font-size: .68rem; font-weight: 700; padding: 2px 6px; border-radius: 6px; white-space: nowrap; }
.kbm-success   { background: #e3f7e9; border-color: #8fd6a5; }
.kbm-success .kbm-badge { background: #1f9d55; color: #fff; }
.kbm-danger    { background: #fff0f0; border-color: #f2a1a1; }
.kbm-danger .kbm-badge { background: #ffe1e1; color: #b22a2a; }
.kbm-warning   { background: #fff8e6; border-color: #f2cf73; }
.kbm-warning .kbm-badge { background: #fff2d6; color: #946200; }
.kbm-info      { background: #f4faff; border-color: #c4e6ff; }
.kbm-info .kbm-badge { background: #dcefff; color: #1771b0; }
.kbm-secondary { background: #f3f5f7; border-color: #dde3e9; color: #6a819b; }
.kbm-secondary .kbm-badge { background: #e6eaee; color: #4c5d70; }
.legend { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 1px solid; vertical-align: -2px; margin-right: 4px; }
.stat-card.kbm-green { background: linear-gradient(135deg, #8fe0a8 0%, #2fae62 100%); }
.stat-card.kbm-red   { background: linear-gradient(135deg, #ffb0a8 0%, #e5534b 100%); }
@media print { .kbm-week .col-md-4 { width: 16.66%; } .kbm-day { break-inside: avoid; } }
.legend.kbm-success { background: #1f9d55; } .legend.kbm-danger { background: #e5534b; }
.legend.kbm-warning { background: #f2b630; } .legend.kbm-info { background: #6cc0f8; } .legend.kbm-secondary { background: #b8c2cc; }
.sumber-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sumber-opt { text-align: left; padding: 8px 10px; font-size: .88rem; }
.sumber-opt small { font-weight: 500; font-size: .72rem; opacity: .85; }
.btn-check:disabled + .sumber-opt { opacity: .45; }

/* ---------- Dashboard ---------- */
.dash-no { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 8px; background: var(--grad-main); color: #fff; font-size: .78rem; margin-right: 8px; }
.dash-big { font-size: 2.4rem; font-weight: 800; color: var(--navy); line-height: 1; }
.bg-male { background: #3fa9f0 !important; } .bg-female { background: #f07fb0 !important; }
.text-male { color: #1d84cc; } .text-female { color: #d0538c; }
.dash-kelas { display: grid; grid-template-columns: 70px 1fr 120px; align-items: center; gap: 10px; margin-bottom: 8px; font-size: .85rem; }
.dash-kelas .nm { font-weight: 700; color: var(--navy); }
.dash-kelas .bar { display: flex; height: 12px; background: #eef6fd; border-radius: 6px; overflow: hidden; }
.dash-kelas .val { text-align: right; white-space: nowrap; }
.dash-hadir { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.dash-hadir .dh { border-radius: 12px; padding: 10px 6px; text-align: center; border: 1px solid; }
.dash-hadir .dh i { font-size: 1.1rem; }
.dash-hadir .dh .v { font-size: 1.45rem; font-weight: 800; line-height: 1.1; }
.dash-hadir .dh .l { font-size: .7rem; font-weight: 600; }
.dh-success { background: #e3f7e9; border-color: #a6dfb8; color: #157a4a; }
.dh-warning { background: #fff6dd; border-color: #f2d48a; color: #946200; }
.dh-info { background: #e3f3ff; border-color: #9dd5fd; color: #1771b0; }
.dh-primary { background: #ebeaff; border-color: #c4c1f7; color: #4a43b8; }
.dh-danger { background: #ffe8e8; border-color: #f5b5b5; color: #b22a2a; }
.dh-orange { background: #fff0e3; border-color: #f7c49b; color: #b85a0c; }
.dh-secondary { background: #eef2f6; border-color: #d3dbe3; color: #4c5d70; }
.dash-spark { display: flex; align-items: flex-end; gap: 3px; height: 70px; padding: 4px; background: #f6fbff; border-radius: 10px; }
.dash-spark .sb { flex: 1; background: linear-gradient(180deg, #6cc0f8, #2f98e2); border-radius: 3px 3px 0 0; min-height: 3px; }
.dash-spark .sb.nol { background: #dbe9f5; }
@media (max-width: 575.98px) { .dash-hadir { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Detail guru: grafik & kehadiran ---------- */
.chart-box { position: relative; width: 100%; }
.kh-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.kh-tile { border-radius: 12px; padding: 10px; background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--c); }
.kh-tile .v { font-size: 1.5rem; font-weight: 800; color: var(--navy); line-height: 1.1; }
.kh-tile .l { font-size: .75rem; font-weight: 600; color: var(--muted); }
.kc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; max-width: 420px; }
.kc-head { font-size: .7rem; text-align: center; color: var(--muted); font-weight: 700; }
.kc-day { aspect-ratio: 1.6; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700;
          background: var(--c); color: #fff; }
.kc-day.off { background: #f1f4f7; color: #a5b1bd; }
.kc-day.future { background: transparent; color: #c2ccd6; border: 1px dashed #dbe3ea; }
.kc-day.empty { background: transparent; }
@media (max-width: 575.98px) { .kh-tiles { grid-template-columns: repeat(2, 1fr); } }
.kc-day.miss { color: #6a819b; }
/* Kolom aksi tetap terlihat saat tabel digeser */
.table-responsive .table td.actions, .table-responsive .table thead th:last-child { position: sticky; right: 0; z-index: 1; }
.table-responsive .table td.actions { background: #fff; box-shadow: -8px 0 10px -8px rgba(13,59,102,.18); }
.table-hover > tbody > tr:hover > td.actions { background: #f1fbf3; }
.table-responsive .table td.actions:has(.dropdown-menu.show) { z-index: 20; }
.td-actions-menu .dropdown-item, td.actions .dropdown-item { font-size: .85rem; }
td.actions .dropdown-menu form { margin: 0; }

/* ---------- Kelompok collapse (detail produk, tagihan per siswa) ---------- */
.mini-stat { background: #f4faff; border: 1px solid var(--line); border-radius: 12px; padding: .6rem .8rem; }
.acc-group .accordion-item { border-radius: 12px !important; overflow: hidden; margin-bottom: .5rem; border: 1px solid var(--line); }
.acc-group .accordion-button { gap: .25rem; padding: .7rem 1rem; flex-wrap: wrap; }
.acc-group .accordion-button:not(.collapsed) { background: linear-gradient(90deg, #e3f2fd, #f1f9ff); color: #0d3b66; box-shadow: none; }
.acc-group .accordion-button:focus { box-shadow: none; }
.acc-group .accordion-body table th { background: #f8fbff; font-size: .8rem; }
@media (max-width: 576px) { .acc-group .accordion-button .badge { font-size: .7rem; } }

/* ===================== v12: Beranda — foto & berita kegiatan ===================== */
.min-w-0 { min-width: 0; }
.keg-carousel, .keg-carousel .carousel-inner, .keg-carousel .carousel-item { height: 100%; }
.keg-carousel { min-height: 300px; }
.keg-slide { display: block; position: relative; height: 100%; min-height: 300px; color: #fff; text-decoration: none; }
.keg-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.keg-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 48px 22px 34px; background: linear-gradient(180deg, transparent, rgba(6, 28, 52, .82)); }
.keg-carousel .carousel-indicators { margin-bottom: .6rem; }
.keg-carousel .carousel-indicators [data-bs-target] { width: 8px; height: 8px; border-radius: 50%; }
.keg-card { text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; overflow: hidden; }
.keg-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(35, 143, 216, .18); }
.keg-card-img { width: 100%; height: 150px; object-fit: cover; display: block; }
.keg-card-ph { display: flex; align-items: center; justify-content: center; background: var(--grad-soft); color: var(--sky-500); font-size: 2.6rem; }
.keg-card-sum, .keg-news-sum { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.keg-news { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.keg-news:last-child { border-bottom: 0; }
.keg-news:hover { background: var(--sky-50); }
.keg-news img, .keg-news-ic { width: 72px; height: 54px; border-radius: 10px; object-fit: cover; flex: none; }
.keg-news-ic { display: flex; align-items: center; justify-content: center; background: var(--grad-soft); color: var(--sky-600); font-size: 1.4rem; }
.berita-foto .carousel-item img { width: 100%; max-height: 460px; object-fit: contain; background: #0b2238; border-radius: 12px; }
.berita-foto .thumb-ind { width: 64px !important; height: 44px !important; border-radius: 8px; background-size: cover; background-position: center; opacity: .55; border: 2px solid transparent !important; text-indent: 0; }
.berita-foto .thumb-ind.active { opacity: 1; border-color: var(--sky-500) !important; }
.berita-isi { line-height: 1.75; font-size: .98rem; }

/* ===================== v12: Lokasi & waktu shalat ===================== */
.shalat-card .card-header { background: linear-gradient(135deg, #eaf7ef, #def3ff); }
.shalat-next { background: linear-gradient(135deg, #0d3b66, #1771b0); color: #fff; border-radius: 12px; padding: 12px 16px; }
.shalat-next.dekat { background: linear-gradient(135deg, #8a4b08, #d97706); }
.shalat-next .sn-nama { font-size: 1.5rem; font-weight: 800; line-height: 1.1; }
.shalat-next .sn-jam { font-size: 1.5rem; font-weight: 300; line-height: 1.1; }
.shalat-next .sn-jam small { font-size: .7rem; opacity: .75; }
.shalat-next .sn-sisa { font-size: .82rem; background: rgba(255, 255, 255, .18); border-radius: 20px; padding: 2px 10px; }
.shalat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.shalat-grid .sg { background: var(--sky-50); border: 1px solid var(--line); border-radius: 10px; padding: 6px 4px; text-align: center; }
.shalat-grid .sg .n { font-size: .7rem; color: var(--muted); }
.shalat-grid .sg .j { font-weight: 700; color: var(--ink); }
.shalat-grid .sg.wajib .j { color: var(--navy); }
.shalat-grid .sg.aktif { background: #fff7e6; border-color: #f2b544; box-shadow: 0 0 0 2px rgba(242, 181, 68, .25); }
.shalat-chip { align-items: center; gap: 5px; font-size: .8rem; color: var(--navy); background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 4px 12px; text-decoration: none; white-space: nowrap; }
.shalat-chip:hover { background: var(--sky-50); }
.shalat-chip small { color: var(--muted); }

/* ===================== v12: Dikte suara jurnal ===================== */
.dikte-panel { border: 1.5px dashed var(--sky-300); background: var(--grad-soft); border-radius: 14px; padding: 14px 16px; }
.dikte-panel.recording { border-style: solid; border-color: #e5484d; background: #fff5f5; }
.dikte-ic { width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #fde8e8; color: #e5484d; font-size: 1.25rem; flex: none; }
.dikte-panel.recording .dikte-ic { animation: dikte-pulse 1.2s infinite; }
@keyframes dikte-pulse { 0% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .45); } 100% { box-shadow: 0 0 0 14px rgba(229, 72, 77, 0); } }
.dikte-live { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; min-height: 40px; }
.dikte-interim { color: var(--muted); font-style: italic; }
.rec-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #ff5b5b; margin-right: 2px; animation: dikte-blink 1s infinite; }
@keyframes dikte-blink { 50% { opacity: .2; } }
.dikte-flash { animation: dikte-flash .9s; }
@keyframes dikte-flash { 0% { background: #fff3c4; } 100% { background: #fff; } }
@media (max-width: 575.98px) { .shalat-grid { grid-template-columns: repeat(4, 1fr); } .keg-slide, .keg-carousel { min-height: 220px; } }

/* ===================== v12.1: foto utuh (fit) & kartu 1:1 ===================== */
.foto-fit { position: relative; overflow: hidden; background: #0b2238; }
.foto-fit::before { content: ""; position: absolute; inset: -24px; background-image: var(--bg); background-size: cover; background-position: center; filter: blur(22px) brightness(.75); transform: scale(1.1); }
.foto-fit img { position: relative; display: block; width: 100%; height: 100%; object-fit: contain; }
/* slide beranda: bingkai mengikuti tinggi kartu, foto utuh di tengah */
.keg-slide .foto-fit { position: absolute; inset: 0; }
.keg-slide .foto-fit img { position: relative; inset: auto; object-fit: contain; }
.berita-foto .foto-fit img { max-height: none; height: 100%; background: transparent; border-radius: 0; }
/* kartu berita mode Fit: tinggi mengikuti rasio asli foto (dibatasi agar foto portrait tidak terlalu panjang) */
.keg-card-media.fit { aspect-ratio: auto; }
.keg-card-media.fit img { height: auto; max-height: 340px; margin: 0 auto; width: 100%; }
/* kartu berita mode 1:1 */
.keg-card-media { position: relative; }
.keg-card-media.sq { aspect-ratio: 1 / 1; overflow: hidden; }
.keg-card-media.sq img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.keg-card:hover .keg-card-media.sq img { transform: scale(1.04); }
.keg-card-ph { display: flex; align-items: center; justify-content: center; background: var(--grad-soft); color: var(--sky-500); font-size: 2.6rem; height: 150px; }
.keg-card-ph.sq { height: auto; }
.keg-card { position: relative; }
.keg-card-count { position: absolute; top: 10px; right: 10px; background: rgba(6, 28, 52, .7); color: #fff; font-size: .75rem; border-radius: 20px; padding: 2px 9px; }
/* halaman baca berita: foto utuh */
.berita-foto .foto-fit { height: min(70vh, 520px); border-radius: 12px; }

/* ===================== v12.2: kartu berita lebih ringkas, tanggal Hijriah ===================== */
.keg-card-media.fit img { max-height: 210px; }
.keg-card-ph { height: 120px; font-size: 2.1rem; }
.keg-card-body { padding: .7rem .85rem .85rem; }
.keg-card-body .fw-bold { font-size: .95rem; }
.keg-card-body .small { font-size: .78rem; }
.keg-card-sum { -webkit-line-clamp: 2; }
.keg-card .tgl-h { display: block; }
.tgl-h { opacity: .85; white-space: nowrap; }
.welcome .tgl-h { opacity: 1; }
