/* ==========================================================================
   Modern Executive Dashboard & Bento Grid Design System
   Dashboard 14 Pilot Districts - Southern Border Provinces (ศอ.บต.)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700;800&family=Sarabun:wght@300;400;500;600;700&display=swap');

:root {
  /* Surface & Base */
  --bg-app: #f8fafc; /* Slate-50 */
  --bg-canvas: #ffffff;
  --bg-sidebar: #0b0f19; /* Deep Slate / Dark Indigo */
  --bg-sidebar-card: #151c2e;
  
  /* Text */
  --text-main: #0f172a; /* Slate-900 */
  --text-muted: #64748b; /* Slate-500 */
  --text-sub: #334155; /* Slate-700 */

  /* Borders & Dividers */
  --border-light: #e2e8f0; /* Slate-200 */
  --border-subtle: #f1f5f9;
  --border-focus: #3b82f6;

  /* Executive Province Identities */
  --songkhla-sky: #0284c7;
  --songkhla-light: #38bdf8;
  --songkhla-bg: #f0f9ff;
  --songkhla-border: #bae6fd;

  --yala-emerald: #059669;
  --yala-light: #34d399;
  --yala-bg: #ecfdf5;
  --yala-border: #a7f3d0;

  --narathiwat-amber: #d97706;
  --narathiwat-light: #fb923c;
  --narathiwat-bg: #fffbeb;
  --narathiwat-border: #fde68a;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

.font-prompt {
  font-family: 'Prompt', sans-serif;
}

/* -------------------------------------------------------------
   Top Global Header - 100% Full-Width Fluid Executive Bar
   ------------------------------------------------------------- */
.executive-header {
  width: 100%;
  max-width: 100%;
  margin: 0 0 0.5rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1.5rem;
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid var(--border-light);
  box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.05);
}

.live-db-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-family: 'Prompt', sans-serif;
  font-weight: 500;
  background-color: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.header-segmented-controls {
  display: inline-flex;
  background: #f1f5f9;
  padding: 0.25rem;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  gap: 0.25rem;
}

.header-seg-btn {
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  font-family: 'Prompt', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: #475569;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.header-seg-btn:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.7);
}

.header-seg-btn.active {
  background: #ffffff;
  color: #0284c7;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* -------------------------------------------------------------
   Main Slide Frame & Presentation Container - 100% Fullscreen Canvas
   ------------------------------------------------------------- */
.slide-frame {
  background-color: var(--bg-canvas);
  width: 100%;
  max-width: 100%;
  flex: 1;
  min-height: calc(100vh - 78px);
  margin: 0;
  border-radius: 14px;
  box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.03);
  display: flex;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border-light);
  transition: all 0.3s ease;
}

/* Fullscreen Mode Optimization (F11 or Button) */
:fullscreen body,
:-webkit-full-screen body {
  padding: 0 !important;
}

:fullscreen .executive-header,
:-webkit-full-screen .executive-header {
  display: none !important;
}

:fullscreen .slide-frame,
:-webkit-full-screen .slide-frame {
  max-width: 100vw;
  width: 100vw;
  min-height: 100vh;
  height: 100vh;
  margin: 0;
  border-radius: 0;
  border: none;
}

/* -------------------------------------------------------------
   Sidebar: Dark Slate / Executive Indigo Style
   ------------------------------------------------------------- */
.slide-sidebar {
  width: 240px;
  background: linear-gradient(180deg, #0b0f19 0%, #0f172a 100%);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex-shrink: 0;
  position: relative;
  z-index: 20;
  border-right: 1px solid #1e293b;
}

.sidebar-brand {
  padding-bottom: 1.25rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid #1e293b;
}

.nav-tab-btn {
  background-color: transparent;
  color: #94a3b8;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: 'Prompt', sans-serif;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.nav-tab-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
  transform: translateX(3px);
}

.nav-tab-btn.active {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.25) 0%, rgba(14, 165, 233, 0.12) 100%);
  color: #38bdf8;
  font-weight: 600;
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
}

.nav-tab-btn.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  height: 70%;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background-color: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
}

