/* e-SKP Pengawas Madrasah 2026 — Navy Gold theme */
:root {
  /* Brand palette */
  --primary: #1E2A5A;
  --primary-dark: #162047;
  --primary-soft: #E8EBF5;
  --accent: #D4AF37;
  --accent-dark: #B5942A;
  --accent-soft: #FFF7DC;

  /* Neutrals */
  --bg: #F8F9FC;
  --text: #1F2937;
  --muted: #6B7280;
  --border: #E5E7EB;
  --card: #FFFFFF;

  /* Sidebar */
  --sidebar-bg: #111827;
  --sidebar-bg-2: #1E2A5A;

  /* Legacy aliases (kept for any leftover .kemenag references) */
  --kemenag: var(--primary);
  --kemenag-2: var(--primary-dark);
  --kemenag-dark: var(--primary-dark);
  --kemenag-soft: var(--primary-soft);
  --gold: var(--accent);
}

html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
}

/* Defensive: ensure #app is visible after boot regardless of any CSS conflict */
#app:not(.d-none) { display: block !important; }

a { color: var(--primary); }
a:hover { color: var(--primary-dark); }

/* ===== Bootstrap overrides — buttons ===== */
.btn-success,
.btn-primary,
.bg-success,
.bg-primary {
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
}
.btn-success:hover, .btn-success:focus,
.btn-primary:hover, .btn-primary:focus {
  background-color: var(--primary-dark) !important;
  border-color: var(--primary-dark) !important;
  color: #fff !important;
}
.btn-success:active, .btn-success.active,
.btn-primary:active, .btn-primary.active {
  background-color: var(--primary-dark) !important;
  border-color: var(--primary-dark) !important;
}

.btn-outline-success,
.btn-outline-primary {
  color: var(--primary) !important;
  border-color: var(--primary) !important;
  background-color: transparent !important;
}
.btn-outline-success:hover, .btn-outline-success:focus,
.btn-outline-primary:hover, .btn-outline-primary:focus {
  background-color: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
}

.btn-warning {
  background-color: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #1F2937 !important;
}
.btn-warning:hover, .btn-warning:focus {
  background-color: var(--accent-dark) !important;
  border-color: var(--accent-dark) !important;
  color: #fff !important;
}
.btn-outline-warning {
  color: var(--accent-dark) !important;
  border-color: var(--accent) !important;
}
.btn-outline-warning:hover, .btn-outline-warning:focus {
  background-color: var(--accent) !important;
  color: #1F2937 !important;
}

.text-success, .text-primary { color: var(--primary) !important; }
.text-warning { color: var(--accent-dark) !important; }
.bg-warning { background-color: var(--accent) !important; color: #1F2937 !important; }

/* ===== Layout ===== */
.app-shell { display: flex; min-height: 100vh; align-items: stretch; }
.app-shell.no-sidebar { }

.app-sidebar {
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
  color: #fff;
  padding: 12px 0 12px;
  width: 240px; flex: 0 0 240px;
  position: sticky; top: 0; align-self: flex-start;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: block;
  border-right: 1px solid rgba(255,255,255,.05);
}
.app-sidebar nav { flex: 0 0 auto; }
.sidebar-credit {
  padding: 10px 6px;
  text-align: center;
  color: rgba(255,255,255,.75);
  font-size: 8.5px;
  line-height: 1.4;
  white-space: nowrap;
  border-top: 1px solid rgba(255,255,255,.12);
}
.sidebar-credit div + div { margin-top: 2px; }

.app-sidebar .brand {
  padding: 8px 16px 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 8px;
}
.app-sidebar .brand .logo {
  width: 52px; height: 52px;
  background: radial-gradient(circle at center, rgba(255,255,255,.95) 0%, rgba(255,255,255,.65) 35%, rgba(255,255,255,.25) 65%, rgba(255,255,255,0) 85%);
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
  font-weight: 800;
  box-shadow: none;
  flex-shrink: 0;
  padding: 4px;
  box-sizing: border-box;
}
.app-sidebar .brand .logo img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.35));
}
.app-sidebar .brand .title { font-weight: 700; line-height: 1.15; color: #fff; }
.app-sidebar .brand .subtitle { font-size: 11px; opacity: .75; color: var(--accent); }

.app-sidebar nav a {
  display: flex; gap: 10px; align-items: center;
  padding: 9px 16px;
  color: rgba(255,255,255,.82);
  text-decoration: none;
  font-size: 14px;
  border-left: 3px solid transparent;
  transition: background .15s, border-color .15s, color .15s;
}
.app-sidebar nav a:hover {
  background: rgba(212,175,55,.08);
  color: #fff;
  border-left-color: rgba(212,175,55,.5);
}
.app-sidebar nav a.active {
  background: rgba(212,175,55,.14);
  color: var(--accent);
  font-weight: 600;
  border-left-color: var(--accent);
}
.app-sidebar nav a.active i { color: var(--accent); }
.app-sidebar nav .section-label {
  padding: 14px 16px 4px;
  font-size: 11px;
  opacity: .55;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--accent);
}
.app-sidebar .userbox {
  padding: 10px 14px;
  border-top: 1px solid rgba(255,255,255,.12);
  margin-top: 12px;
  font-size: 12px;
  color: rgba(255,255,255,.85);
}

