/* ============================================================
   Tahfidzku — Modern Islamic SaaS Design System
   Clean, Calm, High-Contrast & Commercial-Grade Ergonomics
   ============================================================ */

:root {
  /* Brand Palette: Deep Islamic Emerald / Teal */
  --primary: #0f766e;
  --primary-hover: #115e59;
  --primary-dark: #134e4a;
  --primary-light: #f0fdfa;
  --primary-border: #99f6e4;
  --primary-text: #0f766e;

  /* Neutrals: Professional Slate */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  /* Surface & Body */
  --bg: #f8fafc;
  --bg-subtle: #f1f5f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --border-focus: #0f766e;
  --text: #0f172a;
  --text-soft: #64748b;
  --muted: #64748b;

  /* Secondary & Accents */
  --secondary: #1e293b;
  --secondary-hover: #0f172a;
  --accent: #f8fafc;

  /* Semantic Palettes */
  --success: #10b981;
  --green: #10b981;
  --warning: #f59e0b;
  --warn: #f59e0b;
  --danger: #ef4444;

  /* Shadows (Crisp, Subtle & Professional) */
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-clay: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-clay-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-clay-inset: inset 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);

  /* Radii */
  --radius-xl: 14px;
  --radius-lg: 10px;
  --radius-md: 8px;
  --radius-sm: 6px;
}

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

html, body {
  max-width: 100%;
  overflow-x: hidden;
  background-color: var(--bg);
  color: var(--text);
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

h1, h2, h3, h4, .brand {
  font-family: 'Poppins', 'Inter', sans-serif;
  letter-spacing: -0.02em;
}

/* ============================================================
   Application Shell & Navigation Layout
   ============================================================ */
.app-shell {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 100vh;
}

body.nav-open { overflow: hidden; }

.sidebar {
  position: fixed;
  bottom: calc(74px + env(safe-area-inset-bottom, 12px));
  left: 50%;
  z-index: 60;
  width: min(94vw, 460px);
  height: auto;
  max-height: calc(100dvh - 96px - env(safe-area-inset-bottom, 12px));
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 16px 14px 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  transform: translate(-50%, 16px) scale(0.97);
  opacity: 0;
  transition: transform .22s cubic-bezier(0.16, 1, 0.3, 1), opacity .18s ease;
  border-radius: 18px;
  visibility: hidden;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
}
.sidebar.open {
  transform: translate(-50%, 0) scale(1) !important;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  z-index: 55;
  backdrop-filter: blur(2px);
}
.scrim.show { display: block; }

.sidebar .brand {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 4px 8px;
  user-select: none;
}
.sidebar .brand .logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--primary);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 17px;
  box-shadow: 0 2px 4px rgba(15, 118, 110, 0.2);
  flex-shrink: 0;
}

.nav-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 0 auto;
}

.nav-section-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--slate-400);
  padding: 10px 6px 3px;
  user-select: none;
}

.nav-section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  color: var(--slate-600);
  cursor: pointer;
  font-weight: 500;
  transition: all .15s ease;
  border: 1px solid var(--border);
  background: var(--slate-50);
  width: 100%;
  min-width: 0;
  text-align: left;
  font-size: 12.5px;
  line-height: 1.25;
}
.nav-item:hover {
  background: var(--slate-100);
  color: var(--text);
}
.nav-item.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(15, 118, 110, 0.25);
}
.nav-item.active .nav-ico {
  color: #ffffff;
}

.nav-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--slate-500);
  transition: color .15s ease;
}
.nav-item:hover .nav-ico {
  color: var(--text);
}

.nav-text {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

/* User Box in Sidebar */
.sidebar .spacer { flex: 1; }
.sidebar .user-box {
  background: var(--slate-50);
  border-radius: var(--radius-lg);
  padding: 12px;
  border: 1px solid var(--border);
  font-size: 13px;
  margin-top: 14px;
}
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

/* ============================================================
   Main Content Area & Topbar
   ============================================================ */
.main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 24px 32px 48px;
  overflow-x: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.topbar h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.02em;
}
.topbar .sub {
  color: var(--text-soft);
  font-size: 13px;
  margin-top: 2px;
}
.topbar .actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.menu-toggle {
  display: none !important;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
}
.menu-toggle:hover {
  background: var(--slate-100);
}

