/* Snacko Express.
   Palette taken from the existing kiosk artwork and squadron branding:
   brick #8b3229, deep brown #2a110a, amber #fdac19. No framework — the markup
   is ours, so utility classes would mostly be indirection. */

:root {
  --brand:        #8b3229;
  --brand-dark:   #6d2720;
  --brand-deep:   #2a110a;
  --accent:       #fdac19;
  --accent-soft:  #fdd17f;

  --ink:          #1b1310;
  --ink-soft:     #6b5d57;
  --ink-faint:    #9a8d87;
  --line:         #e7e0dc;
  --surface:      #ffffff;
  --canvas:       #faf7f5;

  --ok:    #1b7f4d;
  --warn:  #a86112;
  --bad:   #b4231c;
  --ok-bg:   #e8f5ee;
  --warn-bg: #fdf3e3;
  --bad-bg:  #fcecea;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(42,17,10,.06), 0 4px 12px rgba(42,17,10,.05);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--canvas);
  color: var(--ink);
  font: 15px/1.55 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); }
h1, h2, h3 { color: var(--brand-deep); margin: 0 0 .4em; line-height: 1.25; }
h1 { font-size: 1.6rem; font-weight: 650; }
h2 { font-size: 1.05rem; font-weight: 650; }
h3 { font-size: .95rem; font-weight: 600; }

/* ── Sign in ─────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100dvh;
  display: grid; place-items: center;
  padding: 24px;
  background: linear-gradient(160deg, var(--brand-deep), var(--brand) 140%);
}
.auth-card {
  width: 100%; max-width: 380px;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,.28);
  padding: 32px 28px;
}
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-mark { font-size: 2rem; display: block; }
.auth-brand h1 { font-size: 1.25rem; margin-top: 6px; }
.auth-note {
  margin: 18px 0 0; text-align: center;
  font-size: .8rem; color: var(--ink-faint);
}

/* ── Forms ───────────────────────────────────────────────────────────── */
.stack { display: grid; gap: 14px; }
label > span {
  display: block; margin-bottom: 5px;
  font-size: .78rem; font-weight: 600; color: var(--ink-soft);
}
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=search], select, textarea {
  width: 100%; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 8px;
  font: inherit; color: var(--ink); background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}
.hint { font-size: .78rem; color: var(--ink-faint); margin: 5px 0 0; }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border: 1px solid transparent; border-radius: 8px;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: filter .12s ease, background .12s ease;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.1); }
.btn-quiet { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-quiet:hover:not(:disabled) { background: var(--canvas); }
/* Confirm and destroy stay green/red: a brand-coloured "Accept payment"
   reads worse than one that is unmistakably the positive action. */
.btn-go     { background: var(--ok);  color: #fff; }
.btn-danger { background: var(--bad); color: #fff; }
.btn-block  { width: 100%; }
.btn-sm     { padding: 6px 11px; font-size: .85rem; }

/* ── Shell ───────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100dvh; }
.sidebar {
  background: var(--brand); color: #fff;
  padding: 18px 0; display: flex; flex-direction: column;
}
.sidebar-brand {
  padding: 0 18px 16px; font-weight: 700; font-size: 1.05rem;
  display: flex; align-items: center; gap: 8px;
}
.sidebar a {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 18px; color: rgba(255,255,255,.88);
  text-decoration: none; font-size: .9rem; border-left: 3px solid transparent;
}
.sidebar a:hover { background: rgba(0,0,0,.14); color: #fff; }
.sidebar a.active {
  background: rgba(0,0,0,.2); color: #fff;
  border-left-color: var(--accent); font-weight: 600;
}
.sidebar-foot { margin-top: auto; padding: 14px 18px 0; font-size: .8rem; }
.sidebar-foot a { padding: 4px 0; border: 0; color: rgba(255,255,255,.7); }

.main { padding: 26px 30px 60px; max-width: 1120px; }
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 22px;
}
.page-head p { margin: 4px 0 0; color: var(--ink-soft); font-size: .88rem; }

/* ── Cards, tables, tiles ────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px;
}
.card-head {
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  font-weight: 650; font-size: .9rem;
}
.card-body { padding: 16px; }
.empty { padding: 40px 16px; text-align: center; color: var(--ink-faint); font-size: .9rem; }

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

.tile { background: var(--surface); border: 1px solid var(--line);
        border-radius: var(--radius); padding: 15px; box-shadow: var(--shadow); }
.tile-label { font-size: .72rem; letter-spacing: .07em; text-transform: uppercase;
              color: var(--ink-soft); }
.tile-value { font-size: 1.6rem; font-weight: 650; margin-top: 3px;
              font-variant-numeric: tabular-nums; }
.tile-hint  { font-size: .76rem; color: var(--ink-faint); margin-top: 3px; }

table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: .74rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--ink-soft); font-weight: 600;
  padding: 9px 16px; border-bottom: 1px solid var(--line);
}
td { padding: 11px 16px; border-bottom: 1px solid var(--line); font-size: .9rem; }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── Status ──────────────────────────────────────────────────────────── */
.alert { padding: 11px 14px; border-radius: 8px; font-size: .88rem; margin: 0 0 16px; }
.alert-error { background: var(--bad-bg);  color: var(--bad);  border: 1px solid #f3c9c6; }
.alert-warn  { background: var(--warn-bg); color: var(--warn); border: 1px solid #f3ddb8; }
.alert-ok    { background: var(--ok-bg);   color: var(--ok);   border: 1px solid #bfe3ce; }

.pill { display: inline-block; padding: 2px 8px; border-radius: 999px;
        font-size: .74rem; font-weight: 600; }
.pill-ok   { background: var(--ok-bg);   color: var(--ok); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-bad  { background: var(--bad-bg);  color: var(--bad); }
.pill-mute { background: #eee8e5;        color: var(--ink-soft); }

/* The reconciliation code is the thing an admin matches against a Venmo
   statement, so it is deliberately the loudest element on the row. */
.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700; letter-spacing: .18em;
  background: var(--accent-soft); color: var(--brand-deep);
  padding: 3px 9px; border-radius: 6px;
}
.code-xl { font-size: 2.1rem; letter-spacing: .3em; padding: 12px 18px; display: inline-block; }

.muted { color: var(--ink-soft); }
.small { font-size: .82rem; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* Inputs default to full width for stacked forms; inside a .row they should
   size to their content instead of pushing everything onto its own line. */
.row > input, .row > select { width: auto; }
.page-head form { flex-wrap: nowrap; }
.right { margin-left: auto; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; overflow-x: auto; padding: 10px; gap: 4px; }
  .sidebar-brand, .sidebar-foot { display: none; }
  .sidebar a { white-space: nowrap; border-left: 0; border-bottom: 3px solid transparent; }
  .sidebar a.active { border-left: 0; border-bottom-color: var(--accent); }
  .main { padding: 18px 16px 48px; }
}