.app-main { flex: 1 1 auto; min-width: 0; }
.app-topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky; top: 0;
  z-index: 5;
  box-shadow: 0 1px 3px rgba(30,42,90,.04);
}
.app-topbar .page-title {
  font-weight: 700;
  font-size: 18px;
  color: var(--primary);
}
.app-content { padding: 16px; max-width: 100%; margin: 0; }

/* Wide tables: always show horizontal scrollbar (not just on overflow), pinned at bottom of viewport */
.table-wide-wrap {
  overflow-x: scroll;
  overflow-y: auto;
  max-height: calc(100dvh - 130px);
}
.table-wide-wrap::-webkit-scrollbar { height: 12px; width: 10px; }
.table-wide-wrap::-webkit-scrollbar-thumb { background: #b6b6b6; border-radius: 6px; }
.table-wide-wrap::-webkit-scrollbar-track { background: #f0f0f0; }
.table-wide-wrap table { min-width: 2000px; }

/* On mobile / touch: don't trap scroll inside the wrap, let page scroll naturally */
@media (max-width: 900px) {
  .table-wide-wrap {
    max-height: none;
    overflow-y: visible;
  }
  .table-wide-wrap .table thead th {
    position: static;
  }
}

/* SKP Atasan import — Excel cells preserve borders & alignment */
.skp-excel-table { border-collapse: collapse; table-layout: fixed; font-size: 12px; }
.skp-excel-table td {
  border: 1px solid #888;
  padding: 4px 6px;
  vertical-align: top;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}
.skp-doc { line-height: 1.55; }
.skp-doc h1, .skp-doc h2, .skp-doc h3 { color: var(--primary-dark); }
.skp-doc table { border-collapse: collapse; margin: 8px 0; width: 100%; }
.skp-doc table td, .skp-doc table th { border: 1px solid #888; padding: 4px 6px; vertical-align: top; }
.skp-doc img { max-width: 100%; height: auto; }
.skp-doc p { margin: 0 0 8px; }

/* Crisp borders + sticky header for the master-rhk wide table */
.table-wide-wrap .table {
  border-collapse: collapse;
}
.table-wide-wrap .table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  border: 1px solid #6b6b6b !important;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 700;
  vertical-align: middle;
}
.table-wide-wrap .table tbody td {
  border: 1px solid #b0b0b0 !important;
  vertical-align: top;
}
.table-wide-wrap .table tbody tr:hover td {
  background-color: #f3f5fb;
}

.btn-burger { display: none; }

/* ===== Cards & stats ===== */
.stat-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 4px 14px rgba(30,42,90,.06);
  transition: transform .15s, box-shadow .15s;
}
.stat-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(30,42,90,.10);
}
.stat-card .stat-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
}
.stat-card .stat-label { color: var(--muted); font-size: 13px; }
.stat-card .icon {
  width: 46px; height: 46px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 22px;
}
.stat-card .icon.icon-accent {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 2px 8px rgba(30,42,90,.04);
}
.card .card-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  color: var(--primary-dark);
}

.table thead th {
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 700;
  border-bottom-color: var(--border);
}
.table-sm td, .table-sm th { font-size: 13px; }

.table > :not(caption) > * > * {
  border-color: var(--border);
}

