/* ============================================
   CareNavi — Global Stylesheet
   Font: DM Sans (body) + Playfair Display (headings)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Playfair+Display:ital,wght@0,600;0,700;0,800;1,600&display=swap');

/* ── CSS Variables ─────────────────────────────── */
:root {
  --cn-nav-height: 68px;
  --cn-sticky-top: 68px;
  --primary-blue:  #0B5394;
  --primary-teal:  #00A9A5;
  --primary-green: #2E8B57;
  --navy:          #0A2342;
  --accent-gold:   #F4A623;
  --error:         #DC2626;

  --cream:         #FAF6F1;
  --cream-light:   #FDF9F5;
  --warm-white:    #FFFFFF;

  --gray-100: #F7F7F7;
  --gray-200: #E8E8E8;
  --gray-400: #9CA3AF;
  --gray-600: #6B7280;
  --gray-700: #374151;
  --gray-900: #111827;

  --shadow-sm:  0 1px 4px rgba(0,0,0,0.07);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.13);

  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  20px;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
}

/* ── Reset ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; overflow-x: hidden; }
body {
  font-family: var(--font-body);
  color: var(--gray-900);
  background: var(--cream);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a  { text-decoration: none; color: inherit; }

/* ── Typography ─────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  color: var(--gray-900);
}
h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }
p  { color: var(--gray-700); line-height: 1.7; }

/* ── Layout ─────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.section { padding: 5rem 0; }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header h2 { margin-bottom: 0.75rem; }
.section-subtitle { font-size: 1.1rem; color: var(--gray-600); max-width: 640px; margin: 0 auto; }

/* ── Grid System ─────────────────────────────────── */
.grid { display: grid; gap: 1.5rem; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 992px) {
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-cols-2, .grid-cols-3, .grid-cols-4 { grid-template-columns: 1fr; }
}

/* ── Cards ─────────────────────────────────────── */
.card {
  background: var(--warm-white);
  border: 1.5px solid #EDE4D8;
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.card-icon {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-teal));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 1.3rem;
  margin-bottom: 1.25rem;
}

/* ── Buttons ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-align: center;
  justify-content: center;
  white-space: nowrap;
  max-width: 100%;
}
.btn > span,
.btn > strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-teal));
  color: white;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(11,83,148,0.3); }
.btn-secondary {
  background: white;
  color: var(--primary-blue);
  border: 2px solid var(--primary-blue);
}
.btn-secondary:hover { background: var(--primary-blue); color: white; }
.btn-danger { background: var(--error); color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1.05rem; }
.btn-sm { padding: 0.4rem 1rem; font-size: 0.85rem; }

/* ── Badges ─────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.9rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.badge-primary { background: #DBEAFE; color: #1E40AF; }
.badge-success { background: #D1FAE5; color: #065F46; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-error   { background: #FEE2E2; color: #991B1B; }

/* ── Form Elements ─────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.4rem;
}
.form-control {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1.5px solid #D1C4B5;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--gray-900);
  background: white;
  transition: border-color 0.2s;
  outline: none;
}
.form-control:focus { border-color: var(--primary-teal); box-shadow: 0 0 0 3px rgba(0,169,165,0.15); }
textarea.form-control { resize: vertical; min-height: 120px; }

/* ── Top Bar ─────────────────────────────────────── */
.top-bar {
  background: linear-gradient(90deg, var(--primary-blue) 0%, var(--primary-teal) 100%);
  color: white;
  font-size: 0.85rem;
  padding: 0.55rem 0;
}
.top-bar a { color: white; }
.top-bar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ── Navbar ─────────────────────────────────────── */
.navbar {
  background: white;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0.75rem 0;
}
.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.logo-icon {
  width: auto;
  height: 48px;
  max-width: 130px;
  border-radius: 8px;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.logo-icon img {
  width: auto;
  height: 100%;
  max-width: 130px;
  object-fit: contain;
}
/* Hide text block when full-brand PNG is being used */
.logo-icon:has(img) ~ .logo-text { display: none; }
.logo-text { line-height: 1.2; }
.logo-text > div { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: var(--primary-blue); }
.logo-text .subtitle { font-size: 0.7rem; color: var(--gray-600); }

.nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 0.25rem;
  flex-wrap: nowrap;
  min-width: 0;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  transition: all 0.2s;
  white-space: nowrap;
  line-height: 1.2;
}
.nav-link:hover, .nav-link.active {
  color: var(--primary-blue);
  background: #EEF4FF;
}
.nav-link.emergency-link {
  color: var(--error);
  font-weight: 700;
}
.nav-link.emergency-link:hover { background: #FEE2E2; }

/* Nav dropdown (Resources) */
.nav-dropdown-item {
  position: relative;
}

.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--font-body);
  line-height: 1.2;
  margin: 0;
  min-height: 36px;
  white-space: nowrap;
}

