/* ============================================================
   SVG Cable TV Network — Design System
   Sri Venkata Gayathri Cable TV Network
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&family=Noto+Sans+Telugu:wght@400;500;600;700&family=Noto+Serif+Telugu:wght@400;600;700&family=Inter:wght@400;500;600;700&family=Roboto:wght@400;500;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* ── CSS Custom Properties ─────────────────────────────────── */
:root {
  /* Brand Palette */
  --navy-950: #020813;
  --navy-900: #070e2b;
  --navy-800: #0d1b3e;
  --navy-700: #132252;
  --navy-600: #1a2d6b;
  --navy-500: #223888;

  --blue-700: #0d47a1;
  --blue-600: #1565c0;
  --blue-500: #1e88e5;
  --blue-400: #42a5f5;
  --blue-300: #90caf9;
  --blue-200: #bbdefb;
  --blue-100: #e3f2fd;

  --orange-700: #bf360c;
  --orange-600: #e64a19;
  --orange-500: #ff6a00;
  --orange-400: #ff8c00;
  --orange-300: #ffb74d;
  --orange-200: #ffcc80;

  --gold-600: #f57f17;
  --gold-500: #ffb300;
  --gold-400: #ffd54f;

  --green-500: #00c853;
  --green-400: #69f0ae;
  --red-500: #f44336;
  --red-400: #ef5350;
  --yellow-500: #ffc107;
  --yellow-400: #ffca28;

  /* Semantic Background */
  --bg-base:     var(--navy-900);
  --bg-surface:  var(--navy-800);
  --bg-elevated: var(--navy-700);
  --bg-card:     rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --bg-glass:    rgba(13, 27, 62, 0.7);
  --bg-overlay:  rgba(2, 8, 19, 0.85);

  /* Semantic Text */
  --text-primary:   #e8eeff;
  --text-secondary: #8ba3cc;
  --text-muted:     #4d6a99;
  --text-accent:    var(--blue-400);
  --text-orange:    var(--orange-400);
  --text-success:   var(--green-400);
  --text-danger:    var(--red-400);
  --text-warning:   var(--yellow-500);

  /* Semantic Borders */
  --border-subtle:  rgba(255, 255, 255, 0.06);
  --border-card:    rgba(30, 136, 229, 0.18);
  --border-orange:  rgba(255, 106, 0, 0.3);
  --border-focus:   var(--blue-500);

  /* Gradients */
  --grad-brand:      linear-gradient(135deg, var(--blue-600), var(--orange-500));
  --grad-brand-soft: linear-gradient(135deg, rgba(21,101,192,0.15), rgba(255,106,0,0.15));
  --grad-hero:       linear-gradient(135deg, #020813 0%, #070e2b 40%, #0d1b3e 100%);
  --grad-blue:       linear-gradient(135deg, var(--navy-800), var(--navy-700));
  --grad-card:       linear-gradient(145deg, rgba(255,255,255,0.06), rgba(255,255,255,0.01));
  --grad-text-brand: linear-gradient(135deg, var(--blue-400), var(--orange-400));
  --grad-text-blue:  linear-gradient(135deg, var(--blue-300), var(--blue-500));
  --grad-orange:     linear-gradient(135deg, var(--orange-500), var(--orange-300));
  --grad-green:      linear-gradient(135deg, #00c853, #69f0ae);

  /* Shadows */
  --shadow-xs:     0 1px 4px rgba(0,0,0,0.3);
  --shadow-sm:     0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:     0 8px 24px rgba(0,0,0,0.35);
  --shadow-lg:     0 16px 48px rgba(0,0,0,0.45);
  --shadow-xl:     0 24px 80px rgba(0,0,0,0.55);
  --shadow-glow-blue:   0 0 24px rgba(30,136,229,0.25), 0 0 48px rgba(30,136,229,0.1);
  --shadow-glow-orange: 0 0 24px rgba(255,106,0,0.25), 0 0 48px rgba(255,106,0,0.1);
  --shadow-glow-card:   0 0 0 1px rgba(30,136,229,0.2), 0 8px 32px rgba(0,0,0,0.4);

  /* Typography */
  --font-heading: 'Poppins', 'Outfit', 'Inter', system-ui, sans-serif;
  --font-body:    'Poppins', 'Inter', 'Roboto', system-ui, sans-serif;
  --font-telugu:  'Noto Sans Telugu', 'Noto Serif Telugu', sans-serif;
  --font-telugu-serif: 'Noto Serif Telugu', 'Noto Sans Telugu', serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  /* Type Scale */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;
  --text-6xl:  3.75rem;
  --text-7xl:  4.5rem;

  /* Line Heights */
  --leading-tight:  1.2;
  --leading-snug:   1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose:  1.8;

  /* Spacing Scale */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Border Radius */
  --radius-xs:  4px;
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-2xl: 32px;
  --radius-full: 9999px;

  /* Transitions */
  --ease-out:    cubic-bezier(0.0, 0.0, 0.2, 1);
  --ease-in:     cubic-bezier(0.4, 0.0, 1, 1);
  --ease-in-out: cubic-bezier(0.4, 0.0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast:   150ms;
  --duration-base:   300ms;
  --duration-slow:   500ms;
  --duration-slower: 800ms;

  /* Z-index Scale */
  --z-base:   1;
  --z-raised: 10;
  --z-overlay: 50;
  --z-nav:    100;
  --z-modal:  200;
  --z-toast:  300;
  --z-top:    400;

  /* Layout */
  --container-sm:  640px;
  --container-md:  768px;
  --container-lg:  1024px;
  --container-xl:  1280px;
  --container-2xl: 1440px;
  --nav-height: 72px;
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100% !important;
}

body {
  font-family: 'Poppins', 'Inter', 'Roboto', sans-serif;
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--text-primary);
  background-color: #050c1f;
  background-image:
    radial-gradient(ellipse 80% 40% at 10% 0%,   rgba(13, 71, 161, 0.28) 0%, transparent 55%),
    radial-gradient(ellipse 60% 35% at 90% 5%,   rgba(26, 35, 126, 0.22) 0%, transparent 50%),
    radial-gradient(ellipse 50% 30% at 50% 50%,  rgba(7, 14, 43, 0.6) 0%, transparent 70%),
    radial-gradient(ellipse 70% 40% at 85% 100%, rgba(230, 74, 25, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse 40% 30% at 15% 90%,  rgba(21, 101, 192, 0.10) 0%, transparent 50%),
    linear-gradient(170deg, #040a18 0%, #060d22 30%, #070e2b 60%, #08102e 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100% !important;
  position: relative;
}

/* Multilingual & Regional Font Rules */
html[lang="te"],
.telugu-text,
[lang="te"] {
  font-family: 'Noto Sans Telugu', 'Noto Serif Telugu', 'Poppins', sans-serif;
}

.telugu-serif {
  font-family: 'Noto Serif Telugu', 'Noto Sans Telugu', serif;
}

.hindi-text,
[lang="hi"] {
  font-family: 'Noto Sans Devanagari', 'Poppins', 'Inter', sans-serif;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

a {
  color: var(--blue-400);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover { color: var(--blue-300); }

ul, ol { list-style: none; }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--navy-900); }
::-webkit-scrollbar-thumb {
  background: var(--navy-600);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--blue-600); }

/* ── Selection ─────────────────────────────────────────────── */
::selection {
  background: rgba(30, 136, 229, 0.35);
  color: var(--blue-200);
}

/* ── Focus States (WCAG 2.4.7 AA Compliant) ─────────────────── */
:focus-visible {
  outline: 2px solid #00c8ff !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 4px rgba(0, 200, 255, 0.25) !important;
  border-radius: var(--radius-xs);
}

/* ── Screen Reader & Accessibility Utilities ────────────────── */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: absolute;
  top: -120px;
  left: 16px;
  z-index: 100000;
  background: var(--blue-600);
  color: #ffffff !important;
  padding: 12px 20px;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 700;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 15px rgba(0, 159, 227, 0.5);
  text-decoration: none;
  transition: top 0.2s var(--ease-out);
}

.skip-link:focus {
  top: 16px;
  outline: 3px solid #ffaa00 !important;
  outline-offset: 3px !important;
}

/* ── Typography (Phase 9 Improvements) ─────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: var(--leading-tight);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 5.5vw, 3.75rem); font-weight: 800; line-height: 1.12; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.5rem, 3.8vw, 2.5rem); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.75rem); font-weight: 600; line-height: 1.28; letter-spacing: -0.01em; }
h4 { font-size: clamp(1.05rem, 1.8vw, 1.35rem); font-weight: 600; line-height: 1.35; }
h5 { font-size: var(--text-lg); font-weight: 600; }
h6 { font-size: var(--text-base); font-weight: 500; }

p {
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-3);
  font-size: clamp(0.92rem, 1vw, 1.05rem);
}

p:last-child {
  margin-bottom: 0;
}

.text-gradient-brand {
  background: var(--grad-text-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-blue {
  background: var(--grad-text-blue);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-orange {
  background: var(--grad-orange);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Performance & Rendering Optimizations (Phase 10) ──────── */
.footer-cta,
.faq-section,
.site-footer {
  content-visibility: auto;
  contain-intrinsic-size: 1px 350px;
}

.card,
.plan-card,
.service-card,
.hero-glass-badge {
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* ── Layout ────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.container-sm { max-width: var(--container-sm); }
.container-md { max-width: var(--container-md); }
.container-lg { max-width: var(--container-lg); }
.container-2xl { max-width: var(--container-2xl); }

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

.section-sm { padding-block: var(--space-16); }
.section-lg { padding-block: var(--space-32); }

.section-header {
  text-align: center;
  margin-bottom: var(--space-16);
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange-400);
  background: rgba(255,106,0,0.1);
  border: 1px solid rgba(255,106,0,0.2);
  border-radius: var(--radius-full);
  padding: var(--space-1) var(--space-4);
  margin-bottom: var(--space-4);
}

.section-title {
  margin-bottom: var(--space-4);
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 640px;
  margin-inline: auto;
  line-height: var(--leading-relaxed);
}

/* ── Grid System ───────────────────────────────────────────── */
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); gap: var(--space-6); }
.grid-3 { grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.grid-4 { grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-6); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.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); }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all var(--duration-base) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-card);
  pointer-events: none;
  border-radius: inherit;
}

