:root {
  color-scheme: light;
  --bg: #f3f4f6;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --accent: #0b57d0;
  --accent-strong: #0848ad;
  --border: #d1d5db;
  --pill: #eef4ff;
  --shadow: none;
  --shadow-sm: none;
  --radius: 4px;
  --radius-sm: 4px;
  --sidebar: #111827;
  --sidebar-text: #f3f4f6;
  --sidebar-muted: #9ca3af;
  --surface: #f8fafc;
  --surface-strong: #f3f4f6;
  --content-max-width: 2200px;
  --ui-font-scale: 1;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI Variable", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: calc(16px * var(--ui-font-scale));
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.4;
}

a { color: inherit; text-decoration: none; }
input, select, textarea, button { font: inherit; }

.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06);
}

.logo { display: flex; align-items: center; padding: 2px 4px 6px; }
/* Variante chiara: sulla barra scura quella normale sparirebbe, perche' "Car"
   e' blu notte. I due file li produce marchio/prepara.py dal PNG. */
.logo__img { width: calc(176px * var(--ui-font-scale)); height: auto; }


.nav-block { display: flex; flex-direction: column; gap: 8px; }

.sidebar__select {
  background: #111827;
  color: var(--sidebar-text);
  border: 1px solid #374151;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: calc(13px * var(--ui-font-scale));
}

.nav { display: flex; flex-direction: column; gap: 6px; }
.nav__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 4px;
  color: var(--sidebar-text);
  font-family: inherit;
  font-size: calc(14px * var(--ui-font-scale));
  font-weight: 600;
  line-height: 1.2;
  border: 1px solid transparent;
  background: transparent;
}
.nav__item:hover { background: rgba(255, 255, 255, 0.05); }
.nav__item.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}
.nav-group {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}
.nav__item--toggle {
  width: 100%;
  justify-content: flex-start;
  cursor: pointer;
}
.nav__item--toggle .nav__caret {
  margin-left: auto;
  transition: transform 0.15s ease;
}
.nav-group.is-open .nav__item--toggle .nav__caret {
  transform: rotate(180deg);
}
.nav-sub {
  display: none;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}
.nav-group.is-open .nav-sub { display: flex; }
.nav-sub__item {
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  color: var(--sidebar-text);
  font-weight: 600;
  padding: 8px 12px 8px 40px;
  border: 1px solid transparent;
  font-size: calc(13px * var(--ui-font-scale));
}
.nav-sub__item:hover { background: rgba(255, 255, 255, 0.05); }
.nav-sub__item.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}
.nav-sub__dot {
  width: 9px;
  height: 9px;
  margin-left: 8px;
  flex: 0 0 auto;
}
.contract-checkbox-field {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  align-self: end;
  padding-bottom: 10px;
}
.contract-checkbox-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: #2563eb;
}

.nav__icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  color: var(--sidebar-text);
}
.nav__icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar__footer { margin-top: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sidebar__version {
  font-size: calc(11px * var(--ui-font-scale));
  color: rgba(255, 255, 255, .45);
  letter-spacing: .02em;
  cursor: default;
}

.main {
  padding: 18px 20px 32px;
}

.main > .topbar,
.main > .section {
  width: 100%;
  max-width: var(--content-max-width);
  margin-inline: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(216, 225, 235, 0.9);
}
.topbar h1 {
  margin: 4px 0 0;
  font-size: calc(clamp(1.45rem, 1.05rem + 0.9vw, 2rem) * var(--ui-font-scale));
  letter-spacing: -0.025em;
}
.topbar__meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.meta {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  min-width: 98px;
  text-align: center;
  box-shadow: none;
}
.alerts-bell {
  position: relative;
  display: inline-flex;
}
.alerts-bell__btn {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  position: relative;
}
.alerts-bell__btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.alerts-bell__btn:hover {
  border-color: #93c5fd;
  color: var(--accent);
}
.alerts-bell__dot {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #dc2626;
}
.alerts-bell__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(380px, 80vw);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  z-index: 40;
}
.alerts-bell__panel-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: calc(13px * var(--ui-font-scale));
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.alerts-bell__list {
  display: flex;
  flex-direction: column;
  max-height: 300px;
  overflow: auto;
}
.alerts-bell__item {
  padding: 10px 12px;
  border-bottom: 1px solid #eef2f7;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.alerts-bell__item:last-child {
  border-bottom: none;
}
.alerts-bell__item:hover {
  background: #f8fafc;
}
.alerts-bell__item-title {
  font-size: calc(13px * var(--ui-font-scale));
  font-weight: 700;
  color: var(--text);
}
.alerts-bell__item-text {
  font-size: calc(12px * var(--ui-font-scale));
  color: var(--muted);
}
.alerts-bell__item-date {
  font-size: calc(12px * var(--ui-font-scale));
  color: #1d4ed8;
  font-weight: 700;
}
.alerts-bell__empty {
  margin: 0;
  padding: 14px 12px;
  color: var(--muted);
  font-size: calc(13px * var(--ui-font-scale));
}

.section { margin-bottom: 16px; }
.section__header { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.actions-inline { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.section h2 { margin: 4px 0 0; letter-spacing: -0.02em; font-size: calc(1.05rem * var(--ui-font-scale)); }

.grid { display: grid; gap: 14px; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) {
  .metrics-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .metrics-grid { grid-template-columns: repeat(1, minmax(0, 1fr)); }
}
.grid.columns { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
.grid.two-columns { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.grid.settings-cards-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 8px;
  align-items: stretch;
}
.grid.settings-cards-grid > .card {
  min-width: 0;
}

.checkbox-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.checkbox-card span {
  font-size: calc(13px * var(--ui-font-scale));
  font-weight: 700;
  color: var(--text);
}

.checkbox-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #2563eb;
}

.archive-manager-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.archive-manager-panel {
  min-width: 0;
}

.archive-manager-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.archive-manager-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.archive-manager-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  background: #fff;
}

.archive-manager-column__head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
  font-size: calc(12px * var(--ui-font-scale));
  font-weight: 700;
}

.archive-manager-list {
  min-height: 400px;
  max-height: 540px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
}

.archive-manager-item {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  background: #fff;
  text-align: left;
  color: var(--text);
  cursor: pointer;
}

.archive-manager-item:hover {
  border-color: rgba(37, 99, 235, 0.2);
  background: #f8fbff;
}

.archive-manager-item.is-active {
  border-color: rgba(37, 99, 235, 0.38);
  background: #eef4ff;
}

.archive-manager-item strong {
  display: block;
  font-size: calc(13px * var(--ui-font-scale));
  line-height: 1.3;
}

.archive-manager-item span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: calc(12px * var(--ui-font-scale));
  line-height: 1.35;
}

.archive-manager-empty {
  padding: 14px 12px;
  color: var(--muted);
  font-size: calc(12px * var(--ui-font-scale));
}

.archive-manager-hint {
  margin: 12px 0 0;
}

.archive-manager-meta-grid {
  margin-top: 6px;
}

@media (max-width: 1180px) {
  .archive-manager-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .archive-manager-columns {
    grid-template-columns: 1fr;
  }

  .archive-manager-list {
    min-height: 220px;
    max-height: 320px;
  }
}
.graphics-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}
.graphics-setting-card {
  display: grid;
  gap: 14px;
}
.graphics-settings-footer {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
.graphics-setting-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #c7d2fe;
  background: #eef4ff;
  color: #1e3a8a;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.graphics-setting-body {
  display: grid;
  gap: 12px;
}
.graphics-setting-range-row {
  display: grid;
  gap: 10px;
}
.graphics-setting-label {
  font-weight: 700;
  color: var(--text);
}
.graphics-setting-range {
  width: 100%;
  margin: 0;
  accent-color: var(--accent);
}
.graphics-setting-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}
.graphics-setting-preview {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.graphics-setting-preview strong {
  color: var(--text);
}
.graphics-setting-status {
  margin: 0;
}
.graphics-setting-status[data-state="saving"] {
  color: #1d4ed8;
}
.graphics-setting-status[data-state="saved"] {
  color: #166534;
}
.graphics-setting-status[data-state="error"] {
  color: #b91c1c;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: none;
}
.card.metric { border-radius: 6px; }
.card h3 { margin: 6px 0; font-size: calc(1rem * var(--ui-font-scale)); letter-spacing: -0.015em; }
.metric--available { background: #ffedd5; border-color: #fdba74; }
.metric--loaded { background: #e0e7ff; border-color: #a5b4fc; }
.metric--sold { background: #dcfce7; border-color: #86efac; }
.metric--returned { background: #fce8ef; border-color: #f28fad; }
.card h4 { margin: 4px 0 12px; }
.muted { color: var(--muted); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--pill);
  color: #1e3a8a;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid #c7d2fe;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: calc(7px * var(--ui-font-scale)) calc(11px * var(--ui-font-scale));
  min-height: calc(34px * var(--ui-font-scale));
  border-radius: 4px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: calc(12px * var(--ui-font-scale));
  line-height: 1.2;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  box-shadow: none;
}
.btn.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}
.btn.primary:hover { transform: translateY(-1px); background: var(--accent-strong); }
.btn.success {
  background: #137333;
  color: #fff;
  box-shadow: none;
}
.btn.success:hover { transform: translateY(-1px); }
.btn.danger {
  background: #b91c1c;
  color: #fff;
  box-shadow: none;
}
.btn.danger:hover { transform: translateY(-1px); }
.btn.ghost {
  background: #fff;
  border-color: var(--border);
  color: var(--text);
  box-shadow: none;
}
.btn:active { transform: translateY(0); box-shadow: none; }
.btn-sm {
  padding: calc(6px * var(--ui-font-scale)) calc(10px * var(--ui-font-scale));
  font-size: calc(11px * var(--ui-font-scale));
  border-radius: 6px;
  font-weight: 700;
  min-height: calc(32px * var(--ui-font-scale));
}

.form { display: flex; flex-direction: column; gap: 10px; }
.form label { font-weight: 700; font-size: calc(12px * var(--ui-font-scale)); color: var(--text); letter-spacing: -0.01em; }
.form input, .form select {
  width: 100%;
  margin-top: 6px;
  padding: calc(8px * var(--ui-font-scale)) calc(10px * var(--ui-font-scale));
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: calc(13px * var(--ui-font-scale));
  line-height: 1.35;
  min-height: calc(36px * var(--ui-font-scale));
  box-shadow: none;
}
.form textarea {
  width: 100%;
  margin-top: 6px;
  padding: calc(9px * var(--ui-font-scale)) calc(10px * var(--ui-font-scale));
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: calc(13px * var(--ui-font-scale));
  font-family: inherit;
  resize: vertical;
  line-height: 1.5;
  min-height: calc(88px * var(--ui-font-scale));
  box-shadow: none;
}
.form input:focus,
.form select:focus,
.form textarea:focus,
.customer-search-input:focus,
.filter-field input:focus,
.filter-field select:focus,
.finance-inline-commission:focus {
  outline: none;
  border-color: #7aa9f8;
  box-shadow: 0 0 0 4px rgba(15, 95, 215, 0.11);
}
.form select {
  appearance: none;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, transparent 50%, #64748b 50%),
    linear-gradient(135deg, #64748b 50%, transparent 50%);
  background-position:
    calc(100% - calc(18px * var(--ui-font-scale))) calc(50% - 1px),
    calc(100% - calc(12px * var(--ui-font-scale))) calc(50% - 1px);
  background-size:
    calc(6px * var(--ui-font-scale)) calc(6px * var(--ui-font-scale)),
    calc(6px * var(--ui-font-scale)) calc(6px * var(--ui-font-scale));
  background-repeat: no-repeat;
  padding-right: calc(34px * var(--ui-font-scale));
}
.form [data-load-when="acquisto"] select,
.form [data-load-when="mandato"] select,
.form [data-purchase-vat-manager] select {
  background-color: #eef7ff;
  border-color: #bfdcff;
}
.form [data-load-when="acquisto"] select:focus,
.form [data-load-when="mandato"] select:focus,
.form [data-purchase-vat-manager] select:focus {
  border-color: #7fb2ff;
  box-shadow: 0 0 0 3px rgba(125, 177, 255, 0.22);
}
.form [data-purchase-vat-add] {
  background: #16a34a;
  border-color: #15803d;
  color: #fff;
  min-width: 44px;
}
.form [data-purchase-vat-add]:hover {
  background: #15803d;
  transform: translateY(-1px);
}
.form__hint { font-size: calc(12px * var(--ui-font-scale)); margin: 4px 0 0; }
.segmented {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  width: fit-content;
}
.segmented__item {
  padding: 8px 14px;
  border: none;
  background: #fff;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}
.segmented__item.is-active {
  background: var(--accent);
  color: #fff;
}
.customer-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.customer-search-card { padding: 16px; }
.customer-search-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  padding: calc(9px * var(--ui-font-scale)) calc(10px * var(--ui-font-scale));
  font-size: calc(13px * var(--ui-font-scale));
  line-height: 1.35;
  min-height: calc(38px * var(--ui-font-scale));
}
.customer-form-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.contract-form-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.contract-form-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.9fr);
  gap: 16px;
  align-items: start;
}
.contract-summary-rail {
  position: sticky;
  top: 16px;
}
.contract-summary-card {
  gap: 14px;
}
.contract-summary-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.contract-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-size: calc(13px * var(--ui-font-scale));
}
.contract-summary-row strong {
  text-align: right;
  font-size: calc(14px * var(--ui-font-scale));
}
.contract-summary-row--total,
.contract-summary-row--balance {
  padding-top: 4px;
  font-weight: 800;
}
.contract-summary-row--total strong,
.contract-summary-row--balance strong {
  font-size: calc(16px * var(--ui-font-scale));
}
.contract-summary-inputs {
  margin-top: 4px;
}
.contract-services-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.contract-service-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(160px, 0.8fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.contract-service-row__remove {
  align-self: center;
}
.contract-service-row--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  color: var(--muted);
  border-style: dashed;
  background: #f8fafc;
}
.customer-form-section {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.contract-form-section {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.customer-form-section__title {
  margin: 0;
  font-size: calc(12px * var(--ui-font-scale));
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 800;
}
.contract-form-section__title {
  margin: 0;
  font-size: calc(12px * var(--ui-font-scale));
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 800;
}
/* Sotto-titolo dentro una sezione (es. "Indirizzo" / "Sede legale"
   nei dati di fatturazione): piu' leggero del titolo di sezione. */
.customer-form-subtitle {
  margin: 2px 0 0;
  font-size: calc(12px * var(--ui-font-scale));
  font-weight: 700;
  color: var(--text);
}
.grid.customer-form-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
/* Riga con un solo campo (es. la tendina "Tipo"): non deve stirarsi
   per tutta la larghezza della sezione. */
.grid.customer-form-grid.customer-form-grid--narrow {
  grid-template-columns: minmax(220px, 320px);
}
.grid.contract-form-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.contract-form-grid__wide {
  grid-column: 1 / -1;
}
.contract-transfer-price-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.customer-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.customer-form-note {
  margin: 0;
  color: var(--muted);
  font-size: calc(12px * var(--ui-font-scale));
}
.customer-name-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.customer-name-cell strong {
  font-size: calc(14px * var(--ui-font-scale));
  color: var(--text);
}
.customer-row-meta {
  color: var(--muted);
  font-size: calc(12px * var(--ui-font-scale));
}
/* Riga della lista aperta nell'editor qui sotto. */
#customers-table tr.is-selected {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
#customers-table tr.is-selected .customer-name-cell strong {
  color: var(--accent);
}
.customer-detail-card {
  padding: 16px;
}
.customer-detail-card .detail-grid {
  margin-top: 8px;
}
.form-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 6px;
}
.form-tab {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 12px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}
.form-tab.is-active {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}
.form-tab-panel {
  display: none;
  flex-direction: column;
  gap: 10px;
}
.form-tab-panel.is-active { display: flex; }
.vehicle-info-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.vehicle-info-section {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.vehicle-info-section__title {
  margin: 0;
  font-size: calc(12px * var(--ui-font-scale));
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 800;
}
.vehicle-info-section .grid {
  gap: 10px;
}
.grid.vehicle-info-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.vehicle-info-note {
  margin: 0;
  font-size: calc(12px * var(--ui-font-scale));
  color: var(--muted);
}
.field-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-weight: 600;
  font-size: calc(14px * var(--ui-font-scale));
  color: var(--text);
}
.field-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
}
.field-checkbox span {
  line-height: 1.3;
}
.accessories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}
.accessory-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  font-weight: 600;
  font-size: calc(13px * var(--ui-font-scale));
}
.accessory-item input {
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
  border-radius: 0;
}
.accessory-item span { line-height: 1.3; }

