/* ============================================================
   PEFINDO BI · Financial Dashboard — Design System
   ------------------------------------------------------------
   PEFINDO brand: navy #0B2A5B, gold #F4A016, cyan #00B0F0
   Adaptive light/dark, glass surfaces, motion-first.
   ============================================================ */

:root {
  --pf-navy:      #0B2A5B;
  --pf-navy-2:    #143A75;
  --pf-navy-3:    #1D4C93;
  --pf-gold:      #F4A016;
  --pf-cyan:      #00B0F0;
  --pf-mint:      #16C79A;
  --pf-rose:      #F56C6C;
  --pf-violet:    #8B5CF6;
  --pf-lime:      #A3E635;

  --bg:           #F5F7FB;
  --bg-2:         #EEF2F9;
  --panel:        #FFFFFF;
  --panel-soft:   rgba(255,255,255,0.72);
  --border:       #E4E9F2;
  --border-soft:  #EEF1F6;
  --text:         #0E1B3D;
  --text-soft:    #4B5A7A;
  --text-muted:   #8592AE;

  --shadow-sm:    0 1px 2px rgba(11,42,91,0.06), 0 1px 3px rgba(11,42,91,0.04);
  --shadow-md:    0 4px 10px rgba(11,42,91,0.06), 0 8px 24px rgba(11,42,91,0.06);
  --shadow-lg:    0 12px 32px rgba(11,42,91,0.10), 0 24px 60px rgba(11,42,91,0.10);
  --radius-sm:    8px;
  --radius:       14px;
  --radius-lg:    20px;

  --grad-blue:    linear-gradient(135deg, #143A75 0%, #1D4C93 60%, #00B0F0 100%);
  --grad-gold:    linear-gradient(135deg, #C77A00 0%, #F4A016 100%);
  --grad-mint:    linear-gradient(135deg, #0F9E7A 0%, #16C79A 100%);
  --grad-rose:    linear-gradient(135deg, #C0392B 0%, #F56C6C 100%);
  --grad-violet:  linear-gradient(135deg, #6D28D9 0%, #8B5CF6 100%);
  --grad-cyan:    linear-gradient(135deg, #007FB0 0%, #00B0F0 100%);
}

html.dark {
  --bg:           #060B1E;
  --bg-2:         #0A1230;
  --panel:        #0F1B3F;
  --panel-soft:   rgba(15,27,63,0.72);
  --border:       #1B2A57;
  --border-soft:  #15214A;
  --text:         #E8ECF7;
  --text-soft:    #A9B5D3;
  --text-muted:   #6C7BA0;

  --shadow-sm:    0 1px 2px rgba(0,0,0,0.4);
  --shadow-md:    0 4px 10px rgba(0,0,0,0.35), 0 8px 24px rgba(0,0,0,0.35);
  --shadow-lg:    0 12px 32px rgba(0,0,0,0.5), 0 24px 60px rgba(0,0,0,0.5);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin:0; padding:0; height:100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
  overflow: hidden;
}
button { font-family: inherit; }
::selection { background: rgba(0,176,240,0.35); }

/* ---------- Scrollbars ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(133,146,174,0.35);
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(133,146,174,0.55); }

/* ============================================================
   Layout
   ============================================================ */
.app-root {
  display: grid;
  grid-template-rows: 64px 1fr;
  height: 100vh;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

/* ---------- Header ---------- */
.pf-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  background: var(--panel-soft);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 40;
}

.pf-brand {
  display: flex; align-items: center; gap: 12px;
  min-width: 240px;
}
.pf-logo {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--grad-blue);
  color: white;
  display: grid; place-items: center;
  font-weight: 800;
  letter-spacing: 0.5px;
  box-shadow: 0 6px 16px rgba(20,58,117,0.4);
  position: relative;
  overflow: hidden;
}
.pf-logo::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.35), transparent 60%);
}
.pf-brand-name {
  display: flex; flex-direction: column; line-height: 1.15;
}
.pf-brand-name b { font-weight: 800; font-size: 14px; }
.pf-brand-name small { color: var(--text-muted); font-size: 11px; letter-spacing: 0.3px; }

.pf-header .spacer { flex: 1; }

/* ---------- Global filters ---------- */
.pf-filters {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.pf-filter {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease;
  font-size: 12.5px;
}
.pf-filter:hover { background: var(--bg-2); }
.pf-filter .label { color: var(--text-muted); font-weight: 500; }
.pf-filter .value { font-weight: 700; color: var(--text); }
.pf-filter .caret { color: var(--text-muted); font-size: 10px; }
.pf-filter .divider { width: 1px; height: 18px; background: var(--border); }

.pf-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 10px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  transition: all .15s ease;
  box-shadow: var(--shadow-sm);
}
.pf-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.pf-btn.primary {
  background: var(--grad-blue);
  color: white;
  border-color: transparent;
}
.pf-btn.ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.pf-btn.ghost:hover { background: var(--bg-2); box-shadow: none; }
.pf-btn.icon { padding: 8px; }

.pf-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(0,176,240,0.12);
  color: var(--pf-cyan);
}
.pf-badge.pos { background: rgba(22,199,154,0.15); color: var(--pf-mint); }
.pf-badge.neg { background: rgba(245,108,108,0.15); color: var(--pf-rose); }
.pf-badge.warn { background: rgba(244,160,22,0.18); color: var(--pf-gold); }

.pf-user {
  display: flex; align-items: center; gap: 8px;
  padding-left: 8px;
  padding-right: 4px;
}
.pf-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--grad-gold);
  color: #3b2a00;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 12.5px;
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   Body layout: tabs + content + right panel
   ============================================================ */