.nav-step-badge {
  font-size: 0.72rem;
  font-weight: 700;
  font-family: 'Prompt', sans-serif;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #64748b;
  letter-spacing: 0.5px;
}

.nav-tab-btn.active .nav-step-badge {
  background: rgba(56, 189, 248, 0.2);
  color: #7dd3fc;
}

/* Fullscreen Toggle Button */
.fullscreen-toggle-btn {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-family: 'Prompt', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fullscreen-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

/* -------------------------------------------------------------
   Slide Canvas & Views
   ------------------------------------------------------------- */
.slide-canvas {
  flex: 1;
  padding: 1.5rem 1.75rem;
  overflow-y: auto;
  background-color: var(--bg-canvas);
  display: flex;
  flex-direction: column;
}

.slide-title {
  font-family: 'Prompt', sans-serif;
  font-weight: 700;
  font-size: 1.45rem;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.3px;
}

/* -------------------------------------------------------------
   Executive KPI Bento Cards
   ------------------------------------------------------------- */
.kpi-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 0.85rem 1.4rem;
  text-align: left;
  min-width: 220px;
  box-shadow: 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  position: relative;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.kpi-card:hover {
  box-shadow: 0 8px 20px -4px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

.kpi-card-projects {
  border-left: 4px solid var(--narathiwat-amber);
}

.kpi-card-budget {
  border-left: 4px solid var(--songkhla-sky);
}

.kpi-title {
  font-size: 0.82rem;
  font-family: 'Prompt', sans-serif;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.kpi-value {
  font-size: 1.6rem;
  font-family: 'Prompt', sans-serif;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

/* -------------------------------------------------------------
   Screen 1: Province Executive Cards with Interactive Pills
   ------------------------------------------------------------- */
.province-executive-card {
  border: 1px solid var(--border-light);
  border-radius: 16px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.province-executive-card:hover {
  box-shadow: 0 10px 24px -4px rgba(15, 23, 42, 0.09);
  border-color: #cbd5e1;
}

.province-card-header {
  padding: 0.8rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.province-card-header h3 {
  font-family: 'Prompt', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  color: #ffffff;
}

.province-card-header .header-meta-pill {
  font-family: 'Prompt', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Summary stats band inside card */
.province-stats-band {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
  padding: 0.65rem 0.85rem;
  background-color: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
  font-family: 'Prompt', sans-serif;
}

.province-stat-item {
  font-size: 0.76rem;
  color: #64748b;
  display: flex;
  flex-direction: column;
}

.province-stat-item strong {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

/* Interactive District Grid Pills */
.province-districts-grid {
  padding: 0.7rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.4rem;
}

.district-pill-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  font-family: 'Prompt', sans-serif;
  font-size: 0.84rem;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  transition: all 0.18s ease;
}

.district-pill-btn:hover,
.district-pill-btn.sync-highlight {
  background-color: #ffffff;
  border-color: #0284c7;
  color: #0284c7;
  font-weight: 600;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.15);
}

.district-pill-btn .pill-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  background-color: #e2e8f0;
  color: #475569;
}

.district-pill-btn:hover .pill-badge,
.district-pill-btn.sync-highlight .pill-badge {
  background-color: #e0f2fe;
  color: #0284c7;
}

/* -------------------------------------------------------------
   Modern Interactive Vector Map 100% (Pure SVG Geo-Map)
   ------------------------------------------------------------- */
.map-container {
  border: 1px solid var(--border-light);
  background: radial-gradient(circle at 50% 50%, #ffffff 0%, #f8fafc 100%);
  border-radius: 20px;
  position: relative;
  overflow: visible;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.05);
}

.interactive-vector-map-box {
  position: relative;
  width: 100%;
  max-width: 960px;
  aspect-ratio: 720 / 540;
  margin: 0 auto;
}

.map-svg-canvas {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  user-select: none;
}

/* Vector Province Polygons */
.province-vector-poly {
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.province-vector-poly:hover {
  filter: brightness(1.1) drop-shadow(0 8px 16px rgba(0, 0, 0, 0.25));
  stroke-width: 3.5;
  stroke: #ffffff !important;
}

.province-vector-poly.selected {
  filter: brightness(1.15) drop-shadow(0 0 16px rgba(254, 240, 138, 0.6));
  stroke: #fef08a !important;
  stroke-width: 4 !important;
}

/* Modern Vector Interactive Pins - Stable Hover with Zero Bouncing / Jitter */
.vector-pin-group {
  cursor: pointer;
}

.vector-pin-group .hit-target {
  cursor: pointer !important;
  pointer-events: all !important;
}

.vector-pin-group circle,
.vector-pin-group path,
.vector-pin-group text,
.vector-pin-group rect,
.vector-pin-group g:not(.hit-target) {
  pointer-events: none !important;
}

/* Highlight inner pin visuals on hover WITHOUT modifying group transform/coordinates */
.vector-pin-group:hover .pin-outer-ring,
.vector-pin-group.sync-highlight .pin-outer-ring {
  stroke-width: 2.5;
  stroke: #ffffff !important;
  fill: rgba(255, 255, 255, 0.25) !important;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.8));
}

.vector-pin-group:hover .pin-badge-rect,
.vector-pin-group.sync-highlight .pin-badge-rect {
  stroke: #ffffff !important;
  stroke-width: 1.5;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6));
}

/* Map Floating Glass Tooltip - Completely Stable at Fixed Pin Position */
.map-floating-tooltip {
  position: absolute;
  pointer-events: none !important;
  user-select: none !important;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #ffffff;
  padding: 0.85rem 1.15rem;
  border-radius: 14px;
  font-family: 'Prompt', sans-serif;
  font-size: 0.84rem;
  box-shadow: 0 16px 36px -6px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.22);
  white-space: nowrap;
  opacity: 1;
  transition: opacity 0.12s ease;
}

.map-floating-tooltip.hidden {
  display: none !important;
}

/* Map Controls & Legend Overlay */
.map-controls-bar {
  position: absolute;
  top: 12px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  padding: 0.35rem 0.65rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  z-index: 10;
  font-family: 'Prompt', sans-serif;
  font-size: 0.76rem;
}

.map-control-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.map-control-btn:hover {
  background: #ffffff;
  color: #0284c7;
  border-color: #0284c7;
}

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

/* -------------------------------------------------------------
   Chart Cards & Responsive Center Metric
   ------------------------------------------------------------- */
.chart-card {
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 18px;
  box-shadow: 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  padding: 0.9rem 1.1rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  height: 260px;
  transition: all 0.2s ease;
}

.chart-card:hover {
  box-shadow: 0 8px 18px -4px rgba(15, 23, 42, 0.08);
}

.chart-card-header {
  font-size: 0.86rem;
  font-family: 'Prompt', sans-serif;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.chart-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.chart-wrapper canvas {
  max-width: 100% !important;
  max-height: 100% !important;
  display: block;
}

/* Donut Chart Center Metric Label (Handled via Chart.js Plugin for Pixel-Perfect Center Alignment) */
.donut-center-metric {
  display: none !important;
}

/* -------------------------------------------------------------
   Interactive Activities Summary Matrix Cards (s3)
   ------------------------------------------------------------- */
.activity-matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.6rem;
}

@media (min-width: 1200px) {
  .activity-matrix-grid {
    grid-template-columns: repeat(var(--activity-cols, 8), minmax(0, 1fr));
  }
}

.activity-matrix-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 0.75rem 0.65rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.activity-matrix-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--card-accent, #0284c7);
}

