:root {
  color-scheme: light;
  --ink: #173431;
  --muted: #66807c;
  --line: #dce8e5;
  --soft: #f4f8f7;
  --canvas: #eef4f2;
  --teal: #0c5e59;
  --teal-2: #14756e;
  --mint: #dff2ec;
  --green: #31866c;
  --orange: #f3a96f;
  --yellow: #f8e6a8;
  --red: #bc4b51;
  --white: #fff;
  --shadow: 0 12px 35px rgba(28, 72, 67, 0.08);
  --radius: 16px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[hidden] { display: none !important; }

* { box-sizing: border-box; }
html { background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
.view-hidden, .role-dealer .admin-only, .role-admin .dealer-only { display: none !important; }

.login-screen {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(circle at 20% 15%, rgba(84, 191, 159, .2), transparent 32%),
    radial-gradient(circle at 82% 82%, rgba(243, 169, 111, .16), transparent 28%),
    #073b38;
}
body:not(.session-pending) .login-screen { display: none; }
.session-pending .sidebar, .session-pending .app-shell { visibility: hidden; }
.login-panel { width: min(620px, 100%); padding: 34px; border: 1px solid rgba(255,255,255,.13); border-radius: 24px; background: rgba(255,255,255,.98); box-shadow: 0 35px 90px rgba(0,0,0,.28); }
.login-brand { display: flex; align-items: center; gap: 12px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.login-brand .brand-mark { background: var(--teal); }
.login-brand strong, .login-brand small { display: block; }
.login-brand strong { font-size: 17px; }
.login-brand small { margin-top: 2px; color: var(--muted); font-size: 13px; }
.login-copy { padding: 26px 0 18px; }
.login-copy h1 { margin: 0; font-size: clamp(28px, 5vw, 40px); letter-spacing: -.045em; }
.login-copy > p:last-child { margin: 10px 0 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.login-roles { display: grid; gap: 11px; }
.dealer-login-form { display: grid; gap: 8px; }
.dealer-login-form > label { color: #52706b; font-size: 10px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.dealer-login-form > input { width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: #f8fbfa; outline: none; }
.dealer-login-form > input:focus { border-color: var(--teal-2); box-shadow: 0 0 0 3px rgba(20,117,110,.1); }
.dealer-login-form .role-card { margin-top: 4px; }
.login-error { min-height: 18px; margin: 0; color: #b7464d; font-size: 11px; font-weight: 750; }
.password-change-copy { display: grid; gap: 4px; margin: 0 0 8px; padding: 13px; border-radius: 11px; color: #235e52; background: #effaf7; }
.password-change-copy span { color: var(--muted); font-size: 12px; line-height: 1.4; }
.password-change-form .button { margin-top: 5px; }
.email-confirmed-notice { display: grid; gap: 5px; margin: 0 0 10px; padding: 16px; border: 1px solid #8fc9a5; border-radius: 11px; color: #185d35; background: #eaf8ef; }
.email-confirmed-notice strong { font-size: 16px; }
.email-confirmed-notice span { font-size: 14px; line-height: 1.5; }
.supplier-payment-terms strong { white-space: pre-wrap; overflow-wrap: anywhere; }
.verification-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 2px; }
.verification-actions .button { width: 100%; }
.verification-help { margin: 2px 0 8px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.verification-code-toggle { justify-self: start; padding: 8px 0; border: 0; color: var(--teal-2); background: transparent; font: inherit; font-size: 14px; text-align: left; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.verification-code-toggle:focus-visible { outline: 2px solid var(--teal-2); outline-offset: 4px; border-radius: 3px; }
.verification-status { margin: 0; color: #235e52; font-size: 14px; line-height: 1.5; }
.verification-status:empty { display: none; }
.email-verification-form .password-change-copy span, .email-verification-form .login-error { font-size: 14px; line-height: 1.5; }
.demo-login { margin-top: 8px; }
.role-card { width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #fff; text-align: left; cursor: pointer; transition: .18s ease; }
.role-card:hover { transform: translateY(-2px); border-color: #8dbbb4; box-shadow: 0 10px 24px rgba(12,94,89,.1); }
.role-card strong, .role-card small { display: block; }
.role-card strong { font-size: 15px; }
.role-card small { margin-top: 3px; color: var(--muted); font-size: 13px; }
.role-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--mint); color: var(--teal); font-weight: 900; }
.role-icon.admin { background: #fff0df; color: #9a5b23; }
.role-arrow { color: var(--teal); font-size: 22px; }
.login-note { margin: 18px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.login-legal { display: grid; justify-items: center; gap: 5px; margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9.5px; line-height: 1.4; text-align: center; }
.login-legal a, .legal-footer a { color: var(--teal); font-weight: 800; text-decoration: none; }
.login-legal a:hover, .legal-footer a:hover { text-decoration: underline; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 244px;
  padding: 26px 18px;
  background: #093f3c;
  color: #fff;
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 0 8px 28px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; background: rgba(255,255,255,.1); border-radius: 12px; }
.brand-mark svg { width: 27px; fill: none; stroke: #fff; stroke-width: 2.2; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 18px; letter-spacing: .01em; }
.brand small { color: #afd0cb; margin-top: 2px; font-size: 12px; }
.main-nav { display: grid; gap: 7px; }
.nav-item { border: 0; background: transparent; color: #bbd5d1; border-radius: 11px; padding: 12px 14px; text-align: left; cursor: pointer; display: flex; align-items: center; gap: 11px; font-weight: 650; }
.nav-item span { width: 19px; text-align: center; font-size: 17px; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.is-active { background: #fff; color: var(--teal); }
.sidebar-note { margin-top: auto; display: flex; align-items: flex-start; gap: 10px; padding: 13px; border: 1px solid rgba(255,255,255,.11); border-radius: 12px; background: rgba(255,255,255,.05); }
.sidebar-note strong, .sidebar-note small { display: block; }
.sidebar-note strong { font-size: 12px; }
.sidebar-note small { margin-top: 3px; color: #afd0cb; font-size: 10.5px; line-height: 1.35; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #72d3a3; margin-top: 4px; box-shadow: 0 0 0 4px rgba(114,211,163,.12); }
.account-card { margin-top: 10px; padding: 11px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 9px; border: 1px solid rgba(255,255,255,.11); border-radius: 12px; background: rgba(255,255,255,.06); }
.account-avatar { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; background: #fff; color: var(--teal); font-weight: 900; font-size: 12px; }
.account-card strong, .account-card small { display: block; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-card strong { font-size: 11px; }
.account-card small { margin-top: 2px; color: #afd0cb; font-size: 9.5px; }
.account-card button { width: 28px; height: 28px; padding: 0; border: 1px solid rgba(255,255,255,.15); border-radius: 8px; background: transparent; color: #dcecea; cursor: pointer; }

.app-shell { margin-left: 244px; min-height: 100vh; }
.topbar { min-height: 93px; padding: 19px 30px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 24px; position: sticky; top: 0; z-index: 8; backdrop-filter: blur(12px); }
.eyebrow { margin: 0 0 3px; color: var(--teal-2); font-weight: 750; font-size: 11px; text-transform: uppercase; letter-spacing: .11em; }
.topbar h1 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.save-status { display: block; margin-top: 5px; color: var(--muted); font-size: 10.5px; line-height: 1.3; }
.top-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.button { min-height: 39px; border-radius: 10px; border: 1px solid var(--line); padding: 8px 14px; font-weight: 700; font-size: 13px; cursor: pointer; transition: .18s ease; background: #fff; }
.button:hover { transform: translateY(-1px); border-color: #afc8c4; }
.button.primary { background: var(--teal); color: #fff; border-color: var(--teal); box-shadow: 0 6px 18px rgba(12,94,89,.2); }
.button.order { background: #d97832; color: #fff; border-color: #d97832; box-shadow: 0 6px 18px rgba(217,120,50,.2); }
.button.ghost { background: #fff; }
.button.soft { background: var(--mint); border-color: transparent; color: var(--teal); }
.button.danger { color: var(--red); border-color: #f0d4d6; background: #fff8f8; }
.button.icon { min-width: 39px; padding-inline: 10px; }

#app { max-width: 1540px; margin: 0 auto; padding: 28px 30px 60px; outline: none; }
.legal-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 30px 20px; border-top: 1px solid var(--line); color: var(--muted); background: rgba(255,255,255,.45); font-size: 10px; line-height: 1.45; }

.legal-page-body { background: #eef4f2; }
.legal-page-header { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 76px; padding: 14px max(24px, calc((100vw - 980px) / 2)); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }
.legal-page-brand { display: flex; align-items: center; gap: 11px; }
.legal-page-brand .brand-mark { width: 40px; height: 40px; background: var(--teal); }
.legal-page-brand strong, .legal-page-brand small { display: block; }
.legal-page-brand strong { font-size: 16px; }
.legal-page-brand small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.legal-back { display: inline-flex; align-items: center; min-height: 38px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 10px; color: var(--teal); background: #fff; font-size: 12px; font-weight: 800; text-decoration: none; }
.legal-page { width: min(980px, calc(100% - 32px)); margin: 28px auto 48px; }
.legal-hero { padding: 30px; border-radius: 18px; color: #fff; background: linear-gradient(135deg, #073b38, #0c5e59); box-shadow: var(--shadow); }
.legal-hero .eyebrow { color: #9ed6cc; }
.legal-hero h1 { margin: 5px 0 10px; font-size: clamp(29px, 5vw, 45px); letter-spacing: -.045em; }
.legal-hero p { max-width: 720px; margin: 0; color: #d6ebe8; font-size: 14px; line-height: 1.6; }
.legal-hero time { display: block; margin-top: 17px; color: #a9d4ce; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.legal-content { display: grid; gap: 14px; margin-top: 18px; }
.legal-section { padding: 23px 25px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow); }
.legal-section h2 { margin: 0 0 11px; font-size: 18px; letter-spacing: -.025em; }
.legal-section h3 { margin: 18px 0 8px; font-size: 14px; }
.legal-section p, .legal-section li { color: #4f6965; font-size: 12.5px; line-height: 1.65; }
.legal-section p { margin: 8px 0 0; }
.legal-section ul { margin: 8px 0 0; padding-left: 20px; }
.legal-section li + li { margin-top: 5px; }
.legal-section a { color: var(--teal); font-weight: 750; }
.legal-details { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 13px; }
.legal-details div { padding: 11px 12px; border-radius: 9px; background: var(--soft); }
.legal-details small, .legal-details strong { display: block; }
.legal-details small { color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.legal-details strong { margin-top: 3px; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.legal-table-wrap { margin-top: 13px; overflow-x: auto; }
.legal-table { width: 100%; border-collapse: collapse; min-width: 580px; }
.legal-table th, .legal-table td { padding: 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 11px; line-height: 1.45; }
.legal-table th { color: #355d57; background: var(--soft); font-size: 9.5px; text-transform: uppercase; letter-spacing: .04em; }
.legal-note { border-left: 4px solid var(--teal); }
.legal-page-footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 16px; padding: 16px 4px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
.content-stack { display: grid; gap: 18px; min-width: 0; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { padding: 19px 21px 15px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.card-header h2, .card-header h3 { margin: 0; letter-spacing: -.02em; }
.card-header h2 { font-size: 18px; }
.card-header h3 { font-size: 15px; }
.card-header p { margin: 5px 0 0; color: var(--muted); font-size: 12.5px; }
.card-body { padding: 0 21px 21px; }
.section-divider { border: 0; border-top: 1px solid var(--line); margin: 0 0 19px; }

.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px 15px; }
.field { display: grid; align-content: start; gap: 6px; min-width: 0; }
.field.span-2 { grid-column: span 2; }
.field.span-4 { grid-column: 1 / -1; }
.field label { color: #53706c; font-size: 11px; line-height: 1.25; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.field input, .field select, .field textarea {
  width: 100%; min-width: 0; border: 1px solid #cadbd8; background: #fff; color: var(--ink); border-radius: 9px; padding: 9px 10px; min-height: 40px; outline: none; transition: .16s ease;
}
.field textarea { min-height: 70px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--teal-2); box-shadow: 0 0 0 3px rgba(20,117,110,.1); }
.field input[disabled], .field select[disabled] { color: #8ca09d; background: #f4f7f6; }
.field-help { color: var(--muted); font-size: 10px; line-height: 1.35; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: #c9585f; background: #fffafa; box-shadow: 0 0 0 3px rgba(201,88,95,.08); }
.field.has-error label { color: #96373e; }
.field-error { color: #a23c43; font-size: 10px; line-height: 1.35; font-weight: 750; }
.municipality-autocomplete { position: relative; }
.municipality-suggestions {
  position: absolute; z-index: 30; inset: calc(100% + 5px) 0 auto; max-height: 270px; overflow-y: auto;
  padding: 5px; border: 1px solid #b9d2ce; border-radius: 10px; background: #fff; box-shadow: 0 15px 35px rgba(24, 69, 63, .18);
}
.municipality-option { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px; border: 0; border-radius: 7px; background: transparent; text-align: left; cursor: pointer; }
.municipality-option:hover, .municipality-option.is-active { color: var(--teal); background: var(--mint); }
.municipality-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.municipality-option strong { min-width: 30px; color: var(--teal); font-size: 10px; letter-spacing: .05em; text-align: right; }
.municipality-empty { margin: 0; padding: 10px; color: var(--muted); font-size: 11px; }
.transport-attribution { grid-column: 1 / -1; margin: -2px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.transport-attribution a { color: var(--teal); font-weight: 700; text-decoration: none; }
.transport-attribution a:hover { text-decoration: underline; }
.position-form .frame-field { align-content: start; }
.position-form .frame-field > label { min-height: 2.4em; }
.field-result { color: var(--teal); font-size: 9.5px; line-height: 1.3; font-weight: 850; }
.cremonese-control { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px; }
.cremonese-control .mini-button { white-space: nowrap; color: var(--teal); font-weight: 800; }
.cremonese-field > small { color: var(--muted); font-size: 10px; line-height: 1.25; }
.input-prefix { position: relative; }
.input-prefix span { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-prefix input { padding-left: 27px; }
.input-suffix { position: relative; }
.input-suffix span { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 800; }
.input-suffix input { padding-right: 30px; }

.positions-toolbar { display: flex; gap: 9px; flex-wrap: wrap; }
.position-card { margin: 0 21px 14px; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: #fff; }
.position-card:last-child { margin-bottom: 21px; }
.position-head { min-height: 66px; padding: 12px 14px; background: #f6f9f8; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: 12px; cursor: pointer; }
.position-number { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--teal); font-weight: 850; }
.position-title { min-width: 0; }
.position-title strong, .position-title small { display: block; }
.position-title strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.position-title small { color: var(--muted); margin-top: 3px; font-size: 11.5px; }
.technical-light { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid; border-radius: 999px; font-size: 9.5px; font-weight: 850; white-space: nowrap; }
.technical-light i { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(255,255,255,.78); }
.technical-light.is-green { color: #217052; border-color: #afd7c6; background: #eaf7f1; }
.technical-light.is-amber { color: #8a5c12; border-color: #e4c37e; background: #fff7dc; }
.technical-light.is-red { color: #a23c43; border-color: #e5b0b4; background: #fff0f1; }
.position-price { text-align: right; }
.position-price strong, .position-price small { display: block; }
.position-price strong { font-size: 15px; }
.position-price small { color: var(--muted); font-size: 10px; margin-top: 2px; text-transform: uppercase; font-weight: 700; }
.position-head-actions { display: flex; gap: 5px; }
.mini-button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 9px; cursor: pointer; font-size: 12px; }
.mini-button:hover { border-color: #a6bfbb; }
.mini-button:disabled { opacity: .35; cursor: default; }
.position-body { padding: 16px; border-top: 1px solid var(--line); }
.position-card:not(.is-open) .position-body { display: none; }
.position-form { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; }
.position-form .subsection { grid-column: 1 / -1; margin: 5px 0 -1px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--teal); font-weight: 850; }
.advanced-options { grid-column: 1 / -1; margin-top: 3px; border: 1px solid #cfe0dd; border-radius: 11px; overflow: hidden; background: #fbfdfc; }
.advanced-options-toggle { width: 100%; min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 13px; border: 0; background: #f2f8f6; color: var(--ink); text-align: left; cursor: pointer; }
.advanced-options-toggle:hover { background: #eaf4f1; }
.advanced-options-toggle strong, .advanced-options-toggle small { display: block; }
.advanced-options-toggle strong { color: var(--teal); font-size: 12.5px; }
.advanced-options-toggle small { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.advanced-options-action { flex: 0 0 auto; color: var(--teal); font-size: 11px; font-weight: 850; white-space: nowrap; }
.advanced-options-body { padding: 14px; border-top: 1px solid var(--line); background: #fff; }
.advanced-form-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; }
.technical-strip { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 4px; }
.technical-item { background: var(--soft); border-radius: 9px; padding: 10px; }
.technical-item small, .technical-item strong { display: block; }
.technical-item small { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; font-weight: 800; }
.technical-item strong { margin-top: 3px; font-size: 12px; }
.warning-box { grid-column: 1 / -1; padding: 10px 12px; border-radius: 9px; background: #fff6df; color: #7a5810; font-size: 11.5px; font-weight: 650; }
.ok-box { grid-column: 1 / -1; padding: 9px 12px; border-radius: 9px; background: #e8f6ee; color: #226746; font-size: 11.5px; font-weight: 750; }

.attachments-panel { grid-column: 1 / -1; padding: 13px; border: 1px dashed #b9d2cd; border-radius: 11px; background: #f8fbfa; }
.attachments-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.attachments-heading strong, .attachments-heading small { display: block; }
.attachments-heading strong { font-size: 12px; }
.attachments-heading small { margin-top: 3px; color: var(--muted); font-size: 10.5px; }
.attachment-add { display: inline-flex; align-items: center; white-space: nowrap; }
.attachment-add input { display: none; }
.attachment-add.is-disabled { opacity: .45; pointer-events: none; }
.attachment-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.attachment-item { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 7px; padding: 7px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.attachment-open { min-width: 0; display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; }
.attachment-open img, .attachment-type { width: 42px; height: 42px; flex: 0 0 auto; border-radius: 7px; object-fit: cover; background: #e7f3ef; }
.attachment-type { display: grid; place-items: center; color: var(--teal); font-size: 10px; font-weight: 900; }
.attachment-open span { min-width: 0; }
.attachment-open strong, .attachment-open small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attachment-open strong { font-size: 11px; }
.attachment-open small { margin-top: 3px; color: var(--muted); font-size: 9.5px; }
.attachment-remove { width: 27px; height: 27px; border: 0; border-radius: 7px; background: #fff0f1; color: var(--red); cursor: pointer; font-weight: 900; }
.attachment-empty { margin-top: 10px; color: var(--muted); font-size: 11px; }

.dealer-pricing-card .card-body { display: grid; gap: 18px; }
.supplier-payment-terms { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 15px; border: 1px solid #b9ded7; border-radius: 11px; background: #effaf7; }
.supplier-payment-terms small, .supplier-payment-terms strong { display: block; }
.supplier-payment-terms small { color: var(--teal-2); font-size: 9px; font-weight: 850; letter-spacing: .06em; }
.supplier-payment-terms strong { margin-top: 3px; font-size: 13px; }
.supplier-payment-terms > span { max-width: 370px; color: var(--muted); font-size: 10px; line-height: 1.4; text-align: right; }
.dealer-pricing-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.server-price-badge { display: inline-flex; align-items: center; min-height: 30px; padding: 5px 10px; border: 1px solid #b9ded7; border-radius: 999px; background: #effaf7; color: #0c5e59; font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.server-price-badge::before { content: "🔒"; margin-right: 5px; }
.calculation-pending .server-price-badge { opacity: .72; }
.dealer-pricing-overview { display: grid; grid-template-columns: minmax(240px,.7fr) minmax(0,1.3fr); gap: 18px; align-items: end; }
.dealer-pricing-overview .field > small { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.dealer-pricing-totals { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.dealer-pricing-totals > div { min-width: 0; padding: 12px; border-right: 1px solid var(--line); background: #fff; }
.dealer-pricing-totals > div:last-child { border-right: 0; }
.dealer-pricing-totals small, .dealer-pricing-totals strong { display: block; }
.dealer-pricing-totals small { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.dealer-pricing-totals strong { margin-top: 5px; font-size: 14px; white-space: nowrap; }
.dealer-pricing-totals .accent { background: var(--teal); color: #fff; }
.dealer-pricing-totals .accent small { color: #c7e4df; }
.extra-items-heading { display: flex; justify-content: space-between; gap: 15px; align-items: baseline; }
.extra-items-heading small { color: var(--muted); font-size: 10px; }
.extra-items-list { overflow-x: auto; }
.extra-item-labels, .extra-item-row { display: grid; grid-template-columns: 115px minmax(190px,1fr) 72px 125px 100px 28px; gap: 7px; min-width: 690px; align-items: center; }
.extra-item-labels { padding: 0 4px 6px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.extra-item-row { padding: 8px; border-top: 1px solid var(--line); }
.extra-item-row input, .extra-item-row select { width: 100%; min-height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 9px; background: #fff; }
.extra-item-row .input-prefix input { padding-left: 30px; }
.portal-list { padding: 20px; display: grid; gap: 16px; }
.portal-item { border: 1px solid var(--line); border-radius: 12px; padding: 18px; min-width: 0; overflow-x: auto; }
.portal-item h3 { margin: 8px 0; }
.cloud-notice { padding: 16px; background: #eef7f5; border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
.save-status { max-width: 650px; white-space: normal; }
.extra-item-row > strong { text-align: right; font-size: 12px; white-space: nowrap; }

.summary-card { position: sticky; top: 116px; overflow: hidden; }
.summary-hero { padding: 23px; background: linear-gradient(145deg, #0c5e59, #14756e); color: #fff; }
.summary-hero p { margin: 0; color: #bce0db; font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.summary-hero h2 { margin: 8px 0 3px; font-size: 34px; letter-spacing: -.045em; }
.summary-hero small { color: #d6ebe8; }
.summary-stats { display: grid; grid-template-columns: repeat(2, 1fr); border-bottom: 1px solid var(--line); }
.summary-stat { padding: 15px 18px; }
.summary-stat:nth-child(odd) { border-right: 1px solid var(--line); }
.summary-stat small, .summary-stat strong { display: block; }
.summary-stat small { color: var(--muted); text-transform: uppercase; font-size: 9px; letter-spacing: .06em; font-weight: 800; }
.summary-stat strong { margin-top: 4px; font-size: 14px; }
.summary-lines { padding: 16px 18px; display: grid; gap: 10px; }
.summary-line { display: flex; justify-content: space-between; gap: 15px; font-size: 12px; }
.summary-line span { color: var(--muted); }
.summary-line strong { text-align: right; }
.summary-warnings { margin: 0 18px 18px; padding: 11px; border-radius: 10px; background: #fff6df; color: #795b18; font-size: 10.5px; line-height: 1.45; }
.summary-ok { margin: 0 18px 18px; padding: 11px; border-radius: 10px; background: #e8f6ee; color: #226746; font-size: 11px; font-weight: 750; }
.pricing-lock { margin: 0 18px 14px; padding: 10px 11px; border: 1px solid #f0d9bd; border-radius: 10px; background: #fff8ee; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pricing-lock.is-locked { border-color: #b9d9d0; background: #edf8f5; }
.pricing-lock small, .pricing-lock strong { display: block; }
.pricing-lock small { color: var(--muted); font-size: 8.5px; font-weight: 850; letter-spacing: .06em; }
.pricing-lock strong { margin-top: 2px; font-size: 10.5px; }
.pricing-lock > span { color: var(--muted); font-size: 9.5px; text-align: right; }
.historical-pricing-callout { margin: -5px 18px 14px; padding: 10px 11px; border: 1px solid #e4c37e; border-radius: 10px; background: #fff8df; display: grid; gap: 8px; }
.historical-pricing-callout strong, .historical-pricing-callout span { display: block; }
.historical-pricing-callout strong { color: #795010; font-size: 10.5px; }
.historical-pricing-callout span { margin-top: 2px; color: #725e34; font-size: 9.5px; line-height: 1.35; }
.historical-pricing-callout .mini-button { justify-self: start; }
.timeline-block { padding: 15px 18px 18px; border-top: 1px solid var(--line); }
.timeline-heading { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.timeline-heading strong { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.timeline-heading span { color: var(--muted); font-size: 9.5px; }
.timeline-list { display: grid; gap: 10px; }
.timeline-item { display: grid; grid-template-columns: 10px 1fr; gap: 8px; position: relative; }
.timeline-item:not(:last-child)::after { content: ""; position: absolute; left: 4px; top: 10px; bottom: -12px; width: 1px; background: #cfe0dd; }
.timeline-dot { width: 9px; height: 9px; margin-top: 2px; border-radius: 50%; background: #bdd0cd; z-index: 1; }
.timeline-item.is-latest .timeline-dot { background: var(--teal); box-shadow: 0 0 0 3px #dff2ec; }
.timeline-item strong, .timeline-item small { display: block; }
.timeline-item strong { font-size: 11px; }
.timeline-item small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.timeline-item p { margin: 3px 0 0; color: #49645f; font-size: 9.5px; }

.empty-state { padding: 44px 24px; text-align: center; color: var(--muted); }
.empty-icon { width: 56px; height: 56px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 16px; background: var(--mint); color: var(--teal); font-size: 26px; }
.empty-state h3 { color: var(--ink); margin: 0 0 5px; }
.empty-state p { margin: 0 auto 18px; max-width: 440px; font-size: 13px; }

.table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
.data-table { width: 100%; border-collapse: collapse; min-width: 1050px; font-size: 11px; }
.data-table th { background: #e7f3ef; color: #476862; text-transform: uppercase; letter-spacing: .045em; font-size: 9px; text-align: right; padding: 10px 9px; white-space: nowrap; }
.data-table th:first-child, .data-table th:nth-child(2), .data-table td:first-child, .data-table td:nth-child(2) { text-align: left; }
.data-table td { padding: 10px 9px; border-top: 1px solid var(--line); text-align: right; white-space: nowrap; }
.data-table tr:hover td { background: #fafcfb; }
.data-table tfoot td { font-weight: 850; background: #f4f8f7; }
.data-table td small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.archive-card { overflow: hidden; }
.archive-table { min-width: 900px; font-size: 12px; }
.archive-table th, .archive-table td { text-align: left; }
.archive-table th:nth-last-child(2), .archive-table td:nth-last-child(2) { text-align: right; }
.archive-table tr.is-current td { background: #f0faf7; }
.archive-actions { display: flex; justify-content: flex-end; gap: 5px; }
.historic-badge { display: inline-flex; margin-top: 5px; padding: 3px 6px; border-radius: 999px; color: #81560e; background: #fff1c9; font-size: 8px; font-weight: 850; text-transform: uppercase; }
.status-badge { display: inline-flex; align-items: center; min-height: 26px; padding: 4px 9px; border-radius: 999px; background: #edf2f1; color: #536a67; font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .035em; }
.status-inviato, .status-in-trattativa { background: #fff0ce; color: #7c5b12; }
.status-confermato, .status-in-produzione, .status-in-verniciatura { background: #dff2ec; color: #19604c; }
.status-pronto, .status-consegnato { background: #dcecff; color: #265b8c; }
.status-annullato { background: #f8dfe1; color: #943b42; }
.demo-disclaimer { margin-top: 14px; padding: 12px 15px; border: 1px dashed #b8cfcb; border-radius: 11px; color: var(--muted); background: rgba(255,255,255,.55); font-size: 12px; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; border-radius: 999px; padding: 4px 8px; font-size: 10px; font-weight: 800; background: var(--mint); color: var(--teal); }
.pill.warning { background: #fff0ce; color: #7c5b12; }
.profile-badges { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.dealer-category-badge { background: #e8f3ef; color: #0c5e59; box-shadow: inset 0 0 0 1px #b9d7ce; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; margin-bottom: 18px; }
.kpi-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 17px; box-shadow: var(--shadow); }
.kpi-card small, .kpi-card strong { display: block; }
.kpi-card small { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: 9.5px; font-weight: 850; }
.kpi-card strong { margin-top: 7px; font-size: 21px; letter-spacing: -.03em; }
.kpi-card.accent { background: var(--teal); color: #fff; border-color: var(--teal); }
.kpi-card.accent small { color: #c6e2df; }

.parameter-groups { display: grid; gap: 17px; }
.parameter-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px 14px; }
.parameter-note { margin: -3px 0 16px; color: var(--muted); font-size: 12px; }
.parameter-warning { padding: 13px 15px; border-radius: 11px; background: #fff6df; color: #72530f; font-size: 12px; }

.branding-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr); gap: 18px; align-items: start; }
.brand-logo-editor { display: grid; grid-template-columns: auto 1fr; gap: 15px; align-items: center; margin-bottom: 20px; padding: 14px; border-radius: 12px; background: var(--soft); }
.brand-logo-preview { width: 78px; height: 78px; display: grid; place-items: center; overflow: hidden; border-radius: 15px; background: var(--dealer-accent); color: #fff; font-size: 22px; font-weight: 900; }
.brand-logo-preview img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.brand-logo-editor strong, .brand-logo-editor small { display: block; }
.brand-logo-editor small { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.brand-logo-actions { display: flex; gap: 7px; margin-top: 10px; }
.brand-fields { margin-top: 0; }
.brand-preview-card { position: sticky; top: 116px; }
.brand-document-preview { overflow: hidden; min-height: 265px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 15px 35px rgba(28,72,67,.08); }
.brand-document-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; padding: 10px; background: var(--dealer-accent); color: #fff; }
.brand-document-logo { width: 38px; height: 38px; display: grid; place-items: center; overflow: hidden; border-radius: 7px; background: rgba(255,255,255,.16); font-size: 11px; font-weight: 900; }
.brand-document-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.brand-document-head strong, .brand-document-head small, .brand-document-head > span { display: block; }
.brand-document-head strong { font-size: 11px; }
.brand-document-head small { margin-top: 2px; color: rgba(255,255,255,.78); font-size: 6.5px; }
.brand-document-head > span { padding: 5px 6px; border: 1px solid rgba(255,255,255,.35); border-radius: 4px; font-size: 6.5px; font-weight: 900; text-align: center; }
.brand-document-lines { padding: 18px; display: grid; gap: 15px; }
.brand-document-lines i { display: block; height: 30px; border-radius: 5px; background: linear-gradient(90deg, #eef5f3 70%, #f8faf9 70%); }
.branding-note { margin-top: 16px; padding: 12px; border-radius: 10px; background: #edf8f5; }
.branding-note strong { font-size: 11px; }
.branding-note p { margin: 4px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.45; }

.order-dialog { width: min(590px, calc(100% - 28px)); border: 0; border-radius: 20px; padding: 0; box-shadow: 0 28px 80px rgba(6,48,45,.28); }
.order-dialog::backdrop { background: rgba(7,44,42,.62); backdrop-filter: blur(3px); }
#order-check-content { padding: 27px; }
.dialog-icon { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 17px; border-radius: 14px; font-size: 23px; font-weight: 900; }
.dialog-icon.success { background: #dff2ec; color: var(--teal); }
.dialog-icon.error { background: #fff0f1; color: var(--red); }
#order-check-content h2 { margin: 4px 0 18px; font-size: 24px; letter-spacing: -.035em; }
.validation-checks { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; margin: 0 0 15px; padding: 0; list-style: none; }
.validation-checks li { display: flex; gap: 7px; align-items: center; padding: 9px 10px; border-radius: 9px; background: #f4f8f7; font-size: 11px; font-weight: 700; }
.validation-checks li span { width: 19px; height: 19px; display: grid; place-items: center; border-radius: 50%; }
.validation-checks li.passed span { background: #dff2ec; color: var(--teal); }
.validation-checks li.failed span { background: #fff0f1; color: var(--red); }
.dialog-list { margin-top: 10px; padding: 12px 14px; border-radius: 10px; font-size: 11px; }
.dialog-list.error { background: #fff0f1; color: #853b41; }
.dialog-list.warning { background: #fff6df; color: #72530f; }
.dialog-list ul { margin: 7px 0 0; padding-left: 18px; line-height: 1.5; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 21px; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; padding: 12px 16px; border-radius: 10px; background: #173431; color: #fff; box-shadow: 0 12px 35px rgba(0,0,0,.18); font-size: 12px; font-weight: 700; opacity: 0; transform: translateY(10px); pointer-events: none; transition: .22s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.mobile-action-bar { display: none; }
.print-area { display: none; }

@media (max-width: 1180px) {
  .content-grid { grid-template-columns: 1fr; }
  .summary-card { position: static; order: -1; }
  .summary-stats { grid-template-columns: repeat(4,1fr); }
  .summary-stat { border-right: 1px solid var(--line); }
  .form-grid, .position-form, .advanced-form-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .field.span-4 { grid-column: 1 / -1; }
  .branding-layout { grid-template-columns: 1fr; }
  .brand-preview-card { position: static; }
  .dealer-pricing-overview { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .sidebar { position: static; width: 100%; min-height: 0; padding: 12px 15px; flex-direction: row; align-items: center; }
  .brand { padding: 0; }
  .brand small { display: none; }
  .brand-mark { width: 36px; height: 36px; }
  .main-nav { display: flex; margin-left: auto; }
  .nav-item { padding: 9px 10px; font-size: 0; }
  .nav-item span { font-size: 18px; }
  .sidebar-note { display: none; }
  .account-card { margin: 0 0 0 8px; padding: 4px; gap: 4px; }
  .account-card > div:nth-child(2) { display: none; }
  .account-avatar { width: 32px; height: 32px; }
  .app-shell { margin-left: 0; }
  .topbar { position: static; padding: 15px; align-items: flex-start; }
  .topbar h1 { font-size: 19px; }
  .top-actions { gap: 5px; }
  .top-actions .button { min-height: 34px; padding: 7px 9px; font-size: 11px; }
  #app { padding: 16px 14px 105px; }
  .mobile-action-bar { position: fixed; z-index: 24; inset: auto 0 0; min-height: 70px; display: flex; align-items: center; gap: 8px; padding: 10px max(14px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); border-top: 1px solid var(--line); background: rgba(255,255,255,.96); box-shadow: 0 -10px 28px rgba(24,69,63,.12); backdrop-filter: blur(12px); }
  .mobile-total { min-width: 0; margin-right: auto; }
  .mobile-total small, .mobile-total strong { display: block; }
  .mobile-total small { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
  .mobile-total strong { margin-top: 2px; font-size: 15px; white-space: nowrap; }
  .mobile-action-bar .button { min-height: 38px; padding: 7px 10px; font-size: 11px; white-space: nowrap; }
  .legal-footer { display: grid; padding: 14px; text-align: center; }
  .legal-details { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .summary-stats { grid-template-columns: repeat(2,1fr); }
  .position-head { grid-template-columns: auto minmax(0,1fr) auto; }
  .technical-light { grid-column: 2; justify-self: start; }
  .position-head-actions { grid-column: 2 / -1; justify-content: flex-end; }
  .parameter-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 560px) {
  .login-screen { padding: 12px; }
  .login-panel { padding: 22px 18px; border-radius: 18px; }
  .legal-page-header { padding: 11px 16px; }
  .legal-page-brand small { display: none; }
  .legal-page { width: min(100% - 20px, 980px); margin-top: 12px; }
  .legal-hero, .legal-section { padding: 20px 18px; }
  .legal-page-footer { display: grid; }
  .login-copy { padding-block: 20px 15px; }
  .role-card { padding: 12px; }
  .topbar { display: block; }
  .top-actions { margin-top: 12px; justify-content: flex-start; }
  .form-grid, .position-form, .advanced-form-grid, .parameter-grid { grid-template-columns: 1fr; }
  .field.span-2, .field.span-4 { grid-column: auto; }
  .technical-strip { grid-template-columns: repeat(2,1fr); }
  .position-price { grid-column: 2; text-align: left; }
  .technical-light { grid-column: 2; }
  .position-head-actions { grid-column: 1 / -1; }
  .summary-hero h2 { font-size: 30px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .kpi-card { padding: 13px; }
  .kpi-card strong { font-size: 17px; }
  .archive-actions { flex-wrap: wrap; justify-content: flex-start; }
  .attachment-list, .validation-checks { grid-template-columns: 1fr; }
  .attachments-heading { align-items: flex-start; flex-direction: column; }
  .dealer-pricing-totals { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dealer-pricing-totals > div:nth-child(2) { border-right: 0; }
  .dealer-pricing-totals > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .extra-items-heading { align-items: flex-start; flex-direction: column; }
  .supplier-payment-terms { align-items: flex-start; flex-direction: column; }
  .supplier-payment-terms > span { text-align: left; }
  .advanced-options-toggle { align-items: flex-start; }
  .advanced-options-action { padding-top: 1px; }
  .dialog-actions { flex-direction: column-reverse; }
  .dialog-actions .button { width: 100%; }
}

@media print {
  @page { size: A4; margin: 10mm; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  html, body { background: #fff; color: #172c29; }
  .sidebar, .app-shell, .toast, .order-dialog, .legal-page-header, .legal-page, .legal-page-footer { display: none !important; }
  .print-area { display: block; font-family: Arial, sans-serif; font-size: 9pt; }
  .print-page { position: relative; min-height: 276mm; padding-bottom: 14mm; break-after: page; page-break-after: always; }
  .print-page:last-child { break-after: auto; page-break-after: auto; }
  .print-brand { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 6px; background: var(--dealer-accent, #0c5e59); color: #fff; }
  .print-brand-mark { width: 112px; height: 64px; display: grid; place-items: center; overflow: hidden; border-radius: 7px; background: rgba(255,255,255,.14); }
  .print-brand-mark svg { width: 40px; fill: none; stroke: #fff; stroke-width: 2.2; }
  .print-brand-mark img { width: 100%; height: 100%; padding: 2px; box-sizing: border-box; object-fit: contain; border-radius: 4px; background: #fff; }
  .print-brand-mark b { font-size: 8pt; }
  .print-brand strong, .print-brand small { display: block; }
  .print-brand strong { font-size: 13pt; }
  .print-brand small { margin-top: 1px; color: #d6ebe8; font-size: 7pt; }
  .print-document-name { padding: 5px 7px; border: 1px solid rgba(255,255,255,.35); border-radius: 4px; font-size: 8pt; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; text-align: center; }
  .print-document-name small { display: block; margin-top: 2px; color: rgba(255,255,255,.82); font-size: 5.5pt; letter-spacing: .02em; text-transform: none; }
  .print-meta { width: 100%; border-collapse: collapse; margin-top: 8px; }
  .print-meta th { width: 14%; text-align: left; color: #0c5e59; font-size: 7pt; text-transform: uppercase; }
  .print-meta td, .print-meta th { border-bottom: 1px solid #d8e4e1; padding: 3px 5px; }
  .print-summary { margin: 9px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .print-summary div { border: 1px solid #d7e7e4; padding: 7px; text-align: center; }
  .print-summary small, .print-summary strong { display: block; }
  .print-summary small { color: #4d6b66; font-size: 7.5pt; text-transform: uppercase; }
  .print-summary strong { margin-top: 3px; font-size: 9pt; }
  .print-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
  .client-print-page > h3 { margin: 3mm 0 1.5mm; color: #0c5e59; font-size: 9pt; break-after: avoid; }
  .client-print-page .print-table tr { break-inside: avoid; page-break-inside: avoid; }
  .print-table th { border: .2mm solid rgba(255,255,255,.42); background: #67b99a; color: #fff; padding: 5px 3px; font-size: 6.7pt; line-height: 1.15; text-align: center; }
  .print-table td { border: .2mm solid #cbd8d5; padding: 4px 3px; vertical-align: top; overflow-wrap: break-word; word-break: normal; line-height: 1.22; }
  .print-table td small { color: #58736f; font-size: 7pt; }
  .print-table .numeric { text-align: right; white-space: nowrap; }
  .print-table td:nth-child(8) { text-align: center; white-space: nowrap; font-size: 7pt; }
  .print-extras-title { margin-top: 8px; color: #0c5e59; font-size: 7.5pt; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
  .print-extras { width: 100%; margin-top: 4px; border-collapse: collapse; table-layout: fixed; }
  .print-extras th { border: .2mm solid rgba(255,255,255,.42); padding: 4px 5px; background: #4f8d84; color: #fff; font-size: 6.8pt; text-align: left; }
  .print-extras th:nth-child(n+2) { text-align: right; }
  .print-extras th:first-child { width: 58%; }
  .print-extras td { border: .2mm solid #cbd8d5; padding: 4px 5px; font-size: 7.5pt; }
  .print-extras td:first-child small, .print-extras td:first-child strong { display: block; }
  .print-extras td:first-child small { color: #58736f; font-size: 6.3pt; text-transform: uppercase; }
  .print-extras td.numeric { text-align: right; white-space: nowrap; }
  .print-shutter-cell { text-align: center; }
  .print-shutter-cell > small { display: block; white-space: nowrap; line-height: 1.15; }
  .print-shutter-cell > .finished-size { margin-top: -1px; color: #263d39; font-size: 6.5pt; font-weight: 800; }
  .print-shutter-cell > .hole-size { margin-top: 2px; color: #607a76; font-size: 5.8pt; }
  .client-shutter-svg { display: block; width: 100%; height: 15mm; margin: -1px auto 0; }
  .shutter-body { stroke: #263d39; stroke-width: 1.5; }
  .shutter-joints { fill: none; stroke: rgba(31,52,48,.88); stroke-width: 1.25; }
  .print-note-row td { padding: 5px 7px; background: #f0f7f5; color: #2d4a45; font-size: 8pt; line-height: 1.35; }
  .print-total { margin-top: 8px; padding: 7px 10px; display: flex; justify-content: flex-end; gap: 35px; background: #0c5e59; color: #fff; font-size: 12pt; font-weight: 800; }
  .print-conditions { margin-top: 8px; border-top: 2px solid #0c5e59; padding-top: 6px; font-size: 8pt; line-height: 1.35; }
  .print-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; margin-top: 20px; text-align: center; font-weight: 700; }
  .print-signatures div { border-top: 1px solid #777; padding-top: 5px; }
  .print-footer { position: absolute; inset: auto 0 0; display: flex; justify-content: space-between; border-top: 1px solid #d3dfdd; padding-top: 4px; color: #647b77; font-size: 7pt; }

  .production-position-title { display: flex; justify-content: space-between; gap: 10px; margin: 10px 0 8px; padding: 8px 10px; border-left: 4px solid #f3a96f; background: #fff5ec; font-size: 13pt; }
  .production-grid { display: grid; grid-template-columns: repeat(2,1fr); border: 1px solid #d6e2df; border-bottom: 0; }
  .production-grid > div { padding: 7px 9px; border-right: 1px solid #d6e2df; border-bottom: 1px solid #d6e2df; }
  .production-grid > div:not(.production-drawing):nth-child(odd) { border-right: 0; }
  .production-grid .production-drawing { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; border-right: 0; text-align: center; }
  .production-grid .production-drawing > small { text-align: left; }
  .production-grid .production-drawing > strong { text-align: right; }
  .production-shutter-svg { width: 42mm; height: 48mm; }
  .production-grid small, .production-grid strong { display: block; }
  .production-grid small { color: #58736f; font-size: 7pt; text-transform: uppercase; letter-spacing: .04em; }
  .production-grid strong { margin-top: 2px; font-size: 9pt; }
  .production-note { margin-top: 8px; padding: 8px 10px; border-radius: 4px; break-inside: avoid; }
  .production-note.client { background: #edf7f4; border: 1px solid #cfe4de; }
  .production-note.internal { background: #fff4d8; border: 1px solid #edd99e; }
  .production-note strong { font-size: 8pt; text-transform: uppercase; }
  .production-note p { margin: 4px 0 0; font-size: 9pt; line-height: 1.35; }
  .production-section-title { margin-top: 9px; color: #0c5e59; font-size: 8pt; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
  .production-attachments { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 6px; }
  .production-attachments figure, .production-file { margin: 0; border: 1px solid #d7e2e0; border-radius: 4px; padding: 5px; break-inside: avoid; }
  .production-attachments img { display: block; width: 100%; height: 42mm; object-fit: contain; background: #f2f5f4; }
  .production-attachments figcaption { margin-top: 4px; font-size: 7pt; overflow-wrap: anywhere; }
  .production-file { display: flex; min-height: 20mm; align-items: center; gap: 7px; }
  .production-file strong { padding: 5px; border-radius: 3px; background: #e7f3ef; color: #0c5e59; }
  .production-file span { font-size: 7.5pt; overflow-wrap: anywhere; }
  .production-empty { margin-top: 6px; padding: 9px; border: 1px dashed #c5d5d2; color: #637b76; font-size: 8pt; }
  .production-checks { display: grid; grid-template-columns: repeat(2,1fr); gap: 7px; margin-top: 12px; }
  .production-checks span { padding: 7px; border: 1px solid #ccd9d6; font-size: 8pt; }
}

.coprifilo-options { grid-column: 1 / -1; display:flex; gap:16px; align-items:end; flex-wrap:wrap; padding:8px; background:#eff8f5; font-size:12px; }
.coprifilo-options label { display:grid; gap:4px; }
@media print { .production-grid > div > strong { font-size:11pt; } .production-grid > div > small { font-size:8pt; } }

.auto-cost-details{min-width:230px;margin-top:8px;font-size:12px}.auto-cost-details summary,.auto-cost-settings summary{cursor:pointer;color:#0f625b;font-weight:700}.auto-cost-details[open]{padding:10px;background:#f2f7f5;border-radius:8px}.auto-cost-details .summary-line{gap:14px;padding:4px 0;white-space:normal}.auto-cost-details strong{white-space:nowrap}.auto-cost-settings{margin:20px 0;border-top:1px solid #d8e6e2;padding-top:16px}.auto-cost-settings p{line-height:1.55}.auto-cost-settings .mixed-admin-costs{margin:16px 0}.auto-cost-settings .check-row{display:flex;align-items:center;gap:8px}.auto-cost-settings input[type=checkbox]{width:auto}

/* Product filter shared by the unified quote archive. */
.quote-archive-filter{display:flex;align-items:center;gap:1rem;flex-wrap:wrap;margin:0 0 1rem;padding:1rem;background:#fff;border:1px solid var(--border,#d8e4e0);border-radius:12px}
.quote-archive-filter label{display:flex;align-items:center;gap:.65rem;font-weight:700}
.quote-archive-filter select{min-width:150px;padding:.6rem .8rem;border:1px solid var(--border,#d8e4e0);border-radius:8px;background:#fff;color:inherit;font:inherit}
.quote-archive-filter>span{flex:1;min-width:220px;font-size:.82rem;color:var(--muted,#5b706a)}
.quote-archive-legacy{margin-top:1.25rem}.quote-archive-legacy .card-body{padding:1rem 1.25rem}
.quote-archive-legacy .mini-button{text-decoration:none;display:inline-block;white-space:nowrap}
.quote-archive-error{padding:.8rem;background:#fff2ed;border-radius:8px;margin-bottom:1rem}
.quote-archive-warning{font-size:.85rem;margin:1rem 0 0}.quote-archive-warning button{margin-left:.7rem}

.quote-archive-legacy a.mini-button { display:inline-flex; color:inherit; text-decoration:none; }
/* Admin installation pricebook: the catalog data comes from the private API. */
.installation-dialog{width:min(860px,calc(100vw - 32px));max-height:calc(100dvh - 32px);border:1px solid #cfdfdd;border-radius:18px;padding:0;color:#183f40;background:#fff;box-shadow:0 24px 80px #12333340}
.installation-dialog::backdrop{background:#102d2c80}
.installation-dialog-head{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:20px 24px;border-bottom:1px solid #dce8e6}
.installation-dialog-head h2{margin:0;font-size:1.3rem}.installation-dialog-head p{margin:5px 0 0;color:#567471;font-size:.875rem}
.installation-dialog-body{padding:24px}.installation-form{display:grid;gap:16px}
.installation-form label{display:grid;gap:7px;font-size:.9375rem;font-weight:600;min-width:0}
.installation-form input,.installation-form select{width:100%;min-width:0;box-sizing:border-box;padding:10px;border:1px solid #b9cecb;border-radius:8px;background:#fff;color:#183f40;font:inherit;font-weight:400}
.installation-form select[size]{height:156px;padding:4px}.installation-form select[size] option{padding:7px 8px;white-space:normal;overflow-wrap:anywhere}
.installation-filters{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.installation-form .installation-eqf{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.installation-eqf input{width:18px;height:18px;accent-color:#00675f}
.installation-form input:disabled{opacity:.5}.installation-hint,.installation-form small{font-size:.875rem;line-height:1.5;color:#546f6d;margin:0}
.installation-preview{border:1px solid #ccdedb;background:#f0f7f5;border-radius:10px;padding:16px;font-size:1rem;overflow-wrap:anywhere}
.installation-preview p{margin:10px 0 0}.installation-preview-prices{display:flex;gap:20px;flex-wrap:wrap;margin-top:14px}.installation-preview-prices span{display:grid;gap:4px;font-size:.875rem}.installation-preview-prices b{font-size:1.2rem}
.installation-dialog-actions{display:flex;justify-content:flex-end}.installation-form [role=alert]:empty{display:none}.installation-form [role=alert]{margin:0;color:#a42d20}
.installation-line-source{grid-column:1/-1;font-size:.875rem;color:#52726c}
@media(max-width:600px){.installation-dialog-head,.installation-dialog-body{padding:16px}.installation-filters{grid-template-columns:1fr}.installation-dialog-actions .button{width:100%}.dealer-pricing-actions{flex-wrap:wrap}}


/* Supplier import: internal controls and customer-safe technical details. */
.eko-dialog {width:min(1120px,96vw);max-width:96vw}
.eko-dialog input[type=file] {max-width:100%;font-size:14px}
.eko-dialog [data-error] {color:#a12020}
.eko-dialog .eko-confirm {display:flex;gap:10px;align-items:flex-start;margin:18px 0;font-weight:600}
.eko-confirm input {width:18px;height:18px;flex-shrink:0}
.eko-review-table td {vertical-align:top}
.eko-review-table td:first-child {min-width:220px}
.eko-review-table small,.eko-review-table strong {display:block}
.eko-drawing {display:block;width:100px;max-height:160px;object-fit:contain;object-position:top;background:white}
.eko-item-detail {display:flex;gap:12px;align-items:flex-start;grid-column:1/-1;padding:6px 0}
.eko-item-detail small {display:block;white-space:normal;line-height:1.4}
.eko-dialog .eko-drawing {float:left;margin-right:12px}
@media print {
 .eko-item-detail {gap:3mm}
 .eko-item-detail .eko-drawing {width:25mm;max-height:38mm}
 .print-extras .eko-item-detail small {text-transform:none;color:#244943;font-size:7pt}
 .print-extras tr {break-inside:avoid}
}

.eko-pricing-controls {padding:18px;border:1px solid #a9ccbd;border-radius:10px;background:#f1f8f5;margin-bottom:22px}
.eko-pricing-controls h3 {margin:0 0 8px;color:#004747}
.eko-pricing-controls p {font-size:14px;line-height:1.5;margin:8px 0}
.eko-pricing-fields {display:flex;gap:16px;align-items:end;flex-wrap:wrap;margin:15px 0}
.eko-pricing-fields label {display:grid;gap:6px;font-size:14px;font-weight:600}
.eko-pricing-fields input,.eko-pricing-fields select {padding:10px;font-size:16px;border:1px solid #92b4a6;border-radius:6px;background:white}
.eko-pricing-fields input {width:145px}
.eko-pricing-preview {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.eko-pricing-preview span {font-size:13px;color:#42685b}
.eko-pricing-preview b {display:block;font-size:20px;color:#004747;margin-top:5px}
[data-eko-pricing-error],[data-korus-pricing-error],[data-korus-costs-error] {color:#a32020}
@media(max-width:650px){.eko-pricing-preview{grid-template-columns:repeat(2,minmax(0,1fr))}}

.customer-dialog {width:min(850px,94vw);max-height:90vh;border:1px solid #b8cbc7;border-radius:12px;padding:0;color:#173b35}.customer-dialog::backdrop{background:#1238}.customer-dialog .card-body{padding:20px}.customer-result{display:block;width:100%;text-align:left;padding:14px;margin:8px 0;background:#f0f5f2;border:1px solid #b8cbc7;border-radius:6px}.customer-snapshot{padding:12px;margin-top:12px;background:#f0f5f2}.customer-dialog input,.customer-dialog select{width:100%;padding:9px}

.scope-row{display:flex;align-items:center;gap:10px;margin:6px 0}.scope-row input[type=checkbox]{width:18px;flex:0 0 18px}.scope-row input:not([type=checkbox]){flex:1;min-width:0;padding:7px}[data-scope-editor]{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:20px;margin:18px 0}
