@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");
:root {
  --admin-sidebar-width: 260px;
  --admin-header-height: 60px;
  /* Palette enterprise */
  --admin-bg: #f4f6f9;
  --admin-sidebar-bg: #0b0f19;
  --admin-sidebar-text: #f1f5f9;
  --admin-sidebar-active: #2563eb;
  --admin-sidebar-hover: rgba(255, 255, 255, 0.05);
  --admin-card-bg: #ffffff;
  --admin-border: #e5e7eb;
  --admin-text: #111827;
  --admin-muted: #6b7280;
  --admin-danger: #dc2626;
  --admin-success: #059669;
  --admin-warning: #d97706;
  --admin-accent: #7c3aed;
  --muted: var(--admin-muted);
  --primary: var(--admin-sidebar-active);
  --border: var(--admin-border);
}
* {
  box-sizing: border-box;
}
body.admin-layout {
  margin: 0;
  padding: 0;
  background-color: var(--admin-bg);
  color: var(--admin-text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  min-height: 100vh;
}
body.team-login-layout {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(30, 41, 59, 0.12)), #f8fafc;
  color: var(--admin-text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
body.admin-layout a {
  color: inherit;
}
body.admin-layout button,
body.admin-layout input,
body.admin-layout select,
body.admin-layout textarea,
body.team-login-layout button,
body.team-login-layout input,
body.team-login-layout select,
body.team-login-layout textarea {
  font: inherit;
}
.team-login-shell {
  width: min(100%, 1080px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px;
  display: grid;
  align-items: center;
}
.team-login-card {
  width: min(100%, 520px);
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  padding: 30px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.14);
}
.team-login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  color: var(--admin-muted);
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.team-login-brand img {
  width: 46px;
  height: auto;
  display: block;
}
.team-login-kicker {
  margin: 0 0 8px;
  color: #0f766e;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.team-login-card h1 {
  margin: 0 0 8px;
  font-size: 1.75rem;
  line-height: 1.15;
}
.team-login-copy {
  margin: 0 0 22px;
  color: var(--admin-muted);
}
.team-login-actions {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.team-login-help {
  margin: 14px 0 0;
  color: var(--admin-muted);
  font-size: 0.88rem;
}
.team-login-help a {
  color: #0f766e;
}
.admin-sidebar {
  width: var(--admin-sidebar-width);
  background-color: var(--admin-sidebar-bg);
  color: var(--admin-sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 200;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.admin-sidebar.open {
  transform: translateX(0);
}
.sidebar-header {
  padding: 20px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.sidebar-header img {
  max-width: 140px;
  filter: brightness(0) invert(1);
}
.sidebar-nav {
  flex: 1;
  padding: 20px 0;
  overflow-y: auto;
}
.sidebar-link {
  display: flex;
  align-items: center;
  padding: 9px 24px 9px 36px;
  color: var(--admin-sidebar-text);
  text-decoration: none;
  transition: background 0.15s, color 0.15s, opacity 0.15s;
  font-size: 0.88rem;
  gap: 10px;
  opacity: 0.82;
}
.sidebar-link:hover {
  background-color: rgba(255, 255, 255, 0.06);
  opacity: 1;
}
.sidebar-link.active {
  background-color: var(--admin-sidebar-active);
  color: #fff;
  font-weight: 600;
  opacity: 1;
}
.sidebar-link-dashboard {
  padding: 12px 20px;
  font-size: 0.9rem;
  opacity: 1;
  font-weight: 600;
}
.nav-group {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.nav-group summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(241, 245, 249, 0.5);
  list-style: none;
  user-select: none;
  transition: color 0.15s;
}
.nav-group summary::-webkit-details-marker {
  display: none;
}
.nav-group summary:hover {
  color: rgba(241, 245, 249, 0.8);
}
.nav-group[open] summary {
  color: rgba(241, 245, 249, 0.9);
}
.sidebar-subgroup {
  padding: 10px 18px 4px;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(148, 163, 184, 0.55);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  margin-top: 4px;
}
.sidebar-subgroup:first-child {
  border-top: none;
  margin-top: 0;
}
.nav-group-chevron {
  margin-left: auto;
  font-size: 0.65rem;
  transition: transform 0.2s;
  opacity: 0.5;
}
.nav-group[open] .nav-group-chevron {
  transform: rotate(180deg);
}
.nav-group-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(241, 245, 249, 0.25);
  flex-shrink: 0;
}
.nav-group[open] .nav-group-dot,
.nav-group-has-active .nav-group-dot {
  background: #0f766e;
}
.sidebar-footer {
  padding: 15px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
  opacity: 0.7;
}
.admin-main {
  flex: 1;
  margin-left: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}
.admin-header {
  height: var(--admin-header-height);
  background: #fff;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 30px;
  position: sticky;
  top: 0;
  z-index: 90;
}
.admin-header-left,
.admin-user-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-user-actions {
  gap: 15px;
}
.admin-logout-form {
  margin: 0;
}
/* ── Topbar tools: clock, dropdown, notifiche ── */
.topbar-home-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--admin-border);
  background: #fff;
  border-radius: 8px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.topbar-home-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.admin-header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-clock-time {
  font-variant-numeric: tabular-nums;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--admin-text);
  background: #f1f5f9;
  padding: 5px 12px;
  border-radius: 7px;
  letter-spacing: 0.02em;
}
.topbar-dropdown-wrapper {
  position: relative;
}
.topbar-icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border: 1px solid var(--admin-border);
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.topbar-icon-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.topbar-logout-btn {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.2);
}
.topbar-logout-btn:hover {
  background: #fef2f2;
  border-color: rgba(239, 68, 68, 0.4);
}
.topbar-notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #ef4444;
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(239, 68, 68, 0.4);
}
.topbar-user-divider {
  width: 1px;
  height: 28px;
  background: var(--admin-border);
  margin: 0 4px;
}
.topbar-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
  z-index: 200;
  overflow: hidden;
  padding: 4px;
}
.topbar-dropdown-open {
  display: block;
}
.topbar-dropdown-wide {
  min-width: 280px;
}
.topbar-dropdown-header {
  padding: 8px 12px 6px;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--admin-muted);
}
.topbar-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 0.86rem;
  color: var(--admin-text);
  text-decoration: none;
  transition: background 0.12s;
}
.topbar-dropdown-item span:first-child {
  font-size: 1.05rem;
  flex-shrink: 0;
}
.topbar-dropdown-item:hover {
  background: #f1f5f9;
}
.topbar-dropdown-notif {
  align-items: flex-start;
}
.topbar-dropdown-notif .muted {
  font-size: 0.74rem;
  margin-top: 1px;
}
.topbar-dropdown-empty {
  padding: 20px 14px;
  text-align: center;
  color: var(--admin-muted);
  font-size: 0.85rem;
}
.admin-breadcrumb {
  font-size: 0.9rem;
  color: var(--admin-muted);
}
.admin-breadcrumb-current {
  color: var(--admin-text);
  font-weight: 500;
}
.admin-content {
  padding: 30px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}
