@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/plus-jakarta-sans-400.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/plus-jakarta-sans-500.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/plus-jakarta-sans-600.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/plus-jakarta-sans-700.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 800; font-display: swap; src: url("/assets/fonts/plus-jakarta-sans-800.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --brand: #111827;
  --brand-mid: #374151;
  --brand-hover: #030712;
  --accent: #111827;
  --accent-dark: #030712;
  --accent-bg: #f3f4f6;
  --canvas: oklch(.965 .004 140);
  --surface: oklch(.99 .004 140);
  --surface-soft: oklch(1 0 0);
  --surface-muted: oklch(.965 .006 145);
  --ink: oklch(.24 .015 220);
  --text-secondary: oklch(.39 .012 220);
  --muted: oklch(.55 .01 220);
  --faint: oklch(.72 .008 220);
  --line: oklch(.9 .006 145);
  --line-strong: oklch(.84 .008 145);
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #15803d;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body {
  min-width: 320px;
  margin: 0;
  background: var(--canvas);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled, input:disabled, select:disabled { cursor: not-allowed; opacity: .55; }
a { color: var(--brand-mid); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.workspace-canvas { min-height: 100vh; }
.app-shell { min-height: 100vh; }
.app-sidebar {
  position: fixed; inset: 12px auto 12px 12px; z-index: 10;
  display: flex; width: 240px; flex-direction: column;
  overflow: hidden; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); box-shadow: 0 2px 12px rgb(0 0 0 / .05);
  transition: width 200ms ease;
}
.app-brand {
  display: flex; align-items: center; gap: 10px; padding: 16px 16px 18px;
  color: var(--ink); font-size: 16px; font-weight: 700; letter-spacing: -.025em; text-decoration: none; white-space: nowrap;
}
.app-mark {
  display: grid; width: 32px; height: 32px; place-items: center; border-radius: 8px;
  background: var(--accent); color: var(--surface); font-family: Georgia, serif; font-size: 18px; font-weight: 700;
}
.app-nav { display: grid; gap: 2px; padding: 0 12px 12px; }
.nav-label { margin: 0 10px 8px; color: var(--faint); font-size: 12px; font-weight: 500; letter-spacing: 0; }
.app-nav a {
  display: flex; min-height: 36px; align-items: center; gap: 10px; border-radius: 8px; padding: 8px 10px;
  color: var(--muted); font-size: 16px; font-weight: 400; text-decoration: none; transition: background-color 150ms ease, color 150ms ease; white-space: nowrap;
}
.nav-glyph { display: grid; width: 17px; place-items: center; color: var(--faint); font-size: 16px; line-height: 1; }
.app-nav a:hover { background: var(--surface-muted); color: var(--ink); }
.app-nav a.is-active { background: var(--brand); color: var(--surface); font-weight: 600; }
.app-nav a.is-active .nav-glyph { color: var(--surface); }
.logout-form { margin-top: auto; padding: 12px; }
.button, button, .action-link {
  display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--brand); border-radius: 8px; padding: 8px 14px;
  background: var(--brand); color: #fff; font-size: 14px; font-weight: 700; line-height: 1.25; text-decoration: none;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
.button:hover, button:hover, .primary-action:hover { border-color: var(--brand-hover); background: var(--brand-hover); }
.secondary-button { width: 100%; border-color: transparent; background: transparent; color: var(--muted); justify-content: flex-start; }
.secondary-button:hover { border-color: transparent; background: var(--surface-muted); color: var(--ink); }

.workspace-main { display: flex; min-width: 0; min-height: 100vh; flex: 1; flex-direction: column; margin-left: 264px; transition: margin-left 200ms ease; }
.workspace-header {
  display: flex; min-height: 64px; align-items: center; justify-content: space-between; gap: 16px;
  z-index: 20; border-bottom: 1px solid var(--line); padding: 12px 24px; background: transparent;
}
.desktop-page-header { display: flex; min-width: 0; align-items: center; gap: 12px; }
.sidebar-toggle { display: grid; width: 36px; height: 36px; place-items: center; border: 0; border-radius: 10px; padding: 0; background: transparent; color: var(--muted); }
.sidebar-toggle:hover { background: var(--surface-muted); color: var(--ink); }
.sidebar-toggle svg { display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.75; }
.toggle-expand { display: none; }
.header-divider { width: 1px; height: 20px; background: var(--line); }
.page-header-title { display: flex; min-width: 0; align-items: center; gap: 8px; color: var(--ink); font-size: 16px; font-weight: 600; }
.page-header-title > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-header-icon { display: grid; width: 16px; height: 16px; place-items: center; color: var(--muted); }
.page-header-icon svg { display: block; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.75; }
.profile-chip { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 4px; border-radius: 10px; }
.profile-avatar { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 10px; background: var(--accent); color: var(--surface); font-size: 12px; font-weight: 800; }
.profile-copy { display: grid; gap: 1px; line-height: 1.15; }
.profile-copy strong { color: var(--text-secondary); font-size: 11px; font-weight: 700; }
.profile-copy small { color: var(--faint); font-size: 10px; font-weight: 600; }
.profile-chevron { color: var(--faint); font-size: 15px; }
.app-content { min-width: 0; flex: 1; padding: 0; }
.page-surface { width: 100%; max-width: none; min-height: 100%; margin: 0; padding: 12px 24px 32px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
.page-heading { margin-bottom: 7px; }
.page-heading h1, .page-surface > h2 { margin: 0; color: var(--ink); font-size: 22px; font-weight: 800; letter-spacing: -.025em; line-height: 1.15; }
.eyebrow { margin: 0 0 7px; color: var(--faint); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.page-intro { max-width: 65ch; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.page-surface > h3 { margin: 28px 0 10px; color: var(--ink); font-size: 16px; font-weight: 700; letter-spacing: -.01em; }

form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
input, select, .Select-control {
  min-height: 40px; max-width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px;
  background: var(--surface-soft); color: var(--ink); font-size: 16px; outline: 0;
}
input::placeholder { color: var(--faint); }
input:hover, select:hover { border-color: var(--line-strong); }
input:focus, select:focus { border-color: #9ca3af; }
input[aria-invalid="true"] { border-color: #fca5a5; background: #fef2f2; }
form input[type="file"] { padding: 8px; }
.inline-form, .page-surface > form { margin-top: 12px; padding: 16px; border-radius: 12px; background: var(--surface); box-shadow: 0 2px 12px rgb(0 0 0 / .06); }
.inline-form input { flex: 1 1 220px; }
.home-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.action-link { border-color: var(--line); background: var(--surface); color: var(--text-secondary); }
.action-link:hover { border-color: var(--line-strong); background: var(--surface-soft); }
.primary-action { border-color: var(--accent); background: var(--accent); color: var(--surface); }
.primary-action:hover { border-color: var(--accent-dark); background: var(--accent-dark); color: var(--surface); }
.empty-state { max-width: 640px; margin-top: 12px; padding: 24px; border-radius: 12px; background: var(--surface); box-shadow: 0 2px 12px rgb(0 0 0 / .06); color: var(--muted); }
.empty-state h2 { margin: 0 0 6px; color: var(--ink); font-size: 16px; }
.empty-state p { margin: 0 0 14px; line-height: 1.5; }
.empty-state p:last-child { margin-bottom: 0; }
.status-row { display: grid; grid-template-columns: minmax(180px, 1.3fr) minmax(130px, .9fr) minmax(150px, 1fr) auto; align-items: center; gap: 12px; margin-top: 8px; padding: 16px; border-radius: 12px; background: var(--surface); box-shadow: 0 2px 12px rgb(0 0 0 / .06); color: var(--muted); font-size: 13px; }
.status-row strong { color: var(--ink); font-size: 14px; }
.status-row a { font-size: 12px; font-weight: 700; }
.status-row form { grid-column: 1 / -1; align-items: center; padding-top: 8px; border-top: 1px solid var(--line); }
.status-row form button { min-height: 34px; }
.projects-workspace { padding-top: 4px; }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.project-filters { display: flex; flex: 1; align-items: center; gap: 8px; }
.search-field { display: flex; width: min(380px, 100%); align-items: center; gap: 8px; min-height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; background: var(--surface-soft); color: var(--faint); }
.search-field:focus-within { border-color: var(--line); }
.search-field input { min-width: 0; width: 100%; min-height: 38px; border: 0; padding: 0; background: transparent; }
.search-field input:focus { border-color: transparent; }
.search-field input:focus-visible { outline: 0; }
.project-filters select { width: 176px; }
.filter-submit { display: none; }
.clear-filters { padding: 8px 4px; color: var(--muted); font-size: 12px; font-weight: 700; text-decoration: none; }
.clear-filters:hover { color: var(--brand); }
.quick-actions { display: flex; flex: 0 0 auto; gap: 8px; }
.prezzari-workspace { padding-top: 4px; }
.prezzari-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.prezzari-search { display: flex; flex: 1; align-items: center; gap: 8px; }
.prezzari-actions { display: flex; flex: 0 0 auto; gap: 8px; }
.prezzari-search .search-field { width: min(420px, 100%); }
.search-field svg, .toolbar-icon-button svg, .toolbar-action-button svg { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.prezzari-search select { width: 220px; }
.toolbar-icon-button { display: grid; width: 40px; min-height: 40px; place-items: center; border-color: var(--line); border-radius: 8px; padding: 0; background: var(--surface); color: var(--text-secondary); }
.toolbar-icon-button:hover { border-color: var(--line-strong); background: var(--surface-muted); color: var(--brand); }
.toolbar-action-button { display: inline-flex; min-height: 40px; align-items: center; gap: 8px; border-color: var(--brand); border-radius: 8px; padding: 8px 14px; background: var(--brand); color: var(--surface); }
.toolbar-action-button:hover { border-color: var(--brand-hover); background: var(--brand-hover); }
.toolbar-secondary-action { border-color: var(--line-strong); background: var(--surface); color: var(--text-secondary); text-decoration: none; }
.toolbar-secondary-action:hover { border-color: var(--line-strong); background: var(--surface-muted); color: var(--brand); }
.prezzari-list { margin-top: 0; }
.prezzario-unresolved, .prezzario-macrovoci { margin: 0 0 18px; }
.prezzario-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 15px 18px 13px; border-bottom: 1px solid var(--line); background: var(--surface); }
.prezzario-section-heading h2 { margin: 0; color: var(--ink); font-size: 15px; font-weight: 700; }
.prezzario-section-heading p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.prezzario-section-heading > span { display: grid; min-width: 25px; height: 25px; place-items: center; border-radius: 999px; background: #fffbeb; color: #9a6700; font-size: 12px; font-weight: 700; }
.prezzario-section-heading-actions { display: flex; flex: none; align-items: center; gap: 8px; }
.fixed-label-table { table-layout: fixed; }
.fixed-label-table th { width: 260px; }
.principale-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.parametri-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 16px 18px 4px; }
.parametri-column h3 { margin: 0 0 10px; color: var(--ink); font-size: 13px; font-weight: 700; }
.parametri-column .data-table { width: 100%; table-layout: fixed; }
.parametri-column .data-table th { width: 58%; }
.viewer-login-link { display: flex; align-items: center; gap: 8px; padding: 16px 18px; }
.viewer-login-link input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--surface-muted); color: var(--muted); font-size: 13px; }
.inline-field { width: 100%; border: none; border-radius: 6px; background: transparent; padding: 2px 0; color: var(--ink); font: inherit; }
.inline-field:not([readonly]) { border: 1px solid var(--line); background: var(--surface-soft); padding: 8px 10px; }
.inline-field:not([readonly]):focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.inline-field-computed { color: var(--muted); }
/* Select e checkbox ignorano readonly: si bloccano finché la sezione non è in modifica. */
select.inline-field[readonly], input[type="checkbox"].inline-field[readonly] { pointer-events: none; }
select.inline-field[readonly] { appearance: none; }
input[type="checkbox"].inline-field { width: auto; }
.parametri-checkbox { display: inline-flex; align-items: center; gap: 6px; }
.parametri-checkbox:has(input[readonly]) { pointer-events: none; }
.data-table tr.is-missing-field th { color: var(--danger); }
.prezzario-parent-description { display: block; max-width: 360px; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.macrovoce-row td { vertical-align: middle !important; }
.macrovoce-row td:first-child { width: 48px; }
.macrovoce-expand { display: grid; width: 30px; min-height: 30px; place-items: center; border-color: transparent; border-radius: 7px; padding: 0; background: transparent; color: var(--muted); }
.macrovoce-expand:hover { border-color: transparent; background: var(--surface-muted); color: var(--ink); }
.macrovoce-expand svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; transition: transform 150ms ease; }
.macrovoce-expand[aria-expanded="true"] svg { transform: rotate(90deg); }
.macrovoce-details > td { padding: 0 !important; background: var(--surface-muted); }
.macrovoce-details .data-table { table-layout: fixed; font-size: 14px; }
.macrovoce-results-code { width: 25%; }
.macrovoce-results-description { width: 51%; }
.macrovoce-results-unit { width: 8%; }
.macrovoce-results-price, .macrovoce-results-calculated { width: 8%; }
.macrovoce-details .data-table th:nth-child(4), .macrovoce-details .data-table td:nth-child(4), .macrovoce-details .data-table th:nth-child(5), .macrovoce-details .data-table td:nth-child(5) { white-space: nowrap; }
.macrovoce-loading { margin: 0; padding: 16px; color: var(--muted); font-size: 13px; }
.description-expand { margin-left: 5px; color: var(--brand-mid); font-size: 12px; font-weight: 700; white-space: nowrap; }
.description-expand:hover { color: var(--brand); text-decoration: underline; }
.prezzario-code { padding-right: 32px !important; color: var(--ink) !important; font-weight: 700; overflow-wrap: break-word; }
.prezzario-macro { min-width: 180px; }
.prezzario-macro strong, .prezzario-macro span { display: block; }
.prezzario-macro strong { color: var(--text-secondary); font-size: 13px; }
.prezzario-macro span { margin-top: 2px; color: var(--muted); font-size: 12px; }
.prezzari-results .data-table { table-layout: fixed; }
.prezzari-results-code { width: 30%; }
.prezzari-results-description { width: 36%; }
.prezzari-results-macro { width: 18%; }
.prezzari-results-price, .prezzari-results-calculated { width: 8%; }
.prezzari-results .data-table th:nth-child(4), .prezzari-results .data-table td:nth-child(4), .prezzari-results .data-table th:nth-child(5), .prezzari-results .data-table td:nth-child(5) { white-space: nowrap; }
.prezzari-results-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px 0 4px; }
.prezzari-results-pagination-info { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.gantt-workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.gantt-project-header { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; min-height: 52px; }
.gantt-project-header h1 { margin: 0; color: var(--ink); font-size: 20px; letter-spacing: -.02em; }
.gantt-project-header p { margin: 3px 0 0; color: var(--muted); font-size: 14px; }
.gantt-back-link { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--text-secondary); font-size: 14px; font-weight: 600; text-decoration: none; }
.gantt-back-link:hover { border-color: var(--line-strong); background: var(--surface-muted); color: var(--brand); }
.gantt-back-link svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.gantt-summary { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gantt-actions-row { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 18px 16px; }
.gantt-scope-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 34px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--text-secondary); font-size: 12px; font-weight: 600;
  line-height: 1.25; text-decoration: none;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
.gantt-scope-toggle:hover { border-color: var(--line-strong); background: var(--surface-muted); color: var(--ink); }
.button svg, .gantt-scope-toggle svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.gantt-figure-shell { position: relative; border-top: 1px solid var(--line); background: var(--surface); }
.gantt-row-principale.is-selected > td { background: var(--surface-soft); }
.gantt-row-principale.is-selected > td:first-child { border-left: 3px solid var(--brand); }

.gantt-section-placeholder { padding: 28px 18px; color: var(--muted); font-size: 13px; text-align: center; }
.gantt-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 13px 18px 11px; border-bottom: 1px solid var(--line); background: var(--surface); }
.gantt-section-heading h3 { margin: 0; color: var(--ink); font-size: 14px; font-weight: 700; }
.gantt-section-heading p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.gantt-section-heading .icon-button { flex: none; }
.gantt-section-shell .gantt-scroll { max-height: none; overflow-y: visible; overflow-x: auto; }

.gantt-bottom-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 900px) { .gantt-bottom-row { grid-template-columns: 1fr; } }
.gantt-collapsible-heading-main { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.gantt-collapsible-toggle {
  display: inline-flex; flex: none; align-items: center; justify-content: center;
  width: 28px; height: 28px; margin-top: 1px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); padding: 0; color: var(--text-secondary); cursor: pointer;
}
.gantt-collapsible-toggle:hover { border-color: var(--line-strong); background: var(--surface-muted); color: var(--ink); }
.gantt-collapsible-toggle svg {
  width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round; transition: transform 150ms ease;
}
.gantt-collapsible-panel.is-expanded .gantt-collapsible-toggle svg { transform: rotate(90deg); }
.gantt-collapsible-count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px;
  margin-left: 8px; padding: 0 7px; border-radius: 999px; background: var(--surface-muted);
  color: var(--text-secondary); font-size: 12px; font-weight: 700; vertical-align: middle;
}
.gantt-collapsible-empty {
  margin: 0; padding: 10px 18px 12px; color: var(--muted); font-size: 13px;
}
.gantt-collapsible-panel.is-collapsible:not(.is-expanded) .gantt-collapsible-heading { border-bottom: none; }
.gantt-collapsible-panel:not(.is-collapsible) .gantt-collapsible-heading { border-bottom: none; }
.gantt-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 64px 18px; color: var(--muted); font-size: 14px; }
.gantt-spinner { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--brand); animation: gantt-spin .7s linear infinite; }
@keyframes gantt-spin { to { transform: rotate(360deg); } }

