/* Magic Sands Finance - the one shared stylesheet (Stage 25).
   Clean, boxed, "government finance system" look: system fonts, one navy
   accent, 1px grey borders, full table grids, 3-4px corners, no gradients
   or large shadows. Presentation only - every page keeps its fields,
   buttons, links and columns (tests/test_stage25_interface.py).

   Sections: 1 tokens  2 base  3 shell (top bar, sidebar, page head)
   4 boxes and headings  5 buttons, badges, messages  6 forms  7 tables
   8 KPI tiles  9 filter bar  10 drawers and pop-ups  11 page parts
   12 small screens  13 print */

/* ------------------------------------------------------------ 1 tokens */
:root {
  color-scheme: light;
  --navy: #1f3a5f;
  --navy-2: #2b4c77;
  --navy-soft: #e8eef6;
  --ink: #1f2933;
  --mut: #5f6b7a;
  --line: #c9ced6;
  --line-2: #dde1e6;
  --head: #e9edf2;
  --zebra: #fafbfc;
  --page: #f4f5f7;
  --ok: #2e7d32;
  --ok-bg: #edf5ee;
  --amber: #b26a00;
  --amber-bg: #fdf5e6;
  --red: #c62828;
  --red-bg: #fbeeee;
  --grey: #5f6b7a;
  /* names the page templates already use - mapped onto the new palette */
  --cyan: var(--navy);
  --cyan-dark: var(--navy);
  --tint: var(--navy-soft);
  --soft: var(--head);
  --gold: var(--amber);
  --grad: var(--navy);
  --sh: none;
  --side1: #fff; --side2: #fff; --stx: var(--ink);
  --radius: 3px;
  --font: "Segoe UI", Arial, "Helvetica Neue", Helvetica, sans-serif;
}

