/* ─── Grossmonitor / TV-Modus Stylesheet ────────────────────────────── */
:root {
  --tv-bg: #090d16;
  --tv-bg-header: #0f172a;
  --tv-card-bg: #1e293b;
  --tv-card-border: #334155;
  --tv-text: #f8fafc;
  --tv-text-muted: #94a3b8;
  --tv-accent: #3b82f6;

  /* Department Colors: Kräftig, hochkontrastreich */
  --status-green: #15803d; /* etwas satteres Rettungsdienst-Grün */
  --status-orange: #f59e0b; /* Signal-Orange / Gelb */
  --status-red: #dc2626; /* Alarm-Rot */

  /* Textfarben:
   * Steingrau / Schiefergrau für farbige Buttons: Gut lesbar mit hohem Kontrast
   * Für Grün und Orange: Ein sehr dunkles, klares Steingrau (#1f2937 / #0f172a / #27272a)
   * Für Rot: Tiefschwarz (#000000)
   * Für Grau: Tiefschwarz (#000000)
   */
  --btn-stone-gray: #1e293b;
}

[data-theme="light"] {
  --tv-bg: #f1f5f9;
  --tv-bg-header: #ffffff;
  --tv-card-bg: #ffffff;
  --tv-card-border: #cbd5e1;
  --tv-text: #0f172a;
  --tv-text-muted: #64748b;
  --tv-accent: #2563eb;
  --btn-stone-gray: #0f172a;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.tv-body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--tv-bg);
  color: var(--tv-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.25;
}

/* ─── Header ────────────────────────────────────────────────────────── */
.tv-header {
  background: var(--tv-bg-header);
  border-bottom: 2px solid var(--tv-card-border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.tv-header-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.tv-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 0;
  border: none;
  margin-bottom: 2px;
}

.tv-brand-patch-logo {
  width: 30px;
  height: auto;
  max-height: 34px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.tv-brand-title {
  font-size: 1.25rem;
  line-height: 1.1;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--tv-text);
  display: flex;
  align-items: baseline;
  white-space: nowrap;
}

.tv-brand-title .brand-exchange {
  color: #059669;
  font-weight: 800;
  margin-left: 1px;
  text-shadow: none;
}

[data-theme="light"] .tv-brand-title {
  color: #0f172a;
}

[data-theme="light"] .tv-brand-title .brand-exchange {
  color: #059669;
}

.tv-header-title-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.tv-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.2;
}

.tv-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--tv-text-muted);
  margin-top: 1px;
}

.tv-live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #10b981;
  font-weight: 700;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Counter Summary Badges */
.tv-summary-counters {
  display: flex;
  align-items: center;
  gap: 12px;
}

.counter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
}
.counter-item .counter-num {
  font-size: 1.4rem;
  font-weight: 900;
}

.counter-green {
  background: rgba(22, 163, 74, 0.2);
  border: 1px solid rgba(22, 163, 74, 0.5);
  color: #4ade80;
}
.counter-orange {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fbbf24;
}
.counter-red {
  background: rgba(239, 68, 68, 0.25);
  border: 1px solid rgba(239, 68, 68, 0.6);
  color: #f87171;
}

/* Header Right: Clock & Actions */
.tv-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.tv-clock {
  font-family: monospace, monospace;
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  padding: 4px 14px;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

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

.tv-btn {
  background: var(--tv-card-bg);
  color: var(--tv-text);
  border: 1px solid var(--tv-card-border);
  padding: 8px 14px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}
.tv-btn:hover {
  background: var(--tv-accent);
  color: #fff;
  border-color: var(--tv-accent);
}

/* ─── Cluster Navigation Tabs ────────────────────────────────────────── */
.tv-cluster-nav {
  display: flex;
  gap: 10px;
  padding: 10px 24px;
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid var(--tv-card-border);
  overflow-x: auto;
}

.tv-cluster-tab {
  background: var(--tv-card-bg);
  border: 1px solid var(--tv-card-border);
  color: var(--tv-text-muted);
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.tv-cluster-tab:hover {
  color: var(--tv-text);
  border-color: var(--tv-accent);
}

.tv-cluster-tab.active {
  background: var(--tv-accent);
  color: #ffffff;
  border-color: var(--tv-accent);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.5);
}

/* ─── Status Filter Nav (All vs Alert/Gelb-Rot) ───────────────────────── */
.tv-filter-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 8px 24px;
  background: rgba(10, 16, 28, 0.85);
  border-bottom: 1px solid var(--tv-card-border);
}

