:root {
  --bg: #0b0f1a;
  --bg-sidebar: #11162a;
  --bg-topbar: #11162a;
  --bg-card: #171e33;
  --bg-card-hover: #1c2440;
  --border: #262e4a;
  --text: #e7e9f2;
  --text-muted: #8890ab;
  --gold: #d4af37;
  --gold-bright: #f0c766;
  --blue: #3b82f6;
  --green: #22c55e;
  --red: #ef4444;
  --orange: #f59e0b;
  --shadow: 0 2px 10px rgba(0,0,0,0.35);
  --radius: 12px;
}

[data-theme="light"] {
  --bg: #f3f4f8;
  --bg-sidebar: #101423;
  --bg-topbar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f7f8fc;
  --border: #e4e6ef;
  --text: #171a2b;
  --text-muted: #6b7188;
  --shadow: 0 2px 10px rgba(20,20,50,0.08);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  transition: background .15s ease, color .15s ease;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 0%, #1a2140 0%, #0b0f1a 60%);
  padding: 24px;
}
.login-box {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
  text-align: center;
}
.login-box img.logo {
  width: 110px;
  height: 110px;
  object-fit: contain;
  margin-bottom: 8px;
}
.login-box h1 {
  font-size: 20px;
  margin: 8px 0 2px;
  color: var(--gold-bright);
}
.login-box .sub {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 24px;
}
.login-error {
  background: rgba(239,68,68,0.12);
  border: 1px solid var(--red);
  color: var(--red);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  text-align: left;
}
.field { text-align: left; margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--blue);
}
.btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  color: #14181f;
  font-weight: 600;
  border: none;
  padding: 11px 18px;
  border-radius: 8px;
  font-size: 14px;
  width: 100%;
}
.btn:hover { filter: brightness(1.05); }
.btn-secondary {
  background: var(--bg-card-hover);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-sm { width: auto; padding: 7px 12px; font-size: 13px; }
.btn-danger { background: var(--red); color: #fff; }

/* ---------- App shell ---------- */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.sidebar-brand img { width: 36px; height: 36px; object-fit: contain; }
.sidebar-brand .name { font-weight: 700; font-size: 14px; color: #fff; line-height: 1.2; }
.sidebar-brand .name span { display: block; font-size: 10px; color: var(--gold-bright); font-weight: 500; letter-spacing: .5px; }
.nav-group { margin-bottom: 16px; }
.nav-group-title {
  font-size: 10.5px;
  letter-spacing: .6px;
  color: #5c6485;
  text-transform: uppercase;
  padding: 0 10px;
  margin-bottom: 6px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  color: #c3c8dd;
  margin-bottom: 2px;
}
.nav-link:hover { background: rgba(255,255,255,0.05); color: #fff; }
.nav-link.active { background: rgba(212,175,55,0.14); color: var(--gold-bright); font-weight: 600; }
.nav-link .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .5; }

.main { min-width: 0; }
.topbar {
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar-search {
  flex: 1;
  max-width: 420px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 14px;
  color: var(--text-muted);
  font-size: 13px;
}
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 16px;
}
.icon-btn:hover { color: var(--text); }
.user-chip { display: flex; align-items: center; gap: 8px; }
.user-chip .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--blue));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #14181f;
}
.user-chip .who { font-size: 12.5px; }
.user-chip .who .role { color: var(--text-muted); font-size: 11px; display: block; }

.content { padding: 22px 24px 48px; max-width: 1400px; }
.page-title { font-size: 20px; font-weight: 700; margin: 0 0 2px; }
.page-sub { color: var(--text-muted); font-size: 13px; margin: 0 0 20px; }

