/* ═══════════════════════════════════════════════
   B2Bco CRM Hub — Design System
═══════════════════════════════════════════════ */

:root {
  --bg:          #05080F;
  --surface:     #0B1020;
  --card:        rgba(255,255,255,0.032);
  --card-h:      rgba(255,255,255,0.055);
  --border:      rgba(255,255,255,0.065);
  --border-hi:   rgba(124,92,246,0.45);

  --t1:  #E8EBF3;
  --t2:  #8A94A8;
  --t3:  #454F66;

  --purple:     #7C5CF6;
  --purple-lt:  #9D7FFB;
  --purple-dim: rgba(124,92,246,0.12);

  --teal:       #0FD4A0;
  --teal-dim:   rgba(15,212,160,0.10);

  --amber:      #F59E0B;
  --amber-dim:  rgba(245,158,11,0.10);

  --red:        #FF4D6D;
  --red-dim:    rgba(255,77,109,0.10);

  --blue:       #3B82F6;
  --blue-dim:   rgba(59,130,246,0.10);

  --sidebar-w:  228px;
  --topbar-h:   58px;

  --r:   12px;
  --r-s:  8px;
  --r-xs: 5px;

  --shadow:  0 4px 24px rgba(0,0,0,.35);
  --ease:    cubic-bezier(0.22,1,0.36,1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--t1);
  display: flex;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════
   SIDEBAR
══════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  gap: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.brand-glow {
  font-size: 22px;
  filter: drop-shadow(0 0 10px rgba(124,92,246,.9));
}

.brand-name {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, var(--purple-lt), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-sub {
  font-size: 9.5px;
  color: var(--t3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .7px;
  -webkit-text-fill-color: var(--t3);
}

/* Nav */
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.nav-sep {
  flex: 1;
  min-height: 20px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: var(--r-s);
  background: transparent;
  color: var(--t2);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  text-align: left;
}

.nav-item:hover {
  background: var(--card);
  color: var(--t1);
}

.nav-item.active {
  background: var(--purple-dim);
  color: var(--purple-lt);
  font-weight: 600;
}

.nav-item.active svg {
  stroke: var(--purple-lt);
}

/* ══════════════════════════════════════
   MAIN AREA
══════════════════════════════════════ */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Top bar */
.top-bar {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(5,8,15,.88);
  backdrop-filter: blur(14px);
  flex-shrink: 0;
  gap: 12px;
}

.page-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Period tabs */
.period-tabs {
  display: flex;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  padding: 2px;
}

.ptab {
  padding: 4px 14px;
  border: none;
  background: transparent;
  color: var(--t2);
  font-size: 12px;
  font-weight: 700;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: .2px;
  transition: all .18s;
}

.ptab:hover { color: var(--t1); background: rgba(255,255,255,.05); }

.ptab.active {
  background: var(--purple);
  color: #fff;
  box-shadow: 0 0 12px rgba(124,92,246,.4);
}

.ctrl-select {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  color: var(--t1);
  padding: 6px 11px;
  border-radius: var(--r-xs);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}

.ctrl-select option { background: #0B1020; }

.icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--t2);
  border-radius: var(--r-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}

.icon-btn:hover { border-color: var(--border-hi); background: var(--purple-dim); color: var(--t1); }

/* Content */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 22px 24px 48px;
  position: relative;
}

/* ══════════════════════════════════════
   LOADING / ERROR
══════════════════════════════════════ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5,8,15,.8);
  backdrop-filter: blur(5px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 200;
  color: var(--t2);
  font-size: 13px;
  transition: opacity .3s;
}

.loading-overlay.hidden { opacity: 0; pointer-events: none; }

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.err-bar {
  background: var(--red-dim);
  border: 1px solid rgba(255,77,109,.3);
  color: #FF8FA3;
  border-radius: var(--r-s);
  padding: 10px 16px;
  font-size: 13px;
  margin-bottom: 18px;
}

.hidden { display: none !important; }

/* ══════════════════════════════════════
   KPIs
══════════════════════════════════════ */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.kpi {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform .25s var(--ease), box-shadow .25s;
}

.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.kpi.meetings { border-color: rgba(124,92,246,.35); background: var(--purple-dim); }
.kpi.won      { border-color: rgba(15,212,160,.35); background: var(--teal-dim); }
.kpi.spend    { border-color: rgba(245,158,11,.3);  background: var(--amber-dim); }

.kpi-ico { font-size: 26px; flex-shrink: 0; }
.kpi-val { font-size: 28px; font-weight: 900; letter-spacing: -1.5px; line-height: 1; }
.kpi-lbl { font-size: 10.5px; color: var(--t2); margin-top: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.kpi-sub { font-size: 10.5px; color: var(--t3); margin-top: 2px; }

/* ══════════════════════════════════════
   DASHBOARD GRID
══════════════════════════════════════ */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 18px;
}

/* Card */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  backdrop-filter: blur(8px);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 14px;
}

.card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--t1);
}

.pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 100px;
  letter-spacing: .3px;
}

.pill.purple { background: var(--purple-dim); border: 1px solid rgba(124,92,246,.35); color: var(--purple-lt); }

/* Funnel */
.funnel-body { padding: 0 22px 22px; display: flex; flex-direction: column; }

.f-stage { opacity: 0; animation: fadeIn .4s var(--ease) forwards; }
@keyframes fadeIn { from { opacity:0; transform:translateX(-12px); } to { opacity:1; transform:none; } }
.f-stage:nth-child(1) { animation-delay:.04s; }
.f-stage:nth-child(2) { animation-delay:.09s; }
.f-stage:nth-child(3) { animation-delay:.14s; }
.f-stage:nth-child(4) { animation-delay:.19s; }
.f-stage:nth-child(5) { animation-delay:.24s; }
.f-stage:nth-child(6) { animation-delay:.29s; }
.f-stage:nth-child(7) { animation-delay:.34s; }
.f-stage:nth-child(8) { animation-delay:.39s; }

.f-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5px;
  padding: 0 2px;
}

.f-name  { font-size: 12.5px; font-weight: 500; }
.f-count { font-size: 13.5px; font-weight: 800; letter-spacing: -.5px; }

.f-track {
  height: 28px;
  background: rgba(255,255,255,.03);
  border-radius: 4px;
  overflow: hidden;
}

.f-fill {
  height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding-left: 10px;
  transition: width 1s var(--ease);
  min-width: 40px;
}

.f-fill span { font-size: 10.5px; font-weight: 700; color: rgba(255,255,255,.85); white-space: nowrap; }

