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

:root {
  /* Core Palette - Deep Indigo & Slate */
  --bg-dark: #0f172a;
  --bg-darker: #020617;
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.4);
  --primary-hover: #4f46e5;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-glass: rgba(255, 255, 255, 0.08);
  --bg-glass: rgba(30, 41, 59, 0.5);
  --bg-glass-heavy: rgba(15, 23, 42, 0.85);

  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;

  --font-main: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-darker);
  /* Aura Background Effect */
  background-image:
    radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(139, 92, 246, 0.1) 0%, transparent 40%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex; /* Sidebar layout */
  overflow-x: hidden;
}

.main-viewport {
  flex: 1;
  height: 100vh;
  overflow-y: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-main);
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Glassmorphism Utilities */
.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.glass-heavy {
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
}

/* Sidebar Navigation */
.sidebar {
  width: 280px;
  height: 100vh;
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  flex-shrink: 0;
  z-index: 1000;
  position: sticky;
  top: 0;
}

/* ===== HAMBURGER / MOBILE NAV ===== */

/* Hidden on desktop */
.mobile-topbar { display: none; }
.hamburger-btn { display: none; }
.sidebar-close-btn { display: none; }
.sidebar-backdrop { display: none; }

/* Hamburger lines */
.hamburger-line {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-main);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}

/* Alpine animated state classes */
.rotate-45 { transform: rotate(45deg) translateY(8px); }
.-rotate-45 { transform: rotate(-45deg) translateY(-8px); }
.translate-y { transform: rotate(45deg) translateY(8px); }
.-translate-y { transform: rotate(-45deg) translateY(-8px); }
.opacity-0 { opacity: 0 !important; }

/* Fade transition for backdrop */
.transition-fade { transition: opacity 0.25s ease; }
.opacity-0 { opacity: 0; }
.opacity-100 { opacity: 1; }


.sidebar-logo {
  font-family: var(--font-main);
  font-weight: 800;
  font-size: 1.6rem;
  margin-bottom: 3rem;
  background: linear-gradient(to right, #fff, var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-left: 0.5rem;
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.sidebar-links a {
  font-family: var(--font-main);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.sidebar-links a:hover, .sidebar-links a.active {
  color: var(--text-main);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.1);
}

.sidebar-footer {
  padding-top: 2rem;
  border-top: 1px solid var(--border-glass);
}


.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem 4rem 2rem;
  flex: 1;
}

/* UI Elements */
.card {
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
  padding: 2rem;
  transition: var(--transition);
}

.card:hover {
  border-color: rgba(99, 102, 241, 0.2);
  transform: translateY(-2px);
}

.btn {
  font-family: var(--font-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 100px; /* Pill */
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  box-shadow: 0 4px 14px 0 var(--primary-glow);
}

.btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 var(--primary-glow);
}

.btn-danger {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--danger);
  box-shadow: none;
}
.btn-danger:hover {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

/* Forms Premium Upgrade */
.form-group {
  margin-bottom: 2rem;
}

.form-control {
  width: 100%;
  padding: 1.15rem 1.5rem;
  background: rgba(2, 6, 23, 0.4);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.2);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236366f1'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.5rem center;
  background-size: 1.1rem;
  padding-right: 3.5rem;
  /* Force browser native dropdown to render in dark mode */
  color-scheme: dark;
}

select.form-control option {
  background-color: #0f172a;
  color: #f8fafc;
  padding: 1rem;
}

/* ===== GLOBAL SELECT DARK FIX =====
   Force ALL select dropdowns across the app to render
   with dark backgrounds in the browser-native option list. */
select {
  color-scheme: dark;
}

select option {
  background-color: #0f172a;
  color: #f8fafc;
}

.form-control:focus {
  border-color: var(--primary);
  background: rgba(2, 6, 23, 0.6);
  box-shadow:
    inset 0 2px 4px 0 rgba(0, 0, 0, 0.2),
    0 0 0 4px rgba(99, 102, 241, 0.15),
    0 0 20px 0 rgba(99, 102, 241, 0.2);
  transform: translateY(-1px);
}

