/* ============================================================
   ShopFlow v2 styles  ·  Fullbay-inspired UI
   ============================================================ */

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

:root {
  --bg:           #f3f5f7;
  --card:         #ffffff;
  --ink:          #1c2733;
  --ink-soft:     #5a6b7a;
  --line:         #dde3ea;
  --accent:       #0d6efd;
  --accent-dark:  #084298;
  --ok:           #1f8a3d;
  --warn:         #b85c00;
  --err:          #b8232f;
  --pill-bg:      #eef2f6;

  /* state colors */
  --s-assign:    #6b7785;
  --s-diagnose:  #2563eb;
  --s-authorize: #b45309;
  --s-repair:    #d97706;
  --s-invoice:   #1f8a3d;
  --p-quote:     #6b7785;
  --p-order:     #2563eb;
  --p-receive:   #1f8a3d;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
}

/* ---------- TOP BAR ---------- */
.topbar {
  display: flex; align-items: center;
  background: #0c1726; color: #fff;
  padding: 0 16px; height: 52px;
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid #0a1320;
}
.brand { display: flex; align-items: center; gap: 8px; }
.logo-img {
  width: 36px; height: 36px;
  background: #fff; border-radius: 6px;
  padding: 3px; box-sizing: border-box;
}
.brand-name { font-weight: 800; font-size: 17px; letter-spacing: -0.3px; }
.brand-version { font-size: 11px; color: #8aa0bb; font-weight: 500; }
.topbar-search { flex: 1; padding: 0 32px; }
.topbar-search input {
  width: 100%; max-width: 480px;
  padding: 7px 12px; border-radius: 6px; border: 0;
  background: #1d2c3d; color: #fff; font-size: 13px;
}
.topbar-search input::placeholder { color: #6c8198; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.user-chip {
  font-size: 12px; padding: 4px 10px;
  background: #1d2c3d; border-radius: 12px;
}
.lang-chip {
  font-size: 12px; padding: 4px 8px;
  background: #1d2c3d; border-radius: 12px; cursor: pointer;
}
.topbar-location {
  font-size: 12px; padding: 4px 10px;
  background: #1d2c3d; border-radius: 12px; color: #fff;
  margin-left: 10px; cursor: pointer;
}
.topbar-clock {
  display: flex; align-items: center; gap: 8px;
  margin-left: 12px;
  font-size: 12px; color: #cfdbe8;
}
.clock-state { font-variant-numeric: tabular-nums; min-width: 90px; }
.clock-state.on { color: #4caf50; font-weight: 600; }
.clock-btn {
  padding: 5px 12px; border: 0; border-radius: 4px;
  background: #2e7d32; color: #fff; font-size: 11px; font-weight: 600;
  cursor: pointer;
}
.clock-btn.out { background: #b8232f; }
.clock-btn:hover { opacity: .9; }
.topbar-icon {
  background: transparent; border: 0; color: #fff;
  font-size: 18px; cursor: pointer; padding: 0 6px;
  position: relative;
}
.bell-badge {
  position: absolute; top: -3px; right: -3px;
  background: var(--err); color: #fff;
  font-size: 10px; font-weight: 700;
  border-radius: 8px; padding: 1px 5px; min-width: 14px;
  text-align: center;
}
.search-results {
  position: absolute; top: 38px; left: 0; right: 0; max-width: 480px;
  background: #fff; color: var(--ink); border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,.2); max-height: 60vh; overflow-y: auto;
  z-index: 60;
}
.search-result {
  padding: 8px 12px; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--line); font-size: 13px;
}
.search-result:hover { background: #f8fafc; }
.search-result-type {
  background: var(--pill-bg); padding: 1px 6px; border-radius: 8px;
  font-size: 10px; text-transform: uppercase; color: var(--ink-soft); font-weight: 600;
  min-width: 60px; text-align: center;
}
.search-result-sub { color: var(--ink-soft); font-size: 11px; margin-left: 8px; }
.topbar-search { position: relative; }

/* notification drawer */
.notif-drawer {
  position: fixed; top: 52px; right: 0; width: 380px; bottom: 0;
  background: #fff; border-left: 1px solid var(--line);
  box-shadow: -4px 0 16px rgba(0,0,0,.1); z-index: 80;
  display: flex; flex-direction: column;
}
.notif-drawer.hidden { display: none; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.notif-body { flex: 1; overflow-y: auto; padding: 8px; }
.notif-item {
  padding: 10px 12px; border-bottom: 1px solid var(--line);
  display: flex; gap: 10px; cursor: pointer;
}
.notif-item:hover { background: #f8fafc; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.notif-dot.critical { background: var(--err); }
.notif-dot.warning  { background: var(--warn); }
.notif-dot.info     { background: var(--accent); }
.notif-content { flex: 1; }
.notif-title    { font-weight: 600; font-size: 13px; }
.notif-detail   { color: var(--ink-soft); font-size: 12px; margin-top: 2px; }
.notif-dismiss  { background: transparent; border: 0; color: var(--ink-soft); cursor: pointer; font-size: 16px; padding: 0 4px; }

/* Bay status grid */
.bay-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.bay-card {
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 12px; position: relative; min-height: 110px;
}
.bay-card.in_progress  { background: linear-gradient(180deg, #d1fae5 0%, #fff 80%); }
.bay-card.maintenance  { background: linear-gradient(180deg, #fef3c7 0%, #fff 80%); }
.bay-card.available    { background: #f8fafc; border-style: dashed; }
.bay-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.bay-card-name { font-weight: 700; font-size: 14px; }
.bay-card-dot { width: 8px; height: 8px; border-radius: 50%; }
.bay-card-dot.in_progress { background: #16a34a; }
.bay-card-dot.maintenance { background: #d97706; }
.bay-card-dot.available   { background: #94a3b8; }
.bay-card-so { font-weight: 600; color: var(--accent); font-size: 13px; }
.bay-card-detail { font-size: 11px; color: var(--ink-soft); margin-top: 2px; }
.bay-card-eta {
  position: absolute; bottom: 8px; right: 10px;
  font-size: 10px; color: var(--ink-soft);
}

/* ---------- SCHEDULING calendar ---------- */
.sched-toolbar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
}
.sched-nav { display: flex; align-items: center; gap: 4px; }
.sched-nav button {
  background: #fff; border: 1px solid var(--line); padding: 6px 10px;
  border-radius: 4px; cursor: pointer; font-size: 13px;
}
.sched-nav button:hover { background: var(--pill-bg); }
.sched-current { font-weight: 600; font-size: 15px; padding: 0 12px; }
.sched-view-toggle { display: flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.sched-view-toggle button {
  background: #fff; border: 0; padding: 6px 14px; cursor: pointer; font-size: 13px; color: var(--ink);
}
.sched-view-toggle button.active { background: var(--accent); color: #fff; }

.capacity-bar {
  background: var(--pill-bg); border-radius: 4px;
  height: 22px; position: relative; margin: 8px 0;
}
.capacity-bar-fill {
  height: 100%; background: linear-gradient(90deg, #16a34a 0%, #facc15 60%, #d97706 80%, var(--err) 95%);
  border-radius: 4px;
}
.capacity-bar-label {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: var(--ink);
}

/* day view: techs × hourly columns */
.day-grid {
  display: grid;
  grid-template-columns: 130px repeat(12, minmax(54px, 1fr));
  gap: 1px; background: var(--line);
  border: 1px solid var(--line);
  border-radius: 6px; overflow: hidden;
  font-size: 11px;
}
.day-grid .hdr {
  background: #f8fafc; padding: 6px 6px; text-align: center;
  color: var(--ink-soft); font-weight: 600;
}
.day-grid .row-label {
  background: #fff; padding: 8px 10px; font-weight: 600; color: var(--ink);
  font-size: 12px;
}
.day-grid .cell {
  background: #fff; min-height: 38px; position: relative;
}
.day-grid .cell.now { background: linear-gradient(90deg, transparent 50%, rgba(13,110,253,.08) 50%); }

.shift-bar {
  position: absolute; inset: 2px;
  border-radius: 3px;
  color: #fff; font-size: 10px; font-weight: 600;
  padding: 2px 4px; overflow: hidden; white-space: nowrap;
  display: flex; align-items: center;
}
.shift-bar.regular  { background: #16a34a; }
.shift-bar.overtime { background: #d97706; }
.shift-bar.pto      { background: #fbbf24; color: #78350f; }
.shift-bar.sick     { background: #b8232f; }
.shift-bar.training { background: #2563eb; }
.shift-bar.on_call  { background: #94a3b8; }

.appt-dot {
  position: absolute; bottom: 2px; right: 2px;
  width: 8px; height: 8px; border-radius: 50%; z-index: 5;
}
.appt-dot.drop_off    { background: #2563eb; }
.appt-dot.pickup      { background: #16a34a; }
.appt-dot.mobile_call { background: #d97706; }
.appt-dot.inspection  { background: #facc15; }
.appt-dot.consultation { background: #94a3b8; }

/* week view: techs × 7-day columns */
.week-grid {
  display: grid;
  grid-template-columns: 140px repeat(7, 1fr);
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
  font-size: 12px;
}
.week-grid .hdr {
  background: #f8fafc; padding: 8px; text-align: center;
  font-weight: 600; font-size: 11px; color: var(--ink-soft);
}
.week-grid .hdr.today { background: #dbeafe; color: #1e40af; }
.week-grid .row-label { background: #fff; padding: 10px 12px; font-weight: 600; }
.week-grid .day-cell {
  background: #fff; padding: 4px; min-height: 56px;
  display: flex; flex-direction: column; gap: 3px;
}
.week-pill {
  font-size: 10px; padding: 2px 5px; border-radius: 3px;
  color: #fff; font-weight: 600; text-align: center;
}
.week-pill.regular  { background: #16a34a; }
.week-pill.overtime { background: #d97706; }
.week-pill.pto      { background: #fbbf24; color: #78350f; }
.week-pill.sick     { background: #b8232f; }
.week-pill.training { background: #2563eb; }

.legend { display: flex; gap: 12px; font-size: 11px; margin-top: 8px; color: var(--ink-soft); }
.legend-item { display: flex; align-items: center; gap: 4px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }

/* expense report modal */
.er-line {
  background: #f8fafc; border: 1px solid var(--line); border-radius: 8px;
  padding: 12px; margin-bottom: 10px;
  display: grid; grid-template-columns: 120px 1fr; gap: 12px;
}
.er-photo {
  width: 110px; height: 110px;
  background: #fff; border: 2px dashed var(--line); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative; overflow: hidden;
  color: var(--ink-soft); font-size: 11px; text-align: center;
}
.er-photo:hover { border-color: var(--accent); background: #f0f7ff; }
.er-photo.has-image { border-style: solid; padding: 0; }
.er-photo img { width: 100%; height: 100%; object-fit: cover; }
.er-photo input[type=file] { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.er-photo-icon { font-size: 28px; margin-bottom: 4px; }
.er-fields { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.er-fields label { font-size: 11px; color: var(--ink-soft); display: block; }
.er-fields input, .er-fields select { width: 100%; padding: 6px 8px; font-size: 13px; border: 1px solid var(--line); border-radius: 4px; margin-top: 2px; }
.er-fields .er-desc { grid-column: 1 / -1; }
.er-line-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 6px; }
.er-line-actions button { font-size: 11px; padding: 4px 10px; }
.ai-fill {
  background: linear-gradient(90deg, #7c3aed 0%, #2563eb 100%);
  color: #fff; font-weight: 600;
  border: 0; border-radius: 4px; padding: 5px 10px; cursor: pointer;
  font-size: 11px;
}
.ai-fill:hover { opacity: .9; }
.ai-fill:disabled { background: #94a3b8; cursor: wait; }
.ai-badge {
  display: inline-block; font-size: 9px; font-weight: 700; padding: 1px 5px;
  background: linear-gradient(90deg, #7c3aed 0%, #2563eb 100%); color: #fff;
  border-radius: 6px; margin-left: 6px; vertical-align: middle;
}
.ai-conf {
  display: inline-block; font-size: 10px; margin-left: 6px; color: var(--ok); font-weight: 600;
}

/* tech-on-clock list */
.toc-list { display: flex; flex-direction: column; gap: 4px; }
.toc-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 0; border-bottom: 1px dashed var(--line);
  font-size: 13px;
}
.toc-row:last-child { border-bottom: 0; }
.toc-dot { width: 8px; height: 8px; background: #16a34a; border-radius: 50%; display: inline-block; margin-right: 6px; }

/* ---------- LAYOUT ---------- */
.layout { display: flex; min-height: calc(100vh - 52px); }

/* ---------- SIDEBAR ---------- */
.sidebar {
  width: 220px; background: #142235; color: #d4dde7;
  padding: 12px 0; display: flex; flex-direction: column;
}
.sidebar nav { flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; color: #d4dde7;
  text-decoration: none; font-size: 13px;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: #1d2e44; }
.nav-item.active { background: #1d2e44; border-left-color: var(--accent); color: #fff; }
.nav-icon { width: 18px; text-align: center; }
.nav-badge {
  margin-left: auto; background: #2c4361;
  padding: 1px 8px; border-radius: 10px; font-size: 11px;
}
.sidebar-foot { padding: 12px 16px; font-size: 11px; color: #6c8198; }
.conn-ok { color: #4caf50; }
.conn-err { color: #ef5350; }

/* ---------- MAIN ---------- */
.main { flex: 1; padding: 18px 24px; overflow-x: auto; }
.loader { padding: 40px; text-align: center; color: var(--ink-soft); }

/* ---------- BUTTONS ---------- */
.btn-primary, .btn-ghost, .btn-danger {
  cursor: pointer; border: 0; padding: 7px 14px;
  border-radius: 5px; font-size: 13px; font-weight: 500;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost   { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--pill-bg); }
.btn-danger  { background: var(--err); color: #fff; }

/* ---------- CARDS ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-head h2 { font-size: 16px; }
.muted { color: var(--ink-soft); font-size: 12px; }

/* KPI strip */
.kpi-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.kpi-label { font-size: 11px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; }
.kpi-value { font-size: 22px; font-weight: 700; margin-top: 4px; }

/* ---------- TABLES ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); }
th { background: #f8fafc; font-weight: 600; color: var(--ink-soft); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
tr:hover td { background: #fbfcfd; }
.so-link, .cust-link { color: var(--accent); cursor: pointer; }
.so-link:hover, .cust-link:hover { text-decoration: underline; }

/* SO list groups */
.group-hdr {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0 6px; border-bottom: 2px solid var(--line);
  margin: 12px 0 4px; font-weight: 600; font-size: 13px;
}
.group-count { background: var(--pill-bg); padding: 1px 8px; border-radius: 10px; font-size: 11px; color: var(--ink-soft); }

/* ---------- STATUS PILLS ---------- */
.pill {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 600;
  background: var(--pill-bg); color: var(--ink);
}
.pill.s-assign    { background: #e2e6eb; color: #3a4654; }
.pill.s-diagnose  { background: #dbeafe; color: #1e40af; }
.pill.s-authorize { background: #fed7aa; color: #7c2d12; }
.pill.s-repair    { background: #fde68a; color: #78350f; }
.pill.s-invoice   { background: #bbf7d0; color: #14532d; }
.pill.p-quote     { background: #e2e6eb; color: #3a4654; }
.pill.p-order     { background: #dbeafe; color: #1e40af; }
.pill.p-receive   { background: #bbf7d0; color: #14532d; }

/* ---------- TABS ---------- */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tab {
  padding: 10px 18px; cursor: pointer; font-size: 13px; font-weight: 500;
  color: var(--ink-soft); border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- SO DETAIL HEADER ---------- */
.so-header { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.so-header-cell { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; }
.so-header-cell .lbl { font-size: 11px; color: var(--ink-soft); text-transform: uppercase; }
.so-header-cell .val { font-size: 14px; margin-top: 2px; }

/* ---------- DUAL-TRACK PIPELINE ---------- */
.pipeline { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-bottom: 14px; }
.pipeline-row { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.pipeline-label { width: 70px; font-size: 11px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; }
.pipeline-stages { flex: 1; display: flex; align-items: center; gap: 4px; }
.stage {
  flex: 1; padding: 7px 10px; text-align: center; font-size: 11px; font-weight: 600;
  background: #f0f3f6; color: var(--ink-soft); border: 1px solid transparent;
  position: relative; cursor: pointer; user-select: none;
}
.stage.done       { background: #bbf7d0; color: #14532d; }
.stage.current    { background: #fed7aa; color: #7c2d12; border-color: #fb923c; }
.stage.locked     { opacity: .45; cursor: not-allowed; }
.stage:not(:last-child)::after {
  content: "›"; position: absolute; right: -7px; top: 50%;
  transform: translateY(-50%); color: var(--ink-soft); font-weight: 400; font-size: 14px;
  z-index: 2;
}
.pipeline-advance {
  background: var(--accent); color: #fff; padding: 5px 12px;
  border: 0; border-radius: 4px; cursor: pointer; font-size: 11px; font-weight: 600;
}
.pipeline-advance:disabled { background: #94a3b8; cursor: not-allowed; }
.pipeline-back {
  background: #fff; color: var(--ink-soft); padding: 5px 10px; margin-right: 6px;
  border: 1px solid var(--line); border-radius: 4px; cursor: pointer; font-size: 11px; font-weight: 600;
}
.pipeline-back:hover { background: #f1f5f9; color: var(--ink); border-color: #cbd5e1; }
.pipeline-back:disabled { opacity: .5; cursor: not-allowed; }
/* clickable stage cells — jump straight to a state by clicking it */
.stage.clickable { cursor: pointer; }
.stage.clickable:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
.stage.locked.clickable { cursor: not-allowed; }
.stage.locked.clickable:hover { outline: 2px solid #f59e0b; }
/* clickable employee picker modal */
.emp-pick-list { display: flex; flex-direction: column; gap: 6px; }
.emp-pick-row {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; text-align: left; padding: 10px 14px; cursor: pointer;
  background: #fff; border: 1px solid var(--line); border-radius: 6px; font-size: 14px;
}
.emp-pick-row:hover { background: #eff6ff; border-color: var(--accent); }
.emp-pick-name { font-weight: 600; color: var(--ink); }
/* clickable scheduling grid cells */
.day-grid .cell.clickable-cell { cursor: pointer; }
.day-grid .cell.clickable-cell:hover { background: #eff6ff; box-shadow: inset 0 0 0 2px var(--accent); }
/* clickable dashboard KPI cards + bay cards */
.kpi-clickable { cursor: pointer; transition: box-shadow .12s, transform .12s; }
.kpi-clickable:hover { box-shadow: 0 2px 10px rgba(30,58,95,.15); transform: translateY(-1px); }
.bay-card-clickable { cursor: pointer; transition: box-shadow .12s, transform .12s; }
.bay-card-clickable:hover { box-shadow: 0 2px 10px rgba(30,58,95,.18); transform: translateY(-1px); }
/* clickable table rows */
tr.row-clickable { cursor: pointer; }
tr.row-clickable:hover { background: #eff6ff; }
tr.pd-row-sel { background: #dbeafe; }
tr.pd-row-sel:hover { background: #cfe3fb; }
.pd-part:hover { opacity: .85; }

/* ---------- ACTION ITEM CARD ---------- */
.ai-card {
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 14px 16px; margin-bottom: 12px;
}
.ai-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ai-seq { background: var(--ink); color: #fff; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; }
.ai-complaint { font-size: 15px; font-weight: 600; flex: 1; }
.ai-total { font-size: 14px; font-weight: 700; color: var(--ok); }
.ai-cause { font-size: 12px; color: var(--ink-soft); margin: 4px 0 10px; }
.ai-actions { display: flex; gap: 8px; margin-top: 10px; }

/* line items table inside action item */
.li-table { margin-top: 10px; font-size: 12px; }
.li-table input[type=number], .li-table input[type=text], .li-table select {
  padding: 4px 6px; font-size: 12px; border: 1px solid var(--line); border-radius: 3px;
  width: 100%;
}
.li-table .col-action { width: 60px; text-align: center; }
.li-row.dirty { background: #fffbeb; }

/* ---------- ESTIMATE TAB ---------- */
.estimate-header { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.addr-block { background: #f8fafc; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; }
.addr-block label { display: block; font-size: 11px; color: var(--ink-soft); text-transform: uppercase; margin-bottom: 4px; }
.addr-block select { width: 100%; padding: 5px; font-size: 12px; }
.addr-block .addr-detail { margin-top: 6px; font-size: 12px; line-height: 1.5; color: var(--ink); }

.estimate-totals {
  margin-top: 16px; margin-left: auto; max-width: 320px;
  background: #f8fafc; border: 1px solid var(--line); border-radius: 6px; padding: 12px 16px;
}
.estimate-totals .row { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; }
.estimate-totals .row.grand { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 6px; font-weight: 700; font-size: 15px; }

/* ---------- MODALS ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(12, 23, 38, 0.6);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal-backdrop.hidden { display: none; }
.modal { background: #fff; border-radius: 8px; min-width: 480px; max-width: 90vw; max-height: 88vh; overflow: auto; }
.modal-wide { min-width: 640px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 15px; }
.modal-close { background: transparent; border: 0; font-size: 24px; cursor: pointer; color: var(--ink-soft); line-height: 1; }
.modal-body { padding: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); }
.modal-body .row { display: flex; gap: 12px; margin-top: 12px; }
.modal-body .row label { flex: 1; display: block; font-size: 12px; color: var(--ink-soft); }
.modal-body input, .modal-body select, .modal-body textarea {
  display: block; width: 100%; padding: 6px 10px; margin-top: 4px;
  border: 1px solid var(--line); border-radius: 4px; font-size: 13px;
}

/* signature canvas */
#sig-canvas { display: block; border: 1px dashed var(--line); border-radius: 4px; background: #fff; cursor: crosshair; margin: 8px auto; }

/* wizard steps */
.wiz-steps { display: flex; padding: 10px 18px; background: #f8fafc; border-bottom: 1px solid var(--line); gap: 8px; }
.wiz-step { padding: 5px 12px; font-size: 12px; color: var(--ink-soft); border-radius: 12px; }
.wiz-step.active { background: var(--accent); color: #fff; font-weight: 600; }
.wiz-step.done   { background: #bbf7d0; color: #14532d; }

/* search list inside wizard */
.wiz-list { max-height: 280px; overflow-y: auto; border: 1px solid var(--line); border-radius: 4px; }
.wiz-list-item { padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13px; }
.wiz-list-item:hover { background: #f8fafc; }
.wiz-list-item.selected { background: #dbeafe; }

/* ---------- TOAST ---------- */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 200;
  padding: 12px 18px; background: #1c2733; color: #fff;
  border-radius: 6px; font-size: 13px; box-shadow: 0 4px 16px rgba(0,0,0,.2);
  max-width: 360px;
}
.toast.hidden { display: none; }
.toast.err  { background: var(--err); }
.toast.ok   { background: var(--ok); }
.toast.warn { background: var(--warn); }

/* ---------- UTILS ---------- */
.hidden { display: none !important; }
.flex { display: flex; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.flex-1 { flex: 1; }
.right { text-align: right; }
.tnum  { font-variant-numeric: tabular-nums; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
