/* =============================================
   ThanksMD.com — Global Design System V46
   Dark Theme · Premium Red · Modern SaaS
   ============================================= */

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

/* ─── CSS Tokens ─── */
:root {
  /* Brand */
  --red-400:  #f43f5e;
  --red-500:  #e11d48;
  --red-600:  #be123c;
  --teal-400: #e11d48;   /* kept for backward compat */
  --teal-500: #be123c;
  --cyan-400: #f43f5e;
  --cyan-500: #e11d48;

  /* Accent secondaries */
  --indigo:   #6366f1;
  --violet:   #7c3aed;
  --emerald:  #10b981;
  --amber:    #f59e0b;
  --sky:      #0ea5e9;

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

  /* Grays */
  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* ── DARK SURFACES ── */
  --bg-body:      #0a0a0f;
  --bg-primary:   #0a0a0f;
  --bg-secondary: #111118;
  --bg-card:      #141420;
  --bg-card-hover:#1a1a2e;
  --bg-elevated:  #1e1e30;
  --bg-input:     rgba(255,255,255,0.05);

  /* Borders */
  --border:        rgba(255,255,255,0.08);
  --border-subtle: rgba(255,255,255,0.05);
  --border-glow:   rgba(225,29,72,0.35);
  --border-strong: rgba(255,255,255,0.15);

  /* Text */
  --text-primary:   #f1f5f9;
  --text-main:      #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #475569;

  /* Gradients */
  --grad-brand:   linear-gradient(135deg, #e11d48 0%, #f43f5e 100%);
  --grad-hero:    linear-gradient(135deg, #0a0a0f 0%, #130a20 50%, #0a0a0f 100%);
  --grad-card:    linear-gradient(135deg, rgba(225,29,72,0.04) 0%, rgba(124,58,237,0.02) 100%);
  --grad-glow:    radial-gradient(circle at 50% 0%, rgba(225,29,72,0.12) 0%, transparent 60%);

  /* Radius */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   20px;
  --radius-2xl:  24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:   0 12px 40px rgba(0,0,0,0.6);
  --shadow-glow: 0 4px 24px rgba(225,29,72,0.25);
  --shadow-card: 0 0 0 1px rgba(255,255,255,0.06), 0 8px 32px rgba(0,0,0,0.4);
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ─── Typography ─── */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 900; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.5rem); font-weight: 800; }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }
p  { color: var(--text-secondary); }

/* ─── Layout ─── */
.container { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 5rem 0; }
.section-sm { padding: 3rem 0; }
.grid { display: grid; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 0.5rem; } .gap-2 { gap: 1rem; } .gap-3 { gap: 1.5rem; } .gap-4 { gap: 2rem; }

