/* Components */

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: var(--fs-base);
  font-weight: 500;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  transition: background var(--t-fast) ease, border-color var(--t-fast) ease, transform var(--t-fast) ease;
  min-height: 40px;
  white-space: nowrap;
}
.btn:hover    { background: var(--surface-3); }
.btn:active   { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn--primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn--primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn--ghost {
  background: transparent;
  border-color: transparent;
}
.btn--ghost:hover { background: var(--surface-2); }
.btn--danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.btn--danger:hover { background: var(--danger-soft); }
.btn--sm { padding: 6px 12px; min-height: 32px; font-size: var(--fs-sm); }
.btn--lg { padding: 14px 22px; min-height: 48px; font-size: var(--fs-md); }
.btn--block { width: 100%; }
.btn--icon  { padding: 8px; min-height: 36px; min-width: 36px; }

/* --- Forms --- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  font-weight: 500;
}
.field__hint {
  font-size: var(--fs-xs);
  color: var(--text-dim);
}
.field__error {
  font-size: var(--fs-xs);
  color: var(--danger);
}
.input, .select, .textarea {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-size: var(--fs-base);
  min-height: 44px;
  transition: border-color var(--t-fast) ease, background var(--t-fast) ease;
}
.input::placeholder, .textarea::placeholder { color: var(--text-dim); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--ring);
  background: var(--surface-2);
}
.textarea { min-height: 96px; padding: 12px 14px; resize: vertical; }

/* --- Cards --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}
.card--flush { padding: 0; overflow: hidden; }
.card__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
}
.card__body { padding: var(--space-5); }
.card__title { font-size: var(--fs-lg); font-weight: 600; }
.card__subtitle { color: var(--text-muted); font-size: var(--fs-sm); margin-top: 2px; }

/* --- Badges --- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 500;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.badge--success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge--warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge--danger  { background: var(--danger-soft);  color: var(--danger);  border-color: transparent; }
.badge--info    { background: var(--info-soft);    color: var(--info);    border-color: transparent; }
.badge--brand   { background: var(--brand-soft);   color: var(--brand);   border-color: transparent; }
.badge--neutral { background: var(--surface-3); color: var(--text-muted); border-color: transparent; }

/* Priority dot (André's signature visual) */
.prio-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 999px;
  background: var(--prio-green);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.04);
  flex-shrink: 0;
}
.prio-dot--green   { background: var(--prio-green); }
.prio-dot--yellow  { background: var(--prio-yellow); }
.prio-dot--red     { background: var(--prio-red); box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.18); }
.prio-dot--neutral { background: var(--text-muted); }

/* --- KPI tile --- */
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  display: flex; flex-direction: column; gap: var(--space-2);
}
.kpi__label { color: var(--text-muted); font-size: var(--fs-sm); }
.kpi__value { font-size: var(--fs-2xl); font-weight: 600; letter-spacing: -0.01em; }
.kpi__delta { font-size: var(--fs-xs); color: var(--text-dim); }
.kpi--brand   { border-color: var(--brand);   background: linear-gradient(180deg, var(--brand-soft),   transparent 80%); }
.kpi--danger  { border-color: var(--danger);  background: linear-gradient(180deg, var(--danger-soft),  transparent 80%); }
.kpi--success { border-color: var(--success); background: linear-gradient(180deg, var(--success-soft), transparent 80%); }

/* --- Tables --- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.table th {
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface);
}
.table tr:hover td { background: var(--surface-2); }
.table tr:last-child td { border-bottom: none; }

/* --- Empty state --- */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--space-3);
  padding: var(--space-7) var(--space-5);
  color: var(--text-muted);
  text-align: center;
}
.empty__icon {
  width: 48px; height: 48px;
  border-radius: 999px;
  background: var(--surface-2);
  display: grid; place-items: center;
  color: var(--text-dim);
}

