/* ==========================================================================
   NEU PREMIUM DENTISTRY - EXECUTIVE DASHBOARD
   Design System & Styling
   ========================================================================== */

:root {
  /* Color Palette - Executive Dark Luxury */
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --bg-card: #131c31;
  --bg-card-hover: #17233d;
  --bg-surface: #1e293b;
  --bg-glass: rgba(19, 28, 49, 0.75);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #d4af37;
  --border-subtle: rgba(255, 255, 255, 0.04);

  /* Accents */
  --gold-primary: #d4af37;
  --gold-light: #f5e2a3;
  --gold-glow: rgba(212, 175, 55, 0.25);
  --cyan-primary: #06b6d4;
  --cyan-glow: rgba(6, 182, 212, 0.2);
  --emerald-primary: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.2);
  --rose-primary: #f43f5e;
  --rose-glow: rgba(244, 63, 94, 0.2);
  --indigo-primary: #6366f1;
  --purple-primary: #8b5cf6;

  /* Typography */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Dimensions & Spacing */
  --sidebar-width: 260px;
  --header-height: 68px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Small Premium Form Standards */
  --input-height: 30px;
  --input-radius: 6px;
  --input-bg: #111a2e;
  --input-border: rgba(255, 255, 255, 0.12);

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 4px 20px rgba(212, 175, 55, 0.15);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

/* App Shell Layout */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Sidebar Navigation */
.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
}

.clinic-logo-mark {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #d4af37, #997b1a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: #0b0f19;
  box-shadow: var(--shadow-gold);
}

.clinic-brand {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #fff;
  text-transform: uppercase;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--gold-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

/* Navigation Links */
.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 12px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.nav-item:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: var(--gold-light);
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.03));
  border-color: rgba(212, 175, 55, 0.3);
  font-weight: 600;
}

.nav-icon {
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  font-size: 11px;
  color: var(--text-subtle);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.status-indicator-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--emerald-primary);
  font-weight: 600;
}

.live-dot {
  width: 7px;
  height: 7px;
  background-color: var(--emerald-primary);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--emerald-primary);
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Main Content Area */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Top App Header & Filters */
.app-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  cursor: pointer;
}

.header-title-block h1 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.header-title-block p {
  font-size: 12px;
  color: var(--text-muted);
}

/* Global Filter Bar - Small Premium Standard */
.global-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
  white-space: nowrap;
}

/* Small Premium Input / Select Styles */
.form-select-sm, .form-input-sm {
  height: var(--input-height);
  border-radius: var(--input-radius);
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-main);
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  padding: 0 10px;
  outline: none;
  transition: all 0.2s ease;
  min-width: 120px;
}

.form-select-sm:focus, .form-input-sm:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.filter-pills {
  display: flex;
  gap: 4px;
}

.pill-btn {
  height: var(--input-height);
  padding: 0 10px;
  border-radius: var(--input-radius);
  font-size: 11px;
  font-weight: 600;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.pill-btn:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.1);
}

.pill-btn.active {
  background: var(--gold-primary);
  color: #0b0f19;
  border-color: var(--gold-primary);
}

/* Refresh & Action Buttons */
.btn-refresh {
  height: var(--input-height);
  padding: 0 12px;
  border-radius: var(--input-radius);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.05));
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: var(--gold-light);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-refresh:hover {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.35), rgba(212, 175, 55, 0.15));
  box-shadow: var(--shadow-gold);
}

/* Dashboard Content Container */
.content-body {
  padding: 24px;
  flex: 1;
}

/* HTMX Transition Animations */
.htmx-swapping {
  opacity: 0.5;
  transition: opacity 0.2s ease-out;
}

