/* Expoeye CRM v2 — Core Styles */
:root {
  --ink: #172033;
  --ink-2: #3a4558;
  --muted: #788397;
  --line: #e8ebf1;
  --line-2: #f0f1f5;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --purple: #625bf6;
  --purple-light: #efefff;
  --purple-hover: #5248e8;
  --green: #1c9b72;
  --green-light: #eaf8f2;
  --amber: #c98518;
  --amber-light: #fff8eb;
  --red: #d75d53;
  --red-light: #fef2f2;
  --blue: #3b82f6;
  --blue-light: #eff6ff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.03);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.08);
  --transition: .2s cubic-bezier(.4,0,.2,1);
}
[data-theme="dark"] {
  --ink: #e8ecf4;
  --ink-2: #b0b8c8;
  --muted: #7a8494;
  --line: #2a3040;
  --line-2: #1e2532;
  --bg: #0f1219;
  --surface: #181e2a;
  --purple-light: #1e1b3a;
  --green-light: #122b23;
  --amber-light: #2a2010;
  --red-light: #2a1515;
  --blue-light: #141e30;
  --shadow: 0 1px 3px rgba(0,0,0,.2), 0 4px 12px rgba(0,0,0,.15);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.4);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font: 14px/1.5 'DM Sans', -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
input, select, textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  background: var(--surface);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(98,91,246,.12);
}
a { color: var(--purple); text-decoration: none; }

/* Layout Shell */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transition: background var(--transition);
}
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 10;
  gap: 16px;
  transition: background var(--transition);
}
.content { flex: 1; padding: 28px 32px; max-width: 1600px; }

/* Brand */
.brand { display: flex; align-items: center; gap: 10px; padding-bottom: 22px; }
.logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--purple); color: #fff;
  display: grid; place-items: center;
  font: 800 18px 'Manrope';
}
.brand-text b { font: 700 16px 'Manrope'; letter-spacing: -.3px; display: block; }
.brand-text small { color: var(--muted); font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; }

/* Workspace */
.workspace {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}
.avatar {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--purple-light); color: var(--purple);
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.workspace-info { flex: 1; min-width: 0; }
.workspace-info strong { font-size: 12px; display: block; }
.workspace-info small { color: var(--muted); font-size: 10px; }

/* Nav */
.group-label {
  font-size: 10px; color: var(--muted); font-weight: 700;
  letter-spacing: 1.2px; padding: 12px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: var(--radius-sm);
  color: var(--muted); font-size: 13px;
  transition: all var(--transition);
  cursor: pointer; margin: 1px 0;
  position: relative;
}
.nav-item:hover { background: var(--line-2); color: var(--ink); }
.nav-item.active { background: var(--purple-light); color: var(--purple); font-weight: 600; }
.nav-icon { width: 18px; text-align: center; font-size: 15px; }
.nav-badge {
  margin-left: auto; font-size: 10px; font-weight: 600;
  background: var(--line-2); padding: 2px 7px; border-radius: 10px;
  color: var(--muted);
}
.nav-item.active .nav-badge { background: rgba(98,91,246,.12); color: var(--purple); }

/* Sidebar footer */
.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: all var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); }
.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.panel-head h2 { font: 700 15px 'Manrope'; }
.panel-head .sub { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: all var(--transition);
}
.btn:hover { border-color: var(--purple); color: var(--purple); }
.btn-primary {
  background: var(--purple); color: #fff; border-color: var(--purple);
}
.btn-primary:hover { background: var(--purple-hover); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon {
  width: 34px; height: 34px; padding: 0;
  display: grid; place-items: center; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface);
  transition: all var(--transition);
}
.btn-icon:hover { border-color: var(--purple); color: var(--purple); }
.link { color: var(--purple); font-size: 12px; font-weight: 600; background: none; border: none; cursor: pointer; }
.link:hover { text-decoration: underline; }

/* Badges */
.badge {
  display: inline-block; font-size: 10px; font-weight: 600;
  padding: 3px 8px; border-radius: 20px;
  background: var(--line-2); color: var(--muted);
}
.badge-purple { background: var(--purple-light); color: var(--purple); }
.badge-green { background: var(--green-light); color: var(--green); }
.badge-amber { background: var(--amber-light); color: var(--amber); }
.badge-red { background: var(--red-light); color: var(--red); }
.badge-blue { background: var(--blue-light); color: var(--blue); }

/* Stats Row */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat { min-height: 110px; display: flex; flex-direction: column; justify-content: center; }
.stat-top { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.stat-icon { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-size: 12px; }
.stat-value { font: 800 26px 'Manrope'; margin: 8px 0 4px; letter-spacing: -.5px; }
.stat-value small { font: 500 12px 'DM Sans'; color: var(--muted); margin-left: 4px; }
.stat-trend { font-size: 11px; color: var(--green); }
.stat-trend.warn { color: var(--amber); }
.stat-trend.danger { color: var(--red); }

/* Pipeline */
.pipeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 12px 0 16px; }
.stage {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px; text-align: center;
  transition: all var(--transition);
}
.stage:hover { border-color: var(--purple); }
.stage span { font-size: 10px; color: var(--muted); display: block; }
.stage b { font: 700 18px 'Manrope'; display: block; margin: 4px 0; }
.stage .bar { height: 4px; background: var(--line-2); border-radius: 4px; margin-top: 8px; }
.stage .bar i { display: block; height: 100%; background: var(--purple); border-radius: 4px; transition: width .4s; }
.stage small { font-size: 10px; color: var(--muted); display: block; margin-top: 5px; }

