:root {
  --bg: #0f1115; --card: #181b22; --card2: #20242d; --line: #2b303b;
  --text: #eef0f4; --muted: #9098a8; --green: #4ade80; --amber: #fbbf24; --red: #f87171; --blue: #60a5fa;
  --radius: 12px; --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif; -webkit-text-size-adjust: 100%; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
input[type=checkbox] { width: 22px; height: 22px; min-height: 0; accent-color: var(--green); }
input[type=color] { padding: 2px; width: 48px; min-width: 48px; height: 44px; }
textarea { min-height: 140px; resize: vertical; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--card2); cursor: pointer; text-decoration: none; color: var(--text); white-space: nowrap; }
.btn:hover { border-color: #3c4250; }
.btn.primary { background: var(--green); color: #052e14; border-color: var(--green); font-weight: 600; }
.btn.danger { color: var(--red); }
.btn.small { min-height: 34px; padding: 0 10px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
.muted { color: var(--muted); }
.center { display: grid; place-items: center; min-height: 60vh; padding: 24px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 12px 16px calc(40px + var(--safe-b)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card h2 { margin: 0 0 12px; font-size: 17px; }
h1 { font-size: 22px; margin: 8px 0 16px; }
.grid2 { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: rgba(15,17,21,.94); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); padding: calc(8px + env(safe-area-inset-top, 0px)) 16px 8px; }
.top-in { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 10px; }
.brand { font-weight: 800; letter-spacing: .5px; text-decoration: none; color: var(--text); display: inline-flex; align-items: center; gap: 8px; flex: none; }
.brand img { height: 30px; width: auto; display: block; }
@media (max-width: 520px) { .brand span { display: none; } .brand img { height: 24px; } .seg a { padding: 7px 9px; } }
.brandlogo { display: block; width: 100%; max-width: 300px; height: auto; margin: 0 0 18px -6px; }
.evname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); flex: none; box-shadow: 0 0 0 3px rgba(248,113,113,.2); }
.dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(74,222,128,.2); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; flex: none; }
.seg a, .seg button { padding: 7px 12px; text-decoration: none; color: var(--muted); background: none; border: 0; cursor: pointer; font-size: 14px; }
.seg .on { background: var(--card2); color: var(--text); }
.menu-btn { background: none; border: 1px solid var(--line); border-radius: 10px; min-width: 40px; height: 36px; cursor: pointer; }

/* counters */
.counters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.counter { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.counter b { display: block; font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.counter span { font-size: 13px; color: var(--muted); }
.counter.in b { color: var(--green); } .counter.open b { color: var(--amber); }
.capbar { height: 6px; background: var(--card2); border-radius: 3px; overflow: hidden; margin-top: -2px; margin-bottom: 10px; }
.capbar i { display: block; height: 100%; background: var(--green); }
.capbar.warn i { background: var(--amber); } .capbar.full i { background: var(--red); }

/* door */
.search { position: sticky; top: 0; }
.search input { font-size: 18px; min-height: 52px; padding-left: 44px; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%239098a8' stroke-width='2'%3E%3Ccircle cx='9' cy='9' r='6'/%3E%3Cpath d='m14 14 4 4'/%3E%3C/svg%3E") no-repeat 14px center; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--muted); cursor: pointer; font-size: 14px; white-space: nowrap; }
.chip.on { color: var(--text); border-color: var(--text); background: var(--card2); }
.chip .sw { width: 10px; height: 10px; border-radius: 50%; }
.toolbar { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin: 6px 0 8px; font-size: 14px; }
.toolbar select { width: auto; min-height: 36px; padding: 4px 10px; }
.list { list-style: none; margin: 0; padding: 0; }
.guest { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 8px; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }
.guest:active { transform: scale(.995); background: var(--card2); }
.guest .band { width: 14px; align-self: stretch; border-radius: 4px; flex: none; min-height: 36px; border: 1px solid rgba(255,255,255,.15); }
.guest .band.none { background: repeating-linear-gradient(45deg, #2b303b 0 4px, transparent 4px 8px); }
.guest .main { flex: 1; min-width: 0; }
.guest .name { font-size: 18px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.guest .meta { font-size: 13px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.guest .state { text-align: right; font-size: 13px; color: var(--muted); flex: none; }
.guest .check { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; margin-left: auto; }
.guest.in { opacity: .55; }
.guest.in .check { background: var(--green); border-color: var(--green); color: #052e14; font-weight: 900; }
.guest.flash { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: #1e3a2a; } to { background: var(--card); } }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.new { background: var(--blue); color: #061528; }
.note-ico { color: var(--amber); }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }

/* sheet (bottom modal) */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--card); border: 1px solid var(--line); border-radius: 18px 18px 0 0; width: 100%; max-width: 560px;
  padding: 20px 18px calc(18px + var(--safe-b)); max-height: 92vh; overflow: auto; animation: up .18s ease-out; }
@media (min-width: 700px) { .backdrop { align-items: center; } .sheet { border-radius: 18px; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.sheet h3 { margin: 0 0 4px; font-size: 24px; }
.sheet .big { width: 100%; min-height: 60px; font-size: 20px; margin-top: 14px; }
.notebox { background: rgba(251,191,36,.12); border: 1px solid rgba(251,191,36,.4); color: #fde68a; border-radius: 10px; padding: 10px 12px; margin: 12px 0; white-space: pre-wrap; }
.bandbox { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; margin: 12px 0; font-weight: 700; font-size: 18px; }
.warnbox { background: rgba(248,113,113,.12); border: 1px solid rgba(248,113,113,.4); border-radius: 10px; padding: 12px; margin: 12px 0; }

/* full-screen wristband flash */
.bandflash { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px; cursor: pointer; animation: pop .15s ease-out; }
.bandflash .l1 { font-size: 22px; font-weight: 600; opacity: .85; }
.bandflash .l2 { font-size: clamp(40px, 12vw, 88px); font-weight: 900; line-height: 1.05; margin: 10px 0; text-transform: uppercase; }
.bandflash .l3 { font-size: 20px; opacity: .85; }
.bandflash .l4 { font-size: 14px; opacity: .6; margin-top: 30px; }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }

/* production */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 8px 0 14px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button.on { color: var(--text); border-bottom-color: var(--green); }
.addform { display: grid; gap: 8px; grid-template-columns: 2fr minmax(170px, 1.2fr) 2fr auto; align-items: end; }
@media (max-width: 800px) { .addform { grid-template-columns: 1fr; } }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 13px; color: var(--muted); font-weight: 500; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.gt td .sub { font-size: 13px; color: var(--muted); }
.gt tr.in td:not(:last-child) { color: var(--muted); }
.st-in { color: var(--green); font-weight: 600; } .st-open { color: var(--amber); }
.acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 700px) {
  .gt thead { display: none; }
  .gt tr { display: grid; grid-template-columns: 30px 1fr auto; gap: 2px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .gt td { border: 0; padding: 0; }
  .gt td.c-sel { grid-row: 1 / span 3; padding-top: 2px; }
  .gt td.c-name { grid-column: 2; } .gt td.c-st { grid-column: 3; grid-row: 1; text-align: right; }
  .gt td.c-band { grid-column: 2 / -1; font-size: 13px; }
  .gt td.c-act { grid-column: 2 / -1; }
  .gt td.c-act .acts { justify-content: flex-start; margin-top: 6px; }
}
.label { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(255,255,255,.2); flex: none; }
.wbrow, .wbhead { display: grid; grid-template-columns: 48px minmax(110px,1fr) 130px minmax(160px,2fr) 70px auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.wbhead { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.wbrow .cater { justify-content: center; font-size: 18px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (max-width: 760px) { .wbhead { display: none; } .wbrow { grid-template-columns: 48px 1fr 1fr; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
  .wbrow > input[data-f=zones], .wbrow > input[name=zones] { grid-column: 1 / -1; } }
.credbox { display: block; }
.credbox .ctype { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; opacity: .8; }
.credbox .cname { font-size: 24px; font-weight: 800; }
.zonebox { background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: -4px 0 12px; }
.zonebox.catering { color: var(--green); font-weight: 600; }
.bandflash .l5 { font-size: 20px; font-weight: 700; margin-top: 8px; }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; color: var(--text); font-size: 16px; margin: 0; }
.log { list-style: none; margin: 0; padding: 0; max-height: 520px; overflow: auto; font-size: 14px; }
.log li { padding: 7px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; }
.log time { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.bulkbar { position: sticky; bottom: 0; background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-top: 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; }
details summary { cursor: pointer; color: var(--blue); margin-top: 12px; }

/* events / login */
.evcard { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.evcard h3 { margin: 0; font-size: 18px; }
.login { max-width: 380px; margin: 10vh auto; padding: 0 16px; }
.login .logo { font-size: 34px; font-weight: 900; letter-spacing: 1px; margin-bottom: 4px; }
.login form > * + * { margin-top: 12px; }
.err { color: var(--red); font-size: 14px; min-height: 20px; }

/* menu + toasts */
.dropdown { position: fixed; right: 16px; top: calc(54px + env(safe-area-inset-top, 0px)); background: var(--card); border: 1px solid var(--line); border-radius: 12px; min-width: 200px; padding: 6px; z-index: 30; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.dropdown a, .dropdown button { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 8px; color: var(--text); text-decoration: none; background: none; border: 0; cursor: pointer; }
.dropdown a:hover, .dropdown button:hover { background: var(--card2); }
.dropdown .who { padding: 8px 12px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + var(--safe-b)); z-index: 70; display: grid; gap: 8px; width: min(92vw, 460px); }
.toast { background: #2a2f3a; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; box-shadow: 0 6px 20px rgba(0,0,0,.4); animation: up .15s ease-out; }
.toast.err { border-color: var(--red); } .toast.ok { border-color: var(--green); }
.offline { background: rgba(248,113,113,.15); color: #fecaca; text-align: center; font-size: 14px; padding: 6px; }
