/* Wydaho KDS — dark, kitchen-readable, tablet-first */
:root {
  --bg:        #0c0c0b;
  --surface:   #1a1a19;
  --surface2:  #242423;
  --border:    #38383a;
  --text:      #f0efe9;
  --muted:     #8c8c87;

  --accent:    #d1432a;     /* Wydaho rust red */
  --green:     #3ecf8e;
  --yellow:    #f7c948;
  --red:       #e74c3c;
  --orange:    #f6993f;
  --blue:      #5aa9e6;
}

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

html, body {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100%;
  width: 100%;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

button { font-family: inherit; cursor: pointer; }

/* ── Login page ────────────────────────────────────────────────── */

.login-body {
  display: flex; align-items: center; justify-content: center;
  height: 100vh;
  padding: 24px;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 32px;
  width: 100%;
  max-width: 380px;
}

.brand { text-align: center; margin-bottom: 32px; }
.brand-name { font-size: 28px; font-weight: 800; letter-spacing: 0.5px; }
.brand-sub  { color: var(--accent); font-weight: 700; letter-spacing: 3px;
              font-size: 12px; text-transform: uppercase; margin-top: 4px; }

#login-form { display: flex; flex-direction: column; gap: 14px; }

#login-form input[type="password"] {
  background: var(--surface2);
  border: 2px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 16px 18px;
  font-size: 18px;
  outline: none;
}
#login-form input[type="password"]:focus { border-color: var(--accent); }

#login-form button {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 16px;
  font-size: 18px;
  font-weight: 700;
}
#login-form button:disabled { opacity: 0.6; }

.login-error { color: var(--red); font-size: 14px; min-height: 18px;
               text-align: center; }

/* ── KDS header ────────────────────────────────────────────────── */

.kds-body { display: flex; flex-direction: column; }

.kds-header {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 18px;
  flex: 0 0 auto;
}

.kds-title { display: flex; align-items: baseline; gap: 12px; }
.kds-brand   { font-size: 20px; font-weight: 800; }
.kds-station { color: var(--accent); font-weight: 700;
               text-transform: uppercase; letter-spacing: 2px;
               font-size: 12px; }

.kds-status { display: flex; align-items: center; gap: 12px;
              font-size: 14px; color: var(--muted); }

.kds-count   { font-size: 22px; font-weight: 700; color: var(--text); }
.kds-divider { color: var(--border); }

.conn-indicator { display: inline-flex; align-items: center; gap: 6px; }
.conn-dot { width: 10px; height: 10px; border-radius: 50%;
            background: var(--muted); transition: background 0.2s; }
.conn-indicator.live    .conn-dot { background: var(--green); }
.conn-indicator.stale   .conn-dot { background: var(--yellow); }
.conn-indicator.offline .conn-dot { background: var(--red); }

.header-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
}
.header-btn:hover { border-color: var(--accent); }

/* ── Orders grid (tiled) ──────────────────────────────────────── */

.orders-grid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  padding: 12px;
  overflow-y: auto;
  align-content: start;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 80px 20px;
  font-size: 18px;
}

/* ── Order card ───────────────────────────────────────────────── */

.order-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.1s;
}
.order-card:active { transform: scale(0.99); }

.order-card.age-green  { border-color: var(--green); }
.order-card.age-yellow { border-color: var(--yellow); }
.order-card.age-red    { border-color: var(--red); animation: pulse 1.4s infinite; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(231, 76, 60, 0); }
}

.order-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.order-card.age-green  .order-header { background: rgba(62, 207, 142, 0.12); }
.order-card.age-yellow .order-header { background: rgba(247, 201, 72, 0.12); }
.order-card.age-red    .order-header { background: rgba(231, 76, 60, 0.18); }

.order-ticket { font-size: 16px; font-weight: 800; }
.order-customer { font-size: 13px; color: var(--muted); margin-left: 6px; }
.order-timer { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.order-card.age-green  .order-timer { color: var(--green); }
.order-card.age-yellow .order-timer { color: var(--yellow); }
.order-card.age-red    .order-timer { color: var(--red); }

.order-body { padding: 8px 12px; flex: 1 1 auto; }

.order-item {
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 16px;
}
.order-item:last-child { border-bottom: none; }
.order-item.muted { opacity: 0.45; }     /* non-kitchen items shown for context */

.order-item-name { font-weight: 700; }
.order-item-qty  { color: var(--muted); margin-right: 4px; font-weight: 700; }

.order-item-mods {
  font-size: 13px; color: var(--accent); font-weight: 600;
  margin-top: 2px;
}
.order-item-note {
  font-size: 13px; color: var(--yellow); font-style: italic;
  margin-top: 2px;
}

.order-footer {
  padding: 0;
  display: flex;
}
.bump-btn {
  flex: 1;
  background: var(--accent);
  color: white;
  border: none;
  padding: 16px 12px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.bump-btn:active { background: #b53a23; }

/* ── Recall view ──────────────────────────────────────────────── */

.recall-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
}

.recall-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.recall-meta { flex: 1 1 auto; }
.recall-ticket { font-size: 16px; font-weight: 700; }
.recall-customer { color: var(--muted); margin-left: 6px; font-size: 14px; }
.recall-items { color: var(--muted); font-size: 13px; margin-top: 4px; }
.recall-time { color: var(--muted); font-size: 13px; }
.recall-btn {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px; font-weight: 700;
}
.recall-btn:hover { border-color: var(--accent); color: var(--accent); }