.admin-card,
.form-section,
.customer-block,
.customer-link-block,
.vehicle-focus-block,
.status-section,
.paid-toggle {
  background: var(--admin-card-bg);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--admin-border);
  padding: 24px;
  margin-bottom: 24px;
}
.admin-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.admin-section-title {
  margin: 0 0 16px;
  font-size: 1rem;
  font-weight: 700;
}
.admin-grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.45fr);
  gap: 24px;
  align-items: start;
}
.form-grid-2,
.form-grid-3 {
  display: grid;
  gap: 0.75rem;
}
.form-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.form-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.admin-actions-row {
  margin-top: 1rem;
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.admin-actions-inline {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}
.admin-actions-inline form {
  margin: 0;
}
.admin-table-card {
  padding: 0;
  overflow: hidden;
}
.admin-table-card .admin-section-title {
  padding: 18px 20px 0;
}
.admin-table-card table {
  margin-top: 8px;
}
.admin-empty-cell {
  padding: 34px 20px;
  text-align: center;
  color: #94a3b8;
}
.accounting-totals-row td {
  font-weight: 700;
  border-top: 2px solid #cbd5e1;
  background: #f8fafc;
  padding: 12px 14px;
  font-variant-numeric: tabular-nums;
}
.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: #475569;
}
.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #0f766e;
}
.admin-strong-link {
  color: #334155;
  font-weight: 700;
  text-decoration: none;
}
.admin-strong-link:hover {
  color: #0f766e;
}
.admin-definition-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
}
.admin-definition-list div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 0.75rem;
}
.admin-definition-list dt {
  color: var(--admin-muted);
  font-weight: 600;
}
.admin-definition-list dd {
  margin: 0;
  font-weight: 700;
}
.admin-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 5px;
  color: var(--admin-text);
}
.admin-subtitle {
  color: var(--admin-muted);
  margin: 0 0 24px;
}
.row,
.row-between {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.row-between {
  justify-content: space-between;
}
.stack {
  display: grid;
  gap: 0.6rem;
}
.inline-form {
  margin: 0;
  display: inline-block;
}
.muted,
.hint,
.helper {
  color: var(--admin-muted);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
  background: #0f766e;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
.btn:hover {
  background: #0b5f59;
}
.btn:active {
  transform: translateY(1px);
}
.btn-sm {
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
}
.btn-alt,
.btn-light,
.btn-secondary {
  background: #eef2f7;
  color: #1f3b57;
  border-color: #d8dde5;
}
.btn-alt:hover,
.btn-light:hover,
.btn-secondary:hover {
  background: #dde6f1;
}
.btn-danger {
  background: #fee2e2;
  color: var(--admin-danger);
  border-color: #fecaca;
}
.btn-danger:hover {
  background: #fecaca;
}
.field {
  margin-top: 0.75rem;
}
.field label,
label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.28rem;
}
.field input,
.field textarea,
.field select,
.form-control,
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  width: 100%;
  border: 0;
  border-bottom: 2px solid #94a3b8;
  border-radius: 0;
  padding: 0.4rem 0;
  background: transparent;
  color: var(--admin-text);
  font-size: 0.95rem;
  transition: border-color 0.15s ease;
}
.field input:hover,
.field textarea:hover,
.field select:hover,
.form-control:hover,
input:not([type="checkbox"]):not([type="radio"]):hover,
select:hover,
textarea:hover {
  border-bottom-color: #64748b;
}
.field input:focus,
.field textarea:focus,
.field select:focus,
.form-control:focus,
input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
  outline: none;
  border-bottom-color: #0f766e;
  box-shadow: 0 2px 0 0 rgba(15, 118, 110, 0.25);
}
/* Evidenziazione input vuoti */
input.is-empty,
textarea.is-empty,
select.is-empty {
  border-bottom-color: #fca5a5 !important;
  background: rgba(254, 226, 226, 0.22) !important;
}
input.is-empty:focus,
textarea.is-empty:focus,
select.is-empty:focus {
  border-bottom-color: #ef4444 !important;
  box-shadow: 0 2px 0 0 rgba(239, 68, 68, 0.35) !important;
}
.field-inline {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}
.checkbox {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  cursor: pointer;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}
th,
td {
  border-bottom: 1px solid var(--admin-border);
  padding: 0.55rem;
  text-align: left;
  vertical-align: top;
}
th {
  font-size: 0.82rem;
  color: var(--admin-muted);
  font-weight: 700;
}
.alert,
.errors {
  margin-bottom: 1rem;
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
}
.alert-success,
.admin-flash-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}
.alert-danger,
.alert-error,
.admin-flash-error,
.errors {
  background: #fff1f2;
  color: #9f1239;
  border: 1px solid #fda4af;
}
.status-badge,
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.status-badge.new {
  background: #dbeafe;
  color: #1e40af;
}
.status-badge.incomplete {
  background: #fee2e2;
  color: #991b1b;
}
.status-badge.processing {
  background: #fef3c7;
  color: #92400e;
}
.status-badge.offered {
  background: #ffedd5;
  color: #9a3412;
}
.status-badge.won {
  background: #dcfce7;
  color: #166534;
}
.status-badge.invoiced {
  background: #ccfbf1;
  color: #0f766e;
}
.status-badge.delivered {
  background: #cffafe;
  color: #155e75;
}
.status-badge.returned {
  background: #ede9fe;
  color: #5b21b6;
}
.status-badge.lost {
  background: #fee2e2;
  color: #991b1b;
}
.status-badge.cancelled {
  background: #f1f5f9;
  color: #475569;
}
.status-badge.test {
  background: #f3f4f6;
  color: #4b5563;
}
/* ── Timeline preventivo ─────────────────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 24px;
}
.timeline::before {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 10px;
  width: 2px;
  background: #e2e8f0;
  border-radius: 1px;
}
.timeline-item {
  position: relative;
  padding-bottom: 18px;
}
.timeline-item:last-child {
  padding-bottom: 0;
}
.timeline-marker {
  position: absolute;
  left: -20px;
  top: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--timeline-color, #64748b);
  color: var(--timeline-color, #64748b);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.timeline-marker svg {
  width: 12px;
  height: 12px;
}
.timeline-content {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
}
.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.timeline-type {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.timeline-time {
  font-size: 0.7rem;
  color: #64748b;
  white-space: nowrap;
}
.timeline-description {
  font-size: 0.85rem;
  color: #1e293b;
  line-height: 1.45;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.timeline-arrow {
  color: #94a3b8;
  font-size: 0.9rem;
}
.timeline-metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}
.timeline-meta-item {
  font-size: 0.75rem;
  color: #475569;
  background: #fff;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}
.timeline-note {
  font-size: 0.78rem;
  color: #475569;
  background: #fff;
  padding: 8px;
  border-radius: 6px;
  border-left: 3px solid #cbd5e1;
  margin-bottom: 6px;
  line-height: 1.4;
}
.timeline-actor {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 500;
}
@media (max-width: 960px) {
  .timeline {
    padding-left: 20px;
  }
  .timeline::before {
    left: 8px;
  }
  .timeline-marker {
    left: -16px;
    width: 18px;
    height: 18px;
  }
  .timeline-marker svg {
    width: 10px;
    height: 10px;
  }
  .timeline-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}
.kpi-card {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--admin-border);
}
.kpi-label {
  font-size: 0.85rem;
  color: var(--admin-muted);
  margin-bottom: 8px;
  font-weight: 500;
}
.kpi-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--admin-text);
}
.admin-flash {
  position: fixed;
  top: 1.1rem;
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  z-index: 9999;
  min-width: 280px;
  max-width: min(480px, calc(100vw - 2rem));
  border-radius: 14px;
  padding: 0.9rem 1.1rem 0.9rem 1rem;
  font-size: 0.97rem;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.18);
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  opacity: 0;
  transition: transform 360ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 260ms ease;
}
.admin-flash.toast-in {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.admin-flash-close {
  margin-left: auto;
  background: none;
  border: 0;
  cursor: pointer;
  color: inherit;
  opacity: 0.55;
  font-size: 1rem;
  padding: 0 0 0 0.5rem;
  line-height: 1;
}
.admin-flash-close:hover {
  opacity: 1;
}
.sidebar-toggle {
  display: flex;
  align-items: center;
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  padding: 6px 8px;
  color: var(--admin-text);
  border-radius: 8px;
  transition: background 0.15s;
}
.sidebar-toggle:hover {
  background: #f1f5f9;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 99;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.open {
  display: block;
}
@media (max-width: 720px) {
  .admin-header {
    padding: 0 14px;
    gap: 10px;
  }
  .admin-breadcrumb {
    display: none;
  }
  .admin-content {
    padding: 18px 12px;
  }
  .admin-user-actions {
    gap: 8px;
  }
  .topbar-clock-time {
    display: none;
  }
  .topbar-user-divider {
    display: none;
  }
  .btn-sm {
    padding: 0.38rem 0.55rem;
  }
  .team-login-shell {
    padding: 16px;
  }
  .team-login-card {
    padding: 22px;
  }
  .team-login-actions .btn {
    width: 100%;
  }
  .field-inline {
    align-items: stretch;
  }
  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 1024px) {
  .admin-grid-2 {
    grid-template-columns: 1fr;
  }
}
.tutorial-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 26px;
  margin-bottom: 24px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #0f172a 0%, #134e4a 100%);
  color: #e2e8f0;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
}
.tutorial-hero h1,
.tutorial-hero .admin-title {
  margin: 0 0 6px;
  color: #fff;
}
.tutorial-hero p {
  max-width: 720px;
  margin: 0;
  color: #cbd5e1;
  line-height: 1.55;
}
.tutorial-principles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.tutorial-principle {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 0.8rem;
  color: #cbd5e1;
  backdrop-filter: blur(4px);
}
.tutorial-principle strong {
  display: block;
  color: #5eead4;
  margin-bottom: 2px;
}
.tutorial-category {
  margin-bottom: 30px;
}
.tutorial-category__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 11px;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.tutorial-category__title::after {
  content: "";
  flex: 1;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(15, 118, 110, 0.35), #e2e8f0 40%);
}
.tutorial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 13px;
}
.tutorial-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  min-height: 122px;
  padding: 17px;
  border-top: 3px solid #0f766e;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.tutorial-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
  border-color: rgba(15, 118, 110, 0.35);
}
.tutorial-card__eyebrow {
  color: #0f766e !important;
}
.tutorial-card__eyebrow {
  color: #94a3b8;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tutorial-card__title {
  margin: 4px 0 0;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.35;
}
.tutorial-card__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
@media (max-width: 800px) {
  .tutorial-hero {
    display: block;
  }
  .tutorial-hero .btn {
    margin-top: 16px;
  }
  .tutorial-principles {
    grid-template-columns: 1fr;
  }
}
.guide-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  align-items: start;
}
.guide-toc {
  position: sticky;
  top: 80px;
  background: var(--admin-card-bg, #fff);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 16px;
}
.guide-toc-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin: 0 0 10px;
}
.guide-toc a {
  display: block;
  font-size: 0.85rem;
  color: #475569;
  text-decoration: none;
  padding: 3px 0;
  border-left: 2px solid transparent;
  padding-left: 8px;
  transition: color 0.15s, border-color 0.15s;
}
.guide-toc a:hover {
  color: #0f172a;
  border-left-color: #0f766e;
}
.guide-toc a.toc-h3 {
  padding-left: 20px;
  font-size: 0.82rem;
}
.guide-content {
  max-width: 720px;
}
.guide-content h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 6px;
}
.guide-content > h1:not([style]) {
  display: none;
}
.guide-content h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  margin: 28px 0 10px;
  padding-top: 8px;
  border-top: 1px solid var(--admin-border);
}
.guide-content h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #334155;
  margin: 20px 0 8px;
}
.guide-content p {
  color: #374151;
  line-height: 1.7;
  margin: 0 0 12px;
}
.guide-content ul,
.guide-content ol {
  color: #374151;
  line-height: 1.7;
  margin: 0 0 12px;
  padding-left: 1.4rem;
}
.guide-content li {
  margin-bottom: 4px;
}
.guide-content blockquote {
  border-left: 3px solid #0f766e;
  padding: 10px 16px;
  background: #f0fdf4;
  margin: 16px 0;
  border-radius: 0 6px 6px 0;
  color: #374151;
}
.guide-content code {
  background: #f1f5f9;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.88em;
}
.tutorial-review-notes {
  max-width: 752px;
  margin-top: 24px;
  padding: 18px 20px;
  border: 1px solid #fbbf24;
  border-left: 5px solid #d97706;
  border-radius: 10px;
  background: #fffbeb;
  color: #78350f;
}
.tutorial-review-notes__head {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.tutorial-review-notes__badge {
  padding: 3px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tutorial-review-notes p {
  margin: 0 0 10px;
  font-size: 0.84rem;
  line-height: 1.5;
}
.tutorial-review-notes ul {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.86rem;
  line-height: 1.55;
}
@media (max-width: 768px) {
  .guide-layout {
    grid-template-columns: 1fr;
  }
  .guide-toc {
    position: static;
  }
}
.guide-exercises {
  max-width: 752px;
  margin-top: 24px;
}
.guide-exercises > h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 16px;
}
.exercise-card {
  background: var(--admin-card-bg, #fff);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.exercise-card:focus-within {
  border-color: rgba(15, 118, 110, 0.4);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.08);
}
.exercise-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 8px;
}
.exercise-card p {
  font-size: 0.9rem;
  color: #374151;
  margin: 0 0 12px;
}
.exercise-options {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}
.exercise-options li {
  margin-bottom: 6px;
}
.exercise-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #374151;
  cursor: pointer;
}
.exercise-options input[type=radio] {
  accent-color: #0f766e;
}
.exercise-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.exercise-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 3px;
}
.exercise-field input[type=text] {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--admin-border, #e2e8f0);
  border-radius: 6px;
  font-size: 0.9rem;
}
.exercise-field input.field-invalid {
  border-color: #ef4444;
  background: #fef2f2;
}
.exercise-btn {
  display: inline-block;
  padding: 8px 18px;
  background: #0f766e;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
}
.exercise-btn:hover {
  background: #0b5f59;
  transform: translateY(-1px);
}
.exercise-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.exercise-feedback {
  display: none;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.88rem;
}
.exercise-feedback.ok {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.exercise-feedback.err {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
@media (max-width: 768px) {
  .guide-content {
    padding: 20px 16px !important;
  }
  .exercise-card {
    padding: 16px;
  }
}
.tutorial-sim {
  margin: 2rem 0;
  padding: 1.25rem;
  border: 1px solid #cbd5e1;
  border-radius: 1rem;
  background: linear-gradient(145deg, #f8fafc, #f0fdfa);
}
.tutorial-sim-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.tutorial-sim-heading span {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #0b5f59;
}
.tutorial-sim-heading h2 {
  margin: 0.15rem 0;
}
.tutorial-sim-heading p {
  margin: 0;
  color: #475569;
}
.tutorial-sim-heading b {
  height: max-content;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: #ccfbf1;
  color: #134e4a;
  font-size: 0.75rem;
  white-space: nowrap;
}
.tutorial-sim-panel {
  padding: 1rem;
  border: 1px solid #dbe3ee;
  border-radius: 0.8rem;
  background: #fff;
}
.tutorial-sim-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}
.tutorial-sim-grid label {
  display: grid;
  gap: 0.35rem;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 800;
}
.tutorial-sim-grid input,
.tutorial-sim-grid select,
.tutorial-sim-grid textarea {
  width: 100%;
  padding: 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.55rem;
}
.tutorial-sim-grid em {
  color: #ef4444;
  font-style: normal;
}
.tutorial-sim-grid .wide {
  grid-column: 1/-1;
}
.tutorial-sim-grid .check {
  display: flex;
  align-items: center;
}
.tutorial-sim-grid .check input {
  width: auto;
}
.tutorial-sim-context,
.tutorial-sim-result {
  display: grid;
  gap: 0.2rem;
  margin-bottom: 1rem;
  padding: 0.8rem;
  border-left: 4px solid #0f766e;
  border-radius: 0.45rem;
  background: #f0fdfa;
}
.tutorial-sim-result {
  margin: 1rem 0 0;
}
.tutorial-sim-result.warning {
  border-color: #d97706;
  background: #fffbeb;
}
.tutorial-sim-actions,
.options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}
.tutorial-sim-actions button,
.options button {
  padding: 0.65rem 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.55rem;
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}
.tutorial-sim-actions .primary {
  border-color: #0b5f59;
  background: #0f766e;
  color: #fff;
}
.tutorial-sim-feedback {
  margin: 0.85rem 0 0;
  padding: 0.7rem;
  border-radius: 0.55rem;
  font-weight: 700;
}
.tutorial-sim-feedback--success {
  background: #dcfce7;
  color: #166534;
}
.tutorial-sim-feedback--warning {
  background: #fef3c7;
  color: #92400e;
}
.tutorial-sim-feedback--error {
  background: #fee2e2;
  color: #991b1b;
}
.tutorial-sim-quote {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem;
  border-radius: 0.65rem;
  background: #0f172a;
  color: #fff;
}
.tutorial-sim-quote div {
  display: grid;
}
.tutorial-sim-quote p {
  max-width: 36rem;
  margin: 0;
  color: #cbd5e1;
}
.tutorial-sim-workflow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 1rem;
}
.tutorial-sim-workflow button {
  display: grid;
  gap: 0.35rem;
  padding: 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.65rem;
  background: #f8fafc;
  text-align: left;
  cursor: pointer;
}
.tutorial-sim-workflow button:disabled {
  border-color: #86efac;
  background: #f0fdf4;
}
.tutorial-sim-workflow span {
  font-size: 0.72rem;
  color: #64748b;
}
.tutorial-chat {
  max-width: 42rem;
  background: #e5ddd5;
}
.tutorial-chat [data-sim-step] {
  display: grid;
  gap: 0.65rem;
}
.tutorial-chat .bot,
.tutorial-chat .user {
  max-width: 85%;
  padding: 0.7rem;
  border-radius: 0.7rem;
  background: #fff;
}
.tutorial-chat .user {
  justify-self: end;
  background: #dcf8c6;
}
.options button {
  border-color: #5eead4;
  color: #0f766e;
}
.client-sim-selector {
  margin-bottom: 1rem;
}
.client-sim-selector > label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  font-weight: 800;
  color: #334155;
}
.client-sim-selector small {
  font-weight: 500;
  color: #64748b;
}
.client-sim-search {
  display: flex;
  gap: 0.5rem;
  align-items: start;
}
.client-sim-search > div {
  position: relative;
  flex: 1;
}
.client-sim-search input,
.client-sim-modal input[type=search] {
  width: 100%;
  padding: 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.55rem;
}
.client-sim-search > button,
.client-sim-modal header button,
.client-sim-modal nav button {
  padding: 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.55rem;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
}
.client-sim-results {
  position: absolute;
  z-index: 3;
  top: calc(100% + 3px);
  right: 0;
  left: 0;
  border: 1px solid #cbd5e1;
  border-radius: 0.55rem;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}
.client-sim-result {
  display: grid;
  width: 100%;
  gap: 0.15rem;
  padding: 0.65rem 0.75rem;
  border: 0;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.client-sim-result:hover {
  background: #f1f5f9;
}
.client-sim-result span,
.client-sim-empty {
  font-size: 0.76rem;
  color: #64748b;
}
.client-sim-empty {
  margin: 0;
  padding: 0.8rem;
}
.client-sim-selected {
  margin: 0.35rem 0 0;
  color: #0f766e;
  font-size: 0.82rem;
  font-weight: 800;
}
.client-sim-billing {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.7rem;
  background: #f8fafc;
}
.client-sim-billing h3 {
  margin: 0 0 0.8rem;
  font-size: 0.9rem;
}
.client-sim-modal {
  position: fixed;
  z-index: 1000;
  inset: 0;
  padding: 3vh 1rem;
  background: rgba(15, 23, 42, 0.55);
  overflow: auto;
}
.client-sim-modal-card {
  max-width: 720px;
  margin: auto;
  border-radius: 0.8rem;
  background: #fff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.25);
  overflow: hidden;
}
.client-sim-modal header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #e2e8f0;
}
.client-sim-modal h3 {
  margin: 0;
}
.client-sim-modal nav {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}
.client-sim-modal nav button.active {
  border-color: #0f766e;
  background: #f0fdfa;
  color: #0b5f59;
}
.client-sim-modal section {
  padding: 1rem;
}
.client-sim-modal-results {
  display: grid;
  gap: 0.35rem;
  max-height: 350px;
  margin-top: 0.75rem;
  overflow: auto;
}
.client-sim-modal-results .client-sim-result {
  border: 1px solid #e2e8f0;
  border-radius: 0.55rem;
}
@media (max-width: 900px) {
  .tutorial-sim-grid {
    grid-template-columns: 1fr;
  }
  .tutorial-sim-grid .wide {
    grid-column: auto;
  }
  .tutorial-sim-workflow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tutorial-sim-quote {
    display: grid;
  }
}
@media (max-width: 560px) {
  .tutorial-sim-heading {
    display: grid;
  }
  .tutorial-sim-workflow {
    grid-template-columns: 1fr;
  }
  .client-sim-search {
    display: grid;
  }
  .client-sim-modal nav {
    display: grid;
  }
}
/* ── Tour wrapper ───────────────────────────────────────────────────────── */
.guide-tour-wrap {
  margin-top: 32px;
}
.guide-tour-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.guide-tour-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}
.guide-tour-meta {
  font-size: 0.8rem;
  color: #94a3b8;
}
.guide-simulator-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  background: #f0f9ff;
  color: #075985;
  font-size: 0.85rem;
  line-height: 1.5;
}
.guide-simulator-goal {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  color: #334155;
  font-size: 0.83rem;
}
.guide-simulator-goal strong {
  display: block;
  color: #0f172a;
  margin-bottom: 5px;
}
.guide-simulator-goal ol {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 28px;
}
.guide-simulator-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding: 5px;
  border: 1px solid #e2e8f0;
  border-radius: 11px;
  background: #f8fafc;
}
.guide-simulator-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.guide-simulator-secondary:hover,
.guide-simulator-secondary:focus-visible {
  border-color: #0284c7;
  color: #0369a1;
  background: #f0f9ff;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}
.guide-simulator-reset {
  border-color: #fecaca;
  color: #b91c1c;
  background: #fff;
}
.guide-simulator-reset:hover,
.guide-simulator-reset:focus-visible {
  border-color: #ef4444;
  color: #991b1b;
  background: #fef2f2;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}
.guide-simulator-actions .guide-tour-start-btn {
  margin-left: 4px;
  box-shadow: 0 2px 6px rgba(15, 118, 110, 0.2);
}
.guide-simulator-actions .guide-tour-start-btn:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.2);
  outline-offset: 2px;
}
.guide-tour-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: #0f766e;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.guide-tour-start-btn:hover {
  background: #0d6460;
}
/* ── Tooltip ────────────────────────────────────────────────────────────── */
.guide-tour-tooltip {
  position: fixed;
  z-index: 9999;
  width: 320px;
  max-width: calc(100vw - 24px);
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
  display: none;
  pointer-events: auto;
}
.guide-tour-tooltip__counter {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0f766e;
  background: rgba(15, 118, 110, 0.1);
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-block;
  margin-bottom: 8px;
}
.guide-tour-tooltip__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 6px;
}
.guide-tour-tooltip__body {
  font-size: 0.85rem;
  color: #374151;
  line-height: 1.6;
  margin: 0 0 14px;
}
.guide-tour-tooltip__body strong {
  color: #0f172a;
}
.guide-tour-tooltip__body em {
  color: #0f766e;
  font-style: normal;
  font-weight: 600;
}
.guide-tour-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.guide-tour-nav__prev {
  padding: 6px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  color: #64748b;
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.15s;
}
.guide-tour-nav__prev:hover {
  border-color: #94a3b8;
  color: #0f172a;
}
.guide-tour-nav__prev:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.guide-tour-nav__next {
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  background: #0f766e;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.guide-tour-nav__next:hover {
  background: #0d6460;
}
.guide-tour-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 2px 5px;
  line-height: 1;
}
.guide-tour-close:hover {
  color: #0f172a;
}
/* ── Tip button (per-step help button) ──────────────────────────────────── */
.guide-tour-tip-btn {
  width: max-content;
  min-height: 28px;
  margin: 0 0 8px auto;
  border: 1px solid rgba(15, 118, 110, 0.35);
  border-radius: 999px;
  background: #f0fdfa;
  color: #0f766e;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 10px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.guide-tour-tip-btn::after {
  content: "Aiuto";
}
.guide-tour-tip-btn:hover,
.guide-tour-tip-btn:focus-visible {
  background: #ccfbf1;
  border-color: #0f766e;
  color: #0d5f59;
}
.guide-tour-form-inner .form-grid-3[data-tour-step] > .guide-tour-tip-btn {
  grid-column: 1 / -1;
  justify-self: end;
  margin-bottom: 0;
}
.guide-tour-form-inner .field[data-tour-step] > .guide-tour-tip-btn {
  margin-bottom: 4px;
}
.guide-tour-form-wrap .action-bar-clone {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.guide-tour-form-wrap .action-bar-clone .guide-tour-tip-btn {
  grid-column: 1;
  justify-self: start;
  margin: 0;
}
.guide-tour-form-wrap .action-bar-clone .btn-clone-primary {
  grid-column: 2;
}
/* ── Highlight ──────────────────────────────────────────────────────────── */
.guide-tour-highlight {
  position: relative;
  z-index: 9990;
  outline: 3px solid #0f766e !important;
  outline-offset: 4px;
  border-radius: 4px;
  box-shadow: 0 0 0 8px rgba(15, 118, 110, 0.12) !important;
  transition: outline 0.2s, box-shadow 0.2s;
}
/* ── Backdrop ───────────────────────────────────────────────────────────── */
.guide-tour-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9980;
  background: rgba(10, 20, 40, 0.45);
  display: none;
}
/* ── Form clone container ───────────────────────────────────────────────── */
.guide-tour-form-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: #f8fafc;
  padding: 0;
  position: relative;
  z-index: 1;
}
.guide-tour-form-inner {
  padding: 16px 20px 24px;
}
.guide-tour-form-inner *:focus {
  outline: none !important;
}
/* Scoped preventivo form styles */
.guide-tour-form-inner .form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}
.guide-tour-form-inner .form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}
.guide-tour-form-inner .field label {
  display: block;
  font-size: 0.76rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.guide-tour-form-inner .field input,
.guide-tour-form-inner .field select,
.guide-tour-form-inner .field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 0;
  border-bottom: 2px solid #94a3b8;
  border-radius: 0;
  background: transparent;
  padding: 0.4rem 0;
  font-size: 0.9rem;
  font-family: inherit;
  color: #0f172a;
  pointer-events: auto;
}
.guide-tour-form-inner .field input:focus,
.guide-tour-form-inner .field select:focus,
.guide-tour-form-inner .field textarea:focus {
  border-bottom-color: #0f766e;
}
.guide-tour-form-inner .field input[readonly] {
  color: #475569;
  background: #f8fafc;
  cursor: not-allowed;
}
.guide-tour-form-inner .field {
  margin-bottom: 0;
}
/* Section blocks */
.guide-tour-form-inner .status-section {
  margin: 0 0 12px;
  border-radius: 10px;
  border: 2px solid #3b82f6;
  background: rgba(59, 130, 246, 0.04);
  padding: 0.9rem 1rem;
  position: relative;
}
.guide-tour-form-inner .status-section h3 {
  margin: 0 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #3b82f6;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.guide-tour-form-inner .status-section h3::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3b82f6;
  flex-shrink: 0;
}
.guide-tour-form-inner .status-select {
  font-size: 1.1rem;
  font-weight: 700;
  border-bottom: 3px solid #3b82f6 !important;
  color: #3b82f6;
}
.guide-tour-form-inner .section-block {
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: rgba(255, 255, 255, 0.6);
  padding: 0.85rem 0.9rem 0.95rem;
  margin-bottom: 12px;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.8);
}
.guide-tour-form-inner .section-block h3 {
  margin: 0 0 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}
.guide-tour-form-inner .customer-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.guide-tour-form-inner .customer-col {
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: rgba(255, 255, 255, 0.3);
  padding: 10px;
}
.guide-tour-form-inner .customer-col h4 {
  margin: 0 0 8px;
  font-size: 12px;
  text-transform: uppercase;
}
.guide-tour-form-inner .vehicle-block {
  border: 1px solid rgba(0, 0, 0, 0.35);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(0, 0, 0, 0.02));
  padding: 0.85rem 0.9rem;
  margin-bottom: 12px;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.8);
}
.guide-tour-form-inner .vehicle-block h3 {
  margin: 0 0 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.18);
}
.guide-tour-form-inner .vehicle-found-panel {
  margin-top: 10px;
  padding: 10px 14px;
  background: rgba(15, 118, 110, 0.06);
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 8px;
  font-size: 0.85rem;
}
.guide-tour-form-inner .vehicle-found-panel strong {
  color: #0f766e;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 6px;
}
.guide-tour-form-inner .vehicle-found-grid {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 4px 18px;
}
.guide-tour-form-inner .vehicle-found-grid span {
  font-size: 0.75rem;
  color: #64748b;
  display: block;
}
.guide-tour-form-inner .vehicle-found-grid b {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
}
.guide-tour-form-inner .product-panel {
  border: 1px solid rgba(0, 0, 0, 0.45);
  background: rgba(255, 255, 255, 0.4);
  padding: 8px;
  margin-bottom: 12px;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.7);
}
.guide-tour-form-inner .product-panel h3 {
  margin: 0 0 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.guide-tour-form-inner .product-grid-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin-top: 6px;
}
.guide-tour-form-inner .product-grid-table th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  padding: 4px 6px;
  border-bottom: 1px solid #e2e8f0;
}
.guide-tour-form-inner .product-grid-table td {
  padding: 5px 6px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  color: #0f172a;
}
.guide-tour-form-inner .product-grid-table tr:last-child td {
  border-bottom: none;
}
.guide-tour-form-inner .product-grid-table input[type="text"],
.guide-tour-form-inner .product-grid-table input[type="number"] {
  width: 100%;
  min-width: 54px;
  box-sizing: border-box;
  padding: 5px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
  font-size: 0.8rem;
}
.guide-tour-form-inner .product-grid-table input:focus {
  outline: 2px solid rgba(15, 118, 110, 0.18) !important;
  border-color: #0f766e;
}
.guide-tour-form-inner .product-grid-scroll {
  overflow-x: auto;
}
.guide-tour-wrap[data-sim-customer-type="private"] .sim-mechanic-col {
  background: #faf5ff;
  color: #6b21a8;
}
.guide-tour-wrap[data-sim-customer-type="private"] .sim-customer-col {
  background: #ecfdf5;
  color: #047857;
  font-weight: 700;
}
.guide-tour-wrap[data-sim-customer-type="mechanic"] .sim-mechanic-col {
  background: #faf5ff;
  color: #6b21a8;
  font-weight: 700;
}
.guide-tour-wrap[data-sim-customer-type="mechanic"] .sim-customer-col {
  background: #f8fafc;
  color: #64748b;
}
.guide-tour-form-inner .product-toolbar {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.guide-tour-form-inner .markup-fields {
  display: flex;
  gap: 16px;
  align-items: center;
}
.guide-tour-form-inner .markup-field {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #64748b;
}
.guide-tour-form-inner .markup-field input {
  width: 56px;
  padding: 3px 6px;
  font-size: 12px;
  border: 1px solid #ccc !important;
  border-bottom: 1px solid #ccc !important;
  border-radius: 4px;
  text-align: right;
}
.guide-tour-form-inner .totals-section {
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: rgba(255, 255, 255, 0.6);
  padding: 0.85rem 0.9rem;
  margin-bottom: 12px;
}
.guide-tour-form-inner .totals-section h3 {
  margin: 0 0 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.guide-tour-form-inner .totals-section input[readonly] {
  color: #64748b;
  font-variant-numeric: tabular-nums;
}
.guide-tour-form-wrap .action-bar-clone {
  background: #fff;
  border-top: 1px solid #e2e8f0;
  padding: 12px 16px;
  box-shadow: 0 -2px 10px rgba(15, 23, 42, 0.08);
  border-radius: 0 0 12px 12px;
}
.guide-tour-form-wrap .btn-clone-primary {
  padding: 10px 32px;
  background: #0f766e;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.02em;
}
.guide-tour-form-wrap .btn-clone-primary:hover {
  background: #0d6460;
}
.guide-tour-form-inner .search-field {
  display: flex;
  gap: 6px;
  align-items: center;
}
.guide-tour-form-inner .search-input {
  flex: 1;
  border: 1px solid #e2e8f0 !important;
  border-bottom: 1px solid #e2e8f0 !important;
  border-radius: 6px !important;
  padding: 6px 10px !important;
  font-size: 0.85rem !important;
  color: #94a3b8 !important;
}
.guide-tour-form-inner .chip-btn {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid rgba(19, 34, 55, 0.18);
  border-radius: 6px;
  background: #fff;
  font-size: 0.78rem;
  color: #64748b;
  cursor: pointer;
}
.guide-tour-form-inner .chip-btn:hover {
  border-color: #0f766e;
  color: #0f766e;
}
.guide-tour-form-inner .chip-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.guide-tour-form-inner .selected-label {
  font-size: 0.82rem;
  color: #0f766e;
  font-weight: 600;
  margin-top: 4px;
}
.guide-simulator-feedback {
  grid-column: 3;
  justify-self: end;
  max-width: 430px;
  padding: 8px 11px;
  border-radius: 7px;
  font-size: 0.8rem;
  line-height: 1.4;
}
.guide-simulator-feedback.is-info {
  background: #eff6ff;
  color: #0f766e;
}
.guide-simulator-feedback.is-success {
  background: #f0fdf4;
  color: #166534;
}
.guide-simulator-feedback.is-error {
  background: #fef2f2;
  color: #991b1b;
}
@media (max-width: 960px) {
  .guide-tour-form-inner .customer-split {
    grid-template-columns: 1fr;
  }
  .guide-tour-form-inner .vehicle-found-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .guide-tour-form-inner .markup-fields {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}
@media (max-width: 640px) {
  .guide-tour-form-inner .customer-split {
    grid-template-columns: 1fr;
  }
  .guide-tour-form-inner .form-grid-3 {
    grid-template-columns: 1fr 1fr;
  }
  .guide-tour-form-inner .form-grid-2 {
    grid-template-columns: 1fr;
  }
  .guide-tour-form-inner {
    padding: 12px;
  }
  .guide-tour-header {
    align-items: flex-start;
  }
  .guide-simulator-actions {
    width: 100%;
  }
  .guide-simulator-actions > button {
    flex: 1 1 auto;
    justify-content: center;
  }
  .guide-tour-tooltip {
    width: calc(100vw - 24px);
  }
  .guide-tour-form-wrap .action-bar-clone {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .guide-tour-form-wrap .action-bar-clone .guide-tour-tip-btn,
  .guide-tour-form-wrap .action-bar-clone .btn-clone-primary {
    grid-column: 1;
    justify-self: center;
  }
  .guide-simulator-feedback {
    grid-column: 1;
    justify-self: stretch;
    max-width: none;
  }
}
/* Gestionale Contabilità: prima nota, acquisti, abbonamenti */
.movimento-entrata {
  color: #047857;
  font-weight: 700;
}
.movimento-uscita {
  color: #b91c1c;
  font-weight: 700;
}
/* Twemoji: le emoji sostituite con SVG devono seguire la riga di testo */
img.emoji {
  height: 1em;
  width: 1em;
  margin: 0 0.07em;
  vertical-align: -0.125em;
  display: inline-block;
}
/* Cruscotto contabilità: grafico cassa e categorie */
.cashflow-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 170px;
  padding-top: 6px;
}
.cashflow-month {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
}
.cashflow-bars {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
}
.cashflow-bars span {
  width: 9px;
  border-radius: 3px 3px 0 0;
  min-height: 2px;
}
.cashflow-bars .bar-in {
  background: #0f766e;
}
.cashflow-bars .bar-out {
  background: #f59e0b;
}
.cashflow-label {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--admin-muted);
  text-transform: uppercase;
}
.cashflow-legend {
  display: flex;
  gap: 1.2rem;
  margin-top: 0.7rem;
  font-size: 0.78rem;
  color: var(--admin-muted);
}
.cashflow-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 4px;
}
.cashflow-legend .dot-in {
  background: #0f766e;
}
.cashflow-legend .dot-out {
  background: #f59e0b;
}
.category-bars {
  display: grid;
  gap: 0.75rem;
}
.category-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}
.category-head b {
  color: #0f766e;
}
.category-track {
  height: 8px;
  background: #eef2f5;
  border-radius: 4px;
  overflow: hidden;
}
.category-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #0f766e, #14b8a6);
  border-radius: 4px;
}
/* ── Simulatore provvigioni (Contabilità) ───────────────────────────────── */
.commission-sim-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.commission-sim-head h2 {
  margin: 0;
  font-size: 1rem;
}
.commission-sim-head p {
  margin: 0.2rem 0 0;
  color: #64748b;
  font-size: 0.8rem;
}
.commission-sim-card {
  margin-bottom: 16px;
}
.commission-sim-card .commission-sim-head {
  padding: 18px 20px 0;
}
.commission-sim-card table {
  margin-top: 8px;
}
.commission-sim-card td input {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.4rem 0.55rem;
  font-size: 0.85rem;
}
.commission-sim-card td input:focus {
  outline: 2px solid rgba(15, 118, 110, 0.35);
  border-color: #0f766e;
}
.commission-sim-num {
  text-align: right;
  white-space: nowrap;
  font-weight: 700;
}
.commission-sim-remove {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.3rem;
}
.commission-sim-remove:hover {
  color: #b91c1c;
}
.commission-sim-kpis small {
  display: block;
  margin-top: 0.35rem;
  color: #64748b;
}
.commission-sim-kpis .kpi-value.is-negative {
  color: #b91c1c;
}
.commission-sim-quick-result {
  font-size: 1.4rem;
  font-weight: 700;
  color: #0f766e;
  padding: 0.35rem 0;
}
/* ============================================================
   Scheda agente — gestione provvigioni
   ============================================================ */