/* ===== Badges ===== */
.badge-tw {
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
}
.badge-tambahan {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
}
.badge.bg-success { background-color: var(--primary) !important; }
.badge.bg-warning { background-color: var(--accent) !important; color: #1F2937 !important; }
.badge.bg-secondary { background-color: var(--muted) !important; }

/* ===== Forms ===== */
.form-control, .form-select {
  border-color: var(--border);
  color: var(--text);
  background-color: var(--card);
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgba(30,42,90,.15);
}
.form-label { color: var(--text); font-weight: 500; }

/* ===== Modals ===== */
.modal-content {
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(30,42,90,.18);
}
.modal-header {
  background: var(--primary);
  color: #fff;
  border-bottom: none;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}
.modal-header .btn-close {
  filter: invert(1) brightness(2);
}
.modal-header .modal-title {
  color: #fff;
  font-weight: 600;
}

/* ===== Auth pages (login / register) ===== */
.auth-wrap {
  min-height: 100vh;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  position: relative;
}
.auth-wrap::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(212,175,55,.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(212,175,55,.10) 0%, transparent 50%);
  pointer-events: none;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
  padding: 32px 28px;
  position: relative;
  z-index: 1;
}
.auth-card h1 {
  font-size: 18px;
  color: var(--primary-dark);
  font-weight: 700;
}
.auth-card .auth-logo {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--accent);
  border-radius: 16px;
  display: inline-grid;
  place-items: center;
  font-size: 30px;
  box-shadow: 0 6px 20px rgba(30,42,90,.3);
}

/* ===== Mobile ===== */
@media (max-width: 900px) {
  .app-sidebar { position: fixed; top: 0; left: -260px; width: 260px; flex-basis: 260px; transition: left .2s ease; z-index: 20; }
  .app-sidebar.open { left: 0; }
  .app-main { flex-basis: 100%; }
  .btn-burger { display: inline-flex; }
  .app-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 15; }
  .app-overlay.show { display: block; }

  .app-content { padding: 12px; }
  .app-topbar { padding: 10px 14px; }
  .stat-card { padding: 14px !important; }
  .stat-card .stat-num { font-size: 24px; }
}

/* ===== Print formatting ===== */
@media print {
  .app-sidebar, .app-topbar, .no-print { display: none !important; }
  .app-shell { display: block; }
  .app-content { padding: 0; }
  body { background: #fff; }
  .doc-page {
    page-break-after: auto;
    page-break-before: always;
    padding: 0;
    margin: 0;
    box-shadow: none;
    max-width: none;
    min-height: 0;
  }
  /* Skala cetak (--print-scale) HARUS pakai `zoom`, bukan `transform: scale()`.
     `transform` hanya mengubah tampilan visual SETELAH layout dihitung —
     ukuran kotak halaman yang dipakai Chromium untuk menghitung page-break
     tetap memakai ukuran ASLI (sebelum discale). Akibatnya saat skala <100%
     kontennya mengecil secara visual, tapi jumlah halaman fisik yang
     dialokasikan tetap dihitung seolah-olah kontennya masih berukuran penuh
     — menghasilkan banyak halaman kosong/setengah-kosong. `zoom` mengubah
     ukuran layout SEBELUM page-break dihitung, jadi jumlah halaman fisik
     ikut menyusut sesuai skala yang sebenarnya dipakai. */
  #docContainer, .app-content {
    zoom: var(--print-scale, 1);
  }
  /* First page in the printed flow should not force a leading blank page.
     Using page-break-BEFORE on every .doc-page (instead of page-break-AFTER)
     avoids the classic Chromium bug where a forced break placed right at the
     end of naturally-reflowed multi-page content produces an extra blank
     page. Each .doc-page starts a new page except the very first one.
     NOTE: this must NOT be `.doc-page:first-of-type`. In the Eviden preview
     each document (Laporan Singkat / Surat Tugas / Undangan) is wrapped in
     its own `.doc-pane > .doc-body` container, so every `.doc-page` is the
     ONLY .doc-page inside its own parent — each one independently matches
     `:first-of-type`, which cancels page-break-before on every document and
     causes the next document to start on the same physical page as the
     previous one instead of a fresh page. Scope the "avoid" rule to only the
     page inside the very first .doc-pane/document (works for both the
     multi-.doc-pane Eviden layout and the flat Laporan Triwulan layout,
     where #docContainer's first child IS the first .doc-page). */
  #docContainer > .doc-page:first-child,
  #docContainer > .doc-pane:first-child .doc-page:first-child {
    page-break-before: avoid;
  }
  .doc-cover { padding: 0; }
  /* Margin fisik per halaman diatur di @page supaya berulang otomatis di
     setiap halaman fisik (termasuk halaman sambungan saat 1 dokumen meluber
     ke >1 halaman) — padding di .doc-page tidak berulang di tiap page-break
     fisik, jadi harus dipindah ke sini. */
  @page { size: A4 portrait; margin: 0.6in; }
  @page :first { margin-top: 0; }
}