/* ============================================================
   Card & Container Components
   ============================================================ */
.clay-card {
  background: var(--card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-clay);
  padding: 20px;
  transition: border-color .15s ease;
}
.clay-card.pad-sm { padding: 14px 16px; }
.clay-card:hover { border-color: var(--slate-300); }

.section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}

/* ============================================================
   Buttons
   ============================================================ */
.clay-btn {
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--text);
  border-color: var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all .15s ease;
  line-height: 1.4;
  user-select: none;
  white-space: nowrap;
}
.clay-btn:hover {
  background: var(--slate-100);
  border-color: var(--slate-300);
}
.clay-btn:active {
  transform: translateY(1px);
}
.clay-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

.clay-btn.primary {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 1px 2px rgba(15, 118, 110, 0.2);
}
.clay-btn.primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.clay-btn.secondary {
  background: var(--secondary);
  color: #ffffff;
  border-color: var(--secondary);
}
.clay-btn.secondary:hover {
  background: var(--secondary-hover);
  border-color: var(--secondary-hover);
}

.clay-btn.ghost {
  background: #ffffff;
  color: var(--slate-700);
  border-color: var(--slate-300);
}
.clay-btn.ghost:hover {
  background: var(--slate-100);
  color: var(--text);
  border-color: var(--slate-400);
}

.clay-btn.danger {
  background: var(--danger);
  color: #ffffff;
  border-color: var(--danger);
}
.clay-btn.danger:hover {
  background: #dc2626;
  border-color: #dc2626;
}

.clay-btn.danger.ghost {
  background: #fef2f2 !important;
  color: var(--danger) !important;
  border: 1px solid #fecaca !important;
}
.clay-btn.danger.ghost:hover {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border-color: #fca5a5 !important;
}

.clay-btn.sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

/* Actions inline inside table cells */
.actions-inline {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
}
.actions-inline .clay-btn {
  flex: 0 0 auto;
  min-width: 54px;
  justify-content: center;
  white-space: nowrap;
  padding: 5px 8px;
  font-size: 11.5px;
}

/* ============================================================
   Forms & Inputs
   ============================================================ */
.clay-input, .clay-select, .clay-textarea, .search-input {
  width: 100%;
  border: 1px solid var(--slate-300);
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  line-height: 1.4;
}
.clay-input:hover, .clay-select:hover, .clay-textarea:hover, .search-input:hover {
  border-color: var(--slate-400);
}
.clay-input:focus, .clay-select:focus, .clay-textarea:focus, .search-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

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

label.field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin: 10px 0 5px;
  color: var(--slate-700);
}

.clay-toggle {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: var(--slate-300);
  position: relative;
  cursor: pointer;
  border: none;
  transition: background .2s;
}
.clay-toggle.on { background: var(--primary); }
.clay-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: left .2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.clay-toggle.on::after { left: 22px; }

.fab {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 40;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-md);
  transition: transform .15s ease, background-color .15s ease;
}
.fab:hover {
  transform: translateY(-2px);
  background: var(--primary-hover);
}

/* ============================================================
   Grids & Layout Utilities
   ============================================================ */
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.grid.kpi { grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.grid.cols-main-side {
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr);
  align-items: start;
}
@media (max-width: 1024px) {
  .grid.cols-main-side { grid-template-columns: minmax(0, 1fr); }
}

.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.center { align-items: center; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 14px; }
.muted { color: var(--text-soft); }
.empty { text-align: center; color: var(--text-soft); padding: 36px 0; font-size: 13.5px; }

/* ============================================================
   KPI & Stat Cards
   ============================================================ */
.stat {
  background: var(--card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-clay);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color .15s ease;
}
.stat:hover { border-color: var(--slate-300); }
.stat .icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  display: grid;
  place-items: center;
  font-size: 20px;
  background: var(--slate-100);
  color: var(--primary);
  flex-shrink: 0;
}
.stat .icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
}
.stat .meta { flex: 1; min-width: 0; }
.stat .meta .num {
  font-size: 23px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-feature-settings: "tnum";
}
.stat .meta .lbl {
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 500;
  margin-top: 2px;
}

/* ============================================================
   Tables
   ============================================================ */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}