/* ─── Navbar ─── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
}
.navbar.scrolled {
  background: rgba(10,10,15,0.95);
  box-shadow: 0 4px 30px rgba(0,0,0,0.5);
  border-bottom-color: rgba(225,29,72,0.15);
}
.navbar-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
}
.navbar-logo {
  display: flex; align-items: center; gap: 0.75rem;
  font-size: 1.5rem; font-weight: 900;
  background: var(--grad-brand);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: -0.03em;
}
.navbar-logo svg { width: 36px; height: 36px; }
.navbar-links { display: flex; align-items: center; gap: 0.25rem; }
.navbar-link {
  padding: 0.45rem 0.9rem; border-radius: var(--radius-full);
  color: var(--text-muted); font-size: 0.88rem; font-weight: 500;
  transition: all 0.2s;
}
.navbar-link:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.navbar-link.active { color: var(--red-400); background: rgba(244,63,94,0.1); }
.navbar-actions { display: flex; align-items: center; gap: 0.75rem; }
.navbar-hider { display: flex; align-items: center; gap: 0.5rem; }
.navbar-portal-switch { display: flex; background: rgba(255,255,255,0.05); border-radius: var(--radius-full); padding: 3px; }
.portal-btn { padding: 0.4rem 1rem; border-radius: var(--radius-full); font-size: 0.8rem; font-weight: 600; color: var(--text-muted); transition: all 0.2s; }
.portal-btn.active { background: var(--grad-brand); color: white; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 1.5rem; border-radius: var(--radius-full);
  font-size: 0.88rem; font-weight: 600; letter-spacing: 0.01em;
  transition: all 0.22s; white-space: nowrap;
}
.btn-primary {
  background: var(--grad-brand); color: white;
  box-shadow: 0 3px 12px rgba(225,29,72,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(225,29,72,0.45); filter: brightness(1.05); }
.btn-ghost {
  background: rgba(255,255,255,0.05); color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: rgba(255,255,255,0.09); color: var(--text-primary); border-color: var(--border-strong); }
.btn-outline {
  background: transparent; color: var(--red-400);
  border: 1.5px solid rgba(244,63,94,0.4);
}
.btn-outline:hover { background: rgba(244,63,94,0.08); border-color: var(--red-400); }
.btn-danger   { background: rgba(239,68,68,0.12);  color: #f87171; border: 1px solid rgba(239,68,68,0.25); }
.btn-success  { background: rgba(16,185,129,0.12); color: #34d399; border: 1px solid rgba(16,185,129,0.25); }
.btn-warning  { background: rgba(245,158,11,0.12); color: #fbbf24; border: 1px solid rgba(245,158,11,0.25); }
.btn-secondary{ background: rgba(255,255,255,0.07); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-secondary:hover { background: rgba(255,255,255,0.11); color: var(--text-primary); }
.btn-teal { background: var(--grad-brand); color: white; box-shadow: 0 4px 15px rgba(225,29,72,0.3); }
.btn-teal:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(225,29,72,0.45); }
.btn-sm  { padding: 0.4rem 1rem; font-size: 0.8rem; }
.btn-lg  { padding: 0.85rem 2rem; font-size: 1rem; }
.btn-xl  { padding: 1rem 2.5rem; font-size: 1.1rem; }
.btn-icon{ padding: 0.6rem; border-radius: var(--radius-md); }
.btn-block { width: 100%; justify-content: center; }

/* ─── Cards ─── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  transition: all 0.25s;
}
.card:hover { border-color: rgba(255,255,255,0.12); }
.card-hover:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}
.card-gradient { background: var(--grad-card); }
.card-glass {
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
}
.card-premium {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  transition: all 0.3s cubic-bezier(0.16,1,0.3,1);
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-card);
}
.card-premium:hover { border-color: var(--border-glow); transform: translateY(-3px); box-shadow: var(--shadow-glow); }

/* ─── Forms ─── */
.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-label { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; }
.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all 0.2s;
}
.form-control:focus {
  outline: none;
  border-color: rgba(244,63,94,0.5);
  background: rgba(244,63,94,0.04);
  box-shadow: 0 0 0 3px rgba(244,63,94,0.1);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control { cursor: pointer; appearance: none; }
select.form-control option { background: #1a1a2e; color: var(--text-primary); }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-control[readonly] { opacity: 0.6; cursor: not-allowed; }

/* ─── Badges ─── */
.badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.22rem 0.7rem; border-radius: var(--radius-full);
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em;
}
.badge-teal   { background: rgba(244,63,94,0.12);   color: #fb7185; border: 1px solid rgba(244,63,94,0.2); }
.badge-green  { background: rgba(16,185,129,0.12);  color: #34d399; border: 1px solid rgba(16,185,129,0.2); }
.badge-yellow { background: rgba(245,158,11,0.12);  color: #fbbf24; border: 1px solid rgba(245,158,11,0.2); }
.badge-red    { background: rgba(239,68,68,0.12);   color: #f87171; border: 1px solid rgba(239,68,68,0.2); }
.badge-blue   { background: rgba(59,130,246,0.12);  color: #60a5fa; border: 1px solid rgba(59,130,246,0.2); }
.badge-purple { background: rgba(139,92,246,0.12);  color: #a78bfa; border: 1px solid rgba(139,92,246,0.2); }
.badge-gray   { background: rgba(148,163,184,0.08); color: var(--text-secondary); border: 1px solid var(--border); }
.badge-dot::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; display: inline-block;
}

/* ─── Stars ─── */
.stars { display: flex; gap: 2px; }
.star { color: #fbbf24; font-size: 0.9rem; }
.star.empty { color: rgba(255,255,255,0.12); }

/* ─── Avatar ─── */
.avatar {
  border-radius: 50%; object-fit: cover;
  background: var(--grad-brand);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: white;
  flex-shrink: 0;
}
.avatar-sm  { width: 36px;  height: 36px;  font-size: 0.85rem; }
.avatar-md  { width: 48px;  height: 48px;  font-size: 1rem; }
.avatar-lg  { width: 64px;  height: 64px;  font-size: 1.25rem; }
.avatar-xl  { width: 96px;  height: 96px;  font-size: 1.75rem; }
.avatar-xxl { width: 120px; height: 120px; font-size: 2rem; }

/* ─── Status Dots ─── */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-online  { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-away    { background: var(--warning); }
.status-offline { background: #374151; }
.status-busy    { background: var(--danger); }

/* ─── Tables ─── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
thead { background: rgba(255,255,255,0.03); }
th {
  padding: 0.85rem 1.25rem; text-align: left;
  font-size: 0.7rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 0.9rem 1.25rem; font-size: 0.88rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.025); }
td strong, td .doc-name { color: var(--text-primary); }

/* ─── Portal Sidebar Layout ─── */
.portal-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 256px; flex-shrink: 0;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 1.25rem 0.875rem;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 0.5rem 0; margin-bottom: 2rem;
  font-size: 1.2rem; font-weight: 900;
  background: var(--grad-brand);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: -0.03em;
}
.sidebar-section-label {
  font-size: 0.64rem; font-weight: 800; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-muted);
  padding: 0.5rem 0.75rem; margin: 0.5rem 0 0.25rem;
}
.sidebar-link {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 0.75rem; border-radius: var(--radius-md);
  color: var(--text-muted); font-size: 0.875rem; font-weight: 500;
  transition: all 0.18s; margin-bottom: 0.1rem;
  border-left: 2px solid transparent;
}
.sidebar-link:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.sidebar-link.active {
  background: rgba(225,29,72,0.1);
  color: var(--red-400);
  border-left-color: var(--red-500);
  font-weight: 600;
}
.sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.7; }
.sidebar-link.active svg { opacity: 1; }
.sidebar-link .badge { margin-left: auto; }
.sidebar-bottom { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--border); }
.sidebar-user { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem; border-radius: var(--radius-md); }
.sidebar-user:hover { background: rgba(255,255,255,0.04); }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 0.72rem; color: var(--text-muted); }

/* portal-sidebar (alias) */
.portal-sidebar {
  width: 256px; flex-shrink: 0;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 1.25rem 0.875rem;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto; z-index: 10;
}
.portal-sidebar-header { margin-bottom: 2rem; padding: 0.25rem 0.5rem; }
.portal-sidebar-header .navbar-logo {
  -webkit-text-fill-color: transparent;
  background: var(--grad-brand);
  -webkit-background-clip: text; background-clip: text;
  font-size: 1.2rem; font-weight: 900;
}
.portal-nav { display: flex; flex-direction: column; flex: 1; gap: 0.1rem; }
.portal-nav-link {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 0.85rem; border-radius: var(--radius-md);
  color: var(--text-muted); font-size: 0.875rem; font-weight: 500;
  transition: all 0.18s; text-decoration: none;
  border-left: 2px solid transparent;
}
.portal-nav-link span { font-size: 1.1rem; flex-shrink: 0; }
.portal-nav-link:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.portal-nav-link.active {
  background: rgba(225,29,72,0.1); color: var(--red-400);
  border-left-color: var(--red-500); font-weight: 600;
  padding-left: calc(0.85rem - 2px);
}
.portal-sidebar-footer {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 0.5rem; margin-top: auto;
  border-top: 1px solid var(--border); padding-top: 1rem;
}

.portal-main { flex: 1; overflow-y: auto; background: var(--bg-body); }
.portal-content { padding: 2rem; max-width: 1200px; }
.portal-header { margin-bottom: 2rem; }
.portal-header h1 { font-size: 1.65rem; margin-bottom: 0.25rem; }
.portal-header p { color: var(--text-secondary); font-size: 0.88rem; }

/* ─── KPI Cards ─── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem; margin-bottom: 2rem;
}
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  position: relative; overflow: hidden;
  transition: all 0.25s;
  box-shadow: var(--shadow-card);
}
.kpi-card::before {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 100%; height: 2px;
  background: var(--grad-brand);
}
.kpi-card:hover { border-color: rgba(225,29,72,0.2); transform: translateY(-2px); }
.kpi-icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: rgba(225,29,72,0.1);
  border: 1px solid rgba(225,29,72,0.15);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem; font-size: 1.2rem;
}
.kpi-value {
  font-size: 1.9rem; font-weight: 900; color: var(--text-primary);
  margin-bottom: 0.25rem; letter-spacing: -0.03em; line-height: 1;
}
.kpi-label { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.kpi-change { font-size: 0.78rem; font-weight: 600; }
.kpi-change.up { color: var(--success); }
.kpi-change.down { color: var(--danger); }

/* ─── Search Bar ─── */
.search-hero {
  background: rgba(255,255,255,0.04);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 0.5rem;
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  align-items: center;
  backdrop-filter: blur(8px);
}
.search-field {
  flex: 1; min-width: 180px;
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-right: 1px solid var(--border);
}
.search-field:last-of-type { border-right: none; }
.search-field-icon { color: var(--red-400); flex-shrink: 0; }
.search-field input, .search-field select {
  background: none; border: none; outline: none;
  color: var(--text-primary); font-size: 0.88rem; width: 100%; font-family: inherit;
}
.search-field input::placeholder { color: var(--text-muted); }
.search-field select { cursor: pointer; }
.search-field select option { background: #1a1a2e; }

/* ─── Doctor Card (legacy + new) ─── */
.doctor-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  transition: all 0.25s; display: flex; flex-direction: column;
  box-shadow: var(--shadow-card);
}
.doctor-card:hover {
  border-color: rgba(225,29,72,0.3);
  box-shadow: var(--shadow-glow);
  transform: translateY(-3px);
}
.doctor-card-header { display: flex; gap: 1rem; margin-bottom: 1rem; }
.doctor-card-avatar { position: relative; }
.doctor-card-avatar .status-dot { position: absolute; bottom: 2px; right: 2px; border: 2px solid var(--bg-card); }
.doctor-card-name { font-size: 0.97rem; font-weight: 700; margin-bottom: 0.2rem; color: var(--text-primary); }
.doctor-card-specialty { font-size: 0.8rem; color: var(--red-400); font-weight: 600; margin-bottom: 0.4rem; }
.doctor-card-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; font-size: 0.8rem; color: var(--text-muted); }
.doctor-card-stats {
  display: flex; gap: 1rem; padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
.doctor-stat { text-align: center; flex: 1; }
.doctor-stat-value { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.doctor-stat-label { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.doctor-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.fee-display {}
.fee-amount {
  font-size: 1.2rem; font-weight: 800;
  background: var(--grad-brand);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.fee-label { font-size: 0.68rem; color: var(--text-muted); }
.fee-old { text-decoration: line-through; color: var(--text-muted); font-size: 0.8rem; }

/* ─── Slot Picker ─── */
.slots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 0.5rem; }
.slot-btn {
  padding: 0.55rem; border-radius: var(--radius-md); text-align: center;
  font-size: 0.82rem; font-weight: 600;
  background: rgba(255,255,255,0.03); border: 1.5px solid var(--border);
  color: var(--text-secondary); cursor: pointer; transition: all 0.18s; font-family: inherit;
}
.slot-btn:hover { border-color: rgba(244,63,94,0.5); color: var(--red-400); background: rgba(244,63,94,0.06); }
.slot-btn.selected { background: var(--grad-brand); color: white; border-color: transparent; box-shadow: 0 3px 12px rgba(225,29,72,0.35); }
.slot-btn.taken { opacity: 0.3; cursor: not-allowed; text-decoration: line-through; }

/* ─── Profile Page ─── */
.profile-hero {
  background: linear-gradient(135deg, rgba(225,29,72,0.05), rgba(124,58,237,0.03));
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 2.5rem; margin-bottom: 2rem;
}
.profile-hero-inner { display: flex; gap: 2rem; align-items: flex-start; flex-wrap: wrap; }
.profile-main-info { flex: 1; min-width: 240px; }
.profile-name { font-size: 2rem; font-weight: 900; margin-bottom: 0.4rem; }
.profile-specialty { font-size: 1rem; color: var(--red-400); font-weight: 600; margin-bottom: 1rem; }
.profile-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.25rem; }
.profile-quick-stats { display: flex; gap: 2rem; flex-wrap: wrap; }
.profile-quick-stat { text-align: center; }
.profile-quick-stat-value { font-size: 1.5rem; font-weight: 800; color: var(--red-400); }
.profile-quick-stat-label { font-size: 0.72rem; color: var(--text-muted); }

/* ─── Prescription Pad ─── */
.rx-header {
  display: flex; align-items: center; gap: 1rem;
  padding-bottom: 1rem; margin-bottom: 1.5rem;
  border-bottom: 2px dashed rgba(244,63,94,0.25);
}
.rx-symbol { font-size: 3rem; font-weight: 900; color: var(--red-400); line-height: 1; }
.rx-doctor-info { flex: 1; }
.rx-doc-name { font-size: 1.2rem; font-weight: 700; }
.rx-doc-meta { font-size: 0.8rem; color: var(--text-muted); }
.med-row {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem; margin-bottom: 0.75rem;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 0.75rem; align-items: center;
}
.med-number {
  width: 26px; height: 26px; background: var(--grad-brand);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700; color: white; flex-shrink: 0;
}
@media (max-width: 768px) { .med-row { grid-template-columns: 1fr; } }

/* ─── Video Room ─── */
.video-layout { display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem; height: calc(100vh - 160px); }
.video-main { background: #0a0a14; border-radius: var(--radius-2xl); position: relative; overflow: hidden; }
.video-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #0a0a14 0%, #111120 100%);
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 1rem;
}
.patient-self-view {
  position: absolute; bottom: 1rem; right: 1rem;
  width: 140px; height: 100px;
  background: #1a1a2e; border-radius: var(--radius-md);
  border: 2px solid rgba(255,255,255,0.1); overflow: hidden;
}
.video-controls {
  position: absolute; bottom: 0; left: 0; right: 0; padding: 1.5rem;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 100%);
  display: flex; align-items: center; justify-content: center; gap: 1rem;
}
.video-btn {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; cursor: pointer; transition: all 0.2s; border: none;
}
.video-btn.active { background: rgba(255,255,255,0.12); color: white; }
.video-btn.end-call { background: var(--danger); color: white; width: 60px; height: 60px; font-size: 1.5rem; }
.video-btn.muted { background: rgba(239,68,68,0.2); color: #f87171; }
.waiting-room-panel { display: flex; flex-direction: column; gap: 1rem; overflow-y: auto; }
.waiting-patient {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1rem;
  display: flex; align-items: center; gap: 0.75rem;
}
.timer {
  font-size: 3.5rem; font-weight: 900;
  background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  text-align: center;
}

/* ─── Chart Bars ─── */
.chart-bar-group { display: flex; align-items: flex-end; gap: 0.4rem; height: 80px; }
.chart-bar {
  flex: 1; background: var(--grad-brand);
  border-radius: 4px 4px 0 0; opacity: 0.7; transition: opacity 0.2s;
}
.chart-bar:hover { opacity: 1; }
.chart-labels { display: flex; gap: 0.4rem; margin-top: 0.4rem; }
.chart-label { flex: 1; text-align: center; font-size: 0.65rem; color: var(--text-muted); }

/* ─── EHR / File Upload ─── */
.upload-zone {
  border: 2px dashed rgba(225,29,72,0.25);
  border-radius: var(--radius-xl);
  padding: 3rem 2rem; text-align: center;
  background: rgba(225,29,72,0.03);
  cursor: pointer; transition: all 0.25s;
}
.upload-zone:hover { background: rgba(225,29,72,0.07); border-color: var(--red-500); }
.upload-zone-icon { font-size: 3rem; margin-bottom: 1rem; }
.file-row {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  margin-bottom: 0.5rem; transition: all 0.2s;
}
.file-row:hover { border-color: rgba(225,29,72,0.25); }
.file-icon { font-size: 1.5rem; flex-shrink: 0; }
.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); }
.file-meta { font-size: 0.78rem; color: var(--text-muted); }

/* ─── Toast Notifications ─── */
.toast {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 9999;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1rem 1.25rem;
  display: flex; align-items: center; gap: 0.75rem;
  box-shadow: var(--shadow-lg);
  animation: slideInToast 0.3s ease;
  max-width: 360px;
}
.toast.success { border-color: rgba(16,185,129,0.4); }
.toast.error   { border-color: rgba(239,68,68,0.4); }
@keyframes slideInToast {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.toast-icon { font-size: 1.25rem; }
.toast-msg  { font-size: 0.88rem; color: var(--text-primary); font-weight: 500; }

/* ─── Modal ─── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.8);
  backdrop-filter: blur(6px); z-index: 500;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-2xl); padding: 2rem;
  max-width: 540px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  animation: fadeUp 0.3s ease;
  box-shadow: var(--shadow-lg);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.modal-title { font-size: 1.2rem; font-weight: 700; }

/* ─── Progress ─── */
.progress { background: rgba(255,255,255,0.08); border-radius: var(--radius-full); height: 6px; }
.progress-fill { height: 100%; border-radius: var(--radius-full); background: var(--grad-brand); }

/* ─── Divider ─── */
.divider { height: 1px; background: var(--border); margin: 1.5rem 0; }
.divider-glow { background: linear-gradient(to right, transparent, rgba(225,29,72,0.4), transparent); }

/* ─── Section Headings ─── */
.section-tag {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--red-400); margin-bottom: 1rem;
}
.section-tag-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red-400); display: inline-block; }
.section-heading { margin-bottom: 1rem; }
.section-subtext { color: var(--text-secondary); max-width: 600px; }
.text-gradient {
  background: var(--grad-brand);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.text-gradient-animated {
  background: linear-gradient(135deg, #f43f5e, #a855f7, #3b82f6, #f43f5e);
  background-size: 300% 300%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: gradient-shift 5s ease infinite;
}
@keyframes gradient-shift { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* ─── Booking Steps ─── */
.step-indicator { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; opacity: 0.4; transition: all 0.3s; }
.step-indicator.active { opacity: 1; }
.step-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-card); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem; color: var(--text-muted);
}
.active .step-num { background: var(--grad-brand); border-color: transparent; color: white; box-shadow: var(--shadow-glow); }
.step-label { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.active .step-label { color: var(--red-400); }
.step-line { flex: 1; height: 2px; background: var(--border); max-width: 60px; margin-top: 16px; transition: all 0.3s; }
.step-line.active { background: var(--red-400); }

/* ─── Call Window ─── */
@keyframes call-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.5); }
  50%       { box-shadow: 0 0 0 8px rgba(16,185,129,0); }
}
.call-btn-active {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: white !important; border-color: transparent !important;
  animation: call-pulse 1.5s infinite;
}
.active-call-banner {
  background: linear-gradient(135deg, rgba(16,185,129,.1), rgba(5,150,105,.07));
  border: 1px solid rgba(16,185,129,.35);
  border-radius: var(--radius-lg); padding: 1.25rem 1.5rem;
  display: flex; align-items: center; gap: 1.25rem;
  margin-bottom: 1.5rem; animation: call-pulse 2s infinite;
}
.call-live-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: #10b981; box-shadow: 0 0 8px #10b981;
  animation: pulse 1s infinite; flex-shrink: 0;
}