.form-label {
  display: block;
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
/* Kanban Board Styling */
.board {
  display: flex !important;
  overflow-x: auto;
  gap: 2rem;
  padding: 1.5rem 1rem 3rem 1rem;
  align-items: flex-start;
  scroll-behavior: smooth;
  height: calc(100vh - 280px);
  background: transparent;
}

.board::-webkit-scrollbar { height: 6px; }
.board::-webkit-scrollbar-track { background: transparent; }
.board::-webkit-scrollbar-thumb {
  background: var(--border-glass);
  border-radius: 10px;
}
.board::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== BOARD PAGE HEADER ===== */
.board-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.board-page-title h1 {
  font-size: 2.5rem;
  margin-bottom: 0.25rem;
  line-height: 1;
}

.board-page-title p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.board-page-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.btn-ghost-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.65rem 1.25rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-ghost-action:hover {
  color: white;
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.3);
}

.btn-primary-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.95rem;
  color: white;
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  border: none;
  border-radius: var(--radius-md);
  padding: 0.75rem 1.75rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
}

.btn-primary-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.5);
}

/* ===== BOARD TOOLBAR ===== */
.board-toolbar {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  margin-bottom: 2rem;
  overflow: hidden;
}

/* Summary / top bar */
.board-toolbar-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  gap: 1rem;
  border-bottom: 1px solid var(--border-glass);
}

.board-toolbar-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  flex-wrap: wrap;
  min-width: 0;
}

/* Active filter chips in the summary bar */
.filter-chip-active {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem 0.25rem 0.75rem;
  font-family: var(--font-main);
  white-space: nowrap;
}

.chip-close {
  background: none;
  border: none;
  color: #a5b4fc;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0;
  opacity: 0.6;
  line-height: 1;
  transition: opacity 0.2s;
}

.chip-close:hover { opacity: 1; }

/* Clear all & toggle buttons */
.toolbar-clear-btn {
  font-family: var(--font-main);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 100px;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.toolbar-clear-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.4);
}

.toolbar-toggle-btn {
  font-family: var(--font-main);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-glass);
  border-radius: 100px;
  padding: 0.35rem 1rem;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.toolbar-toggle-btn:hover,
.toolbar-toggle-active {
  color: white;
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.3);
}

/* Filter fields panel */
.board-toolbar-panel {
  display: flex;
  align-items: stretch;
  gap: 0;
}

/* Individual filter field */
.toolbar-field {
  display: flex;
  align-items: center;
  flex: 1;
  border-right: 1px solid var(--border-glass);
  position: relative;
  min-width: 0;
  transition: background 0.2s;
}

.toolbar-field:last-child {
  border-right: none;
}

.toolbar-field:focus-within {
  background: rgba(99, 102, 241, 0.05);
}

.toolbar-field-search {
  flex: 2;
}

.toolbar-field-icon {
  padding: 0 0.75rem 0 1.25rem;
  font-size: 1rem;
  opacity: 0.5;
  flex-shrink: 0;
}

.toolbar-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 1.1rem 0.5rem;
  outline: none;
  min-width: 0;
}

.toolbar-input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.toolbar-select {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 1.1rem 2.5rem 1.1rem 0.25rem;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236366f1'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 0.9rem;
  min-width: 0;
}

.toolbar-field-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem 0.75rem;
  font-size: 0.85rem;
  opacity: 0.5;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.toolbar-field-clear:hover { opacity: 1; color: var(--danger); }

/* ===== RESPONSIVE BOARD TOOLBAR ===== */
@media (max-width: 768px) {
  .board-page-header { flex-direction: column; align-items: flex-start; }
  .board-page-actions { width: 100%; }
  .btn-ghost-action, .btn-primary-action { flex: 1; justify-content: center; }

  .board-toolbar-panel {
    flex-direction: column;
  }

  .toolbar-field {
    border-right: none;
    border-bottom: 1px solid var(--border-glass);
  }

  .toolbar-field:last-child { border-bottom: none; }

  .toolbar-field-search { flex: unset; }
}


/* ============================================
   AURORA DARK THEME
   ============================================ */