/* Table */
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
.table { width: 100%; border-collapse: collapse; font-size: 12px; }
.table th {
  text-align: left; font-weight: 600; color: var(--muted);
  padding: 9px 10px; border-bottom: 1px solid var(--line);
  font-size: 11px; white-space: nowrap;
}
.table td { padding: 11px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:hover td { background: var(--line-2); }
.table tr { transition: background var(--transition); }

/* Body Grid (2-col) */
.body-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(300px, 0.8fr);
  gap: 16px;
  align-items: start;
}
.right-stack { display: flex; flex-direction: column; gap: 14px; }

/* Deadlines */
.deadline {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line-2);
}
.deadline:last-child { border: none; }
.datebox {
  width: 38px; height: 38px; border-radius: 8px;
  background: var(--purple-light); color: var(--purple);
  display: grid; place-items: center; text-align: center; flex-shrink: 0;
}
.datebox b { font: 700 14px 'Manrope'; line-height: 1; }
.datebox small { font-size: 8px; letter-spacing: .5px; }
.deadline-text { flex: 1; min-width: 0; }
.deadline-text strong { font-size: 12px; display: block; }
.deadline-text small { font-size: 10px; color: var(--muted); }
.deadline .days { font-size: 11px; color: var(--muted); white-space: nowrap; }
.deadline .days.urgent { color: var(--red); font-weight: 600; }

/* Activity */
.activity { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; }
.activity:last-child { border: none; }
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--purple); margin-top: 5px; flex-shrink: 0;
}
.activity p { font-size: 12px; }
.activity small { font-size: 10px; color: var(--muted); margin-top: 2px; display: block; }

/* Form Styles */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid label, .form-card label {
  font-size: 11px; color: var(--muted); font-weight: 500;
  display: flex; flex-direction: column; gap: 5px;
}
.form-card { margin-bottom: 16px; }
.form-card h2 { font: 700 14px 'Manrope'; margin-bottom: 14px; }
.form-columns { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 20px 0; }
.section-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.section-title h2 { margin-bottom: 0; }

/* Items (expense lines) */
.items-head {
  display: grid; grid-template-columns: 1fr 60px 80px 80px 28px;
  gap: 8px; font-size: 10px; color: var(--muted);
  padding: 6px 0; font-weight: 600;
}
.item-row {
  display: grid; grid-template-columns: 1fr 60px 80px 80px 28px;
  gap: 8px; align-items: center; padding: 6px 0;
}
.item-row input { padding: 7px 8px; font-size: 12px; }
.item-row .line-total { font-size: 12px; font-weight: 600; text-align: right; }
.item-row button {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--line-2); color: var(--muted);
  display: grid; place-items: center; font-size: 14px;
  transition: all var(--transition);
}
.item-row button:hover { background: var(--red-light); color: var(--red); }
.totals {
  border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px;
  display: flex; flex-direction: column; gap: 6px; font-size: 12px;
}
.totals .grand { font-size: 14px; font-weight: 700; color: var(--purple); }

/* Progress Steps */
.steps { display: grid; grid-template-columns: repeat(6, 1fr); margin: 20px 0 16px; }
.step { position: relative; text-align: center; color: var(--muted); }
.step:not(:last-child)::after {
  content: ""; height: 2px; background: var(--line);
  position: absolute; left: 60%; right: -40%; top: 10px;
}
.step.done:not(:last-child)::after { background: var(--green); }
.step i {
  display: block; position: relative; z-index: 1; margin: 0 auto 6px;
  width: 21px; height: 21px; border-radius: 50%;
  background: var(--line-2); font-style: normal;
  font-size: 10px; line-height: 21px;
}
.step.done i { background: var(--green-light); color: var(--green); }
.step.active i { background: var(--purple); color: #fff; box-shadow: 0 0 0 4px var(--purple-light); }
.step b { font-size: 10px; display: block; color: var(--ink-2); }
.step.active b { color: var(--purple); }
.step small { font-size: 9px; display: block; margin-top: 3px; color: var(--muted); }

/* Modal / Overlay */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15,18,25,.45);
  display: grid; place-items: center;
  backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.overlay.show { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 90%; max-width: 560px;
  max-height: 85vh; overflow-y: auto;
  padding: 24px;
  transform: translateY(12px) scale(.97);
  transition: transform var(--transition);
}
.overlay.show .modal { transform: translateY(0) scale(1); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-head h2 { font: 700 16px 'Manrope'; }
.modal-close {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-size: 18px;
  background: var(--line-2); color: var(--muted);
  transition: all var(--transition);
}
.modal-close:hover { background: var(--red-light); color: var(--red); }

/* Drawer */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(15,18,25,.4);
  backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.drawer-overlay.show { opacity: 1; pointer-events: all; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 91;
  width: 90%; max-width: 480px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
}
.drawer.show { transform: translateX(0); }
.drawer-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px; border-bottom: 1px solid var(--line);
}
.drawer-head b { font: 700 15px 'Manrope'; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.drawer-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }

/* Kanban Board */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 12px; }
.kanban-col {
  background: var(--line-2); border-radius: var(--radius);
  padding: 12px; min-height: 300px;
  transition: background var(--transition);
}
.kanban-col.drag-over { background: var(--purple-light); outline: 2px dashed var(--purple); }
.kanban-head { font: 700 12px 'Manrope'; margin-bottom: 4px; display: flex; justify-content: space-between; }
.kanban-total { font-size: 11px; color: var(--muted); margin-bottom: 10px; }
.kanban-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px;
  margin-bottom: 8px; cursor: grab;
  transition: all var(--transition);
}
.kanban-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.kanban-card.dragging { opacity: .5; transform: rotate(2deg); }
.kanban-card h3 { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.kanban-card p { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.kanban-card .card-value { font: 700 13px 'Manrope'; color: var(--purple); margin-top: 8px; }

/* Charts */
.chart-container { position: relative; width: 100%; }
.chart-container canvas { width: 100% !important; height: auto !important; }
.chart-funnel { display: flex; flex-direction: column; gap: 4px; }
.funnel-step {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0;
}
.funnel-bar { height: 24px; border-radius: 4px; transition: width .6s cubic-bezier(.4,0,.2,1); min-width: 4px; }
.funnel-label { font-size: 11px; min-width: 60px; color: var(--muted); }
.funnel-value { font: 700 13px 'Manrope'; }

/* Gantt */
.gantt { overflow-x: auto; }
.gantt-header { display: flex; border-bottom: 1px solid var(--line); padding-left: 180px; }
.gantt-month { flex: 1; text-align: center; font-size: 10px; color: var(--muted); padding: 6px 0; min-width: 80px; border-left: 1px solid var(--line-2); }
.gantt-row { display: flex; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.gantt-label { width: 180px; flex-shrink: 0; padding-right: 12px; }
.gantt-label b { font-size: 11px; display: block; }
.gantt-label small { font-size: 9px; color: var(--muted); }
.gantt-track { flex: 1; position: relative; height: 24px; }
.gantt-bar {
  position: absolute; top: 2px; height: 20px; border-radius: 4px;
  font-size: 9px; color: #fff; padding: 0 6px;
  display: flex; align-items: center;
  white-space: nowrap; overflow: hidden;
  transition: all var(--transition);
}
.gantt-bar:hover { filter: brightness(1.1); transform: scaleY(1.15); }

/* Search */
.search-box {
  flex: 1; max-width: 360px;
  position: relative;
}
.search-box input {
  width: 100%; padding: 8px 12px 8px 34px;
  border-radius: 20px; border: 1px solid var(--line);
  background: var(--bg);
}
.search-box::before {
  content: "⌕"; position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%); color: var(--muted); font-size: 14px;
}
.search-results {
  position: absolute; top: 100%; left: 0; right: 0;
  margin-top: 6px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); z-index: 50;
  max-height: 360px; overflow-y: auto;
  display: none;
}
.search-results.show { display: block; }
.search-result-item {
  padding: 10px 14px; cursor: pointer;
  border-bottom: 1px solid var(--line-2);
  transition: background var(--transition);
}
.search-result-item:hover { background: var(--purple-light); }
.search-result-item:last-child { border: none; }
.search-result-item b { font-size: 12px; display: block; }
.search-result-item small { font-size: 10px; color: var(--muted); }
.search-result-type {
  display: inline-block; font-size: 9px; padding: 2px 6px;
  border-radius: 4px; background: var(--line-2); color: var(--muted);
  margin-right: 6px;
}

/* Notification Panel */
.notif-panel {
  position: fixed; top: 64px; right: 16px;
  width: 360px; max-height: 480px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  z-index: 60; overflow: hidden;
  transform: translateY(-8px) scale(.96); opacity: 0;
  pointer-events: none;
  transition: all var(--transition);
}
.notif-panel.show { transform: translateY(0) scale(1); opacity: 1; pointer-events: all; }
.notif-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.notif-head b { font: 700 14px 'Manrope'; }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item {
  padding: 12px 16px; border-bottom: 1px solid var(--line-2);
  display: flex; gap: 10px; cursor: pointer;
  transition: background var(--transition);
}
.notif-item:hover { background: var(--line-2); }
.notif-item.unread { background: var(--purple-light); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--purple); margin-top: 5px; flex-shrink: 0; }
.notif-item:not(.unread) .notif-dot { background: var(--line); }
.notif-content { flex: 1; }
.notif-content p { font-size: 12px; line-height: 1.4; }
.notif-content small { font-size: 10px; color: var(--muted); margin-top: 3px; display: block; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--ink); color: #fff;
  padding: 12px 20px; border-radius: var(--radius-sm);
  font-size: 13px; z-index: 200;
  box-shadow: var(--shadow-lg);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
