/* ── Variables ── */
:root {
  --black:      #0a0a0a;
  --white:      #ffffff;
  --accent:      #4F63F5;
  --accent-dark: #3A4FE0;
  --accent-light:#EDEFFD;
  --gray-50:    #fafafa;
  --gray-100:   #f4f4f5;
  --gray-200:   #e4e4e7;
  --gray-300:   #d1d1d6;
  --gray-400:   #a1a1aa;
  --gray-500:   #71717a;
  --gray-600:   #52525b;
  --gray-700:   #3f3f46;
  --gray-800:   #27272a;
  --gray-900:   #18181b;
  --sidebar-w:  220px;
  --radius:     6px;
  --radius-lg:  10px;
  --shadow:     0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:  0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:  0 20px 60px rgba(0,0,0,.18);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--gray-50);
  color: var(--black);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font: inherit; }
input, select, textarea {
  font: inherit;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: .5rem .75rem;
  background: var(--white);
  color: var(--black);
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--black);
  box-shadow: 0 0 0 3px rgba(10,10,10,.06);
}
textarea { resize: vertical; }
.hidden { display: none !important; }
svg { display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* ── Setup Screen ── */
.setup-screen {
  min-height: 100vh;
  background: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.setup-card {
  background: var(--white);
  border-radius: 14px;
  padding: 2.75rem;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
}
.setup-logo-wrap {
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
}
.setup-logo-img {
  height: 52px;
  width: auto;
  display: block;
}
.setup-logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--black);
}
.setup-card h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: .4rem; }
.setup-sub { color: var(--gray-500); font-size: .875rem; margin-bottom: 1.75rem; }
.setup-card .form-group { margin-bottom: 1.25rem; }
.setup-card label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--gray-600); }
.setup-card small { display: block; color: var(--gray-400); font-size: .8rem; margin-top: .4rem; line-height: 1.45; }
.btn-full { width: 100%; justify-content: center; }

/* ── App Layout ── */
.app { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: #2E2D4D;
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
}
.sidebar-top {
  padding: 1.25rem 1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-logo-wrap {
  display: flex;
  align-items: center;
  padding: 4px 0;
}
.sidebar-logo-img {
  height: 44px;
  width: auto;
  display: block;
}
.sidebar-logo-text {
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--white);
  white-space: nowrap;
  padding: 4px 0;
}
.sidebar-nav {
  flex: 1;
  padding: .75rem 0;
  overflow-y: auto;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .6rem 1.1rem;
  font-size: .875rem;
  color: rgba(255,255,255,.5);
  transition: background .15s, color .15s;
  white-space: nowrap;
  font-weight: 500;
}
.nav-item:hover  { background: rgba(255,255,255,.05); color: rgba(255,255,255,.85); }
.nav-item.active { background: rgba(255,255,255,.08); color: var(--white); }
.nav-item.active .nav-icon svg { stroke: var(--accent); }
.nav-icon { width: 18px; display: flex; align-items: center; justify-content: center; }
.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: .5rem 0 .25rem;
}
.sidebar-brand {
  font-size: .72rem;
  color: rgba(255,255,255,.25);
  padding: .3rem 1.1rem .85rem;
  letter-spacing: .03em;
}

/* ── Main Content ── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 2rem 2.5rem 3rem;
  min-height: 100vh;
  max-width: calc(100vw - var(--sidebar-w));
}

/* ── View Header ── */
.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 1rem;
}
.view-header h2 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.view-subtitle { color: var(--gray-400); font-size: .875rem; margin-top: .2rem; font-weight: 400; }

