/* ==========================================================================
   SolidCap Tracker — design system
   Near-black for anything that acts, gold for anything that identifies,
   white cards floating on a soft grey ground.
   ========================================================================== */

:root {
  --ink: #10151c;          /* headings, dark surfaces, primary buttons */
  --ink-soft: #1b2430;
  --body: #39424f;
  --muted: #6f7a89;
  --faint: #9aa4b2;

  --bg: #eef0f4;
  --card: #ffffff;
  --line: #e3e7ee;
  --line-soft: #eef1f5;

  /* Two golds: the dark one is legible on white, the bright one on near-black. */
  --accent: #8a6913;       /* dark gold — eyebrows, ticket numbers, links */
  --accent-bg: #faf3e0;
  --accent-dark: #6b510c;
  --gold: #e0b352;         /* bright gold — text on a black selected button */

  --ok: #0f7b4f;      --ok-bg: #e7f5ee;
  --warn: #9a5b06;    --warn-bg: #fdf3e3;
  --danger: #b42318;  --danger-bg: #fdeceb;
  --info: #4f46e5;    --info-bg: #eeecfd;

  --r-xl: 18px;
  --r-lg: 14px;
  --r-md: 11px;
  --r-sm: 9px;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .10);

  --sans: -apple-system, "SF Pro Display", BlinkMacSystemFont, "Segoe UI Variable Display",
    "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- Type ---------- */

h1, h2, h3 { color: var(--ink); margin: 0; }

h1 {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -.028em;
  line-height: 1.1;
}
h2 { font-size: 20px; font-weight: 650; letter-spacing: -.015em; }
h3 {
  font-size: 12px; font-weight: 650; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.01em;
}