.commission-rate-edit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}
.commission-rate-edit input {
  width: 72px;
  padding: 3px 6px;
  font-size: 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
}
.commission-status-select {
  padding: 4px 8px;
  font-size: 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
}
.commission-pay-bar {
  margin-top: 1rem;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.commission-pay-bar-inner {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}
.commission-pay-note {
  flex: 1;
  min-width: 200px;
}
.commission-pay-note label {
  font-size: 0.85rem;
  display: block;
  margin-bottom: 4px;
}
.commission-pay-note input {
  width: 100%;
}
/* Degrado a card sotto 960px */
@media (max-width: 960px) {
  .agent-commissions-table thead {
    display: none;
  }
  .agent-commissions-table,
  .agent-commissions-table tbody,
  .agent-commissions-table tr,
  .agent-commissions-table td {
    display: block;
    width: 100%;
  }
  .agent-commissions-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 14px;
    padding: 14px;
    margin-bottom: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  }
  .agent-commissions-table td {
    padding: 0 !important;
    border: none !important;
    text-align: left !important;
  }
  .agent-commissions-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    margin-bottom: 3px;
  }
  .agent-commissions-table td[data-label=""]::before {
    content: none;
  }
  .agent-commissions-table td[data-label=""] {
    grid-column: 1 / -1;
  }
  .commission-pay-bar-inner {
    flex-direction: column;
    align-items: stretch;
  }
}
/* Stili modulo Preventivo - form (estratti dai <style> inline) */
/* --- layout --- */
/* .form-grid-* base sono globali in admin.less; qui solo il gap del form. */
.admin-preventivo-form .form-grid-2,
.admin-preventivo-form .form-grid-3 {
  gap: 0.65rem;
}
.form-advanced {
  margin-top: 0.7rem;
  border: 1px solid rgba(19, 34, 55, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.64);
}
.form-advanced summary {
  cursor: pointer;
  list-style: none;
  padding: 0.65rem 0.8rem;
  font-weight: 600;
}
.form-advanced summary::-webkit-details-marker {
  display: none;
}
.form-advanced > div {
  padding: 0 0.8rem 0.75rem;
}
.advanced-tools {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 0.7rem;
}
.advanced-tools .btn {
  padding: 0.45rem 0.75rem;
}
/* ── Design tokens "Console ERP" (brand teal su neutri slate) ───────────── */
.admin-preventivo-form {
  --erp-border: #e2e8f0;
  --erp-border-strong: #cbd5e1;
  --erp-surface: #ffffff;
  --erp-surface-muted: #f8fafc;
  --erp-accent: #0f766e;
  --erp-head: #334155;
  --erp-muted: #64748b;
  --erp-radius: 10px;
  --erp-radius-sm: 8px;
  --erp-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --erp-focus: 0 0 0 3px rgba(15, 118, 110, 0.16);
}
/* I blocchi del form ereditano le proprietà di .admin-card più un bordo superiore colorato */
.form-section,
.customer-block,
.customer-link-block,
.vehicle-focus-block,
.status-section,
.paid-toggle {
  border-top: 3px solid var(--erp-accent, #0f766e);
  margin-top: 1rem;
  margin-bottom: 0;
}
/* Barra accento a sinistra dei titoli di sezione/blocco (dettaglio enterprise) */
.form-section > h3::before,
.form-subblock > h4::before,
.status-section > h3::before,
.paid-toggle > h3::before,
.customer-link-block > h3::before,
.customer-block > h3::before,
.vehicle-focus-title::before {
  content: "";
  flex: 0 0 auto;
  width: 3px;
  height: 0.95em;
  margin-right: 0.5rem;
  background: var(--erp-accent, #0f766e);
  border-radius: 2px;
}
.form-section {
  margin: 1rem 0 0;
  border: 1px solid var(--erp-border, #e2e8f0);
  border-radius: var(--erp-radius, 10px);
  background: var(--erp-surface, #fff);
  box-shadow: var(--erp-shadow);
  padding: 0 0.95rem 0.95rem;
}
.form-section > h3 {
  display: flex;
  align-items: center;
  margin: 0 -0.95rem 0.85rem;
  padding: 0.7rem 0.95rem;
  border-bottom: 1px solid var(--erp-border, #e2e8f0);
  border-radius: var(--erp-radius, 10px) var(--erp-radius, 10px) 0 0;
  background: var(--erp-surface-muted, #f8fafc);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--erp-head, #334155);
}
/* Sottoblocchi dentro una sezione (es. Gestione pratica) */
.form-subblock {
  border: 1px solid var(--erp-border, #e2e8f0);
  background: var(--erp-surface-muted, #f8fafc);
  border-radius: var(--erp-radius-sm, 8px);
  padding: 0.8rem;
}
.form-subblock + .form-subblock {
  margin-top: 0.85rem;
}
.form-subblock > h4 {
  display: flex;
  align-items: center;
  margin: 0 0 0.7rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--erp-border, #e2e8f0);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--erp-head, #334155);
}
/* Gestione pratica: Avanzamento e Provvigioni affiancati (impilati sotto 960px) */
.gestione-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  align-items: start;
}
.gestione-split > .form-subblock {
  margin-top: 0;
}
@media (max-width: 960px) {
  .gestione-split {
    grid-template-columns: 1fr;
  }
}
/* Ogni campo del blocco Gestione come mini-card distinta */
.gestione-field {
  border: 1px solid var(--erp-border, #e2e8f0);
  border-radius: var(--erp-radius-sm, 8px);
  background: var(--erp-surface, #fff);
  padding: 0.6rem 0.65rem 0.65rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.gestione-field:focus-within {
  border-color: var(--erp-accent, #0f766e);
  box-shadow: var(--erp-focus);
}
.gestione-field > label {
  display: block;
  margin: 0 0 0.45rem;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
}
.gestione-field .helper {
  margin-bottom: 0;
}
/* --- status --- */
/* Blocco Incasso in cima (toggle Pagato / Non Pagato) */
.incasso-block {
  margin: 1rem 0 0;
}
.incasso-block .paid-toggle {
  max-width: 360px;
}
/* Riga superiore: Stato pratica + Incasso affiancati */
.status-row {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 320px);
  gap: 0.8rem;
  align-items: stretch;
  margin: 1rem 0 0;
}
@media (max-width: 720px) {
  .status-row {
    grid-template-columns: 1fr;
  }
}
/* Stato pratica — card neutra (colori per-stato rimossi) */
.status-section {
  margin: 0;
  border-radius: var(--erp-radius, 10px);
  border: 1px solid var(--erp-border, #e2e8f0);
  background: var(--erp-surface, #fff);
  box-shadow: var(--erp-shadow);
  padding: 0.85rem 1rem 1rem;
  position: relative;
}
.status-section > h3 {
  margin: 0 0 0.75rem;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--erp-head, #334155);
  font-weight: 700;
  display: flex;
  align-items: center;
}
/* Select stato — molto visibile (neutro) */
.status-section .status-select {
  font-size: 1.2rem;
  font-weight: 700;
  padding: 0.7rem 0.5rem;
  border-bottom-width: 3px;
  border-bottom-color: #94a3b8;
  color: #0f172a;
  background: transparent;
  width: 100%;
}
.status-section .status-select:focus {
  outline: none;
  box-shadow: 0 3px 0 0 #64748b;
}
/* Stato pratica come tasti: tutte le opzioni visibili, attivo evidenziato */
.status-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.status-btn {
  box-sizing: border-box;
  flex: 0 0 150px;
  text-align: center;
  white-space: nowrap;
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
/* Variante a larghezza piena: i tasti riempiono la colonna in parti uguali
       (es. Tipo cliente: Privato / Meccanico in una colonna stretta) */
.status-buttons--fill {
  width: 100%;
}
.status-buttons--fill .status-btn {
  flex: 1 1 0;
  text-align: center;
}
.status-btn:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}
.status-btn:focus-visible {
  outline: none;
  border-color: var(--erp-accent, #0f766e);
  box-shadow: var(--erp-focus);
}
.status-btn.is-active {
  background: var(--erp-accent, #0f766e);
  border-color: var(--erp-accent, #0f766e);
  color: #fff;
  box-shadow: 0 1px 2px rgba(15, 118, 110, 0.3);
}
.status-btn.is-active:hover {
  background: #115e59;
  border-color: #115e59;
}
/* Blocco Incasso — toggle Pagato / Non Pagato */
.paid-toggle {
  border-radius: var(--erp-radius, 10px);
  border: 1px solid var(--erp-border, #e2e8f0);
  background: var(--erp-surface, #fff);
  box-shadow: var(--erp-shadow);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.paid-toggle > h3 {
  display: flex;
  align-items: center;
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--erp-head, #334155);
  font-weight: 700;
}
.paid-toggle__buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.paid-btn {
  padding: 0.6rem 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.paid-btn:hover {
  border-color: #94a3b8;
}
.paid-btn.is-active.paid-btn--paid {
  background: #dcfce7;
  border-color: #16a34a;
  color: #166534;
}
.paid-btn.is-active.paid-btn--unpaid {
  background: #fee2e2;
  border-color: #dc2626;
  color: #991b1b;
}
.paid-toggle__method {
  display: flex;
  gap: 0.4rem;
  align-items: stretch;
  flex-wrap: wrap;
}
.paid-toggle__method select {
  flex: 1;
  min-width: 120px;
  padding: 0.45rem 0.4rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  font-size: 0.85rem;
}
.paid-toggle__method .btn {
  padding: 0.4rem 0.7rem;
  font-size: 0.82rem;
}
.paid-toggle__info {
  margin: 0;
  font-size: 0.8rem;
  color: #166534;
  font-weight: 600;
}
/* --- grid --- */
/* Copia input */
.copy-field {
  display: flex;
  gap: 5px;
  align-items: stretch;
}
.copy-field input {
  flex: 1;
}
.copy-btn {
  flex-shrink: 0;
  padding: 0 10px;
  font-size: 13px;
  white-space: nowrap;
}
.product-grid-panel {
  border: 1px solid var(--erp-border, #e2e8f0);
  border-radius: var(--erp-radius-sm, 8px);
  background: var(--erp-surface, #fff);
  padding: 0.6rem;
}
.product-grid-tools {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.product-grid-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.product-grid-host {
  min-height: 260px;
  border: 1px solid var(--erp-border, #e2e8f0);
  border-radius: 6px;
  background: #fff;
}
.product-grid-status {
  margin-top: 0.4rem;
  font-size: 12px;
  color: #333;
}
/* --- cliente --- */
/* Riga: Nome e cognome (pieno) + Tipo cliente in colonna stretta a destra */
.customer-name-row {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 0.65rem;
  align-items: start;
}
/* Blocco Cliente: a sinistra collega + nome impilati, a destra il tipo cliente */
.cliente-fields-row {
  display: grid;
  grid-template-columns: 1fr minmax(190px, 240px);
  gap: 0.65rem;
  align-items: start;
}
.cliente-fields-main {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.customer-block {
  margin: 1rem 0 0;
  border: 1px solid var(--erp-border, #e2e8f0);
  border-radius: var(--erp-radius, 10px);
  background: var(--erp-surface, #fff);
  box-shadow: var(--erp-shadow);
  padding: 0 0.95rem 0.95rem;
}
/* Blocco dedicato al collegamento cliente (gate del form) */
.customer-link-block {
  margin: 1rem 0 0;
  border: 1px solid var(--erp-border, #e2e8f0);
  border-radius: var(--erp-radius, 10px);
  background: var(--erp-surface, #fff);
  box-shadow: var(--erp-shadow);
  padding: 0.85rem 1rem 1rem;
}
.customer-link-block > h3 {
  margin: 0 0 0.75rem;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--erp-head, #334155);
  display: flex;
  align-items: center;
}
.customer-gate-hint {
  margin: 0.6rem 0 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.85rem;
  font-weight: 600;
}
/* Card di conferma cliente collegato */
.cliente-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0 0;
  padding: 0.5rem 0.7rem;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  background: #f0fdfa;
}
.cliente-card__badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #0f766e;
  background: rgba(15, 118, 110, 0.12);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}
.cliente-card__meta {
  font-size: 0.82rem;
  color: #334155;
  font-weight: 600;
}
.customer-block > h3 {
  display: flex;
  align-items: center;
  margin: 0 -0.95rem 0.85rem;
  padding: 0.7rem 0.95rem;
  border-bottom: 1px solid var(--erp-border, #e2e8f0);
  border-radius: var(--erp-radius, 10px) var(--erp-radius, 10px) 0 0;
  background: var(--erp-surface-muted, #f8fafc);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--erp-head, #334155);
}
.customer-split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 0.75rem;
}
.customer-column {
  border: 1px solid var(--erp-border, #e2e8f0);
  border-radius: var(--erp-radius-sm, 8px);
  background: var(--erp-surface-muted, #f8fafc);
  padding: 0.8rem;
}
.customer-column h4 {
  display: flex;
  align-items: center;
  margin: 0 0 0.6rem;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--erp-head, #334155);
}
/* Intestazione colonna con azione affiancata (es. Spedizione + "Copia da fatturazione") */
.customer-column__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.55rem;
}
.customer-column__head h4 {
  margin: 0;
}
.customer-column__copy {
  font-size: 11px;
  padding: 0.25rem 0.55rem;
}
/* --- vehicle --- */
.vehicle-focus-block {
  margin-top: 1rem;
  border: 1px solid var(--erp-border, #e2e8f0);
  border-radius: var(--erp-radius, 10px);
  background: var(--erp-surface, #fff);
  box-shadow: var(--erp-shadow);
  padding: 0.85rem 0.95rem 0.95rem;
}
.vehicle-focus-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.8rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--erp-border, #e2e8f0);
}
.vehicle-focus-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--erp-head, #334155);
  display: flex;
  align-items: center;
}
.vehicle-focus-flag {
  flex: 0 0 auto;
  padding: 0.28rem 0.45rem;
  border: 1px solid rgba(0, 0, 0, 0.55);
  background: rgba(0, 0, 0, 0.08);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.vehicle-focus-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}
.vehicle-ai-panel {
  margin: 0.75rem 0 0;
  border: 1px solid rgba(0, 0, 0, 0.45);
  background: rgba(255, 255, 255, 0.18);
  padding: 0.7rem 0.8rem;
}
.vehicle-ai-status {
  margin: 0 0 0.6rem;
  font-size: 12px;
  font-weight: 700;
}
.vehicle-ai-topflag {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin: 0 0 0.7rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid rgba(0, 0, 0, 0.45);
  font-size: 12px;
  font-weight: 700;
}
.vehicle-ai-topflag strong {
  text-transform: uppercase;
}
.vehicle-ai-topflag span {
  font-weight: 400;
  line-height: 1.35;
}
.vehicle-ai-topflag--high {
  background: rgba(17, 94, 89, 0.14);
  border-color: rgba(17, 94, 89, 0.55);
  color: #0f4d48;
}
.vehicle-ai-topflag--medium {
  background: rgba(180, 113, 9, 0.14);
  border-color: rgba(180, 113, 9, 0.48);
  color: #7c4a03;
}
.vehicle-ai-topflag--low {
  background: rgba(153, 27, 27, 0.12);
  border-color: rgba(153, 27, 27, 0.48);
  color: #7f1d1d;
}
.vehicle-ai-block + .vehicle-ai-block {
  margin-top: 0.7rem;
}
.vehicle-ai-block h4 {
  margin: 0 0 0.3rem;
  font-size: 12px;
  text-transform: uppercase;
}
.vehicle-ai-block p,
.vehicle-ai-block ul {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
}
.vehicle-ai-block ul {
  padding-left: 1rem;
}
.vehicle-ai-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}
.vehicle-ai-card {
  border: 1px solid rgba(0, 0, 0, 0.35);
  background: rgba(255, 255, 255, 0.28);
  padding: 0.55rem 0.6rem;
}
.vehicle-ai-card__head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}
.vehicle-ai-card__flags {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.vehicle-ai-card__head h4 {
  margin: 0;
  font-size: 12px;
}
.vehicle-ai-confidence {
  font-size: 11px;
  text-transform: uppercase;
  border: 1px solid rgba(0, 0, 0, 0.42);
  padding: 0.12rem 0.3rem;
  background: rgba(0, 0, 0, 0.06);
}
.vehicle-ai-source {
  font-size: 11px;
  border: 1px solid rgba(0, 0, 0, 0.36);
  padding: 0.12rem 0.3rem;
  background: rgba(255, 255, 255, 0.45);
}
.vehicle-ai-codes {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}
/* Code chips with copy button */
.vehicle-ai-code-wrap {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid rgba(0, 0, 0, 0.55);
  background: rgba(255, 255, 255, 0.55);
}
.vehicle-ai-code {
  padding: 0.15rem 0.35rem;
  font-size: 11px;
}
.vehicle-ai-copy-btn {
  border: none;
  border-left: 1px solid rgba(0, 0, 0, 0.3);
  background: transparent;
  padding: 0.1rem 0.28rem;
  font-size: 11px;
  cursor: pointer;
  color: #555;
  line-height: 1;
}
.vehicle-ai-copy-btn:hover {
  background: rgba(0, 0, 0, 0.09);
  color: #000;
}
.vehicle-ai-empty {
  display: inline-flex;
  align-items: center;
  border: 1px dashed rgba(0, 0, 0, 0.35);
  padding: 0.15rem 0.35rem;
  font-size: 11px;
  color: #666;
}
.vehicle-ai-verified {
  margin: 0 0 0.35rem;
  font-size: 11px;
  color: #0f4d48;
}
.vehicle-ai-card p {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}
/* Loading state */
.vehicle-ai-loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 12px;
  color: #374151;
  padding: 0.3rem 0;
}
.vehicle-ai-spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(0, 0, 0, 0.15);
  border-top-color: #374151;
  border-radius: 50%;
  animation: ai-spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes ai-spin {
  to {
    transform: rotate(360deg);
  }
}
/* Auto-filled field flash */
@keyframes ai-field-flash {
  0% {
    background: transparent;
  }
  25% {
    background: rgba(234, 179, 8, 0.28);
  }
  75% {
    background: rgba(234, 179, 8, 0.28);
  }
  100% {
    background: transparent;
  }
}
.vehicle-ai-autofilled {
  animation: ai-field-flash 2s ease forwards;
}
/* Client note callout in vehicle section */
.vehicle-ai-client-note {
  margin-top: 0.7rem;
  padding: 0.5rem 0.65rem;
  background: rgba(255, 249, 219, 0.75);
  border: 1px solid rgba(180, 130, 0, 0.38);
  font-size: 12px;
  line-height: 1.4;
}
.vehicle-ai-client-note strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #7c5800;
  letter-spacing: 0.04em;
}
/* --- inputs --- */
.admin-preventivo-form .field input,
.admin-preventivo-form .field textarea,
.admin-preventivo-form .field select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--erp-border-strong, #cbd5e1);
  border-radius: 6px;
  background: #fff;
  padding: 0.5rem 0.6rem;
  font-size: 0.9rem;
  color: #0f172a;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.admin-preventivo-form .field input:hover,
.admin-preventivo-form .field textarea:hover,
.admin-preventivo-form .field select:hover {
  border-color: #94a3b8;
}
.admin-preventivo-form .field input:focus,
.admin-preventivo-form .field textarea:focus,
.admin-preventivo-form .field select:focus {
  outline: none;
  border-color: var(--erp-accent, #0f766e);
  box-shadow: var(--erp-focus);
}
/* Importi/numeri: cifre tabellari per allineamento da gestionale */
.admin-preventivo-form .field input[type="number"] {
  font-variant-numeric: tabular-nums;
}
.admin-preventivo-form {
  padding-bottom: 10rem;
}
/* --- dock --- */
/* ── Riepilogo dock professionale ── */
.quote-summary-dock {
  position: fixed;
  right: 0.6rem;
  bottom: 3.6rem;
  z-index: 60;
  width: min(340px, calc(100vw - 1.2rem));
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
  padding: 0;
  max-height: calc(100vh - 1.2rem);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.qsd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
  border-radius: 14px 14px 0 0;
}
.qsd-head__badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #0f766e;
  background: rgba(15, 118, 110, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}
.qsd-head__actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.qsd-head__num {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  font-family: monospace;
}
.qsd-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: #64748b;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.qsd-toggle:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.qsd-auto-save-status {
  font-size: 10px;
  font-weight: 700;
  color: #0f766e;
  opacity: 0;
  transition: opacity 0.3s ease;
  white-space: nowrap;
}
.qsd-auto-save-status.is-visible {
  opacity: 1;
}
.qsd-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.qsd-body[hidden] {
  display: none;
}
.qsd-actions {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  padding: 0.75rem 1rem 0.25rem;
}
.qsd-actions .btn {
  font-size: 13px;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
}
.qsd-pdf {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 1rem 0;
}
.qsd-pdf .btn {
  font-size: 12px;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  flex: 1;
  text-align: center;
}
.qsd-sep {
  height: 1px;
  background: #e2e8f0;
  margin: 0.7rem 1rem;
}
.qsd-section {
  padding: 0 1rem 0.75rem;
}
.qsd-section--economico {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  padding: 0.75rem 1rem;
  border-radius: 0 0 14px 14px;
}
.qsd-section__title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  margin: 0 0 0.5rem;
}
.qsd-grid {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.qsd-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 13px;
  line-height: 1.3;
  padding: 0.2rem 0;
}
.qsd-row--totale {
  margin-top: 0.3rem;
  padding-top: 0.5rem;
  border-top: 2px solid #e2e8f0;
}
.qsd-label {
  color: #64748b;
  font-weight: 600;
  font-size: 12px;
  flex-shrink: 0;
}
.qsd-val {
  color: #0f172a;
  font-weight: 600;
  text-align: right;
  word-break: break-word;
  min-width: 0;
}
.qsd-val--num {
  font-family: 'SF Mono', Monaco, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.qsd-val--totale {
  font-size: 16px;
  font-weight: 800;
  color: #0f766e;
}
@media (max-width: 920px) {
  .admin-preventivo-form .form-grid-2,
  .admin-preventivo-form .form-grid-3 {
    grid-template-columns: 1fr;
  }
  .customer-name-row {
    grid-template-columns: 1fr;
  }
  .cliente-fields-row {
    grid-template-columns: 1fr;
  }
  .customer-split-grid {
    grid-template-columns: 1fr;
  }
  .vehicle-ai-cards {
    grid-template-columns: 1fr;
  }
  .admin-preventivo-form {
    padding-bottom: 11rem;
  }
  .quote-summary-dock {
    position: static;
    width: 100%;
    margin-top: 0.8rem;
    max-height: none;
    border-radius: 12px;
  }
}
/* --- chrome --- */
/* ── Barra azioni fissa (CREA / Salva) ── */
.preventivo-action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -4px 18px rgba(15, 23, 42, 0.12);
}
.preventivo-action-bar__buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.preventivo-action-bar__primary {
  min-width: 240px;
  font-weight: 700;
}
.preventivo-action-bar__notice {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.85rem;
  line-height: 1.2;
}
.preventivo-action-bar__notice:empty {
  display: none;
}
.preventivo-action-bar__notice.is-complete {
  color: #15803d;
  font-weight: 600;
}
.preventivo-action-bar__notice.is-incomplete {
  color: #b45309;
}
.preventivo-action-bar__notice .pc-label {
  font-weight: 700;
}
.preventivo-action-bar__notice .pc-chip {
  font-size: 0.8rem;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  cursor: pointer;
  transition: background 0.15s;
}
.preventivo-action-bar__notice .pc-chip:hover {
  background: #fde68a;
}
.preventivo-completeness-summary {
  margin: 1.5rem 0 5.5rem;
  padding: 1rem;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  background: #fff7ed;
}
.preventivo-completeness-summary__head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}
.preventivo-completeness-summary__head h3 {
  margin: 0.35rem 0 0;
  font-size: 1rem;
}
.preventivo-completeness-summary__head p,
.preventivo-completeness-summary__head small {
  margin: 0;
  color: #64748b;
}
.preventivo-smart-status {
  display: inline-flex;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}
.preventivo-smart-status.is-incomplete {
  background: #fee2e2;
  color: #991b1b;
}
.preventivo-smart-status.is-complete {
  background: #dcfce7;
  color: #166534;
}
.preventivo-missing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.55rem;
}
.preventivo-missing-item {
  display: grid;
  gap: 0.15rem;
  padding: 0.65rem;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  text-align: left;
  cursor: pointer;
}
.preventivo-missing-item strong {
  color: #9a3412;
  font-size: 0.7rem;
  text-transform: uppercase;
}
.preventivo-completeness-empty {
  margin: 0;
  padding: 0.75rem;
  border-radius: 8px;
  background: #dcfce7;
  color: #166534;
  font-weight: 700;
}
@media (max-width: 720px) {
  .preventivo-action-bar {
    padding: 0.5rem 0.7rem;
  }
  .preventivo-action-bar__buttons {
    width: 100%;
  }
  .preventivo-action-bar__primary {
    flex: 1;
    min-width: 0;
  }
}
/* ── Quick-links toolbar ── */
.quick-links-toolbar {
  position: fixed;
  bottom: 5.8rem;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding: 0.45rem 1rem;
  background: rgba(20, 28, 42, 0.95);
  backdrop-filter: blur(4px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.25);
}
.quick-links-toolbar-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
  margin-right: 0.2rem;
}
.quick-links-toolbar-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  padding: 0.3rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.07);
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.quick-links-toolbar-item:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}
.sidebar-actions {
  align-self: start;
  position: sticky;
  top: 1rem;
}
@media (max-width: 1024px) {
  .sidebar-actions {
    position: static;
  }
}
/* Dock fluttuante superato dalla barra azioni fissa + sidebar: sempre nascosto */
.quote-summary-dock--fixed {
  display: none !important;
}
/* ── Modale selezione/creazione cliente ── */
.cm-tabs {
  display: flex;
  border-bottom: 1px solid rgba(0, 0, 0, 0.25);
}
.cm-tab {
  flex: 1;
  padding: 0.55rem 0.5rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  color: #475569;
  transition: color 0.15s, border-color 0.15s;
}
.cm-tab:hover {
  color: #0f172a;
}
.cm-tab--active {
  border-bottom-color: #0f766e;
  color: #0f766e;
}
.cm-panel {
  display: none;
}
.cm-panel--active {
  display: block;
}
.cm-row {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: background 0.1s;
}
.cm-row:hover {
  background: rgba(15, 118, 110, 0.06);
}
.cm-row__name {
  font-weight: 700;
  font-size: 0.85rem;
  color: #0f172a;
}
.cm-row__meta {
  font-size: 0.76rem;
  color: #64748b;
  margin-top: 0.15rem;
}
.cm-empty {
  text-align: center;
  color: #94a3b8;
  font-size: 0.85rem;
  padding: 1.5rem;
}
@media (max-width: 600px) {
  .cm-row {
    padding: 0.7rem 0.5rem;
  }
}
/* ── Form tip button ──────────────────────────────────────────────────── */
.form-tip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1px solid rgba(15, 118, 110, 0.35);
  background: #f0fdfa;
  color: #0f766e;
  font-size: 0.68rem;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
  vertical-align: middle;
  margin-left: 6px;
  transition: background 0.15s, border-color 0.15s;
}
.form-tip-btn:hover {
  background: #ccfbf1;
  border-color: #0f766e;
}
/* ── Form tip popover (singleton, appended to body) ───────────────────── */
.form-tip-popover {
  position: absolute;
  z-index: 9500;
  width: 300px;
  max-width: calc(100vw - 20px);
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15), 0 2px 6px rgba(0, 0, 0, 0.06);
  display: none;
}
.form-tip-popover__close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 0.78rem;
  cursor: pointer;
  padding: 2px 5px;
  line-height: 1;
}
.form-tip-popover__close:hover {
  color: #0f172a;
}
.form-tip-popover__title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
  padding-right: 20px;
}
.form-tip-popover__body {
  font-size: 0.82rem;
  color: #374151;
  line-height: 1.6;
}
.form-tip-popover__body strong {
  color: #0f172a;
  font-weight: 700;
}
.form-tip-popover__body em {
  color: #0f766e;
  font-style: normal;
  font-weight: 600;
}
/* === Modale selezione/creazione cliente (ex _form_modale_cliente.php) === */
/* ── Cliente modal ─────────────────────────────────────────────────────── */
.cliente-modal {
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  padding: 0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18), 0 4px 16px rgba(0, 0, 0, 0.1);
  background: var(--admin-card-bg);
  color: var(--admin-text);
  width: min(700px, calc(100vw - 1rem));
  max-height: calc(100vh - 2rem);
  overflow: hidden;
}
.cliente-modal[open] {
  display: flex;
  flex-direction: column;
}
.cliente-modal::backdrop {
  background: rgba(10, 15, 30, 0.72);
  backdrop-filter: blur(4px);
}
.cliente-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--admin-border);
  flex-shrink: 0;
}
.cliente-modal__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--admin-text);
}
.cliente-modal__body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
}
/* Tabs */
.cm-tabs {
  display: flex;
  border-bottom: 1px solid var(--admin-border);
  background: var(--admin-bg);
  flex-shrink: 0;
}
.cm-tab {
  flex: 1;
  padding: 0.7rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--admin-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.cm-tab:hover {
  color: var(--admin-text);
  background: rgba(15, 118, 110, 0.04);
}
.cm-tab--active {
  color: #0f766e;
  border-bottom-color: #0f766e;
  background: var(--admin-card-bg);
}
/* Select panel */
.cm-search-wrap {
  padding: 0.75rem 1rem 0.6rem;
  border-bottom: 1px solid var(--admin-border);
  flex-shrink: 0;
}
.cm-search-wrap input {
  width: 100%;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  font-family: inherit;
  background: #fff;
  color: var(--admin-text);
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.cm-search-wrap input:focus {
  outline: none;
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}
#cm-list {
  overflow-y: auto;
  flex: 1;
  padding: 0.3rem 0;
}
.cm-row {
  padding: 0.65rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  transition: background 0.1s;
}
.cm-row:last-child {
  border-bottom: none;
}
.cm-row:hover {
  background: rgba(15, 118, 110, 0.05);
}
.cm-row__name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--admin-text);
}
.cm-row__meta {
  font-size: 0.77rem;
  color: var(--admin-muted);
  margin-top: 0.1rem;
}
.cm-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--admin-muted);
  font-size: 0.88rem;
}
.cm-list-more {
  padding: 0.6rem 1rem;
  text-align: center;
  border-top: 1px solid var(--admin-border);
  flex-shrink: 0;
}
/* Create panel */
.cm-create-body {
  padding: 1rem;
  overflow-y: auto;
  flex: 1;
  background: #f8fafc;
}
.cm-create-section {
  padding: 0.85rem;
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  background: #fff;
}
.cm-create-section + .cm-create-section {
  margin-top: 0.75rem;
}
.cm-create-section__head {
  margin-bottom: 0.7rem;
}
.cm-create-section__head strong {
  display: block;
  color: #0f172a;
  font-size: 0.83rem;
}
.cm-create-section__head span {
  display: block;
  margin-top: 0.1rem;
  color: var(--admin-muted);
  font-size: 0.72rem;
}
.cm-create-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.7rem;
}
.cm-create-grid .field {
  grid-column: span 6;
  margin: 0;
  min-width: 0;
}
.cm-create-grid .field--full {
  grid-column: 1 / -1;
}
.cm-create-grid .field--wide {
  grid-column: span 8;
}
.cm-create-grid .field--small {
  grid-column: span 4;
}
.cm-create-grid .field--tiny {
  grid-column: span 3;
}
.cm-create-grid label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.cm-required {
  color: #dc2626;
  font-size: 0.72rem;
}
.cm-field-note {
  color: var(--admin-muted);
  font-size: 0.66rem;
  font-weight: 500;
}
.cm-create-hint {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.75rem;
  border-left: 3px solid #0f766e;
  border-radius: 6px;
  background: #ecfdf5;
  color: #475569;
  font-size: 0.75rem;
  line-height: 1.4;
}
.cm-create-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--admin-border);
  background: var(--admin-bg);
  flex-shrink: 0;
}
.cm-create-error {
  color: #b91c1c;
  font-size: 0.82rem;
  padding: 0 1.25rem 0.5rem;
  flex-shrink: 0;
}
@media (max-width: 760px) {
  .cm-create-grid .field,
  .cm-create-grid .field--wide,
  .cm-create-grid .field--small {
    grid-column: span 6;
  }
  .cm-create-grid .field--full {
    grid-column: 1 / -1;
  }
  .cm-create-grid .field--tiny {
    grid-column: span 3;
  }
}
@media (max-width: 520px) {
  .cm-create-body {
    padding: 0.65rem;
  }
  .cm-create-section {
    padding: 0.7rem;
  }
  .cm-create-grid .field,
  .cm-create-grid .field--wide,
  .cm-create-grid .field--small,
  .cm-create-grid .field--tiny {
    grid-column: 1 / -1;
  }
  .cm-create-footer {
    justify-content: stretch;
  }
  .cm-create-footer .btn {
    flex: 1;
  }
}
.extra-file-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
}
.extra-file-name {
  flex: 1;
  font-size: 0.83rem;
  color: #0369a1;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.extra-file-name:hover {
  text-decoration: underline;
}
.extra-file-delete {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 0.85rem;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
}
.extra-file-delete:hover {
  background: #fee2e2;
  color: #dc2626;
}
.page-researcher-create .researcher-chat-layout {
  display: flex;
  height: calc(100vh - var(--admin-header-height) - 60px);
  min-height: 500px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--admin-border);
  overflow: hidden;
  margin: -10px -30px 0;
}
.page-researcher-create .researcher-sidebar {
  width: 260px;
  border-right: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  flex-shrink: 0;
}
.page-researcher-create .researcher-sidebar-list {
  flex: 1;
  overflow-y: auto;
}
.page-researcher-create .researcher-session-item {
  display: block;
  padding: 10px 16px;
  text-decoration: none;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s;
}
.page-researcher-create .researcher-session-item:hover {
  background: #f1f5f9;
}
.page-researcher-create .researcher-session-item.active {
  background: #e0f2fe;
  border-left: 3px solid #0f766e;
}
.page-researcher-create .researcher-session-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.page-researcher-create .researcher-session-meta {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.page-researcher-create .researcher-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.page-researcher-create .researcher-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-researcher-create .researcher-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}
.page-researcher-create .researcher-welcome {
  text-align: center;
  margin: auto;
  padding: 20px;
}
.page-researcher-create .researcher-bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.6;
  word-wrap: break-word;
}
.page-researcher-create .researcher-bubble.user {
  align-self: flex-end;
  background: #0f766e;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.page-researcher-create .researcher-bubble.assistant {
  align-self: flex-start;
  background: #f1f5f9;
  color: #0f172a;
  border-bottom-left-radius: 4px;
}
.page-researcher-create .researcher-bubble.assistant pre {
  background: #e2e8f0;
  padding: 10px 12px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.85rem;
}
.page-researcher-create .researcher-bubble.assistant code {
  background: #e2e8f0;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
}
.page-researcher-create .researcher-bubble.assistant ul,
.page-researcher-create .researcher-bubble.assistant ol {
  margin: 8px 0;
  padding-left: 20px;
}
.page-researcher-create .researcher-bubble.assistant p {
  margin: 0 0 8px;
}
.page-researcher-create .researcher-bubble.assistant p:last-child {
  margin-bottom: 0;
}
.page-researcher-create .researcher-typing-dots {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}
.page-researcher-create .researcher-typing-dots span {
  width: 8px;
  height: 8px;
  background: #94a3b8;
  border-radius: 50%;
  animation: researcherTyping 1.4s infinite ease-in-out both;
}
.page-researcher-create .researcher-typing-dots span:nth-child(1) {
  animation-delay: -0.32s;
}
.page-researcher-create .researcher-typing-dots span:nth-child(2) {
  animation-delay: -0.16s;
}
@keyframes researcherTyping {
  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}