.table-wrapper {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  box-shadow: none;
}
.table-wrapper--row-menu {
  overflow: visible;
}
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td {
  padding: 7px 9px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: calc(12px * var(--ui-font-scale));
  vertical-align: middle;
}
th {
  color: #4b5563;
  font-weight: 800;
  font-size: calc(10px * var(--ui-font-scale));
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #f3f4f6;
}
table.table--compact th,
table.table--compact td {
  padding: 4px 6px;
  font-size: calc(11px * var(--ui-font-scale));
  line-height: 1.25;
  vertical-align: top;
}
table.table--compact .table-meta {
  font-size: calc(11px * var(--ui-font-scale));
}
table.table--compact input,
table.table--compact select {
  margin-top: 0;
  width: 100%;
  padding: 6px 7px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: calc(12px * var(--ui-font-scale));
}
.table-sort {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.table-sort:hover { color: var(--text); }
.table-sort__arrows {
  display: inline-grid;
  grid-template-rows: 6px 6px;
  gap: 2px;
}
.table-sort__arrow {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  opacity: 0.35;
}
.table-sort__arrow--up { border-bottom: 6px solid var(--muted); }
.table-sort__arrow--down { border-top: 6px solid var(--muted); }
.table-sort.is-active-asc .table-sort__arrow--up {
  opacity: 1;
  border-bottom-color: var(--accent);
}
.table-sort.is-active-desc .table-sort__arrow--down {
  opacity: 1;
  border-top-color: var(--accent);
}
.table-actions-header {
  width: 1%;
}
tbody tr:hover { background: #eef2f7; }
.table-wrapper tbody tr:nth-child(even) { background: #fafbfc; }
.table-row-clickable td { cursor: pointer; }
.table-row-clickable .actions-inline,
.table-row-clickable .actions-inline * { cursor: auto; }
.sales-contract-actions {
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}
.sales-contracts-table td,
.sales-contracts-table th {
  vertical-align: middle;
}
.sales-contracts-table .table-title {
  margin-bottom: 2px;
}
.sales-contracts-table .table-title strong { font-size: calc(14px * var(--ui-font-scale)); }
.sales-contracts-table .table-actions {
  width: 1%;
  white-space: nowrap;
}
.sales-contracts-table .statement-numdate__date {
  font-size: calc(11px * var(--ui-font-scale));
}
.payable-import-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fbff;
  margin-bottom: 18px;
}
.payable-import-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.payable-import-dropzone {
  width: 100%;
  min-height: 180px;
  border: 2px dashed #93c5fd;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fbff 0%, #eff6ff 100%);
  color: #0f172a;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 10px;
  padding: 18px;
  text-align: left;
  cursor: pointer;
}
.payable-import-dropzone.is-dragover {
  border-color: #2563eb;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}
.payable-import-summary {
  display: grid;
  gap: 12px;
}
.payable-import-files {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.payable-import-file {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  display: grid;
  gap: 4px;
}
.invoice-register-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.invoice-register-note {
  margin-top: 12px;
}
.sale-invoice-shell {
  display: grid;
  grid-template-columns: minmax(340px, 390px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.sale-invoice-sidebar {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 18px;
}
.sale-invoice-card,
.sale-invoice-stage {
  border-radius: 8px;
  border: 1px solid #dbe3ee;
  background: #ffffff;
  box-shadow: none;
}
.sale-invoice-card {
  display: grid;
  gap: 16px;
}
.sale-invoice-card--hero {
  padding: 16px;
  gap: 14px;
  background:
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.18), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
}
.sale-invoice-card .section__header,
.sale-invoice-stage .section__header {
  align-items: center;
}
.sale-invoice-card .eyebrow,
.sale-invoice-stage .eyebrow,
.sale-invoice-card--hero .eyebrow {
  letter-spacing: 0.08em;
}
.sale-invoice-card--hero h2 {
  margin: 0;
  font-size: calc(31px * var(--ui-font-scale));
  line-height: 1.05;
}
.sale-invoice-card--hero .muted {
  margin: 0;
  color: #475569;
}
.sale-invoice-status-row {
  display: flex;
  align-items: center;
}
.sale-invoice-status-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: calc(12px * var(--ui-font-scale));
  font-weight: 800;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
}
.sale-invoice-status-chip--draft {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}
.sale-invoice-status-chip--done {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}
.sale-invoice-stage .btn.ghost.active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 800;
}
.sale-invoice-status-chip--danger {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}
.sale-invoice-primary-actions,
.sale-invoice-secondary-actions,
.sale-invoice-downloads {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.sale-invoice-primary-actions .btn {
  min-width: 190px;
}
.sale-invoice-downloads .btn {
  background: #fff;
}
.sale-invoice-card .detail-grid {
  gap: 10px;
}
.sale-invoice-card .detail-item {
  border-radius: 6px;
  background: #f8fbff;
  border: 1px solid #e2e8f0;
  padding: 12px 14px;
}
.sale-invoice-documents {
  display: grid;
  gap: 12px;
}
.sale-invoice-document-card {
  display: grid;
  gap: 10px;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  padding: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}
.sale-invoice-document-card.is-active {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.sale-invoice-document-card__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.sale-invoice-document-card__top h3 {
  margin: 2px 0 0;
  font-size: calc(17px * var(--ui-font-scale));
}
.sale-invoice-document-card__badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 9px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: calc(11px * var(--ui-font-scale));
  font-weight: 800;
}
.sale-invoice-document-card.is-active .sale-invoice-document-card__badge {
  background: #dbeafe;
  color: #1d4ed8;
}
.sale-invoice-document-card__meta,
.sale-invoice-document-card__files,
.sale-invoice-document-card__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.sale-invoice-document-card__meta span,
.sale-invoice-document-card__files span {
  border-radius: 999px;
  padding: 6px 9px;
  background: #eef4fb;
  color: #334155;
  font-size: calc(12px * var(--ui-font-scale));
}
.sale-invoice-document-card__files span {
  border-radius: 7px;
  background: #f8fafc;
  color: #64748b;
}
.sale-invoice-stage {
  display: grid;
  gap: 16px;
  min-height: 78vh;
  padding-bottom: 6px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f7fafe 100%);
}
.sale-invoice-preview-body {
  min-height: 520px;
  padding: 10px;
  border-radius: 6px;
  background: linear-gradient(180deg, #edf3f9 0%, #f8fbff 100%);
}
.sale-invoice-stage .invoice-preview-sheet {
  border-radius: 6px;
  border-color: #dbe3ee;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
}
.sale-invoice-stage .invoice-preview-docbox,
.sale-invoice-stage .invoice-preview-party,
.sale-invoice-stage .invoice-preview-vat,
.sale-invoice-stage .invoice-preview-totals {
  border-radius: 6px;
  background: #fbfdff;
}
.sale-invoice-stage .btn.btn-sm {
  min-width: 72px;
}
.sale-invoice-preview-body iframe {
  width: 100%;
  min-height: 76vh;
  border: 0;
  border-radius: 10px;
  background: #e5e7eb;
}
.accounting-modal.sale-invoice-pdf-modal {
  padding: 12px;
}
.accounting-modal__panel.sale-invoice-pdf-modal__panel {
  width: min(1480px, calc(100vw - 24px));
  height: calc(100vh - 24px);
  max-height: calc(100vh - 24px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}
.accounting-modal__header.sale-invoice-pdf-modal__header {
  margin-bottom: 0;
}
.sale-invoice-pdf-modal-frame {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 8px;
  background: #e5e7eb;
}
.finance-inline-commission {
  width: 120px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  font: inherit;
}
.finance-inline-commission:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.18);
}
.finance-commission-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.finance-inline-commission[readonly],
.finance-inline-commission:disabled {
  background: #f8fafc;
  color: #475569;
}
.finance-ledger-row--invoiced {
  background: #f8fafc;
}
.finance-ledger-row--invoiced input[type="checkbox"] {
  cursor: not-allowed;
}
.receivables-filter-row {
  display: flex;
  gap: 12px;
  align-items: end;
  justify-content: space-between;
}
.receivables-filter-bar {
  flex: 1 1 auto;
}
.receivables-filter-actions {
  flex: 0 0 auto;
  justify-content: flex-end;
  white-space: nowrap;
}
.payables-filter-row {
  display: flex;
  gap: 12px;
  align-items: end;
  justify-content: space-between;
}
.payables-filter-bar {
  flex: 1 1 auto;
}
.payables-filter-actions {
  flex: 0 0 auto;
  justify-content: flex-end;
  white-space: nowrap;
}
.payables-status-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.receivables-type-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
@media (max-width: 980px) {
  .receivables-filter-row,
  .payables-filter-row {
    align-items: stretch;
    flex-direction: column;
  }
  .receivables-filter-actions,
  .payables-filter-actions {
    justify-content: flex-start;
    white-space: normal;
  }
  .payables-status-buttons {
    justify-content: flex-start;
  }
}
.finance-ledger-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 18px;
  align-items: start;
}
.finance-ledger-main {
  min-width: 0;
}
.finance-selection-panel {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 18px;
}
.finance-selection-note {
  margin: 0;
  font-size: calc(13px * var(--ui-font-scale));
  color: #475569;
}
.finance-selection-note--error {
  color: #b91c1c;
  font-weight: 700;
}
.finance-selection-note--ok {
  color: #166534;
  font-weight: 700;
}
.finance-selection-panel .btn {
  width: 100%;
}
.invoice-register-table td,
.invoice-register-table th {
  vertical-align: top;
}
.invoice-register-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  border: 1px solid transparent;
  font-size: calc(11px * var(--ui-font-scale));
  font-weight: 700;
  white-space: nowrap;
}
.invoice-register-pill--passive {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}
.invoice-register-pill--active {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}
.invoice-register-pill--credit {
  background: #fff7ed;
  border-color: #fdba74;
  color: #c2410c;
}
.invoice-register-subject strong {
  display: block;
  margin-bottom: 2px;
}
.invoice-register-number strong {
  display: block;
  margin-bottom: 2px;
}
.invoice-register-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.tulps-register-table th,
.tulps-register-table td {
  padding: 2px 4px !important;
  line-height: 1.05;
}
.tulps-register-table tbody td {
  padding-top: 1px !important;
  padding-bottom: 1px !important;
  height: calc(40px * var(--ui-font-scale));
  vertical-align: middle !important;
  overflow: hidden;
}
.tulps-register-table .table-meta {
  margin-top: 0;
  font-size: calc(9px * var(--ui-font-scale));
  line-height: 1.05;
}
.tulps-register-table tbody tr {
  height: calc(40px * var(--ui-font-scale));
}
.tulps-register-table .tulps-cell-primary {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 1.05;
}
.tulps-register-table .tulps-cell-primary strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.tulps-register-table .tulps-cell-meta {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  max-height: calc(2.1em);
}
.tulps-register-table strong {
  display: block;
  margin: 0;
  line-height: 1.02;
}
.tulps-register-table .table-actions {
  width: 150px;
  min-width: 150px;
  white-space: nowrap;
  vertical-align: middle !important;
}
.tulps-actions-header {
  width: 150px;
  min-width: 150px;
}
.tulps-row-actions {
  display: grid;
  grid-template-columns: max-content max-content;
  align-items: center;
  justify-content: end;
  gap: 3px;
  width: max-content;
  min-width: 130px;
  margin-left: auto;
  white-space: nowrap;
}
.tulps-row-actions .btn {
  white-space: nowrap;
}
.tulps-register-table .btn.btn-sm {
  min-height: calc(24px * var(--ui-font-scale));
  padding: calc(2px * var(--ui-font-scale)) calc(7px * var(--ui-font-scale));
  font-size: calc(10px * var(--ui-font-scale));
  line-height: 1;
  border-radius: 4px;
}
.tulps-print-tools {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}
.tulps-print-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 14px;
  padding: 14px;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}
