@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Manrope:wght@400;600;700;800&display=swap');

/*
 * Sistema UI ConEco One: token, primitive e componenti condivisi da tutte le pagine.
 * Le composizioni legate ai singoli domini restano nelle sezioni successive del file.
 */

:root {
	--ink: #17241f;
	--ink-soft: #35413c;
	--paper: #f7f3ea;
	--paper-deep: #e7d8c2;
	--paper-light: #fffdf8;
	--orange: #c55b2b;
	--orange-dark: #a7441f;
	--green: #2f6b5b;
	--gold: #c99b3b;
	--red: #b83e32;
	--green-dark: #245346;
	--gold-dark: #78591b;
	--red-dark: #8f2f27;
	--line: rgba(23, 36, 31, .17);
	--muted: #6e736f;
	--radius: 3px;
	--shadow: 0 18px 60px rgba(23, 36, 31, .09);
	--serif: "Manrope", "Inter", system-ui, sans-serif;
	--sans: "Inter", system-ui, sans-serif;
	--page-title-size: clamp(48px, 4vw, 64px);
	--card-title-size: 22px;
	--control-height: 42px;
	--control-padding-inline: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 6px var(--paper-light); }
.visually-hidden { width: 1px; height: 1px; margin: -1px; padding: 0; position: absolute; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ui-icon { width: 22px; height: 22px; display: block; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.skip-link { position: fixed; z-index: 100; top: 12px; left: 12px; padding: 11px 16px; color: var(--paper-light); background: var(--ink); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
#main-content:focus { outline: none; }

.shell { min-height: 100vh; display: flex; flex-direction: column; }
.shell::before { content: ""; position: fixed; z-index: -1; inset: 0; opacity: .17; pointer-events: none; background-image: linear-gradient(rgba(18,33,29,.14) 1px, transparent 1px), linear-gradient(90deg, rgba(18,33,29,.14) 1px, transparent 1px); background-size: 32px 32px; mask-image: linear-gradient(to bottom, black, transparent 70%); }
.shell-header { width: min(1460px, calc(100% - 48px)); margin: 0 auto; min-height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 32px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; min-width: 180px; }
.brand img { flex: 0 0 auto; }
.brand > span { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name { display: inline-flex; align-items: baseline; gap: .28em; font-family: var(--serif); font-size: 17px; letter-spacing: -.035em; }
.brand__name strong { font-weight: 800; }
.brand__name b { color: var(--orange); font-weight: 800; }
.brand > span > small { max-width: 210px; margin-top: 5px; color: var(--muted); font-size: 8px; letter-spacing: .12em; text-transform: uppercase; }
.shell-header__tools { display: flex; align-items: center; gap: clamp(12px, 1.5vw, 24px); }
.main-nav { display: flex; align-items: center; gap: 2px; }
/* Testo e indicatore attivo restano una sola unità anche quando lo spazio si riduce. */
.main-nav a { min-height: 44px; padding: 11px 9px; position: relative; display: inline-flex; flex: 0 0 auto; align-items: center; justify-self: start; color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.main-nav a::after { content: ""; position: absolute; left: 9px; right: 9px; bottom: 5px; height: 2px; background: transparent; }
.main-nav a:hover, .main-nav a.is-active { color: var(--ink); }
.main-nav a.is-active::after { background: var(--orange); }
.shell-login { background: var(--ink); color: var(--paper-light); padding: 10px 18px; border-radius: var(--radius); font-size: 13px; font-weight: 700; }
.shell-login:hover { background: var(--orange-dark); }
.account-menu { display: flex; align-items: center; gap: 9px; border-left: 1px solid var(--line); padding-left: 20px; }
.account-avatar { width: 32px; height: 32px; display: grid; flex: 0 0 auto; place-items: center; background: var(--ink); color: var(--paper-light); border-radius: 50%; font-size: 10px; font-weight: 700; letter-spacing: .05em; }
.account-menu__identity { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.account-menu__identity strong { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.account-menu__identity small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.account-menu__actions { margin-left: 2px; padding-left: 6px; display: flex; align-items: center; gap: 2px; border-left: 1px solid var(--line); }
.account-menu__actions a { min-height: 32px; padding: 6px 5px; display: inline-flex; align-items: center; border-radius: var(--radius); color: var(--muted); font-size: 11px; font-weight: 600; }
.account-menu__actions a:hover { color: var(--ink); background: rgba(255,255,255,.3); }
.nav-toggle { display: none; width: 42px; height: 42px; border: 1px solid var(--line); background: transparent; padding: 11px; }
.nav-toggle span { display: block; height: 2px; background: var(--ink); margin: 5px 0; }
.utility-button { width: 44px; height: 44px; padding: 0; position: relative; display: inline-grid; flex: 0 0 auto; place-items: center; color: var(--muted); background: rgba(255,250,241,.45); border: 1px solid var(--line); border-radius: var(--radius); }
.utility-button:hover { color: var(--ink); background: rgba(255,255,255,.48); border-color: var(--ink); }
.command-trigger { min-width: 44px; min-height: 44px; padding: 8px 9px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: var(--muted); background: rgba(255,250,241,.45); border: 1px solid var(--line); border-radius: var(--radius); font-size: 11px; font-weight: 700; }
.command-trigger:hover { color: var(--ink); border-color: var(--ink); }
.command-trigger__label { display: none; }
.command-trigger kbd { margin-left: 3px; }
kbd { min-width: 20px; min-height: 20px; padding: 2px 5px; display: inline-grid; place-items: center; color: inherit; background: rgba(18,33,29,.07); border: 1px solid currentColor; border-radius: 3px; font: 9px var(--sans); opacity: .72; }
.shell-content { width: min(1460px, calc(100% - 48px)); margin: 0 auto; flex: 1; transition: opacity .16s ease; }
.shell-content[aria-busy="true"] { opacity: .58; pointer-events: none; }
.shell-footer { width: min(1460px, calc(100% - 48px)); margin: 70px auto 0; padding: 24px 0 30px; display: flex; gap: 28px; color: var(--muted); border-top: 1px solid var(--line); font-size: 11px; letter-spacing: .04em; }
.shell-footer a { margin-left: auto; text-decoration: underline; text-underline-offset: 3px; }

/* Centro notifiche condiviso: disclosure al clic, anteprime leggibili e accesso alla pagina completa. */
.notification-center { position: relative; flex: 0 0 auto; }
.notification-trigger__label { display: none; }
.notification-center.is-current .notification-trigger { color: var(--ink); border-color: var(--ink); }
.notification-center.is-current .notification-trigger::after { content: ""; position: absolute; left: 9px; right: 9px; bottom: 3px; height: 2px; background: var(--orange); }
.notification-center .notification-trigger[aria-expanded="true"] { color: var(--ink); background: var(--paper-light); border-color: var(--orange); }
.notification-badge { min-width: 20px; height: 20px; padding: 0 5px; position: absolute; top: -7px; right: -7px; display: grid; place-items: center; color: var(--paper-light); background: var(--orange-dark); border: 2px solid var(--paper); border-radius: 20px; font-size: 9px; font-weight: 800; line-height: 1; }
.notification-popover { width: min(400px, calc(100vw - 28px)); max-height: min(610px, calc(100vh - 110px)); position: absolute; z-index: 50; top: calc(100% + 12px); right: 0; overflow: hidden; display: flex; flex-direction: column; color: var(--ink); background: var(--paper-light); border: 1px solid var(--line); border-top: 4px solid var(--orange); box-shadow: 0 22px 70px rgba(23,36,31,.22); }
.notification-popover__header { min-height: 82px; padding: 16px 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.notification-popover__header h2 { margin: 0; font-family: var(--serif); font-size: 21px; line-height: 1.1; }
.notification-popover__header p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.notification-popover__header form { margin: 1px 0 0; }
.notification-popover__header .text-link { font-size: 11px; white-space: nowrap; }
.notification-preview { min-height: 0; max-height: 406px; overflow-y: auto; flex: 1 1 auto; border-top: 1px solid var(--line); }
.notification-preview__item { border-bottom: 1px solid var(--line); }
.notification-preview__item form { margin: 0; }
.notification-preview__entry { width: 100%; min-height: 92px; padding: 13px 16px; display: grid; grid-template-columns: 4px minmax(0, 1fr); align-items: stretch; gap: 12px; color: inherit; background: transparent; border: 0; border-radius: 0; font: inherit; text-align: left; }
a.notification-preview__entry, button.notification-preview__entry { cursor: pointer; }
a.notification-preview__entry:hover, button.notification-preview__entry:hover { background: var(--paper); }
.notification-preview__mark { width: 4px; min-height: 100%; background: var(--line); }
.notification-preview__item.is-unread .notification-preview__mark { background: var(--orange); }
.notification-preview__copy { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.notification-preview__meta { width: 100%; margin-bottom: 4px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.notification-preview__meta small { color: var(--orange-dark); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.notification-preview__meta time { flex: 0 0 auto; color: var(--muted); font-size: 10px; }
.notification-preview__copy strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.notification-preview__copy > span:not(.notification-preview__meta, .notification-preview__status) { width: 100%; margin-top: 3px; overflow: hidden; color: var(--muted); display: -webkit-box; font-size: 11px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.notification-preview__status { margin-top: 7px; color: var(--orange-dark); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.notification-preview__empty { margin: 0; padding: 34px 18px; color: var(--muted); font-size: 12px; text-align: center; }
.notification-popover__footer { min-height: 52px; padding: 9px 16px; display: flex; align-items: center; justify-content: space-between; gap: 18px; background: var(--paper); }
.notification-popover__footer a { min-height: 34px; display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; text-decoration: underline; text-decoration-color: var(--orange); text-underline-offset: 4px; }
.notification-popover__footer a:hover { color: var(--orange-dark); }

.command-palette { width: min(680px, calc(100% - 28px)); max-height: min(720px, calc(100vh - 40px)); padding: 0; color: var(--ink); background: transparent; border: 0; overflow: visible; }
.command-palette::backdrop { background: rgba(18,33,29,.72); backdrop-filter: blur(5px); }
.command-palette__surface { max-height: min(720px, calc(100vh - 40px)); padding: 24px; display: flex; flex-direction: column; background: var(--paper-light); border-top: 5px solid var(--orange); box-shadow: 0 28px 90px rgba(0,0,0,.35); }
.command-palette__surface > header { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.command-palette h2 { margin: 0; font-family: var(--serif); font-size: 35px; font-weight: 400; }
.command-palette form { margin: 22px 0 10px; }
.command-palette input { width: 100%; min-height: 56px; padding: 14px 16px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); }
.command-palette nav { min-height: 0; overflow-y: auto; border-top: 1px solid var(--line); }
.command-palette nav a { min-height: 64px; padding: 12px 7px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.command-palette nav a:hover, .command-palette nav a:focus-visible { padding-left: 12px; background: var(--paper); }
.command-palette nav a > span:first-child { min-width: 0; display: flex; flex-direction: column; }
.command-palette nav strong { font-size: 12px; }
.command-palette nav small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.command-palette__empty { margin: 12px 0 0; padding: 15px; color: var(--muted); background: var(--paper); font-size: 11px; }
.command-palette__surface > footer { padding-top: 16px; display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }
.command-palette__surface > footer span { display: flex; align-items: center; gap: 5px; }

.eyebrow { margin: 0 0 13px; color: var(--orange-dark); font-size: 10px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.button { min-height: var(--control-height); padding: 10px 18px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; border: 1px solid transparent; border-radius: var(--radius); font-size: 12px; font-weight: 700; line-height: 1; }
.button--primary { color: var(--paper-light); background: var(--orange-dark); border-color: var(--orange-dark); }
.button--primary:hover { background: var(--ink); border-color: var(--ink); }
.button--ghost { color: var(--ink); background: transparent; border-color: var(--line); }
.button--ghost:hover { border-color: var(--ink); background: rgba(255,255,255,.3); }
.button--wide { width: 100%; }
.button--small { min-height: 40px; padding: 8px 12px; }
.button:disabled { cursor: not-allowed; opacity: .52; }
/* Il menu azioni riutilizzabile contiene i comandi secondari senza alterare aspetto e dimensioni dei pulsanti condivisi. */
.action-menu { position: relative; }
.action-menu > summary { list-style: none; cursor: pointer; }
.action-menu > summary::-webkit-details-marker { display: none; }
.action-menu[open] > summary { border-color: var(--ink); background: rgba(255,255,255,.35); }
.action-menu__panel { width: min(270px,calc(100vw - 32px)); padding: 8px; position: absolute; z-index: 30; top: calc(100% + 8px); right: 0; display: grid; gap: 5px; background: var(--paper-light); border: 1px solid var(--line); box-shadow: 0 18px 52px rgba(23,36,31,.16); }
.action-menu__panel .button { width: 100%; justify-content: flex-start; }
.text-link { display: inline-flex; align-items: center; padding: 0; border: 0; background: transparent; color: var(--ink); font-size: 12px; font-weight: 700; text-decoration: underline; text-decoration-color: var(--orange); text-underline-offset: 5px; }
.text-link:hover { color: var(--orange-dark); }
.action-row { display: flex; align-items: center; gap: 26px; }
.progress { --progress-track: rgba(18,33,29,.12); width: 100%; height: 6px; display: block; overflow: hidden; appearance: none; border: 0; border-radius: 99px; color: var(--orange); background: var(--progress-track); }
.progress--inverse { --progress-track: rgba(255,255,255,.18); }
.progress::-webkit-progress-bar { border-radius: 99px; background: var(--progress-track); }
.progress::-webkit-progress-value { border-radius: 99px; background: var(--orange); }
.progress::-moz-progress-bar { border-radius: 99px; background: var(--orange); }
.badge { min-height: 26px; display: inline-flex; align-items: center; border: 1px solid currentColor; padding: 5px 9px; border-radius: 30px; font-size: 10px; font-weight: 700; letter-spacing: .06em; line-height: 1; text-transform: uppercase; }
.badge--active, .badge--success, .badge--low, .badge--confirmed { color: var(--green-dark); background: #dcebe5; }
.badge--planned, .badge--warning, .badge--high, .badge--draft { color: var(--gold-dark); background: #f0dfb7; }
.badge--suspended, .badge--danger, .badge--urgent, .badge--cancelled { color: var(--red-dark); background: #f9ddd4; }
.badge--completed, .badge--info, .badge--normal, .badge--closed { color: #284e43; background: #d7e6e0; }
.badge--archived, .badge--neutral { color: var(--ink-soft); background: var(--paper-deep); }

/* Ricerca globale: risultati compatti e riconoscibili anche senza affidarsi al colore. */
.global-search-form { margin-bottom: 24px; padding: 24px; background: var(--ink); color: var(--paper-light); }
.global-search-form > label { display: block; margin-bottom: 9px; color: rgba(244,235,221,.7); font-size: 9px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.global-search-form > div { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.global-search-form input { min-width: 0; min-height: 48px; padding: 11px 14px; color: var(--ink); background: var(--paper-light); border: 1px solid transparent; }
.search-results { border-top: 1px solid var(--line); }
.search-result { min-height: 78px; padding: 14px 4px; display: grid; grid-template-columns: 100px 1fr auto; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); }
.search-result:hover { padding-left: 10px; background: rgba(255,250,241,.45); }
.search-result__kind { width: max-content; padding: 5px 8px; color: var(--paper-light); background: var(--ink); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.search-result__kind--issue { background: var(--red); }
.search-result__kind--activity, .search-result__kind--report { background: var(--orange-dark); }
.search-result > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.search-result strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.search-result small { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

/* Metriche: l'aggregazione rende visibili i flussi usati senza mostrare contenuti personali. */
.metrics-page .metric-grid { grid-template-columns: repeat(3, 1fr); }
.usage-route-list article { min-height: 60px; display: grid; grid-template-columns: minmax(200px, 1fr) auto; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); }
.usage-route-list code { overflow-wrap: anywhere; font-size: 11px; }
.usage-route-list span { color: var(--muted); font-size: 10px; }
.usage-route-list span strong { color: var(--ink); font-family: var(--serif); font-size: 23px; font-weight: 400; }

/* La landing usa una composizione editoriale specifica per il dominio dei cantieri. */
.landing { padding-top: 34px; }
.landing-hero { min-height: 650px; display: grid; grid-template-columns: .92fr 1.08fr; align-items: center; gap: 70px; }
.landing-hero__copy { max-width: 650px; padding: 70px 0 90px; }
.landing-hero h1 { font-family: var(--serif); font-size: clamp(72px, 7.8vw, 136px); font-weight: 400; line-height: .79; letter-spacing: -.055em; margin: 0; }
.landing-hero h1 em { color: var(--orange); font-weight: 400; }
.landing-hero__lead { max-width: 570px; margin: 42px 0 34px; color: var(--ink-soft); font-size: 17px; }
.landing-hero__visual { min-height: 520px; position: relative; overflow: hidden; background: var(--ink); box-shadow: var(--shadow); }
.landing-hero__visual::after { content: "CONECO ONE / 01"; position: absolute; left: 35px; bottom: 24px; color: rgba(247,243,234,.45); font-size: 10px; letter-spacing: .2em; }
.blueprint-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(244,235,221,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(244,235,221,.08) 1px, transparent 1px); background-size: 28px 28px; }
.blueprint-grid::before, .blueprint-grid::after { content: ""; position: absolute; border: 1px solid rgba(244,235,221,.18); }
.blueprint-grid::before { width: 48%; height: 58%; right: 9%; top: 12%; }
.blueprint-grid::after { width: 34%; height: 34%; left: 11%; bottom: 12%; }
.signal-card { position: absolute; padding: 22px; background: var(--paper-light); color: var(--ink); box-shadow: 0 16px 42px rgba(0,0,0,.22); }
.signal-card span, .signal-card small { display: block; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.signal-card strong { font-family: var(--serif); font-weight: 400; line-height: .9; }
.signal-card--main { left: 9%; top: 13%; width: 54%; padding: 30px; }
.signal-card--main strong { display: block; margin: 12px 0 22px; font-size: 80px; }
.signal-card--main .progress { margin-bottom: 12px; }
.signal-card--alert { right: 7%; bottom: 17%; width: 33%; background: var(--orange-dark); color: var(--paper-light); }
.signal-card--alert span { color: rgba(255,255,255,.72); }
.signal-card--alert strong { display: block; margin-top: 14px; font-size: 64px; }
.signal-card--date { right: 7%; top: 13%; width: 23%; background: var(--gold); }
.signal-card--date strong { display: block; margin-top: 10px; font-size: 58px; }
.landing-method { margin: 55px 0 110px; padding-top: 72px; border-top: 1px solid var(--line); }
.section-heading h2 { margin: 0; font-family: var(--serif); font-size: clamp(45px, 5vw, 74px); font-weight: 400; line-height: .95; letter-spacing: -.035em; }
.section-heading--inline { display: flex; align-items: end; justify-content: space-between; }
.benefit-grid { margin-top: 55px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.benefit-card { min-height: 270px; padding: 32px; background: var(--paper); }
.benefit-card > span { display: block; color: var(--orange); font-family: var(--serif); font-size: 38px; }
.benefit-card h3 { margin: 60px 0 12px; font-family: var(--serif); font-size: 29px; font-weight: 400; line-height: 1.05; }
.benefit-card p { max-width: 320px; color: var(--muted); margin: 0; }

.narrow-page { max-width: 680px; margin: 120px auto; padding: 60px; background: var(--ink); color: var(--paper-light); }
.narrow-page h1 { font-family: var(--serif); font-size: 55px; font-weight: 400; line-height: 1; }
.status-orb { width: 12px; height: 12px; border-radius: 50%; background: #76b98c; box-shadow: 0 0 0 8px rgba(118,185,140,.15); margin-bottom: 34px; }
.error-page { width: min(720px, calc(100% - 40px)); margin: 15vh auto; border-left: 5px solid var(--orange); padding: 30px 45px; }
.error-page > span { color: var(--orange); font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.error-page h1 { max-width: 650px; font-family: var(--serif); font-size: 62px; font-weight: 400; line-height: 1; }

.auth-page { min-height: calc(100vh - 180px); display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 90px; padding: 70px 6vw; }
.auth-page__intro { max-width: 650px; }
.auth-page__intro h1 { margin: 0; max-width: 620px; font-family: var(--serif); font-size: clamp(64px, 7vw, 100px); font-weight: 400; line-height: .86; letter-spacing: -.04em; }
.auth-page__intro > p:not(.eyebrow) { max-width: 500px; margin-top: 32px; color: var(--muted); font-size: 17px; }
.auth-rule { margin-top: 54px; display: flex; align-items: center; gap: 16px; }
.auth-rule span { width: 80px; height: 2px; background: var(--orange); }
.auth-rule small { color: var(--muted); letter-spacing: .05em; }
.form-card { padding: 40px; background: var(--paper-light); border: 1px solid var(--line); box-shadow: var(--shadow); }
.auth-form { display: grid; gap: 24px; max-width: 460px; }
.auth-form h2 { margin: 0; font-family: var(--serif); font-size: 46px; font-weight: 400; }
label { display: grid; gap: 8px; color: var(--ink-soft); font-size: 12px; font-weight: 700; letter-spacing: .03em; }
input, select, textarea { width: 100%; min-height: var(--control-height); border: 1px solid rgba(18,33,29,.28); border-radius: var(--radius); padding: 10px var(--control-padding-inline); color: var(--ink); background: #fffdf8; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(233,93,42,.12); }
textarea { resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 18px; padding: 0; accent-color: var(--orange-dark); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--red); }
.form-alert, .notice { padding: 13px 15px; color: #78291f; background: #f9ddd4; border-left: 3px solid var(--red); font-size: 12px; }
.notice { margin: 20px 0; color: #245346; background: #dcebe5; border-color: var(--green); }
.field-error { color: var(--red); font-weight: 500; }

/* Scelte brevi riusabili: i radio restano nativi e l'intera etichetta diventa il controllo. */
.choice-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.choice-field legend { margin-bottom: 8px; color: var(--ink-soft); font-size: 12px; font-weight: 700; letter-spacing: .03em; }
.choice-field > .field-error { margin-top: 8px; display: block; }
.choice-group { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-option { position: relative; display: block; cursor: pointer; }
.choice-option input { width: 1px; height: 1px; min-height: 0; margin: -1px; padding: 0; position: absolute; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.choice-option span { min-height: var(--control-height); padding: 10px 13px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-soft); background: #fffdf8; border: 1px solid rgba(18,33,29,.28); border-radius: var(--radius); font-size: 11px; font-weight: 700; line-height: 1.2; transition: color .16s ease, background .16s ease, border-color .16s ease; }
.choice-option input:checked + span { color: var(--paper-light); background: var(--ink); border-color: var(--ink); box-shadow: inset 0 -3px var(--orange); }
.choice-option input:focus-visible + span { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(233,93,42,.18); }
.choice-option input:checked:focus-visible + span { box-shadow: inset 0 -3px var(--orange), 0 0 0 3px rgba(233,93,42,.18); }
.choice-option input:disabled + span { cursor: not-allowed; opacity: .52; }
.choice-field[aria-invalid="true"] .choice-option span { border-color: var(--red); }
.choice-group--compact { gap: 6px; }
.choice-group--compact .choice-option span { min-height: 40px; padding: 9px 12px; font-size: 11px; }

.app-page { padding: 36px 0 0; }
.app-page--form { max-width: 1050px; margin: 0 auto; }
/* L'ordine DOM resta titolo, descrizione e azioni; la griglia affianca le azioni al titolo solo sui viewport ampi. */
.page-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "back back" "copy actions" "lead lead"; align-items: end; column-gap: clamp(28px, 5vw, 72px); margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid rgba(23,36,31,.18); }
.page-heading__copy { min-width: 0; grid-area: copy; }
.page-heading__actions { grid-area: actions; display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.page-heading h1 { margin: 0; overflow-wrap: anywhere; font-family: var(--serif); font-size: var(--page-title-size); font-weight: 400; line-height: .96; letter-spacing: -.045em; text-wrap: balance; }
.page-heading__lead { max-width: 720px; margin: 12px 0 0; grid-area: lead; color: var(--ink-soft); font-size: 14px; }
.page-heading__meta { max-width: 720px; margin: 13px 0 0; grid-area: lead; color: var(--muted); font-size: 12px; }
.back-link { display: inline-block; margin-bottom: 35px; color: var(--ink-soft); font-size: 11px; text-decoration: underline; text-underline-offset: 4px; }
.page-heading > .back-link { margin-bottom: 22px; grid-area: back; justify-self: start; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.metric { min-height: 175px; padding: 23px; position: relative; overflow: hidden; background: var(--paper-light); border: 1px solid var(--line); }
.metric::after { content: ""; position: absolute; width: 80px; height: 80px; right: -42px; top: -42px; border: 1px solid currentColor; border-radius: 50%; opacity: .18; }
.metric > span { display: block; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.metric strong { display: block; margin: 18px 0 9px; font-family: var(--serif); font-size: 66px; font-weight: 400; line-height: .8; }
.metric small { color: var(--muted); font-size: 11px; }
.metric--dark { color: var(--paper-light); background: var(--ink); border-color: var(--ink); }
.metric--dark > span, .metric--dark small { color: rgba(244,235,221,.65); }
.metric--alert { color: var(--paper-light); background: var(--orange-dark); border-color: var(--orange-dark); }
.metric--alert > span, .metric--alert small { color: var(--paper-light); }
.metric[data-tone="healthy"] { box-shadow: inset 3px 0 var(--green); }
.metric[data-tone="danger"] { box-shadow: inset 3px 0 var(--red); }

/* Barra indicatori condivisa: i toni dichiarano il significato senza dipendere dall'ordine degli elementi. */
.stat-strip { margin-bottom: 22px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.stat-strip__item { min-width: 0; min-height: 118px; padding: 22px; display: flex; flex-direction: column; justify-content: center; color: var(--paper-light); background: var(--ink); text-decoration: none; }
.stat-strip__item[data-tone="subtle"] { background: #263c35; }
.stat-strip__item[data-tone="accent"] { background: #304a40; }
.stat-strip__item[data-tone="paper"] { color: var(--ink); background: var(--paper-light); }
.stat-strip__item[data-tone="danger"] { color: var(--paper-light); background: var(--red); }
.stat-strip__item span { color: inherit; opacity: .82; font-size: 8px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.stat-strip__item strong { margin-top: 8px; overflow-wrap: anywhere; font-family: var(--serif); font-size: clamp(22px, 2.5vw, 38px); font-variant-numeric: tabular-nums; font-weight: 400; line-height: 1; }
.stat-strip__item small { margin-top: 8px; color: inherit; opacity: .82; font-size: 8px; text-transform: uppercase; }
.stat-strip__item[data-tone="danger"] span, .stat-strip__item[data-tone="danger"] small { opacity: 1; }
.stat-strip a.stat-strip__item:hover { box-shadow: inset 0 0 0 2px var(--orange); }
.stat-strip--compact .stat-strip__item { min-height: 90px; padding: 17px 22px; }
.stat-strip--compact .stat-strip__item strong { font-size: clamp(22px, 2vw, 27px); }
.dashboard-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 24px; }
.dashboard-grid--site { grid-template-columns: 1.35fr .65fr; align-items: start; }
.panel { padding: 28px; background: rgba(255,250,241,.74); border: 1px solid var(--line); }
.panel--attention { background: var(--paper-light); }
.panel--wide { min-width: 0; }
.panel__heading { min-height: 53px; margin-bottom: 22px; padding-bottom: 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.panel__heading h2 { margin: 0; }
.panel__heading .eyebrow { margin-bottom: 7px; }
.counter { min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--paper-light); background: var(--orange-dark); font-family: var(--serif); font-size: 20px; }
.empty-state { padding: 28px 0; color: var(--muted); font-size: 13px; }
.attention-list { display: grid; }
.attention-item { min-height: 70px; display: grid; grid-template-columns: 4px 1fr auto; align-items: center; gap: 15px; border-bottom: 1px solid var(--line); }
.attention-item__mark { align-self: stretch; margin: 12px 0; background: var(--gold); }
.attention-item--urgent .attention-item__mark, .attention-item--high .attention-item__mark { background: var(--red); }
.attention-item div { display: flex; flex-direction: column; }
.attention-item small { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.attention-item strong { margin-top: 3px; font-size: 13px; }
.attention-item time { color: var(--muted); font-size: 11px; }
.timeline { display: grid; }
.timeline__item { min-height: 75px; display: grid; grid-template-columns: 12px 1fr auto; gap: 13px; position: relative; }
.timeline__item > span { width: 8px; height: 8px; margin-top: 7px; border: 2px solid var(--orange); border-radius: 50%; background: var(--paper-light); }
.timeline__item > span::after { content: ""; width: 1px; height: 53px; display: block; margin: 7px 0 0 2px; background: var(--line); }
.timeline__item:last-child > span::after { display: none; }
.timeline__item div { display: flex; flex-direction: column; }
.timeline__item small { color: var(--orange-dark); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.timeline__item strong { font-size: 12px; }
.timeline__item p { color: var(--muted); margin: 2px 0 0; font-size: 11px; }
.timeline__item time { color: var(--muted); font-size: 9px; }
.site-strip { margin-top: 58px; }
.site-card-grid { margin-top: 25px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.site-card { min-height: 220px; padding: 25px; background: var(--ink); color: var(--paper-light); border-top: 4px solid var(--orange); }
.site-card:hover { background: var(--ink-soft); }
.site-card__code { color: rgba(244,235,221,.53); font-size: 9px; letter-spacing: .14em; }
.site-card h3 { margin: 40px 0 5px; }
.site-card p { margin: 0 0 26px; color: rgba(244,235,221,.62); font-size: 11px; }
.site-card footer { display: flex; justify-content: space-between; margin-top: 9px; font-size: 11px; }
.site-card footer small { color: rgba(244,235,221,.62); }

/* Il quadro generale separa segnali operativi, stato commerciale e flussi recenti mantenendo la stessa gerarchia visiva. */
.metric-grid--dashboard { grid-template-columns: repeat(5, minmax(0, 1fr)); }
a.metric { display: block; transition: transform .18s ease, box-shadow .18s ease; }
a.metric:hover { z-index: 1; box-shadow: 0 14px 36px rgba(23,36,31,.13); transform: translateY(-2px); }
.dashboard-commercial { margin-bottom: 22px; border: 1px solid var(--line); background: rgba(255,250,241,.58); }
.dashboard-commercial > header { min-height: 90px; padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; gap: 22px; border-bottom: 1px solid var(--line); }
.dashboard-commercial > header h2 { margin: 2px 0 0; font-family: var(--serif); font-size: 27px; font-weight: 400; }
.dashboard-commercial__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.dashboard-commercial__grid a { min-height: 112px; padding: 19px 22px; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label value" "note value"; align-items: center; gap: 4px 20px; background: var(--paper-light); }
.dashboard-commercial__grid a:hover { background: #fff7ea; }
.dashboard-commercial__grid span { grid-area: label; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.dashboard-commercial__grid strong { grid-area: value; font-family: var(--serif); font-size: 50px; font-weight: 400; line-height: 1; }
.dashboard-commercial__grid small { grid-area: note; color: var(--muted); font-size: 10px; }
.dashboard-grid--overview { grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr); align-items: start; }
.dashboard-grid--updates { margin-top: 24px; grid-template-columns: minmax(0, 1.08fr) minmax(380px, .92fr); align-items: start; }
.counter--quiet { color: var(--ink); background: var(--paper-deep); }
.attention-item:hover { background: rgba(197,91,43,.05); }
.attention-item div { min-width: 0; }
.attention-item strong { overflow-wrap: anywhere; }
.deadline-list { display: grid; }
.deadline-list > a { min-height: 78px; padding: 10px 0; display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); }
.deadline-list > a:hover { padding-left: 6px; color: var(--orange-dark); }
.deadline-list time { display: flex; flex-direction: column; }
.deadline-list time strong { color: var(--ink); font-size: 11px; }
.deadline-list time span { margin-top: 2px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.deadline-list > a > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.deadline-list > a > span:nth-child(2) small { color: var(--orange-dark); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.deadline-list > a > span:nth-child(2) strong { margin-top: 3px; overflow-wrap: anywhere; color: var(--ink); font-size: 12px; }
.dashboard-grid--updates .timeline__item { min-height: 98px; }
.dashboard-grid--updates .timeline__item > span::after { height: 76px; }
.dashboard-grid--updates .timeline__item .text-link { width: fit-content; margin-top: 5px; font-size: 9px; }
.dashboard-photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dashboard-photo-grid > a { min-width: 0; position: relative; overflow: hidden; aspect-ratio: 4 / 3; background: var(--ink); }
.dashboard-photo-grid img { width: 100%; height: 100%; display: block; object-fit: cover; opacity: .83; transition: opacity .18s ease, transform .25s ease; }
.dashboard-photo-grid > a:hover img { opacity: .63; transform: scale(1.03); }
.dashboard-photo-grid > a > span { padding: 34px 13px 11px; position: absolute; inset: auto 0 0; display: grid; color: var(--paper-light); background: linear-gradient(transparent, rgba(23,36,31,.92)); }
.dashboard-photo-grid small { font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.dashboard-photo-grid strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-photo-grid time { margin-top: 2px; color: rgba(255,253,248,.7); font-size: 8px; }
.site-card-grid__empty { grid-column: 1 / -1; min-height: 240px; }

.site-list { display: grid; border-top: 1px solid var(--line); }
.site-row { min-height: 142px; display: grid; grid-template-columns: minmax(290px, 1.3fr) .45fr 1fr .65fr 30px; align-items: center; gap: 25px; border-bottom: 1px solid var(--line); }
.site-row:hover { background: rgba(255,250,241,.44); }
.site-row__identity { display: flex; align-items: center; gap: 18px; }
.site-row__identity > span { min-width: 56px; height: 56px; display: grid; place-items: center; background: var(--ink); color: var(--paper-light); font-size: 10px; font-weight: 700; }
.site-row__identity h2 { margin: 0; font-family: var(--serif); font-size: 28px; font-weight: 400; }
.site-row__identity p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.site-row__status { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.site-row__status small { color: var(--muted); font-size: 10px; }
.site-row__progress > div:first-child { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 10px; }
.site-row__signals { display: flex; gap: 16px; }
.site-row__signals span { display: flex; flex-direction: column; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.site-row__signals strong { color: var(--ink); font-family: var(--serif); font-size: 27px; font-weight: 400; line-height: 1; }
.site-row__arrow { font-size: 20px; }
.empty-panel { min-height: 380px; display: grid; place-items: center; align-content: center; text-align: center; border: 1px dashed var(--line); }
.empty-panel > span { color: var(--orange); font-family: var(--serif); font-size: 52px; }
.empty-panel h2 { margin: 5px 0; font-family: var(--serif); font-size: 38px; font-weight: 400; }
.empty-panel p { max-width: 500px; color: var(--muted); }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.form-grid__wide { grid-column: span 1; }
.form-grid__full { grid-column: 1 / -1; }
.form-section-heading { margin: 10px 0 4px; padding: 0 0 16px; display: flex; gap: 17px; border-bottom: 1px solid var(--line); }
.form-section-heading:not(:first-of-type) { margin-top: 35px; }
.form-section-heading > span { color: var(--orange); font-family: var(--serif); font-size: 28px; }
.form-section-heading h2 { margin: 0; font-family: var(--serif); font-size: 28px; font-weight: 400; }
.form-section-heading p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 15px; padding-top: 22px; border-top: 1px solid var(--line); }

.site-hero { min-height: 250px; display: grid; grid-template-columns: 1.2fr .6fr auto; align-items: center; gap: 50px; padding: 45px; background: var(--ink); color: var(--paper-light); }
.site-hero .back-link { color: rgba(244,235,221,.6); margin-bottom: 28px; }
.site-hero__meta { display: flex; align-items: center; gap: 12px; color: rgba(244,235,221,.6); font-size: 9px; letter-spacing: .12em; }
.site-hero h1 { margin: 9px 0 4px; font-family: var(--serif); font-size: clamp(48px, 5vw, 78px); font-weight: 400; line-height: .95; }
.site-hero p { color: rgba(244,235,221,.65); margin: 0; }
.site-hero__progress > span { color: rgba(244,235,221,.58); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.site-hero__progress strong { display: block; margin: 12px 0 17px; font-family: var(--serif); font-size: 74px; font-weight: 400; line-height: .8; }
.site-hero__progress strong small { font-size: 25px; }
.site-hero .button--ghost { color: var(--paper-light); border-color: rgba(255,255,255,.3); }
.site-hero__actions { display: grid; gap: 7px; }
.site-hero__actions .button { justify-content: center; white-space: nowrap; }
.site-facts { display: grid; grid-template-columns: repeat(4, 1fr); margin: 16px 0 24px; background: var(--line); gap: 1px; border: 1px solid var(--line); }
.site-facts div { min-height: 92px; padding: 18px; display: flex; flex-direction: column; background: var(--paper-light); }
.site-facts span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.site-facts strong { margin-top: 8px; font-family: var(--serif); font-size: 23px; font-weight: 400; }
.site-context-nav { margin: -8px 0 24px; display: flex; gap: 6px; overflow-x: auto; }
.site-context-nav a { flex: 0 0 auto; padding: 9px 14px; color: var(--muted); border: 1px solid var(--line); background: rgba(255,250,241,.45); font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.site-context-nav a:hover { color: var(--ink); border-color: var(--orange); }
.view-switcher { display: inline-flex; padding: 3px; gap: 2px; background: rgba(255,250,241,.65); border: 1px solid var(--line); }
.view-switcher button { min-height: 34px; padding: 7px 12px; color: var(--muted); background: transparent; border: 0; font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.view-switcher button.is-active { color: var(--paper-light); background: var(--ink); }
.map-panel { padding: 16px; background: var(--paper-light); border: 1px solid var(--line); }
.map-panel > p { margin: 10px 2px 0; color: var(--muted); font-size: 10px; }
.map-canvas { min-height: min(620px, 65vh); display: grid; place-items: center; background: #e6e0d6; color: var(--muted); }
.map-canvas--detail { min-height: 360px; }
.map-canvas--error { padding: 30px; text-align: center; }
.map-info { min-width: 180px; display: grid; gap: 6px; color: #17241f; font: 12px var(--sans); }
.map-info strong { font-size: 14px; }
.map-info span { color: #6e736f; }
.map-info a { color: #a9441f; }
.site-location { margin: -8px 0 24px; padding: 22px; background: var(--paper-light); border: 1px solid var(--line); }
.site-location__address { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 20px; }
.site-location__address > strong { font-family: var(--serif); font-size: 24px; font-weight: 400; }
.site-location__address > span { grid-column: 1; color: var(--muted); font-size: 10px; }
.site-location__address > div { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-wrap: wrap; gap: 12px; }
.location-field { display: grid; gap: 7px; }
.location-field > label { gap: 8px; }
.coneco-place-autocomplete { width: 100%; color-scheme: light; }
.is-autocomplete-fallback { display: none; }
.location-field__status { color: var(--muted); font-size: 9px; line-height: 1.5; }
.location-field__status[data-tone="success"] { color: var(--green); }
.location-field__status[data-tone="warning"] { color: var(--orange-dark); }
.building-list { display: grid; gap: 14px; }
.building-card { padding: 20px; border: 1px solid var(--line); background: var(--paper-light); }
.building-card > header { display: flex; justify-content: space-between; align-items: center; }
.building-card > header div { display: flex; align-items: baseline; gap: 10px; }
.building-card > header span { color: var(--orange-dark); font-size: 9px; font-weight: 700; }
.building-card > header h3 { margin: 0; }
.building-card__tools { display: flex; align-items: center; gap: 8px; }
.building-card__tools > strong { font-family: var(--serif); font-size: 25px; font-weight: 400; }
.building-card__description { margin: 10px 0 5px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.building-card > .progress { margin: 13px 0; }
.floor-list { display: grid; }
.floor-row { min-height: 55px; display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 12px; border-top: 1px solid var(--line); }
.floor-row__name { display: flex; flex-direction: column; }
.floor-row__name strong { font-size: 11px; }
.floor-row__name small { color: var(--muted); font-size: 9px; }
.unit-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.unit-pill { padding: 4px 7px; border: 1px solid var(--line); color: var(--muted); background: transparent; font: inherit; font-size: 9px; }
.floor-row__actions { display: flex; gap: 5px; }
.unit-pill--available { color: var(--green); border-color: var(--green); }
.unit-pill--sold, .unit-pill--deeded { color: var(--paper-light); background: var(--ink); border-color: var(--ink); }
.unit-pill--optioned, .unit-pill--reserved { color: #78591b; background: #f0dfb7; border-color: #d1ad5e; }
.icon-button { width: 30px; height: 30px; border: 1px solid var(--line); background: transparent; color: var(--orange-dark); }
.icon-button:hover { border-color: var(--orange); background: #f9e2d8; }
.building-card__action { margin-top: 10px; }
.report-weather-field { display: grid; align-content: start; gap: 7px; }
.report-weather-field > label { margin: 0; }
.report-weather-field > .text-link { justify-self: start; }
.report-weather-field > small { color: var(--muted); line-height: 1.45; }
.compact-task-list { display: grid; }
.compact-task { min-height: 63px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.compact-task div { display: flex; flex-direction: column; }
.compact-task small { color: var(--muted); font-size: 9px; }
.compact-task strong { font-size: 11px; }
.compact-task > span { min-width: 39px; color: var(--green); font-family: var(--serif); font-size: 20px; }
.compact-task.is-late > span { color: var(--red); }
.app-dialog { width: min(520px, calc(100% - 30px)); border: 0; padding: 0; background: transparent; }
.app-dialog::backdrop { background: rgba(18,33,29,.76); backdrop-filter: blur(3px); }
.app-dialog form { padding: 30px; display: grid; gap: 18px; background: var(--paper-light); border-top: 5px solid var(--orange); box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.app-dialog h2 { margin: 0; font-family: var(--serif); font-size: 38px; font-weight: 400; }

.filter-bar { margin-bottom: 24px; padding: 16px; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; background: rgba(255,250,241,.78); border: 1px solid var(--line); }
.filter-bar > label:not(.check-label) { min-width: min(100%, 190px); max-width: 320px; flex: 1 1 190px; }
.filter-bar > .check-label { flex: 0 1 auto; }
.filter-bar > .choice-field { flex: 1 1 330px; }
.filter-bar > .button { flex: 0 0 auto; }
.filter-bar--compact { margin-bottom: 0; padding: 0 0 22px; background: transparent; border: 0; border-bottom: 1px solid var(--line); }
.filter-bar--compact > label:not(.check-label) { max-width: 360px; flex: 0 1 360px; }
.check-label { min-height: 44px; padding: 0 4px; display: flex; flex-direction: row; align-items: center; gap: 9px; }
.check-label input { flex: 0 0 auto; }

/* Registri cronologici riusabili per diari, verbali e aggiornamenti operativi. */
.record-feed { margin: 0; padding: 0; list-style: none; }
.record-feed > li { margin: 0; }
.record-entry { min-height: 132px; padding: 22px 8px; display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; align-items: center; gap: 24px; border-bottom: 1px solid var(--line); transition: padding .16s ease, background .16s ease; }
.record-entry:hover { padding-left: 14px; padding-right: 2px; background: rgba(255,250,241,.45); }
.date-tile { width: 62px; height: 76px; display: grid; place-items: center; align-content: center; color: var(--paper-light); background: var(--ink); border-radius: var(--radius); font-variant-numeric: tabular-nums; line-height: 1; }
.date-tile__day { font-family: var(--serif); font-size: 29px; font-weight: 400; }
.date-tile__month { margin-top: 4px; color: var(--paper-light); font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.date-tile__year { margin-top: 4px; color: rgba(244,235,221,.72); font-size: 8px; letter-spacing: .08em; }
.record-entry__body { width: min(100%, 1120px); min-width: 0; display: grid; gap: 5px; }
.record-entry__kicker { color: var(--orange-dark); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.record-entry__title { display: -webkit-box; overflow: hidden; overflow-wrap: anywhere; font-family: var(--serif); font-size: clamp(20px, 1.75vw, 25px); font-weight: 400; line-height: 1.24; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.record-entry__meta { margin-top: 3px; display: flex; flex-wrap: wrap; align-items: center; gap: 5px 9px; color: var(--ink-soft); font-size: 11px; }
/* I separatori rendono i metadati scansionabili senza aggiungere testo ridondante al markup. */
.record-entry__meta > span + span::before { margin-right: 9px; color: var(--muted); content: "\00b7"; }
.record-entry__status { align-self: center; justify-self: end; }

/* Tabelle operative riusabili con celle nominate anche nella resa a schede. */
.data-table { border: 1px solid var(--line); background: rgba(255,250,241,.52); }
.data-table table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.data-table caption { padding: 14px 18px; color: var(--muted); border-bottom: 1px solid var(--line); text-align: left; font-size: 12px; }
.data-table caption strong { color: var(--ink); font-size: 13px; }
.data-table th { height: 46px; padding: 10px 16px; color: var(--muted); text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.data-table td { padding: 18px 16px; vertical-align: middle; border-top: 1px solid var(--line); font-size: 13px; }
.data-table tbody tr:first-child td { border-top: 0; }
.data-table tbody tr:hover td { background: rgba(255,250,241,.72); }
.data-table tbody tr[data-tone="danger"] > :first-child { box-shadow: inset 3px 0 var(--red); }
.data-table tbody tr[data-tone="warning"] > :first-child { box-shadow: inset 3px 0 var(--gold-dark); }
.data-table__primary { width: 32%; }
.data-table__context { width: 14%; }
.data-table__context--wide { width: 24%; }
.data-table__compact { width: 11%; }
.data-table__metric { width: 17%; }
.data-table__actions { width: 26%; }
.data-table__numeric { width: 15%; text-align: right; }
.data-table__numeric > strong { font-family: var(--serif); font-size: 21px; font-variant-numeric: tabular-nums; font-weight: 400; white-space: nowrap; }
.data-table__actions--compact { width: 14%; text-align: right; }
.data-table__title { min-width: 0; display: grid; gap: 5px; }
.data-table__title > strong { font-size: 14px; line-height: 1.3; }
.data-table__title > small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.data-table__badges { margin-top: 3px; display: flex; flex-wrap: wrap; gap: 5px; }
.data-table__date { display: grid; justify-items: start; gap: 7px; }
.data-table__date[data-tone="danger"] time { color: var(--red-dark); font-weight: 700; }
.data-table__progress { display: grid; grid-template-columns: minmax(80px, 1fr) auto; align-items: center; gap: 10px; }
.data-table__progress strong { font-size: 11px; }
.data-table td.data-table__empty { padding: 0; }
/* La variante quiet riduce i bordi quando una tabella è già contenuta in una card o in un pannello. */
.data-table--quiet { background: transparent; border: 0; }
.data-table--quiet th { border-bottom: 1px solid rgba(23,36,31,.11); }
.data-table--quiet td { border-top-color: rgba(23,36,31,.1); }

/* Form compatto riusabile per modifiche contestuali dentro tabelle e liste. */
.inline-form { display: grid; grid-template-columns: minmax(115px, 1fr) minmax(86px, .55fr) auto; align-items: end; gap: 8px; }
.inline-form label { min-width: 0; gap: 4px; font-size: 10px; }
.inline-form input, .inline-form select { min-width: 0; }
.inline-form .button { white-space: nowrap; }
.report-summary { margin-bottom: 22px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.report-summary div { min-height: 100px; padding: 22px; display: flex; flex-direction: column; background: var(--ink); color: var(--paper-light); }
.report-summary span { color: rgba(244,235,221,.6); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.report-summary strong { margin-top: 8px; font-family: var(--serif); font-size: 27px; font-weight: 400; }
.report-sheet { padding: clamp(28px, 5vw, 70px); background: var(--paper-light); border: 1px solid var(--line); box-shadow: var(--shadow); }
.report-sheet > section { padding-bottom: 35px; }
.report-sheet > section > h2 { max-width: 1000px; margin: 0; font-family: var(--serif); font-size: clamp(30px, 3vw, 46px); font-weight: 400; line-height: 1.18; }
.report-sheet__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; padding: 35px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.report-sheet__grid p { white-space: normal; color: var(--ink-soft); }
.report-sheet footer { padding-top: 28px; }
.report-companies { margin: 0; padding: 0; border: 0; }
.report-companies legend { color: var(--ink); font-size: 11px; font-weight: 700; }
.field-hint { margin: 7px 0 14px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.report-companies__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.report-company { min-width: 0; padding: 14px; display: grid; grid-template-columns: minmax(0, 1fr) 92px; align-items: end; gap: 12px; border: 1px solid var(--line); background: rgba(255,250,241,.55); }
.report-company__choice { min-width: 0; display: flex; flex-direction: row; align-items: center; gap: 10px; }
.report-company__choice span { min-width: 0; display: grid; gap: 3px; }
.report-company__choice strong { overflow: hidden; text-overflow: ellipsis; font-size: 11px; white-space: nowrap; }
.report-company__choice small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.report-company__workers { gap: 4px; font-size: 9px; }
.report-company__workers input { min-width: 0; }
.report-presences, .report-photos { padding-top: 35px; border-top: 1px solid var(--line); }
.report-presences__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.report-presences__list div { min-height: 78px; padding: 16px; display: flex; flex-direction: column; justify-content: center; gap: 5px; background: var(--paper); }
.report-presences__list strong { font-size: 12px; }
.report-presences__list span { color: var(--muted); font-size: 10px; }
.report-photos .section-heading { margin-bottom: 18px; }
.report-photos .section-heading h2 { margin: 4px 0 0; font-family: var(--serif); font-size: 30px; font-weight: 400; }
.report-photos .photo-card figcaption { min-height: 72px; align-items: center; }
.report-photos .photo-card figcaption strong { margin: 0; }
.empty-inline { color: var(--muted); font-size: 11px; }

.issue-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.issue-card { min-height: 236px; padding: 19px 21px 17px; display: flex; flex-direction: column; background: var(--paper-light); border: 1px solid var(--line); border-left: 3px solid var(--muted); }
.issue-card--urgent { border-left-color: var(--red); }
.issue-card--high { border-left-color: var(--gold); }
.issue-card--normal { border-left-color: var(--green); }
.issue-card.is-late { background: linear-gradient(90deg,rgba(184,62,50,.035),transparent 18%),var(--paper-light); }
.issue-card > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.issue-card > header > div { display: flex; gap: 10px; color: var(--muted); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.issue-card h2 { margin: 15px 0 6px; }
.issue-card h2 .text-link { font-size: inherit; font-weight: inherit; line-height: inherit; }
.issue-card > p { max-width: 630px; margin: 0; display: -webkit-box; overflow: hidden; color: var(--ink-soft); font-size: 11px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.issue-card__facts { margin-top: 15px; padding: 11px 12px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; background: rgba(23,36,31,.025); border-top: 1px solid rgba(23,36,31,.1); border-bottom: 1px solid rgba(23,36,31,.1); }
.issue-card__facts span { display: flex; flex-direction: column; }
.issue-card__facts small { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.issue-card__facts strong { margin-top: 3px; overflow-wrap: anywhere; color: var(--ink-soft); font-size: 10px; line-height: 1.3; }
.issue-card footer { margin-top: 12px; padding-top: 0; display: flex; align-items: center; gap: 15px; border-top: 0; }
.issue-card footer > span { color: var(--muted); font-size: 9px; }
.issue-card footer .button { margin-left: auto; }
.issue-grid__empty { grid-column: 1 / -1; }

/* I filtri dei problemi specializzano soltanto la disposizione, non l'aspetto dei controlli condivisi. */
.issue-filter-bar { display: grid; grid-template-columns: minmax(185px,.75fr) minmax(500px,1.7fr) minmax(350px,1.25fr) minmax(200px,.9fr); align-items: end; }
.issue-filter-bar > label:not(.check-label), .issue-filter-bar > .choice-field { width: auto; min-width: 0; max-width: none; }
.issue-filter-bar .choice-group { gap: 5px; flex-wrap: nowrap; }
.issue-filter-bar__schedule { grid-column: 1 / 4; display: grid; grid-template-columns: repeat(2,minmax(185px,220px)) max-content; align-items: end; gap: 12px; }
.issue-filter-bar__late { min-height: var(--control-height); padding: 0 var(--control-padding-inline); display: flex; align-items: center; gap: 8px; background: transparent; border: 1px solid var(--line); }
.issue-filter-bar > .button { grid-column: 4; justify-self: end; min-width: 132px; }
.issue-status-badge { color: var(--ink-soft); background: rgba(231,216,194,.65); }
.issue-status-badge[data-status="assigned"] { color: var(--orange-dark); background: rgba(197,91,43,.12); }
.issue-status-badge[data-status="in_progress"] { color: var(--gold-dark); background: rgba(240,223,183,.72); }
.issue-status-badge[data-status="resolved"] { color: var(--green-dark); background: rgba(220,235,229,.9); }
.issue-status-badge[data-status="verified"] { color: var(--paper-light); background: var(--green-dark); }

.photo-gallery-controls { display: grid; grid-template-columns: minmax(180px,.7fr) repeat(2,minmax(280px,1fr)) auto; align-items: end; }
.photo-gallery-controls > label:not(.check-label), .photo-gallery-controls > .choice-field { width: auto; min-width: 0; max-width: none; }
.photo-gallery-controls > .button { justify-self: end; }
.photo-gallery-list { display: grid; gap: clamp(26px,4vw,44px); }
.photo-context-group { display: grid; gap: 14px; }
.photo-context-group__header { min-width: 0; padding-bottom: 12px; display: flex; align-items: end; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.photo-context-group__header h2 { min-width: 0; margin: 0; overflow-wrap: anywhere; font-family: var(--serif); font-size: var(--card-title-size); font-weight: 400; line-height: 1.08; }
.photo-context-group__count { flex: 0 0 auto; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.photo-arrangement-status, [data-photo-arrangement-status] { margin: -9px 0 20px; color: var(--muted); font-size: 10px; line-height: 1.5; }
[data-photo-context-status] { color: var(--muted); font-size: 9px; line-height: 1.5; }
.photo-context-field { min-width: 0; display: grid; align-content: start; gap: 8px; }
.photo-context-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.photo-context-actions[hidden] { display: none; }
.photo-context-actions .text-link { width: fit-content; font-size: 9px; }
.photo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.photo-card { margin: 0; overflow: hidden; background: var(--paper-light); border: 1px solid var(--line); }
.photo-card > a { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--ink); }
.photo-card img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(.84) contrast(1.03); }
.photo-card:hover img { filter: saturate(1) contrast(1); }
.photo-card figcaption { min-height: 82px; padding: 14px; display: flex; justify-content: space-between; gap: 12px; }
.photo-card figcaption div { display: flex; flex-direction: column; }
.photo-card figcaption small { color: var(--orange-dark); font-size: 8px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.photo-card figcaption strong { margin-top: 4px; font-size: 10px; }
.photo-card figcaption div > span { margin-top: 5px; color: var(--green); font-size: 8px; }
.photo-card figcaption time { color: var(--muted); font-size: 9px; white-space: nowrap; }
.photo-grid__empty { grid-column: 1 / -1; }
.upload-drop { min-height: 145px; align-content: center; padding: 25px; border: 1px dashed var(--orange); background: #fff6ea; }
.upload-drop input { padding: 15px; background: transparent; border: 0; }
.upload-drop small { color: var(--muted); font-weight: 400; }
.photo-location-field { padding: 14px; display: grid; align-content: center; gap: 8px; border: 1px solid var(--line); background: rgba(255,250,241,.55); }
.photo-location-field > span { font-size: 11px; font-weight: 700; }
.photo-location-field > div { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.photo-location-field > small { color: var(--muted); font-size: 9px; line-height: 1.5; }
.photo-annotation-launch { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.photo-annotation-launch small { color: var(--muted); }
.photo-annotator { width: min(94vw, 1080px); }
.photo-annotator > div { display: grid; gap: 16px; }
.photo-annotator__tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.photo-annotator__stage { display: grid; place-items: center; max-height: 62vh; overflow: auto; background: var(--ink); }
.photo-annotator canvas { display: block; max-width: 100%; height: auto; cursor: crosshair; touch-action: none; }
.photo-card { position: relative; }
.photo-card__compare { position: absolute; z-index: 2; top: 9px; left: 9px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; color: var(--ink); background: rgba(247, 243, 234, .94); border: 1px solid rgba(23, 36, 31, .16); font-size: 9px; font-weight: 700; }
.photo-card__compare input { margin: 0; }
.photo-compare-status { color: var(--muted); font-size: 11px; }
.photo-comparison { width: min(94vw, 1180px); }
.photo-comparison > div { padding: 30px; display: grid; gap: 18px; background: var(--paper-light); border-top: 5px solid var(--orange); box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.photo-comparison__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.photo-comparison figure { margin: 0; display: grid; gap: 8px; }
.photo-comparison img { width: 100%; max-height: 68vh; object-fit: contain; background: var(--ink); }
.photo-comparison figcaption { color: var(--muted); font-size: 11px; }

.notification-filters { margin-bottom: 18px; display: flex; gap: 6px; }
.notification-filters a { padding: 9px 14px; display: inline-flex; align-items: center; gap: 7px; color: var(--muted); border: 1px solid var(--line); background: rgba(255,250,241,.45); font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.notification-filters a:hover, .notification-filters a.is-active { color: var(--ink); border-color: var(--orange); }
.notification-filters span { min-width: 19px; height: 19px; padding: 0 5px; display: grid; place-items: center; border-radius: 20px; color: var(--paper-light); background: var(--orange-dark); font-size: 9px; }
.notification-list { border-top: 1px solid var(--line); }
.notification-row { min-height: 116px; padding: 20px 0; display: grid; grid-template-columns: 5px minmax(280px, 1fr) 145px 120px; align-items: center; gap: 22px; border-bottom: 1px solid var(--line); }
.notification-row.is-unread { background: rgba(255,250,241,.5); }
.notification-row__mark { align-self: stretch; background: transparent; }
.notification-row.is-unread .notification-row__mark { background: var(--orange); }
.notification-row__content small { color: var(--orange-dark); font-size: 9px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.notification-row__content h2 { margin: 4px 0 2px; font-family: var(--serif); font-size: 25px; font-weight: 400; line-height: 1.1; }
.notification-row.is-unread .notification-row__content h2 { font-weight: 500; }
.notification-row__content p { margin: 0; color: var(--muted); font-size: 11px; }
.notification-row > time { color: var(--muted); font-size: 10px; }
.notification-row > form { display: flex; justify-content: flex-end; }
.notification-row > .text-link { justify-self: end; }

/* Preferenze: matrice dei canali e dispositivi autorizzati restano distinti dalla lista degli avvisi. */
.notification-settings-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(330px, .55fr); align-items: start; gap: 18px; }
.preference-form { padding: 30px; }
.preference-channel-head, .preference-row { display: grid; grid-template-columns: minmax(250px, 1fr) repeat(4, minmax(105px, .42fr)); gap: 12px; align-items: stretch; }
.preference-channel-head { min-height: 38px; padding: 0 15px; align-items: center; color: var(--ink-soft); border-bottom: 1px solid var(--line); font-size: 8px; font-weight: 800; letter-spacing: .09em; text-align: center; text-transform: uppercase; }
.preference-channel-head span:first-child { text-align: left; }
.preference-list { display: grid; }
.preference-row { min-width: 0; margin: 0; padding: 16px 15px; border: 0; border-bottom: 1px solid var(--line); }
.preference-row__copy { align-self: center; padding-right: 10px; }
.preference-row__copy strong { font-family: var(--serif); font-size: 22px; font-weight: 400; line-height: 1; }
.preference-row__copy p { max-width: 420px; margin: 5px 0 0; color: var(--ink-soft); font-size: 10px; line-height: 1.45; }
.channel-choice { min-height: 62px; padding: 9px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--ink-soft); background: rgba(255,255,255,.34); border: 1px solid transparent; text-align: left; }
.channel-choice:hover { border-color: var(--line); }
.channel-choice input { width: 17px; height: 17px; flex: 0 0 auto; padding: 0; accent-color: var(--orange-dark); }
.channel-choice span { display: none; font-size: 10px; }
.channel-choice small { display: block; margin-top: 2px; color: var(--ink-soft); font-size: 8px; font-weight: 500; letter-spacing: 0; }
.channel-choice.is-disabled { opacity: .58; cursor: not-allowed; }
.preference-note { margin: 18px 0 0; color: var(--ink-soft); font-size: 10px; }
.device-panel { padding: 30px; color: var(--paper-light); background: var(--ink); border-color: var(--ink); }
.device-panel .panel__heading { border-color: rgba(244,235,221,.17); }
.device-panel .panel__heading h2 { color: var(--paper-light); }
.device-panel .eyebrow { color: #ffb08e; }
.device-panel .counter { color: var(--ink); background: var(--paper); }
.device-panel__intro { margin: 0 0 24px; color: rgba(244,235,221,.72); font-size: 11px; }
.web-push-card { padding: 18px; color: var(--ink); background: var(--paper-light); }
.web-push-card > div { margin-bottom: 17px; display: flex; align-items: center; gap: 12px; }
.web-push-card > div > div { display: flex; flex-direction: column; }
.web-push-card strong { font-size: 12px; }
.web-push-card small { margin-top: 2px; color: var(--ink-soft); font-size: 9px; }
.push-registration-status { min-height: 17px; margin: 9px 0 0; color: var(--ink-soft); font-size: 9px; }
.device-mark { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; color: var(--paper-light); background: var(--orange-dark); font-family: var(--serif); font-size: 18px; }
.device-list { margin-top: 24px; border-top: 1px solid rgba(244,235,221,.17); }
.device-row { min-height: 80px; padding: 13px 0; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 11px; border-bottom: 1px solid rgba(244,235,221,.17); }
.device-row > div { min-width: 0; display: flex; flex-direction: column; }
.device-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.device-row small { margin-top: 3px; color: rgba(244,235,221,.66); font-size: 8px; }
.device-panel .button--ghost { color: var(--paper-light); border-color: rgba(244,235,221,.3); }
.device-panel .button--ghost:hover { border-color: var(--paper-light); background: rgba(255,255,255,.08); }
.device-list__empty { padding: 25px 4px; color: var(--paper-light); }
.device-list__empty strong { font-family: var(--serif); font-size: 23px; font-weight: 400; }
.device-list__empty p { margin: 6px 0 0; color: rgba(244,235,221,.66); font-size: 10px; }
.delivery-queue-note { margin-top: 22px; padding: 18px; display: grid; grid-template-columns: 1fr auto; color: var(--ink); background: var(--gold); }
.delivery-queue-note span { font-size: 8px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.delivery-queue-note strong { font-family: var(--serif); font-size: 30px; font-weight: 400; line-height: .8; }
.delivery-queue-note p { grid-column: 1 / -1; margin: 10px 0 0; font-size: 9px; }
.delivery-queue-note__secondary { grid-column: 1 / -1; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(23,36,31,.18); font-size: 9px; letter-spacing: 0; text-transform: none; }
.delivery-queue-note__secondary strong { font-family: inherit; font-size: inherit; font-weight: 800; line-height: inherit; }

.document-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.document-card { min-height: 300px; padding: 25px; display: flex; flex-direction: column; background: var(--paper-light); border: 1px solid var(--line); border-top: 4px solid var(--ink); }
.document-card:hover { border-top-color: var(--orange); box-shadow: var(--shadow); }
.document-card.is-expiring { border-top-color: var(--gold); }
.document-card.is-expired { border-top-color: var(--red); }
.document-card > header { display: flex; align-items: center; justify-content: space-between; color: var(--orange-dark); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.document-card > header strong { color: var(--ink); font-family: var(--serif); font-size: 22px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.document-card h2 { margin: 28px 0 7px; }
.document-card > p { margin: 0; color: var(--muted); font-size: 10px; }
.document-card__facts { margin-top: auto; padding-top: 25px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.document-card__facts span { display: flex; flex-direction: column; }
.document-card__facts small { color: var(--muted); font-size: 8px; letter-spacing: .07em; text-transform: uppercase; }
.document-card__facts strong { margin-top: 4px; font-size: 10px; }
.document-card footer { margin-top: 18px; padding-top: 14px; display: flex; justify-content: space-between; color: var(--muted); border-top: 1px solid var(--line); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.document-card.is-expired footer span:first-child { color: var(--red); }
.document-card.is-expiring footer span:first-child { color: #78591b; }
.document-grid__empty { grid-column: 1 / -1; }
.document-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-bottom: 22px; background: var(--line); border: 1px solid var(--line); }
.document-summary div { min-height: 100px; padding: 20px; display: flex; flex-direction: column; background: var(--ink); color: var(--paper-light); }
.document-summary span { color: rgba(244,235,221,.6); font-size: 9px; letter-spacing: .09em; text-transform: uppercase; }
.document-summary strong { margin-top: 8px; font-family: var(--serif); font-size: 25px; font-weight: 400; }
.document-notes { margin-bottom: 22px; padding: 25px; background: var(--paper-light); border-left: 4px solid var(--orange); }
.document-notes p:last-child { max-width: 900px; margin: 0; color: var(--ink-soft); }
.document-versions { margin-top: 22px; }
.document-version { min-height: 82px; display: grid; grid-template-columns: 55px 1fr auto; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); }
.document-version > strong { font-family: var(--serif); font-size: 25px; font-weight: 400; }
.document-version h3 { margin: 0; font-size: 12px; }
.document-version p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.document-version__actions { display: flex; gap: 7px; }

/* Imprese e fornitori: schede compatte, profilo e associazioni ai cantieri. */
.company-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.company-grid__empty { grid-column: 1 / -1; }
.company-card { min-height: 310px; padding: 24px; display: flex; flex-direction: column; color: var(--ink); background: var(--paper-light); border: 1px solid var(--line); text-decoration: none; transition: transform .2s ease, border-color .2s ease; }
.company-card:hover { transform: translateY(-3px); border-color: var(--ink); }
.company-card.is-supplier { border-top: 4px solid var(--gold); }
.company-card.is-supplier .company-card__mark { background: var(--orange-dark); }
.company-card.is-inactive { opacity: .62; }
.company-card > header { display: flex; align-items: flex-start; justify-content: space-between; }
.company-card__mark { width: 48px; height: 48px; display: grid; place-items: center; color: var(--paper-light); background: var(--ink); font-family: var(--serif); font-size: 18px; }
.company-card > div { margin: auto 0; }
.company-card > div p { margin: 0 0 8px; color: var(--orange); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.company-card h2 { margin: 0; }
.company-card > div > span { margin-top: 13px; display: block; color: var(--muted); font-size: 11px; }
.company-card footer { padding-top: 16px; display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); font-size: 9px; text-transform: uppercase; }
.company-card footer span { color: var(--muted); }
.company-profile { margin-bottom: 2px; padding: 34px; display: grid; grid-template-columns: 1fr minmax(180px, .35fr) auto; align-items: end; gap: 35px; color: var(--paper-light); background: var(--ink); }
.company-profile h1 { max-width: 900px; margin: 10px 0 8px; font-family: var(--serif); font-size: clamp(48px, 6vw, 86px); font-weight: 400; line-height: .88; }
.company-profile p { margin: 0; color: rgba(244,235,221,.65); }
.company-profile .back-link { color: rgba(244,235,221,.62); }
.company-profile__status { padding-left: 24px; display: flex; flex-direction: column; border-left: 1px solid rgba(244,235,221,.2); }
.company-profile__status span, .company-profile__status small { color: rgba(244,235,221,.55); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.company-profile__status strong { margin: 8px 0; font-family: var(--serif); font-size: 28px; font-weight: 400; }
.company-facts { margin-bottom: 22px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.company-facts div { min-height: 95px; padding: 20px; display: flex; flex-direction: column; justify-content: center; background: var(--paper-light); }
.company-facts span { color: var(--muted); font-size: 8px; letter-spacing: .1em; text-transform: uppercase; }
.company-facts strong { margin-top: 7px; overflow-wrap: anywhere; font-size: 12px; }
.company-detail-grid { grid-template-columns: minmax(0, 1.6fr) minmax(280px, .6fr); }
.company-operations { margin-top: 18px; padding: 24px; border: 1px solid var(--line); background: rgba(255, 250, 241, .58); }
.company-operations > header h2 { margin: 3px 0 18px; }
.company-operations__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.company-operations__grid > article { display: grid; align-content: start; gap: 7px; }
.company-operations__grid h3 { margin: 0 0 5px; font-size: 14px; }
.company-operations__grid a { display: grid; gap: 3px; padding: 10px; color: inherit; border: 1px solid var(--line); text-decoration: none; }
.company-operations__grid a:hover { border-color: var(--orange-dark); }
.company-operations__grid a span, .company-operations__grid a small { color: var(--muted); font-size: 9px; }
.document-relations { margin-bottom: 18px; padding: 18px; border: 1px solid var(--line); }
.document-relations > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.document-relations a { display: grid; gap: 4px; padding: 12px; color: inherit; background: rgba(255, 250, 241, .7); text-decoration: none; }
.document-relations a span { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.detail-card { padding: 22px; border: 1px solid var(--line); background: rgba(255, 250, 241, .68); }
.detail-card > header h2 { margin: 3px 0 14px; }
/* I titoli delle card condividono sempre scala e peso; i singoli moduli possono variare soltanto spaziatura e struttura. */
.panel__heading h2, .site-card h3, .building-card > header h3, .issue-card h2, .document-card h2, .company-card h2, .detail-card > header h2 { font-family: var(--serif); font-size: var(--card-title-size); font-weight: 700; line-height: 1.15; }
.detail-card dl { margin: 0; display: grid; gap: 10px; }
.detail-card dl > div { display: grid; grid-template-columns: minmax(90px, .7fr) minmax(0, 1fr); gap: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.detail-card dt { color: var(--muted); font-size: 10px; }
.detail-card dd { margin: 0; font-weight: 700; }
.activity-photo-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.activity-photo-strip img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.activity-comments { display: grid; gap: 12px; margin-bottom: 16px; }
.activity-comments > article { padding: 12px 0; border-bottom: 1px solid var(--line); }
.activity-comments > article > div { display: flex; justify-content: space-between; gap: 12px; }
.activity-comments time { color: var(--muted); font-size: 9px; }
.activity-comments p { margin: 7px 0 0; line-height: 1.55; }
.activity-comment-form { display: grid; gap: 10px; }
.activity-comment-form .button { justify-self: start; }

/* Il dettaglio attività usa gerarchie diverse per indicatori, dati descrittivi e contenuti operativi. */
.activity-detail-page .back-link { color: var(--orange-dark); font-weight: 700; }
.activity-detail-page .page-heading__lead { max-width: 780px; }
.activity-detail-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; overflow: hidden; background: rgba(23,36,31,.18); border: 1px solid rgba(23,36,31,.18); box-shadow: 0 16px 45px rgba(23,36,31,.06); }
.activity-detail-metrics .metric-card { min-width: 0; min-height: 126px; padding: 22px 24px; position: relative; display: flex; flex-direction: column; justify-content: center; overflow: hidden; background: rgba(255,253,248,.94); }
.activity-detail-metrics .metric-card::after { content: ""; width: 56px; height: 56px; position: absolute; top: -31px; right: -31px; border: 1px solid currentColor; border-radius: 50%; opacity: .12; }
.activity-detail-metrics .metric-card > span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.activity-detail-metrics .metric-card > strong { margin: 9px 0 5px; overflow-wrap: anywhere; font-family: var(--serif); font-size: clamp(24px, 2.2vw, 34px); font-variant-numeric: tabular-nums; font-weight: 600; line-height: 1.05; }
.activity-detail-metrics .metric-card > small { color: var(--muted); font-size: 10px; }
.activity-detail-metrics .metric-card[data-tone="status"] { color: var(--paper-light); background: var(--ink); }
.activity-detail-metrics .metric-card[data-tone="status"] > span, .activity-detail-metrics .metric-card[data-tone="status"] > small { color: rgba(244,235,221,.72); }
.activity-detail-metrics .metric-card[data-tone="progress"] { box-shadow: inset 4px 0 var(--orange); }
.activity-detail-metrics .metric-card[data-tone="positive"] { background: rgba(220,235,229,.42); box-shadow: inset 4px 0 var(--green); }
.activity-detail-metrics .metric-card[data-tone="critical"] { color: var(--red-dark); background: rgba(249,221,212,.68); box-shadow: inset 4px 0 var(--red); }
.activity-detail-metrics .progress { height: 8px; margin-top: 8px; }
.activity-detail-page .detail-grid { gap: 18px; margin-bottom: 18px; }
.activity-detail-page .detail-card { padding: 27px 28px; background: rgba(255,253,248,.76); border: 1px solid rgba(23,36,31,.15); box-shadow: 0 9px 28px rgba(23,36,31,.035); }
.activity-detail-page .detail-card > header { margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid rgba(23,36,31,.14); }
.activity-detail-page .detail-card > header h2 { margin: 5px 0 0; }
.activity-detail-page .detail-card dl { gap: 0; }
.activity-detail-page .detail-card dl > div { min-height: 48px; padding: 13px 0; align-items: center; border-top-color: rgba(23,36,31,.11); }
.activity-detail-page .detail-card dl > div:first-child { border-top: 0; }
.activity-detail-page .detail-card dt { color: var(--muted); font-size: 11px; }
.activity-detail-page .detail-card dd { color: var(--ink); font-size: 13px; }
.activity-detail-overview { align-items: start; }
.activity-detail-overview .detail-card { width: 100%; }
.activity-detail-overview > .detail-card:first-child { padding-block: 22px; }
.activity-detail-overview > .detail-card:first-child > header { margin-bottom: 12px; padding-bottom: 13px; }
.activity-detail-overview > .detail-card:first-child dl > div { min-height: 40px; padding-block: 8px; }
.activity-detail-overview__actual { grid-column: 1 / -1; }
.activity-detail-overview__actual { padding-block: 22px; display: grid; grid-template-columns: minmax(220px, .42fr) minmax(0, 1fr); align-items: center; column-gap: 38px; }
.activity-detail-overview__actual > header { margin: 0; padding: 0; border-bottom: 0; }
.activity-detail-overview__actual dl { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
.activity-action-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px !important; overflow: hidden; background: rgba(23,36,31,.16); border: 1px solid rgba(23,36,31,.16); }
.activity-action-grid .detail-card { min-height: 174px; position: relative; border: 0; border-top: 3px solid var(--orange); box-shadow: none; }
.activity-action-grid .detail-card[data-accent="delay"] { border-top-color: var(--gold-dark); }
.activity-action-grid .detail-card[data-accent="escalation"] { border-top-color: var(--green); }
.activity-action-grid .detail-card > p { margin: 0; color: var(--ink-soft); line-height: 1.65; }
.activity-dependency-grid .detail-card { background: rgba(255,253,248,.9); }
.activity-dependency-list { margin: 0; padding: 0; display: grid; gap: 8px; list-style: none; }
.activity-dependency-list a { min-height: 58px; padding: 12px 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px; color: var(--ink); background: rgba(23,36,31,.025); border-left: 3px solid var(--orange); }
.activity-dependency-list a:hover { background: rgba(197,91,43,.07); }
.activity-dependency-list strong { font-size: 12px; line-height: 1.4; }
.activity-dependency-list small { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.activity-empty-copy { max-width: 620px; margin: 0; color: var(--muted); font-style: italic; }
.activity-detail-page .activity-history { margin-top: 28px; padding-block: 24px; border-left: 4px solid var(--ink); }
.activity-collaboration { grid-template-columns: minmax(280px, .72fr) minmax(0, 1.28fr); align-items: start; }
.activity-collaboration > .detail-card { width: 100%; display: flex; flex-direction: column; }
.activity-collaboration > .detail-card:first-child { min-height: 255px; background: rgba(220,235,229,.24); }
.activity-collaboration .button { margin-top: 24px; align-self: flex-start; }
.activity-collaboration .activity-comment-form { margin-top: auto; padding-top: 8px; }
.activity-collaboration textarea { min-height: 118px; background: var(--paper-light); }

/* Il cronoprogramma separa titoli, asse temporale e avanzamento mantenendo allineate tutte le righe. */
.activity-gantt-filters { padding: 20px; display: grid; grid-template-columns: repeat(5, minmax(145px, 1fr)) auto auto; gap: 14px; background: rgba(255,250,241,.84); border-top: 2px solid rgba(167,68,31,.55); box-shadow: 0 12px 38px rgba(23,36,31,.045); }
.activity-gantt-filters > label:not(.check-label) { min-width: 0; max-width: none; }
.activity-gantt-filters__late { min-width: max-content; padding: 0 13px; justify-content: center; background: rgba(255,253,248,.72); border: 1px solid var(--line); }
.gantt-board { max-width: 100%; margin: 0 0 24px; overflow: hidden; contain: inline-size paint; background: var(--paper-light); border: 1px solid var(--line); box-shadow: var(--shadow); }
.gantt-board__viewport { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-color: var(--orange) rgba(23,36,31,.08); }
.gantt-board__viewport:focus-visible { outline-offset: -5px; }
.gantt-board__chart { min-width: 1000px; }
.gantt-board__axis, .gantt-board__row { padding-inline: 28px; display: grid; grid-template-columns: minmax(270px, 300px) minmax(520px, 1fr) 88px; align-items: center; gap: 22px; }
.gantt-board__axis { min-height: 82px; background: rgba(23,36,31,.025); border-bottom: 1px solid var(--line); }
.gantt-board__column-label { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.gantt-board__column-label--progress { text-align: right; }
.gantt-board__scale { min-height: 43px; position: relative; background-image: linear-gradient(90deg, rgba(23,36,31,.12) 1px, transparent 1px); background-size: 25% 100%; border-right: 1px solid rgba(23,36,31,.12); border-bottom: 1px solid rgba(23,36,31,.22); }
.gantt-board__scale time, .gantt-board__scale > span { position: absolute; top: 0; color: var(--ink-soft); font-size: 11px; font-variant-numeric: tabular-nums; font-weight: 600; }
.gantt-board__scale-start { left: 0; }
.gantt-board__scale-end { right: 0; }
.gantt-board__scale > span { left: 50%; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; transform: translateX(-50%); }
.gantt-board__row { min-height: 66px; border-bottom: 1px solid rgba(23,36,31,.085); }
.gantt-board__row:last-child { border-bottom: 0; }
.gantt-board__row--alternate { background: rgba(23,36,31,.022); }
.gantt-board__row--critical { box-shadow: inset 3px 0 var(--red); }
.gantt-board__activity { min-width: 0; display: grid; align-content: center; gap: 3px; }
.gantt-board__activity > span { color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.gantt-board__activity small { color: var(--red-dark); font-size: 8px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.gantt-board__timeline { height: 34px; position: relative; background-image: linear-gradient(90deg, rgba(23,36,31,.095) 1px, transparent 1px); background-size: 25% 100%; border-right: 1px solid rgba(23,36,31,.095); }
.gantt-board__timeline::before { content: ""; height: 18px; position: absolute; inset: 8px 0 auto; background: rgba(23,36,31,.055); }
.gantt-board__window { height: 18px; min-width: 4px; position: absolute; top: 8px; left: var(--gantt-start); width: max(var(--gantt-width), 4px); overflow: hidden; background: rgba(197,91,43,.25); border-left: 2px solid rgba(167,68,31,.5); box-shadow: inset 0 0 0 1px rgba(167,68,31,.08); }
.gantt-board__window > span { width: var(--gantt-progress); height: 100%; display: block; background: var(--orange-dark); }
.gantt-board__row--critical .gantt-board__window { background: rgba(184,62,50,.22); border-left-color: rgba(143,47,39,.55); box-shadow: inset 0 0 0 1px rgba(143,47,39,.1); }
.gantt-board__row--critical .gantt-board__window > span { background: var(--red-dark); }
.gantt-board__percentage { min-width: 66px; justify-self: end; padding: 7px 9px; color: var(--ink); background: rgba(255,253,248,.82); border-left: 2px solid var(--orange); font-family: var(--serif); font-size: 18px; font-variant-numeric: tabular-nums; font-weight: 600; line-height: 1; text-align: right; }
.gantt-board__row--critical .gantt-board__percentage { color: var(--red-dark); border-left-color: var(--red); }
.gantt-board__footer { padding: 18px 28px 20px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 20px 34px; color: var(--muted); background: rgba(23,36,31,.018); border-top: 1px solid var(--line); }
.gantt-board__footer figcaption { max-width: 720px; font-size: 11px; line-height: 1.55; }
.gantt-board__legend { margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px 18px; list-style: none; }
.gantt-board__legend li { display: inline-flex; align-items: center; gap: 7px; font-size: 9px; font-weight: 700; white-space: nowrap; }
.gantt-board__legend li > span { width: 22px; height: 8px; display: inline-block; }
.gantt-board__legend-planned { background: rgba(197,91,43,.25); border-left: 2px solid rgba(167,68,31,.5); }
.gantt-board__legend-progress { background: var(--orange-dark); }
.gantt-board__legend-critical { background: var(--red-dark); }
.gantt-detail-table { overflow: hidden; background: rgba(255,250,241,.6); }
.gantt-detail-table caption { padding-block: 16px; background: rgba(23,36,31,.025); }
.gantt-detail-table__date, .gantt-detail-table__amount { font-variant-numeric: tabular-nums; }
.gantt-detail-table__amount { white-space: nowrap; }
.gantt-detail-table .data-table__progress { grid-template-columns: minmax(54px, 1fr) auto; }
.gantt-detail-table .data-table__progress strong { font-variant-numeric: tabular-nums; }

@media (min-width: 1221px) {
	.gantt-detail-table table { table-layout: fixed; }
	.gantt-detail-table th:nth-child(1) { width: 22%; }
	.gantt-detail-table th:nth-child(2) { width: 14%; }
	.gantt-detail-table th:nth-child(3), .gantt-detail-table th:nth-child(4) { width: 17%; }
	.gantt-detail-table th:nth-child(5) { width: 8%; }
	.gantt-detail-table th:nth-child(6) { width: 10%; }
	.gantt-detail-table th:nth-child(7) { width: 12%; }
	.gantt-detail-table td { padding: 15px 14px; border-top-color: rgba(23,36,31,.1); }
	.gantt-detail-table tbody tr:nth-child(even) td { background: rgba(23,36,31,.022); }
	.gantt-detail-table tbody tr:hover td { background: rgba(255,253,248,.9); }
	.gantt-detail-table .text-link { font-size: 13px; line-height: 1.45; }
	.gantt-detail-table .badge { min-height: 22px; padding: 4px 7px; font-size: 8px; }
}

/* Il mese forma un unico controllo compatto, senza sottrarre attenzione alla griglia. */
.calendar-navigation { width: max-content; margin: 28px auto 20px; display: grid; grid-template-columns: 40px auto 40px; align-items: center; gap: 14px; }
.calendar-navigation h2 { min-width: 235px; margin: 0; font-family: var(--serif); font-size: clamp(28px, 3vw, 38px); font-weight: 500; letter-spacing: -.035em; text-align: center; }
.calendar-navigation__button { width: 40px; height: 40px; display: grid; place-items: center; color: var(--ink-soft); background: rgba(255,253,248,.7); border: 1px solid var(--line); border-radius: 50%; font-size: 18px; transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease; }
.calendar-navigation__button:hover { color: var(--paper-light); background: var(--ink); border-color: var(--ink); transform: translateY(-1px); }
.activity-calendar-wrap { max-width: 100%; overflow-x: auto; border: 1px solid rgba(23,36,31,.23); background: rgba(255,250,241,.78); box-shadow: 0 18px 50px rgba(23,36,31,.055); }
.activity-calendar { width: 100%; min-width: 980px; border-collapse: collapse; table-layout: fixed; }
.activity-calendar caption { padding: 14px 16px; color: var(--ink-soft); background: rgba(255,253,248,.72); font-size: 10px; line-height: 1.5; text-align: left; }
.activity-calendar th { padding: 13px 11px; color: var(--ink-soft); background: rgba(23,36,31,.035); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-align: left; text-transform: uppercase; border: 1px solid rgba(23,36,31,.2); }
.activity-calendar th:nth-child(n+6) { color: var(--orange-dark); background: rgba(197,91,43,.065); }
.activity-calendar td { height: 164px; padding: 11px; vertical-align: top; border: 1px solid rgba(23,36,31,.19); }
.activity-calendar td.is-weekend { background: rgba(197,91,43,.025); }
.activity-calendar td.is-adjacent-month { color: var(--muted); background: rgba(18,33,29,.055); }
.activity-calendar td.is-adjacent-month > ul { opacity: .72; }
.activity-calendar td.is-today { background: rgba(197,91,43,.075); }
.activity-calendar td > time { width: 28px; height: 28px; display: grid; place-items: center; color: var(--ink-soft); font-variant-numeric: tabular-nums; font-weight: 800; }
.activity-calendar td.is-today > time { color: var(--paper-light); background: var(--orange); border-radius: 50%; }
.activity-calendar ul { margin: 9px 0 0; padding: 0; display: grid; gap: 7px; list-style: none; }
.activity-calendar li { padding: 9px 9px 9px 11px; position: relative; display: grid; gap: 3px; overflow: hidden; background: rgba(255,253,248,.96); border: 1px solid rgba(23,36,31,.09); border-left: 4px solid var(--orange); box-shadow: 0 4px 14px rgba(18,33,29,.055); }
.activity-calendar li[data-status="in_progress"] { background: rgba(240,223,183,.24); border-left-color: var(--gold-dark); }
.activity-calendar li[data-status="suspended"] { background: rgba(249,221,212,.3); border-left-color: var(--red); }
.activity-calendar li[data-status="completed"] { background: rgba(220,235,229,.42); border-left-color: var(--green); }
.activity-calendar li[data-status="cancelled"] { opacity: .66; border-left-color: var(--muted); }
.activity-calendar li.is-critical { box-shadow: 0 4px 14px rgba(143,47,39,.08), inset 0 0 0 1px rgba(184,62,50,.12); }
.activity-calendar li[data-phase="scadenza"] small { color: var(--red-dark); }
.activity-calendar li small { color: var(--orange-dark); font-size: 8px; font-weight: 800; letter-spacing: .085em; line-height: 1.35; text-transform: uppercase; }
.activity-calendar li a { color: var(--ink); font-size: 11px; font-weight: 700; line-height: 1.35; text-decoration: none; }
.activity-calendar li a:hover { color: var(--orange-dark); text-decoration: underline; }
.activity-calendar li span { color: var(--ink-soft); font-size: 9px; line-height: 1.4; }
.activity-calendar__empty { margin-top: 9px; display: block; color: var(--muted); font-size: 9px; font-style: italic; }
.activity-history { margin-top: 24px; }
.activity-history ol { margin: 22px 0 0; padding: 0; display: grid; list-style: none; }
.activity-history li { min-height: 82px; display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 12px; }
.activity-history li > span { width: 10px; height: 10px; margin-top: 5px; position: relative; background: var(--paper-light); border: 2px solid var(--orange); border-radius: 50%; }
.activity-history li:not(:last-child) > span::after { content: ""; width: 1px; height: 62px; position: absolute; top: 10px; left: 3px; background: var(--line); }
.activity-history li > div > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.activity-history time, .activity-history small { color: var(--muted); font-size: 9px; }
.activity-history p { margin: 5px 0 3px; color: var(--ink-soft); line-height: 1.55; }
.company-site-list article { min-height: 98px; padding: 18px 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.company-site-list article:first-child { border-top: 1px solid var(--line); }
.company-site-list span { color: var(--orange); font-size: 8px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.company-site-list h3 { margin: 4px 0; font-family: var(--serif); font-size: 24px; font-weight: 400; }
.company-site-list h3 a { color: inherit; text-decoration: none; }
.company-site-list p { margin: 0; color: var(--muted); font-size: 10px; }
.company-assignment { background: var(--ink); color: var(--paper-light); }
.company-assignment > p:not(.eyebrow) { color: rgba(244,235,221,.62); font-size: 11px; line-height: 1.6; }
.company-assignment form { margin-top: 28px; display: grid; gap: 18px; }
.company-assignment label { color: rgba(244,235,221,.7); }
.company-assignment input, .company-assignment select { color: var(--paper-light); background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.18); }
.company-notes { margin-top: 22px; padding: 28px; background: var(--paper-light); border-left: 4px solid var(--orange); }
.company-notes p:last-child { margin-bottom: 0; color: var(--ink-soft); line-height: 1.7; }

/* La navigazione completa resta visibile soltanto quando tutte le voci entrano senza overflow. */
@media (max-width: 1478px) {
	.shell-header { min-height: 72px; position: relative; }
	.nav-toggle { display: block; }
	.shell-header__tools { position: absolute; z-index: 30; left: 0; right: 0; top: 72px; padding: 18px; display: none; align-items: stretch; gap: 18px; background: var(--ink); color: var(--paper-light); box-shadow: var(--shadow); }
	.shell-header__tools.is-open { display: grid; }
	.command-trigger { width: 100%; justify-content: flex-start; color: var(--paper-light); background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.2); }
	.command-trigger__label { display: inline; }
	.command-trigger kbd { margin-left: auto; }
	.main-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.main-nav a { color: rgba(244,235,221,.75); }
	.main-nav a:hover, .main-nav a.is-active { color: var(--paper-light); }
	.notification-center { display: grid; }
	.notification-trigger { width: 100%; padding: 0 13px; display: flex; justify-content: flex-start; gap: 9px; color: var(--paper-light); background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.2); }
	.notification-trigger__label { display: inline; font-size: 11px; font-weight: 700; }
	.notification-badge { top: 10px; right: 12px; border-color: var(--ink); }
	.notification-center.is-current .notification-trigger { color: var(--paper-light); border-color: var(--orange); }
	.notification-center.is-current .notification-trigger::after { left: 13px; right: auto; width: 22px; }
	.notification-center .notification-trigger[aria-expanded="true"] { color: var(--ink); background: var(--paper-light); border-color: var(--orange); }
	.notification-popover { width: 100%; max-height: min(560px, calc(100vh - 140px)); margin-top: 9px; position: static; }
	.account-menu { border-left: 0; border-top: 1px solid rgba(255,255,255,.15); padding: 16px 0 0; }
	.account-avatar { color: var(--ink); background: var(--paper-light); }
	.account-menu__identity small, .account-menu__actions a { color: rgba(244,235,221,.72); }
	.account-menu__actions { border-left-color: rgba(255,255,255,.15); }
	.account-menu__actions a { min-height: 44px; }
	.account-menu__actions a:hover { color: var(--paper-light); background: rgba(255,255,255,.08); }
}

@media (max-width: 1220px) {
	.data-table { border: 0; background: transparent; }
	.data-table table, .data-table tbody { display: block; }
	.data-table caption { width: 100%; display: block; border: 1px solid var(--line); background: rgba(255,250,241,.62); }
	.data-table thead { width: 1px; height: 1px; margin: -1px; padding: 0; position: absolute; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
	.data-table tbody { margin-top: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
	.data-table tbody tr { padding: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 2px 18px; background: rgba(255,250,241,.7); border: 1px solid var(--line); }
	.data-table tbody tr[data-tone="danger"] { border-left: 3px solid var(--red); }
	.data-table tbody tr[data-tone="warning"] { border-left: 3px solid var(--gold-dark); }
	.data-table tbody tr[data-tone="danger"] > :first-child { box-shadow: none; }
	.data-table tbody tr[data-tone="warning"] > :first-child { box-shadow: none; }
	.data-table td { width: auto; padding: 8px 0; display: grid; grid-template-columns: minmax(90px, .6fr) minmax(0, 1fr); align-items: start; gap: 12px; border: 0; }
	.data-table td::before { content: attr(data-label); color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
	.data-table td.data-table__primary, .data-table td.data-table__actions, .data-table td.data-table__empty { grid-column: 1 / -1; }
	.data-table td.data-table__primary { display: block; margin-bottom: 5px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
	.data-table td.data-table__primary::before, .data-table td.data-table__empty::before { display: none; }
	.data-table td.data-table__actions { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
	.data-table td.data-table__numeric, .data-table td.data-table__actions--compact { text-align: left; }
	.data-table td.data-table__empty { display: block; }
	.data-table tbody tr.data-table__empty-row { grid-column: 1 / -1; display: block; padding: 0; }
}

@media (max-width: 1100px) {
	.landing-hero { grid-template-columns: 1fr 1fr; gap: 30px; }
	.landing-hero h1 { font-size: 78px; }
	.metric-grid { grid-template-columns: repeat(2, 1fr); }
	.metric-grid--dashboard { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.dashboard-grid--overview, .dashboard-grid--updates { grid-template-columns: 1fr; }
	.site-row { grid-template-columns: 1fr .45fr .8fr 30px; }
	.site-row__signals { display: none; }
	.dashboard-grid--site { grid-template-columns: 1fr; }
	.photo-gallery-controls { grid-template-columns: repeat(2,minmax(0,1fr)); }
	.photo-gallery-controls > .button { justify-self: start; }
	.photo-grid { grid-template-columns: repeat(3, 1fr); }
	.notification-row { grid-template-columns: 5px 1fr 130px; }
	.notification-row > form, .notification-row > .text-link { grid-column: 2; justify-self: start; }
	.notification-settings-grid { grid-template-columns: 1fr; }
	.device-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
	.device-panel .panel__heading, .device-panel__intro, .delivery-queue-note { grid-column: 1 / -1; }
	.device-list { margin-top: 0; }
	.document-grid { grid-template-columns: repeat(2, 1fr); }
	.company-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 780px) {
	.shell-header, .shell-content, .shell-footer { width: min(1460px, calc(100% - 28px)); }
	.main-nav { grid-template-columns: 1fr; }
	.shell-footer { flex-wrap: wrap; }
	.shell-footer a { margin-left: 0; }
	.landing { padding-top: 0; }
	.landing-hero { min-height: auto; display: block; }
	.landing-hero__copy { padding: 70px 0 60px; }
	.landing-hero h1 { font-size: clamp(58px, 18vw, 88px); }
	.landing-hero__lead { margin-top: 30px; }
	.landing-hero__visual { min-height: 420px; }
	.benefit-grid { grid-template-columns: 1fr; }
	.benefit-card { min-height: 220px; }
	.benefit-card h3 { margin-top: 35px; }
	.auth-page { display: block; padding: 65px 0; }
	.auth-page__intro { margin-bottom: 45px; }
	.auth-page__intro h1 { font-size: 62px; }
	.app-page { padding-top: 36px; }
	.page-heading { display: flex; align-items: flex-start; flex-direction: column; margin-bottom: 30px; }
	.page-heading > .back-link { margin-bottom: 18px; }
	.page-heading__actions { align-self: stretch; justify-content: flex-start; margin-top: 20px; }
	.page-heading h1 { font-size: clamp(46px, 14vw, 58px); }
	.metric-grid { grid-template-columns: 1fr 1fr; }
	.metric-grid--dashboard { grid-template-columns: 1fr 1fr; }
	.metric { min-height: 145px; }
	.metric strong { font-size: 52px; }
	.dashboard-grid { grid-template-columns: 1fr; }
	.site-card-grid { grid-template-columns: 1fr; }
	.site-row { padding: 20px 0; grid-template-columns: 1fr 30px; gap: 14px; }
	.site-row__status, .site-row__progress { grid-column: 1; }
	.site-row__arrow { grid-column: 2; grid-row: 1; }
	.form-card { padding: 24px; }
	.form-grid { grid-template-columns: 1fr; }
	.form-grid__full { grid-column: 1; }
	.site-hero { grid-template-columns: 1fr; gap: 25px; padding: 28px; }
	.site-hero__progress { max-width: 350px; }
	.site-hero__actions { width: 100%; grid-template-columns: 1fr; }
	.site-facts { grid-template-columns: 1fr 1fr; }
	.site-location__address { grid-template-columns: 1fr; }
	.site-location__address > span, .site-location__address > div { grid-column: 1; grid-row: auto; }
	.map-canvas { min-height: 420px; }
	.panel { padding: 20px; }
	.filter-bar > label:not(.check-label), .filter-bar > .check-label, .filter-bar > .choice-field, .filter-bar > .button { width: 100%; max-width: none; flex-basis: 100%; }
	.filter-bar--compact > .button { width: auto; flex-basis: auto; }
	.data-table tbody { grid-template-columns: 1fr; }
	.floor-row { grid-template-columns: 100px 1fr 30px; }
	.record-entry { padding: 18px 0; grid-template-columns: 58px minmax(0, 1fr); align-items: start; gap: 14px; }
	.record-entry:hover { padding-left: 6px; padding-right: 0; }
	.date-tile { width: 54px; height: 68px; }
	.record-entry__title { font-size: 21px; }
	.record-entry__status { grid-column: 2; justify-self: start; }
	.report-summary, .report-sheet__grid { grid-template-columns: 1fr; }
	.report-companies__grid, .report-presences__list { grid-template-columns: 1fr; }
	.report-company { grid-template-columns: minmax(0, 1fr) 84px; }
	.issue-grid { grid-template-columns: 1fr; }
	.photo-gallery-controls { grid-template-columns: 1fr; }
	.photo-gallery-controls > label:not(.check-label), .photo-gallery-controls > .choice-field, .photo-gallery-controls > .button { width: 100%; }
	.photo-gallery-controls > .button { justify-self: stretch; }
	.photo-context-group__header { align-items: flex-start; flex-direction: column; gap: 5px; }
	.photo-grid { grid-template-columns: repeat(2, 1fr); }
	.photo-comparison__grid { grid-template-columns: 1fr; }
	.notification-row { grid-template-columns: 5px 1fr; gap: 14px; }
	.notification-row > time, .notification-row > form, .notification-row > .text-link { grid-column: 2; }
	.preference-channel-head { display: none; }
	.preference-row { grid-template-columns: 1fr; gap: 8px; padding: 20px 5px; }
	.preference-row__copy { margin-bottom: 5px; }
	.channel-choice { min-height: 52px; padding: 10px 12px; justify-content: flex-start; border-color: var(--line); }
	.channel-choice span { display: block; }
	.device-panel { display: block; }
	.device-list { margin-top: 24px; }
	.document-grid { grid-template-columns: 1fr; }
	.document-summary { grid-template-columns: 1fr 1fr; }
	.document-version { padding: 15px 0; grid-template-columns: 45px 1fr; }
	.document-version__actions { grid-column: 2; }
	.company-grid { grid-template-columns: 1fr; }
	.company-profile { grid-template-columns: 1fr; align-items: start; }
	.company-profile__status { padding: 20px 0 0; border-left: 0; border-top: 1px solid rgba(244,235,221,.2); }
	.company-facts { grid-template-columns: 1fr; }
	.company-detail-grid { grid-template-columns: 1fr; }
	.company-operations__grid, .document-relations > div { grid-template-columns: 1fr; }
	.detail-grid { grid-template-columns: 1fr; }
	.page-heading__actions { justify-content: flex-start; }
	.stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.dashboard-commercial > header { align-items: flex-start; flex-direction: column; }
	.dashboard-commercial__grid { grid-template-columns: 1fr; }
	.dashboard-commercial__grid a { min-height: 92px; }
	.dashboard-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.metrics-page .metric-grid { grid-template-columns: 1fr 1fr; }
	.search-result { grid-template-columns: 82px 1fr auto; gap: 10px; }
}

@media (max-width: 480px) {
	.account-menu { display: grid; grid-template-columns: 32px minmax(0, 1fr); }
	.account-menu__actions { grid-column: 2; margin-left: 0; padding-left: 0; justify-self: start; border-left: 0; }
	.notification-popover__header { display: grid; gap: 9px; }
	.notification-popover__header .text-link { min-height: 32px; }
	.notification-preview__meta { align-items: flex-start; flex-direction: column; gap: 2px; }
	.action-row { align-items: flex-start; flex-direction: column; }
	.data-table tbody tr { padding: 16px; grid-template-columns: 1fr; }
	.data-table td, .data-table td.data-table__primary, .data-table td.data-table__actions { grid-column: 1; }
	.data-table td { grid-template-columns: minmax(82px, .55fr) minmax(0, 1fr); }
	.inline-form { grid-template-columns: minmax(0, 1fr) minmax(0, .75fr); }
	.inline-form .button { width: 100%; grid-column: 1 / -1; }
	.signal-card--main { width: 68%; }
	.signal-card--date { display: none; }
	.signal-card--alert { width: 44%; }
	.metric-grid { grid-template-columns: 1fr; }
	.metric-grid--dashboard { grid-template-columns: 1fr; }
	.attention-item { grid-template-columns: 4px minmax(0, 1fr); }
	.attention-item time { grid-column: 2; margin: -9px 0 10px; }
	.deadline-list > a { grid-template-columns: 76px minmax(0, 1fr); }
	.deadline-list > a > span:last-child { display: none; }
	.dashboard-photo-grid { grid-template-columns: 1fr; }
	.site-facts { grid-template-columns: 1fr; }
	.floor-row { padding: 10px 0; grid-template-columns: 1fr 30px; }
	.unit-pills { grid-column: 1 / -1; }
	.photo-grid { grid-template-columns: 1fr; }
	.notification-filters { align-items: stretch; flex-direction: column; }
	.document-summary { grid-template-columns: 1fr; }
	.document-card__facts { grid-template-columns: 1fr 1fr; }
	.global-search-form > div { grid-template-columns: 1fr; }
	.search-result { grid-template-columns: 1fr auto; }
	.search-result__kind { grid-column: 1 / -1; }
	.metrics-page .metric-grid { grid-template-columns: 1fr; }
	.activity-detail-metrics { grid-template-columns: 1fr; }
	.activity-detail-overview__actual { grid-template-columns: 1fr; row-gap: 18px; }
	.activity-detail-overview__actual > header { padding-bottom: 16px; border-bottom: 1px solid rgba(23,36,31,.14); }
	.activity-detail-overview__actual dl { grid-template-columns: 1fr; }
	.activity-dependency-list a { grid-template-columns: 1fr; gap: 4px; }
	.usage-route-list article { grid-template-columns: 1fr; gap: 4px; padding: 12px 0; }
}

/* Il dettaglio resta compatto sui tablet senza creare colonne isolate o schede vuote. */
@media (min-width: 481px) and (max-width: 980px) {
	.activity-detail-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.activity-action-grid { grid-template-columns: 1fr; }
	.activity-action-grid .detail-card { min-height: 0; }
}

@media (max-width: 360px) {
	.stat-strip { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
	* { scroll-behavior: auto !important; transition: none !important; }
}

@media (prefers-contrast: more) {
	:root { --line: rgba(18, 33, 29, .45); --muted: #3e4944; }
	.button, .command-trigger, .utility-button, input, select, textarea { border-width: 2px; }
}

/* Il controllo commessa concentra indicatori decisionali mantenendo la stessa grammatica visiva dell'app. */
.commission-portfolio { margin: 24px 0; }
/* Il controllo commessa privilegia densità e lettura dei valori: titolo, spiegazione e comandi non si contendono la stessa colonna. */
.commission-page > .metric-grid--dashboard { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.commission-page > .metric-grid--dashboard .metric strong { overflow-wrap: normal; font-size: clamp(30px, 2.8vw, 42px); line-height: .95; font-variant-numeric: tabular-nums; white-space: nowrap; }
.commission-portfolio .panel__heading > small { max-width: 430px; color: var(--muted); line-height: 1.5; text-align: right; }
.commission-portfolio .data-table { margin-top: 18px; }
.commission-portfolio td > strong, .commission-portfolio td > small { display: block; }
.commission-portfolio td > small { margin-top: 5px; color: var(--muted); }
.commission-portfolio tr[data-tone="danger"] { box-shadow: inset 4px 0 0 var(--red); }
.commission-portfolio tr[data-tone="warning"] { box-shadow: inset 4px 0 0 var(--orange); }
.commission-portfolio tr[data-tone="healthy"] { box-shadow: inset 4px 0 0 var(--green); }
.commission-progress { display: grid; gap: 4px; }
.commission-progress small { color: var(--ink); font-weight: 700; }
/* Le tre schede più brevi bilanciano il cash flow alto, evitando il grande vuoto prodotto da righe di griglia diseguali. */
.commission-columns { margin: 22px 0; display: grid; grid-template-columns: minmax(0,1.05fr) minmax(0,.95fr); grid-template-rows: auto auto auto; align-items: start; gap: 22px; }
.commission-columns > .commission-grid { display: contents; }
.commission-columns > .commission-grid > .panel { min-width: 0; overflow: hidden; }
.commission-columns > .commission-grid:first-child > .panel:first-child { grid-column: 1; grid-row: 1; }
.commission-columns > .commission-grid:first-child > .panel:last-child { grid-column: 2; grid-row: 1 / span 3; align-self: start; }
.commission-columns > .commission-grid:last-child > .panel:first-child { grid-column: 1; grid-row: 2; }
.commission-columns > .commission-grid:last-child > .panel:last-child { grid-column: 1; grid-row: 3; }
.commission-kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 18px 0; border: 1px solid var(--line); background: var(--line); }
.commission-kpi-row > span { display: grid; gap: 5px; min-width: 0; padding: 14px; background: var(--paper); }
.commission-kpi-row small { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.commission-kpi-row strong { font-size: clamp(17px, 2vw, 23px); overflow-wrap: anywhere; }
.cash-week-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 18px 0; }
.cash-week-grid article { display: grid; gap: 6px; min-width: 0; padding: 12px; background: var(--paper); border-left: 3px solid var(--green); }
.cash-week-grid article[data-tone="danger"] { background: color-mix(in srgb,var(--red) 5%,var(--paper)); border-left-color: var(--red); }
.cash-week-grid article[data-tone="healthy"] { border-left-color: var(--green); }
.cash-week-grid time, .cash-week-grid small { color: var(--muted); font-size: 11px; }
.cash-week-grid strong { font-size: 17px; overflow-wrap: anywhere; }
.cash-amount--inflow { color: var(--green); }
.cash-amount--outflow { color: var(--red); }
button.text-link { appearance: none; padding: 0; border: 0; background: transparent; font: inherit; cursor: pointer; }
.app-dialog--wide { width: min(920px, calc(100vw - 32px)); max-width: 920px; }
.app-dialog--wide .form-grid { max-height: min(80vh, 780px); overflow-y: auto; }
.dashboard-commission-health { margin: 22px 0; }
.dashboard-commission-health__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin-top: 18px; border: 1px solid var(--line); background: var(--line); }
.dashboard-commission-health__grid > a { min-width: 0; padding: 18px; display: grid; grid-template-columns: minmax(130px, .8fr) repeat(2, minmax(0, 1fr)); gap: 18px; color: var(--ink); background: var(--paper-light); text-decoration: none; box-shadow: inset 4px 0 0 var(--green); }
.dashboard-commission-health__grid > a[data-tone="warning"] { box-shadow: inset 4px 0 0 var(--orange); }
.dashboard-commission-health__grid > a[data-tone="danger"] { box-shadow: inset 4px 0 0 var(--red); }
.dashboard-commission-health__grid span { display: grid; align-content: start; gap: 4px; min-width: 0; }
.dashboard-commission-health__grid small { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.dashboard-commission-health__grid strong { overflow-wrap: anywhere; }
.dashboard-commission-health__grid em { color: var(--muted); font-size: 12px; font-style: normal; }

@media (max-width: 1100px) {
	.commission-columns { display: block; }
	.commission-columns > .commission-grid { margin: 22px 0; display: grid; grid-template-columns: 1fr; gap: 22px; }
	.commission-columns > .commission-grid > .panel { grid-column: auto !important; grid-row: auto !important; }
	.dashboard-commission-health__grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
	.commission-page > .metric-grid--dashboard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.commission-page > .metric-grid--dashboard .metric strong { font-size: clamp(27px, 7vw, 38px); }
	.commission-portfolio .panel__heading > small { text-align: left; }
	.commission-kpi-row, .cash-week-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.dashboard-commission-health__grid > a { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
	.commission-page > .metric-grid--dashboard { grid-template-columns: 1fr; }
	.commission-kpi-row, .cash-week-grid { grid-template-columns: 1fr; }
}

/* Adattamenti del cronoprogramma: i filtri si ricompongono, mentre l'asse conserva proporzioni leggibili. */
@media (max-width: 1220px) {
	.activity-gantt-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.activity-gantt-filters__late { min-width: 0; }
	.gantt-board__footer { grid-template-columns: 1fr; }
	.gantt-board__legend { justify-content: flex-start; }
	.gantt-detail-table .data-table__progress { grid-template-columns: minmax(80px, 1fr) auto; }
}

@media (max-width: 780px) {
	.activity-gantt-filters { padding: 16px; grid-template-columns: 1fr; }
	.activity-gantt-page .page-heading { align-items: flex-start; }
	.activity-gantt-page .page-heading__copy { width: 100%; }
	.action-menu__panel { right: auto; left: 0; }
	.gantt-board__footer { padding: 17px 18px 19px; }
	.gantt-board__legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
	.gantt-board__legend { grid-template-columns: 1fr; }
}

/* I filtri dei problemi si ricompongono per gruppi, senza lasciare controlli isolati. */
@media (max-width: 1220px) {
	.issue-filter-bar { grid-template-columns: repeat(2,minmax(0,1fr)); }
	.issue-filter-bar .choice-group { flex-wrap: wrap; }
	.issue-filter-bar__schedule { grid-column: 1 / -1; }
	.issue-filter-bar > .button { grid-column: 1 / -1; }
}

@media (max-width: 780px) {
	.issue-filter-bar { padding: 16px; grid-template-columns: 1fr; }
	.issue-filter-bar__schedule { grid-column: 1; grid-template-columns: 1fr; }
	.issue-filter-bar__late { width: 100%; }
	.issue-filter-bar > .button { width: 100%; grid-column: 1; justify-self: stretch; }
	.issue-card__facts { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 420px) {
	.issue-card__facts { grid-template-columns: 1fr; }
	.issue-card > header { align-items: flex-start; flex-direction: column; }
}