/* --- Alert banner --- */
.alert {
  display: flex; gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.alert--danger  { background: var(--danger-soft);  border-color: var(--danger); }
.alert--warning { background: var(--warning-soft); border-color: var(--warning); }
.alert--info    { background: var(--info-soft);    border-color: var(--info); }

/* --- Toast --- */
.toast-stack {
  position: fixed;
  bottom: calc(var(--space-4) + var(--safe-bottom));
  right: var(--space-4);
  display: flex; flex-direction: column; gap: var(--space-2);
  z-index: 80;
  pointer-events: none;
}
.toast {
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  min-width: 220px; max-width: 360px;
  pointer-events: auto;
  animation: slideIn var(--t-base) ease;
}
.toast--success { border-left: 3px solid var(--success); }
.toast--error   { border-left: 3px solid var(--danger); }
.toast--info    { border-left: 3px solid var(--info); }
.toast { display: flex; align-items: center; gap: var(--space-3); }
.toast__action {
  margin-left: auto;
  color: var(--brand);
  font-weight: 600;
  font-size: var(--fs-sm);
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}
.toast__action:hover { color: var(--brand-hover); }
@keyframes slideIn { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* --- Spinner --- */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--surface-3);
  border-top-color: var(--brand);
  border-radius: 999px;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Avatar --- */
.avatar {
  width: 32px; height: 32px;
  border-radius: 999px;
  background: var(--surface-3);
  display: grid; place-items: center;
  font-size: var(--fs-sm); font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
  text-transform: uppercase;
}
.avatar--lg { width: 40px; height: 40px; font-size: var(--fs-base); }
.avatar--brand { background: var(--brand); color: #fff; }

/* --- Divider --- */
.divider { height: 1px; background: var(--border); border: 0; margin: var(--space-3) 0; }

/* --- Kanban --- */
.kanban {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: var(--space-2);
  padding-bottom: var(--space-3);
  margin-left: calc(-1 * var(--space-4));
  margin-right: calc(-1 * var(--space-4));
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}
.kanban__col {
  flex: 0 0 86vw;
  max-width: 320px;
  min-width: 260px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
  overflow: hidden;
}
@media (min-width: 900px) {
  .kanban {
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
  }
  .kanban__col { flex: 1 1 0; min-width: 240px; max-width: none; }
}
.kanban__col-head {
  display: flex; align-items: center; gap: var(--space-2);
  padding: 14px var(--space-4);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: var(--surface);
  z-index: 2;
}
.kanban__col-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
}
.kanban__col-count {
  font-size: var(--fs-xs);
  background: var(--surface-2);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.kanban__col-body {
  display: flex; flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
}
.kanban__col-empty {
  text-align: center;
  color: var(--text-dim);
  font-size: var(--fs-sm);
  padding: var(--space-5) var(--space-3);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* --- Lead card --- */
.lead-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex; flex-direction: column; gap: 6px;
  cursor: pointer;
  position: relative;
  transition: transform var(--t-fast) ease, border-color var(--t-fast) ease, background var(--t-fast) ease;
  -webkit-tap-highlight-color: transparent;
}
.lead-card:hover {
  background: var(--surface-3);
  border-color: var(--border-strong);
}
.lead-card:active { transform: translateY(1px); }

.lead-card--red {
  border-color: var(--prio-red);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.10), var(--surface-2) 70%);
}
.lead-card--red:hover {
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.15), var(--surface-3) 70%);
}
.lead-card--yellow {
  border-color: rgba(234, 179, 8, 0.55);
}
.lead-card--green {
  border-color: rgba(34, 197, 94, 0.35);
}