[data-theme="dark"] .toast { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.toast.show { transform: translateX(-50%) translateY(0); }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab {
  padding: 10px 14px; font-size: 12px; color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap; transition: all var(--transition);
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--purple); border-bottom-color: var(--purple); font-weight: 600; }

/* Filters toolbar */
.toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0; flex-wrap: wrap;
}
.toolbar input[type="text"] {
  flex: 1; min-width: 180px; max-width: 300px;
  border-radius: 20px; padding-left: 14px;
}
.filter-group { display: flex; gap: 4px; flex-wrap: wrap; }
.filter-btn {
  padding: 5px 12px; border-radius: 20px;
  font-size: 11px; color: var(--muted);
  border: 1px solid var(--line); background: var(--surface);
  transition: all var(--transition);
}
.filter-btn:hover, .filter-btn.active {
  border-color: var(--purple); color: var(--purple);
  background: var(--purple-light);
}

/* Customer Layout */
.split-layout { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 16px; align-items: start; }
.list-panel { overflow: hidden; padding: 0; }
.list-panel .toolbar { padding: 14px; border-bottom: 1px solid var(--line); }
.list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 14px; cursor: pointer;
  border-bottom: 1px solid var(--line-2);
  transition: all var(--transition);
}
.list-item:hover { background: var(--line-2); }
.list-item.selected { background: var(--purple-light); box-shadow: inset 3px 0 var(--purple); }
.list-item-info { flex: 1; min-width: 0; }
.list-item-info b { font-size: 12px; display: block; }
.list-item-info small { font-size: 10px; color: var(--muted); display: block; margin-top: 2px; }
.list-item .badge { margin-top: 4px; }

/* Theme toggle */
.theme-toggle {
  display: flex; align-items: center; gap: 8px;
  padding: 6px; border-radius: 20px;
  background: var(--line-2);
}
.theme-toggle button {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 14px;
  transition: all var(--transition);
}
.theme-toggle button.active { background: var(--surface); box-shadow: var(--shadow); }

/* Page enter animation */
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.page-enter { animation: fadeUp .3s ease-out; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* Responsive */
@media (max-width: 1100px) {
  .body-grid { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: repeat(5, 200px); }
  .split-layout { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 80;
    transform: translateX(-100%); transition: transform .3s;
    width: 260px;
  }
  .sidebar.open { transform: translateX(0); }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .pipeline { grid-template-columns: repeat(3, 1fr); }
  .form-columns { grid-template-columns: 1fr; }
  .menu-toggle { display: grid; }
}
.menu-toggle {
  display: none; width: 34px; height: 34px;
  place-items: center; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface);
}
@media (max-width: 720px) { .menu-toggle { display: grid; } }

/* Print */
@media print {
  .content { padding: 0; }
}

/* === v3: Project Command Center === */
.project-card { transition: all var(--transition); }
.project-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.readiness-bar { margin: 8px 0; }
.mini-metric { background: var(--line-2); border-radius: 6px; padding: 8px 10px; text-align: center; }
.mini-metric span { display: block; font-size: 10px; color: var(--muted); margin-bottom: 3px; }
.mini-metric b { font: 700 14px 'Manrope'; }

/* === v3: Compliance Items === */
.compliance-item { margin-bottom: 12px; transition: all var(--transition); }
.compliance-item.overdue { border-color: var(--red); background: var(--red-light); }
.compliance-item:hover { box-shadow: var(--shadow-lg); }
.compliance-type {
  display: inline-block; font-size: 10px; font-weight: 600;
  padding: 3px 8px; border-radius: 12px; text-transform: uppercase;
}
.nav-badge-warn { background: var(--red-light) !important; color: var(--red) !important; }

/* === v3: Resource Planning Grid === */
.resource-grid {
  display: grid;
  grid-template-columns: 140px repeat(7, 1fr);
  gap: 1px; background: var(--line-2); padding: 1px;
}
.res-header { background: var(--surface); padding: 6px 4px; font-size: 10px; color: var(--muted); text-align: center; }
.res-header b { font-size: 13px; color: var(--ink); }
.res-row-label {
  background: var(--surface); padding: 8px 10px;
  display: flex; align-items: center; gap: 8px;
}
.res-cell {
  background: var(--surface); min-height: 36px;
  transition: background var(--transition);
  border-radius: 2px;
}
.res-cell.busy { background: var(--purple-light); border: 1px solid rgba(98,91,246,.2); }
.res-cell.overloaded { background: var(--red-light); border: 1px solid rgba(215,93,83,.2); }
.capacity-bar { height: 5px; background: var(--line-2); border-radius: 4px; margin: 6px 0; }
.capacity-bar div { height: 100%; border-radius: 4px; transition: width .4s; }

/* === v3: Logistics Metrics === */
.logi-metric { background: var(--line-2); border-radius: 6px; padding: 8px 10px; }
.logi-metric small { display: block; font-size: 9px; color: var(--muted); margin-bottom: 3px; text-transform: uppercase; letter-spacing: .5px; }
.logi-metric b { font-size: 11px; }

