@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

/* Color Variables & Base Styles */
:root {
  --bg-app: #faf9f6; /* Warm off-white backdrop */
  --bg-sidebar: #ffffff; /* Clean white sidebar */
  --bg-card: #ffffff; /* Pure white cards */
  --border-color: rgba(190, 18, 60, 0.08); /* Soft crimson-tinted borders */
  --border-hover: rgba(190, 18, 60, 0.16);
  
  --text-main: #1f070b; /* Deep crimson-black for maximum readability */
  --text-muted: #6b565a; /* Warm slate for highly readable secondary text */
  --text-inverse: #ffffff; /* White text on dark elements */
  
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.15);
  --amber: #f59e0b;
  --amber-glow: rgba(245, 158, 11, 0.15);
  --rose: #f43f5e;
  --rose-glow: rgba(244, 63, 94, 0.15);
  --blue: #3b82f6;
  
  --font-display: 'Outfit', sans-serif;
  --font-sans: 'Plus Jakarta Sans', sans-serif;
  
  --shadow-sm: 0 2px 8px -2px rgba(190, 18, 60, 0.04);
  --shadow-md: 0 8px 24px -4px rgba(190, 18, 60, 0.06);
  --shadow-lg: 0 16px 48px -8px rgba(190, 18, 60, 0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  
  --primary: #be123c; /* Kamal Crimson Red */
  --primary-light: #e11d48; /* Vivid Rose Red */
  --primary-glow: rgba(225, 29, 72, 0.08);
  --primary-hue: 348; /* Crimson Hue corresponding to #be123c */
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --bg-select-option: #ffffff; /* Solid white background for light theme select lists */
}

/* Base resets & resets */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  transition: background-color 0.3s;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* App Layout structure */
.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  position: relative;
}

/* Sidebar Navigation */
.sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  border-right: 2px solid var(--border-hover);
  display: flex;
  flex-direction: column;
  padding: 24px;
  flex-shrink: 0;
  z-index: 10;
  transition: var(--transition);
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  padding: 4px;
}

.logo-section svg {
  color: var(--primary);
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 0 8px var(--primary));
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--primary) 30%, var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.nav-item button {
  width: 100%;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 550;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}

.nav-item button svg {
  width: 20px;
  height: 20px;
  transition: var(--transition);
}

.nav-item button:hover {
  color: var(--primary);
  background-color: rgba(190, 18, 60, 0.08);
}

.nav-item.active button {
  color: var(--primary);
  background-color: rgba(190, 18, 60, 0.12);
  box-shadow: inset 3px 0 0 var(--primary);
}

.nav-item.active button svg {
  color: var(--primary);
}

/* Sidebar Footer / Theme / Logs Switch */
.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
}

.toggle-btn {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-family: var(--font-sans);
  padding: 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
}

.toggle-btn:hover {
  color: var(--primary);
  border-color: var(--border-hover);
  background-color: rgba(190, 18, 60, 0.06);
}

/* Main Content Area */
.main-content {
  flex-grow: 1;
  height: 100vh;
  overflow-y: auto;
  padding: 32px;
  position: relative;
}

/* Header bar */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.header-title h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.header-title p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.badge-live {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--primary-glow);
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge-live::before {
  content: '';
  width: 8px;
  height: 8px;
  background-color: var(--primary);
  border-radius: 50%;
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 8px var(--primary); }
  100% { transform: scale(0.9); opacity: 0.6; }
}

/* Views display toggle */

/* Main Content Area */
.main-content {
  flex-grow: 1;
  height: 100vh;
  overflow-y: auto;
  padding: 32px;
  position: relative;
}

/* Header bar */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.header-title h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.header-title p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.badge-live {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--primary-glow);
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge-live::before {
  content: '';
  width: 8px;
  height: 8px;
  background-color: var(--primary);
  border-radius: 50%;
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 8px var(--primary); }
  100% { transform: scale(0.9); opacity: 0.6; }
}

/* Views display toggle */
.app-view {
  display: none;
  animation: fade-in 0.4s ease-out;
}

.app-view.active {
  display: block;
}

/* TV view gets flex display to fill the panel */
#view-tv-display.active {
  display: flex;
  flex-direction: column;
  padding: 0;
  height: 100%;
  border: none;
  border-radius: 0;
  background: none !important;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cards & Glassmorphic components */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.grid-main {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 24px;
}

/* Forms styling */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-control, select {
  width: 100%;
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 11px 14px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: var(--transition);
}

select option {
  background-color: var(--bg-select-option);
  color: var(--text-main);
}

.form-control:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: #ffffff;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Buttons style */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--text-inverse);
}

