/* Counter app — big type, high contrast, tablet first. Tokens match site.css. */
:root {
  --bg: #0E0E0E; --surface: #1A1A1A; --surface-2: #262626; --line: #333;
  --primary: #E8352B; --primary-strong: #C9271E; --on-primary: #FFFFFF;
  --text: #fff; --muted: #BDBDBD; --danger: #E53935; --ok: #43A047; --warn: #FF9800;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 500 16px/1.4 'Nunito', system-ui, sans-serif; display: flex; flex-direction: column; }
a { color: var(--primary); }
h1, h2, h3 { font-family: 'Rubik', sans-serif; text-transform: uppercase; margin: 0; }

.btn { border: 2px solid transparent; border-radius: 999px; padding: 12px 16px; font: 700 .95rem 'Nunito', sans-serif; cursor: pointer; text-transform: uppercase; }
.btn:disabled { opacity: .5; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-strong); }
.btn-danger { background: transparent; border-color: var(--danger); color: #ff8a80; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-wide { flex: 1; }
.btn-icon { padding: 10px 14px; }
.btn-xl { font-size: 1.4rem; padding: 20px 44px; }
.link { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; }
.input { width: 100%; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font: inherit; }
.logo { display: block; height: auto; flex-shrink: 0; }

.start-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .92); display: grid; place-items: center; text-align: center; padding: 24px; }
.start-overlay[hidden] { display: none; }
.start-box .logo { width: 160px; margin: 0 auto 16px; }
.start-box h1 { font-size: 2.4rem; color: var(--primary); }
.start-box p { color: var(--muted); max-width: 420px; margin: 12px auto 28px; }