/* === v3: Timeline (Activity) === */
.timeline { padding: 4px 0; }
.timeline-item {
  display: flex; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--line-2);
}
.timeline-item:last-child { border: none; }
.timeline-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--line-2); display: grid; place-items: center;
  font-size: 14px; flex-shrink: 0;
}
.timeline-body { flex: 1; min-width: 0; }
.timeline-body b { display: block; }

/* === v3: Gantt health coloring === */
.gantt-bar { box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* === Responsive for new views === */
@media (max-width: 1100px) {
  .resource-grid { grid-template-columns: 120px repeat(7, 1fr); font-size: 10px; }
  .compliance-item { padding: 14px; }
}
@media (max-width: 720px) {
  .resource-grid { display: none; }
  .project-card { min-width: 0; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .mini-metric b { font-size: 12px; }
}

/* === v3: Large modal for complex forms === */
.modal-lg { max-width: 760px; width: 94%; max-height: 90vh; }

/* === v3: Form card sections === */
.form-card { background: var(--line-2); border-radius: var(--radius-sm); padding: 16px; }
.form-card h2 { font: 700 13px 'Manrope'; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.form-card label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); font-weight: 500; margin-bottom: 8px; }
.form-card label input, .form-card label select, .form-card label textarea {
  font-size: 12px; padding: 8px 10px;
}
.form-card .wide { grid-column: 1 / -1; }
.terms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.terms-grid textarea { font-size: 11px; min-height: 50px; resize: vertical; }

/* === v3: Editable lines === */
.editable-line {
  display: flex; gap: 6px; align-items: center; padding: 5px 0;
}
.editable-line input { flex: 1; font-size: 12px; padding: 7px 10px; }
.editable-line button {
  width: 22px; height: 22px; border-radius: 50%; font-size: 14px;
  background: var(--line); color: var(--muted); display: grid; place-items: center;
  transition: all var(--transition); border: none; cursor: pointer; flex-shrink: 0;
}
.editable-line button:hover { background: var(--red-light); color: var(--red); }

/* === v3: Payment rows === */
.payment-row {
  display: grid; grid-template-columns: 1fr 1fr 50px 28px 60px 28px;
  gap: 6px; align-items: center; padding: 6px 0;
  border-bottom: 1px solid var(--line-2);
}
.payment-row input { font-size: 11px; padding: 6px 8px; }
.payment-row .pay-pct { width: 50px; text-align: center; }
.payment-row .pay-amount { font-size: 11px; font-weight: 600; text-align: right; }
.payment-row button {
  width: 20px; height: 20px; border-radius: 50%; font-size: 12px;
  background: var(--line-2); color: var(--muted); display: grid; place-items: center;
  border: none; cursor: pointer;
}
.payment-row button:hover { background: var(--red-light); color: var(--red); }

/* === v3: Quote checkboxes === */
.quote-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; }
.check-item { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--ink-2); padding: 6px 10px; background: var(--surface); border-radius: 6px; border: 1px solid var(--line); cursor: pointer; transition: all var(--transition); }
.check-item:hover { border-color: var(--purple); }
.check-item input { accent-color: var(--purple); }
.check-item:has(input:checked) { background: var(--purple-light); border-color: var(--purple); color: var(--purple); }

/* === v3: Form actions row === */
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 12px; }

/* === v3: Invoice/Contract totals === */
.totals { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; display: flex; flex-direction: column; gap: 5px; font-size: 11px; }
.totals .grand { font-size: 14px; font-weight: 700; color: var(--purple); }
.totals input { width: 50px; padding: 4px 6px; font-size: 11px; }