.btn-primary:hover {
  background-color: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-secondary {
  background: #f4f1fa;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: #ece8f7;
  border-color: var(--border-hover);
}

.btn-danger {
  background-color: var(--rose-glow);
  color: var(--rose);
  border: 1px solid var(--rose);
}

.btn-danger:hover {
  background-color: var(--rose);
  color: var(--text-inverse);
  box-shadow: 0 4px 12px var(--rose-glow);
}

.btn-success {
  background-color: var(--emerald-glow);
  color: var(--emerald);
  border: 1px solid var(--emerald);
}

.btn-success:hover {
  background-color: var(--emerald);
  color: var(--text-inverse);
  box-shadow: 0 4px 12px var(--emerald-glow);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f4f1fa;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover {
  color: var(--text-main);
  background: #ece8f7;
  border-color: var(--border-hover);
}

/* Patient registration billing notice */
.billing-notice {
  background-color: var(--primary-glow);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.billing-notice span {
  font-size: 0.85rem;
  font-weight: 550;
}

.billing-price {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary-light);
}

/* Queue List CSS */
.queue-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #fdfcff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.queue-item:hover {
  background: #f7f4fe;
  border-color: var(--border-hover);
  transform: translateX(2px);
}

.queue-patient-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.queue-badge {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary-light);
  background: var(--primary-glow);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid hsla(var(--primary-hue), 85%, 45%, 0.2);
  min-width: 82px;
  text-align: center;
}

.queue-patient-details h4 {
  font-size: 0.95rem;
  font-weight: 600;
}

.queue-patient-details p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.urgency-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}

.urgency-routine { background-color: var(--blue); }
.urgency-urgent { background-color: var(--amber); }
.urgency-emergency { 
  background-color: var(--rose); 
  box-shadow: 0 0 8px var(--rose);
  animation: pulse-alert 1s infinite alternate;
}

@keyframes pulse-alert {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

.queue-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Empty queues state */
.empty-queue {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty-queue svg {
  width: 48px;
  height: 48px;
  stroke: var(--border-hover);
  margin-bottom: 12px;
}

/* Doctor Panel CSS */
.doctor-rooms {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.room-card {
  display: flex;
  flex-direction: column;
  min-height: 400px;
}

.room-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.room-title h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

.room-status {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 4px;
}

.room-status.active {
  background-color: var(--emerald-glow);
  color: var(--emerald);
}

.room-status.empty {
  background-color: #f0edf9;
  color: var(--text-muted);
}

.serving-now-box {
  background: linear-gradient(135deg, rgba(190, 18, 60, 0.05) 0%, rgba(190, 18, 60, 0.01) 100%);
  border: 1px solid rgba(190, 18, 60, 0.15);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  margin-bottom: 20px;
}

.serving-now-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1px;
  font-weight: 600;
  margin-bottom: 8px;
}

.serving-token {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary-light);
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.serving-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.serving-details {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.serving-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.room-queue {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.room-queue-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Lobby TV Display view - fills main-content completely */
#view-tv-display {
  padding: 0;
  margin: 0;
  border-radius: 0;
  border: none;
  background: var(--bg-app) !important;
}

/* ====================================================
   TV LANDSCAPE PATIENT WAITING BOARD
   ==================================================== */

/* Outer wrapper - fills the entire main-content area */
.tv-landscape-wrap {
  display: flex;
  width: 100%;
  flex: 1;
  min-height: 0;
  gap: 0;
  overflow: hidden;
}

/* ── LEFT PANEL (called token section) ─────────────────── */
.tv-left-panel {
  width: 38%;
  flex-shrink: 0;
  background: linear-gradient(135deg, #f6f3ff 0%, #ede9fe 50%, #e0d7ff 100%);
  border-right: 2px solid var(--border-hover);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 32px 24px;
  color: var(--text-main);
  position: relative;
  overflow: hidden;
  box-shadow: inset -5px 0 15px rgba(190, 18, 60, 0.02);
}

.tv-left-panel::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 220px; height: 220px;
  background: rgba(225, 29, 72, 0.05);
  border-radius: 50%;
}

.tv-left-panel::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -40px;
  width: 260px; height: 260px;
  background: rgba(225, 29, 72, 0.04);
  border-radius: 50%;
}

.tv-lp-header {
  text-align: center;
  z-index: 1;
}

.tv-lp-header svg { 
  margin-bottom: 10px;
  stroke: var(--primary);
}

.tv-lp-clinic {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.tv-lp-tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 4px;
  font-weight: 600;
}

.tv-lp-called {
  text-align: center;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tv-lp-now-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--primary-light);
  font-weight: 700;
  margin-bottom: 8px;
  background: var(--primary-glow);
  padding: 6px 18px;
  border-radius: 20px;
  border: 1px solid rgba(225, 29, 72, 0.15);
}

.tv-lp-token {
  font-family: var(--font-display);
  font-size: 5.5rem;
  font-weight: 900;
  letter-spacing: -2px;
  color: var(--primary);
  line-height: 1;
  text-shadow: 0 4px 16px rgba(225, 29, 72, 0.15);
  animation: tv-lp-pulse 2.5s ease-in-out infinite;
}

@keyframes tv-lp-pulse {
  0%, 100% { transform: scale(1);    opacity: 1; }
  50%       { transform: scale(1.04); opacity: 0.88; }
}

.tv-lp-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  max-width: 90%;
  text-align: center;
  line-height: 1.2;
}

