:root {
  --blue-950: #082f49;
  --blue-900: #0c4a6e;
  --blue-800: #075985;
  --blue-700: #0369a1;
  --blue-100: #e0f2fe;
  --orange: #f97316;
  --ink: #172033;
  --muted: #64748b;
  --line: #dbe4ee;
  --surface: #ffffff;
  --canvas: #f1f6fa;
  --danger: #b42318;
  --success: #087443;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--canvas); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 80% 10%, #0ea5e9 0, #075985 35%, #082f49 100%); }
.auth-card { width: min(100%, 470px); padding: clamp(28px, 6vw, 48px); border-radius: 24px; background: #fff; box-shadow: 0 24px 70px rgba(2, 31, 51, .35); }
.brand-mark { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 15px; background: linear-gradient(135deg, var(--orange), #ef4444); color: #fff; font-size: 22px; font-weight: 900; }
.eyebrow { margin: 16px 0 4px; color: var(--blue-700); font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.eyebrow.light { color: #bae6fd; margin-top: 0; }
h1, h2, h3 { margin: 0; line-height: 1.08; }
.auth-card h1 { font-size: clamp(30px, 7vw, 42px); }
.muted { color: var(--muted); line-height: 1.55; }
.stack { display: grid; gap: 18px; margin-top: 28px; }
label { display: grid; gap: 7px; color: #334155; font-size: 14px; font-weight: 750; }
input, select, textarea { width: 100%; border: 1px solid #cbd5e1; border-radius: 11px; background: #fff; color: var(--ink); padding: 12px 14px; outline: none; transition: border-color .15s, box-shadow .15s; }
input, select { min-height: 48px; }
textarea { min-height: 105px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #0284c7; box-shadow: 0 0 0 3px rgba(14, 165, 233, .17); }
.button { min-height: 44px; border: 0; border-radius: 10px; padding: 10px 16px; font-weight: 800; }
.button.primary { min-height: 52px; background: var(--blue-800); color: #fff; }
.button.primary:hover { background: var(--blue-900); }
.button.secondary { background: var(--blue-100); color: var(--blue-900); }
.button.text { background: transparent; color: var(--blue-700); padding-inline: 4px; }
.button.outline-light { border: 1px solid rgba(255,255,255,.45); background: transparent; color: #fff; }
.button.danger { background: #fee4e2; color: var(--danger); }
.auth-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; }
.message { margin: 16px 0; border-radius: 10px; padding: 12px 14px; background: var(--blue-100); color: var(--blue-950); line-height: 1.45; }
.message.error { background: #fee4e2; color: var(--danger); }
.message.success { background: #dcfae6; color: var(--success); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.crm-sidebar { position: sticky; top: 0; z-index: 10; display: flex; height: 100vh; height: 100dvh; flex-direction: column; padding: 22px 16px 16px; background: linear-gradient(180deg, var(--blue-950), #061f31); color: #fff; box-shadow: 8px 0 28px rgba(8,47,73,.13); }
.sidebar-brand { display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 0 8px 22px; border-bottom: 1px solid rgba(255,255,255,.13); }
.sidebar-logo { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; font-size: 17px; }
.sidebar-brand-copy { display: grid; gap: 2px; min-width: 0; }
.sidebar-brand-copy strong { font-size: 18px; letter-spacing: -.02em; }
.sidebar-brand-copy span { color: #9ec7dc; font-size: 12px; font-weight: 700; }
.main-nav { display: grid; gap: 7px; margin-top: 22px; }
.nav-button, .sidebar-logout { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 48px; border: 0; border-radius: 11px; padding: 10px 12px; background: transparent; color: #c9e6f4; text-align: left; font-weight: 850; }
.nav-button:hover, .sidebar-logout:hover { background: rgba(255,255,255,.09); color: #fff; }
.nav-button.active { background: #fff; color: var(--blue-900); box-shadow: 0 7px 22px rgba(0,0,0,.18); }
.nav-icon { display: grid; flex: 0 0 26px; place-items: center; width: 26px; height: 26px; font-size: 20px; line-height: 1; }
.nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-bottom { display: grid; gap: 10px; margin-top: auto; }
.settings-nav-button { border: 1px solid rgba(255,255,255,.13); }
.account-box { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.13); }
.account-email { overflow: hidden; padding: 0 8px; color: #9ec7dc; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-logout { min-height: 42px; color: #9ec7dc; font-size: 13px; }
.app-main { min-width: 0; }
.topbar { min-height: 104px; display: flex; align-items: center; padding: 22px clamp(20px, 4vw, 54px); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); color: var(--ink); backdrop-filter: blur(12px); }
.topbar h1 { color: var(--blue-950); font-size: clamp(26px, 4vw, 38px); }
.topbar-title { min-width: 0; }
.topbar .eyebrow { margin-top: 0; }
.workspace { width: min(1500px, 100%); margin: 0 auto; padding: clamp(16px, 3vw, 34px); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { min-height: 126px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: inherit; text-align: left; box-shadow: 0 5px 20px rgba(15, 43, 63, .05); transition: transform .15s, border-color .15s, box-shadow .15s; }
.stat-card span { color: var(--muted); font-weight: 700; }
.stat-card strong { color: var(--blue-900); font-size: 36px; }
.stat-card small { color: var(--muted); font-size: 11px; font-weight: 750; }
.stat-card:hover { border-color: #7dd3fc; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15,43,63,.1); }
.stat-card.active { border-color: var(--blue-800); background: linear-gradient(145deg,var(--blue-800),var(--blue-900)); box-shadow: 0 10px 25px rgba(7,89,133,.23); }
.stat-card.active span, .stat-card.active strong, .stat-card.active small { color: #fff; }
.stat-card.warning { border-color: #fdba74; background: #fff7ed; }
.stat-card.warning strong { color: #c2410c; }
.stat-card.warning.active { border-color: #c2410c; background: linear-gradient(145deg,#ea580c,#c2410c); }
.stat-card.warning.active strong { color: #fff; }
.panel { border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 8px 28px rgba(15, 43, 63, .06); }
.lead-panel { padding: clamp(16px, 3vw, 28px); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.panel-heading .eyebrow { margin-top: 0; }
.panel-heading h2 { font-size: clamp(23px, 3vw, 32px); }
.filters { display: grid; grid-template-columns: minmax(260px,1.4fr) repeat(3,minmax(150px,.65fr)); align-items: end; gap: 12px; margin: 24px 0 12px; }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; color: var(--muted); font-size: 13px; font-weight: 800; }
.filter-buttons { display: flex; overflow-x: auto; gap: 8px; margin-bottom: 18px; padding: 2px 2px 7px; scrollbar-width: thin; }
.filter-button { flex: 0 0 auto; min-height: 40px; border: 1px solid #cbdbe4; border-radius: 999px; padding: 8px 14px; background: #fff; color: #526276; font-size: 13px; font-weight: 850; }
.filter-button:hover { border-color: #7dd3fc; color: var(--blue-900); }
.filter-button.active { border-color: var(--blue-800); background: var(--blue-800); color: #fff; box-shadow: 0 5px 14px rgba(7,89,133,.2); }
.lead-list { display: grid; gap: 10px; }
.lead-row { width: 100%; display: grid; grid-template-columns: minmax(210px, 1.2fr) minmax(170px, 1fr) minmax(145px, .75fr) minmax(150px, .7fr) auto; align-items: center; gap: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: inherit; text-align: left; }
.lead-row:hover { border-color: #7dd3fc; background: #f8fcff; transform: translateY(-1px); }
.lead-main strong { display: block; font-size: 17px; }
.lead-main span, .lead-cell span { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.lead-cell strong { display: block; font-size: 14px; }
.status-pill, .priority-pill { display: inline-flex; width: fit-content; align-items: center; border-radius: 999px; padding: 6px 10px; background: var(--blue-100); color: var(--blue-900); font-size: 12px; font-weight: 850; }
.status-pill.closed { background: #dcfae6; color: var(--success); }
.status-pill.cancelled { background: #f2f4f7; color: #475467; }
.status-pill.new { background: #fff1d6; color: #9a4d00; }
.priority-pill.urgent, .priority-pill.high { background: #fee4e2; color: var(--danger); }
.empty-state { padding: 50px 20px; text-align: center; color: var(--muted); }

.detail-page { width: min(1600px, 100%); }
.detail-header { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 18px; margin-bottom: 18px; }
.detail-header .eyebrow { margin-top: 0; }
.detail-heading-copy { min-width: 0; }
.detail-heading-copy h2 { color: var(--blue-950); font-size: clamp(26px,4vw,38px); }
.back-button { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; border: 1px solid #cbdbe4; border-radius: 11px; padding: 9px 14px; background: #fff; color: var(--blue-900); font-weight: 850; }
.back-button:hover { border-color: #7dd3fc; background: #f0f9ff; }
.detail-message { margin: 0 0 16px; }
.detail-content { display: grid; gap: 18px; }
.detail-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: clamp(18px,3vw,28px); border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(135deg,#fff,#eef8fd); box-shadow: 0 8px 28px rgba(15,43,63,.06); }
.detail-hero-main { display: grid; gap: 13px; min-width: 0; }
.detail-vehicle { margin: 0; color: var(--blue-950); font-size: clamp(21px,3vw,29px); font-weight: 900; }
.detail-contact-line { margin: 5px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.detail-badges, .detail-quick-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-quick-actions { flex: 0 0 auto; justify-content: flex-end; }
.quick-action { min-height: 44px; }
.telus-sms { border-color: #4b286d; background: #4b286d; color: #fff; }
.telus-sms:hover { border-color: #351c4d; background: #351c4d; }
.crm-tag { display: inline-flex; align-items: center; border-radius: 999px; padding: 6px 10px; background: #ede9fe; color: #6d28d9; font-size: 12px; font-weight: 850; }
.detail-tabs { position: sticky; top: 0; z-index: 5; display: flex; overflow-x: auto; gap: 6px; padding: 7px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.96); box-shadow: 0 6px 18px rgba(15,43,63,.07); backdrop-filter: blur(10px); scrollbar-width: thin; }
.detail-tab { flex: 0 0 auto; min-height: 44px; border: 0; border-radius: 9px; padding: 9px 14px; background: transparent; color: #526276; font-size: 13px; font-weight: 850; }
.detail-tab:hover { background: #f0f9ff; color: var(--blue-900); }
.detail-tab.active { background: var(--blue-800); color: #fff; box-shadow: 0 5px 14px rgba(7,89,133,.2); }
.detail-tab-panel { display: grid; gap: 18px; }
.two-column-detail, .activity-grid { grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; }
.detail-card { padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.detail-card h3 { margin-bottom: 16px; color: var(--blue-900); font-size: 19px; }
.detail-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.detail-card-heading h3 { margin-bottom: 0; }
.detail-card-heading .button { flex: 0 0 auto; }
.overview-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.overview-metrics .info-item { min-height: 104px; padding: 16px; border: 1px solid #cfe2ec; border-radius: 13px; background: #fff; }
.overview-metrics .info-item strong { color: var(--blue-950); font-size: 16px; }
.overview-info-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.info-item span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.info-item strong { display: block; margin-top: 4px; overflow-wrap: anywhere; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.button-row { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.photo-link { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; color: inherit; text-decoration: none; }
.photo-link img { width: 100%; aspect-ratio: 4/3; display: block; object-fit: cover; background: #e2e8f0; }
.photo-link span { display: block; padding: 8px; font-size: 12px; font-weight: 750; }
.photo-link:hover { border-color: #38bdf8; box-shadow: 0 7px 18px rgba(7,89,133,.12); }
.editable-info-item { display: grid; align-content: start; gap: 6px; }
.editable-info-item input { min-height: 42px; margin-top: 2px; border-color: #9cc9dc; background: #f8fcfe; font-weight: 800; }
.editable-info-item small { color: var(--muted); font-size: 11px; }
.identifier-info-item small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
.vehicle-identification-controls { grid-column: 1 / -1; display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; padding-top: 4px; }
.identification-messages { display: grid; gap: 7px; flex: 1 1 auto; }
.identification-status, .identification-warning, .identification-success { margin: 0; padding: 11px 13px; border-radius: 9px; font-size: 13px; font-weight: 750; }
.identification-status { background: #eff6ff; color: #1d4ed8; }
.identification-status.failed, .identification-warning { background: #fff7ed; color: #9a3412; }
.identification-status.disabled { background: #f1f5f9; color: #475569; }
.identification-success { background: #ecfdf5; color: #047857; }
.lead-details-form { display: grid; gap: 4px; }
.identification-actions { flex: 0 0 auto; margin-top: 0; }
.note-list { display: grid; gap: 10px; margin-top: 16px; }
.note { padding: 13px; border-left: 4px solid #38bdf8; border-radius: 8px; background: #f0f9ff; }
.note p { margin: 0 0 8px; white-space: pre-wrap; }
.note small { color: var(--muted); }
.timeline { display: grid; gap: 12px; }
.timeline-item { display: grid; grid-template-columns: 10px 1fr; gap: 10px; }
.timeline-dot { width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: #0ea5e9; }
.timeline-item p { margin: 0; }
.timeline-item small { color: var(--muted); }
.task-create-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.task-create-grid .wide { grid-column: 1 / -1; }
.task-list { display: grid; gap: 9px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.task-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #f8fbfd; }
.task-row.overdue { border-color: #fdba74; background: #fff7ed; }
.task-row.completed { opacity: .65; }
.task-row.completed .task-copy strong { text-decoration: line-through; }
.task-row input { width: 22px; min-height: 22px; margin: 0; accent-color: var(--success); }
.task-copy { display: grid; gap: 3px; min-width: 0; }
.task-copy strong { overflow-wrap: anywhere; }
.task-copy span { color: var(--muted); font-size: 12px; }
.file-list { display: grid; gap: 9px; }
.file-row { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #f8fbfd; color: inherit; text-decoration: none; }
.file-row:hover { border-color: #7dd3fc; background: #f0f9ff; }
.file-row > span:last-child { display: grid; gap: 3px; min-width: 0; }
.file-row small { color: var(--muted); }
.file-type { display: grid; place-items: center; width: 48px; height: 42px; border-radius: 9px; background: var(--blue-100); color: var(--blue-900); font-size: 11px; font-weight: 950; }
.detail-photo-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
.duplicate-alert { display: grid; gap: 10px; margin-bottom: 16px; padding: 15px; border: 1px solid #fdba74; border-radius: 12px; background: #fff7ed; }
.duplicate-alert h4, .duplicate-alert p { margin: 0; }
.duplicate-list { display: grid; gap: 7px; }
.duplicate-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 0; border-radius: 9px; padding: 10px 12px; background: #fff; color: var(--blue-900); text-align: left; font-weight: 800; }
.activity-entry-form { display: grid; gap: 12px; margin-bottom: 18px; padding: 15px; border: 1px solid #b8d8e6; border-radius: 12px; background: #f4fbff; }
.activity-list { display: grid; gap: 10px; }
.activity-wide { grid-column: 1 / -1; }
.activity-row { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 11px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.activity-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--blue-100); color: var(--blue-900); font-size: 18px; }
.activity-copy { min-width: 0; }
.activity-copy p { margin: 5px 0; white-space: pre-wrap; }
.activity-copy small { color: var(--muted); }
.task-center-panel { padding: clamp(18px,3vw,30px); }
.task-center-filters { display: grid; grid-template-columns: minmax(180px,.45fr) minmax(220px,1fr); gap: 12px; margin: 22px 0 18px; }
.task-center-list { display: grid; gap: 10px; }
.global-task-row { display: grid; grid-template-columns: auto minmax(0,1.3fr) minmax(170px,.7fr) auto; align-items: center; gap: 14px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.global-task-row.overdue { border-color: #fdba74; background: #fffaf4; }
.global-task-row.completed { opacity: .65; }
.global-task-row input { width: 22px; min-height: 22px; margin: 0; accent-color: var(--success); }
.global-task-main { display: grid; gap: 4px; min-width: 0; }
.global-task-main button { width: fit-content; border: 0; padding: 0; background: transparent; color: var(--blue-900); text-align: left; font-size: 16px; font-weight: 900; }
.global-task-main span, .global-task-meta span { color: var(--muted); font-size: 12px; }
.global-task-meta { display: grid; gap: 4px; }
.reports-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.reports-heading h2 { color: var(--blue-950); font-size: clamp(27px,4vw,38px); }
.report-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.report-metric { min-height: 120px; display: grid; align-content: space-between; gap: 8px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 5px 20px rgba(15,43,63,.05); }
.report-metric span { color: var(--muted); font-size: 13px; font-weight: 750; }
.report-metric strong { color: var(--blue-900); font-size: clamp(26px,4vw,37px); }
.reports-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.report-card { padding: 22px; }
.report-card h3 { margin-bottom: 18px; color: var(--blue-900); }
.report-bar-list { display: grid; gap: 13px; }
.report-bar-row { display: grid; grid-template-columns: minmax(125px,.8fr) minmax(100px,1fr) auto; align-items: center; gap: 10px; color: #526276; font-size: 13px; font-weight: 750; }
.report-bar-track { height: 9px; overflow: hidden; border-radius: 999px; background: #e2e8f0; }
.report-bar-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#38bdf8,#075985); }
.task-report-list { display: grid; gap: 10px; }
.task-report-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px; border-radius: 10px; background: #f8fbfd; }
.task-report-item strong { color: var(--blue-900); font-size: 21px; }

.estimate-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.estimate-kicker { margin: 0 0 3px; color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: .08em; }
.estimate-status-title { color: var(--blue-950); font-size: 18px; }
.estimate-status { display: inline-flex; width: fit-content; align-items: center; border-radius: 999px; padding: 7px 10px; background: #e2e8f0; color: #475569; font-size: 12px; font-weight: 850; }
.estimate-status.completed { background: #dcfae6; color: var(--success); }
.estimate-status.processing, .estimate-status.queued, .estimate-status.pending { background: #e0f2fe; color: var(--blue-900); }
.estimate-status.failed { background: #fee4e2; color: var(--danger); }
.estimate-status.waiting_for_configuration, .estimate-status.disabled { background: #fff1d6; color: #9a4d00; }
.estimate-range { display: grid; gap: 3px; margin: 10px 0 16px; padding: 17px; border: 1px solid #8dd4ef; border-radius: 13px; background: linear-gradient(135deg,#eaf8ff,#f8fdff); }
.estimate-range span, .estimate-range small { color: var(--muted); font-size: 12px; font-weight: 750; }
.estimate-range strong { color: var(--blue-900); font-size: clamp(25px, 5vw, 34px); letter-spacing: -.03em; }
.estimate-notice { margin: 0; padding: 14px; border-left: 4px solid #38bdf8; border-radius: 8px; background: #f0f9ff; color: #334155; line-height: 1.5; }
.confidence-row { display: grid; grid-template-columns: auto minmax(90px,1fr) auto; align-items: center; gap: 10px; margin-bottom: 16px; color: #526276; font-size: 12px; font-weight: 800; }
.confidence-track { height: 8px; overflow: hidden; border-radius: 999px; background: #e2e8f0; }
.confidence-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#38bdf8,#047857); }
.estimate-damage-list { display: grid; gap: 10px; }
.estimate-damage-card { padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #f8fbfd; }
.estimate-damage-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.estimate-damage-title strong { color: var(--blue-950); }
.estimate-damage-title span { flex: 0 0 auto; color: var(--blue-700); font-size: 12px; font-weight: 850; }
.estimate-damage-card p { margin: 9px 0 0; color: #526276; line-height: 1.45; }
.estimate-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.estimate-tag { border-radius: 999px; padding: 4px 8px; background: #e2e8f0; color: #475569; font-size: 11px; font-weight: 800; text-transform: capitalize; }
.estimate-hours { font-size: 12px; font-weight: 750; }
.estimate-damage-price { display: block; margin-top: 10px; color: var(--blue-900); font-size: 18px; }
.estimate-uncertainty { display: block; margin-top: 8px; color: #9a4d00; line-height: 1.4; }
.client-choice { margin: 14px 0 0; padding: 12px; border-radius: 9px; background: #dcfae6; color: #047857; font-weight: 850; }
.estimate-disclaimer { margin: 13px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.actual-estimate-summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; padding: 14px; border-radius: 12px; background: #f1f5f9; }
.actual-estimate-summary div { display: grid; gap: 2px; }
.actual-estimate-summary div span { color: var(--muted); font-size: 12px; font-weight: 750; }
.actual-estimate-summary div strong { color: var(--blue-900); font-size: 25px; }
.comparison-pill { border-radius: 999px; padding: 7px 10px; background: #e2e8f0; color: #475569; font-size: 11px; font-weight: 850; }
.comparison-pill.within { background: #dcfae6; color: var(--success); }
.comparison-pill.outside { background: #fff1d6; color: #9a4d00; }
.manual-estimate-grid { margin-top: 16px; }
.estimate-document-list { display: grid; gap: 9px; margin-bottom: 16px; }
.estimate-document-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 8px; border: 1px solid #b8d8e6; border-radius: 11px; background: #f4fbff; }
.estimate-document-row:hover { border-color: #38bdf8; }
.estimate-document-link { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 11px; min-width: 0; padding: 4px; color: inherit; text-decoration: none; }
.estimate-document-link span:nth-child(2) { display: grid; min-width: 0; gap: 2px; }
.estimate-document-row small { color: var(--muted); }
.pdf-icon { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 9px; background: #fee4e2; color: #b42318; font-size: 11px; font-weight: 950; }
.pdf-upload-box { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 12px; margin: 16px 0; padding: 15px; border: 1px dashed #8ec9dd; border-radius: 12px; background: #f8fcff; }
.pdf-upload-box label { min-width: 0; }
.pdf-upload-box input { min-width: 0; background: #fff; }
.manual-entry-separator { display: flex; align-items: center; gap: 10px; margin: 18px 0 2px; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.manual-entry-separator:before, .manual-entry-separator:after { content: ''; height: 1px; flex: 1; background: var(--line); }

.settings-workspace { display: grid; gap: 18px; }
.settings-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 6px 2px; }
.settings-heading h2 { font-size: clamp(25px, 3vw, 34px); }
.settings-heading .eyebrow { margin-top: 0; }
.settings-heading .muted { margin-bottom: 0; }
.settings-tabs { display: flex; gap: 6px; width: fit-content; padding: 5px; border: 1px solid var(--line); border-radius: 13px; background: #e8f0f5; }
.settings-tab { min-height: 44px; border: 0; border-radius: 9px; padding: 10px 20px; background: transparent; color: #526276; font-weight: 850; }
.settings-tab.active { background: #fff; color: var(--blue-900); box-shadow: 0 3px 12px rgba(15,43,63,.1); }
.crm-settings-menu { display: grid; grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); gap: 10px; }
.crm-menu-button { display: grid; grid-template-columns: auto minmax(0,1fr); column-gap: 11px; min-height: 76px; align-items: center; border: 1px solid var(--line); border-radius: 13px; padding: 12px 15px; background: #fff; color: var(--blue-950); text-align: left; }
.crm-menu-button > span { grid-row: 1 / 3; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--blue-100); color: var(--blue-900); font-size: 19px; }
.crm-menu-button strong { align-self: end; }
.crm-menu-button small { align-self: start; color: var(--muted); font-weight: 700; }
.crm-menu-button:hover { border-color: #7dd3fc; background: #f8fcff; }
.crm-menu-button.active { border-color: var(--blue-800); background: var(--blue-800); color: #fff; box-shadow: 0 7px 18px rgba(7,89,133,.2); }
.crm-menu-button.active > span { background: rgba(255,255,255,.18); color: #fff; }
.crm-menu-button.active small { color: #d8eff9; }
.settings-panel { padding: clamp(18px, 3vw, 30px); }
.settings-panel-heading { align-items: flex-start; }
.settings-panel-heading h3 { font-size: clamp(22px, 3vw, 29px); }
.settings-panel-heading .muted { max-width: 680px; margin-bottom: 0; }
.button-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.recipient-list { display: grid; gap: 12px; margin-top: 24px; }
.recipient-row { display: grid; grid-template-columns: minmax(180px,.8fr) minmax(240px,1.25fr) auto auto; align-items: end; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: #f8fbfd; }
.recipient-active { display: flex; align-items: center; gap: 9px; min-height: 48px; padding: 0 5px; white-space: nowrap; }
.recipient-active input { width: 22px; min-height: 22px; margin: 0; }
.recipient-remove { min-height: 48px; }
.estimation-settings-form { margin-top: 26px; }
.ai-toggle-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-bottom: 12px; }
.ai-toggle-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 102px; padding: 17px; border: 1px solid #b9d8e5; border-radius: 14px; background: #f7fcff; cursor: pointer; }
.ai-toggle-card span { display: grid; gap: 5px; }
.ai-toggle-card strong { color: var(--blue-950); font-size: 16px; }
.ai-toggle-card small { color: var(--muted); line-height: 1.4; }
.ai-toggle-card input[role="switch"] { appearance: none; flex: 0 0 auto; width: 54px; height: 30px; margin: 0; border: 0; border-radius: 999px; background: #94a3b8; box-shadow: inset 0 0 0 1px rgba(15,23,42,.12); transition: .18s; cursor: pointer; }
.ai-toggle-card input[role="switch"]:before { content: ''; display: block; width: 24px; height: 24px; margin: 3px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(15,23,42,.25); transition: transform .18s; }
.ai-toggle-card input[role="switch"]:checked { background: #047857; }
.ai-toggle-card input[role="switch"]:checked:before { transform: translateX(24px); }
.ai-toggle-card input[role="switch"]:disabled { opacity: .45; cursor: not-allowed; }
.learning-mode-note { margin: 0 0 25px; padding: 12px 14px; border-left: 4px solid #38bdf8; border-radius: 8px; background: #eaf8ff; color: var(--blue-900); font-weight: 750; }
.automation-settings-form { display: grid; gap: 18px; margin-top: 24px; }
.automation-master { width: 100%; }
.automation-fields { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #f8fbfd; }
.automation-check { display: flex; grid-template-columns: auto minmax(0,1fr); align-items: center; align-self: end; gap: 10px; min-height: 48px; padding: 10px 12px; border: 1px solid #cbdbe4; border-radius: 11px; background: #fff; }
.automation-check input { flex: 0 0 auto; width: 22px; min-height: 22px; margin: 0; }
.automation-repeat-card { display: grid; gap: 15px; padding: 18px; border: 1px solid #b8d8e6; border-radius: 14px; background: #f4fbff; }
.rate-section-title { margin: 0 0 12px; color: var(--blue-900); font-size: 19px; }
.rate-table { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.rate-row { display: grid; grid-template-columns: minmax(230px, 1.2fr) repeat(2, minmax(150px, .55fr)); align-items: center; gap: 14px; padding: 13px 16px; border-top: 1px solid var(--line); }
.rate-row:first-child { border-top: 0; }
.rate-row:nth-child(odd):not(.rate-header) { background: #f8fbfd; }
.rate-row label { color: var(--blue-950); font-size: 15px; }
.rate-row label small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 600; }
.rate-row input { min-height: 44px; }
.rate-header { background: var(--blue-950); color: #fff; }
.rate-header strong:not(:first-child) { font-size: 12px; text-align: center; text-transform: uppercase; letter-spacing: .04em; }
.rate-help { margin: 14px 2px 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.site-settings-layout { display: grid; grid-template-columns: minmax(0,1.08fr) minmax(340px,.92fr); align-items: start; gap: 28px; margin-top: 25px; }
.settings-form { min-width: 0; }
.color-control { display: grid; grid-template-columns: 58px 1fr; gap: 9px; }
.color-control input[type="color"] { min-height: 48px; padding: 4px; cursor: pointer; }
.site-preview { position: sticky; top: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 12px 35px rgba(15,43,63,.11); }
.site-preview > small { display: block; padding: 9px 15px; background: var(--preview-primary, #075985); color: #fff; font-weight: 800; text-align: center; }
.preview-body { padding: 30px 25px 32px; background: linear-gradient(135deg,#f4f8fb,#fff); }
.preview-brand { color: var(--preview-primary, #075985); font-size: 11px; font-weight: 950; letter-spacing: .08em; }
.preview-body h3 { margin: 16px 0 14px; color: #082f49; font-size: clamp(31px,4vw,45px); line-height: 1.02; letter-spacing: -.04em; }
.preview-body h3 span, .preview-body h3 em { display: block; font-style: normal; }
.preview-body h3 em { color: var(--preview-accent, #e3403b); }
.preview-body p { color: #526276; line-height: 1.55; }
.preview-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.preview-actions span { padding: 10px 12px; border: 2px solid var(--preview-primary, #075985); border-radius: 9px; color: var(--preview-primary, #075985); font-size: 12px; font-weight: 900; }
.preview-actions span:first-child { background: var(--preview-primary, #075985); color: #fff; }
.module-settings-layout { display: grid; grid-template-columns: minmax(210px, .28fr) minmax(0, 1fr); align-items: start; gap: 20px; margin-top: 25px; }
.module-list { position: sticky; top: 18px; display: grid; gap: 7px; padding: 8px; border: 1px solid var(--line); border-radius: 15px; background: #f0f5f8; }
.module-button { display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 10px; min-height: 50px; border: 0; border-radius: 10px; padding: 9px 12px; background: transparent; color: #526276; text-align: left; font-weight: 850; }
.module-button:hover { background: #fff; color: var(--blue-900); }
.module-button.active { background: var(--blue-800); color: #fff; box-shadow: 0 5px 16px rgba(7,89,133,.2); }
.module-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: rgba(255,255,255,.7); color: var(--blue-900); font-size: 14px; }
.module-editor { min-width: 0; padding: clamp(18px, 3vw, 28px); border: 1px solid var(--line); border-radius: 16px; background: #f8fbfd; }
.module-editor-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; margin-bottom: 22px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.module-editor-heading h4 { margin: 0; color: var(--blue-900); font-size: clamp(22px, 3vw, 28px); }
.module-editor-heading .eyebrow { margin-top: 0; }
.module-editor-heading .muted { max-width: 620px; margin-bottom: 0; }
.module-visibility { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 8px 12px; border: 1px solid #a7d8ec; border-radius: 10px; background: #eaf8ff; color: var(--blue-900); white-space: nowrap; }
.module-visibility input { width: 21px; min-height: 21px; margin: 0; }
.module-fields { align-items: start; }
.module-fields .field-group-title { grid-column: 1 / -1; margin: 12px 0 -2px; padding-top: 17px; border-top: 1px solid var(--line); color: var(--blue-900); font-size: 17px; }
.module-fields .field-group-title:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.module-fields .field-help { display: block; color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.4; }
.module-fields textarea.long { min-height: 135px; }
.list-editor { grid-column: 1 / -1; min-width: 0; }
.list-editor-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: var(--blue-900); }
.list-editor-title small { color: var(--muted); font-weight: 700; }
.list-editor-items { display: grid; gap: 12px; }
.list-editor-item { overflow: hidden; border: 1px solid #cbdbe4; border-radius: 13px; background: #fff; box-shadow: 0 4px 14px rgba(15,43,63,.05); }
.list-item-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 45px; padding: 7px 10px 7px 14px; background: #edf5f9; color: var(--blue-900); }
.list-action-buttons { display: flex; gap: 6px; }
.button.compact { min-height: 32px; padding: 5px 10px; font-size: 12px; }
.list-item-fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); align-items: start; gap: 12px; padding: 14px; }
.list-item-fields label { min-width: 0; }
.list-item-fields label.wide { grid-column: 1 / -1; }
.list-item-fields label:has(input[type="checkbox"]) { display: flex; align-items: center; gap: 8px; min-height: 48px; }
.list-item-fields input[type="checkbox"] { width: 22px; min-height: 22px; margin: 0; }
.list-item-fields textarea { min-height: 96px; }
.list-add-button { margin-top: 12px; }

.calendar-panel, .repair-pipeline-panel { padding: clamp(18px,3vw,30px); }
.calendar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.calendar-range { margin: 24px 0 14px; color: var(--blue-900); font-size: 18px; }
.appointment-calendar { display: grid; grid-template-columns: repeat(7,minmax(150px,1fr)); overflow-x: auto; gap: 9px; padding-bottom: 8px; }
.calendar-day { min-height: 390px; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: #f8fbfd; }
.calendar-day header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; padding: 3px 2px 9px; border-bottom: 1px solid var(--line); text-transform: capitalize; }
.calendar-day header strong { color: var(--blue-950); font-size: 13px; }
.calendar-day header span { color: var(--muted); font-size: 11px; font-weight: 800; }
.appointment-card { width: 100%; display: grid; gap: 3px; margin-bottom: 8px; border: 1px solid #8ec9dd; border-left: 4px solid var(--blue-700); border-radius: 9px; padding: 10px; background: #fff; color: inherit; text-align: left; }
.appointment-card:hover { border-color: var(--blue-700); box-shadow: 0 5px 14px rgba(7,89,133,.12); }
.appointment-card strong { color: var(--blue-900); }
.appointment-card span { font-size: 13px; font-weight: 850; }
.appointment-card small, .calendar-empty { color: var(--muted); font-size: 11px; line-height: 1.4; }
.calendar-empty { margin: 18px 4px; text-align: center; }
.repair-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin-top: 24px; }
.repair-metrics article { display: grid; gap: 5px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #f8fbfd; }
.repair-metrics span { color: var(--muted); font-size: 12px; font-weight: 750; }
.repair-metrics strong { color: var(--blue-900); font-size: 27px; }
.repair-filters { grid-template-columns: minmax(260px,1fr) minmax(190px,.4fr); }
.repair-list { display: grid; gap: 9px; }
.repair-row { width: 100%; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)) auto; align-items: center; gap: 18px; border: 1px solid var(--line); border-radius: 12px; padding: 15px; background: #fff; color: inherit; text-align: left; }
.repair-row:hover { border-color: #7dd3fc; background: #f8fcff; }
.repair-row div { min-width: 0; }
.repair-row div strong, .repair-row div span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.repair-row div span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.repair-stage { display: inline-flex; width: fit-content; border-radius: 999px; padding: 7px 10px; background: var(--blue-100); color: var(--blue-900); font-size: 11px; font-weight: 850; white-space: nowrap; }
.repair-stage.ready, .repair-stage.delivered { background: #dcfae6; color: var(--success); }
.repair-stage.parts, .repair-stage.authorization { background: #fff1d6; color: #9a4d00; }
.progi-status-card { display: flex; align-items: center; gap: 13px; padding: 16px; border: 1px solid #b8d8e6; border-radius: 13px; background: #f4fbff; }
.progi-status-card div { display: grid; gap: 4px; }
.progi-status-card small { color: var(--muted); line-height: 1.4; }
.integration-status-dot { flex: 0 0 auto; width: 13px; height: 13px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 5px #dcfae6; }
.weekday-settings { display: flex; flex-wrap: wrap; gap: 9px; border: 1px solid var(--line); border-radius: 13px; padding: 14px; }
.weekday-settings legend { padding: 0 7px; color: var(--blue-900); font-weight: 850; }
.weekday-settings label { display: flex; align-items: center; gap: 6px; min-height: 38px; border: 1px solid #cbdbe4; border-radius: 9px; padding: 7px 10px; background: #fff; }
.weekday-settings input { width: 18px; min-height: 18px; margin: 0; }
.crm-dialog { width: min(880px,calc(100vw - 24px)); max-height: calc(100vh - 30px); overflow: auto; border: 0; border-radius: 18px; padding: 0; background: #fff; box-shadow: 0 28px 80px rgba(2,31,51,.35); }
.crm-dialog::backdrop { background: rgba(3,20,31,.68); backdrop-filter: blur(3px); }
.crm-dialog > form { display: grid; gap: 17px; padding: clamp(20px,4vw,32px); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.dialog-heading .eyebrow { margin-top: 0; }
.dialog-heading h2 { color: var(--blue-950); font-size: clamp(24px,4vw,32px); }
.dialog-close { flex: 0 0 auto; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--muted); font-size: 26px; line-height: 1; }
.dialog-summary { margin: -4px 0 0; color: var(--muted); font-weight: 750; }
.dialog-section { display: grid; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #f8fbfd; }
.dialog-section h3 { color: var(--blue-900); font-size: 18px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.notify-client-control { margin-top: 3px; }

.employee-workspace { display: grid; gap: 18px; }
.employee-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.employee-heading h2 { color: var(--blue-950); font-size: clamp(26px,4vw,36px); }
.employee-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.employee-panel { display: grid; gap: 16px; padding: clamp(18px,3vw,28px); }
.employee-list, .staff-user-list { display: grid; gap: 11px; }
.employee-card { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.employee-card.notification-card { grid-template-columns: minmax(0,1fr) auto; align-items: center; }
.employee-card.notification-card.unread { border-left: 5px solid var(--orange); background: #fffaf5; }
.employee-card p { margin: 7px 0 0; color: #334155; line-height: 1.55; white-space: pre-wrap; }
.employee-card span, .employee-card small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.employee-card-summary { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: start; gap: 16px; }
.employee-card-summary > div > strong { color: var(--blue-950); font-size: 16px; }
.employee-status { display: inline-flex !important; width: fit-content; margin: 0 !important; border-radius: 999px; padding: 7px 11px; background: var(--blue-100); color: var(--blue-900) !important; font-weight: 850; white-space: nowrap; }
.employee-status.approved, .employee-status.responded { background: #dcfae6; color: #166534 !important; }
.employee-status.rejected { background: #fee2e2; color: #991b1b !important; }
.employee-status.pending, .employee-status.under_review { background: #fff1d6; color: #9a4d00 !important; }
.employee-status.closed { background: #e2e8f0; color: #475569 !important; }
.employee-admin-actions { display: grid; gap: 10px; padding-top: 13px; border-top: 1px solid var(--line); }
.employee-admin-actions textarea { width: 100%; }
.employee-card .admin-response { margin-top: 10px; border-left: 4px solid var(--blue-600); padding: 9px 12px; background: #f0f9ff; color: var(--blue-950); font-weight: 700; }
.notification-count { display: inline-flex; border-radius: 999px; padding: 7px 11px; background: #ffedd5; color: #9a3412; font-size: 12px; font-weight: 850; }
.privacy-notice { margin: 0; border: 1px solid #bae6fd; border-radius: 11px; padding: 12px 14px; background: #f0f9ff; color: var(--blue-900); font-size: 13px; font-weight: 750; line-height: 1.5; }
.danger-button { border-color: #fecaca !important; color: #991b1b !important; }
.staff-user-form { display: grid; gap: 15px; margin-bottom: 20px; border: 1px solid #b8d8e6; border-radius: 14px; padding: 18px; background: #f4fbff; }
.staff-permissions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 11px; padding: 10px 13px; }
.staff-permissions legend { padding: 0 6px; color: var(--blue-900); font-weight: 800; }
.staff-permissions label, .staff-check { display: flex !important; grid-template-columns: auto 1fr !important; align-items: center; gap: 7px; }
.staff-permissions input, .staff-check input { width: 18px; min-height: 18px; margin: 0; }
.staff-user-card { display: grid; gap: 12px; border: 1px solid var(--line); border-radius: 13px; padding: 15px; background: #fff; }
.staff-user-fields { display: grid; grid-template-columns: 1fr 1.3fr .7fr repeat(3,auto); align-items: end; gap: 11px; }
.staff-user-card > .button { justify-self: end; }

.apps-heading { margin-bottom: 18px; }
.apps-heading h2 { color: var(--blue-950); font-size: clamp(27px,4vw,38px); }
.app-launcher-card { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 18px; padding: 22px; margin-bottom: 18px; }
.app-launcher-card h3 { color: var(--blue-950); font-size: 22px; }
.app-launcher-card p:not(.eyebrow) { margin: 5px 0 0; color: var(--muted); }
.app-launcher-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 15px; background: linear-gradient(145deg,var(--blue-800),var(--blue-950)); color: #fff; font-size: 28px; font-weight: 950; }
.repair-plan-panel, .repair-plan-editor { padding: clamp(18px,3vw,28px); }
.repair-plan-list { display: grid; gap: 10px; margin-top: 20px; }
.repair-plan-row { display: grid; grid-template-columns: minmax(190px,1fr) minmax(210px,1fr) auto 70px; align-items: center; gap: 15px; width: 100%; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: inherit; text-align: left; }
.repair-plan-row:hover { border-color: #7dd3fc; background: #f8fcff; transform: translateY(-1px); }
.repair-plan-row span:not(.status-pill) { display: grid; gap: 4px; min-width: 0; }
.repair-plan-row small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.repair-plan-score { color: var(--blue-900); font-size: 18px; font-weight: 950; text-align: right; }
.repair-plan-editor { display: grid; gap: 18px; }
.repair-plan-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.repair-plan-editor-heading h3 { color: var(--blue-950); font-size: clamp(24px,3vw,32px); }
.repair-plan-actions { display: flex; gap: 9px; }
.repair-plan-section { display: grid; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdfe; }
.repair-plan-section > h4 { color: var(--blue-900); font-size: 18px; }
.repair-plan-form-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.repair-plan-phase { margin-top: 8px; padding-bottom: 7px; border-bottom: 1px solid #cfe2ec; color: var(--blue-900); font-size: 14px; text-transform: uppercase; letter-spacing: .05em; }
.repair-plan-check { display: grid; grid-template-columns: 120px minmax(0,1fr); align-items: center; gap: 12px; padding: 11px 13px; border: 1px solid #dce8ee; border-radius: 10px; background: #fff; }
.repair-plan-check > input { width: 22px; min-height: 22px; margin: 0; accent-color: var(--success); }
.repair-plan-yes-no { display: flex; gap: 9px; }
.repair-plan-yes-no label { display: flex; align-items: center; gap: 5px; font-size: 12px; }
.repair-plan-yes-no input { width: 18px; min-height: 18px; margin: 0; accent-color: var(--blue-800); }
.repair-plan-add-component { display: grid; grid-template-columns: minmax(220px,1fr) minmax(170px,.6fr) auto; gap: 10px; }
.repair-plan-components, .repair-plan-suggestions { display: grid; gap: 9px; }
.repair-plan-component { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid #cfe2ec; border-radius: 10px; background: #fff; }
.repair-plan-component span { display: grid; gap: 3px; }
.repair-plan-component small { color: var(--muted); }
.repair-plan-suggestion { padding: 15px; border-left: 4px solid #38bdf8; border-radius: 10px; background: #f0f9ff; }
.repair-plan-suggestion h4 { color: var(--blue-900); }
.repair-plan-suggestion ul { display: grid; gap: 7px; margin: 10px 0 0; padding-left: 20px; }
.repair-plan-score-card { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 5px 14px; padding: 16px; border: 1px solid #8dd4ef; border-radius: 12px; background: #effaff; }
.repair-plan-score-card span { color: var(--muted); font-weight: 800; }
.repair-plan-score-card strong { grid-row: 1 / 3; grid-column: 2; align-self: center; color: var(--blue-900); font-size: 30px; }
.repair-plan-score-card small { color: #526276; }
.repair-plan-oem-warning { padding: 14px; border-left: 4px solid #f59e0b; border-radius: 9px; background: #fffbeb; color: #854d0e; font-weight: 750; }

@media (max-width: 900px) {
  .repair-plan-form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .repair-plan-row { grid-template-columns: 1fr 1fr auto; }
  .repair-plan-score { grid-column: 3; }
  .app-shell { grid-template-columns: 82px minmax(0, 1fr); }
  .crm-sidebar { padding: 16px 10px 12px; }
  .sidebar-brand { justify-content: center; padding: 0 0 17px; }
  .sidebar-brand-copy, .nav-label, .account-email { display: none; }
  .main-nav { margin-top: 17px; }
  .nav-button, .sidebar-logout { justify-content: center; padding-inline: 8px; }
  .nav-icon { flex-basis: 30px; width: 30px; }
  .settings-nav-button { border: 0; }
  .account-box { padding-top: 9px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lead-row { grid-template-columns: 1fr 1fr; }
  .lead-row > :last-child { justify-self: start; }
  .site-settings-layout { grid-template-columns: 1fr; }
  .site-preview { position: static; }
  .module-settings-layout { grid-template-columns: 1fr; }
  .module-list { position: static; grid-template-columns: repeat(3, minmax(0,1fr)); }
  .crm-settings-menu { grid-template-columns: 1fr; }
  .module-button { grid-template-columns: 1fr; justify-items: center; text-align: center; font-size: 12px; }
  .detail-hero { align-items: stretch; flex-direction: column; }
  .detail-quick-actions { justify-content: flex-start; }
  .two-column-detail, .activity-grid { grid-template-columns: 1fr; }
  .overview-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .overview-info-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .detail-photo-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .report-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .reports-grid { grid-template-columns: 1fr; }
  .global-task-row { grid-template-columns: auto minmax(0,1fr) auto; }
  .global-task-meta { grid-column: 2; }
  .appointment-calendar { grid-template-columns: repeat(7,170px); }
  .repair-row { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .repair-row .repair-stage { justify-self: start; }
  .staff-user-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 620px) {
  .auth-shell { padding: 0; background: #fff; }
  .auth-card { min-height: 100vh; border-radius: 0; box-shadow: none; padding: 34px 22px; }
  .auth-actions { align-items: flex-start; flex-direction: column; }
  .app-shell { grid-template-columns: 68px minmax(0, 1fr); }
  .crm-sidebar { padding-inline: 8px; }
  .sidebar-logo { width: 40px; height: 40px; font-size: 15px; }
  .topbar { min-height: 84px; padding: 15px 16px; }
  .topbar h1 { font-size: 25px; }
  .topbar .eyebrow { font-size: 10px; }
  .workspace { padding: 12px; }
  .stats-grid { gap: 9px; }
  .stat-card { min-height: 100px; padding: 15px; }
  .stat-card strong { font-size: 30px; }
  .filters { grid-template-columns: 1fr; }
  .list-toolbar, .reports-heading { align-items: stretch; flex-direction: column; }
  .list-toolbar .button, .reports-heading .button { width: 100%; }
  .lead-row { grid-template-columns: 1fr; gap: 10px; padding: 15px; }
  .lead-cell { display: grid; grid-template-columns: 110px 1fr; align-items: baseline; gap: 8px; }
  .lead-cell span { margin-top: 0; }
  .info-grid, .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .button-row { flex-direction: column; }
  .button-row .button { width: 100%; }
  .settings-heading, .settings-panel-heading { align-items: stretch; flex-direction: column; }
  .settings-heading .button, .settings-panel-heading .button, .settings-panel-heading .button-link { width: 100%; }
  .settings-tabs { width: 100%; }
  .settings-tab { flex: 1; }
  .recipient-row { grid-template-columns: 1fr; }
  .recipient-active { min-height: 36px; }
  .module-list { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .module-editor-heading { align-items: stretch; flex-direction: column; }
  .module-visibility { justify-content: center; }
  .list-item-fields { grid-template-columns: 1fr; }
  .list-item-fields label.wide { grid-column: auto; }
  .list-item-actions { align-items: flex-start; flex-direction: column; }
  .rate-table { overflow: visible; border: 0; background: transparent; }
  .ai-toggle-grid { grid-template-columns: 1fr; }
  .pdf-upload-box { grid-template-columns: 1fr; }
  .pdf-upload-box .button { width: 100%; }
  .rate-header { display: none; }
  .rate-row { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-bottom: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff !important; }
  .rate-row label { grid-column: 1 / -1; }
  .rate-row input { min-width: 0; }
  .estimate-heading, .estimate-damage-title, .actual-estimate-summary { align-items: stretch; flex-direction: column; }
  .confidence-row { grid-template-columns: 1fr auto; }
  .confidence-track { grid-column: 1 / -1; grid-row: 2; }
  .detail-header { gap: 10px; }
  .back-button span { display: none; }
  .back-button { width: 44px; min-height: 44px; justify-content: center; padding: 8px; font-size: 20px; }
  .detail-hero { padding: 16px; }
  .detail-quick-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .detail-quick-actions .button { width: 100%; padding-inline: 10px; }
  .detail-tabs { margin-inline: -2px; }
  .detail-tab { padding-inline: 12px; }
  .overview-metrics, .overview-info-grid, .task-create-grid { grid-template-columns: 1fr; }
  .vehicle-identification-controls { align-items: stretch; flex-direction: column; }
  .identification-actions { width: 100%; }
  .identification-actions .button { flex: 1 1 auto; }
  .task-create-grid .wide { grid-column: auto; }
  .detail-photo-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .task-row { grid-template-columns: auto minmax(0,1fr); }
  .task-row .priority-pill { grid-column: 2; }
  .task-center-filters, .report-metrics { grid-template-columns: 1fr; }
  .global-task-row { grid-template-columns: auto minmax(0,1fr); }
  .global-task-row .priority-pill { grid-column: 2; }
  .report-bar-row { grid-template-columns: 1fr auto; }
  .report-bar-track { grid-column: 1 / -1; grid-row: 2; }
  .calendar-heading { align-items: stretch; flex-direction: column; }
  .calendar-actions { display: grid; grid-template-columns: repeat(4,1fr); }
  .repair-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .repair-filters, .repair-row { grid-template-columns: 1fr; }
  .dialog-actions { flex-direction: column-reverse; }
  .dialog-actions .button { width: 100%; }
  .employee-heading { align-items: stretch; flex-direction: column; }
  .employee-heading .button { width: 100%; }
  .employee-form-grid { grid-template-columns: 1fr; }
  .employee-card-summary, .employee-card.notification-card { grid-template-columns: 1fr; }
  .staff-user-fields { grid-template-columns: 1fr; }
  .staff-user-card > .button { width: 100%; }
  .app-launcher-card { grid-template-columns: auto minmax(0,1fr); }
  .app-launcher-card > .button { grid-column: 1 / -1; width: 100%; }
  .repair-plan-editor-heading { align-items: stretch; flex-direction: column; }
  .repair-plan-actions { display: grid; grid-template-columns: 1fr; }
  .repair-plan-form-grid, .repair-plan-add-component, .repair-plan-row { grid-template-columns: 1fr; }
  .repair-plan-row .status-pill, .repair-plan-score { grid-column: auto; }
  .repair-plan-check { grid-template-columns: 1fr; }
}