/* Column: transparent lane, no chrome */
/*  min-width: 310px;*/
/*  max-width: 310px;*/
/*  flex-shrink: 0;*/
/*  background: rgba(255,255,255,0.02);*/
/*  border-radius: var(--radius-xl);*/
/*  border: 1px solid rgba(255,255,255,0.04);*/
/*  display: flex;*/
/*  flex-direction: column;*/
/*  max-height: 100%;*/
/*}*/

/* Column header: pill-style with status accent bar */
/*.board-column-header {*/
/*  padding: 1rem 1.25rem;*/
/*  font-family: var(--font-main);*/
/*  font-weight: 700;*/
/*  font-size: 0.8rem;*/
/*  letter-spacing: 1.5px;*/
/*  text-transform: uppercase;*/
/*  display: flex;*/
/*  justify-content: space-between;*/
/*  align-items: center;*/
/*  color: rgba(255,255,255,0.5);*/
/*  border-bottom: 1px solid rgba(255,255,255,0.04);*/
/*}*/

/* Active column header text and count pill */
.header-booked   { border-bottom-color: rgba(100, 116, 139, 0.3); }
.header-waiting  { border-bottom-color: rgba(251, 191, 36, 0.4); color: #fbbf24; }
.header-progress { border-bottom-color: rgba(99, 102, 241, 0.5); color: #818cf8; }
.header-complete { border-bottom-color: rgba(52, 211, 153, 0.4); color: #34d399; }
.header-cancelled{ border-bottom-color: rgba(248, 113, 113, 0.3); color: #f87171; }

/* Count badge: monospace, inlined with header */
.badge {
  font-family: var(--font-main);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.6);
}

/* Column body: clean scrollable area */
.board-column-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* =====================
   AURORA CARDS
   ===================== */
.task-card {
  background: linear-gradient(145deg, rgba(22, 30, 52, 0.95) 0%, rgba(10, 15, 30, 0.90) 100%);
  border-radius: 14px;
  padding: 1.25rem 1.4rem;
  cursor: grab;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow:
    0 0 0 1px rgba(var(--status-rgb, 99,102,241), 0.15),
    0 8px 24px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.06);
  transition: all 0.35s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Luminous left border via pseudo-element */
.task-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--status-color, var(--primary));
  box-shadow: 0 0 10px var(--status-glow, transparent);
  transition: top 0.3s, bottom 0.3s, box-shadow 0.3s;
}

.task-card:hover::before {
  top: 8%;
  bottom: 8%;
  box-shadow: 0 0 18px var(--status-glow, transparent);
}

.task-card.dragging {
  opacity: 0.75;
  transform: rotate(2deg) scale(1.04);
  box-shadow: 0 30px 60px rgba(0,0,0,0.6);
}

.task-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255,255,255,0.12);
  background: linear-gradient(145deg, rgba(28, 38, 66, 0.98) 0%, rgba(14, 20, 42, 0.95) 100%);
  box-shadow:
    0 0 0 1px rgba(var(--status-rgb, 99,102,241), 0.35),
    0 20px 40px rgba(0,0,0,0.5),
    0 0 30px rgba(var(--status-rgb, 99,102,241), 0.12),
    inset 0 1px 0 rgba(255,255,255,0.1);
}

.task-title {
  font-family: var(--font-main);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* Stats Widgets */
.stat-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(30, 41, 59, 0.5) 100%);
  border: 1px solid var(--border-glass);
  padding: 2rem;
  border-radius: var(--radius-lg);
  text-align: center;
}

.stat-value {
  font-family: var(--font-main);
  font-size: 3.5rem;
  font-weight: 800;
  background: linear-gradient(to bottom, #fff, var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height:1;
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--text-muted);
  font-family: var(--font-main);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Premium Filter Bar */
.filter-bar {
  display: flex;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(20px);
  padding: 0.5rem;
  border-radius: 100px;
  border: 1px solid var(--border-glass);
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5);
  max-width: 700px;
  margin: 0 auto 3rem auto;
}

.doctor-badge {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
  border: 1px solid rgba(99, 102, 241, 0.2);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
  margin-top: 0.75rem;
}

