/* ====== TASHKHEESA.COM - PROFESSIONAL MEDICAL REDESIGN ====== */
/* Designed for trust, clarity, and accessibility */


:root {
  /* ====== PRIMARY COLOR SYSTEM (Blue-Focused, Premium Healthcare) ====== */
  --primary: #0066CC;
  --primary-hover: #0052A3;
  --primary-light: #E6F0FF;
  --primary-ultra-light: #F0F7FF;
  --primary-dark: #003D7A;

  /* Backwards-compatible aliases */
  --bg: #F9FAFB;
  --text: #1F2937;
  --muted: #6B7280;
  --border: #E5E7EB;
  --radius: 0.75rem;
  --shadow: 0 14px 30px rgba(0, 102, 204, 0.14);
  --container: 1200px;

  /* Medical Professional Color Palette */
  --primary-blue: #0066CC;
  --primary-blue-dark: #0052A3;
  --primary-blue-light: #E6F0FF;
  --trust-blue: #0066CC;
  --trust-teal: #0d9488;
  --trust-teal-light: #ccfbf1;
  --accent-green: #00B366;
  --alert-red: #DC2626;

  /* Secondary Blue (Accents) */
  --secondary-blue: #1E40AF;
  --accent-blue: #2563EB;

  /* Semantic Colors */
  --color-success: #00B366;
  --color-warning: #F59E0B;
  --color-danger: #DC2626;
  --color-info: #0066CC;

  /* Neutrals for medical credibility */
  --neutral-white: #ffffff;
  --neutral-offwhite: #F9FAFB;
  --neutral-light: #F3F4F6;
  --neutral-gray: #9CA3AF;
  --neutral-dark: #6B7280;
  --neutral-black: #1F2937;

  /* Typography - Medical Professional Fonts */
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-arabic: 'Noto Sans Arabic', sans-serif;

  /* Font sizes with perfect readability */
  --text-xs: 0.75rem;     /* 12px */
  --text-sm: 0.875rem;    /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg: 1.125rem;    /* 18px */
  --text-xl: 1.25rem;     /* 20px */
  --text-2xl: 1.5rem;     /* 24px */
  --text-3xl: 2rem;       /* 32px */
  --text-4xl: 2.5rem;     /* 40px */

  /* Spacing System (8px baseline) */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-24: 6rem;     /* 96px */

  /* Shadows (depth system) */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-focus: 0 0 0 3px rgba(0, 102, 204, 0.15);

  /* Border Radius */
  --radius-sm: 0.375rem;  /* 6px */
  --radius: 0.5rem;       /* 8px */
  --radius-lg: 0.75rem;   /* 12px */
  --radius-xl: 1rem;      /* 16px */
  --radius-2xl: 1.5rem;   /* 24px */

  /* Transitions (smooth, professional) */
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-very-fast: 100ms var(--ease-out);
  --transition-fast: 150ms var(--ease-out);
  --transition: 250ms var(--ease-out);
  --transition-slow: 350ms var(--ease-out);

  /* Container */
  --container-max: 1200px;
  --container-padding: clamp(1rem, 5vw, 2rem);
}

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

html {
  scroll-behavior: smooth;
  font-size: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--neutral-black);
  background: linear-gradient(180deg, var(--primary-ultra-light) 0%, #ffffff 70%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ====== GLOBAL SMOOTH TRANSITIONS ====== */
a {
  transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
}

button,
[type="button"],
[type="submit"],
[type="reset"],
.btn {
  transition: all var(--transition);
}

input,
select,
textarea {
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--neutral-black);
  margin-bottom: var(--space-4);
}

h1 {
  font-size: var(--text-4xl);
  font-weight: 800;
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: -0.01em;
}

h3 {
  font-size: var(--text-2xl);
  font-weight: 600;
}

h4 {
  font-size: var(--text-xl);
  font-weight: 600;
}

h5 {
  font-size: var(--text-lg);
  font-weight: 600;
}

h6 {
  font-size: var(--text-base);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--trust-teal);
}

p {
  margin-bottom: var(--space-4);
  color: var(--neutral-dark);
}

strong {
  font-weight: 600;
  color: var(--neutral-black);
}

/* Arabic text support */
.arabic-text {
  font-family: var(--font-arabic);
  direction: rtl;
}

/* ====== LAYOUT CONTAINERS ====== */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* Hero needs full width */
.container-full {
  width: 100%;
}

/* Section spacing */

.section-sm {
  padding: var(--space-12) 0;
}

.section-lg {
  padding: var(--space-16) 0;
}

.section-xl {
  padding: var(--space-24) 0;
}

/* ====== HEADER & NAVIGATION ====== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--neutral-white);
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  z-index: 1000;
}
/* Remove skip-to-content link */
.skip-link { display: none !important; }

.header-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Logo/Brand */
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--neutral-black);
  min-width: 160px;
}

.logo-wrap {
  height: 40px;
  width: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary-blue-light), #ffffff);
  border: 1px solid var(--neutral-light);
}

/* Header logo — primary control (single source of truth) */
.brand-logo-img {
  height: 44px;              /* desktop default */
  width: auto;
  max-width: 260px;          /* allow horizontal logo */
  object-fit: contain;
  display: block;
}

/* Tablet */
@media (max-width: 1024px) {
  .brand-logo-img {
    height: 40px;
    max-width: 220px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .brand-logo-img {
    height: 36px;
    max-width: 200px;
  }
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-text strong {
  font-size: 16px;
  font-weight: 800;
  color: var(--neutral-black);
  margin: 0;
}

.brand-text span {
  font-size: 12px;
  font-weight: 600;
  color: var(--neutral-dark);
}

/* Navigation */
.main-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Dark mode removed: hide any leftover toggle button */
.theme-toggle { display: none !important; }


.nav-list {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 10px;
  white-space: nowrap;
  transition: color var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast);
}

.nav-link:hover {
  background: var(--primary-ultra-light);
  color: var(--primary);
}

/* Primary CTA (Start Order) */
.nav-cta,
.nav-link.nav-cta {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: var(--neutral-white);
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.25);
  transition: all var(--transition);
}

.nav-cta:hover,
.nav-link.nav-cta:hover {
  color: var(--neutral-white);
  background: linear-gradient(135deg, var(--primary-hover), var(--primary-dark));
  box-shadow: 0 6px 16px rgba(0, 102, 204, 0.35);
  transform: translateY(-1px);
}

/* ====== NAV DROPDOWN ====== */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  cursor: pointer;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--neutral-white);
  border: 1px solid var(--neutral-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 240px;
  padding: var(--space-2);
  flex-direction: column;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
  display: flex;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-menu a {
  padding: var(--space-3) var(--space-4);
  text-decoration: none;
  color: var(--neutral-dark);
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.nav-dropdown-menu a:hover {
  background: var(--primary-ultra-light);
  color: var(--primary);
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--neutral-light);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  color: var(--neutral-dark);
}

@media (max-width: 768px) {
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .main-nav {
    position: fixed;
    top: 76px;
    left: 0;
    right: 0;
    background: var(--neutral-white);
    padding: var(--space-4);
    border-bottom: 1px solid var(--neutral-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-110%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
  }

  .main-nav.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-list {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .nav-link {
    width: 100%;
    justify-content: space-between;
  }

  .nav-dropdown-menu {
    position: static;
    box-shadow: none;
    border: 1px solid var(--neutral-light);
    margin-top: 6px;
  }
}

/* Ensure page content clears the fixed header */
body {
  padding-top: 76px;
}

/* Portal/Auth layouts should NOT inherit the public fixed-header offset */
body.layout-portal,
body.layout-auth {
  padding-top: 0;
}

/* ====== HERO SECTION ====== */
/* ====== HERO SECTION ====== */
.hero-section {
  padding-top: 120px;
  padding-bottom: var(--space-24);
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  position: relative;
  overflow: hidden;
}

.hero-section * {
  color: #0f172a !important;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--primary-blue-light), transparent 70%);
  opacity: 0.3;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-content {
  max-width: 560px;
}

.hero-title {
  font-size: clamp(var(--text-3xl), 5vw, var(--text-4xl));
  margin-bottom: var(--space-6);
  color: #0f172a;
}

.hero-subtitle {
  font-size: var(--text-lg);
  color: #334155;
  margin-bottom: var(--space-8);
  max-width: 480px;
}

.hero-features {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.feature-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--neutral-white);
  border: 1px solid var(--neutral-light);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--neutral-dark);
  box-shadow: var(--shadow-sm);
}

.feature-tag::before {
  content: '✓';
  color: var(--accent-green);
  font-weight: bold;
}

.hero-image {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-image img,
.medical-illustration {
  width: 100%;
  max-width: 460px;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
}
/* Hero logo placeholder (temporary visual) */
.hero-logo-placeholder{
  max-width: 360px;
  width: 100%;
  height: auto;
  margin: 0 auto;
  display: block;
  filter: drop-shadow(0 12px 24px rgba(15,23,42,0.15));
}

@media (max-width: 1024px){
  .hero-logo-placeholder{ max-width: 300px; }
}

@media (max-width: 768px){
  .hero-logo-placeholder{ max-width: 240px; }
}

@media (max-width: 1024px) {
  .hero-image img,
  .medical-illustration {
    max-width: 380px;
  }
}

@media (max-width: 768px) {
  .hero-image img,
  .medical-illustration {
    max-width: 300px;
  }
}


/* Logo variants */
.logo-full {
  filter: none;
  display: block;
}
.logo-white {
  filter: brightness(0) invert(1);
  display: none;
}
.logo-mono-blue { 
  filter: grayscale(1) sepia(1) hue-rotate(190deg) saturate(4); 
}



/* ====== PROCESS SECTION ====== */
.process-section {
  background: var(--neutral-white);
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-16);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--neutral-dark);
  margin-bottom: var(--space-8);
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-8);
  margin-top: var(--space-12);
}

.process-card {
  text-align: center;
  padding: var(--space-8);
  background: var(--neutral-offwhite);
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  position: relative;
}

.process-card::before {
  content: attr(data-step);
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  background: var(--trust-blue);
  color: var(--neutral-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-lg);
  box-shadow: var(--shadow-md);
}

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

.process-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto var(--space-4);
  background: linear-gradient(135deg, var(--primary-blue-light), white);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--trust-blue);
}

/* ====== SERVICES SECTION ====== */
.services-section {
  background: var(--neutral-offwhite);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-6);
  margin-top: var(--space-8);
}

.service-card {
  background: var(--neutral-white);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  border: 1px solid var(--neutral-light);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  height: 100%;
}

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

.service-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--trust-teal-light), white);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
  color: var(--trust-teal);
  font-size: 1.25rem;
}

.service-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.service-price {
  display: block;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--trust-teal);
  margin: var(--space-4) 0;
}

.service-features {
  list-style: none;
  margin: var(--space-4) 0;
  padding: 0;
  flex-grow: 1;
}

.service-features li {
  padding: var(--space-2) 0;
  color: var(--neutral-dark);
  display: flex;
  align-items: center;
}

.service-features li::before {
  content: '•';
  color: var(--trust-blue);
  font-weight: bold;
  margin-right: var(--space-2);
}

