/* =============================================
   AYUKER CLINIC — DESIGN SYSTEM
   AI-Driven Clinic Management
   ============================================= */

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

/* =============================================
   CSS VARIABLES — LIGHT THEME
   ============================================= */
:root {
  /* Primary Palette */
  --primary: #0c6cf2;
  --primary-light: #3b8bff;
  --primary-dark: #0050c8;
  --primary-gradient: linear-gradient(135deg, #0c6cf2 0%, #6c3cf5 100%);
  --primary-glow: 0 4px 30px rgba(12, 108, 242, 0.25);

  /* Accent */
  --accent: #10b981;
  --accent-light: #34d399;
  --accent-dark: #059669;
  --accent-gradient: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);

  /* Status Colors */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  /* Status Badges */
  --status-waiting: #f59e0b;
  --status-waiting-bg: rgba(245, 158, 11, 0.1);
  --status-inprogress: #3b82f6;
  --status-inprogress-bg: rgba(59, 130, 246, 0.1);
  --status-completed: #10b981;
  --status-completed-bg: rgba(16, 185, 129, 0.1);
  --status-cancelled: #ef4444;
  --status-cancelled-bg: rgba(239, 68, 68, 0.1);

  /* Surfaces */
  --bg-body: #f0f4f8;
  --bg-sidebar: #0f172a;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-input: #f1f5f9;
  --bg-input-focus: #ffffff;
  --bg-modal-overlay: rgba(15, 23, 42, 0.6);
  --bg-tooltip: #1e293b;

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-blur: 16px;

  /* Text */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;
  --text-link: #0c6cf2;

  /* Borders */
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --border-focus: #0c6cf2;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 8px 30px rgba(15, 23, 42, 0.12);
  --shadow-xl: 0 16px 48px rgba(15, 23, 42, 0.16);
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.06);

  /* Sidebar */
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #ffffff;
  --sidebar-item-hover: rgba(255, 255, 255, 0.08);
  --sidebar-item-active: rgba(12, 108, 242, 0.2);

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-Index Scale */
  --z-sidebar: 40;
  --z-topbar: 30;
  --z-modal: 100;
  --z-toast: 110;
  --z-loader: 120;
}

/* =============================================
   DARK THEME
   ============================================= */
[data-theme="dark"] {
  --bg-body: #0b1120;
  --bg-sidebar: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #263548;
  --bg-input: #1e293b;
  --bg-input-focus: #263548;
  --bg-modal-overlay: rgba(0, 0, 0, 0.7);

  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(51, 65, 85, 0.5);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --border: #334155;
  --border-light: #1e293b;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background var(--transition-base), color var(--transition-base);
}

a { color: var(--text-link); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; display: block; }

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* =============================================
   LAYOUT — DASHBOARD SHELL
   ============================================= */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: var(--z-sidebar);
  transition: transform var(--transition-base), width var(--transition-base);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand-icon {
  width: 40px;
  height: 40px;
  background: var(--primary-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.sidebar-brand-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-inverse);
  white-space: nowrap;
}

.sidebar-brand-sub {
  font-size: 11px;
  color: var(--sidebar-text);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 16px 12px 8px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  white-space: nowrap;
}

.sidebar-item:hover {
  background: var(--sidebar-item-hover);
  color: var(--sidebar-text-active);
}

.sidebar-item.active {
  background: var(--sidebar-item-active);
  color: var(--primary-light);
  font-weight: 600;
}

.sidebar-item .icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-item .badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.sidebar-user:hover {
  background: var(--sidebar-item-hover);
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-user-info {
  overflow: hidden;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-inverse);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: capitalize;
}

/* --- Main Content --- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition-base);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* --- Topbar --- */
.topbar {
  height: 64px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  backdrop-filter: blur(12px);
  background: var(--glass-bg);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  position: relative;
}

.topbar-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--primary);
}

.topbar-btn .notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-primary);
}

/* --- Content Area --- */
.content-area {
  flex: 1;
  padding: 28px;
}

