/* =========================================================================
   Fully Accountant — design system
   Replicates the Manager.io look: soft grey shell, white cards, blue links.
   ========================================================================= */

:root {
  --bg:            #e9eaec;
  --panel:         #f4f5f6;
  --card:          #ffffff;
  --card-muted:    #fafbfc;
  --border:        #e2e4e8;
  --border-strong: #d5d8dd;
  --text:          #2f3337;
  --text-muted:    #8a9099;
  --text-faint:    #b4b9c0;
  --link:          #3b82c4;
  --link-hover:    #2f6aa3;
  --primary:       #3b82c4;
  --primary-hover: #3675b0;
  --badge-bg:      #eceef1;
  --badge-text:    #9aa0a8;
  --shadow-sm:     0 1px 2px rgba(20, 30, 45, 0.06);
  --shadow-md:     0 2px 10px rgba(20, 30, 45, 0.08);
  --radius:        10px;
  --radius-sm:     7px;
}

:root[data-theme="dark"] {
  --bg:            #1c1f24;
  --panel:         #23272e;
  --card:          #262b32;
  --card-muted:    #22262c;
  --border:        #333941;
  --border-strong: #3b424b;
  --text:          #dfe3e8;
  --text-muted:    #8b929b;
  --text-faint:    #666d76;
  --link:          #5aa0e0;
  --link-hover:    #7bb4e8;
  --primary:       #3b82c4;
  --primary-hover: #4a90d0;
  --badge-bg:      #30363e;
  --badge-text:    #8b929b;
  --shadow-sm:     0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md:     0 2px 10px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

svg.icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

/* Obscure mode — conceal all financial figures */
.fin { transition: filter 0.12s; }
:root.obscure .fin,
:root.obscure .line-total,
:root.obscure #grandTotal {
  filter: blur(6px);
  user-select: none;
  cursor: default;
}
.obscure-toggle { color: var(--text-faint); }
:root.obscure .obscure-toggle { color: var(--primary); background: rgba(59, 130, 196, 0.12); }

/* Full-width banner at the top of the page while obscure mode is on */
.obscure-banner {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}
:root.obscure .obscure-banner { display: flex; }
.obscure-banner .icon { color: var(--text-muted); flex: 0 0 auto; }
.obscure-banner__spacer { flex: 1; }
.obscure-banner__close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.obscure-banner__close:hover { color: var(--text); }

/* ---------------------------------------------------------------- Top bar */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  background: var(--bg);
}

.topbar__left,
.topbar__right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}
.topbar__right { justify-content: flex-end; }

.topbar__nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.iconbtn:hover { background: rgba(0, 0, 0, 0.05); color: var(--text); }
:root[data-theme="dark"] .iconbtn:hover { background: rgba(255, 255, 255, 0.06); }

/* Nav pills */
.navpill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 18px;
  border-radius: 9px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
}
.navpill:hover { color: var(--text); }
.navpill--active {
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.navpill .icon { width: 19px; height: 19px; }

/* ---------------------------------------------------- Business sub-header */
.bizhead {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 6px 22px 0;
  padding: 22px 26px;
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.bizhead__close {
  color: var(--text-faint);
  font-size: 26px;
  line-height: 1;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 2px;
}
.bizhead__close:hover { color: var(--text-muted); }
.bizhead__name { font-size: 26px; font-weight: 700; }
.bizhead__rename { color: var(--link); font-size: 20px; font-weight: 500; }
.bizhead__spacer { flex: 1; }
.bizhead__actions { display: flex; gap: 12px; }

/* Login / account cards */
.login-card {
  max-width: 500px;
  margin: 30px auto;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 30px 34px;
}
.login-card h1 { margin: 0; font-size: 26px; font-weight: 800; }
.login-card hr { border: none; border-top: 1px solid var(--border); margin: 16px 0 24px; }
.login-card label { display: block; font-weight: 700; margin: 0 0 8px; }
.login-card input[type="text"],
.login-card input[type="password"] {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 15px;
}
.login-card input:focus { outline: none; border-color: var(--primary); }
.login-card .btn { margin-top: 20px; }
.login-error {
  background: #fdf3d0; color: #8a6d13;
  padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; font-weight: 600;
}
:root[data-theme="dark"] .login-error { background: #3a3216; color: #e8d089; }
.account-section { margin-top: 26px; }
.account-section h3 { font-size: 15px; color: var(--text-muted); margin: 0 0 14px; }
.account-device { display: flex; align-items: center; gap: 16px; }
.account-device strong { flex: 1; }

/* Top-level pages (Businesses / Users) — centered, no sidebar */
.toplevel { padding: 40px 22px; }
.toplevel__content { max-width: 760px; margin: 0 auto; }
.toplevel__content .panel { background: transparent; box-shadow: none; }
.biz-list__row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 8px;
  border-bottom: 1px solid var(--border);
}
.biz-list__row:last-child { border-bottom: none; }
.biz-list__avatar {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-faint); font-weight: 700; text-transform: uppercase;
}
.biz-list__name { flex: 1; font-size: 18px; font-weight: 600; }
.biz-list__size { color: var(--text-faint); background: none; border: none; cursor: pointer; font-size: 14px; }
.biz-list__size:hover { color: var(--link); text-decoration: underline; }
.biz-list__radio { width: 16px; height: 16px; accent-color: var(--primary); }
.app-version { text-align: center; color: var(--text-faint); margin-top: 30px; font-size: 13px; }
.user-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 8px;
  border-bottom: 1px solid var(--border);
}
.user-row:last-child { border-bottom: none; }
.user-row__avatar { color: var(--text-faint); display: inline-flex; }
.user-row__avatar .icon { width: 26px; height: 26px; }
.user-row__name { font-weight: 700; color: var(--link); }
.user-row__username { color: var(--text-faint); font-size: 14px; }
.user-row__spacer { flex: 1; }
.user-row__role { color: var(--text-muted); font-weight: 600; }
.user-row__tools a { color: var(--link); font-size: 13px; margin-left: 12px; }
.toplevel__head {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 6px; padding: 8px;
}
.toplevel__title { font-size: 24px; font-weight: 700; color: var(--text-muted); }