.app-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  overflow: hidden;
}

.pf-tabs {
  border-right: 1px solid var(--border);
  background: var(--panel-soft);
  backdrop-filter: blur(10px);
  padding: 16px 12px;
  display: flex; flex-direction: column; gap: 4px;
  overflow-y: auto;
}
.pf-tabs .group-label {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 12px 12px 6px;
}
.pf-tab {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-soft);
  cursor: pointer;
  transition: all .15s ease;
  font-size: 13px;
  font-weight: 500;
  position: relative;
}
.pf-tab:hover { background: var(--bg-2); color: var(--text); }
.pf-tab.active {
  background: var(--grad-blue);
  color: white;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(20,58,117,0.25);
}
.pf-tab .tab-icon {
  width: 22px; height: 22px;
  border-radius: 6px;
  display: grid; place-items: center;
  background: rgba(133,146,174,0.15);
  color: currentColor;
}
.pf-tab.active .tab-icon { background: rgba(255,255,255,0.2); }
.pf-tab .tab-badge {
  margin-left: auto;
  font-size: 10px;
  background: rgba(244,160,22,0.2);
  color: var(--pf-gold);
  border-radius: 999px;
  padding: 1px 7px;
  font-weight: 700;
}
.pf-tab.active .tab-badge { background: rgba(255,255,255,0.25); color: white; }

.pf-content {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 22px 40px;
  scroll-behavior: smooth;
}

/* ---------- Page header ---------- */
.pf-page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.pf-page-title {
  display: flex; flex-direction: column; gap: 4px;
}
.pf-page-title h1 {
  margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.2px;
}
.pf-page-title p { margin: 0; color: var(--text-muted); font-size: 13px; }
.pf-page-actions { display: flex; gap: 8px; }

/* ============================================================
   Grid + cards
   ============================================================ */
.pf-grid { display: grid; gap: 16px; }
.g-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; }
.col-12 { grid-column: span 12; }

.pf-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
  overflow: hidden;
}
.pf-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(0,176,240,0.35);
}
.pf-card.no-hover:hover { transform: none; }
.pf-card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}
.pf-card-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.pf-card-head h3 .info-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg-2);
  color: var(--text-muted);
  font-size: 10px; font-weight: 700;
  display: grid; place-items: center;
  cursor: help;
}
.pf-card-actions {
  display: flex; align-items: center; gap: 4px;
}
.pf-card-actions .pf-btn {
  padding: 4px 8px; font-size: 11px; box-shadow: none;
}

.pf-chart {
  width: 100%;
  min-height: 200px;
}

/* ============================================================
   KPI card
   ============================================================ */