.tv-lp-room {
  font-size: 0.95rem;
  color: var(--emerald);
  font-weight: 700;
  margin-top: 4px;
  padding: 4px 14px;
  background: var(--emerald-glow);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 12px;
  min-height: 24px;
}

.tv-lp-footer {
  text-align: center;
  z-index: 1;
  border-top: 1px solid rgba(190, 18, 60, 0.08);
  width: 100%;
  padding-top: 16px;
}

.tv-lp-clock {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary-light);
  letter-spacing: 2px;
}

.tv-lp-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 4px;
}

/* ── RIGHT PANEL (queue board) ───────────────────── */
.tv-right-panel {
  flex: 1;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100% !important;
}

.tv-rp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: #f7f4fe;
  border-bottom: 2px solid var(--border-hover);
  flex-shrink: 0;
}

.tv-rp-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.tv-rp-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tv-waiting-count {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  background: #ede9fe;
  padding: 3px 12px;
  border-radius: 20px;
}

.tv-page-indicator {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(190, 18, 60, 0.08);
  padding: 3px 10px;
  border-radius: 12px;
}

.tv-col-headers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: #faf9fd;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.tv-col-header-item {
  display: grid;
  grid-template-columns: 36px 140px 1fr;
  gap: 0 15px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.tv-col-header-item:first-child {
  border-right: 1px solid var(--border-color);
}

/* The 2-column grid board */
.tv-grid-board {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  overflow: hidden;
}

.tv-col {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  border-right: 1px solid var(--border-color);
  padding: 6px 8px;
  height: 100%;
  box-sizing: border-box;
}

.tv-col:last-child { border-right: none; }

.tv-board-row {
  display: grid;
  grid-template-columns: 36px 140px 1fr;
  gap: 0 15px;
  align-items: center;
  padding: 0 12px;
  border-radius: 6px;
  transition: background 0.15s;
  border-bottom: 1px solid #f4f1fa;
  height: calc(10% - 4px);
  box-sizing: border-box;
}

