/* ==========================================================================
   Opportuna - Full Responsive Design System
   Mobile-first breakpoints:
     - Base: < 640px (Mobile)
     - sm: >= 640px (Large phone / small tablet)
     - md: >= 768px (Tablet)
     - lg: >= 1024px (Laptop / Desktop)
     - xl: >= 1280px (Wide desktop)
   ========================================================================== */

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-muted: #475569;
  --text-soft: #64748b;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: rgba(79, 70, 229, 0.1);
  --accent-emerald: #10b981;
  --accent-emerald-soft: rgba(16, 185, 129, 0.12);
  --accent-amber: #f59e0b;
  --accent-amber-soft: rgba(245, 158, 11, 0.14);
  --accent-rose: #ef4444;
  --accent-rose-soft: rgba(239, 68, 68, 0.12);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px -6px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 40px -12px rgba(15, 23, 42, 0.14);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  --container-max: 1240px;
  --header-h: 68px;
}

[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #111827;
  --surface-alt: #1e293b;
  --border: #1f2937;
  --border-strong: #334155;
  --text: #f8fafc;
  --text-muted: #cbd5e1;
  --text-soft: #94a3b8;
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --primary-soft: rgba(99, 102, 241, 0.18);
  --accent-emerald-soft: rgba(16, 185, 129, 0.18);
  --accent-amber-soft: rgba(245, 158, 11, 0.2);
  --accent-rose-soft: rgba(239, 68, 68, 0.2);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 26px -6px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, 0.65);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
}

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

img {
  max-width: 100%;
  display: block;
}

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

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 640px) {
  .container {
    padding: 0 24px;
  }
}

/* Announcement Bar */
.announcement-bar {
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #ffffff;
}

.announcement-bar.style-info {
  background: linear-gradient(90deg, #4338ca, #6366f1);
}

.announcement-bar.style-success {
  background: linear-gradient(90deg, #059669, #10b981);
}

.announcement-bar.style-warning {
  background: linear-gradient(90deg, #d97706, #f59e0b);
}

.announcement-link {
  background: rgba(255, 255, 255, 0.2);
  padding: 3px 12px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.8rem;
  transition: background 0.15s ease;
}

.announcement-link:hover {
  background: rgba(255, 255, 255, 0.32);
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}

[data-theme="dark"] .site-header {
  background: rgba(17, 24, 39, 0.88);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f46e5, #0ea5e9);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(79, 70, 229, 0.32);
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 6px;
}

.nav-link {
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover, .nav-link.active {
  background: var(--surface-alt);
  color: var(--text);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.icon-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--surface-alt);
}

.mobile-menu-btn {
  display: inline-grid;
}

.desktop-only-actions {
  display: none;
  align-items: center;
  gap: 8px;
}

@media (min-width: 1024px) {
  .nav-desktop {
    display: flex;
  }
  .desktop-only-actions {
    display: flex;
  }
  .mobile-menu-btn {
    display: none;
  }
}

/* Mobile Slide Drawer */
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
}

.mobile-drawer.open {
  display: block;
}

.mobile-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
}

.mobile-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 86vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

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

.drawer-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.drawer-link {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-alt);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-sm {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 0.82rem;
}

.btn-lg {
  min-height: 48px;
  padding: 12px 24px;
  font-size: 0.98rem;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--surface-alt);
}

.btn-emerald {
  background: var(--accent-emerald);
  color: #ffffff;
}

.btn-emerald:hover {
  background: #059669;
}

.btn-danger {
  background: var(--accent-rose);
  color: #ffffff;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: var(--surface-alt);
  color: var(--text);
}

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.badge-primary {
  background: var(--primary-soft);
  color: var(--primary);
}

.badge-emerald {
  background: var(--accent-emerald-soft);
  color: #059669;
}

[data-theme="dark"] .badge-emerald {
  color: #34d399;
}

.badge-amber {
  background: var(--accent-amber-soft);
  color: #b45309;
}

[data-theme="dark"] .badge-amber {
  color: #fbbf24;
}

.badge-rose {
  background: var(--accent-rose-soft);
  color: #dc2626;
}

[data-theme="dark"] .badge-rose {
  color: #f87171;
}

.badge-neutral {
  background: var(--surface-alt);
  color: var(--text-muted);
}

.count-pill {
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-full);
  padding: 1px 7px;
  font-size: 0.72rem;
  font-weight: 700;
}