.nav-dropdown-chevron {
  font-size: 0.6rem;
  opacity: 0.55;
  transition: transform 0.2s;
}

.nav-dropdown-item.is-open .nav-dropdown-chevron {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 200px;
  background: white;
  border: 1px solid #EDE4D8;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 0.4rem 0;
  z-index: 1050;
  animation: profileDropIn 0.18s ease;
}

.nav-dropdown-item.is-open .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  transition: background 0.15s, color 0.15s;
  min-width: 0;
  white-space: nowrap;
}

.nav-dropdown-link i {
  width: 18px;
  text-align: center;
  color: var(--primary-teal);
  font-size: 0.85rem;
}

.nav-dropdown-link:hover,
.nav-dropdown-link.active {
  background: #EEF4FF;
  color: var(--primary-blue);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.nav-signin-btn {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-teal));
  box-shadow: 0 2px 8px rgba(11, 83, 148, 0.2);
  white-space: nowrap;
}

.nav-signin-btn--user {
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 1rem;
}

.mobile-menu-btn {
  display: none;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--gray-700);
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1.5px solid #EDE4D8;
  border-radius: 12px;
  background: var(--warm-white);
  line-height: 1;
  flex-shrink: 0;
}

/* ── Profile menu (navbar) ─────────────────────── */
.nav-profile-item {
  position: relative;
  flex-shrink: 0;
  margin-left: 0.25rem;
}

.profile-container {
  position: relative;
}

.profile-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.65rem 0.35rem 0.35rem;
  border: 1.5px solid #EDE4D8;
  border-radius: 50px;
  background: var(--warm-white);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.profile-trigger:hover,
.profile-container.is-open .profile-trigger {
  border-color: var(--primary-teal);
  box-shadow: 0 2px 8px rgba(0, 169, 165, 0.15);
}

.profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-teal));
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
}

.profile-avatar i {
  font-size: 0.85rem;
}

.profile-name-text {
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-chevron {
  font-size: 0.65rem;
  opacity: 0.55;
  transition: transform 0.2s;
}

.profile-container.is-open .profile-chevron {
  transform: rotate(180deg);
}

.profile-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 260px;
  background: white;
  border: 1px solid #EDE4D8;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem 0;
  z-index: 1100;
  animation: profileDropIn 0.18s ease;
}

.profile-container.is-open .profile-dropdown-menu {
  display: block;
}

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

.profile-dropdown-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
}

.profile-dropdown-header .profile-dropdown-avatar,
.profile-dropdown-header .profile-avatar {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.profile-dropdown-meta {
  min-width: 0;
  flex: 1;
}

.profile-dropdown-header .name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--gray-900);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-dropdown-header .email {
  font-size: 0.78rem;
  color: var(--gray-600);
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-role-badge {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0.15rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary-blue);
  background: #EEF4FF;
  border-radius: 50px;
}

.profile-dropdown-divider {
  height: 1px;
  background: #EDE4D8;
  margin: 0.35rem 0;
}

.profile-dropdown-nav {
  display: flex;
  flex-direction: column;
}

.dropdown-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  transition: background 0.15s, color 0.15s;
  min-width: 0;
  white-space: nowrap;
}

.dropdown-link i {
  width: 18px;
  text-align: center;
  color: var(--primary-teal);
  font-size: 0.9rem;
}

.dropdown-link:hover {
  background: #F5FAF9;
  color: var(--primary-blue);
}

.dropdown-link-logout {
  color: var(--error) !important;
}

.dropdown-link-logout i {
  color: var(--error) !important;
}

.dropdown-link-logout:hover {
  background: #FEF2F2;
}

/* ── Guest account menu + registration ───────────── */
.account-container {
  position: relative;
  z-index: 2;
}

.account-container .profile-trigger {
  cursor: pointer;
}

.account-container.is-open .profile-chevron {
  transform: rotate(180deg);
}

.account-dropdown-menu {
  min-width: min(92vw, 380px);
  max-width: 400px;
  max-height: min(85vh, 640px);
  overflow-y: auto;
  padding-bottom: 0.75rem;
}

.account-signin-link {
  font-weight: 600;
}

.account-mobile-auth {
  display: none;
}

.account-mobile-hint {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--gray-600);
  text-align: center;
}

.account-mobile-signin,
.account-mobile-register {
  width: 100%;
  min-height: 48px;
  font-size: 0.95rem;
}

.account-reg-panel {
  padding: 0.5rem 1rem 0.25rem;
}

.account-reg-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0 0 0.2rem;
}