.lead-card__head {
  display: flex; align-items: center; gap: var(--space-2);
}
.lead-card__name {
  font-weight: 600;
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lead-card__service {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lead-card__meta {
  display: flex; align-items: center; gap: var(--space-2);
  font-size: var(--fs-xs);
  color: var(--text-dim);
  margin-top: 2px;
}
.lead-card__meta .badge { font-size: 11px; padding: 2px 7px; }

/* Priority dot, larger + tappable on cards */
.prio-btn {
  width: 28px; height: 28px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  cursor: pointer;
  transition: transform var(--t-fast) ease, background var(--t-fast) ease;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.prio-btn:hover { background: var(--surface); }
.prio-btn:active { transform: scale(0.92); }
.prio-btn[data-prio="red"] {
  background: var(--prio-red);
  border-color: var(--prio-red);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.18), 0 0 14px rgba(239, 68, 68, 0.4);
}
.prio-btn[data-prio="yellow"] {
  background: var(--prio-yellow);
  border-color: var(--prio-yellow);
}
.prio-btn[data-prio="green"] {
  background: var(--prio-green);
  border-color: var(--prio-green);
}

/* --- Filter bar --- */
.filter-bar {
  display: flex; align-items: center; gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}
.filter-bar .input { max-width: 260px; min-width: 180px; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--t-fast) ease, color var(--t-fast) ease, border-color var(--t-fast) ease;
}
.filter-chip:hover {
  background: var(--surface-3);
  color: var(--text);
}
.filter-chip.is-active {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: var(--brand);
}
.filter-chip .prio-dot {
  width: 8px; height: 8px;
}

/* --- Drawer (slide-in panel) --- */
.drawer-root {
  position: fixed; inset: 0;
  z-index: 60;
  pointer-events: none;
}
.drawer-root.is-open { pointer-events: auto; }
.drawer-root__backdrop {
  position: absolute; inset: 0;
  background: var(--overlay);
  opacity: 0;
  transition: opacity var(--t-base) ease;
}
.drawer-root.is-open .drawer-root__backdrop { opacity: 1; }
.drawer {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--t-base) ease;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}
.drawer-root.is-open .drawer { transform: translateX(0); }
.drawer--wide { max-width: 640px; }
.drawer--xl   { max-width: 760px; }
.drawer__head {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
}
.drawer__title {
  font-size: var(--fs-lg);
  font-weight: 600;
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.drawer__close {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  color: var(--text-muted);
}
.drawer__close:hover { background: var(--surface-2); color: var(--text); }
.drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
  display: flex; flex-direction: column;
  gap: var(--space-4);
}
.drawer__footer {
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; align-items: center;
  gap: var(--space-2); row-gap: var(--space-2);
  background: var(--surface);
}
.drawer__footer .spacer { flex: 1; }
/* Lead drawer footer: substantial secondary actions (~44px tap target) */
.drawer__footer .btn--sm {
  padding: 10px 14px; gap: 6px;
  min-height: 44px; font-size: var(--fs-base);
}
.drawer__footer .btn--icon {
  min-height: 44px; min-width: 44px;
  padding: 10px;
}

/* Priority pill row (radio-style) */
.prio-radio {
  display: flex; gap: var(--space-2);
}
.prio-radio__option {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: var(--fs-sm);
  transition: background var(--t-fast) ease, border-color var(--t-fast) ease;
}
.prio-radio__option:hover { background: var(--surface-3); }
.prio-radio__option[data-prio="red"].is-selected {
  background: var(--danger-soft);
  border-color: var(--prio-red);
  color: var(--prio-red);
}
.prio-radio__option[data-prio="yellow"].is-selected {
  background: var(--warning-soft);
  border-color: var(--prio-yellow);
  color: var(--prio-yellow);
}
.prio-radio__option[data-prio="green"].is-selected {
  background: var(--success-soft);
  border-color: var(--prio-green);
  color: var(--prio-green);
}