/* Main Content */
.main-content {
  flex: 1;
  padding-bottom: 56px;
}

/* Flash Messages */
.messages-wrap {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.92rem;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.alert-success {
  border-color: rgba(16, 185, 129, 0.35);
  background: var(--accent-emerald-soft);
}

.alert-error, .alert-danger {
  border-color: rgba(239, 68, 68, 0.35);
  background: var(--accent-rose-soft);
}

.alert-warning {
  border-color: rgba(245, 158, 11, 0.4);
  background: var(--accent-amber-soft);
}

.alert-info {
  border-color: rgba(79, 70, 229, 0.35);
  background: var(--primary-soft);
}

/* Hero Section */
.hero {
  position: relative;
  padding: 36px 0 32px;
  background:
    radial-gradient(circle at 12% 10%, rgba(79, 70, 229, 0.14), transparent 42%),
    radial-gradient(circle at 88% 15%, rgba(14, 165, 233, 0.12), transparent 40%);
  border-bottom: 1px solid var(--border);
}

@media (min-width: 768px) {
  .hero {
    padding: 52px 0 42px;
  }
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: center;
}

@media (min-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1.4fr 0.85fr;
  }
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.hero-title {
  margin: 0 0 12px;
  font-size: clamp(1.85rem, 4vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.hero-subtitle {
  margin: 0 0 22px;
  color: var(--text-muted);
  font-size: clamp(0.98rem, 1.5vw, 1.12rem);
  max-width: 620px;
}

.hero-search-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 8px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (min-width: 640px) {
  .hero-search-box {
    flex-direction: row;
    align-items: center;
  }
}

.hero-search-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
}

.hero-search-input {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.96rem;
  min-height: 42px;
  outline: none;
}

.hero-stats-panel {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.stat-value {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-soft);
  font-weight: 600;
  margin-top: 4px;
}

/* Horizontal Scroll Category Bar */
.category-strip-wrap {
  margin: 24px 0 18px;
  position: relative;
}

.category-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}

.category-strip::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.cat-pill:hover {
  border-color: var(--primary);
  color: var(--text);
}

.cat-pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.cat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Filter Toolbar */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 1024px) {
  .filter-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.filter-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 640px) {
  .filter-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .filter-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
  }
}

.filter-toggles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
}

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}

/* Section Headers */
.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 0 16px;
}

.section-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Opportunity Grid & Cards */
.opp-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

@media (min-width: 640px) {
  .opp-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .opp-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.opp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  position: relative;
}

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

.opp-card.featured {
  border-color: rgba(79, 70, 229, 0.4);
  background: linear-gradient(180deg, rgba(79, 70, 229, 0.04) 0%, var(--surface) 45%);
}

.opp-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.opp-org-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.org-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #ffffff;
  flex-shrink: 0;
  font-size: 0.95rem;
}

.opp-org-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.opp-title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.35;
}

.opp-title a:hover {
  color: var(--primary);
}

.opp-summary {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.opp-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.opp-card-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.82rem;
}

/* Detail Page Layout */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 24px;
}

@media (min-width: 1024px) {
  .detail-layout {
    grid-template-columns: 1.65fr 0.95fr;
    align-items: start;
  }
}

.card-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
  .card-panel {
    padding: 28px;
  }
}

.sticky-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 20px);
}

.detail-cover {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.detail-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.detail-section h2 {
  margin: 0 0 10px;
  font-size: 1.12rem;
  font-weight: 700;
}

.prose {
  color: var(--text-muted);
  font-size: 0.97rem;
  line-height: 1.72;
  white-space: pre-line;
}

.share-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 10px;
}

/* Forms */
.form-shell {
  max-width: 820px;
  margin: 28px auto 0;
}

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

@media (min-width: 640px) {
  .form-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text);
}

.form-help {
  font-size: 0.78rem;
  color: var(--text-soft);
}

.form-error {
  font-size: 0.8rem;
  color: var(--accent-rose);
  font-weight: 600;
}