.tulps-print-form strong {
  align-self: center;
  min-width: 210px;
  margin-right: 6px;
}
.tulps-print-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 150px;
  color: #475569;
  font-size: calc(12px * var(--ui-font-scale));
  font-weight: 800;
}
.tulps-print-form input,
.tulps-print-form select {
  min-height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  padding: 8px 10px;
  font-weight: 700;
}
.tulps-print-form input.tulps-readonly-number[readonly] {
  border-color: #94a3b8 !important;
  background: #e5e7eb !important;
  color: #475569 !important;
  cursor: not-allowed !important;
  box-shadow: inset 0 0 0 1px #cbd5e1;
  font-weight: 900;
}
.tulps-print-lock {
  color: #92400e;
  font-weight: 800;
}
.tulps-register-table tbody tr.tulps-row--definitive {
  background: #fffbeb;
}
.tulps-register-table tbody tr.tulps-row--definitive:hover {
  background: #fef3c7;
}
.payable-import-customer-dialog {
  max-width: 760px;
}
.payable-import-customer-dialog__body {
  display: grid;
  gap: 12px;
}
.payable-import-customer-summary {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  background: #f8fafc;
}
.payable-import-customer-summary span {
  color: #475569;
  font-size: calc(13px * var(--ui-font-scale));
}
.payable-import-customer-dialog__similar {
  display: grid;
  gap: 8px;
}
.payable-import-customer-dialog__category {
  display: grid;
  gap: 6px;
  color: #475569;
  font-size: calc(13px * var(--ui-font-scale));
  font-weight: 800;
}
.payable-import-customer-dialog__category select {
  min-height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
}
.payable-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.payable-row-actions .btn.ghost {
  background: #fff;
}
.payable-draft-installments {
  margin-top: 12px;
}
.payable-installment-due {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}
.payable-installment-due input {
  min-width: 0;
}
.payable-installment-kind {
  margin-bottom: 0;
  font-size: calc(11px * var(--ui-font-scale));
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}
.payable-installment-kind--withholding {
  color: #b45309;
}
.table-meta.payable-withholding-meta {
  font-weight: 700;
}
.table-meta.payable-withholding-meta--open {
  color: #b91c1c;
}
.table-meta.payable-withholding-meta--paid {
  color: #166534;
}
.btn.payable-edit {
  background: #e0f2fe;
  border-color: #bae6fd;
  color: #0c4a6e;
  box-shadow: none;
}
.btn.payable-edit:hover {
  transform: translateY(-1px);
  background: #dbeafe;
  border-color: #93c5fd;
}
.invoice-register-table .quote-status {
  white-space: nowrap;
}
.invoice-viewer-modal__panel {
  width: min(1180px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
}
.invoice-viewer-body {
  min-height: 420px;
}
.invoice-viewer-panel {
  min-height: 420px;
}
.invoice-viewer-panel iframe {
  width: 100%;
  min-height: 70vh;
  border: 0;
  border-radius: 10px;
  background: #e5e7eb;
}
.invoice-preview-sheet {
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.invoice-preview-sheet__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.invoice-preview-docbox {
  min-width: 220px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  display: grid;
  gap: 4px;
  text-align: right;
}
.invoice-preview-parties {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.invoice-preview-party {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  display: grid;
  gap: 4px;
}
.invoice-preview-meta {
  margin: 0;
  color: #475569;
  font-size: calc(13px * var(--ui-font-scale));
}
.invoice-preview-causals {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: #f8fafc;
  color: #334155;
  font-size: calc(13px * var(--ui-font-scale));
}
.invoice-preview-causals .eyebrow {
  margin-bottom: 0;
}
.invoice-preview-description-trigger {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.invoice-preview-description-trigger:hover {
  color: #1d4ed8;
}
.invoice-preview-edit-trigger {
  width: 100%;
  padding: 3px 4px;
  border: 1px dashed transparent;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.invoice-preview-edit-trigger:hover {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}
.invoice-preview-vat-select {
  min-width: 110px;
  min-height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  font-size: calc(13px * var(--ui-font-scale));
}
.invoice-preview-customer-change {
  justify-self: start;
  margin-top: 6px;
}
.invoice-preview-inline-editor {
  display: grid;
  gap: 8px;
}
.invoice-preview-inline-editor input {
  width: 100%;
  min-width: 120px;
}
.invoice-preview-description-editor {
  display: grid;
  gap: 8px;
}
.invoice-preview-description-editor input {
  width: 100%;
}
.invoice-preview-description-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.invoice-preview-footer {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(220px, 0.8fr);
  gap: 16px;
}
.invoice-preview-payment {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
}
.invoice-preview-payment > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 6px;
}
.invoice-preview-payment > div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.invoice-preview-payment span {
  color: #64748b;
  font-size: calc(12px * var(--ui-font-scale));
  font-weight: 800;
}
.invoice-preview-payment strong {
  text-align: right;
}
.invoice-preview-vat {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  display: grid;
  gap: 8px;
}
.invoice-preview-vat__row,
.invoice-preview-totals div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}
.invoice-preview-totals {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  display: grid;
  gap: 8px;
}
.invoice-preview-totals div {
  grid-template-columns: minmax(0, 1fr) auto;
}
.table-image {
  width: 72px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #e5e7eb;
}
.table-title { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.table-title strong { font-size: calc(14px * var(--ui-font-scale)); letter-spacing: -0.01em; }
.table-meta { color: var(--muted); font-size: calc(12px * var(--ui-font-scale)); line-height: 1.35; }
.vehicle-price-cell {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.status-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  vertical-align: middle;
}
.status-dot--danger {
  background: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.16);
}
.deed-payment-toggle {
  width: 34px;
  height: 34px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #f3f4f6;
  color: #4b5563;
  font-size: calc(18px * var(--ui-font-scale));
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}
.deed-payment-toggle svg {
  width: 18px;
  height: 18px;
  display: block;
  margin: 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.deed-payment-toggle.is-empty {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #4b5563;
}
.deed-payment-toggle.is-partial {
  background: #ffedd5;
  border-color: #fdba74;
  color: #c2410c;
}
.deed-payment-toggle.is-balanced {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}
.deed-payment-toggle.is-over {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}
.deed-payment-toggle:hover,
.deed-payment-toggle.is-open {
  background: #dbeafe;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.deed-toggle-cell {
  width: 1%;
  white-space: nowrap;
  text-align: center;
}
.deed-actions-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.deed-document-toggle.is-loaded {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}
.deed-payments-expanded-row td {
  background: #f8fbff;
  padding: 0;
}
.deed-documents-expanded-row td {
  background: #f8fbff;
  padding: 0;
}
.deed-payments-panel {
  padding: 16px 18px;
}
.deed-payments-panel__header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.deed-payments-panel__total {
  margin-left: auto;
  color: #0f172a;
  font-size: calc(13px * var(--ui-font-scale));
  font-weight: 700;
}
.deed-payments-panel__body {
  display: grid;
  gap: 12px;
}
.deed-payment-row {
  display: grid;
  grid-template-columns: minmax(120px, 150px) minmax(180px, 220px) minmax(220px, 1fr) auto auto auto;
  gap: 12px;
  align-items: end;
  padding: 12px;
  border: 1px solid #dbe7f5;
  border-radius: 10px;
  background: #ffffff;
}
.deed-payment-row__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}
.deed-payment-row__actions--top {
  grid-column: 6;
  grid-row: 1;
  align-self: center;
}
.deed-payment-row__description {
  grid-column: 1 / -1;
}
.deed-payment-row__status {
  grid-column: 5;
  grid-row: 1;
  display: flex;
  align-items: center;
  min-height: 42px;
}
.deed-payment-posted {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #374151;
  font-size: calc(12px * var(--ui-font-scale));
  font-weight: 700;
}
.deed-payment-posted.is-posted {
  background: #dcfce7;
  color: #166534;
}
.deed-documents-panel {
  padding: 16px 18px;
}
.deed-documents-panel__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.deed-documents-panel__meta {
  color: #475569;
  font-size: calc(13px * var(--ui-font-scale));
  font-weight: 600;
}
.deed-documents-dropzone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 92px;
  padding: 16px 18px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.deed-documents-dropzone strong {
  display: block;
  color: #0f172a;
  font-size: calc(14px * var(--ui-font-scale));
  margin-bottom: 4px;
}
.deed-documents-dropzone p {
  margin: 0;
}
.deed-documents-dropzone.is-loaded {
  border-color: #86efac;
  background: #f0fdf4;
}
.deed-documents-dropzone.is-dragover {
  border-color: #60a5fa;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.deed-documents-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
@media (max-width: 980px) {
  .deed-payment-row {
    grid-template-columns: 1fr;
  }
  .deed-payment-row__status {
    min-height: 0;
  }
  .deed-documents-panel__header,
  .deed-documents-dropzone,
  .deed-documents-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .causal-picker-modal__split.is-create-open {
    grid-template-columns: 1fr;
  }
  .causal-picker-trigger {
    flex-direction: column;
  }
}
.table-actions {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}
.table-row-menu {
  position: relative;
  display: inline-flex;
  justify-content: flex-end;
}
.table-row-menu__toggle {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
  font-size: calc(18px * var(--ui-font-scale));
  line-height: 1;
  cursor: pointer;
}
.table-row-menu__toggle:hover {
  border-color: #93c5fd;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}
.table-row-menu__list {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 190px;
  z-index: 1200;
  display: none;
  flex-direction: column;
  padding: 6px;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  box-shadow: var(--shadow);
}
.table-row-menu.is-open .table-row-menu__list {
  display: flex;
}
.table-row-menu__item {
  border: 1px solid transparent;
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  font-size: calc(13px * var(--ui-font-scale));
  font-weight: 600;
  text-align: left;
  padding: 8px 10px;
  cursor: pointer;
}
.table-row-menu__item:hover {
  background: #f8fafc;
  border-color: var(--border);
}
.table-row-menu__item--danger {
  color: #b91c1c;
}
.table-row-menu__item--danger:hover {
  background: #fee2e2;
  border-color: #fecaca;
}
.vehicle-branch-modal__panel {
  width: min(460px, 100%);
}
.vehicle-branch-modal__body {
  display: grid;
  gap: 10px;
}
.statement-numdate {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 110px;
}
.statement-numdate__id {
  color: var(--text);
  font-size: calc(13px * var(--ui-font-scale));
  font-weight: 700;
  line-height: 1.2;
}
.statement-numdate__date {
  color: var(--muted);
  font-size: calc(11px * var(--ui-font-scale));
  line-height: 1.2;
}
.sale-type-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  padding: 5px 8px;
  width: fit-content;
  font-size: calc(12px * var(--ui-font-scale));
  font-weight: 700;
  border: 1px solid transparent;
}
.sale-type-tag--mandato {
  background: #f5edff;
  border-color: #ddd6fe;
  color: #6d28d9;
}
.sale-type-tag--acquisto {
  background: #ffedd5;
  border-color: #fdba74;
  color: #9a3412;
}
.sale-type-tag--unknown {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #3730a3;
}
.statement-col-orange {
  background: #fff4e8;
  color: #9a3412;
  font-weight: 600;
}
.statement-col-green {
  background: #ecfdf3;
  color: #166534;
  font-weight: 600;
}
.statement-money-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.statement-money-cell .table-meta {
  font-weight: 600;
}
.statement-expanded-row .deed-payment-row {
  grid-template-columns: minmax(110px, 130px) minmax(140px, 160px) minmax(180px, 220px) minmax(220px, 1fr) auto auto auto;
}
.statement-expanded-row .deed-payment-row__actions--top {
  grid-column: 7;
}
.statement-expanded-row .deed-payment-row__status {
  grid-column: 6;
}
.vehicle-card__img {
  width: 96px;
  height: 64px;
  border-radius: 6px;
  overflow: hidden;
  background: #e5e7eb;
}
.vehicle-card__img.large {
  width: 180px;
  height: 120px;
}
.vehicle-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vehicle-card__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
}
.vehicle-card__title strong { font-size: calc(15px * var(--ui-font-scale)); }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: calc(12px * var(--ui-font-scale));
  font-weight: 700;
  text-transform: capitalize;
}
.badge--available { background: #ffedd5; color: #9a3412; }
.badge--sold { background: #dcfce7; color: #166534; }
.badge--delivered { background: #e0f2fe; color: #075985; }
.badge--returned { background: #fce8ef; color: #9f1239; }
.badge--temporary { background: #e2e8f0; color: #0f172a; }
.load-type-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: calc(12px * var(--ui-font-scale));
  font-weight: 700;
  white-space: nowrap;
}
.load-type-tag--mandato {
  background: #ede9fe;
  color: #6d28d9;
}
.load-type-tag--acquisto {
  background: #dbeafe;
  color: #1d4ed8;
}

.vehicle-meta { margin: 0; color: var(--muted); font-size: calc(13px * var(--ui-font-scale)); }
.vehicle-meta strong { color: var(--text); }
.vehicle-footer { margin: 6px 0 0; font-size: calc(13px * var(--ui-font-scale)); color: var(--muted); }
.vehicle-detail__header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}
.vehicle-detail__info { display: flex; flex-direction: column; gap: 6px; }
.vehicle-view {
  margin-bottom: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 10px;
}
.view-tab {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 12px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}
.view-tab.is-active {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}
.view-panel { display: none; }
.view-panel.is-active { display: block; }
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}
.detail-item {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 11px;
  background: #fff;
}
.detail-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: calc(11px * var(--ui-font-scale));
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.detail-value {
  margin: 0;
  font-weight: 700;
  font-size: calc(14px * var(--ui-font-scale));
  color: var(--text);
  word-break: break-word;
}
.detail-accessories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.detail-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: calc(13px * var(--ui-font-scale));
  font-weight: 700;
}
.vehicle-costs-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 10px;
}
.detail-empty {
  color: var(--muted);
  font-size: calc(14px * var(--ui-font-scale));
}
.hidden { display: none; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.vehicle-gallery { margin-top: 12px; }
.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.gallery-header h4 { margin: 0; }
.gallery-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.gallery-item {
  position: relative;
  width: 80px;
  height: 64px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  flex: 0 0 auto;
}
.gallery-item a { display: block; width: 100%; height: 100%; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-item.is-default {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.gallery-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  border: none;
  font-size: calc(12px * var(--ui-font-scale));
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-default {
  position: absolute;
  bottom: -6px;
  left: -6px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #fff;
  color: #0f172a;
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-default svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}
.gallery-item.is-default .gallery-default {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.gallery-item.is-default .gallery-default svg { fill: currentColor; }
.gallery-add {
  width: 80px;
  height: 64px;
  border: 2px dashed var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: calc(24px * var(--ui-font-scale));
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.footer {
  padding: 18px 24px 28px;
  border-top: 1px solid var(--border);
  background: #f8fafc;
  text-align: center;
}

.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: calc(12px * var(--ui-font-scale)); color: var(--muted); margin: 0; }

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.chip {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 20px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.1s ease;
}
.chip:hover { border-color: var(--accent); }
.chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.chip.has-alert {
  position: relative;
  padding-right: 20px;
}
.chip.has-alert::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #dc2626;
  box-shadow: 0 0 0 2px #fff;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  align-items: end;
}
.filter-bar input[type="search"] {
  min-width: 0;
}
.filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 600;
  color: var(--text);
  font-size: calc(12px * var(--ui-font-scale));
}
.filter-bar .filter-field input,
.filter-bar .filter-field select {
  width: 100%;
  height: calc(42px * var(--ui-font-scale));
  min-height: calc(42px * var(--ui-font-scale));
  padding: 0 calc(12px * var(--ui-font-scale));
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: calc(14px * var(--ui-font-scale));
  line-height: 1.2;
  background: #fff;
  color: var(--text);
}
.filter-bar .filter-field input:focus,
.filter-bar .filter-field select:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.filter-search {
  width: 100%;
  background: #fff;
}
.period-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.sales-filter-shortcuts {
  display: grid;
  grid-template-columns: max-content 1fr;
  justify-content: stretch;
  align-items: center;
  column-gap: 24px;
}
.sales-filter-shortcuts__left,
.sales-filter-shortcuts__right {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sales-filter-shortcuts__right {
  justify-content: flex-end;
}
.period-btn {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  padding: 8px 12px;
  font-size: calc(13px * var(--ui-font-scale));
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.period-btn:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}
.period-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.accounting-toolbar {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.sales-contracts-table colgroup col,
.finance-ledger-table colgroup col,
.payables-ledger-table colgroup col {
  width: auto;
}
.accounting-account-context {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.accounting-account-context__main {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: min(440px, 100%);
  flex: 1;
}
.accounting-account-context__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.accounting-account-context__select {
  width: min(520px, 100%);
  max-width: 100%;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: calc(14px * var(--ui-font-scale));
  font-weight: 700;
}
.accounting-account-context__select:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.accounting-account-context__hint {
  margin: 0;
  font-size: calc(13px * var(--ui-font-scale));
}
.accounting-layout-grid {
  grid-template-columns: 2fr 1fr;
  gap: 12px;
}
.accounting-form-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.accounting-form-grid__wide {
  grid-column: span 2;
}
.accounting-readonly-input {
  background: #f8fafc;
  color: #111827;
  font-weight: 700;
}
.accounting-inline-form {
  display: grid;
  grid-template-columns: 1fr 180px 140px auto;
  align-items: end;
  gap: 8px;
}
.accounting-causals-table-wrap {
  margin-top: 12px;
  max-height: 360px;
}
.accounting-totals {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}
.accounting-total {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 7px 10px;
  background: #fff;
  font-size: calc(12px * var(--ui-font-scale));
  color: var(--text);
}
.accounting-total strong {
  font-size: calc(12px * var(--ui-font-scale));
}
.accounting-total--entry {
  background: #ecfdf3;
  border-color: #bbf7d0;
  color: #166534;
}
.accounting-total--exit {
  background: #fff4e8;
  border-color: #fed7aa;
  color: #9a3412;
}
.accounting-total--transfer {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #3730a3;
}
.accounting-type {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 2px 8px;
  font-size: calc(11px * var(--ui-font-scale));
  font-weight: 700;
  white-space: nowrap;
}
.accounting-type--entry {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}
.accounting-type--exit {
  background: #ffedd5;
  border-color: #fdba74;
  color: #9a3412;
}
.accounting-type--transfer {
  background: #e0e7ff;
  border-color: #a5b4fc;
  color: #3730a3;
}
.entry-description-field {
  grid-column: 1 / -1;
}
.entry-causal-field {
  grid-column: span 2;
}
.entry-subject-picker-field {
  grid-column: span 2;
}
.accounting-installments {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  background: #f8fafc;
}
.accounting-lock-note {
  margin: 0 0 8px;
  color: #9a3412;
  font-size: calc(12px * var(--ui-font-scale));
  font-weight: 700;
}
.accounting-installment-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.accounting-installment-row:last-child {
  margin-bottom: 0;
}
.accounting-installment-row .btn {
  margin-left: auto;
}
.accounting-modal[hidden] {
  display: none !important;
}
.accounting-modal {
  position: fixed;
  inset: 0;
  z-index: 1020;
  display: grid;
  place-items: center;
  padding: 20px;
}
.accounting-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
}
.accounting-modal__panel {
  position: relative;
  width: min(740px, 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  box-shadow: var(--shadow);
}
.accounting-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.accounting-modal__header h3 {
  margin: 0;
}
.accounting-modal__meta {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: calc(13px * var(--ui-font-scale));
}
.accounting-alert-text {
  color: #b91c1c;
  font-weight: 700;
}
.accounting-row-alert {
  background: #fffaf4;
}
.accounting-row-focus {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
}

.vehicle-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}
.vehicle-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.app-dialog-backdrop {
  position: fixed;
  inset: 0;
  /* Sopra a tutti i modal (picker 1010, accounting 1020): i dialog devono sempre stare in cima. */
  z-index: 2000;
  background: rgba(15, 23, 42, 0.45);
  display: grid;
  place-items: center;
  padding: 24px;
}
.app-dialog {
  width: min(calc(520px + ((var(--ui-font-scale) - 1) * 140px)), 100%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  padding: 16px;
}
.app-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.app-dialog__title {
  margin: 0;
  font-size: calc(18px * var(--ui-font-scale));
  flex: 1 1 220px;
  min-width: 0;
}
.app-dialog__badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: calc(12px * var(--ui-font-scale));
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.app-dialog__badge--info {
  background: #dbeafe;
  color: #1d4ed8;
}
.app-dialog__badge--success {
  background: #dcfce7;
  color: #15803d;
}
.app-dialog__badge--error {
  background: #fee2e2;
  color: #b91c1c;
}
.app-dialog__message {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
  font-size: calc(15px * var(--ui-font-scale));
  white-space: pre-wrap;
}
.app-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.quote-customer-field {
  grid-column: 1 / -1;
}
.quote-customer-picker {
  margin-top: 6px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.quote-customer-picker input {
  margin-top: 0;
  background: #f8fafc;
  cursor: pointer;
}
.quote-customer-picker input.field-invalid {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
  background: #fff7f7;
}
.field-invalid-text {
  color: #b91c1c;
}
.quote-customer-picker .btn {
  padding: calc(10px * var(--ui-font-scale)) calc(12px * var(--ui-font-scale));
  white-space: nowrap;
}

.customer-picker-modal[hidden] {
  display: none !important;
}
.customer-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 1010;
  display: grid;
  place-items: center;
  padding: 18px;
}
.customer-picker-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}
.customer-picker-modal__panel {
  position: relative;
  width: min(calc(920px + ((var(--ui-font-scale) - 1) * 220px)), 100%);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}
.customer-picker-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}
.customer-picker-modal__header h3 {
  margin: 0;
  font-size: calc(19px * var(--ui-font-scale));
  flex: 1 1 260px;
  min-width: 0;
}
.customer-picker-modal__close {
  padding: calc(8px * var(--ui-font-scale)) calc(12px * var(--ui-font-scale));
  flex: 0 0 auto;
  align-self: flex-start;
}
.customer-picker-modal__body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}
.customer-picker-modal__toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.customer-picker-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.customer-picker-filter {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  padding: calc(8px * var(--ui-font-scale)) calc(12px * var(--ui-font-scale));
  font-size: calc(12px * var(--ui-font-scale));
  font-weight: 800;
  cursor: pointer;
}
.customer-picker-filter.is-active {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #075985;
}
.customer-picker-modal__split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
}
.customer-picker-modal__split.is-create-open {
  grid-template-columns: minmax(280px, 0.9fr) minmax(420px, 1.1fr);
}
.customer-picker-modal__panel--expanded {
  width: min(calc(1240px + ((var(--ui-font-scale) - 1) * 320px)), 100%);
}
.customer-picker-modal__results-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  min-width: 0;
}
.customer-picker-modal__search-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: calc(13px * var(--ui-font-scale));
  font-weight: 700;
}
.customer-picker-modal__search {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  padding: calc(10px * var(--ui-font-scale)) calc(12px * var(--ui-font-scale));
  font-size: calc(14px * var(--ui-font-scale));
  line-height: 1.35;
  min-height: calc(40px * var(--ui-font-scale));
}
.customer-picker-modal__search:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.customer-picker-modal__results {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  overflow: auto;
  min-height: 220px;
  max-height: 52vh;
}
.customer-picker-item {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  padding: 12px 14px;
  border: none;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}
.customer-picker-item__content {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
}
.customer-picker-item__actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
  flex: 0 0 auto;
}
.customer-picker-item__action {
  white-space: nowrap;
}
.customer-picker-item:last-child {
  border-bottom: none;
}
.customer-picker-item:hover {
  background: #f8fafc;
}
.customer-picker-item.is-highlighted {
  background: #eff6ff;
  box-shadow: inset 3px 0 0 #2563eb;
}
.customer-picker-item__main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.customer-picker-item__badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: calc(11px * var(--ui-font-scale));
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.customer-picker-item__meta {
  color: var(--muted);
  font-size: calc(13px * var(--ui-font-scale));
}
.customer-picker-item--empty {
  cursor: default;
  color: var(--muted);
}
.customer-picker-item--empty:hover {
  background: #fff;
}
.customer-picker-modal__create {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  overflow: auto;
}
.customer-picker-modal__create .grid.two-columns,
.causal-picker-modal__panel .grid.two-columns,
.payable-inline-editor .grid.two-columns,
.app-dialog .grid.two-columns {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 12px;
}
.customer-picker-modal__create.hidden,
.customer-picker-modal__create[hidden] {
  display: none !important;
}
/* Form "Nuovo soggetto": etichette sopra i campi, larghezze uniformi e allineate. */
.customer-picker-modal__create .grid > label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
  min-width: 0;
  font-weight: 650;
  font-size: calc(12px * var(--ui-font-scale));
  color: var(--text);
  letter-spacing: -0.01em;
}
.customer-picker-modal__create .grid > label.hidden {
  display: none;
}
.customer-picker-modal__create .grid > label > input,
.customer-picker-modal__create .grid > label > select,
.customer-picker-modal__create .grid > label > textarea {
  width: 100%;
  margin: 0;
  box-sizing: border-box;
  padding: calc(8px * var(--ui-font-scale)) calc(10px * var(--ui-font-scale));
  border: 1px solid var(--border, #d1d5db);
  border-radius: 6px;
  background: #fff;
  font: inherit;
  font-weight: 500;
}
.customer-picker-modal__create .grid > label > textarea {
  resize: vertical;
  min-height: 64px;
}
/* Note e ragione sociale occupano tutta la riga. */
.customer-picker-modal__create .grid > label:has(textarea),
.customer-picker-modal__create .grid > label:has(input[id$="-create-company-name"]):not(.hidden) {
  grid-column: 1 / -1;
}
.customer-picker-modal__create .form-actions {
  margin-top: 2px;
}
.customer-picker-modal__create-header h4 {
  margin: 0;
  font-size: calc(15px * var(--ui-font-scale));
}
.customer-picker-modal__create-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: calc(12px * var(--ui-font-scale));
}
.causal-picker-modal__panel {
  width: min(calc(980px + ((var(--ui-font-scale) - 1) * 200px)), 100%);
  padding: 16px;
}
.causal-picker-modal__toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.causal-picker-modal__search-wrap {
  min-width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: calc(13px * var(--ui-font-scale));
  font-weight: 700;
}
.causal-picker-modal__split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}
.causal-picker-modal__split.is-create-open {
  grid-template-columns: minmax(280px, 1fr) minmax(360px, 0.95fr);
}
.causal-picker-trigger {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.causal-picker-trigger__display {
  flex: 1 1 auto;
  min-width: 0;
  background: #f8fafc;
}

.payable-groups-search-field {
  margin-top: 12px;
}
.payable-groups-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
  gap: 18px;
}
.payable-groups-layout--modal {
  grid-template-columns: minmax(300px, 0.95fr) minmax(360px, 1.05fr);
  width: 100%;
}
.payable-pane {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 14px;
  min-height: 420px;
  min-width: 0;
}
.payable-pane__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}
.payable-pane__header h3 {
  margin: 4px 0;
  font-size: calc(20px * var(--ui-font-scale));
}
.payable-items-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.payable-inline-editor {
  margin-top: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: linear-gradient(180deg, #eff6ff 0%, #f8fbff 100%);
}
.payable-inline-editor h4 {
  margin: 0 0 10px;
  font-size: calc(16px * var(--ui-font-scale));
}
.payable-item-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid #dbe5ef;
  border-radius: 8px;
  background: #fff;
}
.payable-item-card.is-active {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
  background: #f8fbff;
}
.payable-item-card--static {
  align-items: flex-start;
}
.payable-item-card__content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.payable-item-card__select {
  width: 100%;
  border: none;
  padding: 0;
  background: transparent;
  text-align: left;
  color: inherit;
  cursor: pointer;
}
.payable-item-card__select strong,
.payable-item-card__content strong {
  display: block;
  font-size: calc(16px * var(--ui-font-scale));
  line-height: 1.2;
}
.payable-item-subtitle {
  color: var(--muted);
  font-size: calc(12px * var(--ui-font-scale));
  font-weight: 700;
}
.payable-item-count {
  min-width: 30px;
  text-align: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: calc(12px * var(--ui-font-scale));
  font-weight: 800;
}
.payable-expense-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #fff;
}
.payable-expense-row--empty {
  color: var(--muted);
  border-style: dashed;
  background: #f8fafc;
}

