/* CoreHub Serve — stil comun (design system minimal, responsive) */
:root,
:root[data-theme="classic"] {
  color-scheme: dark;
  --bg: #111827;
  --surface: #1f2937;
  --card: #1f2933;
  --input: #111827;
  --ink: #e5e7eb;
  --strong: #f9fafb;
  --muted: #9ca3af;
  --line: #4b5563;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #93c5fd;
  --accent-ink: #ffffff;
  --ok: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --info: #60a5fa;
  --radius: 8px;
  --shadow: 0 10px 25px rgba(0, 0, 0, .4);
}
:root[data-theme="garden"] {
  color-scheme: light;
  --bg: #f4faf6; --surface: #e3f2e8; --card: #ffffff; --input: #ffffff;
  --ink: #254137; --strong: #10251d; --muted: #637a70; --line: #b9d0c1;
  --accent: #2f8f68; --accent-hover: #247653; --accent-soft: #247653;
  --accent-ink: #ffffff; --info: #247653; --shadow: 0 10px 25px rgba(36, 76, 55, .16);
}
:root[data-theme="rose"] {
  color-scheme: light;
  --bg: #fff5f8; --surface: #fce7ef; --card: #ffffff; --input: #ffffff;
  --ink: #4a2a36; --strong: #28141c; --muted: #856170; --line: #e8afc2;
  --accent: #c43f73; --accent-hover: #a83262; --accent-soft: #a83262;
  --accent-ink: #ffffff; --info: #a83262; --shadow: 0 10px 25px rgba(122, 37, 74, .16);
}
:root[data-theme="sunrise"] {
  color-scheme: light;
  --bg: #fff8ed; --surface: #ffe9c7; --card: #ffffff; --input: #ffffff;
  --ink: #463221; --strong: #24160d; --muted: #7c6956; --line: #d8af72;
  --accent: #c46432; --accent-hover: #a94f24; --accent-soft: #a94f24;
  --accent-ink: #ffffff; --info: #a94f24; --shadow: 0 10px 25px rgba(116, 72, 31, .16);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0 0 .5em; color: var(--strong); }
a { color: var(--info); text-decoration: none; }
button {
  font: inherit; cursor: pointer; border: 0; border-radius: 8px;
  padding: 10px 16px; background: var(--card); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}
button.primary { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
button.primary:hover { background: var(--accent-hover); }
button.ok { background: var(--ok); color: #fff; box-shadow: none; }
button.danger { background: var(--bad); color: #fff; box-shadow: none; }
button.ghost { background: transparent; box-shadow: none; color: var(--muted); }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea {
  font: inherit; width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--input); color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 1px; border-color: var(--accent);
}
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.muted { color: var(--muted); font-size: 13px; }
.grid { display: grid; gap: 12px; }

.pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--line); color: var(--muted);
}
.pill.queued    { background: #eef2f6; color: #475467; }
.pill.preparing { background: #fef0c7; color: #93540b; }
.pill.ready     { background: #d1fadf; color: #067647; }
.pill.delivered { background: #e4e7ec; color: #475467; }
.pill.cancelled { background: #fee4e2; color: #b42318; }
.pill.open      { background: #fef0c7; color: #93540b; }
.pill.ack       { background: #d6e4ff; color: #1849a9; }

.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--surface);
  border-bottom: 1px solid var(--line); padding: 10px 16px;
  display: flex; align-items: center; gap: 12px;
}
.topbar .brand { font-weight: 700; }
.topbar .grow { flex: 1; }
.now-clock { font-size: 24px; font-weight: 800; color: var(--accent); letter-spacing: .02em; }

.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 8px 12px; }
.tabs button { white-space: nowrap; border-radius: 999px; padding: 8px 16px; }
.tabs button.active { background: var(--accent); color: var(--accent-ink); box-shadow: none; }

.page { max-width: 1100px; margin: 0 auto; padding: 16px; }

.theme-switcher {
  position: fixed; right: 14px; bottom: 14px; z-index: 45;
  display: flex; align-items: center; gap: 8px; padding: 7px 9px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); box-shadow: var(--shadow);
  color: var(--muted); font-size: 12px;
}
.theme-switcher select {
  width: auto; min-width: 100px; padding: 6px 28px 6px 8px; font-size: 12px;
}

.auth-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
}
.auth-card {
  width: min(360px, calc(100vw - 32px)); padding: 24px;
  background: var(--card); border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.auth-mark {
  width: 82px; height: 82px; margin: 0 auto 14px; border-radius: 16px;
  display: grid; place-items: center; background: var(--accent); color: #fff;
  font-size: 36px; font-weight: 800; letter-spacing: -2px;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 35%, transparent);
}
.auth-title { margin: 0; text-align: center; font-size: 22px; }
.auth-subtitle { margin: 6px 0 18px; text-align: center; color: var(--muted); font-size: 13px; }
.auth-message {
  min-height: 18px; margin: 0 0 4px; color: var(--muted);
  font-size: 13px; line-height: 1.4; text-align: center;
}
.auth-message.ok { color: var(--ok); }
.auth-message.bad { color: #f87171; }
.auth-card label { margin-top: 12px; }
.auth-submit { width: 100%; margin-top: 18px; }
.auth-link {
  width: 100%; margin-top: 7px; padding: 8px; background: transparent;
  color: var(--accent-soft); box-shadow: none;
}
.auth-link:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.password-field { position: relative; }
.password-field input { padding-right: 44px; }
.password-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 36px; padding: 6px; color: var(--muted); background: transparent; box-shadow: none;
}
.password-toggle:hover { color: var(--ink); }
.auth-hint { color: var(--muted); font-size: 12px; line-height: 1.45; text-align: center; }
.auth-code { letter-spacing: .24em; text-align: center; font-weight: 700; }

/* Modal generic */
.modal-back {
  position: fixed; inset: 0; background: rgba(12, 16, 24, .5); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  background: var(--card); width: 100%; max-width: 520px; max-height: 88vh;
  overflow-y: auto; border-radius: 16px 16px 0 0; padding: 20px;
}
@media (min-width: 640px) {
  .modal-back { align-items: center; }
  .modal { border-radius: 16px; }
}

/* Toast-uri */
#toasts { position: fixed; top: 12px; right: 12px; z-index: 100; display: grid; gap: 8px; max-width: 320px; }
.toast {
  background: var(--accent); color: var(--accent-ink); border-radius: 10px; padding: 12px 16px;
  box-shadow: var(--shadow); font-size: 14px; animation: toast-in .2s ease-out;
}
.toast.ok { background: var(--ok); }
.toast.bad { background: var(--bad); }
@keyframes toast-in { from { transform: translateY(-8px); opacity: 0; } }

.badge {
  min-width: 18px; height: 18px; border-radius: 9px; background: var(--bad); color: #fff;
  font-size: 11px; font-weight: 700; display: inline-flex; align-items: center;
  justify-content: center; padding: 0 5px;
}

table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 14px; }
table.list th { color: var(--muted); font-weight: 600; font-size: 12px; }
