:root {
  --demo-top: 0px;
  --bg: #f0f9fb;
  --bg-2: #e0f2f5;
  --surface: #ffffff;
  --surface-2: #f7fdfe;
  --text: #0a1f26;
  --text-2: #334f58;
  --muted: #5f7d87;
  --faint: #94aab3;
  --border: #dceff3;
  --border-2: #b8dde4;
  --primary: #0891b2;
  --primary-2: #06b6d4;
  --primary-soft: #cffafe;
  --accent: #f59e0b;
  --accent-soft: #fef3c7;
  --success: #16a34a;
  --success-soft: #dcfce7;
  --warn: #d97706;
  --warn-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --info: #7c3aed;
  --info-soft: #ede9fe;
  --shadow-sm: 0 1px 2px rgba(10, 31, 38, 0.05);
  --shadow: 0 4px 14px rgba(10, 31, 38, 0.08);
  --shadow-lg: 0 18px 40px rgba(10, 31, 38, 0.16);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --font: system-ui, 'Segoe UI', Tahoma, sans-serif;
}
html[data-theme='dark'] {
  --bg: #041820;
  --bg-2: #0a2530;
  --surface: #0d2b36;
  --surface-2: #123843;
  --text: #cffafe;
  --text-2: #a5d4dd;
  --muted: #5e8e9a;
  --faint: #3d6672;
  --border: #1e4652;
  --border-2: #2d5f6d;
  --primary: #22d3ee;
  --primary-2: #67e8f9;
  --primary-soft: #083344;
  --accent: #fbbf24;
  --accent-soft: #3b2a06;
  --success: #4ade80;
  --success-soft: #052e1a;
  --warn: #fbbf24;
  --warn-soft: #3b2a06;
  --danger: #f87171;
  --danger-soft: #3b0e0e;
  --info: #a78bfa;
  --info-soft: #1e1b4b;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.6);
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  padding-top: var(--demo-top, 0px);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: none;
  background: none;
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 8px;
}