/* ====== FAQ SECTION ====== */
.faq-section {
  background: var(--neutral-white);
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-6);
  max-width: 800px;
  margin: var(--space-8) auto 0;
}

.faq-item {
  background: var(--neutral-offwhite);
  border-radius: var(--radius);
  padding: var(--space-6);
  border: 1px solid var(--neutral-light);
  transition: border-color var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast);
}

.faq-item:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
}

/* ====== ABOUT & CONTACT ====== */
.about-section {
  background: linear-gradient(135deg, var(--neutral-offwhite) 0%, #f0f9ff 100%);
}

.contact-section {
  background: var(--neutral-white);
}

.contact-form {
  max-width: 500px;
  margin: var(--space-8) auto 0;
}

/* ====== BUTTONS ====== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  min-height: 44px; /* WCAG touch target */
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: var(--neutral-white);
  box-shadow: 0 8px 20px rgba(0, 102, 204, 0.25);
  border-radius: var(--radius-sm);
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 28px rgba(0, 102, 204, 0.35);
  text-decoration: none;
  color: var(--neutral-white);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.2);
}

.btn-secondary {
  background: var(--neutral-white);
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-secondary:hover {
  background: var(--primary);
  color: var(--neutral-white);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 102, 204, 0.2);
}

.btn-secondary:active {
  transform: translateY(0) scale(0.98);
}

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

.btn-danger:hover {
  background: #B91C1C;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 20px rgba(220, 38, 38, 0.25);
}

.btn-success {
  background: var(--color-success);
  color: var(--neutral-white);
}

.btn-success:hover {
  background: #009952;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 179, 102, 0.25);
}

.btn-large {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
  border-radius: var(--radius-lg);
}

.btn-full {
  width: 100%;
}

/* ====== FORM ELEMENTS ====== */
.form-group {
  margin-bottom: var(--space-6);
}

.form-label {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: 500;
  color: var(--neutral-dark);
}

/* Updated .form-control for improved readability and dropdown contrast */
.form-control {
  width: 100%;
  padding: 10px 12px;
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--neutral-black);
  background-color: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  background-color: #ffffff;
  box-shadow: var(--shadow-focus);
}

.form-control.is-error,
.form-control:invalid:not(:placeholder-shown) {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-control.is-success {
  border-color: var(--color-success);
  box-shadow: 0 0 0 3px rgba(0, 179, 102, 0.1);
}

select.form-control option {
  color: #0f172a;
  background-color: #ffffff;
}

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

/* ====== FOOTER ====== */
.site-footer {
  background: var(--neutral-black);
  color: var(--neutral-white);
  padding: var(--space-16) 0 var(--space-8);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-12);
  margin-bottom: var(--space-12);
}

.footer-brand {
  max-width: 300px;
}

.footer-logo {
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-4);
}

.footer-title {
  font-size: var(--text-lg);
  margin-bottom: var(--space-4);
  color: var(--neutral-white);
}

.footer-links {
  list-style: none;
  padding: 0;
}

.footer-links li {
  margin-bottom: var(--space-2);
}

.footer-links a {
  color: var(--neutral-gray);
  text-decoration: none;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.footer-links a:hover {
  color: var(--neutral-white);
  transform: translateX(2px);
}

.footer-bottom {
  padding-top: var(--space-8);
  border-top: 1px solid var(--neutral-dark);
  text-align: center;
  color: var(--neutral-gray);
  font-size: var(--text-sm);
}

/* ====== UTILITY CLASSES ====== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }
.mt-16 { margin-top: var(--space-16); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }
.mb-16 { margin-bottom: var(--space-16); }

/* ====== RESPONSIVE DESIGN ====== */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--space-12);
  }
  
  .process-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --container-padding: 1rem;
  }
  
  .menu-toggle {
    display: block;
  }
  
  .main-nav {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--neutral-white);
    padding: var(--space-4);
    border-bottom: 1px solid var(--neutral-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
  }
  
  .main-nav.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .nav-list {
    flex-direction: column;
    gap: var(--space-1);
  }
  
  .hero-section {
    padding-top: 100px;
  }
  
  .process-grid {
    grid-template-columns: 1fr;
  }
  
  .service-grid {
    grid-template-columns: 1fr;
  }
  
  h1 {
    font-size: var(--text-3xl);
  }
  
  h2 {
    font-size: var(--text-2xl);
  }
}

@media (max-width: 480px) {
  .section {
    padding: var(--space-12) 0;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  .hero-title {
    font-size: var(--text-2xl);
  }
  
  .hero-subtitle {
    font-size: var(--text-base);
  }
}

/* ====== ANIMATION KEYFRAMES ====== */

/* Fade In (basic) */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Fade In Up (scroll reveal) */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In Down (alerts, dropdowns) */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In Left */
@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade In Right */
@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scale In (modals) */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Scale Out */
@keyframes scaleOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.95);
  }
}

/* Slide Up (page transitions) */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide Down (exit) */
@keyframes slideDown {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(20px);
  }
}

/* Shake (form error) */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* Pulse (loading indicator) */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Spin (spinner) */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Draw checkmark */
@keyframes drawCheck {
  0% { stroke-dashoffset: 20; }
  100% { stroke-dashoffset: 0; }
}

/* Bounce subtle */
@keyframes bounceSubtle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ====== ANIMATION UTILITY CLASSES ====== */

/* Basic animations */
.fade-in {
  animation: fadeIn 0.4s var(--ease-out) forwards;
}

.fade-in-up {
  animation: fadeInUp 0.5s var(--ease-out) forwards;
}

.fade-in-down {
  animation: fadeInDown 0.4s var(--ease-out) forwards;
}

.fade-in-left {
  animation: fadeInLeft 0.5s var(--ease-out) forwards;
}

.fade-in-right {
  animation: fadeInRight 0.5s var(--ease-out) forwards;
}

.scale-in {
  animation: scaleIn 0.25s var(--ease-out) forwards;
}

.shake {
  animation: shake 0.4s var(--ease-out);
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

.spin {
  animation: spin 1s linear infinite;
}

/* ====== SCROLL REVEAL ANIMATIONS ====== */
/* Add .scroll-reveal to elements that should animate on scroll */
/* Use JavaScript IntersectionObserver to add .is-visible when in viewport */

.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
  will-change: opacity, transform;
}

.scroll-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays for multiple items */
.scroll-reveal.delay-1 { transition-delay: 50ms; }
.scroll-reveal.delay-2 { transition-delay: 100ms; }
.scroll-reveal.delay-3 { transition-delay: 150ms; }
.scroll-reveal.delay-4 { transition-delay: 200ms; }
.scroll-reveal.delay-5 { transition-delay: 250ms; }
.scroll-reveal.delay-6 { transition-delay: 300ms; }

/* Scroll reveal variants */
.scroll-reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
  will-change: opacity, transform;
}
.scroll-reveal-left.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.scroll-reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
  will-change: opacity, transform;
}
.scroll-reveal-right.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.scroll-reveal-scale {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
  will-change: opacity, transform;
}
.scroll-reveal-scale.is-visible {
  opacity: 1;
  transform: scale(1);
}

/* ====== PAGE TRANSITION SUPPORT ====== */
/* Add to <main> or content wrapper for page transition effects */

.page-enter {
  animation: slideUp 0.35s var(--ease-out) forwards;
}

.page-exit {
  animation: slideDown 0.2s var(--ease-out) forwards;
}

/* Auto-animate main content on page load */
main,
.app-shell,
.portal-content {
  animation: fadeInUp 0.35s var(--ease-out);
}

/* ====== MODAL/DIALOG ANIMATIONS ====== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9999;
  animation: fadeIn 0.2s var(--ease-out);
  backdrop-filter: blur(4px);
}

.modal-content {
  animation: scaleIn 0.25s var(--ease-out);
}

.modal-content.closing {
  animation: scaleOut 0.15s var(--ease-out) forwards;
}

/* ====== ALERT/NOTIFICATION ANIMATIONS ====== */

.alert,
.notification,
.flash-message {
  animation: fadeInDown 0.3s var(--ease-out);
}

.alert.dismissing {
  animation: fadeIn 0.2s var(--ease-out) reverse forwards;
}

/* ====== LOADING STATES ====== */

.skeleton {
  background: linear-gradient(90deg, var(--neutral-light) 25%, #e8e8e8 50%, var(--neutral-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

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

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--neutral-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-spinner-lg {
  width: 40px;
  height: 40px;
  border-width: 4px;
}

/* ====== PRINT STYLES ====== */
@media print {
  .site-header,
  .site-footer,
  .btn {
    display: none;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.4;
  }
  
  .container {
    max-width: 100%;
    padding: 0;
  }
}

/* ====== FORCE IMAGE & HERO CONSTRAINTS (HOTFIX) ====== */

/* Absolute global safety net */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Prevent hero image from dominating */
/* (Removed redundant global constraint for hero images) */

/* Header logo hard cap */


/* Section visual separation */
.section {
  border-top: 1px solid #e5e7eb;
}

/* Process/service icons */
.process-icon,
.service-icon {
  width: 48px;
  height: 48px;
}


/* Prevent any SVG background from overflowing */

/* Logo row constrained */
.logo-row.constrained {
  max-width: 900px;
  margin: 0 auto;
}

/* Page end spacer */
.page-end-spacer {
  height: 120px;
}
/* Cap service media images */
.service-media-img {
  max-width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: contain;
  margin: 0 auto;
}

.section {
  padding: 96px 0;
  border-top: 1px solid #e5e7eb;
}

.section:first-of-type {
  border-top: none;
}

.btn-primary {
  min-width: 200px;
  text-align: center;
  border-radius: 12px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.service-card {
  justify-content: space-between;
}

.service-price {
  margin-top: 16px;
  margin-bottom: 16px;
}

/* ===== Upload Flow Layout Fix ===== */


.page-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

.flow-header {
  display: none; /* hide legacy header inside pages */
}

.flow-section {
  margin-bottom: 32px;
}

.flow-section--intro {
  margin-bottom: 24px;
}

.page-heading {
  background: #ffffff;
  border-radius: 14px;
  padding: 28px 32px;
  margin-bottom: 28px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.04);
  border: 1px solid #eef1f5;
  border-left: 6px solid var(--trust-blue);
}

.flow-card {
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  border-radius: 18px;
  padding: 40px;
  margin-bottom: 32px;
box-shadow: 0 14px 32px rgba(15, 23, 42, 0.10);
  border: 1px solid #e0e7ff;
}

.flow-label {
  font-weight: 600;
  margin-bottom: 8px;
  display: block;
  color: #0f172a;
}

.flow-note {
  color: #475569;
  margin-bottom: 16px;
}

.upload-dropzone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 36px;
  text-align: center;
  cursor: pointer;
  background: var(--neutral-offwhite);
  transition: all var(--transition);
}

.upload-dropzone:hover {
  background: var(--primary-ultra-light);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.08);
}

.upload-dropzone.dragover {
  background: var(--primary-light);
  border-color: var(--primary);
  transform: scale(1.01);
}

.flow-group {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
}

