/* Journaut brand stylesheet
   Palette + layout primitives lifted from the SVG mockups
   (see Journaut Dashboard.svg etc. in the project workspace).
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

@font-face {
  font-family: 'Special Elite';
  src: url('/static/fonts/SpecialElite-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg:           #FAF8F3;  /* cream canvas */
  --surface:      #FFFFFF;
  --border:       #ECE7DD;  /* warm card border */
  --border-soft:  #F4F0E8;
  --ink:          #1A293F;  /* deep navy */
  --ink-2:        #2C3845;
  --muted:        #5C5A52;
  --muted-2:      #7A7367;
  --muted-3:      #A8A095;
  --brass:        #E9933E;  /* helmet brass */
  --brass-deep:   #B0701F;
  --brass-tint:   #FDF4E8;  /* active nav row + alert tint */
  --gold:         #C19A60;  /* wordmark colour */
  --teal:         #6C9296;
  --good:         #2E7D5B;
  --warn:         #C77B1F;
  --bad:          #B04437;
  --shadow-card:  0 1px 2px rgba(26,41,63,0.04);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); }
a.muted { color: var(--muted); }
a:hover { color: var(--brass-deep); }

button { font-family: inherit; }

/* ------------------------------------------------------------------ */
/* Layout shell                                                        */
/* ------------------------------------------------------------------ */

.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.sidebar .brand {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 4px 16px 4px;
}
.sidebar .brand img { height: 28px; width: auto; }

.workspace-pill {
  display: flex; align-items: center;
  width: 208px; height: 44px;
  padding: 0 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 24px;
  cursor: default;
  gap: 10px;
}
.workspace-pill .ws-mark {
  width: 24px; height: 24px;
  background: var(--ink);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 600; font-size: 11px;
  flex-shrink: 0;
}
.workspace-pill .ws-meta {
  display: flex; flex-direction: column;
  flex: 1; min-width: 0;
  line-height: 1.2;
}
.workspace-pill .ws-name {
  font-size: 13px; font-weight: 500; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.workspace-pill .ws-sub  { font-size: 11px; color: var(--muted-2); }
.workspace-pill .ws-chevron { flex-shrink: 0; }

.nav-group { margin-bottom: 18px; }
.nav-group .nav-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted-3);
  letter-spacing: 0.4px;
  margin: 0 0 6px 8px;
}