.tv-status-nav {
  display: flex;
  gap: 10px;
}

.tv-status-tab {
  background: var(--tv-card-bg);
  border: 1px solid var(--tv-card-border);
  color: var(--tv-text-muted);
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.tv-status-tab:hover {
  color: var(--tv-text);
  border-color: var(--tv-accent);
}

.tv-status-tab.active {
  background: var(--tv-accent);
  color: #ffffff;
  border-color: var(--tv-accent);
}

.tv-status-tab.tv-tab-alert {
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}
.tv-status-tab.tv-tab-alert.active {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
  box-shadow: 0 0 14px rgba(220, 38, 38, 0.6);
}

/* ─── Legend Bar ─────────────────────────────────────────────────────── */
.tv-legend-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 8px 24px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--tv-text-muted);
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--tv-card-border);
}

.tv-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tv-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
}
.tv-dot-none {
  background: transparent;
  border: 2px dashed var(--tv-card-border);
}

/* ─── Main Grid Layout ───────────────────────────────────────────────── */
.tv-main-container {
  flex: 1;
  padding: 18px 24px;
}

.tv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 16px;
}

@media (min-width: 2500px) {
  /* 4K Screens */
  .tv-grid {
    grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
    gap: 20px;
  }
}

.tv-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  font-size: 1.5rem;
  color: var(--tv-text-muted);
}

.tv-empty-alert {
  background: rgba(16, 185, 129, 0.12);
  border: 3px solid rgba(16, 185, 129, 0.6);
  border-radius: 16px;
  color: #10b981;
  font-weight: 900;
  font-size: 2.2rem;
  line-height: 1.4;
  padding: 70px 30px;
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* ─── Hospital TV Cards ──────────────────────────────────────────────── */
.tv-card {
  background: var(--tv-card-bg);
  border: 2px solid var(--tv-card-border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s, border-color 0.15s;
}

.tv-card:hover {
  transform: translateY(-2px);
  border-color: #38bdf8;
}

.tv-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.tv-hospital-name {
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--tv-text);
}

.tv-cluster-badge {
  font-size: 0.85rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
  white-space: nowrap;
}

/* ─── Departments 2x2 Grid: Large, Filling Buttons ───────────────────── */
.tv-depts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tv-dept {
  border-radius: 10px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 82px;
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.2);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s;
}

/* Feld-füllende, extra-große Schrift */
.tv-dept-label {
  font-size: 1.85rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}

/* Sperrzeit direkt unter dem Kenner */
.tv-dept-time {
  margin-top: 6px;
  font-size: 1.05rem;
  font-weight: 900;
  padding: 3px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.1;
}

/* ─── Kontrast-Regeln für die Buttons ───
 * 1. Farbige Buttons (Grün / Gelb / Orange):
 *    Schrift in Steingrau (#334155 / #1e293b) mit Textschatten/Kontrast
 * 2. Rot (Nicht aufnahmefähig / Abgemeldet):
 *    Schrift in Tiefschwarz (#000000)
 * 3. Grau / N.V. (Unavailable / Off-Hours / None):
 *    Schrift in Tiefschwarz (#000000)
 */

/* Grün (Aufnahmefähig) */
.tv-status-available {
  background: #22c55e; /* Frisches Signal-Grün */
  border: 2px solid #16a34a;
}
.tv-status-available .tv-dept-label {
  color: #334155; /* Steingrau */
}
.tv-status-available .tv-dept-time {
  color: #1e293b;
  background: rgba(255, 255, 255, 0.4);
}

/* Gelb / Orange (Eingeschränkt) */
.tv-status-limited {
  background: #fbbf24; /* Kräftiges Signal-Gelb/Orange */
  border: 2px solid #f59e0b;
}
.tv-status-limited .tv-dept-label {
  color: #334155; /* Steingrau */
}
.tv-status-limited .tv-dept-time {
  color: #1e293b;
  background: rgba(0, 0, 0, 0.15);
}

/* Rot (Nicht aufnahmefähig / Abgemeldet) -> SCHRIFT SCHWARZ */
.tv-status-closed {
  background: #ef4444; /* Signalrot */
  border: 2px solid #dc2626;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.15);
}
.tv-status-closed .tv-dept-label {
  color: #000000 !important;
}
.tv-status-closed .tv-dept-time {
  color: #000000 !important;
  background: rgba(255, 255, 255, 0.45);
}

