@font-face {
  font-family: Roboto;
  src: url("./Roboto.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #0b1020;
  --card: rgba(255, 255, 255, 0.08);
  --text: #f4f7fb;
  --muted: #9ca8c3;
  --accent: #7c98ff;
  --accent-strong: #5f7ff6;
  --border: rgba(255, 255, 255, 0.12);
  --danger: #ff7d7d;
  font-family: Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: linear-gradient(180deg, #0b1020 0%, #141c33 100%);
  color: var(--text);
}
button, input, select {
  font: inherit;
}
button {
  border: none;
  border-radius: 16px;
  padding: 12px 16px;
  background: var(--accent);
  color: white;
  cursor: pointer;
}
button.secondary {
  background: transparent;
  border: 1px solid var(--border);
}
button.danger { color: var(--danger); border-color: var(--danger); }
button.danger:hover:not(:disabled) { background: rgba(255, 125, 125, 0.12); }
input, select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 12px 14px;
  background: rgba(255,255,255,0.04);
  color: var(--text);
}
label {
  display: grid;
  gap: 8px;
}
.shell {
  min-height: 100vh;
  padding: 24px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 28px;
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 80px rgba(0,0,0,0.25);
}
.login-card {
  max-width: 520px;
  margin: 7vh auto;
  padding: 32px;
  display: grid;
  gap: 24px;
}
.login-card form {
  display: grid;
  gap: 16px;
}
.app {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
}
.sidebar, .content {
  padding: 24px;
}
.sidebar-header, .content-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 8px;
}
h1, h2, p { margin: 0; }
.muted { color: var(--muted); }
.queue-list, .entries {
  margin-top: 20px;
  display: grid;
  gap: 14px;
}
.queue-item, .entry-item {
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px;
  background: rgba(255,255,255,0.04);
}
.queue-item.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.entry-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.ticket {
  font-size: 28px;
  font-weight: 700;
}
.badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(124, 152, 255, 0.15);
  color: #dfe6ff;
}
.entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.error {
  color: var(--danger);
  min-height: 1.2em;
}
.hidden { display: none !important; }
.sidebar { position:relative; }
.menu-toggle { width:44px; height:44px; flex:none; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; padding:8px; background:transparent; border:0; color:var(--text); }
.menu-toggle span { width:22px; height:2px; border-radius:2px; background:currentColor; }
.page-menu { position:absolute; z-index:5; top:76px; right:20px; min-width:180px; display:grid; gap:3px; padding:10px; border:1px solid var(--border); border-radius:18px; background:#202941; box-shadow:0 16px 40px rgba(0,0,0,.35); }
.branch-nav { display:grid; gap:4px; margin-top:22px; padding:18px 0 4px; border-top:1px solid var(--border); }
.branch-nav-link { width:100%; padding:11px 12px; border:0; border-radius:10px; background:transparent; color:var(--text); text-align:left; }
.branch-nav-link:hover, .branch-nav-link.active { background:rgba(124,152,255,.16); }
.branch-form { max-width:640px; margin-top:24px; }
.coordinate-settings { border:1px solid var(--border); border-radius:16px; padding:16px; }
.coordinate-settings summary { cursor:pointer; }
.coordinate-settings p { margin:12px 0; }
.coordinate-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.users-list { display:grid; gap:10px; margin-top:24px; }
.user-row { padding:16px; border:1px solid var(--border); border-radius:14px; }
.user-row { display:grid; gap:10px; }
.user-row-header, .user-row-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.user-row-header strong { margin-right:auto; }
.user-row-actions select, .user-row-actions input { width:auto; min-width:150px; }
.user-row-actions select { border:1px solid var(--border); border-radius:12px; padding:10px; background:#202941; color:var(--text); }
.user-create-form { max-width:760px; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); align-items:end; }
.user-create-form button { align-self:end; }
.audit-list { display:grid; gap:8px; }
.audit-row { display:flex; gap:12px; flex-wrap:wrap; color:var(--muted); font-size:.9rem; }
.join-pass-dialog { width:min(92vw,420px); border:1px solid var(--border); border-radius:20px; padding:24px; background:#202941; color:var(--text); text-align:center; }
.join-pass-dialog::backdrop { background:rgba(0,0,0,.68); }
.join-pass-dialog img { display:block; width:min(100%,300px); aspect-ratio:1; margin:20px auto; background:white; border-radius:12px; }
.join-pass-dialog .header-actions { justify-content:center; }
.menu-link { display:block; width:100%; padding:11px 14px; border:0; border-radius:10px; background:transparent; color:var(--text); text-align:left; }
.menu-link:hover, .menu-link:focus-visible { background:rgba(255,255,255,.09); }
.menu-link.active { color:var(--accent); font-weight:700; }
.settings-form { display:grid; gap:18px; margin-top:24px; max-width:760px; }
.settings-form select { width:100%; border-radius:14px; border:1px solid var(--border); padding:12px 14px; background:#202941; color:var(--text); }
.settings-accordions { display:grid; gap:14px; max-width:900px; margin-top:22px; }
.routing-form { max-width:none; margin:0; gap:14px; }
.settings-disclosure { border:1px solid var(--border); border-radius:20px; background:rgba(255,255,255,.035); overflow:hidden; }
.settings-disclosure > summary { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:20px; list-style:none; cursor:pointer; font-size:18px; font-weight:700; }
.settings-disclosure > summary::-webkit-details-marker { display:none; }
.settings-disclosure > summary:focus-visible { outline:3px solid var(--accent); outline-offset:-4px; }
.disclosure-icon { flex:none; width:12px; height:12px; margin:0 6px; border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(45deg); transition:transform .2s ease; }
.settings-disclosure[open] .disclosure-icon { transform:rotate(225deg); }
.disclosure-body { padding:0 20px 20px; }
.settings-controls { display:grid; gap:18px; }
.settings-lanes, .settings-options { display:grid; gap:12px; }
.settings-row { display:grid; grid-template-columns:1fr 1fr auto; align-items:end; gap:12px; padding:14px; border:1px solid var(--border); border-radius:16px; }
.settings-options .settings-row { grid-template-columns:1fr 1fr; }
.settings-column-title { padding:0 14px; font-weight:700; }
.settings-column-headings { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:12px; padding:0 14px; font-weight:700; }
.settings-row.lane-row { grid-template-columns:minmax(0,1fr) auto; align-items:center; }
.settings-options .settings-row.mapping-row { grid-template-columns:minmax(0,1fr) minmax(0,1fr); align-items:center; }
.settings-form .muted { line-height:1.5; }
.definition-toolbar { display:flex; flex-wrap:wrap; align-items:end; gap:10px; margin-top:20px; }
.definition-selector { min-width:min(100%, 280px); flex:1 1 280px; }
.definition-selector select { background:#202941; }
.definition-form { max-width:none; margin:0; }
.definition-form h3, .definition-form h4 { margin:0; }
.definition-field { display:grid; gap:12px; padding:16px; margin:12px 0; border:1px solid var(--border); border-radius:16px; }
.definition-options { display:grid; gap:10px; }
.definition-option-level { padding-left:12px; border-left:2px solid var(--border); }
.definition-option-level.depth-1 { margin-left:22px; }
.definition-option-level.depth-2 { margin-left:44px; }
.definition-option-level.depth-3 { margin-left:66px; }
.definition-option-level.depth-4 { margin-left:88px; }
.definition-option-level.depth-5 { margin-left:110px; }
.definition-option { display:grid; grid-template-columns:1fr 2fr auto; align-items:end; gap:10px; }
.checkbox-row { display:flex; align-items:center; gap:10px; }
.checkbox-row input { width:auto; }
@media (max-width:600px) { .definition-option { grid-template-columns:1fr; } }
@media (max-width:600px) { .coordinate-grid { grid-template-columns:1fr; } }
@media (max-width:600px) { .settings-row, .settings-options .settings-row { grid-template-columns:1fr; } }
@media (max-width:600px) { .settings-row.lane-row { grid-template-columns:minmax(0,1fr) auto; } .settings-options .settings-row.mapping-row { grid-template-columns:minmax(0,1fr) minmax(0,1fr); } }
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
}

button:disabled { opacity: 0.5; cursor: default; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.queue-item { text-align: left; display: grid; gap: 8px; }
.entry-fields { display: grid; gap: 8px; }
.entry-fields > div { display: flex; flex-wrap: wrap; gap: 8px; }
.entry-fields dt { color: var(--muted); }
.entry-fields dd { margin: 0; overflow-wrap: anywhere; }
#connection-status, #app-error { margin-top: 12px; }