.table-wide {
  min-width: 680px;
}
.table-wider {
  min-width: 820px;
}
.clay-table td.cell-wrap,
.clay-table td .wrap-content {
  white-space: normal !important;
}

.clay-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}
.clay-table th {
  color: var(--slate-600);
  font-weight: 600;
  padding: 10px 14px;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid var(--border);
  background: var(--slate-50);
}
.clay-table td {
  background: var(--card);
  padding: 11px 14px;
  border-bottom: 1px solid var(--slate-100);
  color: var(--slate-800);
  vertical-align: middle;
}
.clay-table tr:last-child td { border-bottom: none; }
.clay-table tbody tr:hover td { background: var(--slate-50); }

.laporan-sort-heading { min-width: 130px; }
.laporan-sort-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}
.laporan-sort-toggle span { color: var(--primary); font-size: 15px; }
.laporan-sort-toggle[aria-pressed="true"] { color: var(--primary); }
.laporan-mobile-sort { display: none; }
.laporan-result-count { margin-top: 8px; font-size: 12px; text-align: right; }

/* ============================================================
   Badges & Indicators
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
}
.badge.green { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.badge.blue { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge.cream { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.badge.gray { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.badge.warn { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.badge.danger { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.badge.purple { background: #f5f3ff; color: #6d28d9; border: 1px solid #ddd6fe; }
.badge.sm { font-size: 10.5px; padding: 2px 6px; }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.green { background: var(--success); }
.dot.yellow { background: var(--warning); }
.dot.blue { background: #2563eb; }
.dot.red { background: var(--danger); }
.dot.purple { background: #8b5cf6; }

/* ============================================================
   Progress & Simple Charts
   ============================================================ */
.progress-circle {
  --val: 0;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: conic-gradient(var(--primary) calc(var(--val) * 1%), var(--slate-100) 0);
  display: grid;
  place-items: center;
  position: relative;
}
.progress-circle::before {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: #ffffff;
}
.progress-circle span {
  position: relative;
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 12px;
  height: 140px;
  padding-top: 10px;
}
.bar-chart .bar {
  flex: 0 1 38px;
  max-width: 44px;
  min-width: 22px;
  background: var(--primary);
  border-radius: 6px 6px 2px 2px;
  position: relative;
  min-height: 4px;
  transition: height .3s ease;
  cursor: pointer;
}
.bar-chart .bar:hover {
  background: var(--primary-hover);
}
.bar-chart .bar span {
  position: absolute;
  bottom: -22px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 11px;
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-chart-wrap { padding-bottom: 24px; }

/* Timeline */
.timeline { position: relative; padding-left: 20px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--slate-200);
}
.timeline .item { position: relative; margin-bottom: 14px; }
.timeline .item::before {
  content: '';
  position: absolute;
  left: -19px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px var(--slate-200);
}
.timeline .item .t { font-size: 11.5px; color: var(--text-soft); }
.timeline .item .d { font-size: 13px; color: var(--text); }

/* ============================================================
   Modal & Popups
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 20px;
}
.modal {
  background: #ffffff;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
}
.modal h3 {
  margin-bottom: 6px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.modal .modal-sub {
  color: var(--text-soft);
  font-size: 13px;
  margin-bottom: 16px;
}
.modal .modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
}

.modal.modal-lg { max-width: 860px; width: 95vw; }
.modal.modal-kitab {
  max-width: 1050px;
  width: 95vw;
  height: 92vh;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  padding: 20px 24px;
}
.modal.modal-kitab .modal-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.modal.modal-kitab .modal-actions { margin-top: 10px; }

/* ============================================================
   Toast Notifications
   ============================================================ */
#toast-root {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  min-width: 260px;
  max-width: 420px;
  color: var(--text);
  animation: slideIn .2s ease;
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid #2563eb; }
@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ============================================================
   Search Autocomplete
   ============================================================ */
.search-box { position: relative; z-index: 50; min-width: 200px; }
.search-drop {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 280px;
  max-height: 300px;
  overflow-y: auto;
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 4px 0;
}
.search-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  transition: background .1s;
  border-bottom: 1px solid var(--slate-100);
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--slate-100); }
.search-empty { padding: 16px; text-align: center; color: var(--text-soft); font-size: 12.5px; }