.account-reg-title i {
  color: var(--primary-teal);
  margin-right: 0.35rem;
}

.account-reg-sub {
  font-size: 0.75rem;
  color: var(--gray-600);
  margin: 0 0 0.75rem;
}

.account-role-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.account-role-pill {
  cursor: pointer;
}

.account-role-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.account-role-pill span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 600;
  border: 1.5px solid #EDE4D8;
  border-radius: 50px;
  color: var(--gray-600);
  background: var(--warm-white);
  transition: all 0.15s;
  white-space: nowrap;
}

.account-role-pill input:checked + span {
  border-color: var(--primary-teal);
  background: #E6FFFA;
  color: var(--primary-blue);
}

.account-reg-note {
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--gray-600);
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  margin: 0 0 0.65rem;
}

.account-reg-note.is-pending {
  background: #FFFBEB;
  border-color: #FDE68A;
  color: #92400E;
}

.account-reg-note i {
  margin-right: 0.25rem;
}

.account-reg-error {
  background: #FEE2E2;
  color: #991B1B;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.account-field {
  display: block;
  margin-bottom: 0.5rem;
}

.account-field span {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-field input,
.account-field select {
  width: 100%;
  padding: 0.45rem 0.65rem;
  border: 1.5px solid #D1C4B5;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  box-sizing: border-box;
}

.account-field input:focus,
.account-field select:focus {
  outline: none;
  border-color: var(--primary-teal);
  box-shadow: 0 0 0 2px rgba(0, 169, 165, 0.15);
}

.account-reg-submit {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
}

.account-reg-footer {
  text-align: center;
  font-size: 0.72rem;
  margin: 0.5rem 0 0;
}

.account-reg-footer a {
  color: var(--primary-blue);
  font-weight: 600;
}

.account-sheet-header {
  display: none;
}

.account-sheet-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.account-sheet-handle {
  display: none;
  width: 40px;
  height: 4px;
  background: #CBD5E1;
  border-radius: 999px;
  margin: 0 auto 0.65rem;
}

.account-sheet-body {
  display: block;
}

.account-sheet-close {
  border: none;
  background: #F1F5F9;
  color: #64748B;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.account-reg-submit .spin,
.spin {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: cn-spin 0.65s linear infinite;
  vertical-align: middle;
}

.account-container.is-open .profile-dropdown-menu {
  display: block;
}

@media (max-width: 768px) {
  .profile-name-text { display: none; }

  .profile-container:not(.account-container) .profile-dropdown-menu {
    right: 0;
    left: auto;
    min-width: min(88vw, 280px);
  }
}

/* ── Hero Section ─────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-teal) 60%, var(--primary-green) 100%);
  color: white;
  padding: 5rem 0;
  text-align: center;
  position: relative;
  overflow: visible;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.hero-content { position: relative; z-index: 2; max-width: 800px; margin: 0 auto; }
.hero h1 {
  color: white;
  margin-bottom: 1rem;
  font-size: clamp(1.85rem, 6vw, 3rem);
}
.hero p {
  font-size: clamp(0.95rem, 2.5vw, 1.15rem);
  color: rgba(255,255,255,0.9);
  margin-bottom: 2rem;
}
.hero-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* App page hero (dashboard, loyalty, settings) */
.page-hero {
  background: linear-gradient(135deg, #0B5394 0%, #00A9A5 65%, #2E8B57 100%);
  padding: 2.25rem 0 2.75rem;
  color: #fff;
}
.page-hero--green {
  background: linear-gradient(135deg, #065F46 0%, #059669 65%, #10B981 100%);
}
.page-hero-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  margin-bottom: 0.75rem;
}
.page-hero-back:hover { color: #fff; }
.page-hero h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 0 0 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.28);
}
.page-hero h1 i { opacity: 0.95; color: #fff; }
.page-hero p {
  margin: 0;
  font-size: 0.95rem;
  max-width: 720px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.92);
}
.page-hero p a {
  color: #fff;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Dark gradient headers — override global heading/body colours */
.hero,
[class$="-hero"],
.page-hero,
.dash-hero,
.page-header,
.stats-section,
.section-dark-header {
  color: #fff;
}

.hero h1, .hero h2, .hero h3, .hero h4,
[class$="-hero"] h1, [class$="-hero"] h2, [class$="-hero"] h3, [class$="-hero"] h4,
.page-hero h1, .page-hero h2, .page-hero h3, .page-hero h4,
.dash-hero h1, .dash-hero h2, .dash-hero h3, .dash-hero h4,
.page-header h1, .page-header h2, .page-header h3, .page-header h4,
.stats-section h1, .stats-section h2, .stats-section h3, .stats-section h4,
.section-dark-header h1, .section-dark-header h2, .section-dark-header h3, .section-dark-header h4 {
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.28);
}

.hero p,
[class$="-hero"] p,
.page-hero p,
.dash-hero p,
.page-header p,
.stats-section p,
.section-dark-header p {
  color: rgba(255, 255, 255, 0.92);
}

.page-hero a:not(.btn):not(.badge),
[class$="-hero"] a:not(.btn):not(.badge),
.dash-hero a:not(.btn):not(.badge) {
  color: rgba(255, 255, 255, 0.9);
}

/* ── Stats Section ─────────────────────────────── */
.stats-section {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-teal) 100%);
  padding: 4rem 0;
  color: white;
}
.stat-item { text-align: center; }
.stat-number {
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 800;
  color: white;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 0.9rem; color: rgba(255,255,255,0.8); margin-top: 0.4rem; }