.activity-matrix-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px -2px rgba(15, 23, 42, 0.08);
  border-color: #cbd5e1;
}

.activity-matrix-card.active-col {
  border-color: #0284c7;
  background-color: #f0f9ff;
  box-shadow: 0 0 0 2px #0284c7;
}

.activity-matrix-card .card-code {
  font-size: 0.7rem;
  font-weight: 700;
  font-family: 'Prompt', sans-serif;
  color: #64748b;
}

.activity-matrix-card .card-name {
  font-size: 0.82rem;
  font-weight: 600;
  font-family: 'Prompt', sans-serif;
  color: #0f172a;
  margin: 0.35rem 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.activity-matrix-card .card-dept-badge {
  font-size: 0.72rem;
  font-weight: 700;
  font-family: 'Prompt', sans-serif;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: #e2e8f0;
  color: #334155;
  width: fit-content;
}

.activity-matrix-card .card-budget {
  font-size: 0.8rem;
  font-weight: 700;
  font-family: 'Prompt', sans-serif;
  color: #0284c7;
  margin-top: 0.4rem;
}

/* -------------------------------------------------------------
   Modern Data Table & CSV Export Button
   ------------------------------------------------------------- */
.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.search-input-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 0.45rem 0.85rem;
  font-family: 'Prompt', sans-serif;
  font-size: 0.84rem;
  width: 280px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.search-input-box input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  color: #0f172a;
  font-family: 'Prompt', sans-serif;
}