.page-researcher-create .researcher-input-area {
  padding: 12px 24px 16px;
  border-top: 1px solid var(--admin-border);
  background: #fff;
}
.page-researcher-create .researcher-input-wrap {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.page-researcher-create .researcher-textarea {
  flex: 1;
  resize: none;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.92rem;
  font-family: inherit;
  line-height: 1.5;
  max-height: 120px;
  min-height: 44px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.page-researcher-create .researcher-textarea:focus {
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}
.page-researcher-create .researcher-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: none;
  background: #0f766e;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
}
.page-researcher-create .researcher-send-btn:hover {
  background: #115e59;
}
.page-researcher-create .researcher-send-btn:active {
  transform: scale(0.96);
}
.page-researcher-create .researcher-send-btn:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}
@media (max-width: 960px) {
  .page-researcher-create .researcher-chat-layout {
    flex-direction: column;
    margin: 0;
    height: calc(100vh - var(--admin-header-height) - 40px);
  }
  .page-researcher-create .researcher-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--admin-border);
    max-height: 180px;
  }
  .page-researcher-create .researcher-header {
    padding: 12px 16px;
  }
  .page-researcher-create .researcher-messages {
    padding: 16px;
  }
  .page-researcher-create .researcher-input-area {
    padding: 10px 16px 12px;
  }
  .page-researcher-create .researcher-vehicle-input-wrap {
    width: 100%;
  }
  .page-researcher-create .researcher-vehicle-input-wrap input {
    max-width: 100% !important;
    width: 100%;
  }
}
.page-researcher-show .researcher-chat-layout {
  display: flex;
  height: calc(100vh - var(--admin-header-height) - 60px);
  min-height: 500px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--admin-border);
  overflow: hidden;
  margin: -10px -30px 0;
}
.page-researcher-show .researcher-sidebar {
  width: 260px;
  border-right: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  flex-shrink: 0;
}
.page-researcher-show .researcher-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.page-researcher-show .researcher-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-researcher-show .researcher-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}
.page-researcher-show .researcher-bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.6;
  word-wrap: break-word;
}
.page-researcher-show .researcher-bubble.user {
  align-self: flex-end;
  background: #0f766e;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.page-researcher-show .researcher-bubble.assistant {
  align-self: flex-start;
  background: #f1f5f9;
  color: #0f172a;
  border-bottom-left-radius: 4px;
}
.page-researcher-show .researcher-bubble.assistant pre {
  background: #e2e8f0;
  padding: 10px 12px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.85rem;
}
.page-researcher-show .researcher-bubble.assistant code {
  background: #e2e8f0;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
}
.page-researcher-show .researcher-bubble.assistant ul,
.page-researcher-show .researcher-bubble.assistant ol {
  margin: 8px 0;
  padding-left: 20px;
}
.page-researcher-show .researcher-bubble.assistant p {
  margin: 0 0 8px;
}
.page-researcher-show .researcher-bubble.assistant p:last-child {
  margin-bottom: 0;
}
.page-researcher-show .researcher-typing-dots {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}
.page-researcher-show .researcher-typing-dots span {
  width: 8px;
  height: 8px;
  background: #94a3b8;
  border-radius: 50%;
  animation: researcherTyping 1.4s infinite ease-in-out both;
}
.page-researcher-show .researcher-typing-dots span:nth-child(1) {
  animation-delay: -0.32s;
}
.page-researcher-show .researcher-typing-dots span:nth-child(2) {
  animation-delay: -0.16s;
}
@keyframes researcherTyping {
  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}
