/* ============================================================
   BUDDS Reporting — design tokens
   Palette, type, and logo pulled directly from budds.com's own CSS
   and markup (see CLAUDE.md "Design system" for the exact source
   values and how they were extracted) - this is BUDDS' real visual
   identity, adapted for a data-dense internal tool rather than a
   photography-led marketing site. Dark structural chrome (sidebar)
   holding a clean white working canvas (forms, tables, content),
   with BUDDS' real coral-red as the single accent.
   ============================================================ */

:root {
  /* Ink — structural chrome: sidebar, masthead, login.
     #111111 is BUDDS' own navbar background value, exactly. */
  --ink: #111111;
  --ink-raised: #1D1D1D;
  --ink-line: #2A2A2A;
  --ink-text: #F2F2F2;
  --ink-text-muted: #9A9A9A;

  /* Paper — working surfaces: forms, tables, content.
     BUDDS' own page is a flat #FFFFFF; --paper is nudged to #FAFAFA
     so raised surfaces (inputs, cards) can sit visibly on top of it
     at --paper-raised: #FFFFFF - a data-entry-heavy tool needs a bit
     more structure than a flat marketing page does. */
  --paper: #FAFAFA;
  --paper-raised: #FFFFFF;
  --paper-line: #E6E6E6;
  --paper-text: #111111;
  --paper-text-muted: #6B6B6B;

  /* Accent — BUDDS' real button/highlight coral-red (#FE4F4C, taken
     directly from their CSS, used 100+ times site-wide). Used for
     action, emphasis, focus. */
  --accent: #FE4F4C;
  --accent-strong: #D84341;
  --accent-tint: #FFEAEA;

  /* Reserved, narrow-use signal colors - not sourced from BUDDS'
     marketing site (it doesn't need a "destructive/unsold" color),
     kept distinct in tone (deep/muted vs the accent's bright warmth)
     so status badges never get confused with the brand accent. */
  --oxblood: #7A2E32;
  --oxblood-tint: #F5E7E6;
  --sage: #4B6B4F;
  --sage-tint: #E7EEE6;

  --radius: 3px;
  --shadow-soft: 0 1px 2px rgba(17, 17, 17, 0.06), 0 2px 8px rgba(17, 17, 17, 0.04);

  /* BUDDS' real heading font is "Futura PT Condensed Extra Bold," a
     commercial font with no free redistribution - Anton is the
     closest freely-licensed match (bold, condensed, geometric,
     built for uppercase headlines). Body font is BUDDS' actual
     "Geist," loaded for real via Google Fonts. */
  --font-display: 'Anton', Impact, sans-serif;
  --font-body: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--paper-text);
  background: var(--paper);
  font-size: 15px;
  line-height: 1.5;
}

a { color: inherit; }

::selection { background: var(--accent-tint); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Login ---------- */

.login-shell {
  min-height: 100vh;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-panel {
  width: 100%;
  max-width: 340px;
}

.login-mark {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 400;
  text-transform: uppercase;
  color: var(--ink-text);
  letter-spacing: -0.02em;
  margin: 0;
}

.login-logo { display: block; }
.login-logo svg { display: block; height: 34px; width: auto; }
.login-logo path { fill: var(--ink-text); }

.login-mark-rule {
  width: 40px;
  height: 2px;
  background: var(--accent);
  border: none;
  margin: 14px 0 10px;
}

.login-sub {
  color: var(--ink-text-muted);
  font-size: 13.5px;
  margin: 0 0 32px;
}

.login-panel label {
  display: block;
  color: var(--ink-text-muted);
  font-size: 12.5px;
  margin-bottom: 6px;
}

.login-panel input {
  width: 100%;
  background: var(--ink-raised);
  border: 1px solid var(--ink-line);
  color: var(--ink-text);
  border-radius: var(--radius);
  padding: 11px 13px;
  font-size: 14.5px;
  font-family: var(--font-body);
}

.login-panel input::placeholder { color: #565C68; }

.login-panel button {
  width: 100%;
  margin-top: 18px;
}

.login-error {
  color: #E29A9A;
  font-size: 13px;
  margin-top: 14px;
}

/* ---------- App shell ---------- */

.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 216px;
  flex-shrink: 0;
  background: var(--ink);
  color: var(--ink-text);
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
}

.sidebar-mark {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  color: var(--ink-text);
  margin: 0 0 2px;
}

.sidebar-logo { display: block; margin-bottom: 10px; }
.sidebar-logo svg { display: block; height: 26px; width: auto; }
.sidebar-logo path { fill: var(--ink-text); }

.sidebar-mark-sub {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-text-muted);
  margin: 0 0 28px;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar nav a {
  text-decoration: none;
  color: var(--ink-text-muted);
  font-size: 13.5px;
  padding: 9px 10px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 9px;
  transition: background 0.12s ease, color 0.12s ease;
}

.sidebar nav a:hover { color: var(--ink-text); background: var(--ink-raised); }
.sidebar nav a.active { color: var(--ink-text); background: var(--ink-raised); border-left: 2px solid var(--accent); padding-left: 8px; }

.sidebar nav svg { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.9; }

.sidebar-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--ink-line);
}