.g0 { background: linear-gradient(90deg, #7C5CF6, #9D7FFB); }
.g1 { background: linear-gradient(90deg, #6047DC, #8670F5); }
.g2 { background: linear-gradient(90deg, #4437BD, #6A55EC); }
.g3 { background: linear-gradient(90deg, #3B5BDB, #5B80F0); }
.g4 { background: linear-gradient(90deg, #1E86C3, #28A8DC); }
.g5 { background: linear-gradient(90deg, #0EB8B8, #12D5CA); }
.g6 { background: linear-gradient(90deg, #0FC89A, #14D5A6); }
.gwon { background: linear-gradient(90deg, #0FD4A0, #0BBD8C); box-shadow: 0 0 14px rgba(15,212,160,.2); }

.f-connector {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0 6px 4px;
}

.f-line {
  width: 2px;
  height: 18px;
  background: linear-gradient(to bottom, rgba(124,92,246,.2), rgba(15,212,160,.2));
  border-radius: 1px;
  flex-shrink: 0;
}

.f-conv {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 100px;
  border: 1px solid;
  line-height: 1.6;
  letter-spacing: .2px;
}

.f-conv.good   { color: var(--teal);  border-color: rgba(15,212,160,.4);  background: var(--teal-dim);  }
.f-conv.medium { color: var(--amber); border-color: rgba(245,158,11,.4);  background: var(--amber-dim); }
.f-conv.low    { color: var(--red);   border-color: rgba(255,77,109,.4);  background: var(--red-dim);   }

/* Right col */
.right-col { display: flex; flex-direction: column; gap: 12px; }

/* CAC cards */
.cac-card { padding: 18px 20px; }
.cac-lbl  { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--t2); margin-bottom: 8px; }
.cac-val  { font-size: 32px; font-weight: 900; letter-spacing: -1.8px; line-height: 1; }
.cac-sub  { font-size: 10.5px; color: var(--t3); margin-top: 6px; }

.cac-card.purple-border { border-color: rgba(124,92,246,.4); background: var(--purple-dim); }
.cac-card.green-border  { border-color: rgba(15,212,160,.4);  background: var(--teal-dim);   }

/* Ratios */
.ratios-row { display: flex; align-items: center; padding: 14px 18px; }
.ratio-item  { flex: 1; text-align: center; }
.ratio-val   { font-size: 20px; font-weight: 800; letter-spacing: -.8px; }
.ratio-lbl   { font-size: 9.5px; color: var(--t3); text-transform: uppercase; letter-spacing: .4px; margin-top: 4px; }
.ratio-div   { width: 1px; height: 40px; background: var(--border); flex-shrink: 0; }

/* Spend */
.spend-card { padding: 18px 20px; }
.spend-hd   { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--t2); margin-bottom: 14px; }
.spend-row  { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }

.plt {
  font-size: 10.5px;
  font-weight: 700;
  width: 88px;
  flex-shrink: 0;
}

.plt.meta   { color: #4267B2; }
.plt.google { color: #4285F4; }

.spend-val  { font-size: 12px; font-weight: 700; width: 72px; text-align: right; flex-shrink: 0; }
.spend-track { flex: 1; height: 4px; background: rgba(255,255,255,.05); border-radius: 2px; overflow: hidden; }
.spend-fill { height: 100%; border-radius: 2px; width: 0; transition: width 1s var(--ease); }
.spend-fill.meta   { background: #4267B2; }
.spend-fill.google { background: #4285F4; }

.spend-notes { margin-top: 10px; }
.spend-note  { font-size: 10.5px; color: var(--t3); }
.spend-err   { font-size: 10.5px; color: var(--amber); margin-top: 3px; }

/* ══════════════════════════════════════
   FILTERS BAR
══════════════════════════════════════ */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.search-inp {
  flex: 1;
  min-width: 200px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--t1);
  padding: 8px 12px;
  border-radius: var(--r-s);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
}

.search-inp:focus { border-color: var(--border-hi); }
.search-inp::placeholder { color: var(--t3); }

.btn-ghost {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--t2);
  padding: 8px 16px;
  border-radius: var(--r-s);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all .2s;
}

.btn-ghost:hover { border-color: var(--border-hi); color: var(--t1); background: var(--purple-dim); }

.total-badge {
  font-size: 12px;
  color: var(--t3);
  margin-left: 4px;
}

/* ══════════════════════════════════════
   TABLES
══════════════════════════════════════ */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  overflow-x: auto;
}

.dtable {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.dtable th {
  text-align: left;
  padding: 10px 14px;
  background: rgba(255,255,255,.025);
  border-bottom: 1px solid var(--border);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--t2);
  white-space: nowrap;
  font-weight: 600;
}

.dtable td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255,255,255,.035);
  color: var(--t1);
  white-space: nowrap;
}

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

.dtable tbody tr:hover td { background: rgba(255,255,255,.018); }

.tbl-empty {
  text-align: center;
  color: var(--t3);
  padding: 40px;
  font-size: 13px;
}

/* Status badges */
.sbadge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 100px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}

.sbadge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sbadge.active  { color: #60A5FA; background: rgba(96,165,250,.1);  border: 1px solid rgba(96,165,250,.3);  }
.sbadge.active::before  { background: #60A5FA; }
.sbadge.won     { color: var(--teal); background: var(--teal-dim); border: 1px solid rgba(15,212,160,.3); }
.sbadge.won::before     { background: var(--teal); }
.sbadge.lost    { color: var(--red);  background: var(--red-dim);  border: 1px solid rgba(255,77,109,.3);  }
.sbadge.lost::before    { background: var(--red); }

/* Stage badge */
.stage-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
  background: var(--purple-dim);
  color: var(--purple-lt);
  border: 1px solid rgba(124,92,246,.25);
  white-space: nowrap;
}

/* Rating stars */
.stars { color: var(--amber); font-size: 11px; }

/* Links */
.tlink { color: var(--purple-lt); text-decoration: none; }
.tlink:hover { text-decoration: underline; }

/* ══════════════════════════════════════
   PAGINATION
══════════════════════════════════════ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 14px;
}

.pag-btn {
  padding: 5px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--t2);
  border-radius: var(--r-xs);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all .2s;
}

.pag-btn:hover { border-color: var(--border-hi); color: var(--t1); }
.pag-btn:disabled { opacity: .3; cursor: default; }

.pag-info { font-size: 12px; color: var(--t2); padding: 0 8px; }

/* ══════════════════════════════════════
   SETTINGS
══════════════════════════════════════ */
.settings-layout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 22px;
}

.cfg-card { padding: 22px; display: flex; flex-direction: column; gap: 18px; }

.cfg-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--t1);
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}

.cfg-hint {
  font-size: 11.5px;
  color: var(--t3);
  line-height: 1.5;
  margin-top: -10px;
}

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

.form-group label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--t2);
}

.form-inp {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  color: var(--t1);
  padding: 9px 12px;
  border-radius: var(--r-s);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
}

.form-inp:focus { border-color: var(--border-hi); }
.form-inp::placeholder { color: var(--t3); }
.form-inp option { background: #0B1020; }

.form-hint { font-size: 10.5px; color: var(--t3); line-height: 1.4; }

/* Account list */
.acc-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 320px;
  overflow-y: auto;
}

.acc-loading { font-size: 12px; color: var(--t3); padding: 12px 0; }

.acc-err {
  font-size: 12px;
  color: var(--amber);
  background: var(--amber-dim);
  border: 1px solid rgba(245,158,11,.25);
  border-radius: var(--r-xs);
  padding: 10px 12px;
  line-height: 1.4;
}

.acc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
  cursor: pointer;
}

.acc-row:last-child { border-bottom: none; }
.acc-row:hover { background: rgba(255,255,255,.02); border-radius: var(--r-xs); padding-left: 4px; }

.acc-chk {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--purple);
  flex-shrink: 0;
}

.acc-info { flex: 1; min-width: 0; }

.acc-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--t1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.acc-bm {
  font-size: 10.5px;
  color: var(--t3);
  margin-top: 1px;
}

.acc-status {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 100px;
  flex-shrink: 0;
}

.acc-status.active { background: var(--teal-dim); color: var(--teal); border: 1px solid rgba(15,212,160,.3); }
.acc-status.paused { background: var(--red-dim);  color: var(--red);  border: 1px solid rgba(255,77,109,.3); }

/* Settings footer */
.settings-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 0;
}

.btn-primary {
  background: var(--purple);
  color: #fff;
  border: none;
  padding: 11px 24px;
  border-radius: var(--r-s);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all .2s;
  letter-spacing: .1px;
}

.btn-primary:hover {
  background: var(--purple-lt);
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(124,92,246,.4);
}

.save-msg {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--teal);
}

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 1200px) {
  .dash-grid { grid-template-columns: 1fr; }
  .right-col { display: grid; grid-template-columns: repeat(2, 1fr); }
  .ratios-row, .spend-card { grid-column: span 2; }
}

@media (max-width: 1000px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .settings-layout { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .sidebar { width: 56px; }
  .sidebar .brand-name, .sidebar .brand-sub, .nav-item span { display: none; }
  .brand-glow { font-size: 20px; }
  .nav-item { justify-content: center; padding: 10px; }
  .kpi-row { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════
   VIEW TOGGLE (Table / Kanban)
══════════════════════════════════════ */
.view-toggle {
  display: flex;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  padding: 2px;
  margin-left: auto;
}

.vtog {
  width: 32px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--t2);
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .18s;
}

.vtog:hover { color: var(--t1); background: rgba(255,255,255,.06); }
.vtog.active { background: var(--purple); color: #fff; box-shadow: 0 0 10px rgba(124,92,246,.35); }

/* ══════════════════════════════════════
   KANBAN BOARD
══════════════════════════════════════ */
.kanban-wrap {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 20px;
  min-height: 500px;
  align-items: flex-start;
  /* Custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.kanban-wrap::-webkit-scrollbar { height: 6px; }
.kanban-wrap::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Kanban column */
.kb-col {
  flex-shrink: 0;
  width: 272px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kb-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 8px;
  border-bottom: 2px solid;
}

.kb-col-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2px;
  color: var(--t1);
}

.kb-col-count {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 100px;
  background: rgba(255,255,255,.06);
  color: var(--t2);
}

/* Column accent colors */
.kb-col:nth-child(1) .kb-col-head { border-color: #7C5CF6; }
.kb-col:nth-child(2) .kb-col-head { border-color: #6047DC; }
.kb-col:nth-child(3) .kb-col-head { border-color: #3B5BDB; }
.kb-col:nth-child(4) .kb-col-head { border-color: #1E86C3; }
.kb-col:nth-child(5) .kb-col-head { border-color: #0EB8B8; }
.kb-col:nth-child(6) .kb-col-head { border-color: #0FC89A; }
.kb-col:nth-child(n+7) .kb-col-head { border-color: #0FD4A0; }

/* Kanban card */
.kb-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-s);
  padding: 14px;
  cursor: pointer;
  transition: all .22s var(--ease);
  position: relative;
  overflow: hidden;
}

.kb-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(124,92,246,.04), transparent);
  opacity: 0;
  transition: opacity .2s;
}

.kb-card:hover {
  border-color: rgba(124,92,246,.35);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}

.kb-card:hover::before { opacity: 1; }

.kb-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 6px;
}

.kb-card-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--t1);
  line-height: 1.3;
  flex: 1;
}

.kb-card-days {
  font-size: 10px;
  font-weight: 700;
  color: var(--t3);
  white-space: nowrap;
  background: rgba(255,255,255,.04);
  padding: 2px 6px;
  border-radius: 3px;
  flex-shrink: 0;
}

.kb-card-contact {
  font-size: 11px;
  color: var(--t2);
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kb-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.kb-card-value {
  font-size: 12px;
  font-weight: 800;
  color: var(--teal);
  letter-spacing: -.3px;
}

.kb-card-campaign {
  font-size: 10px;
  color: var(--t3);
  background: rgba(255,255,255,.04);
  padding: 2px 7px;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

.kb-card-stars { font-size: 9.5px; color: var(--amber); }

.kb-won .kb-card-name { color: var(--teal); }
.kb-lost .kb-card-name { color: var(--t3); }
.kb-lost .kb-card { opacity: .6; }

.kb-empty {
  font-size: 11px;
  color: var(--t3);
  text-align: center;
  padding: 18px 0;
  border: 1px dashed rgba(255,255,255,.06);
  border-radius: var(--r-s);
}

/* ══════════════════════════════════════
   DEAL DETAIL MODAL
══════════════════════════════════════ */
.dmodal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.dmodal-overlay.hidden { display: none; }

.dmodal-bg {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.dmodal-box {
  position: relative;
  z-index: 1;
  background: #0D1525;
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 720px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 32px 80px rgba(0,0,0,.5), 0 0 0 1px rgba(124,92,246,.1);
  animation: slideUp .25s var(--ease);
}

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

/* Modal header */
.dmodal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.dmodal-head-left { flex: 1; min-width: 0; }

.dmodal-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.4px;
  color: var(--t1);
  margin-top: 8px;
  margin-bottom: 4px;
  line-height: 1.2;
}

.dmodal-stage-line {
  font-size: 11.5px;
  color: var(--t3);
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.dmodal-stage-crumb {
  font-size: 11px;
  color: var(--purple-lt);
  background: var(--purple-dim);
  padding: 2px 9px;
  border-radius: 100px;
  border: 1px solid rgba(124,92,246,.25);
}

.dmodal-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--t2);
  border-radius: var(--r-xs);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  flex-shrink: 0;
}

.dmodal-close:hover { background: var(--red-dim); border-color: rgba(255,77,109,.4); color: var(--red); }

/* Modal body */
.dmodal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.dmodal-col {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dmodal-col:first-child { border-right: 1px solid var(--border); }

.dmodal-sec {}

.dmodal-sec-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--t3);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,.04);
}

.dmodal-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
  min-height: 22px;
}

.df-lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--t3);
  width: 80px;
  flex-shrink: 0;
  line-height: 1.5;
}

.df-val {
  font-size: 12.5px;
  color: var(--t1);
  font-weight: 500;
  line-height: 1.5;
  flex: 1;
  word-break: break-all;
}

.df-empty { font-size: 12px; color: var(--t3); font-style: italic; }

/* Product list in modal */
.dm-product-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
  font-size: 12.5px;
}

.dm-product-item:last-child { border-bottom: none; }

.dm-product-name { color: var(--t1); font-weight: 500; flex: 1; }
.dm-product-price { color: var(--teal); font-weight: 700; margin-left: 8px; }

/* ══════════════════════════════════════
   SAFRAS PAGE
══════════════════════════════════════ */
.safras-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.safras-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.5px;
  margin: 0;
}