.tv-board-row:last-child { border-bottom: none; }
.tv-board-row:hover { background: #f7f4fe; }

.tv-emerg    { border-left: 3px solid var(--rose);  background: #fff8f8; }
.tv-urgent-row { border-left: 3px solid var(--amber); background: #fffdf5; }

.tv-br-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--primary-glow);
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.tv-br-token {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
}

.tv-br-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tv-br-svc {
  font-size: 1.05rem;
  color: var(--text-muted);
  background: #f4f1fa;
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.tv-badge {
  font-size: 0.6rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tv-badge.emerg  { background: var(--rose-glow);  color: var(--rose); }
.tv-badge.urgent { background: var(--amber-glow); color: var(--amber); }

/* Empty state */
.tv-empty-msg {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 30px 0;
  grid-column: 1 / -1;
}

/* Slideshow dots */
.tv-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  flex-shrink: 0;
  border-top: 1px solid var(--border-color);
}

.tv-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border-hover);
  transition: background 0.3s, transform 0.3s;
}

.tv-dot.active {
  background: var(--primary);
  transform: scale(1.3);
}

/* Standalone Clean TV presentation view classes */
body.tv-view-active .top-header,
body.tv-view-active #db-status-banner,
body.tv-view-active .simulator-widget {
  display: none !important;
}

body.tv-view-active .main-content {
  padding: 0 !important;
  overflow: hidden !important;
}

/* Fullscreen Mode Sidebar Toggle */
body.tv-fullscreen .sidebar {
  display: none !important;
}

.tv-exit-btn {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 24px;
  background-color: var(--primary);
  color: var(--text-inverse);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  transition: var(--transition);
}

.tv-exit-btn:hover {
  background-color: var(--primary-light);
  transform: translateY(-2px);
}

body.tv-fullscreen .tv-exit-btn {
  display: block;
}

/* Portrait orientation styles for Waiting Room TV Screen */
@media (orientation: portrait), (max-width: 1024px) {
  .tv-landscape-wrap {
    flex-direction: column;
    height: 100%;
  }
  
  .tv-left-panel {
    width: 100%;
    height: 40%;
    border-right: none;
    border-bottom: 2px solid var(--border-hover);
    padding: 16px;
    box-shadow: inset 0 -5px 15px rgba(190, 18, 60, 0.02);
  }
  
  .tv-right-panel {
    width: 100%;
    height: 60%;
  }
  
  .tv-lp-header svg {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
  }
  
  .tv-lp-clinic {
    font-size: 1.35rem;
  }
  
  .tv-lp-tagline {
    font-size: 0.7rem;
    letter-spacing: 1px;
    margin-top: 0;
  }
  
  .tv-lp-called {
    gap: 4px;
  }
  
  .tv-lp-now-label {
    font-size: 0.7rem;
    padding: 3px 12px;
    margin-bottom: 2px;
  }
  
  .tv-lp-token {
    font-size: 3.8rem;
  }
  
  .tv-lp-name {
    font-size: 1.05rem;
  }
  
  .tv-lp-room {
    font-size: 0.85rem;
    padding: 2px 10px;
  }
  
  .tv-lp-footer {
    padding-top: 8px;
    width: 100%;
  }
  
  .tv-lp-clock {
    font-size: 1.8rem;
  }
  
  .tv-lp-date {
    font-size: 0.75rem;
    margin-top: 0;
  }
  
  /* Patient list column formatting for compact portrait view */
  .tv-rp-header {
    padding: 6px 12px;
  }
  
  .tv-rp-title {
    font-size: 0.85rem;
  }
  
  .tv-waiting-count {
    font-size: 0.75rem;
    padding: 2px 8px;
  }
  
  .tv-page-indicator {
    font-size: 0.72rem;
    padding: 2px 8px;
  }
  
  .tv-board-row {
    padding: 0 8px;
    font-size: 0.8rem;
    grid-template-columns: 24px 95px 1fr;
    gap: 0 8px;
    height: calc(10% - 4px);
    box-sizing: border-box;
  }
  
  .tv-col-headers {
    padding: 6px 12px;
    font-size: 0.72rem;
    grid-template-columns: 24px 95px 1fr;
    gap: 0 8px;
  }
  
  .tv-br-num {
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
  }
  
  .tv-br-token {
    font-size: 1.05rem;
  }
  
  .tv-br-name {
    font-size: 1.15rem;
    gap: 4px;
  }
  
  .tv-br-svc {
    font-size: 0.85rem;
    padding: 2px 6px;
    border-radius: 8px;
  }
}

/* Public Waiting Area TV Screen */
.public-display-container {
  display: grid;
  grid-template-rows: auto 1fr;
  height: calc(100vh - 120px);
  gap: 24px;
}

.tv-banner {
  background: linear-gradient(90deg, #f0edf9 0%, #e8e2f6 50%, #f0edf9 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tv-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tv-title h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
}

.tv-clock {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-light);
}

.tv-departments {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.tv-dept-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.tv-dept-header {
  padding: 20px 24px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.tv-dept-header.sonography { background-color: rgba(190, 18, 60, 0.06); border-bottom: 2px solid var(--primary); }
.tv-dept-header.xray { background-color: rgba(225, 29, 72, 0.03); border-bottom: 2px solid var(--primary-light); }

.tv-dept-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

.tv-dept-room {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-top: 4px;
}

.tv-serving-panel {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
}

.tv-serving-lbl {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 600;
}

.tv-token-active {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 8px;
}

.sonography .tv-token-active { color: var(--primary); text-shadow: 0 2px 12px rgba(190, 18, 60, 0.2); }
.xray .tv-token-active { color: var(--primary-light); text-shadow: 0 2px 12px rgba(225, 29, 72, 0.2); }

.tv-patient-name {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.tv-upcoming-panel {
  padding: 20px 24px;
  background-color: rgba(190, 18, 60, 0.02);
}

.tv-upcoming-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 12px;
  font-weight: 700;
}

.tv-upcoming-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tv-upcoming-token {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 6px 10px;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-main);
}

/* TV Alert screen overlay when token is called */
.tv-overlay-alert {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(250, 249, 253, 0.96);
  backdrop-filter: blur(12px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
}

.tv-overlay-card {
  width: 600px;
  background: #ffffff;
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(190, 18, 60, 0.15);
  animation: scale-up 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scale-up {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.tv-overlay-sound-wave {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 24px;
}

.tv-overlay-sound-wave span {
  width: 4px;
  height: 32px;
  background: var(--primary-light);
  border-radius: 20px;
  animation: wave-bounce 1s infinite ease-in-out;
}

.tv-overlay-sound-wave span:nth-child(2) { animation-delay: 0.15s; }
.tv-overlay-sound-wave span:nth-child(3) { animation-delay: 0.3s; }
.tv-overlay-sound-wave span:nth-child(4) { animation-delay: 0.45s; }
.tv-overlay-sound-wave span:nth-child(5) { animation-delay: 0.6s; }

@keyframes wave-bounce {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
}

.tv-overlay-title {
  font-size: 1rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 3px;
  font-weight: 600;
  margin-bottom: 16px;
}

.tv-overlay-token {
  font-family: var(--font-display);
  font-size: 5rem;
  font-weight: 900;
  color: var(--primary-light);
  margin-bottom: 12px;
  animation: flash-token-text 0.8s infinite alternate;
}

@keyframes flash-token-text {
  from { text-shadow: 0 0 10px hsla(var(--primary-hue), 85%, 45%, 0.4); }
  to { text-shadow: 0 0 35px hsla(var(--primary-hue), 85%, 45%, 0.8); }
}

.tv-overlay-name {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.tv-overlay-room {
  font-size: 1.25rem;
  color: var(--emerald);
  font-weight: 600;
}

/* Analytics Dashboard elements */
.analytics-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 20px;
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.stat-trend {
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.trend-up { color: var(--emerald); }
.trend-down { color: var(--rose); }

/* SVG Graph visual fallback styling */
.chart-container {
  height: 240px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 10px 10px 0 10px;
  border-bottom: 2px solid var(--border-color);
  border-left: 2px solid var(--border-color);
  margin-top: 10px;
}

.chart-bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 15%;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  transition: height 1s ease-out;
  position: relative;
}

.chart-bar::before {
  content: attr(data-value);
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  font-weight: 700;
}

.chart-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: center;
  white-space: nowrap;
}

/* Settings tables */
.settings-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.settings-table th, .settings-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.settings-table th {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.settings-table td {
  font-size: 0.9rem;
}

/* Modal dialogs */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-card {
  width: 480px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
}

.receipt-body {
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0;
  background-color: #faf9fd;
  margin-bottom: 20px;
  font-family: monospace;
  overflow: hidden;
}

.receipt-letterhead-wrap {
  width: 100%;
  background: #fff;
  border-bottom: 3px solid #be123c;
  line-height: 0;
}

.receipt-letterhead-img {
  width: 100%;
  display: block;
  max-height: 130px;
  object-fit: contain;
  object-position: center;
  background: #fff;
  padding: 4px 16px;
}

.receipt-body > .receipt-row,
.receipt-body > .receipt-total,
.receipt-body > div:not(.receipt-letterhead-wrap) {
  padding-left: 16px;
  padding-right: 16px;
}

.receipt-body > .receipt-row:first-of-type {
  margin-top: 12px;
}

.receipt-body > div:last-child {
  padding-bottom: 14px;
}

.receipt-header {
  text-align: center;
  margin-bottom: 16px;
  padding: 0 16px;
}

.receipt-header h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.receipt-total {
  border-top: 1px dashed var(--border-color);
  padding-top: 8px;
  margin-top: 8px;
  font-weight: 700;
  font-size: 0.95rem;
}

/* Sliding Reminder Logs Panel */
.reminder-sidebar {
  position: fixed;
  right: -360px;
  top: 0;
  width: 360px;
  height: 100vh;
  background-color: var(--bg-sidebar);
  border-left: 2px solid var(--border-hover);
  box-shadow: var(--shadow-lg);
  z-index: 40;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.reminder-sidebar.active {
  right: 0;
}

.reminder-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.reminder-header h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}

.reminder-log-list {
  padding: 20px;
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.reminder-card {
  background: #f7f4fe;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  position: relative;
}

.reminder-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.reminder-phone {
  font-weight: 600;
  color: var(--primary-light);
}

.reminder-time {
  font-size: 0.7rem;
}

.reminder-text {
  font-size: 0.8rem;
  line-height: 1.4;
}

.reminder-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 750;
  text-transform: uppercase;
}

.reminder-badge.reg { background-color: var(--primary-glow); color: var(--primary-light); }
.reminder-badge.next { background-color: var(--amber-glow); color: var(--amber); }
.reminder-badge.call { background-color: var(--rose-glow); color: var(--rose); }
.reminder-badge.comp { background-color: var(--emerald-glow); color: var(--emerald); }

.logs-toggle-fixed {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: var(--primary-light);
  color: var(--text-inverse);
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  box-shadow: 0 4px 20px hsla(var(--primary-hue), 85%, 45%, 0.35);
  cursor: pointer;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}



.logs-toggle-fixed:hover {
  transform: scale(1.1);
  background-color: var(--primary-light);
}

.logs-badge-count {
  position: absolute;
  top: -2px;
  right: -2px;
  background-color: var(--rose);
  color: var(--text-main);
  font-size: 0.7rem;
  font-weight: 750;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* System Simulator panel controls */
.simulator-widget {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.04) 0%, rgba(245, 158, 11, 0.01) 100%);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.simulator-info h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--amber);
  display: flex;
  align-items: center;
  gap: 6px;
}

.simulator-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.simulator-actions {
  display: flex;
  gap: 8px;
}

/* Responsive Styles */
@media (max-width: 1200px) {
  .doctor-rooms {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .room-card {
    min-height: auto;
  }
}

@media (max-width: 1024px) {
  .grid-main {
    grid-template-columns: 1fr;
  }
  .tv-departments {
    grid-template-columns: 1fr;
  }
  .analytics-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  body {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 16px;
  }
  .main-content {
    padding: 16px;
    height: auto;
    overflow-y: visible;
  }
  .grid-2, .form-row {
    grid-template-columns: 1fr;
  }
}

/* Legacy duplicate styles removed */

/* ====================================================
   ROLE AUTHENTICATION LOGIN SCREEN STYLES
   ==================================================== */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #faf9f6; /* Warm off-white from image */
  background-image: 
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.7), rgba(250, 249, 246, 0.2)),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.035'/%3E%3C/svg%3E");
  z-index: 10000; /* Ensure it stays above everything */
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  overflow: hidden;
  backdrop-filter: blur(10px);
  animation: login-bg-fade 0.5s ease-out;
  
  /* Brand Crimson Red Variable Override */
  --primary: #be123c;
  --primary-light: #e11d48;
  --primary-glow: rgba(225, 29, 72, 0.08);
}

@keyframes login-bg-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.login-brand-side {
  flex: 1.25;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 40px 60px 80px;
  border-right: 1px solid rgba(190, 18, 60, 0.06);
}

.login-form-side {
  flex: 0.75;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 80px 40px 40px;
}

.brand-logo-container {
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand-logo-svg {
  width: 150px;
  height: 112px;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 8px rgba(190, 18, 60, 0.08));
}

.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-name-kamal {
  font-family: var(--font-display);
  font-size: 3.4rem;
  font-weight: 800;
  color: #be123c;
  line-height: 0.85;
  letter-spacing: -1.5px;
}

.brand-name-diagnostics {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 800;
  color: #be123c;
  line-height: 0.9;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.brand-tagline {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  color: #52525b;
  letter-spacing: 1.2px;
  margin-top: 8px;
  white-space: nowrap;
}

.brand-welcome-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 580px;
  width: 100%;
}

.brand-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(190, 18, 60, 0.15), rgba(190, 18, 60, 0));
  margin: 32px 0;
}