/* =============================================
   CARDS
   ============================================= */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

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

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.card-body {
  padding: 24px;
}

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* Stat Cards */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-gradient);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-card-icon.blue { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.stat-card-icon.green { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.stat-card-icon.amber { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.stat-card-icon.rose { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.stat-card-icon.violet { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.stat-card-icon.cyan { background: rgba(6, 182, 212, 0.1); color: #06b6d4; }

.stat-card-info { flex: 1; }
.stat-card-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.stat-card-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}
.stat-card-change {
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}
.stat-card-change.up { color: var(--success); }
.stat-card-change.down { color: var(--danger); }

/* =============================================
   TABLES
   ============================================= */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

.data-table thead th {
  background: var(--bg-input);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color var(--transition-fast);
}

.data-table thead th:hover {
  color: var(--text-primary);
}

.data-table tbody tr {
  transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.data-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table tbody td:first-child {
  color: var(--text-primary);
  font-weight: 500;
}

/* =============================================
   BADGES / STATUS
   ============================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-waiting { background: var(--status-waiting-bg); color: var(--status-waiting); }
.badge-in-progress { background: var(--status-inprogress-bg); color: var(--status-inprogress); }
.badge-completed { background: var(--status-completed-bg); color: var(--status-completed); }
.badge-cancelled { background: var(--status-cancelled-bg); color: var(--status-cancelled); }
.badge-active { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.badge-inactive { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.badge-admin { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.badge-doctor { background: rgba(6, 182, 212, 0.1); color: #06b6d4; }
.badge-patient { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.badge-receptionist { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
  font-family: inherit;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: var(--primary-glow);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 36px rgba(12, 108, 242, 0.35);
}

.btn-success {
  background: var(--accent-gradient);
  color: white;
}
.btn-success:hover:not(:disabled) { transform: translateY(-1px); }

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}
.btn-danger:hover:not(:disabled) { transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(12, 108, 242, 0.04);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-input);
  color: var(--text-primary);
}

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* =============================================
   FORMS
   ============================================= */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-primary);
  font-family: inherit;
  transition: all var(--transition-fast);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--border-focus);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px rgba(12, 108, 242, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

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

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-modal-overlay);
  backdrop-filter: blur(6px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-spring);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-lg { max-width: 800px; }
.modal-sm { max-width: 420px; }

.modal-header {
  padding: 24px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--bg-input);
  cursor: pointer;
  font-size: 18px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--danger);
  color: white;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px 24px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* =============================================
   TOAST NOTIFICATIONS
   ============================================= */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  min-width: 320px;
  max-width: 420px;
  pointer-events: auto;
  animation: toastIn 0.4s var(--transition-spring) forwards;
}

.toast.removing {
  animation: toastOut 0.3s ease forwards;
}

.toast-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.toast-content { flex: 1; }
.toast-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.toast-message {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.toast-close {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
}

.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info .toast-icon { color: var(--info); }

/* =============================================
   LOADER
   ============================================= */
.loader-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-modal-overlay);
  backdrop-filter: blur(4px);
  z-index: var(--z-loader);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
}

.loader-overlay.active {
  display: flex;
}

.loader-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loader-text {
  color: var(--text-inverse);
  font-size: 14px;
  font-weight: 500;
}

/* =============================================
   TABS
   ============================================= */
.tab-bar {
  display: flex;
  gap: 4px;
  background: var(--bg-input);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab-btn {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  font-family: inherit;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block;
}

/* =============================================
   SEARCH & FILTER BAR
   ============================================= */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 250px;
}

.search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
}

.search-box input {
  width: 100%;
  padding: 10px 14px 10px 42px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
  transition: all var(--transition-fast);
}

.search-box input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(12, 108, 242, 0.1);
}

.filter-select {
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
  cursor: pointer;
  min-width: 150px;
}

/* =============================================
   QUEUE SYSTEM
   ============================================= */
.queue-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.queue-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.queue-token {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
}

.queue-token.waiting { background: var(--status-waiting-bg); color: var(--status-waiting); }
.queue-token.in-progress { background: var(--status-inprogress-bg); color: var(--status-inprogress); }

.queue-info { flex: 1; }
.queue-name { font-weight: 600; color: var(--text-primary); font-size: 15px; }
.queue-details { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.queue-actions { display: flex; gap: 8px; }

/* =============================================
   NOTIFICATIONS PANEL
   ============================================= */
.notif-panel {
  position: fixed;
  top: 0;
  right: -380px;
  width: 380px;
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  z-index: var(--z-modal);
  transition: right var(--transition-base);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
}

.notif-panel.active {
  right: 0;
}

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

.notif-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.notif-item {
  padding: 14px;
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  cursor: pointer;
  transition: background var(--transition-fast);
  border-left: 3px solid transparent;
}

.notif-item:hover { background: var(--bg-card-hover); }
.notif-item.unread {
  background: rgba(12, 108, 242, 0.04);
  border-left-color: var(--primary);
}

.notif-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.notif-message {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.notif-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-state-icon {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state-text {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 400px;
}

/* =============================================
   DOCTOR CARD (for patient booking)
   ============================================= */
.doctor-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  gap: 20px;
  transition: all var(--transition-base);
}

.doctor-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.doctor-avatar {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-lg);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: white;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}

.doctor-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.doctor-meta { flex: 1; }
.doctor-name { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.doctor-dept {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  margin-top: 2px;
}
.doctor-spec {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
}
.doctor-fee {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  margin-top: 6px;
}

/* =============================================
   PRESCRIPTION / MEDICAL RECORD
   ============================================= */
.prescription-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
}

.rx-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--border);
}

.rx-title {
  font-size: 16px;
  font-weight: 700;
}