/* ---------- Stat cards ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 16px;
  box-shadow: var(--shadow);
}
.stat-card .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.stat-card .icon {
  width: 36px; height: 36px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.stat-card .label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.stat-card .value { font-size: 19px; font-weight: 700; }
.stat-card .delta { font-size: 11.5px; margin-top: 6px; }
.delta.up { color: var(--green); }
.delta.down { color: var(--red); }
.delta.flat { color: var(--text-muted); }

.icon-blue { background: rgba(59,130,246,0.15); color: var(--blue); }
.icon-green { background: rgba(34,197,94,0.15); color: var(--green); }
.icon-gold { background: rgba(212,175,55,0.18); color: var(--gold-bright); }
.icon-red { background: rgba(239,68,68,0.15); color: var(--red); }
.icon-orange { background: rgba(245,158,11,0.15); color: var(--orange); }

/* ---------- Panels / cards ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 1000px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.panel-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.panel-head .see-all { font-size: 12px; color: var(--blue); }
.empty-hint { color: var(--text-muted); font-size: 12.5px; padding: 18px 4px; text-align: center; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--text-muted); font-weight: 500; font-size: 11.5px; text-transform: uppercase; letter-spacing: .3px; padding: 8px 8px; border-bottom: 1px solid var(--border); }
td { padding: 9px 8px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-green { background: rgba(34,197,94,0.15); color: var(--green); }
.badge-red { background: rgba(239,68,68,0.15); color: var(--red); }
.badge-orange { background: rgba(245,158,11,0.15); color: var(--orange); }
.badge-gray { background: rgba(136,144,171,0.15); color: var(--text-muted); }

/* Quick actions */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 700px) { .quick-grid { grid-template-columns: repeat(2, 1fr); } }
.quick-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text);
}
.quick-btn:hover { background: var(--bg-card-hover); border-color: var(--gold); }
.quick-btn .qi { font-size: 20px; display: block; margin-bottom: 6px; }