/* ── Stat Cards ── */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow);
}
.stat-card.clickable { cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.stat-card.clickable:hover { box-shadow: var(--shadow-md); border-color: var(--gray-300); }
.stat-icon { font-size: 1.1rem; margin-bottom: .6rem; color: var(--accent); display: flex; }
.stat-label { font-size: .75rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.stat-value { font-size: 1.75rem; font-weight: 800; margin-top: .2rem; letter-spacing: -.02em; }
.stat-sub { font-size: .8rem; color: var(--gray-400); margin-top: .25rem; }
.stat-alert { color: #dc2626 !important; font-weight: 600; }

/* ── Alert ── */
.alert-box {
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  border-radius: var(--radius);
  padding: .9rem 1.1rem;
  margin-bottom: 1.5rem;
  font-size: .875rem;
  display: flex;
  gap: .75rem;
  align-items: flex-start;
}
.alert-box svg { color: #dc2626; margin-top: 1px; flex-shrink: 0; }
.alert-box-body strong { display: block; margin-bottom: .3rem; color: #991b1b; }
.alert-box ul { padding-left: 1.25rem; color: #7f1d1d; }

/* ── Dashboard Cols ── */
.dashboard-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 900px) { .dashboard-cols { grid-template-columns: 1fr; } }

/* ── Tables ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  font-size: .875rem;
}
.data-table thead { background: var(--black); }
.data-table th {
  padding: .75rem 1rem;
  text-align: left;
  font-weight: 700;
  color: var(--white);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}
.data-table td {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
  color: var(--gray-700);
}
.data-table td strong { color: var(--black); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--gray-50); }
.data-table a { color: var(--black); text-decoration: underline; text-underline-offset: 2px; }
.actions { white-space: nowrap; text-align: right; }

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray-400);
  font-size: .9rem;
}

/* ── Filters ── */
.filter-bar {
  display: flex;
  gap: .75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  align-items: center;
}
.search-input { max-width: 280px; }
.filter-select { max-width: 200px; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem 1.1rem;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  font-weight: 600;
  font-size: .875rem;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap;
  text-decoration: none;
  letter-spacing: .01em;
}
.btn-primary {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}
.btn-primary:hover { background: var(--gray-800); }
.btn-ghost {
  background: var(--white);
  color: var(--black);
  border-color: var(--gray-200);
}
.btn-ghost:hover { background: var(--gray-50); border-color: var(--gray-300); }
.btn-danger { color: #dc2626 !important; border-color: #fecaca !important; }
.btn-danger:hover { background: #fef2f2 !important; }
.btn-sm { padding: .35rem .7rem; font-size: .8rem; }
.btn-lg { padding: .75rem 1.5rem; font-size: 1rem; }
.btn-icon {
  background: none;
  border: 1.5px solid transparent;
  padding: .3rem .35rem;
  border-radius: var(--radius);
  transition: background .12s, border-color .12s;
  display: inline-flex;
  align-items: center;
  color: var(--gray-500);
  line-height: 1;
}
.btn-icon:hover { background: var(--gray-100); color: var(--black); border-color: var(--gray-200); }
.btn-icon.danger:hover { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.btn-icon.accent:hover { background: var(--accent-light); color: var(--accent); border-color: #fed7aa; }
.btn-icon.advance { font-weight: 700; font-size: 13px; }
.btn-icon.advance:hover { background: #f0fdf4; color: #16a34a; border-color: #86efac; }

/* ── Forms ── */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  color: var(--gray-600);
  margin-bottom: .35rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem 1rem;
}
.form-group.full { grid-column: 1 / -1; }
.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1.5px solid var(--gray-100);
}
.total-display {
  margin-right: auto;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -.01em;
}
.section-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--gray-400);
  margin: 1.25rem 0 .75rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

/* ── Line rows ── */
.line-row {
  display: grid;
  grid-template-columns: 140px 1fr 80px 120px 36px;
  gap: .5rem;
  margin-bottom: .5rem;
  align-items: center;
}
.line-product {
  font-size: .78rem;
  padding: .3rem .4rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-muted);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Mode choice cards ── */
.mode-choice-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .5rem;
  padding: 1.5rem 1rem;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: var(--bg-secondary);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.mode-choice-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(79,99,245,.15);
  transform: translateY(-2px);
}
.mode-choice-icon  { font-size: 2.5rem; }
.mode-choice-title { font-size: 14px; font-weight: 700; color: var(--text); }
.mode-choice-desc  { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .6rem;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: .02em;
}
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-gray   { background: var(--gray-100); color: var(--gray-600); }
.badge-red    { background: #fee2e2; color: #b91c1c; }
.badge-yellow { background: #fef9c3; color: #92400e; }
.badge-accent { background: var(--accent-light); color: var(--accent-dark); }

/* ── Kanban ── */
.kanban {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  align-items: start;
}
@media (max-width: 1100px) { .kanban { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px)  { .kanban { grid-template-columns: 1fr; } }
.kanban-col {
  background: var(--gray-100);
  border-radius: var(--radius-lg);
  padding: .875rem;
  min-height: 200px;
}
.kanban-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .875rem;
}
.kanban-count {
  font-size: .78rem;
  color: var(--gray-400);
  font-weight: 700;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: 99px;
  padding: .1rem .5rem;
}
.kanban-empty { color: var(--gray-400); font-size: .8rem; text-align: center; padding: 1rem 0; }
.kanban-card {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: .875rem;
  margin-bottom: .6rem;
  box-shadow: var(--shadow);
  transition: box-shadow .15s;
}
.kanban-card:hover { box-shadow: var(--shadow-md); }
.kanban-card.card-late { border-left: 3px solid #dc2626; }
.card-title { font-weight: 700; font-size: .875rem; margin-bottom: .25rem; color: var(--black); }
.card-client { font-size: .8rem; color: var(--gray-500); display: flex; align-items: center; gap: .35rem; }
.card-date { font-size: .75rem; color: var(--gray-400); margin-top: .5rem; display: flex; align-items: center; gap: .3rem; }
.card-date.late { color: #dc2626; font-weight: 700; }
.card-notes { font-size: .78rem; color: var(--gray-500); margin-top: .45rem; line-height: 1.45; }
.card-actions { display: flex; gap: .25rem; margin-top: .6rem; justify-content: flex-end; border-top: 1px solid var(--gray-100); padding-top: .5rem; }

/* ── Modal ── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10,10,10,.5);
  backdrop-filter: blur(3px);
}
.modal-box {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  margin: 1rem;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1.5px solid var(--gray-100);
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 1;
}
.modal-header h3 { font-size: 1rem; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  color: var(--gray-400);
  padding: .3rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
}
.modal-close:hover { background: var(--gray-100); color: var(--black); }
.modal-body { padding: 1.5rem; }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: .75rem 1.2rem;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 600;
  z-index: 9999;
  box-shadow: var(--shadow-lg);
  animation: slideUp .2s ease;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.toast-success { background: var(--black); color: var(--white); }
.toast-error   { background: #dc2626; color: var(--white); }
@keyframes slideUp {
  from { transform: translateY(10px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── Loading ── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  backdrop-filter: blur(2px);
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Contracts ── */
.contract-container { max-width: 740px; }
.contract-intro {
  background: var(--gray-100);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.75rem;
  font-size: .875rem;
  border-left: 3px solid var(--accent);
}
.contract-intro p { margin-bottom: .4rem; }
.contract-intro .note { color: var(--gray-500); font-size: .82rem; }

/* ── Stripe modal ── */
.stripe-info { font-size: .9rem; }
.stripe-info p { margin-bottom: .75rem; }
.stripe-info .note { color: var(--gray-500); font-size: .82rem; }

/* ── Settings ── */
.settings-section {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}
.settings-section h3 { font-size: .95rem; font-weight: 700; margin-bottom: 1rem; }
.info-block {
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  font-size: .875rem;
  line-height: 1.8;
}
.info-block.small { font-size: .82rem; }
.info-block code {
  background: var(--gray-200);
  padding: .1rem .4rem;
  border-radius: 3px;
  font-family: 'Menlo', 'Consolas', monospace;
  font-size: .78rem;
}

/* ── Pipeline ────────────────────────────────────────────────────────────── */
.pipeline-board {
  display: flex;
  gap: .75rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  align-items: flex-start;
}
.pipeline-col {
  min-width: 190px;
  max-width: 210px;
  flex-shrink: 0;
  background: var(--gray-50);
  border-radius: var(--radius);
  border: 1.5px solid var(--gray-200);
  overflow: hidden;
}
.pipeline-col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .6rem .75rem;
  background: var(--white);
}
.pipeline-col-title { font-size: .78rem; font-weight: 700; color: var(--black); }
.pipeline-col-count {
  font-size: .7rem; font-weight: 600; background: var(--gray-200);
  color: var(--gray-600); border-radius: 99px; padding: 1px 7px;
}
.pipeline-col-body { padding: .5rem; display: flex; flex-direction: column; gap: .4rem; min-height: 80px; }
.pipeline-empty { font-size: .75rem; color: var(--gray-400); text-align: center; padding: .75rem 0; }

.pipeline-card {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  padding: .65rem .75rem;
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
}
.pipeline-card:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(79,99,245,.12); }
.pl-card-name  { font-size: .82rem; font-weight: 700; color: var(--black); }
.pl-card-sub   { font-size: .75rem; color: var(--gray-500); margin-top: 1px; }
.pl-card-info  { font-size: .72rem; color: var(--gray-500); display: flex; align-items: center; gap: 3px; margin-top: 2px; }
.pl-card-assign{ font-size: .7rem; color: var(--gray-400); display: flex; align-items: center; gap: 3px; margin-top: 3px; }
.pl-card-badges{ display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.pl-badge {
  font-size: .67rem; font-weight: 600; border-radius: 99px; padding: 1px 6px;
}
.pl-badge.blue   { background: var(--accent-light); color: var(--accent); }
.pl-badge.orange { background: #FFF3E0; color: #E65100; }
.pl-badge.green  { background: #E8F5E9; color: #2E7D32; }
.pl-badge.gray   { background: var(--gray-100); color: var(--gray-600); }

/* Prospect detail */
.prospect-detail { display: flex; flex-direction: column; gap: .75rem; }
.detail-section  { border: 1.5px solid var(--gray-200); border-radius: var(--radius); padding: .85rem 1rem; }
.detail-section h4 { font-size: .88rem; font-weight: 700; margin-bottom: .5rem; color: var(--black); }
.detail-row  { font-size: .85rem; color: var(--gray-700); display: flex; align-items: center; gap: 5px; margin-bottom: 3px; }
.detail-notes{ margin-top: .5rem; font-size: .82rem; color: var(--gray-600); font-style: italic; border-top: 1px solid var(--gray-100); padding-top: .4rem; }
.detail-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; padding-top: .25rem; }

/* Pre-client */
.pre-client-box { border-color: #F97316; background: #FFF8F0; }
.pre-client-box h4 { color: #C2410C; }
.checklist { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .5rem; }
.check-item { display: flex; align-items: center; gap: .5rem; font-size: .85rem; cursor: pointer; }
.check-item input { width: 15px; height: 15px; cursor: pointer; accent-color: var(--accent); }
.withdrawal-info { font-size: .8rem; color: var(--gray-600); margin-top: .4rem; }

/* Contract tracker */
.contract-tracker { margin-top: .75rem; }
.tracker-bar  { height: 8px; background: var(--gray-200); border-radius: 99px; overflow: hidden; }
.tracker-fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }
.tracker-labels { display: flex; justify-content: space-between; font-size: .73rem; color: var(--gray-500); margin-top: 3px; }

/* Duration selector */
.duration-sel { display: flex; gap: .4rem; flex-wrap: wrap; }
.dur-btn {
  padding: .35rem .9rem; border-radius: 99px; font-size: .82rem; font-weight: 600;
  border: 1.5px solid var(--gray-300); background: var(--white); cursor: pointer; color: var(--gray-600);
  transition: all .15s;
}
.dur-btn.active { border-color: var(--accent); background: var(--accent); color: var(--white); }
.dur-btn:hover:not(.active) { border-color: var(--accent); color: var(--accent); }

/* Products grid */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: .5rem; margin: .75rem 0; }
.prod-card {
  border: 1.5px solid var(--gray-200); border-radius: var(--radius); padding: .65rem .75rem;
  cursor: pointer; transition: all .15s; position: relative; background: var(--white);
}
.prod-card:hover   { border-color: var(--accent); }
.prod-card.selected{ border-color: var(--accent); background: var(--accent-light); }
.prod-check  { position: absolute; top: .4rem; right: .4rem; color: var(--accent); }
.prod-name   { font-size: .82rem; font-weight: 700; color: var(--black); margin-bottom: 2px; }
.prod-cat    { font-size: .7rem; color: var(--gray-500); margin-bottom: 3px; }
.prod-price  { font-size: .75rem; color: var(--gray-600); }

/* Panier total */
.panier-total { background: var(--gray-50); border: 1.5px solid var(--gray-200); border-radius: var(--radius); padding: .75rem 1rem; margin-top: .25rem; }
.tot-row { display: flex; justify-content: space-between; font-size: .83rem; padding: .15rem 0; color: var(--gray-700); }
.tot-row.accent { font-weight: 700; color: var(--accent); font-size: .9rem; border-top: 1px solid var(--gray-200); margin-top: .2rem; padding-top: .4rem; }

/* Contract summary */
.contract-summary { background: var(--gray-50); border: 1.5px solid var(--gray-200); border-radius: var(--radius); padding: .85rem 1rem; margin: .75rem 0; }
.cs-title { font-size: .85rem; font-weight: 700; color: var(--black); margin-bottom: .5rem; }
.cs-line   { display: flex; justify-content: space-between; font-size: .82rem; color: var(--gray-600); padding: .15rem 0; }
.cs-total  { display: flex; justify-content: space-between; font-size: .88rem; color: var(--black); border-top: 1px solid var(--gray-200); margin-top: .4rem; padding-top: .4rem; }

.text-muted { color: var(--gray-500); }
.text-green { color: #10B981; }
.small { font-size: .8rem; }

/* MES slider */
.mes-slider-wrap {
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  margin: .5rem 0;
}
.mes-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .83rem;
  color: var(--gray-700);
  margin-bottom: .5rem;
}
.mes-slider-header strong { color: var(--accent); font-size: .95rem; }
.mes-range {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
  height: 6px;
}
.mes-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: .72rem;
  color: var(--gray-400);
  margin-top: .3rem;
}
.mes-hint {
  font-size: .75rem;
  color: var(--gray-500);
  font-style: italic;
  margin-top: .4rem;
  margin-bottom: 0;
}

/* ── Semantic aliases ── */
:root {
  --text:       var(--black);
  --text-muted: var(--gray-500);
  --border:     var(--gray-200);
  --bg-input:   var(--white);
  --success:    #10B981;
  --warning:    #F59E0B;
  --danger:     #EF4444;
}

/* ── Projects — sections ── */
.projects-sections { display: flex; flex-direction: column; gap: 40px; }
.projects-section-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--gray-200);
}
.projects-section-header h3 { font-size: 1rem; font-weight: 700; color: var(--black); }
.projects-section-icon { font-size: 18px; }
.card-domain { font-size: .75rem; color: var(--gray-600); margin-top: 4px; }
.type-chip {
  display: inline-block; font-size: .72rem; font-weight: 600;
  padding: 2px 8px; border-radius: 20px;
}
.type-site    { background: #DBEAFE; color: #1D4ED8; }
.type-graph   { background: #FDE8FF; color: #9333EA; }

/* Project detail modal */
.project-detail { display: flex; flex-direction: column; gap: 0; }
.project-detail-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
  padding-bottom: 14px; margin-bottom: 16px;
  border-bottom: 1.5px solid var(--gray-100);
  font-size: .875rem;
}
.project-detail-notes {
  font-size: .85rem; color: var(--gray-600);
  background: var(--gray-50); border-radius: var(--radius);
  padding: 10px 14px; margin-bottom: 16px;
}
.project-section { margin-bottom: 28px; }
.project-section h4 {
  font-size: .875rem; font-weight: 700; color: var(--black);
  margin-bottom: 12px; display: flex; align-items: center; gap: 6px;
}

/* Domain row */
.domain-row { display: flex; gap: 8px; align-items: center; }
.domain-row input { flex: 1; }

/* Graphisme file upload */
.doc-upload-zone {
  border: 2px dashed var(--gray-300); border-radius: var(--radius-lg);
  padding: 28px 20px; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.doc-upload-zone:hover { border-color: var(--accent); background: var(--accent-light); }

/* ── Presite builder ── */
#presite-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column;
  background: var(--gray-50);
}
.presite-topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--black); color: var(--white);
  padding: 10px 20px; gap: 16px; min-height: 52px; flex-shrink: 0;
}
.presite-topbar-left  { display: flex; align-items: center; gap: 12px; min-width: 0; }
.presite-topbar-center { flex: 1; display: flex; justify-content: center; }
.presite-topbar-right { display: flex; align-items: center; gap: 8px; }
.presite-title {
  font-size: .875rem; font-weight: 600; color: var(--white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.presite-client { font-size: .78rem; color: var(--gray-400); white-space: nowrap; }

.presite-template-tabs { display: flex; gap: 4px; background: rgba(255,255,255,.08); border-radius: 8px; padding: 3px; }
.presite-tab {
  background: none; border: none; color: rgba(255,255,255,.65);
  padding: 5px 14px; border-radius: 6px; font-size: .8rem; font-weight: 500;
  cursor: pointer; transition: background .15s, color .15s;
}
.presite-tab:hover { color: var(--white); background: rgba(255,255,255,.1); }
.presite-tab.active { background: var(--white); color: var(--black); }

.presite-workspace {
  display: flex; flex: 1; overflow: hidden;
}
.presite-panel {
  width: 320px; flex-shrink: 0;
  background: var(--white); border-right: 1.5px solid var(--gray-200);
  overflow-y: auto;
}
.presite-panel-inner { padding: 0 0 32px; }
.presite-preview-wrap { flex: 1; display: flex; flex-direction: column; background: var(--gray-100); overflow: hidden; }
.presite-view-toggle { display: flex; gap: 4px; padding: 6px 10px; background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.presite-view-btn { background: none; border: 1px solid transparent; border-radius: 6px; padding: 4px 10px; font-size: 16px; cursor: pointer; color: var(--text-muted); transition: all .15s; }
.presite-view-btn:hover { background: var(--hover); border-color: var(--border); }
.presite-view-btn.active { background: var(--primary); border-color: var(--primary); filter: none; }
.presite-iframe-shell { flex: 1; display: flex; overflow: hidden; }
.presite-iframe { flex: 1; border: none; width: 100%; height: 100%; }

.presite-section {
  border-bottom: 1.5px solid var(--gray-100);
  padding: 14px 16px;
}
.presite-section-title {
  font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--gray-500); margin-bottom: 10px;
}
.presite-field { margin-bottom: 10px; }
.presite-field label { display: block; font-size: .78rem; color: var(--gray-600); margin-bottom: 4px; font-weight: 500; }
.presite-field input,
.presite-field textarea { font-size: .82rem; padding: 6px 10px; }
.presite-field small { font-size: .72rem; color: var(--gray-400); }
.presite-field-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.presite-field-row label { font-size: .82rem; color: var(--gray-700); }
.presite-field-row input[type="color"] {
  width: 36px; height: 28px; padding: 2px 3px; cursor: pointer; border-radius: 4px;
}

.presite-service-row {
  background: var(--gray-50); border-radius: var(--radius);
  padding: 10px; margin-bottom: 8px;
  display: flex; flex-direction: column; gap: 6px;
}

/* Topbar buttons override in presite context */
#presite-overlay .btn-ghost {
  border-color: rgba(255,255,255,.2); color: rgba(255,255,255,.85);
  background: transparent;
}
#presite-overlay .btn-ghost:hover { background: rgba(255,255,255,.1); }

/* ── ProspectSearch autocomplete ── */
.ps-wrap {
  position: relative;
  margin-bottom: 1.1rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 12px 14px 8px;
}
.ps-bar { display: flex; gap: 8px; align-items: center; }
.ps-input-wrap {
  flex: 1; position: relative; display: flex; align-items: center;
}
.ps-icon {
  position: absolute; left: 10px; font-size: 14px;
  pointer-events: none; z-index: 1;
}
.ps-spinner { position: absolute; right: 10px; font-size: 13px; }
.ps-input {
  width: 100%; padding: 9px 32px 9px 32px;
  border: 1.5px solid var(--gray-300); border-radius: var(--radius);
  font-size: 13.5px; outline: none;
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
}
.ps-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,99,245,.1);
}
.ps-google-btn {
  white-space: nowrap; font-size: 12px; padding: 7px 12px;
  display: flex; align-items: center; gap: 4px;
}
.ps-hint {
  font-size: 11px; color: var(--gray-400); margin-top: 6px;
  padding-left: 2px;
}
.ps-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,.13);
  z-index: 9999;
  max-height: 260px; overflow-y: auto;
}
.ps-item {
  padding: 11px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--gray-100);
  transition: background .1s;
}
.ps-item:last-child { border-bottom: none; }
.ps-item:hover, .ps-item.ps-focus { background: var(--gray-50); }
.ps-item-main { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.ps-item-name { font-size: 13.5px; font-weight: 600; color: var(--gray-900); }
.ps-item-badge {
  font-size: 10px; color: var(--gray-500);
  background: var(--gray-100); border-radius: 4px;
  padding: 1px 6px; font-weight: 500;
}
.ps-src-badge {
  font-size: 10px; color: var(--accent);
  background: var(--accent-light); border-radius: 4px;
  padding: 1px 6px; font-weight: 600; margin-left: 4px;
}
.ps-item-sub { font-size: 11.5px; color: var(--gray-500); display: flex; gap: 4px; flex-wrap: wrap; }
.ps-item-extra { font-size: 11px; color: var(--gray-400); margin-top: 3px; }
.ps-loading, .ps-empty {
  padding: 14px; text-align: center;
  font-size: 13px; color: var(--gray-400); cursor: default;
}
.ps-loading:hover, .ps-empty:hover { background: none; }
/* Flash fill animation */
@keyframes ps-fill-flash {
  0%   { background: rgba(79,99,245,.18); }
  100% { background: transparent; }
}
input.ps-filled { animation: ps-fill-flash 1.6s ease-out; }

/* ── Dashboard v2 — MRR Hero ── */
.mrr-hero {
  background: linear-gradient(135deg, #0d2640 0%, #143352 60%, #1a4060 100%);
  border-radius: 14px;
  padding: 1.75rem 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 1.5rem;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.mrr-hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: rgba(79,99,245,.12);
  pointer-events: none;
}
@media (max-width: 768px) { .mrr-hero { grid-template-columns: 1fr; gap: 1.5rem; } }

.mrr-eyebrow {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: rgba(255,255,255,.45); margin-bottom: .6rem;
}
.mrr-amount {
  font-size: 3rem; font-weight: 800; letter-spacing: -.04em; line-height: 1;
  font-variant-numeric: tabular-nums; margin-bottom: .4rem;
}
.mrr-target {
  font-size: .82rem; color: rgba(255,255,255,.5);
}
.mrr-bar-wrap {
  height: 6px; background: rgba(255,255,255,.12);
  border-radius: 999px; margin: 1rem 0 .5rem;
  overflow: hidden;
}
@media (prefers-reduced-motion: no-preference) {
  .mrr-bar { transition: width .7s cubic-bezier(.4,0,.2,1); }
}
.mrr-bar {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #4F63F5, #10B981);
}
.mrr-meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .77rem; color: rgba(255,255,255,.45);
}
.mrr-pct { font-weight: 700; color: #10B981; font-size: .88rem; }

.mrr-right { display: flex; flex-direction: column; }
.mrr-right-title {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: rgba(255,255,255,.35); margin-bottom: .6rem;
}
.mrr-contract-rows { display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.mrr-contract-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: .45rem .7rem;
  background: rgba(255,255,255,.07);
  border-radius: 7px; font-size: .81rem;
}
.mrr-contract-name { color: rgba(255,255,255,.8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.mrr-contract-amount { font-weight: 700; color: #10B981; font-variant-numeric: tabular-nums; flex-shrink: 0; margin-left: .5rem; }
.mrr-empty { color: rgba(255,255,255,.3); font-size: .82rem; padding: .5rem 0; }

/* Mensualités table in dashboard */
.dash-mrr-table .mrr-prog {
  display: flex; align-items: center; gap: .5rem;
}
.mrr-prog-bar-wrap { height: 5px; background: var(--gray-200); border-radius: 999px; flex: 1; overflow: hidden; }
.mrr-prog-bar { height: 100%; border-radius: 999px; background: #10B981; }
.mrr-prog-label { font-size: .72rem; color: var(--gray-400); white-space: nowrap; }