.flow-group input,
.flow-group select,
.flow-group textarea {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 14px;
  background: #ffffff;
  color: #0f172a;
}

.section-cta {
  text-align: right;
  margin-top: 24px;
}

.consent-box {
  font-size: 14px;
  line-height: 1.5;
  color: #475569;
}
.auth-page {
  background: linear-gradient(135deg, #edf3ff 0%, #ffffff 100%);
}

.auth-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-radius: 20px;
  padding: 56px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  border: 1px solid #e0e7ff;
  text-align: left;
  animation: fadeInUp 0.5s var(--ease-out);
}

.auth-header {
  margin-bottom: 24px;
}

.auth-header h1 {
  font-size: var(--text-2xl);
  margin-bottom: 8px;
}

.auth-header p {
  color: var(--neutral-dark);
  font-size: var(--text-sm);
}

.auth-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  font-size: var(--text-sm);
}

.auth-actions a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition-fast);
}

.auth-actions a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Portal dashboards */

/* ===== Portal Header / Hero ===== */

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

.portal-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 18px;
  color: var(--neutral-black);
}

.portal-logo span {
  font-size: 12px;
  font-weight: 600;
  color: var(--neutral-dark);
}

.portal-hero {
  background: linear-gradient(135deg, #e8f2ff 0%, #ffffff 100%);
  border-left: 4px solid var(--trust-blue);
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 24px;
}

.portal-hero-title {
  font-size: var(--text-2xl);
  margin-bottom: 8px;
}

.portal-hero-subtitle {
  font-size: var(--text-sm);
  color: var(--neutral-dark);
}

.portal-hero-actions {
  margin-top: 16px;
  display: flex;
  gap: 12px;
}

 .portal-shell {
   width: 100%;
   /* Wide canvas like the render */
   max-width: 1720px;
   margin: 0 auto;
   padding: 28px 24px;
 }

 .portal-grid {
   display: grid;
   grid-template-columns: 280px minmax(0, 1fr);
   gap: 24px;
   align-items: start;
 }

 .portal-sidebar {
   border-radius: 18px;
   padding: 22px;
   border: 1px solid #dbeafe;
   box-shadow: 0 18px 44px rgba(15, 23, 42, 0.10);
   background:
     radial-gradient(1200px 500px at 20% 10%, rgba(59,130,246,0.35), transparent 60%),
     linear-gradient(180deg, #0b2a6f 0%, #0a1f4d 60%, #081a3e 100%);
   color: #e5e7eb;
   position: sticky;
   top: 96px;
   overflow: hidden;
 }

 .portal-sidebar::before {
   content: '';
   position: absolute;
   inset: -1px;
   border-radius: 18px;
   pointer-events: none;
   background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.18), transparent 40%);
   opacity: 0.9;
 }

 .portal-sidebar > * {
   position: relative;
   z-index: 1;
 }

 .portal-content {
   width: 100%;
   background: linear-gradient(180deg, #ffffff 0%, #f4f8ff 100%);
   border-radius: 18px;
   padding: 26px;
   box-shadow: 0 18px 44px rgba(15, 23, 42, 0.10);
   border: 1px solid #dbeafe;
   min-width: 0;
   overflow: hidden;
 }

 .portal-nav a {
   display: flex;
   align-items: center;
   gap: 10px;
   padding: 12px 14px;
   border-radius: 14px;
   text-decoration: none;
   color: rgba(255,255,255,0.92);
   font-weight: 700;
   letter-spacing: 0.01em;
   border: 1px solid transparent;
   background: rgba(255,255,255,0.06);
   transition: all var(--transition);
 }

 .portal-nav a:hover {
   background: rgba(255,255,255,0.12);
   border-color: rgba(255,255,255,0.18);
   transform: translateX(4px);
 }

 .portal-nav a.active {
   background: rgba(255,255,255,0.16);
   border-color: rgba(255,255,255,0.22);
 }
/* ===== FORCE ALL FLOW PAGES INTO NEW LAYOUT SYSTEM ===== */

.page-shell {
  padding-top: 0 !important;
}

.page-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-12) var(--container-padding);
}

/* Fix overly dark backgrounds on order pages */
.page-shell,
.page-inner {
  background: #f8fafc !important;
  color: #1e293b !important;
}

/* Make flow pages look like modern sections */
.flow-section,
.flow-card,
.page-heading {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  margin-bottom: var(--space-8);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  border: 1px solid #e2e8f0;
  color: #1e293b;
}

.flow-card.primary {
background: linear-gradient(180deg, #ffffff 0%, #eef4ff 100%);
  border: 1px solid #c7d2fe;
box-shadow: 0 14px 32px rgba(15, 23, 42, 0.10);
}

.flow-card.soft {
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  border: 1px solid #e6eef9;
   box-shadow: 0 12px 28px rgba(0,102,204,0.08);
}

/* Kill legacy header inside pages */
.flow-header {
  display: none !important;
}

/* ===== Case Layout (Patient Order Pages) ===== */

.case-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: start;
}

.case-layout-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.case-layout-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 96px;
}

/* Responsive fallback */
@media (max-width: 900px) {
  .case-layout {
    grid-template-columns: 1fr;
  }

  .case-layout-side {
    position: static;
  }
}

/* Dark mode removed: light-only UI */

/* ===== MICRO ANIMATIONS ===== */
.flow-card,
.service-card,
.process-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.flow-card:hover,
.service-card:hover,
.process-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 48px rgba(15,23,42,0.18);
}

/* ===== HERO TEXTURE ===== */
/* .hero-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('/assets/noise.png');
  opacity: 0.03;
  pointer-events: none;
} */

/* ==========================================================
   DOCTOR PORTAL — OPTION A DASHBOARD SYSTEM
   (Adds modern dashboard UI primitives used by portal_doctor_* views)
   ========================================================== */

/* Page wrapper (content area inside portal frame) */
.portal-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.portal-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, #eef4ff 0%, #ffffff 70%);
  border: 1px solid #dbeafe;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.portal-page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

.portal-page-title {
  margin: 6px 0 6px 0;
  font-size: 28px;
  line-height: 1.15;
}

.portal-page-subtitle {
  margin: 0;
  font-size: 14px;
  color: #475569;
  max-width: 720px;
}

.portal-page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Compact identity chip */
.portal-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  font-size: 13px;
  color: #0f172a;
}

.portal-chip strong {
  font-weight: 800;
  color: #0f172a;
}

.portal-chip .muted {
  color: #64748b;
  font-weight: 600;
}

/* KPI Row */
.portal-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.portal-kpi {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  padding: 16px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 86px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.portal-kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(0, 102, 204, 0.12);
  border-color: rgba(0, 102, 204, 0.15);
}

.portal-kpi .kpi-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 6px;
}

.portal-kpi .kpi-value {
  font-size: 28px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1;
}

.portal-kpi .kpi-meta {
  font-size: 13px;
  color: #475569;
}

.portal-kpi .kpi-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid #dbeafe;
  background: #eff6ff;
  color: var(--primary);
  white-space: nowrap;
}

.portal-kpi .kpi-badge.good {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.portal-kpi .kpi-badge.warn {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.portal-kpi .kpi-badge.bad {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

/* Two-column dashboard grid */
.portal-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

/* Card primitive */
.portal-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  padding: 16px 16px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.portal-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.portal-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  color: #0f172a;
}

.portal-card-subtitle {
  margin: 6px 0 0 0;
  font-size: 13px;
  color: #64748b;
}

.portal-card-tools {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Modern case row list */
.portal-case-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.portal-case-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  align-items: center;
}

/* Prevent pills/buttons from crushing and overlapping */
.portal-case-row > * {
  min-width: 0;
}

/* Default cell alignment */
.portal-case-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  min-width: 0;
  flex-wrap: wrap;
}

/* Right column (actions) aligns right when 2-column layout is active */
.portal-case-row:not(.portal-case-row--stack) > :last-child {
  justify-content: flex-end;
}
.portal-case-row--stack .portal-case-actions {
  justify-content: flex-end;
}

/* Make action buttons consistent and never clip */
.portal-case-row .btn,
.portal-case-row a.btn {
  min-width: 112px;
  padding: 10px 14px;
  border-radius: 12px;
  white-space: nowrap;
}

/* Stacked case row: left details + right actions (prevents pill/text/button overlap) */
.portal-case-row--stack {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.portal-case-main--stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.portal-case-meta-2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #64748b;
}

.portal-dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: #cbd5e1;
  display: inline-block;
}

.portal-case-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.portal-case-actions--wrap {
  max-width: 340px;
}

.portal-case-actions .portal-pill {
  max-width: 100%;
}

