/* ==========================================================================
   SOLO HEKİM PRO — Modern Medical Design System & Styling
   ========================================================================== */

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

:root {
  /* Color Palette - Emerald Medical & Royal Slate */
  --primary: #0f766e;
  --primary-light: #0d9488;
  --primary-dark: #10b981;
  --primary-subtle: rgba(13, 148, 136, 0.12);
  --primary-glow: rgba(20, 184, 166, 0.25);

  --secondary: #6366f1;
  --secondary-subtle: rgba(99, 102, 241, 0.12);

  --success: #10b981;
  --success-subtle: rgba(16, 185, 129, 0.12);

  --warning: #f59e0b;
  --warning-subtle: rgba(245, 158, 11, 0.15);

  --danger: #ef4444;
  --danger-subtle: rgba(239, 68, 68, 0.12);

  --whatsapp: #25d366;
  --whatsapp-dark: #128c7e;
  --whatsapp-subtle: rgba(37, 211, 102, 0.15);

  /* Backgrounds & Surfaces (Light Theme Default) */
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f1f5f9;
  --bg-subtle: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.88);

  /* Borders & Dividers */
  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;
  --border-focus: #0d9488;

  /* Text & Typography */
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-on-primary: #ffffff;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 25px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.03);
  --shadow-xl: 0 20px 35px -5px rgba(15, 23, 42, 0.12);

  /* Radius & Transitions */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Theme Tokens */
[data-theme="dark"] {
  --primary: #14b8a6;
  --primary-light: #2dd4bf;
  --primary-dark: #0d9488;
  --primary-subtle: rgba(20, 184, 166, 0.18);
  --primary-glow: rgba(20, 184, 166, 0.35);

  --bg-app: #090d16;
  --bg-surface: #111827;
  --bg-card: #141e33;
  --bg-hover: #1e293b;
  --bg-subtle: #1a233a;
  --bg-glass: rgba(17, 24, 39, 0.85);

  --border-color: #1e293b;
  --border-subtle: #141e33;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-light: #64748b;

  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.45);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
  color: var(--text-main);
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-subtle);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* App Shell Layout */
.app-container {
  display: flex;
  min-height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Sidebar Navigation */
.sidebar {
  width: 270px;
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 40;
  transition: var(--transition);
}

.sidebar-header {
  padding: 22px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

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

.brand-icon,
img.brand-logo,
img.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
  font-weight: 800;
  font-size: 20px;
  object-fit: contain;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

img.brand-logo:hover,
img.brand-icon:hover {
  transform: scale(1.05);
}

.brand-info h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

.brand-info span {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.doctor-profile-card {
  margin: 16px 16px 8px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border-color);
}

.doctor-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #0d9488, #3b82f6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.doctor-meta h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.doctor-meta p {
  font-size: 11px;
  color: var(--text-muted);
}

/* Nav Menu */
.sidebar-nav {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
  padding: 12px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
}

.nav-item-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.nav-item:hover {
  background-color: var(--bg-hover);
  color: var(--text-main);
}

.nav-item.active {
  background: linear-gradient(135deg, var(--primary-subtle), rgba(20, 184, 166, 0.08));
  color: var(--primary);
  font-weight: 600;
  border-left: 3px solid var(--primary);
}

.nav-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--primary-subtle);
  color: var(--primary);
}

.nav-badge.danger {
  background: var(--danger-subtle);
  color: var(--danger);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.whatsapp-status-banner {
  background: var(--whatsapp-subtle);
  border: 1px solid rgba(37, 211, 102, 0.3);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--whatsapp);
  box-shadow: 0 0 8px var(--whatsapp);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Main Content Area */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
}

/* Public Pages Navbar */
.navbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color, rgba(15, 23, 42, 0.08));
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.03);
}

.navbar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Outfit', sans-serif;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.navbar .brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 900;
  font-size: 18px;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
  flex-shrink: 0;
  object-fit: contain;
}

