/* ============================================================
   LAYERS PARTNER CRM — Design Guide v4
   DM Sans + DM Mono · Brand #4527F9 · Sidebar açık gri (#F7F7F5)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@300;400;500&display=swap');

/* ── LEGACY VARIABLE SHIMS ──────────────────────────────── */
/* Old variable names still used in JS-generated HTML — mapped to new tokens */
:root {
  --teal:          #4527F9;   /* was teal/mint — now brand */
  --text-muted:    #7D7C7A;   /* = var(--c-txm) */
  --aria:          #E8E5F4;   /* = var(--c-bord) */
  --alpine-goat:   #F5F2FF;   /* = var(--c-surf2) */
  --placebo-purple:#EEEAFC;   /* = var(--brand-light) */
  --placebo-orange:#FBF0E0;   /* = var(--c-warn-bg) */
  --purple-btn:    #4527F9;   /* = var(--brand) */
  --purple:        #7B6CF6;   /* = var(--brand-mid) */
  --white:         #FFFFFF;   /* = var(--c-surf) */
  --negroni:       #EDC8A3;   /* brand-sand */
  --text-dark:     #212324;   /* = var(--c-tx) */
  --cold-white:    #F5F2FF;   /* = var(--c-surf2) */
  --wistful:       #7B6CF6;   /* = var(--brand-mid) */
  --ghost:         #F0ECFE;   /* = var(--c-row) */
}

/* ── CRM TOKEN OVERRIDES ─────────────────────────────────── */
:root {
  /* Brand — Layers teal palette */
  --brand:         #59aaa1;
  --brand-hover:   #4a9990;
  --brand-mid:     #7BBFB8;
  --brand-light:   #E8F5F3;
  --lav-100:       #E0F0EE;
  --lav-200:       #BCE1DC;
  --lav-300:       #8CBFB8;
  --lav-400:       #3D8A82;
  --brand-teal:    #BCE1DC;
  --brand-sand:    #EDC8A3;

  /* Sidebar */
  --sb-bg:         #F3F1ED;
  --sb-border:     #E5E3DF;
  --sb-text:       #5C5B5A;
  --sb-text-muted: #9A9A9A;
  --sb-active-bg:  #E8E6E2;
  --sb-hover:      #EDEBE7;
  --sb-active-txt: #1A1A1A;
  --sb-bar:        #59aaa1;

  /* Surfaces */
  --c-surf:        #FFFFFF;
  --c-surf2:       #FAFAF8;
  --c-bord:        #E5E3DF;
  --c-row:         #F0EDE8;

  /* Text */
  --c-tx:          #212324;
  --c-tx2:         #3D4F5F;
  --c-txm:         #7D7C7A;
  --c-txh:         #9A9A9A;

  /* Semantic */
  --c-ok:          #2D6B1A;
  --c-ok-bg:       #E6F4DF;
  --c-ok-b:        #94C97A;
  --c-warn:        #7A4A10;
  --c-warn-bg:     #FBF0E0;
  --c-warn-b:      #D4974A;
  --c-err:         #881F1F;
  --c-err-bg:      #FDE8E8;
  --c-err-b:       #E08080;

  /* Radius */
  --r4: 4px; --r6: 6px; --r10: 10px; --r12: 12px; --r14: 14px; --rF: 9999px;

  /* Fonts */
  --sans: 'DM Sans', sans-serif;
  --mono: 'DM Mono', monospace;

  /* Sidebar dimensions */
  --sb-width: 220px;
  --topbar-h: 70px;
}

/* ── RESET FOR CRM ───────────────────────────────────────── */
.crm-layout * { box-sizing: border-box; }

body.crm-body {
  background: var(--c-surf2);
  font-family: var(--sans);
  font-size: 13px;
  color: var(--c-tx);
  margin: 0;
  overflow: hidden;
}

/* ── LAYOUT ──────────────────────────────────────────────── */
.crm-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── SIDEBAR ─────────────────────────────────────────────── */
.crm-sidebar {
  width: var(--sb-width);
  background: var(--sb-bg);
  border-right: 1px solid var(--sb-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  overflow-y: auto;
}
.crm-sidebar::-webkit-scrollbar { width: 0; }
.crm-sidebar { transition: width 0.25s ease; }

/* Collapsed sidebar */
.crm-sidebar.collapsed { width: 56px; }
.crm-sidebar.collapsed .sb-item-txt { display: none; }
.crm-sidebar.collapsed .sb-badge { display: none; }
.crm-sidebar.collapsed .sb-user-name { display: none; }
.crm-sidebar.collapsed .sb-user-role { display: none; }
.crm-sidebar.collapsed .sb-logout { font-size: 0; padding: 6px; }
.crm-sidebar.collapsed .sb-logout::before { content: '→'; font-size: 13px; }
.crm-sidebar.collapsed .sb-logo-row { padding: 12px 8px; }
.crm-sidebar.collapsed .sb-item { justify-content: center; padding: 9px 0; }
.crm-sidebar.collapsed .sb-item-icon { width: 20px; height: 20px; }
.crm-sidebar.collapsed .sb-item.active::before { top: 8px; bottom: 8px; }
.crm-sidebar.collapsed .sb-divider { margin: 6px 8px; }
.crm-sidebar.collapsed .sb-section-label { display: none; }
.crm-sidebar.collapsed .sb-user { display: none; }
.crm-sidebar.collapsed .sb-logo { display: none; }
.crm-sidebar.collapsed .sb-logo-row { justify-content: center; }
.crm-sidebar.collapsed .sb-toggle-icon { transform: rotate(180deg); }

.sb-logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 0;
  flex-shrink: 0;
  text-decoration: none;
}
.sb-logo-bars {
  display: flex;
  gap: 2px;
  align-items: flex-end;
  height: 18px;
  flex-shrink: 0;
}
.sb-logo-bar {
  width: 4px;
  border-radius: 1.5px;
}
.sb-logo-txt {
  font-size: 13px;
  font-weight: 500;
  color: var(--sb-active-txt);
  font-family: var(--sans);
  letter-spacing: -0.2px;
}
.sb-sub {
  font-size: 9px;
  color: var(--lav-300);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
}

.sb-section-label {
  font-size: 9px;
  font-family: var(--mono);
  color: var(--sb-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 10px 14px 4px;
}

.sb-nav {
  flex: 1;
  padding: 4px 0;
}

.sb-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  cursor: pointer;
  position: relative;
  text-decoration: none;
  transition: background 0.1s;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--sb-text);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.sb-item:hover { background: var(--sb-hover); }
.sb-item.active {
  background: var(--sb-active-bg);
  color: var(--sb-active-txt);
  font-weight: 500;
}
.sb-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 5px; bottom: 5px;
  width: 2.5px;
  background: var(--sb-bar);
  border-radius: 0 2px 2px 0;
}
.sb-item-icon {
  width: 16px; height: 16px;
  flex-shrink: 0;
  opacity: 0.55;
  color: var(--sb-text);
}
.sb-item.active .sb-item-icon { opacity: 1; color: var(--brand); }
.sb-item-txt { flex: 1; }
.sb-badge {
  font-size: 9px;
  font-family: var(--mono);
  background: rgba(69,39,249,0.1);
  color: var(--brand);
  padding: 1px 5px;
  border-radius: var(--rF);
}
.sb-item.active .sb-badge { background: var(--brand); color: #fff; }

.sb-divider {
  height: 1px;
  background: var(--sb-border);
  margin: 6px 14px;
}

.sb-user {
  padding: 12px 14px;
  border-top: 1px solid var(--sb-border);
  flex-shrink: 0;
}
.sb-user-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--sb-active-txt);
  margin-bottom: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-user-role {
  font-size: 9px;
  font-family: var(--mono);
  color: var(--sb-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 8px;
}
.sb-logout {
  font-size: 11px;
  color: var(--sb-text);
  background: none;
  border: 1px solid var(--sb-border);
  padding: 4px 10px;
  border-radius: var(--r6);
  cursor: pointer;
  font-family: var(--sans);
  transition: all 0.1s;
  width: 100%;
  text-align: center;
}
.sb-logout:hover { border-color: var(--c-err-b); color: var(--c-err); }

/* Sidebar logo row + toggle */
.sb-logo-row {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--topbar-h); padding: 0 14px; border-bottom: 1px solid var(--sb-border);
  margin-bottom: 6px; flex-shrink: 0; box-sizing: border-box;
}
.sb-logo-row .sb-logo {
  border-bottom: none; margin-bottom: 0; padding: 0;
}
.sb-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; flex-shrink: 0;
  background: none; border: 1px solid var(--sb-border); border-radius: 6px;
  cursor: pointer; color: var(--sb-text-muted); transition: all 0.15s;
}
.sb-toggle:hover { color: var(--sb-active-txt); background: var(--sb-hover); }
.sb-toggle-icon {
  display: inline-block; transition: transform 0.25s ease;
  font-size: 12px; line-height: 1;
}

/* ── MAIN AREA ───────────────────────────────────────────── */
.crm-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ── PAGE CONTENT ────────────────────────────────────────── */
.crm-page {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
  background: var(--c-surf2);
}
.crm-page::-webkit-scrollbar { width: 3px; }
.crm-page::-webkit-scrollbar-thumb { background: var(--lav-200); border-radius: 2px; }

/* crm-section override — removes old padding-top since sidebar handles layout */
.crm-section {
  padding-top: 0 !important;
  min-height: unset !important;
}

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px;
  font-size: 12px; font-weight: 500; font-family: var(--sans);
  background: var(--brand); color: #fff;
  border: 1px solid var(--brand);
  border-radius: var(--r6);
  cursor: pointer; transition: background 0.1s;
  text-decoration: none; white-space: nowrap;
}
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  font-size: 12px; font-family: var(--sans); color: var(--c-tx2);
  background: var(--c-surf); border: 1px solid var(--c-bord);
  border-radius: var(--r6); cursor: pointer; transition: background 0.1s;
  text-decoration: none; white-space: nowrap;
}
.btn-secondary:hover { background: var(--c-surf2); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  font-size: 12px; font-family: var(--sans); color: var(--c-txm);
  background: none; border: none; cursor: pointer; transition: color 0.1s;
}
.btn-ghost:hover { color: var(--c-tx); }

.btn-danger {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; font-size: 11px; font-family: var(--sans);
  color: var(--c-err); background: none; border: 1px solid var(--c-err-b);
  border-radius: var(--r6); cursor: pointer; transition: all 0.1s;
}
.btn-danger:hover { background: var(--c-err-bg); }

.btn-sm { padding: 4px 10px !important; font-size: 11px !important; }

/* Legacy aliases */
.btn-p {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; font-size: 12px; font-weight: 500; font-family: var(--sans);
  background: var(--brand); color: #fff; border: 1px solid var(--brand);
  border-radius: var(--r6); cursor: pointer; transition: background 0.1s;
  text-decoration: none; white-space: nowrap; box-shadow: none; transform: none;
}
.btn-p:hover { background: var(--brand-hover); border-color: var(--brand-hover); transform: none; box-shadow: none; }

.btn-s {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; font-size: 12px; font-family: var(--sans); color: var(--c-tx2);
  background: var(--c-surf); border: 1px solid var(--c-bord);
  border-radius: var(--r6); cursor: pointer; transition: background 0.1s;
  text-decoration: none; white-space: nowrap; backdrop-filter: none;
}
.btn-s:hover { background: var(--c-surf2); color: var(--c-tx); border-color: var(--lav-200); }

