/* ==========================================================================
   SISTEM SEMAKAN & DASHBOARD PENILAIAN TAHAP KESEDIAAN TnD KP2027
   NEGERI TERENGGANU (JPNT / KPM)
   Design System: Modern Executive Light Theme (Calm & Professional)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Outfit:wght@500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Surface & Background (Soothing Neutral Slate) */
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-muted: #e2e8f0;
  
  /* Borders */
  --border-light: #e2e8f0;
  --border-subtle: #cbd5e1;
  --border-focus: #3b82f6;

  /* Typography Colors (High Contrast, No Eye Strain) */
  --text-heading: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  /* Brand: Royal Navy & Terengganu Gold */
  --brand-navy: #0f2b48;
  --brand-navy-light: #1e3a8a;
  --brand-blue: #2563eb;
  --brand-blue-subtle: #eff6ff;
  --brand-gold: #d97706;
  --brand-gold-subtle: #fffbeb;

  /* Status Tokens (Soft Pastels with High Readability Text) */
  --status-complete-text: #065f46;
  --status-complete-bg: #ecfdf5;
  --status-complete-border: #a7f3d0;
  --status-complete-solid: #10b981;

  --status-partial-text: #92400e;
  --status-partial-bg: #fffbeb;
  --status-partial-border: #fde68a;
  --status-partial-solid: #f59e0b;

  --status-none-text: #9f1239;
  --status-none-bg: #fff1f2;
  --status-none-border: #fecdd3;
  --status-none-solid: #f43f5e;

  /* Soft Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-modal: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;

  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Layout Container */
.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 20px 60px 20px;
}

/* Inline SVG Icon Global Style */
.svg-icon {
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  stroke-width: 2;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.15em;
  flex-shrink: 0;
}

.svg-icon-lg {
  width: 1.4em;
  height: 1.4em;
}

/* ==========================================================================
   HEADER SECTION (Refined Royal Navy Executive Card)
   ========================================================================== */
.header-card {
  background: linear-gradient(135deg, #0b1f36 0%, #112d4e 50%, #1b3d68 100%);
  border-radius: var(--radius-xl);
  padding: 26px 30px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
  color: #ffffff;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.header-card::after {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(217, 119, 6, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
}

.emblem-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fbbf24;
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.brand-info h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1.25;
}

.brand-info h1 span {
  color: #fbbf24;
  font-weight: 800;
}

.brand-info p {
  font-size: 0.86rem;
  color: #cbd5e1;
  margin-top: 3px;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  font-family: inherit;
  line-height: 1.3;
}

.btn-primary {
  background: #2563eb;
  color: #ffffff;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.btn-success {
  background: #16a34a;
  color: #ffffff;
}

.btn-success:hover {
  background: #15803d;
}

/* Header Meta Bar */
.header-meta-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 11px;
  border-radius: var(--radius-full);
  font-size: 0.77rem;
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.meta-pill strong {
  color: #ffffff;
  font-weight: 600;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
  display: inline-block;
}

/* ==========================================================================
   OFFICIAL NOTICE BANNER (Calm Blue Alert)
   ========================================================================== */
.official-notice-banner {
  background: #f0f7ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.notice-icon-box {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: #dbeafe;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1d4ed8;
  flex-shrink: 0;
  margin-top: 2px;
}

.notice-content {
  flex: 1;
}

.notice-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 4px;
}

.notice-desc {
  font-size: 0.85rem;
  color: #334155;
  line-height: 1.5;
}

.notice-stats-inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.notice-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.77rem;
  font-weight: 600;
  color: #334155;
}

/* ==========================================================================
   QUICK FILTER BAR (Segmented Pill Buttons)
   ========================================================================== */
.quick-status-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.filter-pills-container {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e2e8f0;
  padding: 4px;
  border-radius: var(--radius-lg);
  flex-wrap: wrap;
}

.status-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  background: transparent;
  color: #475569;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.status-pill-btn:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.6);
}

.status-pill-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: var(--shadow-sm);
}

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