/* Notif list */
.notif-item { display: flex; align-items: center; justify-content: space-between; padding: 9px 4px; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.notif-item:last-child { border-bottom: none; }
.notif-item .dot2 { width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; display: inline-block; }

.theme-toggle {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 20px; padding: 4px; width: 60px;
  position: relative;
  height: 30px;
}
.theme-toggle .knob {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  position: absolute; top: 3px; left: 3px;
  transition: left .15s ease;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
}
[data-theme="light"] .theme-toggle .knob { left: 33px; }

.coming-soon { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.coming-soon .big { font-size: 40px; margin-bottom: 10px; }

.form-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }

/* ---------- Compat layer: modul lama (transaksi/nota/piutang/pelanggan/laporan) ---------- */
.wrap { max-width: 1200px; }
.wrap .page-title { margin-top: 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
.cards .card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.cards .card .label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; }
.cards .card .value { font-size: 22px; font-weight: 700; margin-top: 6px; }
.cards .card.accent-green .value { color: var(--green); }
.cards .card.accent-amber .value { color: var(--orange); }
.cards .card.accent-navy .value { color: var(--blue); }

.panel h2 { font-size: 15px; margin: 0 0 14px; color: var(--gold-bright); font-weight: 600; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid.full { grid-template-columns: 1fr; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }

th.num, td.num { text-align: right; }

.badge.lunas { background: rgba(34,197,94,0.15); color: var(--green); }
.badge.belum_lunas { background: rgba(239,68,68,0.15); color: var(--red); }
.badge.sebagian { background: rgba(245,158,11,0.15); color: var(--orange); }
.badge.telat { background: var(--red); color: #fff; margin-left: 4px; }

.btn.secondary { background: var(--bg-card-hover); color: var(--text); border: 1px solid var(--border); }
.btn.small { padding: 5px 10px; font-size: 12px; width: auto; display: inline-block; }
.btn.gold { background: linear-gradient(135deg, var(--gold), var(--gold-bright)); color: #14181f; }

.actions-row { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }

.items-table th, .items-table td { padding: 6px 5px; }
.items-table input, .items-table select { font-size: 13px; padding: 6px 7px; }
.item-row .col-desc { min-width: 160px; }
.remove-item { background: none; border: none; color: var(--red); cursor: pointer; font-size: 16px; }

.modal-cell .mata-uang-select { margin-bottom: 4px; }
.modal-cell .modal-asing { display: flex; gap: 4px; margin-bottom: 4px; }
.modal-cell .modal-asing input { width: 50%; }
.modal-cell .modal-input[readonly] { background: var(--bg-card-hover); color: var(--text-muted); }

@media (max-width: 720px) {
  .items-table thead { display: none; }
  .items-table, .items-table tbody { display: block; width: 100%; }
  .items-table tr.item-row {
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    margin-bottom: 14px;
    background: var(--bg-card);
  }
  .items-table td {
    display: block;
    width: 100% !important;
    padding: 7px 0;
    white-space: normal;
  }
  .items-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
    margin-bottom: 3px;
  }
  .items-table td input, .items-table td select { width: 100%; }
  .items-table td.col-remove { padding-top: 12px; border-top: 1px solid var(--border); margin-top: 4px; }
  .items-table .remove-item { width: 100%; text-align: center; padding: 8px; border: 1px solid var(--red); border-radius: 8px; font-size: 13px; }
}

.summary-box { max-width: 320px; margin-left: auto; }
.summary-box .row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.summary-box .row.total { font-weight: 700; font-size: 17px; border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px; }

/* Nota / invoice cetak — desain "kaya" (logo besar+ring emas, panel navy, badge, footer sosmed)
   sesuai contoh persis yang Briliant kirim. Pelajaran dari 2 bug print sebelumnya diterapkan di sini:
   - jangan pakai border-radius elips ekstrem di elemen berwarna (dipakai radius wajar 0 0 0 22px)
   - jangan pasang border-radius langsung di sel <th>; bungkus tabel & potong dari wrapper-nya
   - semua warna dipaksa print-color-adjust:exact + !important di @media print (iOS suka nge-skip) */
.nota-sheet {
  background: #fff; color: #1c2733; border: 1px solid #e3e8ee; border-radius: 10px;
  max-width: 760px; margin: 0 auto; padding: 0; overflow: hidden;
  box-shadow: 0 8px 28px rgba(11,37,64,0.08);
}
.nota-sheet, .nota-sheet * { -webkit-print-color-adjust: exact; print-color-adjust: exact; color-adjust: exact; }
.nota-sheet label { display: block; font-size: 12px; color: #6b7785; margin-bottom: 4px; font-weight: 600; }

.nk-head { display: flex; align-items: stretch; justify-content: space-between; gap: 0; border-bottom: 3px solid #c9a227; }
.nk-brand { display: flex; gap: 14px; align-items: flex-start; padding: 12px 24px; }
.nk-logo {
  width: 68px; height: 68px; object-fit: contain; flex: none; border-radius: 50%;
  border: 2.5px solid #c9a227; padding: 3px; background: #fff;
}
.nk-name { font-size: 22px; font-weight: 800; letter-spacing: .5px; color: #0b2540; margin-top: 2px; }
.nk-tagline { font-size: 12px; color: #6b7785; margin-top: 3px; }
.nk-contact { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: #445; margin-top: 8px; }
.nk-docpanel {
  background-color: #0b2540; color: #fff; padding: 16px 28px; min-width: 210px; flex: none;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-end;
  border-radius: 0 0 0 22px;
}
.nk-doctitle { font-size: 26px; font-weight: 800; color: #f0c766; line-height: 1.15; letter-spacing: .5px; text-align: right; }
.nk-docnomor { margin-top: 10px; display: inline-block; font-size: 12.5px; font-weight: 600; border: 1px solid #f0c766; color: #f0c766; border-radius: 20px; padding: 4px 14px; }

.nk-body { padding: 8px 28px 4px; }

.nk-meta { display: flex; justify-content: space-between; gap: 20px; font-size: 13px; }
.nk-meta-left b { display: block; font-size: 15px; margin: 2px 0 3px; color: #0b2540; }
.nk-meta-right { min-width: 220px; }
.nk-meta-table { border-collapse: collapse; }
.nk-meta-table td { padding: 3px 0; color: #6b7785; white-space: nowrap; vertical-align: top; }
.nk-meta-table td:nth-child(2) { padding: 3px 8px; }
.nk-meta-table td:nth-child(3) { color: #1c2733; white-space: normal; }

.nk-tablewrap { margin-top: 12px; border-radius: 6px; overflow: hidden; }
.nk-tablewrap table { width: 100%; border-collapse: collapse; table-layout: fixed; color: #1c2733; }
.nk-tablewrap th, .nk-tablewrap td { padding: 6px 10px; font-size: 13px; border-bottom: 1px solid #e5e7eb; overflow: hidden; text-overflow: ellipsis; }
.nk-tablewrap th { background-color: #0b2540; color: #f0c766; text-align: left; font-weight: 600; text-transform: uppercase; font-size: 11.5px; letter-spacing: .3px; }
.nk-tablewrap .num { text-align: right; }
.nk-tablewrap th:nth-child(2), .nk-tablewrap td:nth-child(2) { width: 32%; }
.nk-tablewrap tbody tr:nth-child(even) { background: #f7f9fc; }

.nk-bottom { display: flex; gap: 20px; margin-top: 10px; align-items: flex-start; }
.nk-bottom-left { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.nk-bottom-right { width: 280px; flex: none; }
.nk-box {
  display: flex; gap: 10px; align-items: flex-start; border: 1px solid #e3e8ee; border-radius: 8px;
  padding: 6px 12px; font-size: 12.5px; color: #445;
}
.nk-box .nk-icon {
  width: 30px; height: 30px; border-radius: 7px; background-color: #0b2540; color: #f0c766;
  display: flex; align-items: center; justify-content: center; font-size: 14px; flex: none;
}
.nk-box i { font-style: italic; }
.nk-box label { text-transform: uppercase; letter-spacing: .3px; }

.nk-summary { border: 1px solid #e3e8ee; border-radius: 8px; overflow: hidden; }
.nk-summary .row { display: flex; justify-content: space-between; padding: 6px 14px; font-size: 14px; }
.nk-summary .row.total { font-weight: 700; font-size: 18px; color: #0b2540; border-top: 1px solid #e3e8ee; text-transform: uppercase; }
.nk-summary .row.total span:last-child { color: #c9a227; text-transform: none; }
.nk-summary .row.bar { color: #fff; font-weight: 700; }
.nk-summary .row.bar-navy { background-color: #0b2540; }
.nk-summary .row.bar-gold { background-color: #c9a227; }
.nk-summary .row.bar-gold span:first-child { text-transform: uppercase; }

.nk-ttd { margin-top: 8px; text-align: center; font-size: 13px; }
.nk-ttd-box { margin-top: 5px; border: 1.5px dashed #c3ccd9; border-radius: 8px; height: 34px; }
.nk-line { margin-top: 5px; border-top: 1px solid #1c2733; padding-top: 3px; }

/* display:table/table-cell dipakai (bukan flex) — flexbox 2-kolom terbukti di-stack vertikal
   oleh wkhtmltopdf di halaman ini (lihat catatan nk-badges di bawah), jadi konsisten pola yang sama. */
.nk-ttd-dual { display: table; width: 100%; table-layout: fixed; }
.nk-ttd-dual .nk-ttd-col { display: table-cell; width: 50%; padding: 0 4px; }

.nk-badges { display: table; width: 100%; table-layout: fixed; margin-top: 6px; border: 1px solid #e6c568; border-radius: 8px; padding: 4px 0; }
.nk-badges > div { display: table-cell; text-align: center; font-size: 9.5px; font-weight: 700; color: #0b2540; line-height: 1.2; padding: 0 6px; }
.nk-badges > div + div { border-left: 1px solid #e6c568; }
.nk-badges .b-icon { display: block; font-size: 14px; margin-bottom: 1px; }

.nk-social { background-color: #0b2540; padding: 5px 28px; }
.nk-social .social-row { display: flex; justify-content: center; gap: 24px; font-size: 10.5px; color: #fff; flex-wrap: wrap; }
.nk-social .social-tag { text-align: center; font-size: 10px; color: #f0c766; letter-spacing: .5px; margin-top: 3px; font-weight: 600; }

.nk-footnote { padding: 6px 28px 8px; text-align: center; font-size: 10px; color: #9aa4b2; display: flex; justify-content: space-between; }

@media print {
  .no-print, .sidebar, .topbar { display: none !important; }
  body { background: #fff; }
  .app { display: block; }
  .content { padding: 0; max-width: none; }
  .nota-sheet { border: none; padding: 0; max-width: none; }

  /* iOS print-to-PDF kadang gagal ngecat background elemen berwarna — dipaksa eksplisit */
  .nota-sheet, .nota-sheet * {
    -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; color-adjust: exact !important;
  }
  .nk-docpanel { background-color: #0b2540 !important; }
  .nk-tablewrap th { background-color: #0b2540 !important; color: #f0c766 !important; }
  .nk-box .nk-icon { background-color: #0b2540 !important; color: #f0c766 !important; }
  .nk-summary .row.bar-navy { background-color: #0b2540 !important; }
  .nk-summary .row.bar-gold { background-color: #c9a227 !important; }
  .nk-social { background-color: #0b2540 !important; }
  .badge.lunas { background-color: #dcfce7 !important; color: #16a34a !important; }
  .badge.belum_lunas { background-color: #fee2e2 !important; color: #dc2626 !important; }
  .badge.sebagian { background-color: #fef3c7 !important; color: #d97706 !important; }
}

/* ---------- Nota — mobile (layout aslinya didesain buat print A4, jadi kolom-kolomnya
   fixed-width dan gampang kepotong di layar HP sempit; di sini semuanya ditumpuk vertikal) ---------- */
@media (max-width: 640px) {
  .nota-sheet { max-width: 100%; border-radius: 0; }
  .nk-head { flex-direction: column; }
  .nk-brand { padding: 14px 16px; }
  .nk-logo { width: 52px; height: 52px; }
  .nk-name { font-size: 18px; }
  .nk-docpanel {
    min-width: 0; width: 100%; align-items: flex-start;
    padding: 12px 16px; border-radius: 0;
  }
  .nk-doctitle { text-align: left; font-size: 20px; }
  .nk-body { padding: 8px 16px 4px; }
  .nk-meta { flex-direction: column; gap: 10px; }
  .nk-meta-right { min-width: 0; width: 100%; }
  .nk-meta-table td { white-space: normal; }
  .nk-meta-table td:nth-child(3) { word-break: break-word; }
  .nk-tablewrap { overflow-x: auto; }
  .nk-tablewrap table { min-width: 480px; }
  .nk-bottom { flex-direction: column; }
  .nk-bottom-right { width: 100%; }
  .nk-badges { display: flex; flex-wrap: wrap; }
  .nk-badges > div { flex: 1 1 40%; border-left: none !important; padding: 6px; }
  .nk-social { padding: 8px 16px; }
  .nk-social .social-row { gap: 10px 16px; }
  .nk-footnote { flex-direction: column; gap: 2px; padding: 6px 16px 10px; text-align: center; }
}

/* ---------- Mobile ---------- */
.menu-toggle {
  display: none;
  width: 36px; height: 36px;
  align-items: center; justify-content: center;
  border-radius: 9px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 18px;
  flex: none;
}
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 40;
}
@media (max-width: 900px) {
  .app { display: block; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 240px;
    max-width: 82vw;
    transform: translateX(-100%);
    transition: transform .2s ease;
    z-index: 50;
    box-shadow: 4px 0 24px rgba(0,0,0,0.4);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.show { display: block; }
  .menu-toggle { display: flex; }
  .topbar-search { display: none; }
  .topbar { padding: 12px 14px; gap: 10px; }
  .topbar-actions { gap: 8px; }
  .user-chip .who { display: none; }
  .content { padding: 14px 14px 40px; }
  table { display: block; overflow-x: auto; white-space: nowrap; }
}