.topbar { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.topbar .logo { width: 70px; }
.clock { font: 700 1.8rem 'Rubik', sans-serif; }
.indicator { background: var(--surface-2); border: 0; color: var(--text); border-radius: 999px; padding: 6px 12px; font: 600 .85rem 'Nunito', sans-serif; cursor: default; }
button.indicator { cursor: pointer; }
.indicator.ok { color: #9ccc65; }
.indicator.bad { color: #ff8a80; animation: blink 1s infinite; }
.pause { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.pause select { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; font: inherit; }
.pause-label { background: var(--warn); color: #000; border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: .85rem; }
.topnav { display: flex; gap: 14px; align-items: center; }
.topnav form { margin: 0; }

.alert-bar { background: var(--danger); color: #fff; text-align: center; padding: 10px; font-weight: 700; }
.alert-bar.warn { background: var(--warn); color: #000; }
.alert-bar[hidden] { display: none; }

.board { flex: 1; display: grid; grid-template-columns: 1.25fr 1.25fr 1fr .8fr; gap: 12px; padding: 12px; min-height: 0; }
.col { background: #121212; border-radius: 14px; display: flex; flex-direction: column; min-height: 0; border: 1px solid #1f1f1f; }
.col h2 { font-size: 1.1rem; padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.count { background: var(--surface-2); border-radius: 999px; padding: 2px 10px; font-size: .95rem; }
.col-new h2 .count { background: var(--primary); color: var(--on-primary); }
body.has-new .col-new { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary), 0 0 30px rgba(232, 53, 43, .3); animation: glow 1.2s ease-in-out infinite alternate; }
.list { overflow-y: auto; padding: 10px; display: grid; gap: 10px; align-content: start; }
.empty { color: var(--muted); text-align: center; padding: 20px 0; margin: 0; }

.ocard { background: var(--surface); border-radius: 12px; padding: 14px; border-left: 6px solid var(--line); display: grid; gap: 8px; }
.ocard.status-New { border-left-color: var(--primary); animation: arrive .5s ease-out; }
.ocard.status-Accepted { border-left-color: #64b5f6; }
.ocard.status-Preparing { border-left-color: var(--warn); }
.ocard.status-Ready { border-left-color: var(--ok); }
.ocard.remind { outline: 3px solid var(--warn); animation: blink 1s infinite; }
.ocard header { display: flex; justify-content: space-between; align-items: baseline; }
.onum { font: 700 1.6rem 'Rubik', sans-serif; color: var(--primary); }
.ochan { font-weight: 700; }
.odue { font: 700 1.35rem 'Rubik', sans-serif; }
.ocard.scheduled .odue { color: var(--primary); }
.oready { color: #9ccc65; font-weight: 600; }
.oremind { background: var(--warn); color: #000; font-weight: 700; padding: 6px 10px; border-radius: 8px; }
.olines { list-style: none; margin: 0; padding: 0; font-size: 1.05rem; display: grid; gap: 4px; }
.olines b { color: var(--primary); margin-right: 4px; }
.gift { color: #9ccc65; font-style: normal; font-size: .85rem; }
.ocomment { margin: 0; background: var(--surface-2); padding: 8px 10px; border-radius: 8px; }
.ocust { color: var(--muted); font-size: .9rem; }
.ofoot { display: flex; justify-content: space-between; align-items: baseline; }
.ototal { font: 700 1.2rem 'Rubik', sans-serif; }
.ototal small { font: 500 .8rem 'Nunito', sans-serif; color: var(--muted); }
.oago { color: var(--muted); font-size: .85rem; }
.oactions { display: flex; gap: 8px; flex-wrap: wrap; }
.ocard.compact { display: flex; gap: 10px; align-items: baseline; padding: 10px 12px; font-size: .9rem; }
.ocard.compact .onum { font-size: 1.1rem; }
.ocard.compact .ototal { margin-left: auto; font-size: 1rem; }
.ocard.status-Rejected, .ocard.status-Cancelled { border-left-color: var(--danger); opacity: .7; }
.ocard.status-Completed { opacity: .7; }

.reject-dialog { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 16px; padding: 22px; width: min(440px, 92vw); }
.reject-dialog::backdrop { background: rgba(0, 0, 0, .7); }
.reasons { display: grid; gap: 10px; margin: 16px 0; }
.reasons label { display: flex; gap: 10px; align-items: center; font-size: 1.05rem; }
.reasons input { width: 20px; height: 20px; accent-color: var(--primary); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

#print-area { display: none; }
@media print {
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block; color: #000; font: 14px/1.4 monospace; width: 72mm; }
  #print-area h1 { font-size: 22px; }
}

@keyframes blink { 50% { opacity: .55; } }
@keyframes glow { to { box-shadow: 0 0 0 2px var(--primary), 0 0 50px rgba(232, 53, 43, .5); } }
@keyframes arrive { from { transform: translateY(-10px); opacity: 0; } }

/* Phone tabs (shown only at phone width). */
.tabs { display: none; }
.tab { display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--surface-2); color: var(--text); border: 2px solid transparent; border-radius: 12px; padding: 8px 4px; font: 700 .78rem 'Nunito', sans-serif; text-transform: uppercase; cursor: pointer; min-width: 0; }
.tab .count { font-size: .9rem; background: var(--bg); }
.tab.active { background: var(--primary); color: var(--on-primary); }
.tab.active .count { background: rgba(0, 0, 0, .15); color: var(--on-primary); }
body.has-new .tab-new .count { background: var(--primary); color: var(--on-primary); }
body.has-new .tab-new:not(.active) { border-color: var(--primary); animation: blink 1s infinite; }

/* Tablet: columns grow with their orders and the whole board scrolls,
   instead of squeezing every column into the screen height. */
@media (max-width: 1100px) {
  .board { grid-template-columns: 1fr 1fr; grid-auto-rows: max-content; overflow-y: auto; align-content: start; }
  .col { min-height: 200px; }
  .list { overflow-y: visible; }
}

/* Phone: one column at a time, picked with the tabs, filling the rest of the screen. */
@media (max-width: 640px) {
  body { height: 100dvh; }
  .topbar { gap: 8px 10px; padding: 8px 10px; }
  .topbar .logo { width: 44px; }
  .clock { font-size: 1.35rem; }
  .pause { margin-left: 0; }
  .tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 8px 8px 0; }
  .board { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr); align-content: stretch; overflow: hidden; padding: 8px; }
  .col { display: none; min-height: 0; }
  .col.active { display: flex; }
  .col h2 { display: none; }
  .list { overflow-y: auto; overscroll-behavior: contain; }
  .oactions .btn { flex: 1; }
}