/* ── Footer ─────────────────────────────────────── */
.footer {
  background: #0F2342;
  color: rgba(255, 255, 255, 0.92);
  padding: 4rem 0 0;
}
.footer p,
.footer li,
.footer-bottom p {
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.65;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem; margin-bottom: 3rem; }
.footer-section h3 { color: #fff; font-size: 1rem; margin-bottom: 1.25rem; font-weight: 700; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 0.6rem; font-size: 0.9rem; color: rgba(255, 255, 255, 0.9); }
.footer-links a { color: rgba(255, 255, 255, 0.92); transition: color 0.2s; }
.footer-links a:hover { color: var(--primary-teal); }
.footer-links i { color: var(--primary-teal); margin-right: 0.4rem; width: 1rem; text-align: center; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.85);
}
.footer-bottom a { color: #7eece8; font-weight: 600; }
.footer-bottom a:hover { color: #fff; }
.social-links { display: flex; gap: 0.75rem; margin-top: 1rem; }
.social-link {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 0.85rem;
  transition: background 0.2s;
}
.social-link:hover { background: var(--primary-teal); }

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* ── Utility Classes ─────────────────────────────── */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.text-center { text-align: center; }
.mt-2 { margin-top: 0.75rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.75rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ── Alert / Notification Boxes ─────────────────── */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.95rem;
  display: flex; align-items: flex-start; gap: 0.75rem;
}
.alert-success { background: #D1FAE5; color: #065F46; border-left: 4px solid #10B981; }
.alert-error   { background: #FEE2E2; color: #991B1B; border-left: 4px solid #EF4444; }
.alert-info    { background: #DBEAFE; color: #1E40AF; border-left: 4px solid #3B82F6; }

/* ── Doctor / Profile Cards ─────────────────────── */
.doctor-card {
  background: white;
  border: 1.5px solid #EDE4D8;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.doctor-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.doctor-avatar {
  width: 100%; height: 220px;
  object-fit: cover;
  background: linear-gradient(135deg, #E0F2FE, #BAE6FD);
  display: flex; align-items: center; justify-content: center;
  font-size: 4rem;
  color: var(--primary-blue);
}
.doctor-body { padding: 1.25rem; }
.doctor-name { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; margin-bottom: 0.2rem; }
.doctor-specialty { color: var(--primary-teal); font-size: 0.875rem; font-weight: 600; margin-bottom: 0.4rem; }
.doctor-meta { font-size: 0.82rem; color: var(--gray-600); margin-bottom: 0.2rem; }
.star-rating { color: #F59E0B; font-size: 0.85rem; }

/* ── Tabs ─────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0.25rem;
  background: white;
  border: 1.5px solid #EDE4D8;
  border-radius: 50px;
  padding: 0.35rem;
  width: fit-content;
  margin-bottom: 2rem;
}
.tab-btn {
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--gray-600);
  transition: all 0.2s;
  font-family: var(--font-body);
}
.tab-btn.active {
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-teal));
  color: white;
  box-shadow: 0 2px 8px rgba(11,83,148,0.25);
}

/* ── FAQ Accordion ─────────────────────────────── */
.faq-item {
  background: white;
  border: 1.5px solid #EDE4D8;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.faq-question {
  padding: 1.1rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--gray-900);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: background 0.15s;
  font-family: var(--font-body);
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}
.faq-question:hover { background: var(--cream); }
.faq-icon { font-size: 1.2rem; color: var(--primary-blue); flex-shrink: 0; transition: transform 0.2s; }
.faq-question.open .faq-icon { transform: rotate(45deg); }
.faq-answer {
  display: none;
  padding: 0 1.25rem 1.1rem;
  color: var(--gray-700);
  font-size: 0.95rem;
  line-height: 1.7;
  border-top: 1px solid #F0EAE2;
}
.faq-answer.visible { display: block; }

/* ── Loading Spinner ─────────────────────────────── */
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  vertical-align: middle; margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Animations ─────────────────────────────────── */
.fade-in-up {
  opacity: 0;
  transform: translateY(24px);
  animation: fadeInUp 0.55s ease forwards;
}
@keyframes fadeInUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ── Search autocomplete ─────────────────────────── */
.cn-search-ac-wrap {
  position: relative;
}
.cn-search-ac-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.45rem);
  background: #fff;
  border-radius: 16px;
  border: 1px solid #E2E8F0;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
  overflow: hidden;
  z-index: 120;
  text-align: left;
  max-height: min(420px, 70vh);
  overflow-y: auto;
}
.cn-search-ac-suggest[hidden] { display: none !important; }
.cn-search-ac-head {
  padding: 0.55rem 0.9rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
  background: #FAFAF8;
  border-bottom: 1px solid #F0EAE2;
  position: sticky;
  top: 0;
  z-index: 1;
}
.cn-search-ac-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  text-decoration: none;
  color: var(--gray-900);
  border-bottom: 1px solid #F8F4EF;
  transition: background 0.15s;
  cursor: pointer;
  min-width: 0;
}
.cn-search-ac-item:last-of-type { border-bottom: none; }
.cn-search-ac-item:hover,
.cn-search-ac-item.is-active {
  background: rgba(0, 169, 165, 0.08);
}
.cn-search-ac-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
}
.cn-search-ac-icon.doctor { background: rgba(11, 83, 148, 0.1); color: #0B5394; }
.cn-search-ac-icon.facility { background: rgba(0, 169, 165, 0.12); color: #00A9A5; }
.cn-search-ac-icon.insurance { background: rgba(16, 185, 129, 0.12); color: #059669; }
.cn-search-ac-icon.emergency { background: rgba(220, 38, 38, 0.12); color: #DC2626; }
.cn-search-ac-icon.phrase { background: rgba(245, 158, 11, 0.12); color: #D97706; }
.cn-search-ac-icon.specialty { background: rgba(99, 102, 241, 0.12); color: #4F46E5; }
.cn-search-ac-icon.condition { background: rgba(11, 83, 148, 0.12); color: #0B5394; }
.cn-search-ac-item > div:last-child { min-width: 0; }
.cn-search-ac-label {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--navy);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cn-search-ac-meta {
  font-size: 0.78rem;
  color: var(--gray-600);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cn-search-ac-all {
  display: block;
  padding: 0.75rem 0.9rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #0B5394;
  text-decoration: none;
  background: #F8FAFC;
  border-top: 1px solid #F0EAE2;
}
.cn-search-ac-all:hover { background: rgba(11, 83, 148, 0.06); }

/* ── Mobile ─────────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --cn-nav-height: 58px;
    --cn-sticky-top: 58px;
  }

  .container {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .navbar {
    padding: 0.5rem 0;
  }

  .nav-container {
    position: relative;
    gap: 0.5rem;
    flex-wrap: nowrap;
  }

  .logo {
    min-width: 0;
    flex: 1 1 auto;
  }

  .logo-icon {
    height: 40px;
    max-width: 100px;
  }

  .logo-icon img {
    max-width: 100px;
  }

  .logo-text > div {
    font-size: 0.95rem;
  }

  .logo-text .subtitle {
    display: none;
  }

  .nav-signin-btn {
    display: inline-flex;
  }

  .nav-menu { display: none; }
  .nav-menu.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--cn-nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    padding: 0.85rem max(1rem, env(safe-area-inset-right)) 1.5rem max(1rem, env(safe-area-inset-left));
    box-shadow: none;
    z-index: 1035;
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0;
    border: none;
    border-top: 1px solid #EDE4D8;
  }

  body.cn-nav-open {
    overflow: hidden;
  }

  .nav-menu .nav-link,
  .nav-menu .nav-dropdown-trigger {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 48px;
    padding: 0.7rem 0.85rem;
    font-size: 1rem;
    border-radius: 10px;
  }

  .nav-profile-item { width: 100%; margin-top: 0.35rem; padding-top: 0.35rem; border-top: 1px solid #EDE4D8; }
  .account-container,
  .profile-container { width: 100%; }
  .account-container .profile-trigger,
  .profile-container .profile-trigger {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }

  /* Guest account: bottom sheet (not inline in nav drawer) */
  body.cn-account-sheet-open {
    overflow: hidden;
  }

  body.cn-account-sheet-open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(15, 35, 66, 0.55);
    z-index: 1040;
    pointer-events: auto;
  }

  .account-container {
    position: static;
  }

  .account-container.is-open .account-dropdown-menu {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0 !important;
    right: 0 !important;
    bottom: 0;
    top: auto;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    max-height: min(92vh, 100dvh);
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -12px 48px rgba(15, 35, 66, 0.22);
    z-index: 1050;
    overflow: hidden;
    animation: accountSheetUp 0.32s cubic-bezier(0.34, 1.2, 0.64, 1);
  }

  @keyframes accountSheetUp {
    from { transform: translateY(100%); opacity: 0.6; }
    to { transform: translateY(0); opacity: 1; }
  }

  .account-sheet-header {
    display: block;
    padding: 0.65rem 1rem 0.5rem;
    border-bottom: 1px solid #F0EAE2;
    flex-shrink: 0;
  }

  .account-sheet-handle {
    display: block;
  }

  .account-sheet-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .account-sheet-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0F2342;
  }

  .account-sheet-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 0 calc(1rem + env(safe-area-inset-bottom));
  }

  .account-mobile-auth {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.85rem 1rem 0.75rem;
    border-bottom: 1px solid #F0EAE2;
  }

  .account-signin-link--desktop,
  .account-divider--desktop {
    display: none !important;
  }

  .account-reg-panel--desktop {
    display: block !important;
    padding: 0.75rem 1rem 0.5rem;
  }

  .account-role-pills {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
  }

  .account-role-pill span {
    min-height: 44px;
    padding: 0.5rem 0.45rem;
    font-size: 0.72rem;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
  }

  .account-role-pill span i {
    display: block;
    margin: 0 auto 0.2rem;
    font-size: 0.9rem;
  }

  .account-reg-note {
    font-size: 0.78rem;
    line-height: 1.45;
    word-wrap: break-word;
  }

  .account-field input,
  .account-field select {
    font-size: 16px;
    min-height: 48px;
  }

  .account-reg-submit {
    min-height: 48px;
    width: 100%;
  }

  .profile-container:not(.account-container) .profile-dropdown-menu {
    position: static;
    display: none;
    min-width: 100%;
    max-width: none;
    max-height: none;
    box-shadow: none;
    border: 1px solid #EDE4D8;
    margin-top: 0.5rem;
    border-radius: 12px;
  }

  .profile-container.is-open .profile-dropdown-menu {
    display: block;
  }

  .account-container.is-open .profile-chevron {
    transform: rotate(180deg);
  }

  .nav-dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    padding: 0 0 0 0.75rem;
    margin-top: 0.25rem;
    display: none;
  }

  .nav-dropdown-item.is-open .nav-dropdown-menu { display: block; }
  .nav-dropdown-link {
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    min-height: 44px;
  }

  .mobile-menu-btn { display: inline-flex; align-items: center; justify-content: center; }

  .hero { padding: 2.5rem 0 3rem; }
  .hero-buttons { flex-direction: column; align-items: stretch; }
  .hero-buttons .btn { width: 100%; min-height: 48px; }
  .section { padding: 2.75rem 0; }
  .section-header { margin-bottom: 2rem; }
  .section-header h2 { font-size: clamp(1.45rem, 5vw, 2rem); }

  .top-bar-content > div:last-child { display: none; }

  .top-bar-content {
    flex-wrap: wrap;
    gap: 0.35rem;
    font-size: 0.78rem;
  }

  .top-bar-content .flex.items-center.gap-4 > div:last-child {
    display: none;
  }

  .stats-section { padding: 2.5rem 0; }
  .stat-number { font-size: clamp(1.6rem, 5vw, 2.2rem); }

  .page-hero {
    padding: 1.35rem 0 1.5rem;
  }

  .page-hero h1 {
    font-size: clamp(1.35rem, 5vw, 1.65rem);
  }

  .page-hero p {
    font-size: 0.88rem;
  }

  /* Shared search bars (home hero, search page, find care) */
  .hero-search,
  .sr-form {
    flex-direction: column;
    align-items: stretch !important;
    border-radius: 18px !important;
    padding: 0.75rem !important;
    gap: 0.65rem !important;
  }

  .hero-search > i,
  .sr-form > i {
    display: none;
  }

  .hero-search input,
  .sr-form input[type="search"],
  .sr-form input[type="text"] {
    width: 100%;
    flex: 1 1 auto !important;
    font-size: 16px !important;
    min-height: 48px;
    padding: 0.75rem 1rem !important;
    border-radius: 12px !important;
    background: #fff !important;
    border: 1.5px solid #E2E8F0 !important;
  }

  .hero-search .btn,
  .sr-form .btn {
    width: 100%;
    flex: 1 1 auto;
    min-height: 48px;
    border-radius: 12px !important;
  }

  .hero-search-wrap,
  .cn-search-ac-wrap {
    margin-top: 1.25rem;
  }

  .cn-search-ac-suggest {
    position: relative;
    top: 0.35rem;
    left: auto;
    right: auto;
    max-height: 50vh;
  }

  .sr-panel {
    padding: 0.85rem !important;
  }

  .sr-hints {
    justify-content: center;
  }

  .sr-hints li {
    font-size: 0.72rem;
  }
}

@media (max-width: 480px) {
  .logo-icon {
    height: 36px;
    max-width: 88px;
  }

  .logo-icon img {
    max-width: 88px;
  }

  .nav-signin-btn span {
    display: none;
  }

  .nav-signin-btn:not(.nav-signin-btn--user) {
    width: 44px;
    padding: 0;
  }

  .trust-items {
    gap: 0.75rem 1.25rem;
    justify-content: flex-start;
  }

  .trust-item {
    font-size: 0.78rem;
  }

  .btn {
    min-height: 44px;
  }
}

/* ── User dashboard (mobile-first) ───────────────── */
.dash-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.75rem;
  align-items: start;
}

.dash-sidebar {
  background: white;
  border-radius: var(--radius-md);
  border: 1.5px solid #EDE4D8;
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
}

.dash-card {
  background: white;
  border-radius: var(--radius-md);
  border: 1.5px solid #EDE4D8;
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
  margin-bottom: 1.25rem;
}

.dash-card--flush {
  padding: 0;
  overflow: hidden;
}

.dash-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid #F0EAE2;
  background: linear-gradient(180deg, #FAFAF8, #fff);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dash-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.dash-quick-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid #EDE4D8;
  text-decoration: none;
  color: var(--gray-700);
  font-size: 0.875rem;
  font-weight: 600;
  background: white;
  transition: transform 0.15s, box-shadow 0.15s;
}

.dash-quick-item:active {
  transform: scale(0.98);
}

.dash-quick-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.dash-notif-item {
  display: flex;
  gap: 0.85rem;
  padding: 0.95rem 1.5rem;
  border-bottom: 1px solid #F8F4EF;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}

.dash-notif-item.unread {
  background: rgba(11, 83, 148, 0.04);
}

.dash-mobile-stats {
  display: none;
  margin-top: -2.25rem;
  margin-bottom: 1rem;
  position: relative;
  z-index: 2;
}

.dash-stat-pill {
  flex: 1;
  min-width: 0;
  background: white;
  border-radius: 14px;
  border: 1.5px solid #EDE4D8;
  box-shadow: var(--shadow-sm);
  padding: 0.85rem 0.65rem;
  text-align: center;
  text-decoration: none;
  color: inherit;
  position: relative;
}

.dash-stat-pill i {
  font-size: 1.15rem;
  color: var(--primary-teal);
  display: block;
  margin-bottom: 0.35rem;
}

.dash-stat-pill strong {
  display: block;
  font-size: 1.15rem;
  color: var(--navy);
  line-height: 1.1;
}

.dash-stat-pill span {
  font-size: 0.68rem;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.dash-stat-badge {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  background: #EF4444;
  color: white;
  font-size: 0.62rem;
  font-weight: 800;
  min-width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.25rem;
}

.dash-stat-badge[hidden] {
  display: none;
}

.dash-tab-bar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1020;
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid #EDE4D8;
  padding: 0.35rem max(0.5rem, env(safe-area-inset-right)) calc(0.45rem + env(safe-area-inset-bottom)) max(0.5rem, env(safe-area-inset-left));
  box-shadow: 0 -4px 24px rgba(15, 35, 66, 0.08);
  backdrop-filter: blur(10px);
}

.dash-tab-bar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: 52px;
  text-decoration: none;
  color: var(--gray-600);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: 10px;
  position: relative;
}

.dash-tab-bar a i {
  font-size: 1.15rem;
}

.dash-tab-bar a.is-active {
  color: var(--primary-blue);
  background: rgba(11, 83, 148, 0.06);
}

.dash-tab-badge {
  position: absolute;
  top: 0.35rem;
  right: calc(50% - 1.1rem);
  background: #EF4444;
  color: white;
  font-size: 0.55rem;
  font-weight: 800;
  min-width: 1rem;
  height: 1rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.2rem;
}

.dash-tab-badge[hidden] {
  display: none;
}

body.cn-dash-mobile {
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}

@media (max-width: 768px) {
  .dash-hero {
    padding: 1.35rem 0 3.25rem !important;
  }

  .dash-hero > .container > div {
    gap: 0.85rem !important;
  }

  .dash-hero h1 {
    font-size: 1.25rem !important;
  }

  .dash-section {
    margin-top: -2.5rem !important;
    padding-bottom: 1rem;
  }

  .dash-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .dash-sidebar {
    display: none;
  }

  .dash-mobile-stats {
    display: flex;
    gap: 0.55rem;
  }

  .dash-tab-bar {
    display: flex;
  }

  .dash-quick-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.55rem;
  }

  .dash-quick-item {
    flex-direction: column;
    text-align: center;
    padding: 0.85rem 0.5rem;
    font-size: 0.72rem;
    gap: 0.45rem;
  }

  .dash-quick-icon {
    width: 44px;
    height: 44px;
  }

  .dash-card {
    padding: 1.15rem;
  }

  .dash-card-head {
    padding: 0.95rem 1.15rem;
  }

  .dash-notif-item {
    padding: 0.85rem 1.15rem;
  }

  .dash-card .btn-lg {
    width: 100%;
    justify-content: center;
  }
}

/* ── Realtime alerts (calls + chat toasts) ───────── */
.cn-toast-stack {
  position: fixed;
  top: calc(var(--cn-nav-height, 64px) + 0.65rem);
  right: max(0.75rem, env(safe-area-inset-right));
  left: max(0.75rem, env(safe-area-inset-left));
  z-index: 10050;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  pointer-events: none;
  max-width: 420px;
  margin-left: auto;
}

.cn-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem;
  background: white;
  border-radius: 14px;
  border: 1.5px solid #EDE4D8;
  box-shadow: 0 10px 32px rgba(15, 35, 66, 0.14);
  transform: translateY(-12px);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.cn-toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.cn-toast.is-leaving {
  transform: translateY(-8px);
  opacity: 0;
}

.cn-toast-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.12);
  color: #6366F1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cn-toast--chat .cn-toast-icon {
  background: rgba(11, 83, 148, 0.1);
  color: #0B5394;
}

.cn-toast-body {
  flex: 1;
  min-width: 0;
}

.cn-toast-body strong {
  display: block;
  font-size: 0.88rem;
  color: var(--navy);
  margin-bottom: 0.15rem;
}

.cn-toast-body p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--gray-600);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.cn-toast-close {
  border: none;
  background: transparent;
  color: var(--gray-500);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

.cn-incoming-overlay {
  position: fixed;
  inset: 0;
  z-index: 10060;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.cn-incoming-overlay[hidden] {
  display: none !important;
}

.cn-incoming-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 35, 66, 0.72);
  backdrop-filter: blur(6px);
}