/* Splash */
.splash {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: linear-gradient(160deg, var(--primary) 0%, #0e7490 55%, #155e75 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    opacity 0.45s,
    visibility 0.45s;
}
html[data-theme='dark'] .splash {
  background: linear-gradient(160deg, #083344 0%, #041e26 60%, #02141a 100%);
}
.splash.hide {
  opacity: 0;
  visibility: hidden;
}
.splash-inner {
  text-align: center;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: splashIn 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes splashIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.splash-logo {
  width: 82px;
  height: 82px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  filter: blur(6px);
  font-size: 38px;
}
.splash-brandname {
  filter: blur(7px);
  font-weight: 800;
  font-size: 20px;
}
.splash-generic {
  font-size: 12px;
  opacity: 0.85;
  margin-top: -8px;
}
.splash-title {
  font-size: 19px;
  font-weight: 700;
  margin-top: 4px;
}
.splash-credit {
  font-size: 10.5px;
  letter-spacing: 3px;
  font-weight: 300;
  opacity: 0.75;
  margin-top: 24px;
}
.splash-credit span {
  animation: glow 2.6s ease-in-out infinite;
}
@keyframes glow {
  0%,
  100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

/* Layout */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  position: sticky;
  top: var(--demo-top, 0px);
  z-index: 60;
  height: auto;
  min-height: 60px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 14px;
}
.topbar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}
.topbar-title {
  font-weight: 800;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.topbar-title .t-ic {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  flex-shrink: 0;
  background: linear-gradient(140deg, var(--primary), var(--primary-2));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}
.spacer {
  flex: 1;
}
.topbar-break {
  display: none;
}
html.mobile-layout .topbar-row {
  gap: 2px 6px;
  flex-wrap: wrap;
}
html.mobile-layout .topbar-row .spacer {
  display: none;
}
html.mobile-layout .topbar-row .badge-demo {
  margin-inline-start: auto;
  order: 10;
}
html.mobile-layout .topbar-row .topbar-break {
  display: block;
  flex-basis: 100%;
}
html.mobile-layout .topbar-title {
  flex: 1 1 auto;
  overflow: hidden;
}
html.mobile-layout .topbar-title .t-txt {
  -webkit-line-clamp: 2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  line-height: 1.3;
  overflow: hidden;
}
.badge-demo {
  font-size: 10px;
  padding: 4px 9px;
  border-radius: 20px;
  background: var(--warn-soft);
  color: var(--warn);
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent);
}
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  position: relative;
  transition: background 0.15s;
  flex-shrink: 0;
}
.icon-btn:hover {
  background: var(--bg-2);
}
.icon-btn svg {
  width: 19px;
  height: 19px;
}
.dot-badge {
  position: absolute;
  top: 5px;
  inset-inline-end: 5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.role-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 2px 4px;
  -webkit-overflow-scrolling: touch;
}
.role-tab {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 800;
  background: var(--bg-2);
  color: var(--muted);
  border: 1.5px solid transparent;
  white-space: nowrap;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.role-tab:hover {
  background: var(--primary-soft);
  color: var(--primary);
}
.role-tab.active {
  background: linear-gradient(140deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 25%, transparent);
}
.role-tab .rt-ic {
  font-size: 15px;
}
.side-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  padding: 6px 11px;
  border-radius: 20px;
  background: var(--bg-2);
}
.side-toggle input {
  width: auto;
  min-height: auto;
}

.content {
  padding: 16px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}
html.mobile-layout .content {
  padding: 12px 12px 96px;
}

/* Bottom nav */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 70;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  justify-content: space-around;
  align-items: center;
}
html.mobile-layout .bottom-nav {
  display: flex;
}
.bn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 2px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  min-height: 48px;
  justify-content: center;
  position: relative;
}
.bn-item svg,
.bn-item .bn-emoji {
  width: 20px;
  height: 20px;
  font-size: 20px;
}
.bn-item.active {
  color: var(--primary);
}
.bn-ic-wrap {
  padding: 3px 10px;
  border-radius: 10px;
  display: flex;
  font-size: 20px;
}
.bn-item.active .bn-ic-wrap {
  background: var(--primary-soft);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13.5px;
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--border);
  transition:
    transform 0.1s,
    background 0.15s;
  min-height: 42px;
}
.btn:hover {
  background: var(--bg-2);
}
.btn:active {
  transform: scale(0.975);
}
.btn svg {
  width: 17px;
  height: 17px;
}
.btn-primary {
  background: linear-gradient(140deg, var(--primary), var(--primary-2));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 30%, transparent);
}
.btn-primary:hover {
  filter: brightness(1.06);
}
.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: transparent;
}
.btn-success {
  background: var(--success-soft);
  color: var(--success);
  border-color: transparent;
}
.btn-warn {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: transparent;
}
.btn-purple {
  background: var(--info-soft);
  color: var(--info);
  border-color: transparent;
}
.btn-sm {
  padding: 7px 12px;
  font-size: 12.5px;
  min-height: 36px;
}
.btn-lg {
  padding: 13px 22px;
  font-size: 15px;
  min-height: 50px;
}
.btn-block {
  width: 100%;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.card-title {
  font-size: 14.5px;
  font-weight: 800;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.grid {
  display: grid;
  gap: 14px;
}
.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 900px) {
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}
html.mobile-layout .grid-2,
html.mobile-layout .grid-3,
html.mobile-layout .grid-4 {
  grid-template-columns: 1fr;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}
.field label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 5px;
}
.field input,
.field select,
.field textarea {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  width: 100%;
  min-height: 42px;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
}
.field input.err {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}
.field-err {
  font-size: 11.5px;
  color: var(--danger);
  font-weight: 600;
  min-height: 14px;
}

