/* Cool Car Rentals — internal ops UI.
   Dense and legible: this replaces a spreadsheet people read all day. */

:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --ink: #16191d;
  --ink-2: #5a626e;
  --ink-3: #8b93a1;
  --line: #dfe3e9;
  --line-2: #eef0f4;
  --accent: #12603f;
  --accent-soft: #e6f2ec;
  --warn: #9a5b00;
  --warn-soft: #fdf1de;
  --danger: #a12525;
  --danger-soft: #fbeaea;
  --ok: #1c6b3f;
  --accent-hover: #0e4f34;
  /* Surfaces that repeat across tables and the top bar. They are tokens so a
     palette can be swapped per page — see .sheet-theme below. */
  --head-bg: #fafbfc;
  --head-ink: var(--ink-3);
  --row-hover: #fafbfc;
  --chip-bg: #eef2f7;
  --chip-ink: #3d4a5a;
  --bar: var(--accent-soft);
  --topbar-bg: #10161d;
  --topbar-hover: #1c252f;
  --topbar-active: #22303d;
  --topbar-ink: #e9edf2;
  --topbar-ink-soft: #cdd6e0;
  --topbar-ink-2: #aeb8c4;
  --topbar-ink-3: #8b97a6;
  --topbar-line: #2c3945;
  --radius: 6px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* The workbook's own colours, read out of ccr.xlsm's Office 2013-2022 theme
   and the `Car Reservation` sheet: dk2 #44546A is the frozen header row (the
   sheet fills it "Darker 50%", #222A35, white text), lt2 #E7E6E6 the data
   band, accent1 #4472C4, accent6 #70AD47, accent2 #ED7D31, and the sheet's
   own #C00000 for the red. Text shades are the sheet's Darker 25/50% steps so
   they stay legible on white. Scoped to the dashboard; move the declarations
   into :root to theme the whole app. */
.sheet-theme {
  --bg: #f2f2f2;              /* the F2F2F2 fill the sheet uses behind data */
  --panel: #ffffff;
  --ink: #222a35;             /* dk2 Darker 50% */
  --ink-2: #44546a;           /* dk2 — the sheet's body text */
  --ink-3: #7b8494;
  --line: #d3d6dd;
  --line-2: #e7e6e6;          /* lt2 */
  --accent: #2f5597;          /* accent1 Darker 25% */
  --accent-hover: #203864;    /* accent1 Darker 50% */
  --accent-soft: #d9e2f3;     /* accent1 Lighter 80% */
  --ok: #385723;              /* accent6 Darker 50% */
  --warn: #833c0c;            /* accent2 Darker 50% */
  --warn-soft: #fbe5d6;       /* accent2 Lighter 80% */
  --danger: #c00000;
  --danger-soft: #f6dcdc;
  --head-bg: #222a35;
  --head-ink: #ffffff;
  --row-hover: #f4f5f7;
  --chip-bg: #d9e2f3;
  --chip-ink: #2f5597;
  --bar: #8faadc;             /* accent1 Lighter 40% */
  --topbar-bg: #222a35;
  --topbar-hover: #334054;
  --topbar-active: #44546a;
  --topbar-ink: #ffffff;
  --topbar-ink-soft: #dbe0e8;
  --topbar-ink-2: #bcc4d1;
  --topbar-ink-3: #98a2b3;
  --topbar-line: #44546a;
}
/* Header row dark, data band grey — the sheet's frozen panes. */
.sheet-theme thead th { border-bottom-color: var(--head-bg); }
.sheet-theme tfoot td { background: var(--line-2); }
.sheet-theme .panel-head {
  background: var(--line-2); border-bottom-color: var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
}
/* The plain badge shares lt2 with the panel head it usually sits in. */
.sheet-theme .panel-head .badge { background: var(--panel); color: var(--ink-2); }

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
}

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

h1 { font-size: 20px; margin: 0 0 2px; letter-spacing: -0.01em; }
h2 { font-size: 15px; margin: 0 0 10px; letter-spacing: -0.005em; }
h3 { font-size: 13px; margin: 0 0 8px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }

/* ---------------------------------------------------------------- chrome */

.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 0 20px; height: 52px;
  background: var(--topbar-bg); color: var(--topbar-ink);
  position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: baseline; gap: 8px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-mark { font-weight: 700; letter-spacing: 0.08em; font-size: 15px; }