/* Allow specialty/meta to wrap instead of colliding with pills */
.portal-case-meta {
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Ensure pills don’t overflow their cell */
.portal-pill {
  max-width: 100%;
}

/* Fix default purple/underlined links inside portal cards */
.portal-card a {
  color: var(--trust-blue);
  text-decoration: none;
  font-weight: 700;
}

.portal-card a:hover {
  text-decoration: underline;
}

.portal-case-row {
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.portal-case-row:hover {
  border-color: rgba(0, 102, 204, 0.25);
  box-shadow: 0 10px 22px rgba(0, 102, 204, 0.10);
  transform: translateY(-1px);
}

.portal-case-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.portal-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #0f172a;
  white-space: nowrap;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.portal-pill.blue {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: var(--primary);
}

.portal-pill.green {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.portal-pill.orange {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.portal-pill.red {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.portal-empty {
  padding: 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  color: #64748b;
  font-size: 14px;
}

/* Make portal buttons consistent size */
.portal-content .btn {
  padding: 10px 14px;
  font-size: 14px;
  border-radius: 12px;
}

/* Responsive */
@media (max-width: 1100px) {
  .portal-dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .portal-page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .portal-page-actions {
    justify-content: flex-start;
  }

  /* Stack case rows on small screens */
  .portal-case-actions--wrap {
    max-width: none;
  }

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

  .portal-case-actions {
    justify-content: flex-start;
  }
}

 
/* ==========================================================
   PORTAL — TOP TABS + WIDE DASHBOARD (Doctor render alignment)
   ========================================================== */

/* Tabs row used under the page header: Dashboard / My Cases / Alerts */
.portal-top-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  margin: 14px 0 16px 0;
}

.portal-top-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  color: #334155;
  background: transparent;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.portal-top-tabs a:hover {
  background: var(--primary-ultra-light);
  color: var(--primary);
}

.portal-top-tabs a.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: rgba(0, 102, 204, 0.2);
}

/* Make dashboard layout wider like the render */
.portal-dashboard-grid--wide {
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
  gap: 16px;
}

/* Wider canvas on large screens (render-like) */
@media (min-width: 1200px) {
  .portal-shell {
    max-width: 1600px;
  }
}

@media (min-width: 1600px) {
  .portal-shell {
    max-width: 1720px;
  }
}

/* Keep the right rail readable (alerts/last completed) */
.portal-dashboard-grid--wide .portal-card {
  padding: 16px;
}

/* Tablet: collapse to one column to prevent cramped UI */
@media (max-width: 1100px) {
  .portal-dashboard-grid--wide {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================
   DOCTOR DASHBOARD — FULL-WIDTH RENDER (TOPBAR + TILE ROW)
   Copy/paste render alignment helpers.
   ========================================================== */

.portal-topbar {
  position: sticky;
  top: 0;
  z-index: 900;
  margin: 0;
  padding: 14px 0;
  background: rgba(248, 250, 252, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(226,232,240,0.7);
}

.portal-topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.portal-topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  color: #0f172a;
}

.portal-topbar-brand img {
  height: 34px;
  width: auto;
  display: block;
}

.portal-topbar-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #334155;
  font-weight: 800;
}

.portal-topbar-nav a {
  text-decoration: none;
  color: #334155;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  transition: all var(--transition-fast);
}

.portal-topbar-nav a:hover {
  background: var(--primary-ultra-light);
  color: var(--primary);
  transform: translateY(-1px);
}

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

.portal-pill-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid #dbeafe;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15,23,42,0.08);
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}

.portal-icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid #dbeafe;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15,23,42,0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.portal-icon-btn:hover {
  background: var(--primary-ultra-light);
  border-color: rgba(0, 102, 204, 0.25);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(0,102,204,0.12);
}

.portal-hero-wide {
  background: radial-gradient(900px 260px at 65% 50%, rgba(59,130,246,0.18), transparent 60%),
              linear-gradient(135deg, #eef4ff 0%, #ffffff 70%);
  border: 1px solid #dbeafe;
  border-radius: 18px;
  padding: 22px 22px;
  box-shadow: 0 18px 44px rgba(15,23,42,0.08);
  margin-bottom: 16px;
}

.portal-hero-wide .portal-page-kicker {
  margin: 0 0 8px 0;
}

.portal-hero-wide-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.portal-hero-wide h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: -0.02em;
}

.portal-hero-wide p {
  margin: 10px 0 0 0;
  font-size: 14px;
  color: #475569;
  max-width: 760px;
}

.portal-hero-wide-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.portal-kpi-row--render {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 16px 0 10px 0;
}

.portal-kpi--render {
  min-height: 88px;
  padding: 18px;
  border-radius: 18px;
}

/* Make the dashboard grid breathe like the render */
.portal-dashboard-grid {
  gap: 16px;
}

/* Sidebar buttons in render are outlined + equal width */
.portal-sidebar .btn,
.portal-sidebar a.btn {
  width: 100%;
  justify-content: center;
  border-radius: 14px;
}

/* Responsive: remove sticky sidebar and compress spacing */
@media (max-width: 1100px) {
  .portal-grid {
    grid-template-columns: 1fr;
  }
  .portal-sidebar {
    position: static;
  }
  .portal-topbar-inner {
    padding: 0 16px;
  }
  .portal-shell {
    padding: 20px 16px;
  }
}
/* ==========================================================
   DOCTOR DASHBOARD — OCD POLISH PASS
   - Center KPI tiles
   - Improve right-rail cards (Recent Alerts / Last Completed)
   - Add subtle color + structure without going "too loud"
   ========================================================== */

/* Center KPI tiles (render + generic dashboard) */
.portal-kpi-row--render .portal-kpi,
.portal-kpi-row--render .portal-kpi--render,
.portal-kpi-row--center .portal-kpi,
.portal-kpi-row--center .portal-kpi--center,
.portal-kpi-row .portal-kpi.portal-kpi--center {
  justify-content: center;
  flex-direction: column;
  text-align: center;
  gap: 8px;
}

/* If no modifier class is present, still center KPI content on doctor dashboard */
.portal-page .portal-kpi-row .portal-kpi {
  justify-content: center;
  flex-direction: column;
  text-align: center;
  gap: 8px;
}

.portal-kpi-row--render .portal-kpi .kpi-label,
.portal-kpi-row--render .portal-kpi--render .kpi-label {
  margin-bottom: 0;
}

.portal-kpi-row--render .portal-kpi .kpi-value,
.portal-kpi-row--render .portal-kpi--render .kpi-value {
  line-height: 1;
}

.portal-kpi-row--render .portal-kpi .kpi-badge,
.portal-kpi-row--render .portal-kpi--render .kpi-badge {
  margin-top: 2px;
}

/* KPI typography tightening */
.portal-page .portal-kpi .kpi-label {
  margin: 0;
}
.portal-page .portal-kpi .kpi-value {
  margin: 0;
}
.portal-page .portal-kpi .kpi-meta {
  margin: 0;
}

/* ==========================================================
   DOCTOR DASHBOARD — RIGHT RAIL (Recent Alerts + Last Completed)
   Adds structured, non-bland list rows if markup provides hooks.
   Safe: no impact unless these classes exist.
   ========================================================== */

/* Generic list wrapper */
.portal-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Alert/Completed row layout */
.portal-alert--row,
.portal-completed--row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.portal-alert--row:hover,
.portal-completed--row:hover {
  border-color: rgba(0, 102, 204, 0.2);
  box-shadow: 0 10px 22px rgba(0, 102, 204, 0.10);
  transform: translateY(-1px);
}

/* Left icon */
.portal-alert-icon,
.portal-completed-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: var(--primary);
  box-shadow: 0 10px 18px rgba(0,102,204,0.10);
}

.portal-alert-content,
.portal-completed-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.portal-alert-title,
.portal-completed-title {
  font-size: 14px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.2;
  margin: 0;
}

.portal-alert-sub,
.portal-completed-sub {
  font-size: 13px;
  color: #64748b;
  margin: 0;
  line-height: 1.25;
}

/* Right meta area (badge + time) */
.portal-alert-meta,
.portal-completed-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.portal-time {
  font-size: 12px;
  font-weight: 800;
  color: #64748b;
  white-space: nowrap;
}

.portal-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #0f172a;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
  white-space: nowrap;
}

.portal-badge.blue {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: var(--primary);
}