.page-researcher-show .researcher-input-area {
  padding: 12px 24px 16px;
  border-top: 1px solid var(--admin-border);
  background: #fff;
}
.page-researcher-show .researcher-input-wrap {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.page-researcher-show .researcher-textarea {
  flex: 1;
  resize: none;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.92rem;
  font-family: inherit;
  line-height: 1.5;
  max-height: 120px;
  min-height: 44px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.page-researcher-show .researcher-textarea:focus {
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}
.page-researcher-show .researcher-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: none;
  background: #0f766e;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
}
.page-researcher-show .researcher-send-btn:hover {
  background: #115e59;
}
.page-researcher-show .researcher-send-btn:active {
  transform: scale(0.96);
}
.page-researcher-show .researcher-send-btn:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}
@media (max-width: 960px) {
  .page-researcher-show .researcher-chat-layout {
    flex-direction: column;
    margin: 0;
    height: calc(100vh - var(--admin-header-height) - 40px);
  }
  .page-researcher-show .researcher-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--admin-border);
    max-height: 200px;
  }
  .page-researcher-show .researcher-header {
    padding: 12px 16px;
  }
  .page-researcher-show .researcher-messages {
    padding: 16px;
  }
  .page-researcher-show .researcher-input-area {
    padding: 10px 16px 12px;
  }
}
@media (max-width: 960px) {
  .page-researcher-index .researcher-table-wrap {
    display: none;
  }
  .page-researcher-index .researcher-cards {
    display: block !important;
  }
}
.page-access-logs {
  /* app/Views/admin/access_logs/index.php */
  /* Mobile: riduci spaziatura globale della pagina */
  /* Responsive: su schermi stretti trasforma la tabella in card */
}
@media (max-width: 640px) {
  .page-access-logs .kpi-grid {
    gap: 8px !important;
    margin-bottom: 14px !important;
  }
  .page-access-logs .kpi-card {
    padding: 12px !important;
  }
  .page-access-logs .kpi-value {
    font-size: 1.3rem !important;
  }
  .page-access-logs .admin-card {
    padding: 14px !important;
    margin-bottom: 12px !important;
  }
  .page-access-logs .admin-title {
    font-size: 1.25rem !important;
    margin-bottom: 2px !important;
  }
  .page-access-logs .admin-subtitle {
    margin-bottom: 12px !important;
    font-size: 0.85rem !important;
  }
}
@media (max-width: 640px) {
  .page-access-logs table,
  .page-access-logs thead,
  .page-access-logs tbody,
  .page-access-logs th,
  .page-access-logs td,
  .page-access-logs tr {
    display: block;
  }
  .page-access-logs thead tr {
    display: none;
  }
  .page-access-logs tbody tr {
    margin-bottom: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px;
    background: #fff;
  }
  .page-access-logs tbody td {
    border: none;
    padding: 4px 0;
    position: relative;
    padding-left: 40%;
  }
  .page-access-logs tbody td::before {
    position: absolute;
    left: 0;
    width: 35%;
    white-space: nowrap;
    font-weight: 600;
    color: #64748b;
    font-size: 0.8rem;
    content: attr(data-label);
  }
  .page-access-logs tbody td:nth-of-type(1)::before {
    content: "Data";
  }
  .page-access-logs tbody td:nth-of-type(2)::before {
    content: "Pagina";
  }
  .page-access-logs tbody td:nth-of-type(3)::before {
    content: "Metodo";
  }
  .page-access-logs tbody td:nth-of-type(4)::before {
    content: "HTTP";
  }
}
.page-articoli-index {
  /* app/Views/admin/articoli/index.php */
}
.page-articoli-index .art-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.page-articoli-index .art-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid rgba(19, 34, 55, 0.1);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}
.page-articoli-index .art-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(19, 34, 55, 0.06);
  vertical-align: middle;
}
.page-articoli-index .art-table tr:last-child td {
  border-bottom: 0;
}
.page-articoli-index .art-table tr:hover td {
  background: rgba(15, 118, 110, 0.03);
}
.page-articoli-index .art-codice {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink);
  font-family: monospace;
}
.page-articoli-index .art-nome {
  font-size: 0.85rem;
}
.page-articoli-index .art-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.1rem;
}
.page-articoli-index .kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.page-articoli-index .kpi-card {
  background: var(--admin-card-bg);
  border-radius: 10px;
  border: 1px solid var(--admin-border);
  padding: 16px 18px;
}
.page-articoli-index .kpi-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 4px;
}
.page-articoli-index .kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
}
.page-articoli-index .kpi-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}
.page-articoli-index .promo-badge {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
}
.page-articoli-index .low-stock {
  color: #dc2626;
  font-weight: 700;
}
.page-articoli-index .ok-stock {
  color: #0f766e;
}
.page-articoli-index .price-col {
  font-family: monospace;
  font-size: 0.85rem;
  text-align: right;
  white-space: nowrap;
}
.page-clienti-index {
  /* app/Views/admin/clienti/index.php */
}
.page-clienti-index .cl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.page-clienti-index .cl-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid rgba(19, 34, 55, 0.1);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}
.page-clienti-index .cl-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(19, 34, 55, 0.06);
  vertical-align: middle;
}
.page-clienti-index .cl-table tr:last-child td {
  border-bottom: 0;
}
.page-clienti-index .cl-table tr:hover td {
  background: rgba(15, 118, 110, 0.03);
}
.page-clienti-index .cl-name {
  font-weight: 700;
  color: var(--ink);
}
.page-clienti-index .cl-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.1rem;
}
.page-clienti-index .cl-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}
.page-clienti-index .cl-badge--private {
  background: #eff6ff;
  color: #1d4ed8;
}
.page-clienti-index .cl-badge--mechanic {
  background: #fef3c7;
  color: #92400e;
}
.page-clienti-index .cl-badge--company {
  background: #f0fdf4;
  color: #15803d;
}
.page-fornitori-index {
  /* app/Views/admin/fornitori/index.php */
  /* KPI */
  /* Ricerca */
  /* Tabella */
  /* Empty state */
  /* Responsive: tabella → card sotto 960px */
}
.page-fornitori-index .fn-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
  margin-bottom: 16px;
}
.page-fornitori-index .fn-kpi {
  background: var(--admin-card-bg, #fff);
  border: 1px solid var(--admin-border, #e2e8f0);
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
}
.page-fornitori-index .fn-kpi__label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
}
.page-fornitori-index .fn-kpi__value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.1;
  margin-top: 0.2rem;
}
.page-fornitori-index .fn-kpi__hint {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.15rem;
}
.page-fornitori-index .fn-toolbar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
}
.page-fornitori-index .fn-search {
  position: relative;
  flex: 1;
  min-width: 220px;
}
.page-fornitori-index .fn-search svg {
  position: absolute;
  left: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}