@media (max-width: 1180px) {
  .contract-form-shell {
    grid-template-columns: 1fr;
  }
  .contract-summary-rail {
    position: static;
  }
  .customer-picker-modal__split.is-create-open,
  .payable-groups-layout--modal {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1120px) {
  .causal-picker-modal__split.is-create-open {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .contract-transfer-price-grid {
    grid-template-columns: 1fr;
  }
  .contract-service-row {
    grid-template-columns: 1fr;
  }
  .contract-service-row__remove {
    width: 100%;
  }
  .customer-picker-modal__toolbar {
    align-items: stretch;
  }
  .customer-picker-modal__split {
    grid-template-columns: 1fr;
  }
  .customer-picker-item {
    flex-direction: column;
  }
  .customer-picker-item__actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  .payable-groups-layout {
    grid-template-columns: 1fr;
  }
  .payable-pane__header,
  .payable-item-card,
  .payable-expense-row {
    flex-direction: column;
    align-items: stretch;
  }
}

.quote-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid transparent;
  font-size: calc(12px * var(--ui-font-scale));
  font-weight: 700;
}
.quote-status--open {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}
.quote-status--concluded {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}
.quote-status--partial {
  background: #ffedd5;
  border-color: #fdba74;
  color: #9a3412;
}
.quote-status--cancelled {
  background: #fee2e2;
  border-color: #fecaca;
  color: #991b1b;
}
.pdf-action-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #1f2933;
}
.pdf-action-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pdf-action-btn:hover {
  border-color: #93c5fd;
  color: #1d4ed8;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.e-invoicing-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.e-invoicing-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}

.e-invoicing-module h3 {
  margin: 4px 0 8px;
}

.e-invoicing-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: #334155;
}

