/* ========== Prime Visa Ops — Design Tokens ========== */
:root {
  --navy-900: #0b2347;
  --navy-800: #122e5c;
  --navy-700: #1b3a6b;
  --navy-600: #25497f;
  --navy-500: #3a619b;
  --navy-100: #e7eef8;
  --navy-50:  #f3f7fc;

  --gold-500: #c89B3c;
  --gold-400: #d4ae5e;

  --ink-900:  #0d1521;
  --ink-700:  #2b384d;
  --ink-500:  #5b6878;
  --ink-400:  #8593a4;
  --ink-300:  #b6bfcc;
  --ink-200:  #d8dee7;
  --ink-100:  #ecf0f6;
  --ink-50:   #f7f9fc;
  --white:    #ffffff;

  --green-600: #1e8a5a;
  --green-100: #e2f3ea;
  --amber-600: #c08319;
  --amber-100: #fbeed2;
  --red-600:   #c8302a;
  --red-100:   #fbe1df;
  --blue-100:  #dbe9fb;
  --blue-600:  #2a6fdb;
  --purple-100:#e8e0f8;
  --purple-600:#6a3fbf;
  --slate-100: #e6e9ef;
  --slate-600: #4b5765;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(11,35,71,.06);
  --shadow:    0 4px 16px rgba(11,35,71,.08);
  --shadow-lg: 0 12px 32px rgba(11,35,71,.14);

  --font-display: "Fraunces", "Times New Roman", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-lao: "Noto Sans Lao", "Phetsarath OT", "Saysettha OT", var(--font-body);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink-900);
  background: var(--ink-50);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }

/* ========== App shell ========== */
.app {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--navy-900);
  color: #cad7eb;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 14px;
}
.sidebar .brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: var(--navy-700);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.sidebar .brand-mark svg { display: block; }
.sidebar .brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: #fff;
  letter-spacing: -0.01em;
  line-height: 1;
}
.sidebar .brand-tag {
  font-size: 10px;
  color: #8da3c4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 3px;
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-section {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6f85a8;
  padding: 14px 10px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  color: #cad7eb;
  background: transparent;
  border: none;
  text-align: left;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-item.active {
  background: var(--navy-700);
  color: #fff;
}
.nav-item .nav-badge {
  margin-left: auto;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 99px;
}
.nav-item.active .nav-badge {
  background: var(--gold-500);
  color: var(--navy-900);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
}
.sidebar-footer .ops-user {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 8px;
}
.sidebar-footer .ops-user .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--gold-500); color: var(--navy-900);
  display: grid; place-items: center;
  font-weight: 700; font-size: 12px;
}
.sidebar-footer .ops-user .name { color: #fff; font-weight: 600; font-size: 13px; }
.sidebar-footer .ops-user .role { color: #8da3c4; font-size: 11px; }

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

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--ink-200);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 18px;
  position: sticky; top: 0; z-index: 10;
}
.topbar .page-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink-900);
  letter-spacing: -0.01em;
  margin: 0;
}
.topbar .crumbs {
  font-size: 12px;
  color: var(--ink-500);
  margin-bottom: 2px;
}
.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.search {
  position: relative;
  display: flex; align-items: center;
}
.search input {
  background: var(--ink-50);
  border: 1px solid var(--ink-200);
  border-radius: 8px;
  padding: 8px 12px 8px 32px;
  width: 280px;
  outline: none;
  transition: all 0.15s;
}
.search input:focus { border-color: var(--navy-500); background: #fff; }
.search svg { position: absolute; left: 10px; color: var(--ink-400); }

.content {
  padding: 24px 28px 64px;
  max-width: 1400px;
  width: 100%;
}
.content.wide { max-width: none; }

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  background: #fff;
  color: var(--ink-900);
  border-color: var(--ink-200);
  transition: all 0.12s;
  text-decoration: none;
}
.btn:hover { border-color: var(--ink-300); background: var(--ink-50); }
.btn.primary {
  background: var(--navy-700);
  color: #fff;
  border-color: var(--navy-700);
}
.btn.primary:hover { background: var(--navy-800); }
.btn.danger {
  background: #fff;
  color: var(--red-600);
  border-color: var(--red-100);
}
.btn.danger:hover { background: var(--red-100); }
.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-500);
}
.btn.ghost:hover { background: var(--ink-100); color: var(--ink-900); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.icon { padding: 7px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ========== Cards ========== */
.card {
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--ink-100);
  display: flex; align-items: center; gap: 10px;
}
.card-header h3 {
  font-family: var(--font-display);
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-900);
}
.card-header .subtle { font-size: 12px; color: var(--ink-500); }
.card-body { padding: 18px; }