.page-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 21px;
  font-weight: 800;
  margin: 0;
}
.page-sub {
  font-size: 13px;
  color: var(--muted);
  margin: 2px 0 0;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  position: relative;
  overflow: hidden;
}
.kpi .k-ic {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary);
  margin-bottom: 9px;
  font-size: 17px;
}
.kpi .k-lbl {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 2px;
}
.kpi .k-val {
  font-size: 23px;
  font-weight: 900;
  letter-spacing: -0.6px;
  font-variant-numeric: tabular-nums;
}
.kpi .k-sub {
  font-size: 11px;
  color: var(--faint);
  margin-top: 3px;
  font-weight: 600;
}
.kpi.green .k-ic {
  background: var(--success-soft);
  color: var(--success);
}
.kpi.amber .k-ic {
  background: var(--warn-soft);
  color: var(--warn);
}
.kpi.red .k-ic {
  background: var(--danger-soft);
  color: var(--danger);
}
.kpi.purple .k-ic {
  background: var(--info-soft);
  color: var(--info);
}

/* Step wizard */
.steps {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.step-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.step-pill.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}
.step-pill.done {
  background: var(--success-soft);
  border-color: transparent;
  color: var(--success);
}
.step-pill .sp-n {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}
.step-pill.active .sp-n {
  background: var(--primary);
  color: #fff;
}
.step-pill.done .sp-n {
  background: var(--success);
  color: #fff;
}

/* Specialty grid */
.spec-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
@media (max-width: 900px) {
  .spec-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 500px) {
  .spec-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
html.mobile-layout .spec-grid {
  grid-template-columns: repeat(2, 1fr);
}
.spec-btn {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 14px 8px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.spec-btn:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}
.spec-btn.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 20%, transparent);
}
.spec-btn .sp-ic {
  font-size: 34px;
}
.spec-btn .sp-lbl {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-2);
  text-align: center;
  line-height: 1.3;
}

/* Doctor card */
.doc-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: start;
  width: 100%;
}
.doc-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.doc-card.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 20%, transparent);
}
.doc-avatar {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(140deg, var(--primary), var(--primary-2));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
  flex-shrink: 0;
}
.doc-info {
  flex: 1;
  min-width: 0;
}
.doc-info .d-name {
  font-weight: 800;
  font-size: 14.5px;
  margin: 0;
}
.doc-info .d-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}
.doc-info .d-price {
  font-weight: 800;
  color: var(--primary);
  font-size: 13px;
  margin-top: 4px;
}

/* Day calendar */
.cal-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.cal-day {
  flex-shrink: 0;
  min-width: 74px;
  padding: 10px 6px;
  border-radius: 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}
.cal-day:hover:not(:disabled) {
  border-color: var(--primary);
}
.cal-day.active {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}
.cal-day:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  text-decoration: line-through;
}
.cal-day .cd-dow {
  font-size: 10.5px;
  font-weight: 800;
  opacity: 0.8;
}
.cal-day .cd-num {
  font-size: 20px;
  font-weight: 900;
  margin: 2px 0;
}
.cal-day .cd-mon {
  font-size: 10.5px;
  font-weight: 700;
  opacity: 0.75;
}
.cal-day .cd-count {
  font-size: 10px;
  margin-top: 3px;
  font-weight: 800;
  opacity: 0.85;
}

/* Time slots */
.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px;
}
.slot-btn {
  padding: 11px 6px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 13.5px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text-2);
  transition: all 0.15s;
  font-variant-numeric: tabular-nums;
}
.slot-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}
.slot-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 30%, transparent);
}
.slot-btn:disabled {
  opacity: 0.32;
  cursor: not-allowed;
  text-decoration: line-through;
}