.board-column.drag-over {
  background: rgba(99, 102, 241, 0.04);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: inset 0 0 40px rgba(99, 102, 241, 0.05);
}

/* Animations */
@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(234, 179, 8, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(234, 179, 8, 0); }
}

.pulse {
  animation: pulse 2s infinite;
}

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

.animate-in {
  animation: fadeIn 0.5s ease-out forwards;
}

/* Modal System - Premium Glass Experience */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(2, 6, 23, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 2000;
  padding: 5vh 2rem;
}

.modal-content {
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(25px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  padding: 3rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

[x-cloak] { display: none !important; }

/* ============================================
   RESPONSIVE SYSTEM - Complete Overhaul
   ============================================ */

/* --- Utility: Responsive Grids --- */
.responsive-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.responsive-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
}

/* --- Utility: Page Header Row --- */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.page-header-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

/* --- Utility: Adaptive Filter Pill --- */
.adaptive-pill {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(20px);
  padding: 0.5rem;
  border-radius: 100px;
  border: 1px solid var(--border-glass);
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
  transition: var(--transition);
}

/* --- Utility: Responsive Table Container --- */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  -webkit-overflow-scrolling: touch;
}

table {
  min-width: 700px;
}

/* ============================================
   BREAKPOINTS
   ============================================ */

/* Large Tablet / Small Desktop */
@media (max-width: 1280px) {
  .responsive-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablet / iPad — hamburger takes over */
@media (max-width: 1024px) {
  body { display: block; } /* stack vertically */

  /* ---- Mobile Top Bar ---- */
  .mobile-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1200;
    background: var(--bg-glass-heavy);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
    padding: 1rem 1.5rem;
  }

  /* ---- Hamburger Button ---- */
  .hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    transition: var(--transition);
  }
  .hamburger-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary);
  }

  /* ---- Close Button (inside drawer) ---- */
  .sidebar-close-btn {
    display: flex;
    align-self: flex-end;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
    font-size: 1rem;
    cursor: pointer;
    margin-bottom: 1.5rem;
    transition: var(--transition);
  }
  .sidebar-close-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-color: var(--danger);
  }

  /* ---- Sidebar Drawer ---- */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    z-index: 1300;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
    border-right: 1px solid var(--border-glass);
    flex-direction: column;
    overflow-y: auto;
  }

  .sidebar.sidebar-open {
    transform: translateX(0);
    box-shadow: 0 0 60px 0 rgba(0, 0, 0, 0.6);
  }

  /* ---- Backdrop ---- */
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.65);
    backdrop-filter: blur(4px);
    z-index: 1200;
  }

  /* ---- Restore sidebar links to vertical ---- */
  .sidebar-links {
    flex-direction: column;
    overflow-x: visible;
    gap: 0.5rem;
    padding-bottom: 0;
  }

  .sidebar-footer { display: flex; flex-direction: column; }

  .main-viewport { height: auto; overflow: visible; }
  .container { padding: 1.5rem 1rem; }

  .responsive-grid-2 { gap: 1.5rem; }
  .stat-value { font-size: 3rem; }
}


/* Mobile Landscape / Large Phone */
@media (max-width: 768px) {
  h1 { font-size: 2.2rem !important; }
  h2 { font-size: 1.6rem !important; }

  .container { padding: 1rem; }

  /* Grids collapse */
  .responsive-grid-2 { grid-template-columns: 1fr; gap: 1.5rem; }

  /* Form rows stack */
  .form-row { grid-template-columns: 1fr; gap: 0; }

  /* Pill filter becomes stacked */
  .adaptive-pill {
    border-radius: var(--radius-lg);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    max-width: 100% !important;
  }
  .adaptive-pill input {
    width: 100%;
    background: transparent;
    border: none;
    color: white;
    padding: 0.6rem;
    outline: none;
    font-size: 0.95rem;
  }
  .adaptive-pill select {
    width: 100%;
    background: transparent;
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    color: white;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }
  .adaptive-pill div[style*="width: 1px"],
  .adaptive-pill div[style*="align-items: center"][style*="opacity"] {
    display: none !important;
  }

  /* Modals */
  .modal-overlay {
    padding: 2vh 1rem;
    align-items: flex-start;
  }
  .modal-content {
    padding: 1.5rem;
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: var(--radius-lg);
    max-height: 95vh;
  }

  /* Stats */
  .stat-card { padding: 1.5rem; }
  .stat-value { font-size: 2.5rem; }

  /* Kanban */
  .board { gap: 1rem; }
  .board-column { min-width: 265px; }

  /* Page Header */
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-header-actions { width: 100%; }
  .page-header-actions .btn { flex: 1; }
}