.nav-item {
  display: flex; align-items: center; gap: 12px;
  width: 208px; height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 400;
  text-decoration: none;
  position: relative;
  margin-bottom: 2px;
}
.nav-item .nav-icon {
  width: 16px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted-2);
  flex-shrink: 0;
}
.nav-item .nav-icon svg { display: block; }
.nav-item .nav-text {
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-item:hover { background: var(--bg); }
.nav-item:hover .nav-icon { color: var(--ink); }
.nav-item.active {
  background: var(--brass-tint);
  font-weight: 500;
  color: var(--ink);
}
.nav-item.active .nav-icon { color: var(--ink); }
.nav-item.active::before {
  content: '';
  position: absolute; left: -16px; top: 6px;
  width: 3px; height: 24px;
  background: var(--brass);
  border-radius: 1.5px;
}
.nav-item.nav-disabled {
  cursor: not-allowed;
  opacity: 0.6;
}
.nav-item.nav-disabled:hover { background: transparent; }
.nav-item.nav-sub-item {
  padding-left: 24px;
  height: 32px;
  font-size: 13px;
  color: var(--muted);
}
.nav-item.nav-sub-item .nav-icon { color: var(--muted-3); }
.nav-item.nav-sub-item.active { background: var(--brass-tint); color: var(--ink); }

.nav-item .nav-badge {
  margin-left: auto;
  min-width: 28px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600;
  border-radius: 8px;
  padding: 0 6px;
  background: var(--border-soft);
  color: var(--muted);
}
.nav-item .nav-badge.pending {
  background: var(--brass-tint);
  color: var(--brass-deep);
}

.user-pill {
  margin-top: auto;
  display: flex; align-items: center; gap: 10px;
  width: 208px; height: 60px;
  padding: 0 12px;
  background: var(--bg);
  border-radius: 10px;
}
.user-pill .avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  flex-shrink: 0;
}
.user-pill .user-meta { flex: 1; min-width: 0; line-height: 1.2; }
.user-pill .u-name {
  font-size: 13px; font-weight: 500; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-pill .u-sub  { font-size: 11px; color: var(--muted-2); }

/* ------------------------------------------------------------------ */
/* Main column                                                         */
/* ------------------------------------------------------------------ */

.main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: grid;
  grid-template-columns: 360px 1fr auto auto auto;
  gap: 16px;
  align-items: center;
  height: 72px;
}
.topbar .tb-title h1 {
  margin: 0; font-size: 20px; font-weight: 600;
  color: var(--ink); letter-spacing: -0.3px;
  line-height: 1;
}
.topbar .tb-status {
  margin-top: 6px;
  font-size: 12.5px; color: var(--muted-2);
  display: flex; align-items: center; gap: 6px;
}
.topbar .tb-status .dot {
  width: 7px; height: 7px; border-radius: 50%; display: inline-block;
}
.topbar .tb-status .dot.good { background: #16A34A; }
.topbar .tb-status .dot.bad  { background: #DC2626; }
.topbar .tb-status .dot.warn { background: var(--brass); }

.topbar .search {
  width: 100%; max-width: 440px;
  height: 40px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex; align-items: center;
  padding: 0 12px;
  color: var(--muted-3);
  font-size: 13px;
}
.topbar .search input {
  flex: 1; border: 0; background: transparent;
  font-size: 13px; color: var(--ink);
  font-family: inherit;
  margin-left: 8px;
}
.topbar .search input:focus { outline: none; }
.topbar .search input::placeholder { color: var(--muted-3); }
.topbar .search .kbd {
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: white;
  color: var(--muted-2);
  font-size: 10.5px; font-weight: 500;
  margin-left: 8px;
}

.topbar .icon-btn {
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-2);
  cursor: pointer;
  position: relative;
  text-decoration: none;
}
.topbar .icon-btn:hover { background: var(--bg); }
.topbar .icon-btn .alert-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--brass);
}

.topbar .top-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--ink);
  color: white; font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}

.content {
  padding: 24px 32px 64px 32px;
  flex: 1;
  max-width: 1208px;
  width: 100%;
}

.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 16px;
}
.page-header .h-title h1 {
  margin: 0 0 4px 0;
  font-size: 22px; font-weight: 600; color: var(--ink);
  letter-spacing: -0.2px;
}
.page-header .h-title .subtitle {
  font-size: 13px; color: var(--muted-2);
}
.page-header .h-actions { display: flex; gap: 8px; }

/* ------------------------------------------------------------------ */
/* Cards + sections                                                    */
/* ------------------------------------------------------------------ */

/* Card system — three patterns matching the dashboard mockups
     .card           default 20px padding all around (simple body)
     .card.flush     no padding; for cards that contain a table or
                     a pre-padded card-body / card-head / card-foot
     .card .card-head    18px 20px (top/sides) + 12-16px bottom
     .card .card-body    20px sides; rule above provides the bottom border
     .card .card-foot    14px 20px on bottom

   Cards always have border-radius 12px to match the SVG mockups. */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-card);
}
.card.flush { padding: 0; }
.card + .card { margin-top: 16px; }

.card .card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 12px 20px;
}
.card.flush > .card-head:not(:last-child) {
  border-bottom: 1px solid var(--border);
}
.card .card-head .card-titles { line-height: 1.35; }
.card .card-head .card-h {
  font-size: 15px; font-weight: 600; color: var(--ink);
  margin: 0;
}
.card .card-head .card-sub {
  font-size: 12px; color: var(--muted-2); margin-top: 2px;
}
.card .card-head .card-actions {
  display: flex; gap: 8px; align-items: center;
}

.card .card-body { padding: 20px; }
.card .card-body.flush-x { padding-left: 0; padding-right: 0; }
.card .card-body.tight { padding: 12px 20px; }

.card .card-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border-soft);
  font-size: 12px; color: var(--muted-2);
  display: flex; align-items: center; justify-content: space-between;
}

