/* ===========================================================================
   Kitchen Display System (dark, glanceable) + Admin dashboard
   =========================================================================== */

/* ------------------------------------------------------------------ auth */
.auth-wrap {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  width: min(100%, 400px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 32px 28px;
}
.auth-card h1 { margin: 0 0 4px; font-size: 1.25rem; }
.auth-card .auth-sub { color: var(--muted); font-size: 0.875rem; margin: 0 0 22px; }
.auth-error {
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid #4a2626;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.85rem;
  margin-bottom: 14px;
}
.auth-hint { margin-top: 18px; font-size: 0.76rem; color: var(--muted-dim); text-align: center; }
.auth-logo {
  width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 16px; display: grid;
  place-items: center; background: linear-gradient(145deg, var(--gold), var(--gold-dim));
  color: #14100c; font-weight: 800; font-size: 1.4rem;
}

/* =================================================================
   KITCHEN
   ================================================================= */
.kitchen-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: #12100d;
  border-bottom: 1px solid var(--line);
}
.kitchen-header h1 { font-size: 1rem; margin: 0; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.kitchen-clock { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 700; margin-left: auto; }
.conn { display: inline-flex; align-items: center; gap: 7px; font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.conn-dot { width: 9px; height: 9px; border-radius: 999px; background: #555; }
.conn.connected .conn-dot { background: #4f9d69; box-shadow: 0 0 8px rgba(79, 157, 105, 0.6); }
.conn.reconnecting .conn-dot { background: var(--amber); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.kitchen-user { color: var(--muted); font-size: 0.78rem; font-weight: 600; }
.kitchen-logout {
  background: none; border: 1px solid var(--line); color: var(--muted);
  border-radius: 8px; padding: 7px 12px; font-size: 0.78rem;
}
.kitchen-logout:hover { color: var(--ink); }

.kds-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(300px, 1fr));
  gap: 14px;
  padding: 14px;
  min-height: calc(100dvh - 62px);
  align-items: start;
}
@media (max-width: 980px) { .kds-board { grid-template-columns: 1fr; } }

.kds-col { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
.kds-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 12px;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
}
.kds-count { background: var(--line); border-radius: 999px; padding: 2px 10px; font-size: 0.78rem; }
.kds-col-new .kds-col-head { color: var(--blue); }
.kds-col-prep .kds-col-head { color: var(--amber); }
.kds-col-ready .kds-col-head { color: var(--green); }
.kds-col-empty { color: var(--muted-dim); text-align: center; padding: 28px 0; font-size: 0.82rem; }

.ticket {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--muted-dim);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  animation: ticket-in 0.25s ease;
}
@keyframes ticket-in { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }
.ticket-new { border-left-color: var(--blue); }
.ticket-preparing { border-left-color: var(--amber); }
.ticket-ready { border-left-color: var(--green); }
.ticket.late { border-left-color: var(--red); }

.ticket-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.ticket-table { font-size: 1.05rem; font-weight: 800; }
.ticket-id { color: var(--muted-dim); font-size: 0.72rem; font-family: ui-monospace, monospace; }
.ticket-ago { margin-left: auto; color: var(--muted); font-size: 0.76rem; font-weight: 700; }
.ticket.late .ticket-ago { color: var(--red); }
.ticket-items { margin: 0 0 10px; padding: 0; list-style: none; }
.ticket-items li { padding: 5px 0; border-bottom: 1px dashed var(--line-soft); font-size: 0.9rem; }
.ticket-items li:last-child { border-bottom: none; }
.ticket-qty { color: var(--gold); font-weight: 800; margin-right: 8px; }
.ticket-note { color: var(--amber); font-size: 0.78rem; display: block; margin-top: 2px; }
.ticket-order-note {
  background: var(--surface-2);
  border-radius: 8px;
  color: var(--amber);
  padding: 8px 10px;
  font-size: 0.78rem;
  margin-bottom: 10px;
}
.ticket-actions { display: flex; gap: 8px; }
.ticket-actions .btn { flex: 1; }

body.kitchen.flash { animation: board-flash 0.7s ease 2; }
@keyframes board-flash { 50% { background: #1a1510; } }

/* =================================================================
   ADMIN
   ================================================================= */
.admin-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  padding: 0 20px;
}
.admin-nav {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 58px;
  overflow-x: auto;
}
.admin-brand {
  font-weight: 800;
  margin-right: 14px;
  white-space: nowrap;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--gold);
}
.admin-tab {
  background: none;
  border: none;
  padding: 18px 14px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  font-size: 0.88rem;
}
.admin-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.admin-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}
.conn.admin-conn { font-size: 0.72rem; }

.admin-main { max-width: 1180px; margin: 0 auto; padding: 22px 20px 64px; }
.admin-section-title { font-size: 1rem; font-weight: 800; margin: 0 0 14px; }

/* stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 22px; }
@media (min-width: 760px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat-label {
  color: var(--muted-dim);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.stat-value { font-size: 1.4rem; font-weight: 800; margin-top: 6px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.panel-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
}

/* revenue bars */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.bar {
  width: 100%;
  max-width: 46px;
  background: linear-gradient(180deg, var(--gold), var(--gold-dim));
  border-radius: 8px 8px 3px 3px;
  min-height: 3px;
  transition: height 0.3s ease;
}
.bar-label { font-size: 0.68rem; color: var(--muted-dim); font-weight: 600; }
.bar-value { font-size: 0.66rem; color: var(--ink); font-weight: 700; }

/* top items */
.top-list { margin: 0; padding: 0; list-style: none; }
.top-list li {
  display: flex;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line-soft);
  font-size: 0.88rem;
}
.top-list li:last-child { border-bottom: none; }
.top-qty { color: var(--gold); font-weight: 800; margin-right: 8px; }

/* data tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.88rem; min-width: 640px; }
table.data th {
  text-align: left;
  color: var(--muted-dim);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td { padding: 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.order-row-main { display: flex; flex-direction: column; gap: 2px; }
.order-id { font-family: ui-monospace, monospace; font-size: 0.74rem; color: var(--muted-dim); }
.order-items-summary { color: var(--muted); font-size: 0.78rem; max-width: 340px; }

/* form grid in modals */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .span2 { grid-column: span 2; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span2 { grid-column: span 1; } }
.check-row { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 4px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 0.88rem; font-weight: 600; }
.check input { width: 18px; height: 18px; accent-color: var(--gold); }

.section-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.inline-select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--bg-soft);
  color: var(--ink);
}
.qr-code { font-family: ui-monospace, monospace; font-size: 0.74rem; color: var(--muted); }
.filter-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.help-text { color: var(--muted-dim); font-size: 0.8rem; line-height: 1.6; }