.card:hover {
  border-color: rgba(30, 136, 229, 0.35);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-card);
}

.card-glow-blue {
  box-shadow: var(--shadow-glow-blue);
  border-color: rgba(30,136,229,0.3);
}

.card-glow-orange {
  box-shadow: var(--shadow-glow-orange);
  border-color: rgba(255,106,0,0.3);
}

.card-featured {
  border-color: var(--orange-500);
  background: linear-gradient(145deg, rgba(255,106,0,0.08), rgba(255,106,0,0.02));
  box-shadow: var(--shadow-glow-orange), inset 0 0 80px rgba(255,106,0,0.04);
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all var(--duration-base) var(--ease-out);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  text-decoration: none;
  -webkit-user-select: none;
  user-select: none;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--duration-fast) var(--ease-out);
  border-radius: inherit;
}

.btn:hover::after { background: rgba(255,255,255,0.08); }
.btn:active::after { background: rgba(0,0,0,0.1); }
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 4px 16px rgba(255,106,0,0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(255,106,0,0.4), 0 2px 8px rgba(21,101,192,0.3);
  transform: translateY(-1px);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  color: var(--blue-300);
  border: 1.5px solid rgba(30,136,229,0.4);
}

.btn-secondary:hover {
  background: rgba(30,136,229,0.1);
  border-color: var(--blue-400);
  color: var(--blue-200);
  transform: translateY(-1px);
}