.kpi-card {
  padding: 16px 18px;
  position: relative;
  min-height: 158px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: var(--kpi-accent, var(--grad-blue));
  filter: blur(50px);
  opacity: 0.16;
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}
.kpi-card:hover::before { opacity: 0.35; transform: scale(1.15); }
.kpi-card .kpi-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.kpi-card .kpi-title {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.kpi-card .kpi-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--kpi-accent, var(--grad-blue));
  color: white;
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(20,58,117,0.3);
}
.kpi-card .kpi-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1.1;
  font-family: 'Inter';
  display: flex; align-items: baseline; gap: 6px;
}
.kpi-card .kpi-value small { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.kpi-card .kpi-sub {
  display: flex; align-items: center; gap: 8px;
  margin-top: 6px;
  font-size: 12px;
}
.kpi-card .kpi-sub .row { display: flex; align-items: center; gap: 4px; color: var(--text-muted); }
.kpi-card .kpi-sub .row b { color: var(--text); font-weight: 600; }
.kpi-card .kpi-sparkline {
  height: 46px;
  margin-top: auto;
  margin-left: -6px;
  margin-right: -6px;
  margin-bottom: -6px;
}
.kpi-card .kpi-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--border-soft);
  overflow: hidden;
  margin-top: 10px;
}
.kpi-card .kpi-progress .fill {
  height: 100%;
  background: var(--kpi-accent, var(--grad-blue));
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(.4,0,.2,1);
}

.trend { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; }
.trend.up { color: var(--pf-mint); }
.trend.down { color: var(--pf-rose); }

/* ============================================================
   Ratio pill
   ============================================================ */
.ratio-card {
  padding: 14px 16px;
  min-height: 140px;
  display: flex; flex-direction: column;
  position: relative;
  overflow: hidden;
}
.ratio-card .ring {
  width: 68px; height: 68px;
  flex-shrink: 0;
}
.ratio-card .rc-body {
  display: flex; gap: 14px; align-items: center;
  margin-top: 4px;
}
.ratio-card .rc-num {
  font-size: 20px; font-weight: 800;
  letter-spacing: -0.3px;
}
.ratio-card .rc-title {
  font-size: 11.5px; color: var(--text-muted); font-weight: 600;
  letter-spacing: 0.5px; text-transform: uppercase;
}
.ratio-card .rc-line {
  display: flex; justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-soft);
  margin-top: 4px;
}
.ratio-card .rc-line b { color: var(--text); font-weight: 600; }
.ratio-card .rc-compare {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.ratio-card .rc-compare .cell small { color: var(--text-muted); font-size: 10.5px; letter-spacing: 0.3px; text-transform: uppercase; }
.ratio-card .rc-compare .cell b { font-size: 13px; font-weight: 700; }

/* ============================================================
   Panels: AI Insights + Compare + Drilldown
   ============================================================ */
.pf-drawer-mask {
  position: fixed; inset: 0;
  background: rgba(6,11,30,0.55);
  backdrop-filter: blur(4px);
  z-index: 60;
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.pf-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 420px;
  background: var(--panel);
  border-left: 1px solid var(--border);
  z-index: 61;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  animation: slideL .22s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes slideL { from { transform: translateX(30px); opacity: 0 } to { transform: none; opacity: 1 } }
.pf-drawer .head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.pf-drawer .head h3 { margin: 0; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.pf-drawer .body { flex: 1; overflow-y: auto; padding: 16px 18px; }

.ai-insight {
  display: flex; gap: 10px;
  padding: 12px;
  background: var(--bg-2);
  border-radius: 12px;
  margin-bottom: 10px;
  border-left: 3px solid var(--pf-cyan);
  animation: appear .3s ease both;
}
.ai-insight.pos { border-left-color: var(--pf-mint); }
.ai-insight.neg { border-left-color: var(--pf-rose); }
.ai-insight.warn { border-left-color: var(--pf-gold); }
.ai-insight .ic {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--pf-cyan);
  color: white;
  display: grid; place-items: center;
  flex-shrink: 0;
  font-size: 12px;
}
.ai-insight.pos .ic { background: var(--pf-mint); }
.ai-insight.neg .ic { background: var(--pf-rose); }
.ai-insight.warn .ic { background: var(--pf-gold); }
.ai-insight .txt { font-size: 12.5px; line-height: 1.55; color: var(--text-soft); }
.ai-insight .txt b { color: var(--text); }
@keyframes appear { from { opacity: 0; transform: translateY(4px) } to { opacity: 1; transform: none } }

/* Modal */
.pf-modal {
  position: fixed; top: 8vh; left: 50%;
  transform: translateX(-50%);
  width: min(90vw, 1080px);
  max-height: 84vh;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  z-index: 71;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: pop .18s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes pop { from { opacity: 0; transform: translateX(-50%) scale(.96) } to { opacity: 1; transform: translateX(-50%) scale(1) } }
.pf-modal .head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.pf-modal .head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.pf-modal .body { flex: 1; overflow-y: auto; padding: 18px 20px; }

/* ============================================================
   Popover / dropdown
   ============================================================ */
.pf-pop {
  position: absolute;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 80;
  min-width: 220px;
  animation: pop .12s ease;
}
.pf-pop .item {
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  display: flex; align-items: center; gap: 8px;
  color: var(--text-soft);
  transition: all .12s;
}
.pf-pop .item:hover { background: var(--bg-2); color: var(--text); }
.pf-pop .item.active { background: rgba(0,176,240,0.12); color: var(--pf-cyan); font-weight: 600; }
.pf-pop .sep { height: 1px; background: var(--border); margin: 6px 4px; }
.pf-pop .head { padding: 6px 10px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); font-weight: 700; }

/* Command palette */
.cmdk-mask {
  position: fixed; inset: 0;
  background: rgba(6,11,30,0.55);
  backdrop-filter: blur(6px);
  z-index: 90;
  display: grid; place-items: start center;
  padding-top: 12vh;
}
.cmdk {
  width: min(90vw, 620px);
  background: var(--panel);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  animation: pop .18s ease;
}
.cmdk .input {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.cmdk input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}
.cmdk .list { max-height: 360px; overflow-y: auto; padding: 6px; }
.cmdk .list .item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-soft);
}
.cmdk .list .item:hover, .cmdk .list .item.hi {
  background: var(--bg-2);
  color: var(--text);
}
.cmdk .list .item .ic {
  width: 26px; height: 26px; border-radius: 6px;
  background: rgba(0,176,240,0.15);
  color: var(--pf-cyan);
  display: grid; place-items: center;
}
.cmdk .list .item small { margin-left: auto; color: var(--text-muted); }