/* Legacy .card-title (uppercase eyebrow) — used in non-mockup cards */
.card .card-title {
  font-size: 13px; font-weight: 600; color: var(--muted);
  letter-spacing: 0.4px; text-transform: uppercase;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* KPI cards exactly as the dashboard SVG: 124px tall, label/big number/
   delta pill row/footnote, with optional inline sparkline. */
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  height: 124px;
  position: relative;
  overflow: hidden;
}
.kpi-card .kpi-label {
  font-size: 12.5px; color: var(--muted-2);
  margin-bottom: 4px;
}
.kpi-card .kpi-value {
  font-size: 28px; font-weight: 600; color: var(--ink);
  letter-spacing: -0.4px; line-height: 1.1;
  margin-bottom: 8px;
}
.kpi-card .kpi-value.bad  { color: #DC2626; }
.kpi-card .kpi-value.good { color: #16A34A; }
.kpi-card .kpi-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
}
.kpi-card .kpi-row .pill {
  padding: 3px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 600;
  background: var(--border-soft); color: var(--muted);
  display: inline-flex; align-items: center; gap: 2px;
}
.kpi-card .kpi-row .pill.up   { background: #ECFDF5; color: #047857; }
.kpi-card .kpi-row .pill.down { background: #FCEEEC; color: #B91C1C; }
.kpi-card .kpi-row .pill.flat { background: var(--border-soft); color: var(--muted); }
.kpi-card .kpi-row .delta-sub { font-size: 11.5px; color: var(--muted-2); }
.kpi-card .kpi-foot {
  font-size: 11px; color: var(--muted-3);
}
.kpi-card .sparkline {
  position: absolute; right: 12px; top: 70px;
  width: 140px; height: 48px;
}

/* legacy .kpi for any older callers — keep working */
.kpi { padding: 4px 0; }
.kpi .kpi-label {
  font-size: 11px; color: var(--muted-2);
  letter-spacing: 0.4px; text-transform: uppercase;
  margin-bottom: 6px;
}
.kpi .kpi-value {
  font-size: 28px; font-weight: 600; color: var(--ink);
  letter-spacing: -0.4px; line-height: 1;
}
.kpi .kpi-sub { margin-top: 6px; font-size: 12px; color: var(--muted-2); }
.kpi .kpi-value.good { color: var(--good); }
.kpi .kpi-value.bad  { color: var(--bad); }

/* ------------------------------------------------------------------ */
/* Asset icon (coloured circle with letter)                            */
/* ------------------------------------------------------------------ */
.asset-icon {
  width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: white; font-size: 13px; font-weight: 700;
  flex-shrink: 0;
}
.asset-icon.lg { width: 40px; height: 40px; font-size: 15px; }

/* ------------------------------------------------------------------ */
/* Dashboard 60/40 row                                                 */
/* ------------------------------------------------------------------ */
.dash-row {
  display: grid;
  grid-template-columns: minmax(0, 1.76fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.dash-rail { display: flex; flex-direction: column; }
@media (max-width: 1200px) {
  .dash-row { grid-template-columns: 1fr; }
}

/* Inline table row text helpers (not all rows are tabular numbers) */
.row-name { font-size: 13.5px; font-weight: 500; color: var(--ink); line-height: 1.3; }
.row-sub  { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; }

/* Warn-tinted card foot for "no live price" callouts */
.card-foot.warn-foot { color: var(--brass-deep); }

/* Section eyebrow above grouped cards (Connections / Mappings / Settings) */
.section-head {
  margin: 24px 0 12px 0;
}
.section-head:first-child { margin-top: 0; }
.section-head .section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-2);
  letter-spacing: 0.6px;
}
.section-head .section-sub {
  font-size: 12.5px;
  color: var(--muted-2);
  margin-top: 2px;
}

/* Connection card row (Kraken / Xero) — left mark + body grid */
.conn-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 16px;
  padding: 20px;
}
.conn-mark {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.conn-body { min-width: 0; }
.conn-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}
.conn-eyebrow {
  font-size: 10.5px; font-weight: 600;
  color: var(--muted-2); letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.conn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 16px 0;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}
.conn-dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.conn-dl dt { color: var(--muted-2); font-size: 12px; }
.conn-dl dd { margin: 0; color: var(--ink); font-size: 12.5px; font-weight: 500; }
.conn-actions { padding-top: 14px; display: flex; gap: 8px; }

/* Mappings page rows */
.map-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 2.2fr) minmax(0, 1fr) auto;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 20px;
}
.map-row + .map-row { border-top: 1px solid var(--border-soft); }
.map-row .map-label .row-sub { margin-top: 4px; }
.map-state .row-sub { font-size: 11px; }
.map-actions { align-self: center; }

