/* The Murmur BMS — design system, on brand with the website.
   Palette + fonts lifted from the theme (assets/css/main.css).
   Light, warm, HIGH CONTRAST and AGE-FRIENDLY: 17px base, large tap targets,
   generous spacing — legible for older staff across a busy counter/kitchen. */

@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Jost:wght@400;500;600;700&display=swap");

:root {
  /* brand palette */
  --espresso: #3d2e24;
  --charcoal: #2c2825;
  --clay: #b8845c;
  --clay-deep: #8b5e3c;
  --cream: #f5ede3;
  --cream-warm: #ede3d5;
  --sage: #8a9a7b;
  --sage-deep: #5c6e52;
  --sage-light: #a8b89a;
  --sage-muted: #c5d1bc;
  --gold: #c9a96e;
  --linen: #faf6f1;

  /* semantic */
  --bg: var(--linen);
  --surface: #ffffff;
  --surface-2: var(--cream);
  --surface-3: var(--cream-warm);
  --line: #e3d7c8;
  --line-strong: #d6c7b4;
  --ink: var(--espresso);
  --muted: #6b5f52;
  --faint: #92857a;

  --primary: var(--sage-deep);
  --primary-hover: #4b5b43;
  --primary-ink: #ffffff;
  --accent: var(--clay-deep);
  --gold-ink: #7a5a1f;

  --success: #4f7a4a;
  --success-bg: #e7efe1;
  --warn: #a9762c;
  --warn-bg: #f6ead2;
  --danger: #b23a2a;
  --danger-bg: #f4ded8;

  /* ticket ageing */
  --age-fresh: var(--sage-deep);
  --age-warm: var(--clay-deep);
  --age-urgent: var(--danger);

  --r-sm: 8px;
  --r: 14px;
  --r-lg: 22px;
  --shadow: 0 4px 18px rgba(61, 46, 36, 0.10);
  --shadow-lg: 0 12px 40px rgba(61, 46, 36, 0.16);

  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body: "Jost", "Calibri", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { font-size: 17px; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; font-weight: 550; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 600; letter-spacing: 0.01em; line-height: 1.15; }

/* ---- Topbar ---- */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 22px; background: var(--espresso); color: var(--cream);
  min-height: 66px; box-shadow: var(--shadow);
}
.topbar a { color: var(--sage-muted); }
.topbar .logo { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; letter-spacing: 0.01em; white-space: nowrap; color: var(--cream); }
.topbar .logo .dot { color: var(--gold); }
.topbar .spacer { flex: 1; }
.topbar .who { color: var(--sage-muted); font-size: 0.95rem; }
.topbar select, .topbar input { background: rgba(255,255,255,0.08); color: var(--cream); border-color: rgba(255,255,255,0.18); }
.topbar select option { color: var(--ink); }

/* ---- Buttons (min 48px tall = age/touch friendly) ---- */
button, .btn {
  font: inherit; font-weight: 600; cursor: pointer;
  border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink);
  border-radius: var(--r-sm); padding: 12px 18px; min-height: 48px;
  transition: background 0.12s, border-color 0.12s, transform 0.05s, box-shadow 0.12s;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button:hover, .btn:hover { background: var(--surface-2); }
button:active, .btn:active { transform: translateY(1px); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-accent { background: var(--clay); color: #fff; border-color: transparent; }
.btn-accent:hover { background: var(--clay-deep); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-outline { background: transparent; }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-lg { padding: 16px 24px; font-size: 1.1rem; min-height: 56px; }
.btn-block { display: block; width: 100%; }

/* ---- Inputs (48px) ---- */
input, select, textarea {
  font: inherit; background: var(--surface); color: var(--ink);
  border: 1.5px solid var(--line-strong); border-radius: var(--r-sm);
  padding: 12px 14px; min-height: 48px;
}
input:focus, select:focus, textarea:focus { outline: 3px solid var(--sage-light); outline-offset: -1px; border-color: var(--sage); }
label.field { display: block; margin-bottom: 14px; }
label.field span { display: block; color: var(--muted); font-size: 0.9rem; font-weight: 550; margin-bottom: 6px; }
label.field input, label.field select { width: 100%; }

/* ---- Segmented control ---- */
.seg { display: inline-flex; border: 1.5px solid var(--line-strong); border-radius: 999px; overflow: hidden; background: var(--surface); }
.seg button { border: none; border-radius: 0; background: transparent; padding: 11px 22px; min-height: 46px; font-weight: 600; }
.seg button.on { background: var(--primary); color: var(--primary-ink); }

/* ---- Cards ---- */
.card { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }

/* ---- Badges ---- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 0.8rem; font-weight: 700;
  padding: 4px 11px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.05em; }
.badge.eat { background: var(--success-bg); color: var(--success); }
.badge.take { background: var(--warn-bg); color: var(--warn); }
.badge.role { background: var(--sage-muted); color: var(--sage-deep); }

/* ---- Utility ---- */
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-variant-numeric: tabular-nums; }
.display { font-family: var(--font-display); }
.conn { width: 12px; height: 12px; border-radius: 50%; background: var(--faint); flex: none; }
.conn.on { background: #8fd39c; box-shadow: 0 0 8px rgba(120,200,140,0.7); }
.conn.off { background: #e39a8f; }

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff; padding: 14px 24px; border-radius: var(--r);
  font-weight: 650; font-size: 1.05rem; box-shadow: var(--shadow-lg); display: none; z-index: 100;
}
.toast.err { background: var(--danger); }

.modal-bg { position: fixed; inset: 0; background: rgba(44,40,37,0.5); backdrop-filter: blur(2px);
  display: none; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.modal-bg.open { display: flex; }
.modal { background: var(--surface); border-radius: var(--r-lg); width: 100%; max-width: 500px;
  max-height: 90vh; overflow: auto; box-shadow: var(--shadow-lg); }
.modal h3 { padding: 20px 24px; border-bottom: 1.5px solid var(--line); font-size: 1.6rem; }
.modal .modal-body { padding: 20px 24px; }
.modal .modal-foot { padding: 18px 24px; border-top: 1.5px solid var(--line); display: flex; gap: 12px; justify-content: flex-end; }

.spin { display: inline-block; width: 20px; height: 20px; border: 3px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