.htmx-settling {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* HTMX Loading Indicator */
.htmx-indicator {
  display: none;
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  display: inline-block;
}

.spinner-sm {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(212, 175, 55, 0.3);
  border-top-color: var(--gold-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   CARDS & GRIDS
   ========================================================================== */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.metric-card.gold::before { background: linear-gradient(90deg, #d4af37, #f5e2a3); }
.metric-card.cyan::before { background: linear-gradient(90deg, #06b6d4, #67e8f9); }
.metric-card.emerald::before { background: linear-gradient(90deg, #10b981, #6ee7b7); }
.metric-card.purple::before { background: linear-gradient(90deg, #8b5cf6, #c084fc); }

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

.metric-title {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.metric-icon-box {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.metric-icon-box.gold { background: rgba(212, 175, 55, 0.12); color: var(--gold-light); }
.metric-icon-box.cyan { background: rgba(6, 182, 212, 0.12); color: var(--cyan-primary); }
.metric-icon-box.emerald { background: rgba(16, 185, 129, 0.12); color: var(--emerald-primary); }
.metric-icon-box.purple { background: rgba(139, 92, 246, 0.12); color: var(--purple-primary); }

.metric-value {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 6px;
}

.metric-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-subtle);
}

/* Growth Badges */
.growth-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 12px;
}

.growth-badge.positive {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.growth-badge.negative {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
}

.growth-badge.neutral {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
}

/* Charts & Analytics Layout Grids */
.dashboard-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.dashboard-grid-3 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

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

.panel-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-subtitle {
  font-size: 11.5px;
  color: var(--text-muted);
}

.chart-wrapper {
  position: relative;
  width: 100%;
  height: 280px;
  min-height: 280px;
  max-height: 320px;
  flex: none;
}

.chart-wrapper canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* ==========================================================================
   DATA TABLES & LISTS
   ========================================================================== */

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.luxury-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  text-align: left;
}

.luxury-table th {
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--text-subtle);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.luxury-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

.luxury-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.025);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-sc { background: rgba(212, 175, 55, 0.15); color: var(--gold-light); border: 1px solid rgba(212, 175, 55, 0.3); }
.badge-cw { background: rgba(6, 182, 212, 0.15); color: var(--cyan-primary); border: 1px solid rgba(6, 182, 212, 0.3); }
.badge-done { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-planing { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-danger { background: rgba(244, 63, 94, 0.15); color: #fb7185; }
.badge-info { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.badge-neutral { background: rgba(148, 163, 184, 0.15); color: var(--text-muted); }

/* Progress bars */
.progress-container {
  height: 6px;
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--gold-primary), var(--gold-light));
}

.progress-bar-fill.cyan {
  background: linear-gradient(90deg, var(--cyan-primary), #67e8f9);
}

/* Branch Share Cards */
.branch-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.branch-stat-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
}

.branch-stat-box .branch-code {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold-light);
}

.branch-stat-box .branch-value {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin: 4px 0;
}

/* ==========================================================================
   MODAL / DRAWER
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.modal-window {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

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

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover {
  color: #fff;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

/* ==========================================================================
   RESPONSIVE DESIGN (TABLET & MOBILE)
   ========================================================================== */

@media (max-width: 1024px) {
  .dashboard-grid-2, .dashboard-grid-3 {
    grid-template-columns: 1fr;
  }
  .branch-card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-sidebar {
    transform: translateX(-100%);
  }

  .app-sidebar.open {
    transform: translateX(0);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.7);
  }

  .main-wrapper {
    margin-left: 0;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .app-header {
    padding: 12px 16px;
  }

  .content-body {
    padding: 16px;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .metric-value {
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  .global-filters {
    width: 100%;
    justify-content: flex-start;
  }
  .form-select-sm, .form-input-sm {
    min-width: 100px;
    font-size: 11px;
  }
}

/* ==========================================================================
   SCHEDULE CALENDAR (View_AppointmentAllSlots)
   ========================================================================== */

.schedule-calendar-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#schedule-calendar-card {
  scroll-margin-top: 84px;
  outline: none;
}

.schedule-calendar-section,
#schedule-day-detail {
  overflow-anchor: none;
}

.schedule-cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 14px;
}

.schedule-cal-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-cal-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-main);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cal-nav:hover {
  border-color: var(--gold-primary);
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.12);
}

.schedule-cal-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.legend-dot.low { background: rgba(6, 182, 212, 0.55); border: 1px solid rgba(6, 182, 212, 0.8); }
.legend-dot.medium { background: rgba(212, 175, 55, 0.55); border: 1px solid rgba(212, 175, 55, 0.85); }
.legend-dot.high { background: rgba(16, 185, 129, 0.55); border: 1px solid rgba(16, 185, 129, 0.9); }
.legend-dot.sunday { background: rgba(244, 63, 94, 0.25); border: 1px solid rgba(244, 63, 94, 0.5); }

.schedule-cal-grid-wrap {
  overflow-x: auto;
}

.schedule-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(134px, 1fr));
  gap: 8px;
}

.schedule-cal-weekdays {
  margin-bottom: 8px;
}

.schedule-cal-weekday {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 6px 4px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
}

.schedule-cal-weekday.is-sunday {
  color: #fda4af;
  background: rgba(244, 63, 94, 0.08);
}

.schedule-cal-cell {
  min-height: 118px;
  padding: 8px 9px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.schedule-cal-cell:hover:not(.outside-month) {
  transform: translateY(-1px);
  border-color: rgba(212, 175, 55, 0.55);
  background: rgba(255, 255, 255, 0.05);
}

.schedule-cal-cell.load-low {
  background: rgba(6, 182, 212, 0.06);
  border-color: rgba(6, 182, 212, 0.25);
}

.schedule-cal-cell.load-medium {
  background: rgba(212, 175, 55, 0.07);
  border-color: rgba(212, 175, 55, 0.3);
}

.schedule-cal-cell.load-high {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.32);
}

.schedule-cal-cell.is-sunday {
  background: rgba(244, 63, 94, 0.04);
}

.schedule-cal-cell.is-today {
  border-color: var(--cyan-primary);
  box-shadow: inset 0 0 0 1px rgba(6, 182, 212, 0.35);
}

.schedule-cal-cell.selected {
  border-color: var(--gold-primary) !important;
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.28), 0 8px 18px rgba(0, 0, 0, 0.35);
  background: rgba(212, 175, 55, 0.13);
}

.schedule-cal-cell.outside-month {
  opacity: 0.28;
  cursor: default;
  background: transparent;
}

.cal-cell-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.cal-day-num {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.schedule-cal-cell.is-sunday .cal-day-num {
  color: #fda4af;
}

.cal-today-tag {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(6, 182, 212, 0.22);
  color: #67e8f9;
  border: 1px solid rgba(6, 182, 212, 0.4);
}

.cal-cell-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}

.cal-patient-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 6px;
  border-radius: 6px;
  color: #fff;
}

.cal-patient-badge.load-low {
  background: rgba(6, 182, 212, 0.2);
  color: #67e8f9;
  border: 1px solid rgba(6, 182, 212, 0.35);
}

.cal-patient-badge.load-medium {
  background: rgba(212, 175, 55, 0.22);
  color: var(--gold-light);
  border: 1px solid rgba(212, 175, 55, 0.4);
}

.cal-patient-badge.load-high {
  background: rgba(16, 185, 129, 0.22);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.42);
}

.cal-slot-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  gap: 4px;
}

.cal-meta-sch { color: #93c5fd; font-weight: 600; }
.cal-meta-done { color: #6ee7b7; font-weight: 600; }

.cal-rest-label {
  font-size: 10.5px;
  font-style: italic;
  color: rgba(253, 164, 175, 0.65);
  text-align: center;
  margin-top: 8px;
}

.cal-off-badge {
  margin-top: auto;
  font-size: 10px;
  font-weight: 700;
  color: #fda4af;
  background: rgba(244, 63, 94, 0.14);
  border: 1px solid rgba(244, 63, 94, 0.3);
  border-radius: 5px;
  padding: 2px 5px;
  text-align: center;
}

.schedule-month-doctors,
.schedule-day-doctors {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: 8px 12px;
  margin-bottom: 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-color);
}

.month-doc-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-right: 4px;
}

.cal-doc-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 4px;
  margin-top: 3px;
  padding-top: 5px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
}