.form-input {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 0.92rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

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

.form-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Newsletter CTA Banner */
.cta-banner {
  margin-top: 44px;
  background: linear-gradient(135deg, #312e81, #4f46e5 55%, #0284c7);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: center;
  box-shadow: var(--shadow-lg);
}

@media (min-width: 900px) {
  .cta-banner {
    padding: 36px 40px;
    grid-template-columns: 1.2fr 1fr;
  }
}

.cta-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (min-width: 640px) {
  .cta-form-row {
    display: flex;
    gap: 8px;
  }
}

.cta-input {
  width: 100%;
  min-height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  padding: 10px 14px;
  font-size: 0.92rem;
}

.cta-input::placeholder {
  color: rgba(255, 255, 255, 0.78);
}

/* Pagination */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
}

.page-link {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.88rem;
}

.page-link.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* ==========================================================================
   Admin Control Center Layout & Responsive Tables
   ========================================================================== */
.control-shell {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

@media (min-width: 1024px) {
  .control-shell {
    grid-template-columns: 240px minmax(0, 1fr);
    align-items: start;
  }
}

.control-nav {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px;
  display: flex;
  overflow-x: auto;
  gap: 6px;
}

@media (min-width: 1024px) {
  .control-nav {
    flex-direction: column;
    position: sticky;
    top: calc(var(--header-h) + 20px);
  }
}

.control-nav-item {
  flex-shrink: 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.control-nav-item:hover, .control-nav-item.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

@media (min-width: 768px) {
  .kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Responsive Data Table -> Stacked Cards on Mobile */
.responsive-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th, .data-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table th {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  background: var(--surface-alt);
}

@media (max-width: 767px) {
  .data-table thead {
    display: none;
  }
  .data-table, .data-table tbody, .data-table tr, .data-table td {
    display: block;
    width: 100%;
  }
  .data-table tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    margin-bottom: 12px;
  }
  .data-table td {
    border-bottom: 1px dashed var(--border);
    padding: 8px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    text-align: right;
  }
  .data-table td:last-child {
    border-bottom: none;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .data-table td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 0.78rem;
    color: var(--text-soft);
    text-align: left;
  }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 36px 0;
  margin-top: auto;
}

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

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr;
  }
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

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

.empty-state {
  text-align: center;
  padding: 48px 20px;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}

/* ==========================================================================
   Social Sharing Modal, Social Buttons & Mobile Sticky Bar
   ========================================================================== */
.share-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.share-modal.open {
  display: flex;
}

.share-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(4px);
}

.share-modal-dialog {
  position: relative;
  width: min(480px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 1;
}

.share-social-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

@media (min-width: 480px) {
  .share-social-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.social-btn:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
}

.social-btn-wa { background: #25d366; color: #ffffff; border-color: #25d366; }
.social-btn-tg { background: #0088cc; color: #ffffff; border-color: #0088cc; }
.social-btn-li { background: #0a66c2; color: #ffffff; border-color: #0a66c2; }
.social-btn-x  { background: #0f172a; color: #ffffff; border-color: #334155; }
.social-btn-fb { background: #1877f2; color: #ffffff; border-color: #1877f2; }

.mobile-sticky-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 55;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  gap: 10px;
  box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.08);
}

[data-theme="dark"] .mobile-sticky-bar {
  background: rgba(17, 24, 39, 0.94);
}

@media (min-width: 1024px) {
  .mobile-sticky-bar {
    display: none;
  }
}

/* ==========================================================================
   Google AdSense Compliant Containers (Anti-CLS & Clear Ad Labeling)
   ========================================================================== */
.ad-slot-wrapper {
  margin: 24px 0;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.ad-slot-wrapper.ad-in-feed {
  grid-column: 1 / -1;
  margin: 4px 0;
}

.ad-slot-wrapper.ad-sidebar {
  margin: 0;
  min-height: 260px;
}

.ad-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.ad-placeholder {
  width: 100%;
  min-height: 76px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px;
  color: var(--text-soft);
  font-size: 0.84rem;
}

.ad-placeholder.ad-sidebar-box {
  min-height: 220px;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
  }
}

/* ==========================================================================
   Breadcrumbs, Editorial Guides & GDPR/AdSense Cookie Consent Banner
   ========================================================================== */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  color: var(--text-soft);
  margin-bottom: 14px;
}

.breadcrumbs a:hover {
  color: var(--primary);
}

.guide-takeaways {
  background: var(--primary-soft);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 16px 20px;
  margin: 18px 0;
}

.guide-takeaways ul {
  margin: 8px 0 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text);
}

.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 95;
  max-width: 680px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  gap: 12px;
}

.cookie-banner.visible {
  display: flex;
}

@media (min-width: 640px) {
  .cookie-banner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.readiness-bar {
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--surface-alt);
  overflow: hidden;
  border: 1px solid var(--border);
}

.readiness-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent-emerald));
  transition: width 0.3s ease;
}