/* -------------------------------------------------------------- 2 base */
* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0; font-family: var(--font); font-size: 13px; line-height: 1.45;
  background: var(--page); color: var(--ink);
  -webkit-font-smoothing: auto;
}
a { color: var(--navy); }
a:hover { color: var(--navy-2); }
b, strong { font-weight: 600; }
p { margin: 0 0 8px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
code, .code { font-family: Consolas, "Courier New", monospace; font-size: 12px; }

/* --------------------------------------------------------------- 3 shell */
.topbar {
  position: sticky; top: 0; z-index: 40; height: 48px;
  display: flex; align-items: center; gap: 14px; padding: 0 16px;
  background: var(--navy); color: #fff; border-bottom: 1px solid #142a47;
}
.topbar .menu-btn {
  display: none; width: 34px; height: 30px; padding: 0; margin: 0;
  border: 1px solid rgba(255,255,255,.45); border-radius: var(--radius);
  background: transparent; color: #fff; font-size: 16px; cursor: pointer;
}
.topbar .brand { display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 14px; white-space: nowrap; }
.topbar .brand img { height: 26px; width: auto; }
.topbar .brand .sep { opacity: .5; font-weight: 400; }
.topbar .book { font-size: 12.5px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; min-width: 0; }
.topbar .book b { font-weight: 600; letter-spacing: .02em; }
.topbar .book .bk-sub { opacity: .8; }
.topbar .sp { flex: 1; }
.bookswitch { display: flex; border: 1px solid rgba(255,255,255,.55);
  border-radius: var(--radius); overflow: hidden; flex: none; }
.bookswitch a { display: block; padding: 4px 12px; font-size: 12px;
  font-weight: 600; color: #fff; text-decoration: none; }
.bookswitch a + a { border-left: 1px solid rgba(255,255,255,.55); }
.bookswitch a:hover { background: rgba(255,255,255,.12); color: #fff; }
.bookswitch a.on { background: #fff; color: var(--navy); }
.topbar .today { font-size: 12px; opacity: .85; white-space: nowrap; }
.topbar .user { position: relative; }
.topbar .user summary {
  list-style: none; cursor: pointer; user-select: none; white-space: nowrap;
  font-size: 12.5px; padding: 4px 8px; border: 1px solid transparent;
  border-radius: var(--radius);
}
.topbar .user summary::-webkit-details-marker { display: none; }
.topbar .user summary:hover, .topbar .user[open] summary {
  border-color: rgba(255,255,255,.45); }
.topbar .user .menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px;
  background: #fff; color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 2px 6px rgba(0,0,0,.12);
  padding: 10px 12px; font-size: 12.5px; z-index: 60;
}
.topbar .user .menu .row { display: flex; justify-content: space-between;
  gap: 12px; padding: 3px 0; }
.topbar .user .menu .row span:first-child { color: var(--mut); }
.topbar .logout { color: #fff; font-size: 12.5px; text-decoration: none;
  padding: 4px 10px; border: 1px solid rgba(255,255,255,.55);
  border-radius: var(--radius); white-space: nowrap; }
.topbar .logout:hover { background: #fff; color: var(--navy); }

.shell { display: flex; align-items: stretch; min-height: calc(100vh - 48px); }
.side {
  width: 240px; flex: none; background: #fff; border-right: 1px solid var(--line);
  padding: 8px 0 30px; position: sticky; top: 48px;
  height: calc(100vh - 48px); overflow-y: auto; font-size: 13px;
}
.side a {
  display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 16px;
  color: var(--ink); text-decoration: none; border-left: 3px solid transparent;
  line-height: 1.3;
}
.side a:hover { background: #f1f3f6; color: var(--ink); }
.side a.on { background: var(--navy-soft); border-left-color: var(--navy);
  color: var(--navy); font-weight: 600; }
.side .dot { display: none; }
.side > a.top { font-weight: 600; }
.side details { border-top: 1px solid var(--line-2); }
.side details:last-child { border-bottom: 1px solid var(--line-2); }
.side > a.top + details, .side > a.top { border-top: 1px solid var(--line-2); }
.side summary {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 16px;
  font-size: 12px; font-weight: 700; color: var(--mut); cursor: pointer;
  list-style: none; user-select: none; text-transform: uppercase;
  letter-spacing: .04em;
}
.side summary::-webkit-details-marker { display: none; }
.side summary:hover { color: var(--ink); background: #f7f8fa; }
.side summary .car { margin-left: auto; font-size: 9px; color: var(--mut);
  transition: transform .12s; }
.side details[open] summary .car { transform: rotate(90deg); }
.side details[open] summary { color: var(--navy); }
.side .sub { padding: 0 0 6px; }
.side .sub a { padding-left: 26px; }
.side .sub a.grp { cursor: default; color: var(--mut); font-weight: 600; }
.side .sub a.grp:hover { background: none; }
.side .sub a.l2 { padding-left: 40px; font-size: 12.5px; }
.side .shdr { font-size: 11px; font-weight: 700; color: var(--mut);
  text-transform: uppercase; letter-spacing: .05em; padding: 10px 14px 3px 26px; }

.main { flex: 1; min-width: 0; padding: 14px 20px 40px; }
.crumb { font-size: 12px; color: var(--mut); margin: 0 0 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb .s { padding: 0 6px; color: #9aa4b1; }
.crumb .cur { color: var(--ink); }

/* -------------------------------------------------- 4 boxes and headings */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: none;
}
details.card > summary { cursor: pointer; }
.h2 {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px;
  font-size: 14px; font-weight: 700; color: var(--ink); margin: 0 0 10px;
  letter-spacing: 0;
}
.h2 .dot { display: none; }
.h2 > span[style*="margin-left:auto"] { font-size: 12px !important;
  font-weight: 400 !important; color: var(--mut) !important; }
/* the page title: the first heading of the page */
.page > .h2:first-child {
  font-size: 18px; font-weight: 600; margin: 0 0 12px; padding: 0 0 8px;
  border-bottom: 1px solid var(--line);
}
.card > .h2:first-child, .card .h2 {
  margin: -14px -16px 12px; padding: 8px 16px; background: var(--head);
  border-bottom: 1px solid var(--line); font-size: 13.5px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.empty {
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 22px 18px; text-align: center; color: var(--mut);
  font-size: 13px; line-height: 1.6; background: #fff;
}

/* ---------------------------------------- 5 buttons, badges, messages */
.btn, button.btn {
  display: inline-block; width: auto; min-width: 120px; height: 32px;
  margin-top: 12px; padding: 0 16px; border: 1px solid var(--navy);
  border-radius: var(--radius); background: var(--navy); color: #fff;
  font: 600 13px/30px var(--font); text-align: center; cursor: pointer;
  text-decoration: none; box-shadow: none; letter-spacing: 0;
  white-space: nowrap; transition: background .1s;
}
.btn:hover { background: var(--navy-2); color: #fff; transform: none;
  filter: none; box-shadow: none; }
.btn:disabled, .btn2:disabled { opacity: .55; cursor: not-allowed; }
.btn2 {
  display: inline-block; padding: 0 12px; height: 30px; line-height: 28px;
  border: 1px solid var(--navy); border-radius: var(--radius);
  background: #fff; color: var(--navy); font: 600 12.5px/28px var(--font);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  vertical-align: middle; box-shadow: none; transition: background .1s;
}
.btn2:hover { background: var(--navy-soft); color: var(--navy);
  border-color: var(--navy); box-shadow: none; }
.btn2.warn, .btn2.danger { border-color: var(--red); color: var(--red); }
.btn2.warn:hover, .btn2.danger:hover { background: var(--red-bg);
  border-color: var(--red); color: var(--red); box-shadow: none; }
a.btn2 { text-decoration: none; }

.err, .msg, .note-box {
  border-radius: var(--radius); padding: 8px 12px; font-size: 13px;
  margin: 0 0 12px; border: 1px solid; border-left-width: 4px;
}
.err { background: var(--red-bg); color: var(--red); border-color: #e3b5b5;
  border-left-color: var(--red); }
.msg { background: var(--ok-bg); color: var(--ok); border-color: #b8d5ba;
  border-left-color: var(--ok); }

.tag, .badge {
  display: inline-block; padding: 1px 7px; border: 1px solid currentColor;
  border-radius: var(--radius); font-size: 11.5px; font-weight: 600;
  letter-spacing: 0; text-transform: none; line-height: 1.5;
  white-space: nowrap; background: #fff;
}
.tag.on { color: var(--ok); background: var(--ok-bg); }
.tag.off { color: var(--grey); background: #f3f4f6; }
.tag.adm { color: var(--navy); background: var(--navy-soft); }

/* the page templates still carry old sizes inline (46px buttons, 40-46px
   fields): one height for every control */
.btn { height: 32px !important; line-height: 30px !important; }
.btn2 { height: 30px !important; line-height: 28px !important; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=month], input[type=search], input[type=tel],
select { height: 32px !important; }

/* --------------------------------------------------------------- 6 forms */
label {
  display: block; font-size: 12.5px; font-weight: 600; letter-spacing: 0;
  color: var(--ink); text-transform: none; margin: 10px 0 4px;
}
label .req, .req { color: var(--red); }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=month], input[type=search], input[type=tel],
input[type=file], select, textarea {
  display: block; width: 100%; height: 32px; padding: 0 8px; font: 13px var(--font);
  color: var(--ink); background: #fff; border: 1px solid #b7bec8;
  border-radius: var(--radius); outline: none; box-shadow: none;
  -webkit-appearance: none; appearance: none;
}
input[type=file] { padding: 4px 6px; height: auto; }
input[type=date], input[type=month] { -webkit-appearance: auto; appearance: auto; }
textarea { height: auto; min-height: 64px; padding: 6px 8px; }
input:focus, select:focus, textarea:focus {
  border-color: var(--navy); background: #fff;
  box-shadow: 0 0 0 2px rgba(31,58,95,.18);
}
input[readonly], input:disabled, select:disabled, textarea:disabled {
  background: #f3f4f6; color: var(--mut); }
select {
  cursor: pointer; padding-right: 26px;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235f6b7a' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
input[type=checkbox], input[type=radio] { width: auto; height: auto;
  accent-color: var(--navy); vertical-align: middle; }
form p, .help, .hint { font-size: 12px; color: var(--mut); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 12px 12px; margin: 10px 0; }
legend { font-size: 12.5px; font-weight: 700; padding: 0 4px; }
/* two-column label | field grid, for forms that opt in */
.fgrid { display: grid; grid-template-columns: 200px 1fr; gap: 6px 14px;
  align-items: center; }
.fgrid > label { margin: 0; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
/* a wide form of label / field pairs: two columns, label | field (the page
   script adds .fg2); anything else in the form spans both columns */
form.fg2 { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
  column-gap: 14px; row-gap: 6px; align-items: center; }
form.fg2 > * { grid-column: 1 / -1; }
form.fg2 > label { grid-column: 1; margin: 0; }
form.fg2 > label + input, form.fg2 > label + select, form.fg2 > label + textarea,
form.fg2 > label + .cdd { grid-column: 2; }
form.fg2 > label + textarea { align-self: start; }
form.fg2 > p, form.fg2 > .help { grid-column: 2; margin: -2px 0 4px; }
form.fg2 > .btn, form.fg2 > button, form.fg2 > .btn2 { grid-column: 1 / -1;
  justify-self: end; margin-top: 8px; }
form.fg2 > input[type=hidden] { display: none; }
.actions .btn { margin-top: 0; }

/* -------------------------------------------------------------- 7 tables */
.tbox { overflow: auto; max-width: 100%; border: 1px solid var(--line);
  border-radius: var(--radius); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px;
  background: #fff; font-variant-numeric: tabular-nums; }
th, td {
  border: 1px solid var(--line); padding: 6px 8px; text-align: left;
  vertical-align: middle; height: 32px;
}
th {
  background: var(--head); color: var(--ink); font-size: 12px; font-weight: 700;
  text-transform: none; letter-spacing: 0; white-space: nowrap;
  position: sticky; top: 0; z-index: 2;
}
.tbox th { top: 0; }
td { white-space: nowrap; overflow-wrap: normal; word-break: normal; }
tbody tr:nth-child(even) td, table tr:nth-child(even) > td { background: var(--zebra); }
tr:hover > td { background: #f0f4f9; }
td .sub, td .code-line { display: block; font-size: 11.5px; color: var(--mut);
  white-space: nowrap; font-weight: 400; }
/* text columns wrap on whole words only, never inside a word or a code */
td.wrap, td.txt, td .wrap { white-space: normal; min-width: 180px; max-width: 420px; }
td.client, td.cli { white-space: normal; min-width: 220px; }
td.clip { max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.num, td.num, th.num { text-align: right; white-space: nowrap; }
table tr.total:nth-child(n) > td, tr.tot td, tfoot td { font-weight: 700; border-top: 3px double var(--ink);
  background: #f3f5f8; }
table table td, table table th { height: auto; }
.card > table, .card > form > table { margin: 0; }
/* tables inside a box scroll sideways in that box only (the page script
   puts every data table in a .tbox); a long table keeps its header in
   view (.tall), a wide one its first column (.wide) */
.card[style*="overflow-x:auto"], .card[style*="overflow:auto"] { overflow-x: auto; }
.card > .tbox, .card > form > .tbox { margin: 0; }
.tbox + .tbox, .tbox + table, table + .tbox { margin-top: 10px; }
.tbox > table { border-style: hidden; }
.tbox.tall { max-height: calc(100vh - 120px); }
.tbox.wide td:first-child, .tbox.wide th:first-child {
  position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 var(--line); }
.tbox.wide td:first-child { background: #fff; }
.tbox.wide tr:nth-child(even) > td:first-child { background: var(--zebra); }
.tbox.wide th:first-child { z-index: 3; }
td.wrap { white-space: normal; min-width: 200px; max-width: 460px; }
td .nw, .nw { white-space: nowrap; }
td .clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; }
td[colspan].wrap { max-width: none; }

/* a table in a grid column scrolls in its own box instead of pushing the
   column (and the page) wider */
.page [style*="display:grid"] > *, .page [style*="display: grid"] > * { min-width: 0; }
/* cells holding several buttons let them wrap onto two lines */
td.acts { white-space: normal !important; min-width: 190px; }
/* buttons inside a table row are compact */
td .btn2 { height: 24px !important; line-height: 22px !important; padding: 0 8px;
  font-size: 12px; }
td .btn { height: 26px !important; line-height: 24px !important; min-width: 0;
  padding: 0 10px; font-size: 12px; margin-top: 0; }
td input[type=text], td input[type=date], td input[type=number], td select {
  height: 26px !important; font-size: 12px; }
td.acts .btn2, td.acts form { margin: 2px 0; }
td.acts form, td.acts > div { display: inline-flex; flex-wrap: wrap; gap: 4px; }
td.range { white-space: normal !important; min-width: 90px; }
/* a status cell with two badges stacks them */
td.stack { white-space: normal !important; }
td.stack .tag { margin: 1px 0; }
/* tables without a heading row are key / value lists: text wraps */
table.kv td { white-space: normal; height: auto; }

/* ------------------------------------------------------------ 8 KPI tiles */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px; margin-bottom: 14px; }
.kpi, .cards .kpi:nth-child(n) {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; box-shadow: none; transform: none; min-height: 84px;
}
.kpi:hover { transform: none; box-shadow: none; }
.kpi .lbl { font-size: 12px; font-weight: 600; color: var(--mut);
  text-transform: none; letter-spacing: 0; margin-bottom: 4px; }
.kpi .val { font-size: 18px; font-weight: 700; letter-spacing: 0;
  font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi .sub, .kpi > div:not(.lbl):not(.val) { font-size: 12px; }

/* ------------------------------------------------------------ 9 filter bar */
/* every list / report filter form carries class="filters"; the page script
   labels its fields and adds Reset and the "Showing:" line */
form.filters { display: flex !important; flex-wrap: wrap; align-items: flex-end !important;
  gap: 8px 12px !important; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 12px !important; margin: 0 0 12px !important;
  flex: 1 1 100% !important; }
.card form.filters { background: #f7f8fa; }
form.filters .fitem { display: flex; flex-direction: column; min-width: 140px; }
form.filters label { margin: 0 0 3px !important; font-size: 12px; font-weight: 600;
  white-space: nowrap; }
form.filters input, form.filters select { margin: 0 !important; }
form.filters input[type=text], form.filters input[type=search] { min-width: 200px; }
form.filters .btn, form.filters .btn2 { margin: 0 !important; align-self: flex-end; }
form.filters > div { margin: 0 !important; }
form.filters .showing { flex: 1 1 100%; margin-top: 2px; padding-top: 6px;
  border-top: 1px solid var(--line-2); font-size: 12px; color: var(--mut); }
.filters {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; margin: 0 0 12px;
}
.filters .fg { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; }
.filters .fg > div { min-width: 150px; }
.filters label { margin: 0 0 3px; font-size: 12px; }
.filters .btn, .filters .btn2 { margin-top: 0; }
.filters .showing { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line-2);
  font-size: 12px; color: var(--mut); }

/* ------------------------------------------------- 10 drawers and pop-ups */
#venpop { display: flex; flex-direction: column; }
#venpop[hidden], #venpop-ovl[hidden] { display: none; }
#venpop { border-radius: var(--radius) !important;
  box-shadow: 0 4px 16px rgba(0,0,0,.25) !important; }
.drw-overlay { position: fixed; inset: 0; background: rgba(20,32,48,.45); z-index: 90; }
.drw {
  position: fixed; top: 0; right: 0; bottom: 0; width: 480px; max-width: 94vw;
  background: #fff; z-index: 95; border-left: 1px solid var(--line);
  box-shadow: -4px 0 16px rgba(0,0,0,.18); display: flex; flex-direction: column;
}
.drw.w440 { width: 440px; } .drw.w470 { width: 470px; }
.drw.w520 { width: 520px; } .drw.w940 { width: 940px; max-width: 96vw; }
.drw[hidden], .drw-overlay[hidden] { display: none; }
.drw input[type=date] { width: 100%; }
.drw-head { display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line);
  background: var(--head); }
.drw-head > div:first-child > div:first-child { font-size: 15px !important; }
.drw-x { border: 1px solid transparent; background: none; font-size: 20px; line-height: 1;
  color: var(--mut); cursor: pointer; padding: 2px 8px; border-radius: var(--radius); }
.drw-x:hover { background: #fff; border-color: var(--line); color: var(--ink); }
.drw-body { padding: 6px 16px 22px; overflow-y: auto; flex: 1; }
.drw .btn { width: 100%; }
/* searchable pickers */
.cdd { position: relative; }
.cdd-native { display: none; }
.cdd-btn {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  height: 32px; padding: 0 8px; font: 13px var(--font); color: var(--ink);
  background: #fff; border: 1px solid #b7bec8; border-radius: var(--radius);
  cursor: pointer; text-align: left;
}
.cdd-btn:hover, .cdd-btn.open { border-color: var(--navy);
  box-shadow: 0 0 0 2px rgba(31,58,95,.18); background: #fff; }
.cdd-btn .cdd-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cdd-btn .cdd-ph { color: var(--mut); }
.cdd-btn .cdd-car { color: var(--mut); font-size: 10px; margin-left: 8px; }
.cdd-panel {
  position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 120;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 4px; box-shadow: 0 4px 12px rgba(0,0,0,.15); max-height: 300px; overflow: auto;
}
.cdd-add { display: flex; align-items: center; gap: 8px; padding: 7px 9px;
  color: var(--navy); font-weight: 600; font-size: 13px; cursor: pointer;
  border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.cdd-add:before { content: '+'; font-weight: 700; }
.cdd-add:hover { background: var(--navy-soft); }
.cdd-opt { padding: 6px 9px; font-size: 13px; cursor: pointer; border-radius: 2px; }
.cdd-opt:hover { background: #f0f4f9; }
.cdd-opt.sel { background: var(--navy-soft); color: var(--navy); font-weight: 600; }
.cdd-dis { padding: 6px 9px; font-size: 13px; color: #9aa4b1; cursor: not-allowed; }
.cdd-none { padding: 8px 9px; color: var(--mut); font-size: 12.5px; }
.cdd-search { width: 100%; height: 30px; margin: 0 0 4px; }
.cdd-addform { display: flex; gap: 6px; padding: 4px; }
.cdd-addform input { height: 30px; }
.cdd-addform .btn2 { height: 30px; white-space: nowrap; }

/* --------------------------------------------------------- 11 page parts */
/* expense register tabs */
.reg-tab { padding: 5px 12px; border-radius: var(--radius); font-size: 12.5px;
  font-weight: 600; text-decoration: none; border: 1px solid var(--line);
  background: #fff; color: var(--ink); }
.reg-tab.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.reg-tab:hover { border-color: var(--navy); }
.tot-tag { display: inline-block; padding: 1px 7px; border: 1px solid currentColor;
  border-radius: var(--radius); font-size: 11.5px; font-weight: 600; }
.tot-tag.direct { color: #1d4f7a; background: #eef4fa; }
.tot-tag.billed { color: var(--amber); background: var(--amber-bg); }
/* client invoice form (drawer) */
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.g3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 0 12px; }
.g5 { display: grid; grid-template-columns: 1.2fr 1.2fr 1fr 1fr 1fr; gap: 0 10px; }
.sec-h { margin: 14px 0 4px; padding: 5px 8px; font-weight: 700; font-size: 13px;
  color: var(--ink); background: var(--head); border: 1px solid var(--line);
  border-radius: var(--radius); }
.sec-h span { font-weight: 400; font-size: 12px; color: var(--mut); }
.ci-head { display: grid; grid-template-columns: 5fr 1fr 1.4fr 1.4fr 28px; gap: 6px;
  font-size: 12px; font-weight: 700; color: var(--ink); margin: 8px 0 4px;
  padding: 4px; background: var(--head); border: 1px solid var(--line); }
.ci-line { display: grid; grid-template-columns: 5fr 1fr 1.4fr 1.4fr 28px; gap: 6px;
  margin-bottom: 4px; align-items: center; }
.ci-line .amt { height: 32px; display: flex; align-items: center; justify-content: flex-end;
  padding: 0 8px; font-weight: 700; background: #f3f4f6; border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--ink); }
.ci-line .rm { border: 0; background: none; color: var(--mut); font-size: 18px;
  cursor: pointer; padding: 0; height: 32px; }
.ci-line .rm:hover { color: var(--red); }
.ci-tot { margin: 12px 0 0 auto; max-width: 360px; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 0 10px; }
.ci-tot > div { display: flex; justify-content: space-between; padding: 5px 0;
  font-size: 13px; border-bottom: 1px solid var(--line-2); }
.ci-tot > div:last-child { border-bottom: 0; }
.ci-tot .grand { font-size: 14px; font-weight: 700; background: var(--head);
  margin: 0 -10px; padding: 7px 10px; border-top: 3px double var(--ink); }
/* operations invoices list */
.invt th, .invt td { vertical-align: middle; white-space: nowrap; }
.invt .c-num { text-align: right; }
.invt .c-ref { font-weight: 600; }
.invt .c-name { font-weight: 600; min-width: 200px; max-width: 260px;
  white-space: normal; }
.invt .c-ar { font-size: 11.5px; color: var(--mut); margin-top: 1px; white-space: nowrap; }
.invt .c-guest { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.invt .c-sub { font-size: 12px; color: var(--mut); }
.invt .c-act { text-align: right; }
.invt .c-nopdf { font-size: 12px; color: var(--mut); }
/* BILLING e-mail table */
.mail-tbl input, .mail-tbl select { font-size: 12.5px; height: 28px; }
.mail-tbl td { padding-left: 5px; padding-right: 5px; }

/* sign in and forgotten password */
.login-page { background: var(--page); }
.login-wrap { max-width: 860px; margin: 0 auto; padding: 20px; min-height: 96vh;
  display: flex; align-items: center; justify-content: center; }
.lbrand { flex: 1; align-self: stretch; background: var(--navy); color: #fff;
  border: 1px solid var(--navy); border-radius: var(--radius) 0 0 var(--radius);
  padding: 40px 34px; display: flex; flex-direction: column; justify-content: center; }
.login-logo { display: block; margin: 0 0 18px; height: 84px; width: auto;
  align-self: flex-start; object-fit: contain; }
.login-title { font-size: 22px; font-weight: 600; margin: 0; }
.login-title .bar { opacity: .5; font-weight: 400; padding: 0 6px; }
.login-title .accent { color: #fff; }
.login-sub { font-size: 13px; opacity: .85; margin: 8px 0 0; }
.login-box { flex: 1; max-width: 400px; align-self: stretch; background: #fff;
  border: 1px solid var(--line); border-left: 0;
  border-radius: 0 var(--radius) var(--radius) 0; padding: 36px 32px;
  display: flex; flex-direction: column; justify-content: center; }
.login-box .card { border: 0; padding: 0; }
.login-box .btn, .fwrap .btn { width: 100%; }
.acc { font-size: 12px; font-weight: 700; color: var(--mut); margin: 0 0 8px;
  text-transform: uppercase; letter-spacing: .05em; }
.lfoot { font-size: 12px; color: var(--mut); margin-top: 16px; }
.forgot, .back { display: block; text-align: center; margin-top: 14px; font-size: 12.5px; }
.fwrap { max-width: 400px; margin: 0 auto; padding: 16px; min-height: 92vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center; }
.fwrap img { height: 72px; margin-bottom: 12px; }
.fwrap h1 { font-size: 18px; font-weight: 600; margin: 0 0 12px; }
.fwrap .card { width: 100%; }
@media (max-width: 760px) {
  .login-wrap { flex-direction: column; }
  .lbrand { border-radius: var(--radius) var(--radius) 0 0; width: 100%; padding: 26px; }
  .login-box { width: 100%; max-width: none; border-left: 1px solid var(--line);
    border-top: 0; border-radius: 0 0 var(--radius) var(--radius); padding: 24px; }
}

/* --------------------------------------------------- 12 small screens */
@media (max-width: 1100px) {
  .topbar .today, .topbar .book .bk-sub { display: none; }
}
@media (max-width: 980px) {
  div[style*="grid-template-columns:1.4fr 1fr"],
  div[style*="grid-template-columns:1fr 1fr"] { display: block !important; }
  div[style*="grid-template-columns:1fr 1fr"] > .card { margin-bottom: 14px; }
  .card + .card { margin-top: 14px; }
}
@media (max-width: 860px) {
  .topbar .menu-btn { display: block; }
  .topbar .book { display: none; }
  .side { position: fixed; top: 48px; left: 0; bottom: 0; height: auto; z-index: 35;
    transform: translateX(-100%); transition: transform .15s;
    box-shadow: 2px 0 10px rgba(0,0,0,.18); }
  body.side-open .side { transform: none; }
  .main { padding: 12px; }
  .g2, .g3, .g5, .fgrid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .page [style*="display:flex"] { flex-wrap: wrap; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .topbar { gap: 8px; padding: 0 8px; }
  .topbar .brand span { display: none; }
  .topbar .user summary { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
}

/* ------------------------------------------------------------- 13 print */
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: #fff; font-size: 11px; }
  .topbar, .side, .crumb, .drw, .drw-overlay, #venpop, #venpop-ovl,
  .filters .btn, .filters .btn2, .no-print { display: none !important; }
  .shell { display: block; min-height: 0; }
  .main { padding: 0; }
  .card, .tbox { border: 0; padding: 0; overflow: visible !important;
    max-height: none !important; }
  td .clamp { display: block; -webkit-line-clamp: unset; }
  th { position: static; }
  table { font-size: 10.5px; }
  th, td { height: auto; padding: 3px 5px; }
  tr { page-break-inside: avoid; }
  a { color: var(--ink); text-decoration: none; }
  form button, .btn, .btn2 { display: none !important; }
  /* a filter bar prints as its "Showing:" line only */
  form.filters { border: 0 !important; padding: 0 !important; background: none !important; }
  form.filters > *:not(.showing) { display: none !important; }
  form.filters .showing { border: 0; padding: 0; color: var(--ink); }
  input[type=text]:not([value]), input[type=search] { display: none; }
}