/* ===== Trial watermark (cetak & screen saat dipreview) ===== */
body.trial-mode .trial-watermark-band{position:fixed;top:6px;left:0;right:0;text-align:center;font-family:"Times New Roman",serif;font-size:9pt;color:rgba(220,53,69,.75);font-weight:700;letter-spacing:.1em;z-index:9999;pointer-events:none;display:none}
body.trial-mode .trial-watermark{position:fixed;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:9999;display:none;align-items:center;justify-content:center;overflow:hidden}
body.trial-mode .trial-watermark::before{content:"TRIAL \2022  e-RHK Pengawas 2026";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%) rotate(-30deg);font-size:84pt;font-family:"Times New Roman",serif;font-weight:900;color:rgba(220,53,69,.18);white-space:nowrap;letter-spacing:.05em;text-transform:uppercase}
@media print{
  body.trial-mode .trial-watermark-band{display:block !important}
  body.trial-mode .trial-watermark{display:flex !important}
}

/* ===== Document preview ===== */
.doc-page {
  background: #fff;
  /* Margin standar: 0.6" semua sisi */
  padding: 0.6in;
  max-width: 210mm;
  min-height: 297mm;
  margin: 16px auto;
  box-shadow: 0 4px 14px rgba(30,42,90,.08);
  font-family: "Times New Roman", serif;
  font-size: 12pt;
  line-height: 1.5;
}
.doc-page h1, .doc-page h2, .doc-page h3 { font-family: "Times New Roman", serif; }
.doc-page h1 { font-size: 13pt; font-weight: 700; }
.doc-page h2 { font-size: 13pt; font-weight: 700; }
.doc-page h3 { font-size: 13pt; font-weight: 700; }
.doc-page h4 { font-size: 12pt; font-weight: 700; }
.doc-page h5 { font-size: 12pt; font-weight: 700; }
.doc-page .kop { display: flex; align-items: center; gap: 12px; border-bottom: 3px double #000; padding-bottom: 8px; margin-bottom: 16px; }
.doc-page .kop .logo { width: 80px; height: 80px; flex-shrink: 0; }
.doc-page .kop .text { flex: 1; text-align: center; min-width: 0; }
.doc-page .kop .text .l1,
.doc-page .kop .text .l2,
.doc-page .kop .text .l3,
.doc-page .kop .text .l4 {
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.doc-page .kop .text .l1 { font-size: 12pt; }
.doc-page .kop .text .l2 { font-size: 12pt; font-weight: 700; }
.doc-page .kop .text .l3 { font-size: 12pt; font-weight: 700; }
.doc-page .kop .text .l4 { font-size: 12pt; }
.doc-page .ttd { display: flex; align-items: flex-start; margin-top: 36px; padding-left: 20px; padding-right: 20px; }
.doc-page .ttd .ttd-block { flex: 1 1 auto; text-align: center; white-space: nowrap; }
.doc-page .signature-img, .doc-page .ttd .signature-img { max-height: 80px; max-width: 180px; width: auto; height: auto; object-fit: contain; object-position: center; display: block; margin: 0 auto; }
.doc-page table.fmt { width: 100%; border-collapse: collapse; }
.doc-page table.fmt th, .doc-page table.fmt td { border: 1px solid #000; padding: 4px 6px; }

/* TTD blocks: never wrap names */
.doc-page .ttd, .doc-page .ttd-penutup, .doc-page table { word-break: normal; overflow-wrap: normal; }
.doc-page .ttd-penutup div { word-break: keep-all; overflow-wrap: normal; }

/* Cover khusus: tanpa kop, padding sama */
.doc-cover { padding: 0.8in; }

.cover-title { text-align: center; margin: 40px 0 8px; font-size: 12pt; font-weight: 700; }
.cover-sub { text-align: center; font-size: 12pt; margin-bottom: 80px; }
.cover-id { text-align: center; line-height: 1.8; margin-top: 60px; font-size: 12pt; }
.cover-foot { text-align: center; margin-top: 80px; font-weight: 700; font-size: 12pt; }

/* ===== Master RHK: resizable columns + inline edit ===== */
.table-wide-wrap .rhk-table { min-width: 0; }
.table-wide-wrap .rhk-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding-right: 12px;
  user-select: none;
}
.col-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  z-index: 3;
  background: transparent;
  transition: background .15s;
}
.col-resize-handle:hover,
.col-resize-handle:active {
  background: var(--accent);
  opacity: .6;
}
.rhk-table td.cell-wrap,
.rhk-table td.cell-aspek,
.rhk-table td.cell-id {
  padding: 4px 6px;
  vertical-align: top;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
}
.rhk-table .cell-aspek { background: var(--primary-soft); color: var(--primary-dark); text-align: center; }
.rhk-table .cell-input,
.rhk-table .cell-textarea,
.rhk-table .cell-select {
  width: 100%;
  max-width: 100%;
  border: 1px solid transparent;
  background: transparent;
  padding: 4px 6px;
  font-size: 13px;
  line-height: 1.4;
  border-radius: 4px;
  resize: none;
  font-family: inherit;
  color: var(--text);
  box-sizing: border-box;
  display: block;
}

/* Read-only mode: textareas, inputs, selects look like plain text (no editable hint). */
.rhk-table .cell-textarea[readonly],
.rhk-table .cell-input[readonly],
.rhk-table .cell-select[disabled] {
  cursor: default;
  background: transparent;
  border-color: transparent;
  pointer-events: auto;
}
.rhk-table .cell-textarea[readonly]:hover,
.rhk-table .cell-input[readonly]:hover,
.rhk-table .cell-select[disabled]:hover {
  background: transparent;
  border-color: transparent;
}

/* Edit mode: highlight editable cells. */
.rhk-table tr.row-editing td.cell-wrap,
.rhk-table tr.row-editing td.cell-id {
  background: #fffdf3;
}
.rhk-table .cell-editable.cell-textarea,
.rhk-table .cell-editable.cell-input {
  border: 1px solid var(--border);
  background: #fff;
  cursor: text;
}
.rhk-table .cell-editable.cell-select {
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
}
.rhk-table .cell-editable:hover {
  border-color: var(--accent) !important;
}
.rhk-table .cell-editable:focus {
  outline: none;
  border-color: var(--primary) !important;
  background: #fff !important;
  box-shadow: 0 0 0 2px rgba(30,42,90,.15);
}

/* Display-mode link inside cells (e.g. Nama Eviden -> detail) */
.rhk-table .cell-display-block {
  display: block;
}
.rhk-table .cell-display-link {
  display: block;
  padding: 4px 6px;
  color: var(--primary);
  text-decoration: none;
  word-break: break-word;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.4;
}
.rhk-table .cell-display-link:hover {
  text-decoration: underline;
  color: var(--primary-dark);
}
.rhk-table .cell-drive-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin: 2px 6px 4px;
  padding: 2px 8px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border: 1px solid var(--accent);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.4;
}
.rhk-table .cell-drive-link:hover {
  background: var(--accent);
  color: #1F2937;
  text-decoration: none;
}
.rhk-table .cell-drive-link i { font-size: 13px; }
.rhk-table tr.row-editing .cell-display-block { display: none; }
.rhk-table .cell-editor-block { display: none; }
.rhk-table tr.row-editing .cell-editor-block { display: block; }
.rhk-table .cell-editor-block .cell-link-input {
  margin-top: 4px;
  font-size: 12px;
}
.rhk-table .cell-textarea {
  min-height: 32px;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.rhk-table .cell-saved {
  animation: cellSavedFlash .8s ease;
}
@keyframes cellSavedFlash {
  0%   { background: rgba(212,175,55,.30); border-color: var(--accent); }
  100% { background: transparent; }
}

/* ===== Form sections ===== */
.required::after { content: " *"; color: #c0392b; }
.form-section-title {
  color: var(--primary-dark);
  font-weight: 700;
  margin: 16px 0 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--primary-soft);
  position: relative;
}
.form-section-title::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 48px; height: 2px;
  background: var(--accent);
}