/* ── PILLS / BADGES ──────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 500;
  padding: 2px 8px; border-radius: var(--rF);
  white-space: nowrap; font-family: var(--sans);
}
.pill-purple { background: #EEEAFC; color: #1E0D7A; }
.pill-green  { background: #E6F4DF; color: #2D6B1A; }
.pill-amber  { background: #FBF0E0; color: #7A4A10; }
.pill-red    { background: #FDE8E8; color: #881F1F; }
.pill-blue   { background: #E6F1FB; color: #0C447C; }
.pill-gray   { background: #F1EFE8; color: #444441; }
.pill-teal   { background: #E0F0EE; color: #1A5C57; }

/* Stage → Pill */
.stage-badge { display: inline-flex; align-items: center; font-size: 10px; font-weight: 500; padding: 2px 8px; border-radius: var(--rF); white-space: nowrap; }
.stage-lead          { background: #F1EFE8; color: #444441; }
.stage-contact       { background: #E6F1FB; color: #0C447C; }
.stage-demo          { background: #EEEAFC; color: #1E0D7A; }
.stage-proposal      { background: #FBF0E0; color: #7A4A10; }
.stage-negotiation   { background: #F3E5F5; color: #6A1FA2; }
.stage-won           { background: #E6F4DF; color: #2D6B1A; }
.stage-lost          { background: #FDE8E8; color: #881F1F; }
.stage-disqualified  { background: #F1EFE8; color: #6B6B68; }

/* Segment badges */
.segment-smbs    { background: #FBF0E0; color: #7A4A10; font-size: 10px; font-weight: 500; padding: 2px 8px; border-radius: var(--rF); display: inline-flex; align-items: center; font-family: var(--sans); white-space: nowrap; }
.segment-smbm    { background: #FBF0E0; color: #7A4A10; font-size: 10px; font-weight: 500; padding: 2px 8px; border-radius: var(--rF); display: inline-flex; align-items: center; font-family: var(--sans); white-space: nowrap; }
.segment-enterprise { background: #EEEAFC; color: #1E0D7A; font-size: 10px; font-weight: 500; padding: 2px 8px; border-radius: var(--rF); display: inline-flex; align-items: center; font-family: var(--sans); white-space: nowrap; }

/* Partner tag */
.partner-tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: var(--rF); font-size: 10px; font-weight: 500; background: var(--brand-light); color: var(--brand); font-family: var(--sans); }

/* Quote status */
.qs-draft    { background: #F1EFE8; color: #444441; }
.qs-pending_approval { background: #FFF8E1; color: #8D6E00; }
.qs-revision_needed  { background: #FFF3E0; color: #BF5C00; }
.qs-sent     { background: #E6F1FB; color: #0C447C; }
.qs-viewed   { background: #E0F0EE; color: #1A5C57; }
.qs-approved { background: #E6F4DF; color: #2D6B1A; }
.qs-rejected { background: #FDE8E8; color: #881F1F; }

/* ── FILTER BAR ──────────────────────────────────────────── */
.crm-filter-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px;
}
.crm-search {
  height: 34px; padding: 0 10px 0 32px;
  border: 1px solid var(--c-bord); border-radius: var(--r6);
  font-size: 12px; font-family: var(--sans); color: var(--c-tx);
  background: var(--c-surf) url("data:image/svg+xml,%3Csvg width='13' height='13' viewBox='0 0 13 13' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='5.5' cy='5.5' r='4' stroke='%23A398D3' stroke-width='1.3'/%3E%3Cpath d='M9 9l2.5 2.5' stroke='%23A398D3' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 10px center;
  outline: none; transition: border-color 0.15s; min-width: 200px;
}
.crm-search:focus { border-color: var(--brand); }
.crm-search::placeholder { color: var(--c-txh); }
.crm-filter-bar select {
  height: 34px; padding: 0 28px 0 10px;
  border: 1px solid var(--c-bord); border-radius: var(--r6);
  font-size: 12px; font-family: var(--sans); color: var(--c-tx2);
  background: var(--c-surf) url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23A398D3' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center;
  appearance: none; outline: none; cursor: pointer; transition: border-color 0.15s;
}
.crm-filter-bar select:focus { border-color: var(--brand); }

/* ── DATA TABLE ──────────────────────────────────────────── */
.crm-table-wrap { background: var(--c-surf); border: 1px solid var(--c-bord); border-radius: var(--r10); overflow: hidden; }
.crm-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.crm-table th { background: var(--c-surf2); padding: 9px 14px; text-align: left; font-size: 10px; font-family: var(--mono); font-weight: 400; color: var(--c-txh); text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--c-bord); white-space: nowrap; }
.crm-table td { padding: 10px 14px; border-bottom: 1px solid var(--c-row); vertical-align: middle; color: var(--c-tx); }
.crm-table tr:last-child td { border-bottom: none; }
.crm-table tr:hover td { background: var(--c-surf2); }
.crm-table td .company-name { font-weight: 500; color: var(--c-tx); cursor: pointer; }
.crm-table td .company-name:hover { color: var(--brand); }
.crm-table td.mono-cell { font-family: var(--mono); color: var(--brand); }
.crm-table td.muted { color: var(--c-txm); }

/* Action icons */
.tbl-actions { display: flex; gap: 4px; align-items: center; }
.tbl-action-btn { width: 26px; height: 26px; border-radius: var(--r6); border: 1px solid var(--c-bord); background: var(--c-surf); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.1s; color: var(--c-txm); }
.tbl-action-btn:hover { border-color: var(--lav-200); background: var(--brand-light); color: var(--brand); }
.tbl-action-btn.del:hover { border-color: var(--c-err-b); background: var(--c-err-bg); color: var(--c-err); }
.tbl-action-btn svg { width: 12px; height: 12px; }

/* ── STAT GRID ───────────────────────────────────────────── */
.stat-grid-6 { display: grid; grid-template-columns: repeat(6,1fr); gap: 10px; margin-bottom: 16px; }
.stat-grid-5 { display: grid; grid-template-columns: repeat(5,1fr); gap: 10px; margin-bottom: 16px; }
.stat-grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 16px; }
.stat-grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-bottom: 16px; }
@media (max-width:900px) { .stat-grid-5 { grid-template-columns: repeat(3,1fr); } }
@media (max-width:600px) { .stat-grid-5 { grid-template-columns: repeat(2,1fr); } }

/* ── ACTIVE CUSTOMERS PAGE ────────────────────────────────── */
.ac-status-badge { font-size:10px; padding:2px 8px; border-radius:var(--rF); font-weight:500; font-family:var(--mono); }
.ac-status-pending { background:#e8f5e9; color:#2e7d32; }
.ac-status-renewed { background:#e3f2fd; color:#1565c0; }
.ac-status-churned { background:#fde8e8; color:#c62828; }
.ac-churn-reason { display:inline-block; width:14px; height:14px; line-height:14px; text-align:center; font-size:9px; background:#fde8e8; color:#c62828; border-radius:var(--rF); margin-left:3px; cursor:help; vertical-align:middle; }
.ac-urgency-badge { font-size:10px; padding:2px 8px; border-radius:var(--rF); font-weight:600; font-family:var(--mono); display:inline-block; }
.urgency-safe { background:#e8f5e9; color:#2e7d32; }
.urgency-warning { background:#fff8e1; color:#f9a825; }
.urgency-critical { background:#fde8e8; color:#c62828; animation:pulse 2s infinite; }
.urgency-expired { background:#4a0e0e; color:#fff; }
.urgency-renewed { background:#e3f2fd; color:#1565c0; }
.urgency-churned { background:#fde8e8; color:#c62828; }
.ac-type-badge { font-size:10px; padding:2px 8px; border-radius:var(--r6); font-weight:500; font-family:var(--mono); }
.ac-actions { display:flex; gap:3px; }
.ac-action-btn { width:26px; height:26px; display:flex; align-items:center; justify-content:center; border:1px solid var(--c-bord); border-radius:var(--r6); background:var(--c-surf); cursor:pointer; font-size:12px; transition:all .15s; color:var(--c-txm); }
.ac-action-btn:hover { border-color:var(--brand); background:var(--brand-light); color:var(--brand); }
.ac-action-danger:hover { border-color:var(--c-err); background:var(--c-err-bg,#fde8e8); color:var(--c-err); }

/* ── REVENUE ANALYTICS PAGE ──────────────────────────────── */
.rv-chart-card { background:var(--c-surf); border:1px solid var(--c-bord); border-radius:var(--r10); padding:16px; margin-bottom:12px; }
.rv-chart-title { font-size:11px; font-family:var(--mono); color:var(--c-txh); text-transform:uppercase; letter-spacing:.05em; margin-bottom:12px; font-weight:500; }
.rv-chart-area svg { display:block; }
.rv-grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:12px; }
@media (max-width:768px) { .rv-grid-2 { grid-template-columns:1fr; } }
.rv-bar-row { display:flex; align-items:center; gap:8px; margin-bottom:6px; }
.rv-bar-label { font-size:11px; min-width:80px; color:var(--c-txm); font-family:var(--mono); }
.rv-bar-track { flex:1; height:16px; background:var(--c-bg); border-radius:var(--r4); overflow:hidden; }
.rv-bar-fill { height:100%; border-radius:var(--r4); transition:width .4s; }
.rv-bar-value { font-size:11px; font-family:var(--mono); min-width:40px; text-align:right; }
.rv-mini-bars { display:flex; align-items:flex-end; gap:3px; height:100px; padding-top:10px; }
.rv-mini-bar-col { flex:1; display:flex; flex-direction:column; align-items:center; gap:2px; }
.rv-mini-bar { min-height:2px; width:100%; border-radius:2px 2px 0 0; transition:height .3s; }
.rv-mini-bar-label { font-size:8px; color:var(--c-txh); font-family:var(--mono); white-space:nowrap; }
.rv-cohort-table { font-size:11px; }
.rv-cohort-table td { font-family:var(--mono); }

.stat-box { background: var(--c-surf); border: 1px solid var(--c-bord); border-radius: var(--r10); padding: 14px 16px; transition: all 0.15s; }
.stat-box:hover { border-color: var(--lav-200); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.stat-box-icon { font-size: 18px; margin-bottom: 6px; }
.stat-box-label { font-size: 10px; font-family: var(--mono); color: var(--c-txh); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.stat-box-value { font-size: 22px; font-weight: 500; font-family: var(--mono); color: var(--brand); line-height: 1; margin-bottom: 2px; }
.stat-box-value.green { color: var(--c-ok); }
.stat-box-value.amber { color: var(--c-warn); }
.stat-box-value.red   { color: var(--c-err); }
.stat-box-value.muted { color: var(--c-txm); }
.stat-box-sub { font-size: 10px; color: var(--c-txm); margin-top: 2px; }

/* Colored stat cards */
.stat-box.stat-leads    { background: #EFF6FF; border-color: #BFDBFE; }
.stat-box.stat-leads .stat-box-value    { color: #2563EB; }
.stat-box.stat-quotes   { background: #F3F0FF; border-color: #DDD6FE; }
.stat-box.stat-quotes .stat-box-value   { color: #7C3AED; }
.stat-box.stat-won      { background: #ECFDF5; border-color: #A7F3D0; }
.stat-box.stat-won .stat-box-value      { color: #059669; }
.stat-box.stat-pipeline { background: #FFF7ED; border-color: #FED7AA; }
.stat-box.stat-pipeline .stat-box-value { color: #EA580C; }
.stat-box.stat-weighted { background: #F0FDFA; border-color: #99F6E4; }
.stat-box.stat-weighted .stat-box-value { color: #0D9488; }
.stat-box.stat-stale    { background: #FEF2F2; border-color: #FECACA; }
.stat-box.stat-stale .stat-box-value    { color: #DC2626; }

/* ── CHART CARDS ─────────────────────────────────────────── */
.crm-chart-row { display: grid; grid-template-columns: 1fr 340px; gap: 12px; margin-bottom: 12px; }
.crm-chart-card { background: var(--c-surf); border: 1px solid var(--c-bord); border-radius: var(--r10); padding: 16px 18px; }
.crm-chart-card h4 { font-size: 12px; font-weight: 500; color: var(--c-tx); margin-bottom: 14px; font-family: var(--sans); }

/* Funnel */
.funnel-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 11px; }
.funnel-label { width: 70px; color: var(--c-txm); text-align: right; flex-shrink: 0; font-family: var(--sans); }
.funnel-track { flex: 1; height: 5px; background: var(--c-bord); border-radius: 3px; overflow: hidden; }
.funnel-bar   { height: 100%; border-radius: 3px; background: var(--brand); transition: width 0.4s; }
.funnel-count { width: 24px; text-align: right; font-family: var(--mono); font-size: 11px; color: var(--c-txm); flex-shrink: 0; }

/* Donut */
.donut-wrap { display: flex; align-items: center; gap: 16px; }
.donut-svg-wrap { flex-shrink: 0; }
.donut-legend { font-size: 11px; display: flex; flex-direction: column; gap: 6px; }
.donut-legend-item { display: flex; align-items: center; gap: 6px; }
.donut-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.donut-legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--brand); }
.donut-legend-label { flex: 1; color: var(--c-tx); }
.donut-legend-val { font-family: var(--mono); color: var(--brand); font-weight: 500; }
.donut-legend-count { font-family: var(--mono); color: var(--brand); font-weight: 500; margin-left: auto; padding-left: 12px; }

/* ── CONVERSION METRICS ──────────────────────────────────── */
.conversion-section { background: var(--c-surf); border: 1px solid var(--c-bord); border-radius: var(--r10); padding: 16px 18px; margin-bottom: 12px; }
.conversion-section h4 { font-size: 12px; font-weight: 500; color: var(--c-tx); margin-bottom: 14px; font-family: var(--sans); }
.conversion-grid, .conv-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
.conv-card { background: var(--c-surf2); border: 1px solid var(--c-bord); border-radius: var(--r10); padding: 12px 14px; }
.conv-label { font-size: 10px; font-family: var(--mono); color: var(--c-txh); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; }
.conv-value { font-size: 20px; font-weight: 500; font-family: var(--mono); color: var(--brand); margin-bottom: 4px; }
.conv-track { height: 3px; background: var(--c-bord); border-radius: 2px; margin-bottom: 6px; overflow: hidden; }
.conv-bar, .conv-fill { height: 100%; border-radius: 2px; background: var(--brand); transition: width 0.4s; }
.conv-sub { font-size: 10px; color: var(--c-txm); font-family: var(--mono); }

/* Churn/NRR */
.stat-progress-card { background: var(--c-surf); border: 1px solid var(--c-bord); border-radius: var(--r10); padding: 14px 18px; }
.stat-progress-card .spc-label { font-size: 11px; color: var(--c-txm); margin-bottom: 4px; }
.stat-progress-card .spc-value { font-size: 20px; font-weight: 500; font-family: var(--mono); color: var(--brand); margin-bottom: 8px; }
.stat-progress-card .spc-track { height: 3px; background: var(--c-bord); border-radius: 2px; overflow: hidden; }
.stat-progress-card .spc-bar   { height: 100%; border-radius: 2px; background: var(--brand); }

/* Revenue metrics */
.revenue-metrics { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 12px; }

/* ── LEADERBOARD ─────────────────────────────────────────── */
.crm-leaderboard { background: var(--c-surf); border: 1px solid var(--c-bord); border-radius: var(--r10); overflow: hidden; margin-bottom: 12px; }
.crm-leaderboard h4 { font-size: 12px; font-weight: 500; color: var(--c-tx); padding: 12px 16px; border-bottom: 1px solid var(--c-bord); margin: 0; font-family: var(--sans); background: var(--c-surf2); }
.medal-icon { font-size: 14px; }
.conv-mini { font-size: 11px; font-family: var(--mono); color: var(--c-txm); }

/* ── ACTIVITY FEED ───────────────────────────────────────── */
.crm-feed-section { background: var(--c-surf); border: 1px solid var(--c-bord); border-radius: var(--r10); overflow: hidden; margin-bottom: 12px; }
.crm-feed-section h4 { font-size: 12px; font-weight: 500; color: var(--c-tx); padding: 12px 16px; border-bottom: 1px solid var(--c-bord); margin: 0; font-family: var(--sans); background: var(--c-surf2); }
.crm-feed { padding: 4px 0; }
.crm-activity-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--c-row); font-size: 12px; }
.crm-activity-item:last-child { border-bottom: none; }
.crm-activity-item.auto { opacity: 0.65; }
.act-icon { width: 28px; height: 28px; border-radius: 50%; background: var(--brand-light); border: 1px solid var(--lav-200); display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
.act-icon svg { width: 12px; height: 12px; }
.act-body { flex: 1; }
.act-title { color: var(--c-tx); line-height: 1.4; }
.act-title strong { font-weight: 500; }
.act-meta { font-size: 10px; color: var(--c-txm); margin-top: 2px; font-family: var(--mono); }

/* ── EMPTY STATE ─────────────────────────────────────────── */
.crm-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px; text-align: center; }
.crm-empty-icon { width: 48px; height: 48px; border-radius: var(--r10); background: var(--c-surf2); border: 1px solid var(--c-bord); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; font-size: 20px; }
.crm-empty-text { font-size: 13px; font-weight: 500; color: var(--c-tx); margin-bottom: 4px; }
.crm-empty-sub  { font-size: 11px; color: var(--c-txm); max-width: 280px; line-height: 1.6; margin-bottom: 14px; }

/* ── SECTION CARD ────────────────────────────────────────── */
.section-card { background: var(--c-surf); border: 1px solid var(--c-bord); border-radius: var(--r10); overflow: hidden; margin-bottom: 12px; }
.section-card-head { padding: 11px 16px; background: var(--c-surf2); border-bottom: 1px solid var(--c-bord); display: flex; align-items: center; justify-content: space-between; }
.section-card-title { font-size: 11px; font-weight: 500; color: var(--c-tx2); font-family: var(--mono); text-transform: uppercase; letter-spacing: .05em; }
.section-card-body { padding: 14px 16px; }

/* ── MODAL ───────────────────────────────────────────────── */
.crm-modal-overlay { position: fixed; inset: 0; background: rgba(26,24,37,0.5); display: none; align-items: center; justify-content: center; z-index: 10000; }
.crm-modal-overlay.show, .crm-modal-overlay.open { display: flex; }
.crm-modal { background: var(--c-surf); border-radius: var(--r14); border: 1px solid var(--c-bord); width: 560px; max-width: 90vw; max-height: 88vh; overflow-y: auto; display: flex; flex-direction: column; animation: modalIn 0.2s ease; }
.crm-modal-lg { width: 720px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.crm-modal::-webkit-scrollbar { width: 3px; }
.crm-modal::-webkit-scrollbar-thumb { background: var(--lav-200); border-radius: 2px; }
.crm-modal-header { padding: 16px 20px 12px; border-bottom: 1px solid var(--c-bord); display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.crm-modal-icon { width: 34px; height: 34px; border-radius: var(--r10); background: var(--brand-light); border: 1px solid var(--lav-200); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.crm-modal-icon svg { width: 16px; height: 16px; }
.crm-modal-title { font-size: 14px; font-weight: 500; color: var(--c-tx); flex: 1; }
.crm-modal-close { width: 26px; height: 26px; border-radius: var(--r6); border: 1px solid var(--c-bord); background: none; cursor: pointer; color: var(--c-txm); font-size: 12px; display: flex; align-items: center; justify-content: center; font-family: var(--sans); }
.crm-modal-close:hover { background: var(--c-surf2); }
.crm-modal h3 { font-size: 14px; font-weight: 500; color: var(--c-tx); padding: 16px 20px 12px; border-bottom: 1px solid var(--c-bord); margin: 0; font-family: var(--sans); }
.crm-modal-body { padding: 18px 22px; flex: 1; }

/* Modal Tabs */
.crm-modal-tabs { display: flex; border-bottom: 1px solid var(--c-bord); padding: 0 20px; gap: 0; flex-shrink: 0; }
.cm-tab { padding: 10px 18px; font-size: 12px; font-weight: 500; color: var(--c-txm); background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; font-family: var(--sans); letter-spacing: 0.3px; transition: color 0.15s, border-color 0.15s; }
.cm-tab:hover { color: var(--c-tx); }
.cm-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.cm-tab-panel { display: none; }
.cm-tab-panel.active { display: block; }

.crm-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px 20px; }
.crm-form-group { display: flex; flex-direction: column; gap: 5px; }
.crm-form-group.full { grid-column: 1 / -1; }
.crm-form-group label { font-size: 10px; font-family: var(--mono); color: var(--c-txh); text-transform: uppercase; letter-spacing: 0.04em; }
.crm-form-group input, .crm-form-group select, .crm-form-group textarea { height: 34px; padding: 0 10px; border: 1px solid var(--c-bord); border-radius: var(--r6); font-size: 12px; font-family: var(--sans); color: var(--c-tx); background: var(--c-surf); outline: none; transition: border-color 0.15s; }
.crm-form-group input:focus, .crm-form-group select:focus, .crm-form-group textarea:focus { border-color: var(--brand); }
.crm-form-group input::placeholder { color: var(--c-txh); }
.crm-form-group textarea { height: auto; min-height: 70px; padding: 8px 10px; resize: vertical; }
.crm-form-group select { cursor: pointer; appearance: none; background: var(--c-surf) url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23A398D3' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center; padding-right: 28px; }
.crm-form-actions { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px; border-top: 1px solid var(--c-bord); flex-shrink: 0; }

/* ── CUSTOMER DETAIL ─────────────────────────────────────── */
.crm-detail { font-family: var(--sans); }
.cust-header { background: var(--c-surf); border: 1px solid var(--c-bord); border-radius: var(--r10); overflow: hidden; margin-bottom: 14px; }
.cust-header-top { padding: 16px 20px; display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--c-bord); }
.cust-name { font-size: 18px; font-weight: 500; color: var(--c-tx); margin-bottom: 6px; }
.cust-badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.cust-header-actions { display: flex; gap: 7px; align-items: center; }
.cust-meta-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 0; padding: 0; }
.cust-meta-item { padding: 12px 18px; border-right: 1px solid var(--c-bord); }
.cust-meta-item:last-child, .cust-meta-item:nth-child(3n) { border-right: none; }
.cust-meta-label { font-size: 9px; font-family: var(--mono); color: var(--c-txh); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.cust-meta-value { font-size: 12px; color: var(--c-tx); font-weight: 500; }
.cust-meta-value a { color: var(--brand); text-decoration: none; }
.cust-meta-value a:hover { text-decoration: underline; }
.cust-meta-value.mono { font-family: var(--mono); }

/* Sub sections */
.cust-section { margin-bottom: 12px; }
.cust-section-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--c-surf2); border: 1px solid var(--c-bord); border-radius: var(--r10) var(--r10) 0 0; }
.cust-section-title { font-size: 12px; font-weight: 500; color: var(--c-tx2); }
.cust-section-body { border: 1px solid var(--c-bord); border-top: none; border-radius: 0 0 var(--r10) var(--r10); background: var(--c-surf); padding: 14px 16px; }
.cust-section-body.padless { padding: 0; }

/* Activity form */
.activity-form { background: var(--c-surf2); border: 1px solid var(--c-bord); border-radius: var(--r10); padding: 12px 14px; margin-bottom: 10px; }
.activity-form-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.activity-form-row select, .activity-form-row input { height: 32px; padding: 0 8px; border: 1px solid var(--c-bord); border-radius: var(--r6); font-size: 11px; font-family: var(--sans); color: var(--c-tx); background: var(--c-surf); outline: none; }
.activity-form-row select:focus, .activity-form-row input:focus { border-color: var(--brand); }
.activity-form-row select { appearance: none; padding-right: 24px; background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23A398D3' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 6px center; }
.activity-form-row input.act-topic { flex: 1; }
.activity-form textarea { width: 100%; min-height: 56px; padding: 7px 10px; margin-bottom: 8px; border: 1px solid var(--c-bord); border-radius: var(--r6); font-size: 11px; font-family: var(--sans); color: var(--c-tx); background: var(--c-surf); outline: none; resize: none; }
.activity-form textarea:focus { border-color: var(--brand); }
.activity-form-footer { display: flex; gap: 8px; align-items: center; }
.activity-form-footer select, .activity-form-footer input[type=date], .activity-form-footer input[type=number] { height: 30px; padding: 0 8px; border: 1px solid var(--c-bord); border-radius: var(--r6); font-size: 11px; font-family: var(--sans); color: var(--c-tx); background: var(--c-surf); outline: none; }
.activity-form-footer select { appearance: none; padding-right: 22px; background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23A398D3' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 5px center; }
.activity-form-footer input[type=number] { width: 70px; }

/* ── TEAM CARDS ──────────────────────────────────────────── */
.team-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 16px; }

/* team-card — JS tarafından üretilen kart yapısı */
.team-card { background: var(--c-surf); border: 1px solid var(--c-bord); border-radius: var(--r10); overflow: hidden; transition: border-color 0.15s; }
.team-card:hover { border-color: var(--lav-200); }
.team-card-header { padding: 12px 14px; border-bottom: 1px solid var(--c-bord); display: flex; align-items: flex-start; justify-content: space-between; background: var(--c-surf2); }
.team-card-name { font-size: 13px; font-weight: 500; color: var(--c-tx); margin-bottom: 2px; }
.team-card-meta { font-size: 10px; color: var(--c-txm); }
.team-stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 0; border-bottom: 1px solid var(--c-bord); }
.team-stat { padding: 10px 12px; text-align: center; border-right: 1px solid var(--c-bord); }
.team-stat:last-child { border-right: none; }
.team-stat-val { font-size: 16px; font-weight: 500; font-family: var(--mono); color: var(--brand); line-height: 1.2; }
.team-stat-val.purple { color: var(--brand-mid); }
.team-stat-val.orange { color: var(--c-warn); }
.team-stat-val.green  { color: var(--c-ok); }
.team-stat-lbl { font-size: 9px; color: var(--c-txm); font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 3px; }

/* Rol badge — Satış / Yönetici */
.rep-role-tag { font-size: 10px; font-weight: 500; padding: 2px 8px; border-radius: var(--rF); display: inline-flex; align-items: center; font-family: var(--sans); white-space: nowrap; }
.rep-role-tag.manager   { background: #EEEAFC; color: #1E0D7A; }
.rep-role-tag.sales_rep { background: #E0F0EE; color: #1A5C57; }

/* Assign select in team table */
.assign-select { height: 28px; padding: 0 24px 0 8px; border: 1px solid var(--c-bord); border-radius: var(--r6); font-size: 11px; font-family: var(--sans); color: var(--c-tx2); background: var(--c-surf) url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23A398D3' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 6px center; appearance: none; outline: none; cursor: pointer; }
.assign-select:focus { border-color: var(--brand); }

/* Legacy aliases — some pages still reference rep-card */
.rep-card { background: var(--c-surf); border: 1px solid var(--c-bord); border-radius: var(--r10); overflow: hidden; transition: border-color 0.15s; }
.rep-card:hover { border-color: var(--lav-200); }
.rep-card-head { padding: 12px 14px; border-bottom: 1px solid var(--c-bord); display: flex; align-items: flex-start; justify-content: space-between; background: var(--c-surf2); }
.rep-name { font-size: 13px; font-weight: 500; color: var(--c-tx); margin-bottom: 2px; }
.rep-contact { font-size: 10px; color: var(--c-txm); }
.rep-actions { display: flex; gap: 4px; }
.rep-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 0; border-bottom: 1px solid var(--c-bord); }
.rep-stat { padding: 10px 12px; text-align: center; border-right: 1px solid var(--c-bord); }
.rep-stat:last-child { border-right: none; }
.rep-stat-val { font-size: 16px; font-weight: 500; font-family: var(--mono); color: var(--brand); }
.rep-stat-val.green { color: var(--c-ok); }
.rep-stat-lbl { font-size: 9px; color: var(--c-txm); font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }
.rep-footer { padding: 8px 14px; display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--c-txm); }

/* ── PARTNER CARDS ───────────────────────────────────────── */
.partner-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.partner-card { background: var(--c-surf); border: 1px solid var(--c-bord); border-radius: var(--r10); overflow: hidden; transition: border-color 0.15s; }
.partner-card:hover { border-color: var(--lav-200); }
.partner-card-head { padding: 12px 14px; border-bottom: 1px solid var(--c-bord); display: flex; align-items: flex-start; justify-content: space-between; background: var(--c-surf2); }
.partner-card-name { font-size: 13px; font-weight: 500; color: var(--c-tx); margin-bottom: 2px; }
.partner-card-code { font-size: 10px; font-family: var(--mono); color: var(--c-txm); }
.partner-commission { font-size: 12px; font-family: var(--mono); color: var(--brand); font-weight: 500; }
.partner-card-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 0; border-bottom: 1px solid var(--c-bord); }
.partner-stat { padding: 10px 12px; text-align: center; border-right: 1px solid var(--c-bord); }
.partner-stat:last-child { border-right: none; }
.partner-stat-val { font-size: 16px; font-weight: 500; font-family: var(--mono); color: var(--brand); }
.partner-stat-val.green { color: var(--c-ok); }
.partner-stat-lbl { font-size: 9px; color: var(--c-txm); font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }
.partner-card-footer { padding: 8px 14px; display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--c-txm); }

/* ── PIPELINE KANBAN ─────────────────────────────────────── */
.kanban-board { display: grid; grid-template-columns: repeat(7,1fr); gap: 8px; min-height: calc(100vh - 160px); align-items: start; }
.kanban-column { background: var(--c-surf2); border: 1px solid var(--c-bord); border-radius: var(--r10); padding: 10px 8px; min-height: 200px; border-top: 3px solid var(--c-bord); }
.kanban-column[data-stage="lead"]     { border-top-color: #BCE1DC; }
.kanban-column[data-stage="contact"]  { border-top-color: #7BBFB8; }
.kanban-column[data-stage="demo"]     { border-top-color: #59aaa1; }
.kanban-column[data-stage="proposal"] { border-top-color: #EDC8A3; }
.kanban-column[data-stage="won"]      { border-top-color: #2D6B1A; background: #FAFFF8; }
.kanban-column[data-stage="lost"]     { border-top-color: #C0392B; background: #FFFAFA; }
.kanban-col-header { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; margin-bottom: 8px; font-size: 11px; font-weight: 500; color: var(--c-tx2); font-family: var(--sans); }
.kanban-col-count { background: var(--c-surf); border: 1px solid var(--c-bord); border-radius: var(--rF); min-width: 20px; height: 18px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-family: var(--mono); color: var(--c-txm); padding: 0 5px; }
.kanban-col-total { display: flex; flex-direction: column; align-items: stretch; gap: 3px; margin-bottom: 8px; }
.kanban-col-total .stage-badge { font-family: var(--mono); font-size: 12px; font-weight: 500; border-radius: var(--r6); padding: 3px 8px; text-align: center; }
[data-stage="lead"] .stage-badge     { background: #e8f5f3; color: #3a7a70; }
[data-stage="contact"] .stage-badge  { background: #e2f0ee; color: #2d6e64; }
[data-stage="demo"] .stage-badge     { background: #ddecea; color: #256b60; }
[data-stage="proposal"] .stage-badge { background: #faf0e2; color: #8a5a1e; }
[data-stage="won"] .stage-badge      { background: #e6f4e0; color: #2d6b1a; }
[data-stage="lost"] .stage-badge     { background: #fde8e8; color: #a03030; }
.kanban-col-total .stage-badge.arr   { opacity: 0.7; }
.kanban-col-norev { background: #fff3e0; border: 1px solid #ffe0b2; border-radius: var(--rF); min-width: 20px; height: 18px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-family: var(--mono); color: #e65100; padding: 0 5px; }
.kanban-col-dq { opacity: 0.7; }
.kanban-cards { min-height: 60px; }
.kanban-card { background: var(--c-surf); border: 1px solid var(--c-bord); border-radius: var(--r10); padding: 10px; margin-bottom: 6px; cursor: grab; transition: border-color 0.15s; font-size: 11px; }
.kanban-card:hover { border-color: var(--lav-200); }
.kanban-card.dragging { opacity: 0.4; transform: rotate(1.5deg); }
.kanban-card-company { font-weight: 500; color: var(--c-tx); margin-bottom: 3px; font-size: 12px; }
.kanban-card-contact { color: var(--c-txm); font-size: 10px; margin-bottom: 6px; }
.kanban-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--c-bord); }
.kanban-card-amount { font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--brand); }
.kanban-card-partner { font-size: 10px; color: var(--c-txm); }
.kanban-card-partner-line { font-size: 10px; color: var(--brand); font-weight: 500; margin-bottom: 2px; opacity: 0.75; }
.kanban-column[data-stage="won"] .kanban-card { border-left: 2px solid #2D6B1A; }
.kanban-column[data-stage="won"] .kanban-card-amount { color: #2D6B1A; }
.kanban-column[data-stage="lost"] .kanban-card { border-left: 2px solid #C0392B; opacity: 0.7; }
.kanban-column[data-stage="lost"] .kanban-card-amount { color: #C0392B; }
.kanban-card.stale { border-left: 2px solid #D4974A; background: #FFFBF5; }
.stale-badge { font-size: 9px; color: #D4974A; font-weight: 500; font-family: var(--mono); }
.kanban-col-drop { border: 1.5px dashed var(--lav-200); background: var(--c-surf2); border-radius: var(--r10); min-height: 50px; margin-top: 6px; display: none; align-items: center; justify-content: center; font-size: 11px; color: var(--c-txm); }
.dq-bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; background: var(--c-surf); border: 1px solid var(--c-bord); border-radius: var(--r10); margin-bottom: 10px; font-size: 11px; }
.dq-bar-left  { display: flex; align-items: center; gap: 8px; }
.dq-bar-label { color: var(--c-txm); }
.dq-bar-count { font-family: var(--mono); font-weight: 500; color: var(--c-tx); }
.dq-bar-qual  { font-size: 11px; color: var(--c-txm); }
.dq-bar-qual strong { color: var(--c-ok); font-weight: 500; }

/* ── QUOTE PREVIEW ───────────────────────────────────────── */
.quote-preview-box { background: var(--c-surf2); border: 1px solid var(--lav-200); border-radius: var(--r10); padding: 14px 16px; margin-top: 14px; }
.qp-row { display: flex; justify-content: space-between; font-size: 12px; padding: 4px 0; }
.qp-label { color: var(--c-txm); }
.qp-val { font-family: var(--mono); color: var(--c-tx2); }
.qp-row.total .qp-label { font-weight: 500; color: var(--c-tx); font-size: 13px; }
.qp-row.total .qp-val { color: var(--brand); font-size: 15px; }
.qp-row.disc .qp-val { color: var(--c-ok); }
.qp-divider { height: 1px; background: var(--c-bord); margin: 6px 0; }

/* Suite checkboxes */
.eq-readonly{display:inline-block;padding:6px 10px;background:var(--c-surf2);border:1px solid var(--c-bord);border-radius:var(--r6);font-size:12px;color:var(--c-tx2);min-width:80px}
.suite-check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.suite-check-item { display: flex; align-items: center; gap: 7px; padding: 7px 9px; border: 1px solid var(--c-bord); border-radius: var(--r6); cursor: pointer; transition: all 0.15s; font-size: 11px; color: var(--c-tx2); background: var(--c-surf); }
.suite-check-item:hover { border-color: var(--lav-200); background: var(--c-surf2); }
.suite-check-item.checked { border-color: var(--brand); background: var(--brand-light); color: var(--brand); }
.suite-cb { width: 14px; height: 14px; border-radius: 3px; border: 1.5px solid var(--c-bord); background: var(--c-surf); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.suite-check-item.checked .suite-cb { background: var(--brand); border-color: var(--brand); }
.suite-check-item.checked .suite-cb::after { content: '✓'; font-size: 8px; color: #fff; font-weight: 500; }
.suite-check-name { flex: 1; }
.suite-check-price { font-family: var(--mono); font-size: 10px; color: var(--c-txm); }
.suite-check-item.checked .suite-check-price { color: var(--lav-400); }

/* Collaborators */
.collab-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.collab-avatars { display: flex; }
.collab-av { width: 26px; height: 26px; border-radius: 50%; background: var(--brand-light); border: 2px solid var(--c-surf); color: var(--brand); font-size: 9px; font-weight: 500; font-family: var(--mono); display: flex; align-items: center; justify-content: center; margin-left: -6px; }
.collab-av:first-child { margin-left: 0; }
.collab-plus { background: var(--c-surf2); border: 2px solid var(--c-bord); color: var(--c-txm); font-size: 9px; font-family: var(--mono); }
.collab-add-row { display: flex; gap: 7px; align-items: center; }
.collab-add-row select { flex: 1; height: 30px; padding: 0 8px; border: 1px solid var(--c-bord); border-radius: var(--r6); font-size: 11px; font-family: var(--sans); color: var(--c-tx); background: var(--c-surf); outline: none; appearance: none; }

/* Target section */
.target-section { background: var(--c-surf); border: 1px solid var(--c-bord); border-radius: var(--r10); overflow: hidden; margin-bottom: 12px; }
.target-section h4 { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 500; color: var(--c-tx); padding: 11px 16px; background: var(--c-surf2); border-bottom: 1px solid var(--c-bord); margin: 0; font-family: var(--sans); }
.target-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px 16px; }
.target-label { font-size: 10px; color: var(--c-txm); margin-bottom: 4px; }
.target-vals { display: flex; justify-content: space-between; font-size: 11px; color: var(--c-txm); margin-bottom: 4px; }
.target-current { font-family: var(--mono); color: var(--brand); }
.target-track { height: 5px; background: var(--c-bord); border-radius: 3px; overflow: hidden; }
.target-bar   { height: 100%; background: var(--brand); border-radius: 3px; transition: width 0.4s; }

/* Revenue detail */
.revenue-detail-card { background: var(--c-surf); border: 1px solid var(--c-bord); border-radius: var(--r10); padding: 14px 16px; }
.revenue-detail-row { display: flex; justify-content: space-between; font-size: 11px; padding: 3px 0; color: var(--c-txm); }
.revenue-detail-bar { height: 3px; background: var(--c-bord); border-radius: 2px; margin: 4px 0 8px; overflow: hidden; }
.revenue-detail-fill { height: 100%; border-radius: 2px; background: var(--brand); transition: width 0.4s; }
.revenue-detail-fill.nrr { background: var(--c-ok); }

/* Contract dist */
.contract-dist { margin-top: 12px; }
.contract-dist-title { font-size: 10px; font-family: var(--mono); color: var(--c-txh); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.contract-dist-bars { display: flex; flex-direction: column; gap: 6px; }
.contract-dist-row { display: flex; align-items: center; gap: 10px; font-size: 11px; }
.contract-dist-label { width: 70px; color: var(--c-txm); text-align: right; flex-shrink: 0; }
.contract-dist-bar { flex: 1; height: 5px; background: var(--c-bord); border-radius: 3px; overflow: hidden; }
.contract-dist-fill { height: 100%; border-radius: 3px; transition: width 0.4s; }
.contract-dist-count { font-size: 10px; font-family: var(--mono); color: var(--c-txm); white-space: nowrap; }

/* ── REVENUE CARDS ──────────────────────────────────────── */
.revenue-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 12px; }
.revenue-card { background: var(--c-surf); border: 1px solid var(--c-bord); border-radius: var(--r10); padding: 14px 16px; }
.revenue-card-label { font-size: 10px; font-family: var(--mono); color: var(--c-txh); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.revenue-card-value { font-size: 22px; font-weight: 500; font-family: var(--mono); color: var(--brand); line-height: 1; margin-bottom: 2px; }
.revenue-card-value.urgent { color: var(--c-warn); }
.revenue-card-value.churn  { color: var(--c-err); }
.revenue-card-value small { font-size: 13px; color: var(--c-txm); }
.revenue-card-sub { font-size: 10px; color: var(--c-txm); margin-top: 2px; }

.revenue-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.revenue-detail-label { font-size: 11px; color: var(--c-txm); margin-bottom: 4px; }
.revenue-detail-value { font-size: 20px; font-weight: 500; font-family: var(--mono); color: var(--brand); margin-bottom: 8px; }
.revenue-detail-value.churn { color: var(--c-err); }
.revenue-detail-value.good  { color: var(--c-ok); }
.revenue-detail-bar { height: 3px; background: var(--c-bord); border-radius: 2px; overflow: hidden; }
.revenue-detail-fill { height: 100%; border-radius: 2px; background: var(--brand); transition: width 0.4s; }
.revenue-detail-fill.nrr   { background: var(--c-ok); }
.revenue-detail-fill.churn { background: var(--c-err); }

/* ── ACTIVITY FEED ITEMS ─────────────────────────────────── */
.crm-feed-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--c-row); font-size: 12px; }
.crm-feed-item:last-child { border-bottom: none; }
.crm-feed-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; background: var(--brand-mid); }
.crm-feed-dot.green  { background: var(--c-ok); }
.crm-feed-dot.blue   { background: #0C447C; }
.crm-feed-dot.orange { background: var(--c-warn); }
.crm-feed-dot.red    { background: var(--c-err); }
.crm-feed-text { flex: 1; color: var(--c-tx); line-height: 1.5; }
.crm-feed-text strong { font-weight: 500; }
.crm-feed-time { font-size: 10px; font-family: var(--mono); color: var(--c-txm); white-space: nowrap; flex-shrink: 0; }

/* ── PERFORMANCE BAR ─────────────────────────────────────── */
.crm-perf-bar { display: inline-block; width: 60px; height: 4px; background: var(--c-bord); border-radius: 2px; overflow: hidden; vertical-align: middle; margin-right: 5px; }
.crm-perf-fill { height: 100%; border-radius: 2px; background: var(--brand); }

/* ── REP BADGE (avatar + isim) ───────────────────────────── */
.rep-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px 2px 2px; border-radius: var(--rF); background: var(--c-surf2); border: 1px solid var(--c-bord); font-size: 11px; color: var(--c-tx2); }
.rep-avatar { width: 18px; height: 18px; border-radius: 50%; background: var(--brand-light); color: var(--brand); font-size: 8px; font-weight: 500; font-family: var(--mono); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ── CUSTOMER DETAIL ─────────────────────────────────────── */
.crm-detail-title { font-size: 18px; font-weight: 500; color: var(--c-tx); margin-bottom: 6px; }

.crm-detail-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 0; border: 1px solid var(--c-bord); border-radius: var(--r10); overflow: hidden; margin-bottom: 14px; }
.crm-detail-field { padding: 10px 14px; border-right: 1px solid var(--c-bord); border-bottom: 1px solid var(--c-bord); }
.crm-detail-field:nth-child(3n) { border-right: none; }
.crm-detail-field:nth-last-child(-n+3) { border-bottom: none; }
.crm-detail-field.full { grid-column: 1 / -1; border-right: none; }
.crm-detail-field label { font-size: 9px; font-family: var(--mono); color: var(--c-txh); text-transform: uppercase; letter-spacing: 0.05em; display: block; margin-bottom: 3px; }
.crm-detail-field span { font-size: 12px; color: var(--c-tx); font-weight: 500; }

/* ── ACTIVITY TIMELINE ────────────────────────────────────── */
.crm-timeline-title { font-size: 11px; font-weight: 500; color: var(--c-tx2); margin: 16px 0 10px; font-family: var(--sans); }
.crm-timeline-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--c-row); }
.crm-timeline-item:last-child { border-bottom: none; }
.crm-timeline-icon { width: 28px; height: 28px; border-radius: 50%; background: var(--brand-light); border: 1px solid var(--lav-200); display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; font-size: 13px; }
.crm-timeline-content { flex: 1; }
.crm-timeline-note { font-size: 12px; color: var(--c-tx); line-height: 1.5; }
.crm-timeline-date { font-size: 10px; color: var(--c-txm); margin-top: 3px; font-family: var(--mono); }

/* Add activity inline form */
.crm-add-activity { display: flex; flex-direction: column; gap: 8px; background: var(--c-surf2); border: 1px solid var(--c-bord); border-radius: var(--r10); padding: 12px 14px; margin-bottom: 14px; }
.crm-add-activity select,
.crm-add-activity input[type=text],
.crm-add-activity input[type=date],
.crm-add-activity input[type=number] { height: 32px; padding: 0 9px; border: 1px solid var(--c-bord); border-radius: var(--r6); font-size: 11px; font-family: var(--sans); color: var(--c-tx); background: var(--c-surf); outline: none; transition: border-color .15s; }
.crm-add-activity select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23A398D3' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 7px center; padding-right: 24px; }
.crm-add-activity select:focus,
.crm-add-activity input:focus { border-color: var(--brand); }
.crm-add-activity input::placeholder { color: var(--c-txh); }

/* Stage change select inside detail */
.stage-change-select { height: 30px; padding: 0 24px 0 9px; border: 1px solid var(--c-bord); border-radius: var(--r6); font-size: 11px; font-family: var(--sans); color: var(--c-tx2); background: var(--c-surf) url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23A398D3' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 7px center; appearance: none; outline: none; cursor: pointer; }
.stage-change-select:focus { border-color: var(--brand); }

/* ── MISC ────────────────────────────────────────────────── */
.text-mono  { font-family: var(--mono) !important; }
.text-brand { color: var(--brand) !important; }
.text-muted { color: var(--c-txm) !important; }
.text-ok    { color: var(--c-ok) !important; }
.text-warn  { color: var(--c-warn) !important; }
.text-err   { color: var(--c-err) !important; }
.dash-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.dash-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.mono { font-family: var(--mono); }

/* ── Topbar (fixed above scroll area) ── */
.topbar { height: var(--topbar-h); background: var(--c-surf); border-bottom: 1px solid var(--c-bord); display: flex; align-items: center; padding: 0 22px; gap: 10px; flex-shrink: 0; }
.tb-title { flex: 1; font-size: 22px; font-weight: 600; color: var(--c-tx); letter-spacing: -0.3px; }
.tb-actions { display: flex; align-items: center; gap: 8px; }

/* ── Alert Bar ── */
.alert-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--c-warn-bg); border: 1px solid var(--c-warn-b); border-radius: var(--r10); margin-bottom: 12px; font-size: 12px; color: var(--c-warn); }
.alert-bar svg { flex-shrink: 0; }
.alert-bar-txt { flex: 1; }
.alert-bar-txt strong { font-weight: 500; }

/* ── Revenue Cards ── */
.rev-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 12px; }
.rev-card { background: var(--c-surf); border: 1px solid var(--c-bord); border-radius: var(--r10); padding: 14px 16px; }
.rev-label { font-size: 10px; font-family: var(--mono); color: var(--c-txh); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.rev-value { font-size: 22px; font-weight: 500; font-family: var(--mono); color: var(--brand); line-height: 1; }
.rev-value.urgent { color: var(--c-warn); }
.rev-value.churn { color: var(--c-err); }
.rev-value small { font-size: 13px; color: var(--c-txm); }
.rev-sub { font-size: 10px; color: var(--c-txm); margin-top: 3px; }

/* ── Metric Cards (Churn / NRR) ── */
.metric-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.metric-card { background: var(--c-surf); border: 1px solid var(--c-bord); border-radius: var(--r10); padding: 14px 18px; }
.metric-card-label { font-size: 11px; color: var(--c-txm); margin-bottom: 4px; }
.metric-card-value { font-size: 22px; font-weight: 500; font-family: var(--mono); color: var(--brand); margin-bottom: 8px; }
.metric-card-value.good { color: var(--c-ok); }
.metric-card-value.risk { color: var(--c-err); }
.metric-bar { height: 3px; background: var(--c-bord); border-radius: 2px; overflow: hidden; }
.metric-fill { height: 100%; border-radius: 2px; background: var(--brand); }
.metric-fill.good { background: var(--c-ok); }
.metric-fill.risk { background: var(--c-err); }

/* ── Chart Row (2-col, funnel + donut) ── */
.chart-row { display: grid; grid-template-columns: 1fr 320px; gap: 12px; margin-bottom: 12px; }

/* ── Funnel amount ── */
.funnel-amount { width: 58px; text-align: right; font-family: var(--mono); font-size: 10px; color: var(--brand); flex-shrink: 0; }

/* ── Feed (redesign) ── */
.feed-list { padding: 4px 0; }
.feed-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 16px; border-bottom: 1px solid var(--c-row); font-size: 12px; }
.feed-item:last-child { border-bottom: none; }
.feed-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; background: var(--brand-mid); }
.feed-dot.green { background: var(--c-ok); }
.feed-dot.blue { background: #0C447C; }
.feed-dot.orange { background: var(--c-warn); }
.feed-dot.red { background: var(--c-err); }
.feed-text { flex: 1; color: var(--c-tx); line-height: 1.5; }
.feed-text strong { font-weight: 500; }
.feed-meta { font-size: 10px; font-family: var(--mono); color: var(--c-txm); margin-top: 2px; }
.feed-time { font-size: 10px; font-family: var(--mono); color: var(--c-txm); white-space: nowrap; flex-shrink: 0; }

/* ── Wall / Ekip Duvarı ── */
.wall-compose { border-bottom: 1px solid var(--c-bord); }
.wall-textarea { width: 100%; resize: vertical; padding: 8px 10px; border: 1px solid var(--c-bord); border-radius: var(--r8); font-size: 12px; font-family: var(--sans); min-height: 40px; max-height: 120px; box-sizing: border-box; }
.wall-textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 2px rgba(79,70,187,.1); }
.wall-avatar { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: #fff; flex-shrink: 0; }
.wall-item { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--c-row); }
.wall-item:last-child { border-bottom: none; }
.wall-item.wall-post { background: #fefff7; }
.wall-bubble { flex: 1; }
.wall-bubble-head { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.wall-bubble-name { font-size: 12px; font-weight: 600; color: var(--c-tx); }
.wall-bubble-badge { font-size: 9px; padding: 1px 6px; border-radius: 4px; font-weight: 500; }
.wall-bubble-time { font-size: 10px; color: var(--c-txm); font-family: var(--mono); margin-left: auto; }
.wall-bubble-text { font-size: 12px; color: var(--c-tx); line-height: 1.5; }
.wall-bubble-ctx { font-size: 10px; color: var(--c-txm); margin-top: 2px; }

/* ── Leaderboard perf bars ── */
.perf-wrap { display: flex; align-items: center; gap: 8px; }
.perf-track { flex: 1; height: 4px; background: var(--c-bord); border-radius: 2px; overflow: hidden; max-width: 80px; }
.perf-fill { height: 100%; border-radius: 2px; background: var(--brand); }
.perf-pct { font-family: var(--mono); font-size: 11px; color: var(--c-txm); white-space: nowrap; }
.medal { font-size: 14px; }
.mono-cell { font-family: var(--mono); color: var(--brand); }

/* ── Target progress (redesign) ── */
.target-label { font-size: 10px; color: var(--c-txm); margin-bottom: 4px; }
.target-vals { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 4px; }
.target-current { font-family: var(--mono); color: var(--brand); }
.target-goal { font-family: var(--mono); color: var(--c-txm); }
.target-track { height: 5px; background: var(--c-bord); border-radius: 3px; overflow: hidden; }
.target-fill { height: 100%; background: var(--brand); border-radius: 3px; }

/* ══════════════════════════════════════════════════════════
   OPPORTUNITY WIZARD — 4-Step (from prototype v5)
   ══════════════════════════════════════════════════════════ */

/* ── WIZARD HEADER ───────────────────────────────────────── */
.ow-header{padding:16px 22px 12px;border-bottom:1px solid var(--c-bord);display:flex;align-items:flex-start;justify-content:space-between}
.ow-header-left{display:flex;align-items:center;gap:11px}
.ow-header-icon{width:36px;height:36px;border-radius:var(--r10);background:var(--brand-light);border:1px solid var(--lav-200);display:flex;align-items:center;justify-content:center;flex-shrink:0}
.ow-title{font-size:15px;font-weight:500;color:var(--c-tx);margin-bottom:2px}
.ow-sub{font-size:11px;color:var(--c-txm)}
.ow-close{width:26px;height:26px;border-radius:var(--r6);border:1px solid var(--c-bord);background:none;cursor:pointer;color:var(--c-txm);font-size:12px;display:flex;align-items:center;justify-content:center}
.ow-close:hover{background:var(--c-surf2)}

/* ── STEP BAR ────────────────────────────────────────────── */
.ow-steps{display:flex;align-items:center;padding:0 22px;border-bottom:1px solid var(--c-bord);background:var(--c-surf2);height:50px}
.ow-sw{display:flex;align-items:center;flex:1}
.ow-sw:last-child{flex:none}
.ow-sb{display:flex;align-items:center;gap:6px;cursor:pointer;border:none;background:none;font-family:var(--sans);padding:2px 0}
.ow-sn{width:21px;height:21px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:500;font-family:var(--mono);flex-shrink:0;transition:all .2s}
.ow-sl_{font-size:11px;white-space:nowrap}
.ow-sl{flex:1;height:1px;margin:0 8px;transition:background .3s}
.ow-sb.done .ow-sn{background:var(--brand);color:#fff}
.ow-sb.done .ow-sl_{color:var(--brand);font-weight:500}
.ow-sb.active .ow-sn{background:var(--brand-light);color:var(--brand);border:1.5px solid var(--brand)}
.ow-sb.active .ow-sl_{color:var(--brand);font-weight:500}
.ow-sb.todo .ow-sn{background:var(--c-bord);color:var(--c-txm)}
.ow-sb.todo .ow-sl_{color:var(--c-txm)}
.ow-sl.done{background:var(--lav-200)}
.ow-sl.todo{background:var(--c-bord)}

/* ── PANELS & BODY ───────────────────────────────────────── */
.ow-panel{display:none;flex-direction:column}
.ow-panel.active{display:flex}
.ow-body{padding:18px 22px;overflow-y:auto;max-height:calc(100vh - 270px)}
.ow-body::-webkit-scrollbar{width:3px}
.ow-body::-webkit-scrollbar-thumb{background:var(--lav-200);border-radius:2px}

/* ── FORM ELEMENTS ───────────────────────────────────────── */
.ow-fg{display:flex;flex-direction:column;gap:5px;margin-bottom:13px}
.ow-fl{font-size:10px;font-family:var(--mono);color:var(--c-txh);text-transform:uppercase;letter-spacing:.04em}
.ow-req{color:var(--brand);margin-left:2px}
.ow-fi,.ow-fs{width:100%;height:34px;padding:0 10px;border:1px solid var(--c-bord);border-radius:var(--r6);font-size:12px;font-family:var(--sans);color:var(--c-tx);background:var(--c-surf);outline:none;transition:border-color .15s}
.ow-fi:focus,.ow-fs:focus{border-color:var(--brand)}
.ow-fi::placeholder{color:var(--c-txh)}
.ow-fi.ok,.ow-fs.ok{border-color:var(--lav-200);background:#FDFCFF}
.ow-fs{cursor:pointer;appearance:none;background-image:url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23A398D3' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center;padding-right:28px}
.ow-fr2{display:grid;grid-template-columns:1fr 1fr;gap:13px}
.ow-fr3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:13px}
.ow-ft{width:100%;height:auto;min-height:66px;padding:8px 10px;border:1px solid var(--c-bord);border-radius:var(--r6);font-size:12px;font-family:var(--sans);color:var(--c-tx);background:var(--c-surf);outline:none;resize:none;line-height:1.6}
.ow-fi-pre{position:relative}
.ow-fi-pre .ow-fi{padding-left:22px}
.ow-fi-pre .ow-sym{position:absolute;left:10px;top:50%;transform:translateY(-50%);font-family:var(--mono);font-size:12px;color:var(--c-txh)}

/* ── SECTION / DIVIDER ───────────────────────────────────── */
.ow-sec{font-size:10px;font-family:var(--mono);color:var(--c-txh);text-transform:uppercase;letter-spacing:.06em;margin-bottom:10px;display:flex;align-items:center;gap:8px}
.ow-sec::after{content:'';flex:1;height:1px;background:var(--c-bord)}
.ow-divider{height:1px;background:var(--c-bord);margin:14px 0}

/* ── PACKAGE CARDS ───────────────────────────────────────── */
.ow-pkg-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin-bottom:13px}
.ow-pkg{border:1px solid var(--c-bord);border-radius:var(--r10);padding:12px 11px;cursor:pointer;transition:all .15s;background:var(--c-surf);position:relative}
.ow-pkg:hover{border-color:var(--lav-200);background:var(--c-surf2)}
.ow-pkg.on{border-color:var(--brand);background:var(--brand-light);border-width:1.5px}
.ow-pkg-badge{position:absolute;top:-1px;right:10px;font-size:9px;font-family:var(--mono);padding:2px 7px;border-radius:0 0 var(--r4) var(--r4);background:var(--brand);color:#fff}
.ow-pkg-name{font-size:13px;font-weight:500;color:var(--c-tx);margin-bottom:3px}
.ow-pkg.on .ow-pkg-name{color:var(--brand)}
.ow-pkg-price{font-size:16px;font-weight:500;font-family:var(--mono);color:var(--brand);margin-bottom:1px}
.ow-pkg-price-sub{font-size:9px;color:var(--c-txm);margin-bottom:6px}
.ow-pkg-saving{font-size:9px;font-family:var(--mono);padding:1px 5px;border-radius:var(--r4);background:var(--c-ok-bg);color:var(--c-ok);border:1px solid var(--c-ok-b);display:inline-block;margin-bottom:6px}
.ow-pkg-saving-mo{font-size:9px;font-family:var(--mono);padding:1px 5px;border-radius:var(--r4);background:var(--c-warn-bg);color:var(--c-warn);border:1px solid var(--c-warn-b);display:inline-block;margin-bottom:6px}
.ow-pkg-feat{list-style:none}
.ow-pkg-feat li{font-size:10px;color:var(--c-txm);padding:2px 0;display:flex;align-items:center;gap:4px}
.ow-pkg-feat li::before{content:'';width:5px;height:5px;border-radius:50%;background:var(--lav-300);flex-shrink:0}
.ow-pkg.on .ow-pkg-feat li::before{background:var(--brand-mid)}
.ow-pkg-mark{width:16px;height:16px;border-radius:50%;background:var(--brand);display:none;align-items:center;justify-content:center;position:absolute;top:9px;right:9px}
.ow-pkg.on .ow-pkg-mark{display:flex}

/* ── SUITE CARDS ─────────────────────────────────────────── */
.ow-suite-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-bottom:14px}
.ow-suite{border:1px solid var(--c-bord);border-radius:var(--r10);padding:10px 12px;cursor:pointer;transition:all .15s;background:var(--c-surf);display:flex;align-items:flex-start;gap:9px}
.ow-suite:hover{border-color:var(--lav-200);background:var(--c-surf2)}
.ow-suite.on{border-color:var(--brand);background:var(--brand-light);border-width:1.5px}
.ow-suite-chk{width:16px;height:16px;border-radius:4px;border:1.5px solid var(--c-bord);background:var(--c-surf);flex-shrink:0;margin-top:1px;display:flex;align-items:center;justify-content:center;transition:all .15s}
.ow-suite.on .ow-suite-chk{background:var(--brand);border-color:var(--brand)}
.ow-suite.on .ow-suite-chk::after{content:'\2713';font-size:9px;color:#fff;font-weight:500}
.ow-suite-name{font-size:12px;font-weight:500;color:var(--c-tx2);margin-bottom:2px}
.ow-suite.on .ow-suite-name{color:var(--brand)}
.ow-suite-price{font-size:10px;font-family:var(--mono);color:var(--c-txm)}
.ow-suite.on .ow-suite-price{color:var(--lav-400)}
.ow-suite-oor{font-size:9px;color:var(--c-warn);background:var(--c-warn-bg);padding:1px 5px;border-radius:var(--r4);margin-left:4px;font-family:var(--mono)}

/* ── TOGGLE GROUP ────────────────────────────────────────── */
.ow-tg{display:flex;border:1px solid var(--c-bord);border-radius:var(--r6);overflow:hidden;width:fit-content;height:34px}
.ow-tg-b{padding:0 14px;font-size:11px;font-family:var(--mono);background:none;border:none;border-right:1px solid var(--c-bord);cursor:pointer;color:var(--c-txm);transition:all .1s;line-height:32px}
.ow-tg-b:last-child{border-right:none}
.ow-tg-b.on{background:var(--brand);color:#fff}

/* ── PREPAY BOX ──────────────────────────────────────────── */
.ow-prepay-box{display:none;align-items:center;gap:10px;padding:11px 14px;border-radius:var(--r10);border:1px solid var(--c-bord);background:var(--c-surf);cursor:pointer;transition:all .15s;user-select:none;margin-bottom:14px}
.ow-prepay-box:hover{border-color:var(--lav-200);background:var(--c-surf2)}
.ow-prepay-box.active{border-color:var(--c-ok-b);background:var(--c-ok-bg)}
.ow-prepay-chk{width:18px;height:18px;border-radius:4px;border:1.5px solid var(--c-bord);background:var(--c-surf);flex-shrink:0;display:flex;align-items:center;justify-content:center;transition:all .15s}
.ow-prepay-box.active .ow-prepay-chk{background:var(--c-ok);border-color:var(--c-ok)}
.ow-prepay-box.active .ow-prepay-chk::after{content:'\2713';font-size:10px;color:#fff;font-weight:500}
.ow-prepay-label{flex:1}
.ow-prepay-title{font-size:13px;font-weight:500;color:var(--c-tx)}
.ow-prepay-box.active .ow-prepay-title{color:var(--c-ok)}
.ow-prepay-desc{font-size:11px;color:var(--c-txm);margin-top:1px}
.ow-prepay-badge{font-size:11px;font-family:var(--mono);font-weight:500;padding:3px 9px;border-radius:var(--rF);background:var(--c-ok-bg);color:var(--c-ok);border:1px solid var(--c-ok-b);white-space:nowrap;flex-shrink:0}
.ow-prepay-box:not(.active) .ow-prepay-badge{background:var(--c-surf2);color:var(--c-txm);border-color:var(--c-bord)}

/* ── PRICE TABLE ─────────────────────────────────────────── */
.ow-pt-wrap{border:1px solid var(--c-bord);border-radius:var(--r10);overflow:hidden;margin-bottom:14px}
.ow-pt-header{display:grid;grid-template-columns:2fr 80px 100px 80px 100px 90px;gap:0;background:var(--c-surf2);border-bottom:1px solid var(--c-bord)}
.ow-pt-th{padding:7px 10px;font-size:9px;font-family:var(--mono);color:var(--c-txh);text-transform:uppercase;letter-spacing:.04em}
.ow-pt-th.right{text-align:right}
.ow-pt-row{display:grid;grid-template-columns:2fr 80px 100px 80px 100px 90px;gap:0;border-bottom:1px solid var(--c-row);align-items:center;transition:background .1s}
.ow-pt-row:last-child{border-bottom:none}
.ow-pt-row:hover{background:var(--c-surf2)}
.ow-pt-row.core-row{background:#FAFAFE}
.ow-pt-row.core-row:hover{background:var(--brand-light)}
.ow-pt-cell{padding:8px 10px;font-size:12px;color:var(--c-tx)}
.ow-pt-cell.right{text-align:right;font-family:var(--mono)}
.ow-pt-prod{display:flex;align-items:center;gap:7px}
.ow-pt-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}
.ow-pt-name{font-size:12px;color:var(--c-tx)}
.ow-pt-badge{font-size:9px;font-family:var(--mono);padding:1px 5px;border-radius:var(--r4);background:var(--brand-light);color:var(--brand);margin-left:3px}
.ow-pt-oor{font-size:9px;color:var(--c-warn);background:var(--c-warn-bg);padding:1px 5px;border-radius:var(--r4);margin-left:3px;font-family:var(--mono)}
.ow-pt-input{width:100%;height:28px;padding:0 7px;border:1px solid var(--c-bord);border-radius:var(--r4);font-size:11px;font-family:var(--mono);color:var(--c-tx);outline:none;background:var(--c-surf);text-align:right;transition:border-color .15s}
.ow-pt-input:focus{border-color:var(--brand)}
.ow-pt-input:hover{border-color:var(--lav-200)}
.ow-disc-cell{display:flex;align-items:center;gap:4px;padding:8px 10px}
.ow-disc-cell input{width:48px;height:28px;padding:0 6px;border:1px solid var(--c-bord);border-radius:var(--r4);font-size:11px;font-family:var(--mono);color:var(--c-tx);outline:none;background:var(--c-surf);text-align:right;transition:border-color .15s}
.ow-disc-cell input:focus{border-color:var(--brand)}
.ow-disc-cell .ow-pct{font-size:11px;color:var(--c-txm);font-family:var(--mono)}
.ow-disc-cell.has-disc input{border-color:var(--c-ok-b);background:var(--c-ok-bg);color:var(--c-ok)}
.ow-disc-cell.has-disc .ow-pct{color:var(--c-ok)}
.ow-net-val{font-weight:500;color:var(--brand)}
.ow-net-val.discounted{color:var(--c-ok)}
.ow-pt-subtotal{display:grid;grid-template-columns:2fr 80px 100px 80px 100px 90px;gap:0;border-top:2px solid var(--c-bord);background:var(--c-surf2)}
.ow-pt-st{padding:9px 10px;font-size:11px}
.ow-pt-st.right{text-align:right;font-family:var(--mono)}

/* ── TOTALS BOX ──────────────────────────────────────────── */
.ow-totals{background:var(--c-surf2);border:1px solid var(--lav-200);border-radius:var(--r10);padding:14px 16px}
.ow-tot-row{display:flex;justify-content:space-between;align-items:center;padding:4px 0;font-size:12px}
.ow-tot-label{color:var(--c-txm)}
.ow-tot-val{font-family:var(--mono);color:var(--c-tx2)}
.ow-tot-row.disc-line .ow-tot-label,.ow-tot-row.disc-line .ow-tot-val{color:var(--c-ok)}
.ow-tot-row.prepay-line .ow-tot-label,.ow-tot-row.prepay-line .ow-tot-val{color:var(--c-ok)}
.ow-tot-divider{height:1px;background:var(--c-bord);margin:6px 0}
.ow-tot-row.big .ow-tot-label{font-size:13px;font-weight:500;color:var(--c-tx)}
.ow-tot-row.big .ow-tot-val{font-size:15px;color:var(--brand)}
.ow-tot-row.arr .ow-tot-label{color:var(--lav-400)}
.ow-tot-row.arr .ow-tot-val{color:var(--lav-400)}
.ow-prob-row{display:flex;align-items:center;gap:9px;margin-top:8px;padding-top:8px;border-top:1px solid var(--c-bord)}
.ow-prob-label{font-size:11px;color:var(--c-txm);white-space:nowrap}

/* ── FOOTER ──────────────────────────────────────────────── */
.ow-footer{padding:13px 22px;border-top:1px solid var(--c-bord);display:flex;align-items:center;justify-content:space-between;background:var(--c-surf2);flex-shrink:0}
.ow-footer-l{font-size:11px;color:var(--c-txm)}
.ow-footer-r{display:flex;gap:7px}
.ow-btn{font-size:12px;padding:6px 14px;border-radius:var(--r6);border:1px solid var(--c-bord);background:var(--c-surf);color:var(--c-tx2);cursor:pointer;font-family:var(--sans);display:inline-flex;align-items:center;gap:5px;transition:all .1s}
.ow-btn:hover{background:var(--c-surf2)}
.ow-btn-p{background:var(--brand);color:#fff;border-color:var(--brand);font-weight:500}
.ow-btn-p:hover{background:var(--brand-hover)}
.ow-btn-g{border:none;background:none;color:var(--c-txm);padding:6px 9px}
.ow-btn-g:hover{color:var(--c-tx);background:var(--c-surf)}
.ow-btn-ok{background:var(--c-ok);color:#fff;border-color:var(--c-ok);font-weight:500}
.ow-btn-ok:hover{background:#235414}

/* ── PILLS & TAGS ────────────────────────────────────────── */
.ow-sp-row{display:flex;gap:5px;flex-wrap:wrap}
.ow-sp{padding:4px 11px;border-radius:var(--rF);font-size:11px;cursor:pointer;border:1px solid var(--c-bord);background:var(--c-surf);color:var(--c-txm);transition:all .1s;font-family:var(--sans)}
.ow-sp:hover{border-color:var(--lav-200)}
.ow-sp.g{border-color:var(--c-ok-b);background:var(--c-ok-bg);color:var(--c-ok);font-weight:500}
.ow-sp.a{border-color:var(--c-warn-b);background:var(--c-warn-bg);color:var(--c-warn);font-weight:500}
.ow-sp.r{border-color:var(--c-err-b);background:var(--c-err-bg);color:var(--c-err);font-weight:500}
.ow-pill{display:inline-flex;align-items:center;font-size:10px;font-weight:500;padding:2px 7px;border-radius:var(--rF);white-space:nowrap}
.ow-pill-p{background:#EEEAFC;color:#1E0D7A}
.ow-pill-g{background:var(--c-ok-bg);color:var(--c-ok)}
.ow-pill-a{background:var(--c-warn-bg);color:var(--c-warn)}

/* ── CUSTOMER LIST (Step 1) ──────────────────────────────── */
.ow-cc-wrap{border:1px solid var(--c-bord);border-radius:var(--r10);overflow:hidden}
.ow-cc-srch{display:flex;align-items:center;padding:0 11px;border-bottom:1px solid var(--c-bord);gap:7px}
.ow-cc-srch input{flex:1;height:34px;border:none;outline:none;font-size:12px;color:var(--c-tx);font-family:var(--sans);background:transparent}
.ow-cc-srch input::placeholder{color:var(--c-txh)}
.ow-cc-list{max-height:200px;overflow-y:auto}
.ow-cc-item{display:flex;align-items:center;gap:9px;padding:8px 11px;cursor:pointer;border-bottom:1px solid var(--c-row);transition:background .1s}
.ow-cc-item:last-child{border-bottom:none}
.ow-cc-item:hover{background:var(--c-surf2)}
.ow-cc-item.sel{background:var(--brand-light)}
.ow-ci-av{width:24px;height:24px;border-radius:5px;background:var(--brand-light);border:1px solid var(--lav-200);color:var(--brand);display:flex;align-items:center;justify-content:center;font-size:9px;font-weight:500;font-family:var(--mono);flex-shrink:0}
.ow-ci-nm{font-size:12px;color:var(--c-tx);flex:1;font-weight:500}
.ow-ci-mt{font-size:10px;color:var(--c-txm)}
.ow-ci-tk{width:15px;height:15px;border-radius:50%;background:var(--brand);display:flex;align-items:center;justify-content:center;flex-shrink:0}
.ow-sel-cb{display:flex;align-items:center;gap:9px;padding:10px 13px;border:1px solid var(--lav-200);border-radius:var(--r10);background:var(--brand-light);margin-bottom:13px}

/* ── CONTRACT TYPE CARDS (Step 2) ────────────────────────── */
.ow-ct-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:7px}
.ow-ct{display:flex;flex-direction:column;align-items:center;padding:9px 5px;border:1px solid var(--c-bord);border-radius:var(--r10);cursor:pointer;transition:all .15s;gap:4px;background:var(--c-surf)}
.ow-ct:hover{border-color:var(--lav-200);background:var(--c-surf2)}
.ow-ct.on{border-color:var(--brand);background:var(--brand-light);border-width:1.5px}
.ow-ct .ow-ct-ico{font-size:16px;line-height:1}
.ow-ct .ow-ct-lbl{font-size:10px;font-weight:500;text-align:center}
.ow-ct.on .ow-ct-lbl{color:var(--brand)}
.ow-ct:not(.on) .ow-ct-lbl{color:var(--c-txm)}

/* ── SUMMARY BLOCKS (Step 4) ─────────────────────────────── */
.ow-sum-block{border:1px solid var(--c-bord);border-radius:var(--r10);overflow:hidden;margin-bottom:11px}
.ow-sb-head{padding:9px 13px;background:var(--c-surf2);border-bottom:1px solid var(--c-bord);display:flex;align-items:center;justify-content:space-between}
.ow-sb-htitle{font-size:10px;font-family:var(--mono);color:var(--c-txh);text-transform:uppercase;letter-spacing:.05em}
.ow-sb-edit{font-size:10px;color:var(--brand);cursor:pointer;background:none;border:none;font-family:var(--sans)}
.ow-sb-row{display:flex;justify-content:space-between;align-items:center;padding:6px 13px;border-bottom:1px solid var(--c-row);font-size:12px}
.ow-sb-row:last-child{border-bottom:none}
.ow-sb-key{color:var(--c-txm)}
.ow-sb-val{color:var(--c-tx);font-weight:500}
.ow-sb-val.money{font-family:var(--mono);color:var(--brand)}
.ow-sb-val.ok{color:var(--c-ok)}
.ow-sb-row.hl{background:var(--lav-100);border-top:1px solid var(--lav-200)}

/* ── SUCCESS BANNER ──────────────────────────────────────── */
.ow-confirm-banner{display:flex;align-items:center;gap:11px;padding:12px 14px;background:var(--c-ok-bg);border:1px solid var(--c-ok-b);border-radius:var(--r10);margin-bottom:13px}
.ow-cb-ico{width:30px;height:30px;border-radius:50%;background:var(--c-ok);display:flex;align-items:center;justify-content:center;flex-shrink:0}
.ow-cb-t{font-size:13px;font-weight:500;color:var(--c-ok)}
.ow-cb-s{font-size:11px;color:#4A8C35;margin-top:2px}

/* ══════════════════════════════════════════════════════════
   ACCOUNT HEADER — 3-Layer (Design Guide §7)
   ══════════════════════════════════════════════════════════ */

/* ── CONTAINER ─────────────────────────────────────────── */
.acct-header{background:var(--c-surf);border:1px solid var(--c-bord);border-radius:var(--r10);overflow:hidden;margin-bottom:14px;position:sticky;top:0;z-index:10}

/* ── LAYER 1: Identity ─────────────────────────────────── */
.acct-identity{padding:16px 20px;display:flex;align-items:flex-start;justify-content:space-between;border-bottom:1px solid var(--c-bord)}
.acct-info{display:flex;align-items:flex-start;gap:12px}
.acct-avatar{width:44px;height:44px;border-radius:var(--r10);background:var(--brand-light);border:1px solid var(--lav-200);display:flex;align-items:center;justify-content:center;font-size:15px;font-weight:500;color:var(--brand);font-family:var(--mono);flex-shrink:0}
.acct-name{font-size:17px;font-weight:500;color:var(--c-tx);margin-bottom:4px}
.acct-badges{display:flex;gap:5px;flex-wrap:wrap;align-items:center;margin-bottom:4px}
.acct-meta{font-size:11px;color:var(--c-txm)}
.acct-tags{display:flex;gap:4px;flex-wrap:wrap;margin-top:5px}
.acct-actions{display:flex;gap:7px;align-items:center;flex-shrink:0}

/* ── LAYER 2: Metrics ──────────────────────────────────── */
.acct-metrics{display:grid;grid-template-columns:repeat(4,1fr);border-bottom:1px solid var(--c-bord)}
.acct-metric{padding:10px 16px;border-right:1px solid var(--c-bord);text-align:center}
.acct-metric:last-child{border-right:none}
.acct-metric-label{font-size:9px;font-family:var(--mono);color:var(--c-txh);text-transform:uppercase;letter-spacing:.05em;margin-bottom:3px}
.acct-metric-value{font-size:16px;font-weight:500;font-family:var(--mono);color:var(--brand)}
.acct-metric-value.ok{color:var(--c-ok)}

/* ── LAYER 3: Tabs ─────────────────────────────────────── */
.acct-tabs{display:flex;padding:0 16px}
.acct-tab{padding:10px 14px;font-size:12px;color:var(--c-txm);cursor:pointer;border:none;border-bottom:2px solid transparent;transition:all .15s;background:none;font-family:var(--sans);display:flex;align-items:center;gap:4px}
.acct-tab:hover{color:var(--c-tx)}
.acct-tab.active{color:var(--brand);border-bottom-color:var(--brand);font-weight:500}
.acct-tab-count{font-size:9px;font-family:var(--mono);background:var(--brand-light);color:var(--brand);padding:1px 5px;border-radius:var(--rF)}
.acct-tab.active .acct-tab-count{background:var(--brand);color:#fff}

/* ── TAB CONTENT ───────────────────────────────────────── */
.detail-tab-panel{display:none}
.detail-tab-panel.active{display:block;padding:18px 0}

/* ══════════════════════════════════════════════════════════
   TOAST / NOTIFICATION SYSTEM  (Design Guide §6.18)
   ══════════════════════════════════════════════════════════ */
.crm-toast-container{position:fixed;top:16px;right:16px;z-index:9999;display:flex;flex-direction:column;gap:8px;pointer-events:none}
.crm-toast{pointer-events:auto;display:flex;align-items:center;gap:10px;padding:12px 16px;border-radius:var(--r10);font-size:12px;font-family:var(--sans);color:var(--c-tx);background:var(--c-surf);border:1px solid var(--c-bord);box-shadow:0 4px 16px rgba(0,0,0,.08);min-width:280px;max-width:420px;animation:toastIn .3s cubic-bezier(.16,1,.3,1) forwards}
.crm-toast.out{animation:toastOut .25s cubic-bezier(.7,0,.84,0) forwards}
.crm-toast-icon{flex-shrink:0;width:20px;height:20px;border-radius:var(--r6);display:flex;align-items:center;justify-content:center;font-size:11px}
.crm-toast.success .crm-toast-icon{background:var(--c-ok-bg);color:var(--c-ok)}
.crm-toast.error .crm-toast-icon{background:var(--c-err-bg);color:var(--c-err)}
.crm-toast.warning .crm-toast-icon{background:var(--c-warn-bg);color:#8B6914}
.crm-toast.info .crm-toast-icon{background:var(--brand-light);color:var(--brand)}
.crm-toast-msg{flex:1;line-height:1.4}
.crm-toast-close{flex-shrink:0;background:none;border:none;color:var(--c-txm);cursor:pointer;font-size:14px;padding:2px 4px;line-height:1;border-radius:var(--r4)}
.crm-toast-close:hover{background:var(--c-surf2);color:var(--c-tx)}
.crm-toast.success{border-color:var(--c-ok-b)}
.crm-toast.error{border-color:var(--c-err-b)}
.crm-toast.warning{border-color:#E8D5A8}
@keyframes toastIn{from{opacity:0;transform:translateX(40px)}to{opacity:1;transform:translateX(0)}}
@keyframes toastOut{from{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(40px)}}

/* ══════════════════════════════════════════════════════════
   FILTER CHIPS  (Design Guide §6.17)
   ══════════════════════════════════════════════════════════ */
.crm-filter-chips{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:10px}
.crm-filter-chip{display:inline-flex;align-items:center;gap:5px;padding:4px 10px;border-radius:var(--rF);font-size:11px;font-family:var(--sans);color:var(--brand);background:var(--brand-light);border:1px solid var(--lav-200);cursor:default;animation:chipIn .2s ease}
.crm-filter-chip .chip-label{color:var(--c-txh);font-family:var(--mono);font-size:9px;text-transform:uppercase}
.crm-filter-chip .chip-close{background:none;border:none;color:var(--brand);cursor:pointer;font-size:14px;line-height:1;padding:0 1px;border-radius:50%;transition:all .15s}
.crm-filter-chip .chip-close:hover{background:var(--brand);color:#fff}
@keyframes chipIn{from{opacity:0;transform:scale(.9)}to{opacity:1;transform:scale(1)}}

/* ══════════════════════════════════════════════════════════
   FORM VALIDATION STATES  (Design Guide §6.4)
   ══════════════════════════════════════════════════════════ */
.crm-form-group.error input,
.crm-form-group.error select,
.crm-form-group.error textarea{border-color:var(--c-err)}
.crm-form-group.error input:focus,
.crm-form-group.error select:focus,
.crm-form-group.error textarea:focus{border-color:var(--c-err)}
.crm-form-group.error label{color:var(--c-err)}
.crm-form-error{font-size:10px;color:var(--c-err);margin-top:2px;display:none}
.crm-form-group.error .crm-form-error{display:block}
.crm-form-group.success input,
.crm-form-group.success select{border-color:var(--c-ok-b)}
.crm-form-group.success input:focus,
.crm-form-group.success select:focus{border-color:var(--c-ok)}

/* ══════════════════════════════════════════════════════════
   TABLE SORTING INDICATORS  (Design Guide §6.16)
   ══════════════════════════════════════════════════════════ */
.crm-table th.sortable{cursor:pointer;user-select:none;position:relative;padding-right:22px}
.crm-table th.sortable:hover{color:var(--brand)}
.crm-table th.sortable::after{content:'⇅';position:absolute;right:6px;top:50%;transform:translateY(-50%);font-size:10px;color:var(--c-txh);font-family:var(--sans);opacity:.5;transition:opacity .15s}
.crm-table th.sortable:hover::after{opacity:1}
.crm-table th.sortable.asc::after{content:'↑';color:var(--brand);opacity:1}
.crm-table th.sortable.desc::after{content:'↓';color:var(--brand);opacity:1}

/* ══════════════════════════════════════════════════════════
   SOFT DELETE / INACTIVE ROW  (Design Guide §9, Rule 17)
   ══════════════════════════════════════════════════════════ */
.crm-table tr.inactive td{opacity:.5}
.crm-table tr.inactive:hover td{opacity:.65}
.pill-inactive{font-size:9px;font-family:var(--mono);padding:2px 7px;border-radius:var(--rF);background:var(--c-surf2);color:var(--c-txm);border:1px solid var(--c-bord);text-transform:uppercase;letter-spacing:.04em}

/* ══════════════════════════════════════════════════════════
   PAGINATION  (Design Guide §4.1.2)
   ══════════════════════════════════════════════════════════ */
.crm-pagination{display:flex;align-items:center;justify-content:center;gap:4px;padding:14px 0;font-size:12px}
.crm-page-btn{min-width:32px;height:32px;border:1px solid var(--c-bord);border-radius:var(--r6);background:var(--c-surf);color:var(--c-tx);font-family:var(--mono);font-size:12px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .15s}
.crm-page-btn:hover{border-color:var(--lav-200);background:var(--brand-light);color:var(--brand)}
.crm-page-btn.active{background:var(--brand);color:#fff;border-color:var(--brand)}
.crm-page-btn:disabled{opacity:.4;cursor:not-allowed;background:var(--c-surf)}
.crm-page-info{font-size:11px;color:var(--c-txm);margin:0 8px}

/* ══════════════════════════════════════════════════════════
   BUTTON ICON VARIANT  (Design Guide §6.3)
   ══════════════════════════════════════════════════════════ */
.btn-icon{width:30px;height:30px;border-radius:var(--r6);border:1px solid var(--c-bord);background:var(--c-surf);color:var(--c-txm);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .15s;padding:0}
.btn-icon:hover{border-color:var(--lav-200);background:var(--brand-light);color:var(--brand)}
.btn-icon.danger:hover{border-color:var(--c-err-b);background:var(--c-err-bg);color:var(--c-err)}
.btn-icon svg{width:14px;height:14px}

/* ══════════════════════════════════════════════════════════
   PRIMARY CONTACT ACCENT  (Design Guide §6.15)
   ══════════════════════════════════════════════════════════ */
.crm-table tr.contact-primary{border-left:2px solid var(--brand)}
.crm-table tr.contact-primary td:first-child{padding-left:14px}

/* ══════════════════════════════════════════════════════════
   EMPTY STATE — STANDARDIZED  (Design Guide §6.19)
   ══════════════════════════════════════════════════════════ */
.crm-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:48px 24px;text-align:center}
.crm-empty-icon{width:48px;height:48px;border-radius:var(--r10);background:var(--brand-light);display:flex;align-items:center;justify-content:center;margin-bottom:14px;font-size:20px}
.crm-empty-text{font-size:14px;font-weight:500;color:var(--c-tx);margin-bottom:4px}
.crm-empty-sub{font-size:12px;color:var(--c-txm);margin-bottom:14px;max-width:280px;line-height:1.5}
.crm-empty-cta{padding:7px 16px;border-radius:var(--r6);background:var(--brand);color:#fff;border:none;font-size:12px;font-family:var(--sans);cursor:pointer;transition:background .15s}
.crm-empty-cta:hover{background:var(--brand-hover)}

/* ══════════════════════════════════════════════════════════
   OPPORTUNITY QUOTE FLOW — Card selector
   ══════════════════════════════════════════════════════════ */
/* ══════════════════════════════════════════════════════════
   SETTINGS PAGE — Layout & Components
   ══════════════════════════════════════════════════════════ */
.settings-layout{display:grid;grid-template-columns:220px 1fr;gap:18px;min-height:400px}
.settings-cats{display:flex;flex-direction:column;gap:2px;padding:12px;background:var(--c-surf);border:1px solid var(--c-bord);border-radius:var(--r10)}
.settings-cat{display:flex;align-items:center;gap:8px;padding:9px 12px;border-radius:var(--r8);cursor:pointer;font-size:13px;color:var(--c-txm);transition:all .15s;border:1px solid transparent}
.settings-cat:hover{background:var(--brand-light);color:var(--c-tx)}
.settings-cat.active{background:var(--brand-light);color:var(--brand);font-weight:500;border-color:var(--lav-200)}
.settings-cat-icon{font-size:15px;width:20px;text-align:center;flex-shrink:0}
.settings-cat-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.settings-panel{background:var(--c-surf);border:1px solid var(--c-bord);border-radius:var(--r10);overflow:hidden}
.settings-panel-header{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;border-bottom:1px solid var(--c-bord)}
.settings-panel-header h3{font-size:14px;font-weight:500;margin:0;display:flex;align-items:center;gap:8px}
.settings-config-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;padding:18px}
.crm-input-sm{padding:5px 8px;border:1px solid var(--c-bord);border-radius:var(--r6);font-size:12px;font-family:var(--sans);background:var(--c-bg);width:100%;box-sizing:border-box}
.crm-input-sm:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 2px var(--lav-200)}
.crm-input-color{width:32px;height:26px;padding:1px;border:1px solid var(--c-bord);border-radius:var(--r6);cursor:pointer;background:var(--c-bg)}
.crm-btn-icon{background:none;border:none;cursor:pointer;font-size:14px;padding:4px;border-radius:var(--r4);transition:background .15s}
.crm-btn-icon:hover{background:var(--brand-light)}
.crm-code-sm{font-family:var(--mono);font-size:11px;padding:2px 6px;border-radius:var(--r4);background:var(--c-bg);border:1px solid var(--c-bord);color:var(--c-txm)}
.crm-badge-ok{font-size:10px;padding:2px 6px;border-radius:10px;background:#dcfce7;color:#16a34a;font-weight:500}
.crm-badge-off{font-size:10px;padding:2px 6px;border-radius:10px;background:var(--c-bg);color:var(--c-t3);font-weight:500}
.settings-color-dot{display:inline-block;width:12px;height:12px;border-radius:50%;vertical-align:middle;border:1px solid rgba(0,0,0,0.1)}
.settings-add-row td{background:var(--brand-light)}
.settings-edit-row td{background:#fef9c3}
/* Price panel */
.price-input{font-family:var(--mono);text-align:right}
.price-type-badge{font-size:10px;padding:2px 8px;border-radius:100px;font-weight:500;white-space:nowrap}
.price-type-pkg{background:#e6f4ef;color:#2d6b1a}
.price-type-suite{background:var(--brand-light);color:var(--brand)}
.price-history{background:#f9fafb;border-top:1px dashed var(--c-bord)}
.price-history td{font-size:11px;color:var(--c-txm)}
.price-history-row td{padding:0!important}
.crm-toggle-sm{position:relative;display:inline-block;width:32px;height:18px}
.crm-toggle-sm input{opacity:0;width:0;height:0}
.crm-toggle-sm span{position:absolute;cursor:pointer;inset:0;background:var(--c-bord);border-radius:18px;transition:.2s}
.crm-toggle-sm span:before{content:"";position:absolute;width:14px;height:14px;left:2px;bottom:2px;background:#fff;border-radius:50%;transition:.2s}
.crm-toggle-sm input:checked+span{background:var(--brand)}
.crm-toggle-sm input:checked+span:before{transform:translateX(14px)}
.crm-form-hint{font-size:11px;color:var(--c-t3);margin-top:4px}
@media(max-width:768px){
  .settings-layout{grid-template-columns:1fr;gap:12px}
  .settings-cats{flex-direction:row;overflow-x:auto;padding:8px}
  .settings-cat{white-space:nowrap;padding:7px 10px;font-size:12px}
  .settings-config-grid{grid-template-columns:1fr}
}

.oq-opp-card{padding:12px 14px;border:1px solid var(--c-bord);border-radius:var(--r10);cursor:pointer;transition:all .15s;background:var(--c-surf)}
.oq-opp-card:hover{border-color:var(--lav-200);background:var(--brand-light)}
.oq-opp-card.selected{border-color:var(--brand);background:var(--brand-light);box-shadow:0 0 0 2px var(--lav-200)}

/* ── TASKS ──────────────────────────────────────────────── */

/* Task type dots */
.task-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}
.task-dot.call{background:#2D6B1A}
.task-dot.email{background:#0C447C}
.task-dot.meeting{background:#B45309}
.task-dot.demo{background:var(--brand)}
.task-dot.follow_up{background:var(--brand-mid)}
.task-dot.other{background:var(--c-txm)}

/* Priority badges */
.priority-badge{display:inline-block;font-size:9px;font-family:var(--mono);padding:1px 6px;border-radius:var(--rF);font-weight:500;line-height:1.5}
.priority-badge.low{background:var(--c-ok-bg);color:var(--c-ok);border:1px solid var(--c-ok-b)}
.priority-badge.medium{background:var(--c-warn-bg);color:var(--c-warn);border:1px solid var(--c-warn-b)}
.priority-badge.high{background:var(--c-err-bg);color:var(--c-err);border:1px solid var(--c-err-b)}

/* Task type badge */
.task-type-badge{display:inline-flex;align-items:center;gap:4px;font-size:10px;font-family:var(--mono);color:var(--c-txm);padding:2px 7px;border-radius:var(--rF);background:var(--c-surf2);border:1px solid var(--c-bord)}

/* Overdue indicator */
.overdue-text{font-size:10px;font-family:var(--mono);color:var(--c-err);font-weight:500}
.due-today-text{font-size:10px;font-family:var(--mono);color:var(--c-warn);font-weight:500}
.due-future-text{font-size:10px;font-family:var(--mono);color:var(--c-txm)}

/* Task row in customer detail */
.task-group-title{font-size:10px;font-family:var(--mono);color:var(--c-txh);text-transform:uppercase;letter-spacing:.04em;margin:14px 0 6px;padding-bottom:5px;border-bottom:1px solid var(--c-row)}
.task-group-title:first-child{margin-top:0}
.task-row{display:flex;align-items:center;gap:10px;padding:8px 12px;border-radius:var(--r6);transition:background .1s;border-left:3px solid transparent}
.task-row:hover{background:var(--c-surf2)}
.task-row.overdue{border-left-color:var(--c-err);background:var(--c-err-bg)}
.task-row.today{border-left-color:var(--c-warn-b)}
.task-row .task-info{flex:1;min-width:0}
.task-row .task-title{font-size:12px;font-weight:500;color:var(--c-tx)}
.task-row .task-meta{font-size:10px;color:var(--c-txm);margin-top:2px;display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.task-row .task-actions{display:flex;gap:4px;flex-shrink:0}
.task-row .task-actions button{width:24px;height:24px;border:1px solid var(--c-bord);border-radius:var(--r4);background:var(--c-surf);cursor:pointer;font-size:11px;display:flex;align-items:center;justify-content:center;color:var(--c-txm);transition:all .15s}
.task-row .task-actions button:hover{border-color:var(--brand);color:var(--brand);background:var(--brand-light)}
.task-row .task-actions button.btn-complete:hover{border-color:var(--c-ok);color:var(--c-ok);background:var(--c-ok-bg)}
.task-row .task-actions button.btn-delete:hover{border-color:var(--c-err);color:var(--c-err);background:var(--c-err-bg)}
.task-row.completed .task-title{text-decoration:line-through;color:var(--c-txm)}

/* Quick-add task form */
.task-quick-form{display:flex;gap:8px;align-items:flex-end;flex-wrap:wrap;padding:12px 14px;border:1px solid var(--c-bord);border-radius:var(--r10);background:var(--c-surf);margin-bottom:14px}
.task-quick-form select,.task-quick-form input{height:32px;padding:0 8px;border:1px solid var(--c-bord);border-radius:var(--r6);font-size:12px;font-family:var(--sans);color:var(--c-tx);background:var(--c-surf)}
.task-quick-form select:focus,.task-quick-form input:focus{outline:none;border-color:var(--brand)}
.task-quick-form .tqf-title{flex:1;min-width:140px}
.task-quick-form .tqf-btn{height:32px;padding:0 14px;font-size:11px;font-family:var(--mono);background:var(--brand);color:#fff;border:none;border-radius:var(--r6);cursor:pointer;white-space:nowrap}
.task-quick-form .tqf-btn:hover{background:var(--brand-hover)}

/* Task complete modal */
.task-complete-modal{padding:16px}
.task-complete-modal textarea{width:100%;min-height:60px;padding:8px 10px;border:1px solid var(--c-bord);border-radius:var(--r6);font-size:12px;font-family:var(--sans);resize:none;margin-top:8px}
.task-complete-modal textarea:focus{outline:none;border-color:var(--brand)}

/* Dashboard task widget */
.task-widget-item{display:flex;align-items:center;gap:10px;padding:7px 16px;font-size:12px;cursor:pointer;transition:background .1s}
.task-widget-item:hover{background:var(--c-surf2)}
.task-widget-item .tw-company{font-weight:500;color:var(--c-tx);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:140px}
.task-widget-item .tw-title{flex:1;color:var(--c-txm);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.task-widget-item .tw-date{font-family:var(--mono);font-size:10px;flex-shrink:0}
.task-widget-item .tw-date.overdue{color:var(--c-err);font-weight:500}
.task-widget-item .tw-date.today{color:var(--c-warn);font-weight:500}
.task-widget-item .tw-date.future{color:var(--c-txm)}
.task-widget-summary{padding:6px 16px;font-size:10px;font-family:var(--mono);color:var(--c-txm);border-top:1px solid var(--c-row)}

/* Dashboard pagination */
.dash-pagination{display:flex;align-items:center;justify-content:center;gap:6px;padding:8px 16px;border-top:1px solid var(--c-row)}
.dash-pagination button{width:28px;height:28px;border:1px solid var(--c-bord);border-radius:var(--r4);background:var(--c-surf);cursor:pointer;font-size:11px;font-family:var(--mono);color:var(--c-txm);display:flex;align-items:center;justify-content:center;transition:all .15s}
.dash-pagination button:hover{border-color:var(--brand);color:var(--brand)}
.dash-pagination button.active{background:var(--brand);color:#fff;border-color:var(--brand)}
.dash-pagination button:disabled{opacity:.3;cursor:default}
.dash-pagination .pag-info{font-size:10px;font-family:var(--mono);color:var(--c-txm)}

/* Pipeline task badge */
.pipe-task-badge{display:inline-flex;align-items:center;gap:3px;font-size:9px;font-family:var(--mono);padding:1px 5px;border-radius:var(--r4);background:var(--brand-light);color:var(--brand-mid);border:1px solid var(--lav-200)}
.pipe-task-badge.has-overdue{background:var(--c-err-bg);color:var(--c-err);border-color:var(--c-err-b)}
.pipe-task-badge.has-today{background:var(--c-warn-bg);color:var(--c-warn);border-color:var(--c-warn-b)}

/* CSS Tooltip */
[data-tip]{position:relative}
[data-tip]::after{content:attr(data-tip);position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%) scale(0.9);white-space:nowrap;background:var(--c-tx);color:#fff;font-size:11px;font-weight:500;font-family:var(--sans);padding:4px 10px;border-radius:6px;pointer-events:none;opacity:0;transition:opacity .15s,transform .15s;z-index:50}
[data-tip]::before{content:'';position:absolute;bottom:calc(100% + 2px);left:50%;transform:translateX(-50%) scale(0.9);border:4px solid transparent;border-top-color:var(--c-tx);pointer-events:none;opacity:0;transition:opacity .15s,transform .15s;z-index:50}
[data-tip]:hover::after,[data-tip]:hover::before{opacity:1;transform:translateX(-50%) scale(1)}

/* ── BUTTON ACTIVE STATES ─────────────────────────────── */
.btn-primary:active{transform:scale(0.96);box-shadow:inset 0 1px 3px rgba(0,0,0,.2)}
.btn-secondary:active{transform:scale(0.96);background:var(--c-surf2)}
.btn-ghost:active{transform:scale(0.96)}
.btn-s:active{transform:scale(0.96)}

/* ── STAT BOX CLICKABLE ──────────────────────────────── */
.stat-clickable{cursor:pointer}
.stat-clickable:active{transform:scale(0.97)}

/* ── NAVBAR TASK BADGE ───────────────────────────────── */
.sb-badge{position:absolute;right:8px;top:50%;transform:translateY(-50%);min-width:16px;height:16px;border-radius:var(--rF);background:var(--c-err);color:#fff;font-size:9px;font-family:var(--mono);font-weight:500;display:flex;align-items:center;justify-content:center;padding:0 4px;line-height:1}
.sb-item{position:relative}

/* ── TABLE LOADING ───────────────────────────────────── */
@keyframes tblBarSlide{0%{transform:translateX(-100%)}100%{transform:translateX(250%)}}
@keyframes tblPulse{0%,100%{opacity:.4}50%{opacity:1}}
.tbl-loading-bar{position:relative;height:2px;overflow:hidden;background:var(--c-surf2);border-radius:1px}
.tbl-loading-bar::after{content:'';position:absolute;left:0;top:0;width:40%;height:100%;background:var(--brand);border-radius:1px;animation:tblBarSlide 1.2s ease-in-out infinite}
.tbl-loading-text{padding:32px 0;text-align:center;color:var(--c-sub);font-size:12px;font-family:var(--mono);animation:tblPulse 1.6s ease-in-out infinite}
.tbl-loading-wrap{padding:0 16px}

/* ── CUSTOMER STATUS BADGES ─────────────────────────── */
.cst-badge{display:inline-block;padding:2px 8px;border-radius:var(--rF);font-size:10px;font-weight:500;white-space:nowrap}
.cst-active{background:#e8f5e9;color:#2e7d32}
.cst-proposal{background:#e3f2fd;color:#1565c0}
.cst-demo{background:#fff3e0;color:#e65100}
.cst-contact{background:#fff8e1;color:#f9a825}
.cst-lead{background:#f5f5f5;color:#616161}
.cst-lost{background:#fce4ec;color:#c62828}
.cst-none{background:#fafafa;color:#bdbdbd;border:1px dashed #e0e0e0}

/* ── KANBAN CARD ACTIONS (Won stage) ────────────────── */
.kanban-card-actions{display:flex;gap:4px;padding:6px 0 0;border-top:1px solid var(--c-bord);margin-top:6px}
.kca-btn{flex:1;padding:3px 0;border:none;border-radius:var(--r4);font-size:10px;font-family:var(--sans);cursor:pointer;transition:all .15s;background:var(--c-surf2);color:var(--c-tx2)}
.kca-btn:hover{filter:brightness(.92)}
.kca-renew{background:#e8f5e9;color:#2e7d32}
.kca-upsell{background:#fff3e0;color:#e65100}
.kca-churn{background:#fce4ec;color:#c62828}

/* ── TAB FADE TRANSITION ─────────────────────────────── */
.detail-tab-panel{opacity:0;transition:opacity .2s ease}
.detail-tab-panel.active{opacity:1}

/* ── TABLE SORTABLE HEADERS ──────────────────────────── */
.crm-table th.sortable{cursor:pointer;user-select:none}
.crm-table th.sortable:hover{color:var(--brand)}
.crm-table th.sortable::after{content:'';display:inline-block;width:0;height:0;margin-left:5px;vertical-align:middle;opacity:.3}
.crm-table th.sortable.asc::after{border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:5px solid currentColor;opacity:1}
.crm-table th.sortable.desc::after{border-left:4px solid transparent;border-right:4px solid transparent;border-top:5px solid currentColor;opacity:1}

/* ── OVERDUE TASK STRONG STYLE ───────────────────────── */
.overdue-badge{display:inline-block;padding:2px 8px;border-radius:var(--rF);font-size:10px;font-family:var(--mono);font-weight:600;background:var(--c-err);color:#fff}
.due-today-badge{display:inline-block;padding:2px 8px;border-radius:var(--rF);font-size:10px;font-family:var(--mono);font-weight:600;background:var(--c-warn);color:#fff}

/* ── COMMAND PALETTE (Cmd+K) ──────────────────────────── */
.cmd-palette{background:var(--c-surf);border-radius:var(--r14);box-shadow:0 20px 60px rgba(0,0,0,.25),0 0 0 1px rgba(0,0,0,.06);width:540px;max-width:92vw;overflow:hidden;animation:cmdIn .15s ease}
@keyframes cmdIn{from{opacity:0;transform:scale(.97) translateY(-8px)}to{opacity:1;transform:none}}
.cmd-input-wrap{display:flex;align-items:center;gap:10px;padding:12px 16px;border-bottom:1px solid var(--c-bord)}
.cmd-input-wrap svg{color:var(--c-txm);flex-shrink:0}
.cmd-input{flex:1;border:none;outline:none;font-size:14px;font-family:var(--sans);color:var(--c-tx);background:transparent}
.cmd-input::placeholder{color:var(--c-txh)}
.cmd-kbd{font-family:var(--mono);font-size:10px;padding:2px 6px;border-radius:4px;background:var(--c-surf2);color:var(--c-txm);border:1px solid var(--c-bord);flex-shrink:0}
.cmd-results{max-height:340px;overflow-y:auto;padding:6px}
.cmd-section-title{font-size:10px;font-weight:500;color:var(--c-txm);padding:8px 10px 4px;text-transform:uppercase;letter-spacing:.04em}
.cmd-item{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:var(--r6);cursor:pointer;text-decoration:none;color:var(--c-tx);font-size:13px;transition:background .1s}
.cmd-item:hover,.cmd-item.active{background:var(--brand-light)}
.cmd-icon{font-size:15px;width:22px;text-align:center;flex-shrink:0}
.cmd-meta{margin-left:auto;font-size:11px;color:var(--c-txm);white-space:nowrap}
.cmd-empty{padding:24px;text-align:center;font-size:13px;color:var(--c-txm)}

/* ── QUICK FILTER CHIPS ──────────────────────────────── */
.chip-bar{display:flex;gap:6px;flex-wrap:wrap}
.filter-chip{display:inline-flex;align-items:center;gap:4px;padding:4px 12px;border-radius:var(--rF);border:1px solid var(--c-bord);background:var(--c-surf);font-size:11px;font-family:var(--sans);color:var(--c-tx);cursor:pointer;transition:all .15s;white-space:nowrap}
.filter-chip:hover{border-color:var(--brand);color:var(--brand)}
.filter-chip.active{background:var(--brand);border-color:var(--brand);color:#fff}
.filter-chip .chip-count{font-family:var(--mono);font-weight:600;font-size:10px}

/* ── RECENT CUSTOMERS WIDGET ─────────────────────────── */
.recent-customers{display:flex;gap:8px;flex-wrap:wrap}
.recent-chip{display:inline-flex;align-items:center;gap:6px;padding:5px 12px;border-radius:var(--rF);background:var(--c-surf);border:1px solid var(--c-bord);font-size:12px;color:var(--c-tx);cursor:pointer;text-decoration:none;transition:all .15s}
.recent-chip:hover{border-color:var(--brand);color:var(--brand);background:var(--brand-light)}
.recent-chip .recent-avatar{width:20px;height:20px;border-radius:50%;background:var(--lav-100);color:var(--brand);font-size:9px;font-weight:600;display:flex;align-items:center;justify-content:center}

/* ── QUICK NOTE PANEL ────────────────────────────────── */
.quick-note-panel{display:flex;flex-direction:column;gap:8px;padding:12px;background:var(--c-surf2);border:1px solid var(--c-bord);border-radius:var(--r10);margin-top:10px}
.quick-note-panel textarea{width:100%;border:1px solid var(--c-bord);border-radius:var(--r6);padding:8px 10px;font-size:13px;font-family:var(--sans);resize:vertical;background:var(--c-surf);color:var(--c-tx)}
.quick-note-panel textarea:focus{border-color:var(--brand);outline:none}
.quick-note-actions{display:flex;gap:8px;justify-content:flex-end}

/* ── EMAIL TEMPLATE PANEL ────────────────────────────── */
.email-tpl-panel{margin-bottom:12px;padding:12px;background:var(--c-surf2);border:1px solid var(--c-bord);border-radius:var(--r10)}
.email-tpl-list{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:10px}
.email-tpl-btn{padding:5px 12px;border-radius:var(--rF);border:1px solid var(--c-bord);background:var(--c-surf);font-size:11px;font-family:var(--sans);color:var(--c-tx);cursor:pointer;transition:all .15s}
.email-tpl-btn:hover{border-color:var(--brand);color:var(--brand)}
.email-tpl-btn.active{background:var(--brand);border-color:var(--brand);color:#fff}
.email-tpl-preview{padding:12px;background:var(--c-surf);border:1px solid var(--c-bord);border-radius:var(--r6)}
.email-tpl-subject{font-size:12px;color:var(--c-tx);margin-bottom:8px;padding-bottom:8px;border-bottom:1px solid var(--c-bord)}
.email-tpl-body{font-size:12px;line-height:1.6;color:var(--c-txm);white-space:pre-wrap;margin:0;font-family:var(--sans);background:transparent;border:none;padding:0}
.email-tpl-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:10px;padding-top:10px;border-top:1px solid var(--c-bord)}

/* ── BULK ACTIONS ────────────────────────────────────── */
.bulk-toolbar{display:flex;align-items:center;gap:8px;padding:8px 14px;background:var(--brand-light);border:1px solid var(--lav-200);border-radius:var(--r10);margin-bottom:10px;animation:cmdIn .15s ease}
.bulk-count{font-size:12px;font-weight:600;color:var(--brand);font-family:var(--mono)}
.btn-danger-s{color:var(--c-err)!important;border-color:var(--c-err)!important}
.btn-danger-s:hover{background:var(--c-err)!important;color:#fff!important}
.bulk-selected{background:var(--brand-light)!important}
.bulk-cb{width:15px;height:15px;accent-color:var(--brand);cursor:pointer}
#bulkMasterCb{width:15px;height:15px;accent-color:var(--brand);cursor:pointer}

/* ── HEALTH SCORE ────────────────────────────────────── */
.health-dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:5px;vertical-align:middle}
.health-dot.health-good{background:#4caf50}
.health-dot.health-mid{background:#ff9800}
.health-dot.health-low{background:#f44336}
.health-badge{display:inline-block;padding:2px 10px;border-radius:var(--rF);font-size:12px;font-weight:600;font-family:var(--mono)}
.health-badge.health-good{background:#e8f5e9;color:#2e7d32}
.health-badge.health-mid{background:#fff3e0;color:#e65100}
.health-badge.health-low{background:#ffebee;color:#c62828}

/* ── SAVED FILTERS ───────────────────────────────────── */
.saved-filter-chip{position:relative;padding-right:22px!important}
.saved-filter-del{position:absolute;right:6px;top:50%;transform:translateY(-50%);font-size:14px;line-height:1;color:var(--c-txm);cursor:pointer;font-weight:700}
.saved-filter-del:hover{color:var(--c-err)}

/* ── PIPELINE FILTER RESULT COUNT ────────────────────── */
.filter-result-count{font-size:11px;font-family:var(--mono);color:var(--brand);font-weight:500;white-space:nowrap}

/* ── WIP WARNING ─────────────────────────────────────── */
.wip-warning{color:var(--c-err)!important;font-weight:700}
.wip-warning::before{content:'\26a0\fe0f ';font-size:10px}

/* ── INPUT FOCUS ENHANCEMENT ─────────────────────────── */
.crm-form-group input:focus,.crm-form-group select:focus,.crm-form-group textarea:focus{border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-light)}

/* ── TOUCH DRAG & DROP ────────────────────────────────── */
.kanban-column.touch-drop-target{outline:2px dashed var(--lav-200);outline-offset:-2px}
.kanban-column.touch-hover{background:var(--cold-white) !important;outline-color:var(--brand)}

/* ── RESPONSIVE — TABLET (≤1024px) ────────────────────── */
@media(max-width:1024px){
  .kanban-board{grid-template-columns:repeat(7,minmax(160px,1fr));overflow-x:auto}
  .crm-page{padding:16px}

  /* Table: hide low-priority columns */
  .crm-table .col-sector,.crm-table .col-city,.crm-table .col-pipeline{display:none}
}

/* ── RESPONSIVE — MOBILE (≤768px) ─────────────────────── */
@media(max-width:768px){
  /* Auto-collapse sidebar */
  .crm-sidebar{position:fixed;left:0;top:0;z-index:1000;width:var(--sb-width);transform:translateX(-100%);transition:transform .25s ease}
  .crm-sidebar.mobile-open{transform:translateX(0)}
  .crm-sidebar.collapsed{transform:translateX(-100%)}
  .crm-main{margin-left:0;width:100%}

  /* Mobile hamburger */
  .mobile-menu-btn{display:flex !important}

  /* Mobile overlay */
  .mobile-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.3);z-index:999}
  .mobile-overlay.show{display:block}

  /* Kanban: single column stacked */
  .kanban-board{grid-template-columns:1fr;gap:12px;min-height:auto}
  .kanban-column{min-height:auto}

  /* Topbar compact */
  .crm-topbar{padding:0 12px;height:56px}
  .crm-topbar h1{font-size:15px}
  .crm-page{padding:12px}

  /* Tables: horizontal scroll + hide more columns */
  .crm-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
  .crm-table .col-sector,.crm-table .col-city,.crm-table .col-pipeline,.crm-table .col-segment,.crm-table .col-quote{display:none}

  /* Cards: full width */
  .team-card,.crm-card{min-width:0}

  /* Dashboard grid */
  .dash-stats{grid-template-columns:repeat(2,1fr) !important}
  .dash-grid{grid-template-columns:1fr !important}

  /* Modal responsive */
  .crm-modal{max-width:calc(100vw - 24px) !important;max-height:calc(100vh - 24px);overflow-y:auto}

  /* Customer detail: stacked layout */
  .acct-identity{flex-direction:column;gap:12px}
  .acct-actions{width:100%;justify-content:flex-end}
  .acct-metrics{grid-template-columns:repeat(2,1fr)}
  .acct-metric:nth-child(2){border-right:none}
  .acct-tabs{overflow-x:auto;-webkit-overflow-scrolling:touch;padding:0 8px}
  .acct-tab{white-space:nowrap;padding:10px 10px;font-size:11px}
  .crm-detail-grid{grid-template-columns:1fr 1fr}
  .crm-detail-field:nth-child(3n){border-right:1px solid var(--c-bord)}
  .crm-detail-field:nth-child(2n){border-right:none}
  .crm-detail-field:nth-last-child(-n+2){border-bottom:none}
  .cust-meta-grid{grid-template-columns:1fr 1fr}
  .cust-meta-item:nth-child(3n){border-right:1px solid var(--c-bord)}
  .cust-meta-item:nth-child(2n){border-right:none}

  /* Forms: single column + larger touch targets */
  .crm-form-grid{grid-template-columns:1fr;padding:12px 16px}
  .crm-form-group input,.crm-form-group select,.crm-form-group textarea{height:40px;font-size:14px;padding:0 12px}
  .crm-form-group textarea{padding:10px 12px}
  .crm-form-group label{font-size:11px}
  .crm-form-actions{padding:12px 16px}

  /* Topbar filters: wrap */
  .crm-topbar-actions,.tb-actions{flex-wrap:wrap;gap:6px}
  .crm-search{min-width:0;width:100%}

  /* Filter bar: stack */
  .crm-filters{flex-wrap:wrap;gap:8px}
  .crm-filters select,.crm-filters input{min-width:0;flex:1 1 calc(50% - 4px)}
}

/* ── RESPONSIVE — SMALL PHONE (≤480px) ────────────────── */
@media(max-width:480px){
  .crm-page{padding:8px}
  .dash-stats{grid-template-columns:1fr !important}
  .crm-topbar h1{font-size:13px}
  .kanban-card{font-size:10px;padding:8px}

  /* Detail: single column */
  .crm-detail-grid{grid-template-columns:1fr}
  .crm-detail-field{border-right:none !important}
  .crm-detail-field:last-child{border-bottom:none}
  .acct-metrics{grid-template-columns:1fr 1fr}
  .acct-name{font-size:15px}

  /* Table: hide even more */
  .crm-table .col-opp,.crm-table .col-contact{display:none}
}

/* ===== K: COMMENTS ===== */
.opp-comment{transition:background .15s}
.opp-comment:hover{background:var(--lav-100,#f0efff) !important}
.crm-link-btn{background:none;border:none;cursor:pointer;padding:0;font-family:var(--sans)}

/* ===== L: ATTACHMENTS ===== */
.attach-list{display:flex;flex-direction:column;gap:4px}
.attach-item{display:flex;align-items:center;gap:10px;padding:8px 10px;border:1px solid var(--c-bord);border-radius:var(--r8);background:var(--c-surf)}
.attach-item:hover{background:var(--c-bg2,#f9fafb)}
.attach-icon{font-size:20px;flex-shrink:0;width:28px;text-align:center}
.attach-info{flex:1;min-width:0}
.attach-name{font-size:12px;font-weight:500;color:var(--c-tx);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.attach-meta{font-size:10px;color:var(--c-txm);margin-top:2px}
.attach-desc{font-size:11px;color:var(--c-tx2);margin-top:2px}

/* ===== M: AUDIT LOG ===== */
.audit-log-list{display:flex;flex-direction:column;gap:0}
.audit-log-item{display:flex;gap:10px;padding:10px 0;border-bottom:1px solid var(--c-bord)}
.audit-log-item:last-child{border-bottom:none}
.audit-log-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0;margin-top:5px}
.audit-log-content{flex:1;min-width:0}
.audit-log-header{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-size:12px}
.audit-log-action{font-weight:600;font-size:11px}
.audit-log-field{font-family:var(--mono);font-size:10px;background:var(--c-bg2,#f0f0f0);padding:1px 6px;border-radius:4px;color:var(--c-tx2)}
.audit-log-time{font-size:10px;color:var(--c-txm);margin-left:auto}
.audit-log-changes{font-size:11px;margin-top:4px;font-family:var(--mono);line-height:1.5}
.audit-log-old{color:var(--error);text-decoration:line-through}
.audit-log-new{color:var(--c-ok)}
.audit-log-desc{font-size:11px;color:var(--c-tx2);margin-top:3px}
.audit-log-user{font-size:10px;color:var(--c-txm);margin-top:3px}

/* ── PIPELINE QUICK VIEW ─────────────────────────────── */
.qv-header{display:flex;justify-content:space-between;align-items:flex-start;padding:16px 20px;border-bottom:1px solid var(--c-bord);background:var(--c-surf2)}
.qv-company{font-size:11px;color:var(--c-txm);font-family:var(--mono);text-transform:uppercase;letter-spacing:.03em}
.qv-title{font-size:15px;font-weight:500;color:var(--c-tx);margin-top:2px}
.qv-close{background:none;border:none;font-size:22px;color:var(--c-txm);cursor:pointer;padding:0 4px;line-height:1}
.qv-close:hover{color:var(--c-tx)}
.qv-body{padding:16px 20px;max-height:60vh;overflow-y:auto}
.qv-info-row{display:flex;flex-wrap:wrap;gap:12px;margin-bottom:14px}
.qv-info{display:flex;flex-direction:column;gap:2px}
.qv-label{font-size:9px;text-transform:uppercase;letter-spacing:.04em;color:var(--c-txm);font-family:var(--mono)}
.qv-val{font-size:12px;color:var(--c-tx);font-weight:500}
.qv-badge{font-size:10px;padding:2px 8px;border-radius:var(--rF);font-weight:500;font-family:var(--mono)}
.qv-stage-lead{background:#e3f2fd;color:#1565c0}
.qv-stage-contact{background:#fff3e0;color:#e65100}
.qv-stage-demo{background:#f3e5f5;color:#6a1b9a}
.qv-stage-proposal{background:#e8f5e9;color:#2e7d32}
.qv-stage-negotiation{background:#fff8e1;color:#f9a825}
.qv-stage-won{background:#e8f5e9;color:#2e7d32}
.qv-stage-lost{background:#fde8e8;color:#c62828}
.qv-stage-disqualified{background:#f5f5f5;color:#757575}
.qv-revenue{display:flex;gap:16px;padding:10px 14px;background:var(--c-surf2);border-radius:var(--r8);margin-bottom:14px}
.qv-rev-item{display:flex;flex-direction:column;gap:1px}
.qv-rev-label{font-size:9px;color:var(--c-txm);font-family:var(--mono);text-transform:uppercase}
.qv-rev-val{font-size:14px;font-weight:600;color:var(--c-tx);font-family:var(--mono)}
.qv-dates{display:flex;flex-wrap:wrap;gap:12px;font-size:11px;color:var(--c-txm);margin-bottom:14px}
.qv-section{margin-top:12px;border-top:1px solid var(--c-bord);padding-top:10px}
.qv-section-title{font-size:10px;font-weight:500;color:var(--c-txm);text-transform:uppercase;letter-spacing:.04em;margin-bottom:6px;font-family:var(--mono)}
.qv-table{width:100%;border-collapse:collapse;font-size:11px}
.qv-table th{text-align:left;font-size:9px;text-transform:uppercase;color:var(--c-txm);font-family:var(--mono);padding:4px 6px;border-bottom:1px solid var(--c-bord)}
.qv-table td{padding:5px 6px;border-bottom:1px solid var(--c-bord);color:var(--c-tx)}
.qv-activity{padding:6px 0;border-bottom:1px solid var(--c-bord)}
.qv-activity:last-child{border-bottom:none}
.qv-act-note{display:block;font-size:12px;color:var(--c-tx)}
.qv-act-meta{font-size:10px;color:var(--c-txm);margin-top:2px;display:block}
.qv-footer{padding:12px 20px;border-top:1px solid var(--c-bord);display:flex;justify-content:flex-end;gap:8px;background:var(--c-surf)}

/* Marketing Dashboard */
.mkt-tabs{display:flex;gap:0}
.mkt-tab{padding:6px 14px;font-size:12px;font-family:var(--mono);color:var(--c-txm);cursor:pointer;border:none;border-bottom:2px solid transparent;background:none;transition:all .15s}
.mkt-tab:hover{color:var(--c-tx)}
.mkt-tab.active{color:var(--brand);border-bottom-color:var(--brand)}
.stat-mkt-total{background:#EFF6FF;border-color:#BFDBFE}
.stat-mkt-total .stat-box-value{color:#2563EB}
.stat-mkt-month{background:#F0FDF4;border-color:#BBF7D0}
.stat-mkt-month .stat-box-value{color:#16A34A}
.stat-mkt-conv{background:#FFF7ED;border-color:#FED7AA}
.stat-mkt-conv .stat-box-value{color:#EA580C}
.stat-mkt-sources{background:#F3F0FF;border-color:#DDD6FE}
.stat-mkt-sources .stat-box-value{color:#7C3AED}
.mkt-filter-row{display:flex;gap:8px;align-items:center;padding:10px 14px;border-bottom:1px solid var(--c-bord);flex-wrap:wrap}
.mkt-filter-row select,.mkt-filter-row input{font-size:11px;padding:4px 8px;border-radius:6px;border:1px solid var(--c-bord);background:var(--c-surf);font-family:var(--mono)}
.utm-form{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.utm-form .full-width{grid-column:1/-1}
.utm-form input,.utm-form select{width:100%;padding:6px 10px;border:1px solid var(--c-bord);border-radius:6px;font-size:12px;font-family:var(--mono);background:var(--c-surf)}
.utm-label{display:block;font-size:11px;font-weight:500;color:var(--c-txm);margin-bottom:4px;font-family:var(--mono)}
.utm-preview{margin-top:4px;padding:12px;background:var(--c-surf2);border:1px solid var(--c-bord);border-radius:var(--r6);font-family:var(--mono);font-size:11px}
.utm-templates{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:16px}
.utm-tpl-btn{padding:6px 12px;font-size:11px;border:1px solid var(--c-bord);border-radius:var(--r6);background:var(--c-surf);cursor:pointer;font-family:var(--mono);transition:all .15s}
.utm-tpl-btn:hover{border-color:var(--brand);color:var(--brand)}
@media(max-width:768px){.utm-form{grid-template-columns:1fr}}

/* Marketing readonly mode — hide ALL action buttons system-wide */
body.crm-readonly .btn-primary,
body.crm-readonly .crm-topbar-actions .btn-primary,
body.crm-readonly [onclick*="openAdd"],
body.crm-readonly [onclick*="openNew"],
body.crm-readonly [onclick*="openCreate"],
body.crm-readonly [onclick*="openEdit"],
body.crm-readonly [onclick*="editCustomer"],
body.crm-readonly [onclick*="editSalesRep"],
body.crm-readonly [onclick*="deleteCustomer"],
body.crm-readonly [onclick*="deleteOpp"],
body.crm-readonly [onclick*="deleteSalesRep"],
body.crm-readonly [onclick*="approveQuote"],
body.crm-readonly [onclick*="rejectQuote"],
body.crm-readonly [onclick*="generateProposal"],
body.crm-readonly [onclick*="regenerateToken"],
body.crm-readonly [onclick*="requestApproval"],
body.crm-readonly [onclick*="submitQuote"],
body.crm-readonly [onclick*="updateStage"],
body.crm-readonly [onclick*="assignCustomer"],
body.crm-readonly [onclick*="bulkAssign"],
body.crm-readonly .kanban-card-menu,
body.crm-readonly .crm-action-delete,
body.crm-readonly .crm-action-edit{display:none!important}

/* ===== WALL PINNED DEMOS ===== */
.wall-pin-head{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;background:linear-gradient(135deg,#fffbeb 0%,#fef3c7 100%);border-bottom:1px solid #f59e0b30;font-size:13px;font-weight:600;color:#92400e}
.wall-pin-count{display:inline-flex;align-items:center;justify-content:center;background:#f59e0b;color:#fff;border-radius:10px;min-width:20px;height:20px;font-size:11px;padding:0 6px;margin-left:6px}
.wall-pin-list{padding:4px 0}
.wall-pin-item{display:flex;align-items:center;gap:8px;padding:8px 16px;border-bottom:1px solid #f5f5f5;font-size:12px;transition:background .15s}
.wall-pin-item:last-child{border-bottom:none}
.wall-pin-item:hover{background:#fffbeb}
.wall-pin-icon{font-size:14px;flex-shrink:0}
.wall-pin-name{font-weight:600;color:#1e293b;white-space:nowrap}
.wall-pin-contact{color:#64748b;white-space:nowrap}
.wall-pin-src{padding:2px 8px;border-radius:10px;font-size:10px;font-weight:500;white-space:nowrap}
.wall-pin-time{margin-left:auto;color:#94a3b8;font-size:11px;white-space:nowrap}
.wall-pin-assigned{opacity:.6}
.wall-pin-assigned:hover{opacity:1}
.wall-pin-rep{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:50%;background:#e0e7ff;color:#4f46e5;font-size:9px;font-weight:700;flex-shrink:0}
.wall-pin-unassigned{padding:2px 8px;border-radius:10px;font-size:10px;font-weight:600;background:#fef2f2;color:#dc2626;white-space:nowrap}

/* ===== PLAYBOOK — Sales Enablement ===== */
.pb-tabs{display:flex;gap:0;border-bottom:1px solid var(--c-bord);padding:0 16px;background:var(--c-surf)}
.pb-tab{padding:12px 20px;font-size:13px;font-weight:500;color:var(--c-txm);cursor:pointer;border:none;border-bottom:2px solid transparent;background:none;transition:all .15s;font-family:var(--sans)}
.pb-tab:hover{color:var(--c-tx)}
.pb-tab.active{color:var(--brand);border-bottom-color:var(--brand)}
.pb-tab-panel{display:none;padding:16px}
.pb-tab-panel.active{display:block}

/* Accordion */
.pb-accordion{border:1px solid var(--c-bord);border-radius:var(--r10);background:var(--c-surf);margin-bottom:10px;overflow:hidden}
.pb-accordion-head{display:flex;align-items:center;gap:10px;padding:14px 18px;cursor:pointer;user-select:none;transition:background .15s}
.pb-accordion-head:hover{background:var(--c-surf2)}
.pb-accordion-icon{font-size:18px;flex-shrink:0;width:28px;text-align:center}
.pb-accordion-title{font-size:13px;font-weight:500;color:var(--c-tx);flex:1}
.pb-accordion-sub{font-size:11px;color:var(--c-txm);margin-left:auto;padding-right:8px}
.pb-accordion-arrow{font-size:10px;color:var(--c-txm);transition:transform .2s;flex-shrink:0}
.pb-accordion.open .pb-accordion-arrow{transform:rotate(180deg)}
.pb-accordion-body{max-height:0;overflow:hidden;transition:max-height .3s ease}
.pb-accordion.open .pb-accordion-body{max-height:3000px}
.pb-accordion-content{padding:0 18px 18px;font-size:12px;line-height:1.7;color:var(--c-tx)}

/* Playbook content helpers */
.pb-section-title{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--c-txm);font-family:var(--mono);margin:20px 0 10px;padding-bottom:6px;border-bottom:1px solid var(--c-bord)}
.pb-section-title:first-child{margin-top:0}
.pb-tip{display:flex;gap:10px;padding:12px 14px;background:var(--brand-light);border-radius:var(--r8);margin:10px 0;font-size:12px;line-height:1.6}
.pb-tip-icon{font-size:16px;flex-shrink:0}
.pb-tag{display:inline-block;padding:2px 8px;border-radius:var(--rF);font-size:10px;font-weight:500;font-family:var(--mono)}
.pb-tag-pkg{background:#E8F5F3;color:#2e7d32}
.pb-tag-suite{background:#e3f2fd;color:#1565c0}
.pb-tag-warn{background:#fff3e0;color:#e65100}
.pb-script{background:var(--c-surf2);border:1px solid var(--c-bord);border-radius:var(--r8);padding:14px 16px;font-size:12px;line-height:1.8;white-space:pre-wrap;font-family:var(--sans)}
.pb-script b{color:var(--brand);font-weight:600}
.pb-grid-2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.pb-card{border:1px solid var(--c-bord);border-radius:var(--r8);padding:14px;background:var(--c-surf)}
.pb-card-title{font-size:12px;font-weight:600;color:var(--c-tx);margin-bottom:6px}
.pb-card-text{font-size:11px;color:var(--c-txm);line-height:1.6}
.pb-objection-real{font-size:11px;color:var(--c-txm);font-style:italic;margin:8px 0 10px;padding-left:12px;border-left:2px solid var(--c-bord)}
.pb-response{padding:10px 14px;background:var(--c-surf2);border-radius:var(--r8);margin-bottom:8px;font-size:12px;line-height:1.7}
.pb-response-label{font-size:10px;font-weight:600;color:var(--brand);text-transform:uppercase;letter-spacing:.03em;font-family:var(--mono);margin-bottom:4px}
.pb-stat{display:inline-flex;align-items:center;gap:4px;padding:3px 10px;background:var(--brand-light);border-radius:var(--rF);font-size:11px;font-weight:500;color:var(--brand);font-family:var(--mono);margin:2px 0}
/* Feature Matrix Table */
.pb-matrix-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;margin:12px 0}
.pb-matrix{width:100%;border-collapse:collapse;font-size:11px;font-family:var(--sans)}
.pb-matrix th{padding:10px 12px;text-align:left;font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.03em;color:var(--c-txm);font-family:var(--mono);border-bottom:2px solid var(--c-bord);background:var(--c-surf2);white-space:nowrap;position:sticky;top:0;z-index:1}
.pb-matrix th.pb-matrix-layers{background:var(--brand-light);color:var(--brand)}
.pb-matrix td{padding:8px 12px;border-bottom:1px solid var(--c-bord);vertical-align:middle;white-space:nowrap}
.pb-matrix tr:hover td{background:var(--c-surf2)}
.pb-matrix td.pb-matrix-feature{font-weight:500;color:var(--c-tx);white-space:normal;min-width:140px}
.pb-matrix td.pb-matrix-layers{background:#f0faf8}
.pb-matrix .pb-mx-yes{color:#16a34a;font-weight:600}
.pb-matrix .pb-mx-no{color:#dc2626;font-weight:600}
.pb-matrix .pb-mx-partial{color:#d97706;font-weight:600}
.pb-matrix .pb-mx-na{color:var(--c-txm)}
.pb-matrix-legend{display:flex;gap:16px;padding:8px 0;font-size:10px;color:var(--c-txm)}
.pb-matrix-legend span{display:flex;align-items:center;gap:4px}
/* Competitor card in accordion */
.pb-competitor-header{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.pb-competitor-type{font-size:10px;font-weight:600;padding:2px 8px;border-radius:var(--rF);font-family:var(--mono)}
.pb-competitor-local{background:#FEF3C7;color:#92400E}
.pb-competitor-global{background:#DBEAFE;color:#1E40AF}
.pb-competitor-vs{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:12px 0}
.pb-competitor-col{padding:12px;border-radius:var(--r8);font-size:11px;line-height:1.6}
.pb-competitor-col ul{padding-left:16px;margin:4px 0}
.pb-competitor-strong{background:#FEF2F2;border:1px solid #FECACA}
.pb-competitor-weak{background:#F0FDF4;border:1px solid #BBF7D0}
.pb-competitor-col-title{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.03em;margin-bottom:6px;font-family:var(--mono)}
.pb-competitor-strong .pb-competitor-col-title{color:#991B1B}
.pb-competitor-weak .pb-competitor-col-title{color:#166534}
.pb-win-strategy{padding:12px 14px;background:var(--brand-light);border-radius:var(--r8);font-size:12px;line-height:1.7;margin-top:8px}
.pb-win-strategy b{color:var(--brand)}
@media(max-width:768px){
  .pb-grid-2{grid-template-columns:1fr}
  .pb-tabs{overflow-x:auto;-webkit-overflow-scrolling:touch}
  .pb-tab{white-space:nowrap;padding:10px 14px;font-size:12px}
  .pb-competitor-vs{grid-template-columns:1fr}
  .pb-matrix{font-size:10px}
  .pb-matrix th,.pb-matrix td{padding:6px 8px}
}

/* Team tabs + inactive badge */
.team-tab-bar{display:flex;gap:4px;margin:0 0 14px;border-bottom:1px solid var(--c-bord)}
.team-tab{background:transparent;border:none;padding:8px 16px;font-size:12px;font-family:var(--sans);color:var(--c-txm);cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-1px;transition:all .15s}
.team-tab:hover{color:var(--c-tx)}
.team-tab.active{color:var(--brand);border-bottom-color:var(--brand);font-weight:500}
.inactive-badge{display:inline-block;font-size:9px;padding:2px 6px;background:var(--c-err-bg,#fde8e8);color:var(--c-err,#c53030);border-radius:var(--rF);font-family:var(--mono);text-transform:uppercase;letter-spacing:.03em;margin-left:4px;vertical-align:middle}