.btn-orange {
  background: var(--orange-500);
  color: #fff;
  box-shadow: 0 4px 16px rgba(255,106,0,0.35);
}

.btn-orange:hover {
  background: var(--orange-400);
  box-shadow: 0 6px 24px rgba(255,106,0,0.5);
  transform: translateY(-1px);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

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

.btn-success {
  background: linear-gradient(135deg, #00c853, #00e676);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,200,83,0.3);
}

.btn-danger {
  background: linear-gradient(135deg, #f44336, #ef5350);
  color: #fff;
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
  font-weight: 700;
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  border-radius: var(--radius-md);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
}

.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ── Badges / Status ───────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-blue   { background: rgba(30,136,229,0.15); color: var(--blue-300); border: 1px solid rgba(30,136,229,0.25); }
.badge-orange { background: rgba(255,106,0,0.15);  color: var(--orange-300); border: 1px solid rgba(255,106,0,0.25); }
.badge-green  { background: rgba(0,200,83,0.15);   color: var(--green-400); border: 1px solid rgba(0,200,83,0.25); }
.badge-red    { background: rgba(244,67,54,0.15);  color: var(--red-400); border: 1px solid rgba(244,67,54,0.25); }
.badge-yellow { background: rgba(255,193,7,0.15);  color: var(--yellow-500); border: 1px solid rgba(255,193,7,0.25); }
.badge-gray   { background: rgba(255,255,255,0.06); color: var(--text-secondary); border: 1px solid var(--border-subtle); }

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-active   { background: var(--green-500); box-shadow: 0 0 6px var(--green-500); }
.status-inactive { background: var(--red-500); }
.status-pending  { background: var(--yellow-500); }
.status-suspended{ background: var(--orange-500); }

/* ── Forms ─────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.form-label .required { color: var(--orange-400); }

.form-control {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: rgba(255,255,255,0.04);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-base);
  transition: all var(--duration-fast) var(--ease-out);
  -webkit-appearance: none;
  appearance: none;
}

.form-control::placeholder { color: var(--text-muted); }

.form-control:hover { border-color: rgba(30,136,229,0.3); }

.form-control:focus {
  outline: none;
  border-color: var(--blue-500);
  background: rgba(30,136,229,0.05);
  box-shadow: 0 0 0 3px rgba(30,136,229,0.15);
}

.form-control.is-invalid {
  border-color: var(--red-500);
  background: rgba(244,67,54,0.04);
}

.form-control.is-valid {
  border-color: var(--green-500);
  background: rgba(0,200,83,0.04);
}

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

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238ba3cc' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: var(--space-10);
  cursor: pointer;
}

select.form-control option { background: var(--navy-800); color: var(--text-primary); }

.form-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--red-400);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: var(--space-4);
  color: var(--text-muted);
  pointer-events: none;
  z-index: 1;
}

.input-group .form-control { padding-left: var(--space-10); }

.input-group-append {
  position: absolute;
  right: var(--space-2);
}

/* ── Tables ────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-card);
}

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

.table thead tr {
  background: rgba(30,136,229,0.08);
  border-bottom: 1px solid var(--border-card);
}

.table th {
  padding: var(--space-4) var(--space-5);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.table td {
  padding: var(--space-4) var(--space-5);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

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

.table tbody tr {
  transition: background var(--duration-fast) var(--ease-out);
}

.table tbody tr:hover { background: rgba(255,255,255,0.03); }

/* ── Dividers ──────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border-subtle);
  margin-block: var(--space-6);
}

.divider-gradient {
  background: linear-gradient(90deg, transparent, var(--blue-600), transparent);
}

/* ── Utilities ─────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-orange    { color: var(--orange-400); }
.text-blue      { color: var(--blue-400); }
.text-green     { color: var(--green-400); }
.text-red       { color: var(--red-400); }
.text-gold      { color: var(--gold-400); }
.text-white     { color: #fff; }

.font-heading { font-family: var(--font-heading); }
.font-body    { font-family: var(--font-body); }
.font-light   { font-weight: 300; }
.font-normal  { font-weight: 400; }
.font-medium  { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold    { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-black   { font-weight: 900; }

.text-xs  { font-size: var(--text-xs); }
.text-sm  { font-size: var(--text-sm); }
.text-base{ font-size: var(--text-base); }
.text-lg  { font-size: var(--text-lg); }
.text-xl  { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }

.opacity-50  { opacity: 0.5; }
.opacity-75  { opacity: 0.75; }

.w-full  { width: 100%; }
.h-full  { height: 100%; }
.min-h-screen { min-height: 100vh; }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.inset-0 { inset: 0; }
.z-10 { z-index: var(--z-raised); }
.z-nav { z-index: var(--z-nav); }

.hidden { display: none !important; }
.block  { display: block; }
.inline-flex { display: inline-flex; }
.inline-block { display: inline-block; }

.pointer { cursor: pointer; }
.select-none { -webkit-user-select: none; user-select: none; }

/* Spacing utilities */
.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); }
.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); }
.mx-auto { margin-inline: auto; }
.p-4   { padding: var(--space-4); }
.p-6   { padding: var(--space-6); }
.px-4  { padding-inline: var(--space-4); }
.px-6  { padding-inline: var(--space-6); }
.py-2  { padding-block: var(--space-2); }
.py-4  { padding-block: var(--space-4); }
.py-6  { padding-block: var(--space-6); }

