/* Exam Monitor — Apple-style Design System */

/* === CSS Variables === */
:root {
  --color-bg:             #F5F5F7;
  --color-surface:        #FFFFFF;
  --color-text-primary:   #1D1D1F;
  --color-text-secondary: #6E6E73;
  --color-text-tertiary:  #AEAEB2;
  --color-border:         #E5E5EA;
  --color-accent:         #007AFF;
  --color-destructive:    #FF3B30;
  --color-success:        #34C759;
  --color-warning:        #FF9500;
  --color-info:           #007AFF;
  /* Status backgrounds */
  --status-alert-bg:      #FFF0F0;
  --status-progress-bg:   #FFF8F0;
  --status-resolved-bg:   #F0FAF0;
  --status-toilet-bg:     #F0F5FF;
  --status-toilet-waiting-bg: #E8F0FE;
  /* Shadows */
  --shadow-card:          0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.02);
  --shadow-elevated:      0 4px 12px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-modal:         0 20px 60px rgba(0,0,0,0.15), 0 4px 16px rgba(0,0,0,0.08);
  /* Radii */
  --radius-badge:   6px;
  --radius-button:  10px;
  --radius-card:    14px;
  --radius-modal:   20px;
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 0.75rem;
  --space-lg: 1rem;
  --space-xl: 1.5rem;
  --space-2xl: 2rem;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* === Base === */