/* ========== KPI Cards ========== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.kpi {
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}
.kpi .kpi-label {
  font-size: 12px;
  color: var(--ink-500);
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px;
}
.kpi .kpi-label .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--navy-500);
}
.kpi .kpi-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink-900);
  line-height: 1.1;
}
.kpi .kpi-sub {
  font-size: 12px;
  color: var(--ink-500);
  margin-top: 6px;
  display: flex; align-items: center; gap: 4px;
}
.kpi .kpi-trend.up { color: var(--green-600); }
.kpi .kpi-trend.down { color: var(--red-600); }
.kpi.accent::before {
  content: '';
  position: absolute; top: 0; left: 0; height: 3px; width: 100%;
  background: var(--navy-700);
}
.kpi.accent-gold::before { background: var(--gold-500); }
.kpi.accent-green::before { background: var(--green-600); }
.kpi.accent-red::before { background: var(--red-600); }

/* ========== Tables ========== */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tbl th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-500);
  background: var(--ink-50);
  border-bottom: 1px solid var(--ink-200);
  font-weight: 600;
  white-space: nowrap;
}
.tbl td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--ink-100);
  vertical-align: middle;
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tr.clickable { cursor: pointer; transition: background 0.1s; }
.tbl tr.clickable:hover { background: var(--ink-50); }
.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl th.num { text-align: right; }
.tbl .order-num { font-family: var(--font-mono); font-size: 12px; color: var(--ink-700); }

/* ========== Badges ========== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  background: var(--ink-100);
  color: var(--ink-700);
  white-space: nowrap;
}
.badge .dot {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}
.badge.blue   { background: var(--blue-100);   color: var(--blue-600); }
.badge.green  { background: var(--green-100);  color: var(--green-600); }
.badge.amber  { background: var(--amber-100);  color: var(--amber-600); }
.badge.red    { background: var(--red-100);    color: var(--red-600); }
.badge.purple { background: var(--purple-100); color: var(--purple-600); }
.badge.slate  { background: var(--slate-100);  color: var(--slate-600); }
.badge.navy   { background: var(--navy-100);   color: var(--navy-700); }

/* ========== Forms ========== */
.form-row { display: grid; gap: 14px; }
.form-row.two { grid-template-columns: 1fr 1fr; }
.form-row.three { grid-template-columns: repeat(3, 1fr); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-700);
  letter-spacing: 0.01em;
}
.field input, .field textarea, .field select {
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: 7px;
  padding: 9px 11px;
  outline: none;
  transition: all 0.12s;
  width: 100%;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--navy-500);
  box-shadow: 0 0 0 3px var(--navy-100);
}
.field textarea { resize: vertical; min-height: 80px; font-family: inherit; }
.field .hint { font-size: 11px; color: var(--ink-500); }

/* ========== Toolbar ========== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.toolbar .spacer { flex: 1; }
.toolbar .filters { display: flex; gap: 8px; align-items: center; }
.toolbar select, .toolbar input {
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: 7px;
  padding: 7px 11px;
  outline: none;
}

/* ========== Pipeline (Kanban) ========== */
.pipeline {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.pipeline-col {
  background: var(--ink-50);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius);
  padding: 12px;
  min-height: 200px;
  display: flex; flex-direction: column; gap: 8px;
}
.pipeline-col h4 {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-500);
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 600;
}
.pipeline-col h4 .count {
  background: #fff;
  border: 1px solid var(--ink-200);
  padding: 1px 7px;
  border-radius: 99px;
  font-size: 11px;
  color: var(--ink-700);
  letter-spacing: 0;
}
.pipeline-card {
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: 8px;
  padding: 10px 11px;
  cursor: pointer;
  transition: all 0.12s;
}
.pipeline-card:hover { border-color: var(--navy-500); box-shadow: var(--shadow-sm); }
.pipeline-card .pc-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-500);
}
.pipeline-card .pc-client {
  font-weight: 600;
  font-size: 13px;
  color: var(--ink-900);
  margin-bottom: 4px;
}
.pipeline-card .pc-service {
  font-size: 12px;
  color: var(--ink-500);
  display: flex; align-items: center; gap: 6px;
}
.pipeline-card .pc-due {
  margin-top: 6px;
  font-size: 11px;
  color: var(--ink-500);
}
.pipeline-card .pc-due.overdue { color: var(--red-600); font-weight: 600; }

