:root {
  color-scheme: light;
  --bg: #ece9df; --face: #ece9df; --desktop: #3a6ea5; --surface: #ffffff; --surface-2: #dfdfdf; --border: #c0c0c0; --border-strong: #808080;
  --text: #000000; --text-2: #111111; --muted: #333333;
  --accent: #000080; --accent-hover: #0000a8; --accent-soft: #dfdfdf; --on-accent: #ffffff;
  --good: #006400; --good-soft: #e3f4e0; --warn: #6b4e00; --warn-soft: #fff2c2;
  --bad: #a00000; --bad-soft: #fde3de; --info: #000080; --info-soft: #e0e6fa;
  --series-1: #2a78d6; --series-2: #eb6834;
  --shadow: 2px 2px 0 rgba(0,0,0,.5);
  --radius: 0px;
  --raised: inset -1px -1px #3d3a30, inset 1px 1px #ffffff, inset -2px -2px #a39f8f, inset 2px 2px #f6f4ec;
  --sunken: inset -1px -1px #ffffff, inset 1px 1px #a39f8f, inset -2px -2px #f6f4ec, inset 2px 2px #3d3a30;
  --etched: inset 0 0 0 1px #a39f8f, inset 1px 1px 0 1px #ffffff;
  --titlebar: linear-gradient(90deg, #000080 0%, #1084d0 100%);
  --ui: Verdana, Tahoma, "Segoe UI", Geneva, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 15px; } h3 { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.muted { color: var(--muted); } .small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.pre { white-space: pre-line; }

/* ---- shell */
#shell { display: grid; grid-template-columns: 224px 1fr; min-height: 100vh; }
#sidebar {
  background: var(--surface); border-right: 1px solid var(--border); padding: 16px 10px;
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow-y: auto;
}
.brand { display: flex; gap: 8px; align-items: center; padding: 4px 10px 16px; font-weight: 700; font-size: 15px; }
.brand-mark { color: var(--accent); }
#nav { display: flex; flex-direction: column; gap: 1px; }
.nav-group { margin: 14px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.nav-link {
  display: flex; align-items: center; justify-content: space-between; padding: 7px 10px; border-radius: 7px;
  color: var(--text-2); font-weight: 500;
}
.nav-link:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-count { font-size: 11px; background: var(--surface-2); color: var(--text-2); border-radius: 99px; padding: 0 7px; font-weight: 600; }
.sidebar-foot { margin-top: auto; padding: 10px; font-size: 11.5px; color: var(--muted); }
#main { min-width: 0; }
#page { max-width: 1240px; margin: 0 auto; padding: 24px 28px 64px; }

/* ---- page header */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 2px; }
.page-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.back { display: inline-block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }

/* ---- buttons & inputs */
button { font: inherit; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 550; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 4px 9px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: default; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 7px; padding: 7px 9px; width: 100%; min-width: 0;
}
textarea { resize: vertical; min-height: 62px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
input[type=checkbox] { width: auto; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 550; color: var(--text-2); }
label.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
label.field.check { flex-direction: row; align-items: center; gap: 8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-section { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); grid-column: 1 / -1; margin-top: 6px; }

/* ---- cards & tables */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); gap: 10px; }
.card-body { padding: 14px 16px; }
.toolbar { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.toolbar .search { max-width: 260px; }
.toolbar .spacer { flex: 1; }
.tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.tab { border: 0; background: transparent; color: var(--text-2); padding: 5px 10px; border-radius: 7px; cursor: pointer; font-weight: 550; }
.tab:hover { background: var(--surface-2); }
.tab.active { background: var(--accent-soft); color: var(--accent); }
.tab .n { color: var(--muted); font-weight: 500; margin-left: 4px; font-size: 12px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; user-select: none; }
th.sortable { cursor: pointer; } th.sortable:hover { color: var(--text); }
th.num { text-align: right; }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.cell-main { font-weight: 600; } .cell-sub { color: var(--muted); font-size: 12px; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--text-2); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }

