/* WWWBCavour: componenti condivisi per le schermate esistenti. */
:root {
  --ink: #18324c;
  --muted: #52677a;
  --blue: #164d80;
  --blue-dark: #123a61;
  --sky: #e4f0fa;
  --ash: #edf0f3;
  --line: #ccd9e4;
  --paper: #ffffff;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(24, 50, 76, .09), 0 2px 5px rgba(24, 50, 76, .04);
}
* { box-sizing: border-box; }
html { min-height: 100%; scroll-padding-top: 16px; }
body { margin: 0; color: var(--ink); background: #e8eff5; font: 14px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: #175b92; text-underline-offset: 3px; }
a:hover { color: #103e65; }
button, input, select, textarea { font: inherit; }
button, input, select, textarea, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #c47b08; outline-offset: 3px; }
h1, h2, h3 { line-height: 1.3; overflow-wrap: anywhere; }
h1 { font-size: clamp(23px, 3vw, 32px); }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { overflow-wrap: anywhere; }
small { font-size: 12px; }
.skip-link { position: fixed; top: 8px; left: 12px; z-index: 20; padding: 10px 16px; color: #fff; background: var(--blue-dark); border-radius: 8px; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.topbar { color: #fff; background: linear-gradient(110deg, #143b61, #1d5c94); box-shadow: 0 4px 18px rgba(15, 42, 70, .2); }
.top-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; max-width: 1280px; min-height: 82px; padding: 17px 28px; margin: auto; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; font-weight: 800; letter-spacing: .055em; }
.brand:hover { color: #fff; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid #7ca4c9; border-radius: 12px; background: #346d9f; font-size: 22px; }
.brand small { display: block; color: #d4e5f4; font-size: 11px; font-weight: 400; letter-spacing: .02em; }
.topnav { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.topnav a { color: #fff; font-size: 13px; font-weight: 650; text-decoration: none; }
.topnav a:hover { text-decoration: underline; }
.topnav form { margin: 0; }
.user-chip { padding: 5px 11px; border: 1px solid #7298ba; border-radius: 30px; font-size: 12px; overflow-wrap: anywhere; }
button.logout { padding: 6px 12px; color: #fff; background: transparent; border-color: #91b2ce; box-shadow: none; }
main { width: 100%; max-width: 1280px; padding: 26px 28px 56px; margin: 0 auto; min-height: calc(100vh - 158px); }
main:focus { outline: none; }
footer { padding: 23px 18px; color: #455e73; text-align: center; font-size: 12px; }
.breadcrumb { margin: 0 0 16px; color: var(--muted); font-size: 12px; }
.breadcrumb a { color: #3d607e; text-decoration: none; }
.breadcrumb span { padding: 0 6px; }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 26px 30px; margin: 0 0 23px; border-radius: var(--radius); color: #fff; background: linear-gradient(110deg, #143e66, #23669e); box-shadow: var(--shadow); }
.hero h1 { margin: 6px 0; color: #fff; }
.hero p { max-width: 700px; margin: 0; color: #e2eef8; }
.eyebrow { color: #c2e2ff; font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.hero-date, .hero-back { color: #fff; white-space: nowrap; text-decoration: none; font-size: 12px; }
.hero-back { padding: 7px 12px; border: 1px solid #87adce; border-radius: 7px; }
.hero-back:hover { color: #fff; background: rgba(255,255,255,.12); }
.title-icon { font-size: 23px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin: 26px 0 13px; }
.section-heading h2 { margin: 0; font-size: 18px; }
.muted { color: var(--muted); font-size: 12px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.kpi { padding: 17px 19px; border: 1px solid #d1dae3; border-radius: var(--radius); background: var(--ash); box-shadow: var(--shadow); }
.kpi span, .kpi small { display: block; color: #4b6175; font-size: 12px; }
.kpi strong { display: block; color: #153f65; font-size: 32px; font-weight: 750; line-height: 1.5; }
.account-tools { display: flex; justify-content: flex-end; gap: 13px; flex-wrap: wrap; margin: -5px 0 10px; font-size: 11px; }
.operational-separator { height: 3mm; margin: 24px 0 20px; border-radius: 3px; background: #19578f; }
.sector-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.sector { display: flex; flex-direction: column; min-height: 186px; padding: 21px; color: var(--ink); text-decoration: none; border: 1px solid #bdd4e6; border-radius: var(--radius); background: var(--sky); box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease; }
.sector:hover { transform: translateY(-2px); color: var(--ink); border-color: #4d88b8; }
.sector-icon { font-size: 27px; }
.sector h3 { margin: 10px 0 5px; font-size: 16px; }
.sector p { margin: 0 0 16px; color: #46637b; font-size: 12px; }
.sector-foot { display: flex; justify-content: space-between; margin-top: auto; color: #1b5b8b; font-size: 12px; font-weight: 700; }
.task-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; }
.task-card { display: flex; flex-direction: column; min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--ash); box-shadow: var(--shadow); }
.task-top { display: flex; justify-content: space-between; gap: 14px; }
.task-card h3 { margin: 0; }
.task-card p { color: var(--muted); }
.task-link { margin-top: auto; font-weight: 700; }
.task-disabled { margin-top: auto; color: var(--muted); }
.tag, .status-pill { display: inline-block; padding: 4px 9px; border-radius: 20px; color: #355a76; background: #e0ebf3; font-size: 11px; }
.tag.active { color: #1e6541; background: #dff1e7; }
.tag.planned { color: #78510d; background: #fff0cf; }
.activity-feed { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--ash); box-shadow: var(--shadow); }
.feed-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 15px 18px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.feed-row:last-child { border-bottom: 0; }
.feed-row small { display: block; color: var(--muted); }
.empty { padding: 20px; color: var(--muted); }
.info-note, .form-message { margin: 17px 0; padding: 13px 16px; border: 1px solid #aec9df; border-left: 4px solid #347cac; border-radius: 9px; color: #254c6b; background: #e9f3fa; font-size: 13px; }
.form-message { border-color: #a2c8b4; color: #245b3c; background: #e6f3eb; }
.form-message.form-error { color: #8b2830; border-color: #dfafb5; background: #fff0f1; }
.panel { display: block; margin: 14px 0; padding: 22px; color: inherit; text-decoration: none; border: 1px solid var(--line); border-radius: var(--radius); background: #edf5fc; box-shadow: var(--shadow); }
.item span, .item small { display: block; margin-top: 8px; }
.action-bar, .wwb-form-actions, .wwb-heading-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.action-bar { margin: 19px 0; }
button, .primary-action, .secondary-action, .wwb-small-action, .wwb-save, .wwb-reset, .wwb-edit-row { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 7px 12px; border: 1px solid #b7cbdd; border-radius: 7px; font-size: 12px; font-weight: 650; text-decoration: none; cursor: pointer; }
button, .primary-action, .wwb-save { color: #164d80; background: #ffffff; border-color: #79a8ce; box-shadow: 0 3px 8px rgba(16, 60, 98, .1); }
button:hover, .primary-action:hover, .wwb-save:hover { color: #123e65; background: #ffffff; outline: 2px solid #b8d5ec; }
.secondary-action, .wwb-small-action, .wwb-reset, .wwb-edit-row { color: #214e72; background: #fff; }
.secondary-action:hover, .wwb-small-action:hover, .wwb-reset:hover, .wwb-edit-row:hover { color: #123e65; background: #e9f2f9; }
button[disabled], input[disabled], select[disabled], textarea[disabled] { cursor: not-allowed; opacity: .65; }
input, select, textarea { max-width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid #adbdcc; border-radius: 7px; color: #18324c; background: #fff; }
textarea { min-height: 82px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #647587; opacity: 1; font-weight: 400; }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: #18578d; }
input[type=file] { width: 100%; }
label { display: block; margin: 10px 0 5px; font-weight: 650; }
.field-error, .wwb-error, .error, .errorlist { color: #a12a32; font-size: 12px; }
.errorlist { margin: 5px 0; padding-left: 18px; }
[aria-invalid=true] { border-color: #b63f48; }
.form-panel { max-width: 850px; }
.form-panel h2 { margin-top: 6px; }
.form-field { margin: 16px 0; }
.form-field label { margin: 0 0 6px; }
.form-field input:not([type=checkbox]), .form-field select, .form-field textarea { width: 100%; }
.form-field small { display: block; color: var(--muted); }
.wwb-subscreen { min-width: 0; font-size: 13px; }
.wwb-subscreen > h1, .wwb-page-title { margin: 14px 0 16px; font-size: 22px; }
.wwb-navline { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.wwb-navline a { display: inline-flex; padding: 6px 11px; border: 1px solid #c6d5e2; border-radius: 7px; color: #2d536f; background: #fff; text-decoration: none; font-size: 12px; }
.wwb-navline a:hover { background: #e6f0f8; }
.wwb-subscreen .hero.wwb-subhero { padding: 18px 22px; margin: 0 0 17px; }
.wwb-subscreen .hero h1 { font-size: 24px; }
.wwb-subscreen .hero p { font-size: 12px; }
.wwb-sector { display: grid; grid-template-columns: minmax(0, 2.25fr) minmax(260px, 1fr); gap: 16px; align-items: start; margin: 17px 0 30px; min-width: 0; }
.wwb-sector.wwb-sector-single { grid-template-columns: minmax(0, 1fr); }
.wwb-table-area, .wwb-side, .wwb-inline-panel { min-width: 0; padding: 17px; border: 1px solid #d0dae3; border-radius: var(--radius); background: var(--ash); box-shadow: var(--shadow); }
.wwb-inline-panel { margin: 16px 0; }
.wwb-side { background: #edf4fa; }
.wwb-table-heading, .wwb-inline-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 10px; margin: 0 0 12px; }
.wwb-table-heading h2, .wwb-side h2, .wwb-inline-heading h2 { margin: 0; font-size: 16px; }
.wwb-inline-heading { padding-bottom: 9px; border-bottom: 1px solid #c8d6e1; }
.wwb-search { margin: 12px 0 15px; }
.wwb-search label { margin-top: 0; color: #466078; font-size: 12px; }
.wwb-search-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wwb-search-controls input { flex: 1; min-width: 130px; }
.wwb-scroll, .table-wrap { position: relative; overflow-x: auto; max-width: 100%; overscroll-behavior-inline: contain; }
.wwb-scroll:focus-visible { outline-offset: -3px; }
table { border-collapse: collapse; }
.wwb-data, .wwb-table { width: 100%; color: #203d55; background: #fff; font-size: 12px; }
.wwb-data th, .wwb-data td, .wwb-table th, .wwb-table td { padding: 10px 11px; border-bottom: 1px solid #d9e2ea; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.wwb-data thead th, .wwb-table thead th { color: #244761; background: #d6e5f1; font-size: 12px; font-weight: 750; }
.wwb-data tbody tr:nth-child(even), .wwb-table tbody tr:nth-child(even) { background: #f2f6fa; }
.wwb-data td small, .wwb-table td small { display: block; color: var(--muted); font-weight: 400; margin-top: 3px; }
.wwb-data th[scope=row] { color: #38536b; background: #f2f6fa; }
.wwb-table a { font-weight: 650; }
.wwb-edit-table th { width: 32%; }
.wwb-edit-table input:not([type=checkbox]), .wwb-edit-table select, .wwb-edit-table textarea { width: 100%; max-width: 640px; }
.wwb-pagination { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 14px; color: #4d6377; font-size: 12px; }
.wwb-pagination a { display: inline-block; padding: 5px 8px; margin-left: 5px; }
.wwb-side p { font-size: 12px; }
summary { cursor: pointer; color: #254e6e; }
summary:hover { color: #123e65; }
.wwb-side details[open] summary { margin-bottom: 17px; }
.wwb-side details h2 { margin-bottom: 9px; }
.wwb-facts-grid, .wwb-fields-grid, .wwb-form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid #cedae5; border-radius: 9px; background: #cedae5; }
.wwb-facts-grid { background: #f8fbfe; }
.wwb-fact, .wwb-field, .wwb-cell { box-shadow: 1px 0 #cedae5, 0 1px #cedae5; display: block; min-width: 0; margin: 0; padding: 12px; background: #f8fbfe; }
.wwb-fact span, .wwb-field label, .wwb-cell label { display: block; margin: 0 0 6px; color: #466078; font-size: 12px; font-weight: 700; }
.wwb-fact strong { font-size: 13px; font-weight: 550; overflow-wrap: anywhere; }
.wwb-fact-wide, .wwb-field-wide { grid-column: 1 / -1; }
.wwb-field input:not([type=checkbox]), .wwb-field select, .wwb-field textarea, .wwb-cell input:not([type=checkbox]), .wwb-cell select, .wwb-cell textarea { width: 100%; font-size: 13px; }
.wwb-field small, .wwb-cell small { display: block; color: var(--muted); margin-top: 5px; font-size: 11px; }
.wwb-form-hint { margin: 5px 0 14px; color: var(--muted); font-size: 12px; }
.wwb-form-actions { margin-top: 15px; }
.wwb-jump { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #f1f6fa; }
.wwb-jump a { padding: 5px 9px; border: 1px solid var(--line); border-radius: 5px; background: #fff; text-decoration: none; font-size: 12px; }
.wwb-inline-form { margin-top: 12px; }
.wwb-subscreen .form-panel { max-width: 100%; }
.wwb-login-wrap { display: grid; place-items: center; min-height: 66vh; padding: 28px 0; }
.wwb-login-card { width: min(100%, 430px); padding: 32px; border: 1px solid #b9cedf; border-radius: 18px; background: #f4f9fd; box-shadow: 0 15px 45px rgba(21, 53, 84, .15); }
.wwb-login-card .eyebrow { color: #2d6995; }
.wwb-login-card h1 { font-size: 25px; margin: 9px 0; }
.wwb-login-field { margin: 18px 0; }
.wwb-login-field label { margin: 0 0 6px; font-size: 13px; font-weight: 700; }
.wwb-login-field input { width: 100%; }
.wwb-login-submit { width: 100%; min-height: 42px; margin-top: 8px; font-size: 14px; }
.wwb-login-error { margin: 10px 0; color: #962932; font-size: 13px; }
@media (max-width: 1050px) {
  .sector-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wwb-facts-grid, .wwb-fields-grid, .wwb-form-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .wwb-sector { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .top-inner { min-height: 0; padding: 15px 16px; gap: 14px; }
  .topnav { gap: 10px; }
  .brand { font-size: 13px; }
  .brand small { font-size: 10px; }
  main { padding: 18px 14px 36px; }
  .hero { padding: 22px 20px; display: block; }
  .hero-back, .hero-date { display: inline-flex; margin-top: 14px; }
  .wwb-subscreen .hero.wwb-subhero { padding: 17px; }
  .wwb-subscreen .hero h1 { font-size: 21px; }
  .sector-grid, .task-grid { grid-template-columns: minmax(0, 1fr); }
  .sector { min-height: 155px; padding: 18px; }
  .section-heading { display: block; }
  .section-heading .muted { display: block; margin-top: 4px; }
  .kpi { padding: 13px; }
  .kpi strong { font-size: 27px; }
  .wwb-inline-panel, .wwb-table-area, .wwb-side { padding: 12px; }
  .wwb-facts-grid, .wwb-fields-grid, .wwb-form-grid { grid-template-columns: minmax(0,1fr); }
  .wwb-data th, .wwb-data td, .wwb-table th, .wwb-table td { padding: 8px; }
  .wwb-scroll > table, .table-wrap > table { min-width: 470px; }
  .wwb-jump { position: static; }
  .wwb-login-card { padding: 24px; }
  .wwb-login-wrap { padding: 15px 0; }
  .feed-row { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Fatti, accesso e dotazioni della scheda unità. */
/* Due note nella sezione accesso, distanziate e con punti discreti. */
.wwb-access-notes{display:flex;flex-direction:column;gap:15px}
.wwb-access-item{display:flex;align-items:flex-start;gap:9px}
.wwb-access-item>div{min-width:0;flex:1}
.wwb-access-item>div>span{display:block;font-weight:800}
.wwb-access-item>div>strong{display:block;margin-top:5px;font-weight:500}
.wwb-access-bullet{color:#111827;font-size:15px;line-height:1.2;font-weight:900}
.wwb-status-legend{text-align:right}

/* La descrizione occupa al massimo 60 caratteri tipografici; le dotazioni ricevono lo spazio restante. */
.wwb-data th.wwb-description-col,.wwb-data td.wwb-description-col{width:60ch;max-width:60ch;overflow-wrap:break-word}
.wwb-data th.wwb-dotazioni-col,.wwb-data td.wwb-dotazioni-col{width:auto;min-width:0}
/* Griglia compatta: massimo quattro righe, colonne aggiuntive scorrevoli. */
.wwb-assets-scroll{width:100%;max-width:100%;min-width:0;max-height:156px;overflow-x:hidden;overflow-y:auto;padding:4px 0;box-sizing:border-box;scrollbar-width:thin}
/* Nessun allargamento: le colonne usano soltanto la larghezza gia disponibile. */
.wwb-assets-grid{display:grid;width:100%;max-width:100%;min-width:0;grid-template-columns:repeat(auto-fill,minmax(min(100%,115px),1fr));grid-auto-flow:row;grid-auto-rows:minmax(27px,auto);gap:4px 6px;align-items:stretch;box-sizing:border-box}
.wwb-asset-chip{display:flex;align-items:center;gap:6px;min-width:0;min-height:27px;padding:4px 7px;border:1px solid #e5eaf0;border-radius:6px;background:#fbfcfe;box-sizing:border-box}
.wwb-asset-name{font-size:11px;line-height:1.2;overflow-wrap:anywhere;color:#26364b}
.wwb-status-dot{display:inline-block;flex:0 0 11px;width:11px;height:11px;border-radius:50%;border:.5px solid #303030;box-sizing:border-box;background:#e8b400}
.wwb-status-working{background:#00b85c}.wwb-status-out{background:#e33434}.wwb-status-attention{background:#e8b400}
.wwb-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.wwb-data td{vertical-align:top}
.wwb-data td:has(.wwb-assets-grid){min-width:0}
.wwb-data td .wwb-small-action{font-size:11px;padding:3px 7px}
@media(min-width:850px){.wwb-assets-grid{grid-auto-columns:minmax(115px,1fr)}}
.wwb-add-asset-action{display:flex;justify-content:flex-end;margin-bottom:5px}
.wwb-scroll > .wwb-room-table { min-width: 740px; }
.wwb-status-legend { font-size: 11px; font-weight: 650; margin: 5px 0 10px; }
.wwb-operational-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px 20px; min-width: 0; }
.wwb-operational-summary h2 { margin: 0; }
.wwb-operational-summary span { font-size: 12px; font-weight: 400; }
