:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #0b0c0f;
  --surface: #14161b;
  --surface-2: #1d2027;
  --text: #f5f6f7;
  --muted: #a8aeb8;
  --line: rgba(255, 255, 255, 0.11);
  --accent: #ff6532;
  --accent-light: #ffb07f;
  --success: #78d7a5;
  --danger: #ff9585;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; overflow-x: hidden; color: var(--text); background: var(--bg); font-size: 16px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
.crm-header, main { width: min(1240px, calc(100% - 48px)); margin: 0 auto; }
.crm-header { min-height: 108px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.crm-header h1 { margin: 2px 0 0; font-size: clamp(30px, 4vw, 46px); line-height: 1; letter-spacing: -0.045em; }
.crm-header a { min-height: 44px; padding: 0 16px; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; color: var(--text); text-decoration: none; font-size: 14px; font-weight: 700; }
.eyebrow { margin: 0; color: var(--accent-light); font-size: 12px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
main { padding: 32px 0 72px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metrics article { padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.metrics span { display: block; color: var(--muted); font-size: 13px; }
.metrics strong { display: block; margin-top: 8px; font-size: 32px; line-height: 1; letter-spacing: -.04em; }
.tabs { margin: 34px 0 20px; display: flex; gap: 8px; }
.tab { min-height: 46px; padding: 0 18px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: var(--surface); font-weight: 750; }
.tab.is-active { border-color: var(--accent); color: var(--text); background: rgba(255, 101, 50, .14); }
.panel { padding: 28px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); }
.panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.panel-heading h2 { margin: 0; font-size: 30px; letter-spacing: -.035em; }
.panel-heading p { max-width: 710px; margin: 5px 0 0; color: var(--muted); }
.compact-field, .field { display: grid; gap: 7px; }
.compact-field span, .field span { color: var(--muted); font-size: 13px; font-weight: 680; }
input, select, textarea { width: 100%; min-width: 0; min-height: 46px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; outline: 0; color: var(--text); background: var(--surface-2); }
textarea { padding-top: 10px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 101, 50, .14); }
.page-status { min-height: 24px; margin: 20px 0 0; color: var(--muted); }
.page-status.success { color: var(--success); }
.page-status.error { color: var(--danger); }
.lead-list { margin-top: 18px; display: grid; gap: 12px; }
.lead-card { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #101216; }
.lead-main, .lead-actions { min-width: 0; padding: 22px; }
.lead-actions { border-left: 1px solid var(--line); background: rgba(255, 255, 255, .018); }
.lead-topline { display: flex; flex-wrap: wrap; gap: 8px 12px; color: var(--muted); font-size: 12px; }
.lead-source { padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; }
.lead-card h3 { margin: 16px 0 2px; font-size: 22px; line-height: 1.2; }
.lead-contact { color: var(--accent-light); overflow-wrap: anywhere; }
.lead-vehicle { margin: 18px 0 0; font-weight: 750; }
.lead-details { margin: 14px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.lead-details div { padding: 10px; border-radius: 10px; background: var(--surface-2); }
.lead-details dt { color: var(--muted); font-size: 11px; }
.lead-details dd { margin: 2px 0 0; font-size: 14px; }
.lead-wishes { margin: 15px 0 0; color: var(--muted); white-space: pre-wrap; }
.note-form { margin-top: 15px; }
.note-form button, .primary-button, .hide-price { min-height: 44px; padding: 0 16px; border-radius: 11px; font-weight: 780; }
.note-form button { width: 100%; margin-top: 8px; border: 1px solid var(--line); color: var(--text); background: var(--surface-2); }
.notes { margin-top: 15px; display: grid; gap: 7px; }
.note { padding: 10px 12px; border-left: 2px solid var(--accent); color: #d9dce1; background: var(--surface-2); font-size: 13px; }
.note time { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.price-form { margin-top: 25px; padding: 22px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; border: 1px solid var(--line); border-radius: 17px; background: #101216; }
.span-two { grid-column: 1 / -1; }
.form-hint { margin: 0; color: var(--muted); font-size: 13px; }
.primary-button { border: 0; color: #18100c; background: linear-gradient(145deg, var(--accent-light), var(--accent)); }
.price-list { margin-top: 22px; display: grid; gap: 9px; }
.price-row { padding: 15px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 18px; align-items: center; border: 1px solid var(--line); border-radius: 14px; background: #101216; }
.price-row strong, .price-row span { display: block; }
.price-row span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.price-value { font-weight: 820; white-space: nowrap; }
.hide-price { border: 1px solid var(--line); color: var(--text); background: var(--surface-2); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
@media (max-width: 820px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lead-card { grid-template-columns: 1fr; }
  .lead-actions { border-top: 1px solid var(--line); border-left: 0; }
  .price-row { grid-template-columns: 1fr auto; }
  .price-row .hide-price { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .crm-header, main { width: calc(100% - 24px); }
  .crm-header { min-height: 90px; }
  .crm-header a { padding: 0 11px; font-size: 13px; }
  main { padding-top: 20px; }
  .metrics { gap: 8px; }
  .metrics article { padding: 15px; }
  .panel { padding: 18px; border-radius: 18px; }
  .panel-heading { display: grid; align-items: start; }
  .compact-field { width: 100%; }
  .lead-main, .lead-actions { padding: 17px; }
  .lead-details, .price-form { grid-template-columns: 1fr; }
  .span-two { grid-column: auto; }
  .price-form { padding: 16px; }
  .price-row { grid-template-columns: 1fr; gap: 10px; }
  .price-value { white-space: normal; }
  .price-row .hide-price { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
#customer-list .lead-card > div { padding: 20px; overflow-wrap: anywhere; }
#customer-list .lead-card { display: block; }
#panel-calculator > p, #panel-customers > p { line-height: 1.65; color: var(--muted); }
#calc-result { padding-block: 18px; overflow-wrap: anywhere; }
#calc-result p { margin: 8px 0; line-height: 1.6; }
#calc-offer { width: 100%; min-height: 280px; line-height: 1.6; resize: vertical; }
#calculator-form small { line-height: 1.5; color: var(--muted); }
#calculator-form .field { align-content: start; }
#calc-result h3 { line-height: 1.5; }
.daily-rate,.saved-offers { margin: 20px 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; }
.daily-rate p { margin: 8px 0; }
.daily-rate small { display: block; color: var(--muted); line-height: 1.6; }
.saved-offers .field { margin-top: 16px; }
.card-actions,.card-photo-fields { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.card-photo-fields > label { flex: 1 1 260px; min-width: 0; }
.card-photo-fields input { width: 100%; min-width: 0; font-size: 14px; }
#offer-editor .field { margin: 14px 0; }
#offer-editor textarea { width: 100%; resize: vertical; }
#offer-editor .form-hint { line-height: 1.6; }
.card-actions button,#card-open { min-height: 44px; padding: 12px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text); }
.client-offer-card { margin: 24px 0; padding: clamp(20px,4vw,42px); border-top: 6px solid #c35b24; border-radius: 16px; background: #fbfaf7; color: #26313c; overflow-wrap: anywhere; line-height: 1.65; }
.client-offer-card h3 { margin: 8px 0; font-size: clamp(24px,3vw,36px); line-height: 1.25; }
.client-offer-card p { margin: 14px 0; }
.offer-brand { color: #9b4417; font-size: 13px; font-weight: 800; letter-spacing: .08em; }
.offer-meta { color: #596773; font-size: 14px; }
.offer-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin: 24px 0; }
.offer-options section { padding: 16px; border: 1px solid #ddcfc1; border-radius: 12px; }
.offer-options p { margin: 0 0 8px; }
.offer-options strong { color: #9b4417; font-size: clamp(22px,2.4vw,30px); }
.offer-photo { display: block; width: 100%; height: auto; margin-top: 26px; border-radius: 10px; }
@media(max-width:650px){.offer-options{grid-template-columns:1fr}.card-actions button{width:100%}.client-offer-card{padding:18px}}
#calc-copy { min-height: 44px; padding: 12px 18px; margin: 8px 12px 12px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text); }
.tabs { flex-wrap: wrap; }
.tab { flex: 1 1 140px; }
.field, .price-form { min-width: 0; }
#calc-manual { margin: 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; }
#calc-manual legend { padding: 0 8px; font-weight: 700; }
#calc-manual > label:has(input[type="checkbox"]) { display: flex; align-items: flex-start; gap: 12px; line-height: 1.5; }
#calc-documents { flex: 0 0 22px; width: 22px; height: 22px; min-height: 22px; margin-top: 2px; }
@media(max-width:560px) {
  #calculator-form { padding: 12px; }
  #calc-manual { padding: 16px 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
  #calc-manual legend { padding: 0; }
  #calculator-form .form-hint, #calculator-form small { font-size: 14px; line-height: 1.55; }
}
.field select { width: 100%; min-width: 0; }
#calc-send, #calc-publish, #customers-refresh { min-height: 44px; padding: 12px 18px; margin: 8px 12px 12px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text); }
.session-dialog { width: min(520px, calc(100% - 32px)); box-sizing: border-box; padding: 24px; border: 1px solid #606570; border-radius: 16px; background: #17191e; color: #f6f6f8; }
.session-dialog::backdrop { background: rgb(0 0 0 / 75%); }
.lead-views { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 16px; }
.lead-views button, .lead-primary button { min-height: 44px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: var(--surface-2); white-space: normal; }
.lead-views button[aria-pressed="true"] { border-color: var(--accent); background: rgba(255,101,50,.14); }
.lead-primary { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.lead-primary .lead-primary-button { width: 100%; border-color: var(--accent); }
.lead-next { margin: 0 0 12px; color: var(--muted); line-height: 1.6; }
.lead-state { color: var(--accent-light); }
.lead-feedback:empty { display: none; }
.workflow-hint { padding: 16px; border-left: 3px solid var(--accent); background: var(--surface-2); line-height: 1.6; }
.workflow-confirm { display: flex; align-items: flex-start; gap: 12px; margin: 18px 0; line-height: 1.5; }
.workflow-confirm input { margin: 4px 0 0; flex: 0 0 22px; width: 22px; height: 22px; min-height: 22px; padding: 0; }
#calc-order-next { margin-top: 24px; }
#calc-order-next button, #calc-new { min-height: 44px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: var(--surface-2); white-space: normal; }
.order-close-checklist { padding-left: 22px; line-height: 1.7; }
@media(max-width:600px) { .lead-views button { flex: 1 1 140px; } .lead-primary button { width: 100%; } }
.session-dialog p { line-height: 1.5; overflow-wrap: anywhere; }
.session-dialog a { display: inline-flex; align-items: center; min-height: 44px; color: #ffac83; }
.session-dialog button { width: 100%; min-height: 44px; white-space: normal; }