/* ============================================================
   Auth (Login Screen)
   ============================================================ */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--slate-50);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 32px 28px;
}
.auth-card .brand {
  justify-content: center;
  margin-bottom: 6px;
}
.auth-card .tagline {
  text-align: center;
  color: var(--text-soft);
  margin-bottom: 20px;
  font-size: 13.5px;
}
.auth-roles {
  display: flex;
  gap: 6px;
  margin-top: 14px;
}
.auth-roles .role {
  flex: 1;
  text-align: center;
  padding: 9px;
  border-radius: var(--radius-md);
  background: var(--slate-100);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--slate-600);
  transition: all .15s ease;
}
.auth-roles .role:hover {
  color: var(--text);
  border-color: var(--slate-300);
}
.auth-roles .role.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* ============================================================
   Pills & Calendar
   ============================================================ */
.pill-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.pill {
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--slate-100);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--slate-600);
  transition: all .15s ease;
}
.pill:hover { background: var(--slate-200); color: var(--text); }
.pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 600;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.calendar .day {
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--slate-100);
  display: grid;
  place-items: center;
  font-size: 12px;
  border: 1px solid var(--border);
}
.calendar .day.h { background: #dcfce7; border-color: #86efac; color: #166534; font-weight: 600; }
.calendar .day.i { background: #fef9c3; border-color: #fde047; color: #854d0e; }
.calendar .day.s { background: #dbeafe; border-color: #93c5fd; color: #1e40af; }
.calendar .day.a { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.calendar .day.empty { background: transparent; border: none; }

/* ============================================================
   Live Monitor Elements
   ============================================================ */
@keyframes live-pulse {
  0% { transform: scale(0.95); opacity: 0.8; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  50% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 0 4px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); opacity: 0.8; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
.live-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  display: inline-block;
  animation: live-pulse 1.8s infinite ease-in-out;
  flex-shrink: 0;
}
.badge.live {
  background: #fef2f2;
  color: #b91c1c;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.5px;
  border: 1px solid #fecaca;
}

.live-kpi-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-top: 3px solid var(--primary);
}
.live-kpi-card.blue { border-top-color: #2563eb; }
.live-kpi-card.green { border-top-color: #10b981; }
.live-kpi-card.purple { border-top-color: #8b5cf6; }
.live-kpi-card.amber { border-top-color: #f59e0b; }

.live-bar-container {
  background: var(--slate-100);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  display: flex;
  width: 100%;
  margin: 8px 0 6px;
}
.live-bar-seg {
  height: 100%;
  transition: width 0.4s ease;
}

.lm-filter-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 10px;
  align-items: end;
}
.lm-filter-grid label.field-label { margin: 0 0 4px; font-size: 11.5px; }
.lm-date-row { display: flex; gap: 6px; align-items: center; }
.lm-date-row .clay-input { flex: 1; min-width: 0; }
.lm-date-row .clay-btn { flex-shrink: 0; white-space: nowrap; }

.lk-title { font-size: 12px; font-weight: 700; color: var(--text-soft); }
.lk-metric { margin-top: 8px; display: flex; align-items: baseline; gap: 6px; }
.lk-metric b { font-size: 26px; line-height: 1.1; }
.lk-metric span { font-size: 13px; }
.lk-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 12px; gap: 6px; }
.show-xs { display: none; }

@media (max-width: 900px) {
  .lm-filter-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .lm-filter-grid .lm-span-2 { grid-column: span 2; }
}

.live-sesi-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  white-space: nowrap;
}
.live-sesi-pill.hadir { background: #dcfce7; color: #15803d; }
.live-sesi-pill.izin { background: #fef9c3; color: #854d0e; }
.live-sesi-pill.sakit { background: #dbeafe; color: #1d4ed8; }
.live-sesi-pill.alfa { background: #fee2e2; color: #b91c1c; }
.live-sesi-pill.libur { background: #f3e8ff; color: #7e22ce; }
.live-sesi-pill.belum { background: var(--slate-100); color: var(--slate-400); }

/* Responsive visibility utilities */
.desktop-only { display: block; }
.mobile-only { display: none !important; }

/* Live Glance Bar (Clean 1-row summary for Dashboard) */
.live-glance-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--slate-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 14px;
}
.live-glance-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.live-glance-stats {
  font-size: 12px;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.live-glance-stats b {
  color: var(--text);
  font-weight: 600;
}
.live-glance-btn {
  flex-shrink: 0;
  padding: 4px 10px;
  font-size: 11.5px;
}
.dot-sep {
  color: var(--slate-300);
  font-weight: 700;
}

/* Mobile Halaqah Attendance Cards */
.h-absen-mobile-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.h-absen-item {
  background: var(--slate-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}
.h-chips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(66px, 1fr));
  gap: 6px;
}
.h-sesi-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 6px;
  padding: 6px 2px;
  text-align: center;
}
.h-sesi-lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-soft);
}

@media (max-width: 640px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: block !important; }
}

/* ============================================================
   Al-Qur'an Reader
   ============================================================ */
:root {
  --q-font-size: 32px;
}
.hidden, [hidden] { display: none !important; }
.q-controls-card {
  padding: 14px 16px;
}
.q-nav-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.q-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 7px 10px;
  flex-shrink: 0;
  white-space: nowrap;
}
.q-page-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--slate-100);
}
.q-toolbar-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding-top: 10px;
  border-top: 1px solid var(--slate-100);
}
.q-segmented {
  display: inline-flex;
  background: var(--slate-100);
  padding: 3px;
  border-radius: var(--radius-md);
  gap: 2px;
}
.q-seg-btn {
  background: transparent;
  border: none;
  font-size: 12px;
  font-weight: 500;
  color: var(--slate-600);
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s ease;
  user-select: none;
}
.q-seg-btn.active {
  background: #ffffff;
  color: var(--primary);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.q-font-stepper {
  display: inline-flex;
  align-items: center;
  background: var(--slate-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 32px;
}
.q-font-stepper.sm {
  height: 28px;
}
.q-stepper-btn {
  background: transparent;
  border: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--slate-700);
  padding: 0 9px;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s ease;
}
.q-stepper-btn:hover {
  background: var(--slate-200);
}
.q-font-val {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  padding: 0 6px;
  min-width: 38px;
  text-align: center;
}
.q-fullscreen-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}