/* --- List row (clients, anything tabular-ish) --- */
.list-stack {
  display: flex; flex-direction: column;
  gap: var(--space-2);
}
.list-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-3);
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--t-fast) ease, border-color var(--t-fast) ease;
  -webkit-tap-highlight-color: transparent;
}
.list-row:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}
.list-row__meta {
  display: flex; flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.list-row__title {
  display: flex; align-items: center; gap: var(--space-2);
  flex-wrap: wrap;
}
.list-row__name { font-weight: 600; font-size: var(--fs-md); }
.list-row__sub {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.list-row__sub2 {
  font-size: var(--fs-xs);
  color: var(--text-dim);
  display: flex; align-items: center; gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: 4px;
}
.list-row__right {
  display: flex; flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
@media (max-width: 600px) {
  .list-row {
    grid-template-columns: auto 1fr;
  }
  .list-row__right {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: flex-end;
  }
}

/* --- Line items (quote drawer) --- */
.line-items {
  display: flex; flex-direction: column;
  gap: var(--space-2);
}
.line-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3);
  display: grid;
  gap: var(--space-2);
  grid-template-columns: 1fr;
}
.line-item__row {
  display: grid;
  grid-template-columns: 1fr 90px 110px 36px;
  gap: var(--space-2);
  align-items: end;
}
.line-item__remove {
  width: 36px; height: 40px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  display: grid; place-items: center;
  align-self: end;
  border: 1px solid transparent;
}
.line-item__remove:hover { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.line-item__total {
  text-align: right;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-top: 4px;
}
@media (max-width: 520px) {
  .line-item__row { grid-template-columns: 1fr 1fr; }
  .line-item__row .field:first-child { grid-column: 1 / -1; }
  .line-item__remove { grid-column: 2; justify-self: end; }
}

/* --- Totals card (sticky-ish bottom of drawer body) --- */
.totals {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: var(--space-4);
  display: flex; flex-direction: column;
  gap: 6px;
}
.totals__row {
  display: flex; justify-content: space-between;
  font-variant-numeric: tabular-nums;
}
.totals__row--total {
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 4px;
  font-weight: 600;
  font-size: var(--fs-md);
}
.totals__label { color: var(--text-muted); }
.totals__value { color: var(--text); }

/* --- Quote preview (printable look on dark theme) --- */
.preview {
  background: #FAFAF7;
  color: #111827;
  border-radius: var(--radius);
  padding: var(--space-6);
  font-size: 13px;
  line-height: 1.45;
  box-shadow: var(--shadow);
}
.preview__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--space-4);
  border-bottom: 2px solid #111827;
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-4);
}
.preview__brand {
  display: flex; align-items: center; gap: var(--space-3);
}
.preview__brand img { width: 36px; height: 36px; color: #111827; }
.preview__brand-text strong { font-size: 16px; letter-spacing: 0.06em; }
.preview__brand-text small  { color: #6B7280; font-size: 11px; display: block; }
.preview__doc-meta { text-align: right; font-size: 12px; }
.preview__doc-meta strong { font-size: 18px; letter-spacing: 0.04em; display: block; }
.preview__doc-meta div { color: #6B7280; }
.preview__parties {
  display: grid; gap: var(--space-4);
  grid-template-columns: 1fr 1fr;
  margin-bottom: var(--space-4);
}
.preview__party-label {
  font-size: 11px; text-transform: uppercase; color: #6B7280;
  letter-spacing: 0.08em; margin-bottom: 4px;
}
.preview__title {
  font-size: 17px; font-weight: 600;
  margin-bottom: var(--space-3);
}
.preview__table {
  width: 100%; border-collapse: collapse;
  margin-bottom: var(--space-3);
}
.preview__table th,
.preview__table td {
  text-align: left; padding: 8px 6px;
  border-bottom: 1px solid #E5E7EB;
  font-variant-numeric: tabular-nums;
}
.preview__table th {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em;
  color: #6B7280;
}
.preview__table td.num,
.preview__table th.num { text-align: right; white-space: nowrap; }
.preview__totals {
  margin-left: auto;
  width: 260px;
  display: flex; flex-direction: column; gap: 4px;
}
.preview__totals .totals__row { color: #111827; }
.preview__totals .totals__row--total { border-top-color: #111827; }
.preview__footer {
  margin-top: var(--space-5);
  border-top: 1px solid #E5E7EB;
  padding-top: var(--space-3);
  font-size: 11px; color: #6B7280;
}
@media (max-width: 600px) {
  .preview__parties { grid-template-columns: 1fr; }
  .preview__totals { width: 100%; }
}

/* --- Status pills (quote-specific colors) --- */
.qstatus--brouillon { background: var(--surface-3); color: var(--text-muted); border: 1px solid var(--border); }
.qstatus--envoyee   { background: var(--info-soft);    color: var(--info); }
.qstatus--acceptee  { background: var(--success-soft); color: var(--success); }
.qstatus--refusee   { background: var(--danger-soft);  color: var(--danger); }
.qstatus--expiree   { background: var(--warning-soft); color: var(--warning); }

/* Quote list row tweaks (number + amount) */
.list-row__number {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}
.list-row__amount {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: var(--fs-md);
}

/* --- Service-specific row tweaks --- */
.service-thumb {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  display: grid; place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}
.service-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.service-thumb__placeholder {
  color: var(--text-dim);
}
.list-row__right .unit-chip {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

/* --- Image upload preview (services drawer) --- */
.image-upload {
  display: flex; align-items: flex-start; gap: var(--space-3);
  padding: var(--space-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.image-upload__preview {
  width: 96px; height: 96px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  overflow: hidden;
  display: grid; place-items: center;
  color: var(--text-dim);
  flex-shrink: 0;
}
.image-upload__preview img { width: 100%; height: 100%; object-fit: cover; }
.image-upload__meta {
  flex: 1;
  display: flex; flex-direction: column; gap: 6px;
  min-width: 0;
}
.image-upload__name {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.image-upload__actions {
  display: flex; gap: var(--space-2);
}
.file-trigger {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.file-trigger input[type="file"] {
  position: absolute; inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* --- Week calendar grid (agenda) --- */
.cal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.cal__nav {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
}
.cal__nav-title {
  font-weight: 600;
  font-size: var(--fs-md);
  flex: 1; min-width: 0;
}
.cal__nav-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.cal__nav-btn:hover { background: var(--surface-3); color: var(--text); }

.cal__head {
  display: grid;
  grid-template-columns: 48px repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0; z-index: 2;
}
.cal__head-cell {
  padding: 10px 6px;
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  border-left: 1px solid var(--border);
}
.cal__head-cell:first-child { border-left: 0; }
.cal__head-cell strong {
  display: block;
  font-size: var(--fs-md);
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.cal__head-cell.is-today strong { color: var(--brand); }
.cal__head-cell.is-today { background: var(--brand-soft); }

.cal__grid {
  display: grid;
  grid-template-columns: 48px repeat(7, minmax(0, 1fr));
  position: relative;
  background: var(--surface);
}
.cal__axis {
  border-right: 1px solid var(--border);
  position: relative;
}
.cal__axis-label {
  position: absolute;
  right: 6px;
  font-size: 10px;
  color: var(--text-dim);
  transform: translateY(-50%);
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}
.cal__col {
  position: relative;
  border-left: 1px solid var(--border);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 47px,
    var(--border) 47px,
    var(--border) 48px
  );
}
.cal__col.is-today { background-color: rgba(220, 38, 38, 0.03); }

.cal-event {
  position: absolute;
  left: 4px; right: 4px;
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 11px;
  line-height: 1.2;
  background: var(--surface-3);
  border-left: 3px solid var(--brand);
  cursor: pointer;
  overflow: hidden;
  display: flex; flex-direction: column;
  gap: 1px;
  -webkit-tap-highlight-color: transparent;
  transition: filter var(--t-fast) ease, transform var(--t-fast) ease;
}
.cal-event:hover  { filter: brightness(1.15); }
.cal-event:active { transform: translateY(1px); }
.cal-event__time { color: var(--text-dim); font-variant-numeric: tabular-nums; font-size: 10px; }
.cal-event__title { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-event__sub   { color: var(--text-muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-event--continues::after {
  content: '⤓';
  position: absolute;
  right: 4px; bottom: 2px;
  color: var(--text-dim);
  font-size: 10px;
}
.cal-event--continued::before {
  content: '⤒';
  position: absolute;
  right: 4px; top: 2px;
  color: var(--text-dim);
  font-size: 10px;
}

/* "Now" indicator (only when current week is in view + within working hours) */
.cal__now {
  position: absolute;
  left: 48px; right: 0;
  height: 1px;
  background: var(--brand);
  z-index: 1;
  pointer-events: none;
}
.cal__now::before {
  content: '';
  position: absolute;
  left: -4px; top: -4px;
  width: 9px; height: 9px;
  background: var(--brand);
  border-radius: 999px;
}

/* Mobile: horizontal scroll the day columns (1 col always visible) */
@media (max-width: 700px) {
  .cal__head, .cal__grid {
    grid-template-columns: 40px repeat(7, 78vw);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }
  .cal__head { -webkit-overflow-scrolling: touch; }
  .cal__head-cell { scroll-snap-align: start; }
  .cal__col { scroll-snap-align: start; }
}

/* --- Tab radios (Client vs Lead picker in new quote drawer) --- */
.tab-radio {
  display: flex; gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.tab-radio__option {
  flex: 1;
  padding: 8px 12px;
  text-align: center;
  border-radius: 6px;
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: background var(--t-fast) ease, color var(--t-fast) ease;
  color: var(--text-muted);
}
.tab-radio__option:hover { color: var(--text); }
.tab-radio__option.is-selected {
  background: var(--brand);
  color: #fff;
}

/* --- Page header --- */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}
.page-header__title {
  display: flex; flex-direction: column; gap: 2px;
}
.page-header__title h1 { font-size: var(--fs-2xl); }
.page-header__title p  { color: var(--text-muted); font-size: var(--fs-sm); }
.page-header__actions { display: flex; gap: var(--space-2); }