/* Settings page rows */
.settings-row {
  display: grid;
  grid-template-columns: 240px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px 20px;
}
.settings-row + .settings-row { border-top: 1px solid var(--border-soft); }
.settings-row .set-label {
  font-size: 12.5px;
  color: var(--muted);
}
.settings-row .set-label .row-name {
  font-size: 13px; color: var(--ink); font-weight: 500;
}
.settings-row .set-value {
  font-size: 13px; color: var(--ink); font-weight: 500;
}
.settings-row .set-value.mono {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12.5px;
}
.settings-row .set-actions { display: flex; gap: 8px; }

/* Chart legend dots in card-head */
.card-head .legend-dot {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 2px;
  margin-left: 4px; margin-right: 4px;
}
.card-head .legend-dot.brass { background: var(--brass); }
.card-head .legend-dot.loss  { background: #DC2626; }
.card-head .legend-text { font-size: 11px; color: var(--ink-2); }

/* ------------------------------------------------------------------ */
/* Outputs ready row                                                   */
/* ------------------------------------------------------------------ */
.output-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0;
}
.output-row + .output-row { border-top: 1px solid var(--border-soft); }
.output-row .out-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  color: white; font-size: 16px;
  flex-shrink: 0;
}
.output-row .out-icon.brass { background: var(--brass); }
.output-row .out-icon.ink   { background: var(--ink); }
.output-row .out-meta { flex: 1; min-width: 0; }
.output-row .out-meta .out-title {
  font-size: 13.5px; font-weight: 500; color: var(--ink);
}
.output-row .out-meta .out-sub {
  font-size: 11.5px; color: var(--muted-2);
  margin-top: 2px;
}

/* ------------------------------------------------------------------ */
/* Cadence card 2-col                                                  */
/* ------------------------------------------------------------------ */
.cadence-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 8px;
}
.cadence-grid .cadence-item .c-label {
  font-size: 12px; color: var(--muted-2); margin-bottom: 4px;
  display: flex; align-items: center; gap: 8px;
}
.cadence-grid .cadence-item .c-value {
  font-size: 13px; font-weight: 500; color: var(--ink);
  padding-left: 22px;
}

/* ------------------------------------------------------------------ */
/* 12-month gains chart                                                */
/* ------------------------------------------------------------------ */
.gains-chart { width: 100%; height: 180px; }
.gains-chart .grid { stroke: var(--border-soft); stroke-dasharray: 3 4; }
.gains-chart .axis { stroke: var(--border); }
.gains-chart .ylabel { fill: var(--muted-3); font-size: 10.5px; }
.gains-chart .xlabel { fill: var(--muted-2); font-size: 11px; }
.gains-chart .yrlabel { fill: var(--muted-3); font-size: 10px; font-weight: 500; letter-spacing: 0.4px; }
.gains-chart .ysep { stroke: var(--border-soft); stroke-dasharray: 2 3; }
.gains-chart .bar.gain { fill: var(--brass); }
.gains-chart .bar.loss { fill: #DC2626; }
.gains-chart .bar.latest-ring { stroke: var(--ink); stroke-width: 1.5; fill: none; }
.gains-chart .annotation { fill: var(--ink); font-size: 11px; font-weight: 500; }

/* ------------------------------------------------------------------ */
/* Buttons                                                             */
/* ------------------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px; font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--bg); }
.btn[disabled], .btn.disabled {
  background: var(--border-soft);
  color: var(--muted-3);
  cursor: not-allowed;
}
.btn.primary {
  background: var(--ink); color: white; border-color: var(--ink);
}
.btn.primary:hover { background: #0F1B2C; }
.btn.brass {
  background: var(--brass); color: white; border-color: var(--brass);
}
.btn.brass:hover { background: var(--brass-deep); }
.btn.danger { color: var(--bad); border-color: #E5C4BF; }
.btn.danger:hover { background: #FBEDEA; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ */
/* Status badges                                                       */
/* ------------------------------------------------------------------ */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.2px;
  background: var(--border-soft); color: var(--muted);
}
.badge.good   { background: #E4F2EB; color: var(--good); }
.badge.warn   { background: var(--brass-tint); color: var(--brass-deep); }
.badge.bad    { background: #F8E2DD; color: var(--bad); }
.badge.muted  { background: var(--border-soft); color: var(--muted-2); }
.badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

/* ------------------------------------------------------------------ */
/* Tables                                                              */
/* ------------------------------------------------------------------ */

.table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 13px;
}
.table thead th {
  text-align: left;
  font-size: 11px; font-weight: 600;
  color: var(--muted-2);
  letter-spacing: 0.4px; text-transform: uppercase;
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  background: transparent;
}
.table thead th:first-child { padding-left: 20px; }
.table thead th:last-child  { padding-right: 20px; }
.table tbody td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--ink-2);
  vertical-align: middle;
}
.table tbody td:first-child { padding-left: 20px; }
.table tbody td:last-child  { padding-right: 20px; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--bg); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .mono { font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 12px; }