@media (max-width: 480px) {
  .q-nav-btn .q-btn-text {
    display: none;
  }
  .q-nav-btn {
    padding: 7px 8px;
  }
}

.q-reader { padding: 8px 4px; }
.q-ayah {
  display: block;
  padding: 18px 14px;
  border-bottom: 1px solid var(--slate-200);
}
.q-ayah:last-child { border-bottom: none; }

/* Ornamen Hiasan Nomor Ayat Al-Qur'an */
.q-ayah-ornament {
  display: inline-flex;
  position: relative;
  align-items: center;
  justify-content: center;
  width: 1.35em;
  height: 1.35em;
  margin: 0 0.2em 0.08em 0.28em;
  vertical-align: middle;
  line-height: 1;
  user-select: none;
}
.q-ayah-ornament-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.q-ayah-ornament-num {
  position: relative;
  z-index: 1;
  font-family: 'Amiri', 'Traditional Arabic', serif;
  font-size: 0.54em;
  font-weight: 700;
  color: #806f36;
  direction: ltr;
  text-align: center;
  line-height: 1;
}
.q-body { flex: 1 1 auto; min-width: 0; }
.q-arab {
  font-family: 'Amiri', 'Scheherazade New', 'Traditional Arabic', serif;
  font-size: var(--q-font-size, 28px);
  line-height: 2.2;
  color: #14342b;
  text-align: right;
  direction: rtl;
  word-spacing: 2px;
}
.q-ayah.mushaf .q-arab { font-size: var(--q-font-size, 32px); line-height: 2.3; }
.q-trans {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-soft);
  direction: ltr;
  text-align: left;
}
.q-trans::before { content: "↳ "; opacity: .5; }
.q-trans-num {
  font-weight: 700;
  color: var(--primary);
  margin-right: 4px;
  font-style: normal;
}
.q-page-badge {
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  border: 1px solid var(--primary-border);
}

/* Focused Full-Page Mushaf */
.q-full-toolbar {
  position: sticky;
  top: 10px;
  z-index: 20;
  max-width: 940px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}
.q-full-title { flex: 1; min-width: 0; text-align: center; }
.q-full-title b { font-size: 14px; }
.q-full-title span { color: var(--text-soft); font-size: 11px; }

