/* Kennie's Sign Printer
   Built for a shop-floor PC: large hit targets, high contrast, nothing that
   needs a steady hand. Kennie's red and yellow, used sparingly so the page
   doesn't compete with the signs it makes. */

:root {
  --red: #b4121b;
  --red-dark: #8c0d14;
  --yellow: #fde428;
  --ink: #1c1917;
  --muted: #6b6560;
  --line: #ddd8d2;
  --bg: #f6f4f1;
  --card: #fff;
  --ok: #157a3f;
  --bad: #b4121b;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

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

.topbar {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 12px 24px;
  background: var(--red);
  color: #fff;
}
.brand { font-weight: 800; font-size: 20px; color: #fff; text-decoration: none; letter-spacing: -.01em; }
.brand span { color: var(--yellow); }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  color: #fff; text-decoration: none; padding: 8px 14px; border-radius: 999px;
  font-weight: 600; font-size: 15px;
}
.nav a:hover { background: rgba(255,255,255,.14); }
.nav a.on { background: var(--yellow); color: var(--red-dark); }
.whoami { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.whoami span { opacity: .9; }
.whoami a { color: var(--yellow); }

.wrap { max-width: 1040px; margin: 0 auto; padding: 28px 24px 56px; }
.foot { text-align: center; color: var(--muted); font-size: 14px; padding: 0 24px 32px; }

h1 { font-size: 30px; margin: 0 0 6px; letter-spacing: -.02em; }
h2 { font-size: 19px; margin: 0 0 12px; }
.lede { color: var(--muted); margin: 0 0 24px; max-width: 62ch; }
.hint { color: var(--muted); font-size: 13px; margin: 5px 0 0; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.empty { color: var(--muted); padding: 32px 0; }

/* -- alerts ------------------------------------------------------------- */

.alert { padding: 12px 16px; border-radius: var(--radius); margin: 0 0 20px; border: 1px solid; }
.alert.error { background: #fdf0f0; border-color: #f0c4c4; color: var(--bad); }
.alert.ok { background: #eefaf2; border-color: #bfe6ce; color: var(--ok); }
.alert.pw { background: #fffbe6; border-color: #f0dfa0; }
.alert.pw code { font-size: 22px; font-weight: 700; letter-spacing: .14em; }

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

fieldset { border: 0; padding: 0; margin: 0 0 24px; }
legend { font-weight: 700; font-size: 15px; padding: 0 0 10px; }

.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modes legend { grid-column: 1 / -1; }
.mode {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; cursor: pointer;
}
.mode:has(input:checked) { border-color: var(--red); background: #fff8f8; }
.mode input { margin-top: 3px; width: 20px; height: 20px; accent-color: var(--red); }
.mode-body { display: flex; flex-direction: column; }
.mode-body strong { font-size: 15px; }
.mode-body small { color: var(--muted); }

.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin: 0 0 16px;
}
.panel[hidden] { display: none; }
.panel-head { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; }
.slot-badge {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--red); color: #fff; font-size: 15px; font-weight: 700;
}
.slot-title { font-size: 17px; font-weight: 700; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.f-wide { grid-column: 1 / -1; }
.f label { display: block; font-weight: 600; font-size: 14px; margin: 0 0 6px; }
.f .opt { font-weight: 400; color: var(--muted); font-size: 12px; }
.f input[type=text], .f input[type=date], .f input[type=password], input[type=search], select {
  width: 100%; padding: 11px 13px; font-size: 17px; font-family: inherit;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
.f input:focus, input:focus, select:focus { outline: 3px solid #fcd9a8; border-color: var(--red); }
.f.bad input { border-color: var(--bad); background: #fdf6f6; }
.err { color: var(--bad); font-size: 13px; margin: 5px 0 0; font-weight: 600; }
.f-check { display: flex; align-items: flex-end; }
.check { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--red); }

.stockmode { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.radio { display: flex; gap: 11px; align-items: flex-start; padding: 7px 0; cursor: pointer; }
.radio input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--red); }

.actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 0 0 32px; }

.btn {
  display: inline-block; padding: 11px 20px; font: inherit; font-weight: 700;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 8px; cursor: pointer; text-decoration: none;
}
.btn:hover { background: #f3f0ec; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-dark); }
.btn.big { padding: 14px 30px; font-size: 17px; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.ghost { background: transparent; }
.inline { display: inline-flex; gap: 6px; }

/* -- preview ------------------------------------------------------------ */

.previewwrap { margin: 0 0 32px; }
#preview {
  width: 100%; height: 760px; border: 1px solid var(--line);
  border-radius: var(--radius); background: #fff;
}

/* -- reuse chips -------------------------------------------------------- */

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.chip {
  font: inherit; font-size: 14px; cursor: pointer;
  background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px;
}
.chip:hover { border-color: var(--red); }
.chip span { color: var(--muted); margin-left: 6px; }

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

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 20px; }
.filters input[type=search] { max-width: 280px; }
.filters select { width: auto; }

.hist { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; }
.hist th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.hist td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 15px; }
.hist tr:last-child td { border-bottom: 0; }
.histitem { padding: 2px 0; }
.histitem .price { font-weight: 700; margin-left: 8px; }
.histitem .muted { margin-left: 8px; font-size: 13px; }
.warn { color: #9a6b00; background: #fffbe6; border-radius: 6px; padding: 6px 9px; font-size: 13px; margin-top: 6px; }
.tag { background: var(--yellow); color: var(--red-dark); font-size: 11px; font-weight: 700;
       padding: 2px 7px; border-radius: 999px; margin-left: 6px; text-transform: uppercase; }

/* -- sign in ------------------------------------------------------------ */

.signin { max-width: 400px; margin: 40px auto; background: var(--card);
          border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; }
.signin label { display: block; font-weight: 600; font-size: 14px; margin: 16px 0 6px; }
.signin input { width: 100%; padding: 12px 14px; font-size: 17px; font-family: inherit;
                border: 1px solid var(--line); border-radius: 8px; }
.signin .btn { width: 100%; margin-top: 24px; }

@media (max-width: 720px) {
  .grid, .modes { grid-template-columns: 1fr; }
  .topbar { gap: 12px; }
  .nav { margin-left: 0; order: 3; width: 100%; }
  #preview { height: 520px; }
}

@media print {
  .topbar, .foot, .actions, .modes, .panel, .stockmode, .reuse, .filters { display: none; }
  #preview { height: 100vh; border: 0; }
}