/* ── Glass Morphism ────────────────────────────────────────── */
.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.1);
}

.glass-dark {
  background: rgba(7,14,43,0.8);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.07);
}

/* ── Gradient Borders ──────────────────────────────────────── */
.border-gradient {
  position: relative;
  border-radius: var(--radius-xl);
}

.border-gradient::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: var(--grad-brand);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ── Alerts / Toasts ───────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  border: 1px solid;
}

.alert-info    { background: rgba(30,136,229,0.1);  border-color: rgba(30,136,229,0.25);  color: var(--blue-300); }
.alert-success { background: rgba(0,200,83,0.1);    border-color: rgba(0,200,83,0.25);    color: var(--green-400); }
.alert-warning { background: rgba(255,193,7,0.1);   border-color: rgba(255,193,7,0.25);   color: var(--yellow-500); }
.alert-danger  { background: rgba(244,67,54,0.1);   border-color: rgba(244,67,54,0.25);   color: var(--red-400); }

.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* ── Modal ─────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-base) var(--ease-out);
}

.modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--navy-800);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: translateY(20px) scale(0.97);
  transition: transform var(--duration-base) var(--ease-spring);
}

.modal-backdrop.is-open .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.modal-close {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast) var(--ease-out);
}

.modal-close:hover { color: var(--text-primary); background: var(--bg-card-hover); }