/* ------------------------------------------------------------------ */
/* Forms                                                               */
/* ------------------------------------------------------------------ */

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 12px; font-weight: 500; color: var(--muted);
  margin-bottom: 4px;
  letter-spacing: 0.2px;
}
.field input, .field select, .field textarea {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-family: inherit; font-size: 13px;
  color: var(--ink);
}
.field textarea { height: auto; padding: 10px 12px; min-height: 80px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(233,147,62,0.15);
}
.field .hint { margin-top: 4px; font-size: 11px; color: var(--muted-2); }

/* ------------------------------------------------------------------ */
/* Flash / alerts                                                      */
/* ------------------------------------------------------------------ */

.flash-stack { margin-bottom: 16px; }
.flash {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  border: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: 8px;
}
.flash.success { background: #E4F2EB; border-color: #BFDFCD; color: var(--good); }
.flash.warn    { background: var(--brass-tint); border-color: #F2D9B0; color: var(--brass-deep); }
.flash.error   { background: #F8E2DD; border-color: #E5C4BF; color: var(--bad); }

/* ------------------------------------------------------------------ */
/* Auth pages (centered card)                                           */
/* ------------------------------------------------------------------ */

.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  padding: 32px 16px;
}
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px;
  box-shadow: var(--shadow-card);
}
.auth-card .auth-brand {
  display: flex; justify-content: center; margin-bottom: 24px;
}
.auth-card .auth-brand img { height: 40px; width: auto; }
.auth-card h1 {
  font-size: 18px; font-weight: 600;
  margin: 0 0 4px 0; text-align: center;
}
.auth-card .auth-sub {
  text-align: center; color: var(--muted-2);
  font-size: 13px; margin-bottom: 24px;
}
.auth-card .auth-actions {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 20px; font-size: 12px;
}

/* ------------------------------------------------------------------ */
/* Helpers                                                             */
/* ------------------------------------------------------------------ */

.muted { color: var(--muted-2); }
.mono  { font-family: 'SF Mono', Menlo, Consolas, monospace; }
.num   { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.row   { display: flex; gap: 12px; align-items: center; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-16 { gap: 16px; }
.mt-8   { margin-top: 8px; }
.mt-16  { margin-top: 16px; }
.mt-24  { margin-top: 24px; }
.mb-8   { margin-bottom: 8px; }
.mb-16  { margin-bottom: 16px; }

.empty {
  padding: 32px;
  text-align: center;
  color: var(--muted-2);
  font-size: 13px;
}
.empty strong { color: var(--ink); }

.divider {
  height: 1px; background: var(--border-soft);
  margin: 16px -20px;
}

details summary {
  cursor: pointer;
  font-size: 13px; color: var(--muted);
  padding: 8px 0;
}
details summary:hover { color: var(--brass-deep); }
details[open] summary { color: var(--ink); }