html {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', 'Segoe UI', sans-serif;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text-primary);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
code { font-family: 'SF Mono', 'Monaco', 'Consolas', monospace; font-size: 0.875em; }

/* Alpine.js */
[x-cloak] { display: none !important; }

/* === Typography === */
.text-xs   { font-size: 0.6875rem; line-height: 1rem; }
.text-sm   { font-size: 0.8125rem; line-height: 1.25rem; }
.text-base { font-size: 0.9375rem; line-height: 1.5rem; }
.text-lg   { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl   { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl  { font-size: 1.5rem; line-height: 2rem; }
.text-3xl  { font-size: 1.875rem; line-height: 2.25rem; }
.font-normal   { font-weight: 400; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }
.font-mono     { font-family: 'SF Mono', 'Monaco', 'Consolas', monospace; }
.text-center   { text-align: center; }
.text-left     { text-align: left; }
.uppercase     { text-transform: uppercase; }
.tracking-wider { letter-spacing: 0.05em; }
.truncate      { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* === Layout === */
.h-full          { height: 100%; }
.min-h-screen    { min-height: 100vh; }
.flex            { display: flex; }
.inline-flex     { display: inline-flex; }
.inline-block    { display: inline-block; }
.inline          { display: inline; }
.grid            { display: grid; }
.hidden          { display: none; }
.block           { display: block; }
.flex-1          { flex: 1 1 0%; }
.flex-shrink-0   { flex-shrink: 0; }
.flex-wrap       { flex-wrap: wrap; }
.flex-col        { flex-direction: column; }
.items-center    { align-items: center; }
.items-start     { align-items: flex-start; }
.items-end       { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.gap-1   { gap: var(--space-xs); }
.gap-2   { gap: var(--space-sm); }
.gap-3   { gap: var(--space-md); }
.gap-4   { gap: var(--space-lg); }
.gap-6   { gap: var(--space-xl); }
.space-y-1 > * + * { margin-top: var(--space-xs); }
.space-y-2 > * + * { margin-top: var(--space-sm); }
.space-y-3 > * + * { margin-top: var(--space-md); }
.space-y-4 > * + * { margin-top: var(--space-lg); }
.space-y-6 > * + * { margin-top: var(--space-xl); }
.relative { position: relative; }

/* === Grid === */
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (min-width: 640px)  { .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 768px)  {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1024px) { .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* === Sizing === */
.w-full  { width: 100%; }
.w-2     { width: 0.5rem; }
.w-2\.5  { width: 0.625rem; }
.w-3     { width: 0.75rem; }
.w-48    { width: 12rem; }
.w-56    { width: 14rem; }
.h-2     { height: 0.5rem; }
.h-2\.5  { height: 0.625rem; }
.h-3     { height: 0.75rem; }
.max-w-sm  { max-width: 24rem; }
.max-w-md  { max-width: 28rem; }
.max-w-7xl { max-width: 80rem; }

/* === Spacing === */
.p-3  { padding: var(--space-md); }
.p-4  { padding: var(--space-lg); }
.p-5  { padding: 1.25rem; }
.p-6  { padding: var(--space-xl); }
.p-8  { padding: var(--space-2xl); }
.px-1 { padding-left: var(--space-xs); padding-right: var(--space-xs); }
.px-2 { padding-left: var(--space-sm); padding-right: var(--space-sm); }
.px-3 { padding-left: var(--space-md); padding-right: var(--space-md); }
.px-4 { padding-left: var(--space-lg); padding-right: var(--space-lg); }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: var(--space-xl); padding-right: var(--space-xl); }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1 { padding-top: var(--space-xs); padding-right: var(--space-xs); }
.py-2 { padding-top: var(--space-sm); padding-bottom: var(--space-sm); }
.py-3 { padding-top: var(--space-md); padding-bottom: var(--space-md); }
.py-6 { padding-top: var(--space-xl); padding-bottom: var(--space-xl); }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.pt-3 { padding-top: var(--space-md); }
.pt-4 { padding-top: var(--space-lg); }
.pb-20 { padding-bottom: 5rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-1 { margin-top: var(--space-xs); }
.mt-2 { margin-top: var(--space-sm); }
.mt-3 { margin-top: var(--space-md); }
.mt-4 { margin-top: var(--space-lg); }
.mb-1 { margin-bottom: var(--space-xs); }
.mb-2 { margin-bottom: var(--space-sm); }
.mb-3 { margin-bottom: var(--space-md); }
.mb-4 { margin-bottom: var(--space-lg); }
.mb-6 { margin-bottom: var(--space-xl); }
.mb-8 { margin-bottom: var(--space-2xl); }
.ml-1 { margin-left: var(--space-xs); }
.ml-2 { margin-left: var(--space-sm); }

/* === Colors (Apple System) === */
.bg-page    { background-color: var(--color-bg); }
.bg-surface { background-color: var(--color-surface); }
.bg-white   { background-color: #fff; }
.bg-gray-50  { background-color: #F9F9FB; }
.bg-gray-100 { background-color: #F2F2F7; }
.bg-gray-200 { background-color: var(--color-border); }
.bg-gray-400 { background-color: var(--color-text-tertiary); }
.bg-gray-800 { background-color: #1D1D1F; }

.bg-red-50    { background-color: var(--status-alert-bg); }
.bg-red-100   { background-color: #FFE5E5; }
.bg-red-500   { background-color: var(--color-destructive); }
.bg-orange-50 { background-color: var(--status-progress-bg); }
.bg-orange-100 { background-color: #FFE8D1; }
.bg-orange-500 { background-color: var(--color-warning); }
.bg-green-50  { background-color: var(--status-resolved-bg); }
.bg-green-100 { background-color: #D4F5DC; }
.bg-green-500 { background-color: var(--color-success); }
.bg-green-600 { background-color: #2DA44E; }
.bg-blue-50   { background-color: var(--status-toilet-bg); }
.bg-blue-100  { background-color: #D6E8FF; }
.bg-blue-500  { background-color: var(--color-accent); }
.bg-blue-600  { background-color: #0066DD; }
.bg-blue-700  { background-color: #004EAA; }

.text-primary   { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-tertiary  { color: var(--color-text-tertiary); }
.text-gray-300  { color: #C7C7CC; }
.text-gray-400  { color: var(--color-text-tertiary); }
.text-gray-500  { color: var(--color-text-secondary); }
.text-gray-600  { color: #48484A; }
.text-gray-700  { color: #3A3A3C; }
.text-gray-800  { color: var(--color-text-primary); }
.text-white     { color: #fff; }
.text-red-600   { color: var(--color-destructive); }
.text-red-700   { color: #D12D23; }
.text-red-800   { color: #B5261D; }
.text-orange-700 { color: #CC7A00; }
.text-orange-800 { color: #995C00; }
.text-green-600  { color: var(--color-success); }
.text-green-700  { color: #2DA44E; }
.text-blue-600   { color: var(--color-accent); }
.text-blue-700   { color: #0066DD; }
.text-blue-800   { color: #004EAA; }

/* === Borders === */
.border    { border: 1px solid var(--color-border); }
.border-t  { border-top: 1px solid var(--color-border); }
.border-b  { border-bottom: 1px solid var(--color-border); }
.border-2  { border-width: 2px; }
.border-l-4 { border-left-width: 4px; border-left-style: solid; }
.border-gray-200  { border-color: var(--color-border); }
.border-gray-300  { border-color: #D1D1D6; }
.border-red-200   { border-color: #FFD4D4; }
.border-red-400   { border-color: var(--color-destructive); }
.border-green-200 { border-color: #B0ECC0; }
.border-green-400 { border-color: var(--color-success); }
.border-orange-400 { border-color: var(--color-warning); }
.border-blue-200  { border-color: #B0D4FF; }
.border-blue-400  { border-color: var(--color-accent); }
.border-l-red-500    { border-left-color: var(--color-destructive); }
.border-l-orange-500 { border-left-color: var(--color-warning); }
.border-l-green-500  { border-left-color: var(--color-success); }
.divide-y > * + * { border-top: 1px solid var(--color-border); }

/* === Rounded (Apple radii) === */
.rounded      { border-radius: var(--radius-badge); }
.rounded-lg   { border-radius: var(--radius-button); }
.rounded-xl   { border-radius: var(--radius-card); }
.rounded-2xl  { border-radius: var(--radius-modal); }
.rounded-full { border-radius: 9999px; }

/* === Shadows (subtle Apple) === */
.shadow    { box-shadow: var(--shadow-card); }
.shadow-sm { box-shadow: 0 1px 2px rgba(0,0,0,0.03); }
.shadow-lg { box-shadow: var(--shadow-elevated); }

/* === Effects === */
.opacity-75      { opacity: 0.75; }
.outline-none    { outline: none; }
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.transition-all    { transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1); }
.transition-colors { transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; }
.cursor-pointer    { cursor: pointer; }

/* === Hover States === */
.hover\:bg-gray-50:hover  { background-color: #F9F9FB; }
.hover\:bg-gray-200:hover { background-color: var(--color-border); }
.hover\:bg-gray-500:hover { background-color: var(--color-text-secondary); }
.hover\:bg-red-600:hover  { background-color: #E0342B; }
.hover\:bg-orange-600:hover { background-color: #E08500; }
.hover\:bg-green-600:hover  { background-color: #2DA44E; }
.hover\:bg-green-700:hover  { background-color: #258740; }
.hover\:bg-blue-600:hover   { background-color: #0066DD; }
.hover\:bg-blue-700:hover   { background-color: #004EAA; }
.hover\:bg-blue-800:hover   { background-color: #003D88; }
.hover\:text-white:hover    { color: #fff; }
.hover\:text-blue-800:hover { color: #004EAA; }
.hover\:text-green-800:hover { color: #1B7F37; }
.hover\:underline:hover     { text-decoration: underline; }

/* === Focus (Apple-style ring) === */
.focus\:ring-2:focus { box-shadow: 0 0 0 4px rgba(0,122,255,0.25); }
.focus\:ring-blue-500:focus { box-shadow: 0 0 0 4px rgba(0,122,255,0.25); }
.focus\:border-blue-500:focus { border-color: var(--color-accent); }

/* Touch feedback */
.touch-active:active {
  transform: scale(0.97);
  transition: transform 0.1s ease;
}

/* === Navigation — Frosted Glass === */
.nav-glass {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-glass .nav-link {
  color: var(--color-text-secondary);
  padding: 0.5rem 0.75rem;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: var(--radius-button);
  transition: all 0.2s ease;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.nav-glass .nav-link:hover {
  color: var(--color-text-primary);
  background: rgba(0,0,0,0.04);
}
.nav-glass .nav-link.active {
  color: var(--color-accent);
  font-weight: 600;
}

/* === WS Status Dot === */
.ws-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}
.ws-dot--connected  { background-color: var(--color-success); }
.ws-dot--connecting { background-color: var(--color-warning); }
.ws-dot--disconnected { background-color: var(--color-destructive); }

/* === WS Connection Banner === */
.ws-banner {
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
  display: none;
}
.ws-banner--warning {
  display: block;
  background: #FFF3CD;
  color: #856404;
}
.ws-banner--error {
  display: block;
  background: var(--status-alert-bg);
  color: var(--color-destructive);
}

/* === Cards (Apple style) === */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-border);
  padding: var(--space-md);
  transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Candidate Card States */
.card--normal {
  background: var(--color-surface);
  border-color: var(--color-border);
}
.card--alert {
  background: var(--status-alert-bg);
  border-color: var(--color-destructive);
  animation: alertGlow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.card--progress {
  background: var(--status-progress-bg);
  border-color: var(--color-warning);
}
.card--resolved {
  background: var(--color-surface);
  border-color: var(--color-border);
}
.card--toilet {
  background: var(--status-toilet-bg);
  border-color: var(--color-accent);
}

/* Alert Glow — shadow-only pulse, no opacity */
@keyframes alertGlow {
  0%, 100% {
    box-shadow: 0 0 0 3px rgba(255,59,48,0.2), 0 4px 16px rgba(255,59,48,0.15);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(255,59,48,0.1), 0 4px 16px rgba(255,59,48,0.08);
  }
}

/* Status indicator dots */
.status-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot--alert    { background: var(--color-destructive); }
.status-dot--progress { background: var(--color-warning); }
.status-dot--resolved { background: var(--color-success); }
.status-dot--toilet   { background: var(--color-accent); }

/* === Buttons (Touch-friendly, 44px+ height) === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  font-weight: 500;
  font-size: 0.875rem;
  border-radius: var(--radius-button);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
  padding: 0.625rem 1rem;
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }

.btn--sm {
  min-height: 44px;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}
.btn--lg {
  min-height: 52px;
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
}
.btn--full { width: 100%; }
.btn--icon {
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem;
}

/* Button variants */
.btn--accent {
  background: var(--color-accent);
  color: #fff;
}
.btn--accent:hover { background: #0066DD; }

.btn--destructive {
  background: var(--color-destructive);
  color: #fff;
}
.btn--destructive:hover { background: #E0342B; }
.btn--destructive.btn--lg {
  min-height: 52px;
}

.btn--warning {
  background: var(--color-warning);
  color: #fff;
}
.btn--warning:hover { background: #E08500; }

.btn--success {
  background: var(--color-success);
  color: #fff;
}
.btn--success:hover { background: #2DA44E; }

.btn--secondary {
  background: var(--color-bg);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}
.btn--secondary:hover {
  background: var(--color-border);
  color: var(--color-text-primary);
}

.btn--ghost {
  background: transparent;
  color: var(--color-text-secondary);
}
.btn--ghost:hover {
  background: rgba(0,0,0,0.04);
  color: var(--color-text-primary);
}

.btn--confirm {
  background: var(--color-warning);
  color: #fff;
  animation: confirmPulse 0.6s ease;
}
@keyframes confirmPulse {
  0% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* === Form Components (44px height) === */
.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xs);
}
.form-input {
  width: 100%;
  min-height: 44px;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-button);
  font-size: 0.9375rem;
  outline: none;
  background: var(--color-surface);
  color: var(--color-text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(0,122,255,0.15);
}
.form-input::placeholder { color: var(--color-text-tertiary); }

.form-select {
  width: 100%;
  min-height: 44px;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-button);
  font-size: 0.9375rem;
  outline: none;
  background: var(--color-surface);
  color: var(--color-text-primary);
  appearance: auto;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-select:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(0,122,255,0.15);
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  color: var(--color-text-primary);
  cursor: pointer;
  min-height: 36px;
  padding: 0.25rem 0;
}
.radio-label input[type="radio"] {
  accent-color: var(--color-accent);
  width: 18px;
  height: 18px;
}

/* === Segmented Control === */
.segmented-control {
  display: inline-flex;
  background: var(--color-bg);
  border-radius: var(--radius-button);
  padding: 3px;
  gap: 2px;
}
.segmented-control__item {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.segmented-control__item:hover {
  color: var(--color-text-primary);
}
.segmented-control__item--active {
  background: var(--color-surface);
  color: var(--color-text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  font-weight: 600;
}

/* === Sidebar Room Items (48px) === */
.room-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  border-radius: var(--radius-button);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: all 0.2s ease;
  min-height: 48px;
  color: var(--color-text-secondary);
  text-decoration: none;
}
.room-item:hover {
  background: rgba(0,0,0,0.04);
  color: var(--color-text-primary);
}
.room-item__dots {
  margin-left: auto;
  display: flex;
  gap: 4px;
}
.room-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  padding: 0 4px;
}
.room-dot--alert { background: var(--color-destructive); }
.room-dot--toilet { background: var(--color-accent); }
.room-item--active {
  background: rgba(0,122,255,0.1);
  color: var(--color-accent);
  font-weight: 600;
}

/* === Bottom Sheet === */
.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.bottom-sheet-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border-radius: var(--radius-modal) var(--radius-modal) 0 0;
  box-shadow: var(--shadow-modal);
  z-index: 201;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
  padding: var(--space-xl);
}
.bottom-sheet.active {
  transform: translateY(0);
}
.bottom-sheet__handle {
  width: 36px;
  height: 5px;
  background: var(--color-border);
  border-radius: 3px;
  margin: 0 auto var(--space-lg);
}

/* === FAB (Floating Action Button) === */
.fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 300;
  box-shadow: 0 4px 16px rgba(0,122,255,0.3);
  transition: all 0.2s ease;
  z-index: 150;
  -webkit-tap-highlight-color: transparent;
}
.fab:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0,122,255,0.4);
}
.fab:active { transform: scale(0.95); }

/* === Stats Cards === */
.stat-card {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1.25rem;
}
.stat-card__value {
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
}
.stat-card__label {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-top: 0.25rem;
}

/* === Badge === */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-badge);
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.badge--alert    { background: #FFE5E5; color: var(--color-destructive); }
.badge--warning  { background: #FFE8D1; color: #995C00; }
.badge--success  { background: #D4F5DC; color: #1B7F37; }
.badge--info     { background: #D6E8FF; color: #004EAA; }
.badge--neutral  { background: var(--color-bg); color: var(--color-text-secondary); }

/* === WC Pill (counter) === */
.wc-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-badge);
  background: #D6E8FF;
  color: #004EAA;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.wc-pill--saturated {
  background: #ffedd5;
  color: #9a3412;
  border: 2px solid #f97316;
}
.wc-pill--full {
  background: #fee2e2;
  color: #991b1b;
  border: 2px solid #dc2626;
  animation: pulse-saturated 2s ease-in-out infinite;
}
@keyframes pulse-saturated {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
}

/* === Incident Items === */
.incident-item {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--space-lg);
  border-left: 4px solid transparent;
  transition: all 0.2s ease;
}
.incident-item--open      { border-left-color: var(--color-destructive); }
.incident-item--progress  { border-left-color: var(--color-warning); }
.incident-item--resolved  { border-left-color: var(--color-success); }

.incident-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  background: var(--color-bg);
  border-radius: var(--radius-badge);
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

/* === Table === */
.table-container {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.table-container table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
.table-container thead {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}
.table-container th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.table-container td {
  padding: 0.75rem 1rem;
}
.table-container tbody tr {
  border-bottom: 1px solid var(--color-border);
  transition: background 0.15s ease;
  cursor: pointer;
}
.table-container tbody tr:last-child { border-bottom: none; }
.table-container tbody tr:hover { background: #F9F9FB; }

/* === Import Steps === */
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  flex-shrink: 0;
}

/* === File Upload Zone === */
.file-upload {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-card);
  padding: var(--space-xl);
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
  min-height: 44px;
}
.file-upload:hover {
  border-color: var(--color-accent);
  background: rgba(0,122,255,0.03);
}

/* === Mute Toggle === */
.mute-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.125rem;
  transition: all 0.2s ease;
  color: var(--color-text-secondary);
}
.mute-toggle:hover {
  background: rgba(0,0,0,0.05);
}
.mute-toggle--muted {
  color: var(--color-text-tertiary);
}

/* === Animations === */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
@keyframes ping {
  75%, 100% { transform: scale(2); opacity: 0; }
}
.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.animate-ping  { animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-in { animation: fadeIn 0.3s ease; }

@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

/* === Mobile Bottom Tab Bar === */
.bottom-tab-bar {
  display: none;
}

/* Show/hide at breakpoints */
@media (min-width: 640px) { .sm\:inline { display: inline; } }
.sm\:inline { display: none; }

@media (max-width: 512px) {
  .room-layout {
    flex-direction: column !important;
    gap: var(--space-md) !important;
  }
}

@media (max-width: 640px) {
  .bottom-tab-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.88);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 0.5px solid rgba(0,0,0,0.1);
    z-index: 100;
    padding: 0.5rem 0 env(safe-area-inset-bottom, 0.5rem);
  }
  .bottom-tab-bar__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    padding: 0.375rem 0;
    font-size: 0.625rem;
    font-weight: 500;
    color: var(--color-text-tertiary);
    text-decoration: none;
    min-height: 44px;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
  }
  .bottom-tab-bar__item.active {
    color: var(--color-accent);
  }
  .bottom-tab-bar__icon {
    font-size: 1.375rem;
    line-height: 1;
  }

  /* Hide desktop nav links on mobile */
  .nav-desktop-links { display: none; }

  /* Room sidebar → horizontal pills */
  .room-sidebar {
    width: 100% !important;
    flex-shrink: 1;
  }
  .room-sidebar nav {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
  }
  .room-sidebar .room-item {
    white-space: nowrap;
    min-height: 40px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }

  /* Bottom sheet for incidents */
  .fab { bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)); }

  /* Add padding for bottom tab bar */
  main { padding-bottom: 5rem !important; }

  /* Incidents sidebar hidden on mobile */
  .incidents-sidebar { display: none; }
}

/* === Coarse pointer (touch devices) === */
@media (pointer: coarse) {
  .btn { min-height: 48px; }
  .btn--sm { min-height: 44px; }
  .form-input, .form-select { min-height: 48px; }
  .room-item { min-height: 52px; }
}

/* === Responsive grid adjustments === */
@media (max-width: 768px) {
  .grid-cols-3, .grid-cols-4 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 512px) {
  .grid-cols-2, .grid-cols-3, .grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* === Login page === */
.login-container {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}
.login-card {
  width: 100%;
  max-width: 24rem;
  background: var(--color-surface);
  border-radius: var(--radius-modal);
  box-shadow: var(--shadow-elevated);
  padding: var(--space-2xl);
}
.login-card h1 {
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
  color: var(--color-text-primary);
  margin-bottom: 0.25rem;
}
.login-card .subtitle {
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  margin-bottom: var(--space-xl);
}

/* Error/success inline messages */
.msg-error {
  background: var(--status-alert-bg);
  border: 1px solid #FFD4D4;
  color: var(--color-destructive);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-button);
  font-size: 0.875rem;
  margin-bottom: var(--space-lg);
}
.msg-success {
  background: var(--status-resolved-bg);
  border: 1px solid #B0ECC0;
  color: #1B7F37;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-button);
  font-size: 0.875rem;
  margin-bottom: var(--space-lg);
  position: sticky;
  top: 60px;
  z-index: 50;
}

/* === Offline Queue Badge === */
.offline-badge {
  display: none;
  background: var(--color-warning);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  padding: 0 5px;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.offline-badge.active { display: inline-flex; }

/* === Toilet Waiting State === */
.card--toilet-waiting {
  background: var(--status-toilet-waiting-bg);
  border: 2px dashed var(--color-accent);
}

/* === Gender Badge === */
.gender-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 9999px;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}
.gender-badge--m {
  background: #D6E8FF;
  color: #004EAA;
}
.gender-badge--f {
  background: #FFE0F0;
  color: #C2185B;
}

.status-dot--toilet-waiting {
  background: var(--color-accent);
  opacity: 0.5;
}

/* === Toilet Display — Full Screen Projected Page === */
.display-body {
  background: #1a1a2e;
  color: #FFFFFF;
  min-height: 100vh;
  padding: 2rem;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
  overflow-y: auto;
}

.display-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid rgba(255,255,255,0.1);
  margin-bottom: 2rem;
}
.display-header__left,
.display-header__right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.display-room-name {
  font-size: 3rem;
  font-weight: 700;
  color: #fff;
}
.display-session-name {
  font-size: 1.5rem;
  color: rgba(255,255,255,0.6);
}
.display-clock {
  font-size: 2rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: rgba(255,255,255,0.8);
}

.display-slots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.display-slots__column {
  background: rgba(255,255,255,0.05);
  border-radius: 16px;
  padding: 1.5rem;
}
.display-slots__title {
  font-size: 1.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border-bottom: none;
}
.display-slots__title--m { color: #64B5F6; background: rgba(100, 181, 246, 0.15); }
.display-slots__title--f { color: #F48FB1; background: rgba(244, 143, 177, 0.15); }

.display-slot {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.display-slot:last-child { border-bottom: none; }

.display-slot__dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
}
.display-slot__dot--active { background: #4CAF50; }
.display-slot__dot--free { background: rgba(255,255,255,0.2); }

.display-slot__name {
  font-size: 5rem;
  font-weight: 600;
  color: #FFFFFF;
  flex: 1;
}
.display-slot__name--free {
  color: rgba(255,255,255,0.25);
}
.display-slot__timer {
  font-size: 1.75rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: #FFFFFF;
}

.display-queue {
  background: rgba(255,255,255,0.05);
  border-radius: 16px;
  padding: 1.5rem;
}
.display-queue__title {
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #FFB74D;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid rgba(255,255,255,0.1);
}
.display-queue__item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 1.75rem;
}
.display-queue__item:last-child { border-bottom: none; }
.display-queue__pos {
  font-weight: 700;
  color: rgba(255,255,255,0.5);
  min-width: 2rem;
}
.display-queue__name {
  font-weight: 600;
  flex: 1;
}
.display-queue__gender {
  font-size: 1rem;
  width: 32px;
  height: 32px;
}

/* === Search === */
.nav-search {
  width: 240px;
  height: 40px;
  padding: 0 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  font-size: 0.875rem;
  background: rgba(0,0,0,0.04);
  color: var(--color-text-primary);
  outline: none;
  transition: all 0.2s ease;
}
.nav-search:focus {
  width: 320px;
  border-color: var(--color-accent);
  background: var(--color-surface);
  box-shadow: 0 0 0 4px rgba(0,122,255,0.15);
}
.search-results-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 400px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--color-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-modal);
  z-index: 200;
  display: none;
}
.search-results-dropdown:not(:empty) { display: block; }
.search-result-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
  color: var(--color-text-primary);
  transition: background 0.15s ease;
}
.search-result-item:hover { background: #F9F9FB; }
.search-result-item:last-child { border-bottom: none; }
.search-result-item__number { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 3rem; }
.search-result-item__name { flex: 1; }
.search-result-item__room { color: var(--color-text-secondary); font-size: 0.8125rem; }

/* === Alert Badge (nav) === */
.alert-badge {
  display: none;
  background: var(--color-destructive);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(255, 59, 48, 0.4);
  padding: 0 5px;
  align-items: center;
  justify-content: center;
  line-height: 1;
  animation: alertGlow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.alert-badge.active { display: inline-flex; }

/* === Grid Filters === */
.grid-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  align-items: center;
}
.grid-filters .filter-btn {
  padding: 0.375rem 0.75rem;
  border-radius: 18px;
  font-size: 0.8125rem;
  font-weight: 600;
  min-height: 40px;
  background: var(--color-bg);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: all 0.2s ease;
}
.grid-filters .filter-btn:hover { background: var(--color-border); }
.grid-filters .filter-btn.active {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}
.grid-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  padding: 0.25rem 0.5rem;
}
.grid-stat__count {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* === Display improvements === */
.display-connection {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.4);
}
.display-connection__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4CAF50;
  transition: background 0.3s ease;
}
.display-connection__dot--disconnected {
  background: #FF3B30;
  animation: pulse 1.5s infinite;
}
.display-next-label {
  display: inline-block;
  background: #FF9800;
  color: #fff;
  font-size: 3rem;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  animation: pulse 2s infinite;
  margin-right: 0.75rem;
}
.display-queue__section-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* === Room Plan View (CSS Grid) === */
.room-plan-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--space-sm);
}
/* Fit the plan to the remaining viewport — overflow hidden = no scroll ever */
.room-plan-wrapper--fit {
  overflow: hidden;
  height: calc(100vh - 210px);
  height: calc(100dvh - 210px);
}
@media (max-width: 512px) {
  .room-plan-wrapper--fit {
    height: calc(100vh - 260px);
    height: calc(100dvh - 260px);
  }
}
.room-plan {
  display: grid;
  grid-template-columns: repeat(var(--plan-cols), 1fr);
  grid-template-rows: repeat(var(--plan-rows), 1fr);
  gap: 3px;
  width: 100%;
  height: 100%;
}

/* Plan cell — just the candidate number, nothing else */
.plan-cell {
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.plan-cell:active { opacity: 0.7; }

.plan-cell--empty {
  background: var(--color-bg);
  border: 1px dashed #D1D1D6;
  cursor: default;
  opacity: 0.25;
}

.plan-cell--normal  { background: var(--color-surface); border-color: var(--color-border); }
.plan-cell--alert   { background: var(--status-alert-bg); border-color: var(--color-destructive); animation: alertGlow 2s infinite; }
.plan-cell--progress { background: var(--status-progress-bg); border-color: var(--color-warning); }
.plan-cell--resolved { background: var(--color-surface); border-color: var(--color-border); }
.plan-cell--toilet  { background: var(--status-toilet-bg); border-color: var(--color-accent); }
.plan-cell--toilet-waiting { background: var(--status-toilet-waiting-bg); border: 1.5px dashed var(--color-accent); }

.plan-cell__number {
  font-size: clamp(0.4rem, 1vw, 0.85rem);
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 1px;
}
.plan-cell__queue {
  font-size: clamp(0.35rem, 0.8vw, 0.7rem);
  font-weight: 600;
  color: var(--color-accent);
  line-height: 1;
}

/* Responsive */
@media (max-width: 768px) {
  .room-plan { gap: 2px; }
  .plan-cell { border-radius: 4px; }
}
@media (max-width: 512px) {
  .room-plan { gap: 1px; }
  .plan-cell { border-radius: 3px; border-width: 1px; }
}

/* === Candidate Detail Bottom-Sheet === */
.candidate-detail__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.candidate-detail {
  background: var(--bg);
  border-radius: 1rem 1rem 0 0;
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 0 1.5rem 1.5rem;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.15);
}
.candidate-detail__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 1;
}
.candidate-detail__handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
}
.candidate-detail--enter { transition: transform 0.3s ease-out, opacity 0.3s ease-out; }
.candidate-detail--enter-start { transform: translateY(100%); opacity: 0; }
.candidate-detail--enter-end { transform: translateY(0); opacity: 1; }
.candidate-detail--leave { transition: transform 0.2s ease-in, opacity 0.2s ease-in; }
.candidate-detail--leave-start { transform: translateY(0); opacity: 1; }
.candidate-detail--leave-end { transform: translateY(100%); opacity: 0; }

/* === Candidate Highlight (search) === */
.candidate-highlight {
  box-shadow: 0 0 0 3px var(--accent), 0 0 12px rgba(0,122,255,0.4) !important;
  animation: highlightPulse 3s ease-out forwards;
}
@keyframes highlightPulse {
  0% { box-shadow: 0 0 0 3px var(--accent), 0 0 16px rgba(0,122,255,0.5); }
  70% { box-shadow: 0 0 0 3px var(--accent), 0 0 12px rgba(0,122,255,0.3); }
  100% { box-shadow: none; }
}

/* === Layout Editor === */
.layout-editor-grid {
  display: inline-grid;
  gap: 4px;
  margin: 1rem 0;
}
.editor-cell {
  aspect-ratio: 1;
  width: 32px;
  border: 2px dashed var(--color-border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.7rem;
  color: var(--color-text-tertiary);
  user-select: none;
  -webkit-user-select: none;
  background: var(--color-surface);
}
.editor-cell:hover {
  border-color: var(--color-accent);
  background: rgba(0,122,255,0.1);
}
.editor-cell--active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  border-style: solid;
  color: white;
  font-weight: 600;
  animation: cell-pop 0.15s ease-out;
}
.editor-cell--active:hover {
  background: #006AE0;
}
@keyframes cell-pop {
  0% { transform: scale(0.85); }
  100% { transform: scale(1); }
}

/* === Display: large room mode === */
.display-body--large .display-slot__name { font-size: 8rem; }
.display-body--large .display-queue__item { font-size: 5rem; }
.display-body--large .display-next-label { font-size: 4rem; }
.display-body--large .display-room-name { font-size: 4rem; }
.display-body--large .display-slots__title { font-size: 3rem; }
.display-body--large .display-queue__section-title { font-size: 2.5rem; }
.display-body--large .display-slot__escort { font-size: 2.5rem; }
.display-body--large .display-slot__timer { font-size: 3rem; }

/* === Display: escort name === */
.display-slot__escort {
  font-size: 1rem;
  color: rgba(255,255,255,0.7);
  margin-left: 0.5rem;
}

/* === Beamer: simplified active WC display === */
.display-active-wc {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  min-height: calc(100vh - 8rem);
  flex-wrap: nowrap;
}
.display-active-wc__item {
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: rgba(255,255,255,0.04);
  border-radius: 24px;
}
.display-active-wc__label {
  display: block;
  font-size: 5vw;
  font-weight: 800;
  color: #FFB74D;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  animation: pulse 2s infinite;
  margin-bottom: 0.5rem;
}
.display-active-wc__number {
  display: block;
  font-size: 15vw;
  font-weight: 900;
  color: #fff;
  line-height: 1;
}
.display-active-wc__escort {
  display: block;
  font-size: 1.5rem;
  color: rgba(255,255,255,0.5);
  margin-top: 1rem;
}
.display-active-wc__timer {
  display: block;
  font-size: 2.5rem;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  font-variant-numeric: tabular-nums;
  margin-top: 0.5rem;
}

/* Flash overlay for queue notification on beamer */
.display-flash {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.display-flash__number {
  font-size: 12rem;
  font-weight: 900;
  color: #fff;
}
.display-flash__label {
  font-size: 3rem;
  color: #FFB74D;
  font-weight: 600;
}

/* === Escort sidebar (room grid view) === */
.escort-sidebar {
  position: sticky;
  top: 1rem;
  min-width: 220px;
  max-width: 280px;
  padding: 1rem;
  background: var(--color-bg-secondary, #f5f5f7);
  border-radius: 12px;
  border: 2px solid var(--color-border);
  align-self: flex-start;
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .escort-sidebar {
    min-width: 100%;
    max-width: 100%;
    position: static;
  }
}

/* === Session banner (admin) === */
.session-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: #ecfdf5;
  color: #064e3b;
  font-size: 0.85rem;
  border-bottom: 1px solid #a7f3d0;
}
.session-banner__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16,185,129,0.7);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.7); }
  50%      { box-shadow: 0 0 0 6px rgba(16,185,129,0); }
}
.session-banner--none {
  background: #fef2f2;
  color: #991b1b;
  border-bottom: 1px solid #fecaca;
}
.session-banner--none a { color: #991b1b; font-weight: 700; text-decoration: underline; }

/* === Incident age badge === */
.incident-age {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 700;
  color: #b45309;
  background: #fffbeb;
  padding: 2px 9px;
  border-radius: 6px;
  border: 1px solid #fcd34d;
  white-space: nowrap;
}
.incident-age--urgent {
  color: #fff;
  background: #dc2626;
  border-color: #991b1b;
  animation: pulse-urgent 1.5s ease-in-out infinite;
}
@keyframes pulse-urgent {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
}

/* === Toast notifications === */
#toast-container {
  position: fixed;
  top: 70px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}
.toast {
  background: #1f2937;
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  border-left: 4px solid #6b7280;
  pointer-events: auto;
  max-width: 380px;
}
.toast--visible { opacity: 1; transform: translateX(0); }
.toast--success { border-left-color: #10b981; background: #064e3b; }
.toast--warning { border-left-color: #f59e0b; background: #78350f; }
.toast--info    { border-left-color: #3b82f6; background: #1e3a8a; }
@media (max-width: 640px) {
  #toast-container { top: 60px; right: 8px; left: 8px; }
  .toast { max-width: 100%; font-size: 0.9rem; padding: 10px 14px; }
}

/* === Reduced motion === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