/* ============================================================
   Table
   ============================================================ */
.pf-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 13px;
}
.pf-table th {
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 11.5px;
  color: var(--text-muted);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 2;
}
.pf-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-soft);
}
.pf-table td b { color: var(--text); font-weight: 600; }
.pf-table tr:hover td { background: var(--bg-2); }
.pf-table tr.total td { background: rgba(0,176,240,0.05); font-weight: 700; color: var(--text); }

.mini-bar {
  height: 6px;
  background: var(--border-soft);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.mini-bar .fill {
  height: 100%;
  border-radius: 4px;
  background: var(--pf-cyan);
  transition: width .8s cubic-bezier(.2,.7,.3,1);
}
.mini-bar .fill.pos { background: var(--pf-mint); }
.mini-bar .fill.neg { background: var(--pf-rose); }
.mini-bar .fill.warn { background: var(--pf-gold); }

/* ============================================================
   Skeleton, loaders, toast, misc
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-2) 0%, var(--border-soft) 40%, var(--bg-2) 80%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 8px;
}
@keyframes shimmer { from { background-position: 200% 0 } to { background-position: -200% 0 } }

.toast-wrap {
  position: fixed; bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 100;
}
.toast {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  font-size: 13px;
  display: flex; align-items: center; gap: 10px;
  animation: pop .2s ease;
}
.toast.pos { border-left: 3px solid var(--pf-mint); }
.toast.warn { border-left: 3px solid var(--pf-gold); }
.toast.neg { border-left: 3px solid var(--pf-rose); }
.toast.info { border-left: 3px solid var(--pf-cyan); }

/* segmented control */
.seg {
  display: inline-flex;
  background: var(--bg-2);
  border-radius: 8px;
  padding: 2px;
}
.seg button {
  border: none;
  background: transparent;
  padding: 4px 10px;
  font-size: 11.5px;
  color: var(--text-soft);
  cursor: pointer;
  border-radius: 6px;
  font-weight: 600;
  transition: all .15s;
}
.seg button.on {
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* what-if slider */
.whatif {
  padding: 14px;
  background: linear-gradient(135deg, rgba(0,176,240,0.06), rgba(139,92,246,0.06));
  border-radius: 12px;
  border: 1px dashed rgba(0,176,240,0.35);
}
.whatif label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.whatif input[type=range] {
  width: 100%;
  accent-color: var(--pf-cyan);
}
.whatif .result {
  margin-top: 10px;
  font-size: 20px;
  font-weight: 800;
  color: var(--pf-cyan);
}

/* section heading */
.pf-section-title {
  display: flex; align-items: center; gap: 10px;
  margin: 20px 0 10px;
  padding: 0 4px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.pf-section-title .dash {
  flex: 1; height: 1px; background: var(--border);
}

/* fullscreen overlay for charts */
.fs-overlay {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 100;
  padding: 40px;
  display: flex; flex-direction: column;
  animation: fade .18s;
}

/* keyboard chip */
.kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  color: var(--text-soft);
  padding: 1px 6px;
  border-radius: 5px;
}

/* pulse dot */
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--pf-mint);
  box-shadow: 0 0 0 0 rgba(22,199,154,0.7);
  animation: pulse 1.8s infinite;
  display: inline-block;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(22,199,154,0.7); }
  60%  { box-shadow: 0 0 0 8px rgba(22,199,154,0); }
  100% { box-shadow: 0 0 0 0 rgba(22,199,154,0); }
}