.q-full-page {
  max-width: 940px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 44px) clamp(16px, 5vw, 64px);
  border: 1px solid #ded6bd;
  border-radius: 10px;
  background: #fffdf7;
  box-shadow: 0 4px 14px rgba(71, 56, 23, 0.08);
}
.q-full-flow {
  color: #172033;
  direction: rtl;
  text-align: right;
  font-family: 'Amiri', 'Scheherazade New', 'Traditional Arabic', serif;
  font-size: var(--q-font-size, 34px);
  line-height: 2.25;
  word-spacing: 2px;
}
.q-full-ayah-marker {
  display: inline-grid;
  place-items: center;
  vertical-align: middle;
  width: 1.5em;
  height: 1.5em;
  margin: 0 .15em .10em .2em;
  border: 1px solid #b69a4d;
  border-radius: 50%;
  color: #806f36;
  font-family: 'Amiri', serif;
  font-size: .52em;
  font-weight: 700;
  line-height: 1;
  direction: ltr;
}

body.q-reading-fullscreen { overflow: hidden; background: #f8f7f2; }
.q-reading-fullscreen .sidebar,
.q-reading-fullscreen .bottom-nav,
.q-reading-fullscreen .topbar { display: none; }
.q-reading-fullscreen .app-shell { min-height: 100dvh; }
.q-reading-fullscreen .main {
  height: 100dvh;
  max-width: none;
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ============================================================
   Responsive Adaptations
   ============================================================ */
/* ============================================================
   Web & Mobile Bottom Navigation Bar
   ============================================================ */
.bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(64px + env(safe-area-inset-bottom, 12px));
  padding: 6px 6px max(10px, env(safe-area-inset-bottom, 10px)) 6px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
  z-index: 50;
  justify-content: space-around;
  align-items: flex-start;
  box-sizing: border-box;
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: var(--slate-500);
  background: none;
  border: none;
  padding: 2px 0 0;
  cursor: pointer;
  gap: 3px;
  transition: all .15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav-item:hover {
  color: var(--primary);
}
.bottom-nav-item .b-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 26px;
  border-radius: 13px;
  transition: all .15s ease;
}
.bottom-nav-item.active {
  color: var(--primary);
}
.bottom-nav-item.active .b-ico {
  background: rgba(13, 148, 136, 0.12);
}
.bottom-nav-item svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}
.bottom-nav-item .b-lbl {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.bottom-nav-item.active .b-lbl {
  font-weight: 700;
}

@media (min-width: 861px) {
  .main {
    max-width: 1400px;
    margin: 0 auto;
    padding-bottom: 100px !important;
  }
  .menu-toggle { display: none !important; }
  .bottom-nav {
    left: 50%;
    right: auto;
    bottom: 14px;
    transform: translateX(-50%);
    width: min(94vw, 680px);
    height: 64px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
    align-items: center;
  }
  .sidebar {
    bottom: 90px;
    width: min(92vw, 620px);
    max-height: calc(100vh - 114px);
  }
  .nav-section-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .main {
    padding: 14px 16px calc(76px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Prevent iOS Safari 16px auto-zoom */
  .clay-input, .clay-select, .clay-textarea, .search-input {
    font-size: 16px;
  }
}

@media (max-width: 560px) {
  .sidebar { width: min(95vw, 420px); padding: 14px 12px 16px; }
  .main { padding: 12px 12px calc(84px + env(safe-area-inset-bottom, 16px)) !important; }
  .topbar {
    margin-bottom: 14px;
    padding-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .topbar h1 { font-size: 18px; line-height: 1.25; }
  .topbar .sub { font-size: 11.5px; }
  .nav-item { padding: 9px 10px; font-size: 13px; }

  /* Mobile KPI Stat Cards: 2-column balanced grid */
  .grid.kpi {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .grid.cols-2 { grid-template-columns: 1fr; gap: 12px; }
  .grid.cols-3 { grid-template-columns: 1fr; gap: 12px; }

  .hide-xs { display: none !important; }
  .show-xs { display: inline !important; }
  .lm-date-row .clay-btn {
    min-height: 36px;
    padding: 6px 10px;
    font-size: 12px;
  }

  /* Live KPI Cards: 3-column compact grid so nothing clips on mobile */
  .live-kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin-top: 0;
  }
  .live-kpi-grid .live-kpi-card {
    padding: 9px 10px !important;
    margin-bottom: 0 !important;
  }
  .lk-title { font-size: 10.5px; letter-spacing: 0.02em; }
  .lk-badge { font-size: 10px !important; padding: 2px 6px !important; }
  .lk-metric { margin-top: 6px; gap: 2px; }
  .lk-metric b { font-size: 19px; }
  .lk-metric span { font-size: 11px; }
  .live-kpi-card .live-bar-container { height: 6px; margin: 6px 0 4px; }
  .lk-foot { font-size: 10.5px; margin-top: 2px; }

  .stat {
    padding: 12px 12px;
    gap: 10px;
    border-radius: var(--radius-lg);
  }
  .stat .icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
  }
  .stat .icon svg {
    width: 19px;
    height: 19px;
  }
  .stat .meta .num {
    font-size: 20px;
    font-weight: 700;
  }
  .stat .meta .lbl {
    font-size: 11px;
    line-height: 1.2;
  }

  /* Mobile Cards Padding */
  .clay-card {
    padding: 14px 14px;
    border-radius: var(--radius-lg);
  }
  .clay-card.pad-sm {
    padding: 10px 12px;
  }

  /* Mobile Pills: Swipeable horizontal chips */
  .pill-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding-bottom: 4px;
    margin-bottom: 12px;
    scrollbar-width: none;
  }
  .pill-tabs::-webkit-scrollbar { display: none; }
  .pill {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 6px 12px;
    font-size: 12px;
  }

  /* Mobile Modal Sheet with top handle */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    max-width: none;
    max-height: 85dvh;
    border-radius: 20px 20px 0 0;
    padding: 18px 16px 16px;
    position: relative;
  }
  .modal::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--slate-300);
    margin: -6px auto 14px;
  }
  .modal .modal-actions {
    position: sticky;
    bottom: -16px;
    background: #ffffff;
    padding: 12px 0 6px;
    margin-top: 14px;
    border-top: 1px solid var(--slate-100);
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
  }
  .modal .modal-actions .clay-btn {
    flex: 1 1 0;
    justify-content: center;
    min-width: 0;
    padding: 10px 12px;
    font-size: 13px;
  }

  /* Mobile Responsive Tables (Clean horizontal momentum scroll) */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #ffffff;
    margin-bottom: 12px;
    box-shadow: none;
  }
  .clay-card .table-wrap {
    margin-bottom: 0;
  }
  .clay-table {
    width: 100%;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 12px;
  }
  .clay-table.table-wide {
    min-width: 680px !important;
  }
  .clay-table.table-wider {
    min-width: 820px !important;
  }
  .clay-table td.cell-wrap,
  .clay-table td .wrap-content {
    white-space: normal !important;
  }
  .clay-table th {
    padding: 8px 10px;
    font-size: 10.5px;
    white-space: nowrap;
    background: var(--slate-50);
  }
  .clay-table td {
    padding: 8px 10px;
    font-size: 12px;
    white-space: nowrap;
    border-bottom: 1px solid var(--slate-100);
  }
  .clay-table tr:last-child td {
    border-bottom: none;
  }
  .clay-table td[data-label="Aksi"] .actions-inline,
  .clay-table td .actions-inline {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
  }

  /* Touch buttons */
  .clay-btn {
    min-height: 38px;
  }
  .clay-btn.sm {
    min-height: 32px;
  }
}