.brand-sub { font-size: 11px; color: var(--topbar-ink-3); letter-spacing: 0.04em; }

.mainnav { display: flex; gap: 2px; margin-inline-end: auto; flex-wrap: wrap; }
.mainnav a {
  color: var(--topbar-ink-2); padding: 6px 11px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
}
.mainnav a:hover { background: var(--topbar-hover); color: #fff; text-decoration: none; }
.mainnav a.on { background: var(--topbar-active); color: #fff; }

.userbox { display: flex; align-items: center; gap: 10px; }
.who { color: var(--topbar-ink-soft); font-size: 13px; display: flex; align-items: center; gap: 7px; }
.role {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em;
  background: var(--topbar-active); color: var(--topbar-ink-2); padding: 2px 6px; border-radius: 3px;
}

.page { max-width: 1560px; margin: 0 auto; padding: 20px; }
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 16px; flex-wrap: wrap;
}
.page-head .sub { color: var(--ink-2); font-size: 13px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.flash {
  padding: 9px 20px; font-size: 13px; border-bottom: 1px solid var(--line);
}
.flash-success { background: var(--accent-soft); color: var(--accent); }
.flash-error { background: var(--danger-soft); color: var(--danger); }

/* ---------------------------------------------------------------- panels */

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 16px;
}
.panel-head {
  padding: 11px 14px; border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.panel-head h2 { margin: 0; }
.panel-head-actions { display: flex; align-items: center; gap: 10px; }
.panel-body { padding: 14px; }
.panel-body.tight { padding: 0; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px; }
.stat .k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-3); }
.stat .v { font-size: 25px; font-weight: 600; letter-spacing: -0.02em; margin-top: 3px; }
.stat .n { font-size: 12px; color: var(--ink-2); }

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