/* Grau (Technisch unmöglich) -> SCHRIFT SCHWARZ */
.tv-status-unavailable {
  background: #94a3b8;
  border: 2px solid #64748b;
}
.tv-status-unavailable .tv-dept-label {
  color: #000000 !important;
}

/* Grau (Außerhalb Öffnungszeiten) -> SCHRIFT SCHWARZ */
.tv-status-off_hours {
  background: #94a3b8;
  border: 2px solid #64748b;
}
.tv-status-off_hours .tv-dept-label {
  color: #000000 !important;
}

/* Nicht vorhanden / Keine Kapazität (Hellgrau / Abgedunkelt) -> SCHRIFT SCHWARZ */
.tv-status-none {
  background: #cbd5e1;
  border: 2px dashed #64748b;
}
.tv-status-none .tv-dept-label {
  color: #000000 !important;
  opacity: 0.85;
}


/* ─── Eigene Filter & Standard-Ansicht Styling ─── */
.custom-filter-section {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 10px;
  margin-bottom: 10px;
}

.custom-filter-tags-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.custom-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.custom-filter-tag:hover {
  background: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
}

.custom-filter-tag.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #3b82f6;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.5);
}

.custom-filter-tag .default-star {
  color: #fbbf24;
  font-size: 0.85rem;
}

.custom-filter-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.btn-custom-filter {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}
.btn-custom-filter:hover {
  background: rgba(59, 130, 246, 0.3);
  border-color: #3b82f6;
  color: #fff;
}

/* Modal for Custom Filter */
.cf-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.cf-modal {
  background: #1e293b;
  color: #f8fafc;
  border: 2px solid #334155;
  border-radius: 14px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  animation: cfFadeIn 0.2s ease-out;
}

@keyframes cfFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.cf-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #334155;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cf-modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cf-modal-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
.cf-modal-close:hover {
  color: #ef4444;
}

.cf-modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cf-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cf-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #94a3b8;
}

.cf-input {
  background: #0f172a;
  border: 1px solid #334155;
  color: #f8fafc;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.95rem;
}
.cf-input:focus {
  outline: none;
  border-color: #3b82f6;
}

.cf-select {
  background: #0f172a;
  border: 1px solid #334155;
  color: #f8fafc;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.95rem;
}
.cf-select:focus {
  outline: none;
  border-color: #3b82f6;
}

.cf-hospitals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
  padding: 8px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
}

.cf-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  user-select: none;
}
.cf-checkbox-label:hover {
  background: rgba(255, 255, 255, 0.05);
}

.cf-checkbox-label input {
  cursor: pointer;
}

.cf-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid #334155;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.cf-checkbox-default {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  color: #38bdf8;
  cursor: pointer;
}

.cf-footer-btns {
  display: flex;
  gap: 10px;
}


/* ─── Light Mode Overrides for TV / Grossmonitor ─────────────────────── */
[data-theme="light"] .tv-header {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .tv-logo-badge {
  background: #eff6ff;
  border-color: #bfdbfe;
}

[data-theme="light"] .tv-btn {
  background: #ffffff;
  color: #334155;
  border-color: #cbd5e1;
}

[data-theme="light"] .tv-btn:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

[data-theme="light"] .tv-clock {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}

/* Cluster Nav in Light Mode */
[data-theme="light"] .tv-cluster-nav {
  background: #ffffff;
  border-bottom-color: #e2e8f0;
}

[data-theme="light"] .tv-cluster-tab {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

[data-theme="light"] .tv-cluster-tab:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #94a3b8;
}

[data-theme="light"] .tv-cluster-tab.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

/* Status Filter Row in Light Mode */
[data-theme="light"] .tv-filter-row {
  background: #f8fafc;
  border-bottom-color: #e2e8f0;
}

[data-theme="light"] .tv-status-tab {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #475569;
}

[data-theme="light"] .tv-status-tab:hover {
  background: #f1f5f9;
  color: #0f172a;
}

[data-theme="light"] .tv-status-tab.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

[data-theme="light"] .tv-status-tab.tv-tab-alert {
  background: #ffffff;
  border-color: #fca5a5;
  color: #dc2626;
}

[data-theme="light"] .tv-status-tab.tv-tab-alert.active {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35);
}