/* === v3: Tag selector (supplier form) === */
.tag-opt {
  display: inline-block; padding: 5px 12px; border-radius: 20px; font-size: 11px;
  background: var(--line-2); color: var(--muted); cursor: pointer;
  border: 1px solid var(--line); transition: all var(--transition);
}
.tag-opt:hover { border-color: var(--purple); color: var(--purple); }
.tag-opt.active { background: var(--purple); color: #fff; border-color: var(--purple); }

/* === v3: Pagination pager === */
.pager {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 18px; border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.pager-info { font-size: 11px; color: var(--muted); }
.pg-group { display: flex; gap: 4px; align-items: center; }
.pg-btn {
  min-width: 30px; height: 30px; padding: 0 8px; border-radius: 7px;
  font-size: 12px; color: var(--ink-2); background: var(--surface);
  border: 1px solid var(--line); transition: all var(--transition);
  display: inline-grid; place-items: center;
}
.pg-btn:hover:not(:disabled):not(.active) { border-color: var(--purple); color: var(--purple); }
.pg-btn.active { background: var(--purple); color: #fff; border-color: var(--purple); }
.pg-btn:disabled { opacity: .4; cursor: not-allowed; }
.pg-dots { color: var(--muted); padding: 0 2px; font-size: 12px; }
.pg-size { font-size: 11px; padding: 5px 8px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); margin-right: 6px; cursor: pointer; }
.pg-size:hover { border-color: var(--purple); color: var(--purple); }

/* === v3: Multi-contacts === */
.contacts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.contact-chip { background: var(--line-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; position: relative; }
.contact-chip.primary { border-color: var(--purple); background: var(--purple-light); }
.contact-chip b { font-size: 12px; display: inline-block; }
.contact-chip small { font-size: 10px; color: var(--muted); margin-left: 6px; }
.section-title h2 { font: 700 13px 'Manrope'; margin: 0; }

.cm-legend, .contact-row { display: grid; grid-template-columns: 1.1fr 1fr 1.4fr 1.1fr 1.1fr 28px 28px; gap: 6px; align-items: center; }
.cm-legend { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; padding: 0 2px 4px; }
.cm-rows { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; padding-right: 2px; }
.contact-row input { font-size: 11px; padding: 6px 8px; }
.contact-row .cm-primary { display: grid; place-items: center; }
.contact-row .cm-primary input { accent-color: var(--purple); width: 15px; height: 15px; padding: 0; }
.cm-del { width: 24px; height: 24px; border-radius: 6px; background: var(--line-2); color: var(--muted); font-size: 15px; display: grid; place-items: center; border: none; cursor: pointer; transition: all var(--transition); }
.cm-del:hover { background: var(--red-light); color: var(--red); }

/* === v3: Invoice editor + document === */
.modal-xl { max-width: 1180px; width: 96%; max-height: 92vh; overflow-y: auto; }
.inv-editor { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(320px,0.85fr); gap: 18px; }
.inv-form { display: flex; flex-direction: column; gap: 14px; max-height: 74vh; overflow-y: auto; padding-right: 6px; }
.inv-preview-pane { border: 1px solid var(--line); border-radius: var(--radius); background: var(--line-2); display: flex; flex-direction: column; position: sticky; top: 0; max-height: 74vh; }
.inv-preview-bar { padding: 10px 14px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.inv-preview-scroll { overflow-y: auto; padding: 14px; }
.inv-editor-foot { display: flex; gap: 10px; justify-content: flex-end; padding-top: 14px; margin-top: 6px; border-top: 1px solid var(--line); }

.inv-item-head, .inv-item { display: grid; grid-template-columns: 118px 1fr 1.3fr 54px 82px 90px 26px; gap: 6px; align-items: center; }
.inv-item-head { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; padding: 2px 0 6px; }
.inv-item { margin-bottom: 6px; }
.inv-item input { font-size: 11px; padding: 6px 7px; }
.inv-item .inv-amount { font-size: 11px; font-weight: 600; text-align: right; }
.totals input { width: 56px; }

/* Invoice document (paper) */
.inv-doc { background: #fff; color: #172033; border-radius: 8px; padding: 22px; font-size: 11px; line-height: 1.5; box-shadow: 0 2px 10px rgba(0,0,0,.08); position: relative; min-width: 260px; }
.inv-doc-head { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 2px solid #625bf6; }
.inv-from { display: flex; gap: 10px; }
.inv-logo { width: 34px; height: 34px; border-radius: 8px; background: #625bf6; color: #fff; display: grid; place-items: center; font: 800 16px 'Manrope'; flex-shrink: 0; }
.inv-from b { font-size: 13px; }
.inv-meta { text-align: right; }
.inv-title { font: 800 20px 'Manrope'; color: #625bf6; letter-spacing: 1px; margin-bottom: 4px; }
.inv-muted { color: #788397; font-size: 10px; }
.inv-billto { padding: 12px 0; position: relative; }
.inv-billto b { font-size: 12px; display: block; margin-top: 2px; }
.inv-type { position: absolute; right: 0; top: 12px; background: #efefff; color: #625bf6; font-size: 9px; font-weight: 700; padding: 3px 8px; border-radius: 4px; }
.inv-items { width: 100%; border-collapse: collapse; margin: 6px 0; }
.inv-items th { text-align: left; font-size: 9px; color: #788397; text-transform: uppercase; padding: 6px 4px; border-bottom: 1px solid #e8ebf1; }
.inv-items td { padding: 7px 4px; border-bottom: 1px solid #f0f1f5; }
.inv-items th:nth-child(n+2), .inv-items td:nth-child(n+2) { text-align: right; }
.inv-totals { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; margin-top: 10px; min-width: 220px; }
.inv-totals > div { display: flex; justify-content: space-between; gap: 24px; width: 220px; }
.inv-totals .inv-grand { font-weight: 700; color: #625bf6; font-size: 13px; padding-top: 4px; border-top: 1px solid #e8ebf1; }
.inv-totals .inv-balance { font-weight: 700; color: #1c9b72; }
.inv-pay { margin-top: 14px; background: #f6f7fb; border-radius: 6px; padding: 10px 12px; font-size: 10px; }
.inv-pay > div { display: flex; gap: 6px; }
.inv-pay span { color: #788397; min-width: 56px; }
.inv-note { margin-top: 12px; font-size: 11px; }
.inv-note .inv-muted { display: block; }
.inv-foot { margin-top: 16px; padding-top: 10px; border-top: 1px solid #e8ebf1; text-align: center; color: #788397; font-size: 9px; }
.inv-stamp { position: absolute; right: 20px; bottom: 20px; transform: rotate(-12deg); border: 2px solid #c98518; color: #c98518; font-weight: 800; padding: 4px 10px; border-radius: 6px; opacity: .8; font-size: 12px; }
.inv-stamp.paid { border-color: #1c9b72; color: #1c9b72; }
.inv-view-toolbar { display: flex; gap: 8px; margin-bottom: 14px; }
.inv-view-wrap { max-height: 70vh; overflow-y: auto; background: var(--line-2); border-radius: var(--radius); padding: 16px; }

@media (max-width: 900px) { .inv-editor { grid-template-columns: 1fr; } .inv-preview-pane { position: static; max-height: none; } }

/* Print: only the document (invoice / contract / quote) */
@media print {
  @page { margin: 12mm; }
  html, body { background: #fff !important; height: auto !important; overflow: visible !important; }
  .sidebar, .topbar, .btn, .actions, .notif-panel, .toast, .search-box { display: none !important; }
  /* hide everything, then reveal only the print doc */
  body * { visibility: hidden !important; }
  #printArea, #printArea * { visibility: visible !important; }
  /* un-clip ancestors so the FULL document prints (fixes long-doc cutoff) */
  .overlay { position: static !important; display: block !important; background: none !important; backdrop-filter: none !important; opacity: 1 !important; }
  .modal, .modal-lg, .modal-xl { position: static !important; transform: none !important; box-shadow: none !important; max-height: none !important; overflow: visible !important; width: auto !important; max-width: none !important; padding: 0 !important; margin: 0 !important; }
  .inv-view-wrap, .inv-editor, .inv-form, .inv-preview-pane, .inv-preview-scroll { max-height: none !important; overflow: visible !important; padding: 0 !important; background: #fff !important; position: static !important; }
  #printArea { position: static !important; width: 100% !important; }
  .inv-view-toolbar, .modal-head { display: none !important; }
  .inv-doc, .ctr-doc, .quo-doc { box-shadow: none !important; }
}

/* === v3: Customer management layout === */
.cust-toolbar { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.cust-toolbar input#custSearch { width: 100%; border-radius: 8px; padding: 8px 12px; }
.cust-toolbar select { font-size: 11px; padding: 6px 8px; }
.cust-subline { font-size: 11px; color: var(--muted); margin-top: 4px; }
.subtle { font-size: 11px; color: var(--muted); }
.cust-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; margin-bottom: 16px; }
.ctab { white-space: nowrap; border: 0; background: none; color: var(--muted); padding: 10px 12px; font-size: 12px; border-bottom: 2px solid transparent; transition: all var(--transition); cursor: pointer; }
.ctab:hover { color: var(--ink); }
.ctab.active { color: var(--purple); border-bottom-color: var(--purple); font-weight: 700; }
.cust-tab-body section { padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.cust-tab-body section:last-child { border-bottom: none; }
.cust-tab-body h3 { font: 700 14px 'Manrope'; }
.cust-metrics { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 8px; }
.cust-metrics > div { background: var(--line-2); border-radius: var(--radius-sm); padding: 12px; }
.cust-metrics small { display: block; color: var(--muted); font-size: 10px; margin-bottom: 6px; }
.cust-metrics b { font: 700 16px 'Manrope'; }
.opp-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 8px; transition: all var(--transition); }
.opp-line:hover { border-color: var(--purple); }
.opp-line b { font-size: 13px; }
.contact-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 8px; }
.contact-card b { font-size: 12px; display: block; }
@media (max-width: 720px) { .cust-metrics { grid-template-columns: repeat(2,1fr); } }

/* === v3: Contract document === */
.ctr-doc, .quo-doc { background: #fff; color: #172033; border-radius: 8px; padding: 26px; font-size: 12px; line-height: 1.6; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.ctr-doc-head { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 14px; border-bottom: 2px solid #625bf6; }
.ctr-logo { width: 34px; height: 34px; border-radius: 8px; background: #625bf6; color: #fff; display: grid; place-items: center; font: 800 16px 'Manrope'; margin-bottom: 6px; }
.ctr-doc-head b { font-size: 14px; }
.ctr-title { text-align: right; }
.ctr-title > div:first-child { font: 800 20px 'Manrope'; color: #625bf6; letter-spacing: 1px; }
.ctr-h { font: 700 12px 'Manrope'; margin: 18px 0 8px; color: #172033; }
.ctr-doc > h4.ctr-h:first-of-type { margin-top: 16px; }
.ctr-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; }
.ctr-parties > div { background: #f6f7fb; border-radius: 6px; padding: 12px; }
.ctr-parties span { color: #788397; font-size: 10px; }
.ctr-parties b { display: block; margin: 2px 0; }
.ctr-specs { display: grid; grid-template-columns: repeat(auto-fill,minmax(150px,1fr)); gap: 8px; margin-top: 12px; }
.ctr-specs > div { background: #fafafd; border-radius: 6px; padding: 8px 10px; font-size: 11px; }
.ctr-specs span { color: #788397; margin-right: 6px; }
.ctr-services { margin: 6px 0 0 18px; padding: 0; }
.ctr-services li { margin: 3px 0; }
.ctr-term { margin-bottom: 10px; }
.ctr-term b { font-size: 11px; }
.ctr-term div { color: #3a4558; }
.ctr-note { margin-top: 12px; background: #fff8eb; border-radius: 6px; padding: 10px; }
.ctr-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 28px; padding-top: 14px; border-top: 1px solid #e8ebf1; color: #788397; }

/* === v3: Lead detail === */
.lead-detail { background: var(--line-2); border-radius: var(--radius); padding: 16px; }
.ld-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.ld-row { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; }
.ld-row.wide { grid-column: 1 / -1; }
.ld-row span { display: block; font-size: 10px; color: var(--muted); margin-bottom: 3px; }
.ld-row b { font-size: 12px; font-weight: 600; word-break: break-word; }
@media (max-width: 560px) { .ld-grid { grid-template-columns: 1fr; } }

/* === v3: Cost editor === */
.cost-head, .cost-row { display: grid; grid-template-columns: 1.1fr 1.6fr 1fr 28px; gap: 8px; align-items: center; }
.cost-head { font-size: 9px; color: var(--muted); text-transform: uppercase; padding: 0 2px 4px; }
.cost-row { margin-bottom: 6px; }
.cost-row input, .cost-row select { font-size: 12px; padding: 7px 9px; }
#costRows { display: flex; flex-direction: column; max-height: 280px; overflow-y: auto; }
.cost-summary { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; background: var(--line-2); border-radius: var(--radius-sm); padding: 12px; }
.cost-summary > div { text-align: center; }
.cost-summary span { display: block; font-size: 10px; color: var(--muted); margin-bottom: 4px; }
.cost-summary b { font: 700 15px 'Manrope'; }

/* === v3: Submission / approval trail === */
.sub-trail { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.sub-trail-h { font-size: 10px; color: var(--muted); font-weight: 700; letter-spacing: .5px; margin-bottom: 8px; }
.sub-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); position: relative; }
.sub-item:last-child { border-bottom: none; }
.sub-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); margin-top: 5px; flex-shrink: 0; }
.sub-item.approved .sub-dot { background: var(--green); }
.sub-item.rejected .sub-dot { background: var(--red); }
.sub-body { flex: 1; min-width: 0; font-size: 11px; }
.sub-files { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0; }
.sub-comment { font-size: 10px; color: var(--muted); font-style: italic; margin-top: 2px; }
.sub-item.rejected .sub-comment { color: var(--red); }
.sub-act { display: flex; gap: 6px; align-items: center; }

/* === v3: International / overseas === */
.ven-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.ven-setby { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 20px; background: var(--blue-light); color: var(--blue); }
.ven-setby.organizer { background: var(--purple-light); color: var(--purple); }
.ven-setby.contractor { background: var(--amber-light); color: var(--amber); }
.ven-portal { font-size: 10px; color: var(--muted); }
.ven-fee { font-size: 10px; color: var(--red); font-weight: 600; }
.inv-reverse { margin-top: 10px; background: #fff8eb; border: 1px solid #f7e5bf; border-radius: 6px; padding: 8px 12px; color: #9d6818; font-size: 11px; }

/* === v3: Client approval portal === */
body.portal-mode .sidebar, body.portal-mode .topbar { display: none !important; }
body.portal-mode .shell { grid-template-columns: 1fr; }
body.portal-mode .content { max-width: 1000px; margin: 0 auto; padding: 0; }
.portal-page { background: var(--bg); min-height: 100vh; }
.portal-bar { display: flex; justify-content: space-between; align-items: center; padding: 16px 28px; background: var(--surface); border-bottom: 1px solid var(--line); }
.portal-brand { display: flex; align-items: center; gap: 10px; }
.portal-brand b { font-size: 13px; display: block; }
.portal-body { padding: 28px; }
.portal-head { margin-bottom: 22px; }
.approval-badge { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 20px; background: var(--amber-light); color: var(--amber); }
.approval-badge.approved { background: var(--green-light); color: var(--green); }
.approval-badge.in-review { background: var(--blue-light); color: var(--blue); }
.portal-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; align-items: start; }
.portal-preview-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-height: 360px; display: grid; place-items: center; text-align: center; padding: 24px; }
.portal-preview-tip { margin-top: 14px; font-size: 10px; color: var(--muted); max-width: 280px; }
.portal-side { display: flex; flex-direction: column; gap: 16px; }
.portal-info { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.portal-info > div { background: var(--line-2); border-radius: var(--radius-sm); padding: 10px 12px; }
.portal-info span { display: block; font-size: 10px; color: var(--muted); margin-bottom: 3px; }
.portal-info b { font-size: 12px; }
.approval-trail { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.approval-item { padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 11px; }
.approval-item:last-child { border-bottom: none; }
.approval-item.approved > div:first-child { color: var(--green); }
.approval-item.rejected > div:first-child { color: var(--red); }
.approval-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; }
.approval-form label { font-size: 11px; color: var(--muted); display: block; }
.approval-form textarea { width: 100%; margin-top: 6px; }
.approval-done { background: var(--green-light); border: 1px solid #a7e4ce; color: var(--green); border-radius: var(--radius-sm); padding: 14px; font-weight: 600; font-size: 13px; }
.approval-card { display: flex; flex-direction: column; }
@media (max-width: 760px) { .portal-grid { grid-template-columns: 1fr; } .portal-body { padding: 16px; } }