.brand-features-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

.brand-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.brand-feature-item .feature-icon {
  font-size: 1.35rem;
  background: rgba(190, 18, 60, 0.05);
  color: #be123c;
  padding: 10px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(190, 18, 60, 0.1);
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(190, 18, 60, 0.02);
}

.brand-feature-item .feature-icon svg {
  stroke: #be123c;
}

.brand-feature-item .feature-text h4 {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  color: #140727;
  margin-bottom: 4px;
}

.brand-feature-item .feature-text p {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  font-weight: 500;
}

@media (max-width: 992px) {
  .brand-welcome-container {
    align-items: center;
    max-width: 100%;
  }
  .brand-divider, .brand-features-list {
    display: none !important;
  }
}


.login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid rgba(190, 18, 60, 0.1);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: 0 24px 64px -12px rgba(190, 18, 60, 0.08), 
              inset 0 0 24px rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  transform: translateY(0);
  animation: login-card-slide 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
}

@keyframes login-card-slide {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.login-header {
  margin-bottom: 24px;
}

.login-header h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 750;
  color: #be123c;
  margin-bottom: 6px;
}

.login-header p {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 550;
  line-height: 1.3;
}

.login-error {
  background-color: var(--rose-glow);
  border: 1px solid rgba(244, 63, 94, 0.25);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--rose);
  text-align: center;
  animation: login-shake 0.4s ease-in-out;
}