.e-invoicing-list li + li {
  margin-top: 6px;
}

.e-invoicing-import-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.e-invoicing-dropzone {
  width: 100%;
  min-height: 240px;
  border: 2px dashed #93c5fd;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fbff 0%, #eff6ff 100%);
  color: #0f172a;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 10px;
  padding: 20px;
  text-align: left;
  cursor: pointer;
}

.e-invoicing-dropzone.is-dragover {
  border-color: #2563eb;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.e-invoicing-import-summary {
  display: grid;
  gap: 14px;
}

@media (max-width: 900px) {
  .e-invoicing-hero,
  .e-invoicing-import-layout,
  .finance-ledger-shell,
  .sale-invoice-shell,
  .invoice-register-hero,
  .payable-import-layout,
  .invoice-preview-sheet__header,
  .invoice-preview-parties,
  .invoice-preview-footer {
    grid-template-columns: 1fr;
    display: grid;
  }
  .sale-invoice-sidebar {
    position: static;
  }
  .finance-selection-panel {
    position: static;
  }
}
.quote-print-area {
  margin-top: 0;
}
.quote-print-sheet {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 18px;
  box-shadow: none;
  max-width: 980px;
}
.contract-print-area {
  margin-top: 0;
}
.contract-print-sheet {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 18px;
  box-shadow: none;
  max-width: 980px;
}
.contract-vehicle-specs {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 6px;
}
.contract-grid-two {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 8px;
}
.contract-box {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px;
  background: #fff;
}
.contract-box__note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: calc(12px * var(--ui-font-scale));
  white-space: pre-wrap;
}
.quote-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}
.quote-head h2 {
  margin: 0 0 4px;
  font-size: calc(22px * var(--ui-font-scale));
  letter-spacing: -0.02em;
}
.quote-head p {
  margin: 2px 0;
  font-size: calc(12px * var(--ui-font-scale));
}
.quote-head__box {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 10px;
  min-width: 180px;
  text-align: right;
  background: #f7f9fc;
}
.quote-head__box p {
  margin: 2px 0;
}
.quote-vehicle {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 12px;
  margin-top: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}
.quote-vehicle__image {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #f5f7fa;
}
.quote-vehicle__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.quote-vehicle__details h3 {
  margin: 0;
  font-size: calc(22px * var(--ui-font-scale));
  letter-spacing: -0.02em;
}
.quote-vehicle__details p {
  margin: 4px 0 0;
  color: #4b5563;
  font-size: calc(12px * var(--ui-font-scale));
}
.quote-vehicle__specs {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 6px;
}
.quote-spec {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 7px 8px;
  background: #f7f9fc;
}
.quote-spec span {
  display: block;
  color: #6b7280;
  font-size: calc(11px * var(--ui-font-scale));
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.quote-spec strong {
  display: block;
  margin-top: 4px;
  color: #111827;
  font-size: calc(14px * var(--ui-font-scale));
}
.quote-section-title {
  margin: 0 0 6px;
  font-size: calc(11px * var(--ui-font-scale));
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #6b7280;
  font-weight: 800;
}
.quote-customer {
  margin-top: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}
.quote-customer p {
  margin: 2px 0;
  font-size: calc(12px * var(--ui-font-scale));
}
.quote-financial {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.quote-financial__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--border);
  font-size: calc(12px * var(--ui-font-scale));
}
.quote-financial__row:last-child {
  border-bottom: none;
}
.quote-financial__row--total {
  background: #f1f5fb;
  font-weight: 700;
}
.quote-financial__row strong {
  font-variant-numeric: tabular-nums;
}
.quote-notes {
  margin-top: 10px;
}
.quote-notes p {
  margin: 0;
  white-space: pre-wrap;
}
.quote-accessories {
  margin-top: 12px;
}
.quote-accessories__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.quote-footer {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.quote-footer p {
  margin: 0;
  color: #6b7280;
  font-size: calc(11px * var(--ui-font-scale));
}
.quote-footer strong {
  display: block;
  margin-top: 3px;
  font-size: calc(12px * var(--ui-font-scale));
}
.quote-footer__signature {
  min-width: 280px;
  border-top: 1px solid #9ca3af;
  padding-top: 8px;
  margin-top: 14px;
}

.mandate-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.78fr);
  gap: 16px;
  align-items: start;
}

.mandate-main-card,
.mandate-side-card {
  min-width: 0;
}

.mandate-main-card {
  padding: 16px;
}

.mandate-hero {
  display: grid;
  grid-template-columns: minmax(260px, 0.55fr) minmax(0, 1fr);
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.mandate-hero__image {
  width: 100%;
  aspect-ratio: 16 / 11;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #f8fafc 0%, #e5edf8 100%);
}

.mandate-hero__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mandate-hero__content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mandate-hero__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.mandate-hero__header h2 {
  margin: 4px 0 0;
  font-size: calc(clamp(1.45rem, 1.1rem + 0.55vw, 1.9rem) * var(--ui-font-scale));
  letter-spacing: -0.03em;
}

.mandate-hero__header .muted {
  margin: 6px 0 0;
  max-width: 72ch;
}

.mandate-status-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  min-width: 220px;
}

.mandate-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--text);
  font-size: calc(12px * var(--ui-font-scale));
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mandate-status-chip[data-tone="warning"] {
  background: #fff7ed;
  border-color: #fdba74;
  color: #9a3412;
}

