@font-face {
  font-family: QueueArabic;
  src: url("/static/fonts/Arabic-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: QueueArabic;
  src: url("/static/fonts/Arabic-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
:root {
  --brand: #087f79;
  --brand-2: #fff;
  --bg: #f3f6f7;
  --paper: #fff;
  --ink: #1c343b;
  --muted: #71848a;
  --border: #e5ecee;
  --danger: #bc4952;
  --radius: 16px;
  --shadow: 0 6px 24px #19353a06;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    14px/1.7 QueueArabic,
    "Segoe UI",
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
a {
  color: var(--brand);
  text-decoration: none;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(23px, 2.15vw, 32px);
  line-height: 1.6;
  letter-spacing: -0.5px;
}
h2 {
  font-size: 1.0625rem;
}
h3 {
  font-size: 1rem;
}
small {
  font-size: 0.6875rem;
  color: var(--muted);
}
[hidden] {
  display: none !important;
}
.icon {
  width: 21px;
  height: 21px;
  flex-shrink: 0;
  vertical-align: middle;
}
.eyebrow {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 1.6px;
  color: var(--brand);
  margin-bottom: 9px;
}
.muted {
  color: var(--muted);
  font-size: 0.75rem;
}
.admin-layout {
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
  min-height: 100vh;
}
.admin-nav {
  background: #fff;
  border-inline-end: 1px solid var(--border);
  padding: 28px 17px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.nav-brand {
  display: flex;
  gap: 11px;
  align-items: center;
  color: var(--ink);
  margin: 0 6px 37px;
  min-width: 0;
}
.nav-brand strong {
  display: block;
  font-size: 0.875rem;
  max-width: 160px;
  overflow-wrap: anywhere;
}
.nav-brand small {
  display: block;
  font-size: 0.5rem;
  letter-spacing: 1.1px;
  margin-top: 2px;
}
.brand-symbol {
  width: 45px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--brand);
}
.brand-symbol > span {
  font:
    700 42px/1 "Segoe UI",
    sans-serif;
  letter-spacing: -5px;
  direction: ltr;
  padding-inline-end: 5px;
}
.brand-dot {
  color: #ddad6d;
}
.brand-symbol img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.nav-label {
  font-size: 0.5625rem;
  letter-spacing: 1px;
  color: #9aabb0;
  padding: 0 15px;
  margin: 13px 0 10px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  position: relative;
  border: none;
  background: none;
  width: 100%;
  color: #667f85;
  padding: 12px 15px;
  border-radius: 10px;
  font-size: 0.75rem;
  text-align: start;
  margin-bottom: 4px;
}
.nav-link .icon {
  width: 19px;
  height: 19px;
}
.nav-link:hover {
  background: #f5f9f9;
  color: var(--brand);
}
.nav-link.active {
  background: #eaf5f2;
  color: var(--brand);
  font-weight: 700;
}
.nav-link.active i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand);
  margin-inline-start: auto;
}
.nav-bottom {
  margin-top: auto;
  padding-top: 24px;
}
.nav-logout {
  color: #aa6c70;
}
.nav-bottom form {
  margin: 0;
}
.version {
  display: block;
  margin: 18px 15px 0;
  font-size: 0.5625rem;
  letter-spacing: 1px;
}
.admin-workspace {
  min-width: 0;
}
.topbar {
  height: 82px;
  padding: 0 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffffa3;
  border-bottom: 1px solid var(--border);
  font-size: 0.6875rem;
  color: var(--muted);
  gap: 16px;
}
.topbar-tools {
  display: flex;
  gap: 18px;
  align-items: center;
}
.connection {
  font-size: 0.625rem;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.connection i,
.audit-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #37a38b;
  display: inline-block;
}
.connection.offline i {
  background: #d89e4a;
}
.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e2efeb;
  color: var(--brand);
  border: 3px solid white;
  box-shadow: 0 0 0 1px var(--border);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-weight: 700;
}
.lang-btn {
  font-size: 0.6875rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 4px 11px;
  white-space: nowrap;
}
.admin-content {
  padding: 35px 38px 20px;
  max-width: 1680px;
  margin: auto;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 27px;
}
.page-heading p {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 6px;
}
.page-heading > .btn-primary {
  white-space: nowrap;
}
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-danger,
.btn-danger-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1.6;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.75rem;
  min-height: 39px;
  padding: 9px 17px;
  text-decoration: none;
  transition:
    filter 0.15s,
    background 0.15s;
}
.btn-primary {
  background: var(--brand);
  color: var(--brand-2);
  border: 1px solid var(--brand);
  box-shadow: 0 4px 9px #087f7915;
}
.btn-primary:hover {
  filter: brightness(0.93);
}
.btn-secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--border);
}
.btn-secondary:hover,
.btn-ghost:hover {
  background: #f1f7f6;
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
  border: 1px solid var(--danger);
}
.btn-danger-text {
  color: var(--danger);
  border: 1px solid transparent;
  background: transparent;
}
.btn-danger-text:hover {
  background: #fff1f1;
}
.btn-primary .icon {
  width: 16px;
  height: 16px;
}
.actions {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}
.actions form {
  margin: 0;
}
.actions button {
  min-height: 32px;
  font-size: 0.6875rem;
  padding: 6px 12px;
}
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 25px;
}
.stat-card {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius);
  padding: 20px 23px;
  box-shadow: var(--shadow);
}
.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.6875rem;
  gap: 8px;
}
.stat-top .icon {
  padding: 7px;
  box-sizing: content-box;
  background: #f0f7f5;
  border-radius: 10px;
  color: var(--brand);
  width: 18px;
  height: 18px;
}
.stat-card > strong {
  display: block;
  font:
    700 37px/1.4 "Segoe UI",
    sans-serif;
  color: var(--ink);
  margin: 14px 0 4px;
}
.stat-card > strong.text-small {
  font-family: inherit;
  font-size: 1.25rem;
  min-height: 45px;
  padding-top: 5px;
}
.stat-card > small {
  font-size: 0.625rem;
}
.stat-called {
  border-top: 3px solid var(--brand);
  padding-top: 18px;
}
.stat-waiting .stat-top .icon {
  background: #fff7e9;
  color: #b38c3b;
}
.stat-served .stat-top .icon {
  background: #edf6ef;
  color: #4b8b64;
}
.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 23px;
  overflow: hidden;
}
.padded {
  padding: 25px;
}
.panel-head {
  padding: 21px 23px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f0f3f4;
  gap: 16px;
}
.panel-head h2 {
  font-size: 0.875rem;
}
.panel-head a {
  font-size: 0.6875rem;
}
.panel-head > .icon {
  color: #9aafb2;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 23px;
}
.service-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 23px;
  border-bottom: 1px solid #f2f5f6;
}
.service-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--svc), white 90%);
  border-radius: 10px;
  color: var(--svc);
  font:
    700 19px "Segoe UI",
    sans-serif;
}
.service-row strong {
  font-size: 0.75rem;
}
.service-row small {
  display: block;
  font-size: 0.625rem;
}
.count-badge {
  margin-inline-start: auto;
  border-radius: 6px;
  padding: 4px 9px;
  background: #f3f7f7;
  color: #6e858a;
  font-size: 0.625rem;
}
.quick-counts a {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #f0f4f4;
  padding: 16px 24px;
  gap: 18px;
}
.quick-counts strong {
  font:
    700 25px "Segoe UI",
    sans-serif;
  color: var(--ink);
  width: 32px;
}
.quick-counts span {
  color: var(--muted);
  font-size: 0.75rem;
}
.quick-counts .icon {
  margin-inline-start: auto;
  width: 16px;
  color: #b6c5c6;
}
.quiet-note {
  font-size: 0.6875rem;
  color: var(--muted);
  padding: 15px 20px;
  background: #edf3f3;
  border: 1px solid #e4eded;
  border-radius: 10px;
  margin-bottom: 21px;
}
.panel .quiet-note {
  margin: 20px;
}
.audit-list > div {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 25px;
  border-bottom: 1px solid #f2f5f6;
  font-size: 0.6875rem;
}
.audit-list strong {
  font-size: 0.6875rem;
  font-weight: 400;
}
.audit-list > div > span:not(.audit-dot) {
  color: var(--muted);
  margin-inline-start: auto;
}
.audit-list time {
  color: #9caaae;
  font-size: 0.625rem;
}
.page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.5625rem;
  letter-spacing: 1px;
  color: #9aadb0;
  padding: 12px 2px;
}
.notice {
  padding: 16px 20px;
  border-radius: 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.75rem;
  margin-bottom: 23px;
  border: 1px solid;
}
.notice.success {
  background: #eaf6f0;
  border-color: #d5ebdf;
  color: #2d775e;
}
.notice.warning {
  background: #fff9ed;
  border-color: #f1e6cd;
  color: #8b7040;
}
.notice p {
  margin: 6px 0;
}
.inline-links {
  display: flex;
  gap: 20px;
  margin-top: 9px;
  font-weight: 700;
}
.sync-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  padding: 13px 18px;
  background: #fff7e7;
  border: 1px solid #eddfbc;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 0.6875rem;
}
.welcome-card {
  border: 1px solid #d9e9e4;
  background: #eaf3f0;
  border-radius: 16px;
  padding: 26px;
  margin-bottom: 25px;
}
.welcome-card h2 {
  font-size: 1.1875rem;
}
.setup-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 20px;
}
.setup-steps a {
  background: #ffffffc9;
  padding: 17px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.6875rem;
}
.setup-steps b {
  font:
    700 22px "Segoe UI",
    sans-serif;
  opacity: 0.35;
}
.setup-steps .icon {
  margin-inline-start: auto;
  width: 15px;
}
.list-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
}
.tabs {
  display: flex;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #e9eff0;
  gap: 3px;
}
.tabs a {
  font-size: 0.6875rem;
  color: #7a8d91;
  min-width: 94px;
  text-align: center;
  padding: 6px 15px;
  border-radius: 6px;
}
.tabs .selected {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 1px 3px #0000000a;
  font-weight: 700;
}
.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 9px;
  padding: 0 12px;
  width: 280px;
}
.search-field .icon {
  color: #9aaeb2;
  width: 16px;
}
.search-field input {
  border: 0;
  padding: 9px 0;
  min-width: 0;
  width: 100%;
  background: transparent;
  font-size: 0.6875rem;
  outline: none;
}
.table-scroll {
  overflow: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: start;
  font-size: 0.75rem;
}
.data-table th {
  text-align: start;
  font-size: 0.625rem;
  color: #82959a;
  font-weight: 400;
  background: #fafcfc;
  padding: 14px 23px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 18px 23px;
  border-bottom: 1px solid #eff3f4;
  vertical-align: middle;
}
.data-table tbody tr:last-child td {
  border-bottom: 0;
}
.data-table tbody tr:hover {
  background: #fbfdfd;
}
.data-table strong {
  font-size: 0.75rem;
}
.person-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 170px;
}
.person-cell small {
  display: block;
  font-size: 0.625rem;
}
.row-avatar {
  background: #edf5f3;
  color: #72978f;
  border: 1px solid #e1eeea;
  width: 39px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 0.625rem;
  white-space: nowrap;
  background: #edf2f3;
  color: #7c8e93;
}
.status-badge:before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.status-badge.enabled,
.status-served {
  background: #eaf5ef;
  color: #4a8c6c;
}
.status-called {
  background: #e2f3ef;
  color: #138571;
}
.status-waiting {
  background: #fdf5e4;
  color: #ac863c;
}
.status-cancelled,
.status-skipped {
  background: #f9edef;
  color: #af6e76;
}
.pill-ghost {
  display: inline-block;
  border: 1px solid var(--border);
  background: #f7fafa;
  color: #6b878b;
  font-size: 0.625rem;
  padding: 3px 7px;
  border-radius: 5px;
  margin: 2px;
}
.ticket-prefix {
  color: var(--svc);
  background: color-mix(in srgb, var(--svc), white 92%);
  padding: 5px 13px;
  border-radius: 6px;
  font-weight: 700;
}
.ticket-id {
  font-family: "Segoe UI", sans-serif;
  font-size: 1.125rem !important;
  display: inline-block;
}
.small-count {
  display: inline-block;
  padding: 1px 8px;
  background: #f0f5f4;
  border-radius: 5px;
  font:
    11px "Segoe UI",
    sans-serif;
  color: var(--muted);
  margin-inline-start: 7px;
}
.empty-state {
  text-align: center !important;
  padding: 45px 25px !important;
  color: var(--muted);
}
.empty-state h3 {
  color: var(--ink);
  margin: 10px 0;
}
.empty-state p {
  font-size: 0.75rem;
}
.empty-icon {
  width: 49px;
  height: 49px;
  border-radius: 14px;
  background: #f1f6f4;
  color: #85aaa1;
  display: inline-grid;
  place-items: center;
}
.no-results {
  text-align: center;
  padding: 20px;
  color: var(--muted);
}
dialog {
  border: 1px solid #dde8e5;
  border-radius: 18px;
  padding: 0;
  color: var(--ink);
  box-shadow: 0 28px 90px #102c3c3d;
  max-height: 90dvh;
  overflow: auto;
  background: #fff;
}
dialog::backdrop {
  background: #13373c70;
  backdrop-filter: blur(4px);
}
.editor-dialog {
  width: min(650px, calc(100vw - 28px));
}
.compact-dialog {
  width: min(440px, calc(100vw - 28px));
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 25px;
  border-bottom: 1px solid var(--border);
  gap: 20px;
}
.dialog-head h2 {
  font-size: 1.125rem;
}
.dialog-head .eyebrow {
  margin-bottom: 3px;
}
.dialog-body {
  padding: 24px 25px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.dialog-actions {
  padding: 18px 25px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fafcfc;
}
.icon-button {
  border: 1px solid var(--border);
  background: white;
  color: #8b9ba0;
  font-size: 1.5rem;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  line-height: 1;
  padding: 0;
}
.dialog-body label,
.stack-form > label,
.filter-bar > label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #617b81;
  font-size: 0.75rem;
}
.two-col,
.three-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.two-col label,
.three-col label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #617b81;
  font-size: 0.75rem;
}
input:not([type="checkbox"]):not([type="range"]),
select,
textarea {
  border: 1px solid #dce7e7;
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 42px;
  width: 100%;
  background: #fff;
  color: var(--ink);
  outline: none;
  font-size: 0.75rem;
}
input:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px #087f7910;
}
input[type="color"] {
  height: 44px;
  padding: 5px !important;
}
input[type="checkbox"] {
  accent-color: var(--brand);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
input[type="range"] {
  accent-color: var(--brand);
  width: 100%;
}
.field-hint {
  font-size: 0.6875rem;
  color: #869a9f;
  margin: 0;
  line-height: 1.9;
}
.choice-grid {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 15px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.choice-grid legend {
  font-size: 0.6875rem;
  color: #6a8288;
  padding: 0 6px;
}
.choice {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 10px !important;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
}
.choice small {
  display: block;
  font-size: 0.5625rem;
}
.switch-row {
  display: flex !important;
  align-items: center;
  flex-direction: row !important;
  gap: 12px !important;
  padding: 12px;
  background: #f5f9f8;
  border-radius: 9px;
}
.switch-row strong {
  font-size: 0.75rem;
}
.switch-row small {
  display: block;
  font-size: 0.625rem;
  margin-top: 3px;
}
.form-error {
  color: #9e4c54;
  background: #fff0f0;
  border: 1px solid #f1d5d7;
  border-radius: 9px;
  padding: 12px;
  font-size: 0.75rem;
}
.form-error .btn-ghost {
  margin-top: 9px;
  background: #fff;
}
.form-error .help-link {
  display: block;
  margin-top: 8px;
}
.stack-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 20px;
}
.stack-form .btn-primary,
.stack-form .btn-secondary {
  align-self: flex-start;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.settings-grid .panel {
  margin-bottom: 0;
}
.logo-preview {
  max-width: 180px;
  max-height: 100px;
  object-fit: contain;
  margin-top: 20px;
}
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 13px;
  margin-bottom: 20px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  flex-wrap: wrap;
}
.filter-bar > label {
  min-width: 140px;
}
.filter-bar .grow {
  flex: 1;
}
.pagination {
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: center;
  padding: 17px;
  border-top: 1px solid var(--border);
  font-size: 0.6875rem;
  color: var(--muted);
}
.confirm-dialog {
  width: min(420px, calc(100vw - 32px));
}
.confirm-dialog > p {
  padding: 23px;
  font-size: 0.8125rem;
  color: #6c858a;
}
.portal-signin {
  min-height: 100dvh;
  padding: clamp(16px, 4vw, 48px);
}
.portal-signin .login-card {
  width: min(100%, 520px);
  box-sizing: border-box;
}
.portal-signin h1 {
  font-size: clamp(1.1rem, 3vw, 1.7rem);
  line-height: 1.5;
  text-wrap: balance;
}
.login-tools {
  display: flex;
  justify-content: flex-end;
  margin-block: 20px;
}
.portal-signin .subtle-link {
  display: block;
  margin-block-start: 24px;
}
.room-waiting-list li small {
  color: var(--muted);
  flex-basis: 100%;
}
.login-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}
.login-story {
  background: #173f42;
  color: #fff;
  padding: 65px 65px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.login-story:after {
  content: "";
  width: 500px;
  height: 500px;
  border: 1px solid #ffffff0b;
  border-radius: 50%;
  position: absolute;
  inset-inline-end: -200px;
  bottom: -250px;
  box-shadow:
    0 0 0 55px #ffffff03,
    0 0 0 110px #ffffff02;
}
.login-story .eyebrow {
  color: #a5c9bd;
  letter-spacing: 4px;
  font-size: 0.75rem;
  margin-bottom: 40px;
}
.login-story h1 {
  font-size: clamp(30px, 3.4vw, 52px);
  font-weight: 700;
  line-height: 1.7;
}
.login-story p {
  max-width: 350px;
  color: #a2c3c0;
  font-size: 0.8125rem;
  margin-top: 22px;
  line-height: 2.2;
}
.login-story > small {
  color: #a2c3c0;
  font:
    9px "Segoe UI",
    sans-serif;
  letter-spacing: 3px;
  margin-top: 55px;
}
.story-art {
  display: flex;
  align-items: center;
  gap: 15px;
  direction: ltr;
  margin-top: 48px;
}
.story-art > span {
  border: 1px solid #658a8660;
  border-radius: 12px;
  padding: 18px 22px;
  font:
    25px "Segoe UI",
    sans-serif;
  color: #b2c9c6;
}
.story-art > .art-active {
  background: #e7cf9c;
  color: #244e4a;
  transform: translateY(-8px);
  border: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.login-main {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #f9fbfa;
  padding: 40px;
}
.login-card {
  width: min(360px, 100%);
}
.login-card > .brand-symbol {
  margin-bottom: 25px;
}
.login-card .eyebrow {
  letter-spacing: 0.5px;
  color: #8ba09f;
}
.login-card h2 {
  font-size: 1.75rem;
  margin-bottom: 8px;
}
.login-card > p {
  color: var(--muted);
  font-size: 0.75rem;
}
.login-card .stack-form {
  margin-top: 32px;
  gap: 22px;
}
.login-card .btn-primary {
  width: 100%;
  justify-content: space-between;
  margin-top: 5px;
  padding: 13px 18px;
}
.subtle-link {
  display: block;
  font-size: 0.6875rem;
  color: var(--muted);
  margin: 25px 0 15px;
}
.center-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 25px;
}
.error-card {
  max-width: 540px;
}
.error-card p {
  margin: 18px 0 24px;
  color: var(--muted);
}
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  padding: 13px 25px;
  background: #153e3d;
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 30px #0003;
  z-index: 500;
  font-size: 0.75rem;
  max-width: 90vw;
}
#toast.error {
  background: #9d454f;
}
code {
  font:
    11px "Segoe UI",
    sans-serif;
  color: #7d9095;
  padding: 3px 6px;
  background: #f3f7f8;
  border-radius: 4px;
  display: inline-block;
  direction: ltr;
}
.offline-banner {
  padding: 10px 20px;
  background: #fff2d6;
  color: #8b6b31;
  text-align: center;
  font-size: 0.75rem;
}
/* Live screens */
.live-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 36px;
  border-bottom: 1px solid var(--border);
}
.live-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.live-brand h1 {
  font-size: 1.1875rem;
}
.live-brand small {
  font-size: 0.625rem;
}
.live-tools {
  display: flex;
  align-items: center;
  gap: 14px;
}
.kiosk {
  min-height: 100vh;
  background: #f3f7f6;
  display: flex;
  flex-direction: column;
}
.kiosk-main {
  width: min(1000px, 100%);
  margin: auto;
  padding: 40px 28px;
  text-align: center;
}
.kiosk-main h2 {
  font-size: 2.1875rem;
  margin-bottom: 12px;
}
.kiosk-main > p {
  color: var(--muted);
  margin-bottom: 35px;
}
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.service-btn {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: white;
  min-height: 185px;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  padding: 25px;
  gap: 10px;
  box-shadow: 0 7px 25px #244b3a05;
  transition:
    transform 0.18s,
    border 0.18s;
  color: var(--ink);
}
.service-btn:hover {
  transform: translateY(-4px);
  border-color: var(--svc, var(--brand));
}
.svc-prefix {
  font:
    700 35px "Segoe UI",
    sans-serif;
  color: var(--svc, var(--brand));
  border-radius: 14px;
  background: color-mix(in srgb, var(--svc, var(--brand)), white 92%);
  padding: 10px 20px;
  direction: ltr;
}
.svc-name {
  font-size: 1.125rem;
  font-weight: 700;
}
.service-btn small {
  font-size: 0.625rem;
}
.live-footer {
  text-align: center;
  color: #91a6a9;
  font-size: 0.6875rem;
  padding: 24px;
}
.ticket-modal {
  position: fixed;
  inset: 0;
  background: #173f427d;
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.ticket-card {
  width: min(420px, 100%);
  border-radius: 22px;
  background: #fff;
  text-align: center;
  padding: 35px;
  box-shadow: 0 20px 90px #0002;
}
.ticket-number {
  font:
    700 66px/1.5 "Segoe UI",
    sans-serif;
  color: var(--brand);
  direction: ltr;
  margin: 12px 0;
}
.ticket-label {
  font-size: 0.75rem;
  color: var(--muted);
}
.ticket-service {
  font-size: 1.1875rem;
}
.ticket-time,
.ticket-wait {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 8px 0;
}
.ticket-actions {
  margin-top: 25px;
}
.display {
  min-height: 100vh;
  background: #103437;
  color: #fff;
  display: flex;
  flex-direction: column;
}
.display .live-header {
  border-color: #ffffff16;
}
.display .brand-symbol {
  color: #e3c88f;
}
.display .live-brand small {
  color: #8bb2b0;
}
.display .lang-btn {
  color: #9cbdbb;
  border-color: #ffffff20;
}
.display-clock {
  font:
    22px "Segoe UI",
    sans-serif;
  color: #c6dedb;
  direction: ltr;
}
.display-main {
  flex: 1;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 28px;
  padding: 35px 40px;
  min-height: 0;
}
.display-now {
  border: 1px solid #ffffff14;
  background: linear-gradient(145deg, #204d4d, #143e40);
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 25px;
  position: relative;
  min-height: 380px;
}
.now-label {
  color: #b1ceca;
  font-size: 1.125rem;
}
.now-number {
  font:
    700 clamp(70px, 10vw, 155px) / 1.35 "Segoe UI",
    sans-serif;
  color: #e6ce9f;
  direction: ltr;
  letter-spacing: 2px;
}
.now-counter {
  font-size: clamp(23px, 3vw, 38px);
  color: #fff;
}
.display-now .eyebrow {
  color: #89b2aa;
  position: absolute;
  top: 25px;
  inset-inline-start: 25px;
  font-size: 0.625rem;
}
.display-recent {
  padding-top: 4px;
}
.display-recent h2 {
  font-size: 1.0625rem;
  font-weight: 400;
  color: #b4ccca;
  margin: 0 0 22px;
}
.display-recent ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.display-recent li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff06;
  border: 1px solid #ffffff0c;
  padding: 16px 20px;
  border-radius: 11px;
  gap: 20px;
}
.r-num {
  font:
    700 29px "Segoe UI",
    sans-serif;
  direction: ltr;
  color: #d8e8e2;
}
.r-counter {
  font-size: 1rem;
  color: #9cbdb6;
}
.display-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #ffffff15;
  margin: 0 40px;
  padding: 22px 5px;
  gap: 20px;
  flex-wrap: wrap;
}
.display-stats > div {
  display: flex;
  align-items: center;
  gap: 18px;
}
.display-stats strong {
  font:
    700 27px "Segoe UI",
    sans-serif;
  color: #e5ce9f;
}
.display-stats small {
  color: #8eb1ae;
  font-size: 0.75rem;
}
.audio-start {
  background: #244b4d;
  border: 1px solid #ffffff25;
  color: #b8d4cc;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.6875rem;
}
.display .connection {
  color: #8eb8ad;
}
.staff {
  min-height: 100vh;
}
.staff-main {
  width: min(750px, 100%);
  padding: 35px 24px;
  margin: auto;
}
.staff-login {
  max-width: 440px;
  margin: 30px auto;
  padding: 35px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.staff-login h2 {
  font-size: 1.5rem;
}
.staff-login > p {
  font-size: 0.75rem;
  color: var(--muted);
}
.staff-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}
.staff-name {
  font-weight: 700;
  font-size: 1.0625rem;
}
.staff-head small {
  display: block;
}
.staff-panel > .panel {
  padding: 25px;
}
.staff-current {
  text-align: center;
  padding: 32px 20px;
  background: #f0f7f5;
  border-radius: 14px;
  margin: 25px 0;
}
.current-label {
  color: var(--muted);
  font-size: 0.75rem;
}
.current-number {
  font:
    700 66px/1.5 "Segoe UI",
    sans-serif;
  color: var(--brand);
  direction: ltr;
}
.current-counter {
  font-size: 1.1875rem;
}
.staff-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}
.staff-actions button {
  min-height: 60px;
  font-size: 0.875rem;
}
.staff-actions .btn-call {
  grid-column: span 2;
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: 10px;
}
.staff-actions .btn-served {
  background: #e5f4e9;
  color: #398259;
  border: 1px solid #cee8d6;
  border-radius: 10px;
}
.staff-actions .btn-recall {
  background: #edf3f5;
  color: #617b87;
  border: 1px solid #dde8ec;
  border-radius: 10px;
}
.staff-actions .btn-skip {
  grid-column: span 2;
  background: none;
  color: #ad8956;
  border: 1px solid #ede3d0;
  border-radius: 10px;
  min-height: 40px;
  font-size: 0.75rem;
}
.staff-waiting {
  text-align: center;
  padding-top: 22px;
  color: var(--muted);
  font-size: 0.75rem;
}
.staff-waiting span {
  font:
    700 20px "Segoe UI",
    sans-serif;
  color: var(--brand);
  margin: 0 7px;
}
.home-main {
  width: min(1100px, 100%);
  margin: auto;
  padding: 50px 35px;
}
.home-intro {
  text-align: center;
  margin: 15px 0 45px;
}
.home-intro h1 {
  font-size: 2.3125rem;
}
.home-intro p {
  color: var(--muted);
  margin-top: 10px;
}
.home-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
.home-card {
  border: 1px solid var(--border);
  border-radius: 17px;
  padding: 30px 23px;
  background: #fff;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.15s;
}
.home-card:hover {
  transform: translateY(-4px);
}
.home-card > .icon {
  color: var(--brand);
  width: 30px;
  height: 30px;
}
.home-card strong {
  font-size: 1.0625rem;
}
.home-card small {
  font-size: 0.6875rem;
}
.home-card .home-arrow {
  margin-top: 18px;
  color: #aac1ba;
}
.display-now.highlight {
  animation: callflash 0.8s ease-in-out;
}
@keyframes callflash {
  50% {
    border-color: #e6ce9f;
    box-shadow: 0 0 40px #e6ce9f20;
  }
}
@media (min-width: 1600px) {
  .admin-content {
    padding-top: 45px;
  }
  .stat-card {
    padding: 26px;
  }
  .data-table td {
    padding-top: 22px;
    padding-bottom: 22px;
  }
}
@media (max-width: 1100px) {
  .admin-layout {
    grid-template-columns: 224px minmax(0, 1fr);
  }
  .admin-nav {
    padding: 24px 12px;
  }
  .admin-content {
    padding: 28px 25px;
  }
  .topbar {
    padding: 0 25px;
  }
  .stat-cards {
    gap: 12px;
  }
  .stat-card {
    padding: 17px;
  }
  .stat-top {
    font-size: 0.625rem;
  }
  .stat-card > strong {
    font-size: 1.9375rem;
  }
  .setup-steps {
    grid-template-columns: 1fr;
  }
  .home-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .login-story {
    padding: 45px;
  }
  .data-table th,
  .data-table td {
    padding-inline: 16px;
  }
}
@media (max-width: 820px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .admin-nav {
    position: relative;
    height: auto;
    padding: 16px;
    border-inline-end: 0;
    border-bottom: 1px solid var(--border);
  }
  .nav-brand {
    margin: 0 8px 13px;
  }
  .admin-nav > .nav-label,
  .nav-bottom {
    display: none;
  }
  .admin-nav nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 3px;
  }
  .nav-link {
    width: auto;
    white-space: nowrap;
    font-size: 0.625rem;
    padding: 9px 12px;
    margin: 0;
  }
  .nav-link.active i {
    display: none;
  }
  .nav-link .icon {
    width: 15px;
  }
  .topbar {
    height: 58px;
    padding: 0 20px;
  }
  .admin-content {
    padding: 25px 20px;
  }
  .stat-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-grid .panel {
    margin-bottom: 0;
  }
  .dashboard-grid {
    margin-bottom: 22px;
  }
  .page-heading {
    align-items: flex-start;
  }
  .page-heading h1 {
    font-size: 1.4375rem;
  }
  .page-heading > .btn-primary {
    font-size: 0.6875rem;
    padding: 9px 12px;
    margin-top: 22px;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .login-layout {
    grid-template-columns: 1fr;
  }
  .login-story {
    display: none;
  }
  .login-main {
    min-height: 100vh;
  }
  .display-main {
    padding: 24px;
    gap: 20px;
  }
  .display-stats {
    margin: 0 25px;
  }
  .live-header {
    padding: 20px 24px;
  }
  .now-number {
    font-size: clamp(65px, 12vw, 120px);
  }
  .display-recent li {
    padding: 13px;
  }
  .r-num {
    font-size: 1.5rem;
  }
  .r-counter {
    font-size: 0.8125rem;
  }
}
@media (max-width: 520px) {
  .admin-content {
    padding: 22px 14px;
  }
  .topbar > span {
    display: none;
  }
  .topbar {
    justify-content: flex-end;
  }
  .topbar-tools {
    gap: 12px;
  }
  .page-heading {
    flex-direction: column;
    gap: 15px;
  }
  .page-heading > .btn-primary {
    margin-top: 0;
  }
  .page-heading p {
    font-size: 0.6875rem;
  }
  .page-heading h1 {
    font-size: 1.5rem;
  }
  .stat-card {
    padding: 16px;
  }
  .stat-top .icon {
    padding: 5px;
    width: 15px;
  }
  .stat-card small {
    font-size: 0.5625rem;
  }
  .list-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .search-field {
    width: 100%;
  }
  .tabs a {
    flex: 1;
  }
  .panel-head {
    padding: 18px 16px;
  }
  .panel-head .muted {
    font-size: 0.5625rem;
  }
  .two-col,
  .three-col,
  .choice-grid {
    grid-template-columns: 1fr;
  }
  .dialog-head,
  .dialog-body {
    padding: 20px;
  }
  .dialog-actions {
    padding: 16px 20px;
  }
  .audit-list > div {
    flex-wrap: wrap;
    padding: 14px 18px;
    gap: 9px;
  }
  .audit-list time {
    margin-inline-start: 18px;
  }
  .home-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .home-main {
    padding: 30px 18px;
  }
  .home-card {
    padding: 23px 16px;
  }
  .home-card strong {
    font-size: 0.875rem;
  }
  .home-card small {
    font-size: 0.625rem;
  }
  .home-intro h1 {
    font-size: 1.75rem;
  }
  .live-brand h1 {
    font-size: 0.9375rem;
  }
  .live-header {
    padding: 16px;
    gap: 10px;
  }
  .live-brand {
    gap: 8px;
  }
  .live-tools {
    gap: 8px;
  }
  .live-header .connection {
    font-size: 0.5625rem;
  }
  .kiosk-main h2 {
    font-size: 1.8125rem;
  }
  .display-main {
    grid-template-columns: 1fr;
    padding: 20px;
  }
  .display-now {
    min-height: 330px;
  }
  .display-recent li {
    padding: 9px 16px;
  }
  .display-recent ul {
    gap: 8px;
  }
  .display-stats {
    margin: 0 20px;
    padding: 17px 0;
  }
  .display-clock {
    font-size: 1.0625rem;
  }
  .display .live-tools {
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 150px;
  }
  .audio-start {
    font-size: 0.5625rem;
    padding: 5px 8px;
  }
  .staff-head {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-bar {
    padding: 16px;
  }
  .filter-bar > label {
    min-width: 100%;
    flex: 1;
  }
  .filter-bar .btn-secondary {
    width: 100%;
  }
  .page-footer {
    font-size: 0.5rem;
  }
  .quiet-note {
    font-size: 0.625rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
.block {
  display: block;
}
.timing-summary {
  display: flex;
  gap: 25px;
  flex-wrap: wrap;
}
.timing-summary span {
  font-size: 0.6875rem;
  color: var(--muted);
}
.timing-summary strong {
  display: block;
  font-size: 1.375rem;
  color: var(--brand);
  direction: ltr;
}
.staff-main.board-main {
  width: min(1400px, 100%);
}
.room-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 370px), 1fr));
  gap: 22px;
  align-items: start;
}
.room-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 23px;
}
.room-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 15px;
}
.room-card h2 {
  font-size: 1.25rem;
}
.room-card .staff-current {
  margin: 15px 0;
  padding: 19px;
}
.room-card .current-number {
  font-size: 2.9375rem;
}
.room-card .staff-actions {
  gap: 9px;
}
.room-card .staff-actions button {
  min-height: 43px;
  font-size: 0.75rem;
}
.room-card .staff-actions .btn-start {
  grid-column: span 2;
  background: #e6f2f6;
  color: #26718c;
  border: 1px solid #d0e8f0;
  border-radius: 9px;
}
.room-card .queue-section {
  padding-top: 18px;
  border-top: 1px solid var(--border);
  margin-top: 17px;
}
.queue-section > header {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
}
.queue-tickets {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 12px 0;
}
.queue-tickets span {
  background: #f2f7f6;
  padding: 5px 10px;
  border-radius: 6px;
  font:
    12px "Segoe UI",
    sans-serif;
  color: var(--muted);
  direction: ltr;
}
.queue-tickets span:first-child {
  background: #deeee8;
  color: var(--brand);
  font-weight: 700;
}
.room-time {
  color: var(--muted);
  font-size: 0.6875rem;
}
.display-banner {
  padding: 9px 20px;
  background: #214c50;
  color: #d8cba6;
  font-size: 0.75rem;
  text-align: center;
}
.audio-test {
  background: none;
  border: 1px solid #ffffff25;
  color: #b8d4cc;
  border-radius: 7px;
  font-size: 0.625rem;
  padding: 7px;
}
.audio-start.is-ready {
  color: #b8dec7;
}
.audio-start.is-blocked {
  color: #f0c890;
  border-color: #b08d57;
}
@media print {
  body {
    background: #fff !important;
    color: #000;
  }
  .admin-layout {
    display: block;
  }
  .admin-nav,
  .topbar,
  .page-footer,
  .no-print,
  .sync-notice,
  #toast {
    display: none !important;
  }
  .admin-content {
    padding: 0;
    max-width: none;
  }
  .panel,
  .stat-card {
    box-shadow: none;
    break-inside: avoid;
  }
  .table-scroll {
    overflow: visible;
  }
  .data-table {
    font-size: 0.5625rem;
  }
  .data-table td,
  .data-table th {
    padding: 7px;
  }
  .page-heading h1 {
    font-size: 1.375rem;
  }
  a {
    color: #000;
  }
  .quiet-note {
    font-size: 0.5625rem;
  }
  .stat-cards {
    grid-template-columns: repeat(4, 1fr);
  }
}
/* 2.2: compact horizontal operations and full-window responsiveness. */
html,
body {
  max-width: 100%;
  overflow-x: clip;
}
main,
.admin-workspace,
.admin-content,
.room-card {
  min-width: 0;
}
.home-card {
  text-align: center;
  align-items: center;
  justify-content: center;
}
.home-card small {
  max-width: 25ch;
}
.hypertech-footer {
  text-align: center;
  padding: 14px;
  font-size: 0.6875rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.account-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 10px 22px;
  background: white;
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
}
.room-board {
  display: grid;
  grid-template-columns: 1fr;
}
.room-card .service-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 14px;
}
.room-card .queue-section {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.room-card .staff-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.room-card .staff-actions button,
.room-card .staff-actions .btn-start,
.room-card .staff-actions .btn-skip {
  flex: 1 1 110px;
  grid-column: auto;
  min-height: 40px;
}
.room-card .staff-current {
  padding: 12px;
}
.room-card .current-number {
  font-size: 2.375rem;
}
.room-card .staff-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}
.login-story {
  background: var(--brand);
  color: var(--brand-2);
}
.login-story .eyebrow,
.login-story p,
.login-story > small {
  color: inherit;
  opacity: 0.8;
}
.display {
  background: color-mix(in srgb, var(--brand), #091416 68%);
}
.display-now {
  background: color-mix(in srgb, var(--brand), #162c2d 55%);
}
.display-banner {
  background: color-mix(in srgb, var(--brand), #152b2c 65%);
}
.display .hypertech-footer {
  background: transparent;
  color: #c1d6d2;
}
.now-number {
  color: var(--brand-2);
}
@media (max-width: 600px) {
  .room-card {
    padding: 13px;
  }
  .room-card .staff-actions button {
    flex: 1 1 105px;
  }
  .admin-content {
    padding: 15px 10px;
  }
  .room-card .service-board {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  }
}

/* 2.3: permission-aware sidebar, compact clinical workflow and TV call grid. */
.admin-layout {
  min-height: calc(100vh - 50px);
  grid-template-columns: 250px minmax(0, 1fr);
}
.admin-nav {
  padding: 18px 14px;
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.sidebar-shell {
  width: 100%;
  min-width: 0;
}
.sidebar-toggle {
  display: none;
}
.sidebar-inner {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 40px);
}
.nav-brand {
  margin: 5px 6px 20px;
}
.nav-group {
  margin: 12px 0;
}
.nav-group > summary {
  font-size: 0.75rem;
  font-weight: bold;
  color: var(--ink);
  cursor: pointer;
  padding: 9px 12px;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 7px;
}
.nav-link {
  padding: 9px 12px;
  font-size: 0.75rem;
  white-space: normal;
  overflow-wrap: anywhere;
}
.nav-link.active {
  background: color-mix(in srgb, var(--brand), white 91%);
}
.nav-bottom {
  display: block;
  margin-top: auto;
  padding-top: 15px;
}
.sidebar-tools {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  padding: 12px 4px;
}
.account-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  padding: 10px;
  border-radius: 10px;
  color: var(--ink);
}
.account-chip small {
  display: block;
}
.admin-content {
  padding: 30px;
  max-width: 1680px;
}
.admin-workspace {
  min-width: 0;
}
.account-settings {
  max-width: 620px;
}
.legacy-login {
  border-top: 1px solid var(--border);
  padding-top: 15px;
}
.legacy-login summary {
  cursor: pointer;
}
.legacy-login .stack-form {
  margin-top: 16px;
}
.home-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.home-card {
  min-height: 230px;
  padding: 30px 22px;
  gap: 14px;
}
.home-card strong,
.home-card small {
  width: 100%;
  overflow-wrap: anywhere;
}
.room-board {
  grid-template-columns: 1fr;
}
.room-card {
  padding: 20px;
  margin-bottom: 0;
  box-shadow: var(--shadow);
}
.room-card > header {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.room-card .service-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px;
  margin-top: 16px;
}
.queue-section .btn-primary {
  width: 100%;
  margin-top: auto;
}
.queue-section {
  display: flex;
  flex-direction: column;
}
.queue-section > header {
  flex-wrap: wrap;
}
.queue-tickets {
  min-height: 55px;
}
.room-card .staff-current {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
}
.room-card .current-number {
  font-size: clamp(30px, 4vw, 52px);
}
.room-time {
  grid-column: 1/-1;
}
.room-card .staff-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.room-card .staff-actions > button {
  flex: 1 1 110px;
  min-width: 0;
  padding: 9px 10px;
  min-height: 42px;
  font-size: 0.75rem;
}
.room-card .staff-actions .btn-start {
  grid-column: auto;
}
.room-ready {
  padding: 10px 0;
  color: var(--muted);
  font-size: 0.75rem;
}
.skipped-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
#roleForm {
  margin-top: 20px;
}
.choice input[type="checkbox"] {
  flex: none;
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}
.timeline-stage {
  border-inline-start: 3px solid var(--brand);
  padding: 12px 16px;
  margin: 14px 0;
  background: var(--bg);
  border-radius: 8px;
}
.timeline-stage p {
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}
.kiosk-main {
  max-width: 1200px;
  margin: auto;
  padding: 25px 30px;
}
.kiosk-identity {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.kiosk-identity h1 {
  font-size: clamp(19px, 3vw, 32px);
}
.kiosk-tools {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-bottom: 25px;
}
.kiosk-current {
  margin-top: 36px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}
.kiosk-current ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  padding: 0;
}
.kiosk-current li {
  padding: 12px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 12px;
}
.kiosk-current li strong {
  display: block;
  font:
    700 30px "Segoe UI",
    sans-serif;
  direction: ltr;
  color: var(--brand);
}
.kiosk-current li span {
  font-size: 0.875rem;
}
.page-display {
  background: color-mix(in srgb, var(--brand), #091416 68%);
}
.page-display > .hypertech-footer {
  background: transparent;
  color: #bfd8d4;
  border-color: #ffffff20;
}
.display {
  min-height: calc(100dvh - 52px);
  height: auto;
  display: flex;
  flex-direction: column;
}
.display .live-header {
  flex-wrap: wrap;
  gap: 18px;
  padding: 20px 35px;
}
.display .live-tools {
  flex-wrap: wrap;
  max-width: none;
  gap: 10px;
}
.display-board {
  width: 100%;
  padding: 22px 35px;
  flex: 1;
  min-width: 0;
}
.display-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  color: #d8e9e5;
  margin-bottom: 18px;
}
.display-heading h2 {
  font-size: clamp(17px, 2vw, 26px);
}
.display-ticket-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.display-ticket {
  background: color-mix(in srgb, var(--brand), #162c2d 55%);
  border: 1px solid #ffffff24;
  border-radius: 20px;
  padding: 24px 15px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 195px;
}
.display-ticket-number {
  font:
    700 clamp(38px, 6.3vw, 100px) / 1.4 "Segoe UI",
    sans-serif;
  color: var(--brand-2);
  direction: ltr;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.display-ticket-room {
  font-size: clamp(18px, 2vw, 30px);
  color: white;
  overflow-wrap: anywhere;
}
.display-ticket small {
  color: #b8d4cc;
  font-size: 0.8125rem;
}
.display-empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 90px 20px;
  font-size: 1.75rem;
  color: #c5ded7;
}
.display-stats {
  flex-wrap: wrap;
  gap: 12px;
}
.display-board.highlight {
  animation: callflash 0.8s ease-in-out;
}
.report-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.metric {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}
.metric strong {
  font:
    700 27px/1.8 "Segoe UI",
    sans-serif;
  direction: ltr;
  display: block;
}
.hourly-chart {
  display: flex;
  gap: 5px;
  align-items: end;
  min-height: 200px;
  padding: 25px 20px;
  overflow-x: auto;
}
.hour-bar {
  min-width: 24px;
  flex: 1;
  text-align: center;
}
.hour-bar .bar {
  background: var(--brand);
  border-radius: 6px 6px 0 0;
  height: var(--height);
  min-height: 2px;
}
.hour-bar strong {
  display: block;
  font:
    12px "Segoe UI",
    sans-serif;
  color: var(--muted);
  margin-bottom: 5px;
}
.hour-bar small {
  display: block;
  font:
    10px "Segoe UI",
    sans-serif;
  margin-top: 8px;
}
.report-note {
  max-width: 90ch;
  font-size: 0.75rem;
  color: var(--muted);
}
@media (max-width: 1100px) {
  .admin-layout {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .admin-content {
    padding: 22px;
  }
  .display-ticket-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .display-ticket {
    min-height: 160px;
  }
}
@media (max-width: 820px) {
  .admin-layout {
    display: block;
  }
  .admin-nav {
    position: relative;
    height: auto;
    overflow: visible;
    padding: 10px 15px;
    border-inline-end: 0;
    border-bottom: 1px solid var(--border);
  }
  .sidebar-toggle {
    display: list-item;
    cursor: pointer;
    padding: 7px;
    font-weight: bold;
    color: var(--brand);
  }
  .sidebar-inner {
    min-height: 0;
    padding-top: 12px;
  }
  .admin-nav nav {
    display: block;
    overflow: visible;
  }
  .nav-group .nav-link {
    width: 100%;
    margin: 3px 0;
    font-size: 0.75rem;
    white-space: normal;
  }
  .nav-bottom {
    display: block;
    margin-top: 10px;
  }
  .nav-brand {
    margin-bottom: 15px;
  }
  .admin-content {
    padding: 20px 16px;
  }
  .home-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
  .home-card {
    min-height: 210px;
    padding: 24px 15px;
  }
  .home-card strong {
    font-size: 1rem;
  }
  .display .live-header {
    padding: 18px;
  }
  .display-board {
    padding: 20px;
  }
  .room-card .staff-current {
    grid-template-columns: 1fr;
  }
  .room-time {
    grid-column: auto;
  }
  .display-ticket-number {
    font-size: clamp(40px, 9vw, 75px);
  }
}
@media (max-width: 520px) {
  .home-grid {
    grid-template-columns: 1fr;
  }
  .home-card {
    min-height: 170px;
  }
  .home-card .home-arrow {
    display: none;
  }
  .admin-content {
    padding: 18px 10px;
  }
  .staff-login {
    padding: 23px;
    width: 100%;
    margin: 10px auto;
  }
  .display-ticket-grid {
    gap: 10px;
  }
  .display-ticket {
    padding: 18px 8px;
    min-height: 145px;
  }
  .display-ticket-room {
    font-size: 1rem;
  }
  .display-ticket small {
    font-size: 0.625rem;
  }
  .display-clock {
    font-size: 1.125rem;
  }
  .display .live-header {
    padding: 15px;
  }
  .display-board {
    padding: 15px;
  }
  .display .live-tools {
    justify-content: flex-start;
  }
  .room-card {
    padding: 13px;
  }
  .room-card .staff-actions > button {
    flex-basis: calc(50% - 8px);
  }
  .kiosk-main {
    padding: 25px 16px;
  }
  .report-metrics {
    grid-template-columns: 1fr 1fr;
  }
}
@media print {
  .hypertech-footer {
    font-size: 0.5625rem;
  }
  .sidebar-shell,
  .nav-group {
    display: none;
  }
  .admin-layout {
    display: block;
  }
  .admin-content {
    padding: 0;
  }
  .report-metrics {
    grid-template-columns: repeat(4, 1fr);
  }
  .hourly-chart {
    overflow: visible;
  }
  .metric,
  .timeline-stage {
    break-inside: avoid;
  }
}
@media (max-width: 520px) {
  .room-card .service-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .room-card .queue-section {
    min-width: 0;
    padding: 10px;
  }
  .room-card .queue-section:only-child {
    grid-column: 1/-1;
  }
  .queue-section strong {
    overflow-wrap: anywhere;
  }
  .queue-section .btn-primary {
    padding: 8px;
    font-size: 0.6875rem;
  }
}
/* 2.4: a distinct current call alongside a horizontal room board. */
.display-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.7fr);
  gap: 24px;
  align-items: stretch;
}
.display-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 24px;
  border: 1px solid #ffffff30;
  background: color-mix(in srgb, var(--brand), #102425 65%);
  padding: 30px 18px;
  min-height: 360px;
  color: white;
}
.hero-number {
  font:
    700 clamp(70px, 8vw, 160px) / 1.5 "Segoe UI",
    sans-serif;
  direction: ltr;
  color: var(--brand-2);
  overflow-wrap: anywhere;
  max-width: 100%;
}
.hero-room {
  font-size: clamp(22px, 3vw, 42px);
}
.display-hero p {
  margin-top: 18px;
  color: #c5ded7;
}
.rooms-display {
  min-width: 0;
}
.rooms-display .display-ticket-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
}
.rooms-display .display-ticket-number {
  font-size: clamp(32px, 4vw, 65px);
}
.waiting-services {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.waiting-services span {
  border: 1px solid #ffffff30;
  padding: 5px 12px;
  border-radius: 9px;
}
.transfer-rooms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  border: 0;
  padding: 0;
}
.room-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
}
.room-choice:has(input:checked) {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand), white 92%);
}
.queue-pick {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 6px;
  padding: 5px 9px;
  color: var(--brand);
  font-size: 0.75rem;
  direction: ltr;
}
.service-btn .svc-name {
  font-size: clamp(19px, 2vw, 27px);
}
.home-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
@media (max-width: 820px) {
  .display-layout {
    grid-template-columns: 1fr;
  }
  .display-hero {
    min-height: 250px;
  }
  .hero-number {
    font-size: 5.625rem;
  }
  .rooms-display .display-ticket-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 2.5: personal typography, compact room board and configurable TV presentation. */
html {
  font-size: var(--ui-font-size, 16px);
}
body {
  font-size: 1rem;
}
button,
input,
select,
textarea {
  font-family: inherit;
}
.room-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}
.room-card {
  min-width: 0;
  padding: 18px;
}
.room-card header {
  gap: 8px;
  flex-wrap: wrap;
}
.room-card h2 {
  overflow-wrap: anywhere;
}
.room-card .service-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 125px), 1fr));
  gap: 10px;
}
.room-card .staff-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.room-card .staff-actions button {
  flex: 1 1 105px;
  width: auto;
  min-width: 0;
}
.room-card .queue-section {
  min-width: 0;
}
.room-card .queue-tickets {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.workspace-tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.room-drag-handle,
.room-order-step {
  display: none;
  background: var(--surface);
  color: var(--brand);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
}
.room-drag-handle {
  cursor: grab;
}
.arranging .room-drag-handle,
.arranging .room-order-step {
  display: inline-flex;
}
.arranging .room-card {
  outline: 2px dashed var(--brand);
}
.arranging [data-action],
.arranging [data-return] {
  pointer-events: none;
  opacity: 0.5;
}
.display,
.page-display {
  background: var(--display-bg, #102425);
  color: var(--display-text, #ffffff);
}
.display-layout {
  grid-template-columns: minmax(0, 1fr) minmax(230px, 29%);
  gap: 24px;
  align-items: stretch;
}
.display-hero {
  background: var(--display-bg, #102425);
  color: var(--display-text, #ffffff);
  min-width: 0;
  min-height: min(430px, 55dvh);
  border-color: color-mix(in srgb, var(--display-text, #fff), transparent 75%);
}
.hero-number {
  font-size: clamp(44px, 11vw, var(--display-call-size, 128px));
  line-height: 1.25;
  color: var(--display-accent, #53e0bc);
  overflow-wrap: anywhere;
}
.hero-room {
  font-size: clamp(20px, 3vw, var(--display-room-size, 28px));
}
.display-hero p {
  color: var(--display-text, #fff);
  font-size: var(--display-small-size, 18px);
}
.rooms-display .vertical-rooms {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rooms-display .display-ticket {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px;
  padding: 10px 12px;
  min-height: 78px;
  background: var(--display-card, #193637);
  color: var(--display-text, #fff);
  border-color: color-mix(in srgb, var(--display-text, #fff), transparent 80%);
  border-radius: 14px;
}
.rooms-display .display-ticket-room {
  font-size: clamp(18px, 2vw, var(--display-room-size, 28px));
  color: var(--display-text, #fff);
}
.rooms-display .display-ticket-number {
  font-size: clamp(26px, 4vw, var(--display-ticket-size, 52px));
  line-height: 1.05;
  color: var(--display-accent, #53e0bc);
}
.rooms-display .display-ticket small,
.display-stats small,
.display-heading h2 {
  color: var(--display-text, #fff);
  font-size: var(--display-small-size, 18px);
}
.display .live-header,
.display .display-stats {
  background: var(--display-bg, #102425);
  color: var(--display-text, #fff);
}
.display .live-brand h1,
.display .live-brand small,
.display .display-heading {
  color: var(--display-text, #fff);
}
.display .display-clock,
.display .display-stats strong {
  color: var(--display-accent, #53e0bc);
}
.display .display-banner {
  background: var(--display-card, #193637);
  color: var(--display-text, #fff);
}
.pending-calls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}
.pending-calls span {
  border: 1px solid currentColor;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: var(--display-small-size, 18px);
}
.page-display > .hypertech-footer {
  background: var(--display-bg, #102425);
  color: var(--display-text, #fff);
  min-height: 24px;
  padding: 5px 12px;
  font-size: 12px;
}
.four-col {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.appearance-preview {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  padding: 24px;
  border-radius: 18px;
  background: var(--display-bg, #102425);
  color: var(--display-text, #fff);
  min-height: 210px;
}
.preview-call,
.preview-room {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
}
.preview-call strong {
  font-size: calc(var(--display-call-size, 128px) * 0.45);
  color: var(--display-accent, #53e0bc);
  direction: ltr;
}
.preview-room {
  background: var(--display-card, #193637);
  padding: 10px;
  border-radius: 14px;
}
.preview-room strong {
  font-size: calc(var(--display-ticket-size, 52px) * 0.6);
  color: var(--display-accent, #53e0bc);
}
.preview-room span {
  font-size: calc(var(--display-room-size, 28px) * 0.65);
}
.factory-panel {
  margin-top: 24px;
  border-color: #d66363;
  max-width: 780px;
}
.locale-follow {
  font-size: 0.75rem;
  display: block;
  padding: 8px;
}
@media (max-width: 1350px) {
  .room-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .room-board {
    grid-template-columns: 1fr;
  }
  .four-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 650px) {
  .display-layout {
    grid-template-columns: 1fr;
  }
  .display-hero {
    min-height: 260px;
  }
  .rooms-display .vertical-rooms {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hero-number {
    font-size: clamp(44px, 16vw, var(--display-call-size, 128px));
  }
  .display .live-header {
    flex-wrap: wrap;
  }
  .appearance-preview {
    padding: 14px;
    gap: 10px;
  }
}
@media (min-width: 901px) {
  .rooms-display .display-ticket {
    height: var(--room-card-height, 110px);
    min-height: 0;
    padding: 6px 10px;
  }
  .rooms-display .display-ticket-room {
    font-size: calc(var(--display-room-size, 28px) * var(--room-rail-scale, 1));
    line-height: 1.1;
  }
  .rooms-display .display-ticket-number {
    font-size: calc(
      var(--display-ticket-size, 52px) * var(--room-rail-scale, 1)
    );
    line-height: 1.05;
  }
  .rooms-display .display-ticket small {
    font-size: max(
      11px,
      calc(var(--display-small-size, 18px) * var(--room-rail-scale, 1))
    );
    line-height: 1.1;
  }
}
@media (max-height: 800px) and (min-width: 901px) {
  .display .live-header {
    padding: 10px 22px;
    gap: 8px;
  }
  .display-board {
    padding: 12px 22px;
  }
  .display-heading {
    margin-bottom: 10px;
  }
  .display .display-stats {
    padding: 10px 22px;
  }
  .display-banner {
    padding-block: 6px;
  }
}

.display .eyebrow,
.display .connection {
  color: var(--display-text, #fff);
}
.display .lang-btn {
  color: var(--display-text, #fff);
  border-color: color-mix(in srgb, var(--display-text, #fff), transparent 65%);
}

.room-queue,
.room-display-column {
  display: grid;
  gap: 10px;
}
.room-waiting-list,
.room-display-column {
  padding: 0;
  margin: 0;
  list-style: none;
}
.room-waiting-list li,
.room-queue-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}
.room-waiting-list li {
  padding: 6px 0;
  border-block-end: 1px solid var(--border);
}
.room-waiting-list span {
  overflow-wrap: anywhere;
}
.room-assignment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}
.rooms-display .vertical-rooms {
  display: grid;
  grid-template-columns: repeat(var(--room-columns, 1), minmax(0, 1fr));
  align-items: start;
  gap: 10px;
}
.display-layout:has(.room-display-column:nth-child(2)) {
  grid-template-columns: minmax(0, 1fr) minmax(0, 54%);
}
.room-display-column .display-ticket {
  min-width: 0;
}
.rooms-display .room-display-column .display-ticket-number {
  font-size: max(
    16px,
    calc(var(--display-ticket-size, 52px) * var(--room-rail-scale, 1))
  );
}
.rooms-display .room-display-column .display-ticket-room {
  font-size: max(
    12px,
    calc(var(--display-room-size, 28px) * var(--room-rail-scale, 1))
  );
}
@media (max-width: 650px) {
  .display-layout:has(.room-display-column:nth-child(2)) {
    grid-template-columns: 1fr;
  }
}

[data-theme="medical"] {
  --bg: #eef7f5;
  --paper: #fff;
  --ink: #18393a;
  --muted: #506a6b;
  --border: #cddfdd;
}
[data-theme="blue"] {
  --bg: #eff4fb;
  --paper: #fff;
  --ink: #1b3153;
  --muted: #536785;
  --border: #cfdbeb;
}
[data-theme="green"] {
  --bg: #f1f7f1;
  --paper: #fff;
  --ink: #263c2f;
  --muted: #516757;
  --border: #d0dfd3;
}
[data-theme="dark"] {
  --bg: #122225;
  --paper: #1c3034;
  --ink: #f0f8f6;
  --muted: #bacdc9;
  --border: #4e6969;
  color-scheme: dark;
}
[data-theme="contrast"] {
  --bg: #000;
  --paper: #131313;
  --ink: #fff;
  --muted: #eee;
  --border: #929292;
  color-scheme: dark;
}
body:is([data-theme="dark"], [data-theme="contrast"]):not(.page-display)
  :is(
    .panel,
    .stat-card,
    .room-card,
    .queue-section,
    .staff-login,
    .login-card,
    .home-card,
    .service-btn,
    .ticket-card,
    dialog,
    .data-table th,
    .data-table td,
    input,
    select,
    textarea,
    .btn-secondary,
    .btn-ghost
  ) {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--border);
}
body:is([data-theme="dark"], [data-theme="contrast"]):not(.page-display)
  a:not(.btn-primary, .nav-link) {
  color: var(--ink);
}
.theme-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 12px;
  border: 0;
  padding: 0;
}
.theme-option {
  display: grid;
  gap: 8px;
  cursor: pointer;
  background: var(--sample-bg, var(--bg));
  color: var(--sample-ink, var(--ink));
  border: 2px solid var(--border);
  padding: 12px;
  border-radius: 12px;
}
.theme-option:has(input:checked) {
  border-color: var(--brand);
}
.theme-preview {
  display: flex;
  gap: 5px;
}
.theme-preview i {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border);
}

/* A large group stays inside its rail at the screen's minimum readable size. */
.rooms-display .vertical-rooms {
  max-block-size: var(--room-rail-available, none);
  overflow: auto;
}

/* Unified two-panel sign-in: each portal keeps its own accent. */
.login-layout .login-card .card-sub {
  color: var(--muted);
  font-size: 0.8rem;
  margin: -4px 0 18px;
}
.login-layout .login-card {
  width: min(100%, 520px);
}
.login-layout .login-card h1 {
  font-size: clamp(1.1rem, 2vw, 1.7rem);
  line-height: 1.5;
}
.portal-doctors .login-story {
  background: #163e4d;
}
.portal-doctors .login-story .eyebrow {
  color: #a9c5d6;
}
.portal-doctors .story-art > .art-active {
  background: #9cc3dd;
  color: #12303e;
}
.portal-staff .login-story {
  background: #1d443f;
}
.portal-staff .login-story .eyebrow {
  color: #bcd6c8;
}
.portal-staff .story-art > .art-active {
  background: #bcd9c5;
  color: #1d4038;
}
@media (max-width: 760px) {
  .login-story {
    padding: 44px 28px;
  }
}

/* 2.9: readable tables and responsive room cards. */
body:not(:has(.display)) .data-table {
  font-size: 1rem;
}
body:not(:has(.display)) .data-table th,
body:not(:has(.display)) .data-table td {
  font-size: inherit;
}
body:not(:has(.display)) .nav-link {
  font-size: 1rem;
}
.display-layout,
.display-layout:has(.room-display-column:nth-child(2)) {
  grid-template-columns: minmax(0, 1fr) minmax(
      0,
      var(--display-rooms-width, 48%)
    );
}
.room-display-column .display-ticket {
  min-height: 90px;
  border-radius: 18px;
}

.screen-customize {
  position: relative;
  font-size: 14px;
}
.screen-customize > div {
  position: absolute;
  z-index: 20;
  inset-inline-end: 0;
  width: min(320px, 85vw);
  background: var(--display-card, #193637);
  padding: 18px;
  border: 1px solid currentColor;
  border-radius: 12px;
}
.screen-customize label,
.screen-customize small {
  display: block;
  margin-block: 10px;
}
@media (max-width: 900px) {
  .display-layout,
  .display-layout:has(.room-display-column:nth-child(2)) {
    grid-template-columns: 1fr;
  }
}

/* Balanced working typography and a compact TV room layout. */
.admin-layout .field-hint,
.admin-layout .muted,
.admin-layout .page-heading p,
.admin-layout label,
.admin-layout small,
.admin-layout .nav-group > summary {
  font-size: 0.875rem;
  line-height: 1.55;
}
.admin-layout label > :is(input, select, textarea),
.admin-layout :is(button, .btn-primary, .btn-secondary, .btn-ghost) {
  font-size: 0.9375rem;
}
.admin-layout
  :is(
    input:not(
      [type="checkbox"],
      [type="radio"],
      [type="range"],
      [type="color"]
    ),
    select,
    textarea
  ) {
  min-height: 2.5em;
}
.admin-layout label > select,
.admin-layout option {
  font: inherit;
  font-size: 0.9375rem;
}
.admin-layout .nav-link {
  font-size: 0.9375rem;
}
.rooms-display .room-display-column .display-ticket {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  grid-template-areas: "room number" "state number";
  align-content: center;
  gap: 0 0.6rem;
  height: auto;
  min-height: clamp(3.6rem, var(--room-card-height, 5rem), 6rem);
  padding: 0.45rem 0.75rem;
  border-radius: 0.75rem;
}
.rooms-display .room-display-column .display-ticket-room {
  grid-area: room;
  overflow-wrap: anywhere;
  line-height: 1.2;
  font-size: clamp(0.88rem, 1.65vw, var(--display-room-size, 28px));
}
.rooms-display .room-display-column .display-ticket-number {
  grid-area: number;
  align-self: center;
  font-size: clamp(1.1rem, 2.6vw, var(--display-ticket-size, 52px));
  overflow-wrap: anywhere;
  line-height: 1;
}
.rooms-display .room-display-column .display-ticket small {
  grid-area: state;
  opacity: 0.85;
  font-size: clamp(0.75rem, 1.05vw, var(--display-small-size, 18px));
  line-height: 1.3;
}
.rooms-display
  .display-ticket[data-room-state="available"]
  .display-ticket-number {
  opacity: 0.45;
}
.rooms-display .display-ticket[data-room-state="called"] {
  border-color: var(--display-accent, #53e0bc);
}
.ticket-modal .ticket-card {
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
}
.ticket-tracking:not([hidden]) {
  display: grid;
  justify-items: center;
  margin-block: 0.75rem;
  gap: 0.4rem;
}
.ticket-tracking img {
  background: white;
  width: 152px;
  height: 152px;
}
.ticket-tracking a {
  color: var(--brand);
  font-weight: 700;
  font-size: 0.9375rem;
}

.portal-admin .login-story,
.portal-doctors .login-story,
.portal-staff .login-story {
  background: color-mix(in srgb, var(--brand, #087f79) 65%, #102425);
}
.portal-admin .login-story .eyebrow,
.portal-doctors .login-story .eyebrow,
.portal-staff .login-story .eyebrow { color: inherit; }
.portal-admin .story-art > .art-active,
.portal-doctors .story-art > .art-active,
.portal-staff .story-art > .art-active { background: var(--brand); color: white; }
.room-waiting-list li { flex-wrap: wrap; justify-content: flex-start; }
.room-waiting-list .queue-service-name { flex: 1 1 8ch; min-width: 0; overflow-wrap: break-word; }
.room-waiting-list .queue-pick { flex: 0 0 auto; }
.room-waiting-list .queue-origin { padding-inline-start: 0.4rem; }
.ticket-bulk-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.65rem; margin-block: 0.75rem; }
.settings-section { display: grid; gap: 1rem; margin-block: 1.5rem; }
.queue-print-receipt { display: none; }
.receipt-preview { text-align: center; overflow-wrap: anywhere; }
.receipt-preview strong { display: block; direction: ltr; font-size: 2rem; }
.receipt-preview img { display: block; width: 132px; height: 132px; margin: 0.75rem auto 0; }
@media print {
  body[data-ticket-print] > :not(.queue-print-receipt) { display: none !important; }
  body[data-ticket-print] { margin: 0; padding: 0; background: #fff; color: #000; }
  body[data-ticket-print] .queue-print-receipt {
    display: block; text-align: center; width: min(100%, 68mm); margin: 0 auto;
    padding: 2mm; break-inside: avoid;
  }
  .queue-print-receipt strong { display: block; direction: ltr; font-size: 26pt; }
  .queue-print-receipt img { display: block; width: 31mm; height: 31mm; margin: 2mm auto 0; }
}
.display .rooms-display .display-ticket {
  height: auto; min-height: min(var(--display-card-size, 80px), var(--room-card-height, 144px));
  border-inline-start: 4px solid transparent;
  padding: 0.35rem 0.55rem;
}
.display .rooms-display .display-ticket[data-room-state="called"] {
  border-inline-start-color: var(--display-accent);
}
.display .rooms-display .display-ticket[data-room-state="serving"] {
  border-inline-start-color: color-mix(in srgb, var(--display-accent) 60%, transparent);
}
.display .rooms-display .display-ticket-room {
  font-size: max(14px, calc(var(--display-room-size, 28px) * var(--room-rail-scale, 1)));
}
.display .rooms-display .display-ticket-number {
  font-size: max(19px, calc(var(--display-ticket-size, 52px) * var(--room-rail-scale, 1)));
}
.display .rooms-display .display-ticket small {
  font-size: max(12px, calc(var(--display-small-size, 18px) * var(--room-rail-scale, 1)));
}
.display .display-layout.display-without-rooms { grid-template-columns: minmax(0, 1fr); }
.appearance-preview .preview-room { min-height: calc(var(--display-card-size, 80px) * 0.75); }
.room-layout-preview:not(:empty) {
  display: grid;
  grid-template-columns: repeat(var(--preview-columns, 1), minmax(0, 1fr));
  gap: 0.5rem;
}
.room-layout-preview ul { list-style: none; padding: 0; margin: 0; }
.room-layout-preview li {
  margin-block: 0.25rem; padding: 0.35rem; border: 1px solid var(--border);
  border-radius: 0.5rem; overflow-wrap: anywhere;
}