/* ─── Animations ─── */
@keyframes fadeUp   { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse    { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes spin     { to { transform: rotate(360deg); } }
@keyframes float    { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes shimmer  { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes glow-pulse { 0%, 100% { box-shadow: 0 0 20px rgba(225,29,72,0.1); } 50% { box-shadow: 0 0 40px rgba(225,29,72,0.25); } }
@keyframes slide-in-right { from { transform: translateX(30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slide-in-left  { from { transform: translateX(-30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes scale-in       { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.animate-fade-up     { animation: fadeUp 0.6s ease forwards; }
.animate-float       { animation: float 3s ease-in-out infinite; }
.animate-pulse       { animation: pulse 2s ease-in-out infinite; }
.animate-slide-right { animation: slide-in-right 0.5s ease forwards; }
.animate-slide-left  { animation: slide-in-left 0.5s ease forwards; }
.animate-scale-in    { animation: scale-in 0.4s ease forwards; }
.animate-glow        { animation: glow-pulse 3s ease-in-out infinite; }
.delay-1 { animation-delay: 0.1s; opacity: 0; }
.delay-2 { animation-delay: 0.2s; opacity: 0; }
.delay-3 { animation-delay: 0.3s; opacity: 0; }
.delay-4 { animation-delay: 0.4s; opacity: 0; }
.delay-5 { animation-delay: 0.5s; opacity: 0; }

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

/* ─── Footer ─── */
.footer {
  background: #07070d;
  border-top: 1px solid var(--border);
  padding: 4rem 0 2rem;
  color: var(--text-muted);
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem; margin-bottom: 3rem; }
.footer-brand p { font-size: 0.88rem; color: var(--text-muted); margin-top: 1rem; max-width: 280px; }
.footer-col-title { font-size: 0.78rem; font-weight: 700; color: var(--text-primary); margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 0.06em; }
.footer-link { display: block; font-size: 0.85rem; color: var(--text-muted); padding: 0.25rem 0; transition: color 0.2s; }
.footer-link:hover { color: var(--red-400); }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 2rem; border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem; color: var(--text-muted);
}

/* ─── Mobile Bottom Nav ─── */
.mobile-bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 300;
  background: rgba(10,10,15,0.97);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.mobile-bottom-nav-inner { display: flex; align-items: stretch; height: 62px; }
.mob-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 6px 2px;
  text-decoration: none; color: var(--text-muted);
  font-size: 0.58rem; font-weight: 600; letter-spacing: 0.02em;
  transition: color 0.2s; border: none; background: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent; position: relative;
}
.mob-tab-icon { font-size: 1.3rem; line-height: 1; transition: transform 0.2s; }
.mob-tab.active { color: var(--red-400); }
.mob-tab.active .mob-tab-icon { transform: scale(1.1); }
.mob-tab.active::before {
  content: ''; position: absolute; top: 0; left: 20%; right: 20%;
  height: 2px; background: var(--red-400); border-radius: 0 0 3px 3px;
}
.mob-tab:hover { color: var(--text-secondary); }

/* More Drawer */
.mob-drawer-overlay { display: none; position: fixed; inset: 0; z-index: 290; background: rgba(0,0,0,0.7); backdrop-filter: blur(2px); }
.mob-drawer-overlay.open { display: block; }
.mob-drawer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 295;
  background: var(--bg-elevated); border-top: 1px solid var(--border);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  padding: 0.75rem 1.25rem 1.5rem;
  padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.mob-drawer.open { transform: translateY(0); }
.mob-drawer-handle { width: 36px; height: 4px; background: rgba(255,255,255,0.15); border-radius: 2px; margin: 0 auto 1.25rem; }
.mob-drawer-title { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.75rem; padding: 0 0.25rem; }
.mob-drawer-link {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.85rem; border-radius: var(--radius-md);
  color: var(--text-secondary); font-size: 0.95rem; font-weight: 500;
  text-decoration: none; transition: background 0.15s, color 0.15s;
  border: none; background: none; cursor: pointer; width: 100%; text-align: left;
}
.mob-drawer-link .mob-drawer-icon { font-size: 1.2rem; flex-shrink: 0; }
.mob-drawer-link:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.mob-drawer-link.danger { color: #f87171; }
.mob-drawer-link.danger:hover { background: rgba(239,68,68,0.1); }
.mob-drawer-divider { height: 1px; background: var(--border); margin: 0.5rem 0; }

/* ─── Consultation Mobile ─── */
@media (max-width: 768px) {
  body.consult-page { overflow: auto; }
  .consult-layout { flex-direction: column; height: auto; min-height: 100svh; }
  .consult-sidebar { display: none !important; }
  .consult-main { height: 100svh; flex-direction: column; }
  .video-grid { padding: 0.25rem; }
  .controls-bar { padding: 0.75rem 0.5rem; gap: 0.5rem; padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px)); }
  .ctrl-btn { width: 46px; height: 46px; font-size: 1.15rem; }
  .ctrl-btn.end-call { width: 54px; height: 54px; font-size: 1.3rem; }
  .pip { width: 110px; height: 80px; }
  .consult-mob-drawer {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 400;
    background: var(--bg-elevated); border-top: 1px solid var(--border);
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    max-height: 78svh; overflow-y: auto;
    transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  }
  .consult-mob-drawer.open { transform: translateY(0); }
  .consult-mob-drawer-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.65); z-index: 390; }
  .consult-mob-drawer-overlay.open { display: block; }
  .consult-mob-tray {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 350;
    background: rgba(7,7,15,0.97); backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.6rem 1rem; padding-bottom: calc(0.6rem + env(safe-area-inset-bottom, 0px));
  }
}
.consult-mob-tray { display: none; }
@media (max-width: 768px) {
  .consult-mob-tray { display: flex; }
  .consult-main .controls-bar { padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px) + 0.6rem); }
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--red-400); }

/* ─── Responsive ─── */
@media (max-width: 1024px) { .video-layout { grid-template-columns: 1fr; } .waiting-room-panel { height: 300px; } }
@media (max-width: 768px) {
  .sidebar { display: none; }
  .portal-sidebar { display: none; }
  .navbar-links { display: none; }
  .portal-content { padding: 1rem; padding-bottom: calc(70px + env(safe-area-inset-bottom) + 1rem); }
  .search-hero { flex-direction: column; }
  .search-field { border-right: none; border-bottom: 1px solid var(--border); }
  .search-field:last-of-type { border-bottom: none; }
  .profile-hero-inner { flex-direction: column; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .responsive-grid-2 { grid-template-columns: 1fr !important; }
  .mobile-bottom-nav { display: flex; flex-direction: column; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }
  .portal-layout { flex-direction: column; }
}
@media (max-width: 400px) { .kpi-grid { grid-template-columns: 1fr; } }

/* ─── Accessibility ─── */
:focus-visible { outline: 2px solid var(--red-400); outline-offset: 2px; }

/* ─── Tooltip ─── */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) scale(0.9);
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text-primary); font-size: 0.75rem; font-weight: 500;
  padding: 0.4rem 0.75rem; border-radius: var(--radius-sm);
  white-space: nowrap; pointer-events: none; opacity: 0; transition: all 0.2s; z-index: 100;
}
[data-tooltip]:hover::after { opacity: 1; transform: translateX(-50%) scale(1); }

/* ─── Utility ─── */
.text-main    { color: var(--text-primary) !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-accent  { color: var(--red-400) !important; }
.bg-card      { background: var(--bg-card); }
.rounded      { border-radius: var(--radius-lg); }
.border       { border: 1px solid var(--border); }
.w-full       { width: 100%; }
.mt-1 { margin-top: 0.5rem; }  .mt-2 { margin-top: 1rem; }  .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.p-1  { padding: 0.5rem; }  .p-2  { padding: 1rem; }  .p-3  { padding: 1.5rem; }

/* ─── Smooth image loading ─── */
img[loading="lazy"] { opacity: 0; transition: opacity 0.4s ease; }
img[loading="lazy"].loaded { opacity: 1; }