/* ---- dashboard */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.kpi { padding: 14px 16px; display: block; color: inherit; }
a.kpi:hover { text-decoration: none; border-color: var(--border-strong); }
.kpi .label { font-size: 12px; color: var(--muted); font-weight: 550; }
.kpi .value { font-size: 24px; font-weight: 680; letter-spacing: -.02em; margin: 2px 0; font-variant-numeric: tabular-nums; }
.kpi .note { font-size: 12px; color: var(--text-2); }
.kpi .note.bad { color: var(--bad); } .kpi .note.good { color: var(--good); }
.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; margin-bottom: 14px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; }
.chart text { fill: var(--muted); font-size: 10.5px; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .band { fill: transparent; } .chart .band:hover { fill: var(--surface-2); }
.tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; padding: 8px 10px; font-size: 12px; box-shadow: var(--shadow); min-width: 150px; z-index: 5; }
.tip .row { display: flex; justify-content: space-between; gap: 14px; }
.tip .t { font-weight: 650; margin-bottom: 4px; }
.list-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 16px; border-bottom: 1px solid var(--border); align-items: center; color: inherit; }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover { background: var(--surface-2); text-decoration: none; }

/* ---- detail pages & documents */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.side { display: flex; flex-direction: column; gap: 14px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; }
.doc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 36px 40px; }
.doc-top { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.doc-kind { font-size: 22px; font-weight: 700; letter-spacing: .02em; text-align: right; }
.doc-number { text-align: right; color: var(--text-2); font-weight: 600; }
.doc-company { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.doc-parties { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.doc-label { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; }
.doc table th { border-bottom: 2px solid var(--text); color: var(--text); padding-left: 0; padding-right: 8px; }
.doc table td { padding-left: 0; padding-right: 8px; vertical-align: top; }
.doc table th:last-child, .doc table td:last-child { padding-right: 0; }
.doc-totals { margin: 16px 0 0 auto; width: 280px; }
.doc-totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.doc-totals .grand { border-top: 2px solid var(--text); margin-top: 6px; padding-top: 8px; font-weight: 700; font-size: 16px; }
.doc-foot { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--border); color: var(--text-2); font-size: 12.5px; display: grid; gap: 10px; }
.progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; min-width: 70px; }
.progress i { display: block; height: 100%; background: var(--good); border-radius: 99px; }

/* ---- line editor */
.lines th, .lines td { padding: 5px 4px; border: 0; }
.lines th { padding-bottom: 6px; }
.lines input { padding: 6px 7px; }
.lines .num input { text-align: right; }
.lines .x { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 16px; padding: 2px 6px; border-radius: 6px; }
.lines .x:hover { background: var(--bad-soft); color: var(--bad); }
.lines-foot { display: flex; justify-content: space-between; align-items: flex-start; margin-top: 8px; gap: 16px; }
.totals-box { width: 260px; display: grid; gap: 6px; }
.totals-box div { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.totals-box input { width: 100px; text-align: right; }
.totals-box .grand { font-weight: 700; font-size: 15px; border-top: 1px solid var(--border); padding-top: 8px; }

/* ---- modal & toast */
.overlay { position: fixed; inset: 0; background: rgba(10,10,10,.45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; z-index: 50; }
.modal { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); width: 100%; max-width: 560px; border: 1px solid var(--border); }
.modal.wide { max-width: 980px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 16px 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); }
.modal-foot .left { margin-right: auto; }
#toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 9px; box-shadow: var(--shadow); max-width: 380px; font-weight: 500; }
.toast.error { background: var(--bad); color: #fff; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login { width: 100%; max-width: 340px; padding: 24px; display: grid; gap: 14px; }
.login .btn { justify-content: center; padding: 9px 12px; }
.sidebar-foot a { display: inline-block; margin-top: 2px; }

@media (max-width: 1000px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .detail { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  #shell { grid-template-columns: 1fr; }
  #sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  #nav { flex-direction: row; flex-wrap: wrap; } .nav-group, .sidebar-foot { display: none; }
  #page { padding: 16px; } .form-grid, .form-grid.three, .doc-parties { grid-template-columns: 1fr; }
  .doc { padding: 20px; }
}

@media print {
  :root { color-scheme: light; --surface: #fff; --bg: #fff; --text: #000; --text-2: #222; --muted: #555; --border: #ccc; }
  #sidebar, .page-head, .side, #toasts, .no-print { display: none !important; }
  #shell, .detail { display: block; } #page { padding: 0; max-width: none; }
  .doc { border: 0; padding: 0; border-radius: 0; }
  @page { margin: 16mm; }
}

/* ---- Windows 95/98-inspired look: grey bevels, navy title bars, teal desktop */
body { font-family: var(--ui); font-size: 14px; line-height: 1.5; background: var(--desktop); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font-family: var(--ui); font-size: 14px; }
a { color: #0000a8; text-decoration: underline; }
h1, h2, h3 { letter-spacing: 0; font-family: var(--ui); }
h2 { font-size: 13px; font-weight: 700; }
.mono { font-family: "Courier New", Courier, monospace; font-size: 13px; }
.muted { color: var(--muted); }

/* sidebar: a tool window */
#shell { grid-template-columns: 208px 1fr; gap: 0; }
#sidebar { background: var(--face); border: 0; box-shadow: var(--raised); padding: 3px; margin: 8px 0 8px 8px; height: calc(100vh - 16px); top: 8px; }
.brand { background: var(--titlebar); color: #fff; font-size: 13px; font-weight: 700; padding: 4px 6px; margin-bottom: 6px; gap: 6px; }
.brand-mark { color: #ffff00; }
#nav { gap: 0; padding: 0 5px; }
.nav-group { margin: 12px 0 3px; padding: 0 2px 3px; font-size: 13px; font-weight: 700; letter-spacing: 0; text-transform: none; color: #000;
  border-bottom: 1px solid #808080; box-shadow: 0 1px 0 #fff; }
.nav-link { color: #000; border-radius: 0; padding: 4px 8px; font-weight: 400; text-decoration: none; border: 1px dotted transparent; }
.nav-link:hover { background: transparent; color: #000; border-color: #000; text-decoration: none; }
.nav-link.active { background: #000080; color: #fff; font-weight: 400; }
.sidebar-foot { color: #000; font-size: 12px; margin: auto 5px 5px; padding: 6px 8px; box-shadow: var(--sunken); background: var(--face); }
.sidebar-foot a { display: block; }

/* each page is a window */
#main { padding: 8px 10px; }
#page { max-width: 1240px; margin: 0 auto 24px; padding: 3px 3px 12px; background: var(--face); box-shadow: var(--raised); }
.page-head { background: var(--titlebar); margin: 0 0 10px; padding: 4px 4px 4px 8px; align-items: center; }
.page-head h1 { color: #fff; font-size: 14px; font-weight: 700; }
.page-head .sub, .page-head .sub a, .page-head .back { color: #fff; font-size: 12px; margin: 0; }
.page-head .back { display: block; margin-bottom: 1px; }
#page > div > *:not(.page-head) { margin-left: 9px; margin-right: 9px; }

/* controls */
.btn { border: 0; border-radius: 0; background: var(--face); color: #000; font-weight: 400; padding: 4px 14px; min-height: 24px; box-shadow: var(--raised); text-decoration: none; }
.btn:hover { background: var(--face); }
.btn:active { box-shadow: var(--sunken); padding: 5px 13px 3px 15px; }
.btn:focus-visible { outline: 1px dotted #000; outline-offset: -5px; }
.btn.primary { background: var(--face); color: #000; font-weight: 700; box-shadow: var(--raised), 0 0 0 1px #000; }
.btn.primary:hover { background: var(--face); }
.btn.danger { color: #a00000; }
.btn.ghost { box-shadow: none; background: transparent; color: #0000a8; text-decoration: underline; padding: 2px 6px; }
.btn.ghost:hover { background: transparent; }
.btn.sm { padding: 1px 9px; font-size: 12px; min-height: 20px; }
.btn:disabled { color: #808080; text-shadow: 1px 1px #fff; opacity: 1; }
input, select, textarea { border: 0; border-radius: 0; background: #fff; padding: 4px 6px; box-shadow: var(--sunken); }
input:focus, select:focus, textarea:focus { outline: 1px dotted #000; outline-offset: -4px; }
input[type=checkbox] { box-shadow: none; }
label.field { font-size: 13px; font-weight: 400; color: #000; gap: 3px; }
label.field .hint { font-size: 12px; }
.form-section { color: #000; text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 700; border-bottom: 1px solid #808080; box-shadow: 0 1px 0 #fff; padding-bottom: 2px; }

/* group boxes and list views */
.card { background: var(--face); border: 0; border-radius: 0; box-shadow: var(--etched); padding: 2px; }
.card-head { background: transparent; border-bottom: 1px solid #808080; box-shadow: 0 1px 0 #fff; padding: 6px 10px; }
.card-body { padding: 10px; }
.toolbar { background: transparent; border-bottom: 0; padding: 6px 6px 0; align-items: flex-end; }
.toolbar .search, .toolbar select, .toolbar .btn { margin-bottom: 6px; }
.table-wrap { background: #fff; box-shadow: var(--sunken); padding: 2px; margin: 0 4px 4px; }
.tabs { gap: 0; align-self: flex-end; }
.tab { border: 0; border-radius: 3px 3px 0 0; background: var(--face); color: #000; font-weight: 400; padding: 4px 10px 3px; margin-top: 2px;
  box-shadow: inset 1px 1px #fff, inset -1px 0 #0a0a0a, inset -2px 0 #808080, inset 2px 2px #dfdfdf; }
.tab:hover { background: var(--face); }
.tab.active { background: var(--face); color: #000; font-weight: 700; margin-top: 0; padding: 5px 11px 4px; position: relative; z-index: 1; }
.tab .n { font-weight: 400; color: var(--muted); }
#page > div > .tabs { border-bottom: 1px solid #fff; margin-bottom: 10px; }
th { background: var(--face); color: #000; font-size: 13px; font-weight: 400; text-transform: none; letter-spacing: 0; padding: 4px 8px; border: 0; box-shadow: var(--raised); }
th.sortable:hover { color: #000; }
th.sortable:active { box-shadow: var(--sunken); }
td { padding: 5px 8px; border-bottom: 1px solid #e4e4e4; }
tr.clickable:hover td, tr.clickable:hover td * { background: #000080; color: #fff; }
tr.clickable:hover td .badge { border-color: #fff; }
tr.clickable:hover td .btn { background: var(--face); color: #000; }
.badge { border-radius: 0; border: 1px solid currentColor; background: #fff; font-size: 12px; font-weight: 400; padding: 0 5px; color: #000; }
.empty { background: #fff; color: #000; }
.card.empty { box-shadow: var(--sunken); }

.kpis { gap: 10px; }
.kpi { padding: 8px 12px 10px; text-decoration: none; color: #000; }
.kpi .label { color: #000; font-weight: 700; font-size: 13px; }
.kpi .value { font-size: 22px; font-weight: 700; letter-spacing: 0; background: #fff; box-shadow: var(--sunken); padding: 4px 8px; margin: 6px 0; text-align: right; font-family: "Courier New", Courier, monospace; }
.kpi .note { font-size: 12px; }
.list-row { padding: 6px 10px; border-bottom: 1px solid #808080; box-shadow: 0 1px 0 #fff; text-decoration: none; color: #000; }
.list-row:last-child { box-shadow: none; }
a.list-row:hover, a.list-row:hover * { background: #000080; color: #fff; }
a.list-row:hover .badge { border-color: #fff; }
.chart { background: #fff; box-shadow: var(--sunken); padding: 8px; }
.chart .band:hover { fill: #e4e4e4; }
.tip { border: 1px solid #000; border-radius: 0; background: #ffffe1; box-shadow: var(--shadow); }
.progress { height: 16px; background: #fff; border: 0; border-radius: 0; padding: 3px; box-shadow: var(--sunken); min-width: 90px; }
.progress i { border-radius: 0; background: repeating-linear-gradient(90deg, #000080 0 9px, transparent 9px 11px); }
.kv dt { color: #000; }

/* dialogs */
.overlay { background: rgba(0,0,0,.2); }
.modal { border: 0; border-radius: 0; background: var(--face); box-shadow: var(--raised), 3px 3px 0 rgba(0,0,0,.4); padding: 3px; }
.modal-head { background: var(--titlebar); border-bottom: 0; padding: 3px 3px 3px 8px; }
.modal-head h2 { color: #fff; font-size: 13px; }
.modal-head .btn { background: var(--face); color: #000; font-weight: 700; width: 20px; min-height: 18px; height: 18px; padding: 0; justify-content: center; box-shadow: var(--raised); text-decoration: none; font-size: 11px; }
.modal-body { padding: 12px; }
.modal-foot { border-top: 0; padding: 2px 12px 12px; }
.toast { background: #ffffe1; color: #000; border: 1px solid #000; border-radius: 0; box-shadow: var(--shadow); font-weight: 400; }
.toast.error { background: #ffffe1; color: #a00000; }
.lines th { background: transparent; box-shadow: none; padding: 5px 4px; }
.lines .x { border-radius: 0; }
.totals-box .grand { border-top: 1px solid #808080; box-shadow: inset 0 1px 0 #fff; }

.doc { border: 0; border-radius: 0; background: #fff; box-shadow: var(--sunken); }
.doc table th { background: transparent; box-shadow: none; font-weight: 700; border-bottom: 2px solid #000; padding-left: 0; }
.doc-kind, .doc-company { font-family: "Times New Roman", Times, serif; }
.doc-kind { font-size: 24px; }

.login-wrap { background: var(--desktop); }
.login { border: 0; border-radius: 0; background: var(--face); box-shadow: var(--raised), 3px 3px 0 rgba(0,0,0,.4); padding: 3px 3px 16px; gap: 12px; }
.login > *:not(.brand) { margin-left: 14px; margin-right: 14px; }
.login .brand { margin: 0 0 6px; }
.login .btn { justify-content: center; }

.mono, .kv dd, td:first-child .cell-main { white-space: nowrap; }
@media (max-width: 760px) { #shell { grid-template-columns: 1fr; } #sidebar { height: auto; margin: 6px; position: static; } #main { padding: 0 6px 6px; } }
@media print { body { background: #fff; } #page { box-shadow: none; padding: 0; margin: 0; background: #fff; } #page > div > *:not(.page-head) { margin: 0; } .doc { box-shadow: none; } }

/* readability pass: larger, smoother type and roomier rows, same bevels */
h2 { font-size: 14px; }
.mono { font-family: Menlo, Consolas, "Lucida Console", "Courier New", monospace; font-size: 13px; }
.small, .cell-sub, .kpi .note, label.field .hint, .sidebar-foot, .btn.sm, .tab .n { font-size: 12.5px; }
.brand { font-size: 14px; padding: 5px 8px; }
.nav-group { font-size: 14px; margin-top: 14px; }
.nav-link { padding: 5px 8px; font-size: 14px; }
.page-head { padding: 6px 6px 6px 10px; }
.page-head h1 { font-size: 16px; }
.page-head .sub, .page-head .sub a, .page-head .back { font-size: 12.5px; }
.btn { padding: 5px 15px; min-height: 28px; }
.btn:active { padding: 6px 14px 4px 16px; }
.btn.sm { padding: 2px 10px; min-height: 22px; }
input, select, textarea { padding: 5px 7px; }
label.field, .form-section, .kpi .label { font-size: 13.5px; }
th { font-size: 13.5px; padding: 6px 10px; font-weight: 700; }
td { padding: 8px 10px; }
.badge { font-size: 12.5px; padding: 1px 7px; }
.tab { padding: 5px 12px 4px; font-size: 13.5px; }
.tab.active { padding: 6px 13px 5px; }
.list-row { padding: 8px 12px; }
.kpi .value { font-family: var(--ui); font-size: 24px; padding: 6px 10px; }
.modal-head h2 { font-size: 14px; }
.modal-head .btn { width: 22px; height: 20px; min-height: 20px; padding: 0; font-size: 12px; }
.chart text { font-size: 11.5px; fill: #222; }
.doc { font-size: 14px; }

/* less grey: ivory window face, white panels, tinted status tags, a little colour */
.card { background: #fff; }
.card-head { background: linear-gradient(90deg, #e0e6fa 0%, #ffffff 100%); border-bottom: 1px solid #a39f8f; box-shadow: none; }
.card-head h2, .kpi .label, .nav-group { color: #000080; }
.toolbar { background: var(--face); }
.table-wrap { margin: 0; box-shadow: none; padding: 0; border-top: 1px solid #a39f8f; }
.chart { box-shadow: none; padding: 0; }
.kpi .value { background: #f7f9ff; color: #000080; }
.list-row { border-bottom: 1px solid #e3e0d4; box-shadow: none; }
td { border-bottom: 1px solid #ebe8de; }
tr.clickable:hover td, tr.clickable:hover td *, a.list-row:hover, a.list-row:hover * { background: #000080; color: #fff; }
.badge { background: #f4f2ea; }
.badge.info { background: var(--info-soft); } .badge.good { background: var(--good-soft); }
.badge.warn { background: var(--warn-soft); } .badge.bad { background: var(--bad-soft); }
.nav-link.active { background: #000080; color: #fff; }
.sidebar-foot { background: #fff; }
.modal-foot { background: transparent; }
td:nth-child(2) { white-space: nowrap; }

/* collapsible side menu */
#brand-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#nav-toggle { margin-left: auto; width: 22px; height: 20px; min-height: 20px; padding: 0; justify-content: center; font-size: 13px; font-weight: 700; line-height: 1; flex: none; }
#nav-toggle:active { padding: 0; }
body.nav-collapsed #nav, body.nav-collapsed .sidebar-foot, body.nav-collapsed #brand-name, body.nav-collapsed .brand-mark { display: none; }
body.nav-collapsed .brand { padding: 4px 3px; margin: 0; justify-content: center; }
body.nav-collapsed #nav-toggle { margin: 0; }
@media (min-width: 761px) {
  body.nav-collapsed #shell { grid-template-columns: 42px 1fr; }
  body.nav-collapsed #sidebar { overflow: hidden; }
}
@media print { #nav-toggle { display: none; } }

/* slightly smaller type */
body, button, input, select, textarea, .nav-link, .nav-group, .doc { font-size: 12px; }
h2, .brand, .modal-head h2 { font-size: 12.5px; }
.page-head h1 { font-size: 14px; }
th, .tab, label.field, .form-section, .kpi .label { font-size: 12px; }
.mono { font-size: 11.5px; }
.small, .cell-sub, .kpi .note, label.field .hint, .sidebar-foot, .btn.sm, .tab .n, .badge, .page-head .sub, .page-head .sub a, .page-head .back { font-size: 11px; }
.kpi .value { font-size: 20px; }
#nav-toggle { font-size: 11px; }
.chart text { font-size: 10.5px; }
td { padding: 7px 10px; }

/* company switcher; the second company gets its own title-bar colour so the two are hard to mix up */
#company-switch { padding: 0 5px 4px; }
#company-switch select { font-weight: 700; }
body.nav-collapsed #company-switch { display: none; }
body[data-company="forbecome"] { --titlebar: linear-gradient(90deg, #0b5d3b 0%, #2f9e6b 100%); --desktop: #4d7a66; }
body[data-company="forbecome"] .nav-link.active, body[data-company="forbecome"] tr.clickable:hover td, body[data-company="forbecome"] tr.clickable:hover td *,
body[data-company="forbecome"] a.list-row:hover, body[data-company="forbecome"] a.list-row:hover * { background: #0b5d3b; }

/* shipping label: hidden on screen, the only thing on paper while a label prints */
#label-print { display: none; }
.ship-label { width: 100mm; height: 150mm; box-sizing: border-box; padding: 5mm; background: #fff; color: #000; font: 10pt/1.3 Arial, Helvetica, sans-serif;
  display: flex; flex-direction: column; gap: 3mm; page: label; break-after: page; overflow: hidden; }
.ship-label:last-child { break-after: auto; }
.ship-label .pre { white-space: pre-line; }
.sl-cap { font-size: 7pt; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #000; margin-bottom: .5mm; }
.sl-from { font-size: 8.5pt; padding-bottom: 3mm; border-bottom: 1pt solid #000; }
.sl-to { flex: 1; border: 1.5pt solid #000; padding: 4mm; }
.sl-name { font-size: 17pt; font-weight: 700; line-height: 1.15; margin-bottom: 1.5mm; }
.sl-addr { font-size: 14pt; line-height: 1.25; }
.sl-phone { font-size: 10pt; margin-top: 2mm; }
.sl-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 3mm; font-size: 9pt; border-top: 1pt solid #000; padding-top: 2.5mm; }
.sl-meta b { font-size: 11pt; }
.sl-parcel { font-size: 15pt !important; }
.sl-carrier { display: flex; justify-content: space-between; gap: 3mm; font-size: 11pt; font-weight: 700; border-top: 1pt solid #000; padding-top: 2.5mm; }
.sl-carrier .mono { font-family: "Courier New", monospace; font-size: 11pt; }
.sl-note { font-size: 8.5pt; border-top: 1pt dashed #000; padding-top: 2mm; }
@page label { size: 100mm 150mm; margin: 0; }
@media print {
  body.printing-label #shell, body.printing-label .overlay { display: none !important; }
  body.printing-label #label-print { display: block; }
  body.printing-label { background: #fff; padding: 0; margin: 0; }
}

/* 3PL report: laid out as a document so it prints cleanly */
.doc.report { padding: 22px 24px; }
.doc.report .doc-top { margin-bottom: 16px; border-bottom: 2px solid #000080; padding-bottom: 12px; align-items: flex-end; }
.doc.report table th { padding-left: 8px; }
.doc.report table td { padding-left: 8px; }
.doc.report .kpi { box-shadow: var(--etched); }
@media print { .doc.report .kpis { display: grid; } .doc.report .kpi { border: 1px solid #999; box-shadow: none; } }
.doc.report { overflow-x: auto; }
.doc.report table td:first-child { white-space: nowrap; }
@media print { .doc.report { overflow: visible; } }