@keyframes login-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* Responsiveness for Login Screen */
@media (max-width: 992px) {
  .login-overlay {
    flex-direction: column;
    overflow-y: auto;
    align-items: center;
    justify-content: flex-start;
    padding: 60px 24px 40px 24px;
  }
  .login-brand-side {
    flex: none;
    width: 100%;
    padding: 20px 0 40px 0;
    border-right: none;
    border-bottom: 1px solid rgba(190, 18, 60, 0.06);
    justify-content: center;
    margin-bottom: 30px;
  }
  .brand-logo-container {
    gap: 16px;
  }
  .brand-logo-svg {
    width: 100px;
    height: 75px;
  }
  .brand-name-kamal {
    font-size: 2.5rem;
  }
  .brand-name-diagnostics {
    font-size: 1.55rem;
  }
  .brand-tagline {
    font-size: 0.62rem;
    letter-spacing: 0.8px;
  }
  .login-form-side {
    flex: none;
    width: 100%;
    padding: 0;
    justify-content: center;
  }
}

/* TV Signage standalone style rules */
body.tv-standalone-mode .sidebar {
  display: none !important;
}

body.tv-standalone-mode .main-content {
  padding: 0 !important;
  margin: 0 !important;
  height: 100vh !important;
  width: 100vw !important;
  overflow: hidden !important;
}