/* ========== Two-col layout ========== */
.split { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.split.even { grid-template-columns: 1fr 1fr; }

/* ========== Activity feed ========== */
.activity { display: flex; flex-direction: column; }
.activity-item {
  display: flex; gap: 11px;
  padding: 11px 0;
  border-bottom: 1px solid var(--ink-100);
}
.activity-item:last-child { border-bottom: none; }
.activity-item .a-icon {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--navy-100);
  color: var(--navy-700);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.activity-item .a-body { flex: 1; }
.activity-item .a-text { font-size: 13px; }
.activity-item .a-text b { font-weight: 600; }
.activity-item .a-time { font-size: 11px; color: var(--ink-500); margin-top: 2px; }

/* ========== Detail page ========== */
.detail-head {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}
.detail-head .h-left { flex: 1; }
.detail-head h1 {
  font-family: var(--font-display);
  margin: 0 0 4px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.detail-head .h-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-500);
  display: flex; gap: 12px; align-items: center;
}
.detail-tabs {
  display: flex;
  border-bottom: 1px solid var(--ink-200);
  gap: 4px;
  margin-bottom: 16px;
}
.detail-tabs button {
  background: none;
  border: none;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: flex; align-items: center; gap: 7px;
}
.detail-tabs button:hover { color: var(--ink-900); }
.detail-tabs button.active {
  color: var(--navy-700);
  border-bottom-color: var(--navy-700);
}
.detail-tabs button .count {
  background: var(--ink-100);
  color: var(--ink-700);
  padding: 0 6px;
  border-radius: 99px;
  font-size: 11px;
}

/* ========== Checklist ========== */
.checklist { display: flex; flex-direction: column; }
.checklist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--ink-200);
  border-radius: 8px;
  margin-bottom: 7px;
  background: #fff;
}
.checklist-item.done {
  background: var(--green-100);
  border-color: #c0e2cf;
}
.checklist-item.done .ci-label { text-decoration: line-through; color: var(--ink-500); }
.checklist-item .ci-check {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--ink-300);
  display: grid; place-items: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.15s;
}
.checklist-item.done .ci-check {
  background: var(--green-600);
  border-color: var(--green-600);
  color: #fff;
}
.checklist-item .ci-label { flex: 1; font-size: 13px; font-weight: 500; }
.checklist-item .ci-status { font-size: 11px; color: var(--ink-500); }
.checklist-item .ci-actions { display: flex; gap: 6px; }

/* ========== File grid ========== */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.file-card {
  border: 1px solid var(--ink-200);
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  background: #fff;
}
.file-card .f-preview {
  height: 110px;
  background: var(--ink-50);
  display: grid; place-items: center;
  border-bottom: 1px solid var(--ink-100);
  overflow: hidden;
}
.file-card .f-preview img {
  max-width: 100%; max-height: 100%; object-fit: cover;
  width: 100%; height: 100%;
}
.file-card .f-info {
  padding: 8px 10px;
  font-size: 12px;
}
.file-card .f-name {
  font-weight: 600;
  color: var(--ink-900);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-card .f-meta {
  font-size: 11px; color: var(--ink-500);
  display: flex; justify-content: space-between;
  margin-top: 2px;
}
.file-card .f-actions {
  display: flex;
  border-top: 1px solid var(--ink-100);
  background: var(--ink-50);
}
.file-card .f-actions button {
  flex: 1;
  background: none;
  border: none;
  padding: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-700);
  cursor: pointer;
}
.file-card .f-actions button:hover { background: var(--ink-100); color: var(--navy-700); }
.file-card .f-actions button + button { border-left: 1px solid var(--ink-100); }

.file-dropzone {
  border: 2px dashed var(--ink-300);
  border-radius: 10px;
  padding: 32px 18px;
  text-align: center;
  background: var(--ink-50);
  color: var(--ink-500);
  margin-bottom: 16px;
  cursor: pointer;
  transition: all 0.15s;
}
.file-dropzone:hover, .file-dropzone.drag {
  border-color: var(--navy-500);
  background: var(--navy-50);
  color: var(--navy-700);
}

/* ========== Modal ========== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(11,35,71,0.4);
  backdrop-filter: blur(2px);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 32px;
  animation: fade 0.15s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: calc(100vh - 64px);
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: pop 0.18s ease;
}
@keyframes pop { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal.lg { max-width: 880px; }
.modal.xl { max-width: 1100px; }
.modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--ink-200);
  display: flex; align-items: center;
}
.modal-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
}
.modal-header .close {
  margin-left: auto;
  background: none; border: none;
  padding: 6px;
  border-radius: 6px;
  color: var(--ink-500);
  cursor: pointer;
}
.modal-header .close:hover { background: var(--ink-100); color: var(--ink-900); }
.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--ink-200);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  background: var(--ink-50);
}

/* ========== Empty state ========== */
.empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--ink-500);
}
.empty h4 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-700);
  margin: 0 0 6px;
}
.empty p { margin: 0 0 14px; font-size: 13px; }