.navbar .nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-muted, #475569);
  list-style: none;
  margin: 0;
  padding: 0;
}

.navbar .nav-links a {
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
  white-space: nowrap;
}

.navbar .nav-links a:hover,
.navbar .nav-links a.active {
  color: var(--primary, #0f766e);
}

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

.search-box {
  position: relative;
  width: 380px;
}

.search-box input {
  width: 100%;
  height: 42px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0 44px 0 40px;
  font-size: 13.5px;
  outline: none;
  transition: var(--transition);
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle);
  background-color: var(--bg-surface);
}

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

.search-shortcut {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Action Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px var(--primary-glow);
}

.btn-secondary {
  background-color: var(--bg-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background-color: var(--bg-hover);
  border-color: var(--text-muted);
}

.btn-whatsapp {
  background: linear-gradient(135deg, #25d366, #128c7e);
  color: white;
}
.btn-whatsapp:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
}

.btn-danger {
  background-color: var(--danger-subtle);
  color: var(--danger);
}
.btn-danger:hover {
  background-color: var(--danger);
  color: white;
}

.btn-icon {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}
.btn-icon:hover {
  background: var(--bg-hover);
  color: var(--primary);
}

/* Page Container */
.page-view {
  padding: 28px 32px 48px;
  display: none;
  animation: fadeIn 0.25s ease;
}

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

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

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

.page-title h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.page-title p {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==========================================================================
   DASHBOARD CARDS & GRIDS
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

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

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

.kpi-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-icon-wrap.primary { background: var(--primary-subtle); color: var(--primary); }
.kpi-icon-wrap.success { background: var(--success-subtle); color: var(--success); }
.kpi-icon-wrap.warning { background: var(--warning-subtle); color: var(--warning); }
.kpi-icon-wrap.indigo { background: var(--secondary-subtle); color: var(--secondary); }

.kpi-value {
  font-family: 'Outfit', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.kpi-sub {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.trend-badge {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}
.trend-badge.up { background: var(--success-subtle); color: var(--success); }
.trend-badge.down { background: var(--danger-subtle); color: var(--danger); }

/* Dashboard Two Column Content */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.8fr 1.2fr;
  gap: 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

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

.card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
}

/* Today's Appointments Timeline */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timeline-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.timeline-item:hover {
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.time-badge {
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  min-width: 65px;
}

.patient-info h4 {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-main);
}

.patient-info p {
  font-size: 12px;
  color: var(--text-muted);
}

/* Badges & Status */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
}

.status-badge.waiting { background: var(--warning-subtle); color: var(--warning); }
.status-badge.completed { background: var(--success-subtle); color: var(--success); }
.status-badge.noshow { background: var(--danger-subtle); color: var(--danger); }
.status-badge.cancelled { background: var(--border-color); color: var(--text-muted); }

/* ==========================================================================
   PATIENTS MODULE
   ========================================================================== */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background: var(--bg-subtle);
  padding: 14px 18px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 16px 18px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

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

.patient-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.patient-initials {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: var(--primary-subtle);
  color: var(--primary);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* ==========================================================================
   INTERACTIVE CALENDAR
   ========================================================================== */
.calendar-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

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

.calendar-grid {
  display: grid;
  grid-template-columns: 80px repeat(6, 1fr);
}

.cal-time-col {
  border-right: 1px solid var(--border-color);
  background: var(--bg-subtle);
}

.time-slot-label {
  height: 70px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.cal-day-col {
  border-right: 1px solid var(--border-subtle);
  position: relative;
}

.day-slot {
  height: 70px;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  transition: background 0.15s ease;
  cursor: pointer;
}

.day-slot:hover {
  background: var(--primary-subtle);
}

.cal-event {
  position: absolute;
  left: 6px;
  right: 6px;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11.5px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  z-index: 5;
  overflow: hidden;
}

.cal-event:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
  z-index: 10;
}

.cal-event.waiting {
  background: rgba(245, 158, 11, 0.18);
  border-left: 4px solid var(--warning);
  color: #b45309;
}
[data-theme="dark"] .cal-event.waiting { color: #fcd34d; }

.cal-event.completed {
  background: rgba(16, 185, 129, 0.18);
  border-left: 4px solid var(--success);
  color: #047857;
}
[data-theme="dark"] .cal-event.completed { color: #6ee7b7; }

.cal-event.noshow {
  background: rgba(239, 68, 68, 0.18);
  border-left: 4px solid var(--danger);
  color: #b91c1c;
}
[data-theme="dark"] .cal-event.noshow { color: #fca5a5; }

/* ==========================================================================
   WHATSAPP AUTOMATION SIMULATOR (DIFFERENTIATOR)
   ========================================================================== */
.whatsapp-grid {
  display: grid;
  grid-template-columns: 1.2fr 1.1fr;
  gap: 28px;
  align-items: start;
}

.phone-simulator {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  background: #0b141a;
  border-radius: 40px;
  padding: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
  border: 4px solid #2a3942;
}

.phone-header {
  background: #202c33;
  padding: 14px 16px;
  border-radius: 24px 24px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #e9edef;
}

.phone-body {
  background: #0b141a;
  background-image: radial-gradient(#1f2c34 1px, transparent 1px);
  background-size: 16px 16px;
  height: 430px;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wa-bubble {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  position: relative;
}

.wa-bubble.incoming {
  background: #202c33;
  color: #e9edef;
  align-self: flex-start;
  border-top-left-radius: 2px;
}

.wa-bubble.outgoing {
  background: #005c4b;
  color: #e9edef;
  align-self: flex-end;
  border-top-right-radius: 2px;
}

.wa-time {
  font-size: 10px;
  color: #8696a0;
  text-align: right;
  margin-top: 4px;
}

.wa-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.wa-btn {
  flex: 1;
  background: #111b21;
  color: #00a884;
  font-weight: 600;
  font-size: 12px;
  padding: 8px;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  border: 1px solid #202c33;
}
.wa-btn:hover {
  background: #202c33;
}

/* ==========================================================================
   MODALS & DRAWERS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95);
  transition: var(--transition);
}

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

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

.modal-body {
  padding: 24px 28px;
}

/* Form Styles */
.form-group {
  margin-bottom: 18px;
}

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

.form-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}

.form-input:focus {
  border-color: var(--primary);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px var(--primary-subtle);
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-card);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  font-weight: 600;
  animation: slideInToast 0.3s ease forwards;
}

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

/* Public Website Footer Standard */
.footer {
  border-top: 1px solid var(--border);
  padding: 60px 0 40px;
  background: #ffffff;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  text-align: left;
  margin-bottom: 32px;
}

.footer-col h4 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 18px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 14px;
  color: var(--text-muted);
  padding: 0;
  margin: 0;
}

.footer-col ul a {
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.footer-col ul a:hover {
  color: var(--primary);
}

@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   MOBILE HAMBURGER MENU — PUBLIC NAVBAR
   ========================================================================== */
.mobile-menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  z-index: 1001;
}

.mobile-menu-toggle span {
  position: absolute;
  left: calc(50% - 10px);
  top: calc(50% - 1px);
  width: 20px;
  height: 2px;
  background: var(--text-main, #0f172a);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.mobile-menu-toggle span:nth-child(1) { transform: translateY(-6px); }
.mobile-menu-toggle span:nth-child(3) { transform: translateY(6px); }

.mobile-menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translateY(0); }
.mobile-menu-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translateY(0); }

.mobile-nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
  padding: 16px 20px 20px;
  flex-direction: column;
  gap: 6px;
  z-index: 999;
  animation: slideDown 0.25s ease;
}

.mobile-nav-dropdown.active {
  display: flex;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.mobile-nav-dropdown a {
  display: block;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main, #0f172a);
  text-decoration: none;
  transition: all 0.2s;
}

.mobile-nav-dropdown a:hover,
.mobile-nav-dropdown a.active {
  background: var(--primary-subtle, rgba(13, 148, 136, 0.12));
  color: var(--primary, #0f766e);
}

.mobile-nav-dropdown .mobile-nav-cta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color, #e2e8f0);
}

.mobile-nav-dropdown .mobile-nav-cta a {
  text-align: center;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
}

/* ==========================================================================
   MOBILE SIDEBAR TOGGLE — DASHBOARD (index.html)
   ========================================================================== */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 39;
}

.sidebar-overlay.active {
  display: block;
}

.mobile-topbar-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  color: var(--text-main);
}

.mobile-topbar-toggle svg {
  width: 22px;
  height: 22px;
}

/* ==========================================================================
   RESPONSIVE — TABLET (≤ 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

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

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

  .calendar-grid {
    grid-template-columns: 60px repeat(6, 1fr);
  }

  .topbar {
    padding: 0 20px;
  }

  .search-box {
    width: 260px;
  }

  .page-view {
    padding: 22px 20px 40px;
  }
}

/* ==========================================================================
   RESPONSIVE — MOBILE (≤ 768px)
   ========================================================================== */
@media (max-width: 768px) {
  /* --- Public Navbar --- */
  .navbar {
    padding: 0 16px;
    height: 64px;
    position: relative;
  }

  .navbar .nav-links {
    display: none !important;
  }

  .navbar .container > div:not(.nav-links) {
    display: none !important;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .navbar .brand {
    font-size: 18px;
  }

  .navbar .brand-logo {
    width: 36px;
    height: 36px;
  }

  /* --- Public Hero & Sections Mobile Fixes --- */
  .hero {
    padding: 30px 0 20px !important;
  }

  .hero-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }

  .hero-badge {
    max-width: 100% !important;
    white-space: normal !important;
    line-height: 1.4 !important;
    text-align: left !important;
    padding: 8px 14px !important;
    font-size: 12.5px !important;
  }

  .hero h1 {
    font-size: 28px !important;
    line-height: 1.2 !important;
    letter-spacing: -0.5px !important;
    word-break: break-word !important;
  }

  .hero p {
    font-size: 15px !important;
    line-height: 1.5 !important;
    word-break: break-word !important;
    margin-bottom: 24px !important;
  }

  .hero-actions {
    flex-direction: column !important;
    width: 100% !important;
    gap: 12px !important;
    margin-bottom: 28px !important;
  }

  .hero-actions .btn {
    width: 100% !important;
    padding: 13px 16px !important;
    font-size: 14.5px !important;
    text-align: center !important;
    justify-content: center !important;
    white-space: normal !important;
    height: auto !important;
  }

  .hero-trust {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
    padding-top: 18px !important;
  }

  .glass-card {
    padding: 18px 14px !important;
    border-radius: 20px !important;
  }

  .float-card-1,
  .float-card-2 {
    display: none !important;
  }

  .sim-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }

  .sim-tabs {
    width: 100% !important;
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    justify-content: flex-start !important;
    gap: 6px !important;
  }

  .sim-tab {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
  }

  /* --- Dashboard Sidebar --- */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 40;
    box-shadow: none;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.15);
  }

  .mobile-topbar-toggle {
    display: flex;
  }

  html, body {
    max-width: 100vw;
    overflow-x: hidden !important;
  }

  .app-container,
  .main-area {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* --- Topbar --- */
  .topbar {
    padding: 0 14px;
    height: 60px;
    gap: 10px;
  }

  .search-box {
    width: 100%;
    max-width: 220px;
  }

  .search-shortcut {
    display: none;
  }

  .topbar-actions {
    gap: 8px;
  }

  .topbar-actions .btn-icon {
    width: 36px;
    height: 36px;
  }

  /* --- Page Content --- */
  .page-view {
    padding: 16px 14px 32px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .page-title h2 {
    font-size: 20px;
  }

  .page-title p {
    font-size: 12.5px;
  }

  /* --- Grids --- */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .kpi-card {
    padding: 16px;
  }

  .kpi-value {
    font-size: 22px;
  }

  .kpi-title {
    font-size: 11.5px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .whatsapp-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* --- Calendar --- */
  .calendar-grid {
    grid-template-columns: 50px repeat(6, 1fr);
    font-size: 11px;
  }

  .time-slot-label {
    font-size: 10px;
    height: 55px;
  }

  .day-slot {
    height: 55px;
  }

  .cal-event {
    font-size: 10px;
    padding: 4px 6px;
    left: 3px;
    right: 3px;
  }

  .calendar-header {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }

  /* --- Cards --- */
  .card {
    padding: 16px;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
  }

  .card-title {
    font-size: 15px;
  }

  /* --- Timeline --- */
  .timeline-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
  }

  .timeline-item .status-badge {
    align-self: flex-start;
  }

  /* --- Table --- */
  .data-table th {
    padding: 10px 12px;
    font-size: 11px;
  }

  .data-table td {
    padding: 12px;
    font-size: 12.5px;
  }

  .patient-cell {
    gap: 8px;
  }

  .patient-initials {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  /* --- Phone Simulator --- */
  .phone-simulator {
    max-width: 320px;
    border-radius: 30px;
    padding: 12px;
  }

  .phone-body {
    height: 350px;
    padding: 12px;
  }

  /* --- Modal --- */
  .modal-box {
    width: 95%;
    max-width: 95%;
    margin: 10px;
    border-radius: var(--radius-lg);
  }

  .modal-header {
    padding: 16px 18px;
  }

  .modal-body {
    padding: 16px 18px;
  }

  /* --- Buttons --- */
  .btn {
    padding: 9px 14px;
    font-size: 13px;
  }

  .page-header .btn,
  .page-header .btn-primary,
  .page-header .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  /* --- Toast --- */
  #toast-container {
    left: 14px;
    right: 14px;
    bottom: 14px;
  }

  .toast {
    width: 100%;
  }

  /* --- Footer --- */
  .footer {
    padding: 40px 0 30px;
  }

  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  .footer .brand {
    font-size: 18px;
  }
}

/* ==========================================================================
   RESPONSIVE — SMALL MOBILE (≤ 480px)
   ========================================================================== */
@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

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

  .page-title h2 {
    font-size: 18px;
  }

  .btn {
    font-size: 12.5px;
    padding: 8px 12px;
  }

  .navbar .brand {
    font-size: 16px;
    gap: 8px;
  }

  .navbar .brand-logo {
    width: 32px;
    height: 32px;
  }

  .topbar {
    padding: 0 10px;
    height: 56px;
  }

  .search-box {
    max-width: 160px;
  }

  .search-box input {
    height: 36px;
    font-size: 12px;
    padding: 0 10px 0 34px;
  }

  .search-box .search-icon svg {
    width: 16px;
    height: 16px;
  }

  .mobile-menu-toggle {
    width: 38px;
    height: 38px;
  }

  .card {
    padding: 14px;
    border-radius: var(--radius-md);
  }

  .form-input {
    padding: 9px 12px;
    font-size: 13px;
  }

  .form-label {
    font-size: 12px;
  }

  .calendar-grid {
    grid-template-columns: 42px repeat(6, 1fr);
  }

  .time-slot-label {
    font-size: 9px;
    height: 48px;
  }

  .day-slot {
    height: 48px;
  }

  .modal-box {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 95vh;
  }

  .modal-overlay {
    align-items: flex-end;
  }

  .status-badge {
    font-size: 10.5px;
    padding: 3px 8px;
  }

  .phone-simulator {
    max-width: 100%;
    border-radius: 24px;
    padding: 8px;
  }

  .phone-body {
    height: 300px;
  }

  .doctor-profile-card {
    margin: 12px 12px 6px;
    padding: 10px;
  }
}