.gantt-scroll { max-height: 72vh; overflow: auto; border-radius: 8px; position: relative; }
.gtp-table-wrap {
  position: relative;
  width: max-content;
  min-width: 0;
}
.gtp-milestone-overlay {
  position: absolute; top: 0; left: 0; z-index: 1;
  pointer-events: none;
}
.gtp-milestone-pins-sticky {
  position: sticky; top: 0; z-index: 3; pointer-events: none;
  height: calc(var(--gtp-thead-row1-height, 32px) + var(--gtp-week-row-height, 32px));
  margin-bottom: calc(-1 * (var(--gtp-thead-row1-height, 32px) + var(--gtp-week-row-height, 32px)));
}
.gtp-milestone-pins-sticky .gtp-milestone-overlay {
  position: absolute; top: 0; height: 100%; z-index: 3;
}
.gtp-milestone-overlay .gtp-milestone-line { z-index: 1; }
.gtp-milestone-overlay .gtp-milestone-marker {
  top: calc(var(--gtp-thead-row1-height, 32px) + var(--gtp-week-row-height, 32px) / 2);
  margin-top: -5px; z-index: 2;
}

.gantt-table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
.gantt-table th, .gantt-table td { white-space: nowrap; }
.gantt-table thead th {
  position: sticky; top: 0; z-index: 4; background: var(--surface-muted);
  border-bottom: 1px solid var(--line-strong); padding: 8px 12px;
  text-align: left; font-size: 11px; font-weight: 700; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: .04em;
}
.gantt-col-toggle, .gantt-col-nome, .gantt-col-durata, .gantt-col-importo, .gantt-col-pct { position: sticky; z-index: 2; background: var(--surface); }
thead .gantt-col-toggle, thead .gantt-col-nome, thead .gantt-col-durata, thead .gantt-col-importo, thead .gantt-col-pct { z-index: 5; background: var(--surface-muted); }
.gantt-col-toggle { left: 0; width: 30px; }
.gantt-col-nome { left: 30px; min-width: 250px; max-width: 250px; white-space: normal; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.gantt-nome-label { flex: 1; min-width: 0; }
.gantt-computo-link { flex: none; color: var(--muted); font-size: 11px; font-weight: 600; text-decoration: none; opacity: 0; transition: opacity 120ms ease; }
.gantt-row-principale:hover .gantt-computo-link, .gantt-row-figlio:hover .gantt-computo-link, .gantt-computo-link:focus-visible { opacity: 1; }
.gantt-computo-link:hover { color: var(--brand); text-decoration: underline; }
.gantt-col-durata { left: 280px; width: 66px; text-align: right; }
.gantt-col-importo { left: 346px; width: 128px; text-align: right; }
.gantt-col-pct { left: 474px; width: 54px; text-align: right; border-right: 1px solid var(--line-strong); }
.gantt-table td { padding: 7px 12px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink); }
.gantt-row-principale > td { font-weight: 700; background: var(--surface-muted); }
.gantt-row-figlio > td { font-weight: 400; color: var(--text-secondary); }
.gantt-row-figlio .gantt-col-nome { padding-left: 34px; }
.gantt-row-loading > td { background: var(--surface); color: var(--muted); font-size: 12px; font-style: italic; }
.gantt-row-loading .gantt-spinner { width: 13px; height: 13px; display: inline-block; vertical-align: -2px; margin-right: 7px; }
.gantt-empty-child { color: var(--muted); font-size: 12px; font-style: italic; }

/* Ingresso morbido delle righe figlio quando si espande una fase — legge
   come una transizione intenzionale, non un pop istantaneo (nessuna libreria
   JS, solo un'animazione CSS applicata alla riga appena inserita nel DOM). */
@keyframes gantt-row-enter {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.gantt-row-figlio.is-entering, .gantt-row-loading.is-entering { animation: gantt-row-enter 220ms ease-out; }

/* Riga principale aperta: ancoraggio visivo (bordo colorato a sinistra)
   così scorrendo su/giù non si perde il contesto di quale ramo è espanso —
   applicato sia alla riga principale sia alle sue righe figlio correnti. */
.gantt-row-principale.is-open > td:first-child { border-left: 3px solid var(--brand); }
.gantt-row-figlio[data-parent-of] > td:first-child, .gantt-row-loading[data-parent-of] > td:first-child { border-left: 3px solid var(--line-strong); }

.gantt-row-toggle { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; min-height: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); padding: 0; color: var(--text-secondary); }
.gantt-row-toggle:hover { border-color: var(--line-strong); background: var(--surface-muted); color: var(--ink); }
.gantt-row-toggle svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform 150ms ease; }
.gantt-row-toggle.is-open svg { transform: rotate(90deg); }