.btn-export-csv {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  font-family: 'Prompt', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-export-csv:hover {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

.custom-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.86rem;
  background-color: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.custom-table th {
  border-bottom: 1px solid #e2e8f0;
  padding: 0.75rem 0.85rem;
  font-weight: 600;
  font-family: 'Prompt', sans-serif;
  text-align: left;
  background-color: #f8fafc;
  color: #475569;
  white-space: nowrap;
  font-size: 0.8rem;
  letter-spacing: 0.2px;
}

.custom-table td {
  border-bottom: 1px solid #f1f5f9;
  padding: 0.7rem 0.85rem;
  color: #334155;
  vertical-align: middle;
}

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

.custom-table tr:hover td {
  background-color: #f0f9ff;
}

/* Status Pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.76rem;
  font-weight: 600;
  font-family: 'Prompt', sans-serif;
  white-space: nowrap;
}

.status-completed {
  background-color: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.status-pending {
  background-color: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.status-approved {
  background-color: #fefce8;
  color: #a16207;
  border: 1px solid #fef08a;
}

.status-in_progress {
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

/* -------------------------------------------------------------
   Executive Dossier Modal
   ------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background-color: #ffffff;
  border-radius: 20px;
  max-width: 680px;
  width: 92%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35);
  border: 1px solid var(--border-light);
  transform: scale(0.96);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.open .modal-content {
  transform: scale(1);
}

/* -------------------------------------------------------------
   SLIDE 4: SOP (Standard Operating Procedure) Styles
   ------------------------------------------------------------- */
.sop-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  min-height: 195px;
}

.sop-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--act-accent-color, #6366f1);
  transition: height 0.2s ease;
}

.sop-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 30px -8px rgba(15, 23, 42, 0.12), 0 8px 12px -6px rgba(15, 23, 42, 0.06);
  border-color: #cbd5e1;
}

.sop-card:hover::before {
  height: 6px;
}

.sop-card .sop-act-title {
  font-family: 'Prompt', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: #0f172a;
  line-height: 1.45;
  transition: color 0.15s ease;
}

.sop-card:hover .sop-act-title {
  color: #1e40af;
}

.sop-pdf-action-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.65rem 0.95rem;
  border-radius: 10px;
  background: #4472c4;
  border: 1px solid #334f7f;
  color: #ffffff !important;
  font-family: 'Prompt', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none !important;
  box-shadow: 0 2px 6px rgba(68, 114, 196, 0.25);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.sop-pdf-action-btn:hover {
  background: #365fa3;
  border-color: #243c63;
  box-shadow: 0 4px 14px rgba(68, 114, 196, 0.4);
  transform: translateY(-1px);
}

.sop-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.72rem;
  color: #475569;
  font-family: 'Prompt', sans-serif;
  font-weight: 500;
}

/* Print Mode */
@media print {
  body {
    background-color: #ffffff;
  }
  .slide-frame {
    box-shadow: none;
    border: none;
    margin: 0;
    width: 100%;
    max-width: 100%;
  }
  .slide-sidebar,
  .executive-header {
    display: none !important;
  }
}