.safras-sub {
  font-size: 12.5px;
  color: var(--t2);
  margin-top: 4px;
}

.safras-stats {
  display: flex;
  gap: 20px;
}

.safras-stat {
  text-align: right;
}

.safras-stat-val {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1;
}

.safras-stat-lbl {
  font-size: 10px;
  color: var(--t2);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 600;
  margin-top: 2px;
}

.safras-msg {
  font-size: 13px;
  color: var(--t2);
  padding: 20px 0;
}

.safras-msg.err { color: var(--amber); }

.safras-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Safra row card */
.safra-row {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  cursor: default;
  transition: border-color .2s;
}

.safra-row:hover { border-color: rgba(124,92,246,.3); }

.safra-row-head {
  display: grid;
  grid-template-columns: 130px repeat(5, 1fr) 80px;
  gap: 0;
  align-items: center;
  padding: 14px 20px;
}

.safra-month {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -.3px;
  color: var(--t1);
}

.safra-cell {
  text-align: center;
  padding: 0 8px;
}

.safra-cell-val {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.5px;
  line-height: 1;
}

.safra-cell-lbl {
  font-size: 9.5px;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: .4px;
  font-weight: 600;
  margin-top: 3px;
}

.safra-cell-val.won   { color: var(--teal); }
.safra-cell-val.lost  { color: var(--red);  }
.safra-cell-val.pct   { color: var(--purple-lt); }