.portal-badge.green {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.portal-badge.orange {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.portal-badge.red {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

/* Make right rail cards feel less empty even with plain text */
.portal-dashboard-grid > :last-child .portal-card {
  background: radial-gradient(900px 240px at 15% 0%, rgba(0,102,204,0.08), transparent 60%),
              linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

/* Tighten plain paragraphs inside alerts cards */
.portal-dashboard-grid > :last-child .portal-card p {
  margin-bottom: 8px;
}

/* If a right-rail card contains many links, turn them into block rows */
.portal-dashboard-grid > :last-child .portal-card a:not(.btn):not(.nav-link):not(.nav-cta) {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  text-decoration: none;
}

.portal-dashboard-grid > :last-child .portal-card a:not(.btn):not(.nav-link):not(.nav-cta):hover {
  border-color: #bfdbfe;
  background: #eff6ff;
}

/* Mobile: allow rows to wrap cleanly */
@media (max-width: 520px) {
  .portal-alert--row,
  .portal-completed--row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .portal-alert-meta,
  .portal-completed-meta {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

/* 2) Card headers: stronger hierarchy + align "View all" */
.portal-card-header {
  align-items: center;
}

.portal-card-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.portal-card-title::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(0, 102, 204, 0.25);
  box-shadow: 0 0 0 6px rgba(0, 102, 204, 0.08);
}

.portal-card-tools a,
.portal-card-tools .portal-link {
  font-size: 13px;
  font-weight: 900;
  color: var(--primary);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
}

.portal-card-tools a:hover,
.portal-card-tools .portal-link:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  text-decoration: none;
}

/* 3) Right-rail content: turn loose text/links into clean list rows
      (works even if markup is <ul><li>… or a stack of <a>/<div>) */

/* If the card contains a UL, make it a modern list */
.portal-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.portal-card ul li {
  position: relative;
  padding: 12px 12px 12px 44px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.portal-card ul li::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 14px;
  width: 18px;
  height: 18px;
  border-radius: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  box-shadow: 0 10px 18px rgba(0,102,204,0.10);
}

/* Any non-button links inside portal cards should look intentional */
.portal-card a:not(.btn):not(.nav-link):not(.nav-cta) {
  display: inline-block;
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.portal-card a:not(.btn):not(.nav-link):not(.nav-cta):hover {
  text-decoration: underline;
}

/* If the card is a stack of anchors/divs instead of UL/LI, style them too */
.portal-card .portal-item,
.portal-card .alert-item,
.portal-card .completed-item,
.portal-card .list-item {
  position: relative;
  padding: 12px 12px 12px 44px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.portal-card .portal-item::before,
.portal-card .alert-item::before,
.portal-card .completed-item::before,
.portal-card .list-item::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 14px;
  width: 18px;
  height: 18px;
  border-radius: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  box-shadow: 0 10px 18px rgba(0,102,204,0.10);
}

/* 4) Status pills: slightly tighter + consistent vertical centering */
.portal-pill {
  line-height: 1;
  padding: 8px 10px;
}

/* 5) Make the right rail feel less "blank" with a subtle header tint */
.portal-dashboard-grid > :last-child .portal-card {
  background: radial-gradient(800px 220px at 20% 0%, rgba(0,102,204,0.06), transparent 60%),
              #ffffff;
}

/* 6) Fix overly-tall stacks in right rail by adding internal spacing control */
.portal-dashboard-grid > :last-child .portal-card {
  overflow: hidden;
}

.portal-dashboard-grid > :last-child .portal-card + .portal-card {
  margin-top: 12px;
}

/* ==========================================================

DOCTOR DASHBOARD — FINAL VISUAL POLISH (SCOPED)
Richer spacing/depth with subtle blue accents
Structured Recent Alerts + Last Completed rows
Strong center alignment for KPI tiles across breakpoints
RTL-safe list row layout (icons stay left; text still RTL)

========================================================== */

.portal-doctor-dashboard {
  --dd-blue: var(--primary);
  --dd-blue-soft: #dbeafe;
  --dd-card-border: #d9e6fb;
  --dd-text-main: #0f172a;
  --dd-text-sub: #5b6b81;
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  gap: 20px;
}

.portal-doctor-dashboard .portal-page-header {
  padding: 22px 24px;
  border-radius: 18px;
  border: 1px solid var(--dd-card-border);
  background:
    radial-gradient(1100px 280px at 12% 0%, rgba(0, 102, 204, 0.12), transparent 58%),
    linear-gradient(180deg, #f8fbff 0%, #ffffff 74%);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.portal-doctor-dashboard .portal-page-title {
  font-size: clamp(1.55rem, 2vw, 1.9rem);
  margin-bottom: 8px;
}

.portal-doctor-dashboard .portal-page-subtitle {
  color: var(--dd-text-sub);
  max-width: 780px;
}

.portal-doctor-dashboard .portal-top-tabs {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--dd-card-border);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.07);
  margin: 2px 0 18px 0;
}

.portal-doctor-dashboard .portal-top-tab {
  min-width: 118px;
}

.portal-doctor-dashboard .portal-kpi-row--center {
  gap: 18px;
  align-items: stretch;
}

.portal-doctor-dashboard .portal-kpi.portal-kpi--center {
  min-height: 146px;
  padding: 18px 16px;
  border-radius: 18px;
  border: 1px solid var(--dd-card-border);
  background:
    radial-gradient(720px 220px at 12% 0%, rgba(0, 102, 204, 0.10), transparent 56%),
    linear-gradient(180deg, #ffffff 0%, #f9fcff 100%);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.portal-doctor-dashboard .portal-kpi.portal-kpi--center > * {
  margin: 0;
}

.portal-doctor-dashboard .portal-kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: var(--dd-blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 18px rgba(0, 102, 204, 0.14);
}

.portal-doctor-dashboard .portal-kpi-icon .portal-icon-lucide {
  font-size: 18px;
  line-height: 1;
}

.portal-doctor-dashboard .portal-kpi-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.portal-doctor-dashboard .portal-kpi .kpi-label {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portal-doctor-dashboard .portal-kpi-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
}

.portal-doctor-dashboard .portal-kpi .kpi-value {
  margin: 0;
  line-height: 1;
  font-size: clamp(1.7rem, 2.1vw, 2rem);
}

.portal-doctor-dashboard .portal-kpi .kpi-sub {
  margin: 0;
  font-size: 12px;
  color: var(--dd-text-sub);
  font-weight: 700;
}

.portal-doctor-dashboard .portal-dashboard-grid--wide {
  grid-template-columns: minmax(0, 1.75fr) minmax(340px, 1fr);
  gap: 22px;
}

.portal-doctor-dashboard .portal-card {
  position: relative;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid var(--dd-card-border);
  background:
    radial-gradient(900px 220px at 16% 0%, rgba(0, 102, 204, 0.06), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
}

.portal-doctor-dashboard .portal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 18px 18px 0 0;
  background: linear-gradient(90deg, rgba(0, 102, 204, 0.55), rgba(59, 130, 246, 0.18) 55%, transparent);
  pointer-events: none;
}

.portal-doctor-dashboard .portal-card-header {
  margin-bottom: 14px;
  align-items: center;
}

.portal-doctor-dashboard .portal-card-title {
  font-size: 1.02rem;
  font-weight: 900;
  color: var(--dd-text-main);
}

.portal-doctor-dashboard .portal-card-actions .portal-card-hint {
  font-size: 12px;
  color: #6b7c94;
  font-weight: 700;
}

.portal-doctor-dashboard .portal-list-meta {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  color: #64748b;
  font-weight: 700;
  white-space: nowrap;
}

.portal-doctor-dashboard .portal-empty {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px dashed #dbe7f8;
  background: #f8fbff;
  color: #64748b;
}

.portal-doctor-dashboard .portal-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 800;
  color: var(--dd-blue);
  text-decoration: none;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.portal-doctor-dashboard .portal-link:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: var(--primary);
  text-decoration: none;
}

.portal-doctor-dashboard .portal-rich-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.portal-doctor-dashboard .portal-rich-list > .portal-rich-row + .portal-rich-row {
  margin-top: 2px;
}

.portal-doctor-dashboard .portal-rich-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background-color 0.18s ease;
}

.portal-doctor-dashboard .portal-rich-row:hover {
  border-color: #bfdbfe;
  box-shadow: 0 10px 22px rgba(0, 102, 204, 0.11);
  transform: translateY(-1px);
  text-decoration: none;
}

.portal-doctor-dashboard .portal-rich-row-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid #bfdbfe;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  color: var(--dd-blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(0, 102, 204, 0.12);
}

.portal-doctor-dashboard .portal-rich-row-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.portal-doctor-dashboard .portal-rich-row-title {
  margin: 0;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 900;
  color: var(--dd-text-main);
}

.portal-doctor-dashboard .portal-rich-row-sub {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.3;
  color: var(--dd-text-sub);
}

.portal-doctor-dashboard .portal-rich-row-meta {
  min-width: 138px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  flex-wrap: nowrap;
  padding-left: 10px;
  border-left: 1px solid #e4ebf8;
}

.portal-doctor-dashboard .portal-alert-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  min-width: 72px;
}

.portal-doctor-dashboard .portal-alert-badge--muted {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #475569;
}

.portal-doctor-dashboard .portal-alert-badge--warning {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.portal-doctor-dashboard .portal-alert-badge--urgent {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.portal-doctor-dashboard .portal-alert-badge--success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.portal-doctor-dashboard .portal-alert-time {
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  white-space: nowrap;
  min-width: 44px;
  text-align: right;
}

.portal-doctor-dashboard .portal-completed-meta .portal-pill {
  min-width: 96px;
  justify-content: center;
}

.portal-doctor-dashboard .portal-case-row {
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.portal-doctor-dashboard .portal-case-row:hover {
  transform: translateY(-1px);
}

/* Keep icon column on the left in RTL while preserving Arabic text direction. */
[dir='rtl'] .portal-doctor-dashboard .portal-rich-row {
  direction: ltr;
}

[dir='rtl'] .portal-doctor-dashboard .portal-rich-row-body,
[dir='rtl'] .portal-doctor-dashboard .portal-rich-row-title,
[dir='rtl'] .portal-doctor-dashboard .portal-rich-row-sub {
  direction: rtl;
  text-align: right;
}

@media (max-width: 1240px) {
  .portal-doctor-dashboard .portal-dashboard-grid--wide {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
}

@media (max-width: 720px) {
  .portal-doctor-dashboard .portal-kpi-row--center {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .portal-doctor-dashboard .portal-kpi.portal-kpi--center {
    min-height: 122px;
  }

  .portal-doctor-dashboard .portal-card {
    padding: 16px;
  }

  .portal-doctor-dashboard .portal-rich-row {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
  }

  .portal-doctor-dashboard .portal-rich-row-meta {
    grid-column: 1 / -1;
    justify-content: flex-start;
    align-items: flex-start;
    padding-left: 46px;
    border-left: 0;
  }

  [dir='rtl'] .portal-doctor-dashboard .portal-rich-row-meta {
    padding-left: 0;
    padding-right: 46px;
    justify-content: flex-end;
    align-items: flex-end;
  }
}

/* ==========================================================
   DOCTOR DASHBOARD — ICON RENDER + ALIGNMENT HARDENING
   Scoped to .portal-doctor-dashboard only.
   ========================================================== */

.portal-doctor-dashboard .portal-case-icon,
.portal-doctor-dashboard .portal-kpi-icon,
.portal-doctor-dashboard .portal-rich-row-icon,
.portal-doctor-dashboard .portal-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid #bfdbfe;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(0, 102, 204, 0.12);
  flex: 0 0 40px;
  position: relative;
  overflow: hidden;
}

.portal-doctor-dashboard .portal-icon-lucide {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}

.portal-doctor-dashboard svg.lucide,
.portal-doctor-dashboard .portal-kpi-icon svg,
.portal-doctor-dashboard .portal-case-icon svg,
.portal-doctor-dashboard .portal-rich-row-icon svg {
  display: block;
  width: 18px;
  height: 18px;
  max-width: none;
  max-height: none;
  color: currentColor;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  flex: 0 0 auto;
}

.portal-doctor-dashboard .portal-icon-fallback {
  display: none;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: var(--primary);
  line-height: 1;
  text-transform: uppercase;
}

html.lucide-ready .portal-doctor-dashboard .portal-icon-lucide {
  display: inline-flex;
}

html.lucide-ready .portal-doctor-dashboard .portal-icon-fallback {
  display: none;
}

/* If lucide fails */
.lucide-fallback .portal-doctor-dashboard .portal-icon-lucide {
  display: none;
}

.lucide-fallback .portal-doctor-dashboard svg.lucide,
.lucide-fallback .portal-doctor-dashboard .portal-kpi-icon svg,
.lucide-fallback .portal-doctor-dashboard .portal-case-icon svg,
.lucide-fallback .portal-doctor-dashboard .portal-rich-row-icon svg {
  display: none;
}

.lucide-fallback .portal-doctor-dashboard .portal-icon-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Optional forced fallback mode for diagnostics. */
.portal-doctor-dashboard.portal-icons-fallback .portal-icon-lucide {
  display: none;
}

.portal-doctor-dashboard.portal-icons-fallback .portal-icon-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Case rows: ensure icon + main text align cleanly */
.portal-doctor-dashboard .portal-case-row,
.portal-doctor-dashboard .portal-rich-row {
  align-items: center;
}

/* Center status pills inside KPI tiles and right-rail meta */
.portal-doctor-dashboard .portal-pill,
.portal-doctor-dashboard .portal-alert-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Keep the 3 KPI label pills visually centered even if text wraps */
.portal-doctor-dashboard .portal-kpi .kpi-label {
  width: 100%;
}

.portal-doctor-dashboard .portal-kpi-pill {
  width: auto;
  max-width: 100%;
}

.portal-doctor-dashboard .portal-inline-form {
  margin: 0;
  display: inline-flex;
  align-items: center;
}

/* RTL: keep icon box on the left, but text remains RTL */
[dir='rtl'] .portal-doctor-dashboard .portal-case-icon,
[dir='rtl'] .portal-doctor-dashboard .portal-icon-box {
  direction: ltr;
}

/* ==========================================================
   DOCTOR LIST PAGES (QUEUE + COMPLETED)
   Scoped to .portal-doctor-list only.
   ========================================================== */

.portal-doctor-list {
  max-width: 1360px;
  margin: 0 auto;
  width: 100%;
}

.portal-doctor-list .portal-filter-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.portal-doctor-list .portal-filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #dbeafe;
  background: #eff6ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.portal-doctor-list .portal-filter-chip:hover {
  background: var(--primary-light);
  border-color: rgba(0, 102, 204, 0.3);
  transform: translateY(-1px);
}

.portal-doctor-list .portal-filter-chip.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.portal-doctor-list .portal-list-search {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.portal-doctor-list .portal-list-search input[type='search'] {
  flex: 1 1 300px;
  min-width: 220px;
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.portal-doctor-list .portal-list-search input[type='search']:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
}

.portal-doctor-list .portal-list-meta {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  color: #64748b;
  font-weight: 700;
  white-space: nowrap;
}

.portal-doctor-list .portal-list-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.portal-doctor-list .is-disabled {
  opacity: 0.55;
  pointer-events: none;
  cursor: not-allowed;
}

.portal-doctor-list .is-static-row {
  cursor: default;
}

.portal-doctor-list .portal-empty {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px dashed #dbe7f8;
  background: #f8fbff;
  color: #64748b;
}

@media (max-width: 640px) {
  .portal-doctor-list .portal-list-pagination {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ==========================================================
   DOCTOR CASE PAGE — STRUCTURE + PARITY
   Scoped strictly to .portal-doctor-case
   ========================================================== */

.portal-doctor-case {
  max-width: 1360px;
  margin: 0 auto;
  width: 100%;
}

/* --- Two-column layout --- */

.portal-doctor-case .portal-case-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.portal-doctor-case .portal-case-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.portal-doctor-case .portal-case-aside {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 24px;
}

/* --- Cards: bring flow-card closer to dashboard style --- */

.portal-doctor-case .flow-card {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e6edf7;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  padding: 20px 22px;
}

.portal-doctor-case .flow-card h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 12px 0;
  color: #0f172a;
}

/* --- Key / Value Grid --- */

.portal-doctor-case .kv-grid {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 10px 18px;
}

.portal-doctor-case .kv {
  display: contents;
}

.portal-doctor-case .kv strong {
  font-weight: 600;
  color: #334155;
}

.portal-doctor-case .kv span {
  color: #0f172a;
  word-break: break-word;
}

/* --- Hero parity --- */

.portal-doctor-case .portal-hero {
  background: linear-gradient(135deg, #eef5ff 0%, #ffffff 100%);
  border-inline-start: 4px solid var(--primary); /* RTL-safe */
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 8px;
}

/* --- CTA alignment --- */

.portal-doctor-case .section-cta {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
}

.portal-doctor-case .portal-file-unavailable {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #64748b;
  cursor: default;
  text-decoration: none;
}

.portal-doctor-case .portal-file-unavailable-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding-inline: 8px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

/* --- Responsive --- */

@media (max-width: 1100px) {
  .portal-doctor-case .portal-case-layout {
    grid-template-columns: 1fr;
  }

  .portal-doctor-case .portal-case-aside {
    position: static;
  }
}

/* --- RTL adjustments --- */

[dir="rtl"] .portal-doctor-case .section-cta {
  justify-content: flex-start;
}

/* ====== SITE HOMEPAGE (PREMIUM REDESIGN) ====== */
body.site-home {
  --site-bg: #f5f8ff;
  --site-card: #ffffff;
  --site-border: #dde5f4;
  --site-text: #0f1d3f;
  --site-muted: #5b6b89;
  --site-blue: #1f62e3;
  --site-blue-strong: #184cb6;
  --site-shadow: 0 18px 46px rgba(21, 47, 97, 0.14);
  --site-radius: 18px;
  --site-container: 1240px;
  padding-top: 0 !important;
  color: var(--site-text);
  background: var(--site-bg);
  overflow-x: hidden;
}

body.site-home .container {
  max-width: var(--site-container);
  padding: 0 40px;
}

body.site-home .site-page {
  position: relative;
  isolation: isolate;
}

body.site-home .site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 120;
  border-bottom: 1px solid rgba(202, 214, 236, 0.9);
  background: rgba(255, 255, 255, 0.75);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 26px rgba(15, 35, 79, 0.07);
}

body.site-home .header-inner {
  max-width: var(--site-container);
  height: 72px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  gap: 28px;
}

body.site-home .site-brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

body.site-home .logo-wrap {
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

body.site-home .brand-logo-img {
  height: 42px;
  width: auto;
  max-width: 260px;
  object-fit: contain;
  display: block;
}

body.site-home .brand-text {
  display: none;
}

body.site-home .menu-toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  border: 1px solid var(--site-border);
  border-radius: 12px;
  background: #ffffff;
  color: #1e335f;
  font-size: 21px;
  cursor: pointer;
}

body.site-home .main-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

body.site-home .nav-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 24px;
}

body.site-home .nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 0;
  text-decoration: none;
  white-space: nowrap;
  color: #233867;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  transition: color 180ms ease;
}

body.site-home .nav-link:hover {
  background: transparent;
  color: var(--site-blue);
}

body.site-home .nav-link-icon {
  padding: 0;
}

body.site-home .nav-link-icon svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.site-home .home-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

body.site-home .home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 12px;
  text-decoration: none;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

body.site-home .home-btn:hover {
  transform: translateY(-1px);
}

body.site-home .home-btn-primary {
  color: #ffffff !important;
  background: linear-gradient(135deg, var(--site-blue) 0%, var(--site-blue-strong) 100%);
  border-color: transparent;
  box-shadow: 0 14px 34px rgba(31, 98, 227, 0.28);
}

body.site-home .home-btn-primary:hover {
  color: #ffffff !important;
  box-shadow: 0 18px 40px rgba(31, 98, 227, 0.32);
}

body.site-home .home-btn-outline {
  color: #24467f !important;
  background: rgba(255, 255, 255, 0.8);
  border-color: #c7d4ee;
}

body.site-home .home-btn-outline:hover {
  color: #1f62e3 !important;
  border-color: #1f62e3;
  background: #ffffff;
}

body.site-home .hero-section {
  position: relative;
  overflow: hidden;
  padding: 94px 0 0;
  background:
    radial-gradient(900px 560px at 84% 18%, rgba(87, 143, 255, 0.26) 0%, rgba(87, 143, 255, 0) 74%),
    radial-gradient(760px 520px at 8% -8%, rgba(165, 193, 255, 0.32) 0%, rgba(165, 193, 255, 0) 76%),
    linear-gradient(180deg, #f7f9ff 0%, #f3f7ff 44%, #eef4ff 100%);
}

body.site-home .hero-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(137, 162, 213, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(137, 162, 213, 0.08) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, black 26%, transparent 78%);
  pointer-events: none;
}

body.site-home .hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  align-items: center;
  gap: 64px;
  padding-bottom: 88px;
}

body.site-home .hero-content {
  max-width: 620px;
}

body.site-home .hero-kicker {
  margin: 0 0 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #3860a6 !important;
}

body.site-home .hero-title {
  margin: 0 0 22px;
  max-width: 620px;
  font-family: var(--font-heading);
  font-size: clamp(54px, 6.3vw, 68px);
  font-weight: 800;
  line-height: 1.03;
  letter-spacing: -0.03em;
  color: #0f1d3f !important;
}

body.site-home .hero-subtitle {
  margin: 0 0 34px;
  max-width: 580px;
  font-size: 19px;
  line-height: 1.62;
  color: var(--site-muted) !important;
}

body.site-home .hero-buttons {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

body.site-home .hero-buttons .home-btn {
  min-height: 52px;
  font-size: 16px;
  padding: 0 24px;
}

body.site-home .hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

body.site-home .hero-stat-card {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--site-border);
  border-radius: 14px;
  padding: 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 8px 20px rgba(24, 48, 95, 0.08);
}

body.site-home .hero-stat-card strong {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
  color: #12306d !important;
}

body.site-home .hero-stat-card span {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
  color: #56678a !important;
}

body.site-home .hero-visual {
  position: relative;
  min-height: 570px;
}

body.site-home .hero-device-shell {
  width: min(100%, 610px);
  margin-left: auto;
  border-radius: 26px;
  border: 1px solid #d5def2;
  background: linear-gradient(180deg, #ffffff 0%, #f6f9ff 100%);
  box-shadow: var(--site-shadow);
  transform: rotate(-4deg);
  overflow: hidden;
}

body.site-home .hero-device-topbar {
  height: 58px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #dee6f4;
  background: linear-gradient(180deg, #f8faff 0%, #f2f6ff 100%);
}

body.site-home .hero-device-brand {
  font-size: 14px;
  font-weight: 700;
  color: #2e4d84 !important;
}

body.site-home .hero-device-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

body.site-home .hero-device-toolbar span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #b8caee;
}

body.site-home .hero-device-body {
  padding: 24px 22px 24px;
}

body.site-home .hero-device-heading {
  margin: 0 0 16px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  color: #15356f !important;
}

body.site-home .hero-device-lines {
  display: grid;
  gap: 11px;
  margin-bottom: 18px;
}

body.site-home .hero-device-lines span {
  display: block;
  height: 13px;
  border-radius: 999px;
  background: linear-gradient(90deg, #dde7fa 0%, #f2f6ff 100%);
}

body.site-home .hero-device-lines span:nth-child(1) { width: 90%; }
body.site-home .hero-device-lines span:nth-child(2) { width: 96%; }
body.site-home .hero-device-lines span:nth-child(3) { width: 84%; }
body.site-home .hero-device-lines span:nth-child(4) { width: 92%; }
body.site-home .hero-device-lines span:nth-child(5) { width: 72%; }

body.site-home .hero-device-meta {
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  font-weight: 600;
  color: #60739b !important;
}

body.site-home .hero-device-action {
  margin-left: auto;
  width: fit-content;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff !important;
  background: linear-gradient(135deg, #1f62e3 0%, #184cb6 100%);
  box-shadow: 0 8px 18px rgba(31, 98, 227, 0.3);
}

body.site-home .floating-card {
  position: absolute;
  width: min(240px, 48%);
  border-radius: 16px;
  border: 1px solid #d8e3f5;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 34px rgba(19, 43, 90, 0.14);
  padding: 14px 14px;
}

body.site-home .floating-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.3;
  color: #173a78 !important;
}

body.site-home .floating-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #5d6f92 !important;
}

body.site-home .floating-card-a {
  top: 52px;
  left: -12px;
}

body.site-home .floating-card-b {
  top: 260px;
  right: -16px;
}

body.site-home .floating-card-c {
  bottom: 22px;
  left: 34px;
}

body.site-home .hero-trust-strip {
  position: relative;
  border-top: 1px solid #d8e2f4;
  background: linear-gradient(180deg, rgba(250, 252, 255, 0.76) 0%, rgba(244, 248, 255, 0.9) 100%);
}

body.site-home .hero-trust-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: center;
  padding-top: 20px;
  padding-bottom: 20px;
}

body.site-home .hero-trust-row span {
  position: relative;
  text-align: center;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #5d6e8d !important;
}

body.site-home .hero-trust-row span:not(:first-child)::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 18px;
  background: #d8e2f4;
}

body.site-home .section {
  border-top: 1px solid var(--site-border);
  padding: 96px 0;
  background: transparent;
}

body.site-home .process-section {
  border-top: 0;
}

body.site-home .section-header {
  max-width: 760px;
  margin: 0 auto 44px;
  text-align: center;
}

body.site-home .section-kicker {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #3a62a8;
}

body.site-home .section-header h2 {
  margin: 0 0 16px;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #102246;
}

body.site-home .section-subtitle {
  margin: 0;
  font-size: 18px;
  line-height: 1.7;
  color: var(--site-muted);
}

body.site-home .process-grid {
  display: grid;
  gap: 18px;
}

body.site-home .process-grid-premium {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.site-home .process-card {
  border-radius: var(--site-radius);
  border: 1px solid var(--site-border);
  background: var(--site-card);
  box-shadow: 0 14px 28px rgba(17, 37, 78, 0.08);
  padding: 30px 24px;
  text-align: left;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

body.site-home .process-card:hover {
  transform: translateY(-3px);
  border-color: #cbd9f2;
  box-shadow: 0 20px 36px rgba(17, 37, 78, 0.12);
}

body.site-home .step-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #184cb6;
  background: #e6efff;
  border: 1px solid #c9daf8;
}

body.site-home .process-card h3 {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.25;
  color: #142f63;
}

body.site-home .process-card p {
  margin: 0;
  font-size: 16px;
  line-height: 1.65;
  color: var(--site-muted);
}

body.site-home .specialties-section {
  background: linear-gradient(180deg, rgba(244, 248, 255, 0.88) 0%, rgba(240, 246, 255, 0.64) 100%);
}

body.site-home .specialties-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

body.site-home .specialty-card {
  border-radius: 16px;
  border: 1px solid var(--site-border);
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(17, 37, 78, 0.07);
  padding: 22px 18px;
  min-height: 152px;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

body.site-home .specialty-card:hover {
  transform: translateY(-3px);
  border-color: #c8d7f3;
  box-shadow: 0 18px 30px rgba(17, 37, 78, 0.11);
}

body.site-home .specialty-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.25;
  color: #16366d;
}

body.site-home .specialty-card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: #5c6f93;
}

body.site-home .premium-cta-row {
  margin-top: 28px;
  text-align: center;
}

body.site-home .clarity-section {
  background: linear-gradient(180deg, #f8fbff 0%, #f2f7ff 100%);
}

body.site-home .clarity-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: start;
  gap: 44px;
}

body.site-home .clarity-copy h2 {
  margin: 0 0 20px;
  font-size: clamp(34px, 4.4vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #0f2248;
}

body.site-home .clarity-copy > p {
  margin: 0 0 20px;
  font-size: 18px;
  line-height: 1.72;
  color: var(--site-muted);
}

body.site-home .clarity-points {
  margin: 0 0 30px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

body.site-home .clarity-points li {
  position: relative;
  padding-left: 24px;
  font-size: 16px;
  line-height: 1.55;
  color: #2a4474;
}

body.site-home .clarity-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #3b79ef 0%, #2056cf 100%);
  box-shadow: 0 0 0 3px rgba(59, 121, 239, 0.16);
}

body.site-home .clarity-stack {
  display: grid;
  gap: 14px;
}

body.site-home .clarity-card {
  border-radius: 16px;
  border: 1px solid #d7e1f3;
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(17, 37, 78, 0.08);
  padding: 18px 18px;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

body.site-home .clarity-card:hover {
  transform: translateY(-3px);
  border-color: #c8d8f2;
  box-shadow: 0 18px 30px rgba(17, 37, 78, 0.11);
}

body.site-home .clarity-card h3 {
  margin: 0 0 8px;
  font-size: 19px;
  line-height: 1.25;
  color: #16366d;
}

body.site-home .clarity-card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: #5a6b8a;
}

body.site-home .quote-strip {
  padding-top: 42px;
  padding-bottom: 42px;
  text-align: center;
  background: #f0f5ff;
}

body.site-home .quote-strip p {
  margin: 0;
  font-size: clamp(20px, 2.8vw, 30px);
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: #17366f;
}

body.site-home .final-cta-section {
  background: linear-gradient(180deg, #eef4ff 0%, #e8f0ff 100%);
}

body.site-home .final-cta-card {
  max-width: 860px;
  margin: 0 auto;
  border-radius: 22px;
  border: 1px solid #d3e0fa;
  background:
    radial-gradient(520px 260px at 92% -8%, rgba(94, 147, 248, 0.26) 0%, rgba(94, 147, 248, 0) 75%),
    linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
  box-shadow: 0 24px 44px rgba(18, 41, 86, 0.14);
  padding: 44px 46px;
  text-align: center;
}

body.site-home .final-cta-card h2 {
  margin: 0 0 14px;
  font-size: clamp(34px, 4.2vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #112a5a;
}

body.site-home .final-cta-card p {
  margin: 0 auto 24px;
  max-width: 640px;
  font-size: 18px;
  line-height: 1.65;
  color: #5a6f97;
}

body.site-home .final-cta-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

body.site-home .final-cta-actions .home-btn {
  min-height: 52px;
  padding: 0 24px;
  font-size: 16px;
}

body.site-home .site-footer {
  background: linear-gradient(180deg, #112349 0%, #0b1a36 100%);
  color: #dbe5fb;
  border-top: 1px solid rgba(139, 163, 214, 0.3);
  padding: 64px 0 34px;
}

body.site-home .site-footer .footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 28px;
  margin-bottom: 0;
}

body.site-home .site-footer .footer-title {
  margin: 0 0 10px;
  color: #ffffff;
  font-size: 28px;
}

body.site-home .site-footer p,
body.site-home .site-footer a {
  color: #c8d5f4;
}

body.site-home .site-footer a {
  text-decoration: none;
}

body.site-home .site-footer a:hover {
  color: #ffffff;
}

body.site-home .site-footer .footer-links {
  display: grid;
  gap: 8px;
}

@media (max-width: 1199px) {
  body.site-home .container,
  body.site-home .header-inner {
    padding-left: 28px;
    padding-right: 28px;
  }

  body.site-home .hero-grid {
    gap: 46px;
    padding-bottom: 74px;
  }

  body.site-home .hero-title {
    font-size: clamp(48px, 5.7vw, 62px);
  }

  body.site-home .hero-subtitle {
    font-size: 18px;
  }

  body.site-home .hero-visual {
    min-height: 520px;
  }

  body.site-home .specialties-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1060px) {
  body.site-home .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  body.site-home .main-nav {
    position: absolute;
    top: 72px;
    left: 20px;
    right: 20px;
    margin-left: 0;
    padding: 18px;
    border-radius: 16px;
    border: 1px solid #d3dff4;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 24px 40px rgba(14, 34, 70, 0.15);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 180ms ease, opacity 180ms ease, visibility 180ms ease;
  }

  body.site-home .main-nav.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  body.site-home .nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  body.site-home .home-nav-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body.site-home .home-nav-actions .home-btn {
    width: 100%;
  }

  body.site-home .hero-grid {
    grid-template-columns: 1fr;
    gap: 34px;
    padding-bottom: 64px;
  }

  body.site-home .hero-content {
    max-width: 100%;
  }

  body.site-home .hero-title,
  body.site-home .hero-subtitle {
    max-width: 100%;
  }

  body.site-home .hero-visual {
    min-height: 480px;
  }

  body.site-home .floating-card-a {
    left: 0;
  }

  body.site-home .floating-card-b {
    right: 0;
  }

  body.site-home .hero-trust-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.site-home .hero-trust-row span:not(:first-child)::before {
    display: none;
  }

  body.site-home .process-grid-premium {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.site-home .clarity-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

@media (max-width: 767px) {
  body.site-home .container,
  body.site-home .header-inner {
    padding-left: 20px;
    padding-right: 20px;
  }

  body.site-home .header-inner {
    gap: 12px;
  }

  body.site-home .logo-wrap,
  body.site-home .brand-logo-img {
    width: auto;
    height: auto;
  }

  body.site-home .brand-logo-img {
    height: 34px;
    max-width: 220px;
  }

  body.site-home .hero-section {
    padding-top: 56px;
  }

  body.site-home .hero-title {
    font-size: clamp(38px, 11.2vw, 48px);
    line-height: 1.05;
  }

  body.site-home .hero-subtitle {
    font-size: 16px;
    line-height: 1.62;
    margin-bottom: 26px;
  }

  body.site-home .hero-buttons {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 24px;
  }

  body.site-home .hero-buttons .home-btn {
    width: 100%;
    min-height: 50px;
  }

  body.site-home .hero-stats {
    grid-template-columns: 1fr;
  }

  body.site-home .hero-visual {
    min-height: 0;
  }

  body.site-home .hero-device-shell {
    width: 100%;
    transform: none;
  }

  body.site-home .floating-card {
    position: static;
    width: 100%;
    margin-top: 10px;
  }

  body.site-home .hero-trust-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding-top: 16px;
    padding-bottom: 18px;
  }

  body.site-home .section {
    padding: 72px 0;
  }

  body.site-home .section-header {
    margin-bottom: 30px;
  }

  body.site-home .section-header h2 {
    font-size: clamp(30px, 9.2vw, 38px);
  }

  body.site-home .section-subtitle,
  body.site-home .clarity-copy > p {
    font-size: 16px;
  }

  body.site-home .process-grid-premium,
  body.site-home .specialties-grid {
    grid-template-columns: 1fr;
  }

  body.site-home .quote-strip {
    padding-top: 36px;
    padding-bottom: 36px;
  }

  body.site-home .final-cta-card {
    border-radius: 18px;
    padding: 30px 22px;
  }

  body.site-home .final-cta-card h2 {
    font-size: clamp(30px, 8.9vw, 38px);
  }

  body.site-home .final-cta-card p {
    font-size: 16px;
    margin-bottom: 18px;
  }

  body.site-home .final-cta-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body.site-home .final-cta-actions .home-btn {
    width: 100%;
    min-height: 50px;
  }

  body.site-home .site-footer {
    padding-top: 52px;
  }

  body.site-home .site-footer .footer-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* ==========================================================
   ACCESSIBILITY — PREFERS-REDUCED-MOTION
   Disables animations for users who prefer reduced motion.
   ========================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .scroll-reveal,
  .scroll-reveal-left,
  .scroll-reveal-right,
  .scroll-reveal-scale {
    opacity: 1;
    transform: none;
    transition: none;
  }

  main,
  .app-shell,
  .portal-content {
    animation: none;
  }

  .loading-spinner {
    animation: spin 1.5s linear infinite; /* Keep spinner functional */
  }
}

/* ==========================================================
   ACCESSIBILITY — ENHANCED FOCUS STYLES (WCAG AA)
   ========================================================== */

/* Global focus-visible ring */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Remove outline for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* Enhanced focus for buttons */
.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: var(--shadow-focus);
}

/* Enhanced focus for form controls */
.form-control:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
}

/* Enhanced focus for links */
a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Skip to content link (accessibility) */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 10000;
  padding: 12px 24px;
  background: var(--primary);
  color: white;
  font-weight: 600;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  text-decoration: none;
  transition: top var(--transition-fast);
}

.skip-to-content:focus {
  top: 0;
}

/* ==========================================================
   ADDITIONAL UTILITY CLASSES
   ========================================================== */

/* Flexbox utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Padding utilities */
.p-0 { padding: 0; }
.p-2 { padding: var(--space-2); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

/* Display utilities */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

/* Width */
.w-full { width: 100%; }
.max-w-sm { max-width: 480px; }
.max-w-md { max-width: 640px; }
.max-w-lg { max-width: 800px; }
.max-w-xl { max-width: 1024px; }

/* Border radius */
.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: 999px; }

/* Shadows */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }
.shadow-none { box-shadow: none; }

/* Text colors */
.text-primary { color: var(--primary); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger { color: var(--color-danger); }
.text-muted { color: var(--neutral-dark); }

/* Background colors */
.bg-primary { background-color: var(--primary); }
.bg-primary-light { background-color: var(--primary-light); }
.bg-success-light { background-color: #ECFDF5; }
.bg-warning-light { background-color: #FFFBEB; }
.bg-danger-light { background-color: #FEF2F2; }
.bg-white { background-color: white; }

/* Truncation */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================
   SIDEBAR ALERT DOT (Unseen notifications indicator)
   ========================================================== */
.alert-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-danger);
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
  animation: pulse 2s ease-in-out infinite;
  vertical-align: middle;
  margin-left: 6px;
}

/* ==========================================================
   RTL ENHANCEMENTS
   ========================================================== */
[dir="rtl"] .footer-links a:hover {
  transform: translateX(-2px);
}

[dir="rtl"] .portal-nav a:hover {
  transform: translateX(-4px);
}

[dir="rtl"] .alert-dot {
  margin-left: 0;
  margin-right: 6px;
}

/* RTL: flip scroll-reveal directional animations */
[dir="rtl"] .scroll-reveal-left {
  transform: translateX(30px);
}
[dir="rtl"] .scroll-reveal-right {
  transform: translateX(-30px);
}

/* RTL: flip progress bar gradient direction */
[dir="rtl"] .progress-bar-fill {
  background: linear-gradient(270deg, var(--primary), var(--accent-blue));
}
[dir="rtl"] .progress-bar-fill.success {
  background: linear-gradient(270deg, var(--color-success), #34D399);
}
[dir="rtl"] .progress-bar-fill.warning {
  background: linear-gradient(270deg, var(--color-warning), #FBBF24);
}

/* RTL: tooltip centering works with translateX(-50%) */
/* RTL: dropdown menu already uses opacity/visibility — no flip needed */

/* ==========================================================
   PROFESSIONAL TABLE STYLING
   ========================================================== */

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

table,
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.table thead th,
table thead th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--neutral-dark);
  background: var(--neutral-light);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.table tbody td,
table tbody td {
  padding: 12px 16px;
  color: var(--neutral-black);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

.table tbody tr:hover,
table tbody tr:hover {
  background: var(--primary-ultra-light);
}

.table tbody tr:last-child td,
table tbody tr:last-child td {
  border-bottom: none;
}

/* Striped variant */
.table-striped tbody tr:nth-child(even) {
  background: var(--neutral-offwhite);
}

.table-striped tbody tr:nth-child(even):hover {
  background: var(--primary-ultra-light);
}

/* RTL table alignment */
[dir="rtl"] .table thead th,
[dir="rtl"] table thead th {
  text-align: right;
}

/* ==========================================================
   TOAST / FLASH NOTIFICATION COMPONENT
   ========================================================== */

.toast,
.flash-message {
  position: relative;
  padding: 14px 20px 14px 16px;
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--primary);
  background: var(--primary-ultra-light);
  color: var(--neutral-black);
  font-size: var(--text-sm);
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: fadeInDown 0.3s var(--ease-out);
  margin-bottom: var(--space-4);
}

.toast-success,
.flash-message.success {
  border-left-color: var(--color-success);
  background: #ECFDF5;
}

.toast-warning,
.flash-message.warning {
  border-left-color: var(--color-warning);
  background: #FFFBEB;
}

.toast-danger,
.flash-message.danger,
.flash-message.error {
  border-left-color: var(--color-danger);
  background: #FEF2F2;
}

.toast-close,
.flash-message .close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--neutral-dark);
  font-size: 16px;
  transition: all var(--transition-fast);
}

.toast-close:hover,
.flash-message .close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--neutral-black);
}

/* RTL flash close button */
[dir="rtl"] .toast-close,
[dir="rtl"] .flash-message .close {
  right: auto;
  left: 12px;
}

[dir="rtl"] .toast,
[dir="rtl"] .flash-message {
  border-left: none;
  border-right: 4px solid var(--primary);
  padding: 14px 16px 14px 20px;
}

[dir="rtl"] .toast-success,
[dir="rtl"] .flash-message.success {
  border-right-color: var(--color-success);
}

[dir="rtl"] .toast-warning,
[dir="rtl"] .flash-message.warning {
  border-right-color: var(--color-warning);
}

[dir="rtl"] .toast-danger,
[dir="rtl"] .flash-message.danger,
[dir="rtl"] .flash-message.error {
  border-right-color: var(--color-danger);
}

/* ==========================================================
   PROGRESS BAR / STATUS BAR
   ========================================================== */

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--neutral-light);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent-blue));
  border-radius: 999px;
  transition: width 0.6s var(--ease-out);
}