/* ── Skeleton Loader ───────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.04) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ── Progress Bar ──────────────────────────────────────────── */
.progress {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--grad-brand);
  border-radius: var(--radius-full);
  transition: width var(--duration-slow) var(--ease-out);
}

/* ── Tabs ──────────────────────────────────────────────────── */
.tab-nav {
  display: flex;
  gap: var(--space-1);
  padding: var(--space-1);
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  width: fit-content;
  margin-inline: auto;
}

.tab-btn {
  padding: var(--space-2) var(--space-6);
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-out);
}

.tab-btn.is-active {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255,106,0,0.25);
}

/* ── Accordion ─────────────────────────────────────────────── */
.accordion-item {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--duration-fast) var(--ease-out);
}

.accordion-item:hover { border-color: var(--border-card); }

.accordion-trigger {
  width: 100%;
  padding: var(--space-5) var(--space-6);
  background: var(--bg-card);
  border: none;
  color: var(--text-primary);
  font-size: var(--text-base);
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  transition: background var(--duration-fast) var(--ease-out);
}

.accordion-trigger:hover { background: var(--bg-card-hover); }

.accordion-icon {
  flex-shrink: 0;
  color: var(--blue-400);
  transition: transform var(--duration-base) var(--ease-out);
}

.accordion-item.is-open .accordion-icon { transform: rotate(180deg); }

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--duration-base) var(--ease-out);
}

.accordion-body-inner {
  padding: var(--space-5) var(--space-6);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  border-top: 1px solid var(--border-subtle);
}

/* ── Steps / Stepper ───────────────────────────────────────── */
.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: var(--space-8);
}

.step {
  display: flex;
  align-items: center;
  flex: 1;
}

.step-indicator {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-sm);
  flex-shrink: 0;
  border: 2px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-muted);
  transition: all var(--duration-base) var(--ease-out);
}

.step.is-active .step-indicator {
  background: var(--grad-brand);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(255,106,0,0.2);
}

.step.is-done .step-indicator {
  background: var(--green-500);
  border-color: transparent;
  color: #fff;
}

.step-line {
  flex: 1;
  height: 2px;
  background: var(--border-subtle);
  transition: background var(--duration-base) var(--ease-out);
}