/* Stage breakdown mini-bars */
.safra-stages {
  padding: 0 20px 14px;
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,.04);
  padding-top: 10px;
}

.safra-stage-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 100px;
  background: rgba(124,92,246,.08);
  border: 1px solid rgba(124,92,246,.18);
  color: var(--t2);
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.safra-stage-pill span {
  font-weight: 800;
  color: var(--purple-lt);
}

/* Safra table header */
.safra-tbl-hdr {
  display: grid;
  grid-template-columns: 130px repeat(5, 1fr) 80px;
  gap: 0;
  padding: 6px 20px;
  margin-bottom: 2px;
}

.safra-tbl-hdr span {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--t3);
  text-align: center;
}

.safra-tbl-hdr span:first-child { text-align: left; }

/* Amount won */
.safra-amount {
  font-size: 11px;
  color: var(--teal);
  text-align: center;
  font-weight: 700;
}
/* ══════════════════════════════════════════════
   DATE PICKERS
══════════════════════════════════════════════ */
.date-picker-wrap {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  gap: 8px;
}
.date-sep {
  font-size: 13px;
  color: var(--t3);
  font-weight: 500;
}
.date-inp {
  background: var(--surface);
  border: 1px solid transparent;
  color: var(--t1);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}
.date-inp:hover, .date-inp:focus {
  background: var(--elevated);
  border-color: var(--border-light);
}

/* ══════════════════════════════════════════════
   CAMPAIGN LIST (Settings)
══════════════════════════════════════════════ */
.campaign-list {
  margin-top: 4px;
  margin-left: 28px;
  border-left: 1px solid var(--border);
  padding-left: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.campaign-list.hidden {
  display: none;
}