@media (max-width: 380px) {
  .grid.kpi { grid-template-columns: 1fr; }
  .topbar .actions { width: 100%; }
}

/* ============================================================
   Notification Cards (In-App Notifications)
   ============================================================ */
.notif-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.notif-item-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  transition: border-color .15s ease, background-color .15s ease;
}
.notif-item-card.unread {
  background: #f8fafc;
  border-color: #bfdbfe;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.06);
}
.notif-item-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.notif-ico-wrap {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.notif-tone-pembaruan { background: #eff6ff; color: #2563eb; }
.notif-tone-setoran   { background: #ecfdf5; color: #059669; }
.notif-tone-absensi   { background: #f0fdfa; color: #0d9488; }
.notif-tone-tagihan   { background: #fef3c7; color: #d97706; }
.notif-tone-info      { background: #f1f5f9; color: #475569; }
.notif-body {
  flex: 1;
  min-width: 0;
}
.notif-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.notif-cat {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-block;
}
.notif-cat.notif-tone-pembaruan { background: #dbeafe; color: #1d4ed8; }
.notif-cat.notif-tone-setoran   { background: #d1fae5; color: #047857; }
.notif-cat.notif-tone-absensi   { background: #ccfbf1; color: #0f766e; }
.notif-cat.notif-tone-tagihan   { background: #fde68a; color: #b45309; }
.notif-cat.notif-tone-info      { background: #e2e8f0; color: #334155; }
.notif-ver {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 1px 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.notif-text {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
  word-break: break-word;
}
.notif-time {
  font-size: 11.5px;
  color: var(--muted, #64748b);
  margin-top: 4px;
}
.notif-badge-new {
  font-size: 11px;
  font-weight: 700;
  color: #1d4ed8;
  background: #dbeafe;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Floating Quick Translator (ID <-> AR) */
.floating-tr-btn {
  position: fixed;
  right: 18px;
  bottom: 88px;
  z-index: 150;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: var(--primary, #0d9488);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
  transition: transform .15s ease, background-color .15s ease;
}
.floating-tr-btn:hover { transform: translateY(-2px); background: var(--primary-hover, #0f766e); }
.floating-tr-btn.hidden, .floating-tr-panel.hidden { display: none !important; }
.floating-tr-panel {
  position: fixed;
  right: 18px;
  bottom: 142px;
  z-index: 151;
  width: min(92vw, 376px);
  background: #fff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 16px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.24);
  overflow: hidden;
}
.floating-tr-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: var(--primary, #0d9488);
  color: #fff;
}
.floating-tr-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.floating-tr-body textarea {
  font-size: 13.5px;
  line-height: 1.45;
  resize: vertical;
  min-height: 68px;
}
.floating-tr-out {
  background: #f8fafc;
  font-family: 'Amiri', 'Poppins', sans-serif;
  font-size: 16px !important;
}
.floating-tr-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}
.q-reading-fullscreen .floating-tr-btn,
.q-reading-fullscreen .floating-tr-panel { display: none !important; }

/* Demo Mode UI (only rendered when DEMO_MODE=true) */
.demo-quick-card {
  margin-bottom: 18px;
  padding: 13px;
  border-radius: 14px;
  background: #f0fdfa;
  border: 1.5px solid #99f6e4;
}
.demo-quick-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 600;
  color: #115e59;
  margin-bottom: 10px;
}
.demo-role-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.demo-role-btn {
  text-align: left;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid #99f6e4;
  background: #ffffff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all 0.15s ease;
}
.demo-role-btn:hover:not(:disabled) {
  border-color: var(--primary, #0d9488);
  background: #ccfbf1;
  transform: translateY(-1px);
}
.demo-role-btn:disabled { opacity: 0.65; cursor: wait; }
.demo-role-btn b { font-size: 12.5px; color: #0f766e; }
.demo-role-btn small { font-size: 10.5px; line-height: 1.3; color: #475569; }
.demo-quick-foot {
  margin-top: 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
}
.demo-quick-foot a { color: #0f766e; text-decoration: none; }
.demo-quick-foot a:hover { text-decoration: underline; }

.demo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 9px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f0fdfa 0%, #ecfdf5 100%);
  border: 1px solid #99f6e4;
  font-size: 12px;
  color: #134e4a;
}
.demo-banner-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.demo-switch-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.demo-switch-btn {
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid #99f6e4;
  background: #ffffff;
  color: #0f766e;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.demo-switch-btn:hover:not(:disabled) { background: #ccfbf1; }
.demo-switch-btn.active {
  background: #0f766e;
  border-color: #0f766e;
  color: #ffffff;
  cursor: default;
}
.demo-cta-link {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 8px;
  background: #0f766e;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.demo-cta-link:hover { background: #115e59; }
@media (max-width: 480px) {
  .demo-role-grid { grid-template-columns: 1fr; }
}
@media print {
  .floating-tr-btn, .floating-tr-panel, .demo-banner { display: none !important; }
}
