:root {
  --ink: #22301F;
  --paper: #F7F4EC;
  --green: #3C6B4A;
  --green-pale: #E7F0E9;
  --amber: #C97A3D;
  --amber-pale: #FBEEE3;
  --slate: #6B6A5E;
  --line: #DDD6C4;
  --red: #A3402E;
  --red-pale: #F6E4E0;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

.screen {
  min-height: 100dvh;
  padding-bottom: 84px; /* clear the tab bar */
}
.screen.hidden { display: none; }

.topbar {
  padding: max(14px, env(safe-area-inset-top)) 20px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-titles { display: flex; flex-direction: column; gap: 3px; }
.topbar h1 { font-size: 21px; margin: 0; font-weight: 800; letter-spacing: -0.01em; line-height: 1.15; }
.eyebrow {
  font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--green); font-weight: 800; line-height: 1;
}
.topbar .back {
  background: none; border: none; font-size: 22px; color: var(--ink);
  padding: 0 6px 0 0; cursor: pointer; line-height: 1;
}

.list { padding: 14px 16px 0; }

.ticket {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; margin-bottom: 10px; position: relative;
}
.ticket.urgent { border-left: 4px solid var(--amber); }
.ticket-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 5px; }
.ticket-top .name { font-size: 16px; font-weight: 800; color: var(--ink); }
.wait { font-size: 11px; font-weight: 700; color: var(--amber); background: var(--amber-pale); padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.wait.old { color: var(--red); background: var(--red-pale); }
.wait.sched { color: var(--green); background: var(--green-pale); }
.what { font-size: 13px; color: #4b4a3f; margin-bottom: 10px; }
.actions { display: flex; gap: 8px; }
.btn { flex: 1; text-align: center; font-size: 12.5px; font-weight: 700; padding: 9px 0; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.btn.call { background: var(--green); color: #fff; border-color: var(--green); }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }

.empty { padding: 40px 20px; text-align: center; color: var(--slate); font-size: 14px; }
.empty .big { font-size: 32px; margin-bottom: 8px; }

.fab {
  position: fixed; bottom: 96px; right: 20px; width: 56px; height: 56px;
  border-radius: 50%; background: var(--ink); color: #fff; border: none;
  font-size: 28px; font-weight: 300; box-shadow: 0 8px 18px rgba(0,0,0,0.25);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  z-index: 20;
}

.detail { padding: 18px 20px; }
.subline { font-size: 13px; color: var(--slate); margin-top: -6px; }
.statuspill {
  display: inline-block; margin-top: 10px; font-size: 11.5px; font-weight: 700;
  color: var(--green); background: var(--green-pale); padding: 5px 11px; border-radius: 20px;
}
.field { margin-top: 18px; }
.flabel {
  font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: #9a9686; font-weight: 700; margin-bottom: 5px;
}
.fbox {
  width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 12px; font-size: 15px; color: #3a382f; font-family: inherit;
}
textarea.fbox { resize: vertical; }
.bigbtn {
  display: block; width: 100%; margin-top: 20px; background: var(--green); color: #fff;
  text-align: center; padding: 14px 0; border-radius: 12px; font-size: 15.5px; font-weight: 800;
  border: none; cursor: pointer; text-decoration: none;
}
.rowbtns { display: flex; gap: 10px; margin-top: 10px; }
.rowbtns .bigbtn { flex: 1; margin-top: 0; padding: 12px 0; font-size: 13.5px; }
.bigbtn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }

.status-actions { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.status-actions .bigbtn { margin-top: 0; }

.danger-zone { margin-top: 30px; text-align: center; }
.linkbtn { background: none; border: none; color: var(--slate); font-size: 12.5px; text-decoration: underline; cursor: pointer; }

.repeat-banner {
  margin-top: 12px; background: var(--amber-pale); border-left: 3px solid var(--amber);
  border-radius: 8px; padding: 11px 13px; font-size: 13px; line-height: 1.5;
}
.repeat-banner button {
  margin-top: 8px; background: var(--ink); color: #fff; border: none; border-radius: 8px;
  padding: 7px 12px; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.hidden { display: none !important; }

.search-wrap { padding: 14px 16px 0; }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; height: 76px;
  padding-bottom: env(safe-area-inset-bottom);
  background: #fff; border-top: 1px solid var(--line);
  display: flex; z-index: 30;
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 700; color: #9a9686; gap: 4px;
  background: none; border: none; cursor: pointer; padding-top: 6px;
}
.tab .dot { width: 20px; height: 20px; border-radius: 6px; background: #EEEBE0; }
.tab.on { color: var(--ink); }
.tab.on .dot { background: var(--ink); }

.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 30px;
  font-size: 13.5px; font-weight: 600; z-index: 50; box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}