.progress-bar-fill.success {
  background: linear-gradient(90deg, var(--color-success), #34D399);
}

.progress-bar-fill.warning {
  background: linear-gradient(90deg, var(--color-warning), #FBBF24);
}

.progress-bar-fill.danger {
  background: linear-gradient(90deg, var(--color-danger), #F87171);
}

/* ==========================================================
   TOOLTIP COMPONENT
   ========================================================== */

[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--neutral-black);
  color: white;
  font-size: var(--text-xs);
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-very-fast), transform var(--transition-very-fast);
  z-index: 9999;
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================
   EMPTY STATE COMPONENT
   ========================================================== */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-12) var(--space-8);
  color: var(--neutral-dark);
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin-bottom: var(--space-4);
  border-radius: var(--radius-xl);
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 24px;
}

.empty-state h3 {
  margin-bottom: var(--space-2);
  color: var(--neutral-black);
  font-size: var(--text-lg);
}

.empty-state p {
  max-width: 400px;
  color: var(--neutral-dark);
  font-size: var(--text-sm);
  line-height: 1.6;
  margin-bottom: var(--space-6);
}

/* ==========================================================
   ENHANCED MOBILE RESPONSIVENESS
   ========================================================== */

@media (max-width: 480px) {
  /* Ensure all interactive elements meet 44px touch targets */
  .btn,
  .portal-top-tabs a,
  .portal-nav a,
  .portal-filter-chip,
  .nav-link {
    min-height: 44px;
  }

  /* Stack portal page header actions */
  .portal-page-actions {
    width: 100%;
  }

  .portal-page-actions .btn {
    flex: 1;
    min-width: 0;
  }

  /* Full-width KPI tiles on small screens */
  .portal-kpi-row {
    grid-template-columns: 1fr;
  }

  /* Toast/flash full width */
  .toast,
  .flash-message {
    border-radius: var(--radius);
  }
}