.sidebar-foot a {
  color: var(--ink-text-muted);
  font-size: 12.5px;
  text-decoration: none;
}
.sidebar-foot a:hover { color: var(--ink-text); }

/* Deliberately modest - a small mark, not a competing logo. */
.voxura-mark {
  display: block;
  margin-top: 10px;
  font-size: 10.5px;
  color: #5A5A5A;
  letter-spacing: 0.02em;
}
.voxura-mark strong { color: var(--ink-text-muted); font-weight: 600; }

.login-panel .voxura-mark { margin-top: 28px; text-align: center; color: #6B6B6B; }
.login-panel .voxura-mark strong { color: var(--ink-text-muted); }

.main {
  flex: 1;
  padding: 44px 56px;
  max-width: 880px;
}

.page-head { margin-bottom: 34px; }

.page-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  color: var(--paper-text);
  margin: 0 0 8px;
}

.page-rule {
  width: 100%;
  height: 1px;
  background: var(--paper-line);
  border: none;
  margin: 0 0 14px;
}

.page-desc {
  color: var(--paper-text-muted);
  font-size: 14px;
  max-width: 62ch;
  margin: 0;
}

/* ---------- Form elements ---------- */

.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--paper-text-muted);
  margin-bottom: 6px;
}

.field input[type="text"],
.field input[type="date"],
.field select {
  width: 100%;
  background: var(--paper-raised);
  border: 1px solid var(--paper-line);
  color: var(--paper-text);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 14.5px;
  font-family: var(--font-body);
}

.field input:focus, .field select:focus { border-color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 400;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 0.12s ease;
}
.btn:hover { background: var(--accent-strong); }
.btn:disabled { background: var(--accent); opacity: 0.55; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--oxblood);
  border: none;
  padding: 0;
  font-size: 12.5px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Loading spinner (Ask the Ledger) ---------- */

.spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Ask the Ledger: actions row + feedback ---------- */

.ask-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 20px;
}

.ask-feedback {
  display: flex;
  align-items: center;
  gap: 6px;
}

.feedback-btn {
  background: transparent;
  border: 1px solid var(--paper-line);
  border-radius: var(--radius);
  padding: 4px 9px;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.feedback-btn:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-tint); }
.feedback-btn:disabled { cursor: default; opacity: 0.6; }
.feedback-btn.feedback-selected { border-color: var(--accent); background: var(--accent-tint); opacity: 1; }

/* ---------- Upload dropzone ---------- */

.dropzone {
  border: 1.5px dashed var(--paper-line);
  border-radius: var(--radius);
  padding: 30px 24px;
  text-align: center;
  background: var(--paper-raised);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone.drag-over {
  border-color: var(--accent);
  background: var(--accent-tint);
}

.dropzone.has-file {
  border-style: solid;
  border-color: var(--sage);
  background: var(--sage-tint);
}

.dropzone-icon { color: var(--paper-text-muted); margin-bottom: 10px; }
.dropzone.drag-over .dropzone-icon,
.dropzone.has-file .dropzone-icon { color: var(--accent-strong); }

.dropzone-title { font-size: 14.5px; font-weight: 600; margin: 0 0 3px; }
.dropzone-sub { font-size: 12.5px; color: var(--paper-text-muted); margin: 0; }
.dropzone input[type="file"] { display: none; }

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--paper-text);
  margin-top: 4px;
}

/* ---------- Ledger table ---------- */

.ledger {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.ledger thead th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--paper-text-muted);
  padding: 0 10px 10px;
  border-bottom: 1.5px solid var(--paper-text);
}

.ledger thead th.num { text-align: right; }

.ledger tbody td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--paper-line);
  font-variant-numeric: tabular-nums;
}

.ledger tbody td.num { text-align: right; }
.ledger tbody tr:hover { background: rgba(168, 117, 47, 0.05); }
.ledger tbody tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}
.badge-sold { background: var(--sage-tint); color: var(--sage); }
.badge-passed { background: var(--oxblood-tint); color: var(--oxblood); }

/* ---------- Stat row (reports page summary) ---------- */

.stat-row {
  display: flex;
  gap: 40px;
  padding: 22px 0;
  border-top: 1px solid var(--paper-line);
  border-bottom: 1px solid var(--paper-line);
  margin: 24px 0 32px;
  flex-wrap: wrap;
}

.stat .stat-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  color: var(--paper-text);
  font-variant-numeric: tabular-nums;
}

.stat .stat-label {
  font-size: 12px;
  color: var(--paper-text-muted);
  margin-top: 2px;
}

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

.notice {
  border-left: 2px solid var(--accent);
  background: var(--accent-tint);
  padding: 12px 16px;
  font-size: 13px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 18px 0;
}

.notice-title { font-weight: 600; margin-bottom: 4px; }
.notice ul { margin: 4px 0 0; padding-left: 18px; }

.empty {
  padding: 40px 0;
  text-align: center;
  color: var(--paper-text-muted);
  font-size: 13.5px;
}

.muted { color: var(--paper-text-muted); }
.small { font-size: 12.5px; }