.page-fornitori-index .fn-search input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(19, 34, 55, 0.18);
  border-radius: 8px;
  padding: 0.5rem 0.7rem 0.5rem 2rem;
  font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.page-fornitori-index .fn-search input:focus {
  outline: none;
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}
.page-fornitori-index .fn-count {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 12px;
}
.page-fornitori-index .fn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.page-fornitori-index .fn-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid rgba(19, 34, 55, 0.1);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}
.page-fornitori-index .fn-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(19, 34, 55, 0.06);
  vertical-align: middle;
}
.page-fornitori-index .fn-table tbody tr {
  transition: background 0.15s;
}
.page-fornitori-index .fn-table tbody tr:hover td {
  background: rgba(15, 118, 110, 0.04);
}
.page-fornitori-index .fn-name {
  font-weight: 700;
}
.page-fornitori-index .fn-name a {
  color: var(--ink);
  text-decoration: none;
}
.page-fornitori-index .fn-name a:hover {
  color: #0f766e;
  text-decoration: underline;
}
.page-fornitori-index .fn-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.1rem;
}
.page-fornitori-index .fn-actions {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
}
.page-fornitori-index .fn-actions .btn {
  font-size: 0.8rem;
  padding: 0.3rem 0.7rem;
}
.page-fornitori-index .fn-actions form {
  margin: 0;
}
.page-fornitori-index .fn-empty {
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--muted);
}
.page-fornitori-index .fn-empty svg {
  width: 42px;
  height: 42px;
  color: #cbd5e1;
  margin-bottom: 0.6rem;
}
.page-fornitori-index .fn-empty h3 {
  margin: 0 0 0.3rem;
  color: var(--ink);
  font-size: 1rem;
}
.page-fornitori-index .fn-empty p {
  margin: 0 0 0.9rem;
}
@media (max-width: 960px) {
  .page-fornitori-index .fn-kpis {
    grid-template-columns: 1fr;
  }
  .page-fornitori-index .fn-table thead {
    display: none;
  }
  .page-fornitori-index .fn-table,
  .page-fornitori-index .fn-table tbody,
  .page-fornitori-index .fn-table tr,
  .page-fornitori-index .fn-table td {
    display: block;
    width: 100%;
  }
  .page-fornitori-index .fn-table tr {
    border: 1px solid var(--admin-border, #e2e8f0);
    border-radius: 10px;
    margin-bottom: 0.65rem;
    padding: 0.5rem 0.75rem;
  }
  .page-fornitori-index .fn-table tbody tr:hover td {
    background: transparent;
  }
  .page-fornitori-index .fn-table td {
    border: 0;
    padding: 0.3rem 0;
  }
  .page-fornitori-index .fn-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 0.1rem;
  }
  .page-fornitori-index .fn-table td.fn-cell-actions::before {
    content: none;
  }
  .page-fornitori-index .fn-actions {
    justify-content: flex-start;
    margin-top: 0.35rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .page-fornitori-index .fn-table tbody tr,
  .page-fornitori-index .fn-search input {
    transition: none;
  }
}
.page-veicoli-index {
  /* app/Views/admin/veicoli/index.php */
}
.page-veicoli-index .vei-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.page-veicoli-index .vei-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid rgba(19, 34, 55, 0.1);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}
.page-veicoli-index .vei-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(19, 34, 55, 0.06);
  vertical-align: middle;
}
.page-veicoli-index .vei-table tr:last-child td {
  border-bottom: 0;
}
.page-veicoli-index .vei-table tr:hover td {
  background: rgba(15, 118, 110, 0.03);
}
.page-veicoli-index .vei-plate {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: var(--ink);
  font-family: monospace;
}
.page-veicoli-index .vei-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.1rem;
}
@keyframes vp-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes vp-fadein {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.page-veicoli-profile {
  /* app/Views/admin/veicoli/profile.php */
  /* ── Tab bar ── */
  /* ── Tab panels ── */
  /* ── Search bar (OEM panels) ── */
  /* ── Aftermarket: 3-column layout ── */
  /* ── Empty state ── */
  /* ── Contatori e label small ── */
  /* ── Category list ── */
  /* ── Filtro fornitore ── */
  /* ── Article grid ── */
  /* ── Article detail panel ── */
  /* ── Spinner & loading ── */
  /* ── Copy button ── */
  /* ── OEM toolbar (filtro + searchParam manuale) ── */
  /* ── OEM groups (albero componenti) ── */
  /* ── Specs nelle card articolo ── */
  /* ── Fornitore nel pannello dettaglio ── */
  /* ── Responsive ── */
}
.page-veicoli-profile .vp-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 20px;
  border-bottom: 2px solid rgba(19, 34, 55, 0.1);
}
.page-veicoli-profile .vp-tab {
  padding: 0.6rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  border-radius: 6px 6px 0 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.page-veicoli-profile .vp-tab:hover {
  color: var(--primary);
  background: rgba(15, 118, 110, 0.05);
}
.page-veicoli-profile .vp-tab--active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: rgba(15, 118, 110, 0.06);
}
.page-veicoli-profile .vp-tab-panel {
  display: none;
}
.page-veicoli-profile .vp-tab-panel--active {
  display: block;
}
.page-veicoli-profile .vp-search-bar {
  display: flex;
  gap: 8px;
}
.page-veicoli-profile .vp-search-bar input {
  flex: 1;
}
.page-veicoli-profile .vp-aftermarket-body {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.page-veicoli-profile .vp-categories-pane {
  flex: 0 0 220px;
  min-width: 0;
  position: sticky;
  top: 20px;
  /* segue lo scroll */
}
.page-veicoli-profile .vp-category-search {
  margin-bottom: 10px;
}
.page-veicoli-profile .vp-category-search input {
  width: 100%;
}
.page-veicoli-profile .vp-categories-scroll {
  max-height: calc(100vh - 260px);
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}
.page-veicoli-profile .vp-articles-pane {
  flex: 1;
  min-width: 0;
}
.page-veicoli-profile .vp-detail-pane {
  display: none;
  /* nascosto finché non c'è un articolo selezionato */
  width: 320px;
  min-width: 320px;
}
.page-veicoli-profile .vp-tab-panel.has-detail .vp-detail-pane {
  display: block;
  animation: vp-fadein 0.2s ease;
}
.page-veicoli-profile .vp-empty-state {
  color: var(--muted);
  font-size: 0.88rem;
  padding: 2rem 1rem;
  text-align: center;
  line-height: 1.6;
}
.page-veicoli-profile .vp-empty-state span {
  opacity: 0.4;
  font-size: 1.1rem;
}
.page-veicoli-profile .vp-cat-count {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.page-veicoli-profile .vp-count {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(19, 34, 55, 0.08);
  border-radius: 10px;
  padding: 1px 6px;
  margin-left: 4px;
  color: var(--muted);
}
.page-veicoli-profile .vp-group {
  margin-bottom: 0.5rem;
  border: 1px solid rgba(19, 34, 55, 0.1);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
}
.page-veicoli-profile .vp-group summary {
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.page-veicoli-profile .vp-group summary::-webkit-details-marker {
  display: none;
}
.page-veicoli-profile .vp-group summary::after {
  content: "›";
  color: var(--muted);
  transition: transform 0.15s;
}
.page-veicoli-profile .vp-group[open] summary::after {
  transform: rotate(90deg);
}
.page-veicoli-profile .vp-category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.page-veicoli-profile .vp-category {
  background: #f8fafc;
  border: 1px solid rgba(19, 34, 55, 0.1);
  border-radius: 5px;
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
}
.page-veicoli-profile .vp-category:hover {
  background: rgba(15, 118, 110, 0.08);
  border-color: rgba(15, 118, 110, 0.3);
}
.page-veicoli-profile .vp-category.active {
  background: rgba(15, 118, 110, 0.1);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}
.page-veicoli-profile .vp-category mark {
  background: #fef08a;
  padding: 0;
}
.page-veicoli-profile .vp-supplier-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}
.page-veicoli-profile .vp-supplier-pill {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 600;
  border: 1px solid rgba(19, 34, 55, 0.15);
  background: #f1f5f9;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  white-space: nowrap;
}
.page-veicoli-profile .vp-supplier-pill:hover {
  border-color: rgba(15, 118, 110, 0.4);
  color: var(--primary);
}
.page-veicoli-profile .vp-supplier-pill.active {
  background: rgba(15, 118, 110, 0.1);
  border-color: var(--primary);
  color: var(--primary);
}
.page-veicoli-profile .vp-article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.65rem;
}
.page-veicoli-profile .vp-tab-panel.has-detail .vp-article-grid {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}
.page-veicoli-profile .vp-article-card {
  background: #fff;
  border: 1px solid rgba(19, 34, 55, 0.1);
  border-radius: 10px;
  padding: 0.65rem;
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.page-veicoli-profile .vp-article-card:hover {
  border-color: rgba(15, 118, 110, 0.4);
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.1);
}
.page-veicoli-profile .vp-article-card.active {
  border-color: var(--primary);
  background: rgba(15, 118, 110, 0.05);
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.12);
}
.page-veicoli-profile .vp-article-card img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 6px;
  background: #f8fafc;
  flex-shrink: 0;
}
.page-veicoli-profile .vp-article-img-placeholder {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 6px;
  background: #f1f5f9;
}
.page-veicoli-profile .vp-article-info {
  flex: 1;
  min-width: 0;
}
.page-veicoli-profile .vp-article-name {
  font-weight: 700;
  font-size: 0.82rem;
  line-height: 1.3;
}
.page-veicoli-profile .vp-article-no {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 3px;
}
.page-veicoli-profile .vp-article-supplier-pill {
  display: inline-block;
  margin-top: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(15, 118, 110, 0.08);
  color: var(--primary);
  border-radius: 10px;
  padding: 1px 7px;
}
.page-veicoli-profile .vp-detail {
  border: 1px solid rgba(15, 118, 110, 0.2);
  border-radius: 12px;
  padding: 1rem;
  background: #f8fffe;
  position: sticky;
  top: 20px;
  /* segue lo scroll */
}
.page-veicoli-profile .vp-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.85rem;
  gap: 0.5rem;
}
.page-veicoli-profile .vp-detail-head-info {
  flex: 1;
  min-width: 0;
}
.page-veicoli-profile .vp-detail-product-name {
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.3;
  margin-bottom: 4px;
}
.page-veicoli-profile .vp-detail-code {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--muted);
}
.page-veicoli-profile .vp-detail-close {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: var(--muted);
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: background 0.12s;
}
.page-veicoli-profile .vp-detail-close:hover {
  background: rgba(19, 34, 55, 0.08);
  color: var(--ink);
}
.page-veicoli-profile .vp-detail-images {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}
.page-veicoli-profile .vp-detail-images img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 7px;
  background: #fff;
  border: 1px solid rgba(19, 34, 55, 0.1);
  cursor: zoom-in;
}
.page-veicoli-profile .vp-detail-ean {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.6rem;
}
.page-veicoli-profile .vp-detail-section {
  border: 1px solid rgba(19, 34, 55, 0.1);
  border-radius: 7px;
  padding: 0.45rem 0.65rem;
  margin-bottom: 0.5rem;
}
.page-veicoli-profile .vp-detail-section summary {
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
}
.page-veicoli-profile .vp-detail-section summary::-webkit-details-marker {
  display: none;
}
.page-veicoli-profile .vp-spec-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.45rem;
  font-size: 0.78rem;
}
.page-veicoli-profile .vp-spec-table td {
  padding: 3px 4px;
  border-bottom: 1px solid rgba(19, 34, 55, 0.06);
  vertical-align: top;
}
.page-veicoli-profile .vp-spec-table td:first-child {
  font-weight: 600;
  color: var(--muted);
  width: 42%;
}
.page-veicoli-profile .vp-ref-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 0.45rem;
}
.page-veicoli-profile .vp-ref-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
  padding: 3px 7px;
  background: #f1f5f9;
  border: 1px solid rgba(19, 34, 55, 0.1);
  border-radius: 6px;
  font-size: 0.76rem;
}
.page-veicoli-profile .vp-ref-badge code {
  font-size: 0.78rem;
}
.page-veicoli-profile .vp-ref-badge small {
  color: var(--muted);
}
.page-veicoli-profile .vp-lazy-content {
  padding-top: 0.4rem;
}
.page-veicoli-profile .vp-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.83rem;
  padding: 0.75rem 0;
}
.page-veicoli-profile .vp-spinner {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border: 2px solid rgba(15, 118, 110, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: vp-spin 0.65s linear infinite;
}
.page-veicoli-profile .vp-error-inline {
  color: #dc2626;
  font-size: 0.8rem;
}
.page-veicoli-profile .vp-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--muted);
  border-radius: 3px;
  transition: background 0.1s, color 0.1s;
  vertical-align: middle;
}
.page-veicoli-profile .vp-copy-btn:hover {
  background: rgba(19, 34, 55, 0.08);
  color: var(--ink);
}
.page-veicoli-profile .vp-copy-btn--done {
  color: var(--primary) !important;
}
.page-veicoli-profile .vp-oem-toolbar {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.page-veicoli-profile .vp-oem-filter-input {
  width: 100%;
}
.page-veicoli-profile .vp-oem-groups {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.page-veicoli-profile .vp-oem-group {
  border: 1px solid rgba(19, 34, 55, 0.1);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  background: #fff;
}
.page-veicoli-profile .vp-oem-group summary {
  font-weight: 700;
  font-size: 0.83rem;
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
}
.page-veicoli-profile .vp-oem-group summary::-webkit-details-marker {
  display: none;
}
.page-veicoli-profile .vp-oem-group[open] {
  background: #f8fffe;
  border-color: rgba(15, 118, 110, 0.2);
}
.page-veicoli-profile .vp-oem-codes {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 8px;
}
.page-veicoli-profile .vp-oem-code-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 4px 6px;
  border-radius: 6px;
  background: #f1f5f9;
  font-size: 0.82rem;
}
.page-veicoli-profile .vp-oem-code-row code {
  flex: 0 0 auto;
  font-size: 0.82rem;
}
.page-veicoli-profile .vp-oem-search-btn {
  margin-left: auto;
  flex-shrink: 0;
  background: rgba(15, 118, 110, 0.07);
  border: 1px solid rgba(15, 118, 110, 0.2);
  color: var(--primary);
  border-radius: 6px;
  padding: 2px 9px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.page-veicoli-profile .vp-oem-search-btn:hover {
  background: rgba(15, 118, 110, 0.15);
  border-color: var(--primary);
}
.page-veicoli-profile .vp-article-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid rgba(19, 34, 55, 0.07);
}
.page-veicoli-profile .vp-spec-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(15, 118, 110, 0.08);
  color: var(--primary);
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.page-veicoli-profile .vp-detail-supplier {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0 4px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}
.page-veicoli-profile .vp-supplier-logo {
  height: 22px;
  width: auto;
  max-width: 80px;
  object-fit: contain;
  filter: grayscale(30%);
}
@media (max-width: 1024px) {
  .page-veicoli-profile .vp-detail-pane {
    width: 280px;
    min-width: 280px;
  }
}
@media (max-width: 860px) {
  .page-veicoli-profile .vp-tabs {
    overflow-x: auto;
  }
  .page-veicoli-profile .vp-aftermarket-body {
    flex-direction: column;
  }
  .page-veicoli-profile .vp-categories-pane {
    position: static;
    flex: none;
    width: 100%;
  }
  .page-veicoli-profile .vp-categories-scroll {
    max-height: 260px;
  }
  .page-veicoli-profile .vp-detail-pane {
    width: 100%;
    min-width: 0;
  }
  .page-veicoli-profile .vp-tab-panel.has-detail .vp-article-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}
.page-services {
  /* app/Views/admin/services/index.php */
}
.page-services .srv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}
.page-services .srv-card {
  background: #fff;
  border: 1px solid rgba(19, 34, 55, 0.1);
  border-radius: 14px;
  overflow: hidden;
}
.page-services .srv-card-head {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid rgba(19, 34, 55, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.page-services .srv-card-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0;
}
.page-services .srv-rates-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
  padding: 1.1rem 1.25rem;
}
.page-services .srv-rates-grid .field {
  margin: 0;
}
.page-services .srv-rates-grid label {
  font-size: 0.8rem;
}
@media (max-width: 860px) {
  .page-services .srv-grid {
    grid-template-columns: 1fr;
  }
  .page-services .srv-rates-grid {
    grid-template-columns: 1fr;
  }
}
.page-support-index {
  /* app/Views/admin/support_tickets/index.php */
}
.page-support-index .support-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 20px;
}
.page-support-index .support-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.page-support-index .support-table {
  width: 100%;
  border-collapse: collapse;
}
.page-support-index .support-table th,
.page-support-index .support-table td {
  padding: 10px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
}
.page-support-index .support-table th {
  background: #f8fafc;
  font-size: 0.82rem;
  text-align: left;
  color: #475569;
}
.page-support-index .ticket-number {
  font-weight: 700;
  color: #0f172a;
}
.page-support-index .ticket-subject {
  font-weight: 650;
  color: #0f172a;
}
.page-support-index .ticket-meta {
  color: #64748b;
  font-size: 0.86rem;
  margin-top: 3px;
}
.page-support-index .ticket-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #334155;
}
.page-support-index .ticket-badge.aperto {
  background: #dbeafe;
  color: #1d4ed8;
}
.page-support-index .ticket-badge.in_lavorazione {
  background: #fef3c7;
  color: #92400e;
}
.page-support-index .ticket-badge.in_attesa_cliente {
  background: #ede9fe;
  color: #6d28d9;
}
.page-support-index .ticket-badge.risolto {
  background: #dcfce7;
  color: #166534;
}
.page-support-index .ticket-badge.chiuso {
  background: #e2e8f0;
  color: #475569;
}
.page-support-index .priority-badge {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #334155;
}
.page-support-index .priority-badge.alta {
  background: #ffedd5;
  color: #c2410c;
}
.page-support-index .priority-badge.urgente {
  background: #fee2e2;
  color: #b91c1c;
}
@media (max-width: 860px) {
  .page-support-index .support-toolbar {
    display: block;
  }
  .page-support-index .support-toolbar .btn {
    margin-top: 10px;
  }
  .page-support-index .support-filters > div,
  .page-support-index .support-filters input,
  .page-support-index .support-filters select {
    width: 100%;
  }
  .page-support-index .support-table,
  .page-support-index .support-table thead,
  .page-support-index .support-table tbody,
  .page-support-index .support-table tr,
  .page-support-index .support-table td {
    display: block;
    width: 100%;
  }
  .page-support-index .support-table thead {
    display: none;
  }
  .page-support-index .support-table tr {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 12px;
    background: #fff;
  }
  .page-support-index .support-table td {
    border: 0;
    padding: 6px 0;
  }
  .page-support-index .support-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 2px;
  }
}
.page-support-show {
  /* app/Views/admin/support_tickets/show.php */
}
.page-support-show .ticket-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}
.page-support-show .ticket-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.page-support-show .conversation {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.page-support-show .message {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}
.page-support-show .message.internal {
  border-color: #fde68a;
  background: #fffbeb;
}
.page-support-show .message-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #64748b;
  font-size: 0.82rem;
  margin-bottom: 8px;
}
.page-support-show .message-body {
  white-space: pre-wrap;
  color: #0f172a;
  line-height: 1.5;
}
.page-support-show .side-field {
  margin-bottom: 12px;
}
.page-support-show .side-field label {
  display: block;
  font-weight: 650;
  font-size: 0.84rem;
  margin-bottom: 4px;
  color: #334155;
}
.page-support-show .side-field input,
.page-support-show .side-field select,
.page-support-show .side-field textarea {
  width: 100%;
  border: 1px solid #d2deea;
  border-radius: 8px;
  padding: 8px;
  box-sizing: border-box;
  font-family: inherit;
}
.page-support-show .ticket-pill {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 750;
}
.page-support-show .ticket-pill.urgent {
  background: #fee2e2;
  color: #b91c1c;
}
.page-support-show .ticket-pill.open {
  background: #dbeafe;
  color: #1d4ed8;
}
@media (max-width: 920px) {
  .page-support-show .ticket-layout {
    grid-template-columns: 1fr;
  }
  .page-support-show .ticket-head {
    display: block;
  }
  .page-support-show .ticket-head .btn {
    margin-top: 10px;
  }
  .page-support-show .message-meta {
    display: block;
  }
}
.page-support-create {
  /* app/Views/admin/support_tickets/create.php */
}
.page-support-create .ticket-form-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  align-items: start;
}
.page-support-create .ticket-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.page-support-create .field label {
  display: block;
  font-weight: 650;
  font-size: 0.88rem;
  margin-bottom: 5px;
  color: #334155;
}
.page-support-create .field input,
.page-support-create .field select,
.page-support-create .field textarea {
  width: 100%;
  border: 1px solid #d2deea;
  border-radius: 8px;
  padding: 9px;
  box-sizing: border-box;
  font-family: inherit;
}
.page-support-create .field-full {
  grid-column: 1 / -1;
}
.page-support-create .error-text {
  color: #b91c1c;
  font-size: 0.8rem;
  margin-top: 4px;
}
@media (max-width: 860px) {
  .page-support-create .ticket-form-grid,
  .page-support-create .ticket-fields {
    grid-template-columns: 1fr;
  }
  .page-support-create .field-full {
    grid-column: auto;
  }
}
.page-users-show {
  /* app/Views/admin/users/show.php */
  /* edit form inside card */
  /* preventivi table */
  /* vehicles */
}
.page-users-show .up-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1.25rem;
  align-items: start;
}
.page-users-show .up-card {
  background: #fff;
  border: 1px solid rgba(19, 34, 55, 0.1);
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
}
.page-users-show .up-card-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(19, 34, 55, 0.08);
}
.page-users-show .up-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 0.25rem 0.75rem;
  font-size: 0.88rem;
  margin-bottom: 0.45rem;
  align-items: baseline;
}
.page-users-show .up-row:last-child {
  margin-bottom: 0;
}
.page-users-show .up-label {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.82rem;
}
.page-users-show .up-value {
  color: var(--ink);
  font-weight: 600;
  word-break: break-word;
}
.page-users-show .up-empty {
  color: var(--muted);
  font-style: italic;
  font-size: 0.85rem;
  margin: 0;
}
.page-users-show .up-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.page-users-show .up-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
  flex-shrink: 0;
}
.page-users-show .up-form .field {
  margin-bottom: 0.85rem;
}
.page-users-show .up-form .field:last-of-type {
  margin-bottom: 0;
}
.page-users-show .up-form label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.3rem;
  display: block;
}
.page-users-show .up-form input,
.page-users-show .up-form select {
  width: 100%;
  font-size: 0.9rem;
}
.page-users-show .up-form .helper {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0.25rem 0 0;
}
.page-users-show .up-form .field-inline {
  display: flex;
  gap: 0.5rem;
}
.page-users-show .up-form .field-inline input {
  flex: 1;
}
.page-users-show .up-form .errors {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  margin-bottom: 0.9rem;
  font-size: 0.85rem;
  color: #b91c1c;
}
.page-users-show .up-form .errors div {
  margin-bottom: 0.2rem;
}
.page-users-show .up-form .errors div:last-child {
  margin-bottom: 0;
}
.page-users-show .up-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.page-users-show .up-table th {
  text-align: left;
  padding: 0.45rem 0.65rem;
  border-bottom: 2px solid rgba(19, 34, 55, 0.09);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}