/* util */
.hstack { display: flex; align-items: center; gap: 8px; }
.vstack { display: flex; flex-direction: column; gap: 8px; }
.grow   { flex: 1; }
.muted  { color: var(--text-muted); }
.right  { text-align: right; }
.center { text-align: center; }
.mono   { font-family: 'JetBrains Mono', monospace; }
.txt-xs { font-size: 11px; }
.txt-sm { font-size: 12px; }

/* ============================================================
   Forms (Recipient Notification)
   ============================================================ */
.pf-form {
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(0,176,240,0.04), rgba(139,92,246,0.04));
  border: 1px dashed rgba(0,176,240,0.35);
  border-radius: 12px;
}
.pf-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 16px;
}
.pf-field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.pf-field.span-2 { grid-column: span 2; }
.pf-field > span:first-child {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.pf-field em { color: var(--pf-rose); font-style: normal; margin-left: 2px; }

.pf-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.pf-input:focus {
  outline: none;
  border-color: var(--pf-cyan);
  box-shadow: 0 0 0 3px rgba(0,176,240,0.15);
}
.pf-input::placeholder { color: var(--text-muted); }
select.pf-input { cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%238592AE' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.pf-check-row { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 6px 0 4px; }
.pf-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 12.5px; }
.pf-check input[type=checkbox] { accent-color: var(--pf-cyan); width: 15px; height: 15px; }

.pf-switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; padding: 6px 0; }
.pf-switch input { display: none; }
.pf-switch .track {
  width: 34px; height: 20px;
  background: var(--border);
  border-radius: 999px;
  position: relative;
  transition: background .18s ease;
}
.pf-switch .thumb {
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: white;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease;
}
.pf-switch input:checked + .track { background: var(--pf-mint); }
.pf-switch input:checked + .track .thumb { transform: translateX(14px); }

.pf-form-errors {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(245,108,108,0.08);
  border: 1px solid rgba(245,108,108,0.3);
  border-radius: 10px;
  font-size: 12px;
  color: var(--pf-rose);
}
.pf-form-errors > div { display: flex; align-items: center; gap: 6px; margin: 2px 0; }

.pf-form-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
}

.pf-input-inline {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
}
.pf-input-inline input {
  border: 0; outline: 0; background: transparent;
  font-family: inherit; font-size: 12.5px;
  color: var(--text); width: 200px;
}

@media (max-width: 1100px) {
  .pf-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-field.span-2 { grid-column: span 2; }
}