.cal-doc-chip,
.month-doc-chip,
.day-doc-chip {
  display: inline-flex;
  align-items: stretch;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid rgba(212, 175, 55, 0.28);
  background: rgba(15, 23, 42, 0.55);
  cursor: help;
  line-height: 1.2;
}

.cal-doc-chip {
  font-size: 9.5px;
}

.month-doc-chip,
.day-doc-chip {
  font-size: 11px;
  border-color: rgba(6, 182, 212, 0.3);
}

.cal-doc-pin {
  background: rgba(212, 175, 55, 0.18);
  color: var(--gold-light);
  font-weight: 800;
  padding: 1px 4px;
  border-right: 1px solid rgba(212, 175, 55, 0.22);
}

.month-doc-chip .cal-doc-pin,
.day-doc-chip .cal-doc-pin {
  padding: 2px 6px;
}

.cal-doc-cnt {
  color: #f1f5f9;
  font-weight: 700;
  padding: 1px 5px;
}

.month-doc-cnt,
.day-doc-cnt {
  color: #f8fafc;
  font-weight: 700;
  padding: 2px 7px;
}

.schedule-day-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.schedule-off-banners {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.schedule-off-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fecdd3;
  font-size: 12px;
}

.day-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
}

/* ==========================================================================
   CLINIC ROOM-SLOT MATRIX BOARD (Matching Reference Schedule Grid)
   ========================================================================== */

.clinic-board-frame {
  background: #5c3317;
  border: 2px solid #3f200c;
  border-radius: var(--radius-md);
  padding: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.clinic-board-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 4px 6px 10px;
}

.clinic-board-branch-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.board-branch-btn {
  padding: 5px 12px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.08);
  transition: all 0.15s ease;
}

.board-branch-btn.board-branch-sc.active {
  background: #ea580c;
  color: #ffffff;
  border-color: #fb923c;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.45);
}

.board-branch-btn.board-branch-cw.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #60a5fa;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.45);
}

.board-branch-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.clinic-board-title {
  font-size: 14px;
  font-weight: 800;
  color: #fde68a;
  letter-spacing: 0.01em;
  text-align: center;
  flex: 1;
}