.lede, .sub {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  max-width: 68ch;
}
.sub { font-size: 14px; margin-top: 6px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.mono { font-family: var(--mono); font-size: 13px; letter-spacing: -.02em; }
.stack > * + * { margin-top: 10px; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.inline-form { display: inline; }
.empty { color: var(--faint); font-size: 14px; padding: 18px 2px; }

/* ---------- Top bar ---------- */

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 54px; height: 54px; flex: none;
  border-radius: var(--r-md);
  background: var(--ink);
  color: var(--gold);
  display: grid; place-items: center;
  overflow: hidden;
  font-size: 17px; font-weight: 700; letter-spacing: .04em;
}
/* Never bigger than the space it is given, whatever shape the file is. */
.brand-mark img {
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain; display: block;
}

/*
 * An uploaded logo sits on its own, without the dark tile behind it — and it
 * keeps its own proportions. A firm's logo is usually wide (emblem plus the
 * name), and squeezing that into a square box shrinks it to an illegible
 * strip, so the height is fixed and the width follows the artwork.
 */
.brand-mark.has-logo {
  background: transparent;
  border-radius: 0;
  overflow: visible;
  display: block;
  width: auto;
  height: auto;
}
/*
 * A fixed height in pixels with the width left free, so the logo is sized by
 * its own proportions rather than a square. object-fit keeps a very wide logo
 * undistorted when the max-width cap is what limits it.
 */
.brand-mark.has-logo img { height: 52px; width: auto; max-width: 260px; }
.auth-panel .brand-mark.has-logo { background: transparent; }
.brand-text { display: block; line-height: 1.15; }
.brand-text small {
  display: block; font-size: 11px; color: var(--faint);
  letter-spacing: -.005em;
}
.brand-text strong {
  display: block; font-size: 21px; font-weight: 700;
  color: var(--ink); letter-spacing: -.025em; line-height: 1.15;
}

.nav { display: flex; align-items: center; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a {
  padding: 9px 15px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  color: var(--body);
  text-decoration: none;
  white-space: nowrap;
}
.nav a:hover { background: var(--line-soft); color: var(--ink); text-decoration: none; }
.nav a.active { background: var(--ink); color: var(--gold); font-weight: 600; }

.topbar-right { display: flex; align-items: center; gap: 12px; }
.whoami { line-height: 1.15; text-align: right; }
.whoami strong { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
.whoami small { display: block; font-size: 11px; color: var(--faint); }

.linkbtn {
  background: none; border: none; padding: 0; cursor: pointer;
  font: inherit; font-size: 13px; color: var(--accent); text-decoration: underline;
}
.linkbtn:hover { color: var(--accent-dark); }

/* ---------- Page frame ---------- */

.wrap { max-width: 1440px; margin: 0 auto; padding: 34px 22px 80px; }
.narrow { max-width: 780px; }

.pagehead {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 24px; flex-wrap: wrap; margin-bottom: 26px;
}

/* ---------- Cards ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  margin-bottom: 18px;
}
.card.tight { padding: 14px 16px; }
.card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; margin-bottom: 16px; flex-wrap: wrap;
}
.card-head h2 { margin: 0; }
.card-head .sub { margin-top: 4px; }

.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.detail { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 980px) {
  .grid.two, .grid.detail { grid-template-columns: 1fr; }
}

/* ---------- Stat tiles ---------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 30px;
}
.tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 14px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color .12s ease, transform .12s ease;
}
.tile:hover {
  border-color: var(--ink); color: inherit; text-decoration: none;
  transform: translateY(-1px);
}
.tile .n {
  font-size: 34px; font-weight: 680; line-height: 1.05;
  color: var(--ink); letter-spacing: -.03em;
}
.tile .l { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.tile.alert .n { color: var(--danger); }
.tile.attention .n { color: var(--warn); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 20px;
  border-radius: var(--r-md);
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 550;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: #000; border-color: #000; color: #fff; text-decoration: none; }
.btn.secondary { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { background: var(--line-soft); border-color: #d3d9e2; color: var(--ink); }
.btn.ok { background: var(--ok); border-color: var(--ok); }
.btn.ok:hover { background: #0b6640; border-color: #0b6640; }
.btn.warn { background: #a4620a; border-color: #a4620a; }
.btn.warn:hover { background: #8a5208; border-color: #8a5208; }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: #911d17; border-color: #911d17; }
.btn.small { padding: 6px 12px; font-size: 13.5px; border-radius: var(--r-sm); }
.btn[disabled], .btn.disabled { opacity: .45; cursor: not-allowed; }
.btnrow { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Forms ---------- */

label {
  display: block;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}
.hint {
  font-size: 13px; font-weight: 400; color: var(--muted);
  margin: 7px 0 0; letter-spacing: 0; text-transform: none;
}

input[type=text], input[type=password], input[type=date], input[type=number],
input[type=month], input[type=email], input[type=search], input[type=file],
select, textarea {
  width: 100%;
  padding: 13px 15px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  appearance: none;
}
input[type=file] { padding: 10px 12px; font-size: 14px; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%236f7a89' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 11px;
  padding-right: 36px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(16, 21, 28, .08);
}
textarea { resize: vertical; min-height: 92px; line-height: 1.5; }
::placeholder { color: var(--faint); }

.field { margin-bottom: 18px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 18px; }

.checkline {
  display: inline-flex; gap: 8px; align-items: center;
  font-size: 14px; white-space: nowrap; cursor: pointer;
}
.checkline input { width: auto; accent-color: var(--ink); cursor: pointer; }

.check { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.check input { width: auto; margin-top: 2px; accent-color: var(--ink); }
.check label {
  margin: 0; font-size: 14px; font-weight: 400; text-transform: none;
  letter-spacing: 0; color: var(--body);
}

.filterbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 16px 16px;
  align-items: end;
}
.filterbar .field { margin: 0; }

/* ---------- Filter chips ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 14px;
  font-weight: 500;
  color: var(--body);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.chip:hover { border-color: #d3d9e2; color: var(--ink); text-decoration: none; }
.chip input { margin: 0; width: auto; accent-color: var(--accent); }
.chip.on {
  background: var(--ink); border-color: var(--ink);
  color: var(--gold); font-weight: 600;
}
.chip.on input { accent-color: var(--gold); }

/* ---------- Status pills ---------- */

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px 5px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 550;
  white-space: nowrap;
  line-height: 1.35;
}
.pill::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; flex: none;
}
.pill.new        { background: #eef1f6; color: #4b5565; }
.pill.approval   { background: #f4ecfe; color: #6d28d9; }
.pill.preparing  { background: #e9f1fe; color: #1d4ed8; }
.pill.review     { background: var(--warn-bg); color: var(--warn); }
.pill.ready      { background: #e6f4fb; color: #0369a1; }
.pill.sent       { background: var(--info-bg); color: var(--info); }
.pill.returned   { background: #e3f5f0; color: #0d7d68; }
.pill.archived   { background: #eceef2; color: #4a5568; }
.pill.completed  { background: var(--ok-bg); color: var(--ok); }
.pill.hold       { background: #f2f1ef; color: #6b6257; }
.pill.cancelled  { background: #f2f3f5; color: #8b95a1; }

/* ---------- Badges (flags, risk, tags) ---------- */

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  margin: 0 4px 4px 0;
  white-space: nowrap;
  background: var(--line-soft);
  color: var(--body);
}
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.warn   { background: var(--warn-bg); color: var(--warn); }
.badge.info   { background: var(--info-bg); color: var(--info); }
.badge.ok     { background: var(--ok-bg); color: var(--ok); }
.badge.muted  { background: var(--line-soft); color: var(--muted); }
.badge.tag    { background: var(--line-soft); color: var(--body); }

/* ---------- Record cards (ticket / list rows) ---------- */

.records { display: flex; flex-direction: column; gap: 14px; }
.record {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  display: block;
  color: inherit;
  text-decoration: none;
}
.record:hover { border-color: #cfd6e0; color: inherit; text-decoration: none; }
.record-top {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; margin-bottom: 10px;
}
.record-no {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -.02em;
}
.record-status { margin-left: auto; }
.record-company {
  font-size: 13px; font-weight: 650; color: var(--ink);
  letter-spacing: -.01em; margin-bottom: 2px;
}
.record-title {
  font-size: 19px; font-weight: 500; color: var(--ink);
  letter-spacing: -.02em; line-height: 1.3; margin-bottom: 12px;
}
.record-meta { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Tables ---------- */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 13px 14px; vertical-align: top; }
th {
  font-size: 11px; font-weight: 650; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted); white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
td { border-bottom: 1px solid var(--line-soft); color: var(--body); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfc; }
td .mono { color: var(--accent); font-weight: 600; }

/* ---------- Documents checklist ---------- */

.doclist { display: flex; flex-direction: column; }
.docrow {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 0; border-bottom: 1px solid var(--line-soft);
}
.docrow:last-child { border-bottom: none; }
.docrow .docname { flex: 1 1 200px; font-size: 15px; color: var(--ink); }
.docrow form { display: flex; align-items: center; gap: 8px; }
.docrow select { width: auto; min-width: 160px; padding: 8px 32px 8px 12px; font-size: 14px; }

/* ---------- Definition lists ---------- */

.deflist { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; font-size: 14px; }
.deflist dt { color: var(--muted); font-size: 12px; letter-spacing: .02em; padding-top: 1px; }
.deflist dd { margin: 0; color: var(--ink); }

/* ---------- Workflow steps ---------- */

.steps {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 0 0 22px; padding: 0; list-style: none; font-size: 12.5px;
}
.steps li {
  padding: 6px 13px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); color: var(--faint);
}
.steps li.done { background: var(--ok-bg); border-color: transparent; color: var(--ok); }
.steps li.current { background: var(--ink); border-color: var(--ink); color: var(--gold); font-weight: 600; }

/* ---------- Timeline ---------- */

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  padding: 14px 0 14px 20px;
  border-left: 2px solid var(--line);
  position: relative;
}
.timeline li::before {
  content: ''; position: absolute; left: -5px; top: 19px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #cbd2dc; border: 2px solid var(--card); box-sizing: content-box;
}
.timeline li.t-followup::before { background: #a4620a; }
.timeline li.t-review::before { background: var(--info); }
.timeline li.t-update::before { background: var(--ok); }
.timeline li.t-reassign::before { background: var(--accent); }
.timeline .meta { font-size: 12px; color: var(--faint); margin-bottom: 3px; }
.timeline .body { white-space: pre-wrap; font-size: 14.5px; color: var(--ink); }
.timeline .body.sys { color: var(--body); }

/* ---------- Autocomplete ---------- */

.autocomplete { position: relative; }
.ac-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  max-height: 280px; overflow-y: auto; display: none;
}
.ac-list.open { display: block; }
.ac-item { padding: 11px 15px; cursor: pointer; font-size: 14.5px; color: var(--ink); }
.ac-item + .ac-item { border-top: 1px solid var(--line-soft); }
.ac-item:hover, .ac-item.sel { background: var(--accent-bg); }
.ac-item .m { font-size: 12.5px; color: var(--muted); margin-top: 1px; }

/* ---------- Notices ---------- */

.notice {
  padding: 13px 17px;
  border-radius: var(--r-md);
  margin-bottom: 20px;
  font-size: 14.5px;
}
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.danger { background: var(--danger-bg); color: var(--danger); }
.notice.info { background: var(--accent-bg); color: var(--accent-dark); }
.notice ul { margin: 8px 0 0; padding-left: 20px; }
.notice a { color: inherit; text-decoration: underline; }

/* ---------- Sign in ---------- */

.auth { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }

.auth-panel {
  background: var(--ink);
  color: #fff;
  padding: 40px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.auth-panel .brand-mark { background: rgba(255, 255, 255, .1); width: 64px; height: 64px; font-size: 20px; }
.auth-panel .brand-mark.has-logo { width: auto; height: auto; }
.auth-panel .brand-mark.has-logo img { height: 88px; max-width: 340px; }
.auth-panel-top { display: flex; align-items: center; gap: 14px; }
.auth-panel-top span { font-size: 20px; font-weight: 600; color: #fff; letter-spacing: -.02em; }
.auth-panel h1 {
  color: #fff; font-size: 52px; line-height: 1.06; letter-spacing: -.035em;
  max-width: 12ch;
}
.auth-panel p {
  color: rgba(255, 255, 255, .58); font-size: 16px;
  max-width: 46ch; margin: 22px 0 0; line-height: 1.6;
}
/* The promise, then the detail: a bright lead line with the paragraph tucked under it. */
.auth-panel p.auth-lede {
  color: #fff; font-size: 20px; font-weight: 600; letter-spacing: -.015em;
  max-width: 30ch; line-height: 1.3;
}
.auth-panel p.auth-lede + p { margin-top: 12px; }
.auth-panel-foot { font-size: 13px; color: rgba(255, 255, 255, .34); margin: 0; }

.auth-form {
  display: flex; align-items: center; justify-content: center;
  padding: 40px 32px;
  background: linear-gradient(160deg, #f4f6f9 0%, #eaedf2 100%);
}
.auth-form-inner { width: 100%; max-width: 400px; }
.auth-form h1 { font-size: 34px; margin-bottom: 4px; }
.auth-form .lede { margin: 0 0 24px; font-size: 15px; }
.auth-form .card { padding: 26px; border-radius: var(--r-xl); box-shadow: var(--shadow); }
.auth-form .btn { width: 100%; padding: 14px; }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; min-height: 0; }
  .auth-panel { padding: 26px 24px 34px; gap: 26px; }
  .auth-panel h1 { font-size: 34px; max-width: none; }
  .auth-panel p { font-size: 15px; margin-top: 14px; }
  .auth-panel p.auth-lede { font-size: 18px; max-width: none; }
  .auth-panel-foot { display: none; }
  .auth-form { min-height: 70vh; }
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  body { font-size: 14.5px; }

  /* Two tight rows: identity + actions, then the nav scrolling sideways.
     The bar must stay wrappable so the nav can claim its own row. */
  .topbar-inner { padding: 9px 14px; gap: 8px; flex-wrap: wrap; }
  .brand { min-width: 0; flex: 0 1 auto; }
  .brand-mark { width: 40px; height: 40px; border-radius: 9px; font-size: 14px; }
  .brand-mark.has-logo { width: auto; height: auto; }
  .brand-mark.has-logo img { height: 38px; max-width: 170px; }
  .auth-panel .brand-mark.has-logo img { height: 64px; max-width: 240px; }
  .brand-text { min-width: 0; }
  .brand-text small { display: none; }
  .brand-text strong {
    font-size: 15px; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; max-width: 34vw;
  }
  .topbar-right { margin-left: auto; gap: 8px; flex: none; }
  .topbar-right .btn { padding: 8px 13px; font-size: 14px; }
  .whoami { display: none; }

  .nav {
    order: 3; flex: 1 0 100%; gap: 2px;
    overflow-x: auto; flex-wrap: nowrap;
    scrollbar-width: none; margin: 0 -14px; padding: 0 14px 2px;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 7px 12px; font-size: 14px; }

  .pagehead { gap: 14px; margin-bottom: 20px; }
  .pagehead .btn { padding: 8px 14px; font-size: 14px; }

  .wrap { padding: 22px 14px 60px; }
  h1 { font-size: 28px; }
  h2 { font-size: 18px; }
  .card { padding: 16px; border-radius: var(--r-lg); }
  .tiles { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; }
  .tile { padding: 15px 10px; }
  .tile .n { font-size: 26px; }
  .record-title { font-size: 17px; }
  th, td { padding: 11px 10px; }
}

/* ---------- Despatch note ---------- */

.notepage { max-width: 860px; }
.note { padding: 34px 38px; }
.note-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 20px; flex-wrap: wrap;
  border-bottom: 2px solid #10151c; padding-bottom: 16px; margin-bottom: 18px;
}
.note-brand { display: flex; align-items: center; gap: 14px; }
.note-org { font-size: 20px; font-weight: 700; letter-spacing: 0.02em; }
.note-title {
  font-size: 12px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--gold-dark, #8a6913);
}
.note-meta th {
  text-align: left; font-weight: 600; padding: 2px 14px 2px 0;
  border: 0; font-size: 13px; color: var(--muted, #667085); white-space: nowrap;
}
.note-meta td { padding: 2px 0; border: 0; font-size: 13px; }
.note-parties {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 18px;
}
.note-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted, #667085); margin-bottom: 4px;
}
.note-strong { font-weight: 600; }
.note-table { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.note-table th, .note-table td { border: 1px solid #c9ced6; padding: 8px 10px; font-size: 13px; }
.note-table th { background: #f2f4f7; text-align: left; }
.note-table td { height: 34px; }
.cbxcol { width: 110px; text-align: center; }
.cbx {
  display: inline-block; width: 16px; height: 16px;
  border: 1.5px solid #10151c; border-radius: 3px; vertical-align: middle;
}
.note-instruction { font-size: 13px; color: var(--muted, #667085); margin: 0 0 20px; }
.sigrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sigbox { border: 1px solid #c9ced6; border-radius: 8px; padding: 12px 14px 6px; }
.sigline {
  border-bottom: 1px solid #c9ced6; padding: 16px 0 4px;
  font-size: 12px; color: var(--muted, #667085);
}
.sigline:last-child { border-bottom: 0; }
.sigline span { color: inherit; font-weight: 600; }
@media (max-width: 640px) {
  .note { padding: 20px 16px; }
  .note-parties, .sigrid { grid-template-columns: 1fr; }
}

/* ---------- Print ---------- */

@media print {
  .topbar, .noprint { display: none !important; }
  body { background: #fff; font-size: 11px; }
  .wrap { padding: 0; max-width: none; }
  .card { box-shadow: none; border-color: #ddd; break-inside: avoid; padding: 12px; }
  h1 { font-size: 20px; }
  .tile { border-color: #ddd; }
}