/* ============================================================
   Data Source Upload Wizard
   ============================================================ */
/* stepper */
.pf-stepper {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 4px 18px;
  border-bottom: 1px solid var(--border-soft);
  margin: 4px 0 16px;
}
.pf-step { display: flex; align-items: center; gap: 8px; }
.pf-step .dot {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--bg-2);
  color: var(--text-muted);
  display: grid; place-items: center;
  font-weight: 700; font-size: 12px;
  border: 1.5px solid var(--border);
  transition: all .18s ease;
}
.pf-step .lbl {
  font-size: 12px; font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color .18s ease;
}
.pf-step.active .dot { background: var(--pf-cyan); color: white; border-color: var(--pf-cyan);
  box-shadow: 0 0 0 4px rgba(0,176,240,0.18); }
.pf-step.active .lbl { color: var(--text); }
.pf-step.done .dot   { background: var(--pf-mint); color: white; border-color: var(--pf-mint); }
.pf-step.done .lbl   { color: var(--text-soft); }
.pf-step-line {
  flex: 1; height: 2px; background: var(--border);
  border-radius: 999px;
  transition: background .18s ease;
}
.pf-step-line.done { background: var(--pf-mint); }

.wiz-body { min-height: 260px; padding: 4px 2px 12px; }
.wiz-footer {
  display: flex; gap: 8px; align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
}

/* source card (grid picker) */
.src-card {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  cursor: pointer;
  transition: all .18s ease;
  position: relative;
  height: 100%;
}
.src-card:hover { border-color: rgba(0,176,240,0.6); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.src-card.selected {
  border-color: var(--pf-cyan);
  background: linear-gradient(135deg, rgba(0,176,240,0.06), rgba(139,92,246,0.06));
  box-shadow: 0 0 0 3px rgba(0,176,240,0.14);
}
.src-card.static { cursor: default; }
.src-card.static:hover { transform: none; border-color: var(--border); box-shadow: var(--shadow-sm); }
.src-icon {
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--grad-blue);
  color: white;
  display: grid; place-items: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.src-icon svg { width: 20px; height: 20px; }
.src-meta { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.src-check {
  position: absolute; top: 10px; right: 10px;
  width: 22px; height: 22px;
  background: var(--pf-cyan); color: white;
  border-radius: 50%;
  display: grid; place-items: center;
}
.src-check svg { width: 12px; height: 12px; }

/* drop-zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 40px 20px;
  text-align: center;
  background: var(--panel);
  cursor: pointer;
  transition: all .18s ease;
}
.drop-zone:hover { border-color: rgba(0,176,240,0.6); background: rgba(0,176,240,0.03); }
.drop-zone.drag {
  border-color: var(--pf-cyan);
  background: rgba(0,176,240,0.08);
  transform: scale(1.01);
}
.drop-zone.has-file {
  border-style: solid;
  border-color: var(--pf-mint);
  background: rgba(22,199,154,0.05);
}
.drop-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0,176,240,0.15), rgba(139,92,246,0.15));
  color: var(--pf-cyan);
  display: inline-grid; place-items: center;
}
.drop-icon svg { width: 24px; height: 24px; }
.file-icon {
  width: 42px; height: 42px;
  background: var(--grad-mint);
  color: white;
  border-radius: 8px;
  display: grid; place-items: center;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow-sm);
}

/* column mapping grid */
.mapping-grid {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.mapping-head {
  display: grid;
  grid-template-columns: 1fr 24px 1.2fr 100px;
  gap: 12px;
  padding: 8px 14px;
  background: var(--bg-2);
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.mapping-row {
  display: grid;
  grid-template-columns: 1fr 24px 1.2fr 100px;
  gap: 12px; align-items: center;
  padding: 10px 14px;
  border-top: 1px solid var(--border-soft);
  background: var(--panel);
}
.mapping-row .arrow { display: grid; place-items: center; color: var(--text-muted); }

/* import progress */
.progress {
  height: 8px;
  background: var(--bg-2);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}
.progress .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pf-cyan), var(--pf-mint));
  border-radius: 999px;
  transition: width .35s ease;
}

/* disabled buttons */
.pf-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}
.divider-v { width: 1px; align-self: stretch; background: var(--border); }