.pill-all .pill-dot { background-color: #3b82f6; }
.pill-belum .pill-dot { background-color: #ef4444; }
.pill-partial .pill-dot { background-color: #f59e0b; }
.pill-complete .pill-dot { background-color: #10b981; }

.pill-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.06);
  color: inherit;
}

.btn-action-highlight {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #fff1f2;
  color: #e11d48;
  border: 1px solid #fecdd3;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.btn-action-highlight:hover {
  background: #ffe4e6;
  border-color: #fda4af;
}

/* ==========================================================================
   TOP KPI CARDS (Executive White Cards with Soft Accents)
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: #cbd5e1;
}

.stat-card.card-target::before { background: #2563eb; }
.stat-card.card-total::before { background: #0284c7; }
.stat-card.card-complete::before { background: #10b981; }
.stat-card.card-partial::before { background: #f59e0b; }
.stat-card.card-none::before { background: #f43f5e; }

.stat-card.is-clickable {
  cursor: pointer;
}

.stat-card.is-clickable:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-subtle);
}

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

.stat-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: var(--bg-subtle);
}

.card-target .stat-icon { background: #eff6ff; color: #2563eb; }
.card-total .stat-icon { background: #f0f9ff; color: #0284c7; }
.card-complete .stat-icon { background: #ecfdf5; color: #059669; }
.card-partial .stat-icon { background: #fffbeb; color: #d97706; }
.card-none .stat-icon { background: #fff1f2; color: #e11d48; }

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-heading);
  line-height: 1.1;
  margin-bottom: 4px;
}

.card-none .stat-value {
  color: #e11d48;
}

.stat-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.stat-progress-bar {
  height: 6px;
  background: var(--bg-muted);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.stat-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: #3b82f6;
  transition: width 0.4s ease;
}

.card-target .stat-progress-fill { background: #2563eb; }
.card-total .stat-progress-fill { background: #0284c7; }
.card-complete .stat-progress-fill { background: #10b981; }
.card-partial .stat-progress-fill { background: #f59e0b; }
.card-none .stat-progress-fill { background: #f43f5e; }

.card-hint-click {
  margin-top: 10px;
  font-size: 0.73rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-none .card-hint-click {
  color: #e11d48;
  font-weight: 600;
}

/* ==========================================================================
   PPD BREAKDOWN GRID
   ========================================================================== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-heading);
}

.section-title .badge {
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--bg-subtle);
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
}

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

.ppd-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: var(--transition);
}

.ppd-card:hover {
  transform: translateY(-2px);
  border-color: #93c5fd;
  box-shadow: var(--shadow-md);
}

.ppd-card.active-ppd {
  border-color: #2563eb;
  background: #f8faff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.ppd-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.ppd-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-heading);
}

.ppd-badge {
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--bg-subtle);
  color: var(--text-muted);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
}

.ppd-metric-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}

.ppd-pct {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: #1e3a8a;
}

.ppd-ratio {
  font-size: 0.77rem;
  color: var(--text-muted);
}

.ppd-pills-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.ppd-pill {
  flex: 1;
  text-align: center;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.ppd-pill.l {
  background: var(--status-complete-bg);
  color: var(--status-complete-text);
  border: 1px solid var(--status-complete-border);
}

.ppd-pill.s {
  background: var(--status-partial-bg);
  color: var(--status-partial-text);
  border: 1px solid var(--status-partial-border);
}

.ppd-pill.b {
  background: var(--status-none-bg);
  color: var(--status-none-text);
  border: 1px solid var(--status-none-border);
  cursor: pointer;
}

.ppd-pill.b:hover {
  background: #ffe4e6;
}

/* ==========================================================================
   CONTROLS & FILTERS SECTION
   ========================================================================== */
.controls-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 40px;
  background: var(--bg-page);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  color: var(--text-heading);
  outline: none;
  transition: var(--transition);
  font-family: inherit;
}

.search-input:focus {
  background: #ffffff;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.filter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.select-custom {
  height: 40px;
  padding: 0 32px 0 12px;
  background-color: var(--bg-page);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 10px center;
  background-repeat: no-repeat;
  background-size: 16px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  color: var(--text-body);
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  flex: 1 1 200px;
}

.select-custom:focus {
  background-color: #ffffff;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.filter-count-info {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.filter-count-info strong {
  color: var(--text-heading);
}

/* Alert Banner when filtering Belum Isi */
.active-filter-alert-banner {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.alert-banner-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.alert-banner-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: #ffe4e6;
  color: #e11d48;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.alert-banner-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #9f1239;
}

.alert-banner-desc {
  font-size: 0.8rem;
  color: #4c0519;
  margin-top: 2px;
}

.btn-banner-action {
  background: #e11d48;
  color: #ffffff;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  font-family: inherit;
}

.btn-banner-action:hover {
  background: #be123c;
}

/* ==========================================================================
   SCHOOLS DATA TABLE (Crisp White & High Contrast)
   ========================================================================== */
.table-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.86rem;
}