/* Mobile Portrait / Small Phones */
@media (max-width: 480px) {
  h1 { font-size: 1.8rem !important; }

  .responsive-grid-4 { grid-template-columns: repeat(2, 1fr); gap: 1rem; }

  .stat-card { padding: 1.25rem; }
  .stat-value { font-size: 2rem; }
  .stat-label { font-size: 0.65rem; }

  .board-column { min-width: 240px; }

  .container { padding: 0.75rem; }

  /* Tasks cards - remove hover scale on touch devices */
  .task-card:hover { transform: none; }

  /* Don't stretch buttons on tiny screens — let them be natural size */
  .btn {
    width: auto;
    min-width: 140px;
    padding: 0.85rem 1.25rem;
    font-size: 0.9rem;
  }

  .modal-content { padding: 1.25rem; }
}


/* ===== STICKY BOARD ENHANCEMENTS ===== */
.board-header-sticky-wrapper {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-darker);
  /* Use radial gradient to match body background for seamless look */
  background-image: radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.05) 0%, transparent 40%);
  margin-top: -1rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.board-column-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1rem 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* Custom Scrollbar for columns */
.board-column-content::-webkit-scrollbar {
  width: 4px;
}
.board-column-content::-webkit-scrollbar-track {
  background: transparent;
}
.board-column-content::-webkit-scrollbar-thumb {
  background: var(--border-glass);
  border-radius: 10px;
}
.board-column-content:hover::-webkit-scrollbar-thumb {
  background: var(--primary-glow);
}

/* ===== AURORA CARD INTERNALS ===== */

/* Time + status dot row */
.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.8px;
  color: rgba(148, 163, 184, 0.65);
}

/* Glowing status dot */
.card-status-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-color, #94a3b8);
  box-shadow: 0 0 6px 1px var(--status-color, transparent),
              0 0 14px var(--status-glow, transparent);
  animation: statusPulse 3s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* Patient block */
.card-patient-info {
  padding-left: 0.25rem;
}

.card-patient-name {
  font-family: var(--font-main);
  font-size: 1.05rem;
  font-weight: 700;
  color: #f1f5f9;
  display: block;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.card-patient-phone {
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.6);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.3rem;
}

/* Doctor pill — frosted */
.card-doctor-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(99, 102, 241, 0.08);
  padding: 0.3rem 0.7rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
  letter-spacing: 0.2px;
}

/* Footer strip */
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Icon action buttons */
.card-action-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.35rem 0.45rem;
  border-radius: 7px;
  transition: background 0.2s, opacity 0.2s;
  opacity: 0.45;
  font-size: 0.85rem;
  line-height: 1;
}

.card-action-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  opacity: 1;
}

.card-action-btn.danger:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
}

/* Waiting timer — compact amber pill */
.card-waiting-timer {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(251, 191, 36, 0.08);
  color: #fbbf24;
  padding: 0.3rem 0.65rem;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  border: 1px solid rgba(251, 191, 36, 0.2);
}



/* ============================================================
   CLINICAL MODERN — NEXUS DARK BOARD THEME
   Scoped to .board-light-zone
   ============================================================ */

.board-light-zone {
  background: var(--bg-darker);
  border-radius: 16px;
  margin: -0.5rem -1rem;
  padding: 0 1rem 1rem 1rem;
}

/* ── Sticky header override ── */
.board-light-zone .board-header-sticky-wrapper {
  background: var(--bg-darker);
  background-image:
    radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(139, 92, 246, 0.05) 0%, transparent 40%);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-glass);
  margin: 0 -1rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