/* ========== Invoice preview (matching Prime invoice layout) ========== */
.invoice-preview {
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: 8px;
  padding: 38px 44px;
  font-size: 13px;
  color: #000;
  font-family: var(--font-body);
}
.invoice-preview .iv-head {
  display: flex; justify-content: space-between;
  margin-bottom: 14px;
}
.invoice-preview .iv-biz { font-size: 12px; line-height: 1.55; }
.invoice-preview .iv-biz b { font-weight: 600; }
.invoice-preview .iv-logo {
  width: 64px; height: 64px;
  background: var(--navy-700);
  border-radius: 4px;
  display: grid; place-items: center;
  color: #fff;
}
.invoice-preview h1.iv-title {
  font-family: var(--font-display);
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  margin: 14px 0 18px;
  letter-spacing: 0.01em;
}
.invoice-preview .iv-meta {
  display: flex; justify-content: flex-end;
  gap: 24px;
  font-size: 12.5px;
  border-top: 1px solid #000;
  padding-top: 8px;
}
.invoice-preview .iv-meta div { display: flex; gap: 16px; }
.invoice-preview .iv-meta .lao { font-family: var(--font-lao); }
.invoice-preview .iv-to {
  border-top: 1px solid #000;
  border-bottom: 1px solid #000;
  padding: 10px 0;
  margin: 12px 0;
  display: grid; grid-template-columns: 80px 1fr; row-gap: 4px;
  font-size: 12.5px;
}
.invoice-preview .iv-to b { font-weight: 600; }
.invoice-preview table.iv-items {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.invoice-preview table.iv-items th,
.invoice-preview table.iv-items td {
  border: 1px solid #000;
  padding: 8px 10px;
  vertical-align: top;
}
.invoice-preview table.iv-items th {
  background: #f3f3f3;
  font-weight: 700;
  text-align: center;
}
.invoice-preview table.iv-items td.num { text-align: right; font-variant-numeric: tabular-nums; }
.invoice-preview table.iv-items td.idx { text-align: center; width: 50px; }
.invoice-preview table.iv-items td.qty { text-align: center; width: 80px; }
.invoice-preview table.iv-items td.amt { width: 140px; }
.invoice-preview table.iv-items tr.empty-row td { height: 24px; }
.invoice-preview table.iv-items tr.sum td {
  text-align: right;
  font-weight: 600;
  background: #fafafa;
}
.invoice-preview table.iv-items tr.sum td:first-child { background: #fff; border-left: none; border-bottom: none; }
.invoice-preview .iv-note {
  margin-top: 10px;
  font-size: 12px;
  display: grid; grid-template-columns: 90px 1fr;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed #000;
}
.invoice-preview .iv-foot {
  margin-top: 16px;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px;
  font-size: 11.5px;
  line-height: 1.6;
}
.invoice-preview .iv-bank { }
.invoice-preview .iv-sig {
  text-align: center;
  display: flex; flex-direction: column;
  justify-content: flex-end;
}
.invoice-preview .iv-sig .sig-line {
  border-top: 1px solid #000;
  margin-top: 50px;
  padding-top: 6px;
}

/* ========== Note item ========== */
.note-item {
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.note-item .nt-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
  font-size: 11px;
  color: var(--ink-500);
}
.note-item .nt-text { font-size: 13px; white-space: pre-wrap; line-height: 1.55; }

/* ========== Misc ========== */
.row-gap { display: flex; flex-direction: column; gap: 14px; }
.hstack { display: flex; align-items: center; gap: 8px; }
.spacer { flex: 1; }
.dim { color: var(--ink-500); }
.text-mono { font-family: var(--font-mono); }
.divider { height: 1px; background: var(--ink-200); margin: 14px 0; }
.flag { width: 16px; height: 12px; border-radius: 2px; display: inline-block; vertical-align: middle; }

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }

.section-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--ink-900);
}

@media print {
  body { background: #fff; }
  .sidebar, .topbar, .toolbar, .modal-header, .modal-footer, .btn { display: none !important; }
  .modal-backdrop { position: static; padding: 0; background: none; }
  .modal { box-shadow: none; max-width: none; max-height: none; }
  .modal-body { overflow: visible; padding: 0; }
  .invoice-preview { border: none; padding: 0; }
}
