/* Broodautomaten — shared design tokens and components.
   Idea: a stainless-steel bread machine. Cool steel greys for the frame,
   crust brown for bread, and a "lamp" yellow for lit (premium) compartments. */

:root {
  --bg: #f1f3f5;
  --card: #ffffff;
  --line: #dfe4e9;
  --line-strong: #c3cbd3;
  --steel: #8794a1;
  --muted: #5a6672;
  --ink: #1d2731;
  --crust: #b4621f;
  --crust-dark: #7e3f0e;
  --crust-soft: #f6e9dc;
  --lamp: #ffc83d;
  --lamp-deep: #b88400;
  --lamp-soft: #fff4d1;
  --basil: #2f7a55;
  --basil-soft: #e1f1e7;
  --alarm: #b8352c;
  --alarm-soft: #fbe5e3;
  --focus: #2b6cb0;
  --verified: #1f6fd0;

  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --shadow-panel: 0 1px 0 var(--line), 0 12px 32px -18px rgba(29, 39, 49, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 600; }
p { margin: 0 0 8px; }
a { color: var(--crust-dark); }
img { max-width: 100%; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- Wordmark ---- */
.wordmark { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.wordmark svg { width: 34px; height: 34px; flex-shrink: 0; }
/* stacked name + tagline */
.wordmark-name, .wordmark-sub { display: block; }
.wordmark-name { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: -0.02em; line-height: 1; }
.wordmark-sub { font-size: 12.5px; color: var(--muted); line-height: 1.2; margin-top: 2px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: 700 14px/1 var(--font-body);
  padding: 10px 14px; min-height: 40px;
  border-radius: var(--r-sm); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn svg { flex-shrink: 0; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #2d3a47; }
.btn-crust { background: var(--crust); color: #fff; }
.btn-crust:hover:not(:disabled) { background: var(--crust-dark); }
.btn-lamp { background: var(--lamp); color: var(--ink); border-color: var(--lamp-deep); }
.btn-lamp:hover:not(:disabled) { background: #ffd666; }
.btn-line { background: var(--card); color: var(--ink); border-color: var(--line-strong); }
.btn-line:hover:not(:disabled) { border-color: var(--ink); }
.btn-quiet { background: transparent; color: var(--muted); padding-left: 8px; padding-right: 8px; }
.btn-quiet:hover:not(:disabled) { color: var(--ink); background: var(--bg); }
.btn-danger { background: var(--card); color: var(--alarm); border-color: #e7b7b2; }
.btn-danger:hover:not(:disabled) { background: var(--alarm); color: #fff; border-color: var(--alarm); }
.btn-good { background: var(--basil); color: #fff; }
.btn-good:hover:not(:disabled) { background: #245f42; }
.btn-sm { min-height: 32px; padding: 7px 10px; font-size: 13px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--crust-dark); text-decoration: underline; cursor: pointer; }

/* ---- Forms ---- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field > label, .field-label { font-weight: 700; font-size: 13.5px; }
.field .hint { font-size: 12.5px; color: var(--muted); }
.row { display: flex; gap: 12px; }
.row > .field { flex: 1; }
.row > .field.narrow { flex: 0 0 110px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=tel], input[type=number], input[type=search], select, textarea {
  font: 15px/1.4 var(--font-body); color: var(--ink);
  background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  padding: 9px 11px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(43, 108, 176, .18); }
textarea { resize: vertical; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }
.form-error { color: var(--alarm); font-size: 13.5px; min-height: 0; margin: 4px 0 10px; }
.form-error:empty { display: none; }

/* ---- Chips / status ---- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700; line-height: 1;
  padding: 5px 8px; border-radius: 999px;
  background: var(--bg); color: var(--muted); border: 1px solid var(--line);
}
.chip-open { background: var(--basil-soft); color: var(--basil); border-color: #bfe0cc; }
.chip-crust { background: var(--crust-soft); color: var(--crust-dark); border-color: #ecd3bb; }
.chip-lamp { background: var(--lamp-soft); color: #7a5800; border-color: #f2dc95; }
.chip-alarm { background: var(--alarm-soft); color: var(--alarm); border-color: #efc4bf; }
.chip-ink { background: var(--ink); color: #fff; border-color: var(--ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(29, 39, 49, .45);
  display: none; align-items: flex-start; justify-content: center;
  padding: 6vh 16px 16px; overflow-y: auto;
}
.modal-overlay.visible { display: flex; }
.modal {
  background: var(--card); border-radius: var(--r-lg); width: 100%; max-width: 560px;
  box-shadow: 0 30px 80px -30px rgba(29, 39, 49, .6);
  animation: modal-in .18s ease-out;
}
.modal-sm { max-width: 440px; }
@keyframes modal-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 6px; }
.modal-body { padding: 10px 20px 20px; }
.modal-close { background: none; border: 0; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: var(--r-sm); }
.modal-close:hover { background: var(--bg); color: var(--ink); }
.modal-intro { color: var(--muted); margin-bottom: 14px; }

/* ---- Toast ---- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 3000;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; font-weight: 700; font-size: 14px;
  padding: 12px 16px; border-radius: var(--r-md); max-width: calc(100vw - 32px);
  transition: opacity .2s, transform .2s;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--alarm); }

/* ---- Auth screens (admin + bakker) ---- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; background: var(--card); border-radius: var(--r-lg); padding: 28px 24px; box-shadow: var(--shadow-panel); }
.auth-card .wordmark { margin-bottom: 22px; }
.auth-card h1 { margin-bottom: 6px; }
.auth-card .modal-intro { margin-bottom: 18px; }
.auth-switch { margin-top: 14px; font-size: 14px; color: var(--muted); text-align: center; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---- Products / payment / shop-hours editor (baker portal + admin) ---- */
.le-section { margin-bottom: 22px; }
.le-section h3 { margin-bottom: 2px; }
.le-section > p { margin-bottom: 10px; }
.le-prods { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.le-prod { display: grid; grid-template-columns: 1fr 120px 110px auto; gap: 6px; align-items: center; }
.le-price { display: flex; align-items: center; gap: 4px; }
.le-price > span { color: var(--muted); font-weight: 700; }
.le-pay { display: flex; flex-wrap: wrap; gap: 6px; }
.le-paychip { position: relative; cursor: pointer; }
.le-paychip input { position: absolute; opacity: 0; pointer-events: none; }
.le-paychip span { display: inline-block; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 14px; font-weight: 700; color: var(--muted); background: var(--card); }
.le-paychip input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.le-paychip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.le-shop { margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fafbfc; }
.le-days { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.le-day { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 40px; border-bottom: 1px solid var(--line); padding: 4px 0; }
.le-dayname { width: 130px; }
.le-blocks { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.le-blocks input[type=time] { width: auto; padding: 6px 8px; }
.le-second { display: inline-flex; align-items: center; gap: 6px; }
.le-second.hidden { display: none; }
@media (max-width: 640px) {
  .le-prod { grid-template-columns: 1fr 1fr; }
  .le-prod .le-pname { grid-column: span 2; }
  .le-dayname { width: 100%; }
}

/* Shop week table (popup + portal preview) */
table.week { border-collapse: collapse; font-size: 13px; width: 100%; }
table.week th { text-align: left; font-weight: 400; color: var(--muted); padding: 2px 10px 2px 0; }
table.week td { padding: 2px 0; }
table.week tr.today th, table.week tr.today td { font-weight: 700; color: var(--ink); }

.le-modes { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 8px; }
.le-mdays { margin-top: 6px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fafbfc; }
.le-mtext { margin-top: 6px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
