:root {
  color-scheme: light;
  --ink: #173431;
  --muted: #68817d;
  --line: #d9e7e4;
  --soft: #f3f8f6;
  --canvas: #edf4f2;
  --teal: #0c5e59;
  --teal-2: #14756e;
  --deep: #073b38;
  --mint: #dff2ec;
  --orange: #d97832;
  --yellow: #fff3d6;
  --red: #b7464d;
  --white: #fff;
  --shadow: 0 12px 34px rgba(27, 72, 67, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--canvas); }
body { min-height: 100vh; margin: 0; color: var(--ink); background: var(--canvas); }
button, input, a { font: inherit; }
button, a { color: inherit; }

.login-screen { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 16% 12%, rgba(78, 190, 156, .2), transparent 31%), radial-gradient(circle at 84% 86%, rgba(217, 120, 50, .17), transparent 28%), var(--deep); }
body.session-ready .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,.14); border-radius: 25px; background: rgba(255,255,255,.985); box-shadow: 0 34px 90px rgba(0,0,0,.3); }
.login-brand, .brand { display: flex; align-items: center; gap: 13px; }
.login-brand { padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.login-brand strong, .login-brand small, .brand strong, .brand small { display: block; }
.login-brand strong { font-size: 18px; }
.login-brand small { margin-top: 3px; color: var(--muted); font-size: 13px; }
.brand-mark { width: 54px; height: 54px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 14px; background: var(--teal); }
.brand-mark svg { width: 34px; fill: none; stroke: #fff; stroke-width: 2.2; }
.login-copy { padding: 28px 0 20px; }
.eyebrow { margin: 0 0 5px; color: var(--teal-2); font-size: 11px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.login-copy h1 { margin: 0; font-size: clamp(30px, 6vw, 43px); line-height: 1.04; letter-spacing: -.05em; }
.login-copy > p:last-child { margin: 13px 0 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.admin-login-form { display: grid; gap: 7px; }
.admin-login-form > label { color: #52706b; font-size: 10px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.password-row { display: grid; grid-template-columns: minmax(190px,.72fr) minmax(300px,1.28fr); gap: 10px; }
.password-row > input { width: 100%; min-height: 80px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: #f8fbfa; outline: none; }
.password-row > input:focus { border-color: var(--teal-2); box-shadow: 0 0 0 3px rgba(20,117,110,.1); }
.role-card { width: 100%; min-height: 80px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 15px; padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: #fff; text-align: left; cursor: pointer; transition: .18s ease; }
.role-card:hover { transform: translateY(-2px); border-color: #8dbbb4; box-shadow: 0 10px 25px rgba(12,94,89,.12); }
.role-card strong, .role-card small { display: block; }
.role-card strong { font-size: 17px; }
.role-card small { margin-top: 4px; color: var(--muted); font-size: 13px; }
.role-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 13px; background: #fff0df; color: #92551f; font-weight: 900; font-size: 18px; }
.role-arrow { color: var(--teal); font-size: 25px; }
.login-note { margin: 18px 0 0; color: var(--muted); text-align: center; font-size: 12px; }
.login-error { min-height: 18px; margin: 1px 0 0; color: var(--red); font-size: 11px; font-weight: 750; }
.lock { color: #399671; }

.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 10; width: 254px; display: flex; flex-direction: column; padding: 25px 18px; background: var(--deep); color: #fff; overflow-y:auto; }
.brand { padding: 0 7px 29px; }
.brand .brand-mark { background: rgba(255,255,255,.11); }
.brand strong { font-size: 17px; }
.brand small { margin-top: 2px; color: #b3d3ce; font-size: 11px; }
.main-nav { display: grid; gap: 7px; }
.nav-group { display: grid; gap: 5px; margin: 5px 0; padding: 10px 0; border-block: 1px solid rgba(255,255,255,.12); }
.nav-group-title { padding: 0 14px 4px; color: #79bdb4; font-size: 10px; letter-spacing: .11em; text-transform: uppercase; }
.nav-item { min-height: 45px; display: flex; align-items: center; gap: 11px; padding: 11px 14px; border: 0; border-radius: 11px; color: #bdd6d2; background: transparent; text-align: left; font-weight: 700; cursor: pointer; }
.nav-item span { width: 19px; text-align: center; font-size: 17px; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-item.is-active { color: var(--teal); background: #fff; }
.document-reference { display: grid; gap: 2px; color: var(--teal); text-decoration: none; }
.document-reference:hover strong { text-decoration: underline; }
.document-reference span, .missing-reference { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.security-card { margin-top: auto; display: flex; align-items: flex-start; gap: 10px; padding: 13px; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; background: rgba(255,255,255,.05); }
.security-card strong, .security-card small { display: block; }
.security-card strong { font-size: 12px; }
.security-card small { margin-top: 3px; color: #b3d3ce; font-size: 10.5px; line-height: 1.4; }
.status-dot { width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: #72d3a3; box-shadow: 0 0 0 4px rgba(114,211,163,.12); }
.account-card { margin-top: 10px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 11px; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; background: rgba(255,255,255,.06); }
.account-avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: #92551f; background: #fff0df; font-size: 12px; font-weight: 900; }
.account-card strong, .account-card small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-card strong { font-size: 11px; }
.account-card small { margin-top: 2px; color: #b3d3ce; font-size: 9.5px; }
.account-card button { width: 31px; height: 31px; padding: 0; border: 1px solid rgba(255,255,255,.16); border-radius: 8px; color: #fff; background: transparent; cursor: pointer; }

.app-shell { min-height: 100vh; margin-left: 254px; }
.topbar { min-height: 94px; position: sticky; top: 0; z-index: 8; display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 19px 30px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.93); backdrop-filter: blur(12px); }
.topbar h1 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.protected-badge { display: inline-flex; align-items: center; min-height: 34px; padding: 6px 11px; border: 1px solid #b5ddd5; border-radius: 999px; color: var(--teal); background: #effaf7; font-size: 11px; font-weight: 850; }
.protected-badge::before { content: "●"; margin-right: 6px; color: #34946e; }
.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-decoration: none; font-size: 12px; font-weight: 750; cursor: pointer; transition: .17s ease; }
.button:hover { transform: translateY(-1px); border-color: #a9c4bf; }
.button.primary { color: #fff; border-color: var(--teal); background: var(--teal); box-shadow: 0 6px 18px rgba(12,94,89,.2); }
.button.warning { color: #754517; border-color: #efd1b3; background: #fff8ee; }
.button.danger { color: #9a3e45; border-color: #efcfd2; background: #fff6f7; }
.button:disabled { opacity: .55; cursor: wait; transform: none; }

#app { max-width: 1560px; margin: 0 auto; padding: 28px 30px 60px; outline: none; }
.loading-card { min-height: 310px; display: flex; align-items: center; justify-content: center; gap: 12px; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: var(--shadow); }
.spinner { width: 22px; height: 22px; border: 3px solid #d6e8e4; border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.page-intro { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 17px; }
.page-intro h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.page-intro p { max-width: 720px; margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.version-pill, .demo-pill, .status-badge { display: inline-flex; align-items: center; min-height: 27px; padding: 4px 9px; border-radius: 999px; color: var(--teal); background: var(--mint); font-size: 10px; font-weight: 850; white-space: nowrap; }
.demo-pill { color: #80521f; background: #fff0df; }

.kpi-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; margin-bottom: 18px; }
.kpi-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow); }
.kpi-card small, .kpi-card strong, .kpi-card em { display: block; }
.kpi-card small { color: var(--muted); font-size: 9.5px; font-weight: 850; letter-spacing: .065em; text-transform: uppercase; }
.kpi-card strong { margin-top: 7px; font-size: clamp(19px,2vw,25px); letter-spacing: -.04em; white-space: nowrap; }
.kpi-card em { margin-top: 5px; color: var(--muted); font-size: 10px; font-style: normal; }
.kpi-card.accent { color: #fff; border-color: var(--teal); background: linear-gradient(145deg,var(--teal),var(--teal-2)); }
.kpi-card.accent small, .kpi-card.accent em { color: #c8e4df; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(310px,.75fr); gap: 18px; align-items: start; }
.content-stack { display: grid; gap: 18px; }
.card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 19px 21px 16px; }
.card-header h2, .card-header h3 { margin: 0; letter-spacing: -.025em; }
.card-header h2 { font-size: 18px; }
.card-header h3 { font-size: 15px; }
.card-header p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.card-body { padding: 0 21px 21px; }
.quote-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.quote-summary div { min-width: 0; padding: 13px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.quote-summary div:nth-child(2n) { border-right: 0; }
.quote-summary div:nth-last-child(-n+2) { border-bottom: 0; }
.quote-summary small, .quote-summary strong { display: block; }
.quote-summary small { color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; }
.quote-summary strong { margin-top: 4px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cost-bars { display: grid; gap: 13px; }
.cost-bar-row { display: grid; grid-template-columns: 125px minmax(90px,1fr) 88px; align-items: center; gap: 10px; font-size: 11px; }
.cost-bar-row > span:first-child { color: #49645f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cost-bar-row > strong { text-align: right; white-space: nowrap; }
.bar-track { height: 8px; overflow: hidden; border-radius: 999px; background: #eaf1ef; }
.bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg,#39a382,var(--teal)); }
.margin-panel { padding: 22px; color: #fff; background: linear-gradient(150deg,#073b38,#0c5e59); }
.margin-panel small, .margin-panel strong { display: block; }
.margin-panel small { color: #bde0db; font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.margin-panel > strong { margin-top: 8px; font-size: 35px; letter-spacing: -.05em; }
.margin-meter { height: 10px; margin: 18px 0 8px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.18); }
.margin-meter span { display: block; height: 100%; border-radius: inherit; background: #72d3a3; }
.margin-detail { display: flex; justify-content: space-between; gap: 15px; color: #d5ebe8; font-size: 11px; }
.margin-guides { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.14); color: #d5ebe8; font-size: 9.5px; font-weight: 750; }
.security-note { padding: 17px 19px; border: 1px solid #b8ddd6; border-radius: 14px; color: #235e52; background: #effaf7; font-size: 12px; line-height: 1.55; }
.security-note strong { display: block; margin-bottom: 3px; color: var(--teal); }

.table-wrap { overflow-x: auto; border-top: 1px solid var(--line); -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; min-width: 1380px; border-collapse: collapse; font-size: 11px; }
.data-table th { padding: 10px 9px; color: #486862; background: #e7f3ef; font-size: 8.5px; font-weight: 850; letter-spacing: .045em; text-align: right; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 10px 9px; border-top: 1px solid var(--line); text-align: right; 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) { position: sticky; z-index: 2; text-align: left; background: #fff; }
.data-table th:first-child { left: 0; background: #e7f3ef; }
.data-table th:nth-child(2) { left: 36px; background: #e7f3ef; }
.data-table td:first-child { left: 0; }
.data-table td:nth-child(2) { left: 36px; }
.data-table tbody tr:hover td { background: #fafcfb; }
.data-table tfoot td { font-weight: 850; background: #f3f8f6; }
.data-table .positive { color: #1c795a; font-weight: 850; }
.reconciliation-body { padding-top: 16px; }
.pricing-reconciliation { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.pricing-reconciliation > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; border-bottom: 1px solid var(--line); font-size: 10px; }
.pricing-reconciliation > div:last-child { border-bottom: 0; }
.pricing-reconciliation span { color: #526f6b; }
.pricing-reconciliation strong { white-space: nowrap; }
.pricing-reconciliation .discount strong { color: #a05c20; }
.pricing-reconciliation .net { color: #fff; background: var(--teal); }
.pricing-reconciliation .net span { color: #d7ebe8; font-weight: 800; }
.transport-row td { background: #fffaf3; }
.orders-table { min-width: 920px; }
.orders-table th, .orders-table td { position: static !important; text-align: left !important; }
.orders-table th:nth-last-child(2), .orders-table td:nth-last-child(2) { text-align: right !important; }
.status-badge { color: #6f5117; background: #fff0ce; text-transform: uppercase; }
.status-confermato, .status-in-produzione { color: #176249; background: #dff2ec; }
.status-pronto { color: #245b8d; background: #deedff; }
.order-alert { color: #8a3d42; }
.orders-table .button { min-height: 35px; padding: 7px 10px; white-space: nowrap; }
.dealer-category-badge { display: inline-flex; align-items: center; margin-top: 5px; padding: 3px 7px; border-radius: 999px; color: #315d78; background: #e8f2fa; font-size: 8.5px; font-weight: 850; line-height: 1.2; text-transform: uppercase; white-space: nowrap; }
.dealer-category-badge.category-partner { color: #6b4b14; background: #fff0ce; }
.dealers-table { min-width: 1180px; }
.dealers-table th, .dealers-table td { position: static !important; text-align: left !important; }
.dealers-table td { vertical-align: middle; }
.dealer-category-select { min-width: 145px; min-height: 38px; padding: 7px 34px 7px 10px; border: 1px solid #c9dad7; border-radius: 9px; color: var(--ink); background: #fff; font: inherit; font-weight: 750; cursor: pointer; }
.dealer-category-select:focus { border-color: var(--teal-2); outline: none; box-shadow: 0 0 0 3px rgba(20,117,110,.1); }
.dealer-change-note { display: block; margin-top: 4px; color: #a05c20; font-size: 8px; font-weight: 750; }
.dealer-row-changed .dealer-category-select { border-color: #e4aa77; background: #fffaf5; }
.margin-health { display: inline-flex; align-items: center; min-height: 26px; padding: 4px 8px; border-radius: 999px; font-size: 8.5px; font-weight: 850; text-transform: uppercase; white-space: nowrap; }
.margin-in-obiettivo { color: #176249; background: #dff2ec; }
.margin-sotto-obiettivo { color: #7b511b; background: #fff0ce; }
.margin-bloccato { color: #8a343c; background: #fff0f1; }
.dealer-toolbar { top: 94px; }

.order-review-intro { align-items: center; }
.back-button { display: block; margin: 0 0 8px; padding: 0; border: 0; color: var(--teal); background: transparent; font-size: 11px; font-weight: 800; cursor: pointer; }
.order-review-grid { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(330px,.65fr); gap: 18px; align-items: start; }
.review-sidebar { position: sticky; top: 111px; }
.order-overview-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.order-overview-grid > div { min-width: 0; padding: 13px; border-right: 1px solid var(--line); }
.order-overview-grid > div:last-child { border-right: 0; }
.order-overview-grid small, .order-overview-grid strong, .order-overview-grid em { display: block; }
.order-overview-grid small { color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; }
.order-overview-grid strong { margin-top: 4px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-overview-grid em { margin-top: 3px; color: #a0581c; font-size: 9px; font-style: normal; font-weight: 800; }
.dealer-badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; color: #385f80; background: #e7f1fb; font-size: 9px; font-weight: 850; text-transform: uppercase; }
.dealer-order-note { padding: 14px; border-left: 3px solid #7da7c7; border-radius: 0 9px 9px 0; color: #31516a; background: #f2f7fc; font-size: 12px; line-height: 1.55; }
.positions-review-list { display: grid; gap: 12px; padding: 0 20px 20px; }
.order-position-card { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.order-position-head { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 12px 14px; background: #f5f9f8; }
.position-index { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: #fff; background: var(--teal); font-size: 12px; font-weight: 900; }
.order-position-head strong, .order-position-head small { display: block; }
.order-position-head > div:nth-child(2) { min-width: 0; }
.order-position-head > div:nth-child(2) strong { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-position-head > div:nth-child(2) small { margin-top: 3px; color: var(--muted); font-size: 9.5px; }
.position-economics { text-align: right; }
.position-economics strong { font-size: 13px; }
.position-economics small { color: var(--muted); }
.order-position-body { display: grid; grid-template-columns: 145px minmax(0,1fr); gap: 16px; padding: 15px; border-top: 1px solid var(--line); }
.position-visual { display: grid; align-content: start; justify-items: center; padding: 10px 6px; border-radius: 10px; background: #f5f8f7; }
.position-visual > small { margin-top: 4px; color: var(--muted); font-size: 8.5px; text-align: center; }
.order-shutter { width: 116px; height: 94px; overflow: visible; }
.order-shutter-body { stroke: #264b47; stroke-width: 1.2; }
.order-shutter-joints line { stroke: #264b47; stroke-width: 1; }
.order-shutter text { fill: #5b7470; font-size: 6px; font-weight: 750; }
.position-review-content { min-width: 0; display: grid; gap: 11px; }
.position-edit-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.review-field, .production-note { min-width: 0; display: grid; gap: 5px; }
.review-field > span, .production-note > span { color: #526f6b; font-size: 9px; font-weight: 850; letter-spacing: .045em; text-transform: uppercase; }
.review-field > div { position: relative; }
.review-field input, .production-note textarea { width: 100%; min-height: 39px; padding: 8px 9px; border: 1px solid #cadbd8; border-radius: 8px; color: var(--ink); background: #fff; outline: none; }
.review-field > div input { padding-right: 34px; }
.review-field > div small { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); color: var(--muted); font-size: 8px; font-weight: 800; }
.review-field > em { color: #a45b1d; font-size: 8px; font-style: normal; font-weight: 750; }
.review-field.is-revised input { border-color: #e4aa77; background: #fff9f2; }
.review-field input:focus, .production-note textarea:focus { border-color: var(--teal-2); box-shadow: 0 0 0 3px rgba(20,117,110,.1); }
.production-note textarea { min-height: 72px; resize: vertical; line-height: 1.4; }
.production-note > span b { display: inline-flex; margin-left: 4px; padding: 2px 5px; border-radius: 999px; color: #7f4d18; background: #fff0df; font-size: 7px; }
.production-note > small { color: var(--muted); font-size: 8.5px; line-height: 1.35; }
.position-specs { display: flex; gap: 6px; flex-wrap: wrap; }
.position-specs span { padding: 5px 7px; border-radius: 7px; color: var(--muted); background: #f3f7f6; font-size: 8.5px; }
.position-specs strong { color: var(--ink); }
.dealer-position-note { padding: 9px 10px; border-radius: 8px; color: #365b78; background: #f1f7fc; }
.dealer-position-note strong { display: block; font-size: 8px; letter-spacing: .05em; text-transform: uppercase; }
.dealer-position-note p { margin: 4px 0 0; font-size: 9px; line-height: 1.4; }
.position-warning, .position-ok { padding: 8px 10px; border-radius: 8px; font-size: 9px; font-weight: 750; }
.position-warning { color: #795412; background: #fff5dc; }
.position-ok { color: #226746; background: #e9f6ee; }

.review-fields { display: grid; gap: 13px; }
.review-fields > .review-field > input { padding: 8px 9px; }
.commercial-review-card { border-color: #b8d8d2; }
.commercial-margin-summary { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 4px 10px; padding: 11px 12px; border-radius: 10px; background: #f1f8f6; }
.commercial-margin-summary > span { color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; }
.commercial-margin-summary > strong { font-size: 21px; letter-spacing: -.035em; }
.commercial-margin-summary > em { grid-column: 2; grid-row: 1 / span 2; font-style: normal; }
.discount-result { margin: 0; padding: 9px 10px; border-radius: 8px; color: #72511d; background: #fff8e9; font-size: 9px; line-height: 1.4; }
.review-checks, .change-list, .order-history { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.review-checks li { display: grid; grid-template-columns: 22px 1fr; align-items: center; gap: 8px; padding: 8px 9px; border-radius: 8px; font-size: 9.5px; font-weight: 700; }
.review-checks li > span { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; font-size: 9px; font-weight: 900; }
.check-passed { color: #226746; background: #e9f6ee; }
.check-passed > span { color: #fff; background: #39916c; }
.check-failed { color: #943b42; background: #fff0f1; }
.check-failed > span { color: #fff; background: #bc4b51; }
.check-warning { color: #755313; background: #fff4d8; }
.check-warning > span { color: #fff; background: #b88425; }
.check-info { color: #385b77; background: #eef6fc; }
.check-info > span { color: #fff; background: #5d8cad; }
.manual-checks { display: grid; gap: 7px; }
.manual-checks label { min-height: 37px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.manual-checks input { width: 17px; height: 17px; accent-color: var(--teal); }
.manual-checks span { font-size: 9.5px; line-height: 1.3; }
.attachment-chips { display: grid; gap: 8px; }
.attachment-chips > div { display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: #fafcfb; }
.attachment-chips > div > span { grid-row: span 2; width: 27px; height: 27px; display: grid; place-items: center; border-radius: 7px; color: var(--teal); background: var(--mint); }
.attachment-chips strong { min-width: 0; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attachment-chips small { color: var(--muted); font-size: 8px; }
.change-list { margin-bottom: 12px; }
.change-list li { padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: #fafcfb; }
.change-list span, .change-list strong, .change-list em { display: block; }
.change-list span { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.change-list strong { margin-top: 3px; font-size: 9.5px; }
.change-list em { margin-top: 3px; color: #a45b1d; font-size: 8px; font-style: normal; }
.change-list .change-internal em { color: #2a725b; }
.change-list .no-change { color: var(--muted); font-size: 9.5px; }
.order-history li { position: relative; display: grid; grid-template-columns: 10px 1fr; gap: 8px; }
.order-history li:not(:last-child)::after { content: ""; position: absolute; left: 4px; top: 10px; bottom: -10px; width: 1px; background: #cbded9; }
.order-history li > span { width: 9px; height: 9px; margin-top: 2px; z-index: 1; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 3px var(--mint); }
.order-history strong, .order-history small { display: block; }
.order-history strong { font-size: 9.5px; }
.order-history small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.order-history p { margin: 3px 0 0; color: #526d69; font-size: 8.5px; line-height: 1.35; }
.revision-alert { max-width: 1560px; margin: 16px auto 0; padding: 11px 14px; border: 1px solid #e7bd8f; border-radius: 10px; color: #774818; background: #fff7ed; font-size: 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.revision-alert strong { display: block; margin-bottom: 2px; }
.revision-alert span { display: block; line-height: 1.35; }
.revision-alert.confirmation-confermata { color: #1e654d; border-color: #a9d3c3; background: #eaf7f1; }
.revision-alert.confirmation-rifiutata { color: #8a343c; border-color: #e3adb2; background: #fff0f1; }
.revision-confirmation-actions { display: flex; gap: 7px; flex: 0 0 auto; }
.order-decision-bar { position: sticky; bottom: 12px; z-index: 7; display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; padding: 11px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.96); box-shadow: 0 12px 32px rgba(19,62,57,.16); backdrop-filter: blur(10px); }

.parameter-toolbar { position: sticky; top: 94px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 15px; padding: 13px 15px; border: 1px solid #e4d6be; border-radius: 13px; background: rgba(255,249,239,.96); box-shadow: 0 8px 20px rgba(70,52,24,.06); backdrop-filter: blur(8px); }
.parameter-toolbar p { margin: 0; color: #72541e; font-size: 11px; line-height: 1.4; }
.parameter-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.parameter-groups { display: grid; gap: 16px; }
.parameter-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px 15px; }
.field { min-width: 0; display: grid; gap: 6px; }
.field label { color: #52706b; font-size: 9.5px; line-height: 1.25; font-weight: 850; letter-spacing: .045em; text-transform: uppercase; }
.field-wrap { position: relative; }
.field input { width: 100%; min-height: 42px; padding: 9px 48px 9px 10px; border: 1px solid #c9dad7; border-radius: 9px; color: var(--ink); background: #fff; outline: none; }
.field input:focus { border-color: var(--teal-2); box-shadow: 0 0 0 3px rgba(20,117,110,.1); }
.field-unit { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); color: var(--muted); font-size: 10px; font-weight: 800; pointer-events: none; }
.changed-note { display: none; margin-top: 4px; color: #a05c20; font-size: 9px; }
.field.is-changed .changed-note { display: block; }
.field.is-changed input { border-color: #e4aa77; background: #fffaf5; }
.demo-disclaimer { margin-top: 14px; padding: 12px 15px; border: 1px dashed #b8cfcb; border-radius: 11px; color: var(--muted); background: rgba(255,255,255,.6); font-size: 12px; line-height: 1.5; }
.dealer-setup-warning, .temporary-credential { margin-bottom: 15px; padding: 15px 17px; border-radius: 13px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.dealer-setup-warning { border: 1px solid #e2c28e; color: #76501a; background: #fff8e9; }
.dealer-setup-warning strong, .dealer-setup-warning span { display: block; }
.dealer-setup-warning span { margin-top: 3px; font-size: 11px; line-height: 1.45; }
.temporary-credential { border: 1px solid #8fc9bb; color: #174f44; background: #eaf8f3; box-shadow: 0 10px 28px rgba(22,91,77,.1); }
.temporary-credential > div:first-child { display: grid; gap: 4px; }
.temporary-credential small { font-size: 9px; font-weight: 900; letter-spacing: .07em; }
.temporary-credential strong { font-size: 14px; }
.temporary-credential code { width: fit-content; padding: 7px 9px; border-radius: 7px; color: #fff; background: #174f44; font-size: 13px; user-select: all; }
.temporary-credential span { color: #47746b; font-size: 10px; }
.temporary-credential > div:last-child, .dealer-account-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.dealer-create-card { margin-bottom: 15px; }
.dealer-create-form { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px 15px; }
.dealer-create-form label { min-width: 0; display: grid; gap: 6px; color: #52706b; font-size: 9.5px; font-weight: 850; letter-spacing: .045em; text-transform: uppercase; }
.dealer-create-form input, .dealer-create-form select, .dealer-category-select, .dealer-payment-select, .dealer-discount-input input, .dealer-vat-input { width: 100%; min-height: 41px; padding: 8px 9px; border: 1px solid #c9dad7; border-radius: 9px; color: var(--ink); background: #fff; outline: none; }
.dealer-create-form input:focus, .dealer-create-form select:focus, .dealer-category-select:focus, .dealer-payment-select:focus, .dealer-discount-input input:focus, .dealer-vat-input:focus { border-color: var(--teal-2); box-shadow: 0 0 0 3px rgba(20,117,110,.1); }
.dealer-payment-select { min-width: 210px; max-width: 260px; }
.payment-editor { display: grid; gap: 6px; min-width: 245px; max-width: 100%; }
.payment-editor .dealer-payment-select { min-width: 0; max-width: 100%; }
.payment-editor textarea { width: 100%; min-height: 90px; resize: vertical; padding: 10px; border: 1px solid #c9dad7; border-radius: 9px; color: var(--ink); background: #fff; font: inherit; font-size: 12px; line-height: 1.5; }
.payment-editor textarea:focus { outline: none; border-color: var(--teal-2); box-shadow: 0 0 0 3px rgba(20,117,110,.1); }
.payment-editor-label { font-size: 11px; font-weight: 700; color: #52706b; }
.payment-editor small, .dealer-payment-field > small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.dealer-payment-field { grid-column: 1 / -1; display: grid; gap: 8px; max-width: 740px; }
.dealer-payment-field > strong { color: #52706b; font-size: 11px; }
.dealer-create-form label small { color: var(--muted); font-size: 8.5px; font-weight: 650; letter-spacing: 0; text-transform: none; }
.dealer-create-submit { align-self: end; min-height: 41px; }
.dealer-accounts-table { min-width: 1240px; }
.dealer-category-select { min-width: 105px; }
.dealer-vat-input { min-width: 145px; text-transform: uppercase; }
.dealer-discount-input { position: relative; min-width: 88px; }
.dealer-discount-input input { padding-right: 27px; }
.dealer-discount-input span { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 850; }
.account-status { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; font-size: 9px; font-weight: 900; text-transform: uppercase; }
.account-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.account-status.is-active { color: #247054; background: #e7f5ee; }
.account-status.is-suspended { color: #98414a; background: #fff0f1; }
.dealer-account-actions .button { min-height: 34px; padding: 7px 9px; font-size: 9px; }
.error-card { padding: 30px; border: 1px solid #efcdd0; border-radius: 16px; color: #8b383e; background: #fff8f8; }
.error-card h2 { margin: 0 0 8px; }
.error-card p { margin: 0 0 18px; line-height: 1.5; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 120; max-width: min(380px,calc(100% - 44px)); padding: 12px 15px; border-radius: 11px; color: #fff; background: #173431; box-shadow: 0 12px 32px rgba(0,0,0,.22); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; font-size: 12px; font-weight: 750; }
.toast.show { opacity: 1; transform: translateY(0); }

.production-sheet-button { margin-right: auto; color: var(--teal); border-color: #a8d4cc; background: #eef9f6; }
.order-production-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:8px; }
.order-production-actions .production-sheet-button { margin-right:0; }
.review-field.is-not-applicable input { color: #758985; background: #eef3f2; }
.review-field.is-not-applicable > em { color: var(--muted); }
.production-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.production-toolbar h2 { margin: 0; font-size: 19px; }
.production-toolbar p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.production-toolbar > div:last-child { display: flex; align-items: center; gap: 9px; }
.production-preview { display: grid; justify-items: center; gap: 22px; overflow-x: auto; padding: 2px 0 30px; }
.production-page { --production-border: #cbdad7; position: relative; width: min(210mm,100%); min-height: 297mm; overflow: hidden; padding: 10mm; color: #172f2c; background: #fff; box-shadow: 0 18px 48px rgba(16,53,49,.15); font-family: Arial, Helvetica, sans-serif; font-size: 8pt; }
.production-page > *:not(.production-watermark) { position: relative; z-index: 1; }
.production-watermark { position: absolute; z-index: 0; inset: 47% auto auto 50%; transform: translate(-50%,-50%) rotate(-31deg); color: rgba(177,60,50,.06); font-size: 44pt; font-weight: 900; letter-spacing: .08em; white-space: nowrap; }
.production-page-header { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 5px; color: #fff; background: #0c5e59; }
.production-brand-mark { width: 18mm; height: 13mm; display: grid; place-items: center; border-radius: 4px; background: rgba(255,255,255,.14); }
.production-brand-mark svg { width: 9mm; fill: none; stroke: #fff; stroke-width: 2.2; }
.production-page-header strong, .production-page-header small { display: block; }
.production-page-header > div:nth-child(2) > strong { font-size: 12pt; }
.production-page-header small { margin-top: 2px; color: #d6ebe8; font-size: 6.5pt; }
.production-document-title { padding: 5px 7px; border: 1px solid rgba(255,255,255,.42); border-radius: 4px; text-align: center; }
.production-document-title > strong { font-size: 8pt; letter-spacing: .045em; }
.production-state-strip { min-height: 7mm; display: flex; align-items: center; gap: 12px; margin-top: 5px; padding: 4px 7px; border: 1px solid var(--production-border); color: #49645f; font-size: 6.7pt; }
.production-state-strip > span:first-child { margin-right: auto; }
.production-state-draft, .production-state-final { padding: 3px 6px; border-radius: 3px; font-weight: 900; letter-spacing: .045em; }
.production-state-draft { color: #983f3d; background: #ffebea; }
.production-state-final { color: #1d684d; background: #e4f4ec; }
.production-meta { width: 100%; margin-top: 5px; border-collapse: collapse; table-layout: fixed; }
.production-meta th, .production-meta td { padding: 3px 5px; border-bottom: 1px solid var(--production-border); text-align: left; }
.production-meta th { width: 15%; color: #0c5e59; font-size: 6.3pt; text-transform: uppercase; }
.production-meta td { width: 35%; font-size: 7.5pt; font-weight: 700; }
.production-position-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 6px; padding: 6px 8px; border-left: 4px solid #e89757; background: #fff2e7; font-size: 11pt; }
.production-position-title span { font-size: 8pt; }
.production-main-grid { display: grid; grid-template-columns: 41% 59%; margin-top: 5px; border: 1px solid var(--production-border); }
.production-drawing-panel { min-width: 0; display: grid; align-content: center; justify-items: center; padding: 5px; border-right: 1px solid var(--production-border); text-align: center; }
.production-drawing-panel > span { color: #5b7470; font-size: 6.2pt; font-weight: 800; letter-spacing: .045em; }
.production-drawing-panel > small { color: #415d58; font-size: 7.2pt; font-weight: 800; }
.production-shutter { width: 59mm; height: 52mm; max-width: 100%; }
.production-shutter-body { stroke: #223f3b; stroke-width: 1.4; }
.production-joints line { stroke: #223f3b; stroke-width: 1.1; }
.production-cremone-mark line, .production-cremone-mark circle { fill: #fff; stroke: #8f3f25; stroke-width: 1.5; }
.production-dimensions line { stroke: #435e59; stroke-width: .75; }
.production-dimensions path { fill: #435e59; }
.production-dimensions text { fill: #344d49; font-size: 6px; font-weight: 800; }
.production-spec-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.production-spec-grid > div { min-width: 0; padding: 4px 6px; border-right: 1px solid var(--production-border); border-bottom: 1px solid var(--production-border); }
.production-spec-grid > div:nth-child(2n) { border-right: 0; }
.production-spec-grid > div:nth-last-child(-n+2) { border-bottom: 0; }
.production-spec-grid small, .production-spec-grid strong, .production-spec-grid em { display: block; }
.production-spec-grid small { color: #5e7772; font-size: 5.7pt; font-weight: 800; text-transform: uppercase; }
.production-spec-grid strong { margin-top: 2px; font-size: 7.1pt; line-height: 1.2; overflow-wrap: anywhere; }
.production-spec-grid em { margin-top: 2px; color: #4b716a; font-size: 5.8pt; font-style: normal; }
.production-spec-grid .emphasis { background: #eff8f5; }
.production-spec-grid .cremone-spec { background: #fff7df; }
.production-spec-grid .cremone-spec.is-custom { background: #ffe9d9; outline: 1px solid #e7a674; outline-offset: -1px; }
.production-lower-grid { display: grid; grid-template-columns: 44% 56%; margin-top: 5px; border: 1px solid var(--production-border); }
.production-lower-grid > section { min-width: 0; padding: 5px 6px; }
.production-lower-grid > section:first-child { border-right: 1px solid var(--production-border); }
.production-lower-grid h3 { margin: 0 0 4px; color: #0c5e59; font-size: 6.5pt; letter-spacing: .04em; text-transform: uppercase; }
.production-pieces { width: 100%; border-collapse: collapse; table-layout: fixed; }
.production-pieces th, .production-pieces td { padding: 2.5px 4px; border: 1px solid #d7e1df; text-align: left; font-size: 6.2pt; }
.production-pieces th { color: #4e6964; background: #edf5f3; text-transform: uppercase; }
.production-pieces th:first-child { width: 15%; }
.production-pieces th:nth-child(4), .production-pieces th:last-child { width: 10%; text-align: center; }
.production-pieces td:nth-child(4), .production-pieces td:last-child { text-align: center; }
.production-notes { display: grid; align-content: start; gap: 3px; }
.production-notes > div { padding: 4px 5px; border-radius: 3px; }
.production-notes .dealer { background: #eef6fc; }
.production-notes .internal { background: #fff5d9; }
.production-notes .automatic { background: #edf7f2; }
.production-notes strong { display: block; font-size: 5.8pt; text-transform: uppercase; }
.production-notes p { margin: 2px 0 0; font-size: 6.3pt; line-height: 1.25; }
.production-general-note { margin-top: 5px; padding: 5px 7px; border: 1px solid #ead6a1; background: #fffaf0; font-size: 6.3pt; line-height: 1.35; }
.production-review-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); margin-top: 5px; border: 1px solid var(--production-border); }
.production-review-row > div { min-width: 0; padding: 5px 7px; }
.production-review-row > div:first-child { border-right: 1px solid var(--production-border); }
.production-review-row strong, .production-review-row span { display: block; }
.production-review-row strong { margin-bottom: 3px; color: #0c5e59; font-size: 6pt; text-transform: uppercase; }
.production-review-row span { font-size: 5.8pt; line-height: 1.35; overflow-wrap: anywhere; }
.production-standard-rule { margin-top: 4px; color: #5b706d; font-size: 5.5pt; line-height: 1.3; }
.production-page-footer { position: absolute !important; inset: auto 10mm 8mm; display: flex; justify-content: space-between; padding-top: 3px; border-top: 1px solid var(--production-border); color: #657b77; font-size: 6pt; }
.production-labels-preview { width: min(210mm,100%); margin: 0 auto; padding: 8mm; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4mm; background: #fff; box-shadow: 0 18px 48px rgba(16,53,49,.15); }
.production-label { min-width: 0; min-height: 62mm; padding: 4mm; border: .45mm solid #173c38; border-radius: 2mm; background: #fff; break-inside: avoid; page-break-inside: avoid; font-family: Arial, Helvetica, sans-serif; }
.production-label header { display: flex; align-items: flex-start; justify-content: space-between; gap: 3mm; padding-bottom: 2.2mm; border-bottom: .3mm solid #bfcfcb; }
.production-label header strong, .production-label header small { display: block; }
.production-label header strong { color: #0c5e59; font-size: 9pt; }
.production-label header small { margin-top: 1mm; color: #4f6b66; font-size: 6.5pt; }
.production-label header > span { flex: 0 0 auto; padding: 1.5mm 2mm; border-radius: 1mm; color: #fff; background: #0c5e59; font-size: 7pt; font-weight: 850; }
.production-label-body { display: grid; grid-template-columns: 27mm minmax(0,1fr); align-items: center; gap: 3mm; padding-top: 3mm; }
.production-label-qr svg { display: block; width: 27mm; height: 27mm; }
.qr-fallback { width: 27mm; height: 27mm; display: grid; place-items: center; border: 1px solid #173c38; font-weight: 900; }
.production-label-data { min-width: 0; }
.production-label-data h3 { margin: 0 0 1.5mm; font-size: 11pt; }
.production-label-data strong, .production-label-data span { display: block; overflow-wrap: anywhere; }
.production-label-data strong { margin-bottom: 1.5mm; font-size: 9pt; }
.production-label-data span { margin-top: .8mm; color: #385651; font-size: 6.5pt; line-height: 1.25; }

@media (max-width: 1120px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .parameter-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dealer-create-form { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .order-review-grid { grid-template-columns: 1fr; }
  .review-sidebar { position: static; }
  .order-overview-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .order-overview-grid > div:nth-child(2) { border-right: 0; }
  .order-overview-grid > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 760px) {
  .sidebar { position: sticky; inset: 0 0 auto; width: 100%; height: auto; padding: 10px 12px 8px; }
  .sidebar .brand, .security-card, .account-card { display: none; }
  .main-nav { display: flex; gap: 5px; overflow-x: auto; padding-bottom: 2px; }
  .nav-group { display: contents; }
  .nav-group-title { min-width: max-content; align-self: center; padding: 0 5px; }
  .nav-item { min-width: max-content; min-height: 44px; padding: 10px 12px; font-size: 12px; }
  .app-shell { margin-left: 0; }
  .topbar { min-height: 78px; position: static; padding: 13px 15px; align-items: flex-start; }
  .topbar h1 { font-size: 19px; }
  .top-actions { gap: 6px; }
  .protected-badge { display: none; }
  .button { min-height: 44px; }
  #app { padding: 18px 14px 42px; }
  .page-intro { display: block; }
  .page-intro .version-pill, .page-intro .demo-pill { margin-top: 10px; }
  .parameter-toolbar { top: 0; display: block; }
  .parameter-actions { margin-top: 10px; }
  .parameter-actions .button { flex: 1; }
  .cost-bar-row { grid-template-columns: 105px minmax(65px,1fr) 80px; }
  .order-position-body { grid-template-columns: 1fr; }
  .position-visual { grid-template-columns: auto 1fr; align-items: center; justify-content: start; }
  .position-edit-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .temporary-credential, .dealer-setup-warning { align-items: stretch; flex-direction: column; }
  .order-decision-bar { bottom: 6px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .revision-alert { align-items: stretch; flex-direction: column; }
  .revision-confirmation-actions { flex-wrap: wrap; }
  .production-sheet-button { margin-right: 0; }
  .production-toolbar { display: block; }
  .production-toolbar > div:last-child { margin-top: 11px; justify-content: space-between; }
}

@media (max-width: 500px) {
  .login-screen { padding: 14px; }
  .login-panel { padding: 24px 20px; border-radius: 21px; }
  .brand-mark { width: 48px; height: 48px; }
  .login-copy { padding: 23px 0 17px; }
  .login-copy h1 { font-size: 31px; }
  .password-row { grid-template-columns: 1fr; }
  .password-row > input { min-height: 50px; }
  .topbar { display: block; }
  .top-actions { margin-top: 10px; justify-content: flex-start; }
  .top-actions .button { width: 100%; }
  .kpi-grid { gap: 9px; }
  .kpi-card { padding: 14px 12px; }
  .kpi-card strong { font-size: 17px; }
  .kpi-card em { display: none; }
  .parameter-grid { grid-template-columns: 1fr; }
  .dealer-create-form { grid-template-columns: 1fr; }
  .quote-summary { grid-template-columns: 1fr; }
  .quote-summary div, .quote-summary div:nth-child(2n), .quote-summary div:nth-last-child(-n+2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .quote-summary div:last-child { border-bottom: 0; }
  .card-header { padding: 16px; }
  .card-body { padding: 0 16px 16px; }
  .parameter-actions { display: grid; grid-template-columns: 1fr; }
  .order-position-head { grid-template-columns: auto minmax(0,1fr); }
  .position-economics { grid-column: 2; text-align: left; }
  .positions-review-list { padding: 0 10px 10px; }
  .order-overview-grid { grid-template-columns: 1fr; }
  .order-overview-grid > div, .order-overview-grid > div:nth-child(2), .order-overview-grid > div:nth-child(-n+2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .order-overview-grid > div:last-child { border-bottom: 0; }
  .order-decision-bar { grid-template-columns: 1fr 1fr; }
  .order-decision-bar .button { min-width: 0; padding-inline: 7px; font-size: 10px; }
  .production-toolbar > div:last-child { display: grid; grid-template-columns: 1fr; }
  .production-labels-preview { grid-template-columns: 1fr; padding: 4mm; }
}

@media print {
  @page { size: A4 portrait; margin: 0; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  html, body { width: 210mm; margin: 0 !important; background: #fff !important; }
  .sidebar, .topbar, .production-toolbar, .toast { display: none !important; }
  .app-shell { width: 210mm; min-height: 0; margin: 0 !important; }
  #app { width: 210mm; max-width: none; margin: 0; padding: 0; }
  .production-preview { display: block; overflow: visible; padding: 0; }
  .production-page { width: 210mm; height: 297mm; min-height: 297mm; margin: 0; padding: 10mm; overflow: hidden; box-shadow: none; break-after: page; page-break-after: always; }
  .production-page:last-child { break-after: auto; page-break-after: auto; }
  .production-labels-preview { width: 210mm; margin: 0; padding: 8mm; grid-template-columns: repeat(2,95mm); gap: 4mm; box-shadow: none; }
  .production-label { width: 95mm; height: 62mm; min-height: 62mm; overflow: hidden; }
}
/* Client management, activity and weekly planning */
.management-grid { display:grid; grid-template-columns:minmax(0,1.5fr) minmax(0,1fr); gap:20px; margin:20px 0; align-items:start; }
.management-grid .dealer-create-form { grid-template-columns:repeat(2,minmax(0,1fr)); }
.management-form { display:grid; gap:14px; }
.management-form label { display:grid; gap:7px; font-size:13px; font-weight:650; }
.management-form input,.management-form textarea,.review-field select { width:100%; box-sizing:border-box; padding:11px; border:1px solid #c9d9d7; border-radius:9px; font:inherit; color:#123d39; background:white; }
.management-form textarea { resize:vertical; }
.management-form small,.operations-sync { color:#526e6b; font-size:12px; line-height:1.6; }
.form-feedback { margin:0; font-size:13px; }
.invitation-notice { border:1px solid #a2c8c1; border-radius:12px; padding:16px 20px; background:#edf7f4; color:#104b42; line-height:1.6; }
.client-link { padding:0; border:0; background:transparent; color:#075c52; text-decoration:underline; text-underline-offset:3px; font:inherit; font-weight:700; cursor:pointer; text-align:left; }
.operation-actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.notification-count { min-width:23px; padding:3px 6px; border-radius:20px; background:#daf0e9; color:#064b41; font-size:11px; margin-left:auto; text-align:center; }
.notification-list { display:grid; gap:12px; }
.notification-item { border:1px solid #d6e3df; border-radius:12px; padding:18px; display:flex; justify-content:space-between; gap:20px; align-items:center; }
.notification-item.is-unread { border-left:4px solid #0c7464; background:#f0f8f5; }
.notification-item h3 { font-size:15px; margin:6px 0; }
.notification-item p { margin:0; font-size:13px; }
.notification-item small { color:#59746e; }
.calendar-toolbar { display:flex; justify-content:center; flex-wrap:wrap; gap:10px; margin:22px 0; }
.calendar-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:9px; }
.calendar-day { min-width:0; min-height:210px; border:1px solid #d8e4df; border-radius:12px; background:#fff; padding:9px; }
.calendar-day.is-today { border:2px solid #087263; padding:8px; }
.calendar-day h3 { margin:3px 0 15px; font-size:12px; text-transform:capitalize; }
.calendar-event { display:grid; gap:7px; padding:10px; margin-bottom:10px; border-radius:9px; background:#edf5f2; font-size:12px; overflow-wrap:anywhere; }
.calendar-event.delivery { background:#f7f1e3; }
.calendar-event .button { padding:8px 5px; font-size:11px; white-space:normal; }
.calendar-event small { font-size:10px; line-height:1.5; }
.calendar-empty { color:#627770; font-size:11px; }
.late-label { color:#9d3225; }
.compact-order { display:flex; gap:14px; align-items:center; padding:12px 0; border-bottom:1px solid #e3ebe7; font-size:13px; }
.compact-order:last-child { border-bottom:0; }
.receipt-summary { display:grid; gap:9px; margin:0; }
.receipt-summary div { display:flex; justify-content:space-between; gap:12px; }
.receipt-summary dt { font-size:13px; }
.receipt-summary dd { margin:0; font-weight:700; }
@media (max-width:1200px) { .calendar-grid { grid-template-columns:repeat(4,minmax(0,1fr)); } .management-grid { grid-template-columns:1fr; } }
@media (max-width:700px) { .calendar-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .notification-item { align-items:flex-start; flex-direction:column; } .management-grid .dealer-create-form { grid-template-columns:1fr; } }
@media (max-width:400px) { .calendar-grid { grid-template-columns:1fr; } }
.hardware-table { border-collapse:collapse; width:100%; font-size:12px; }
.hardware-table th,.hardware-table td { padding:10px; text-align:left; border-bottom:1px solid #cdd9d3; vertical-align:top; }
.hardware-table th { background:#eaf2ee; }
.cumulative-hardware { height:auto; min-height:297mm; }
.cumulative-hardware .table-wrap { overflow:visible; }
@media print { .cumulative-hardware { height:auto; overflow:visible; } .cumulative-hardware thead { display:table-header-group; } .cumulative-hardware tr { break-inside:avoid; } }

.position-edit-grid .review-field select { min-height:39px; padding:8px 9px; border-radius:8px; }
.position-edit-grid .review-field.is-revised select { border-color:#e4aa77; background:#fff9f2; }

/* Larger production data; flow naturally onto continuation pages instead of clipping. */
.production-page { font-size:10pt; overflow:visible; }
.production-spec-grid small { font-size:7.5pt; }
.production-spec-grid strong { font-size:10pt; line-height:1.25; }
.production-spec-grid .emphasis { grid-column:1 / -1; }
.production-spec-grid .emphasis strong { font-size:14pt; }
.production-spec-grid em { font-size:7.5pt; }
.production-pieces th, .production-pieces td { font-size:8pt; padding:4px; }
.production-notes p, .production-general-note { font-size:9pt; }
.production-page-footer { position:static !important; margin-top:8mm; }
@media print {
  .production-page { height:auto; overflow:visible; }
  .production-main-grid, .production-spec-grid > div, .production-pieces tr, .production-notes > div { break-inside:avoid; }
}

/* Unified price editor and archive controls. */
.cass-admin-family-tabs { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 20px; }
.cass-admin-prices fieldset { min-width:0; padding:0; border:0; margin:0; }
.cass-admin-prices .field { display:grid; gap:7px; min-width:0; }
.cass-admin-prices input:not([type="checkbox"]), .cass-admin-prices select { width:100%; min-height:42px; padding:9px 11px; border:1px solid var(--line); border-radius:9px; color:var(--ink); background:#fff; font:inherit; }
.cass-admin-prices .data-table input { min-width:140px; }
.cass-admin-prices .data-table { margin:18px 0; min-width:600px; table-layout:fixed; }
.cass-admin-prices .data-table th, .cass-admin-prices .data-table td { position:static; white-space:normal; text-align:left; }
.cass-admin-prices .data-table th:first-child { width:48%; }
.cass-admin-prices .data-table th:not(:first-child) { width:26%; }
.cass-admin-prices .card-body > p, .cass-admin-prices fieldset > p { color:var(--muted); font-size:13px; line-height:1.55; }
.cass-admin-check { display:flex; align-items:flex-start; gap:9px; margin:18px 0; font-size:13px; }
.cass-admin-check input { flex:0 0 auto; margin-top:2px; }
.cass-admin-product-filter { display:flex; align-items:center; gap:8px; font-size:12px; font-weight:700; }
.cass-admin-product-filter select { min-height:40px; padding:8px 11px; border:1px solid var(--line); border-radius:9px; color:var(--ink); background:#fff; font:inherit; }
.cass-admin-archive-status { color:var(--muted); font-size:12px; }
.cass-admin-error { color:var(--red); font-size:13px; }
@media (max-width:700px) { .cass-admin-prices .parameter-toolbar { flex-wrap:wrap; } .cass-admin-product-filter { align-self:flex-start; } }

/* Dealer terms remain distinct for each product family. */
.dealer-shutter-conditions { min-width:145px; }
.dealer-shutter-conditions label { display:grid;gap:5px;font-size:11px;font-weight:700;margin:0 0 9px; }
.dealer-cass-conditions { min-width:215px;max-width:260px; }
.dealer-cass-terms { display:grid;gap:7px;padding:12px;background:#eef7f3;border:1px solid #c9e3d7;border-radius:9px;white-space:normal; }
.dealer-cass-terms>strong { color:#155a49;font-size:12px; }
.dealer-cass-terms>small { display:block;line-height:1.4; }
.dealer-cass-margin { font-size:12px; }
.dealer-cass-margin b { font-size:16px;color:#155a49; }
.dealer-cass-terms .button { white-space:normal;font-size:10px;min-height:32px;padding:7px 9px; }
.dealer-create-cass { min-width:0;display:grid;align-content:start;gap:7px;font-size:11px; }
.dealer-margin-summary { display:flex;flex-wrap:wrap;gap:14px;margin-bottom:14px; }
.dealer-margin-summary>div { display:grid;gap:4px;min-width:220px;padding:14px 18px;border-radius:9px;background:#eef7f3;border:1px solid #c9e3d7; }
.dealer-margin-summary strong { font-size:27px;color:#155a49; }
.dealer-margin-summary small { color:#52706b; }



/* Commesse / approvvigionamenti — digital job-folder checklist. */
.commesse-table td small, .commesse-table td strong { display:block; }
.commesse-table td small { margin-top:4px; color:var(--muted); font-size:10px; }
.commessa-detail-head { align-items:center; }
.commessa-detail-head .mini-button { margin-bottom:11px; }
.commessa-head-status { min-width:160px; display:grid; justify-items:end; gap:5px; text-align:right; }
.commessa-head-status strong { font-size:24px; letter-spacing:-.04em; }
.commessa-head-status small { color:var(--muted); font-size:10px; }
.commessa-source-card { margin-bottom:18px; }
.commessa-source-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; padding-top:18px; }
.commessa-source-grid > div { min-width:0; padding:13px; border:1px solid var(--line); border-radius:11px; background:var(--soft); }
.commessa-source-grid small, .commessa-source-grid strong { display:block; }
.commessa-source-grid small { color:var(--muted); font-size:9px; font-weight:850; letter-spacing:.05em; text-transform:uppercase; }
.commessa-source-grid strong { margin-top:5px; font-size:12px; overflow-wrap:anywhere; }
.procurement-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:13px; align-items:start; }
.procurement-supply { min-width:0; border:1px solid var(--line); border-radius:14px; background:#fff; overflow:hidden; }
.procurement-supply.is-active { border-color:#afd1ca; box-shadow:0 7px 19px rgba(12,94,89,.07); }
.procurement-supply-head { min-height:66px; display:flex; align-items:center; gap:9px; padding:12px 13px; background:var(--soft); }
.procurement-supply.is-active .procurement-supply-head { background:#eef8f5; }
.procurement-toggle { min-width:0; flex:1; display:flex; align-items:center; gap:10px; cursor:pointer; }
.procurement-toggle input { width:18px; height:18px; flex:0 0 auto; accent-color:var(--teal); }
.procurement-toggle span, .procurement-toggle strong, .procurement-toggle small { min-width:0; display:block; }
.procurement-toggle strong { font-size:13px; }
.procurement-toggle small { margin-top:3px; color:var(--muted); font-size:10px; }
.procurement-supply-body { display:grid; gap:12px; padding:13px; }
.procurement-orders { display:grid; gap:11px; }
.procurement-order { border:1px solid var(--line); border-radius:11px; background:#fbfdfc; overflow:hidden; }
.procurement-order-head { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 11px; border-bottom:1px solid var(--line); }
.procurement-order-head strong { min-width:0; font-size:12px; overflow-wrap:anywhere; }
.procurement-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; padding:11px; }
.procurement-fields label, .procurement-supply-note { display:grid; gap:5px; min-width:0; color:#52706b; font-size:9.5px; font-weight:800; }
.procurement-fields .span-2 { grid-column:1 / -1; }
.procurement-fields input, .procurement-fields select, .procurement-fields textarea,
.procurement-supply-note textarea, [data-commessa-notes], #commessa-custom-label {
  width:100%; min-width:0; padding:9px 10px; border:1px solid var(--line); border-radius:9px; color:var(--ink); background:#fff; font:inherit;
}
.procurement-fields input, .procurement-fields select, #commessa-custom-label { min-height:39px; }
.procurement-fields textarea, .procurement-supply-note textarea, [data-commessa-notes] { resize:vertical; line-height:1.45; }
.procurement-fields input:focus, .procurement-fields select:focus, .procurement-fields textarea:focus,
.procurement-supply-note textarea:focus, [data-commessa-notes]:focus, #commessa-custom-label:focus {
  outline:none; border-color:var(--teal-2); box-shadow:0 0 0 3px rgba(20,117,110,.09);
}
.procurement-fields select:disabled { opacity:.65; background:#edf3f1; }
.procurement-link-note { margin:0 11px 11px; padding:9px 10px; border-radius:8px; color:#496a64; background:#eef7f3; font-size:10.5px; line-height:1.45; }
.procurement-supply-actions { display:flex; flex-wrap:wrap; gap:8px; }
.procurement-supply-note { border-top:1px solid var(--line); padding-top:10px; }
.empty-inline { margin:0; color:var(--muted); font-size:11px; }
.inactive-supplies { margin-top:16px; border-top:1px solid var(--line); padding-top:14px; }
.inactive-supplies > summary { display:flex; align-items:center; width:max-content; max-width:100%; min-height:40px; padding:8px 13px; border:1px solid var(--line); border-radius:10px; color:var(--teal); background:#fff; font-size:12px; font-weight:800; cursor:pointer; list-style:none; }
.inactive-supplies > summary::-webkit-details-marker { display:none; }
.inactive-supplies[open] > summary { margin-bottom:13px; background:var(--soft); }
.custom-supply-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:9px; margin-top:16px; padding-top:16px; border-top:1px solid var(--line); }
.commessa-save-bar { position:sticky; bottom:12px; z-index:6; display:flex; align-items:center; justify-content:flex-end; gap:13px; margin-top:18px; padding:11px 13px; border:1px solid #bcd9d3; border-radius:13px; background:rgba(255,255,255,.96); box-shadow:0 12px 30px rgba(27,72,67,.14); backdrop-filter:blur(10px); }
.commessa-save-bar .save-status { color:var(--muted); font-size:11px; }
.status-configure, .status-to-order { color:#765321; background:#fff3d6; }
.status-in-progress, .status-ordered, .status-confirmed, .status-in-production { color:#245a70; background:#e7f3f8; }
.status-partial { color:#80521f; background:#fff0df; }
.status-ready, .status-arrived { color:#166044; background:#dff2ec; }
.status-problem { color:#9a3e45; background:#fff0f1; }
@media (max-width:1100px) {
  .procurement-grid { grid-template-columns:1fr; }
  .commessa-source-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:700px) {
  .commessa-detail-head { align-items:flex-start; flex-direction:column; }
  .commessa-head-status { justify-items:start; text-align:left; }
  .commessa-source-grid, .procurement-fields { grid-template-columns:1fr; }
  .procurement-fields .span-2 { grid-column:auto; }
  .procurement-supply-head { align-items:flex-start; flex-wrap:wrap; }
  .custom-supply-row { grid-template-columns:1fr; }
  .commessa-save-bar { bottom:8px; justify-content:space-between; }
}