.gantt-col-timeline { padding: 0 !important; position: relative; vertical-align: middle; }
.gantt-months { position: relative; height: 32px; }
.gantt-month-tick { position: absolute; top: 0; height: 100%; padding: 9px 0 0 6px; border-left: 1px solid var(--line-strong); font-size: 11px; color: var(--muted); }
.gantt-track { position: relative; height: 36px; }
.gantt-gridline { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line); pointer-events: none; }
.gantt-gridline-week { position: absolute; top: 0; bottom: 0; border-left: 1px dotted var(--line); opacity: .6; pointer-events: none; }
.gantt-bar { position: absolute; top: 50%; height: 9px; margin-top: -4.5px; border-radius: 3px; background: var(--brand-mid); opacity: .85; }
.gantt-bar.is-principale { height: 16px; margin-top: -8px; border-radius: 5px; background: var(--brand); opacity: 1; box-shadow: 0 1px 3px rgb(0 0 0 / .12); }
.gantt-milestone-marker { position: absolute; top: 50%; width: 9px; height: 9px; margin-top: -5px; margin-left: -4.5px; background: #b45309; border: 1.5px solid var(--surface); transform: rotate(45deg); }

.gantt-legend { display: flex; gap: 18px; padding: 10px 18px 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.gantt-legend span { display: inline-flex; align-items: center; gap: 6px; }
.gantt-legend-bar { width: 18px; height: 7px; border-radius: 3px; background: var(--brand-mid); }
.gantt-legend-bar.principale { background: var(--brand); border-radius: 5px; }
.gantt-legend-bar.confronto { height: 5px; background: #eab308; opacity: .85; }
.gantt-legend-milestone { width: 9px; height: 9px; background: #b45309; transform: rotate(45deg); }
.gantt-legend-sal { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }

.curva-s-section { margin-top: 14px; }
.curva-s-legend { display: flex; gap: 18px; padding: 12px 18px 0; color: var(--muted); font-size: 12px; }
.curva-s-legend span { display: inline-flex; align-items: center; gap: 6px; }
.curva-s-legend span[hidden] { display: none; }
.curva-s-swatch { display: inline-block; width: 18px; height: 3px; border-radius: 2px; }
.curva-s-swatch.programmato { background: var(--brand); }
.curva-s-swatch.contabile { background: #b45309; }
.curva-s-swatch.precedente { background: #eab308; }
.curva-s-chart { padding: 8px 18px 18px; }
.curva-s-chart svg { width: 100%; height: auto; }
.curva-s-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; padding: 12px 18px 0; }
.curva-s-toolbar .curva-s-legend { padding: 0; }
.curva-s-mese[hidden], .curva-s-mese-valore[hidden] { display: none; }
.curva-s-mese { display: flex; align-items: center; gap: 8px; }
.curva-s-mese-select {
  display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 4px 0 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  color: var(--muted); font-size: 12px; font-weight: 600;
}
.curva-s-mese-select:hover, .curva-s-mese-select:focus-within { border-color: var(--line-strong); }
.curva-s-mese-select select {
  min-height: 0; padding: 4px 2px; border: 0; background: transparent;
  color: var(--ink); font-size: 12px; font-weight: 600; cursor: pointer;
}
.curva-s-mese-valore {
  padding: 5px 10px; border-radius: 999px; background: var(--accent-bg);
  color: var(--ink); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.curva-s-mese-band { fill: var(--accent-bg); }
.curva-s-chart.confronto-nascosto .curva-s-line.precedente { display: none; }
.curva-s-gridline { stroke: var(--line); stroke-width: 1; }
.curva-s-axis-label { fill: var(--muted); font-size: 10px; }
.curva-s-line { fill: none; stroke-width: 2.5; }
.curva-s-line.programmato { stroke: var(--brand); }
.curva-s-line.contabile { stroke: #b45309; stroke-dasharray: 6 4; }
.curva-s-line.precedente { stroke: #eab308; stroke-dasharray: 2 3; }

.computo-workspace { display: grid; gap: 16px; }
.computo-catalog-toolbar, .computo-catalog-list { margin: 0; }
.computo-catalog-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; padding: 10px 18px; border-top: 1px solid var(--line); }
.computo-catalog-counts { display: flex; align-items: center; gap: 12px; min-width: 0; }
.computo-catalog-counts > strong { color: var(--ink); font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.computo-catalog-counts > div { display: grid; gap: 3px; }
.computo-catalog-counts > div > span { color: var(--ink); font-size: 13px; font-weight: 600; }
.computo-catalog-counts small, .computo-catalog-status { color: var(--muted); font-size: 12px; }
.computo-catalog-status { margin: 0; text-align: right; }
.computo-pdf-upload { display: flex; align-items: center; gap: 10px; }
.computo-file-picker.file-dropzone { display: flex; width: min(310px, 30vw); min-height: 44px; gap: 9px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; background: var(--surface); }
.computo-file-picker.file-dropzone:hover, .computo-file-picker.file-dropzone.is-dragging { border-color: var(--brand); background: var(--surface-muted); }
.computo-file-picker.file-dropzone svg { width: 18px; height: 18px; }
.computo-file-picker .file-dropzone-copy { min-width: 0; gap: 1px; }
.computo-file-picker .file-dropzone-copy strong { font-size: 12px; }
.computo-file-picker .file-dropzone-name { display: block; max-width: 230px; font-size: 11px; font-weight: 400; }
.computo-file-picker.has-file .file-dropzone-name { color: var(--brand); font-weight: 600; }
.computo-pdf-upload > button { min-height: 44px; white-space: nowrap; }
.computo-catalog-search { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.computo-catalog-search label { display: grid; flex: 1 1 320px; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 600; }
.computo-catalog-search input { min-height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; background: var(--surface); color: var(--ink); }
.computo-group-tree { display: grid; }
.computo-group, .computo-category, .computo-scope { border-bottom: 1px solid var(--line); }
.computo-group > summary, .computo-category > summary, .computo-scope > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 12px 18px; color: var(--ink); cursor: pointer; list-style-position: inside; }
.computo-group > summary { background: var(--surface-muted); font-weight: 700; }
.computo-category > summary { padding-left: 38px; font-weight: 600; }
.computo-scope > summary { padding-left: 58px; color: var(--muted); font-family: var(--font-mono, monospace); font-size: 13px; }
.computo-group > summary small, .computo-category > summary small, .computo-scope > summary small { color: var(--muted); font-family: inherit; font-size: 12px; font-weight: 500; white-space: nowrap; }
.computo-catalog-table { min-width: 760px; table-layout: fixed; }
.computo-catalog-table th:nth-child(1), .computo-catalog-table td:nth-child(1) { width: 190px; }
.computo-catalog-table th:nth-child(3), .computo-catalog-table td:nth-child(3) { width: 120px; white-space: nowrap; }
.computo-catalog-table th:nth-child(4), .computo-catalog-table td:nth-child(4) { width: 130px; white-space: nowrap; }
.computo-description-cell { overflow-wrap: anywhere; line-height: 1.45; }
.description-rest[hidden] { display: none; }
.computo-catalog-empty { padding: 28px 18px; }
.computo-catalog-alerts { padding: 18px; }
.computo-alerts-heading h2 { margin: 0 0 4px; font-size: 16px; }
.computo-alerts-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.computo-alert-list { display: grid; gap: 0; margin: 12px 0 0; padding: 0; list-style: none; }
.computo-alert-list li { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line); }
.computo-alert-list li > span { color: var(--muted); }
.computo-alert-list li strong { color: var(--ink); }
.computo-alert-list li small { display: block; margin-top: 4px; color: var(--muted); line-height: 1.5; }
.variazione-start { max-width: 860px; padding: 24px; }
.variazione-start h2 { margin: 0 0 8px; }
.variazione-start > p { max-width: 68ch; }
.variazione-start-count { display: flex; align-items: baseline; gap: 8px; margin: 22px 0; color: var(--muted); }
.variazione-start-count strong { color: var(--ink); font-size: 24px; font-variant-numeric: tabular-nums; }
.variazione-start ol { padding-left: 22px; line-height: 1.8; }
.variazione-total { display:flex; align-items:baseline; gap:9px; white-space:nowrap; color:var(--muted); }
.variazione-total strong { color:var(--ink); font-size:28px; font-variant-numeric:tabular-nums; }
.variazione-empty { padding:26px; }
.variazione-grid { display:grid; grid-template-columns:minmax(340px,1.05fr) minmax(360px,1.25fr) minmax(360px,1.2fr); align-items:start; gap:0; border-radius:10px; box-shadow:none; }
.variazione-pane { min-width:0; padding:22px; background:transparent; box-shadow:none; font-size:13px; line-height:1.45; }
.variazione-pane + .variazione-pane { border-left:1px solid var(--line); }
.variazione-pane > header { margin-bottom:18px; }
.variazione-pane-header { display:flex; align-items:flex-start; justify-content:space-between; gap:8px; }
.variazione-pane-heading { min-width:0; flex:1 1 auto; }
.variazione-pane-toggle { display:grid; flex:none; width:30px; height:30px; place-items:center; padding:5px; border:1px solid var(--line); border-radius:6px; background:transparent; color:var(--muted); cursor:pointer; }
.variazione-pane-toggle:hover,.variazione-pane-toggle:focus-visible { border-color:var(--line-strong); color:var(--ink); }
.variazione-pane-toggle svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; }
.variazione-pane-collapsed-label { display:none; }
.variazione-pane.is-collapsed { display:block; min-width:0; padding:16px 8px; }
.variazione-pane.is-collapsed > header { display:flex; min-height:100%; align-items:center; flex-direction:column; gap:12px; margin:0; }
.variazione-pane.is-collapsed .variazione-pane-heading,.variazione-pane.is-collapsed > :not(header) { display:none !important; }
.variazione-pane.is-collapsed .variazione-pane-collapsed-label { display:block; writing-mode:vertical-rl; transform:rotate(180deg); color:var(--muted); font-size:12px; font-weight:650; white-space:nowrap; }
.variazione-grid.is-gantt-collapsed { grid-template-columns:62px minmax(360px,1.25fr) minmax(360px,1.2fr); }
.variazione-grid.is-computo-collapsed { grid-template-columns:minmax(340px,1.05fr) 62px minmax(360px,1.2fr); }
.variazione-grid.is-riepilogo-collapsed { grid-template-columns:minmax(340px,1.05fr) minmax(360px,1.25fr) 62px; }
.variazione-grid.is-gantt-collapsed.is-computo-collapsed { grid-template-columns:62px 62px minmax(360px,1.2fr); }
.variazione-grid.is-gantt-collapsed.is-riepilogo-collapsed { grid-template-columns:62px minmax(360px,1.25fr) 62px; }
.variazione-grid.is-computo-collapsed.is-riepilogo-collapsed { grid-template-columns:minmax(340px,1.05fr) 62px 62px; }
.variazione-grid.is-gantt-collapsed.is-computo-collapsed.is-riepilogo-collapsed { grid-template-columns:62px 62px 62px; }
.variazione-pane > header h3 { margin:2px 0 6px; }
.variazione-pane-header h3 { font-size:18px; line-height:1.25; }
.variazione-pane > header p:not(.eyebrow) { color:var(--muted); margin:0; }
.variazione-macro-form,.variazione-search,.variazione-phase-search { display:grid; gap:7px; margin-bottom:15px; }
.variazione-macro-form label,.variazione-search label,.variazione-phase-search label,.variazione-labor-form label { font-size:12px; font-weight:650; color:var(--muted); }
.variazione-macro-form select,.variazione-search input,.variazione-phase-search input,.variazione-labor-form input,.variazione-labor-form select { width:100%; min-width:0; padding:10px 12px; border:1px solid var(--line); border-radius:8px; background:var(--surface); color:var(--ink); }
.variazione-search > div,.variazione-labor-form > div { display:flex; align-items:center; gap:8px; }
.variazione-search-controls input { flex:1 1 auto; }
.variazione-search-controls .button { flex:none; white-space:nowrap; }
.variazione-phase-list,.variazione-computo-list,.variazione-association-list { list-style:none; padding:0; margin:0; }
.variazione-phase-list { flex:1 1 100%; width:100%; min-width:0; max-height:65vh; overflow:auto; }
.variazione-phase-list li { width:100%; border-top:1px solid var(--line); }
.variazione-phase-row,.variazione-phase-row a { width:100%; }
.variazione-phase-list a { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:40px; padding:7px 8px; color:var(--ink); text-decoration:none; }
.variazione-phase-list li:hover,.variazione-phase-list li.is-selected { background:var(--surface-muted); }
.variazione-phase-list li.is-selected a span { color:var(--brand); font-weight:650; }
.variazione-phase-list small,.variazione-phase-count { color:var(--muted); font-size:12px; }
.variazione-phase-count { display:block; padding:0 9px 9px; }
.variazione-search-note { margin:0 0 8px; color:var(--muted); font-size:12px; }
.variazione-groups { margin:16px 0; padding:12px 0; border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.variazione-groups-modal { display:flex; width:min(680px,calc(100vw - 32px)); max-height:calc(100vh - 40px); flex-direction:column; }
.variazione-groups-modal > .variazione-groups { min-height:0; margin:0; padding:12px 18px 18px; overflow:auto; }
.variazione-phase-modal-list { min-height:0; margin:0; padding:0 0 8px 16px; list-style:none; }
.variazione-phase-modal-list li { border-top:1px solid var(--line); }
.variazione-phase-modal-list a { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:44px; padding:8px 4px; color:var(--ink); text-decoration:none; }
.variazione-phase-modal-list a:hover,.variazione-phase-modal-list a:focus-visible { background:var(--surface-muted); }
.variazione-phase-modal-list li.is-selected { background:var(--surface-muted); }
.variazione-phase-modal-list small { color:var(--muted); font-size:12px; white-space:nowrap; }
.variazione-macro-modal-list { padding-left:0; }
.variazione-macro-modal-list a { min-height:48px; }
.variazione-phase-pick-form > .button { margin-top:12px; }
.variazione-modal-back { display:inline-block; margin:0 0 10px; color:var(--muted); font-size:12px; text-decoration:none; }
.variazione-modal-back:hover { color:var(--ink); }
.variazione-phase-check-row { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:44px; padding:6px 4px; border-top:1px solid var(--line); }
.variazione-phase-check-row label { display:flex; align-items:center; gap:10px; min-width:0; cursor:pointer; font-size:13px; line-height:1.4; }
.variazione-phase-check-row label span { overflow-wrap:anywhere; }
.variazione-phase-check-row input { flex:none; accent-color:var(--brand); }
.variazione-phase-check-row small { flex:none; }
.variazione-phase-check-row small,.variazione-phase-list-heading small { font-size:12px; line-height:1.35; }
.variazione-phase-list-heading { display:flex; justify-content:space-between; gap:10px; margin:10px 0 4px; font-size:13px; }
.variazione-phase-list-heading small { color:var(--muted); font-size:12px; }
.variazione-phase-pick-form { display:block; width:100%; min-width:0; }
.variazione-phase-table-list { display:block; width:100%; max-height:52vh; margin:0 0 10px; overflow:auto; padding:0; border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.variazione-phase-table-list .variazione-phase-check-row { padding-inline:8px; }
.variazione-phase-table-list .variazione-phase-check-row label { flex:1 1 auto; }
.variazione-groups-modal .variazione-groups-level { padding-left:14px; }
.variazione-groups > p { margin:0 0 8px; color:var(--muted); font-size:12px; }
.variazione-gantt-hint { margin:0 0 10px; color:var(--muted); font-size:12px; }
.variazione-groups details { border-top:1px solid var(--line); }
.variazione-groups > details:first-of-type { border-top:0; }
.variazione-groups summary { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:9px 4px; cursor:pointer; color:var(--ink); font-size:13px; }
.variazione-groups summary:hover { color:var(--brand); }
.variazione-groups summary small,.variazione-groups li small { color:var(--muted); font-size:11px; white-space:nowrap; }
.variazione-groups-level { padding-left:16px; }
.variazione-groups ul { list-style:none; margin:0; padding:0 0 5px 14px; }
.variazione-groups li a { display:flex; justify-content:space-between; gap:12px; padding:7px 8px; color:var(--ink); text-decoration:none; border-radius:5px; }
.variazione-groups li a:hover,.variazione-groups li a:focus-visible { background:var(--surface-muted); }
.variazione-groups li a span { font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:12px; }
.variazione-computo-list { max-height:65vh; overflow:auto; }
.variazione-computo-list li { display:flex; justify-content:flex-start; align-items:flex-start; gap:10px; padding:13px 0; border-top:1px solid var(--line); }
.variazione-computo-list li > div { min-width:0; }
.variazione-bulk-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 0; border-bottom:1px solid var(--line); }
.variazione-bulk-toolbar > label { display:flex; align-items:center; gap:7px; color:var(--muted); font-size:12px; cursor:pointer; }
.variazione-bulk-toolbar input,.variazione-computo-pick input { flex:none; accent-color:var(--brand); }
.variazione-computo-pick { display:flex; flex:none; padding-top:3px; cursor:pointer; }
.variazione-bulk-toolbar .button { white-space:nowrap; }
.variazione-computo-list li > div > strong,.variazione-association-title strong { font-size:14px; line-height:1.35; }
.variazione-computo-list strong,.variazione-association-title strong { font-variant-numeric:tabular-nums; }
.variazione-computo-list p,.variazione-association-list > li > p { margin:4px 0; color:var(--muted); font-size:12px; line-height:1.4; }
.variazione-computo-list small,.variazione-association-list small { color:var(--muted); font-size:12px; line-height:1.4; }
.variazione-computo-list li > div > p,.variazione-association-list > li > p { font-size:13px; line-height:1.45; }
.variazione-association-title span { font-size:12px; line-height:1.35; }
.variazione-totals { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:0 0 16px; }
.variazione-totals div { padding:12px; background:var(--surface-muted); border-radius:8px; }
.variazione-totals dt { font-size:12px; color:var(--muted); }
.variazione-totals dd { margin:5px 0 0; font-size:16px; font-weight:700; line-height:1.3; font-variant-numeric:tabular-nums; }
.variazione-totals small { display:block; margin-top:3px; color:var(--muted); font-size:11px; }
.variazione-labor-overview { margin:0 0 14px; padding-top:12px; border-top:1px solid var(--line); }
.variazione-labor-feedback:empty { display:none; }
.variazione-labor-feedback .form-feedback { margin:0 0 10px; }
.variazione-labor-overview-wrap { max-width:100%; overflow-x:auto; }
.table-shell .data-table.variazione-labor-overview-table { width:100%; min-width:520px; border-collapse:collapse; font-size:12px; }
.variazione-labor-overview-table th { padding:8px 9px; background:var(--surface-muted); color:var(--muted); font-size:10px; font-weight:700; letter-spacing:.04em; text-align:left; text-transform:uppercase; }
.variazione-labor-overview-table td { padding:8px 9px; vertical-align:top; }
.variazione-labor-overview-table tbody + tbody { border-top:2px solid var(--line); }
.variazione-labor-overview-phase td { padding-top:12px; }
.variazione-labor-overview-phase td:not(:first-child) { white-space:nowrap; font-variant-numeric:tabular-nums; }
.variazione-labor-overview-phase td:first-child strong { font-size:13px; overflow-wrap:anywhere; }
.variazione-labor-overview-workers td { padding-top:0; padding-bottom:12px; }
.variazione-phase-labor-summary { margin:0 0 14px; padding:12px 0 0; border-top:1px solid var(--line); }
.variazione-phase-labor-summary h4 { margin:0 0 4px; font-size:14px; }
.variazione-phase-labor-summary > p { margin:0 0 10px; color:var(--muted); font-size:12px; }
.variazione-phase-group { border-top:1px solid var(--line); }
.variazione-phase-group > summary { position:relative; display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:42px; padding:9px 10px 9px 30px; background:var(--surface-muted); cursor:pointer; list-style:none; user-select:none; }
.variazione-phase-group > summary::-webkit-details-marker { display:none; }
.variazione-phase-group > summary::before { content:'›'; position:absolute; left:11px; top:50%; color:var(--brand); font-size:20px; line-height:1; transform:translateY(-50%); transition:transform 140ms ease-out; }
.variazione-phase-group[open] > summary::before { transform:translateY(-50%) rotate(90deg); }
.variazione-phase-group > summary:hover { background:color-mix(in oklch,var(--surface-muted) 82%,var(--brand)); }
.variazione-phase-group > summary:focus-visible { outline:2px solid var(--brand); outline-offset:2px; }
.variazione-phase-group > summary strong { font-size:13px; }
.variazione-phase-group > summary span { color:var(--muted); font-size:12px; font-variant-numeric:tabular-nums; white-space:nowrap; }
.variazione-phase-group-content { padding:10px 0 12px 18px; }
.variazione-phase-workers { padding:10px 12px; background:var(--surface-muted); border-radius:6px; }
.variazione-phase-workers small,.variazione-no-profile { color:var(--muted); }
.variazione-phase-workers ul { list-style:none; padding:0; margin:6px 0; }
.variazione-phase-workers li { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:6px 0; border-top:1px solid var(--line); font-size:12px; }
.variazione-phase-workers li form { flex:none; }
.variazione-no-profile { margin:7px 0; font-size:12px; }
.variazione-labor-hint { margin:4px 0 8px; color:var(--muted); font-size:12px; }
.variazione-association-table-wrap { max-width:100%; margin-top:10px; overflow-x:auto; border-top:1px solid var(--line); }
.table-shell .data-table.variazione-association-table { width:100%; min-width:760px; table-layout:fixed; border-collapse:collapse; font-size:12px; }
.variazione-association-table th { padding:8px 9px; background:var(--surface-muted); color:var(--muted); font-size:10px; font-weight:700; letter-spacing:.04em; text-align:left; text-transform:uppercase; }
.variazione-association-table td { padding:9px; border-bottom:1px solid var(--line); background:var(--surface); vertical-align:top; }
.variazione-association-table th:nth-child(1),.variazione-association-table td:nth-child(1) { width:40%; }
.variazione-association-table th:nth-child(2),.variazione-association-table td:nth-child(2) { width:13%; }
.variazione-association-table th:nth-child(3),.variazione-association-table td:nth-child(3) { width:12%; }
.variazione-association-table th:nth-child(4),.variazione-association-table td:nth-child(4) { width:13%; }
.variazione-association-table th:nth-child(5),.variazione-association-table td:nth-child(5) { width:10%; }
.variazione-association-table th:nth-child(6),.variazione-association-table td:nth-child(6) { width:52px; }
.variazione-association-table td:not(:first-child) { white-space:nowrap; font-variant-numeric:tabular-nums; }
.variazione-association-table td:last-child { text-align:center; }
.variazione-association-table td:first-child strong,.variazione-association-table td:first-child small { display:block; }
.variazione-association-table td:first-child strong { overflow-wrap:anywhere; font-size:12px; }
.variazione-association-table td:first-child small { margin-top:3px; color:var(--muted); font-size:11px; line-height:1.4; }
.variazione-association-table td form { display:flex; justify-content:center; }
.variazione-remove-button { padding:2px 0; border:0; background:transparent; color:var(--muted); font:inherit; font-size:11px; text-decoration:underline; text-underline-offset:2px; cursor:pointer; }
.variazione-remove-button:hover,.variazione-remove-button:focus-visible { color:var(--danger); }
.variazione-phase-workers .variazione-labor-form { margin-top:8px; padding-top:8px; border-top:1px solid var(--line); }
.variazione-phase-workers .variazione-labor-form > div { align-items:stretch; }
.variazione-phase-workers .variazione-labor-form select { flex:1 1 auto; }
.variazione-phase-workers .variazione-labor-form input[type="number"] { flex:0 0 92px; }
.variazione-phase-workers .variazione-labor-form .button { min-width:82px; }
.variazione-labor-detail { margin-top:12px; padding:12px; background:var(--surface-muted); border-radius:8px; font-size:12px; }
.variazione-labor-form { display:grid; gap:6px; margin-top:10px; }
.variazione-labor-form .button { flex:none; }
.variazione-footnote { color:var(--muted); font-size:12px; line-height:1.5; }
.variazione-profile { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:8px 0; border-top:1px solid var(--line); font-variant-numeric:tabular-nums; }
.variazione-labor-detail > p { margin:8px 0 0; color:var(--muted); }
.variazione-labor-form input[type="number"] { flex:0 0 94px; font-variant-numeric:tabular-nums; }
.variazione-stale { padding:18px 22px; margin-bottom:16px; background:var(--surface-muted); }
.variazione-stale h3 { margin:0 0 5px; }
.variazione-stale p { max-width:80ch; color:var(--muted); font-size:13px; line-height:1.5; }
.variazione-stale ul { list-style:none; padding:0; margin:0; }
.variazione-stale li { padding:10px 0; border-top:1px solid var(--line); }
.variazione-stale form { display:inline-block; margin-left:8px; }
.variazione-generation { margin-top:18px; padding-top:16px; border-top:1px solid var(--line); }
.variazione-generation h4 { margin:0 0 5px; }
.variazione-generation p { color:var(--muted); font-size:13px; line-height:1.5; }
.variazione-generation button:disabled { opacity:.55; cursor:not-allowed; }
.variazione-phase-selection > button { width:100%; margin-top:12px; }
.variazione-phase-search { display:grid; gap:0; margin:0 0 10px; }
.variazione-phase-search .variazione-search-controls { display:flex; align-items:center; flex-wrap:nowrap; gap:5px; min-width:0; }
.variazione-phase-search .variazione-search-controls input { flex:1 1 auto; width:1%; min-width:0; min-height:36px; padding:7px 9px; font-size:12px; }
.variazione-phase-search .variazione-search-controls .button { flex:none; min-height:36px; padding:6px 10px; font-size:12px; }
.variazione-selected-summary { margin:6px 0 0; color:var(--muted); font-size:12px; line-height:1.4; overflow-wrap:anywhere; }
.variazione-phase-row { display:grid; grid-template-columns:22px minmax(0,1fr) auto; align-items:center; gap:8px; width:100%; min-height:44px; padding:2px 8px; cursor:pointer; }
.variazione-phase-row:hover { background:var(--surface-muted); }
.variazione-phase-row span { min-width:0; }
.variazione-phase-row small { color:var(--muted); font-size:12px; white-space:nowrap; }
.variazione-phase-row input[type="checkbox"] { accent-color:var(--brand); width:16px; height:16px; }
.variazione-days-form { display:grid; gap:9px; }
.variazione-days-modal { width:min(560px,calc(100vw - 32px)); }
.variazione-days-modal .modal-description { margin:0; }
.variazione-days-modal .variazione-days-form { gap:12px; }
.variazione-days-modal .variazione-days-form footer { display:flex; justify-content:flex-end; gap:8px; margin-top:4px; }
.variazione-days-form label { display:grid; grid-template-columns:minmax(0,1fr) 110px; align-items:center; gap:10px; color:var(--ink); font-size:13px; }
.variazione-days-form input[type="number"] { min-width:0; padding:8px 10px; border:1px solid var(--line); border-radius:8px; background:var(--surface); color:var(--ink); font-variant-numeric:tabular-nums; }
.variazione-days-form button { justify-self:start; margin-top:5px; }
.variazione-days-row { display:grid; gap:6px; margin:0; padding:0 0 10px; border:0; border-bottom:1px solid var(--line); }
.variazione-days-tipo { display:grid; grid-template-columns:minmax(0,1fr) 110px; gap:10px; }
.variazione-days-tipo select { min-width:0; padding:8px 10px; border:1px solid var(--line); border-radius:8px; background:var(--surface); color:var(--ink); font-size:13px; }
.variazione-preview { padding:24px; }
.variazione-preview h2 { margin:4px 0 8px; }
.variazione-preview > p { max-width:78ch; color:var(--muted); line-height:1.55; }
.variazione-preview-warning { padding:10px 12px; border-radius:8px; background:var(--surface-muted); color:var(--ink) !important; }
.variazione-preview-actions { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top:20px; }
.variazione-preview-actions form { margin:0; }
.variazione-preview-actions .button { white-space:nowrap; }
@media (max-width:720px) { .variazione-preview-actions { align-items:stretch; flex-direction:column-reverse; } .variazione-preview-actions .button { width:100%; } }
@media (max-width:1150px) { .variazione-grid { grid-template-columns:minmax(300px,.95fr) minmax(320px,1.2fr); } .variazione-labor { grid-column:1 / -1; border-top:1px solid var(--line); border-left:0 !important; } }
@media (max-width:720px) { .variazione-heading { align-items:flex-start; flex-direction:column; } .variazione-heading-copy { align-items:flex-start; flex-direction:column; gap:5px; } .variazione-grid { grid-template-columns:1fr; } .variazione-pane + .variazione-pane { border-top:1px solid var(--line); border-left:0; } .variazione-labor { grid-column:auto; } .variazione-computo-list li { align-items:flex-start; flex-direction:row; } .variazione-phase-group-content { padding-left:8px; } .variazione-phase-workers li { align-items:flex-start; flex-direction:column; } .variazione-totals { grid-template-columns:1fr; } }
@media (max-width:520px) { .variazione-search-controls { flex-wrap:wrap; } .variazione-search-controls input { flex-basis:100%; } .variazione-groups-modal { max-height:calc(100vh - 24px); } }
@media (max-width:1150px) {
  .variazione-grid.is-gantt-collapsed { grid-template-columns:62px minmax(320px,1fr); }
  .variazione-grid.is-computo-collapsed { grid-template-columns:minmax(300px,1fr) 62px; }
  .variazione-grid.is-riepilogo-collapsed .variazione-labor { grid-column:1 / -1; }
  .variazione-pane.is-collapsed > header { min-height:34px; flex-direction:row; }
  .variazione-pane.is-collapsed .variazione-pane-collapsed-label { writing-mode:initial; transform:none; }
}
@media (max-width:720px) {
  .variazione-grid.is-gantt-collapsed,.variazione-grid.is-computo-collapsed,.variazione-grid.is-riepilogo-collapsed { grid-template-columns:minmax(0,1fr); }
  .variazione-pane.is-collapsed { padding:12px 16px; }
  .variazione-pane.is-collapsed > header { min-height:30px; flex-direction:row; }
  .variazione-pane.is-collapsed .variazione-pane-collapsed-label { writing-mode:initial; transform:none; }
}
@media (min-width:721px) and (max-width:1150px) {
  .variazione-grid.is-gantt-collapsed,.variazione-grid.is-computo-collapsed,.variazione-grid.is-riepilogo-collapsed { grid-template-columns:62px minmax(240px,1fr) minmax(240px,1fr); }
  .variazione-grid.is-gantt-collapsed.is-computo-collapsed { grid-template-columns:62px 62px minmax(280px,1fr); }
  .variazione-grid.is-gantt-collapsed.is-riepilogo-collapsed { grid-template-columns:62px minmax(280px,1fr) 62px; }
  .variazione-grid.is-computo-collapsed.is-riepilogo-collapsed { grid-template-columns:minmax(280px,1fr) 62px 62px; }
  .variazione-grid.is-gantt-collapsed.is-computo-collapsed.is-riepilogo-collapsed { grid-template-columns:62px 62px 62px; }
  .variazione-grid.is-gantt-collapsed .variazione-labor,.variazione-grid.is-computo-collapsed .variazione-labor,.variazione-grid.is-riepilogo-collapsed .variazione-labor { grid-column:auto; border-top:0; border-left:1px solid var(--line) !important; }
}
@media (max-width: 760px) {
  .prezzario-section-heading { align-items: stretch; flex-direction: column; }
  .prezzario-section-heading-actions { width: 100%; }
  .computo-pdf-upload { width: 100%; align-items: stretch; flex-direction: column; }
  .computo-file-picker.file-dropzone { width: 100%; }
  .computo-pdf-upload > button { width: 100%; }
  .computo-catalog-summary { align-items: flex-start; flex-direction: column; }
  .computo-catalog-status { text-align: left; }
  .computo-catalog-search { align-items: stretch; }
  .computo-catalog-search > * { flex: 1 1 100%; }
  .computo-pdf-upload { flex-wrap: wrap; }
  .computo-alert-list li { align-items: flex-start; flex-direction: column; }
  .computo-category > summary { padding-left: 24px; }
  .computo-scope > summary { padding-left: 34px; }
}
.computo-header { display: flex; align-items: center; gap: 16px; min-height: 52px; }
.computo-header h1 { margin: 0; color: var(--ink); font-size: 20px; letter-spacing: -.02em; }
.computo-section { margin: 0; }
.computo-totale { color: var(--ink); font-size: 16px; font-variant-numeric: tabular-nums; }
.computo-heading-actions { gap: 18px; }
.computo-righe-table { table-layout: fixed; }
.computo-righe-table th:nth-child(1),
.computo-righe-table td:nth-child(1) { width: 16%; overflow-wrap: anywhere; }
.computo-righe-table th:nth-child(2),
.computo-righe-table td:nth-child(2) { width: 18%; overflow-wrap: anywhere; }
.computo-righe-table th:nth-child(3),
.computo-righe-table td:nth-child(3) { width: 28%; }
.computo-righe-table th:nth-child(4),
.computo-righe-table td:nth-child(4),
.computo-righe-table th:nth-child(5),
.computo-righe-table td:nth-child(5) { width: 12%; white-space: nowrap; font-variant-numeric: tabular-nums; }
.computo-righe-table th:nth-child(6),
.computo-righe-table td:nth-child(6) { width: 72px; }

.problemi-fase-workspace { display: grid; gap: 16px; }
.problemi-fase-header { display: flex; align-items: center; gap: 16px; min-height: 52px; }
.problemi-fase-header h1 { margin: 0; color: var(--ink); font-size: 20px; letter-spacing: -.02em; }
.progetto-header { display: flex; align-items: center; gap: 16px; min-height: 52px; margin-bottom: 4px; }
.progetto-header h1 { margin: 0; color: var(--ink); font-size: 20px; letter-spacing: -.02em; }
.progetto-header .eyebrow { margin: 0 0 2px; color: var(--muted); font-size: 13px; font-weight: 600; }
.progetto-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.progetto-tabs-actions { display:flex; align-items:center; gap:12px; margin-bottom:16px; }
.progetto-tabs-actions .progetto-tabs { flex:1 1 auto; min-width:0; margin-bottom:0; }
.progetto-tabs-actions > .button { flex:none; white-space:nowrap; }
.fase-selector { display: flex; align-items: center; flex-wrap: nowrap; gap: 20px; margin-bottom: 16px; }
.computo-section .fase-selector { flex-wrap: nowrap; margin-bottom: 0; padding: 14px 18px; }
.fase-selector label { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.fase-selector select { min-height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--surface); color: var(--ink); font-size: 15px; font-weight: 600; text-transform: none; letter-spacing: normal; }
.progetto-tab { flex: none; padding: 10px 14px; border-bottom: 2px solid transparent; color: var(--text-secondary); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.progetto-tab:hover { color: var(--ink); }
.progetto-tab.is-active { border-bottom-color: var(--brand); color: var(--ink); }
.progetto-tab-separator { flex: none; align-self: center; width: 1px; height: 18px; margin: 0 4px; background: var(--line-strong); }
.problemi-fase-section { margin: 0; }
.problemi-computo-table { table-layout: fixed; }
.problemi-computo-table th:nth-child(1),
.problemi-computo-table td:nth-child(1) { width: 12%; overflow-wrap: anywhere; }
.problemi-computo-table th:nth-child(2),
.problemi-computo-table td:nth-child(2) { width: 10%; }
.problemi-computo-table th:nth-child(3),
.problemi-computo-table td:nth-child(3) { width: 42%; }
.problemi-computo-table th:nth-child(4),
.problemi-computo-table td:nth-child(4),
.problemi-computo-table th:nth-child(5),
.problemi-computo-table td:nth-child(5),
.problemi-computo-table th:nth-child(6),
.problemi-computo-table td:nth-child(6) { width: 12%; white-space: nowrap; font-variant-numeric: tabular-nums; }
.problemi-fase-add-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 18px; }
.problemi-fase-add-form select { min-width: 220px; }
.problemi-fase-add-form input[name="giorni"] { width: 76px; text-align: right; }
.problemi-fase-add-form input[name="note"] { flex: 1; min-width: 160px; }
.problemi-fase-totale-azioni { display: flex; align-items: center; gap: 14px; }
.problemi-fase-totale { color: var(--ink); font-size: 16px; font-variant-numeric: tabular-nums; }
.prezzario-open-link { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 600; text-decoration: none; }
.prezzario-open-link:hover { color: var(--brand); text-decoration: underline; }
.prezzario-open-link svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.prezzario-meta { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 500; }
.import-status-panel { padding: 14px 18px 16px; border-top: 1px solid var(--line); }
.import-status-heading { display: flex; align-items: center; gap: 8px; margin: 0; }
.import-status-panel .prezzario-progress { margin-top: 8px; }
.import-esito-panel { display: grid; gap: 16px; }
.import-esito-banner { display: flex; align-items: flex-start; gap: 12px; }
.import-esito-icon { display: grid; flex: none; place-items: center; width: 34px; height: 34px; border-radius: 9px; }
.import-esito-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.import-esito-ok .import-esito-icon { background: color-mix(in oklch, var(--success) 15%, transparent); color: var(--success); }
.import-esito-parziale .import-esito-icon { background: color-mix(in oklch, #9a6700 15%, transparent); color: #9a6700; }
.import-esito-fallito .import-esito-icon { background: color-mix(in oklch, var(--danger) 15%, transparent); color: var(--danger); }
.import-esito-heading-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.import-esito-heading { margin: 0; font-size: 17px; font-weight: 700; color: var(--ink); }
.import-esito-subtitle { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.import-esito-info-inline { position: relative; margin: 0; }
.import-esito-info-inline > summary { list-style: none; cursor: pointer; color: var(--muted); font-size: 15px; font-weight: 700; line-height: 1; }
.import-esito-info-inline > summary::-webkit-details-marker { display: none; }
.import-esito-info-inline > summary:hover { color: #9a6700; }
.import-esito-info-inline .import-esito-info { position: absolute; z-index: 2; top: calc(100% + 6px); left: 0; width: min(320px, 70vw); margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 8px 24px rgb(0 0 0 / .08); color: var(--text-secondary); font-size: 13px; line-height: 1.5; }
.import-esito-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.import-esito-breakdown { display: grid; gap: 0; }
.import-esito-breakdown-row { display: grid; grid-template-columns: 4ch 1fr; align-items: baseline; gap: 10px; margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--text-secondary); font-size: 15px; }
.import-esito-breakdown-row:first-child { border-top: 1px solid var(--line); }
.import-esito-breakdown-row strong { color: var(--ink); font-size: 17px; font-variant-numeric: tabular-nums; }
.import-esito-breakdown-row small { color: var(--muted); font-size: 13px; }
.import-esito-stat { display: grid; align-content: start; gap: 10px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.import-esito-stat-line { display: grid; gap: 4px; margin: 0; line-height: 1.35; }
.import-esito-stat-value { font-size: 32px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1; }
.import-esito-stat-label { color: var(--text-secondary); font-size: 15px; font-weight: 600; }
.import-esito-stat.is-pending { border-color: color-mix(in oklch, #9a6700 35%, var(--line)); }
.import-esito-stat.is-pending .import-esito-stat-value { color: #9a6700; }
.import-esito-stat.is-error { border-color: color-mix(in oklch, var(--danger) 30%, var(--line)); }
.import-esito-stat.is-error .import-esito-stat-value { color: var(--danger); }
/* Non richiede un'azione (non c'è nulla da "assegnare"/"mappare": è un
   limite del Gantt del cliente, non un errore) — colore neutro dell'accent
   invece di ambra/rosso, ma comunque distinto dallo stat "ok" così non si
   confonde con "tutto importato senza problemi". */
.import-esito-stat.is-info { border-color: color-mix(in oklch, var(--accent) 30%, var(--line)); }
.import-esito-stat.is-info .import-esito-stat-value { color: var(--accent); }
.import-esito-stat-action { justify-self: start; padding: 7px 14px; font-size: 14px; }
.import-esito-stat-note { margin: 0; color: var(--text-secondary); font-size: 13px; line-height: 1.4; }
.import-esito-detail, .import-esito-followups { grid-column: 1 / -1; padding-top: 12px; border-top: 1px solid var(--line); color: var(--text-secondary); font-size: 14px; line-height: 1.5; }
.import-esito-detail h3, .import-esito-followups h3 { margin: 0 0 6px; color: var(--ink); font-size: 15px; }
.import-esito-detail p, .import-esito-followups p { margin: 4px 0; }
.import-esito-detail ul, .import-esito-followups ul { display: grid; gap: 6px; margin: 6px 0; padding-left: 20px; }
.import-esito-detail li, .import-esito-followups li { padding-left: 2px; }
.import-esito-mismatch { padding: 9px 11px; border-left: 3px solid #9a6700; background: color-mix(in oklch, #9a6700 7%, var(--surface)); }
.import-esito-followups .import-esito-stat-action { display: inline-flex; margin-left: 4px; }
.import-esito-ambigue { margin: 0; }
.import-esito-ambigue > summary { list-style: none; cursor: pointer; }
.import-esito-ambigue > summary::-webkit-details-marker { display: none; }
.import-esito-ambigue-list { display: grid; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.import-esito-ambigue-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.import-esito-ambigue-capitolo { flex: 1 1 140px; font-size: 13px; font-weight: 600; color: var(--ink); }
.import-esito-ambigue-form select { flex: 1 1 180px; min-width: 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.import-esito-info a { color: var(--brand-mid); }
.computo-verifica-back { margin-bottom: 16px; }
.mappa-page { display: grid; gap: 16px; }
.mappa-kicker { margin: 0 0 4px; color: var(--text-secondary); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.mappa-lead { margin: 8px 0 0; max-width: 62ch; color: var(--text-secondary); font-size: 14px; line-height: 1.55; }
.mappa-summary-body { display: grid; gap: 18px; padding: 0 18px 18px; border-top: 1px solid var(--line); }
.mappa-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding-top: 16px; }
.mappa-stat { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.mappa-stat.is-highlight { border-color: color-mix(in oklch, #9a6700 35%, var(--line)); background: color-mix(in oklch, #9a6700 6%, var(--surface-soft)); }
.mappa-stat-value { margin: 0; color: var(--ink); font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.mappa-stat-label { margin: 6px 0 0; color: var(--text-secondary); font-size: 13px; font-weight: 600; line-height: 1.35; }
.mappa-prezzari-consultati { display: grid; gap: 8px; }
.mappa-prezzari-label { margin: 0; color: var(--faint); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.mappa-prezzari-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.mappa-prezzari-chips li { padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text-secondary); font-size: 13px; font-weight: 600; line-height: 1.2; }
.mappa-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.mappa-search { flex: 1; min-width: min(100%, 280px); }
.mappa-filter-meta { margin: 0; color: var(--text-secondary); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mappa-listini { display: grid; gap: 12px; }
.mappa-listino-details > summary { list-style: none; cursor: pointer; }
.mappa-listino-details > summary::-webkit-details-marker { display: none; }
.mappa-listino-summary { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid transparent; }
.mappa-listino-details[open] .mappa-listino-summary { border-bottom-color: var(--line); }
.mappa-listino-summary:hover { background: var(--surface-soft); }
.mappa-listino-chevron { flex: none; color: var(--muted); font-size: 18px; font-weight: 700; line-height: 1; transition: transform .15s ease; }
.mappa-listino-details[open] .mappa-listino-chevron { transform: rotate(90deg); }
.mappa-listino-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; min-width: 0; flex: 1; color: var(--ink); font-size: 15px; font-weight: 700; }
.mappa-listino-count { color: var(--muted); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mappa-listino-badges { flex: none; }
.mappa-badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.mappa-badge-import { background: color-mix(in oklch, #9a6700 12%, transparent); color: #9a6700; }
.mappa-badge-manuale { background: color-mix(in oklch, var(--brand) 10%, transparent); color: var(--brand-mid); }
.mappa-listino-body { display: grid; gap: 12px; padding: 14px 18px 18px; }
.mappa-listino-hint { margin: 0; color: var(--text-secondary); font-size: 13px; line-height: 1.5; }
.mappa-conferma-tutti-form { justify-self: end; }
.mappa-listino-hint .prezzario-code,
.mappa-listino-title .prezzario-code { padding-right: 0 !important; }
.mappa-table-wrap { overflow-x: auto; }
.mappa-articoli-table { table-layout: fixed; font-size: 14px; }
.mappa-articoli-table th:nth-child(1), .mappa-articoli-table td:nth-child(1) { width: 18%; }
.mappa-articoli-table th:nth-child(2), .mappa-articoli-table td:nth-child(2) { width: auto; }
.mappa-articoli-table th:nth-child(3), .mappa-articoli-table td:nth-child(3) { width: 10%; white-space: nowrap; }
.mappa-articoli-table th:nth-child(4), .mappa-articoli-table td:nth-child(4) { width: 148px; white-space: nowrap; }
.mappa-descrizione-cell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); }
.mappa-senza-listino-table .mappa-descrizione-cell { white-space: normal; overflow: visible; text-overflow: clip; }
.mappa-codice-cell { font-weight: 600; }
.mappa-unita-cell { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.mappa-azione-cell { text-align: right; }
.mappa-inserisci-voce { min-height: 34px; padding: 5px 12px; font-size: 13px; }
/* Variante a 5 colonne (Codice/Descrizione/U.M./Prezzo/Azione, sezione
   "Senza listino reale"): le regole nth-child sopra assumono 4 colonne
   (Azione in posizione 4), qui serve un set a sé invece di riusarle. */
.mappa-senza-listino-table th:nth-child(3),
.mappa-senza-listino-table td:nth-child(3) { width: 8%; white-space: nowrap; }
.mappa-senza-listino-table th:nth-child(4),
.mappa-senza-listino-table td:nth-child(4) { width: 100px; white-space: nowrap; text-align: right; }
.mappa-senza-listino-table th:nth-child(5),
.mappa-senza-listino-table td:nth-child(5) { width: 260px; white-space: nowrap; }
.mappa-prezzo-cell { text-align: right; }
.mappa-azione-group { display: inline-flex; gap: 8px; }
.mappa-conferma-form { display: contents; }
.mappa-empty-filter { margin: 0; padding: 24px 18px; border: 1px dashed var(--line); border-radius: 10px; color: var(--text-secondary); font-size: 14px; text-align: center; }

.piano-ambiguo-page { display: grid; gap: 16px; }
.piano-ambiguo-page .mappa-lead strong { color: var(--ink); font-weight: 700; }
.piano-ambiguo-table { table-layout: auto; min-width: 1280px; font-size: 13px; }
.piano-ambiguo-table th,
.piano-ambiguo-table td { vertical-align: top; padding-top: 12px; padding-bottom: 12px; }
.piano-ambiguo-desc-cell { min-width: 140px; max-width: 220px; color: var(--text-secondary); font-size: 12px; line-height: 1.45; white-space: normal; }
.piano-ambiguo-importo-cell { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.piano-ambiguo-capitolo-cell { min-width: 140px; max-width: 200px; }
.piano-ambiguo-capitolo-value { display: block; font-weight: 700; color: var(--ink); line-height: 1.35; }
.piano-ambiguo-capitolo-hint { display: block; margin-top: 4px; color: #9a6700; font-size: 11px; font-weight: 600; line-height: 1.3; }
.piano-ambiguo-opera-only-cell { font-weight: 600; color: var(--ink); white-space: nowrap; }
.piano-ambiguo-piano-cell { min-width: 120px; max-width: 160px; color: var(--text-secondary); line-height: 1.35; white-space: normal; }
.piano-ambiguo-select-cell { min-width: 280px; }
.piano-ambiguo-row-form { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.piano-ambiguo-row-form select {
  flex: 1 1 200px; min-width: 0; min-height: 36px; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 13px;
}
.piano-ambiguo-assegna-btn { flex: none; min-height: 36px; padding: 5px 14px; font-size: 13px; white-space: nowrap; }

@media (max-width: 720px) {
  .mappa-stats { grid-template-columns: 1fr; }
  .mappa-listino-summary { flex-wrap: wrap; }
  .mappa-articoli-table th:nth-child(4), .mappa-articoli-table td:nth-child(4) { width: 120px; }
  .mappa-senza-listino-table th:nth-child(5),
  .mappa-senza-listino-table td:nth-child(5) { width: 120px; }
}
.computo-verifica-page { padding: 16px 18px 18px; }
.computo-verifica-page .import-verifica-panel-heading { margin-bottom: 16px; padding: 0; border: none; }
.import-verifica-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.import-verifica-panel-kicker { margin: 0 0 4px; color: var(--text-secondary); font-size: 13px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; }
.import-verifica-panel-title { margin: 0; color: var(--ink); font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.import-verifica-step { margin: 0; color: var(--text-secondary); font-size: 13px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; white-space: nowrap; }
.import-verifica-form { display: grid; gap: 16px; }
.import-verifica-description { margin: 0; color: var(--text-secondary); font-size: 14px; line-height: 1.5; }
.import-verifica-hint { margin: 0; color: var(--text-secondary); font-size: 13px; line-height: 1.5; }
.import-verifica-form-footer { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.import-verifica-mappa-body { display: grid; gap: 14px; }
.import-verifica-mappa-heading { margin: 0; color: var(--ink); font-size: 14px; font-weight: 700; }
.articoli-mancanti-mappa-codici-panel { max-height: none; }
.articoli-mancanti-listini-list { display: grid; gap: 2px; padding-left: 0; list-style: none; }
.articoli-mancanti-listino-item { list-style: none; }
.articoli-mancanti-listino-details > summary { list-style: none; cursor: pointer; }
.articoli-mancanti-listino-details > summary::-webkit-details-marker { display: none; }
.articoli-mancanti-listino-summary { display: flex; align-items: center; gap: 8px; padding: 4px 0; color: #9a6700; font-size: 13px; line-height: 1.55; }
.articoli-mancanti-listino-summary:hover { color: #7c5300; }
.articoli-mancanti-listino-label { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px; min-width: 0; }
.articoli-mancanti-listino-chevron { flex: none; color: var(--muted); font-size: 18px; font-weight: 700; line-height: 1; transition: transform .15s ease; }
.articoli-mancanti-listino-details[open] .articoli-mancanti-listino-chevron { transform: rotate(90deg); }
.articoli-mancanti-mappa-gruppo-count { color: var(--muted); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.articoli-mancanti-mappa-codici { display: grid; gap: 4px; max-height: min(36vh, 280px); margin: 4px 0 8px; padding: 8px 0 8px 12px; border-left: 2px solid color-mix(in oklch, #9a6700 25%, var(--line)); list-style: none; overflow: auto; }
.articoli-mancanti-mappa-codici li { font-size: 13px; line-height: 1.45; }
.articoli-mancanti-codice-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.articoli-mancanti-inserisci-voce { min-height: 32px; padding: 4px 10px; font-size: 13px; white-space: nowrap; }
.import-progress-bar { max-width: 240px; }
.gantt-import-status { margin: 0 0 12px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 2px 12px rgb(0 0 0 / .04); }
.gantt-import-status .import-status-panel { padding: 0; border-top: none; }
.gantt-import-reload-hint { display: block; margin-top: 8px; color: var(--muted); font-size: 13px; }
.prezzario-progress { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.prezzario-progress-bar { display: block; width: 100%; max-width: 140px; height: 5px; margin-top: 6px; border: none; border-radius: 999px; overflow: hidden; }
.prezzario-progress-bar::-webkit-progress-bar { background: var(--surface-muted); border-radius: 999px; }
.prezzario-progress-bar::-webkit-progress-value { background: #9a6700; border-radius: 999px; transition: width 300ms ease; }
.prezzario-progress-bar::-moz-progress-bar { background: #9a6700; border-radius: 999px; }
.table-shell { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 2px 12px rgb(0 0 0 / .04); }
.table-shell .data-table { width: 100%; border-collapse: collapse; border-radius: 0; background: transparent; box-shadow: none; font-size: 16px; }
.table-shell .data-table th { background: var(--surface-muted); }
.table-shell .data-table td { background: var(--surface-soft); vertical-align: middle; }
.projects-table .actions-heading { width: 136px; }
.project-name { display: grid; gap: 2px; }
.project-name > span { color: var(--text-secondary); font-size: 16px; font-weight: 400; }
.project-open-link { display: inline-flex; align-items: center; gap: 5px; color: var(--ink); font-size: 16px; font-weight: 700; text-decoration: none; }
.project-open-link:hover { color: var(--brand); text-decoration: underline; }
.project-open-link svg { width: 13px; height: 13px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.plan-version { color: var(--text-secondary); font-size: 16px; font-weight: 400; }
.status-link { display: inline-flex; align-items: center; gap: 5px; color: var(--brand-mid); font-weight: 700; text-decoration: none; }
.status-link svg, .icon-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.status-link svg { width: 13px; height: 13px; }
.status-link:hover { color: var(--brand); text-decoration: underline; }
.status-muted, .status-pending, .status-error, .status-ok { display: inline-flex; align-items: center; min-height: 22px; font-size: 14px; font-weight: 600; }
.status-muted { color: var(--muted); }
.status-pending { color: #9a6700; }
.prezzario-spinner { width: 12px; height: 12px; flex: none; margin-right: 6px; border-radius: 50%; border: 2px solid #fde68a; border-top-color: #9a6700; animation: gantt-spin .7s linear infinite; }
.button-spinner { display: inline-block; width: 13px; height: 13px; flex: none; margin-right: 7px; vertical-align: -2px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; opacity: .85; animation: gantt-spin .7s linear infinite; }
.status-ok { color: #16a34a; }
.status-error { color: var(--danger); }
.projects-table small.status-error { display: block; margin-top: 3px; font-weight: 500; }
.row-actions { display: flex; justify-content: flex-end; gap: 4px; }
.icon-button { display: grid; width: 32px; min-height: 32px; place-items: center; border-color: transparent; border-radius: 8px; padding: 0; background: transparent; color: var(--muted); font-size: 17px; font-weight: 600; }
.icon-button:hover { border-color: transparent; background: var(--surface-muted); color: var(--brand); }
.icon-button-edit { color: #2563eb; }
.icon-button-edit:hover { background: #eff6ff; color: #1d4ed8; }
.icon-button-upload { color: #b45309; }
.icon-button-upload:hover { background: #fffbeb; color: #92400e; }
.icon-button-danger { color: var(--danger); }
.icon-button-danger:hover { background: #fef2f2; color: var(--danger); }
.table-empty { padding: 48px 16px !important; color: var(--muted) !important; text-align: center; }
.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: rgb(17 24 39 / .28); }
.modal-backdrop[hidden] { display: none; }
.custom-modal { width: min(440px, 100%); overflow: hidden; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); box-shadow: 0 20px 48px rgb(0 0 0 / .14); }
.modal-backdrop[data-modal="create-project"] .custom-modal,
.modal-backdrop[data-modal="edit-project"] .custom-modal,
.modal-backdrop[data-modal="upload-plan"] .custom-modal,
.modal-backdrop[data-modal="delete-project"] .custom-modal,
.modal-backdrop[data-modal="register-sal"] .custom-modal { width: min(620px, 100%); }
.modal-backdrop[data-modal="gtp-bar-detail"] .custom-modal { width: min(520px, calc(100vw - 32px)); }
.modal-backdrop[data-modal="add-riserva"] .custom-modal,
.modal-backdrop[data-modal="edit-riserva"] .custom-modal { width: min(800px, calc(100vw - 32px)); }
.custom-modal header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 16px 13px; border-bottom: 1px solid var(--line); }
.modal-kicker { margin: 0 0 4px; color: var(--faint); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.modal-kicker-danger { color: var(--danger); }
.custom-modal h2 { margin: 0; color: var(--ink); font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.modal-close { display: grid; width: 30px; min-height: 30px; place-items: center; border-color: transparent; border-radius: 8px; padding: 0; background: transparent; color: var(--muted); font-size: 22px; font-weight: 400; line-height: 1; }
.modal-close:hover { border-color: transparent; background: var(--surface-muted); color: var(--ink); }
/* Annulla `form { align-items: end }`: un figlio alto traboccherebbe
   l'area e si disegnerebbe sopra descrizione e filtro. */
.modal-form { display: grid; align-items: stretch; gap: 16px; padding: 20px; }
.modal-form[hidden] { display: none !important; }
.modal-form label { display: grid; gap: 6px; color: var(--text-secondary); font-size: 15px; font-weight: 600; }
.modal-form label[hidden] { display: none !important; }
.modal-backdrop[data-modal="inserisci-voce-manuale"] .custom-modal { width: min(520px, calc(100vw - 32px)); }
.voce-manuale-form { gap: 14px; }
.voce-manuale-field { display: grid; gap: 6px; }
.voce-manuale-field-label { color: var(--text-secondary); font-size: 15px; font-weight: 600; line-height: 1.3; }
.voce-manuale-field input[readonly] { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; background: var(--surface-soft); }
.voce-manuale-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(132px, 38%); gap: 12px; align-items: end; }
.voce-manuale-unita-locked { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.voce-manuale-unita-locked[hidden], .voce-manuale-form select[hidden] { display: none !important; }
.voce-manuale-unita-value { min-width: 0; color: var(--ink); font-size: 15px; font-weight: 600; line-height: 1.35; }
.voce-manuale-unita-badge { flex: none; padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.voce-manuale-form select { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 36px 10px 12px; background: var(--surface); color: var(--ink); font-size: 15px; font-weight: 600; }
.voce-manuale-field-prezzo input { text-align: right; font-variant-numeric: tabular-nums; }
.voce-manuale-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; padding-top: 16px; border-top: 1px solid var(--line); }
@media (max-width: 520px) {
  .voce-manuale-row { grid-template-columns: 1fr; align-items: stretch; }
}
.modal-form label input, .modal-form label textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; color: var(--ink); font-size: 17px; font-weight: 500; line-height: 1.4; }
.modal-form label input:focus-visible, .modal-form label textarea:focus-visible { outline: 0; }
.modal-form label input { min-height: 44px; }
.modal-form textarea { min-height: 80px; resize: vertical; }
.modal-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.modal-form h3 { margin: 0 0 -4px; color: var(--ink); font-size: 13px; font-weight: 700; }
.modal-form .checkbox-field { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.modal-form .checkbox-field input { width: auto; min-height: auto; }
.modal-form .checkbox-field { cursor: pointer; }
.modal-form .checkbox-field input[type="checkbox"],
.modal-form .checkbox-field input[type="radio"] {
  appearance: none; flex: none; display: grid; place-content: center;
  width: 18px; height: 18px; margin: 0; padding: 0;
  border: 1.5px solid var(--line-strong); border-radius: 5px;
  background: var(--surface); cursor: pointer;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.modal-form .checkbox-field input[type="radio"] { border-radius: 50%; }
.modal-form .checkbox-field input:hover { border-color: var(--brand-mid); }
.modal-form .checkbox-field input:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in oklch, var(--brand) 18%, transparent); }
.modal-form .checkbox-field input[type="checkbox"]:checked {
  border-color: var(--brand);
  background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.modal-form .checkbox-field input[type="radio"]:checked {
  border-color: var(--brand); background: var(--brand);
  box-shadow: inset 0 0 0 3.5px var(--surface);
}
.modal-form .checkbox-field input[type="radio"]:checked:focus-visible {
  box-shadow: inset 0 0 0 3.5px var(--surface), 0 0 0 3px color-mix(in oklch, var(--brand) 18%, transparent);
}
.fasi-stima-list { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.fasi-stima-heading, .fasi-stima-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px; align-items: center; gap: 12px; padding: 6px 8px; }
.fasi-stima-heading { color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.fasi-stima-heading span:last-child { text-align: right; }
.fasi-stima-row { border-radius: 6px; }
.fasi-stima-row:hover { background: var(--surface-muted); }
.fasi-stima-row span { min-width: 0; overflow-wrap: anywhere; color: var(--text-secondary); font-size: 14px; font-weight: 500; }
.fasi-stima-row-principale span { color: var(--ink); font-weight: 700; }
.fasi-stima-row:not(.fasi-stima-row-principale) { padding-left: 26px; }
.fasi-stima-row input { width: 90px; min-height: 36px; text-align: right; }
.fasi-stima-row[hidden] { display: none; }
.password-generator { display: flex; align-items: center; gap: 6px; }
.password-generator input { flex: 1; width: auto; min-width: 0; font-variant-numeric: tabular-nums; font-family: ui-monospace, monospace; background: var(--surface-muted); }
.password-generator .icon-button { flex: 0 0 auto; border: 1px solid var(--line); transition: color 150ms ease, border-color 150ms ease, transform 150ms ease; }
.password-generator .icon-button.is-copied { border-color: #16a34a; color: #16a34a; animation: password-copied-pop 300ms ease; }
.password-generator .icon-button.is-spinning svg { animation: password-regenerate-spin 400ms ease; }
@keyframes password-copied-pop { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes password-regenerate-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.file-dropzone { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; min-height: 132px; border: 2px dashed #9ca3af; border-radius: 8px; padding: 18px; background: #f8fafc; color: var(--text-secondary); cursor: pointer; transition: border-color 150ms ease, background-color 150ms ease; }
.file-dropzone:hover, .file-dropzone.is-dragging { border-color: var(--brand); background: var(--surface-muted); }
.file-dropzone input { position: absolute; width: 1px !important; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.file-dropzone svg { width: 24px; height: 24px; fill: none; stroke: var(--brand); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.file-dropzone-copy { display: grid; gap: 3px; }
.file-dropzone-copy strong { color: var(--ink); font-size: 14px; }
.file-dropzone-copy span { color: var(--muted); font-size: 13px; font-weight: 400; }
.file-dropzone-name { grid-column: 1 / -1; overflow: hidden; color: var(--muted); font-size: 13px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.file-dropzone.has-file { border-style: solid; border-color: var(--brand); }
.file-dropzone.has-file .file-dropzone-name { color: var(--brand); font-weight: 700; }
.modal-description { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.modal-hint { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.modal-subtitle { margin: 6px 0 0; color: var(--text-secondary); font-size: 13px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.modal-subtitle:empty { display: none; }
.modal-meta-list { display: table; width: 100%; margin: 0; border: 1px solid var(--line); border-radius: 8px; border-collapse: collapse; background: var(--surface-muted); overflow: hidden; }
.modal-meta-list > div { display: table-row; }
.modal-meta-list > div + div dt,
.modal-meta-list > div + div dd { border-top: 1px solid var(--line); }
.modal-meta-list dt,
.modal-meta-list dd { display: table-cell; padding: 10px 12px; vertical-align: baseline; }
.modal-meta-list dt { width: 1%; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; padding-right: 10px; }
.modal-meta-list dd { margin: 0; min-width: 0; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.modal-meta-list dd[data-computo-voce-prezzo] { white-space: nowrap; font-variant-numeric: tabular-nums; }
.modal-input-with-suffix { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.modal-input-with-suffix:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.modal-form label .modal-input-with-suffix input {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 0;
  padding: 10px 12px;
  text-align: right;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  box-shadow: none;
}
.modal-form label .modal-input-with-suffix input:focus-visible { outline: 0; box-shadow: none; }
.modal-input-suffix { display: grid; place-items: center; min-width: 52px; padding: 0 12px; border-left: 1px solid var(--line); background: var(--surface-muted); color: var(--muted); font-size: 13px; font-weight: 700; white-space: nowrap; }
.modal-form label:has(.modal-input-with-suffix) { gap: 8px; }
.gtp-bar-detail-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.gtp-bar-detail-item { display: grid; gap: 5px; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 13px 14px; background: var(--surface-soft); }
.gtp-bar-detail-item[hidden] { display: none; }
.gtp-bar-detail-item span { color: var(--faint); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.gtp-bar-detail-item strong { overflow: hidden; color: var(--ink); font-size: 16px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: normal; overflow-wrap: anywhere; }
.gtp-bar-detail-periodo strong { font-size: 15px; }
.gtp-bar-detail-mesi dl { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; margin: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.gtp-bar-detail-mesi dd { margin: 0; color: var(--ink); text-align: right; }
.gtp-month-detail-barre { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.gtp-month-detail-barre td { padding: 3px 0; color: var(--ink); }
.gtp-month-detail-barre td + td { padding-left: 16px; text-align: right; white-space: nowrap; }
.gtp-month-detail-barre td:last-child { color: var(--muted); }
.gtp-month-focus,
.gtp-month-focus:hover,
.gtp-month-focus:focus-visible {
  display: inline; min-height: 0; padding: 0; border: 0; border-radius: 0;
  background: none; color: inherit; font: inherit; line-height: inherit; text-align: inherit; cursor: pointer;
}
.gtp-month-focus:hover, .gtp-month-focus:focus-visible { outline: none; text-decoration: underline; text-underline-offset: 3px; }
.modal-error { margin: 0; padding: 10px 12px; border-radius: 8px; background: #fef2f2; color: var(--danger); font-size: 14px; font-weight: 600; }
.modal-warning[hidden] { display: none; }
.modal-warning { display: grid; gap: 10px; padding: 12px 14px; border: 1px solid color-mix(in oklch, #9a6700 35%, var(--line)); border-radius: 10px; background: #fffbeb; }
.modal-warning.is-info-only { border-color: color-mix(in oklch, var(--success) 35%, var(--line)); background: color-mix(in oklch, var(--success) 8%, var(--surface)); }
.modal-warning-info { margin: 0; color: var(--success); font-size: 13px; font-weight: 600; line-height: 1.5; }
.modal-warning-heading { margin: 0; color: #9a6700; font-size: 13px; font-weight: 600; line-height: 1.5; }
.modal-warning-hint { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.modal-warning-list { margin: 8px 0 0; padding-left: 1.25em; color: #9a6700; font-size: 13px; line-height: 1.55; }
.modal-warning-info-list { margin: 4px 0 0; padding-left: 1.25em; color: var(--success); font-size: 13px; line-height: 1.55; }
.modal-warning-info-list[hidden] { display: none; }
.modal-warning-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.modal-warning-actions .button { min-height: 36px; padding: 7px 14px; font-size: 14px; }
.modal-form footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 2px; }
.custom-modal .button { min-height: 40px; padding: 9px 16px; font-size: 15px; font-weight: 600; }
.secondary-action { border-color: var(--line); background: var(--surface); color: var(--text-secondary); }
.secondary-action:hover { border-color: var(--line-strong); background: var(--surface-muted); color: var(--ink); }
.danger-action { border-color: var(--danger); background: var(--danger); color: #fff; }
.danger-action:hover { border-color: #b91c1c; background: #b91c1c; }
body.modal-open { overflow: hidden; }
.page-surface table:not(.gtp-table) { width: 100%; overflow: hidden; border-collapse: separate; border-spacing: 0; border-radius: 12px; background: var(--surface); box-shadow: 0 2px 12px rgb(0 0 0 / .06); font-size: 16px; }
.page-surface table:not(.gtp-table) th { padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--faint); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
.page-surface table:not(.gtp-table) td { padding: 16px; border-bottom: 1px solid var(--line); color: var(--text-secondary); vertical-align: top; line-height: 1.45; }
.page-surface table:not(.gtp-table) tr:last-child td { border-bottom: 0; }
.page-surface table:not(.gtp-table) tbody tr:hover td { background: var(--surface-soft); }
.form-feedback { margin: 0 0 12px; color: var(--danger); font-size: 13px; }
.form-feedback.success { color: var(--success); }
progress { width: min(250px, 100%); height: 7px; accent-color: var(--brand); }

.login-page { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: var(--canvas); }
.login-panel { width: min(420px, 100%); padding: 32px; border-radius: 16px; background: var(--surface); box-shadow: 0 24px 64px rgb(0 0 0 / .10); }
.login-panel h1 { margin: 0 0 8px; color: var(--ink); font-size: 27px; font-weight: 800; letter-spacing: -.03em; }
.login-panel > p { margin: 0 0 24px; color: var(--muted); }
.login-panel form { display: block; }
.form-field { margin-bottom: 14px; }
.form-field label { display: block; margin-bottom: 6px; color: var(--faint); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.login-panel .login-input { display: block; width: 100%; min-height: 43px; border-radius: 10px; background: var(--surface-soft); }
.login-panel button { width: 100%; margin-top: 4px; border-color: var(--accent); background: var(--accent); color: var(--surface); }
.login-panel button:hover { border-color: var(--accent-dark); background: var(--accent-dark); }

body.sidebar-is-collapsed .app-sidebar { width: 76px; }
body.sidebar-is-collapsed .workspace-main { margin-left: 100px; }
body.sidebar-is-collapsed .app-brand { justify-content: center; padding-right: 8px; padding-left: 8px; }
body.sidebar-is-collapsed .app-brand-name,
body.sidebar-is-collapsed .nav-label,
body.sidebar-is-collapsed .app-nav a:not(.nav-glyph) { }
body.sidebar-is-collapsed .app-brand-name { display: none; }
body.sidebar-is-collapsed .app-nav { padding-right: 10px; padding-left: 10px; }
body.sidebar-is-collapsed .app-nav a { justify-content: center; gap: 0; padding-right: 0; padding-left: 0; font-size: 0; }
body.sidebar-is-collapsed .nav-glyph { font-size: 17px; }
body.sidebar-is-collapsed .logout-form { padding-right: 10px; padding-left: 10px; }
body.sidebar-is-collapsed .secondary-button { justify-content: center; padding-right: 0; padding-left: 0; font-size: 0; }
body.sidebar-is-collapsed .secondary-button span { font-size: 17px; }
body.sidebar-is-collapsed .toggle-collapse { display: none; }
body.sidebar-is-collapsed .toggle-expand { display: block; }

@media (max-width: 768px) {
  .app-sidebar { position: static; width: auto; min-height: auto; margin: 8px; border-radius: 16px; }
  .app-brand { padding-bottom: 12px; }
  .app-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-bottom: 12px; }
  .nav-label, .logout-form { display: none; }
  .app-nav a { justify-content: center; padding: 8px; font-size: 12px; }
  .workspace-main, body.sidebar-is-collapsed .workspace-main { margin-left: 0; }
  .workspace-header { min-height: 56px; padding: 8px 16px 2px; }
  .profile-copy, .profile-chevron { display: none; }
  .app-content { padding: 0; }
  .page-surface { padding: 12px 16px 24px; }
  .sidebar-toggle, .header-divider { display: none; }
  .status-row { grid-template-columns: 1fr; }
  .principale-columns { grid-template-columns: 1fr; }
  .parametri-columns { grid-template-columns: 1fr; }
  .table-toolbar { align-items: stretch; flex-direction: column; }
  .project-filters { width: 100%; }
  .search-field { flex: 1; }
  .quick-actions, .quick-actions .button { width: 100%; }
  .prezzari-toolbar { align-items: stretch; flex-direction: column; }
  .gantt-project-header { grid-template-columns: auto 1fr; }
  .gantt-summary { grid-column: 1 / -1; }
  .prezzari-search { width: 100%; }
  .prezzari-search .search-field { flex: 1; }
  .prezzari-actions, .prezzari-actions .toolbar-action-button { width: 100%; }
  .projects-table { min-width: 680px; }
  .page-surface table:not(.gtp-table) { display: block; overflow-x: auto; white-space: nowrap; }
  .gtp-bar-detail-grid { grid-template-columns: 1fr; }
}

/* Timeline della pagina Gantt (/gantt) come vera tabella a colspan, invece
   dell'overlay a pixel assoluti. Prefisso gtp- ereditato dal prototipo che
   l'ha validata, per non toccare le vecchie regole .gantt-* ancora in uso
   altrove (export PDF/PNG). */
.gtp-table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
.gtp-table th, .gtp-table td { border: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.gtp-table,
.gtp-frozen-grid {
  --gtp-grid-week-line: rgb(17 24 39 / 0.07);
  --gtp-grid-month-line: rgb(17 24 39 / 0.16);
}
/* Griglia settimane solo orizzontale: con repeat-y le celle alte (nome
   su più righe) mostravano falsi "strati" orizzontali dentro la timeline. */
:is(.gtp-bar-track, .gtp-table:not(.gtp-table-fullscreen) thead tr:last-child, .gtp-frozen-head-x-inner thead tr:last-child) {
  background-repeat: repeat-x;
}
/* Bordi verticali solo dal gradient: i 1px per cella nel thead
   sfasavano le colonne settimana rispetto al background del body.
   Stesso motivo sulle celle mese: con border-collapse:separate ogni th
   ha un bordo proprio, quindi SET.right + OTT.left = 2px sul confine
   settimana, 1px più a destra della linea del gradient (ultimo pixel
   della settimana precedente). Il divisore mese sta sul border-right. */
.gtp-table:not(.gtp-table-fullscreen) .gtp-week-cell,
.gtp-table:not(.gtp-table-fullscreen) .gtp-bar-track,
.gtp-frozen-head-x-inner .gtp-week-cell,
.gtp-frozen-main .gtp-bar-track,
.gtp-table .gtp-month-cell {
  border-left-color: transparent;
  border-right-color: transparent;
}
.gtp-table .gtp-month-cell:not(:last-child) {
  border-right-color: var(--gtp-grid-month-line);
}
.gtp-table:not(.gtp-table-fullscreen) thead tr:last-child .gtp-week-cell:first-child,
.gtp-frozen-head-x-inner thead tr:last-child .gtp-week-cell:first-child,
.gtp-table:not(.gtp-table-fullscreen) thead .gtp-col-pct + .gtp-month-cell,
.gtp-frozen-head-x-inner thead .gtp-month-cell:first-child {
  border-left-color: var(--line);
}
.gtp-table:not(.gtp-table-fullscreen) tbody .gtp-bar-track,
.gtp-frozen-main tbody .gtp-bar-track {
  border-left-color: var(--line);
}
.gtp-table thead th {
  position: sticky; top: 0; z-index: 3; background: var(--surface-muted);
  padding: 6px 8px; text-align: center; font-size: 11px; font-weight: 700;
  color: var(--text-secondary); text-transform: uppercase; letter-spacing: .04em;
}
/* Riga mesi + riga settimane sticky entrambe: la riga 2 deve agganciarsi
   sotto la riga 1, non sovrapporla. Altezza NON forzata via CSS (un
   rowspan=2 su "Categoria" con height fissa creava un conflitto di
   layout — la cella andava in overlap con la riga 2): l'offset è
   calcolato a runtime dallo script in fondo alla pagina, in base
   all'altezza reale della riga 1. */
.gtp-table thead tr:last-child th { top: var(--gtp-thead-row1-height, 32px); }
.gtp-table:not(.gtp-table-fullscreen) thead tr:last-child {
  background-color: var(--surface-muted);
  background-image: var(--gtp-timeline-grid-bg);
}
.gtp-table:not(.gtp-table-fullscreen) thead tr:last-child th {
  background: transparent;
  border-top: none;
}
.gtp-frozen-head-x-inner thead tr:last-child th { border-top: none; }
.gtp-table thead .gtp-month-cell {
  border-bottom: 1px solid var(--line-strong);
  text-align: left;
}
.gtp-week-cell { width: 34px; font-size: 10px; color: var(--muted); }
.gtp-col-nome { position: sticky; left: 0; z-index: 4; min-width: 220px; max-width: 220px; white-space: normal; background: var(--surface); text-align: left; padding: 4px 10px; font-size: 12px; color: var(--ink); line-height: 1.25; }
.gtp-table td.gtp-col-nome, .gtp-table th.gtp-col-nome { white-space: normal; overflow-wrap: break-word; }
thead .gtp-col-nome { z-index: 5; background: var(--surface-muted); }
.gtp-col-num { min-width: 76px; text-align: right; padding: 4px 8px; font-size: 12px; color: var(--ink); line-height: 1.2; }
.gtp-row-principale > td { font-weight: 700; }
.gtp-row-principale > td:not(.gtp-bar-track) { background: var(--surface-muted); }
.gtp-row-principale > .gtp-col-nome { background: var(--surface-muted); }
.gtp-row-principale:not(.gtp-row-macro) > .gtp-bar-track { background-color: var(--surface-muted); }
.gtp-bar-track {
  position: relative; padding: 0; min-height: 24px;
  background-color: var(--surface);
  background-image: var(--gtp-timeline-grid-bg);
}
.gtp-bar-track.has-confronto { min-height: 32px; }
.gtp-bar-track.has-confronto .gtp-bar-cell {
  top: 30%; height: 12px; transform: translateY(-50%);
}
.gtp-bar-track.has-confronto .gtp-bar-cell-figlio {
  top: 30%; height: 8px;
}
.gtp-bar-track.has-confronto .gtp-bar-confronto {
  top: 72%; bottom: auto; height: 7px; transform: translateY(-50%);
}
.gtp-row-sal > .gtp-bar-track { background-color: var(--surface-soft); }
.gtp-milestone {
  position: absolute; top: 0; bottom: 0; left: 0; width: 0;
  pointer-events: none;
}
.gtp-milestone-line {
  position: absolute; top: 0; bottom: 0; left: 0; z-index: 1; width: 0; margin-left: -1px;
  border-left: 2px solid #b45309; opacity: .45; pointer-events: auto; cursor: pointer;
}
.gtp-milestone-line::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: -5px; width: 10px;
}
.gtp-milestone-marker {
  position: absolute; top: 50%; left: 0; z-index: 2; width: 9px; height: 9px; max-height: 9px; bottom: auto;
  margin-top: -5px; margin-left: -4.5px;
  background: #b45309; border: 1.5px solid var(--surface); transform: rotate(45deg);
  pointer-events: auto; cursor: pointer;
}
.gtp-milestone-overlay .gtp-milestone-marker {
  top: calc(var(--gtp-thead-row1-height, 32px) + var(--gtp-week-row-height, 32px) / 2);
  margin-top: -5px;
}
/* Riga di progetto per i SAL confermati (deciso con Giorgio 2026-08-16):
   una sola riga in cima alla griglia, non ancorata a una fase — un
   pallino per SAL, posizionato sulla data di chiusura del periodo. */
.gtp-row-sal > .gtp-col-nome { font-weight: 700; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.gtp-row-sal > td:not(.gtp-bar-track) { background: var(--surface-soft); border-bottom: 1px solid var(--line-strong); }
.gtp-sal-marker {
  position: absolute; top: 50%; width: 9px; height: 9px; margin-top: -5px; margin-left: -4.5px;
  border-radius: 50%; background: var(--brand); border: 1.5px solid var(--surface); pointer-events: none;
}
/* Barra corrente e barra di confronto "T precedente" (deciso con Giorgio
   2026-08-14) vivono nella stessa cella (.gtp-bar-track, colspan su tutte
   le settimane), posizionate in percentuale invece che impilate su righe
   separate — la corrente più in alto/spessa, il confronto una striscia
   sottile più in basso nella stessa cella, cosi' si sovrappongono quando
   le date coincidono invece di scorrere una sotto l'altra. */
.gtp-bar-cell { position: absolute; top: 50%; height: 16px; border-radius: 4px; background: var(--brand); box-shadow: 0 1px 3px rgb(0 0 0 / .12); cursor: pointer; transform: translateY(-50%); }
.gtp-bar-cell-figlio { top: 50%; height: 9px; border-radius: 3px; background: var(--brand-mid); box-shadow: none; opacity: .85; }
.gtp-bar-confronto { position: absolute; bottom: 3px; height: 5px; border-radius: 3px; background: #eab308; opacity: .85; pointer-events: none; }
.confronto-nascosto .gtp-bar-confronto { display: none; }

.gtp-col-nome-content { display: flex; align-items: center; gap: 6px; }

/* Tooltip unico, appeso a <body> e posizionato via JS (script in
   gantt.html) invece che dentro la cella: un tooltip
   position:absolute dentro una td viene tagliato/coperto dalle colonne e
   dall'header sticky indipendentemente dallo z-index (limite strutturale
   di overflow:auto/hidden sugli antenati .gantt-scroll/.table-shell — bug
   osservato). position:fixed su un nodo a livello body scavalca il
   problema. Il click sulla barra apre il modale con i dettagli della lavorazione. */
.gtp-tooltip-float {
  position: fixed; z-index: 1000;
  display: grid; gap: 2px; min-width: 170px; max-width: 260px; padding: 8px 10px; border-radius: 8px;
  background: var(--brand); color: var(--surface); font-size: 11px; line-height: 1.4;
  box-shadow: 0 4px 16px rgb(0 0 0 / .2); text-align: left;
  pointer-events: none;
}
.gtp-tooltip-float strong { font-size: 12px; font-weight: 700; }
.gtp-tooltip-float .gtp-tooltip-importo { font-size: 12px; font-weight: 700; }
.gtp-tooltip-float .gtp-tooltip-confronto-importo { color: #fde047; font-weight: 600; }
.gtp-tooltip-float .gtp-tooltip-delta { font-weight: 700; }
.gtp-tooltip-float--milestone { background: #92400e; }
.gtp-bar-cell { overflow: hidden; }
.gtp-bar-importo-label {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-start;
  padding: 0 6px; font-size: 10px; font-weight: 700; color: #fff; pointer-events: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gtp-bar-cell-figlio .gtp-bar-importo-label { font-size: 9px; padding: 0 4px; }
.gtp-col-importo { font-weight: 700; color: var(--ink); }
.gtp-col-stack {
  display: grid; gap: 0; white-space: normal; line-height: 1.1;
  min-width: 88px; padding-top: 3px !important; padding-bottom: 3px !important;
  font-variant-numeric: tabular-nums;
}
.gtp-col-stack .gtp-col-primary { display: block; font-size: 12px; font-weight: 700; line-height: 1.2; }
.gtp-col-stack .gtp-col-confronto { display: block; color: #ca8a04; font-size: 10px; font-weight: 600; line-height: 1.15; }
.gtp-col-stack .gtp-col-delta { display: block; color: var(--muted); font-size: 10px; font-weight: 600; line-height: 1.15; }
.confronto-nascosto .gtp-col-confronto,
.confronto-nascosto .gtp-col-delta { display: none; }
.gtp-bar-detail-confronto-block #gtp-bar-detail-confronto-importo { color: #ca8a04; }
.gtp-tooltip-float[hidden] { display: none; }
.gtp-row-toggle { display: inline-flex; flex: none; align-self: center; align-items: center; justify-content: center; width: 20px; height: 20px; min-height: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); padding: 0; color: var(--text-secondary); }
.gtp-row-toggle:hover { border-color: var(--line-strong); background: var(--surface-muted); color: var(--ink); }
.gtp-row-toggle svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform 150ms ease; }
.gtp-row-toggle.is-open svg { transform: rotate(90deg); }
.gtp-row-figlio > .gtp-col-nome { padding-left: calc(28px + var(--gtp-depth, 0) * 14px); color: var(--text-secondary); font-weight: 400; }
.gtp-row-figlio.gtp-row-sommario > .gtp-col-nome { color: var(--ink); font-weight: 600; }
.gtp-bar-cell-figlio.gtp-bar-cell-sommario { height: 5px; border-radius: 2px; background: var(--brand); opacity: 1; }
.gtp-row-loading > td { background: var(--surface); color: var(--muted); font-size: 12px; font-style: italic; }
.gtp-row-loading .gantt-spinner { width: 13px; height: 13px; display: inline-block; vertical-align: -2px; margin-right: 7px; }
.gtp-empty-child { color: var(--muted); font-size: 12px; font-style: italic; }
.gtp-row-principale.is-open > .gtp-col-nome { border-left: 3px solid var(--brand); }
.gtp-row-figlio[data-parent-of] > .gtp-col-nome { border-left: 3px solid var(--line-strong); }

@keyframes gtp-row-enter {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.gtp-row-figlio.is-entering, .gtp-row-loading.is-entering { animation: gtp-row-enter 220ms ease-out; }

.gtp-row-principale { cursor: pointer; }
.gtp-row-principale.is-selected > td:not(.gtp-bar-track) { background: var(--surface-soft); }
.gtp-row-principale.is-selected > .gtp-bar-track { background-color: var(--surface-soft); }
.gtp-row-principale.is-selected > .gtp-col-nome { border-left: 3px solid var(--brand); }

.gtp-section-shell { padding: 0; }
.gtp-section-placeholder { padding: 28px 18px; color: var(--muted); font-size: 13px; text-align: center; }
.gtp-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 13px 18px 11px; border-bottom: 1px solid var(--line); background: var(--surface); }
.gtp-section-heading h3 { margin: 0; color: var(--ink); font-size: 14px; font-weight: 700; }
.gtp-section-heading p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.gtp-section-heading .icon-button { flex: none; }

.gantt-tutte-fasi-shell { overflow: visible; }
body.gantt-tutte-fasi-fullscreen {
  overflow: hidden;
  background: var(--canvas, #eef2f7);
}
body.gantt-tutte-fasi-fullscreen .app-sidebar,
body.gantt-tutte-fasi-fullscreen .workspace-header { display: none; }
body.gantt-tutte-fasi-fullscreen .workspace-main,
body.gantt-tutte-fasi-fullscreen.sidebar-is-collapsed .workspace-main { margin-left: 0; }
body.gantt-tutte-fasi-fullscreen .app-content {
  display: flex; flex-direction: column; min-height: 0; height: 100vh;
}
body.gantt-tutte-fasi-fullscreen .page-surface {
  display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0;
  height: auto; padding: 0; overflow: hidden; box-sizing: border-box;
  background: transparent;
}
body.gantt-tutte-fasi-fullscreen .page-surface .gtp-workspace {
  flex: 1 1 auto; min-height: 0; height: auto;
  gap: 12px;
}
body.gantt-tutte-fasi-fullscreen .page-surface .form-feedback {
  flex: none; margin: 8px 8px 0;
}
.page-surface .gtp-workspace,
.page-surface .gtp-frozen-grid,
.page-surface .gtp-table {
  box-shadow: none;
  border-radius: 0;
}
.page-surface .gtp-table:not(.gtp-table-fullscreen) th {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-align: center;
  text-transform: uppercase;
  vertical-align: middle;
  line-height: 1.4;
}
.page-surface .gtp-table:not(.gtp-table-fullscreen) .gtp-month-cell {
  text-align: left;
  border-bottom-color: var(--line-strong);
}
.page-surface .gtp-table:not(.gtp-table-fullscreen) td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 12px;
  vertical-align: middle;
  line-height: 1.2;
}
.page-surface .gtp-table:not(.gtp-table-fullscreen) .gtp-col-nome {
  padding: 4px 10px;
  text-align: left;
  font-size: 12px;
  line-height: 1.25;
}
.page-surface .gtp-table:not(.gtp-table-fullscreen) .gtp-col-stack td,
.page-surface .gtp-table:not(.gtp-table-fullscreen) td.gtp-col-stack {
  white-space: normal;
}
.gtp-fullscreen-page {
  display: flex; height: 100%; min-height: 0; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface);
  box-shadow: 0 20px 48px rgb(0 0 0 / .14);
}
.gtp-fullscreen-page--flat {
  border: none; border-radius: 0; box-shadow: none; background: var(--surface);
}
.gtp-fullscreen-page-header--flat { align-items: center; }
.gtp-fullscreen-page-title {
  display: flex; align-items: center; gap: 12px; min-width: 0;
}
.gtp-fullscreen-page-header {
  display: flex; flex: none; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 16px 16px 13px; border-bottom: 1px solid var(--line);
}
.gtp-fullscreen-page-header h1 {
  margin: 0; color: var(--ink); font-size: 24px; font-weight: 700; letter-spacing: -.02em;
}
.gtp-fullscreen-page-header .modal-close { text-decoration: none; }
.gtp-fullscreen-page-actions {
  display: flex; flex: none; align-items: center; gap: 8px;
}
.gtp-fullscreen-page .gtp-frozen-grid-fullscreen {
  flex: 1 1 0; min-height: 0; height: 100%;
}
.gtp-frozen-grid-section,
.gtp-frozen-grid-overview {
  --gtp-labels-width: 518px;
}
.gtp-frozen-grid.gtp-frozen-grid-section,
.gtp-frozen-grid.gtp-frozen-grid-overview {
  height: auto;
  min-height: 0;
  max-height: none;
  grid-template-rows: auto max-content;
}
.gtp-frozen-grid-section .gtp-col-nome,
.gtp-frozen-grid-overview .gtp-col-nome {
  min-width: 250px;
  max-width: 250px;
  width: 250px;
}
.gtp-frozen-grid.gtp-frozen-grid-section .gtp-col-giorni,
.gtp-frozen-grid.gtp-frozen-grid-overview .gtp-col-giorni {
  width: 88px;
  min-width: 88px;
  max-width: 88px;
}
.gtp-frozen-grid.gtp-frozen-grid-section .gtp-col-importo,
.gtp-frozen-grid.gtp-frozen-grid-overview .gtp-col-importo {
  width: 128px;
  min-width: 128px;
  max-width: 128px;
}
.gtp-frozen-grid.gtp-frozen-grid-section .gtp-col-pct,
.gtp-frozen-grid.gtp-frozen-grid-overview .gtp-col-pct {
  width: 52px;
  min-width: 52px;
  max-width: 52px;
}
.gtp-fullscreen-legend {
  flex: none; margin: 0; padding: 10px 16px; border-top: 1px solid var(--line);
}
body.viewer-gantt-fullscreen {
  overflow: hidden; margin: 0; background: var(--canvas, #eef2f7);
}
.gtp-workspace,
.viewer-workspace {
  display: flex; height: 100vh; min-height: 0; flex-direction: column;
  padding: 8px; box-sizing: border-box; gap: 0;
  background: var(--surface);
}
.gtp-workspace-header,
.viewer-workspace-header {
  display: flex; flex: none; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 8px 8px 0;
}
.gtp-workspace-title {
  display: flex; align-items: center; gap: 12px; min-width: 0;
}
.gtp-workspace-actions,
.viewer-workspace-actions {
  display: flex; flex: none; align-items: center; gap: 8px;
}
.gtp-workspace-header h1,
.viewer-workspace-header h1 {
  margin: 0; color: var(--ink); font-size: 24px; font-weight: 700; letter-spacing: -.02em;
}
.gtp-view-tabs.progetto-tabs,
.viewer-view-tabs.progetto-tabs {
  position: relative; z-index: 5; flex: none; margin: 8px 8px 0; padding: 0;
  background: var(--surface);
}
.gtp-view-tabs .gtp-view-tab,
.viewer-view-tabs .viewer-view-tab {
  border: none; background: none; cursor: pointer; font: inherit;
}
.gtp-view-panels,
.viewer-view-panels {
  position: relative; z-index: 1; flex: 1 1 0; min-height: 0; display: flex; flex-direction: column;
  margin-top: 0; padding: 0 8px 8px; overflow: hidden;
}
.gtp-workspace > .gtp-gantt-panel,
.gtp-gantt-panel.is-active,
.gtp-view-panel.is-active {
  flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
}
.gtp-view-panel:not(.is-active) {
  display: none !important;
}
.gtp-gantt-panel .gtp-frozen-grid-fullscreen,
.gtp-gantt-panel .gtp-frozen-grid-fullscreen {
  flex: 1 1 0; min-height: 0; height: 100%;
}
.gtp-gantt-panel {
  min-height: 0;
}
.gtp-gantt-panel .gtp-bar-cell { cursor: pointer; }
.gtp-gantt-panel[data-gtp-bar-readonly] .gtp-bar-cell,
[data-gtp-bar-readonly="true"] .gtp-bar-cell { cursor: default; }
.gtp-gantt-note,
.viewer-gantt-note { margin: 4px 0 0; font-size: 13px; }
.gtp-gantt-empty,
.viewer-gantt-empty { margin: 24px 18px; }
.curva-s-section--embedded {
  display: flex; flex: 1 1 0; min-height: 0; flex-direction: column; overflow: hidden;
  padding: 0; background: var(--surface);
}
.curva-s-section--embedded .prezzario-section-heading {
  flex: none; padding: 14px 16px 10px; border-bottom: 1px solid var(--line);
}
.curva-s-section--embedded .curva-s-legend { flex: none; padding: 10px 16px 0; }
.curva-s-section--embedded .curva-s-chart {
  flex: 1 1 0; min-height: 0; padding: 12px 16px 16px; overflow: auto;
}
.viewer-curva-s-section.curva-s-section--embedded { margin-top: 0; }
.gtp-frozen-grid {
  display: grid;
  grid-template-columns: var(--gtp-labels-width, 460px) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  height: calc(100vh - 220px);
  min-height: 320px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  --gtp-labels-width: 460px;
}
.gtp-frozen-grid-fullscreen {
  height: 100%;
  min-height: 0;
}
.gtp-frozen-grid.is-loading > :not(.gtp-frozen-grid-loading) {
  visibility: hidden;
}
.gtp-frozen-grid-loading {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
}
.gtp-frozen-grid:not(.is-loading) .gtp-frozen-grid-loading {
  display: none;
}
.gtp-frozen-corner {
  grid-column: 1; grid-row: 1; z-index: 4; overflow: hidden; min-width: 0;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line-strong);
  background: var(--surface-muted);
}
.gtp-frozen-head-x {
  grid-column: 2; grid-row: 1; z-index: 3; overflow: hidden; min-width: 0;
  border-bottom: 1px solid var(--line-strong); background: var(--surface-muted);
}
.gtp-frozen-head-x-inner { position: relative; will-change: transform; }
.gtp-frozen-head-x-inner .gtp-milestone-overlay {
  z-index: 5; pointer-events: none;
}
.gtp-frozen-head-x-inner thead tr:last-child {
  background-color: var(--surface-muted);
  background-image: var(--gtp-timeline-grid-bg);
}
.gtp-frozen-head-x-inner thead tr:last-child th {
  background: transparent;
}
.gtp-frozen-head-x-inner .gtp-table {
  width: var(--gtp-timeline-width, max-content);
  min-width: var(--gtp-timeline-width, max-content);
}
.gtp-frozen-head-x .gtp-table thead tr:last-child th { top: auto; }
.gtp-frozen-labels-y {
  grid-column: 1; grid-row: 2; z-index: 2; overflow: hidden; min-height: 0;
  border-right: 1px solid var(--line); background: var(--surface);
  box-shadow: 7px 0 10px -10px rgb(17 24 39 / .45);
}
.gtp-frozen-labels-y-inner { will-change: transform; }
.gtp-frozen-milestones {
  grid-column: 2; grid-row: 1 / 3; z-index: 6; position: relative;
  overflow: hidden; min-width: 0; pointer-events: none;
}
.gtp-frozen-milestones .gtp-milestone-overlay {
  z-index: 6; will-change: transform; pointer-events: none;
}
.gtp-frozen-milestones .gtp-milestone-line,
.gtp-frozen-milestones .gtp-milestone-marker {
  pointer-events: auto;
}
.gtp-frozen-main {
  grid-column: 2; grid-row: 2; z-index: 1; overflow: auto; min-width: 0; min-height: 0;
  background: var(--surface);
  position: relative;
}
/* Ordine voluto: a parità di specificità vince l'ultima regola, quindi critica > per area > quasi critica. */
.gtp-show-critica .gtp-bar-cell.is-quasi-critica { background: color-mix(in oklch, var(--danger) 40%, var(--surface)); }
.gtp-show-critica .gtp-bar-cell.is-critica-area { background: var(--warning); }
.gtp-critico-legenda { display: none; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); }
.gtp-show-critica .gtp-critico-legenda { display: inline-flex; }
.gtp-critico-legenda > span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.gtp-critico-legenda i { width: 14px; height: 6px; border-radius: 3px; display: inline-block; }
.gtp-critico-legenda i.is-critica { background: var(--danger); }
.gtp-critico-legenda i.is-critica-area { background: var(--warning); }
.gtp-critico-legenda i.is-quasi-critica { background: color-mix(in oklch, var(--danger) 40%, var(--surface)); }
.gtp-show-critica .gtp-bar-cell.is-critica { background: var(--danger); box-shadow: 0 0 0 2px color-mix(in oklch, var(--danger) 30%, transparent); }
.gtp-links { position: absolute; z-index: 2; overflow: visible; pointer-events: none; }
.gtp-links path { fill: none; stroke: var(--muted); stroke-width: 1.25; }
.gtp-links marker path { fill: var(--muted); stroke: none; }
.gtp-frozen-main .gtp-table {
  width: var(--gtp-timeline-width, max-content);
  min-width: var(--gtp-timeline-width, max-content);
}
.gtp-frozen-main .gtp-bar-track {
  width: var(--gtp-timeline-width, max-content);
  min-width: var(--gtp-timeline-width, max-content);
}
.gtp-frozen-grid .gtp-table { width: max-content; min-width: 100%; }
.gtp-frozen-corner .gtp-table,
.gtp-frozen-labels-y .gtp-table {
  table-layout: fixed;
  width: var(--gtp-labels-width);
  min-width: var(--gtp-labels-width);
  max-width: var(--gtp-labels-width);
}
.gtp-frozen-corner .gtp-col-nome,
.gtp-frozen-labels-y .gtp-col-nome {
  position: static;
  min-width: 280px;
  max-width: min(520px, 38vw);
  width: auto;
  white-space: normal; overflow-wrap: anywhere; word-break: break-word;
  line-height: 1.35;
}
.gtp-frozen-grid .gtp-col-giorni {
  width: 76px;
  min-width: 76px;
  max-width: 76px;
  white-space: nowrap;
}
.gtp-frozen-grid .gtp-col-importo {
  width: var(--gtp-importo-width, 108px);
  min-width: var(--gtp-importo-width, 108px);
  white-space: nowrap;
}
.gtp-frozen-grid .gtp-col-num {
  white-space: nowrap;
}
.gtp-frozen-corner .gtp-table thead th,
.gtp-frozen-head-x .gtp-table thead th {
  position: static;
  top: auto;
}
.gtp-frozen-corner .gtp-frozen-corner-head-cell {
  box-sizing: border-box;
  vertical-align: middle;
  min-height: var(--gtp-frozen-head-height, auto);
}
.gtp-frozen-grid .gtp-row-principale:not(.gtp-row-macro) > .gtp-col-nome,
.gtp-frozen-grid .gtp-row-principale:not(.gtp-row-macro) > .gtp-col-num { background: var(--surface-muted); }
.gtp-frozen-grid .gtp-row-figlio:not(.gtp-row-macro) > .gtp-col-nome,
.gtp-frozen-grid .gtp-row-figlio:not(.gtp-row-macro) > .gtp-col-num { background: var(--surface); }
.gtp-frozen-grid .gtp-row-principale:not(.gtp-row-macro) > .gtp-bar-track,
.gtp-frozen-grid .gtp-row-figlio:not(.gtp-row-macro) > .gtp-bar-track {
  background-color: var(--surface);
  background-image: var(--gtp-timeline-grid-bg);
}
.gtp-frozen-grid .gtp-row-principale.is-selected > .gtp-col-nome,
.gtp-frozen-grid .gtp-row-principale.is-selected > .gtp-col-num { background: var(--surface-soft); }
.gtp-frozen-grid .gtp-row-principale.is-selected > .gtp-bar-track {
  background-color: var(--surface-soft);
  background-image: var(--gtp-timeline-grid-bg);
}
.gtp-frozen-grid .gtp-row-macro > td {
  border-top-color: #cbd5e1; border-bottom-color: #cbd5e1; color: #16243a; font-weight: 700;
}
.gtp-frozen-grid .gtp-row-macro > .gtp-col-nome,
.gtp-frozen-grid .gtp-row-macro > .gtp-col-num {
  background-color: #e8eef6;
  color: #16243a;
}
.gtp-frozen-grid .gtp-row-macro > .gtp-bar-track {
  background-color: #e8eef6;
  background-image: var(--gtp-timeline-grid-bg);
  color: #16243a;
}
.gtp-frozen-grid .gtp-row-macro > .gtp-col-nome { padding-left: 12px; }
.gtp-frozen-grid .gtp-row-sal > .gtp-col-nome,
.gtp-frozen-grid .gtp-row-sal > .gtp-col-num { background: var(--surface-soft); }
.gtp-frozen-grid .gtp-row-sal > .gtp-bar-track {
  background-color: var(--surface-soft);
  background-image: var(--gtp-timeline-grid-bg);
}