.page-users-show .up-table td {
  padding: 0.6rem 0.65rem;
  border-bottom: 1px solid rgba(19, 34, 55, 0.06);
  vertical-align: middle;
}
.page-users-show .up-table tr:last-child td {
  border-bottom: 0;
}
.page-users-show .up-table tr:hover td {
  background: rgba(15, 118, 110, 0.03);
}
.page-users-show .up-vehicles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.page-users-show .up-vehicle {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  background: #f8fafc;
  border: 1px solid rgba(19, 34, 55, 0.1);
  border-radius: 8px;
  padding: 0.55rem 0.8rem;
  font-size: 0.83rem;
  min-width: 140px;
}
.page-users-show .up-vehicle-plate {
  font-family: monospace;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  letter-spacing: 0.05em;
}
.page-users-show .up-vehicle-make {
  color: var(--muted);
  font-size: 0.78rem;
}
@media (max-width: 900px) {
  .page-users-show .up-grid {
    grid-template-columns: 1fr;
  }
}
.page-agente-show {
  /* app/Views/admin/sales_agents/show.php */
}
.page-agente-show .agent-tabs-nav {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #e2e8f0;
  margin: 1.25rem 0 1.1rem;
}
.page-agente-show .agent-tabs-nav button {
  appearance: none;
  border: none;
  background: none;
  padding: 0.6rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.page-agente-show .agent-tabs-nav button:hover {
  color: #0f172a;
}
.page-agente-show .agent-tabs-nav button.is-active {
  color: #0f766e;
  border-bottom-color: #0f766e;
}
.page-contabilita {
  /* app/Views/admin/contabilita/index.php */
}
.page-contabilita .accounting-note {
  display: flex;
  gap: 0.55rem;
  margin-bottom: 16px;
  padding: 0.8rem 1rem;
  border-left: 4px solid #0284c7;
  border-radius: 0.5rem;
  background: #e0f2fe;
  color: #0c4a6e;
}
.page-contabilita .accounting-filter {
  margin-bottom: 16px;
}
.page-contabilita .accounting-filter form {
  display: flex;
  align-items: end;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.page-contabilita .accounting-kpis small {
  display: block;
  margin-top: 0.35rem;
  color: #64748b;
}
.page-contabilita .accounting-kpis .warning {
  border-color: #fcd34d;
  background: #fffbeb;
}
.page-contabilita .accounting-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.page-contabilita .accounting-section-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.page-contabilita .accounting-section-title h2 {
  margin: 0;
  font-size: 1rem;
}
.page-contabilita .accounting-section-title p {
  margin: 0.2rem 0 0;
  color: #64748b;
  font-size: 0.8rem;
}
.page-contabilita .accounting-section-title a {
  font-size: 0.8rem;
  font-weight: 700;
  color: #0369a1;
}
.page-contabilita .accounting-list {
  display: grid;
  gap: 0.5rem;
}
.page-contabilita .accounting-list > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.55rem;
  color: #0f172a;
  text-decoration: none;
}
.page-contabilita .accounting-list > a:hover {
  background: #f8fafc;
}
.page-contabilita .accounting-list span {
  display: grid;
  gap: 0.15rem;
}
.page-contabilita .accounting-list small {
  color: #64748b;
}
.page-contabilita .accounting-list b {
  white-space: nowrap;
  color: #0f766e;
}
.page-contabilita .accounting-empty {
  margin: 0;
  padding: 1rem;
  text-align: center;
  color: #64748b;
}
.page-contabilita .accounting-table {
  margin-top: 0;
}
@media (max-width: 900px) {
  .page-contabilita .accounting-columns {
    grid-template-columns: 1fr;
  }
  .page-contabilita .accounting-note {
    display: grid;
  }
  .page-contabilita .accounting-table table,
  .page-contabilita .accounting-table tbody,
  .page-contabilita .accounting-table tr,
  .page-contabilita .accounting-table td {
    display: block;
  }
  .page-contabilita .accounting-table thead {
    display: none;
  }
  .page-contabilita .accounting-table tr {
    padding: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
  }
  .page-contabilita .accounting-table td {
    display: grid!important;
    grid-template-columns: 110px 1fr;
    padding: 0.35rem !important;
    text-align: left !important;
  }
  .page-contabilita .accounting-table td:before {
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
  }
}
.page-dashboard {
  /* app/Views/admin/index.php */
  /* ── Layout ── */
  /* ── KPI cards ── */
  /* ── Revenue row ── */
  /* ── Funnel ── */
  /* ── Lists ── */
  /* ── Source breakdown ── */
  /* ── Action grid ── */
}
.page-dashboard .db-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--admin-muted);
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(19, 34, 55, 0.07);
}
.page-dashboard .db-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.page-dashboard .db-kpi-card {
  background: var(--admin-card-bg);
  border-radius: 12px;
  padding: 16px 16px 14px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  border: 1px solid var(--admin-border);
  position: relative;
  overflow: hidden;
}
.page-dashboard .db-kpi-accent {
  width: 3px;
  height: 100%;
  border-radius: 3px;
  position: absolute;
  left: 0;
  top: 0;
}
.page-dashboard .db-kpi-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--admin-muted);
  font-weight: 700;
  margin-bottom: 4px;
}
.page-dashboard .db-kpi-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--admin-text);
  line-height: 1.1;
}
.page-dashboard .db-kpi-sub {
  font-size: 0.73rem;
  color: var(--admin-muted);
  margin-top: 4px;
}
.page-dashboard .db-kpi-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  margin-top: 5px;
}
.page-dashboard .db-kpi-badge--up {
  background: #dcfce7;
  color: #15803d;
}
.page-dashboard .db-kpi-badge--down {
  background: #fee2e2;
  color: #b91c1c;
}
.page-dashboard .db-kpi-badge--neu {
  background: #f1f5f9;
  color: #64748b;
}
.page-dashboard .db-revenue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.page-dashboard .db-revenue-card {
  background: var(--admin-card-bg);
  border-radius: 12px;
  padding: 18px 20px;
  border: 1px solid var(--admin-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.page-dashboard .db-revenue-card--primary {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
}
.page-dashboard .db-revenue-card--primary .db-revenue-label {
  color: rgba(255, 255, 255, 0.75);
}
.page-dashboard .db-revenue-card--primary .db-revenue-value {
  color: #fff;
}
.page-dashboard .db-revenue-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--admin-muted);
  margin-bottom: 6px;
}
.page-dashboard .db-revenue-value {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--admin-text);
  line-height: 1.1;
}
.page-dashboard .db-revenue-sub {
  font-size: 0.75rem;
  margin-top: 5px;
  opacity: 0.75;
}
.page-dashboard .db-funnel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.page-dashboard .db-funnel-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-dashboard .db-funnel-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--admin-text);
  width: 110px;
  flex-shrink: 0;
}
.page-dashboard .db-funnel-bar-wrap {
  flex: 1;
  background: rgba(19, 34, 55, 0.06);
  border-radius: 6px;
  height: 8px;
  overflow: hidden;
}
.page-dashboard .db-funnel-bar {
  height: 100%;
  border-radius: 6px;
  transition: width 0.6s ease;
}
.page-dashboard .db-funnel-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--admin-text);
  width: 32px;
  text-align: right;
  flex-shrink: 0;
}
.page-dashboard .db-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.page-dashboard .db-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid rgba(19, 34, 55, 0.05);
}
.page-dashboard .db-list-item:last-child {
  border-bottom: 0;
}
.page-dashboard .db-list-meta {
  font-size: 0.77rem;
  color: var(--admin-muted);
}
.page-dashboard .db-list-title {
  font-weight: 600;
  font-size: 0.87rem;
  color: var(--admin-text);
}
.page-dashboard .db-source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}
.page-dashboard .db-source-card {
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-dashboard .db-source-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}
.page-dashboard .db-source-label {
  font-size: 0.77rem;
  color: var(--admin-muted);
  font-weight: 600;
}
.page-dashboard .db-source-cnt {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--admin-text);
  line-height: 1;
}
.page-dashboard .db-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}
.page-dashboard .db-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 10px;
  border-radius: 10px;
  border: 1px solid var(--admin-border);
  background: var(--admin-card-bg);
  text-decoration: none;
  color: var(--admin-text);
  transition: all 0.2s;
  text-align: center;
}
.page-dashboard .db-action-card:hover {
  border-color: #0f766e;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.08);
  transform: translateY(-1px);
}
.page-dashboard .db-action-icon {
  font-size: 1.6rem;
  line-height: 1;
}
.page-dashboard .db-action-label {
  font-size: 0.82rem;
  font-weight: 600;
}
@media (max-width: 640px) {
  .page-dashboard .db-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .page-dashboard .db-revenue-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.page-wiki-import {
  /* app/Views/admin/wiki/import.php */
}
.page-wiki-import .import-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--admin-border);
}
.page-wiki-import .import-tab {
  padding: 10px 18px;
  cursor: pointer;
  border: none;
  background: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: #64748b;
  border-bottom: 2px solid transparent;
}
.page-wiki-import .import-tab.active {
  color: #0f172a;
  border-bottom-color: #0f766e;
}
.page-wiki-import .import-panel {
  display: none;
}
.page-wiki-import .import-panel.active {
  display: block;
}
.page-wiki-import .markdown-textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  min-height: 320px;
}
.page-email-templates {
  /* app/Views/admin/email_templates/edit.php */
  /* TinyMCE customization for admin theme */
}
.page-email-templates .et-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.25rem;
  align-items: start;
}
.page-email-templates .et-card {
  background: #fff;
  border: 1px solid rgba(19, 34, 55, 0.1);
  border-radius: 14px;
  overflow: hidden;
}
.page-email-templates .et-head {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid rgba(19, 34, 55, 0.08);
}
.page-email-templates .et-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0;
}
.page-email-templates .et-body {
  padding: 1.1rem 1.25rem;
}
.page-email-templates .et-var {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
  font-family: monospace;
  font-size: 0.8rem;
  color: #0f766e;
  cursor: pointer;
  margin: 0 0.3rem 0.4rem 0;
  user-select: none;
}
.page-email-templates .et-var:hover {
  background: #e0f2fe;
  border-color: #bae6fd;
}
.page-email-templates .et-preview-wrap {
  border: 1px solid rgba(19, 34, 55, 0.1);
  border-radius: 8px;
  overflow: hidden;
  height: 550px;
}
.page-email-templates .et-preview-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
@media (max-width: 900px) {
  .page-email-templates .et-grid {
    grid-template-columns: 1fr;
  }
}
.page-email-templates .tox-tinymce {
  border: 0 !important;
  border-top: 1px solid rgba(19, 34, 55, 0.06) !important;
}
.page-env {
  /* app/Views/admin/env/index.php */
}
.page-env .env-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
  font-family: "Courier New", Courier, monospace;
}
.page-env .env-table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom: 2px solid rgba(19, 34, 55, 0.12);
  padding: 0.35rem 0.5rem;
}
.page-env .env-table td {
  padding: 0.3rem 0.5rem;
  border-bottom: 1px solid rgba(19, 34, 55, 0.07);
  vertical-align: top;
  word-break: break-all;
}
.page-env .env-table tr.row-blank td {
  padding: 0.1rem;
  border: none;
}
.page-env .env-table tr.row-comment td {
  color: var(--muted);
  font-style: italic;
  border: none;
  padding: 0.2rem 0.5rem;
}
.page-env .env-table tr:hover td {
  background: rgba(19, 34, 55, 0.03);
}
.page-env .env-key {
  font-weight: 700;
  color: #132237;
  white-space: nowrap;
}
.page-env .env-val {
  color: #374151;
}
.page-env .env-val-empty {
  color: #9ca3af;
  font-style: italic;
}
.page-env .env-val-missing {
  color: #dc2626;
  font-style: italic;
}
.page-env .badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: inherit;
  white-space: nowrap;
}
.page-env .badge-ok {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.page-env .badge-warn {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fde68a;
}
.page-env .badge-err {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.page-env .badge-muted {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}
.page-env .env-section {
  border: 1px solid rgba(19, 34, 55, 0.12);
  border-radius: 14px;
  padding: 0.9rem;
  margin: 0 0 1rem;
  background: rgba(255, 255, 255, 0.7);
}
.page-env .env-section h2 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
}
.page-env .info-grid {
  display: grid;
  grid-template-columns: minmax(180px, auto) 1fr;
  gap: 0.25rem 1rem;
  font-size: 0.83rem;
}
.page-env .info-label {
  color: var(--muted);
  font-family: "Courier New", Courier, monospace;
}
.page-env .info-val {
  font-family: "Courier New", Courier, monospace;
  word-break: break-all;
}
.page-env .file-path {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.82rem;
  background: rgba(19, 34, 55, 0.05);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  word-break: break-all;
}
.page-env .legend {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
  font-size: 0.78rem;
  align-items: center;
}
.page-mypos {
  /* app/Views/admin/mypos/index.php */
}
.page-mypos .settings-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}
.page-mypos .settings-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}
.page-mypos .settings-card {
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 1.1rem;
  background: #fff;
  margin-bottom: 16px;
}
.page-mypos .settings-card h2 {
  font-size: 1rem;
  margin: 0 0 0.75rem;
  color: #0f172a;
}
.page-mypos .diag-list {
  margin: 0 0 0 1rem;
  padding: 0;
}
.page-mypos .diag-list li {
  margin-bottom: 0.25rem;
  font-size: 0.88rem;
}
.page-mypos .badge-mini {
  display: inline-flex;
  align-items: center;
  font-size: 0.74rem;
  padding: 0.08rem 0.42rem;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.14);
  color: #0b5f59;
}
.page-mypos .badge-mini-muted {
  background: rgba(148, 163, 184, 0.2);
  color: #475569;
}
@media (max-width: 920px) {
  .page-mypos .settings-grid-2,
  .page-mypos .settings-grid-3 {
    grid-template-columns: 1fr;
  }
}
.page-palette {
  /* app/Views/admin/palette/index.php */
}
.page-palette .palette-section {
  margin-bottom: 2rem;
}
.page-palette .palette-section h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 1rem;
}
.page-palette .palette-section h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  margin: 1.2rem 0 0.6rem;
}
.page-palette .palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.page-palette .palette-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: transform 0.15s, box-shadow 0.15s;
}
.page-palette .palette-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}
.page-palette .palette-swatch {
  height: 90px;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 8px 10px;
  box-sizing: border-box;
}
.page-palette .palette-swatch code {
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  backdrop-filter: blur(4px);
}
.page-palette .palette-info {
  padding: 12px 14px;
}
.page-palette .palette-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: #0f172a;
  margin-bottom: 2px;
}
.page-palette .palette-role {
  font-size: 0.78rem;
  color: #64748b;
  margin-bottom: 6px;
}
.page-palette .palette-usage {
  font-size: 0.8rem;
  color: #374151;
  line-height: 1.45;
}
.page-palette .palette-usage ul {
  margin: 0;
  padding-left: 1.1rem;
}
.page-palette .palette-usage li {
  margin-bottom: 2px;
}
.page-palette .rule-bar {
  display: flex;
  height: 28px;
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}
.page-palette .rule-segment {
  display: flex;
  align-items: center;
  justify-content: center;
}
.page-palette .copy-hint {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 4px;
}
.page-palette .copy-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.72rem;
  cursor: pointer;
  transition: background 0.15s;
}
.page-palette .copy-btn:hover {
  background: #e2e8f0;
}
.page-palette .canva-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.page-palette .canva-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 0.85rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.page-palette .canva-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.page-settings-payments {
  /* app/Views/admin/settings/payments.php */
}
.page-settings-payments .settings-card {
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 1.1rem;
  background: #fff;
  margin-bottom: 16px;
}
.page-settings-payments .settings-card h2 {
  font-size: 1.1rem;
  margin: 0 0 1rem;
  color: #0f172a;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.5rem;
}
.page-settings-payments .field {
  margin-bottom: 1rem;
}
.page-settings-payments .field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}
.page-settings-payments .field input,
.page-settings-payments .field select,
.page-settings-payments .field textarea {
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #d2deea;
  font-family: inherit;
}
.page-settings-payments .btn-save {
  background: #0f766e;
  color: #fff;
  border: 0;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}
.page-settings-payments .provider-section {
  display: none;
}
.page-settings-payments .provider-section.active {
  display: block;
}
.page-settings-payments .tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 1px solid #d2deea;
  padding-bottom: 10px;
}
.page-settings-payments .tab {
  padding: 8px 16px;
  cursor: pointer;
  border-radius: 8px;
  font-weight: 600;
  background: #f1f5f9;
  color: #64748b;
}
.page-settings-payments .tab.active {
  background: #0f766e;
  color: #fff;
}
.page-settings-payments .settings-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 720px) {
  .page-settings-payments .tabs {
    overflow-x: auto;
  }
  .page-settings-payments .settings-grid-2 {
    grid-template-columns: 1fr;
  }
}
.page-site-settings {
  /* app/Views/admin/site/index.php */
}
.page-site-settings .settings-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}
.page-site-settings .settings-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}
.page-site-settings .settings-card {
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 1.1rem;
  background: #fff;
  margin-bottom: 16px;
}
.page-site-settings .settings-card h2 {
  font-size: 1rem;
  margin: 0 0 0.75rem;
  color: #0f172a;
}
@media (max-width: 920px) {
  .page-site-settings .settings-grid-2,
  .page-site-settings .settings-grid-3 {
    grid-template-columns: 1fr;
  }
}
.page-test-data {
  /* app/Views/admin/test_data/index.php */
}
.page-test-data .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  gap: 8px;
}
.page-test-data .btn-primary {
  background: #0f766e;
  color: #fff;
}
.page-test-data .btn-primary:hover {
  background: #0d6b64;
}
.page-test-data .btn-alt {
  background: #f1f5f9;
  color: #0f172a;
  border: 1px solid #e2e8f0;
}
.page-test-data .btn-alt:hover {
  background: #e2e8f0;
}
.page-test-data .btn:focus {
  outline: 2px solid #0f766e;
  outline-offset: 2px;
}
.page-test-data select:focus,
.page-test-data input:focus {
  outline: 2px solid #0f766e;
  outline-offset: -1px;
  border-color: #0f766e;
}
.page-test-email {
  /* app/Views/admin/test_email.php */
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.page-test-email .test-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.page-test-email .status-ok {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}
.page-test-email .status-err {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}
.page-preventivi-index {
  /* app/Views/admin/preventivi/index.php */
  /* Dropdown inline (Pagamento) — stile gestionale: bordo slate,
       chevron, focus-ring teal, coerente con i campi del form preventivo. */
  /* In lista i select non sono "campi obbligatori": neutralizza l'alone rosa
       globale .is-empty mantenendo il chevron. */
  /* Varianti colore per il dropdown Pagamento */
  /* app/Views/admin/preventivi/index.php */
  /* Responsive: tabella → card a 2 colonne */
}
.page-preventivi-index .list-inline-select {
  width: 100%;
  max-width: 180px;
  padding: 7px 28px 7px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background-color: #fff;
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px 12px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s, color 0.15s;
}
.page-preventivi-index .list-inline-select:hover {
  border-color: #94a3b8;
}
.page-preventivi-index .list-inline-select:focus {
  outline: none;
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}
.page-preventivi-index .list-inline-select.is-empty {
  background-color: #fff !important;
  background-repeat: no-repeat !important;
  background-position: right 8px center !important;
  background-size: 12px 12px !important;
}
.page-preventivi-index .list-inline-select,
.page-preventivi-index .list-inline-select.is-empty {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="%2364748b" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg>');
}
.page-preventivi-index .payment-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.page-preventivi-index .payment-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.page-preventivi-index .payment-dot--none {
  background: #94a3b8;
}
.page-preventivi-index .payment-dot--pending {
  background: #f59e0b;
}
.page-preventivi-index .payment-dot--paid {
  background: #22c55e;
}
.page-preventivi-index .payment-dot--failed,
.page-preventivi-index .payment-dot--cancelled {
  background: #ef4444;
}
.page-preventivi-index .list-inline-select--payment-none,
.page-preventivi-index .list-inline-select--payment-none.is-empty {
  background-color: #fff;
  color: #334155;
  border-color: #cbd5e1;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="%2364748b" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg>');
}
.page-preventivi-index .list-inline-select--payment-pending,
.page-preventivi-index .list-inline-select--payment-pending.is-empty {
  background-color: #fffbeb;
  color: #92400e;
  border-color: #fbbf24;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="%2392400e" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg>');
}
.page-preventivi-index .list-inline-select--payment-paid,
.page-preventivi-index .list-inline-select--payment-paid.is-empty {
  background-color: #f0fdf4;
  color: #15803d;
  border-color: #86efac;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="%2315803d" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg>');
}
.page-preventivi-index .list-inline-select--payment-failed,
.page-preventivi-index .list-inline-select--payment-failed.is-empty,
.page-preventivi-index .list-inline-select--payment-cancelled,
.page-preventivi-index .list-inline-select--payment-cancelled.is-empty {
  background-color: #fef2f2;
  color: #b91c1c;
  border-color: #fca5a5;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="%23b91c1c" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg>');
}
@media (max-width: 960px) {
  .page-preventivi-index .payment-wrap {
    align-items: stretch;
    flex-direction: column;
    gap: 4px;
  }
}
@media (max-width: 960px) {
  .page-preventivi-index {
    /* Label mini sopra ogni campo */
    /* Nascondi animazione GSAP su mobile per evitare flash */
  }
  .page-preventivi-index .preventivi-table-wrapper {
    overflow: visible !important;
    padding: 12px !important;
    background: #f8fafc !important;
  }
  .page-preventivi-index .preventivi-table thead {
    display: none;
  }
  .page-preventivi-index .preventivi-table tbody {
    display: block;
  }
  .page-preventivi-index .preventivi-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
    padding: 16px;
    margin-bottom: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  }
  .page-preventivi-index .preventivi-table td {
    padding: 0 !important;
    border: none !important;
    text-align: left !important;
  }
  .page-preventivi-index .preventivi-table td.tbl-pratica {
    grid-column: 1 / -1;
    padding-bottom: 6px !important;
    border-bottom: 1px solid #f1f5f9 !important;
  }
  .page-preventivi-index .preventivi-table td.tbl-azioni {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 10px !important;
    margin-top: 4px;
    border-top: 1px solid #f1f5f9 !important;
  }
  .page-preventivi-index .preventivi-table td.tbl-azioni > div {
    justify-content: flex-end !important;
  }
  .page-preventivi-index .preventivi-table td:not(.tbl-pratica):not(.tbl-azioni)::before {
    content: attr(data-label);
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    margin-bottom: 3px;
  }
  .page-preventivi-index .preventivi-table tbody tr {
    opacity: 1 !important;
    transform: none !important;
  }
}
.page-preventivi-edit {
  /* app/Views/admin/preventivi/edit.php */
}
.page-preventivi-edit .preventivo-tools {
  margin-top: 2rem;
}
.page-preventivi-edit .preventivo-tools__head {
  margin-bottom: 1rem;
  padding: 0 0.15rem;
}
.page-preventivi-edit .preventivo-tools__head span,
.page-preventivi-edit .preventivo-tool-card__head > div > span {
  display: block;
  color: #0f766e;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.page-preventivi-edit .preventivo-tools__head h2 {
  margin: 0.2rem 0 0;
  font-size: 1.25rem;
  color: #0f172a;
}
.page-preventivi-edit .preventivo-tools__head p {
  margin: 0.25rem 0 0;
  color: #64748b;
  font-size: 0.85rem;
}
.page-preventivi-edit .invoice-readiness {
  display: flex;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
  padding: 1rem;
  border: 1px solid;
  border-radius: 12px;
}
.page-preventivi-edit .invoice-readiness.is-warning {
  border-color: #f59e0b;
  background: #fffbeb;
}
.page-preventivi-edit .invoice-readiness.is-ready {
  border-color: #86efac;
  background: #f0fdf4;
}
.page-preventivi-edit .invoice-readiness__icon {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  height: 34px;
  border-radius: 50%;
  background: #f59e0b;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 900;
}
.page-preventivi-edit .invoice-readiness.is-ready .invoice-readiness__icon {
  background: #16a34a;
}
.page-preventivi-edit .invoice-readiness__content {
  min-width: 0;
  flex: 1;
}
.page-preventivi-edit .invoice-readiness__head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}
.page-preventivi-edit .invoice-readiness__head span {
  color: #92400e;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.page-preventivi-edit .invoice-readiness.is-ready .invoice-readiness__head span {
  color: #166534;
}
.page-preventivi-edit .invoice-readiness__head h3 {
  margin: 0.15rem 0 0;
  font-size: 1rem;
}
.page-preventivi-edit .invoice-readiness__head > strong {
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.72rem;
  white-space: nowrap;
}
.page-preventivi-edit .invoice-readiness.is-ready .invoice-readiness__head > strong {
  background: #dcfce7;
  color: #166534;
}
.page-preventivi-edit .invoice-readiness p {
  margin: 0.6rem 0 0;
  color: #475569;
  font-size: 0.8rem;
  line-height: 1.45;
}
.page-preventivi-edit .invoice-readiness__items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.5rem;
  margin-top: 0.8rem;
}
.page-preventivi-edit .invoice-readiness__items a {
  display: grid;
  gap: 0.12rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid #fde68a;
  border-radius: 7px;
  background: #fff;
  color: #334155;
  text-decoration: none;
}
.page-preventivi-edit .invoice-readiness__items a:hover {
  border-color: #f59e0b;
  background: #fff7ed;
}
.page-preventivi-edit .invoice-readiness__items small {
  color: #b45309;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
}
.page-preventivi-edit .invoice-readiness__items span {
  font-size: 0.78rem;
  font-weight: 700;
}
.page-preventivi-edit .preventivo-tools__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  align-items: stretch;
}
.page-preventivi-edit .preventivo-tool-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: 0;
  border-top: 4px solid #cbd5e1;
}
.page-preventivi-edit .preventivo-tool-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}
.page-preventivi-edit .preventivo-tool-card__head h3 {
  margin: 0.15rem 0 0;
  font-size: 1rem;
  color: #0f172a;
}
.page-preventivi-edit .preventivo-tool-card__badge {
  display: inline-flex;
  min-width: 28px;
  justify-content: center;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 800;
}
.page-preventivi-edit .preventivo-tool-group {
  margin-bottom: 0.75rem;
  padding: 0.7rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}
.page-preventivi-edit .preventivo-tool-group--highlight {
  margin-bottom: 0;
  background: #f8fafc;
}
.page-preventivi-edit .preventivo-tool-message {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.75rem;
  border-left: 3px solid #0284c7;
  border-radius: 6px;
  background: #f0f9ff;
  color: #475569;
  font-size: 0.82rem;
  line-height: 1.4;
}
.page-preventivi-edit .preventivo-tool-message.is-success {
  border-color: #16a34a;
  background: #f0fdf4;
}
.page-preventivi-edit .preventivo-tool-message.is-warning {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #92400e;
}
.page-preventivi-edit .preventivo-tool-card .btn-primary[disabled],
.page-preventivi-edit .preventivo-tool-card .btn-primary[disabled]:hover {
  opacity: 0.6;
  cursor: not-allowed;
  background: #cbd5e1;
  border-color: #cbd5e1;
  color: #64748b;
  box-shadow: none;
}
.page-preventivi-edit .preventivo-tool-data {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}
.page-preventivi-edit .preventivo-tool-data > div {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
  padding: 0.65rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}
.page-preventivi-edit .preventivo-tool-data span,
.page-preventivi-edit .preventivo-tool-link__label,
.page-preventivi-edit .preventivo-tool-field > span {
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.page-preventivi-edit .preventivo-tool-data strong {
  overflow-wrap: anywhere;
  font-size: 0.86rem;
}
.page-preventivi-edit .preventivo-tool-field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}
.page-preventivi-edit .preventivo-tool-field select {
  width: 100%;
  padding: 0.55rem;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
}
.page-preventivi-edit .preventivo-tool-link {
  margin: 0.85rem 0;
  padding: 0.7rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}