/* ------------------------------------------------------- Layout: shell */
.shell {
  display: flex;
  gap: 0;
  padding: 22px;
  align-items: flex-start;
}

/* -------------------------------------------------------------- Sidebar */
.sidebar {
  width: 300px;
  flex: 0 0 300px;
  background: transparent;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-right: 22px;
}
.sidebar__customize {
  display: block;
  text-align: center;
  padding: 18px 10px;
  color: var(--link, #3b82c4);
  font-weight: 600;
  text-decoration: none;
}
.sidebar__customize:hover { text-decoration: underline; }
/* Branch switcher in the business header (searchable combo). */
.bizhead__branchwrap { margin-left: 14px; display: inline-block; width: 240px; }
.bizhead__branchwrap .combo-box { font-size: 13.5px; padding: 6px 8px 6px 11px; }

/* Sidebar search filter. */
.sidebar__search { padding: 12px 14px 8px; }
.sidebar__search input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 13.5px;
}
.sidebar__search input:focus { outline: none; border-color: var(--primary); }

/* Custom module section headers in the sidebar (metadata-driven Apps). */
.sidebar__module {
  padding: 12px 18px 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 6px;
}
/* Flash notices */
.flash {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin: 0 0 16px;
  border: 1px solid transparent;
  font-size: 14px;
}
.flash--ok { background: #e8f5ec; color: #276b41; border-color: #bfe3cc; }
.flash--err { background: #fdecea; color: #a94442; border-color: #f5c6cb; }
:root[data-theme="dark"] .flash--ok { background: #1d3326; color: #8fd3a8; border-color: #2c4d38; }
:root[data-theme="dark"] .flash--err { background: #3a2224; color: #e3a1a1; border-color: #57282c; }

/* Recalculate bar above drill/list tables */
.drill-toolbar {
  display: flex; justify-content: flex-end; align-items: center; gap: 10px;
  padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--bg, #f7f8fa);
}
.drill-toolbar__ico { color: var(--text-faint, #9aa2ac); font-size: 17px; }

/* Addon label pills (invoice/quote/order links on forms) */
.pilink__addon {
  display: inline-flex; align-items: center; padding: 0 12px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  color: var(--text); font-size: 14px; white-space: nowrap;
}

/* Record navigation arrows (view pages) */
.rec-nav { display: flex; align-items: center; gap: 4px; }
.rec-nav__btn { padding: 6px 12px; font-size: 13px; }
.rec-nav__btn--off { opacity: .4; pointer-events: none; }
.rec-nav__pos { color: var(--text-faint); font-size: 13.5px; padding: 0 8px; }

/* Solid status badges (Manager invoice statuses) */
.badge--paid { background: #23c552; color: #fff; }
.badge--duetoday { background: #f5a623; color: #fff; }
.badge--overdue { background: #f03d3d; color: #fff; }
:root[data-theme="dark"] .badge--paid { background: #1ea346; color: #fff; }
:root[data-theme="dark"] .badge--duetoday { background: #d18d15; color: #fff; }
:root[data-theme="dark"] .badge--overdue { background: #cc3333; color: #fff; }

/* Recurring transactions pending banner (Manager-style yellow notice) */
.recur-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  margin: 0 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid #f0dfa0;
  background: #fdf7e2;
  color: #6d5a14;
  font-size: 14px;
}
.recur-banner svg { width: 18px; height: 18px; display: block; }
:root[data-theme="dark"] .recur-banner { background: #35300f; color: #e8d089; border-color: #57511f; }

/* Attachment chips on document views */
.attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 4px 8px 4px 12px;
  margin-left: 10px;
  font-size: 13.5px;
}
.attach-chip a { color: var(--link); text-decoration: none; }
.attach-chip a:hover { text-decoration: underline; }
.attach-chip__x {
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 15px;
  padding: 0 2px;
}
.attach-chip__x:hover { color: #c0504d; }

/* Business header action buttons — icon + label pills, like Manager */
.bizbtn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.bizbtn svg {
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  flex: 0 0 auto;
}
.bizbtn:hover svg { color: var(--link); }

/* Inline business rename (bizhead) */
.bizhead__rename-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
}
.bizhead__rename-form.hidden { display: none; }
.bizhead__rename-form input[type="text"] {
  min-width: 240px;
  font-size: 15px;
  font-weight: 600;
}

/* Business logo (Settings → Business Details) */
.bizhead__logo {
  height: 28px;
  width: auto;
  border-radius: 5px;
  margin-right: 10px;
  vertical-align: middle;
}
.paper__logo {
  display: block;
  max-height: 54px;
  max-width: 180px;
  margin-bottom: 8px;
}
/* Locked while customizing: inert, greyed sidebar until Update/Reset. */
.sidebar--locked .sidebar__item {
  opacity: .5;
  cursor: default;
  pointer-events: none;
  user-select: none;
}
.sidebar__customize--current {
  display: block;
  text-align: center;
  padding: 18px 10px;
  color: var(--text-muted);
  font-weight: 600;
  cursor: default;
}

/* ---- Customize (Tabs) screen — white sheet + grey pill cards, like Manager ---- */
.cust-guid { color: var(--text-faint); font-size: 13px; }
.cust-body {
  background: var(--card);
  padding: 26px 30px 34px;
}
.cust-row { margin-bottom: 18px; }
.cust-row--l1 { margin-left: 54px; }
.cust-row--l2 { margin-left: 108px; }
@media (max-width: 640px) {
  .cust-row--l1 { margin-left: 24px; }
  .cust-row--l2 { margin-left: 48px; }
}
.cust-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.cust-pill:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.cust-pill input[type="checkbox"] {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  accent-color: #2563eb;
}
.cust-pill__label { font-weight: 600; font-size: 15px; color: var(--text); }
.cust-pop {
  background: var(--badge-bg);
  color: #6b7280;
  border-radius: 6px;
  font-size: 12.5px;
  padding: 4px 10px;
  margin-left: 6px;
  white-space: nowrap;
}
:root[data-theme="dark"] .cust-pop { color: var(--text-muted); }
.sidebar__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 20px;
  background: var(--panel);
  color: var(--link);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.sidebar__item:first-child { border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }
.sidebar__item:last-child { border-bottom: none; border-bottom-left-radius: var(--radius); border-bottom-right-radius: var(--radius); }
.sidebar__item:hover { background: var(--card); }
.sidebar__item .icon { color: var(--text-muted); width: 21px; height: 21px; }
.sidebar__item--active { background: var(--card); }
.sidebar__item--active .sidebar__label { color: var(--text); }
.sidebar__label { flex: 1; }
.sidebar__count {
  min-width: 30px;
  height: 26px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--badge-bg);
  color: var(--badge-text);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}

/* ------------------------------------------------------------- Content */
.content { flex: 1; min-width: 0; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: var(--text-muted);
  margin-bottom: 18px;
}
.breadcrumb .icon { color: var(--text-faint); }
.breadcrumb__sep { color: var(--text-faint); }
.breadcrumb a { color: var(--link); }
.breadcrumb__current { color: var(--text-muted); }
.breadcrumb__spacer { flex: 1; }

.panel {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.panel__toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.panel__title { font-size: 22px; font-weight: 700; color: var(--text-muted); }
.panel__spacer { flex: 1; }

.help-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--badge-bg);
  color: var(--text-faint);
  font-size: 13px;
  font-weight: 700;
  cursor: help;
}

.disclosure {
  color: var(--link);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.disclosure::before { content: "\25B8"; margin-right: 6px; color: var(--link); }

/* Search */
.search {
  display: flex;
  align-items: center;
  gap: 10px;
}
.search input {
  width: 240px;
  padding: 9px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
}
.search input::placeholder { color: var(--text-faint); }
.search input:focus { outline: none; border-color: var(--primary); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.3;
}
.btn:hover { background: var(--card-muted); border-color: var(--text-faint); }
.btn--primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn--primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn--lg { padding: 11px 22px; font-size: 15px; }
.btn--danger { background: #c0504d; border-color: #c0504d; color: #fff; }
.btn--danger:hover { background: #a83f3c; border-color: #a83f3c; color: #fff; }
.btn--success { background: #4a9d5b; border-color: #4a9d5b; color: #fff; }
.btn--success:hover { background: #418a50; border-color: #418a50; color: #fff; }

/* Empty table state */
.tablewrap { min-height: 260px; position: relative; }
.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  color: var(--text-faint);
  font-size: 20px;
}

/* Data table */
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.data thead th {
  text-align: left;
  padding: 13px 16px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--panel);
}
/* Manager-style vertical column dividers */
table.data thead th,
table.data tbody td { border-right: 1px solid var(--border); }
table.data thead th:last-child,
table.data tbody td:last-child { border-right: none; }
table.data thead th.num, table.data td.num { text-align: right; }
table.data tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
table.data tbody tr:hover td { background: var(--card); }
table.data tbody td a { font-weight: 600; }
.rowtools a { color: var(--link); margin-right: 12px; font-size: 13px; }

/* Edit / View leading columns */
table.data th.colicon,
table.data td.colicon {
  width: 1%;
  white-space: nowrap;
  text-align: center;
  vertical-align: middle;
}
table.data th.colicon .icon { color: var(--text-faint); width: 19px; height: 19px; }
.btn--sm { padding: 6px 16px; font-size: 13px; }

/* Totals row */
table.data tr.totals td { border-bottom: none; background: var(--panel); font-weight: 600; }
table.data tr.totals:hover td { background: var(--panel); }

.page-indicator {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-faint);
  font-size: 13px;
  font-weight: 600;
}

.panel__footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ---------------------------------------------------------------- Form */
.formcard { max-width: 880px; }
.formcard__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 26px;
  border-bottom: 1px solid var(--border);
}
.formcard__head h1 { font-size: 22px; font-weight: 700; color: var(--text-muted); margin: 0; }
.formcard__body { padding: 26px; }

.form-row {
  display: flex;
  gap: 26px;
  margin-bottom: 22px;
}
.form-field { display: flex; flex-direction: column; }
.form-field label { font-weight: 700; margin-bottom: 8px; font-size: 15px; }
.form-field--name { flex: 1; }
.form-field--code { width: 220px; }
.form-field input[type="text"],
.form-field input[type="number"] {
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 15px;
}
.form-field input:focus { outline: none; border-color: var(--primary); }

.form-field select.select {
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 15px;
}
.form-field input[type="date"] {
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 15px;
}
.form-field select.select:focus,
.form-field input[type="date"]:focus { outline: none; border-color: var(--primary); }

/* Receipt line-items table */
table.lines-table th { border-bottom: 1px solid var(--border); }
table.lines-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
table.lines-table input[type="text"],
table.lines-table input[type="number"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
}
table.lines-table input:focus { outline: none; border-color: var(--primary); }
table.lines-table input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }
.line-del {
  border: none;
  background: transparent;
  color: var(--text-faint);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.line-del:hover { color: #c0504d; }

/* Stacked label + field */
.stack { display: flex; flex-direction: column; }
.stack > label { font-weight: 700; margin-bottom: 8px; font-size: 15px; }
/* Input groups shrink-wrap to their content instead of stretching across the
   whole card (Manager keeps them compact). */
.stack > .input-group { align-self: flex-start; }
.field-row { display: flex; gap: 12px; align-items: stretch; }
.grow { flex: 1; }
.stack input[type="text"],
.stack input[type="date"],
.stack input[type="number"],
.field-row input[type="text"] {
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 15px;
}
.stack input:focus, .field-row input:focus { outline: none; border-color: var(--primary); }
.stack input:disabled { background: var(--card-muted); color: var(--text-faint); }
.stack textarea {
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
}
.stack textarea:focus { outline: none; border-color: var(--primary); }

/* Input group with grey addon (Contact / Account) */
.input-group {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--card);
}
.input-group__addon {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  background: var(--panel);
  color: var(--text-muted);
  font-size: 14px;
  border-right: 1px solid var(--border-strong);
  white-space: nowrap;
}
.input-group__addon--check { padding: 0 12px; background: var(--card); }
.input-group__addon--right { border-right: none; border-left: 1px solid var(--border-strong); }
.input-group__addon--check input { width: 16px; height: 16px; accent-color: var(--primary); }
.input-group > input,
.input-group > select {
  border: none;
  padding: 10px 13px;
  background: var(--card);
  color: var(--text);
  font-size: 15px;
  min-width: 140px;
}
.input-group > input:focus, .input-group > select:focus { outline: none; }
.input-group:focus-within { border-color: var(--primary); }
/* Manager-style searchable combo inside an input-group (e.g. Received in →
   Account picker): the group stops clipping so the menu can drop, and the
   combo draws its own focus frame overlapping the group border. */
.input-group:has(.combo-box) { overflow: visible; }
.input-group > .combo-box {
  border-color: transparent;
  margin: -1px;
  width: auto;
  min-width: 120px;
  max-width: 320px;
}
.input-group > .combo-box:focus,
.input-group > .combo-box.open {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 196, .22);
}

/* Custom select arrow (matches Manager's small triangle) */
.ig-select, select.ig-select {
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: right 14px center, right 9px center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px !important;
  cursor: pointer;
}

/* Add line */
.addline {
  border: none;
  background: transparent;
  color: var(--link);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  padding: 12px 0 4px;
}
.addline::before { content: "\25B8"; margin-right: 8px; }

/* Line-item icon button */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text-muted);
  cursor: pointer;
}
.icon-btn:hover { background: var(--card-muted); color: #c0504d; }
.icon-btn .icon { width: 17px; height: 17px; }
.line-actions { text-align: center; }
table.lines-table .grand-row td { border: none; text-align: right; padding-top: 12px; font-size: 15px; }

/* Optional column / feature checkboxes */
.options { margin: 26px 0 10px; }
.optline {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  font-weight: 700;
  cursor: pointer;
}
.optline input { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }
.options .subfield { margin: 4px 0 8px 29px; }

/* Image fieldset */
.imagebox {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px 22px;
  margin-top: 18px;
}
.imagebox legend { color: var(--text-muted); font-size: 15px; padding: 0 6px; }
.imagebox input[type="file"] { font-size: 14px; }

/* Advanced Queries dropdown */
.aqdrop { position: relative; }
.aqdrop__toggle { margin: 0; }
.aqdrop__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 6px 0;
  display: none;
  z-index: 35;
}
.aqdrop.open .aqdrop__menu { display: block; }
.aqdrop__item {
  display: block;
  padding: 9px 16px;
  color: var(--link);
  font-weight: 600;
  white-space: nowrap;
}
.aqdrop__item:hover { background: var(--panel); }
.aqdrop__item--active { color: var(--text); background: var(--panel); }
.aqdrop__sep { height: 1px; background: var(--border); margin: 6px 0; }

/* Batch Operations dropdown (opens upward from the footer) */
.batchdrop { position: relative; display: inline-block; }
.batchdrop__menu {
  position: absolute;
  min-width: 180px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 6px 0;
  display: none;
  z-index: 35;
}
.batchdrop--up .batchdrop__menu { bottom: calc(100% + 8px); left: 0; }
.batchdrop.open .batchdrop__menu { display: block; }
.batchdrop__item {
  display: block;
  padding: 9px 18px;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}
.batchdrop__item:hover { background: var(--panel); }
.batchdrop__sep { height: 1px; background: var(--border); margin: 6px 0; }

/* Batch selection bar */
.batch-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--card-muted);
}
.batch-selall { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.batch-selall input { width: 16px; height: 16px; accent-color: var(--primary); }
.batch-col { width: 1%; text-align: center; white-space: nowrap; }
.batch-col input { width: 16px; height: 16px; accent-color: var(--primary); }

/* Advanced Query builder rows */
.aq-rows { display: flex; flex-direction: column; gap: 8px; }
.aq-row { display: flex; align-items: center; gap: 8px; }
.aq-row .aq-drag { border: none; background: transparent; color: var(--text-faint); cursor: grab; padding: 4px; }
.aq-row .aq-drag:hover { color: var(--text-muted); }
.aq-row.dragging { opacity: 0.5; }
.aq-field, .aq-op, .aq-dir {
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  min-width: 150px;
}
.aq-op, .aq-dir { min-width: 140px; }
.aq-value {
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  min-width: 150px;
}
.aq-field:focus, .aq-op:focus, .aq-dir:focus, .aq-value:focus { outline: none; border-color: var(--primary); }
.aq-x {
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--text-faint);
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.aq-x:hover { color: #c0504d; border-color: var(--text-faint); }

/* ---------------------------------------------------- Document view */
.docbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
}
.docbar__title { font-size: 22px; font-weight: 700; color: var(--text-muted); margin-right: 8px; }
.docbar__group {
  display: flex;
  gap: 8px;
  padding-left: 14px;
  margin-left: 6px;
  border-left: 1px solid var(--border);
}

.doc-canvas {
  padding: 32px 22px;
  background: var(--bg);
}
.paper {
  background: #ffffff;
  color: #1c1c1c;
  max-width: 720px;
  padding: 42px 46px;
  border-radius: 4px;
  box-shadow: var(--shadow-md);
}
.paper__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}
.paper__title { font-size: 30px; font-weight: 800; margin: 0; letter-spacing: -0.5px; }
.paper__meta { display: flex; align-items: stretch; gap: 22px; }
.paper__meta-right { text-align: right; }
.paper__meta-label { font-weight: 700; }
.paper__meta-sep { border-left: 1px solid #cfcfcf; }
.paper__meta-biz { display: flex; align-items: flex-start; font-weight: 700; }
.paper__desc { font-weight: 700; margin: 30px 0 16px; }

.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
}
.doc-table th,
.doc-table tbody td {
  border: 1px solid #232323;
  padding: 12px 14px;
  font-size: 15px;
}
.doc-table th { text-align: left; font-weight: 700; }
.doc-table th.num,
.doc-table td.num { text-align: right; }
.doc-table tfoot td { padding: 12px 14px; font-weight: 700; }
.doc-table .doc-total-label { text-align: right; border: none; font-weight: 700; }
.doc-table .doc-total { border: 1px solid #232323; font-weight: 700; }

/* Report tables: header underline + totals row bracketed by rules, no cell boxes. */
.rpt-table { width: 100%; border-collapse: collapse; margin-top: 4px; }
.rpt-table th,
.rpt-table td { padding: 11px 16px; font-size: 15px; border: none; }
.rpt-table th { text-align: left; font-weight: 700; border-bottom: 1.5px solid #111; }
.rpt-table th.num,
.rpt-table td.num { text-align: right; }
.rpt-table tbody tr:first-child td { padding-top: 18px; }
.rpt-table tr.rpt-total td {
  font-weight: 700;
  border-top: 1.5px solid #111;
  border-bottom: 1.5px solid #111;
}

.doc-attach {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border-top: 1px solid var(--border);
}
.doc-attach__clip { color: var(--text-faint); display: inline-flex; }
.doc-attach__clip .icon { width: 22px; height: 22px; }

/* Print: show only the paper */
@media print {
  body * { visibility: hidden; }
  #printArea, #printArea * { visibility: visible; }
  #printArea {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    max-width: none;
    box-shadow: none;
    padding: 0;
  }
}

/* Status badges */
.badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}
.badge--ok   { background: #dff3e4; color: #2f7d47; }
.badge--warn { background: #fdf3d0; color: #8a6d13; }
:root[data-theme="dark"] .badge--ok   { background: #1f3a29; color: #7fce9a; }
:root[data-theme="dark"] .badge--warn { background: #3a3216; color: #e8d089; }

/* Active query bar */
.query-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--card-muted);
}
.query-bar__label { color: var(--text-muted); }

/* Yellow uncategorized notice */
.notice {
  display: block;
  padding: 15px 20px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.notice--warn {
  background: #fdf3d0;
  color: #8a6d13;
  border: 1px solid #f0e0a8;
}
.notice--warn:hover { background: #fbecbf; color: #8a6d13; }
:root[data-theme="dark"] .notice--warn {
  background: #3a3216; color: #e8d089; border-color: #4d431f;
}

/* Line textarea (payment description column) */
table.lines-table td[data-lc="desc"] { min-width: 230px; }
table.lines-table td[data-lc="desc"] textarea { min-height: 64px; }
/* When the Description column is shown, every control in the row grows to match it (Manager) */
table.lines-table:has(td[data-lc="desc"]:not(.hidden)) .line-row td { vertical-align: top; }
table.lines-table:has(td[data-lc="desc"]:not(.hidden)) .line-row input[type="text"],
table.lines-table:has(td[data-lc="desc"]:not(.hidden)) .line-row input[type="number"] { min-height: 64px; }
table.lines-table:has(td[data-lc="desc"]:not(.hidden)) .line-row .combo-box {
  min-height: 64px;
  align-items: flex-start;
  padding-top: 12px;
}
table.lines-table:has(td[data-lc="desc"]:not(.hidden)) .line-row .combo-box .combo-arrow,
table.lines-table:has(td[data-lc="desc"]:not(.hidden)) .line-row .combo-box .combo-clear { margin-top: 2px; }
table.lines-table textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}
table.lines-table textarea:focus { outline: none; border-color: var(--primary); }

/* Discount cell with % suffix */
.disc-wrap { position: relative; display: block; }
.disc-suffix {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
  display: none;
}
table.lines-table.disc-pct .disc-wrap input { padding-right: 26px; }
table.lines-table.disc-pct .disc-suffix { display: inline; }

/* Drag handle + row actions */
.line-drag-cell { text-align: center; }
.line-drag {
  border: none;
  background: transparent;
  color: var(--text-faint);
  cursor: grab;
  padding: 4px;
}
.line-drag:hover { color: var(--text-muted); }
.line-drag .icon { width: 18px; height: 18px; }
.line-row.dragging { opacity: 0.5; background: var(--card); }
.line-actions { white-space: nowrap; text-align: center; }
.line-x {
  border: none;
  background: transparent;
  color: var(--text-faint);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  margin-left: 4px;
  vertical-align: middle;
}
.line-x:hover { color: #c0504d; }
.icon-btn .icon { width: 16px; height: 16px; }

/* Searchable combobox (account picker) */
.combo-box {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-width: 140px;
  padding: 7px 8px 7px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}
.combo-box.open { border-color: var(--primary); }
.combo-value {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.combo-value.placeholder { color: var(--text-faint); }
.combo-clear {
  border: none;
  background: transparent;
  color: var(--text-faint);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.combo-clear:hover { color: var(--text-muted); }
.combo-arrow {
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--text-muted);
  margin-left: 2px;
  flex: 0 0 auto;
}
.combo-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  z-index: 30;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  display: none;
}
.combo-box.open .combo-menu { display: block; }
.combo-search {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 9px 12px;
  font-size: 14px;
  background: transparent;
  color: var(--text);
}
.combo-search:focus { outline: none; }
.combo-list { max-height: 240px; overflow: auto; padding: 4px 0; }
.combo-option {
  padding: 8px 13px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.combo-option:hover { background: var(--panel); }
.combo-option.sel { color: var(--link); font-weight: 600; }
.combo-empty { padding: 10px 13px; color: var(--text-faint); font-size: 13px; }

/* Sub-option (indented checkbox) */
.optline--sub { margin-left: 29px; }
.options .subfield select {
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
}

/* Inputs inside reveal sub-fields (Footers, Custom title, Fixed total, IBAN, …) */
.subfield input[type="text"],
.subfield input[type="number"],
.subfield textarea {
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}
.subfield input[type="text"]:focus,
.subfield input[type="number"]:focus,
.subfield textarea:focus { outline: none; border-color: var(--primary); }

/* Right-align numeric inputs (amount fields) */
input.num { text-align: right; }

.checkline { margin-bottom: 16px; }
.checkline label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  cursor: pointer;
}
.checkline input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }
.checkline .subfield { margin: 12px 0 4px 29px; }
.checkline .subfield input { display: block; }

.formcard__footer {
  display: flex;
  gap: 14px;
  padding: 20px 26px;
  border-top: 1px solid var(--border);
}

.hidden { display: none !important; }

/* ------------------------------------------------------- Column popover */
.popover-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40;
}
.popover-backdrop.open { display: flex; }
.popover {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  width: 340px;
  max-height: 80vh;
  overflow: auto;
}
.popover__head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 16px;
}
.popover__body { padding: 10px 20px; }
.popover__row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 0;
  cursor: pointer;
}
.popover__row input { width: 16px; height: 16px; accent-color: var(--primary); }
.popover__foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

@media (max-width: 1000px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; flex-basis: auto; margin-right: 0; margin-bottom: 22px; }
}

/* Custom fields */
.cf-block {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  padding-bottom: 14px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.cf-field { display: flex; flex-direction: column; gap: 5px; min-width: 220px; }
.cf-field label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.formcard__footer { flex-wrap: wrap; }
.doc-cf {
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
}
.doc-cf__row { display: flex; gap: 14px; padding: 3px 0; font-size: 14px; }
.doc-cf__label { font-weight: 700; min-width: 160px; }

/* ---- Compact density pass (match Manager's tighter scale) ---- */
body { font-size: 14px; }
.btn { padding: 7px 14px; font-size: 13.5px; }
.btn--lg { padding: 9px 18px; font-size: 14px; }
.btn--sm { padding: 5px 13px; font-size: 12.5px; }
.panel__toolbar { padding: 14px 18px; }
.panel__footer { padding: 12px 18px; }
.panel__title { font-size: 19px; }
table.data { font-size: 13.5px; }
table.data thead th { padding: 10px 12px; }
table.data tbody td { padding: 9px 12px; }
.sidebar__item { padding: 11px 18px; gap: 12px; }
.formcard__body { padding: 20px; }
.docbar { padding: 12px 18px; }
.docbar__title { font-size: 19px; }
.breadcrumb { padding: 11px 18px; }
.stack input[type="text"],
.stack input[type="date"],
.stack input[type="number"],
.field-row input[type="text"] { padding: 8px 11px; font-size: 14px; }
.stack select, .field-row select { font-size: 14px; }
.combo-box { padding: 6px 8px 6px 11px; font-size: 13.5px; }
table.lines-table input[type="text"],
table.lines-table input[type="number"] { padding: 7px 9px; }
table.lines-table textarea { padding: 7px 9px; }
.bizhead { padding: 14px 20px; gap: 12px; }
.bizhead__name { font-size: 21px; }
.bizhead__rename { font-size: 15px; }
.bizhead__close { font-size: 22px; }
.navpill { padding: 7px 14px; font-size: 14px; }
.topbar { padding: 10px 18px; }
.shell { padding: 14px 16px; }
.sidebar { width: 270px; flex: 0 0 270px; margin-right: 16px; }
.sidebar__item { padding: 8px 16px; gap: 10px; font-size: 13.5px; }
.sidebar__item .icon { width: 18px; height: 18px; }
.sidebar__count { min-width: 26px; height: 22px; padding: 0 7px; font-size: 12px; }
.breadcrumb { margin-bottom: 12px; }
.bizhead { margin: 4px 16px 0; }
body { line-height: 1.4; }

/* Status stamps on document views (RECONCILED / INVOICED / ...) */
.recon-stamp {
  display: inline-block;
  padding: 10px 24px;
  border: 3px solid;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 1px;
}
.recon-stamp--bad { color: #b02a2a; border-color: #b02a2a; }
.recon-stamp--ok { color: #1f7a3d; border-color: #1f7a3d; }
.recon-stamp--warn { color: #b07a1a; border-color: #b07a1a; }
/* Plain selects in form stacks match the text inputs */
.stack > select, .field-row > select,
.stack > div > select:not(.combo), .subfield select {
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
}
.stack > select:focus, .field-row > select:focus, .subfield select:focus {
  outline: none; border-color: var(--primary);
}
/* Comboboxes match the height of inputs and selects */
.combo-box { min-height: 36px; }

/* Combobox keyboard support: focus ring on the tabbable box + arrow-key highlight. */
.combo-box:focus-visible,
.combo-box:focus {
  outline: none;
  border-color: var(--accent, #4a90d9);
  box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.18);
}
.combo-option.active { background: var(--panel); }
.combo-option.active.sel { background: var(--panel); }

/* Form cards: let combo dropdowns escape the card instead of being clipped,
   and keep the rounded corners on the head/footer themselves. */
.panel.formcard { overflow: visible; }
.formcard__head { border-radius: var(--radius) var(--radius) 0 0; }
.formcard__footer { border-radius: 0 0 var(--radius) var(--radius); }

/* Line tables squeeze their columns instead of growing scrollbars. */
table.lines-table input[type="text"],
table.lines-table input[type="number"],
table.lines-table textarea { min-width: 0; }
table.lines-table td[data-lc="desc"] { min-width: 170px; }

/* Inactive records are dimmed on their tab lists (Manager behavior). */
tr.row-inactive td,
tr.row-inactive td a,
tr.row-inactive td .fin { color: var(--text-faint); }
tr.row-inactive .badge { opacity: 0.45; }

/* Report comparative-column rows: match the standard input chrome. */
.cfs-colrow input[type="date"],
.cfs-colrow input[type="text"] {
  padding: 7px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  min-height: 36px;
}
.cfs-colrow input:focus { outline: none; border-color: var(--primary); }

/* ---- Sticky notes (floating pad) ---------------------------------------- */
#noteFab {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  width: 46px; height: 46px; border-radius: 50%;
  border: none; cursor: pointer; font-size: 20px; line-height: 1;
  background: #fdd835; color: #5b4a00;
  box-shadow: 0 3px 10px rgba(0,0,0,.28);
}
#noteFab:hover { background: #ffe45c; }
#notePad {
  position: fixed; right: 22px; bottom: 78px; z-index: 60;
  width: 300px; max-height: 62vh; display: flex; flex-direction: column;
  background: #fdf7c3; border-radius: 6px;
  box-shadow: 0 6px 22px rgba(0,0,0,.3);
}
#notePad.hidden { display: none; }
.notepad__bar {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  background: #fbea8a; border-radius: 6px 6px 0 0;
}
.notepad__title { flex: 1; font-size: 13px; color: #6b5b00; font-weight: 600; }
.notepad__bar button {
  border: none; background: none; cursor: pointer; color: #6b5b00;
  font-size: 18px; line-height: 1; padding: 0 4px;
}
.notepad__body { padding: 10px; overflow-y: auto; }
#noteNew {
  width: 100%; border: none; background: transparent; resize: vertical;
  font: inherit; font-size: 14px; color: #3c3200; outline: none;
}
#noteNew::placeholder { color: #a99b52; }
.note-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 4px; border-top: 1px solid #efe08a; font-size: 13.5px; color: #3c3200;
}
.note-item__text { flex: 1; white-space: pre-wrap; word-break: break-word; cursor: text; }
.note-item.done .note-item__text { text-decoration: line-through; opacity: .55; }
.note-item input[type=checkbox] { margin-top: 2px; accent-color: #8a7500; }
.note-item__del { border: none; background: none; color: #b0392b; cursor: pointer; font-size: 15px; }
:root[data-theme="dark"] #notePad { background: #4a4526; }
:root[data-theme="dark"] .notepad__bar { background: #5c552c; }
:root[data-theme="dark"] .note-item,
:root[data-theme="dark"] #noteNew { color: #f2ecc4; }
:root[data-theme="dark"] .note-item { border-top-color: #6b6234; }