.custom-table thead th {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.custom-table tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition);
}

.custom-table tbody tr:hover {
  background-color: #f8fafc;
}

.custom-table tbody tr.row-unfilled {
  background-color: #fffafb;
}

.custom-table tbody tr.row-unfilled:hover {
  background-color: #fff1f2;
}

.custom-table tbody td {
  padding: 13px 16px;
  vertical-align: middle;
}

.badge-bil-surat {
  display: inline-block;
  padding: 2px 7px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-weight: 700;
}

.school-code-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.school-name-text {
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.3;
}

.school-sub-info {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.school-ppd-badge {
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
}

/* Quota Box & Dots */
.quota-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.quota-fraction {
  font-family: 'Outfit', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-heading);
}

.quota-dots {
  display: flex;
  align-items: center;
  gap: 4px;
}

.quota-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
}

.quota-dot.filled {
  background: #10b981;
}

/* Status Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-complete {
  background: var(--status-complete-bg);
  color: var(--status-complete-text);
  border: 1px solid var(--status-complete-border);
}

.badge-partial {
  background: var(--status-partial-bg);
  color: var(--status-partial-text);
  border: 1px solid var(--status-partial-border);
}

.badge-none {
  background: var(--status-none-bg);
  color: var(--status-none-text);
  border: 1px solid var(--status-none-border);
}

/* Table Action Buttons */
.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.btn-table-action {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-muted);
}

.btn-table-action:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}

.btn-table-action.btn-wa {
  color: #16a34a;
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.btn-table-action.btn-wa:hover {
  background: #dcfce7;
}

.btn-table-action.btn-info {
  color: #2563eb;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.btn-table-action.btn-info:hover {
  background: #dbeafe;
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.empty-state h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 4px;
}

.empty-state p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==========================================================================
   MODAL DIALOGS (Clean Executive White)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.active,
.modal-overlay.open {
  display: flex !important;
}

.modal-container {
  background: #ffffff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.modal-unfilled-dialog {
  max-width: 780px;
}

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

.modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-heading);
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.modal-close-btn:hover {
  color: var(--text-heading);
}

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  font-size: 0.88rem;
  color: var(--text-body);
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  background: var(--bg-subtle);
}

.detail-banner {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 0.85rem;
  border-bottom: 1px dashed #cbd5e1;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  color: var(--text-muted);
}

.detail-val {
  font-weight: 600;
  color: var(--text-heading);
  text-align: right;
}

.role-quota-list {
  list-style: none;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.role-quota-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
}

.role-badge {
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: #dbeafe;
  color: #1e40af;
  font-size: 0.75rem;
  white-space: nowrap;
}

.message-preview-box {
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: var(--text-heading);
  white-space: pre-wrap;
  line-height: 1.5;
  max-height: 280px;
  overflow-y: auto;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: none;
  align-items: center;
  gap: 10px;
  z-index: 2000;
}

.toast.show {
  display: flex;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
  .header-card {
    padding: 20px;
  }
  .brand-wrapper {
    width: 100%;
  }
  .header-actions {
    width: 100%;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .ppd-grid {
    grid-template-columns: 1fr;
  }
  .filter-pills-container {
    width: 100%;
  }
  .status-pill-btn {
    flex: 1;
    justify-content: center;
  }
}

/* Print Optimization */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .header-actions, .quick-status-filter-bar, .controls-card, .btn-table-action, .active-filter-alert-banner {
    display: none !important;
  }
  .header-card {
    background: none !important;
    color: #000000 !important;
    border: 1px solid #000000 !important;
  }
  .table-card {
    border: none !important;
    box-shadow: none !important;
  }
}