/* ==========================================================
   SCROLL REVEAL JAVASCRIPT HELPER
   Include this <script> in your layout to enable scroll animations:

   <script>
   (function() {
     var els = document.querySelectorAll('.scroll-reveal, .scroll-reveal-left, .scroll-reveal-right, .scroll-reveal-scale');
     if (!els.length) return;
     var observer = new IntersectionObserver(function(entries) {
       entries.forEach(function(entry) {
         if (entry.isIntersecting) {
           entry.target.classList.add('is-visible');
           observer.unobserve(entry.target);
         }
       });
     }, { threshold: 0.1, rootMargin: '0px 0px -50px 0px' });
     els.forEach(function(el) { observer.observe(el); });
   })();
   </script>
   ========================================================== */

/* Coming Soon - Pre-Launch CTA */
.btn-coming-soon {
  background: #6b7280 !important;
  color: #d1d5db !important;
  cursor: not-allowed !important;
  pointer-events: none;
  opacity: 0.7;
  position: relative;
  border: none;
  border-radius: 8px;
  padding: 10px 24px;
  font-weight: 600;
  display: inline-block;
}
.btn-coming-soon::after {
  content: 'Feb 28';
  font-size: 0.65em;
  background: #f59e0b;
  color: #000;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 8px;
  vertical-align: middle;
}