/* Appointment card */
.appt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  transition: all 0.15s;
}
.appt-card:hover {
  box-shadow: var(--shadow);
}
.appt-card.current {
  border-color: var(--success);
  background: linear-gradient(140deg, var(--success-soft), var(--surface));
  box-shadow: 0 4px 16px color-mix(in srgb, var(--success) 25%, transparent);
  animation: currentPulse 2s infinite;
}
@keyframes currentPulse {
  0%,
  100% {
    box-shadow: 0 4px 16px color-mix(in srgb, var(--success) 25%, transparent);
  }
  50% {
    box-shadow: 0 8px 24px color-mix(in srgb, var(--success) 40%, transparent);
  }
}
.appt-card.done {
  opacity: 0.65;
}
.appt-card.no-show {
  border-color: var(--danger);
  opacity: 0.6;
}
.appt-time {
  min-width: 56px;
  text-align: center;
  flex-shrink: 0;
}
.appt-time .at-t {
  font-size: 16px;
  font-weight: 900;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.appt-time .at-d {
  font-size: 10px;
  color: var(--muted);
  font-weight: 700;
}
.appt-body {
  flex: 1;
  min-width: 0;
}
.appt-body .ab-name {
  font-weight: 800;
  font-size: 14px;
  margin: 0;
}
.appt-body .ab-info {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}
.appt-status {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}
.st-booked {
  background: var(--info-soft);
  color: var(--info);
}
.st-arrived {
  background: var(--warn-soft);
  color: var(--warn);
}
.st-in_progress {
  background: var(--success-soft);
  color: var(--success);
}
.st-done {
  background: var(--bg-2);
  color: var(--muted);
}
.st-no_show {
  background: var(--danger-soft);
  color: var(--danger);
}
.st-cancelled {
  background: var(--bg-2);
  color: var(--faint);
  text-decoration: line-through;
}

/* Reception day view */
.day-columns {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}
html.mobile-layout .day-columns {
  grid-auto-flow: row;
  grid-auto-columns: auto;
  overflow-x: visible;
}
.doc-column {
  background: var(--surface-2);
  border-radius: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  min-height: 150px;
}
.doc-column-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 10px;
}
.doc-column-head .dch-av {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(140deg, var(--primary), var(--primary-2));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 15px;
  flex-shrink: 0;
}
.doc-column-head .dch-info {
  flex: 1;
  min-width: 0;
}
.doc-column-head .dch-name {
  font-weight: 800;
  font-size: 13.5px;
}
.doc-column-head .dch-sub {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 1px;
}
.doc-column-head .dch-count {
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
}

/* Queue screen */
.queue-screen {
  background: linear-gradient(160deg, #0a2530 0%, #041820 100%);
  color: #cffafe;
  min-height: calc(100vh - 130px);
  padding: 24px;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
}
html[data-theme='dark'] .queue-screen {
  background: linear-gradient(160deg, #0a2530 0%, #020a0f 100%);
}
.queue-header {
  text-align: center;
  padding-bottom: 20px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 24px;
}
.queue-header .qh-brand {
  font-weight: 900;
  font-size: 20px;
  filter: blur(6px);
  color: #fff;
}
.queue-header .qh-sub {
  font-size: 12px;
  color: #7dd3fc;
  margin-top: 4px;
  letter-spacing: 0.5px;
}
.queue-header .qh-clock {
  font-size: 36px;
  font-weight: 900;
  color: #22d3ee;
  margin-top: 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}
.queue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
@media (max-width: 800px) {
  .queue-grid {
    grid-template-columns: 1fr;
  }
}
.queue-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 20px;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}
.queue-card .qc-doc-name {
  font-weight: 900;
  font-size: 18px;
  color: #fff;
  margin-bottom: 4px;
  text-align: center;
}
.queue-card .qc-doc-spec {
  font-size: 12px;
  color: #7dd3fc;
  text-align: center;
  margin-bottom: 16px;
  letter-spacing: 0.3px;
}
.queue-card .qc-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 14px;
}
.qc-block {
  text-align: center;
  flex: 1;
}
.qc-block .qc-lbl {
  font-size: 10.5px;
  font-weight: 800;
  color: #7dd3fc;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.qc-block .qc-num {
  font-size: 64px;
  font-weight: 900;
  color: #22d3ee;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: all 0.3s;
}
.qc-block .qc-num.small {
  font-size: 52px;
  color: #a5f3fc;
}
.qc-block .qc-name {
  font-size: 13px;
  color: #e0f2f5;
  margin-top: 6px;
  font-weight: 700;
}
.qc-num.flash {
  animation: flashNum 0.8s;
}
@keyframes flashNum {
  0%,
  100% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.15);
    color: #fbbf24;
  }
  60% {
    transform: scale(1.1);
    color: #fbbf24;
  }
}
.qc-waiting {
  text-align: center;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.qc-waiting .qcw-lbl {
  font-size: 11px;
  color: #7dd3fc;
  font-weight: 700;
}
.qc-waiting .qcw-val {
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  margin-top: 2px;
}
.queue-ticker {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.3);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  color: #fbbf24;
  letter-spacing: 0.3px;
}
.queue-announce {
  margin-top: 24px;
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 14px;
  padding: 14px 20px;
  text-align: center;
  color: #fbbf24;
  font-weight: 800;
  font-size: 15px;
  display: none;
}
.queue-announce.show {
  display: block;
  animation: pulseAnnounce 2s infinite;
}
@keyframes pulseAnnounce {
  0%,
  100% {
    background: rgba(251, 191, 36, 0.15);
  }
  50% {
    background: rgba(251, 191, 36, 0.28);
  }
}