.step.is-done + .step .step-line,
.step.is-done .step-line { background: var(--green-500); }

.step-label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-muted);
  margin-top: var(--space-2);
  white-space: nowrap;
}

.step.is-active .step-label { color: var(--orange-400); }
.step.is-done  .step-label  { color: var(--green-400); }

/* ── Pagination ────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  justify-content: center;
  margin-top: var(--space-6);
}

.page-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.page-btn:hover { border-color: var(--blue-500); color: var(--blue-400); background: rgba(30,136,229,0.08); }
.page-btn.is-active { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.page-btn:disabled { opacity: 0.4; pointer-events: none; }

/* ── Tooltip ───────────────────────────────────────────────── */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy-700);
  color: var(--text-primary);
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out);
  border: 1px solid var(--border-subtle);
}

[data-tooltip]:hover::before { opacity: 1; }

/* ── Search Bar ────────────────────────────────────────────── */
.search-bar {
  position: relative;
  display: flex;
  align-items: center;
}

.search-bar .search-icon {
  position: absolute;
  left: var(--space-4);
  color: var(--text-muted);
  pointer-events: none;
}

.search-bar input {
  width: 100%;
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-10);
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: var(--text-sm);
  transition: all var(--duration-fast) var(--ease-out);
}

.search-bar input:focus {
  border-color: var(--blue-500);
  outline: none;
  background: rgba(30,136,229,0.05);
}

.search-bar input::placeholder { color: var(--text-muted); }

/* ── Icon Box ──────────────────────────────────────────────── */
.icon-box {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-box-blue   { background: rgba(30,136,229,0.15); color: var(--blue-400); }
.icon-box-orange { background: rgba(255,106,0,0.15);  color: var(--orange-400); }
.icon-box-green  { background: rgba(0,200,83,0.15);   color: var(--green-400); }
.icon-box-red    { background: rgba(244,67,54,0.15);  color: var(--red-400); }
.icon-box-gold   { background: rgba(255,179,0,0.15);  color: var(--gold-400); }
.icon-box-purple { background: rgba(156,39,176,0.15); color: #ce93d8; }

/* ── KPI Card ──────────────────────────────────────────────── */
.kpi-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.kpi-value {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.kpi-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 500;
}

.kpi-change {
  font-size: var(--text-xs);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: var(--space-1);
}

.kpi-change-up   { color: var(--green-400); }
.kpi-change-down { color: var(--red-400); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root {
    --nav-height: 68px;
  }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .section { padding-block: var(--space-16); }
}

@media (max-width: 768px) {
  :root {
    --nav-height: 64px;
  }
  .container { padding-inline: var(--space-4); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding-block: var(--space-12); }
  .section-sm { padding-block: var(--space-8); }
  .section-header { margin-bottom: var(--space-10); }
  .section-label { font-size: 11px; }
  .section-subtitle { font-size: var(--text-base); }
  .tab-nav { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tab-btn { flex: 1; text-align: center; padding: var(--space-2) var(--space-3); font-size: var(--text-xs); white-space: nowrap; }
  .modal { padding: var(--space-5); border-radius: var(--radius-xl); max-width: calc(100vw - 32px); margin: var(--space-4); }
  
  /* Prevent iOS Safari auto-zoom on input focus */
  input, select, textarea, .form-control {
    font-size: 16px !important;
  }
}

@media (max-width: 480px) {
  .container { padding-inline: var(--space-4); }
  .btn { min-height: 42px; }
  .btn-lg { padding: var(--space-3) var(--space-5); font-size: var(--text-sm); }
  .stepper { flex-wrap: nowrap; overflow-x: auto; padding-bottom: var(--space-4); -webkit-overflow-scrolling: touch; }
  .card { padding: var(--space-5); border-radius: var(--radius-lg); }
  .kpi-card { flex-direction: row; gap: var(--space-3); }
  .kpi-value { font-size: var(--text-2xl); }
}

@media (max-width: 360px) {
  .container { padding-inline: var(--space-3); }
  .btn-lg { padding: var(--space-2) var(--space-4); font-size: var(--text-xs); }
  .card { padding: var(--space-4); }
}