/* ====== LEGAL & CONTENT PAGES ====== */

.content-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 40px 48px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
  border: 1px solid #e5e7eb;
}

.legal-page h1 {
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
}

.legal-page .subtitle {
  font-size: 16px;
  color: #64748b;
  margin-bottom: 8px;
}

.legal-page h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 32px 0 12px;
  color: #0f172a;
}

.legal-page h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 24px 0 8px;
  color: #1e293b;
}

.legal-page p,
.legal-page li {
  font-size: 15px;
  line-height: 1.7;
  color: #334155;
  margin-bottom: 12px;
}

.legal-page ul,
.legal-page ol {
  padding-left: 24px;
  margin-bottom: 16px;
}

.legal-page .legal-updated {
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 32px;
}

.legal-page table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
}

.legal-page th,
.legal-page td {
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  text-align: left;
  font-size: 14px;
}

.legal-page th {
  background: #f8fafc;
  font-weight: 600;
}

.legal-page a {
  color: var(--primary, #0066CC);
  text-decoration: none;
}

.legal-page a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .content-card {
    padding: 24px 20px;
  }
}

/* ====== SERVICES PAGE ====== */

.services-hero {
  text-align: center;
  margin-bottom: 32px;
}

.services-hero h1 {
  font-size: 32px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
}

.services-hero .subtitle {
  font-size: 16px;
  color: #64748b;
  max-width: 600px;
  margin: 0 auto;
}

.services-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 32px;
}

.filter-tab {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-tab:hover {
  background: #e2e8f0;
}

.filter-tab.active {
  background: var(--primary, #0066CC);
  color: #fff;
  border-color: var(--primary, #0066CC);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.service-card {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.service-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.service-card-header {
  margin-bottom: 12px;
}

.service-specialty-tag {
  display: inline-block;
  background: var(--primary-light, #E6F0FF);
  color: var(--primary, #0066CC);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
}

.service-card-name {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}

.service-card-desc {
  font-size: 14px;
  line-height: 1.6;
  color: #64748b;
  flex: 1;
  margin-bottom: 16px;
}

.service-card-footer {
  border-top: 1px solid #f1f5f9;
  padding-top: 16px;
}

.service-card-price {
  margin-bottom: 4px;
}

.price-currency {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

.price-amount {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  margin-left: 4px;
}

.service-card-sla {
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 12px;
}

.service-card-cta {
  display: inline-block;
  background: var(--primary, #0066CC);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s ease;
}

.service-card-cta:hover {
  background: var(--primary-hover, #0052A3);
}

.services-bottom {
  margin-bottom: 24px;
}

.services-bottom .content-card {
  text-align: center;
  padding: 32px;
}

.services-bottom h2 {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}

.services-bottom p {
  color: #64748b;
  margin-bottom: 16px;
}

.btn-primary-link {
  display: inline-block;
  background: var(--primary, #0066CC);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s ease;
}

.btn-primary-link:hover {
  background: var(--primary-hover, #0052A3);
}

.services-price-note {
  text-align: center;
  padding: 16px;
}

.services-price-note p {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.6;
}

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

/* ====== CONTACT PAGE ====== */

.contact-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 24px 0 32px;
}

.contact-info-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}

.contact-icon {
  margin-bottom: 12px;
}

.contact-info-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}

.contact-info-card p {
  font-size: 14px;
  color: #475569;
  margin: 0;
}

.contact-info-card a {
  color: var(--primary, #0066CC);
  text-decoration: none;
}

.contact-info-card a:hover {
  text-decoration: underline;
}

.contact-form {
  margin: 16px 0 32px;
}

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

.contact-form .form-group {
  margin-bottom: 16px;
}

.contact-form .form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 6px;
}

.contact-form .form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
}

.contact-form .form-control:focus {
  outline: none;
  border-color: var(--primary, #0066CC);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.contact-hours {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #e2e8f0;
}

.contact-response-note {
  font-size: 13px;
  color: #94a3b8;
  font-style: italic;
}

.contact-social {
  margin-top: 16px;
}

.contact-social a {
  color: var(--primary, #0066CC);
  text-decoration: none;
  font-weight: 500;
}

.contact-social a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .contact-form .form-row {
    grid-template-columns: 1fr;
  }
  .contact-cards {
    grid-template-columns: 1fr;
  }
}

/* ====== FOOTER COLUMNS ====== */

.footer-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-col a {
  color: var(--neutral-gray, #9CA3AF);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.15s ease;
}

.footer-col a:hover {
  color: #fff;
}

.footer-col p {
  color: var(--neutral-gray, #9CA3AF);
  font-size: 14px;
  margin: 0;
}

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