/* Toolbar */
.toolbar {
  display: flex;
  gap: 9px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  align-items: center;
}
.search-wrap {
  position: relative;
  flex: 1;
  min-width: 180px;
}
.search-wrap svg {
  position: absolute;
  inset-inline-start: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--faint);
  pointer-events: none;
}
.search-wrap input {
  padding-inline-start: 36px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  outline: none;
  min-height: 42px;
}
.search-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
}
.chip {
  padding: 7px 13px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 700;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  white-space: nowrap;
  transition: all 0.15s;
}
.chip:hover {
  background: var(--bg-2);
}
.chip.active {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--border);
}
.tab {
  padding: 9px 14px;
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tab.active {
  color: var(--primary);
  border-color: var(--primary);
}
.tab .t-count {
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--bg-2);
  font-size: 10.5px;
  font-weight: 800;
  color: var(--muted);
}
.tab.active .t-count {
  background: var(--primary-soft);
  color: var(--primary);
}

/* Detail rows */
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
  gap: 8px;
}
.detail-row:last-child {
  border-bottom: none;
}
.detail-row .dr-l {
  color: var(--muted);
  font-weight: 600;
}
.detail-row .dr-r {
  font-weight: 700;
  text-align: end;
}

/* Modal */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 20, 0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s,
    visibility 0.2s;
  backdrop-filter: blur(3px);
}
.overlay.show {
  opacity: 1;
  visibility: visible;
}
html.mobile-layout .overlay {
  align-items: flex-end;
  padding: 0;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(14px) scale(0.98);
  transition: transform 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
.overlay.show .modal {
  transform: none;
}
html.mobile-layout .modal {
  border-radius: 22px 22px 0 0;
  max-width: none;
  max-height: 94vh;
  transform: translateY(100%);
}
html.mobile-layout .overlay.show .modal {
  transform: none;
}
.modal-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 2;
}
.modal-title {
  font-size: 16px;
  font-weight: 800;
  margin: 0;
}
.modal-body {
  padding: 18px;
}
.modal-foot {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  position: sticky;
  bottom: 0;
  background: var(--surface);
  flex-wrap: wrap;
}
.grabber {
  width: 38px;
  height: 4px;
  border-radius: 4px;
  background: var(--border-2);
  margin: 9px auto 0;
}

/* Toast */
.toasts {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  inset-inline-start: 20px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
html.mobile-layout .toasts {
  bottom: calc(140px + env(safe-area-inset-bottom, 0px));
  inset-inline: 14px;
}
.toast {
  background: var(--text);
  color: var(--surface);
  padding: 11px 15px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  pointer-events: auto;
  max-width: 340px;
}
html[data-theme='dark'] .toast {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.toast button {
  color: var(--primary-2);
  font-weight: 800;
  font-size: 12.5px;
  text-decoration: underline;
}

/* Tour */
.tour-spot {
  position: fixed;
  z-index: 400;
  border-radius: 16px;
  box-shadow: 0 0 0 9999px rgba(8, 12, 16, 0.62);
  transition: all 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
  pointer-events: none;
  border: 2px solid var(--primary-2);
}
.tour-tip {
  position: fixed;
  z-index: 401;
  background: var(--surface);
  border-radius: 14px;
  padding: 14px 16px;
  max-width: 300px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.tour-tip .t-step {
  font-size: 11px;
  color: var(--primary);
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}
.tour-tip .t-txt {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.55;
  margin-bottom: 11px;
}
.tour-tip .t-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.tour-tip .t-skip {
  font-size: 12px;
  color: var(--muted);
  text-decoration: underline;
}

/* Empty */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}
.empty .e-ic {
  width: 70px;
  height: 70px;
  border-radius: 22px;
  margin: 0 auto 14px;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}
.empty h3 {
  margin: 0 0 5px;
  color: var(--text);
  font-size: 16px;
}
.empty p {
  margin: 0 0 16px;
  font-size: 13px;
}

/* Skeleton */
.skel {
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--border) 50%, var(--bg-2) 75%);
  background-size: 200% 100%;
  animation: shim 1.1s infinite;
  border-radius: 8px;
}
@keyframes shim {
  to {
    background-position: -200% 0;
  }
}