.cn-incoming-card {
  position: relative;
  z-index: 1;
  width: min(100%, 380px);
  background: white;
  border-radius: 24px;
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
  animation: cn-call-pop 0.35s ease;
}

@keyframes cn-call-pop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.cn-incoming-overlay.is-ringing .cn-incoming-pulse {
  animation: cn-call-pulse 1.4s ease-in-out infinite;
}

@keyframes cn-call-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 169, 165, 0.45); }
  50% { transform: scale(1.06); box-shadow: 0 0 0 18px rgba(0, 169, 165, 0); }
}

.cn-incoming-pulse {
  width: 96px;
  height: 96px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(11, 83, 148, 0.12), rgba(0, 169, 165, 0.18));
  display: flex;
  align-items: center;
  justify-content: center;
}

.cn-incoming-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0B5394, #00A9A5);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
}

.cn-incoming-label {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-teal);
  font-weight: 700;
}

.cn-incoming-name {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  color: var(--navy);
}

.cn-incoming-hint {
  margin: 0 0 1.5rem;
  font-size: 0.82rem;
  color: var(--gray-600);
}

.cn-incoming-actions {
  display: flex;
  gap: 0.75rem;
}

.cn-inc-btn {
  flex: 1;
  border: none;
  border-radius: 999px;
  padding: 0.85rem 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.78rem;
  min-height: 72px;
  justify-content: center;
}

.cn-inc-btn i {
  font-size: 1.25rem;
}

.cn-inc-btn--decline {
  background: #FEE2E2;
  color: #991B1B;
}

.cn-inc-btn--accept {
  background: linear-gradient(135deg, #0B5394, #00A9A5);
  color: white;
}

body.cn-call-active {
  overflow: hidden;
}

@media (max-width: 768px) {
  .cn-incoming-overlay {
    padding: 0;
    align-items: stretch;
  }

  .cn-incoming-card {
    width: 100%;
    max-width: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100%;
    padding: max(2rem, env(safe-area-inset-top)) 1.5rem max(2rem, env(safe-area-inset-bottom));
  }

  .cn-incoming-actions {
    margin-top: auto;
    padding-top: 2rem;
  }

  .cn-toast-stack {
    top: calc(var(--cn-nav-height, 58px) + 0.45rem);
    left: max(0.65rem, env(safe-area-inset-left));
    right: max(0.65rem, env(safe-area-inset-right));
    max-width: none;
  }
}