.rx-date {
  font-size: 13px;
  color: var(--text-muted);
}

.medicine-list {
  margin-top: 12px;
}

.medicine-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.medicine-item:last-child { border-bottom: none; }

.medicine-name { font-weight: 600; color: var(--text-primary); flex: 1; }
.medicine-dosage { font-size: 13px; color: var(--text-secondary); }
.medicine-days { font-size: 13px; color: var(--text-muted); }

/* =============================================
   AI INSIGHTS PANEL
   ============================================= */
.ai-card {
  background: linear-gradient(135deg, rgba(12, 108, 242, 0.05), rgba(139, 92, 246, 0.05));
  border: 1px solid rgba(12, 108, 242, 0.15);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.ai-card::before {
  content: '✨';
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 24px;
  opacity: 0.5;
}

.ai-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.ai-prediction {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
}

.ai-bar-container {
  flex: 1;
  height: 8px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.ai-bar {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 1s ease;
}

.ai-bar.low { background: var(--success); }
.ai-bar.medium { background: var(--warning); }
.ai-bar.high { background: var(--danger); }

/* =============================================
   CHART CONTAINERS
   ============================================= */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
}

.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.chart-container canvas {
  width: 100% !important;
  max-height: 300px;
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100%); }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.animate-in {
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

.animate-in:nth-child(1) { animation-delay: 0.05s; }
.animate-in:nth-child(2) { animation-delay: 0.10s; }
.animate-in:nth-child(3) { animation-delay: 0.15s; }
.animate-in:nth-child(4) { animation-delay: 0.20s; }
.animate-in:nth-child(5) { animation-delay: 0.25s; }
.animate-in:nth-child(6) { animation-delay: 0.30s; }

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-card-hover) 50%, var(--bg-input) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

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

  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .stat-cards {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .chart-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .content-area {
    padding: 16px;
  }

  .topbar {
    padding: 0 16px;
  }

  .stat-cards {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    flex-direction: column;
  }

  .filter-bar .search-box {
    width: 100%;
  }

  .modal {
    margin: 12px;
    max-height: 92vh;
  }

  .toast-container {
    left: 12px;
    right: 12px;
  }

  .toast {
    min-width: auto;
    width: 100%;
  }
}

/* =============================================
   LANDING PAGE SPECIFIC
   ============================================= */
.landing-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 16px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition-base);
  background: transparent;
}

.landing-nav.scrolled {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
}

.landing-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 100px 40px 60px;
  position: relative;
  overflow: hidden;
}

.landing-hero::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(12, 108, 242, 0.15), transparent 70%);
  top: -100px;
  right: -100px;
  border-radius: 50%;
}

.landing-hero::after {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.1), transparent 70%);
  bottom: -100px;
  left: -100px;
  border-radius: 50%;
}

.hero-title {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 36px;
  background: var(--primary-gradient);
  color: white;
  font-size: 16px;
  font-weight: 700;
  border-radius: var(--radius-full);
  box-shadow: var(--primary-glow);
  transition: all var(--transition-base);
  text-decoration: none;
}

.hero-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 40px rgba(12, 108, 242, 0.35);
  color: white;
}

.features-section {
  padding: 80px 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 48px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  transition: all var(--transition-base);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 20px;
}

.feature-title {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.feature-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* =============================================
   LOGIN PAGE SPECIFIC
   ============================================= */
.auth-page {
  min-height: 100vh;
  display: flex;
}

.auth-left {
  flex: 1;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  position: relative;
  overflow: hidden;
}

.auth-left::before {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  top: -100px;
  right: -100px;
}

.auth-left::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  bottom: -80px;
  left: -80px;
}

.auth-left-content {
  position: relative;
  z-index: 1;
  color: white;
  max-width: 400px;
}

.auth-left-title {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
}

.auth-left-text {
  font-size: 16px;
  opacity: 0.8;
  line-height: 1.7;
}

.auth-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  background: var(--bg-body);
}

.auth-form-container {
  width: 100%;
  max-width: 420px;
}

.auth-tabs {
  display: flex;
  margin-bottom: 32px;
  border-bottom: 2px solid var(--border);
}

.auth-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  font-family: inherit;
  transition: color var(--transition-fast);
}

.auth-tab.active {
  color: var(--primary);
}

.auth-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.google-btn {
  width: 100%;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: inherit;
  transition: all var(--transition-fast);
}

.google-btn:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.google-btn svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 768px) {
  .auth-page {
    flex-direction: column;
  }

  .auth-left {
    padding: 40px 24px;
    min-height: 200px;
  }

  .auth-left-title {
    font-size: 24px;
  }

  .auth-right {
    padding: 32px 24px;
  }

  .landing-nav {
    padding: 12px 20px;
  }

  .landing-hero {
    padding: 100px 20px 60px;
  }

  .features-section {
    padding: 60px 20px;
  }
}