.mandate-status-chip[data-tone="ready"] {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.mandate-status-chip[data-tone="done"] {
  background: #ecfdf5;
  border-color: #86efac;
  color: #166534;
}

.mandate-summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.mandate-stat {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 11px;
  background: #f8fafc;
}

.mandate-stat p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: calc(11px * var(--ui-font-scale));
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.mandate-stat strong {
  display: block;
  margin: 0;
  color: var(--text);
  font-size: calc(14px * var(--ui-font-scale));
  font-weight: 800;
  word-break: break-word;
}

.mandate-panel-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mandate-panel {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.mandate-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.mandate-panel__header h3 {
  margin: 4px 0 0;
  font-size: calc(1.02rem * var(--ui-font-scale));
  letter-spacing: -0.02em;
}

.mandate-customer-block__name {
  margin: 0;
  font-size: calc(18px * var(--ui-font-scale));
  font-weight: 800;
  letter-spacing: -0.02em;
}

.mandate-customer-block p {
  margin: 4px 0;
  word-break: break-word;
}

.mandate-inline-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.mandate-fact {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  background: #f8fafc;
}

.mandate-fact--highlight {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.mandate-fact__label {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: calc(11px * var(--ui-font-scale));
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.mandate-fact__value {
  margin: 0;
  color: var(--text);
  font-size: calc(14px * var(--ui-font-scale));
  font-weight: 700;
  word-break: break-word;
  white-space: pre-wrap;
}

.mandate-note-card {
  margin-top: 10px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 10px 11px;
  background: #f8fafc;
}

.mandate-note-card p:last-child {
  margin: 6px 0 0;
  white-space: pre-wrap;
}

.mandate-document-card {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 12px;
  background: linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
}

.mandate-document-card__title {
  margin: 0;
  font-size: calc(18px * var(--ui-font-scale));
  font-weight: 800;
  letter-spacing: -0.02em;
}

.mandate-document-card .muted {
  margin: 6px 0 0;
}

.mandate-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mandate-side-card {
  padding: 14px;
}

.mandate-side-card h3 {
  margin: 6px 0 8px;
  letter-spacing: -0.02em;
}

.mandate-side-card--hint {
  background: #f8fafc;
}

.mandate-readiness-meter {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
  margin: 10px 0 12px;
}

.mandate-readiness-meter__bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #93c5fd 0%, #2563eb 100%);
  transition: width 0.18s ease;
}

.mandate-readiness-meter__bar[data-tone="warning"] {
  background: linear-gradient(90deg, #fdba74 0%, #ea580c 100%);
}

.mandate-readiness-meter__bar[data-tone="ready"] {
  background: linear-gradient(90deg, #93c5fd 0%, #2563eb 100%);
}

.mandate-readiness-meter__bar[data-tone="done"] {
  background: linear-gradient(90deg, #86efac 0%, #16a34a 100%);
}

.mandate-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mandate-checklist__item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
}

.mandate-checklist__item[data-tone="warning"] {
  background: #fff7ed;
  border-color: #fdba74;
}

.mandate-checklist__item[data-tone="ready"] {
  background: #eff6ff;
  border-color: #93c5fd;
}

.mandate-checklist__item[data-tone="done"] {
  background: #ecfdf5;
  border-color: #86efac;
}

.mandate-checklist__icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: calc(12px * var(--ui-font-scale));
  font-weight: 800;
  background: #f3f4f6;
  color: #374151;
}

.mandate-checklist__item[data-tone="warning"] .mandate-checklist__icon {
  background: #fed7aa;
  color: #9a3412;
}

.mandate-checklist__item[data-tone="ready"] .mandate-checklist__icon {
  background: #bfdbfe;
  color: #1d4ed8;
}

.mandate-checklist__item[data-tone="done"] .mandate-checklist__icon {
  background: #bbf7d0;
  color: #166534;
}

.mandate-checklist__text {
  margin: 1px 0 0;
  color: var(--text);
  font-size: calc(13px * var(--ui-font-scale));
  font-weight: 600;
  line-height: 1.45;
}

@media (max-width: 860px) {
  .quote-vehicle {
    grid-template-columns: 1fr;
  }
  .mandate-hero {
    grid-template-columns: 1fr;
  }
  .mandate-panel-grid {
    grid-template-columns: 1fr;
  }
  .quote-footer {
    flex-direction: column;
  }
  .quote-footer__signature {
    min-width: 0;
  }
  .accounting-layout-grid {
    grid-template-columns: 1fr;
  }
  .accounting-inline-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1200px) {
  .mandate-workspace {
    grid-template-columns: 1fr;
  }
}

@media print {
  .sidebar,
  .topbar,
  .no-print,
  .section__header {
    display: none !important;
  }
  body,
  .main,
  .app {
    margin: 0;
    padding: 0;
    background: #fff;
  }
  .app {
    display: block;
    min-height: auto;
  }
  .quote-print-area {
    margin: 0;
  }
  .quote-print-sheet {
    border: none;
    box-shadow: none;
    border-radius: 0;
    max-width: none;
    width: 100%;
    padding: 0;
  }
  .contract-print-sheet {
    border: none;
    box-shadow: none;
    border-radius: 0;
    max-width: none;
    width: 100%;
    padding: 0;
  }
}

@media (max-width: 700px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; }
  .sidebar__footer { margin-top: 0; }
  .main { padding: 18px 16px 30px; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .topbar__meta { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
  .section__header { align-items: flex-start; }
  .quote-customer-picker {
    grid-template-columns: 1fr;
  }
  .customer-picker-modal {
    padding: 12px;
  }
  .customer-picker-modal__panel {
    max-height: 90vh;
  }
}
.payable-status-dot {
  width: 34px;
  height: 34px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #f3f4f6;
  color: #4b5563;
  font-size: calc(14px * var(--ui-font-scale));
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.payable-status-dot svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.payable-status-dot.is-empty {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #4b5563;
}

.payable-status-dot.is-partial {
  background: #ffedd5;
  border-color: #fdba74;
  color: #c2410c;
}

.payable-status-dot.is-balanced {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.payable-status-dot.is-over {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.payable-status-dot:hover,
.payable-status-dot.is-open {
  background: #dbeafe;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.payable-expanded-row td {
  background: #f8fbff;
}

.payable-inline-panel {
  padding: 0.75rem 0;
}

.payable-installment-paybox {
  display: grid;
  grid-template-columns: 160px 160px auto 120px;
  gap: 0.75rem;
  align-items: center;
}

.payable-installment-paybox__cashbook {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid #dbe7f3;
  border-radius: 14px;
  background: #ffffff;
}

.payable-installment-paybox__cashbook label {
  display: grid;
  gap: 0.35rem;
}

.payable-installment-paybox__description {
  grid-column: span 1;
}

.payable-installment-paid {
  display: grid;
  gap: 0.25rem;
}

@media (max-width: 1100px) {
  .payable-installment-paybox {
    grid-template-columns: 1fr;
  }

  .payable-installment-paybox__cashbook {
    grid-template-columns: 1fr;
  }
}

.numbering-settings-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 1rem;
}

.numbering-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  justify-content: flex-start;
}

.numbering-settings-group {
  display: grid;
  gap: 0.9rem;
  padding: 18px;
  border: 1px solid #d7e3ef;
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfdff 0%, #f6f9fc 100%);
}

.numbering-settings-group__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e3ebf3;
}

.numbering-settings-group__header h2 {
  margin: 0;
  font-size: calc(1.02rem * var(--ui-font-scale));
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #12324a;
}

.numbering-settings-group__header p {
  margin: 4px 0 0;
  font-size: calc(12px * var(--ui-font-scale));
}

.numbering-settings-grid--sales,
.numbering-settings-grid--invoices {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.numbering-settings-grid--tulps {
  grid-template-columns: repeat(2, minmax(320px, calc((100% - 2rem) / 3)));
  justify-content: flex-start;
}

@media (max-width: 1280px) {
  .numbering-settings-grid--sales,
  .numbering-settings-grid--invoices,
  .numbering-settings-grid--tulps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .numbering-settings-grid--sales,
  .numbering-settings-grid--invoices,
  .numbering-settings-grid--tulps {
    grid-template-columns: 1fr;
  }

  .numbering-settings-group {
    padding: 14px;
  }
}

.numbering-settings-card {
  display: grid;
  gap: 0.85rem;
}

.numbering-settings-preview-box {
  display: grid;
  gap: 0.2rem;
  min-width: 160px;
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  border: 1px solid #d7e3ef;
  background: linear-gradient(135deg, #f7fbff 0%, #eef5fb 100%);
  text-align: right;
}

.numbering-settings-preview-box strong {
  font-size: calc(1.05rem * var(--ui-font-scale));
  color: #12324a;
}

.numbering-settings-note {
  margin: -0.15rem 0 0;
}

.numbering-settings-checkbox {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 600;
  color: #1f2937;
}

.numbering-settings-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

/* ============================================================
   TEMA MODERNO — layer di restyling globale
   Aggiornato: 2026-07. Ridefinisce token e componenti core
   (sidebar, topbar, card, bottoni, form, tabelle, modali).
   Le regole qui sotto vincono sulle precedenti a pari
   specificità: mantenere questo blocco in fondo al file.
   ============================================================ */

@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #101828;
  --muted: #5f6b7e;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --border: #e3e8f0;
  --pill: #eef3ff;
  --shadow: 0 16px 40px -12px rgba(15, 23, 42, 0.18), 0 4px 12px -4px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 2px 8px -2px rgba(15, 23, 42, 0.07);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar: #0e1626;
  --sidebar-text: #e7ecf4;
  --sidebar-muted: #8b96ab;
  --surface: #f8fafd;
  --surface-strong: #eef2f8;
  --focus-ring: 0 0 0 3.5px rgba(37, 99, 235, 0.16);
}

body {
  font-family: "Inter", "Segoe UI Variable", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background:
    radial-gradient(900px 320px at 90% -5%, rgba(37, 99, 235, 0.05), transparent 60%),
    var(--bg);
  line-height: 1.45;
}

::selection { background: rgba(37, 99, 235, 0.18); }

h1, h2, h3, h4 { font-weight: 700; }

/* --- Scrollbar --- */
* { scrollbar-width: thin; scrollbar-color: #c3ccda transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: #c3ccda;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background-color: #a6b2c5; background-clip: content-box; }

/* --- Sidebar --- */
.sidebar {
  background: linear-gradient(180deg, #0f1a30 0%, #0c1424 55%, #0a111e 100%);
  box-shadow: inset -1px 0 0 rgba(148, 163, 184, 0.08);
  padding: 20px 14px;
}
.sidebar__select {
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.sidebar__select:hover { border-color: rgba(148, 163, 184, 0.4); }
.sidebar__select:focus { outline: none; border-color: #3b82f6; box-shadow: var(--focus-ring); }
.nav__item {
  border-radius: 9px;
  padding: 9px 11px;
  color: #c3cbdb;
  font-weight: 600;
  transition: background 0.14s ease, color 0.14s ease;
}
.nav__item:hover { background: rgba(148, 163, 184, 0.1); color: #fff; }
.nav__item.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.95) 0%, rgba(37, 99, 235, 0.95) 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 14px -6px rgba(37, 99, 235, 0.6);
}
.nav__icon { color: inherit; opacity: 0.9; }
.nav-sub__item {
  border-radius: 8px;
  color: #aeb8ca;
  font-weight: 550;
  transition: background 0.14s ease, color 0.14s ease;
}
.nav-sub__item:hover { background: rgba(148, 163, 184, 0.1); color: #fff; }
.nav-sub__item.active {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(59, 130, 246, 0.28);
  color: #fff;
}

/* --- Topbar --- */
.topbar { border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 18px; }
.topbar h1 { font-weight: 750; letter-spacing: -0.03em; }
.eyebrow { letter-spacing: 0.1em; font-weight: 650; font-size: calc(11px * var(--ui-font-scale)); }
.meta {
  border-radius: 10px;
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
  padding: 8px 12px;
}
.meta strong { font-size: calc(16px * var(--ui-font-scale)); font-variant-numeric: tabular-nums; }
.alerts-bell__btn {
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.alerts-bell__panel { border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }

/* --- Card e metriche --- */
.card {
  border-radius: var(--radius);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
}
.card.metric { border-radius: var(--radius); }
.card.metric > p.muted {
  font-size: calc(12px * var(--ui-font-scale));
  font-weight: 600;
  letter-spacing: 0.01em;
}
.card.metric h3 {
  margin: 6px 0 2px;
  font-size: calc(26px * var(--ui-font-scale));
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.metric--available { background: linear-gradient(135deg, #fff8ef 0%, #ffedd5 100%); border-color: #fbd8a8; }
.metric--available h3 { color: #b45309; }
.metric--loaded { background: linear-gradient(135deg, #f0f3ff 0%, #e0e7ff 100%); border-color: #c0c9f7; }
.metric--loaded h3 { color: #4338ca; }
.metric--sold { background: linear-gradient(135deg, #f0fdf5 0%, #dcfce7 100%); border-color: #a9ecc0; }
.metric--sold h3 { color: #15803d; }
.metric--returned { background: linear-gradient(135deg, #fef2f6 0%, #fce8ef 100%); border-color: #f4b3c6; }
.metric--returned h3 { color: #be123c; }

/* --- Bottoni --- */
.btn {
  border-radius: var(--radius-sm);
  font-weight: 650;
  letter-spacing: 0;
  transition: transform 0.1s ease, box-shadow 0.18s ease, background 0.18s ease,
    border-color 0.18s ease, color 0.18s ease, filter 0.18s ease;
}
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.3); }
.btn.primary {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  border-color: #1e55d6;
  box-shadow: 0 2px 6px -1px rgba(29, 78, 216, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn.primary:hover {
  background: linear-gradient(180deg, #4b8dfa 0%, #2f6bf0 100%);
  box-shadow: 0 6px 14px -4px rgba(29, 78, 216, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn.success {
  background: linear-gradient(180deg, #16a34a 0%, #15803d 100%);
  border-color: #136f36;
  box-shadow: 0 2px 6px -1px rgba(21, 128, 61, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.btn.success:hover { box-shadow: 0 6px 14px -4px rgba(21, 128, 61, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.16); }
.btn.danger {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  border-color: #c22020;
  box-shadow: 0 2px 6px -1px rgba(185, 28, 28, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.btn.danger:hover { box-shadow: 0 6px 14px -4px rgba(185, 28, 28, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.14); }
.btn.ghost {
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.btn.ghost:hover { border-color: #c4cede; background: #f8fafd; transform: translateY(-1px); }
.btn:active { transform: translateY(0); filter: brightness(0.97); }
.btn-sm { border-radius: 7px; }

/* --- Form e input --- */
.form input, .form select, .form textarea,
.customer-search-input,
.customer-picker-modal__search,
.filter-bar .filter-field input,
.filter-bar .filter-field select,
.accounting-account-context__select {
  border-radius: var(--radius-sm);
  border-color: #d6deea;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.form input:hover, .form select:hover, .form textarea:hover,
.customer-search-input:hover,
.filter-bar .filter-field input:hover,
.filter-bar .filter-field select:hover { border-color: #b9c5d8; }
.form input:focus,
.form select:focus,
.form textarea:focus,
.customer-search-input:focus,
.customer-picker-modal__search:focus,
.filter-field input:focus,
.filter-field select:focus,
.filter-bar .filter-field input:focus,
.filter-bar .filter-field select:focus,
.accounting-account-context__select:focus,
.finance-inline-commission:focus {
  outline: none;
  border-color: #7fa7f4;
  box-shadow: var(--focus-ring);
}
.form label { font-weight: 650; }
.field-checkbox { border-radius: var(--radius-sm); }
.segmented { border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.segmented__item { transition: background 0.15s ease, color 0.15s ease; }

/* --- Tab --- */
.form-tab, .view-tab {
  border-radius: var(--radius-sm);
  font-weight: 650;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-tab:hover, .view-tab:hover { border-color: #b9c5d8; background: #f8fafd; }
.form-tab.is-active, .view-tab.is-active {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  border-color: #1e55d6;
  color: #fff;
  box-shadow: 0 2px 6px -1px rgba(29, 78, 216, 0.4);
}

/* --- Chip e filtri --- */
.chip { transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease; }
.chip:hover { box-shadow: var(--shadow-sm); }
.chip.active { box-shadow: 0 2px 8px -2px rgba(29, 78, 216, 0.45); border-color: transparent; }
.period-btn { border-radius: 7px; transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease; }
.period-btn.active { box-shadow: 0 2px 6px -2px rgba(29, 78, 216, 0.45); }

/* --- Tabelle --- */
.table-wrapper {
  border-radius: 10px;
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
th {
  background: #f7f9fc;
  color: #5b6779;
  font-size: calc(11px * var(--ui-font-scale));
  font-weight: 700;
  letter-spacing: 0.06em;
  border-bottom: 1px solid #dfe6ef;
}
td { border-bottom: 1px solid #eef2f7; }
th, td { padding: 9px 11px; }
table.table--compact th, table.table--compact td { padding: 5px 7px; }
.tulps-register-table th, .tulps-register-table td { padding: 2px 4px !important; }
tbody tr { transition: background 0.1s ease; }
tbody tr:hover { background: #f0f6ff; }
.table-wrapper tbody tr:nth-child(even) { background: #fbfcfe; }
.table-wrapper tbody tr:nth-child(even):hover { background: #f0f6ff; }
.table-row-menu__toggle { border-radius: 8px; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.table-row-menu__list { border-radius: 10px; box-shadow: var(--shadow); padding: 6px; }
.table-row-menu__item { border-radius: 7px; transition: background 0.12s ease; }
.table-image { border-radius: 8px; }

/* --- Badge, pill, tag --- */
.pill { border-color: #cdddfd; font-weight: 650; }
.badge, .load-type-tag { border-radius: 999px; padding: 4px 10px; }
.sale-type-tag { border-radius: 7px; }
.detail-chip { border-radius: 7px; }
.detail-item { border-radius: var(--radius-sm); }

/* --- Modali e dialoghi --- */
.accounting-modal__backdrop,
.app-dialog-backdrop,
.customer-picker-modal__backdrop {
  background: rgba(9, 14, 26, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.accounting-modal__panel {
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 18px;
  border-color: rgba(227, 232, 240, 0.9);
}
.app-dialog {
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 18px;
}
.customer-picker-modal__panel { border-radius: 14px; box-shadow: var(--shadow); }
.customer-picker-modal__header { background: linear-gradient(180deg, #f8fafd 0%, #f1f5fa 100%); }
.causal-picker-modal__panel { border-radius: 14px; }

/* --- Dropzone e pannelli --- */
.payable-import-dropzone,
.deed-documents-dropzone,
.e-invoicing-dropzone { border-radius: var(--radius); }
.customer-form-section,
.contract-form-section,
.vehicle-info-section { border-radius: 10px; }
.accounting-installments { border-radius: var(--radius-sm); }

/* --- Sezioni e varie --- */
.section__header { margin-bottom: 10px; }
.section h2 { font-weight: 700; letter-spacing: -0.02em; }
.vehicle-card { border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: box-shadow 0.18s ease, border-color 0.18s ease; }
.vehicle-card:hover { box-shadow: var(--shadow); border-color: #d3ddeb; }
.vehicle-card__img { border-radius: var(--radius-sm); }
.gallery-item { border-radius: var(--radius-sm); }
.gallery-add { border-radius: var(--radius-sm); transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease; }
.gallery-add:hover { border-color: #7fa7f4; color: var(--accent); background: #f5f9ff; }
.footer { background: transparent; }

/* --- Anteprime documento (contratto / preventivo) --- */
.quote-print-sheet,
.contract-print-sheet {
  border-radius: 14px;
  border-color: #dde5f0;
  box-shadow: 0 14px 36px -14px rgba(15, 23, 42, 0.2), 0 3px 10px -5px rgba(15, 23, 42, 0.08);
  padding: 28px 32px;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.quote-head {
  border-bottom: 2px solid var(--accent);
  padding-bottom: 14px;
}
.quote-head h2 { font-weight: 800; letter-spacing: -0.025em; }
.quote-head > div:first-child p { color: var(--muted); }
.quote-head__box {
  border-radius: 10px;
  border-color: #cdddfd;
  background: #eef4ff;
  padding: 10px 14px;
}
.quote-head__box p:first-child {
  color: #1d4ed8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: calc(12px * var(--ui-font-scale));
}
.quote-vehicle { border-bottom-color: #eef2f7; }
.quote-vehicle__image { border-radius: 10px; border-color: #e3e8f0; }
.quote-vehicle__details h3 { font-weight: 800; letter-spacing: -0.02em; }
.quote-spec {
  border-radius: 8px;
  border-color: #e5eaf2;
  background: #f8fafd;
}
.quote-spec span {
  color: #3a5a9b;
  font-weight: 650;
  letter-spacing: 0.06em;
}
.quote-section-title { color: #1d4ed8; letter-spacing: 0.12em; }
.quote-customer { border-bottom-color: #eef2f7; }
.quote-financial {
  border-radius: 10px;
  overflow: hidden;
  border-color: #e5eaf2;
}
.quote-financial__row { border-bottom-color: #eef2f7; }
.quote-financial__row--total {
  background: #16233b;
  color: #fff;
}
.contract-box {
  border-radius: 10px;
  border-color: #e5eaf2;
  padding: 12px 14px;
  background: #fbfcfe;
}
.quote-footer {
  border-top: 2px solid var(--accent);
  padding-top: 12px;
}
.quote-footer__signature { border-top-color: #33415c; }

/* --- Logo documenti (impostazioni profilo fatturazione) --- */
.invoicing-logo-section {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.invoicing-logo-row {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}
.invoicing-logo-preview {
  flex: 0 0 auto;
  width: 220px;
  min-height: 96px;
  display: grid;
  place-items: center;
  border: 1px dashed #c3cede;
  border-radius: 10px;
  background: #fff;
  padding: 10px;
}
.invoicing-logo-preview img {
  max-width: 100%;
  max-height: 96px;
  object-fit: contain;
  display: block;
}
.invoicing-logo-actions {
  flex: 1 1 280px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.invoicing-logo-actions p { margin: 0; font-size: calc(13px * var(--ui-font-scale)); }

/* --- Visualizzatore PDF a schermo pieno --- */
.accounting-modal:has(.invoice-viewer-modal__panel) {
  padding: 12px;
}
.accounting-modal__panel.invoice-viewer-modal__panel {
  width: min(1680px, calc(100vw - 24px));
  height: calc(100vh - 24px);
  max-height: calc(100vh - 24px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}
.invoice-viewer-modal__panel .accounting-modal__header {
  margin-bottom: 0;
}
.invoice-viewer-modal__panel .invoice-viewer-body {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}
.invoice-viewer-modal__panel .invoice-viewer-panel {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}
.invoice-viewer-modal__panel .invoice-viewer-panel iframe {
  width: 100%;
  height: 100%;
  min-height: 0;
}

/* ==== Barra superiore applicazione ==== */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: 0 18px;
  height: 52px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 10px rgba(15, 23, 42, 0.25);
}
.app-topbar__nav { display: flex; align-items: center; gap: 6px; }
.app-topbar--beside-sidebar {
  position: fixed;
  top: 0;
  left: 260px;
  right: 0;
}
.has-beside-topbar .app .main { padding-top: 70px; }
.app-topbar__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 6px;
  color: var(--sidebar-text);
  font-size: calc(13.5px * var(--ui-font-scale));
  font-weight: 600;
  border: 1px solid transparent;
}
.app-topbar__link:hover { background: rgba(255, 255, 255, 0.07); }
.app-topbar__link.active {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.16);
}
.app-topbar__link-icon { font-size: calc(15px * var(--ui-font-scale)); }

/* ==== Layout pagine standalone (senza sidebar) ==== */
.standalone-page { background: var(--bg); }
.standalone-main {
  max-width: min(var(--content-max-width), 1560px);
  margin: 0 auto;
  padding: 26px 28px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.standalone-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
}
.standalone-header h1 { margin: 4px 0 6px; }
.standalone-header .muted { margin: 0; }

/* ==== Pagina statistiche ==== */
.stats-filters { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.stats-filters__quick { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.stats-filters__quick .btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.stats-filters__dates { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.stats-filters__dates label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: calc(12px * var(--ui-font-scale));
  color: var(--muted);
  font-weight: 600;
}
.stats-filters__dates input {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  background: #fff;
}
.stats-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}
.stats-kpi {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid #94a3b8;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stats-kpi--blue { border-left-color: #3b82f6; }
.stats-kpi--amber { border-left-color: #f59e0b; }
.stats-kpi--green { border-left-color: #16a34a; }
.stats-kpi--red { border-left-color: #dc2626; }
.stats-kpi--slate { border-left-color: #64748b; }
.stats-kpi__label {
  font-size: calc(12px * var(--ui-font-scale));
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 650;
}
.stats-kpi__value { font-size: calc(22px * var(--ui-font-scale)); letter-spacing: -0.01em; }
.stats-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.stats-chart-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.stats-chart-card--wide { grid-column: 1 / -1; }
.stats-chart-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.stats-chart-card__head h2 { margin: 0; font-size: calc(16px * var(--ui-font-scale)); }
.stats-chart svg { width: 100%; height: auto; display: block; }
.stats-chart--donut { display: grid; place-items: center; }
.stats-donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: center; }
.stats-donut-wrap svg { width: 190px; height: 190px; flex: 0 0 auto; }
.stats-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: calc(12.5px * var(--ui-font-scale));
  color: var(--muted);
  align-items: center;
}
.stats-legend--column { flex-direction: column; align-items: flex-start; gap: 8px; }
.stats-legend--column strong { color: var(--text); margin-left: 6px; }
.stats-legend span { display: inline-flex; align-items: center; gap: 6px; }
.stats-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
}
.stats-empty { color: var(--muted); margin: 24px 0; text-align: center; }
.stats-table-card { padding: 18px; }
.table-scroll { overflow-x: auto; }
.stats-table th.num, .stats-table td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stats-table tbody tr { cursor: pointer; }
.stats-table tbody tr:hover td { background: #f1f5fb; }
.stats-table tfoot td { border-top: 2px solid var(--border); background: var(--surface); }
.stats-pos { color: #15803d; }
.stats-neg { color: #b91c1c; }
.stats-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: calc(13px * var(--ui-font-scale));
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.pill--green { background: #dcfce7; border-color: #86efac; color: #166534; }
.pill--blue { background: #dbeafe; border-color: #93c5fd; color: #1e40af; }

/* ==== Pagina calendario ==== */
.cal-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-month-label {
  min-width: 170px;
  text-align: center;
  font-size: calc(17px * var(--ui-font-scale));
  text-transform: capitalize;
}
.cal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
  align-items: start;
}
.cal-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  font-size: calc(12px * var(--ui-font-scale));
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 0 2px;
}
.cal-weekdays span { text-align: right; padding-right: 6px; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-day {
  min-height: 108px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.cal-day:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.cal-day--outside { background: var(--surface); opacity: 0.55; }
.cal-day--today { border-color: var(--accent); background: #f0f6ff; }
.cal-day--today .cal-day__num {
  background: var(--accent);
  color: #fff;
}
.cal-day__num {
  align-self: flex-end;
  font-size: calc(12.5px * var(--ui-font-scale));
  font-weight: 700;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.cal-day__items { display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.cal-chip {
  --chip-color: #2563eb;
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  border-left: 3px solid var(--chip-color);
  border-radius: 4px;
  background: color-mix(in srgb, var(--chip-color) 12%, #ffffff);
  color: var(--text);
  font-size: calc(11.5px * var(--ui-font-scale));
  font-weight: 600;
  padding: 3px 6px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-chip:hover { background: color-mix(in srgb, var(--chip-color) 22%, #ffffff); }
.cal-chip--done { opacity: 0.5; text-decoration: line-through; }
.cal-chip__time { color: var(--chip-color); margin-right: 4px; font-weight: 700; }
.cal-more {
  font-size: calc(11px * var(--ui-font-scale));
  color: var(--muted);
  font-weight: 600;
  padding-left: 6px;
}
.cal-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: calc(12px * var(--ui-font-scale));
  color: var(--muted);
  padding-top: 4px;
}
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-upcoming { padding: 16px; display: flex; flex-direction: column; gap: 12px; position: sticky; top: 66px; }
.cal-upcoming h2 { margin: 0; font-size: calc(16px * var(--ui-font-scale)); }
.cal-upcoming__list { display: flex; flex-direction: column; gap: 14px; max-height: 70vh; overflow-y: auto; }
.cal-upcoming__day h3 {
  margin: 0 0 6px;
  font-size: calc(12.5px * var(--ui-font-scale));
  text-transform: capitalize;
  color: var(--muted);
  font-weight: 700;
}
.cal-upcoming__item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  margin-bottom: 6px;
}
.cal-upcoming__item:hover { border-color: var(--accent); }
.cal-upcoming__item .stats-dot { margin-top: 5px; }
.cal-upcoming__body { display: flex; flex-direction: column; gap: 2px; font-size: calc(13px * var(--ui-font-scale)); }
.cal-modal__panel { width: min(640px, calc(100vw - 32px)); }
.cal-form { display: flex; flex-direction: column; gap: 12px; }
.cal-form label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: calc(13px * var(--ui-font-scale)); }
.cal-form input, .cal-form select, .cal-form textarea {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  font-weight: 500;
}
.cal-form__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.cal-form__actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.cal-done-toggle {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
  cursor: pointer;
}
@media (max-width: 1100px) {
  .cal-layout { grid-template-columns: 1fr; }
  .stats-charts { grid-template-columns: 1fr; }
  .cal-upcoming { position: static; }
}

/* ==== Icona invio WhatsApp nelle liste ==== */
.table-actions-flex {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.wa-send-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: #9ca3af;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
  padding: 0;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.wa-send-btn svg { width: 19px; height: 19px; }
.wa-send-btn:hover {
  color: #128c7e;
  border-color: #128c7e;
  background: #e9fbf3;
}
.wa-send-btn--sent {
  color: #fff;
  background: #25d366;
  border-color: #25d366;
}
.wa-send-btn--sent:hover {
  color: #fff;
  background: #1ebe5d;
  border-color: #1ebe5d;
}
.wa-send-btn--placeholder {
  visibility: hidden;
  cursor: default;
}

/* --- Flag collegamento auto da XML passivo --- */
.payable-vehicle-flag {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #bbe3c8;
  border-radius: 10px;
  background: #effaf3;
  font-size: calc(13px * var(--ui-font-scale));
  font-weight: 600;
  color: #14532d;
  cursor: pointer;
}
.payable-vehicle-flag input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #16a34a;
  cursor: pointer;
}

/* --- Hub Impostazioni --- */
.settings-search {
  position: relative;
  max-width: 560px;
}
.settings-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  stroke: var(--muted);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.settings-search input {
  width: 100%;
  padding: calc(10px * var(--ui-font-scale)) 14px calc(10px * var(--ui-font-scale)) 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: calc(14px * var(--ui-font-scale));
  color: var(--text);
}
.settings-search input:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}
.settings-search input::placeholder { color: var(--muted); }

.settings-groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 14px;
  align-items: start;
}
@media (max-width: 860px) {
  .settings-groups { grid-template-columns: 1fr; }
}
.card.settings-group {
  padding: 0;
  overflow: hidden;
}
.settings-group__head {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.settings-group__head h2 {
  margin: 0;
  font-size: calc(12px * var(--ui-font-scale));
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}
.settings-group__list { display: flex; flex-direction: column; }
.settings-link {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 16px;
  border-bottom: 1px solid #eef2f7;
  transition: background 0.12s ease;
}
.settings-link:last-child { border-bottom: none; }
.settings-link:hover { background: #f6f9ff; }
.settings-link:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.4);
}
.settings-link__icon {
  flex: 0 0 auto;
  width: calc(38px * var(--ui-font-scale));
  height: calc(38px * var(--ui-font-scale));
  border-radius: 9px;
  background: var(--pill);
  border: 1px solid #dbe6fb;
  display: grid;
  place-items: center;
  color: var(--accent);
}
.settings-link__icon svg {
  width: calc(19px * var(--ui-font-scale));
  height: calc(19px * var(--ui-font-scale));
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.settings-link__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.settings-link__title {
  font-weight: 650;
  font-size: calc(14px * var(--ui-font-scale));
  letter-spacing: -0.01em;
  color: var(--text);
}
.settings-link__desc {
  font-size: calc(12.5px * var(--ui-font-scale));
  color: var(--muted);
  line-height: 1.35;
}
.settings-link__chevron {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  stroke: #b6c2d4;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.12s ease, stroke 0.12s ease;
}
.settings-link:hover .settings-link__chevron {
  stroke: var(--accent);
  transform: translateX(2px);
}
.settings-empty { margin: 14px 2px 0; }

/* --- Raccomandazione di prezzo AutoScout (Nuova auto > Dati commerciali) --- */
.autoscout-price-reco {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 14px 16px;
}
.autoscout-price-reco.hidden { display: none; }
.autoscout-price-reco__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.autoscout-price-reco__logo {
  background: #ffed00;
  color: #111827;
  font-weight: 800;
  font-size: calc(11px * var(--ui-font-scale));
  letter-spacing: 0.01em;
  padding: 3px 8px;
  border-radius: 4px;
}
.autoscout-price-reco__title {
  font-weight: 750;
  font-size: calc(14px * var(--ui-font-scale));
  letter-spacing: -0.01em;
}
.autoscout-price-reco__suggested {
  margin: 0 0 12px;
  font-size: calc(13px * var(--ui-font-scale));
  color: var(--text);
}
.autoscout-price-reco__suggested strong {
  font-size: calc(14px * var(--ui-font-scale));
  font-variant-numeric: tabular-nums;
}
.autoscout-price-reco__spectrum {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.autoscout-price-reco__cat {
  flex: 1 1 140px;
  min-width: 130px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px 9px;
  position: relative;
  overflow: hidden;
  background: #fff;
}
.autoscout-price-reco__cat::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--reco-cat-color, #9ca3af);
}
.autoscout-price-reco__cat-label {
  display: block;
  font-weight: 700;
  font-size: calc(12px * var(--ui-font-scale));
  color: var(--reco-cat-color, var(--text));
  margin-bottom: 2px;
}
.autoscout-price-reco__cat-range {
  display: block;
  font-size: calc(12px * var(--ui-font-scale));
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.autoscout-price-reco__cat[data-cat="verygood"] { --reco-cat-color: #0d7a3f; }
.autoscout-price-reco__cat[data-cat="good"] { --reco-cat-color: #43a047; }
.autoscout-price-reco__cat[data-cat="fair"] { --reco-cat-color: #d99a06; }
.autoscout-price-reco__cat[data-cat="increased"] { --reco-cat-color: #fb8c00; }
.autoscout-price-reco__cat[data-cat="high"] { --reco-cat-color: #e53935; }
.autoscout-price-reco__cat[data-cat="veryhigh"] { --reco-cat-color: #b71c1c; }

/* --- Voltura contratto: campi calcolati non editabili --- */
.contract-transfer-section input[readonly] {
  background: #f1f3f6;
  color: #4b5563;
  border-color: #dde3ec;
  cursor: not-allowed;
}
.contract-transfer-section input[readonly]:hover {
  border-color: #dde3ec;
}

/* --- Modale con pagina incorporata (Gestisci garanzie / agenzie) --- */
.embed-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.embed-modal[hidden] { display: none; }
.embed-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}
.embed-modal__dialog {
  position: relative;
  width: min(1100px, 96vw);
  height: min(88vh, 900px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 24px 60px -12px rgba(15, 23, 42, 0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.embed-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.embed-modal__head h2 {
  margin: 0;
  font-size: calc(15px * var(--ui-font-scale));
  letter-spacing: -0.01em;
}
.embed-modal__frame {
  flex: 1;
  width: 100%;
  border: none;
  background: #fff;
}

/* --- Pagina incorporata in modale: nascondi chrome dell'app --- */
body.is-embedded .app-topbar,
body.is-embedded .sidebar,
body.is-embedded .topbar {
  display: none !important;
}
body.is-embedded .main {
  padding-top: 12px;
}

/* --- Mandato: compilazione inline dei dati mancanti --- */
.mandate-fix-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.mandate-fix-form[hidden] { display: none; }
.mandate-fix-intro {
  margin: 0 0 10px;
  font-size: calc(12.5px * var(--ui-font-scale));
}
.mandate-fix-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mandate-fix-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: calc(12px * var(--ui-font-scale));
  font-weight: 700;
  color: var(--text);
}
.mandate-fix-field input,
.mandate-fix-field select,
.mandate-fix-field textarea {
  width: 100%;
  padding: calc(7px * var(--ui-font-scale)) calc(9px * var(--ui-font-scale));
  border: 1px solid var(--border);
  border-radius: 6px;
  font-weight: 500;
  font-size: calc(13px * var(--ui-font-scale));
  background: #fff;
}
.mandate-fix-field input:focus,
.mandate-fix-field select:focus,
.mandate-fix-field textarea:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}
.mandate-fix-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

/* --- Ritenuta: flag esente inline nel form --- */
.listing-check-line {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.listing-check-line input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  flex: 0 0 auto;
  accent-color: #2563eb;
}

.withholding-exempt-field {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  align-self: end;
  padding-bottom: 10px;
}
.withholding-exempt-field input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  flex: 0 0 auto;
  accent-color: #2563eb;
}

/* --- Campo data unificato (maschera + calendario rapido) --- */
.gdate-field {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  width: 100%;
}
.gdate-field .gdate-text {
  width: 100%;
  min-width: 0;
  margin: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.gdate-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  clip: rect(0 0 0 0);
  overflow: hidden;
}
.gdate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 6px 6px 0;
  background: #fafafa;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}
.gdate-btn:hover { background: #eef4ff; color: var(--accent); }
.gdate-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

/* Calendario */
.gdate-pop {
  position: absolute;
  z-index: 3000;
  width: 268px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 30px -8px rgba(15, 23, 42, 0.32);
  padding: 10px;
  font-size: 13px;
}
.gdate-pop__head {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}
.gdate-select {
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 5px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-size: 12.5px;
  font-weight: 600;
}
.gdate-nav {
  width: 26px;
  height: 26px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.gdate-nav:hover { background: #eef4ff; border-color: #93c5fd; color: var(--accent); }
.gdate-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.gdate-grid--weekdays { margin-bottom: 2px; }
.gdate-weekday {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  padding: 2px 0;
}
.gdate-day {
  aspect-ratio: 1 / 1;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.gdate-day:hover { background: #eef4ff; border-color: #bfdbfe; }
.gdate-day--empty { cursor: default; }
.gdate-day.is-today { border-color: #93c5fd; font-weight: 700; }
.gdate-day.is-selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
}
.gdate-pop__foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.gdate-action {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.gdate-action:hover { background: #eef4ff; border-color: #93c5fd; color: var(--accent); }

/* --- Accesso --------------------------------------------------------- */
/* Foto a sinistra che sfuma nel blu a destra, scheda bianca sopra. Non e' una
   colonna netta: la sfumatura e' una velatura stesa su tutta la scena, cosi'
   la foto non finisce con un taglio. */
.login-body {
  min-height: 100vh;
  margin: 0;
  background: #071125;
}
.login-scena {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr min(470px, 100%) 0.5fr;
  grid-template-rows: 1fr auto;
  padding: clamp(24px, 4vw, 48px) clamp(24px, 5vw, 96px) clamp(20px, 3vw, 34px);
  background: #071125;
}
.login-scena::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 62%;
  background: url("/static/img/login-sfondo.jpg?v=3") left center / cover no-repeat;
  -webkit-mask-image: linear-gradient(to right, #000 38%, rgba(0, 0, 0, 0.55) 68%, transparent 100%);
  mask-image: linear-gradient(to right, #000 38%, rgba(0, 0, 0, 0.55) 68%, transparent 100%);
}
.login-scena::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    rgba(7, 17, 37, 0) 0%,
    rgba(7, 17, 37, 0) 30%,
    rgba(9, 24, 52, 0.3) 46%,
    rgba(11, 27, 58, 0.72) 58%,
    #0a1a35 70%,
    #071125 100%);
}
/* Archi in alto a destra e trama di puntini in basso: sono nel mockup, e
   riempiono il blu senza aggiungere un'altra immagine da scaricare. */
.login-scena__trama {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-radial-gradient(circle at 116% -14%,
      rgba(150, 190, 255, 0) 0 34px, rgba(150, 190, 255, 0.07) 34px 35px) no-repeat,
    radial-gradient(circle at 1px 1px, rgba(160, 200, 255, 0.16) 1px, transparent 1.6px)
      right 3% bottom 5% / 15px 15px;
  background-repeat: no-repeat, repeat;
  z-index: 1;
  -webkit-mask-image: linear-gradient(to right, transparent 52%, #000 78%);
  mask-image: linear-gradient(to right, transparent 52%, #000 78%);
}

.login-main {
  position: relative;
  z-index: 2;
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  width: 100%;
  min-width: 0;
}
.login-card {
  width: 100%;
  display: grid;
  gap: 20px;
  padding: clamp(28px, 3.2vw, 40px) clamp(24px, 2.8vw, 36px);
  border-radius: 18px;
  background: #fdfdfd;
  box-shadow: 0 30px 70px -24px rgba(2, 8, 20, 0.65);
}
.login-logo {
  display: block;
  justify-self: center;
  width: min(310px, 76%);
  height: auto;
  margin-bottom: 2px;
}

.login-form { display: grid; gap: 17px; }
.login-field { display: grid; gap: 8px; }
.login-field__label {
  font-size: calc(14px * var(--ui-font-scale));
  font-weight: 700;
  color: #1b2637;
}
.login-field__box { position: relative; display: block; }
.login-field__icona {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 19px;
  height: 19px;
  transform: translateY(-50%);
  fill: none;
  stroke: #9aa5b5;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.login-form input {
  width: 100%;
  border: 1px solid #e4e8f0;
  border-radius: 10px;
  background: #fdfdfd;
  padding: calc(13px * var(--ui-font-scale)) calc(14px * var(--ui-font-scale));
  padding-left: 46px;
  font-size: calc(15px * var(--ui-font-scale));
  min-height: calc(50px * var(--ui-font-scale));
  color: #1b2637;
}
.login-form input::placeholder { color: #9aa5b5; }
.login-form input:focus {
  outline: none;
  border-color: #0c65d6;
  box-shadow: 0 0 0 3px rgba(12, 101, 214, 0.15);
}
#login-password { padding-right: 48px; }

.login-occhio {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  cursor: pointer;
  color: #9aa5b5;
}
.login-occhio:hover { color: #1b2637; background: rgba(154, 165, 181, 0.14); }
.login-occhio svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-error {
  margin: 0;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  font-size: calc(13px * var(--ui-font-scale));
  font-weight: 600;
}
.login-recovery { margin: -6px 0 0; text-align: right; }
.login-recovery a {
  color: #136de4;
  font-size: calc(14px * var(--ui-font-scale));
  font-weight: 600;
  text-decoration: none;
}
.login-recovery a:hover { text-decoration: underline; }

.login-actions { justify-content: stretch; }
.login-actions .btn {
  width: 100%;
  justify-content: center;
  min-height: calc(52px * var(--ui-font-scale));
  border-radius: 10px;
  background: #0c65d6;
  border-color: #0c65d6;
  font-size: calc(16px * var(--ui-font-scale));
  font-weight: 700;
}
.login-actions .btn:hover:not(:disabled) { background: #0a56b8; border-color: #0a56b8; }

.login-foot {
  position: relative;
  z-index: 2;
  grid-column: 2;
  grid-row: 2;
  margin: 24px 0 0;
  font-size: calc(13px * var(--ui-font-scale));
  color: rgba(203, 216, 235, 0.62);
  text-align: center;
}

/* Sotto i 900px la scena diventa una colonna: la foto resta in alto come
   fascia, la scheda sotto. */
@media (max-width: 900px) {
  .login-scena {
    grid-template-columns: min(470px, 100%);
    justify-content: center;
    padding-top: clamp(180px, 34vw, 260px);
  }
  /* Qui la foto e' una fascia in alto: la sfumatura va verso il basso, non
     verso destra. */
  .login-scena::before {
    width: 100%;
    height: clamp(220px, 42vw, 310px);
    bottom: auto;
    background-position: center 32%;
    -webkit-mask-image: linear-gradient(to bottom, #000 64%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 64%, transparent 100%);
  }
  .login-scena::after {
    background: linear-gradient(184deg,
      rgba(7, 17, 37, 0) 0%,
      rgba(7, 17, 37, 0) 19%,
      rgba(9, 24, 52, 0.42) 30%,
      #0f2246 42%,
      #071125 78%);
  }
  .login-scena__trama { display: none; }
  .login-main, .login-foot { grid-column: 1; }
}

/* --- Utente in sidebar ----------------------------------------------- */

/* Riquadro utente nel calendario, che non ha la barra laterale. */

/* Campi del dialogo password (core/dialog.js). */
.app-dialog__form { display: flex; flex-direction: column; gap: 12px; }
.app-dialog__form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: calc(13px * var(--ui-font-scale));
  font-weight: 600;
}
.app-dialog__form .app-dialog__actions { margin-top: 4px; }
.app-dialog__error { color: var(--danger, #c0392b); font-weight: 600; }

/* ==== Menu account nella barra in alto ====
   Montato da core/session.js, non scritto nelle pagine: sono una cinquantina e
   replicarlo a mano vorrebbe dire cinquanta punti da tenere allineati. */
.account { position: relative; display: inline-flex; margin-left: auto; }

.account__btn {
  display: grid;
  place-items: center;
  width: calc(36px * var(--ui-font-scale));
  height: calc(36px * var(--ui-font-scale));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--muted, #5b6b7f);
  cursor: pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.account__btn:hover { background: var(--accent-soft, #eef4ff); color: var(--accent, #2563eb); border-color: var(--accent, #2563eb); }
.account__btn[aria-expanded="true"] { background: var(--accent, #2563eb); color: #fff; border-color: var(--accent, #2563eb); }
.account__btn svg {
  width: calc(19px * var(--ui-font-scale));
  height: calc(19px * var(--ui-font-scale));
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.account__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  min-width: calc(210px * var(--ui-font-scale));
  padding: 6px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 28px -8px rgba(16, 24, 40, .22), 0 3px 8px -3px rgba(16, 24, 40, .12);
}

.account__who {
  display: grid;
  gap: 2px;
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.account__name {
  font-weight: 650;
  font-size: calc(13.5px * var(--ui-font-scale));
  overflow-wrap: anywhere;
}
.account__role {
  font-size: calc(12px * var(--ui-font-scale));
  color: var(--muted, #667085);
}

.account__action {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  text-align: left;
  font: inherit;
  font-size: calc(13px * var(--ui-font-scale));
  color: inherit;
  cursor: pointer;
}
.account__action:hover { background: var(--surface, #f4f7fb); }
.account__action--exit { color: var(--danger, #b42318); }
.account__action--exit:hover { background: var(--danger-soft, #fef3f2); }