.page-preventivi-edit .preventivo-tool-link__value {
  margin: 0.35rem 0 0.65rem;
  font-family: monospace;
  font-size: 0.72rem;
  word-break: break-all;
}
.page-preventivi-edit .preventivo-tool-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.page-preventivi-edit .preventivo-tool-actions input {
  min-width: 0;
  flex: 1;
}
.page-preventivi-edit .preventivo-tool-action-form {
  margin-top: auto;
  padding-top: 0.75rem;
}
.page-preventivi-edit .preventivo-tool-action-form--primary {
  margin-top: 0.5rem;
  padding-top: 0;
}
.page-preventivi-edit .preventivo-tool-card--summary {
  order: 1;
  grid-column: 1/-1;
  border-top-color: #0f766e;
}
.page-preventivi-edit .preventivo-tool-card--payment {
  order: 2;
  border-top-color: #7c3aed;
}
.page-preventivi-edit .preventivo-tool-card--attachments {
  order: 3;
  border-top-color: #d97706;
}
.page-preventivi-edit .preventivo-tool-card--send {
  order: 4;
  grid-column: 1/-1;
  border-top-color: #0284c7;
}
.page-preventivi-edit .preventivo-tool-card--invoice {
  order: 5;
  grid-column: 1/-1;
  height: auto;
  border-top-color: #1e3a5f;
}
.page-preventivi-edit .quote-debug {
  margin-top: 2rem !important;
}
.page-preventivi-edit .quote-debug summary {
  padding: 0.7rem 0.9rem;
  border: 1px dashed #94a3b8;
  border-radius: 8px;
  background: #f8fafc;
}
.page-preventivi-edit .quote-debug[open] summary {
  border-radius: 8px 8px 0 0;
}
@media (max-width: 960px) {
  .page-preventivi-edit .preventivo-tools__grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 560px) {
  .page-preventivi-edit .invoice-readiness,
  .page-preventivi-edit .invoice-readiness__head {
    display: grid;
  }
  .page-preventivi-edit .preventivo-tool-data {
    grid-template-columns: 1fr;
  }
  .page-preventivi-edit .preventivo-tools__grid {
    gap: 0.85rem;
  }
}
/* === Reso: background arancione carta + blocco gestione reso === */
.page-preventivi-edit.is-returned {
  background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
  border-radius: 14px;
  padding: 1.5rem;
  border: 2px solid #fed7aa;
}
.page-preventivi-edit.is-returned .admin-title {
  color: #9a3412;
}
.page-preventivi-edit.is-returned .admin-subtitle {
  color: #c2410c;
}
.page-preventivi-edit.is-returned .alert-success {
  border-color: #fdba74;
  background: #ffedd5;
  color: #9a3412;
}
.preventivo-tool-card--return {
  border-color: #fdba74 !important;
  background: #fff7ed !important;
}
.preventivo-tool-card--return .preventivo-tool-card__head > div > span {
  color: #c2410c !important;
}
.return-detail-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}
.return-detail-row > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.return-detail-row span {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9a3412;
}
.return-detail-row strong {
  font-size: 0.9rem;
  color: #0f172a;
}
.return-motivazione {
  margin-bottom: 1rem;
}
.return-motivazione span {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9a3412;
  margin-bottom: 4px;
}
.return-motivazione p {
  margin: 0;
  padding: 0.6rem 0.75rem;
  background: #fff;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.5;
}
.return-nc-section {
  margin-bottom: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #fed7aa;
}
.return-nc-section h4 {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  color: #9a3412;
}
.return-nc-row {
  margin-bottom: 6px;
}
.return-nc-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  background: #fff;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  text-decoration: none;
  color: #0f172a;
  font-size: 0.85rem;
}
.return-nc-link:hover {
  border-color: #f97316;
  background: #fff7ed;
}
.return-nc-link .muted {
  margin-left: auto;
  font-size: 0.82rem;
  font-weight: 600;
}
.return-tracking-form {
  padding-top: 0.75rem;
  border-top: 1px solid #fed7aa;
}
.return-tracking-form h4 {
  margin: 0 0 0.6rem;
  font-size: 0.82rem;
  color: #9a3412;
}
.return-tracking-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}
.return-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.return-field--full {
  margin-bottom: 0.6rem;
}
.return-field span {
  font-size: 0.72rem;
  font-weight: 600;
  color: #9a3412;
}
.return-field input,
.return-field textarea,
.return-field select {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  font-size: 0.85rem;
  background: #fff;
  color: #0f172a;
}
.return-field input:focus,
.return-field textarea:focus,
.return-field select:focus {
  outline: 2px solid #f97316;
  outline-offset: 1px;
  border-color: #f97316;
}
.return-field--status {
  grid-column: 1 / -1;
}
.return-field--status select {
  font-weight: 700;
  border-color: #fdba74;
  background: #fff7ed;
}
.return-tracking-status {
  margin-left: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
}
.return-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #fed7aa;
}
@media (max-width: 960px) {
  .page-preventivi-edit.is-returned {
    padding: 1rem;
  }
  .return-tracking-grid {
    grid-template-columns: 1fr;
  }
  .return-actions {
    flex-direction: column;
  }
  .return-actions .btn {
    width: 100%;
    text-align: center;
  }
}
/* === Temi di stato (placeholder pronti per future personalizzazioni) ===
   Solo is-returned ha un background completo per ora.
   Per attivare un nuovo tema, decommentare/aggiungere le regole qui sotto. */
/* .page-preventivi-edit.is-won {
    background: linear-gradient(180deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: 14px;
    padding: 1.5rem;
    border: 2px solid #bbf7d0;
} */
/* .page-preventivi-edit.is-lost {
    background: linear-gradient(180deg, #fef2f2 0%, #fee2e2 100%);
    border-radius: 14px;
    padding: 1.5rem;
    border: 2px solid #fecaca;
} */
/* .page-preventivi-edit.is-cancelled {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 14px;
    padding: 1.5rem;
    border: 2px solid #e2e8f0;
} */
/* === clienti/_form.php === */
.page-clienti-form .cl-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.page-clienti-form .cl-section {
  margin-bottom: 1.5rem;
}
.page-clienti-form .cl-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin: 0 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(19, 34, 55, 0.08);
}
.page-clienti-form .cl-grid {
  display: grid;
  gap: 0.75rem;
}
.page-clienti-form .cl-grid-2 {
  grid-template-columns: 1fr 1fr;
}
.page-clienti-form .cl-grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
}
.page-clienti-form .cl-grid-4 {
  grid-template-columns: 1fr 1fr 1fr 1fr;
}
.page-clienti-form .cl-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.page-clienti-form .cl-field input,
.page-clienti-form .cl-field select,
.page-clienti-form .cl-field textarea {
  width: 100%;
  border: 1px solid rgba(19, 34, 55, 0.18);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  font-size: 0.9rem;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.page-clienti-form .cl-field input:focus,
.page-clienti-form .cl-field select:focus,
.page-clienti-form .cl-field textarea:focus {
  outline: none;
  border-color: #0f766e;
}
.page-clienti-form .cl-field textarea {
  resize: vertical;
  min-height: 80px;
}
.page-clienti-form .field-error {
  color: #dc2626;
  font-size: 0.78rem;
  margin: 0.2rem 0 0;
}
@media (max-width: 640px) {
  .page-clienti-form .cl-grid-2,
  .page-clienti-form .cl-grid-3,
  .page-clienti-form .cl-grid-4 {
    grid-template-columns: 1fr;
  }
}
/* === fornitori/_form.php === */
.page-fornitori-form .fn-form {
  background: var(--admin-card-bg, #fff);
  border: 1px solid var(--admin-border, #e2e8f0);
  border-radius: 12px;
  padding: 1.25rem 1.25rem 0;
}
.page-fornitori-form .fn-section {
  margin-bottom: 1.5rem;
}
.page-fornitori-form .fn-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin: 0 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(19, 34, 55, 0.08);
}
.page-fornitori-form .fn-grid {
  display: grid;
  gap: 0.75rem;
}
.page-fornitori-form .fn-grid-2 {
  grid-template-columns: 1fr 1fr;
}
.page-fornitori-form .fn-grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
}
.page-fornitori-form .fn-grid-4 {
  grid-template-columns: 1fr 1fr 1fr 1fr;
}
.page-fornitori-form .fn-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.page-fornitori-form .fn-field input,
.page-fornitori-form .fn-field select,
.page-fornitori-form .fn-field textarea {
  width: 100%;
  border: 1px solid rgba(19, 34, 55, 0.18);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  font-size: 0.9rem;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.page-fornitori-form .fn-field input:focus,
.page-fornitori-form .fn-field select:focus,
.page-fornitori-form .fn-field textarea:focus {
  outline: none;
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}
.page-fornitori-form .fn-field textarea {
  resize: vertical;
  min-height: 80px;
}
.page-fornitori-form .fn-req {
  color: #dc2626;
}
.page-fornitori-form .field-error {
  color: #dc2626;
  font-size: 0.78rem;
  margin: 0.2rem 0 0;
}
.page-fornitori-form .fn-actions-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 0.6rem;
  align-items: center;
  padding: 1rem 0;
  margin-top: 0.5rem;
  background: var(--admin-card-bg, #fff);
  border-top: 1px solid var(--admin-border, #e2e8f0);
}
@media (max-width: 640px) {
  .page-fornitori-form .fn-grid-2,
  .page-fornitori-form .fn-grid-3,
  .page-fornitori-form .fn-grid-4 {
    grid-template-columns: 1fr;
  }
  .page-fornitori-form .fn-form {
    padding: 1rem 1rem 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .page-fornitori-form .fn-field input,
  .page-fornitori-form .fn-field select,
  .page-fornitori-form .fn-field textarea {
    transition: none;
  }
}
/* === articoli/_form.php === */
.page-articoli-form .art-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.page-articoli-form .art-section {
  margin-bottom: 1.5rem;
}
.page-articoli-form .art-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin: 0 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(19, 34, 55, 0.08);
}
.page-articoli-form .art-grid {
  display: grid;
  gap: 0.75rem;
}
.page-articoli-form .art-grid-2 {
  grid-template-columns: 1fr 1fr;
}
.page-articoli-form .art-grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
}
.page-articoli-form .art-grid-4 {
  grid-template-columns: 1fr 1fr 1fr 1fr;
}
.page-articoli-form .art-grid-5 {
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
}
.page-articoli-form .art-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.page-articoli-form .art-field input,
.page-articoli-form .art-field select,
.page-articoli-form .art-field textarea {
  width: 100%;
  border: 1px solid rgba(19, 34, 55, 0.18);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  font-size: 0.9rem;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.page-articoli-form .art-field input:focus,
.page-articoli-form .art-field select:focus,
.page-articoli-form .art-field textarea:focus {
  outline: none;
  border-color: #0f766e;
}
.page-articoli-form .art-field textarea {
  resize: vertical;
  min-height: 80px;
}
.page-articoli-form .art-field input[type="number"] {
  font-family: monospace;
  text-align: right;
}
.page-articoli-form .field-error {
  color: #dc2626;
  font-size: 0.78rem;
  margin: 0.2rem 0 0;
}
.page-articoli-form .art-checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
}
.page-articoli-form .art-checkbox-row input[type="checkbox"] {
  width: auto;
}
.page-articoli-form .art-checkbox-row label {
  margin: 0;
  cursor: pointer;
}
@media (max-width: 768px) {
  .page-articoli-form .art-grid-2,
  .page-articoli-form .art-grid-3,
  .page-articoli-form .art-grid-4,
  .page-articoli-form .art-grid-5 {
    grid-template-columns: 1fr;
  }
}
/* === veicoli/_form.php === */
.page-veicoli-form .vei-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.page-veicoli-form .vei-section {
  margin-bottom: 1.5rem;
}
.page-veicoli-form .vei-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin: 0 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(19, 34, 55, 0.08);
}
.page-veicoli-form .vei-grid {
  display: grid;
  gap: 0.75rem;
}
.page-veicoli-form .vei-grid-2 {
  grid-template-columns: 1fr 1fr;
}
.page-veicoli-form .vei-grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
}
.page-veicoli-form .vei-grid-4 {
  grid-template-columns: 1fr 1fr 1fr 1fr;
}
.page-veicoli-form .vei-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.page-veicoli-form .vei-field input,
.page-veicoli-form .vei-field select,
.page-veicoli-form .vei-field textarea {
  width: 100%;
  border: 1px solid rgba(19, 34, 55, 0.18);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  font-size: 0.9rem;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.page-veicoli-form .vei-field input:focus,
.page-veicoli-form .vei-field select:focus,
.page-veicoli-form .vei-field textarea:focus {
  outline: none;
  border-color: #0f766e;
}
.page-veicoli-form .vei-field textarea {
  resize: vertical;
  min-height: 80px;
}
.page-veicoli-form .field-error {
  color: #dc2626;
  font-size: 0.78rem;
  margin: 0.2rem 0 0;
}
@media (max-width: 640px) {
  .page-veicoli-form .vei-grid-2,
  .page-veicoli-form .vei-grid-3,
  .page-veicoli-form .vei-grid-4 {
    grid-template-columns: 1fr;
  }
}
/* === guide/_form.php === */
.page-guide-form .fn-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 0.3rem;
}
.page-guide-form .fn-field input,
.page-guide-form .fn-field select {
  width: 100%;
  border: 1px solid rgba(19, 34, 55, 0.18);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  font-size: 0.9rem;
  font-family: inherit;
  background: #fff;
  color: #0f172a;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.page-guide-form .fn-field input:focus,
.page-guide-form .fn-field select:focus {
  outline: none;
  border-color: #0f766e;
}
.page-guide-form .field-invalid {
  border-color: #ef4444 !important;
}
.page-guide-form .field-error {
  color: #dc2626;
  font-size: 0.78rem;
  margin: 0.2rem 0 0;
}
.page-guide-form .editor-wrap {
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: #fff;
}
.page-guide-form .editor-wrap .codex-editor {
  padding: 16px;
}
/* === wiki/_form.php === */
.page-wiki-form .editor-wrap {
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: #fff;
}
.page-wiki-form .editor-wrap .codex-editor {
  padding: 16px;
}
.page-wiki-form .field-invalid {
  border-color: #ef4444 !important;
}
.page-wiki-form .field-error {
  color: #dc2626;
  font-size: 0.78rem;
  margin: 0.2rem 0 0;
}
.page-wiki-form .fn-grid {
  display: grid;
  gap: 0.75rem;
}
.page-wiki-form .fn-grid-2 {
  grid-template-columns: 1fr 1fr;
}
.page-wiki-form .fn-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 0.3rem;
}
.page-wiki-form .fn-field input,
.page-wiki-form .fn-field select,
.page-wiki-form .fn-field textarea {
  width: 100%;
  border: 1px solid rgba(19, 34, 55, 0.18);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  font-size: 0.9rem;
  font-family: inherit;
  background: #fff;
  color: #0f172a;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.page-wiki-form .fn-field input:focus,
.page-wiki-form .fn-field select:focus,
.page-wiki-form .fn-field textarea:focus {
  outline: none;
  border-color: #0f766e;
}
@media (max-width: 640px) {
  .page-wiki-form .fn-grid-2 {
    grid-template-columns: 1fr;
  }
}
.oc-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.oc-badge-bozza {
  background: #f1f5f9;
  color: #475569;
}
.oc-badge-confermato {
  background: #dbeafe;
  color: #1d4ed8;
}
.oc-badge-inviato {
  background: #fef3c7;
  color: #b45309;
}
.oc-badge-spedito {
  background: #f3e8ff;
  color: #7c3aed;
}
.oc-badge-fatturato {
  background: #dcfce7;
  color: #15803d;
}
.oc-badge-ricevuto {
  background: #dcfce7;
  color: #15803d;
}
.oc-badge-annullato {
  background: #fee2e2;
  color: #b91c1c;
}
@media (max-width: 960px) {
  .oc-table thead {
    display: none;
  }
  .oc-table tbody {
    display: block;
  }
  .oc-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
    padding: 16px;
    margin-bottom: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  }
  .oc-table td {
    padding: 0 !important;
    border: none !important;
    text-align: left !important;
  }
  .oc-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    margin-bottom: 3px;
  }
  .oc-table td.oc-col-full {
    grid-column: 1 / -1;
  }
  .oc-table td.oc-col-actions {
    grid-column: 1 / -1;
    border-top: 1px solid #f1f5f9 !important;
    padding-top: 12px !important;
  }
}
.oc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.oc-actions form {
  display: inline;
}
/* ═══════════════════════════════════════════════════════════════════════════
   ENTERPRISE OVERRIDES — palette e componenti chiave
   ═══════════════════════════════════════════════════════════════════════════ */
/* Sidebar — più scura, pulita, accenti blu */
.admin-sidebar {
  background: linear-gradient(180deg, #0b0f19 0%, #111827 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
}
.sidebar-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
.sidebar-link {
  border-radius: 0 8px 8px 0;
  margin-right: 12px;
  margin-left: 8px;
  padding-left: 28px;
  opacity: 0.75;
  transition: all 0.18s ease;
}
.sidebar-link:hover {
  background-color: var(--admin-sidebar-hover);
  opacity: 1;
}
.sidebar-link.active {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.18) 0%, rgba(37, 99, 235, 0.06) 100%);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--admin-sidebar-active);
}
.nav-group summary {
  color: rgba(241, 245, 249, 0.45);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}
.nav-group summary:hover {
  color: rgba(241, 245, 249, 0.75);
}
/* Header — sfondo bianco, bordo sottile, ombra leggera */
.admin-header {
  background: #ffffff;
  border-bottom: 1px solid var(--admin-border);
  box-shadow: 0 1px 3px rgba(11, 15, 25, 0.04);
}
.admin-breadcrumb-current {
  color: var(--admin-text);
  font-weight: 600;
}
/* Main content — padding più generoso */
.admin-content {
  padding: 28px;
}
/* Card — look pulito enterprise */
.admin-card,
.db-revenue-card,
.db-kpi-card,
.db-action-card,
.db-source-card,
.admin-section,
.form-section,
.customer-block,
.customer-link-block,
.vehicle-focus-block,
.status-section,
.paid-toggle {
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(11, 15, 25, 0.04);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.admin-card:hover,
.db-revenue-card:hover,
.db-kpi-card:hover {
  box-shadow: 0 4px 12px rgba(11, 15, 25, 0.06);
}
/* Bottoni — flat, primario blu */
.btn-primary,
.admin-btn-primary,
button[type="submit"].btn-primary {
  background: var(--admin-sidebar-active);
  border: 1px solid var(--admin-sidebar-active);
  color: #fff;
  border-radius: 8px;
  padding: 9px 18px;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.15s ease;
}
.btn-primary:hover,
.admin-btn-primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.btn-secondary,
.admin-btn-secondary {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  color: var(--admin-text);
  border-radius: 8px;
  padding: 9px 18px;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.15s ease;
}
.btn-secondary:hover,
.admin-btn-secondary:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}
/* Tabelle — header più pulito */
.admin-table thead,
.table-admin thead,
.tui-grid-header {
  background: #f9fafb;
  border-bottom: 1px solid var(--admin-border);
}
.admin-table th,
.table-admin th,
.tui-grid-header-cell {
  color: var(--admin-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px;
}
.admin-table td,
.table-admin td,
.tui-grid-cell {
  padding: 14px 16px;
  border-bottom: 1px solid var(--admin-border);
  color: var(--admin-text);
  font-size: 0.86rem;
}
.admin-table tbody tr:hover,
.table-admin tbody tr:hover,
.tui-grid-row:hover {
  background: #f9fafb;
}
/* Form — input più puliti */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="date"],
input[type="search"],
select,
textarea {
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  padding: 9px 12px;
  background: #ffffff;
  color: var(--admin-text);
  font-size: 0.86rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--admin-sidebar-active);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
/* Badge/status — colori enterprise */
.status-badge,
.admin-badge {
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
/* Flash — bordi e ombre più morbidi */
.admin-flash {
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(11, 15, 25, 0.12);
}
/* Responsive content padding */
@media (max-width: 960px) {
  .admin-content {
    padding: 18px;
  }
}