/* Legend Bar in Light Mode */
[data-theme="light"] .tv-legend-bar {
  background: #f1f5f9;
  border-bottom-color: #e2e8f0;
  color: #475569;
}

/* Custom View Filter Section in TV Light Mode */
[data-theme="light"] .custom-filter-section {
  background: #ffffff;
  border-color: #cbd5e1;
}

[data-theme="light"] .custom-filter-tag {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

[data-theme="light"] .custom-filter-tag:hover {
  background: #dbeafe;
  color: #1e40af;
}

[data-theme="light"] .custom-filter-tag.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

[data-theme="light"] .btn-custom-filter {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #334155;
}

[data-theme="light"] .btn-custom-filter:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* TV Modals in Light Mode */
[data-theme="light"] .cf-modal-backdrop {
  background: rgba(15, 23, 42, 0.6);
}

[data-theme="light"] .cf-modal {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.15);
}

[data-theme="light"] .cf-modal-header {
  border-bottom-color: #e2e8f0;
}

[data-theme="light"] .cf-modal-footer {
  border-top-color: #e2e8f0;
}

[data-theme="light"] .cf-modal-title {
  color: #0f172a;
}

[data-theme="light"] .cf-modal-close {
  color: #64748b;
}

[data-theme="light"] .cf-modal-close:hover {
  color: #dc2626;
}

[data-theme="light"] .cf-label {
  color: #475569;
}

[data-theme="light"] .cf-input,
[data-theme="light"] .cf-select {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] .cf-input:focus,
[data-theme="light"] .cf-select:focus {
  border-color: #2563eb;
}

[data-theme="light"] .cf-hospitals-grid {
  background: #f8fafc;
  border-color: #cbd5e1;
}

[data-theme="light"] .cf-checkbox-label {
  color: #1e293b;
}

[data-theme="light"] .cf-checkbox-label:hover {
  background: #e2e8f0;
}

[data-theme="light"] .cf-checkbox-default {
  color: #2563eb;
}

/* TV Cards in Light Mode */
[data-theme="light"] .tv-card {
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .tv-card-name {
  color: #0f172a;
}

[data-theme="light"] .tv-card-cluster {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

[data-theme="light"] .tv-empty-alert {
  background: #ecfdf5;
  border-color: #10b981;
  color: #047857;
  text-shadow: none;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.15);
}


/* ─── TV Zoom Controls ──────────────────────────────────────────────── */
.tv-zoom-controls {
  display: inline-flex;
  align-items: center;
  background: var(--tv-card-bg);
  border: 1px solid var(--tv-card-border);
  border-radius: 8px;
  padding: 2px 4px;
  gap: 4px;
}

.tv-btn-zoom {
  padding: 6px 12px !important;
  font-size: 1.15rem !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  min-width: 32px;
  border-radius: 4px !important;
}

.tv-zoom-level {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: #38bdf8;
  padding: 0 8px;
  min-width: 52px;
  text-align: center;
  cursor: pointer;
  user-select: none;
}

.tv-btn-zoom-reset {
  padding: 6px 10px !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  border-radius: 4px !important;
  background: rgba(255, 255, 255, 0.05) !important;
}

[data-theme="light"] .tv-zoom-controls {
  background: #ffffff;
  border-color: #cbd5e1;
}

[data-theme="light"] .tv-zoom-level {
  color: #0284c7;
}

[data-theme="light"] .tv-btn-zoom-reset {
  background: #f1f5f9 !important;
}

.tv-main-container {
  transform-origin: top center;
  transition: transform 0.15s ease-out;
}

/* ─── Fullscreen View Optimization: Hide navigation and legend to maximize hospital cards ─── */
:fullscreen .tv-cluster-nav,
:fullscreen .tv-filter-row,
:fullscreen .tv-legend-bar,
:-webkit-full-screen .tv-cluster-nav,
:-webkit-full-screen .tv-filter-row,
:-webkit-full-screen .tv-legend-bar,
body.is-fullscreen .tv-cluster-nav,
body.is-fullscreen .tv-filter-row,
body.is-fullscreen .tv-legend-bar {
  display: none !important;
}

:fullscreen .tv-main-container,
:-webkit-full-screen .tv-main-container,
body.is-fullscreen .tv-main-container {
  padding-top: 8px;
}