.board-light-zone .board-page-title h1 {
  color: var(--text-main) !important;
  background: none !important;
  -webkit-text-fill-color: var(--text-main) !important;
}
.board-light-zone .board-page-title p {
  color: var(--text-muted) !important;
}

/* Book Now — Medical Blue */
.board-light-zone .btn-primary-action {
  background: linear-gradient(135deg, #0EA5E9 0%, #0284C7 100%);
  box-shadow: 0 4px 14px rgba(14,165,233,0.35);
}
.board-light-zone .btn-primary-action:hover {
  background: linear-gradient(135deg, #0284C7 0%, #0369A1 100%);
}

/* ── Toolbar ── */
.board-light-zone .board-toolbar {
  background: var(--bg-glass-heavy);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  margin-top: 0.75rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.board-light-zone .board-toolbar-topbar {
  border-bottom: 1px solid var(--border-glass);
}
.board-light-zone .toolbar-input,
.board-light-zone .toolbar-select {
  color: var(--text-main);
}
.board-light-zone .toolbar-input::placeholder {
  color: var(--text-muted);
}
.board-light-zone .toolbar-field {
  border-right-color: var(--border-glass);
}
.board-light-zone .toolbar-field:focus-within {
  background: rgba(99, 102, 241, 0.05);
}
.board-light-zone .filter-chip-active {
  background: rgba(14,165,233,0.1);
  border-color: rgba(14,165,233,0.3);
  color: #0284C7;
}
.board-light-zone .chip-close { color: #0284C7; }
.board-light-zone .toolbar-clear-btn {
  color: #EF4444;
  background: rgba(239,68,68,0.07);
  border-color: rgba(239,68,68,0.2);
}
.board-light-zone .toolbar-toggle-btn { color: #64748B; }
.board-light-zone .toolbar-toggle-btn:hover,
.board-light-zone .toolbar-toggle-active {
  color: #0EA5E9;
  background: rgba(14,165,233,0.08);
  border-color: rgba(14,165,233,0.3);
}

/* ── Board container ── */
.board-light-zone .board {
  background: transparent;
  gap: 1.25rem;
  padding-top: 1rem;
  height: calc(100vh - 290px);
}

/* ── Columns ── */
.board-light-zone .board-column {
  background: transparent;
  backdrop-filter: blur(10px);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  min-width: 295px;
  max-width: 295px;
}
.board-light-zone .board-column.drag-over {
  background: rgba(14,165,233,0.05);
  border-color: #0EA5E9;
  box-shadow: 0 0 0 2px rgba(14,165,233,0.2);
  border-style: solid;
}

/* Column header: white with top accent stripe */
.board-light-zone .board-column-header {
  background: var(--bg-dark);
  border-radius: 11px 11px 0 0;
  padding: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--border-glass);
  color: var(--text-main);
  font-size: 0.82rem;
  letter-spacing: 0.3px;
  text-transform: none;
}
.board-lz-col-accent {
  height: 4px;
  width: 100%;
}
.col-accent-booked    { background: #0EA5E9; }
.col-accent-waiting   { background: #F59E0B; }
.col-accent-progress  { background: #6366F1; }
.col-accent-complete  { background: #22C55E; }
.col-accent-cancelled { background: #EF4444; }

.board-lz-col-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
}
.board-light-zone .badge {
  background: var(--bg-glass);
  color: var(--text-muted);
  border: 1px solid var(--border-glass);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.55rem;
}
.board-light-zone .board-column-body {
  background: transparent;
}
.board-light-zone .board-column-content {
  padding: 0.75rem;
  gap: 0.6rem;
}

/* ══════════════════════════════
   CLINICAL CARDS
   ══════════════════════════════ */
.board-light-zone .task-card {
  background: var(--bg-glass-heavy);
  border: 1px solid var(--border-glass);
  border-top: none;
  border-radius: 10px;
  padding: 1rem 1.1rem;
  gap: 0.65rem;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.3);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: grab;
  position: relative;
}
/* Remove dark pseudo-element */
.board-light-zone .task-card::before { display: none; }

.board-light-zone .task-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 30px -10px rgba(0,0,0,0.5);
  border-color: var(--primary-glow);
  background: rgba(30, 41, 59, 0.9);
}
.board-light-zone .task-card.dragging {
  transform: rotate(1.5deg) scale(1.03);
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.12);
  opacity: 0.92;
}

/* Wait alert states */
.board-light-zone .task-card.wait-warn {
  border-color: #F59E0B !important;
  animation: lzWarnPulse 3s ease-in-out infinite;
}
.board-light-zone .task-card.wait-alert {
  border-color: #EF4444 !important;
  animation: lzAlertPulse 1.5s ease-in-out infinite;
}
@keyframes lzWarnPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0); }
  50%       { box-shadow: 0 0 0 4px rgba(245,158,11,0.15); }
}
@keyframes lzAlertPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
  50%       { box-shadow: 0 0 0 5px rgba(239,68,68,0.18); }
}

/* Card header row */
.card-lz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-initials-badge {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-main);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.card-initials-new       { background: rgba(14,165,233,0.12); color: #0284C7; }
.card-initials-returning { background: rgba(71,85,105,0.08);  color: #475569; }

.card-priority-badge {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 0.18rem 0.52rem;
  border-radius: 100px;
}
.card-priority-routine { background:var(--bg-glass); color:var(--text-muted); border:1px solid var(--border-glass); }
.card-priority-urgent  { background:rgba(239,68,68,0.08); color:#EF4444; border:1px solid rgba(239,68,68,0.25); }

/* Patient name — blur privacy */
.card-lz-name-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  user-select: none;
}
.card-lz-patient-name {
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
  transition: filter 0.3s ease;
}
.card-lz-patient-name.blurred { filter: blur(5px); }
.card-lz-reveal-hint {
  font-size: 0.6rem;
  color: #94A3B8;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Time + visit type */
.card-lz-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.15rem;
}
.card-lz-time {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
}
.card-lz-visit-tag {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 0.09rem 0.42rem;
  border-radius: 100px;
}
.visit-tag-new       { background:rgba(14,165,233,0.15); color:#38BDF8; }
.visit-tag-returning { background:var(--bg-glass); color:var(--text-muted); }

/* Provider row */
.card-lz-provider {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: #64748B;
  font-weight: 500;
}
.card-lz-provider-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366F1 0%, #0EA5E9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}

/* Notes */
.card-lz-notes {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
  background: rgba(0,0,0,0.2);
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  border-left: 2px solid var(--primary-glow);
  line-height: 1.4;
}

/* Card footer */
.card-lz-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border-glass);
}
.card-lz-wait-timer {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: #94A3B8;
  letter-spacing: 0.2px;
}
.wait-timer-warn  { color: #D97706; }
.wait-timer-alert { color: #DC2626; }
.card-lz-timer-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.wait-timer-warn  .card-lz-timer-dot { animation: lzWarnPulse 2s infinite; }
.wait-timer-alert .card-lz-timer-dot { animation: lzAlertPulse 1s infinite; }

.card-lz-actions {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}
.card-lz-cta {
  font-size: 0.68rem;
  font-weight: 700;
  background: #0EA5E9;
  color: white;
  border: none;
  padding: 0.28rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  letter-spacing: 0.2px;
}
.card-lz-cta:hover { background: #0284C7; }
.card-lz-cta.success {
  background: rgba(34,197,94,0.1);
  color: #16A34A;
  border: 1px solid rgba(34,197,94,0.25);
}
.card-lz-cta.success:hover { background: rgba(34,197,94,0.2); }
.card-lz-icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.82rem;
  opacity: 0.38;
  padding: 0.2rem 0.3rem;
  border-radius: 5px;
  transition: opacity 0.2s, background 0.2s;
  line-height: 1;
}
.card-lz-icon-btn:hover { opacity: 1; background: #F1F5F9; }
.card-lz-icon-btn.danger:hover { color: #EF4444; background: rgba(239,68,68,0.08); }