/* Printable Receipt styling */
@media print {
  body * {
    visibility: hidden !important;
  }
  #receipt-modal, #receipt-modal * {
    visibility: visible !important;
  }
  #receipt-modal {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: auto;
    background: #ffffff !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: none !important;
    border: none !important;
  }
  .modal-overlay {
    background: none !important;
    position: static !important;
    display: flex !important;
  }
  .modal-card {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    width: 100% !important;
    background: #ffffff !important;
  }
  #receipt-modal button, #receipt-modal .btn, #close-receipt-btn, #print-receipt-btn, #done-receipt-btn, .modal-header button {
    display: none !important;
  }
}

/* Fullscreen Intro Video Overlay Styles */
.video-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000000;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease-out;
}

.video-overlay video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}

.video-skip-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  z-index: 100000;
  backdrop-filter: blur(8px);
  transition: var(--transition);
}

.video-skip-btn:hover {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
}

.video-unmute-hint {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 20px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  pointer-events: none;
  z-index: 100000;
  backdrop-filter: blur(8px);
  animation: video-hint-pulse 1.5s infinite alternate;
}

@keyframes video-hint-pulse {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

/* ============================================================
   DOCTOR / ADMIN DASHBOARD — GLASSMORPHISM STYLES
   ============================================================ */

/* Welcome Banner */
.dash-welcome-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(190,18,60,0.9) 0%, rgba(225,29,72,0.75) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-lg);
  padding: 22px 28px;
  margin-bottom: 24px;
  box-shadow: 0 8px 32px rgba(190,18,60,0.2), inset 0 1px 0 rgba(255,255,255,0.2);
  animation: dash-fade-in 0.5s ease-out;
}

.dash-welcome-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dash-welcome-text span:first-child {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.dash-welcome-sub {
  font-size: 0.85rem !important;
  color: rgba(255,255,255,0.8) !important;
  font-weight: 500 !important;
}

.dash-date-picker-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  backdrop-filter: blur(10px);
  color: #ffffff;
}

.dash-date-input {
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.dash-date-input::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
  opacity: 0.8;
}

/* KPI Row */
.dash-kpi-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

/* Glass Card base */
.dash-glass-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px rgba(190,18,60,0.06), 0 1px 0 rgba(255,255,255,0.8) inset;
  transition: var(--transition);
  animation: dash-fade-in 0.5s ease-out;
  position: relative;
  overflow: hidden;
}

.dash-glass-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(190,18,60,0.1), 0 1px 0 rgba(255,255,255,0.9) inset;
  border-color: rgba(190,18,60,0.2);
}

/* KPI Card */
.dash-kpi-card {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.dash-kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  backdrop-filter: blur(8px);
}

.dash-kpi-data {
  flex: 1;
  min-width: 0;
}

.dash-kpi-value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
  letter-spacing: -1px;
}

.dash-kpi-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.dash-kpi-glow {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  filter: blur(20px);
  pointer-events: none;
}

/* Main content grid: activity table + right col */
.dash-main-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  margin-bottom: 20px;
}

/* Activity Table card */
.dash-activity-card {
  padding: 0;
  overflow: hidden;
}

.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(190,18,60,0.08);
  background: rgba(255,255,255,0.5);
  backdrop-filter: blur(10px);
}

.dash-card-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.dash-card-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-glow);
  border: 1px solid rgba(190,18,60,0.15);
  padding: 3px 10px;
  border-radius: 50px;
}

.dash-table-wrap {
  overflow-x: auto;
  max-height: 320px;
  overflow-y: auto;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.dash-table thead th {
  background: rgba(250,249,246,0.8);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(190,18,60,0.08);
  position: sticky;
  top: 0;
  backdrop-filter: blur(10px);
}

.dash-table tbody tr {
  border-bottom: 1px solid rgba(190,18,60,0.04);
  transition: background 0.15s;
}

.dash-table tbody tr:hover {
  background: rgba(190,18,60,0.03);
}

.dash-table tbody td {
  padding: 10px 14px;
  color: var(--text-main);
  vertical-align: middle;
}

.dash-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 0 !important;
  font-size: 0.85rem;
}