/* WhatsApp bubble */
.wa-bubble {
  background: #dcf8c6;
  color: #111827;
  padding: 12px 15px;
  border-radius: 14px 14px 4px 14px;
  font-size: 13px;
  line-height: 1.7;
  max-width: 95%;
  margin: 6px 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  white-space: pre-wrap;
}
html[data-theme='dark'] .wa-bubble {
  background: #075e54;
  color: #e9edef;
}

/* Side-by-side mode */
.side-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}
@media (max-width: 900px) {
  .side-layout {
    grid-template-columns: 1fr;
  }
}

/* Receipt */
.receipt {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  max-width: 400px;
  margin: 0 auto;
}
.receipt .rh {
  text-align: center;
  border-bottom: 2px dashed var(--border);
  padding-bottom: 12px;
  margin-bottom: 12px;
}
.receipt .rh .r-brand {
  font-weight: 900;
  font-size: 16px;
  filter: blur(6px);
}
.receipt .rh .r-sub {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 3px;
}
.receipt .r-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 13px;
}
.receipt .r-total {
  text-align: center;
  font-weight: 900;
  font-size: 22px;
  padding: 14px 0;
  border-top: 2px dashed var(--border);
  border-bottom: 2px dashed var(--border);
  margin: 10px 0;
}
.receipt .r-foot {
  text-align: center;
  font-size: 9.5px;
  letter-spacing: 2.5px;
  color: var(--faint);
  margin-top: 14px;
  font-weight: 300;
}

/* Phone mode */
html.phone-mode {
  background: #0c1216;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px 0;
}
html.phone-mode body {
  width: 390px;
  height: 790px;
  max-height: 92vh;
  overflow: hidden;
  border-radius: 44px;
  border: 11px solid #1b2429;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
  padding-top: 0;
  position: relative;
  background: var(--bg);
}
html.phone-mode .app-shell {
  height: 100%;
  overflow: hidden;
}
html.phone-mode .content {
  overflow-y: auto;
  height: calc(100% - 130px);
  padding-bottom: 96px;
}
html.phone-mode .bottom-nav {
  display: flex;
  position: absolute;
}
html.phone-mode .toasts {
  position: absolute;
}
html.phone-mode .overlay {
  position: absolute;
}
html.phone-mode .tour-spot,
html.phone-mode .tour-tip {
  position: absolute;
}
html.phone-mode .spec-grid {
  grid-template-columns: repeat(2, 1fr);
}
html.phone-mode .day-columns {
  grid-auto-flow: row;
  grid-auto-columns: auto;
}
.mobile-toggle {
  display: none;
}
@media (min-width: 768px) {
  .mobile-toggle {
    display: inline-flex;
  }
}
html.phone-mode .mobile-toggle {
  display: inline-flex;
}

@media print {
  body {
    background: #fff;
    padding: 0;
  }
  .topbar,
  .bottom-nav,
  .toasts,
  .no-print,
  .tour-spot,
  .tour-tip {
    display: none !important;
  }
  .content {
    padding: 0;
    max-width: none;
  }
  .card,
  .tbl-wrap,
  .receipt {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

@media (max-width: 520px) {
  .page-title {
    font-size: 19px;
  }
  .kpi .k-val {
    font-size: 20px;
  }
  .qc-block .qc-num {
    font-size: 48px;
  }
  .qc-block .qc-num.small {
    font-size: 40px;
  }
}