table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--head-ink); font-weight: 600; padding: 8px 10px;
  border-bottom: 1px solid var(--line); background: var(--head-bg);
  /* Sticks to the top of its own scroll container, not the viewport — the
     wrapper's overflow is what these tables scroll inside. */
  position: sticky; top: 0; z-index: 5; white-space: nowrap;
}
thead th a { color: inherit; }
tbody td { padding: 7px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
tbody tr:hover { background: var(--row-hover); }
tfoot td {
  padding: 9px 10px; border-top: 2px solid var(--line); font-weight: 600; background: var(--head-bg);
  position: sticky; bottom: 0; z-index: 4;
}
.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
/* Long lists scroll inside the panel with the header frozen, the way the
   spreadsheet's frozen panes worked. */
.table-scroll { overflow: auto; max-height: 72vh; }
.table-scroll.short { max-height: none; }

/* ---------------------------------------------------------------- badges */

.badge {
  display: inline-block; padding: 2px 7px; border-radius: 10px;
  font-size: 11px; font-weight: 500; white-space: nowrap;
  background: var(--line-2); color: var(--ink-2);
}
.badge-open { background: var(--accent-soft); color: var(--accent); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-dead { background: #eef0f4; color: var(--ink-3); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }

.pill-dir {
  font-family: var(--mono); font-size: 11px; background: var(--chip-bg);
  color: var(--chip-ink); padding: 1px 6px; border-radius: 3px;
}
/* Column J's fills, in the sheet's own hues. A-C keeps the plain chip because
   the sheet leaves it unfilled — it is the default leg, 82 of 167 rows. The
   inks are darkened from each fill so the text stays readable at 11px. */
.pill-dir[data-dir="C-A"] { background: #ff66ff; color: #4a1147; }
.pill-dir[data-dir="C-C"] { background: #dcb9ff; color: #3d2159; }
.pill-dir[data-dir="A-A"] { background: #00b0f0; color: #06364a; }

/* ------------------------------------------- sheet conditional formatting */

/* Column I (Total Days), the two live rules on the sheet. Under 45 days is the
   sheet's #00B050; over 90 is Excel's stock "Yellow fill, dark yellow text".
   The fill covers the whole cell, as it does in the workbook. */
.cf-days-short { background: #00b050; color: #06310f; font-weight: 600; }
.cf-days-long { background: #ffeb9c; color: #9c6500; font-weight: 600; }
tbody tr:hover .cf-days-short, tbody tr:hover .cf-days-long { filter: brightness(0.97); }

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

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: var(--radius);
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-size: 13px; font-weight: 500; font-family: inherit;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { background: #f6f7f9; text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { color: var(--danger); border-color: #e8c9c9; }
.btn-danger:hover { background: var(--danger-soft); }
/* A disabled button that looks pressable is a lie the operator finds out about
   by clicking. The first buttons to need this are the payment messages on a
   booking with no payment link. */
.btn:disabled, .btn[disabled] {
  opacity: .45; cursor: not-allowed; background: var(--line-2); border-color: var(--line);
  color: var(--ink-3);
}
.btn-primary:disabled, .btn-primary[disabled] { background: var(--line-2); color: var(--ink-3); }
.btn-quiet { background: transparent; border-color: var(--topbar-line); color: var(--topbar-ink-soft); }
.btn-quiet:hover { background: var(--topbar-active); }
.btn-sm { padding: 4px 9px; font-size: 12px; }

label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 7px 9px; font-size: 13px; font-family: inherit;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent-soft); outline-offset: -1px; border-color: var(--accent);
}
textarea { min-height: 70px; resize: vertical; }
.field { margin-bottom: 12px; }
.field .hint { font-size: 11px; color: var(--ink-3); margin-top: 3px; font-weight: 400; }
.field-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

.filters {
  display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap;
  padding: 12px 14px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px;
}
.filters .field { margin: 0; min-width: 130px; }
.filters label { margin-bottom: 3px; }

/* Multi-select filter (status): a listbox rather than a dropdown, so the
   selected set is visible without opening it. */
.filters .field-multi { min-width: 210px; }
.filters .field-multi select[multiple] {
  height: auto; padding: 4px; overflow-y: auto;
}
.filters .field-multi select[multiple] option { padding: 2px 4px; border-radius: 3px; }
.filters .field-multi .hint { display: block; margin-top: 3px; }

.errors {
  background: var(--danger-soft); border: 1px solid #edcaca; color: var(--danger);
  border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; font-size: 13px;
}
.errors ul { margin: 4px 0 0; padding-inline-start: 18px; }

.warnbox {
  background: var(--warn-soft); border: 1px solid #f0dcbb; color: var(--warn);
  border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; font-size: 13px;
}

/* ---------------------------------------------------------------- login */

.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--topbar-bg); padding: 20px;
}
.login-card {
  background: #fff; border-radius: 10px; padding: 30px; width: 100%; max-width: 370px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}
.login-card .brand-mark { color: var(--ink); font-size: 21px; letter-spacing: 0.1em; }
.login-card .brand-sub { display: block; color: var(--ink-3); margin: 3px 0 22px; font-size: 12px; }

/* ---------------------------------------------------------------- pricing box */

.pricelines { width: 100%; font-size: 13px; }
.pricelines td { padding: 5px 0; border-bottom: 1px solid var(--line-2); }
.pricelines td:last-child { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.pricelines tr.total td { border-top: 2px solid var(--line); border-bottom: none; font-weight: 700; font-size: 15px; padding-top: 9px; }
.pricelines tr.sub td { color: var(--ink-2); }

.monthbars { display: flex; gap: 3px; align-items: flex-end; height: 60px; margin-top: 8px; }
.monthbar { flex: 1; background: var(--bar); border-radius: 2px 2px 0 0; position: relative; min-height: 2px; }
.monthbar span { position: absolute; bottom: -16px; left: 0; right: 0; text-align: center; font-size: 9px; color: var(--ink-3); }

/* ---------------------------------------------------------------- availability grid */

.avail-wrap { overflow: auto; max-height: 74vh; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table.avail { border-collapse: separate; border-spacing: 0; font-size: 11px; }
table.avail th, table.avail td { border-bottom: 1px solid var(--line-2); padding: 0; }
table.avail thead th { position: sticky; top: 0; z-index: 6; background: #fafbfc; padding: 3px 2px; text-align: center; font-size: 10px; }
table.avail th.carcol, table.avail td.carcol {
  position: sticky; left: 0; z-index: 4; background: #fff;
  min-width: 168px; padding: 4px 9px; text-align: left; border-inline-end: 1px solid var(--line);
}
table.avail thead th.carcol { z-index: 7; background: #fafbfc; }
table.avail tbody tr:hover td.carcol { background: #f6f7f9; }
.daycell { width: 21px; height: 25px; text-align: center; }
.daycell .box { display: block; width: 100%; height: 100%; }
.d-free .box { background: #fff; }
.d-booked .box { background: #bcdcc9; }
.d-clash .box { background: #e0a3a3; }
.d-weekend { background: #fbfbfc; }
.d-monthstart { border-inline-start: 2px solid #c8cfd8; }
.legend { display: flex; gap: 16px; align-items: center; font-size: 12px; color: var(--ink-2); margin-bottom: 10px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 13px; height: 13px; border-radius: 2px; margin-inline-end: 5px; vertical-align: -2px; border: 1px solid var(--line); }

/* ---------------------------------------------------------------- rate card */

table.rates input[type=number] { width: 62px; padding: 4px 5px; font-size: 12px; text-align: right; font-family: var(--mono); }
table.rates td, table.rates th { padding: 5px 4px; }

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

.kv { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 5px 14px; font-size: 13px; }
.kv dt { color: var(--ink-3); font-size: 12px; }
.kv dd { margin: 0; }

.doc-actions { display: flex; gap: 7px; flex-wrap: wrap; }

/* One row per customer email: what it is, and the two things you can do with
   it. A flat button row was tried first and read as a wall of verbs — the
   name of the message is the thing being chosen, so it leads. */
.email-templates { margin-top: 4px; }
.email-templates td { padding: 6px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.email-templates tr:last-child td { border-bottom: 0; }
.email-templates td.num { text-align: right; }
.email-templates button + button { margin-left: 6px; }

.attach-picks { display: flex; gap: 14px; flex-wrap: wrap; padding-top: 2px; }
.attach-picks .pick { display: flex; align-items: center; gap: 5px; margin: 0; font-weight: 400; }
.attach-picks input { width: auto; }

.pager { display: flex; gap: 6px; align-items: center; justify-content: center; margin-top: 14px; font-size: 13px; }
.pager a, .pager span { padding: 5px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.pager .on { background: var(--accent); border-color: var(--accent); color: #fff; }

.empty { padding: 26px; text-align: center; color: var(--ink-3); font-size: 13px; }

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

.doc {
  background: #fff; max-width: 800px; margin: 20px auto; padding: 40px 46px;
  border: 1px solid var(--line); border-radius: var(--radius); font-size: 13px; line-height: 1.55;
}
.doc[dir="rtl"] { direction: rtl; text-align: right; }
.doc h1 { font-size: 22px; margin-bottom: 4px; }
.doc h2 { font-size: 15px; margin: 22px 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.doc-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.doc-header .co { font-size: 12px; color: var(--ink-2); line-height: 1.6; }
.doc table { font-size: 12.5px; margin: 8px 0; }
.doc table td, .doc table th { padding: 6px 8px; border-bottom: 1px solid var(--line-2); }
.doc .terms { font-size: 11.5px; color: #3c434d; }
.doc .terms p { margin: 0 0 7px; }
.doc .fineprint { font-size: 11px; color: var(--ink-2); }
.doc .sigline { margin-top: 30px; display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.doc .sigline div { border-top: 1px solid var(--ink-3); padding-top: 5px; font-size: 11.5px; color: var(--ink-2); }
.doc .totalrow td { font-weight: 700; font-size: 14px; border-top: 2px solid var(--ink); border-bottom: none; }
.docbar {
  max-width: 800px; margin: 16px auto 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}

@media print {
  .topbar, .docbar, .flash, .no-print { display: none !important; }
  body { background: #fff; font-size: 11.5pt; }
  .doc { border: none; margin: 0; padding: 0; max-width: none; border-radius: 0; }
  .doc h2 { break-after: avoid; }
  table { break-inside: auto; }
  tr { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}

@media (max-width: 760px) {
  .topbar { height: auto; padding: 10px 14px; flex-wrap: wrap; gap: 10px; }
  thead th { position: static; }
  .page { padding: 14px; }
}

/* ---------------------------------------------------------------- payments */

/* Settlement colours for the payment grid. These are the workbook's own palette
   rather than the generic badge set, because the three states mean specific
   things: blue "nothing yet", green "settled", amber "a human needs to look".
   They are computed from the derived ledger total — see lib/payments.js. */
.badge.pay-blue  { background: var(--accent-soft); color: var(--accent); }
.badge.pay-green { background: #e4efd9; color: #385723; }
.badge.pay-amber { background: var(--warn-soft); color: var(--warn); }

/* A payment reference is read aloud, retyped into a bank's reference field and
   compared by eye against a statement line, so it is monospaced and spaced out
   wherever it appears. */
.mono-ref {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.06em; font-weight: 600;
}

/* ---------------------------------------------------------------- settings */

/* A heading that sits between panels rather than inside one, so the page reads
   as two halves: what a person may change, and what only the server knows. */
.section-head {
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--ink-3); margin: 22px 0 10px;
}
.section-head:first-of-type { margin-top: 0; }

.conn .panel-head h2 { font-size: 14px; }
.conn-blurb { margin: 0 0 12px; line-height: 1.5; }

/* Wide enough that the longest variable name — VERIFONE_WEBHOOK_SIGNATURE_HEADER
   — fits on one line. Nothing here is scannable once a name wraps mid-word. */
.grid-conn { grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); }

/* Environment variables, one per row: name on the left, what may be shown of
   the value on the right. Never the value itself for anything secret — see
   lib/settings.js. */
.conn-vars { font-size: 12px; table-layout: fixed; }
.conn-vars td { border-bottom: 1px solid var(--line-2); padding: 6px 0; vertical-align: top; }
.conn-vars tr:last-child td { border-bottom: none; }
.conn-vars tr:hover { background: transparent; }
.conn-var { width: 60%; }
.conn-var code { font-family: var(--mono); font-size: 11px; color: var(--ink-2); overflow-wrap: anywhere; }
.conn-var .req { color: var(--danger); font-weight: 600; }
.conn-var .hint { font-size: 11px; color: var(--ink-3); margin-top: 2px; line-height: 1.4; }
.conn-val { text-align: right; overflow-wrap: anywhere; }
.conn-val .mono { font-family: var(--mono); font-size: 11.5px; }

.conn-endpoints {
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-2);
  display: grid; gap: 4px;
}
.conn-endpoints code { font-family: var(--mono); font-size: 11.5px; word-break: break-all; }
.conn-testnote { margin-top: 10px; line-height: 1.45; }
.conn-sched {
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-2);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.conn-sched .hint { flex-basis: 100%; margin: 0; }

/* The editable panels. Wider minimum than the booking form's: these labels are
   sentences ("Short-rental threshold"), not the sheet's one-word columns. */
.settings-fields { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); align-items: start; }
.settings-fields .field-wide { grid-column: 1 / -1; }
.settings-fields .settings-sub {
  grid-column: 1 / -1; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-3);
  border-top: 1px solid var(--line-2); padding-top: 10px; margin-top: 2px;
}
.settings-fields label .unit { font-weight: 400; color: var(--ink-3); }
/* The stored key, under each input. Someone reading .env or a SQL dump needs to
   map a label back to the row it writes. */
.settings-fields .keyname code { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
.checkline { display: flex; align-items: center; gap: 7px; font-weight: 400; font-size: 13px; color: var(--ink); }
.checkline input { width: auto; }

/* Where a credential came from — database override, .env, or neither. On the
   screen because "I typed a key and nothing changed" has one cause worth ruling
   out before any other, and that is precedence. */
.src {
  display: inline-block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 1px 5px; border-radius: 3px; margin-top: 3px;
}
.src-database { background: var(--accent-soft); color: var(--accent); }
.src-environment { background: var(--chip-bg); color: var(--chip-ink); }
.src-unset { background: #eef0f4; color: var(--ink-3); }

/* The editing row under each credential. Blank means unchanged, so the
   placeholder has to say so — an empty box next to a working payment rail
   otherwise reads as "not set". */
.conn-edit td { padding: 0 0 10px; border-bottom: 1px solid var(--line-2); }
.conn-edit input[type=text], .conn-edit input[type=password] { font-size: 12px; padding: 5px 8px; }
.conn-edit .checkline { margin-top: 4px; color: var(--ink-2); }
.conn-vars tr.is-managed td { border-bottom: none; padding-bottom: 3px; }
.conn-save { margin-top: 12px; }
.src-default { background: var(--line-2); color: var(--ink-3); }