/* Status badges in table */
.dash-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.dash-status-waiting {
  background: rgba(245,158,11,0.12);
  color: var(--amber);
  border: 1px solid rgba(245,158,11,0.25);
}

.dash-status-completed {
  background: rgba(16,185,129,0.1);
  color: var(--emerald);
  border: 1px solid rgba(16,185,129,0.2);
}

.dash-status-calling {
  background: rgba(190,18,60,0.08);
  color: var(--primary);
  border: 1px solid rgba(190,18,60,0.2);
}

.dash-status-held {
  background: rgba(59,130,246,0.08);
  color: var(--blue);
  border: 1px solid rgba(59,130,246,0.2);
}

/* Right column */
.dash-right-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Service bar chart */
.dash-service-bars {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dash-svc-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dash-svc-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  width: 100px;
  flex-shrink: 0;
}

.dash-svc-track {
  flex: 1;
  height: 8px;
  background: rgba(190,18,60,0.06);
  border-radius: 50px;
  overflow: hidden;
}

.dash-svc-bar {
  height: 100%;
  border-radius: 50px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.dash-svc-count {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  width: 20px;
  text-align: right;
  flex-shrink: 0;
}

/* Payment split */
.dash-payment-list {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dash-pay-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(190,18,60,0.06);
}

.dash-pay-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dash-pay-mode {
  flex: 1;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.dash-pay-amount {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.dash-pay-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
}

.dash-pay-total-row span:last-child {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--primary);
}

/* Quick Action Buttons */
.dash-quick-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.dash-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(190,18,60,0.15);
  border-radius: var(--radius-md);
  color: var(--primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(190,18,60,0.06);
}

.dash-action-btn:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(190,18,60,0.25);
}

.dash-action-btn svg {
  transition: var(--transition);
}

/* Animation */
@keyframes dash-fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Stagger animation for KPI cards */
.dash-kpi-row .dash-glass-card:nth-child(1) { animation-delay: 0.05s; }
.dash-kpi-row .dash-glass-card:nth-child(2) { animation-delay: 0.1s; }
.dash-kpi-row .dash-glass-card:nth-child(3) { animation-delay: 0.15s; }
.dash-kpi-row .dash-glass-card:nth-child(4) { animation-delay: 0.2s; }
.dash-kpi-row .dash-glass-card:nth-child(5) { animation-delay: 0.25s; }

/* Responsive */
@media (max-width: 1200px) {
  .dash-kpi-row { grid-template-columns: repeat(3, 1fr); }
  .dash-main-grid { grid-template-columns: 1fr; }
  .dash-right-col { flex-direction: row; }
}

@media (max-width: 768px) {
  .dash-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .dash-right-col { flex-direction: column; }
  .dash-welcome-banner { flex-direction: column; gap: 16px; align-items: flex-start; }
}


/* ============================================================
   INTERACTIVE SYSTEM TOUR GUIDE STYLES
   ============================================================ */
#tour-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(1.5px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}
#tour-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
#tour-tooltip {
  position: absolute;
  background: var(--bg-card, #ffffff);
  color: var(--text-main, #0f172a);
  border: 1px solid var(--border-color, rgba(0,0,0,0.15));
  border-radius: var(--radius-md, 12px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.3);
  padding: 16px;
  width: 320px;
  z-index: 100000;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.tour-highlight {
  position: relative !important;
  z-index: 100001 !important;
  box-shadow: 0 0 0 5px var(--primary), 0 12px 28px rgba(0,0,0,0.25) !important;
  transition: box-shadow 0.3s ease !important;
  pointer-events: none !important; /* Block clicks on target during tour */
}


/* ============================================================
   WAITING ROOM TV SIGNAGE NEW LAYOUT & NOTICE BAR
   ============================================================ */
.tv-main-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.tv-notice-bar {
  background: var(--primary);
  color: white;
  height: 54px;
  display: flex;
  align-items: center;
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
  border-top: 3px solid rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
  box-shadow: 0 -4px 15px rgba(0,0,0,0.15);
}

.tv-notice-text {
  display: inline-block;
  white-space: nowrap;
  animation: tv-marquee 28s linear infinite;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding-left: 100%;
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

@keyframes tv-marquee {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}

.tv-brand-logo-svg {
  width: 90px;
  height: 68px;
  flex-shrink: 0;
  margin-bottom: 6px;
}

/* TV specific logo style responsive overrides */
@media (orientation: portrait), (max-width: 1024px) {
  .tv-brand-logo-svg {
    width: 60px !important;
    height: 45px !important;
    margin-bottom: 2px !important;
  }
}