.clinic-board-date-chip {
  font-size: 11px;
  font-weight: 700;
  color: #fef3c7;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(253, 230, 138, 0.25);
  padding: 4px 10px;
  border-radius: 5px;
}

.clinic-board-scroll {
  overflow-x: auto;
  border-radius: 4px;
}

.clinic-board-table {
  --board-slot-h: 52px;
  --board-gap-y: 4px;
  width: 100%;
  min-width: 1120px;
  border-collapse: separate;
  border-spacing: 5px var(--board-gap-y);
  background: #5c3317;
  table-layout: fixed;
}

.clinic-board-table tbody tr {
  height: var(--board-slot-h);
}

.clinic-board-table thead th {
  background: #6f3f1d;
  color: #ffffff;
  border: 1px solid #965f36;
  border-radius: 4px;
  padding: 7px 4px;
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.clinic-board-table thead th.board-time-th {
  width: 58px;
  background: #4d2911;
  color: #fde68a;
  position: sticky;
  left: 0;
  z-index: 3;
}

.clinic-board-table thead th.is-as-th {
  background: #7c4722;
  color: #fde68a;
}

.board-time-cell {
  width: 58px;
  height: var(--board-slot-h);
  padding: 0 4px;
  box-sizing: border-box;
  background: #5c3317;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px dotted rgba(253, 230, 138, 0.28);
  position: sticky;
  left: 0;
  z-index: 2;
}

.board-slot-as-empty {
  height: var(--board-slot-h);
  padding: 0;
  box-sizing: border-box;
  background: #cfa06e;
  color: #1f1409;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  vertical-align: middle;
  border-radius: 4px;
  border: 1px solid #9b6c3e;
}

.board-slot-vip-empty {
  height: var(--board-slot-h);
  padding: 0;
  box-sizing: border-box;
  background: #c7c7c7;
  vertical-align: middle;
  border-radius: 4px;
  border: 1px solid #8c8c8c;
}

.board-slot-booked {
  height: calc(var(--slot-span, 1) * var(--board-slot-h) + (var(--slot-span, 1) - 1) * var(--board-gap-y));
  padding: 0;
  box-sizing: border-box;
  vertical-align: top;
  text-align: center;
  border-radius: 4px;
  border: 1px solid rgba(15, 23, 42, 0.48);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 3px rgba(0, 0, 0, 0.35);
  font-size: 10.5px;
  line-height: 1.2;
  cursor: help;
}

.board-slot-booked.is-off-block {
  border-color: rgba(244, 63, 94, 0.8);
}

.board-card-shell {
  height: calc(var(--slot-span, 1) * var(--board-slot-h) + (var(--slot-span, 1) - 1) * var(--board-gap-y) - 2px);
  max-height: calc(var(--slot-span, 1) * var(--board-slot-h) + (var(--slot-span, 1) - 1) * var(--board-gap-y) - 2px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  padding: 3px 5px;
  box-sizing: border-box;
  border-radius: 3px;
}

.board-card-shell.span-1 {
  padding: 2px 4px;
  font-size: 9.5px;
  line-height: 1.14;
}

.board-card-shell.span-1 .board-card-head {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin-bottom: 1px;
}

.board-card-shell.span-1 .board-card-room {
  display: none;
}

.board-card-shell.span-1 .board-card-treat {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.board-card-shell.span-1.has-extra {
  justify-content: flex-start;
  font-size: 9px;
  line-height: 1.08;
}

.board-card-shell.span-1.has-extra .board-card-head,
.board-card-shell.span-1.has-extra .board-card-treat {
  -webkit-line-clamp: 1;
}

.board-card-shell.span-1.has-extra .board-card-extra {
  margin-top: 2px;
  padding: 1px 3px;
}

.board-card-shell.span-2 .board-card-head {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.board-card-shell.span-2 .board-card-treat {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

.board-card-shell.span-2.has-extra .board-card-head {
  -webkit-line-clamp: 1;
}

.board-card-shell.span-2.has-extra .board-card-treat {
  -webkit-line-clamp: 2;
}

.board-card-shell.span-multi .board-card-treat {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 8;
  overflow: hidden;
}

.board-card-head {
  font-weight: 800;
  margin-bottom: 2px;
  word-break: break-word;
}

.board-card-room {
  font-weight: 700;
  font-size: 10px;
  opacity: 0.9;
  margin-bottom: 2px;
}

.board-card-treat {
  font-weight: 500;
  word-break: break-word;
}

.board-card-extra {
  margin-top: 4px;
  padding: 3px 4px;
  border-top: 1px dashed rgba(15, 23, 42, 0.45);
  border-radius: 3px;
}
