/* Moris Accounting — type, color, and header taken from moris.page. */

:root {
  --navy: #0A1A30;
  --navy-2: #0F2442;
  --gold: #C8962E;
  --gold-2: #E0B455;
  --gold-dark: #B5841F;
  --green: #1F7A52;
  --green-dark: #14543A;
  --green-soft: rgba(31, 122, 82, 0.12);
  --ink: #13241B;
  --ink-2: #33443A;
  --muted: #56655B;
  --faint: #66756B;
  --line: rgba(20, 45, 32, 0.10);
  --line-strong: rgba(20, 45, 32, 0.18);
  --bg: #F6F7F2;
  --panel: linear-gradient(180deg, rgba(255, 255, 255, 0.80), rgba(255, 255, 255, 0.60));
  --blue: #1F6B47;
  --blue-soft: rgba(31, 122, 82, 0.10);
  --amber: #7A5710;
  --amber-soft: rgba(200, 150, 46, 0.16);
  --red: #B4382A;
  --red-soft: rgba(201, 80, 61, 0.10);
  --gray-soft: rgba(20, 45, 32, 0.06);
  --radius: 22px;
  --radius-sm: 14px;
  --shadow-sm: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 0 0 1px rgba(20, 45, 32, 0.04), 0 12px 32px rgba(20, 45, 32, 0.08);
  --shadow-md: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 0 0 1px rgba(20, 45, 32, 0.05), 0 18px 44px rgba(20, 45, 32, 0.12);
  --shadow-lg: 0 24px 60px rgba(20, 45, 32, 0.18);
  --sidebar-w: 248px;
  --topbar-h: 72px;
  --surface: #FFFFFF;
  --surface-2: #14543A;
  --glass-blur: blur(22px) saturate(150%);
  --field: rgba(255, 255, 255, 0.78);
  --hover: rgba(20, 45, 32, 0.05);
  --success: #1B7A52;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body, #root { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Poppins, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }

button { font-family: inherit; font-size: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(20, 45, 32, 0.104); border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(20, 45, 32, 0.182); background-clip: content-box; border: 3px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- layout */

.app { display: flex; flex-direction: column; min-height: 100vh; }
.frame { display: flex; flex: 1; min-width: 0; align-items: stretch; }

.sidebar {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  width: var(--sidebar-w);
  flex: none;
  background: rgba(20, 45, 32, 0.029);
  border-right: 1px solid var(--line);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.2px;
  flex: none;
}
.brand:hover { color: var(--ink); text-decoration: none; }
.brand-mark { display: block; flex: none; border-radius: 50%; }
.brand-word { white-space: nowrap; }

.nav { flex: 1; overflow-y: auto; padding: 10px 10px 20px; }
.nav-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--faint);
  padding: 14px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin: 1px 0;
  border-radius: 6px;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border: 0;
  background: none;
  width: 100%;
  text-align: left;
  position: relative;
  transition: background 0.12s ease, color 0.12s ease;
}
.nav-item:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.nav-item.active { background: var(--green); color: #fff; font-weight: 600; }
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -10px; top: 6px; bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--gold);
}
.nav-icon { width: 18px; height: 18px; flex: none; color: #66756B; }
.nav-item.active .nav-icon { color: var(--gold-2); }
.nav-badge { margin-left: auto; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

.sidebar-foot { border-top: 1px solid var(--line); padding: 12px 16px; font-size: 11.5px; color: var(--faint); }
.btn.sidebar-signout { display: none; margin: 4px 12px 8px; justify-content: flex-start; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h);
  background: rgba(255, 255, 255, 0.55);
  border-bottom: 1px solid var(--line);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-company { font-weight: 500; font-size: 14px; white-space: nowrap; color: #33443A; }

.search { position: relative; width: 360px; max-width: 36vw; }
.search-input {
  width: 100%;
  height: 38px;
  border: 1px solid rgba(20, 45, 32, 0.091);
  background: rgba(20, 45, 32, 0.052);
  border-radius: 999px;
  padding: 0 14px 0 36px;
  font-size: 13.5px;
  color: var(--ink);
  outline: none;
}
.search-input::placeholder { color: #33443A; }
.search-input:focus { background: rgba(20, 45, 32, 0.078); border-color: var(--gold-2); box-shadow: 0 0 0 3px rgba(200, 150, 46, 0.28); }
.search-icon { position: absolute; left: 12px; top: 11px; color: #33443A; }
.topbar .btn-ghost { color: #33443A; border-radius: 999px; }
.topbar .btn-ghost:hover { background: rgba(20, 45, 32, 0.052); color: var(--ink); }
.topbar .btn-primary { border-radius: 999px; height: 38px; padding: 0 16px; }
.topbar .search-results { color: var(--ink); }

.topbar-spacer { flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.search-results {
  position: absolute;
  top: 42px;
  left: 0;
  width: 420px;
  max-width: 80vw;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  padding: 6px;
  z-index: 60;
  max-height: 420px;
  overflow-y: auto;
}
.search-group-label { font-size: 12px; color: var(--faint); padding: 8px 10px 4px; font-weight: 500; }
.search-result {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 13px;
}
.search-result:hover { background: var(--hover); }
.search-result .meta { margin-left: auto; color: var(--muted); font-size: 12px; }

.content { padding: 28px 32px 72px; width: 100%; max-width: 1180px; }

.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.page-title { font-size: 28px; font-weight: 700; letter-spacing: -0.4px; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.page-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.crumbs { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.crumbs button { background: none; border: 0; color: var(--blue); cursor: pointer; padding: 0; font-size: 12.5px; }
.crumbs button:hover { text-decoration: underline; }

/* --------------------------------------------------------------- surface */

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.card-title { font-size: 14.5px; font-weight: 600; }
.card-sub { font-size: 12.5px; color: var(--muted); }
.card-body { padding: 18px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }

.stat { background: var(--panel); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 25px; font-weight: 650; letter-spacing: -0.03em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat-foot { font-size: 12px; color: var(--muted); margin-top: 6px; display: flex; gap: 6px; align-items: center; }
.stat-foot .up { color: var(--success); font-weight: 600; }
.stat-foot .down { color: var(--red); font-weight: 600; }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.strong { font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.right { margin-left: auto; }
.stack { display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; align-items: center; gap: 8px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }

/* ---------------------------------------------------------------- tables */

.table-wrap { overflow: auto; border-radius: var(--radius); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th {
  position: sticky; top: 0; z-index: 1;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--ink-2);
  background: rgba(20, 45, 32, 0.026);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid rgba(20, 45, 32, 0.046); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: var(--hover); }
.table tfoot td { font-weight: 600; background: rgba(20, 45, 32, 0.026); border-top: 1px solid var(--line); }
.table .sub { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.table.compact td { padding: 8px 12px; }
.table.compact th { padding: 8px 12px; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 18px;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.green { background: var(--green-soft); color: #7A5710; }
.pill.blue { background: var(--blue-soft); color: #1F6B47; }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.gray { background: var(--gray-soft); color: #33443A; }

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(20, 45, 32, 0.039);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { background: rgba(20, 45, 32, 0.078); border-color: rgba(20, 45, 32, 0.182); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 1px; }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn-primary:hover { background: var(--gold-dark); border-color: var(--gold-dark); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--hover); border-color: transparent; }
.btn-danger { color: var(--red); border-color: rgba(255, 154, 138, 0.40); background: transparent; }
.btn-danger:hover { background: var(--red-soft); border-color: rgba(255, 154, 138, 0.6); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 5px; }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: 6px; }
.btn-block { width: 100%; }

.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 6px 0 0 6px; margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 6px 6px 0; }

/* ---------------------------------------------------------------- forms */

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 12.5px; font-weight: 550; color: var(--ink-2); }
.field .req { color: var(--red); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--field);
  padding: 0 10px;
  font-size: 13.5px;
  color: var(--ink);
  font-family: inherit;
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.textarea { height: auto; min-height: 74px; padding: 8px 10px; resize: vertical; line-height: 1.45; }
.file-input {
  height: auto;
  min-height: 40px;
  padding: 7px 10px;
  line-height: 1.4;
  cursor: pointer;
}
.file-input::file-selector-button {
  height: 26px;
  margin-right: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  padding: 0 10px;
  cursor: pointer;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200, 150, 46, 0.22); }
.input:disabled, .select:disabled { background: rgba(20, 45, 32, 0.019); color: var(--muted); }
.input.num, .num .input { text-align: right; font-variant-numeric: tabular-nums; }
.input.error, .select.error { border-color: #de8b82; box-shadow: 0 0 0 3px rgba(180, 45, 33, 0.1); }
.hint { font-size: 11.5px; color: var(--muted); }
.error-text { font-size: 12px; color: var(--red); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237c8087' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
.form-grid { display: grid; gap: 14px; }
.form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.form-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.form-row { display: grid; gap: 14px; }
.span-2 { grid-column: span 2; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--green); }

/* --------------------------------------------------------------- overlay */

.overlay {
  position: fixed; inset: 0;
  background: rgba(10, 26, 48, 0.42);
  z-index: 30;
  animation: fade 0.16s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 720px; max-width: 94vw;
  background: var(--surface);
  z-index: 80;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slide 0.2s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.drawer.narrow { width: 480px; }
@keyframes slide { from { transform: translateX(30px); opacity: 0.4; } to { transform: none; opacity: 1; } }

.drawer-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.drawer-title { font-size: 17px; font-weight: 650; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px; }
.drawer-foot { display: flex; align-items: center; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); background: rgba(20, 45, 32, 0.019); }

.modal {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 440px; max-width: 92vw;
  background: var(--surface); border-radius: 10px;
  z-index: 80;
  box-shadow: var(--shadow-lg);
  padding: 22px;
  animation: pop 0.16s ease;
}
@keyframes pop { from { transform: translate(-50%, -48%) scale(0.98); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.modal h3 { font-size: 17px; margin-bottom: 6px; }
.modal p { color: var(--ink-2); font-size: 13.5px; margin: 0 0 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------------------------------------------------------------- toast */

.toast-wrap { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--surface-2); color: #fff; border: 1px solid var(--line-strong);
  border-radius: 8px; padding: 10px 16px;
  font-size: 13px; box-shadow: var(--shadow-md);
  display: flex; align-items: center; gap: 8px;
  animation: toast-in 0.18s ease;
  max-width: 90vw;
}
.toast.error { background: #6E2219; }
.toast.success { background: #165A3E; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* ------------------------------------------------------------------ tabs */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab {
  border: 0; background: none; padding: 9px 12px; cursor: pointer;
  font-size: 13.5px; font-weight: 550; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--green); }
.tab .count { font-size: 11px; color: var(--muted); margin-left: 5px; }

/* ----------------------------------------------------------- misc states */

.empty { text-align: center; padding: 54px 20px; color: var(--muted); }
.empty-icon { width: 44px; height: 44px; border-radius: 50%; background: rgba(20, 45, 32, 0.052); display: grid; place-items: center; margin: 0 auto 12px; color: var(--faint); }
.empty h3 { font-size: 15px; color: var(--ink); margin-bottom: 4px; }
.empty p { margin: 0 0 14px; font-size: 13px; }

.skeleton { background: linear-gradient(90deg, rgba(20, 45, 32, 0.033) 25%, rgba(20, 45, 32, 0.078) 37%, rgba(20, 45, 32, 0.033) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 5px; height: 14px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.banner {
  display: flex; align-items: flex-start; gap: 10px;
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 13px;
  border: 1px solid;
}
.banner.info { background: var(--blue-soft); border-color: rgba(127, 178, 240, 0.35); color: #1F6B47; }
.banner.warn { background: var(--amber-soft); border-color: rgba(224, 180, 85, 0.40); color: #7A5710; }
.banner.error { background: var(--red-soft); border-color: rgba(255, 154, 138, 0.40); color: #A3301F; }

/* -------------------------------------------------------------- dashboard */

.greeting { font-size: 28px; font-weight: 700; letter-spacing: -0.4px; }
.greeting-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

.chart { position: relative; }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--ink-2); }
.legend-swatch { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-right: 6px; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-grid-line { stroke: rgba(20, 45, 32, 0.052); stroke-width: 1; }
.chart-label { font-size: 10.5px; fill: var(--muted); }
.chart-value { font-size: 10px; fill: var(--ink-2); font-weight: 600; }

.status-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; gap: 2px; background: rgba(20, 45, 32, 0.052); }
.status-seg { height: 100%; }
.status-legend { display: flex; flex-direction: column; gap: 9px; margin-top: 16px; }
.status-legend-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.status-legend-row .total { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 550; }

.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(20, 45, 32, 0.046); }
.list-row:last-child { border-bottom: 0; }
.list-row .name { font-weight: 550; }
.list-row .meta { font-size: 12px; color: var(--muted); }
.list-row .amount { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 550; }

.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(20, 45, 32, 0.065); color: #33443A;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 650; flex: none;
}
.avatar.green { background: var(--green-soft); color: #7A5710; }
.avatar.blue { background: var(--blue-soft); color: #1F6B47; }
.avatar.amber { background: var(--amber-soft); color: #7A5710; }

/* ------------------------------------------------------------- documents */

.doc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 34px 38px; max-width: 900px; }
.doc-head { display: flex; justify-content: space-between; gap: 30px; align-items: flex-start; }
.doc-brand { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.doc-brand-meta { font-size: 12px; color: var(--muted); line-height: 1.5; margin-top: 4px; }
.doc-title { text-align: right; }
.doc-title h2 { font-size: 26px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); font-weight: 650; }
.doc-no { font-size: 13px; color: var(--muted); margin-top: 2px; }
.doc-status { margin-top: 8px; display: flex; justify-content: flex-end; }

.doc-parties { display: grid; grid-template-columns: 1.2fr 1fr; gap: 30px; margin-top: 34px; }
.doc-block-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); font-weight: 700; margin-bottom: 6px; }
.doc-party-name { font-weight: 600; font-size: 14px; }
.doc-party-lines { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }
.doc-meta-grid { display: grid; grid-template-columns: auto auto; gap: 5px 22px; font-size: 12.5px; justify-content: end; }
.doc-meta-grid dt { color: var(--muted); }
.doc-meta-grid dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

.doc-table { width: 100%; border-collapse: collapse; margin-top: 28px; font-size: 13px; }
.doc-table th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); padding: 8px 8px; border-bottom: 1px solid var(--line-strong); }
.doc-table td { padding: 10px 8px; border-bottom: 1px solid rgba(20, 45, 32, 0.046); vertical-align: top; }
.doc-table .amt { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.doc-totals { display: flex; justify-content: flex-end; margin-top: 16px; }
.doc-totals-inner { width: 300px; }
.doc-total-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; }
.doc-total-row .label { color: var(--ink-2); }
.doc-total-row .value { font-variant-numeric: tabular-nums; }
.doc-total-row.grand { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 10px; font-size: 15px; font-weight: 700; }
.doc-total-row.balance { background: var(--green-soft); margin-top: 8px; padding: 9px 10px; border-radius: 12px; font-weight: 650; color: #9A6E18; }

.doc-notes { margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 24px; font-size: 12.5px; color: var(--ink-2); }
.doc-payments { margin-top: 22px; }
.doc-payment-row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 6px 0; border-bottom: 1px dashed var(--line); }

.doc-aside { display: flex; flex-direction: column; gap: 12px; }

.line-editor { width: 100%; border-collapse: collapse; font-size: 13px; }
.line-editor th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); text-align: left; padding: 6px 6px; border-bottom: 1px solid var(--line); font-weight: 650; }
.line-editor td { padding: 5px 4px; vertical-align: top; border-bottom: 1px solid rgba(20, 45, 32, 0.046); }
.line-editor .input, .line-editor .select { height: 32px; font-size: 13px; }
.line-editor .row-no { color: var(--faint); font-size: 12px; width: 28px; text-align: center; padding-top: 12px; }
.line-editor .amount { text-align: right; font-variant-numeric: tabular-nums; padding-top: 12px; font-weight: 550; white-space: nowrap; }
.line-editor .remove { color: var(--faint); }
.line-editor .remove:hover { color: var(--red); background: var(--red-soft); }
.line-editor-wrap { overflow-x: auto; }
.totals-box { width: 320px; margin-left: auto; margin-top: 14px; }
.totals-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13.5px; }
.totals-row .label { color: var(--ink-2); }
.totals-row .value { font-variant-numeric: tabular-nums; font-weight: 550; }
.totals-row.grand { border-top: 1px solid var(--line-strong); margin-top: 4px; padding-top: 10px; font-size: 15px; font-weight: 700; }

.apply-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.apply-table th { font-size: 11px; text-transform: uppercase; color: var(--muted); text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); }
.apply-table td { padding: 8px; border-bottom: 1px solid rgba(20, 45, 32, 0.046); }
.apply-table .input { height: 30px; }
.apply-table tr.selected td { background: rgba(224, 180, 85, 0.10); }

/* --------------------------------------------------------------- reports */

.report-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.report-card { text-align: left; background: var(--panel); color: var(--ink); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; cursor: pointer; transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s; }
.report-card:hover { box-shadow: var(--shadow-md); border-color: rgba(224, 180, 85, 0.55); transform: translateY(-1px); }
.report-card .icon { width: 34px; height: 34px; border-radius: 12px; background: var(--green-soft); color: #7A5710; display: grid; place-items: center; margin-bottom: 10px; }
.report-card h3 { font-size: 14px; }
.report-card p { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }

.report-viewer { max-width: 980px; }
.report-head { text-align: center; margin-bottom: 22px; }
.report-head h2 { font-size: 19px; letter-spacing: -0.01em; }
.report-head .company { font-size: 13px; color: var(--ink-2); margin-bottom: 2px; }
.report-head .period { font-size: 12.5px; color: var(--muted); }

.report-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.report-table td { padding: 6px 8px; border-bottom: 1px solid rgba(20, 45, 32, 0.046); }
.report-table .indent { padding-left: 26px; }
.report-table .amt { text-align: right; font-variant-numeric: tabular-nums; width: 150px; white-space: nowrap; }
.report-table tr.section-head td { font-weight: 650; border-bottom: 1px solid var(--line-strong); padding-top: 16px; }
.report-table tr.total td { font-weight: 650; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); background: rgba(20, 45, 32, 0.026); }
.report-table tr.subtotal td { font-weight: 600; }
.report-table tr.grand td { font-weight: 750; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); font-size: 14px; }
.report-table tr.spacer td { border: 0; height: 6px; padding: 0; }
.report-table .negative { color: var(--red); }
.report-scroll { overflow-x: auto; }
.report-table.months .amt { width: 108px; }
.report-table.months td:first-child { min-width: 200px; }

.report-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.report-toolbar .field { flex-direction: row; align-items: center; gap: 7px; }
.report-toolbar label { font-size: 12.5px; color: var(--ink-2); }
.report-toolbar .input { height: 32px; width: 150px; }

/* ------------------------------------------------------------- responsive */

@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    height: calc(100vh - var(--topbar-h));
    width: 248px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-lg);
    z-index: 35;
  }
  .sidebar.open { transform: none; }
  .grid-3, .grid-2-1, .grid-1-2, .grid-2 { grid-template-columns: 1fr; }
  .content { padding: 20px 18px 60px; }
  .search { max-width: none; flex: 1; width: auto; }
  .topbar-company { display: none; }
  .doc { padding: 22px; }
}

@media (max-width: 760px) {
  :root { --topbar-h: 116px; }
  .topbar { flex-wrap: wrap; height: auto; align-content: center; padding: 10px 12px 12px; gap: 8px 10px; }
  .topbar .sign-out { display: none; }
  .btn.sidebar-signout { display: inline-flex; }
  .search { order: 5; flex: 1 1 100%; width: 100%; max-width: none; }
  .topbar-spacer { display: none; }
  .topbar-right { margin-left: auto; }
  .brand { font-size: 16px; }
}

@media (max-width: 640px) {
  .grid-4 { grid-template-columns: 1fr; }
  .report-grid { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; }
  .page-actions { margin-left: 0; }
  .doc-parties { grid-template-columns: 1fr; }
  .form-grid.cols-2, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: 1fr; }
}

/* ----------------------------------------------------------------- print */

@media print {
  body { background: #fff; }
  .sidebar, .topbar, .page-head .page-actions, .crumbs, .no-print, .toast-wrap { display: none !important; }
  .main { margin-left: 0 !important; }
  .content { padding: 0; max-width: none; }
  .doc { border: 0; box-shadow: none; padding: 0; max-width: none; }
  .table th { background: #fff; }
  a { color: inherit; }
}

/* ------------------------------------------------------------ additions */

.nav-toggle { display: none; }
.nav-item:hover, .nav-item:focus { text-decoration: none; }

.menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 250px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  padding: 6px;
  z-index: 60;
}
.menu-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: none;
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
  color: var(--ink);
  font-size: 13.5px;
}
.menu-item:hover { background: var(--hover); }
.menu-item svg { margin-top: 2px; color: var(--muted); }
.menu-hint { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; font-weight: 400; }

@media (max-width: 980px) {
  .nav-toggle { display: inline-flex; }
}

@media print {
  .report-toolbar { display: none !important; }
}

/* ------------------------------------------------------- final polish */

.doc { margin-left: auto; margin-right: auto; }
.doc-note { max-width: 900px; margin: 12px auto 0; display: flex; align-items: center; gap: 6px; }
.report-viewer { margin-left: auto; margin-right: auto; }

/* ------------------------------------------------------------ auth screens */

.boot-splash {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: transparent; }
.login-art {
  position: relative;
  overflow: hidden;
  background: radial-gradient(900px 480px at 82% 12%, #163463 0, rgba(22, 52, 99, 0) 62%), linear-gradient(180deg, var(--navy) 0, var(--navy-2) 100%);
  color: var(--ink);
  padding: 56px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
}
.login-art::before, .login-art::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(200, 150, 46, 0.28);
  pointer-events: none;
}
.login-art::before { right: -180px; top: -160px; width: 560px; height: 560px; }
.login-art::after { right: -40px; top: -20px; width: 340px; height: 340px; border-color: rgba(200, 150, 46, 0.16); }
.login-art > div { position: relative; z-index: 1; }
.login-art h1 { font-size: clamp(36px, 4vw, 48px); line-height: 1.08; letter-spacing: -0.8px; font-weight: 700; margin: 18px 0 0; }
.login-points { display: flex; flex-direction: column; gap: 9px; margin-top: 26px; font-size: 13.5px; }
.login-points div { display: flex; align-items: center; gap: 8px; }
.login-card { display: flex; align-items: center; justify-content: center; padding: 40px 32px; background: transparent; }
.login-form { width: 380px; max-width: 100%; }
.login-demo {
  margin-top: 22px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(20, 45, 32, 0.026);
}
.login-demo code { background: rgba(20, 45, 32, 0.065); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.menu-sep { height: 1px; background: var(--line); margin: 5px 4px; }

@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
}

.assistant-log { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow: auto; }
.assistant-bubble { max-width: 92%; border-radius: 14px; padding: 10px 12px; line-height: 1.45; }
.assistant-bubble.user { align-self: flex-end; background: rgba(224, 180, 85, 0.20); border: 1px solid rgba(224, 180, 85, 0.30); color: var(--ink); }
.assistant-bubble.assistant { align-self: flex-start; background: rgba(20, 45, 32, 0.052); border: 1px solid var(--line); color: var(--ink); }
.proposal-card { margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: rgba(20, 45, 32, 0.033); color: var(--ink); }
.assistant-prompts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.assistant-form { display: flex; gap: 8px; margin-top: 10px; }
.assistant-form .input { flex: 1; }

/* ---------------------------------------------------------- attachments */

.attach-list { display: flex; flex-direction: column; }
.attach-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid rgba(20, 45, 32, 0.046); }
.attach-row:last-child { border-bottom: 0; }
.attach-name { font-weight: 550; font-size: 13px; }
.attach-meta { font-size: 11.5px; color: var(--muted); }
.attach-icon {
  width: 30px; height: 30px; border-radius: 7px; background: rgba(20, 45, 32, 0.052);
  display: grid; place-items: center; color: var(--muted); flex: none;
}
.matched-badge {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 8px;
  padding: 2px 8px; border-radius: 999px; background: rgba(224, 180, 85, 0.16); color: #7A5710;
  font-size: 12px; font-weight: 600; vertical-align: middle;
}
.drop-zone {
  border: 1.5px dashed var(--line); border-radius: 16px; padding: 28px 18px;
  text-align: center; background: rgba(20, 45, 32, 0.026); margin-bottom: 14px;
}
.drop-zone.over { border-color: var(--gold-2); background: rgba(224, 180, 85, 0.12); }
.library-group { margin-bottom: 16px; }
.library-month { padding: 10px 16px 0; font-size: 13px; font-weight: 600; color: var(--navy); }
.table td .btn, .table td a.btn { margin-left: 6px; }
.table tr.selected td { background: rgba(224, 180, 85, 0.10); }
@media (max-width: 800px) {
  .card { overflow-x: auto; max-width: 100%; }
  .drop-zone { overflow: hidden; }
  .file-input { min-width: 0; }
  .table td.nowrap { white-space: normal; }
}

/* ------------------------------------------------------------ glass theme (v1.2.0) */
/* Navy ground with soft gold and blue light behind frosted panels — the moris.page look. */

body {
  background: #F6F7F2;
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 640px at 88% -10%, rgba(224, 180, 85, 0.42), rgba(224, 180, 85, 0) 62%),
    radial-gradient(860px 760px at 2% 34%, rgba(46, 139, 94, 0.30), rgba(46, 139, 94, 0) 62%),
    radial-gradient(760px 540px at 62% 110%, rgba(200, 150, 46, 0.20), rgba(200, 150, 46, 0) 62%),
    linear-gradient(160deg, #FCFCF8 0%, #F5F6F0 55%, #EDF1E9 100%);
}
body::after {
  content: "";
  position: fixed;
  right: -220px;
  top: -220px;
  width: 760px;
  height: 760px;
  border-radius: 50%;
  border: 2px solid rgba(200, 150, 46, 0.30);
  z-index: -1;
  pointer-events: none;
}

a { color: var(--blue); }
a:hover { color: #14543A; }

.card, .stat, .report-card, .login-form-panel {
  border-color: rgba(20, 45, 32, 0.078);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.card-head, .card-foot { border-color: rgba(20, 45, 32, 0.052); }

.table th { color: var(--muted); }
.table-wrap { border-radius: var(--radius); }

.select option, .select optgroup { background: var(--surface); color: var(--ink); }
.input::placeholder, .textarea::placeholder { color: #8A968E; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--gold-2); box-shadow: 0 0 0 3px rgba(224, 180, 85, 0.25); }

:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.btn:focus-visible, .nav-item:focus-visible { outline-offset: 1px; }

.btn-primary:hover { background: #1A6646; border-color: #1A6646; color: #fff; }
.btn-primary:disabled { opacity: 0.55; }

.drawer, .modal, .menu, .search-results {
  border: 1px solid rgba(20, 45, 32, 0.078);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(250, 251, 247, 0.96));
  backdrop-filter: blur(28px) saturate(150%);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
}
.modal, .menu, .search-results { border-radius: 16px; }
.overlay { background: rgba(20, 45, 32, 0.22); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }

.sidebar { border-right-color: rgba(20, 45, 32, 0.052); }
.sidebar-foot { border-top-color: rgba(20, 45, 32, 0.052); }
.nav-item { border-radius: 10px; }
.nav-item.active::before { background: var(--gold-2); }

/* Invoices, bills and statements stay on white paper. */
.doc {
  --ink: #0E1B2C;
  --ink-2: #33414F;
  --muted: #5A6878;
  --faint: #6F7D8C;
  --line: #E3E8EF;
  --line-strong: #D0D7E2;
  --blue: #0B5CAD;
  --red: #b42d21;
  --green-soft: rgba(200, 150, 46, 0.14);
  --gray-soft: #EEF1F5;
  --blue-soft: #EEF5FC;
  --red-soft: #fdecea;
  --amber-soft: rgba(200, 150, 46, 0.16);
  color-scheme: light;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(20, 45, 32, 0.135);
}
.doc .table td, .doc .doc-table td { border-bottom-color: #eef0f3; }
.doc .pill.green, .doc .doc-status { color: #8A6416; }
.doc a { color: #0B5CAD; }

/* Login: one glass panel on the same night sky. */
.login-art { background: transparent; }
.login-card .login-form {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.70), rgba(255, 255, 255, 0.46));
  border: 1px solid rgba(20, 45, 32, 0.085);
  border-radius: 24px;
  padding: 30px;
  box-shadow: inset 0 1px 0 rgba(20, 45, 32, 0.065), 0 24px 60px rgba(20, 45, 32, 0.135);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Printing goes back to plain paper. */
@media print {
  :root {
    --ink: #0E1B2C; --ink-2: #33414F; --muted: #5A6878; --faint: #6F7D8C;
    --line: #E3E8EF; --line-strong: #D0D7E2; --panel: #fff; --blue: #0B5CAD; --red: #b42d21;
    color-scheme: light;
  }
  body::before, body::after { display: none; }
  body { background: #fff; color: #0E1B2C; }
  .card, .stat { background: #fff; backdrop-filter: none; box-shadow: none; border-color: #E3E8EF; }
}

/* ------------------------------------------------------------ dashboard (v1.2.0) */
.dash { display: flex; flex-direction: column; gap: 18px; }
.dash-hello { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.dash-date { font-size: 13px; color: var(--muted); }
.dash-title { font-size: clamp(28px, 3.2vw, 36px); font-weight: 700; letter-spacing: -0.6px; line-height: 1.15; margin-top: 2px; }
.dash-company { font-size: 13px; font-weight: 600; color: #7A5710; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(224, 180, 85, 0.35); background: rgba(224, 180, 85, 0.10); }

.dash-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.kpi {
  display: flex; flex-direction: column; gap: 8px; text-align: left; cursor: pointer; font: inherit; color: var(--ink);
  min-height: 132px; padding: 18px 20px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid rgba(20, 45, 32, 0.078); box-shadow: var(--shadow-sm);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.kpi:hover { border-color: rgba(31, 122, 82, 0.40); background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.58)); }
.kpi-label { font-size: 13px; color: var(--ink-2); }
.kpi-value { font-size: clamp(24px, 2.4vw, 30px); font-weight: 700; letter-spacing: -0.6px; font-variant-numeric: tabular-nums; }
.kpi-foot { margin-top: auto; font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.kpi-up { color: var(--success); font-weight: 600; }
.kpi-down { color: #A3301F; font-weight: 600; }
.kpi-chip { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: rgba(20, 45, 32, 0.065); color: var(--ink-2); white-space: nowrap; }
.kpi-chip.warn { background: rgba(255, 120, 100, 0.16); color: #A3301F; }

.dash-lowstock { display: flex; align-items: center; gap: 12px; padding: 14px 18px; width: 100%; text-align: left; cursor: pointer; font: inherit; color: var(--ink-2); }

.dash-charts { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 14px; }
.dash-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.dash-panel { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.dash-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dash-panel-head h2 { font-size: 16.5px; font-weight: 600; }
.dash-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.dash-empty { font-size: 13.5px; color: var(--muted); padding: 10px 0; }

.dash-legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--ink-2); }
.dash-legend span, .dash-tip div { display: flex; align-items: center; gap: 6px; }
.dash-legend i, .dash-tip i, .dash-mixrow i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }

.dash-plot { position: relative; }
.dash-plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.dash-grid { stroke: rgba(20, 45, 32, 0.046); stroke-width: 1; }
.dash-baseline { stroke: rgba(20, 45, 32, 0.143); stroke-width: 1; }
.dash-axis { font-size: 11px; fill: #66756B; font-family: Poppins, system-ui, sans-serif; }
.dash-axis.strong { fill: #33443A; font-size: 12px; }
.dash-hoverband { fill: rgba(20, 45, 32, 0.033); }
.dash-crosshair { stroke: rgba(20, 45, 32, 0.182); stroke-width: 1; stroke-dasharray: 3 3; }
.dash-tip {
  position: absolute; top: 4px; transform: translateX(-50%); pointer-events: none; z-index: 5;
  min-width: 170px; padding: 10px 12px; border-radius: 12px; font-size: 12.5px; color: var(--ink-2);
  background: rgba(255, 255, 255, 0.97); border: 1px solid rgba(20, 45, 32, 0.104); box-shadow: 0 14px 34px rgba(20, 45, 32, 0.15);
  display: flex; flex-direction: column; gap: 4px;
}
.dash-tip b { margin-left: auto; padding-left: 12px; color: var(--ink); font-variant-numeric: tabular-nums; }
.dash-tip-title { font-weight: 600; color: var(--ink); }
.dash-tip-net { border-top: 1px solid rgba(20, 45, 32, 0.078); padding-top: 4px; margin-top: 2px; }
.dash-cash-now { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; margin-top: -4px; }

.dash-table summary { cursor: pointer; font-size: 12.5px; color: var(--muted); width: max-content; }
.dash-table summary:hover { color: var(--ink); }
.dash-table .table { margin-top: 10px; }

.dash-mixbar { display: flex; height: 14px; gap: 2px; border-radius: 999px; overflow: hidden; }
.dash-mixbar span { flex-basis: 0; min-width: 4px; }
.dash-mixlist { display: flex; flex-direction: column; gap: 2px; }
.dash-mixrow, .dash-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  border: 0; background: none; color: var(--ink); font: inherit; border-radius: 12px; padding: 8px 10px; margin: 0 -10px; width: calc(100% + 20px);
}
.dash-mixrow:hover, .dash-row:hover { background: var(--hover); }
.dash-mixlabel { flex: 1; font-size: 14px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.dash-count { font-size: 12px; color: var(--muted); }
.dash-rows { display: flex; flex-direction: column; gap: 2px; }
.dash-row { min-height: 56px; }
.dash-initial { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: rgba(20, 45, 32, 0.052); font-weight: 600; }
.dash-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dash-row-name { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-row-meta { font-size: 12px; color: var(--muted); }
.dash-row-end { display: flex; flex-direction: column; align-items: flex-end; }
.dash-row-amount { font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.dash-late { font-size: 12px; color: #A3301F; }
.dash-soon { font-size: 12px; color: var(--muted); }
.dash-action { margin-top: auto; height: 44px; justify-content: center; }

.dash-findings { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.dash-finding { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 16px; background: rgba(255, 255, 255, 0.55); border: 1px solid rgba(20, 45, 32, 0.052); }
.dash-finding-title { font-weight: 600; font-size: 14px; }

@media (max-width: 980px) {
  .dash-charts { grid-template-columns: 1fr; }
}

.table th.num, .table td.num { text-align: right; }
.table th { background: rgba(250, 251, 247, 0.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn-gold-outline { color: #7A5710; border-color: rgba(224, 180, 85, 0.50); background: rgba(200, 150, 46, 0.14); }
.btn-gold-outline:hover { color: #5E430C; border-color: var(--gold-2); background: rgba(200, 150, 46, 0.24); }
.topbar .btn-gold-outline { border-radius: 999px; height: 38px; padding: 0 16px; }

@media (max-width: 640px) {
  .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { min-height: 116px; padding: 14px; }
  .kpi-value { font-size: 20px; letter-spacing: -0.3px; }
  .kpi-foot { font-size: 11.5px; }
  .dash-chart-wide .dash-axis { font-size: 19px; }
  .dash-chart-wide .dash-axis.strong { font-size: 20px; }
  #cash-flow-chart .dash-axis { font-size: 13px; }
  .dash-chart-wide .dash-legend { width: 100%; }
}
.login-art::before, .login-art::after { display: none; }

/* ------------------------------------------------------------ gold and green, whiteish glass (v1.3.0) */
.card, .stat, .report-card, .kpi { border-color: rgba(255, 255, 255, 0.92); }
.card-head, .card-foot { border-color: rgba(20, 45, 32, 0.07); }
.sidebar { background: rgba(255, 255, 255, 0.42); border-right-color: rgba(255, 255, 255, 0.85); box-shadow: 1px 0 0 rgba(20, 45, 32, 0.05); }
.topbar { background: rgba(255, 255, 255, 0.55); border-bottom-color: rgba(255, 255, 255, 0.85); box-shadow: 0 1px 0 rgba(20, 45, 32, 0.05); }
.nav-item.active .nav-icon { color: #F3D28A; }
.nav-item.active::before { background: var(--gold); }
.nav-badge { color: var(--muted); }
.nav-item.active .nav-badge { color: #fff; }
.search-input { background: rgba(255, 255, 255, 0.7); border-color: rgba(20, 45, 32, 0.10); color: var(--ink); }
.search-input::placeholder, .search-icon { color: #6B7A70; }
.search-input:focus { background: #fff; border-color: var(--green); box-shadow: 0 0 0 3px rgba(31, 122, 82, 0.18); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(31, 122, 82, 0.18); }
:focus-visible { outline-color: var(--green); }
.btn { background: rgba(255, 255, 255, 0.72); }
.btn:hover { background: #fff; border-color: rgba(20, 45, 32, 0.22); }
.btn-primary, .btn-primary:hover { color: #fff; }
.btn-primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn-ghost { background: transparent; }
.btn-gold-outline { color: #6E500F; border-color: rgba(200, 150, 46, 0.60); background: rgba(224, 180, 85, 0.18); }
.pill.green { color: #1B6A47; }
.avatar.green { color: #1B6A47; }
.report-card .icon { color: #1B6A47; }
.table th { color: var(--muted); }
.select option, .select optgroup { background: #fff; color: var(--ink); }
.drawer, .modal, .menu, .search-results { border-color: rgba(255, 255, 255, 0.95); box-shadow: var(--shadow-lg); }
.toast { color: #fff; }
.login-art { color: var(--ink); }
.login-points div svg { color: var(--green); }
.doc { box-shadow: 0 0 0 1px rgba(20, 45, 32, 0.06), 0 24px 60px rgba(20, 45, 32, 0.12); }
.dash-company { color: #6E500F; border-color: rgba(200, 150, 46, 0.45); background: rgba(224, 180, 85, 0.16); }
.kpi-chip.warn { background: rgba(201, 80, 61, 0.12); color: #A3301F; }
.kpi-down { color: #A3301F; }
.dash-late { color: #A3301F; }
.dash-tip { box-shadow: 0 14px 34px rgba(20, 45, 32, 0.16); border-color: rgba(20, 45, 32, 0.10); }
.dash-baseline { stroke: rgba(20, 45, 32, 0.25); }
.dash-crosshair { stroke: rgba(20, 45, 32, 0.30); }
.dash-finding { background: rgba(255, 255, 255, 0.55); border-color: rgba(255, 255, 255, 0.9); }
.dash-initial { background: rgba(31, 122, 82, 0.10); color: #14543A; }
.btn.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.btn-primary:hover { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }
.btn.btn-danger { background: rgba(255, 255, 255, 0.72); }
.btn.btn-gold-outline { background: rgba(224, 180, 85, 0.18); }
.btn.btn-ghost { background: transparent; }

/* ------------------------------------------------------------ tax advice (v1.3.0) */
.tax { display: flex; flex-direction: column; gap: 18px; }
.tax .page-head { margin-bottom: 0; }
.tax-note { margin: 0; }
.kpi.static { cursor: default; }
.kpi.static:hover { border-color: rgba(255, 255, 255, 0.92); background: var(--panel); }
.kpi-chip.gold { background: rgba(224, 180, 85, 0.22); color: #6E500F; }
.kpi-chip.green { background: rgba(31, 122, 82, 0.12); color: #1B6A47; text-transform: capitalize; }
.tax-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.tax-side { display: flex; flex-direction: column; gap: 16px; }
.tax-h2 { font-size: 16.5px; font-weight: 600; }
.tax-advice-list { display: flex; flex-direction: column; gap: 10px; }
.tax-advice { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 14px 22px; border-radius: 16px; background: rgba(255, 255, 255, 0.72); border: 1px solid rgba(20, 45, 32, 0.07); overflow: hidden; }
.tax-advice::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: rgba(20, 45, 32, 0.2); }
.tax-advice.fix::before { background: #C9503D; }
.tax-advice.claim::before { background: #1F7A52; }
.tax-advice.rule::before { background: #C8962E; }
.tax-advice-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tax-advice h3 { flex: 1; min-width: 200px; font-size: 15px; font-weight: 600; margin: 0; }
.tax-advice p { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }
.tax-advice .btn { align-self: flex-start; }
.tax-level { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: rgba(20, 45, 32, 0.07); color: var(--ink-2); }
.tax-level.fix { background: rgba(201, 80, 61, 0.12); color: #A3301F; }
.tax-level.claim { background: rgba(31, 122, 82, 0.12); color: #1B6A47; }
.tax-level.rule { background: rgba(224, 180, 85, 0.22); color: #6E500F; }
.tax-amount { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.tax-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tax-compare > div { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.72); border: 1px solid rgba(20, 45, 32, 0.07); }
.tax-compare > div.better { background: rgba(31, 122, 82, 0.10); border-color: rgba(31, 122, 82, 0.32); }
.tax-compare span { font-size: 12.5px; color: var(--muted); }
.tax-compare b { font-size: 22px; font-variant-numeric: tabular-nums; }
.tax-compare .better b, .tax-compare .better span { color: #14543A; }
.tax-compare small { font-size: 12px; color: var(--muted); line-height: 1.45; }
.tax-p { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }
.tax-calendar { display: flex; flex-direction: column; }
.tax-cal-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid rgba(20, 45, 32, 0.06); }
.tax-cal-row:last-child { border-bottom: 0; }
.tax-cal-row > span:last-child { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.tax-cal-row small { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.tax-cal-date { flex: none; width: 66px; text-align: center; padding: 6px 0; border-radius: 12px; background: rgba(31, 122, 82, 0.12); color: #14543A; font-size: 12px; font-weight: 700; line-height: 1.3; white-space: pre-line; }
.tax-cal-date.none { background: rgba(20, 45, 32, 0.06); color: var(--ink-2); }
.tax-ask { display: flex; flex-direction: column; gap: 10px; }
.tax-ask .btn { align-self: flex-start; }
.tax-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tax-chip { min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(20, 45, 32, 0.10); background: rgba(255, 255, 255, 0.75); color: var(--ink-2); font: inherit; font-size: 12.5px; cursor: pointer; }
.tax-chip:hover { background: #fff; border-color: rgba(31, 122, 82, 0.4); }
.tax-answer { padding: 14px 16px; border-radius: 14px; background: rgba(31, 122, 82, 0.07); border: 1px solid rgba(31, 122, 82, 0.2); }
.tax-answer p { margin: 0 0 6px; font-size: 14px; line-height: 1.6; }
.tax-answer small { color: var(--muted); }
.tax-sources { font-size: 12px; color: var(--muted); margin: 0; }
@media (max-width: 1000px) { .tax-grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ import (v1.3.0) */
.importer { display: flex; flex-direction: column; gap: 16px; }
.importer .page-head { margin-bottom: 0; }
.import-target { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.import-company { font-size: 20px; font-weight: 700; }
.import-target-note { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); max-width: 520px; }
.import-drop { display: flex; flex-direction: column; gap: 6px; align-items: center; padding: 28px 18px; border: 2px dashed rgba(31, 122, 82, 0.35); border-radius: 18px; cursor: pointer; margin: 0; }
.import-drop:hover { background: rgba(31, 122, 82, 0.06); }
.import-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.import-foot .small { max-width: 640px; }
.import-flip { align-self: end; min-height: 40px; }
.import-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.import-summary > div { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.72); border: 1px solid rgba(20, 45, 32, 0.07); }
.import-summary span { font-size: 12px; color: var(--muted); }
.import-summary b { font-size: 15px; font-variant-numeric: tabular-nums; }
.import-summary b.warn { color: #A3301F; }
.table td.neg { color: #A3301F; }
.table td.pos { color: #1B6A47; }

/* ------------------------------------------------------------ invoice design (v1.3.0) */
.doc-brand-wrap { display: flex; align-items: flex-start; gap: 14px; }
.doc-logo { max-width: 140px; max-height: 64px; object-fit: contain; display: block; }
.doc-footer { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); text-align: center; font-size: 12.5px; color: var(--muted); }
.doc.designed .doc-title h2 { color: var(--doc-accent); }
.doc.designed .doc-total-row.balance { background: color-mix(in srgb, var(--doc-accent) 12%, white); color: var(--doc-accent); }
.doc.designed .doc-table th { border-bottom-color: var(--doc-accent); }
.doc.designed .doc-total-row.grand { border-top-color: var(--doc-accent); }
.doc.layout-modern { border-top: 8px solid var(--doc-accent); }
.doc.layout-modern .doc-title h2 { text-transform: none; letter-spacing: -0.02em; font-size: 30px; }
.doc.layout-bold .doc-head { background: var(--doc-accent); color: #fff; margin: -34px -38px 24px; padding: 28px 38px; border-radius: var(--radius) var(--radius) 0 0; }
.doc.layout-bold .doc-head .doc-brand-meta, .doc.layout-bold .doc-head .doc-no { color: rgba(255, 255, 255, 0.85); }
.doc.layout-bold .doc-title h2 { color: #fff; }
.doc.layout-bold .doc-logo { background: #fff; border-radius: 10px; padding: 6px; }
@media print {
  .doc.layout-bold .doc-head { margin: 0 0 24px; border-radius: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .doc.designed { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.design-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 18px; align-items: start; }
.design-preview { transform-origin: top left; }
.design-preview .doc { padding: 26px 28px; font-size: 13px; }
.design-preview .doc.layout-bold .doc-head { margin: -26px -28px 20px; padding: 22px 28px; }
.design-logo-row { display: flex; align-items: center; gap: 12px; }
.design-logo-row img { max-width: 120px; max-height: 48px; object-fit: contain; border-radius: 8px; background: #fff; padding: 4px; border: 1px solid var(--line); }
.design-swatches { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.design-swatch { width: 32px; height: 32px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(20, 45, 32, 0.2); cursor: pointer; padding: 0; }
.design-swatch.on { box-shadow: 0 0 0 2px var(--ink); }
@media (max-width: 1000px) { .design-grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- receipts */
.receipts { max-width: 980px; }
.receipt-capture { display: grid; grid-template-columns: 1.3fr 1fr; gap: 12px; padding: 16px; align-items: stretch; }
.receipt-capture input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.receipt-snap, .receipt-upload { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; border-radius: 14px; font-weight: 600; cursor: pointer; min-height: 64px; }
.receipt-snap { background: linear-gradient(180deg, #1F7A52, #14543A); color: #fff; font-size: 17px; box-shadow: 0 8px 22px rgba(20, 84, 58, .25); }
.receipt-snap.busy { opacity: .75; cursor: progress; }
.receipt-upload { border: 1.5px dashed rgba(20, 84, 58, .35); color: #14543A; background: rgba(255, 255, 255, .6); }
.receipt-tip { grid-column: 1 / -1; font-size: 13px; color: var(--muted, #5b6b62); }
.receipt-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.receipt-stats > div { background: var(--panel, rgba(255,255,255,.8)); border: 1px solid rgba(20,45,32,.08); border-radius: 14px; padding: 12px 14px; display: grid; gap: 2px; }
.receipt-stats span { font-size: 12px; color: var(--muted, #5b6b62); text-transform: uppercase; letter-spacing: .04em; }
.receipt-stats b { font-size: 22px; color: var(--ink, #13241B); font-variant-numeric: tabular-nums; }
.receipt-stats small { font-size: 12px; color: var(--muted, #5b6b62); }
.receipt-stats .warn b { color: #B07D14; }
.receipt-tabs { margin-bottom: 12px; }
.receipt-list { display: grid; gap: 10px; }
.receipt-card { display: grid; grid-template-columns: 84px 1fr; gap: 14px; padding: 12px; }
.receipt-card.review { border-left: 3px solid #B07D14; }
.receipt-card.matched { border-left: 3px solid #1F7A52; }
.receipt-thumb { width: 84px; height: 84px; border-radius: 10px; overflow: hidden; background: #f1f3ef; display: flex; align-items: center; justify-content: center; }
.receipt-thumb img { width: 100%; height: 100%; object-fit: cover; }
.receipt-pdf { font-weight: 700; color: #14543A; font-size: 13px; }
.receipt-body { min-width: 0; display: grid; gap: 4px; }
.receipt-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.receipt-vendor { font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.receipt-total { font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.receipt-meta { font-size: 13px; color: var(--muted, #5b6b62); }
.receipt-missing { color: #B07D14; }
.receipt-summary { font-size: 13px; color: var(--muted, #5b6b62); }
.receipt-actions { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.receipt-edit { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 8px; }
.receipt-edit .field { display: grid; gap: 4px; font-size: 12px; }
.receipt-edit .btn { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .receipt-capture { grid-template-columns: 1fr; }
  .receipt-stats { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .receipt-stats b { font-size: 17px; }
  .receipt-stats small { display: none; }
  .receipt-card { grid-template-columns: 64px 1fr; }
  .receipt-thumb { width: 64px; height: 64px; }
  .receipt-edit { grid-template-columns: 1fr; }
}
.receipt-note { margin: 12px 0 0; padding: 10px 14px; border-radius: 12px; background: #FBF4E4; border: 1px solid rgba(176, 125, 20, .25); color: #6B4E0E; font-size: 13.5px; }
.receipt-note code { font-size: 12.5px; background: rgba(255,255,255,.7); padding: 1px 5px; border-radius: 5px; }
.receipt-actions .receipt-delete { margin-left: auto; color: #A33A2C; }
.receipt-paid { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #14543A; }
.receipt-paid b { font-weight: 600; }
.receipt-suggest { font-size: 13px; padding: 8px 10px; border-radius: 10px; background: #FBF4E4; border: 1px solid rgba(176,125,20,.22); color: #4F3A0B; }
.receipt-card.review:has(.receipt-suggest) { border-left-color: #C8962E; }
.pill.gold { background: #FBF4E4; color: #8A6410; }
.ai-result { padding: 9px 12px; border-radius: 10px; font-size: 13.5px; }
.ai-result.ok { background: #E9F4EE; color: #14543A; border: 1px solid rgba(31,122,82,.25); }
.ai-result.bad { background: #FBEDEA; color: #8A2E22; border: 1px solid rgba(163,48,31,.25); }
.link-btn { background: none; border: 0; padding: 0; color: #1F7A52; font: inherit; font-size: 12.5px; text-decoration: underline; cursor: pointer; }
.link-btn:disabled { color: #8a948e; cursor: default; }
.biz-head { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: #5b6b62; margin: 18px 0 8px; font-weight: 600; }
.biz-details .biz-head:first-child { margin-top: 4px; }
.director-row { display: grid; grid-template-columns: 1.4fr 1fr .6fr 1.3fr 1fr auto; gap: 8px; margin-bottom: 8px; align-items: center; }
@media (max-width: 760px) { .director-row { grid-template-columns: 1fr 1fr; } }
/* ---------------------------------------------------------------- backup */
.backup { max-width: 980px; }
.format-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.format-tile { text-align: left; display: grid; gap: 4px; padding: 14px; border-radius: 14px; border: 1.5px solid rgba(20,45,32,.12); background: rgba(255,255,255,.7); cursor: pointer; font: inherit; color: var(--ink, #13241B); }
.format-tile b { font-size: 15px; }
.format-tile span { font-size: 12.5px; color: #5b6b62; line-height: 1.35; }
.format-tile.on { border-color: #1F7A52; background: #E9F4EE; box-shadow: 0 0 0 3px rgba(31,122,82,.12); }
.parts-head { display: flex; justify-content: space-between; align-items: baseline; margin: 18px 0 8px; font-weight: 600; font-size: 14px; }
.parts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.part { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px; border: 1px solid rgba(20,45,32,.1); background: rgba(255,255,255,.6); font-size: 13.5px; cursor: pointer; }
.part.on { border-color: rgba(31,122,82,.4); background: #F2F8F4; }
.part.off { opacity: .55; cursor: default; }
.part span { flex: 1; }
.part small { color: #8a948e; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .format-grid { grid-template-columns: 1fr 1fr; } .parts-grid { grid-template-columns: 1fr; } }
.receipt-upload input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.storage-warning { margin: 0 0 16px; padding: 12px 16px; border-radius: 14px; background: #FBEDEA; border: 1px solid rgba(163,48,31,.3); color: #6E241A; font-size: 14px; line-height: 1.5; }
.storage-warning code { background: rgba(255,255,255,.7); padding: 1px 5px; border-radius: 5px; font-size: 13px; }
.topbar-company { display: flex; align-items: center; gap: 8px; }
.company-logo { width: 26px; height: 26px; border-radius: 7px; object-fit: contain; background: #fff; box-shadow: 0 0 0 1px rgba(20,45,32,.1); }
.biz-cell { display: inline-flex; align-items: center; gap: 10px; }
.biz-logo { width: 30px; height: 30px; border-radius: 8px; object-fit: contain; background: #fff; box-shadow: 0 0 0 1px rgba(20,45,32,.1); }
.biz-initial { display: inline-grid; place-items: center; background: #E9F4EE; color: #14543A; font-weight: 700; font-size: 14px; }
.logo-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logo-preview { width: 64px; height: 64px; border-radius: 14px; background: #fff; box-shadow: 0 0 0 1px rgba(20,45,32,.12); display: grid; place-items: center; overflow: hidden; font-size: 11px; color: #8a948e; }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
button.receipt-card { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; border: 1px solid rgba(20,45,32,.08); transition: transform .15s ease, box-shadow .15s ease; }
button.receipt-card:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(20,45,32,.10); }
button.receipt-card.suggested { border-left: 3px solid #C8962E; }
.receipt-card .receipt-top, .receipt-card .receipt-meta, .receipt-card .receipt-summary, .receipt-card .receipt-body { display: flex; }
.receipt-card .receipt-body { flex-direction: column; gap: 4px; }
.receipt-card .receipt-meta { flex-wrap: wrap; gap: 0 4px; align-items: center; }
.receipt-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.receipt-view { position: sticky; top: 0; display: grid; gap: 6px; }
.receipt-image { border: 0; padding: 0; background: #f1f3ef; border-radius: 12px; overflow: hidden; cursor: zoom-in; max-height: 74vh; display: block; width: 100%; }
.receipt-image img { width: 100%; height: auto; max-height: 74vh; object-fit: contain; display: block; }
.receipt-view.zoom .receipt-image { cursor: zoom-out; overflow: auto; }
.receipt-view.zoom .receipt-image img { width: 200%; max-height: none; max-width: none; }
.receipt-pdf-frame { width: 100%; height: 74vh; border: 0; border-radius: 12px; background: #f1f3ef; }
.receipt-form { display: grid; gap: 12px; }
.receipt-form .field { display: grid; gap: 4px; font-size: 12.5px; color: #5b6b62; }
.receipt-form .span-2 { grid-column: 1 / -1; }
.plain-fieldset { border: 0; padding: 0; margin: 0; }
.post-choice { border-top: 1px solid rgba(20,45,32,.08); padding-top: 12px; display: grid; gap: 6px; }
.post-head { font-weight: 600; font-size: 14px; }
.line-pick { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; border: 1px solid rgba(20,45,32,.1); background: rgba(255,255,255,.6); cursor: pointer; font-size: 13.5px; }
.line-pick.on { border-color: rgba(31,122,82,.5); background: #F2F8F4; }
.line-main { flex: 1; display: grid; }
.line-main small { color: #6b7a71; font-size: 12px; }
.line-amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.panel-actions { display: flex; gap: 8px; width: 100%; flex-wrap: wrap; }
.panel-actions .receipt-delete { margin-left: auto; color: #A33A2C; }
@media (max-width: 820px) { .receipt-panel { grid-template-columns: 1fr; } .receipt-view { position: static; } .receipt-image, .receipt-image img { max-height: 50vh; } }
.receipt-capture.over { box-shadow: 0 0 0 3px rgba(31,122,82,.35); background: #F2F8F4; }
/* ---------------------------------------------------------------- statements hub */
.stmts { max-width: 1060px; }
.stmt-drop { display: grid; gap: 8px; padding: 16px; }
.stmt-drop.over { box-shadow: 0 0 0 3px rgba(31,122,82,.35); background: #F2F8F4; }
.stmt-drop-btn { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px; border-radius: 14px; font-weight: 600; font-size: 16px; color: #fff; background: linear-gradient(180deg, #1F7A52, #14543A); cursor: pointer; box-shadow: 0 8px 22px rgba(20,84,58,.22); }
.stmt-drop-btn.busy { opacity: .75; cursor: progress; }
.stmt-drop-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.stmt-section { margin: 20px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #5b6b62; font-weight: 600; }
.stmt-list { display: grid; gap: 8px; }
.stmt-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; border: 1px solid rgba(20,45,32,.08); }
.stmt-row:hover { box-shadow: 0 10px 26px rgba(20,45,32,.10); }
.stmt-kind { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 4px 8px; border-radius: 8px; background: #E9F4EE; color: #14543A; }
.stmt-kind.card { background: #FBF4E4; color: #8A6410; }
.stmt-main { flex: 1; display: grid; }
.stmt-main small { color: #6b7a71; }
.stmt-totals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.stmt-totals > div { padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.7); border: 1px solid rgba(20,45,32,.08); display: grid; }
.stmt-totals span { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: #6b7a71; }
.stmt-totals b { font-size: 17px; font-variant-numeric: tabular-nums; }
.stmt-totals .ok b { color: #1F7A52; }
.stmt-totals .warn b { color: #A33A2C; }
.stmt-lines td { vertical-align: middle; }
.stmt-lines .neg { color: #A33A2C; }
.stmt-cat { min-width: 220px; }
.stmt-prop { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.stmt-done { margin-top: 14px; }
.stmt-done summary { cursor: pointer; font-weight: 600; color: #14543A; margin-bottom: 8px; }
.nowrap { white-space: nowrap; }
@media (max-width: 760px) { .stmt-totals { grid-template-columns: 1fr 1fr; } .stmt-lines th:nth-child(1), .stmt-lines td:nth-child(1) { display: none; } .stmt-cat { min-width: 140px; } }
.toast-wrap { pointer-events: none; top: 18px; bottom: auto; } .toast { pointer-events: auto; }
.stmt-split { display: grid; gap: 18px; }
.stmt-split.with-file { grid-template-columns: minmax(380px, 0.9fr) 1.4fr; align-items: start; }
.stmt-file { position: sticky; top: 0; }
.stmt-file iframe { width: 100%; height: calc(100vh - 190px); border: 0; border-radius: 12px; background: #f1f3ef; }
.stmt-work { min-width: 0; }
.stmt-account { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.stmt-account label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #5b6b62; }
.stmt-account .select { min-width: 280px; }
.stmt-cat { min-width: 240px; }
@media (max-width: 1100px) { .stmt-split.with-file { grid-template-columns: 1fr; } .stmt-file { position: static; } .stmt-file iframe { height: 60vh; } }
