:root {
  --ink: #20282d;
  --muted: #68747b;
  --line: #c8d0d4;
  --line-strong: #9faab0;
  --surface: #f8faf9;
  --canvas: #e9edef;
  --brand: #00688b;
  --brand-dark: #20272c;
  --accent: #00688b;
  --danger: #c0392b;
  --success: #2f7650;
  --steel: #344047;
  --shadow: 0 10px 28px rgba(25, 34, 39, .09);
}

html { background: #171c20; }
body {
  display: flow-root;
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--canvas);
  background-image: linear-gradient(rgba(52,64,71,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(52,64,71,.035) 1px, transparent 1px);
  background-size: 32px 32px;
  font-family: "Segoe UI Variable Text", "Segoe UI", Arial, sans-serif;
}


::selection { color: #111619; background: #ffd277; }

.app-header {
  min-height: 78px;
  padding: 0 max(28px, 4vw);
  color: #f2f4f5;
  background: rgba(24,30,34,.98);
  border-top: 3px solid transparent;
  border-bottom: 1px solid #3d484e;
  box-shadow: 0 8px 24px rgba(17,23,26,.18);
  backdrop-filter: blur(14px);
}
.brand { gap: 14px; min-width: 240px; }
.brand-mark {
  position: relative;
  width: 43px;
  height: 43px;
  overflow: hidden;
  color: #161b1e;
  background: var(--accent) !important;
  border: 1px solid #4fa8b8;
  border-radius: 2px;
  box-shadow: inset 0 0 0 3px rgba(20,25,28,.15);
  font-family: Bahnschrift, "Arial Narrow", sans-serif;
  font-size: 12px;
  letter-spacing: .08em;
}
.brand-mark::after {
  content: "";
  position: absolute;
  right: -9px;
  bottom: -7px;
  width: 28px;
  height: 10px;
  background: #20272c;
  transform: rotate(-45deg);
}
.app-header .dashboard-symbol { background: var(--accent) !important; border-color: transparent; border-radius: 3px; box-shadow: none; }
.app-header .dashboard-symbol::after { display: none; }
.app-header .dashboard-symbol img { display: block; width: 70%; height: 70%; object-fit: contain; filter: brightness(0) invert(1); transform: translateX(-1px); }
.brand strong {
  color: #f5f7f7;
  font-family: Bahnschrift, "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: .035em;
  text-transform: uppercase;
}
.brand small { color: #9ba7ad; font-size: 11px; letter-spacing: .04em; }
.tabs { gap: 3px; align-items: stretch; overflow-x: auto; scrollbar-width: thin; }
.tab {
  min-width: max-content;
  padding: 0 12px;
  color: #aeb8bd;
  border-left: 1px solid transparent;
  border-right: 1px solid transparent;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .015em;
}
.tab:hover { color: #fff; background: #222a2f; }
.tab.is-active { color: #fff; background: #2a3338; border-color: #3c474d; }
.tab.is-active::after { height: 3px; background: var(--accent); }
.count {
  min-width: 20px;
  height: 20px;
  color: #171c20;
  background: var(--accent);
  border-radius: 2px;
  font-family: Bahnschrift, monospace;
  font-weight: 700;
}
.session-user { color: #bdc5c9; font-family: Bahnschrift, sans-serif; letter-spacing: .04em; }
.header-session, .header-shutdown {
  align-self: center;
  color: #c9d0d3;
  background: #242c31;
  border-color: #465158;
  border-radius: 2px;
}
.header-session:hover { color: var(--accent); border-color: var(--accent); }
.header-shutdown:hover, .header-shutdown:focus { color: #ff8178; background: #34272a; }

main { width: min(1440px, 94vw); margin: 30px auto 64px; }
h1, h2, .analytics-heading h2 { font-family: Bahnschrift, "Segoe UI", sans-serif; font-weight: 600; letter-spacing: .015em; }
h1 { font-size: clamp(25px, 2.6vw, 36px); }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-family: Bahnschrift, "Segoe UI", sans-serif;
  font-size: 11px;
  letter-spacing: .12em;
}
.eyebrow::before { content: ""; width: 18px; height: 2px; background: currentColor; }

#maintenance-form, #work-form, #fleet-form, .fleet-register, .fleet-chart-tool, .fleet-table-wrap,
.filters, .record-card, .alerts-panel, .alert-summary-card { border-color: var(--line); border-radius: 2px; }
#maintenance-form, #work-form, #fleet-form { background: var(--surface); box-shadow: var(--shadow), inset 0 1px #fff; }
.page-heading, .work-heading, .scheduled-heading, .fleet-heading, .material-heading, .alerts-heading, .archive-heading {
  position: relative;
  overflow: hidden;
  color: #f5f7f7;
  background-color: #283137;
  background-image: linear-gradient(135deg, transparent 0 70%, rgba(255,255,255,.035) 70%), repeating-linear-gradient(90deg, transparent 0 79px, rgba(255,255,255,.025) 80px);
  border-bottom: 1px solid #121719;
}
.page-heading, .archive-heading { padding: 29px 34px 25px; }
.page-heading::after, .alerts-heading::after, .archive-heading::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  width: auto;
  height: 3px;
  background: var(--accent);
}
.sheet-number label { color: #fff; letter-spacing: .07em; }
.sheet-number input { color: #fff; background: #1e2529; border-color: #59656b; font-family: Bahnschrift, monospace; font-weight: 600; }

.form-band { padding: 24px 34px 27px; border-bottom-color: #d3d9dc; }
.form-band:nth-of-type(even) { background: rgba(233,237,239,.36); }
#work-form.activity-verification .office-report-bottom-row > .form-band {
  padding: 24px 34px 27px;
  border-bottom: 0;
  background: #f7f9fa;
}
#work-form.activity-verification .office-report-bottom-row .safety-organ-section h2 { margin-bottom: 19px; }
.form-band h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 19px;
  color: #293238;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: .055em;
}
.form-band h2::before { content: ""; width: 5px; height: 17px; background: var(--accent); }
#fleet-form .form-band.fleet-entry-band {
  padding: 13px 34px 20px;
  background-color: #eef2f3;
  background-image:
    linear-gradient(135deg, transparent 0 62%, rgba(60,78,87,.055) 62%),
    linear-gradient(145deg, #f7f9fa, #e7edef);
  border: 1px solid #c7d1d5;
  border-top: 0;
  box-shadow: 0 5px 16px rgba(31,40,45,.06);
}
#fleet-form-view .fleet-dashboard { margin-top: 16px; }
label { color: #4c5960; font-size: 11px; letter-spacing: .025em; }
input, select, textarea { min-height: 41px; color: #1e262b; background: #fff; border-color: #aeb9bf; border-radius: 2px; }
textarea { min-height: 74px; }
input:hover, select:hover, textarea:hover { border-color: #7e8b92; }
input:focus, select:focus, textarea:focus { border-color: #00688b; box-shadow: 0 0 0 3px rgba(0,104,139,.16); }
input[readonly], input:disabled, select:disabled { background: #edf0f1; }
.sheet-number input[readonly], .sheet-number input[aria-readonly="true"] {
  color: #ffffff;
  background: #182126;
  border-color: #77858d;
  font-size: 16px;
  font-weight: 700;
  opacity: 1;
  -webkit-text-fill-color: #ffffff;
}
input[type="checkbox"], input[type="radio"] { min-height: 0; accent-color: var(--brand); }
.choice-grid label { min-height: 43px; color: #354047; background: #f1f4f4; border-color: #c1cacf; border-radius: 2px; }
.choice-grid label:has(input:checked) { color: #1b2226; background: #e7f5f7; border-color: #00688b; box-shadow: inset 4px 0 var(--accent); }
.form-actions { padding: 19px 34px; background: #e3e8ea; border-top: 1px solid #fff; }

.button, .icon-button { border-radius: 2px; letter-spacing: .015em; }
.button { min-height: 40px; }
.button.primary, #work-form-view .button.primary, #scheduled-maintenance-view .button.primary, #fleet-form-view .button.primary,
#work-form-view .segmented-control input:checked + span, #scheduled-maintenance-view .segmented-control input:checked + span,
#fleet-form-view .segmented-control input:checked + span { color: #fff; background: var(--accent); border-color: #00688b; }
.button.primary:hover, #work-form-view .button.primary:hover, #scheduled-maintenance-view .button.primary:hover,
#fleet-form-view .button.primary:hover { background: #00688b; }
.button.secondary, .icon-button { color: #303a40; background: #f8f9f9; border-color: #aeb8bd; }
.button.secondary:hover, .icon-button:hover { background: #e7ebed; border-color: #7e8a90; }
#work-form .ram-clear-button { color: #fff; background: linear-gradient(145deg, #00688b, #00688b); border-color: #00688b; }
#work-form .ram-clear-button:hover { color: #fff; background: #00688b; border-color: #00688b; }
.readonly-back-button { color: #fff; background: #28784a; border-color: #1d633b; }
.readonly-back-button:hover { color: #fff; background: #1d633b; border-color: #164c2d; }
.material-filters .button.material-clear-button {
  color: #fff;
  background: linear-gradient(145deg, #00688b, #00688b);
  border-color: #00688b;
}
.material-filters .button.material-clear-button:hover {
  color: #fff;
  background: linear-gradient(145deg, #00688b, #00688b);
  border-color: #00688b;
}
.material-filters .button.material-export-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: #fff; background: var(--brand-dark); border-color: var(--brand-dark); }
.material-filters .button.material-export-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.material-filters .button.material-export-button:disabled { opacity: 1; color: #fff; background: var(--brand-dark); border-color: var(--brand-dark); filter: none; }
.material-filters {
  background-color: #eef2f3;
  background-image:
    linear-gradient(135deg, transparent 0 62%, rgba(60,78,87,.055) 62%),
    linear-gradient(145deg, #f7f9fa, #e7edef);
  border-color: #c7d1d5;
  border-top-color: var(--accent);
}
.material-filters label { color: #43525a; }
.work-activity-type, .segmented-control { padding: 3px; background: #dfe5e7; border-color: #abb6bc; border-radius: 2px; }
.work-activity-type span, .segmented-control span { border-radius: 1px; }
.work-activity-type input:checked + span, .segmented-control input:checked + span { color: #171c20; background: var(--accent); }
.work-activity-type { padding: 5px; border-color: var(--line); background: #e7edef; }
.work-activity-type span { padding: 9px 14px; border: 1px solid transparent; border-radius: 3px; }
.work-activity-type input:checked + span { color: var(--ink); border-color: #bdc8ce; background: #fff; box-shadow: 0 1px 2px rgba(20,35,45,.08); }
.component-details, .work-source-mode { background: #edf1f2; border-left-color: var(--accent); }

.archive-heading { align-items: end; margin-bottom: 18px; }
#archive-view .archive-heading, #material-management-view .material-heading { margin-bottom: 0; }
.archive-heading .eyebrow { color: #00688b; }
#personnel-management-view .personnel-heading { margin-bottom: 0; }
#personnel-management-view .personnel-heading::after { background: #aeb8bd; }
#material-management-view .material-heading::after { background: #aeb8bd; }
#material-management-view .material-filters { border-top: 0; }
#fleet-form-view .fleet-heading::after { background: #aeb8bd; }
#archive-view .archive-heading::after { background: #aeb8bd; }
#alerts-view .alerts-heading::after { background: #aeb8bd; }
#competency-monitoring-view .page-heading::after { background: #aeb8bd; }
#competency-monitoring-view .competency-filters { border-top: 0; }
.maintainer-workspace { display: grid; grid-template-columns: 296px minmax(0, 1fr); gap: 12px; min-height: 650px; margin: 0; border: 0; border-radius: 0; background: transparent; }
.maintainer-sidebar { position: relative; display: flex; height: 657px; overflow: hidden; flex-direction: column; border: 1px solid #c9d2d6; background: #fff; }
.maintainer-sidebar-heading { display: flex; min-height: 82px; align-items: center; justify-content: flex-start; gap: 8px; box-sizing: border-box; padding: 14px 34px; border-bottom: 1px solid #d5dde0; }
.maintainer-sidebar-heading h2 { margin: 0; color: #1e2a30; font-size: 20px; }
.maintainer-sidebar-heading .icon-button { width: 32px; min-height: 32px; padding: 0; border-color: #00688b; border-radius: 0; color: #fff; background: #00688b; font-size: 23px; }
.maintainer-sidebar-heading .workspace-new-maintainer { display: inline-flex; min-height: 34px; align-items: center; gap: 10px; padding: 0; border: 0; border-radius: 0; color: #26343a; background: transparent; box-shadow: none; font-size: 14px; font-weight: 800; white-space: nowrap; }
.workspace-new-maintainer-icon { position: relative; display: block; width: 34px; height: 34px; flex: 0 0 34px; background: #00688b; }
.workspace-new-maintainer-icon::before { position: absolute; top: 7px; left: 50%; width: 8px; height: 8px; border-radius: 50%; background: #fff; content: ""; transform: translateX(-50%); }
.workspace-new-maintainer-icon::after { position: absolute; bottom: 6px; left: 50%; width: 18px; height: 10px; border-radius: 10px 10px 3px 3px; background: #fff; content: ""; transform: translateX(-50%); }
.maintainer-sidebar-heading .workspace-new-maintainer:hover { color: #00688b; background: transparent; }
.maintainer-sidebar-heading .workspace-new-maintainer:hover .workspace-new-maintainer-icon { background: #00688b; }
.maintainer-entry-icon { display: none; width: 30px; height: 30px; flex: 0 0 30px; align-items: center; justify-content: center; box-sizing: border-box; border: 1px solid #8ebdc6; border-radius: 2px; color: #00688b; background: #e3f5f8; }
.maintainer-entry-icon svg { display: block; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.maintainer-sidebar.is-entry .maintainer-search, .maintainer-sidebar.is-entry .maintainer-workspace-list { display: none; }
.maintainer-sidebar.is-entry .maintainer-sidebar-heading .icon-button { display: none; }
.maintainer-sidebar.is-entry .maintainer-sidebar-heading .workspace-new-maintainer { display: none; }
.maintainer-sidebar.is-entry .maintainer-entry-icon { display: inline-flex; }
.maintainer-sidebar.is-entry { display: flex; flex-direction: column; }
.maintainer-sidebar.is-entry #maintainer-entry { flex: 1; background: #f8fafb; }
.maintainer-sidebar.is-entry .maintainer-sidebar-footer { display: none; }
.maintainer-sidebar.is-entry .access-enabled-field:has(input[name="monitorCompetencyExpiry"]) { position: absolute; right: 16px; bottom: 16px; left: 16px; display: flex !important; margin: 0; }
.maintainer-sidebar .personnel-data-grid { row-gap: 10px; margin-bottom: 0; }
.maintainer-sidebar.is-entry .maintainer-sidebar-heading::after { color: #64747a; content: "Inserimento dati"; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.maintainer-search { margin: 16px; }
.maintainer-search > span { display: none; }
.maintainer-search::before { position: absolute; z-index: 1; top: 50%; left: 11px; color: #64747a; content: "⌕"; font-size: 21px; transform: translateY(-50%); }
.maintainer-workspace-list { min-height: 0; overflow-y: auto; flex: 1; border-top: 1px solid #e1e6e8; }
.maintainer-sidebar-footer { flex: 0 0 auto; padding: 17px 16px; border-top: 1px solid #d5dde0; background: #fff; }
.maintainer-sidebar-footer .workspace-delete-maintainer { display: inline-flex; align-items: center; }
.maintainer-list-item { display: grid; grid-template-columns: 38px minmax(0, 1fr) 18px; gap: 2px 10px; width: 100%; padding: 14px 34px; border: 0; border-bottom: 1px solid #dde4e7; border-radius: 0; color: #26343a; background: #fff; text-align: left; }
.maintainer-list-item:hover, .maintainer-list-item.is-selected { background: #e3f5f8; }
.maintainer-list-item > .maintainer-list-avatar { grid-row: 1 / span 2; display: grid; width: 34px; height: 34px; place-items: center; color: #fff; background: #00688b; font-size: 12px; font-weight: 850; }
.maintainer-list-item strong { font-size: 14px; }.maintainer-list-item small { color: #5c6b72; font-size: 12px; }
.maintainer-detail { display: flex; min-width: 0; padding: 0; flex-direction: column; gap: 12px; background: transparent; }
.maintainer-detail-summary { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border: 1px solid #cbd5d9; background: #fff; }
.maintainer-detail-summary > span { display: grid; width: 52px; height: 52px; place-items: center; box-sizing: border-box; padding: 0 0 2px 4px; color: #fff; background: #00688b; font-size: 16px; font-weight: 850; text-align: center; }.maintainer-detail-summary h2 { margin: 0; color: #17252c; font-size: 25px; }.maintainer-detail-summary p { margin: 3px 0 0; color: #55646b; }
.maintainer-matrix { margin: 0; overflow-x: auto; border: 1px solid #cbd5d9; background: #fff; }.maintainer-matrix table { width: 100%; min-width: 980px; border-collapse: collapse; }.maintainer-matrix th, .maintainer-matrix td { padding: 10px; border-right: 1px solid #dbe2e5; border-bottom: 1px solid #dbe2e5; text-align: center; }.maintainer-matrix thead th { color: #1f2b31; background: #eef2f4; font-size: 12px; }.maintainer-matrix tbody th { min-width: 265px; color: #26343a; background: #fff; text-align: left; font-size: 13px; }.matrix-check, .matrix-empty { display: inline-grid; width: 27px; height: 27px; place-items: center; box-sizing: border-box; font-size: 18px; }.matrix-check { color: #fff; border: 1px solid #00688b; background: #00688b; }.matrix-empty { border: 2px solid #aab7bd; background: #fff; }.maintainer-status { display: inline-block; min-width: 90px; padding: 6px 8px; border-radius: 0; font-size: 12px; font-weight: 800; }.maintainer-status.is-valid { color: #17643b; background: #dff4e6; }.maintainer-status.is-none { color: #56646a; background: #e8ecee; }.maintainer-workspace-empty { margin: 24px; color: #64747a; }
.workspace-controls { display: flex; gap: 12px; margin: 14px 16px 0; }.workspace-controls label { display: grid; gap: 5px; min-width: 180px; color: #26343a; font-size: 12px; font-weight: 750; }.workspace-controls select { min-height: 36px; border: 1px solid #aebdc3; border-radius: 0; background: #fff; color: #17252c; padding: 0 8px; }.workspace-check { display: inline-grid; width: 28px; height: 28px; cursor: pointer; }.workspace-check input { position: absolute; opacity: 0; pointer-events: none; }.workspace-check span { display: grid; width: 28px; height: 28px; place-items: center; box-sizing: border-box; border: 2px solid #aab7bd; background: #fff; color: transparent; font-size: 17px; font-weight: 800; }.workspace-check input:checked + span { border-color: #00688b; background: #00688b; color: #fff; }.maintainer-matrix.is-editor input[type="date"] { min-height: 34px; max-width: 142px; border: 1px solid #aebdc3; border-radius: 0; padding: 3px 6px; color: #17252c; background: #fff; }
.maintainer-matrix.is-editor input[type="date"]:disabled { border-color: #d5dde0; color: #93a1a7; background: #f2f5f6; cursor: not-allowed; }.button[type="submit"]:disabled { cursor: not-allowed; opacity: .48; }#maintainer-detail > .maintainer-matrix { flex: 1; }#maintainer-detail > .personnel-inline-actions { display: flex; justify-content: flex-end; gap: 8px; margin: -12px 0 0; padding: 16px; border: 1px solid #cbd5d9; border-top: 0; background: #fff; }#maintainer-detail > .personnel-inline-actions .button { min-width: 112px; }
.maintainer-matrix.is-editor { border-bottom: 0; }.maintainer-matrix.is-editor th, .maintainer-matrix.is-editor td { padding-top: 5px; padding-bottom: 5px; }.maintainer-matrix.is-editor .workspace-check, .maintainer-matrix.is-editor .workspace-check span { width: 26px; height: 26px; }.maintainer-matrix.is-editor input[type="date"] { min-height: 30px; }
.maintainer-matrix.is-editor select[data-workspace-validity], .maintainer-matrix.is-editor select[data-workspace-alert] { min-height: 30px; border: 1px solid #aebdc3; border-radius: 0; background: #fff; color: #17252c; padding: 2px 5px; }
#maintainer-entry > #user-access-form { margin: 0; border: 0; box-shadow: none; }.maintainer-sidebar .maintainer-profile-summary, .maintainer-sidebar .competency-expiry-section, .maintainer-sidebar .personnel-login-grid { display: none !important; }.maintainer-sidebar .maintainer-profile-card { margin: 0; border: 0; border-radius: 0; box-shadow: none; }.maintainer-sidebar .maintainer-profile-card > .personnel-data-grid { display: grid; grid-template-columns: 1fr; padding: 16px; }.maintainer-sidebar .personnel-inline-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 16px; }.maintainer-sidebar .personnel-inline-actions .button { width: 100%; }.maintainer-sidebar .personnel-data-grid label { gap: 5px; font-size: 11px; }.maintainer-sidebar .personnel-data-grid input { min-height: 36px; padding: 7px 8px; }.maintainer-sidebar #cancel-user-access { display: block !important; }
.maintainer-detail > .maintainer-matrix { box-sizing: border-box; padding: 12px 12px 0; }
.maintainer-detail > .maintainer-matrix table { border: 1px solid #dbe2e5; }
#maintainer-detail > .personnel-inline-actions { padding: 16px 12px 12px; }
.maintainer-competency-card { display: flex; min-height: 0; flex: 1; flex-direction: column; box-sizing: border-box; padding: 20px; border: 1px solid #b8c4c9; background: #fff; }
.maintainer-competency-card > .maintainer-matrix { flex: 1; padding: 0; border: 1px solid #dbe2e5; }
.maintainer-competency-card > .personnel-inline-actions { display: flex; justify-content: flex-end; gap: 8px; margin: 0; padding: 16px 0 0; border: 0; background: #fff; }
.maintainer-competency-card > .personnel-inline-actions .button { min-width: 112px; }
.workspace-delete-maintainer { min-height: 40px; padding: 0; color: #20282d; border: 0; background: transparent; box-shadow: none; }
.workspace-delete-icon { display: inline-grid; width: 40px; min-height: 40px; margin-right: 9px; place-items: center; color: #94372f; border: 1px solid #dfb6b2; border-radius: 2px; background: #f9e9e7; line-height: 1; vertical-align: middle; }
.workspace-delete-icon svg { display: block; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.workspace-delete-maintainer:hover { color: #20282d; border: 0; background: transparent; }
.workspace-delete-maintainer:hover .workspace-delete-icon { color: #7f2b25; border-color: #c57f78; background: #f5d9d5; }
.maintainer-competency-card .maintainer-matrix.is-editor th, .maintainer-competency-card .maintainer-matrix.is-editor td { padding-top: 3px; padding-bottom: 3px; }
.maintainer-competency-card .maintainer-matrix.is-editor input[type="date"], .maintainer-competency-card .maintainer-matrix.is-editor select[data-workspace-validity], .maintainer-competency-card .maintainer-matrix.is-editor select[data-workspace-alert] { min-height: 28px; }
.maintainer-competency-card .maintainer-matrix.is-editor input[type="date"] { height: 28px; min-height: 28px; box-sizing: border-box; padding: 2px 6px; }
.maintainer-competency-card .maintainer-matrix.is-editor .date-entry-input { height: 28px; min-height: 28px; box-sizing: border-box; padding: 2px 30px 2px 6px; }
.maintainer-competency-card .maintainer-matrix.is-editor .date-entry-picker { right: 2px; width: 28px; height: 28px; }
.maintainer-competency-card .maintainer-matrix tbody tr:last-child > th, .maintainer-competency-card .maintainer-matrix tbody tr:last-child > td { border-bottom: 0; }
.maintainer-competency-card .maintainer-matrix.is-editor .workspace-check, .maintainer-competency-card .maintainer-matrix.is-editor .workspace-check span { width: 24px; height: 24px; }
#form-view .page-heading::after { background: #aeb8bd; }
#work-archive-view .archive-heading::after { background: #aeb8bd; }
#scheduled-maintenance-view .scheduled-heading::after { background: #aeb8bd; }
#work-form-view .work-heading::after { background: #aeb8bd; }
#archive-view .filters { border-top: 0; }

/* Gestione manutentori: allineamento visivo con Gestione accessi */
.maintainer-workspace { grid-template-columns:260px minmax(0,1fr); gap:18px; }
.maintainer-sidebar { border-color:var(--line); border-radius:12px; box-shadow:var(--shadow); }
.maintainer-sidebar-heading { min-height:70px; padding:14px 18px; background:#f6fafb; }
.maintainer-sidebar-heading .workspace-new-maintainer { width:100%; gap:10px; }
.workspace-new-maintainer-icon { width:34px; height:34px; flex-basis:34px; box-sizing:border-box; border:1px solid #00688b; border-radius:6px; }
.maintainer-workspace-list { display:grid; align-content:start; gap:7px; padding:10px; border-top:0; }
.maintainer-list-item { min-height:66px; grid-template-columns:40px minmax(0,1fr); gap:2px 10px; box-sizing:border-box; padding:10px; border:1px solid #dce5e9; border-radius:9px; }
.maintainer-list-item:hover,.maintainer-list-item.is-selected { border-color:#00688b; background:#eefbfc; }
.maintainer-list-item > .maintainer-list-avatar { width:40px; height:40px; box-sizing:border-box; border:1px solid #b9dde2; border-radius:6px; color:#00688b; background:#e4f5f7; }
.maintainer-list-item > strong { grid-column:2; grid-row:1; }
.maintainer-list-item > small { grid-column:2; grid-row:2; }
.maintainer-sidebar-footer { padding:16px; }
.workspace-delete-icon { border-radius:6px; }
.maintainer-detail-summary { border-radius:12px; box-shadow:var(--shadow); }
.maintainer-detail-summary > span { border:1px solid #b9dde2; border-radius:7px; color:#00688b; background:#e4f5f7; }
#personnel-management-view .settings-tabs {
  gap: 7px;
  margin-bottom: 18px;
  padding: 10px 34px;
  background-color: #eef2f3;
  background-image:
    linear-gradient(135deg, transparent 0 62%, rgba(60,78,87,.055) 62%),
    linear-gradient(145deg, #f7f9fa, #e7edef);
  background-size: 100% 96px;
  background-repeat: no-repeat;
  border: 1px solid #c7d1d5;
  border-top: 0;
  box-shadow: 0 5px 16px rgba(31,40,45,.06);
}
.filters {
  grid-template-columns: minmax(150px, .7fr) 140px minmax(205px, 1.05fr) 140px 125px 125px 125px 124px 134px;
  gap: 10px 12px;
  margin-bottom: 14px;
  padding: 13px 34px 20px;
  background-color: #eef2f3;
  background-image:
    linear-gradient(135deg, transparent 0 62%, rgba(60,78,87,.055) 62%),
    linear-gradient(145deg, #f7f9fa, #e7edef);
  border: 1px solid #c7d1d5;
  border-top: 3px solid var(--accent);
  box-shadow: 0 5px 16px rgba(31,40,45,.06);
}
.filters label { color: #43525a; }
.filters .button { min-height: 40px; }
.filters .button.archive-clear-button { width: 124px; white-space: nowrap; }
.filters .button.archive-export-button { width: 134px; white-space: nowrap; }
.filters .button.archive-clear-button { color: #fff; background: linear-gradient(145deg, #00688b, #00688b); border-color: #00688b; }
.filters .button.archive-clear-button:hover { color: #fff; background: linear-gradient(145deg, #00688b, #00688b); border-color: #00688b; }
.filters .button.archive-export-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: #fff; background: var(--brand-dark); border-color: var(--brand-dark); }
.filters .button.archive-export-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.filters .button.archive-export-button:hover { color: #fff; background: var(--brand); border-color: var(--brand); }
@media (max-width: 1100px) {
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters .search-field { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .filters { grid-template-columns: 1fr; padding-right: 20px; padding-left: 20px; }
  .filters .button { width: 100%; }
}
.archive-list { gap: 6px; }
.record-card {
  position: relative;
  padding: 13px 16px;
  background: #fafbfb;
  border-left: 5px solid #5d6970;
  box-shadow: 0 2px 5px rgba(35,43,48,.04);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.record-card::before { content: ""; position: absolute; top: 6px; right: 6px; width: 4px; height: 4px; background: #9ba6ac; }
.record-card:hover { z-index: 1; border-left-color: var(--accent); box-shadow: 0 8px 20px rgba(30,39,44,.12); transform: translateX(2px); }
.record-card small { color: #69767c; text-transform: uppercase; letter-spacing: .035em; }
.record-type-badge, .record-link-badge, .order-badge { border-radius: 2px; }
.record-type-badge { color: #37434a; background: #dde3e5; border: 1px solid #c1cace; }
.record-type-badge.maintenance { color: #37434a; background: #dde3e5; border-color: #c1cace; }
.record-type-badge.internal-maintenance, .record-type-badge.fleet { color: #31596a; background: #e2eef2; }
.record-type-badge.verification { color: #fff; background: #c0392b; border-color: #8f2d22; }
.record-actions button { background: #f3f5f5; border-color: #b8c1c6; }
.technical-note-open { background: #f2fafb; border-left-color: var(--accent); }

.fleet-register-table th, .fleet-summary-table th, .material-table th, .scheduled-table th, .scheduled-checklist-table th {
  color: #e9edef;
  background: #354047;
  border-color: #4b575d;
  font-family: Bahnschrift, "Segoe UI", sans-serif;
  font-weight: 500;
  letter-spacing: .035em;
  text-transform: uppercase;
}
#fleet-form-view .fleet-register-table thead th { height: 45px; vertical-align: middle; }
#fleet-form-view .fleet-register-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background-color: var(--brand);
  background-image: linear-gradient(120deg, #00688b, #00688b);
}
#fleet-form-view .fleet-register-table thead th {
  position: static;
  background-color: transparent;
  background-image: none;
}
#fleet-form-view .fleet-register-table th:first-child,
#fleet-form-view .fleet-register-table td:first-child,
#fleet-form-view .fleet-register-table th:not(:first-child):not(.fleet-register-spacer),
#fleet-form-view .fleet-register-table td:not(:first-child):not(.fleet-register-spacer) { width: 160px; }
#fleet-form-view .fleet-register-table th:not(:first-child):not(.fleet-register-spacer) { text-align: right; }
#fleet-form-view .fleet-register-table { table-layout: fixed; }
#fleet-form-view .fleet-register-table-wrap { max-height: 640px; }
.fleet-register-table tbody tr:nth-child(even), .fleet-summary-table tbody tr:nth-child(even), .material-table tbody tr:nth-child(even), .scheduled-table tbody tr:nth-child(even) { background: #edf1f2; }
.fleet-register-table tbody tr:hover, .fleet-summary-table tbody tr:hover, .material-table tbody tr:hover, .scheduled-table tbody tr:hover { background: #e7f5f7; }
.fleet-register-table td:not(:first-child), .fleet-summary-table td strong { color: #2e383e; font-family: Bahnschrift, monospace; }
.fleet-chart-tool { box-shadow: 0 5px 18px rgba(31,40,45,.07); }

.alerts-heading { margin-bottom: 16px; padding: 29px 34px 25px; box-shadow: var(--shadow); }
#fleet-form-view .fleet-heading { margin-bottom: 20px; }
#fleet-form, #fleet-form .fleet-entry-band { border-bottom-right-radius: 0 !important; border-bottom-left-radius: 0 !important; }
#fleet-form-view .fleet-dashboard { margin-top: 0; }
#fleet-form-view .fleet-register { border-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; }
.alerts-heading > div > p:last-child, .alerts-updated { color: #c2cbd0; }

#fleet-statistics-dialog { width: min(1320px, 94vw); max-width: none; padding: 0; overflow: hidden; border: 0; border-radius: 12px; box-shadow: 0 18px 48px rgba(16, 33, 41, .28); }
#fleet-statistics-dialog::backdrop { background: rgba(17, 31, 38, .45); backdrop-filter: blur(2px); }
.fleet-statistics-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 25px 30px; color: #fff; background: linear-gradient(120deg, #00688b, #00688b); }
.fleet-statistics-dialog-header .eyebrow { margin-bottom: 7px; color: rgba(255,255,255,.82); }
.fleet-statistics-dialog-header h2 { margin: 0; font-size: 27px; }
.fleet-statistics-dialog-header .icon-button { width: 38px; height: 38px; padding: 0 0 3px; border-color: rgba(255,255,255,.72); color: #fff; background: rgba(255,255,255,.12); font-size: 27px; line-height: 1; }
.fleet-statistics-dialog-content { padding: 22px 28px 28px; background: #f4f7f8; }
.fleet-statistics-cycle { margin: 0 0 18px; color: #34454d; font-size: 15px; font-weight: 750; }
.fleet-statistics-table-wrap { overflow-x: auto; border: 1px solid #d1dce0; border-radius: 9px; background: #fff; }
.fleet-statistics-table { width: 100%; min-width: 1080px; border-collapse: collapse; }
.fleet-statistics-table th, .fleet-statistics-table td { padding: 14px 16px; border-right: 1px solid #dce4e7; border-bottom: 1px solid #dce4e7; text-align: right; white-space: nowrap; }
.fleet-statistics-table th { color: #fff; background: var(--brand); font-size: 12px; font-weight: 800; }
.fleet-statistics-table th:first-child, .fleet-statistics-table td:first-child { text-align: left; }
.fleet-statistics-table th:last-child, .fleet-statistics-table td:last-child { border-right: 0; text-align: center; }
.fleet-statistics-table tbody tr:last-child td { border-bottom: 0; }
.fleet-statistics-table tbody tr:nth-child(even) { background: #f8fafb; }
.fleet-statistics-status { display: inline-flex; align-items: center; justify-content: center; min-width: 124px; padding: 6px 10px; border: 1px solid transparent; border-radius: 999px; font-size: 12px; font-weight: 800; }
.fleet-statistics-status.is-regular { color: #216844; border-color: #b6d8c0; background: #e7f3e9; }
.fleet-statistics-status.is-approaching { color: #946000; border-color: #ecd08c; background: #fff5d9; }
.fleet-statistics-status.is-due { color: #a95700; border-color: #f0c28b; background: #fff0db; }
.fleet-statistics-status.is-urgent { color: #a32e35; border-color: #e5aab0; background: #fff0f1; }
.fleet-statistics-status.is-unconfigured { color: #53636c; border-color: #c9d4d8; background: #eef2f3; }
.fleet-statistics-empty, .fleet-statistics-unavailable { margin: 0; color: #617079; }
.fleet-statistics-empty { padding: 15px 0; }
.fleet-statistics-unavailable { text-align: center !important; }

@media (min-width: 561px) {
  body[data-active-view="fleet-form-view"] { overflow-y: hidden; }
}

.alerts-summary { gap: 10px; margin-bottom: 14px; }
.alert-summary-card {
  position: relative;
  min-height: 126px;
  padding: 18px 19px;
  overflow: hidden;
  background: #f8fafa;
  border-top-width: 3px;
  box-shadow: 0 5px 16px rgba(31,40,45,.07);
}
.alert-summary-card::after { content: ""; position: absolute; right: -15px; bottom: -15px; width: 60px; height: 60px; border: 8px solid rgba(56,68,75,.05); transform: rotate(45deg); }
.alert-summary-card strong { color: #273137; font-family: Bahnschrift, monospace; font-size: 38px; }
.alert-summary-card.is-open, .alert-summary-card.is-verification { border-top-color: #c0392b; }
.alert-summary-card.is-order { border-top-color: #b94d47; }
.alert-summary-card.is-deadline { border-top-color: #507286; }
.alert-summary-card.is-neutral { border-top-color: #89969c; }
.alert-summary-card.has-warning { border-top-color: var(--accent); }
.alert-summary-card.is-critical { border-top-color: var(--danger); }
.alerts-board { gap: 20px; }
#alerts-view .alerts-heading, #alerts-view .alerts-summary { margin-bottom: 20px; }
#alerts-view .alerts-summary { gap: 20px; }
.alerts-panel { position: relative; box-shadow: 0 5px 18px rgba(31,40,45,.07); }
.alerts-panel::after { content: ""; position: absolute; right: -15px; bottom: -15px; width: 60px; height: 60px; border: 8px solid rgba(56,68,75,.05); transform: rotate(45deg); pointer-events: none; }
.alerts-panel-heading, .alerts-list { position: relative; z-index: 1; }
.alerts-panel-heading { position: relative; overflow: hidden; padding: var(--secondary-heading-padding, 16px 18px); background-color: #687279; background-image: linear-gradient(135deg, transparent 0 58%, rgba(255,255,255,.12) 58%), repeating-linear-gradient(90deg, transparent 0 79px, rgba(255,255,255,.04) 80px); border-bottom-color: #485158; }
.alerts-panel-heading .eyebrow { color: #151a1d; }
.alerts-panel-heading.competency-panel-heading { position: relative; overflow: hidden; background-color: #687279; background-image: linear-gradient(135deg, transparent 0 58%, rgba(255,255,255,.12) 58%), repeating-linear-gradient(90deg, transparent 0 79px, rgba(255,255,255,.04) 80px); border-bottom-color: #485158; }
.alerts-panel-heading.competency-panel-heading .eyebrow { color: #151a1d; }
.fleet-register .analytics-heading, .material-register-heading, .personnel-panel-heading, .backup-panel-header, .scheduled-list-actions { padding: var(--secondary-heading-padding, 16px 18px); }
#fleet-form-view .fleet-register .analytics-heading {
  min-height: 45px;
  padding: 5px 34px !important;
}
#fleet-form-view .fleet-register .analytics-heading h2 { font-size: 20px; }
#fleet-form-view .fleet-register-row-delete { width: 24px; height: 24px; margin-left: 9px; padding: 0; border: 1px solid #e3aeb0; border-radius: 2px; color: #a32e35; background: #fff5f5; font-weight: 900; line-height: 1; vertical-align: middle; }
#fleet-form-view .fleet-register-row-delete:hover { color: #fff; border-color: #9e2b32; background: #ad343e; }
#competency-monitoring-view .page-heading { margin-bottom: 16px; }
#competency-monitoring-view .competency-monitoring-table-wrap { overflow: auto; border: 1px solid #cbd5d9; border-radius: 12px; background: #fff; box-shadow: 0 5px 16px rgba(31,40,45,.07); }
#competency-monitoring-view .competency-monitoring-table { width: 100%; min-width: 1040px; border-collapse: collapse; table-layout: fixed; }
#competency-monitoring-view .competency-monitoring-table th, #competency-monitoring-view .competency-monitoring-table td { height: 52px; padding: 7px 12px; border-right: 1px solid #c7d1d5; border-bottom: 1px solid #bfcacf; text-align: center; font-size: 14px; font-weight: 800; }
#competency-monitoring-view .competency-monitoring-table thead th { height: 44px; padding-top: 7px; padding-bottom: 7px; color: #f5f7f7; background-color: var(--brand); background-image: none; border-bottom-color: var(--brand); font-size: 12px; font-weight: 750; letter-spacing: .035em; text-transform: uppercase; }
#competency-monitoring-view .competency-monitoring-table th:first-child { width: 210px; }
#competency-monitoring-view .competency-monitoring-table tbody th { color: #26353c; background: #fff; text-align: left; font-size: 16px; }
#competency-monitoring-view .competency-monitoring-cell.is-empty { color: #4d5d64; background: #f2f4f5; }
#competency-monitoring-view .competency-monitoring-cell.is-valid { color: #26353c; background: #fff; }
#competency-monitoring-view .competency-monitoring-cell.is-warning { color: #5a4210; background: #ffe0a1; }
#competency-monitoring-view .competency-monitoring-cell.is-expired { color: #7f2025; background: #ff9fa1; }
#competency-monitoring-view .competency-monitoring-cell.is-first-expiry { position: relative; }
#competency-monitoring-view .competency-monitoring-cell.is-first-expiry::after { position: absolute; top: 3px; right: 6px; color: #17232d; content: "*"; font-size: 17px; font-weight: 900; line-height: 1; }
#competency-monitoring-view .competency-monitoring-renewal, #competency-monitoring-view .competency-monitoring-days { display: block; line-height: 1.1; white-space: nowrap; }
#competency-monitoring-view .competency-monitoring-days { margin-top: 3px; font-size: 10px; font-weight: 700; opacity: .78; }
#fleet-form-view [hidden] { display: none !important; }
#fleet-form-view .fleet-km-grid { grid-template-columns: repeat(4, minmax(130px, 1fr)); }
#fleet-form-view .fleet-filter-fields { grid-template-columns: repeat(4, minmax(130px, 1fr)); }
#fleet-form-view .fleet-entry-row { gap: 14px; }
#fleet-form-view .fleet-form-actions { display: flex; align-items: end; gap: 8px; padding: 0; border-top: 0; background: transparent; }
#fleet-form-view .fleet-form-actions .fleet-dashboard-action { width: 40px; min-height: 40px; height: 40px; padding: 0; color: #fff; background: #ad343e; border-color: #8f2d22; font-size: 18px; }
#fleet-form-view .fleet-form-actions .fleet-dashboard-action.is-editing { background: #2d7a54; border-color: #245f40; }
#fleet-form-view .fleet-filter-grid { grid-template-columns: 140px minmax(0, 1fr); align-items: end; }
#fleet-form-view .fleet-filter-grid label { width: 140px; }
#fleet-form-view .fleet-statistics { display: flex; align-items: end; gap: 18px; min-height: 40px; padding: 0 4px; color: #52626a; font-size: 13px; font-weight: 750; }
#fleet-form-view .fleet-statistics label { width: 160px; }
#fleet-form-view .fleet-statistics input[readonly] { color: #2c3d45; background: #e9eef0; cursor: default; }
#fleet-form-view .fleet-statistics .fleet-forecast { align-self: center; padding-top: 18px; color: #16303c; font-size: 14px; }
#fleet-form-view .fleet-filter-toggle, #fleet-form-view .fleet-dashboard-filter, #fleet-form-view .fleet-filter-close { display: grid; width: 40px; min-height: 40px; height: 40px; padding: 0; place-items: center; }
#fleet-form-view .fleet-filter-toggle { color: #53646c; border-color: #cbd5d9; background: #eef2f3; }
#fleet-form-view .fleet-dashboard-filter { color: #fff; border-color: var(--brand); background: var(--brand); }
#fleet-form-view .fleet-dashboard-filter.is-active { color: #fff; border-color: var(--brand-dark); background: var(--brand-dark); }
#fleet-form-view .fleet-filter-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
#fleet-form-view .fleet-dashboard-filter svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
#fleet-form-view .fleet-filter-export, #fleet-form-view .fleet-filter-print { display: inline-flex; width: 40px; min-height: 40px; height: 40px; align-items: center; justify-content: center; padding: 0; }
#fleet-form-view .fleet-filter-export { color: #fff; border-color: var(--brand-dark); background: var(--brand-dark); }
#fleet-form-view .fleet-filter-print { color: var(--brand); border-color: #cbd6df; background: #fff; }
#fleet-form-view .fleet-filter-export svg, #fleet-form-view .fleet-filter-print svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
#fleet-form-view .fleet-filter-export:hover { color: #fff; border-color: var(--brand); background: var(--brand); }
#fleet-form-view .fleet-filter-print:hover { color: #fff; border-color: var(--brand); background: var(--brand); }
#fleet-form-view .fleet-filter-close { color: #79620b; border-color: #e7d8a4; background: #fffaf0; font-size: 21px; }
#fleet-form-view .fleet-register-actions .fleet-dashboard-action {
  width: 34px;
  min-height: 34px;
  height: 34px;
  font-size: 16px;
}
.alert-row { padding: 13px 16px; background: #fff; }
.alert-row:nth-child(even) { background: #fff; }
.alert-row.is-overdue { background: #fff; border-left-color: transparent; }
.alert-row:hover, .alert-row:focus { background: #f7f9f9; box-shadow: none; }
.alert-row-arrow { color: #00688b; }
.scheduled-state-tag { display: inline-flex; align-items: center; justify-content: center; width: max-content; margin-top: 3px; padding: 4px 8px; border: 1px solid transparent; border-radius: 999px; font-size: 11px; font-weight: 800; line-height: 1; white-space: nowrap; }
.scheduled-state-tag.is-approaching { color: #946000; border-color: #ecd08c; background: #fff5d9; }
.scheduled-state-tag.is-due { color: #a95700; border-color: #f0c28b; background: #fff0db; }
.scheduled-state-tag.is-urgent { color: #a32e35; border-color: #e5aab0; background: #fff0f1; }
.scheduled-state-tag.is-completed { color: #216844; border-color: #b6d8c0; background: #e7f3e9; }
.alert-row-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.alert-row-title > strong { min-width: 0; }
.alert-row-title .scheduled-state-tag { flex: 0 0 auto; margin-top: 0; }
.alert-row.is-scheduled-approaching .alert-row-icon { color: #946000; background: #fff5d9; }
.alert-row.is-scheduled-due .alert-row-icon { color: #a95700; background: #fff0db; }
.alert-row.is-scheduled-urgent .alert-row-icon { color: #a32e35; background: #fff0f1; }
.alerts-empty span { color: #fff; background: var(--success); border-radius: 2px; }
.alerts-placeholder { background: #eef2f3; }

dialog { color: var(--ink); background: #f8fafa; border: 1px solid #69757b; border-radius: 2px; box-shadow: 0 28px 90px rgba(10,15,18,.4); }
dialog::backdrop { background: rgba(12,17,20,.72); backdrop-filter: blur(3px); }
.dialog-header { color: #f2f4f5; background: #293238; border-bottom: 3px solid var(--accent); }
.dialog-actions { background: #e5eaec; }
.detail-section:nth-child(even) { background: #f0f3f4; }
.detail-section h3 { color: var(--ink); letter-spacing: .08em; }
.login-company-logo {
  display: none;
}
.login-dialog .login-symbol { background: #00688b !important; border-color: transparent; }
.login-dialog::backdrop {
  background:
    url("assets/logo_ferrovie_del_gargano.svg?v=3") right 42px top 28px / min(30vw, 360px) auto no-repeat,
    url("assets/login-brand-subtitle.svg?v=2") right 42px top 76px / min(20vw, 240px) auto no-repeat,
    url("assets/login-bottom-left-effect-blueprint.png?v=3") left -85px bottom -65px / min(94vw, 1520px) auto no-repeat,
    linear-gradient(135deg, #00688b 0%, #003847 100%);
  background-blend-mode: normal;
  backdrop-filter: none;
}
@media (min-width: 1000px) { .login-dialog[open] { position: fixed; top: 50%; right: auto; left: 42vw; margin: 0; transform: translateY(-50%); } }
.login-dialog .button.primary { color: #fff; background: #00688b; border-color: #00688b; }
.login-dialog .button.primary:hover { background: #00688b; border-color: #056570; }
#login-recover { justify-self: center; width: auto; min-height: 0; padding: 4px 0; color: #00688b; background: none; border: 0; border-radius: 0; box-shadow: none; }
#login-recover:hover { text-decoration: underline; }
#login-recover:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.login-dialog input:focus { border-color: #00688b; box-shadow: 0 0 0 3px rgba(0,104,139,.14); }
.login-dialog input:-webkit-autofill, .login-dialog input:-webkit-autofill:hover, .login-dialog input:-webkit-autofill:focus { -webkit-text-fill-color: var(--ink); box-shadow: 0 0 0 1000px #fff inset, 0 0 0 3px rgba(0,104,139,.14); }
#print-detail { color: #fff; background: #00688b; border-color: #00688b; }
#print-detail:hover { color: #fff; background: #00688b; border-color: #00688b; }
.login-dialog form { background: #f7f9f9; }
.toast { background: #222a2f; border-left: 4px solid var(--accent); border-radius: 2px; }
.empty-state { background: #f6f8f8; border-color: #98a4aa; }
#scheduled-maintenance-view .scheduled-execution-empty { background: #fff; box-shadow: var(--shadow); }

* { scrollbar-color: #768289 #d9dfe1; scrollbar-width: thin; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: #d9dfe1; }
*::-webkit-scrollbar-thumb { background: #768289; border: 2px solid #d9dfe1; }

@media (max-width: 1100px) {
  .app-header { align-items: flex-start; flex-direction: column; padding-top: 13px; }
  .brand { min-height: 50px; }
  .tabs { width: 100%; max-width: 100%; min-height: 48px; }
  .tab { padding: 0 13px; }
}
@media (max-width: 850px) {
  main { width: 95vw; margin-top: 20px; }
  .app-header { padding-right: 2.5vw; padding-left: 2.5vw; }
  .alerts-heading { align-items: flex-start; }
}
@media (max-width: 560px) {
  .app-header { padding-top: 15px; }
  .brand strong { font-size: 13px; }
  .tabs { height: 52px; margin-top: 6px; }
  .page-heading, .alerts-heading { padding: 22px 20px; }
  .page-heading, .alerts-heading, .archive-heading { flex-direction: column; }
  .sheet-number { width: 100%; justify-content: space-between; }
  .form-band, .form-actions { padding-right: 18px; padding-left: 18px; }
  .alerts-updated { white-space: normal; }
  .archive-actions { width: 100%; }
  .archive-actions .button { width: 100%; }
  .record-card:hover { transform: none; }
}


/* Sidebar navigation --------------------------------------------------------- */
:root { --sidebar-width: 310px; }

.app-header {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 45;
  width: calc(var(--sidebar-width) + 10px);
  min-height: 100vh;
  padding: 27px 17px 18px;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  border-top: 3px solid transparent;
  border-right: 1px solid #3d484e;
  border-bottom: 0;
}
.brand {
  flex: 0 0 auto;
  min-width: 0;
  min-height: 70px;
  padding: 0 7px 20px;
  border-bottom: 1px solid #3d474d;
}
.app-header .brand-mark { flex: 0 0 54px; width: 54px; height: 54px; aspect-ratio: 1; }
.brand > span:last-child { min-width: 0; }
.brand strong { line-height: 1.25; }
.tabs {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  width: 100%;
  min-height: 0;
  margin-top: 20px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1px;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { width: 0; height: 0; }
.tab {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 11px;
  width: calc(100% - 2px);
  margin-right: 1px;
  margin-left: 1px;
  height: 48px;
  min-height: 48px;
  padding: 0 48px 0 13px;
  border: 1px solid transparent;
  border-radius: 2px;
  text-align: left;
}
.tab::before {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border: 1px solid #738087;
  transform: rotate(45deg);
}
.tab:hover { border-color: #384349; }
.tab.is-active { color: #fff; background: #313b41; border-color: #465158; }
.tab.is-active::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,104,139,.12); }
.tab.is-active::after {
  inset: 7px auto 7px 0;
  width: 3px;
  height: auto;
  background: var(--accent);
}
.tab .count, .tab .backup-nav-alert, .tab .competency-nav-alert { position: absolute; top: 50%; right: 13px; margin-left: 0; transform: translateY(-50%); }
.session-actions {
  order: 20;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: stretch;
  gap: 7px;
  align-self: stretch;
  margin-top: auto;
  padding: 17px 1px 7px;
  border-top: 1px solid #3d474d;
}
.session-user {
  padding: 0;
  color: #f3f7f8;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.session-actions .session-profile { flex: 1; width: auto; min-width: 0; }
.session-actions .header-session,
.session-actions .header-shutdown { background-clip: padding-box; outline: 0; }
.session-actions .session-user::before { width: 40px; height: 40px; border-color: rgba(255,255,255,.78); font-size: 16px; }
.session-actions .header-session, .session-actions .header-shutdown { flex: 0 0 40px; width: 40px; height: 40px; padding: 0 0 2px; justify-content: center; }
.header-session, .header-shutdown, .session-profile {
  order: initial;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  height: 38px;
  padding: 0 12px;
  font-size: 17px;
  text-align: left;
}
.session-actions .header-session { color: #55d38b; background: #242c31; border-color: #465158; box-shadow: 0 0 9px rgba(85,211,139,.2), inset 0 0 8px rgba(85,211,139,.06); text-shadow: 0 0 6px rgba(85,211,139,.7); }
.session-actions .header-shutdown { color: #ff7770; background: #242c31; border-color: #465158; box-shadow: 0 0 9px rgba(255,119,112,.2), inset 0 0 8px rgba(255,119,112,.06); text-shadow: 0 0 6px rgba(255,119,112,.7); }
.header-session::after, .header-shutdown::after { display: none; }
.header-session[hidden], .header-shutdown[hidden], .session-user[hidden] { display: none; }

main {
  width: auto;
  max-width: none;
  margin: 0 16px 64px var(--sidebar-width);
}
.sidebar-toggle, .sidebar-scrim { display: none; }

@media (min-width: 901px) {
  body.sidebar-open { overflow: auto; }
}

/* Desktop compatto: recupera spazio utile nelle finestre meno larghe. */
@media (min-width: 901px) and (max-width: 1600px) {
  :root { --sidebar-width: 275px; }
  .tabs { gap: 3px; }
  .tab { height: 44px; min-height: 44px; gap: 8px; padding-left: 9px; font-size: 11px; }
  .maintainer-workspace { grid-template-columns: 261px minmax(0, 1fr); }
  .maintainer-sidebar-heading { padding-right: 14px; padding-left: 14px; }
  .maintainer-search { margin-right: 12px; margin-left: 12px; }
  .maintainer-list-item { padding-right: 14px; padding-left: 14px; }
  .maintainer-matrix table { min-width: 900px; }
  .maintainer-matrix tbody th { min-width: 215px; }
  .maintainer-matrix th, .maintainer-matrix td { padding-right: 7px; padding-left: 7px; }
  #personnel-management-view [data-settings-panel="scheduled-catalog"] .scheduled-plans-layout { grid-template-columns: 261px minmax(0, 1fr); }
}

@media (max-width: 900px) {
  body.sidebar-open { overflow: hidden; }
  body.auth-pending .sidebar-toggle { visibility: hidden; }
  .app-header {
    inset: 0 auto 0 0;
    z-index: 60;
    width: min(300px, 86vw);
    min-height: 100vh;
    padding: 72px 16px 18px;
    transform: translateX(-102%);
    transition: transform .22s ease;
    box-shadow: 14px 0 40px rgba(8,12,14,.3);
  }
  body.sidebar-open .app-header { transform: translateX(0); }
  .brand { min-height: 66px; padding-right: 46px; }
  .tabs { width: 100%; max-width: 100%; min-height: 0; height: auto; margin-top: 16px; }
  .sidebar-toggle {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 65;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 42px;
    padding: 0;
    color: #fff;
    background: #242c31;
    border: 1px solid #526068;
    border-radius: 2px;
    box-shadow: 0 6px 18px rgba(13,18,21,.22);
  }
  .sidebar-toggle span { display: block; width: 20px; height: 2px; background: #eef1f2; transition: transform .2s ease, opacity .2s ease; }
  body.sidebar-open .sidebar-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.sidebar-open .sidebar-toggle span:nth-child(2) { opacity: 0; }
  body.sidebar-open .sidebar-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 55;
    display: block;
    background: rgba(10,15,18,.64);
    backdrop-filter: blur(2px);
  }
  .sidebar-scrim[hidden] { display: none; }
  main { width: auto; max-width: none; margin: 78px 2.5vw 54px; }
  .maintainer-workspace { grid-template-columns: 1fr; min-height: 0; }
  .maintainer-sidebar { height: auto; min-height: 420px; }
}

@media (max-width: 560px) {
  .app-header { padding-top: 72px; }
  .tabs { height: auto; margin-top: 14px; }
  main { width: auto; margin-top: 74px; }
}

@media print {
  .sidebar-toggle, .sidebar-scrim, .app-header, .material-actions, .material-filters { display: none !important; }
  main { margin: 0; }
}
/* Catalogo revisioni manutenzione programmata */
.scheduled-catalog-panel { padding: 0; }
.scheduled-plan-form { overflow: hidden; margin-bottom: 20px; border: 1px solid #cbd6df; border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.scheduled-plan-form-heading { padding: 16px 20px; color: #fff; background: var(--brand); }
.scheduled-plan-form-heading .eyebrow { margin-bottom: 4px; color: rgba(255,255,255,.8); font-size: 11px; }
.scheduled-plan-form-heading h2 { margin: 0; font-size: 20px; }
.scheduled-plan-grid { display: grid; grid-template-columns: minmax(180px, .75fr) minmax(240px, 1fr) minmax(0, 1fr); gap: 16px 18px; padding: 20px; }
.scheduled-plan-grid > label, .scheduled-plan-mode > label { display: grid; gap: 7px; color: #43525a; font-size: 12px; font-weight: 750; }
.scheduled-plan-type { min-width: 0; margin: 0; padding: 0; border: 0; }
.scheduled-plan-type legend { margin-bottom: 7px; color: #43525a; font-size: 12px; font-weight: 750; }
.scheduled-plan-type-options { display: flex; min-height: 40px; gap: 4px; padding: 3px; border: 1px solid #cbd6df; border-radius: 7px; background: #f1f4f5; }
.scheduled-plan-type-options label { position: relative; display: grid; flex: 1; place-items: center; cursor: pointer; }
.scheduled-plan-type-options input { position: absolute; opacity: 0; }
.scheduled-plan-type-options span { width: 100%; padding: 9px 10px; border-radius: 5px; color: #56666f; font-size: 12px; font-weight: 800; text-align: center; }
.scheduled-plan-type-options input:checked + span { color: #fff; background: var(--brand); }
.scheduled-plan-mode { display: contents; }
.scheduled-plan-mode[hidden] { display: none; }
.scheduled-plan-input-suffix { display: grid; grid-template-columns: minmax(0, 1fr) auto; overflow: hidden; border: 1px solid #cbd6df; border-radius: 7px; background: #fff; }
.scheduled-plan-input-suffix input { min-width: 0; border: 0; border-radius: 0; }
.scheduled-plan-input-suffix span { display: grid; min-width: 42px; place-items: center; padding: 0 11px; color: #56666f; background: #eef3f5; font-size: 12px; font-weight: 750; }
.scheduled-plan-file { grid-column: 1 / -1; }
.scheduled-plan-file small { color: #697981; font-weight: 600; }
.scheduled-plan-actions { display: flex; justify-content: flex-end; padding: 15px 20px; border-top: 1px solid #dce4e7; background: #f7f9fa; }
.scheduled-plan-actions .button:disabled { opacity: .52; }
.scheduled-plan-list { display: grid; gap: 8px; margin: 0 0 20px; }
.scheduled-plan-list:empty { display: none; }
.scheduled-plan-list h3 { margin: 0 0 2px; color: #33454e; font-size: 14px; }
.scheduled-plan-card { display: grid; grid-template-columns: minmax(130px, .45fr) minmax(260px, 1fr) minmax(240px, .9fr); gap: 14px; align-items: center; padding: 13px 16px; border: 1px solid #cbd6df; border-radius: 10px; background: #fff; box-shadow: 0 3px 10px rgba(23,34,45,.05); }
.scheduled-plan-card span, .scheduled-plan-card small { color: #62737c; }
.scheduled-catalog-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.scheduled-catalog-heading h2 { margin: 0; }
.scheduled-catalog-panel > .profile-password-feedback,
.scheduled-catalog-panel > .scheduled-catalog-list { margin-right: 0; margin-left: 0; }
.scheduled-catalog-list { display: grid; gap: 8px; margin-top: 20px; }
.scheduled-catalog-card { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto; align-items: center; gap: 16px; padding: 14px 16px; border: 1px solid #c7d1d5; background: #f8f9f9; }
.scheduled-catalog-card.is-active { border-left: 4px solid var(--accent); background: #f2fafb; }
.scheduled-catalog-card strong, .scheduled-catalog-card span, .scheduled-catalog-card small { display: block; }
.scheduled-catalog-card small strong { display: inline; }
.scheduled-catalog-card span, .scheduled-catalog-card small { color: #69767c; margin-top: 3px; }
.scheduled-catalog-card > div:last-child { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.scheduled-catalog-card [data-catalog-action="activate"] { color: #fff; background: var(--accent); border-color: #00688b; }
.scheduled-catalog-card [data-catalog-action="activate"]:hover { color: #fff; background: #00688b; border-color: #00688b; }
.scheduled-catalog-card [data-catalog-action="cancel"] { color: #fff; background: #c0392b; border-color: #a52f24; }
.scheduled-catalog-card [data-catalog-action="cancel"]:hover { color: #fff; background: #a52f24; border-color: #8d271e; }
.scheduled-catalog-card .record-link-badge { margin-top: 0; }
.scheduled-catalog-empty { padding: 18px; border: 1px dashed #b9c3c8; color: #69767c; }
@media (max-width: 800px) { .scheduled-catalog-card { grid-template-columns: 1fr; } }
.workspace-enable-heading { white-space: nowrap; }
.maintainer-competency-card .maintainer-matrix.is-editor input[type="date"] { width: 132px; max-width: 132px; }
.maintainer-status.is-expiring { color: #8a5700; background: #fff0c7; }
.maintainer-status.is-expired { color: #8b2730; background: #f7dadd; }
.maintainer-matrix tr.is-expiry-disabled [data-workspace-renewal], .maintainer-matrix tr.is-expiry-disabled [data-workspace-validity], .maintainer-matrix tr.is-expiry-disabled [data-workspace-alert] { display: none; }
.maintainer-matrix tr.is-expiry-disabled td:has([data-workspace-renewal])::after, .maintainer-matrix tr.is-expiry-disabled td:has([data-workspace-validity])::after, .maintainer-matrix tr.is-expiry-disabled td:has([data-workspace-alert])::after { content: "—"; }
.maintainer-matrix tr.is-expiry-disabled td:has([data-workspace-renewal]) .date-entry-control { display: none !important; }
.maintainer-competency-card .maintainer-matrix.is-editor tbody tr { height: 49px; }
.maintainer-competency-card .maintainer-matrix tbody th { min-width: 300px; }
.maintainer-competency-card .maintainer-matrix table { table-layout: fixed; }
.maintainer-competency-card .maintainer-matrix th:first-child { width: 300px; min-width: 300px; max-width: 300px; }
.maintainer-competency-card .maintainer-matrix thead th:nth-last-child(n + 5):not(:first-child) { width: 64px; }
.maintainer-competency-card .maintainer-matrix th:nth-last-child(4) { width: 172px; }
.maintainer-competency-card .maintainer-matrix th:nth-last-child(3) { width: 100px; }
.maintainer-competency-card .maintainer-matrix th:nth-last-child(2) { width: 110px; }
.maintainer-competency-card .maintainer-matrix th:last-child { width: 100px; }
.maintainer-detail-summary > span { font-size: 20px; }

/* Tema dashboard teal: ispirato all'archivio ricariche, senza modificare le funzioni. */
:root {
  --ink: #17222d;
  --muted: #637282;
  --line: #dbe3ea;
  --line-strong: #cbd6df;
  --surface: #ffffff;
  --canvas: #eef3f6;
  --brand: #00688b;
  --brand-dark: #056570;
  --accent: #ffb703;
  --danger: #c73e4d;
  --success: #287a57;
  --shadow: 0 14px 35px rgba(23, 34, 45, .09);
}
html { background: #eef3f6; }
body { color: var(--ink); background: var(--canvas); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body[data-active-view="work-center-view"],
body[data-active-view="scheduled-maintenance-view"],
body[data-active-view="work-center-view"] main,
body[data-active-view="scheduled-maintenance-view"] main,
#work-center-view,
#scheduled-maintenance-view { background-color: #eef3f6; background-image: none; }
body[data-active-view="work-center-view"] .app-header,
body[data-active-view="scheduled-maintenance-view"] .app-header,
#work-center-view > .page-heading,
#scheduled-maintenance-view > .page-heading,
#work-center-view .scheduled-table-wrap,
#work-center-view .work-center-placeholder,
#scheduled-maintenance-view .scheduled-operator-activity-list,
#scheduled-maintenance-view .scheduled-operator-actions,
#scheduled-maintenance-view .scheduled-operator-documents,
#scheduled-maintenance-view .scheduled-execution-card,
#scheduled-maintenance-view .scheduled-execution-empty { box-shadow: none; }
.app-header { color: #fff; background: #00688b; border-top: 0; border-bottom-color: rgba(255,255,255,.22); box-shadow: 0 8px 24px rgba(0,104,139,.22); }
.app-header .brand { border-bottom-color: rgba(255,255,255,.35); }
.app-header .brand strong { color: #fff; }
.app-header .brand small { color: rgba(255,255,255,.75); }
.app-header .tab { color: rgba(255,255,255,.80); }
.app-header .tab:hover { color: #fff; background: rgba(255,255,255,.10); border-color: transparent; }
.app-header .tab.is-active { color: #fff; background: rgba(255,255,255,.16); }
.app-header .tab::before { background: rgba(255,255,255,.44); }
.app-header .tab.is-active::before { background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.14); }
.app-header .count { color: var(--brand-dark); background: #fff; border-radius: 3px; box-shadow: none; }
.app-header .backup-nav-alert, .app-header .competency-nav-alert { width: 22px; min-width: 22px; height: 22px; padding-top: 2px; color: #171c20; background: #f3a719; border-radius: 3px; box-shadow: none; }
.app-header .backup-nav-alert.is-critical, .app-header .competency-nav-alert.is-critical { color: #fff; background: var(--danger); }
.app-header .session-user { color: rgba(255,255,255,.88); }
.app-header .session-user::before { color: #fff; background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.72); }
.app-header .header-session { color: #fff; background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.72); }
.app-header .header-shutdown { color: #ffd1d1; background: rgba(199,62,77,.14); border-color: #ffd1d1; }
.app-header .session-actions { border-top-color: rgba(255,255,255,.35); }
#alerts-view .alert-summary-card, #alerts-view .alerts-panel { background-color: #fff; background-image: radial-gradient(circle at 100% 0, rgba(0,104,139,.08), transparent 190px), linear-gradient(180deg, #fff 0%, #f6fafb 100%); }
.brand strong { color: var(--ink); font-family: inherit; font-weight: 800; letter-spacing: -.01em; text-transform: none; }
.brand small { color: var(--muted); letter-spacing: 0; }
.brand-mark, .app-header .dashboard-symbol { border: 0; border-radius: 9px; background: linear-gradient(120deg, #00688b, #00688b) !important; box-shadow: 0 5px 12px rgba(0,104,139,.2); }
.app-header .dashboard-symbol { border: 1px solid rgba(255,255,255,.88); background: transparent !important; box-shadow: none; }
.brand-mark::after { display: none; }
.tabs { gap: 6px; }
.tab { padding: 0 12px; color: var(--muted); border: 0; border-radius: 8px 8px 0 0; font-size: 12px; letter-spacing: 0; }
.tab:hover { color: var(--brand-dark); background: #edf6f7; }
.tab.is-active { color: var(--brand-dark); background: #e3f2f3; border: 0; }
.app-header .tab.is-active { border-radius: 7px; }
.tab.is-active::after { height: 3px; background: var(--brand); border-radius: 3px 3px 0 0; }
.tab::before { width: 5px; height: 20px; border: 0; border-radius: 999px; background: #cbd6df; transform: none; }
.tab.is-active::before { background: var(--brand); box-shadow: 0 0 0 3px rgba(0,104,139,.12); }
.tab.is-active::after { display: none; }
.count { color: #fff; background: linear-gradient(120deg, #00688b, #00688b); border-radius: 10px; box-shadow: 0 3px 7px rgba(0,104,139,.18); }
.header-session, .header-shutdown { color: var(--brand); background: transparent; border-color: var(--line); border-radius: 8px; box-shadow: none; }
.header-shutdown { color: var(--danger); }
.session-actions .header-session { color: #fff; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.78); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); text-shadow: none; }
.session-actions .header-shutdown { color: #fff; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.78); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); text-shadow: none; }
.session-actions .session-user::before { flex: 0 0 38px; width: 38px; height: 38px; border-radius: 10px; font-size: 13px; font-weight: 700; }
.session-user { padding: 0; color: var(--muted); font-family: inherit; font-size: 12px; font-weight: 650; letter-spacing: 0; }
.session-user::before { width: 24px; height: 24px; color: var(--brand); background: transparent; border: 1px solid var(--brand); border-radius: 8px; box-shadow: none; font-size: 10px; }
.page-heading, .work-heading, .scheduled-heading, .fleet-heading, .material-heading, .alerts-heading, .archive-heading {
  color: #fff; background-color: var(--brand); background-image: linear-gradient(120deg, #00688b, #00688b); border: 0; border-radius: 12px; box-shadow: 0 10px 24px rgba(0,104,139,.18);
}
.page-heading::after, .alerts-heading::after, .archive-heading::after { display: none; }
main { margin-top: 16px; }
body[data-active-view="alerts-view"] main { margin-bottom: 0; }
.title-company-logo { width: min(260px, 28vw); height: auto; max-height: 54px; margin-left: auto; order: 2; object-fit: contain; }
.eyebrow, .archive-heading .eyebrow { color: rgba(255,255,255,.84); font-family: inherit; letter-spacing: .1em; }
.eyebrow::before { width: 0; }
.form-band h2 { color: #253746; font-family: inherit; font-size: 15px; letter-spacing: .02em; text-transform: none; }
.form-band h2::before { width: 4px; border-radius: 5px; background: var(--brand); }
#maintenance-form, #work-form, #fleet-form, .fleet-register, .fleet-chart-tool, .fleet-table-wrap, .filters, .record-card, .alerts-panel, .alert-summary-card { border-color: var(--line); border-radius: 12px; }
#form-view > .page-heading { margin-bottom: 20px; }
#work-form-view > .work-heading { margin-bottom: 20px; }
#archive-view > .archive-heading { margin-bottom: 20px; border-bottom-right-radius: 12px; border-bottom-left-radius: 12px; }
#archive-view > .filters { border-top-right-radius: 12px; border-top-left-radius: 12px; }
#material-management-view > .material-heading { margin-bottom: 20px; }
#material-management-view > .material-filters { border-radius: 12px; }
#personnel-management-view > .personnel-heading { min-height:75px; margin-bottom:16px; padding:16px 30px; }
#personnel-management-view > .personnel-heading h1 { margin:0; font-size:29px; line-height:1.1; }
#personnel-management-view > .settings-tabs { margin:0 0 16px; border-top:1px solid #c7d1d5; border-radius:12px; }
#personnel-management-view .settings-tab { display: inline-flex; align-items: center; gap: 6px; }
#personnel-management-view .settings-tab.is-active { border-color: var(--brand); background: var(--brand); }
#personnel-management-view #personnel-admin-panel > .personnel-table-wrap { border-radius: 12px; }
#personnel-management-view #personnel-admin-panel > form:not([hidden]) { border-radius: 12px; }
#personnel-management-view .maintainer-sidebar,
#personnel-management-view .maintainer-detail-summary,
#personnel-management-view .maintainer-matrix,
#personnel-management-view .maintainer-competency-card,
#personnel-management-view #maintainer-detail > .personnel-inline-actions { border-radius: 12px; }
#personnel-management-view .workspace-delete-icon,
#personnel-management-view .workspace-new-maintainer-icon,
#personnel-management-view .maintainer-status,
#personnel-management-view .maintainer-list-avatar,
#personnel-management-view .maintainer-detail-summary > span,
#personnel-management-view .maintainer-entry-icon { border-radius: 7px; }
#personnel-management-view .maintainer-matrix thead th { height: 40px; color: #fff; background: var(--brand); }
#personnel-management-view .matrix-check,
#personnel-management-view .workspace-check input:checked + span,
#personnel-management-view .maintainer-list-avatar,
#personnel-management-view .maintainer-detail-summary > span,
#personnel-management-view .workspace-new-maintainer-icon { border-color: var(--brand); background: var(--brand); }
#personnel-management-view .fleet-management-panel #fleet-registry-form,
#personnel-management-view .fleet-management-panel > .personnel-table-wrap { overflow: hidden; border-radius: 12px; }
#maintenance-form, #work-form, #fleet-form, .filters, .record-card, .alerts-panel, .alert-summary-card, .fleet-register, .fleet-chart-tool, .fleet-table-wrap { box-shadow: var(--shadow); }
.form-band:nth-of-type(even), .form-actions { background: #f7f9fa; }
input, select, textarea { border-color: #cbd6df; border-radius: 7px; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,104,139,.14); }
.button, .icon-button { border-radius: 7px; letter-spacing: 0; }
.button.primary, #work-form-view .button.primary, #scheduled-maintenance-view .button.primary, #fleet-form-view .button.primary { background: var(--brand); border-color: var(--brand); box-shadow: 0 4px 10px rgba(0,104,139,.16); }
.button.primary:hover, #work-form-view .button.primary:hover, #scheduled-maintenance-view .button.primary:hover, #fleet-form-view .button.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.button.secondary, .icon-button { background: #fff; border-color: #cbd6df; }
.alerts-panel-heading, .alerts-panel-heading.competency-panel-heading { background: linear-gradient(120deg, #00688b, #00688b); border-bottom: 0; box-shadow: none; }
.alerts-panel-heading { padding: 12px 18px; }
.alerts-panel-heading .eyebrow, .alerts-panel-heading.competency-panel-heading .eyebrow { color: #fff; }
.alerts-panel-heading .eyebrow { font-size: 14px; }
.alerts-panel-heading.competency-panel-heading { background: linear-gradient(120deg, #00688b, #00688b); border-bottom: 0; }
.alerts-panel-heading.competency-panel-heading .eyebrow { color: #fff; }
.alerts-panel-heading .eyebrow, .alerts-panel-heading.competency-panel-heading .eyebrow { color: #fff; }
.alert-summary-card { border-top-width: 4px; border-top-color: var(--brand) !important; }
.dialog-header { color: #fff; background: linear-gradient(120deg, #00688b, #00688b); border-bottom: 0; }
.dialog-actions { background: #f4f8f9; }
dialog { background: #fff; border-radius: 10px; overflow: hidden; }
.toast { background: #17222d; border-left-color: var(--accent); border-radius: 10px; }
@media (max-width: 620px) { .title-company-logo { display: none; } }
@media (min-width: 901px) {
  body[data-active-view="personnel-management-view"],
  body[data-active-view="fleet-form-view"] { overflow-x: hidden; }
  .app-header {
    inset: 14px auto 14px 14px;
    width: calc(var(--sidebar-width) + 10px);
    min-height: calc(100vh - 28px);
    border: 1px solid var(--line);
    border-radius: 12px;
  }
  body[data-active-view="personnel-management-view"] main,
  body[data-active-view="fleet-form-view"] main { min-width: 0; margin-bottom: 14px; }
  #personnel-management-view.is-active {
    display: grid;
    min-height: calc(100vh - 30px);
    min-height: calc(100dvh - 30px);
    height: calc(100vh - 30px);
    height: calc(100dvh - 30px);
    grid-template-rows: auto auto minmax(0, 1fr);
    align-content: start;
  }
  #personnel-management-view > .settings-panel:not([hidden]) { min-height:0; height:100%; box-sizing:border-box; }
  #personnel-management-view > .email-notifications-panel:not([hidden]) { display: flex; height: 100%; flex-direction: column; box-sizing: border-box; }
  #personnel-management-view .email-notifications-panel .email-notifications-grid { min-height: 0; flex: 1; }
  #personnel-management-view .email-notifications-panel .email-notifications-card { min-height: 0; height: 100%; }
  #personnel-management-view .personnel-layout,
  #personnel-management-view .fleet-management-panel { height: 100%; min-height: 0; }
  #personnel-management-view #personnel-admin-panel:not([hidden]) { height: 100%; min-height: 0; }
  #personnel-management-view #personnel-admin-panel > .personnel-table-wrap,
  #personnel-management-view .fleet-management-panel > .personnel-table-wrap { min-height: 0; overflow: auto; }
  #personnel-management-view .fleet-management-panel { grid-template-rows: auto minmax(0, 1fr); }
  .maintainer-workspace { height: 100%; min-height: 0; }
  .maintainer-sidebar { height: 100%; min-height: 0; }
  .maintainer-detail { min-width: 0; min-height: 0; overflow: hidden; }
  .maintainer-detail .maintainer-matrix { max-width: 100%; overflow: auto; }
  .maintainer-competency-card { padding-top: 14px; padding-bottom: 14px; }
  .maintainer-competency-card > .personnel-inline-actions { padding-top: 10px; }
  .maintainer-competency-card .maintainer-matrix.is-editor th,
  .maintainer-competency-card .maintainer-matrix.is-editor td { height: 42px; padding-top: 0; padding-bottom: 0; line-height: 1.15; }
  .maintainer-competency-card .maintainer-matrix.is-editor thead th { height: 38px; }
  .maintainer-competency-card .maintainer-matrix.is-editor input[type="date"],
  .maintainer-competency-card .maintainer-matrix.is-editor select[data-workspace-validity],
  .maintainer-competency-card .maintainer-matrix.is-editor select[data-workspace-alert] { height: 26px; min-height: 26px; padding-top: 1px; padding-bottom: 1px; }
  .maintainer-competency-card .maintainer-matrix.is-editor .date-entry-input { height: 26px; min-height: 26px; }
  .maintainer-competency-card .maintainer-matrix.is-editor .date-entry-picker { width: 26px; height: 26px; }
  #personnel-management-view [data-settings-panel="backup"] .backup-panels { height: 100%; min-height: 0; box-sizing: border-box; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; border-radius: 12px; }
  #personnel-management-view [data-settings-panel="backup"] .backup-panel-shell { display: flex; }
  #personnel-management-view [data-settings-panel="backup"] .backup-panel { display: flex; min-height: 0; flex: 1; flex-direction: column; border-radius: 12px; }
  #personnel-management-view [data-settings-panel="backup"] .backup-list { min-height: 0; overflow-y: auto; flex: 1; }
  #fleet-form-view.is-active {
    display: grid;
    min-height: calc(100vh - 30px);
    min-height: calc(100dvh - 30px);
    height: calc(100vh - 30px);
    height: calc(100dvh - 30px);
    grid-template-rows: auto auto minmax(0, 1fr);
  }
  #fleet-form-view .fleet-dashboard,
  #fleet-form-view .fleet-register { height: 100%; min-height: 0; }
  #fleet-form-view .fleet-register { display: flex; flex-direction: column; }
  #fleet-form-view .fleet-register-table-wrap { min-height: 0; max-height: none; flex: 1; }

  /* Area documento: la pagina resta ferma, scorre soltanto il foglio interno. */
  html:has(body[data-active-view="scheduled-maintenance-view"]),
  body[data-active-view="scheduled-maintenance-view"] { height: 100%; overflow: hidden; }
  body[data-active-view="scheduled-maintenance-view"] main {
    height: calc(100vh - 30px);
    height: calc(100dvh - 30px);
    margin-bottom: 0;
    overflow: hidden;
  }
  #scheduled-maintenance-view.is-active {
    display: grid;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    grid-template-rows: minmax(0, 1fr);
    gap: 0;
  }
  #scheduled-maintenance-view .scheduled-operator-workspace {
    height: 100%;
    min-height: 0;
  }
  #scheduled-maintenance-view .scheduled-operator-activity-list {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
  }
  #scheduled-maintenance-view .scheduled-inline-workflow:not([hidden]) {
    display: grid;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr);
  }
  #scheduled-maintenance-view .scheduled-inline-workspace {
    min-height: 0;
  }
  #scheduled-maintenance-view .scheduled-inline-table-wrap {
    height: auto;
    min-height: 0;
    overflow: hidden;
  }

}

/* Monitor ampi: maggiore respiro ai lati senza penalizzare la modalità compatta. */
@media (min-width: 1601px) {
  .app-header { left: 32px; width: 304px; }
  main { margin-right: 32px; margin-left: 352px; }
}

/* Centro notifiche: quattro riquadri uniformi, allineati al fondo della barra laterale. */
#alerts-view .alerts-dashboard { display: none; }
@media (min-width: 901px) {
  html:has(body[data-active-view="alerts-view"]),
  body[data-active-view="alerts-view"] { height: 100%; overflow: hidden; }

  body[data-active-view="alerts-view"] main {
    height: calc(100vh - 30px);
    height: calc(100dvh - 30px);
    margin-bottom: 0;
  }

  #alerts-view.is-active {
    display: flex;
    height: 100%;
    min-height: 0;
    flex-direction: column;
  }


  #alerts-view .alerts-board {
    grid-template-rows: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    min-height: 0;
    flex: 1;
  }

  #alerts-view .alerts-panel {
    display: flex;
    min-height: 0;
    flex-direction: column;
  }

  #alerts-view .alerts-list {
    height: auto !important;
    max-height: none;
    min-height: 0;
    overflow-y: auto;
    flex: 1;
  }

  #alerts-view .alerts-empty { min-height: 100% !important; }

  #alerts-view .alerts-legacy { display: none; }

  #alerts-view .alerts-dashboard {
    display: grid;
    grid-template-columns: 292px 210px minmax(210px, .42fr) minmax(0, 1fr);
    grid-template-rows: minmax(198px, 1.25fr) minmax(150px, 1fr);
    gap: 16px;
    min-height: 0;
    flex: 1;
  }

  .alerts-operational-summary,
  .alerts-dashboard-panel,
  .alerts-dashboard-alerts > section {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow);
  }

  .alerts-operational-summary { grid-row: 1; display: grid; grid-template-rows: auto repeat(3, minmax(0, 1fr)); gap: 0; padding: 0; }
  .alerts-operational-summary article { position: relative; display: grid; align-content: center; gap: 4px; min-height: 0; margin: 10px 10px 0; padding: 12px 58px 12px 14px; border: 1px solid #e1e8eb; border-radius: 10px; background: linear-gradient(180deg, #fff, #f5f9fa); }
  .alerts-operational-summary article:last-child { margin-bottom: 10px; }
  .alerts-operational-summary .alerts-summary-action { cursor: pointer; }
  .alerts-operational-summary .alerts-summary-action:hover { border-color: #8fc4ca; background: #f4fbfc; }
  .alerts-operational-summary .alerts-summary-action:focus-visible { outline: 3px solid rgba(0, 128, 145, .28); outline-offset: 2px; }
  .alerts-operational-summary article::after { position: absolute; right: 15px; top: 50%; color: #dce5e8; font-size: 34px; line-height: 1; transform: translateY(-50%); }
  .alerts-operational-summary article:nth-of-type(1)::after { content: "▣"; }
  .alerts-operational-summary article:nth-of-type(2)::after { content: "⚒"; }
  .alerts-operational-summary article:nth-of-type(3)::after { content: "◫"; }
  /* Icone del riepilogo: SVG coerenti e indipendenti dal font installato. */
  .alerts-operational-summary article::after { width: 42px; height: 42px; background: center / contain no-repeat; }
  .alerts-operational-summary article:nth-of-type(1)::after { content: ""; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='%23dce5e8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='8' y='10' width='30' height='29' rx='3'/%3E%3Cpath d='M8 19h30M16 6v8M30 6v8M16 26h2M23 26h2M30 26h2M16 33h2M23 33h2M30 33h2'/%3E%3C/svg%3E"); }
  .alerts-operational-summary article:nth-of-type(2)::after { content: ""; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='%23dce5e8' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M39 10a12 12 0 0 1-15 15L10 39a4 4 0 0 1-6-6l14-14A12 12 0 0 1 33 4l-7 7 7 7z'/%3E%3C/svg%3E"); }
  .alerts-operational-summary article:nth-of-type(3)::after { content: ""; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='%23dce5e8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='6' y='8' width='29' height='28' rx='3'/%3E%3Cpath d='M6 17h29M14 4v8M27 4v8M14 24h2M21 24h2M14 30h2'/%3E%3Ccircle cx='36' cy='34' r='8'/%3E%3Cpath d='M36 30v5l3 2'/%3E%3C/svg%3E"); }
  .alerts-operational-summary small, .alerts-operational-summary span { color: #56707b; font-size: 12px; font-weight: 750; }
  .alerts-operational-summary strong { color: #24343d; font-family: Bahnschrift, monospace; font-size: 34px; line-height: 1; }
  .alerts-dashboard-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; color: #fff; background: linear-gradient(120deg, #00688b, #00688b); }
  .alerts-dashboard-heading p { margin: 0; font-size: 14px; font-weight: 800; letter-spacing: 0; text-transform: none; }
  .dashboard-heading-link { padding: 0; color: #fff; border: 0; border-bottom: 1px solid rgba(255,255,255,.7); background: transparent; font: inherit; font-size: 11px; font-weight: 750; cursor: pointer; }
  .alerts-forecast-panel { grid-column: 2 / -1; }
  .alerts-circulation-panel { grid-column: 1 / span 2; }
  .alerts-depot-panel { grid-column: 3; }
  .alerts-calendar-panel { grid-column: 4; }
  .alerts-dashboard-panel { display: flex; min-height: 0; flex-direction: column; }
  .fleet-alert-list { min-height: 0; overflow: auto; flex: 1; }
  .dashboard-notice-list { display: grid; padding: 4px 0; }
  .dashboard-notice-row { display: grid; min-width: 0; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 13px; border-bottom: 1px solid #e4ebed; color: #30444d; font-size: 12px; line-height: 1.25; }
  .dashboard-notice-row:last-child { border-bottom: 0; }
  .dashboard-notice-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #2f8057; }
  .dashboard-notice-row.is-due .dashboard-notice-dot { background: #d87500; }
  .dashboard-notice-row.is-critical .dashboard-notice-dot { background: #c63b45; }
  .dashboard-notice-copy { display: grid; min-width: 0; gap: 3px; }
  .dashboard-notice-copy strong { overflow: hidden; color: #263c45; font-size: 12px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
  .dashboard-notice-copy small { overflow: hidden; color: #667b84; font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
  .dashboard-notice-status { align-self: center; padding: 3px 6px; border-radius: 3px; color: #9b5000; background: #fff0dc; font-size: 10px; font-weight: 800; white-space: nowrap; }
  .dashboard-notice-row.is-critical .dashboard-notice-status { color: #ae3540; background: #ffebed; }
  .dashboard-depot-list { display: grid; gap: 9px; padding: 10px; }
  .dashboard-depot-row { display: grid; width: 100%; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 10px; color: #30444d; border: 1px solid #dce6e9; border-radius: 7px; background: #fff; font: inherit; text-align: left; }
  .dashboard-depot-train-icon { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 7px; background: #eef4f5; }
  .dashboard-depot-train-icon img { width: 28px; height: 28px; object-fit: contain; }
  .dashboard-depot-copy { display: grid; min-width: 0; gap: 3px; }
  .dashboard-depot-copy strong { color: #263c45; font-size: 13px; font-weight: 800; }
  .dashboard-depot-copy small { overflow: hidden; color: #4d626b; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
  .dashboard-depot-copy em { color: #74868d; font-size: 10px; font-style: normal; font-weight: 650; }
  .dashboard-depot-row b { padding: 4px 6px; border-radius: 3px; color: #ae3540; background: #ffebed; font-size: 10px; font-weight: 800; white-space: nowrap; }
  .fleet-forecast-calendar { min-height: 0; overflow: hidden; flex: 1; padding: 9px 10px; }
  .forecast-calendar-month { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 3px; color: #24343d; font-size: 13px; font-weight: 800; text-transform: capitalize; }
  .forecast-calendar-month strong { min-width: 142px; text-align: center; }
  .forecast-calendar-nav { display: inline-grid; width: 22px; height: 22px; padding: 0; place-items: center; border: 1px solid #d7e2e5; border-radius: 5px; color: #00688b; background: #fff; font-size: 19px; line-height: 1; cursor: pointer; }
  .forecast-calendar-nav:hover, .forecast-calendar-nav:focus-visible { color: #fff; background: #00688b; outline: none; }
  .forecast-calendar-note { margin: 0 0 6px; color: #657982; font-size: 10px; font-weight: 650; }
  .forecast-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); overflow: hidden; border: 1px solid #dce6e9; border-radius: 7px; }
  .forecast-calendar-weekday { padding: 5px 2px; color: #60747d; background: #f5f8f9; font-size: 10px; font-weight: 800; text-align: center; }
  .forecast-calendar-day { position: relative; min-height: 49px; padding: 3px 4px; border-top: 1px solid #e3eaec; border-left: 1px solid #e3eaec; background: #fff; }
  .forecast-calendar-weekday:nth-child(7n + 1), .forecast-calendar-day:nth-child(7n + 8) { border-left: 0; }
  .forecast-calendar-day.is-empty { background: #fafcfc; }
  .forecast-calendar-date { position: relative; z-index: 1; display: block; margin-bottom: 2px; color: #50656e; font-size: 11px; font-weight: 800; }
  .forecast-calendar-event { position: relative; z-index: 1; display: block; width: fit-content; max-width: calc(100% - 6px); overflow: hidden; margin: 1px 3px 0; padding: 1px 3px; border-radius: 3px; color: #17643b; background: #e4f3e9; font-family: "Segoe UI Variable Text", "Segoe UI", Arial, sans-serif; font-size: 9px; font-weight: 800; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; cursor: help; }
  .forecast-calendar-event.is-warning { color: #17643b; background: #e4f3e9; }
  .forecast-calendar-event.is-due { color: #a34d00; background: #fff0dc; }
  .forecast-calendar-event.is-overdue { color: #ae3540; background: #ffebed; }
  .forecast-calendar-event.is-unconfigured { color: #60747d; background: #eef2f3; }
  .forecast-calendar-empty { display: grid; height: 100%; min-height: 130px; place-items: center; color: #60747d; font-size: 12px; font-weight: 650; text-align: center; }
  .alerts-calendar-panel .alerts-dashboard-heading { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 7px 10px; color: #fff; background: #00688b; border: 0; }
  .alerts-calendar-panel .alerts-dashboard-heading p { font-size: 14px; }
  .calendar-header-navigation { position: absolute; left: 50%; display: grid; grid-template-columns: 22px 136px 22px; align-items: center; gap: 12px; transform: translateX(-50%); }
  .calendar-header-navigation strong { min-width: 136px; color: #fff; font-size: 12px; font-weight: 800; text-align: center; text-transform: capitalize; }
  .calendar-header-navigation .forecast-calendar-nav { width: 22px; height: 22px; border-color: rgba(255,255,255,.58); color: #fff; background: transparent; font-size: 19px; }
  .calendar-header-navigation .forecast-calendar-nav:hover, .calendar-header-navigation .forecast-calendar-nav:focus-visible { color: #00688b; background: #fff; }
  .calendar-expand-button { display: inline-grid; width: 25px; height: 25px; padding: 0; place-items: center; border: 1px solid rgba(255,255,255,.58); border-radius: 5px; color: #fff; background: transparent; cursor: pointer; }
  .calendar-header-navigation .calendar-expand-button { position: absolute; left: calc(100% + 14px); }
  .calendar-expand-button:hover, .calendar-expand-button:focus-visible { color: #00688b; background: #fff; outline: none; }
  .calendar-expand-button svg { display: block; width: 15px; height: 15px; margin: auto; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 2; }
  #forecast-calendar-dialog { width: min(1280px, calc(100vw - 64px)); max-height: calc(100vh - 32px); padding: 0; overflow: hidden; border: 0; border-radius: 14px; box-shadow: 0 24px 70px rgba(10, 35, 43, .28); }
  #forecast-calendar-dialog[open] { display: grid; grid-template-rows: auto auto; align-content: start; }
  #forecast-calendar-dialog::backdrop { background: rgba(15, 37, 45, .42); }
  #forecast-calendar-dialog .dialog-header { position: relative; display: flex; align-items: center; justify-content: center; min-height: 42px; padding: 8px 18px; color: #fff; background: #00688b; border: 0; }
  #forecast-calendar-dialog .dialog-header .icon-button { position: absolute; right: 18px; display: grid; width: 30px; height: 30px; min-height: 0; padding: 0; place-items: center; border: 1px solid rgba(255,255,255,.8); border-radius: 5px; color: #fff; background: transparent; font-family: Arial, sans-serif; font-size: 0; line-height: 1; }
  #forecast-calendar-dialog .dialog-header .icon-button::after { display: block; content: "×"; font-size: 22px; line-height: 1; transform: translateY(-1px); }
  #forecast-calendar-dialog .dialog-header .icon-button:hover, #forecast-calendar-dialog .dialog-header .icon-button:focus-visible { color: #00688b; background: #fff; }
  #forecast-calendar-dialog .calendar-header-navigation { grid-template-columns: 30px 166px 30px; }
  #forecast-calendar-dialog .calendar-header-navigation strong { min-width: 166px; color: #fff; font-size: 15px; }
  #forecast-calendar-dialog .calendar-header-navigation .forecast-calendar-nav { display: grid; width: 30px; height: 30px; padding: 0; place-items: center; font-size: 23px; line-height: 1; }
  #forecast-calendar-dialog .forecast-calendar-expanded { box-sizing: border-box; min-height: 0; padding: 16px 20px 20px; overflow: auto; background: #f4f7f8; }
  #forecast-calendar-dialog .forecast-calendar-month { margin-bottom: 12px; font-size: 17px; }
  #forecast-calendar-dialog .forecast-calendar-nav { width: 30px; height: 30px; font-size: 25px; }
  #forecast-calendar-dialog .forecast-calendar-grid { width: 100%; margin: 0; overflow: hidden; border-color: #d3e0e4; border-radius: 10px; background: #fff; box-shadow: 0 6px 18px rgba(26, 55, 65, .06); }
  #forecast-calendar-dialog .forecast-calendar-weekday { padding: 9px 2px; color: #48616b; background: #eef4f5; font-size: 11px; letter-spacing: .02em; }
  #forecast-calendar-dialog .forecast-calendar-day { min-height: 72px; padding: 8px; background: #fff; }
  #forecast-calendar-dialog .forecast-calendar-day:nth-child(7n),
  #forecast-calendar-dialog .forecast-calendar-day:nth-child(7n + 6) { background: #fbfcfc; }
  #forecast-calendar-dialog .forecast-calendar-date { display: inline-grid; width: 21px; height: 21px; place-items: center; border-radius: 50%; color: #4e6670; background: #f1f5f6; font-size: 11px; }
  #forecast-calendar-dialog .forecast-calendar-event { margin: 5px 2px 0; padding: 4px 6px; border-radius: 4px; font-size: 10px; line-height: 1.15; box-shadow: inset 3px 0 currentColor; }
  #forecast-calendar-dialog .forecast-calendar-event.is-warning { background: #e4f3e9; }
  #forecast-calendar-dialog .forecast-calendar-event.is-due { background: #fff0dc; }
  #forecast-calendar-dialog .forecast-calendar-event.is-overdue { background: #ffebed; }
  .fleet-alert-table { width: 100%; border-collapse: collapse; font-size: 12px; }
  .fleet-alert-table th, .fleet-alert-table td { padding: 9px 12px; border-bottom: 1px solid #e0e7ea; text-align: left; white-space: nowrap; }
  .fleet-alert-table th { color: #263c45; background: #f6f9fa; font-size: 10px; font-weight: 800; text-transform: none; }
  .alerts-circulation-panel .fleet-alert-table th { font-size: 11px; }
  .alerts-forecast-panel .fleet-alert-table th { font-size: 11px; }
  .fleet-alert-table tr:last-child td { border-bottom: 0; }
  .fleet-alert-status { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; color: #17643b; background: #e4f3e9; font-size: 11px; font-weight: 800; }
  .fleet-alert-status svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
  .fleet-alert-status.is-warning { color: #946000; background: #fff4cf; }
  .fleet-alert-status.is-urgent { color: #b96000; background: #fff0dc; }
  .fleet-alert-status.is-stale { color: #ae3540; background: #ffebed; }
  .fleet-alert-sync-icon { display: inline-grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; color: #17643b; background: #e4f3e9; }
  .fleet-alert-sync-icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
  .fleet-alert-sync-icon.is-warning { color: #946000; background: #fff4cf; }
  .fleet-alert-sync-icon.is-urgent { color: #b96000; background: #fff0dc; }
  .fleet-alert-sync-icon.is-stale { color: #ae3540; background: #ffebed; }
  .fleet-alert-sync-icon.is-suspended { color: #657681; background: #eef2f3; }
  .fleet-alert-icon { display: inline-grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; color: #3a4850; background: #f0f3f4; font-size: 15px; }
  .fleet-alert-calendar svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.75; }
  .fleet-alert-km svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
  .fleet-alert-trigger-clear { color: #23884b; background: #e5f4e9; }
  .fleet-alert-trigger-unconfigured { color: #3a4850; background: #f0f3f4; }
  .fleet-alert-trigger-warning { color: #be8c00; background: #fff4cf; }
  .fleet-alert-trigger-due { color: #d87500; background: #fff0dc; }
  .fleet-alert-trigger-overdue { color: #c63b45; background: #ffebed; }
  .fleet-alert-open-button { display: inline-grid; width: 26px; height: 26px; padding: 0; place-items: center; border: 0; border-radius: 50%; color: #00688b; background: transparent; cursor: pointer; }
  .fleet-alert-open-button:hover, .fleet-alert-open-button:focus-visible { color: #fff; background: #00688b; }
  .fleet-alert-open-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.25; }
  .fleet-alert-train { color: #23884b; background: #e5f4e9; }
  .fleet-alert-train-off-service { color: #c63b45; background: #ffebed; }
  .fleet-alert-train svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.75; }
  .fleet-alert-available-row td { color: #24343d; font-size: 13px; font-weight: 700; }
  .fleet-alert-forecast-row td { color: #24343d; font-size: 13px; font-weight: 700; }
  .alerts-forecast-panel .fleet-alert-table { table-layout: fixed; }
  .alerts-forecast-panel .fleet-alert-table th,
  .alerts-forecast-panel .fleet-alert-table td { padding-right: 8px; padding-left: 8px; }
  .alerts-forecast-panel .fleet-alert-table th:nth-child(1), .alerts-forecast-panel .fleet-alert-table td:nth-child(1) { width: 2.5%; text-align: center; }
  .alerts-forecast-panel .fleet-alert-table th:nth-child(2), .alerts-forecast-panel .fleet-alert-table td:nth-child(2) { width: 3%; text-align: center; }
  .alerts-forecast-panel .fleet-alert-table th:nth-child(3), .alerts-forecast-panel .fleet-alert-table td:nth-child(3) { width: 6.2%; }
  .alerts-forecast-panel .fleet-alert-table th:nth-child(4), .alerts-forecast-panel .fleet-alert-table td:nth-child(4) { width: 5%; }
  .alerts-forecast-panel .fleet-alert-table th:nth-child(5), .alerts-forecast-panel .fleet-alert-table td:nth-child(5) { width: 10%; }
  .alerts-forecast-panel .fleet-alert-table th:nth-child(6), .alerts-forecast-panel .fleet-alert-table td:nth-child(6) { width: 9%; }
  .alerts-forecast-panel .fleet-alert-table th:nth-child(7), .alerts-forecast-panel .fleet-alert-table td:nth-child(7) { width: 9%; text-align: center; }
  .alerts-forecast-panel .fleet-alert-table th:nth-child(8), .alerts-forecast-panel .fleet-alert-table td:nth-child(8) { width: 10%; }
  .alerts-forecast-panel .fleet-alert-table th:nth-child(9), .alerts-forecast-panel .fleet-alert-table td:nth-child(9) { width: 13%; }
  .alerts-forecast-panel .fleet-alert-table th:nth-child(10), .alerts-forecast-panel .fleet-alert-table td:nth-child(10) { width: 12%; }
  .alerts-forecast-panel .fleet-alert-table th:nth-child(11), .alerts-forecast-panel .fleet-alert-table td:nth-child(11) { width: 9%; }
  .alerts-forecast-panel .fleet-alert-table th:nth-child(12), .alerts-forecast-panel .fleet-alert-table td:nth-child(12) { width: 11.3%; }
  .alerts-circulation-panel .fleet-alert-available-row td:nth-child(5),
  .alerts-circulation-panel .fleet-alert-available-row td:nth-child(6) { display: none; }
  .fleet-alert-empty { display: grid; min-height: 100%; place-items: center; padding: 16px; color: #60747d; font-size: 13px; }
  .alerts-dashboard-alerts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .alerts-dashboard-alerts > section { display: grid; grid-template-rows: auto minmax(64px, 1fr); }
  .alerts-dashboard-alerts .alerts-dashboard-heading { display: flex; align-items: center; }
  .alerts-dashboard-alerts > section > div:last-child { display: grid; align-content: center; padding: 10px 14px; color: #24343d; font-size: 12px; font-weight: 750; }
  .alerts-dashboard-alerts > section .alerts-dashboard-heading::before { display: inline-grid; width: 19px; height: 19px; margin-right: 8px; place-items: center; border-radius: 3px; color: #17252c; background: #ffb21a; content: "!"; font-weight: 900; }
  .alerts-dashboard-alerts > section:nth-child(2) .alerts-dashboard-heading::before { color: #fff; background: #2f8057; content: "✓"; }
  #operational-summary-dialog { width: min(1040px, calc(100vw - 48px)); min-height: min(560px, calc(100vh - 48px)); max-height: min(780px, calc(100vh - 48px)); overflow: hidden; border: 0; border-radius: 16px; box-shadow: 0 24px 70px rgba(10, 35, 43, .28); }
  #operational-summary-dialog[open] { display: flex; flex-direction: column; }
  #operational-summary-dialog .dialog-header { min-height: 82px; padding: 0 24px; color: #fff; background: linear-gradient(120deg, #00688b, #00688b); }
  #operational-summary-dialog .dialog-header { display: flex; align-items: center; justify-content: space-between; }
  .operational-summary-dialog-title-group { display: flex; align-items: center; gap: 14px; }
  .operational-summary-dialog-title-icon { display: inline-grid; width: 46px; height: 46px; place-items: center; border: 1px solid rgba(255,255,255,.42); border-radius: 50%; }
  .operational-summary-dialog-title-icon svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
  #operational-summary-dialog .dialog-header h2 { color: inherit; font-size: 22px; }
  #operational-summary-dialog .dialog-header .icon-button { width: 42px; height: 42px; border: 0; border-radius: 9px; color: #33464d; background: #fff; font-size: 25px; }
  .operational-summary-dialog-content { display: flex; min-width: 0; min-height: 430px; max-height: 650px; flex: 1; flex-direction: column; overflow: auto; padding: 18px 26px; background: var(--canvas); }
  .operational-summary-dialog-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; color: #24343d; }
  .operational-summary-dialog-title-icon { display: inline-grid; width: 32px; height: 32px; place-items: center; border: 1px solid #8fc4ca; border-radius: 50%; color: #00688b; background: #f1fbfc; }
  .operational-summary-dialog-title-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.65; }
  .operational-summary-dialog-heading h2 { margin: 0; color: inherit; font-size: 16px; line-height: 1.15; }
  .operational-summary-dialog-kicker { margin-bottom: 6px; color: #526b78; font-size: 11px; font-weight: 850; letter-spacing: .04em; }
  .operational-summary-dialog-count { margin-bottom: 14px; color: #1c3141; font-size: 22px; line-height: 1; }
  .operational-summary-dialog-list { display: grid; gap: 10px; }
  .operational-summary-dialog-item { display: flex; width: 100%; min-height: 56px; align-items: center; gap: 10px; padding: 9px 13px; border: 1px solid #dce5e8; border-radius: 9px; color: #24343d; background: #fff; font: inherit; font-size: 13px; font-weight: 750; text-align: left; cursor: pointer; }
  .operational-summary-dialog-item-icon { display: inline-grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #d78a00; background: #fff0cd; font-size: 17px; font-weight: 500; }
  .operational-summary-dialog-item-icon.is-warning { color: #be8c00; background: #fff4cf; }
  .operational-summary-dialog-item-icon.is-due { color: #d87500; background: #fff0dc; }
  .operational-summary-dialog-item-icon.is-overdue { color: #c63b45; background: #ffebed; }
  .operational-summary-dialog-item-copy { flex: 1; }
  .operational-summary-dialog-item { cursor: default; }
  .operational-summary-dialog-item > svg { display: none; }
  .operational-summary-dialog-item:hover, .operational-summary-dialog-item:focus-visible { border-color: #dce5e8; background: #fff; outline: none; }
  .operational-summary-dialog-item.is-trigger { cursor: default; }
  .operational-summary-dialog-item.is-trigger:hover { border-color: #dce5e8; background: #fff; }
  .operational-summary-dialog-item.is-corrective { cursor: pointer; }
  .operational-summary-dialog-item.is-corrective > svg { display: block; }
  .operational-summary-dialog-item.is-corrective:hover, .operational-summary-dialog-item.is-corrective:focus-visible { border-color: #73bac4; background: #f1fafb; }
  .operational-summary-dialog-notice { flex: 0 0 auto; padding: 4px 8px; border-radius: 999px; color: #946000; background: #fff4cf; font-size: 11px; font-weight: 800; }
  .operational-summary-dialog-notice.is-in-progress { color: #fff; background: #00688b; }
  .operational-summary-dialog-notice.is-ready { color: #fff; background: #2f8057; }
  .operational-summary-dialog-notice.is-warning { color: #946000; background: #fff4cf; }
  .operational-summary-dialog-notice.is-critical { color: #fff; background: #c63b45; }
  .operational-summary-return-button { min-height: 34px; padding: 6px 10px; justify-content: center; white-space: nowrap; font-size: 11px; }
  .operational-summary-dialog-item:hover, .operational-summary-dialog-item:focus-visible { border-color: #73bac4; background: #f1fafb; }
  .operational-summary-dialog-item svg { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: #00688b; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.25; }
  div.operational-summary-dialog-item,
  div.operational-summary-dialog-item.is-corrective { cursor: default; }
  div.operational-summary-dialog-item:hover,
  div.operational-summary-dialog-item:focus-visible,
  div.operational-summary-dialog-item.is-corrective:hover,
  div.operational-summary-dialog-item.is-corrective:focus-visible { border-color: #dce5e8; background: #fff; outline: none; }
  .operational-summary-dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: auto; padding-top: 18px; border-top: 1px solid #dce5e8; color: #718695; font-size: 11px; }
  .operational-summary-dialog-footer > div { display: flex; gap: 12px; }
  .operational-summary-dialog-footer .button { min-width: 108px; min-height: 42px; justify-content: center; font-size: 12px; }
  .operational-summary-dialog-content p { margin: 0; color: #526971; font-weight: 700; }
}

#alerts-all-view { padding-bottom: 34px; }.alerts-all-heading { margin-bottom: 18px; }.alerts-all-toolbar { display:grid; grid-template-columns:minmax(260px,1fr) auto auto; gap:12px; align-items:center; margin:0 34px 22px; padding:12px; border:1px solid #dbe5e8; border-radius:10px; background:#fff; box-shadow:var(--shadow); }.alerts-all-search { display:flex; align-items:center; gap:10px; padding:0 12px; border:1px solid #d5e1e4; border-radius:6px; color:#65808b; }.alerts-all-search input { width:100%; height:40px; border:0; outline:0; font:inherit; font-size:13px; }.alerts-all-filters { display:flex; gap:7px; }.alerts-all-filters button { min-height:40px; padding:0 11px; color:#3e535d; border:1px solid #d5e1e4; border-radius:6px; background:#f8fafb; font:inherit; font-size:12px; font-weight:750; cursor:pointer; }.alerts-all-filters button.is-active { color:#fff; border-color:#00688b; background:#00688b; }.alerts-all-filters b { margin-left:4px; font-size:10px; }.alerts-all-list { margin:0 34px; }.alerts-all-group { margin:0 0 20px; }.alerts-all-group h2 { margin:0 0 8px; color:#2d454f; font-size:14px; }.alerts-all-row { display:grid; grid-template-columns:10px minmax(0,1fr) auto; gap:13px; align-items:center; min-height:64px; padding:11px 16px; border:1px solid #dce6e9; border-bottom:0; background:#fff; }.alerts-all-row:last-child { border-bottom:1px solid #dce6e9; }.alerts-all-dot { width:10px; height:10px; border-radius:50%; background:#d87500; }.alerts-all-row.is-critical .alerts-all-dot { background:#c63b45; }.alerts-all-row.is-warning .alerts-all-dot { border:2px solid #d87500; background:#fff; }.alerts-all-row div { display:grid; gap:4px; }.alerts-all-row strong { color:#263c45; font-size:14px; }.alerts-all-row small { color:#627780; font-size:12px; font-weight:650; }.alerts-all-row b { padding:5px 8px; border:1px solid #f1bd87; border-radius:4px; color:#9b5000; background:#fffaf4; font-size:11px; white-space:nowrap; }.alerts-all-row.is-critical b { border-color:#ef9fa6; color:#ae3540; background:#fff8f8; }

#personnel-management-view [data-settings-panel="backup"] .backup-panel { margin-top: 0; overflow: hidden; border-top: 1px solid #cbd4d8; border-radius: 12px; }
#personnel-management-view [data-settings-panel="backup"] .backup-panel::before { display: none; }
#personnel-management-view [data-settings-panel="backup"] .backup-panel-header { background: #eef3f5; }
#personnel-management-view [data-settings-panel="backup"] .backup-panel-header .backup-info-button { background: var(--brand); }

/* Spostamento del treno fuori servizio */
#fleet-out-of-service-dialog, #fleet-return-to-service-dialog { width: min(1040px, calc(100vw - 48px)); min-height: min(560px, calc(100vh - 48px)); padding: 0; overflow: hidden; border: 0; border-radius: 14px; box-shadow: 0 20px 54px rgba(10, 35, 43, .26); color: #172d42; }
#fleet-out-of-service-dialog::backdrop, #fleet-return-to-service-dialog::backdrop { background: rgba(11, 30, 37, .72); backdrop-filter: blur(3px); }
.fleet-out-of-service-header { min-height: 40px; background: linear-gradient(120deg, #00688b, #00688b); }
.fleet-out-of-service-heading { display: flex; align-items: center; gap: 10px; color: #24343d; }
.fleet-out-of-service-title-icon { display: inline-grid; width: 32px; height: 32px; flex: 0 0 auto; place-items: center; border: 1px solid #8fc4ca; border-radius: 50%; color: #00688b; background: #f1fbfc; }
.fleet-out-of-service-title-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.65; }
.fleet-out-of-service-heading h2 { margin: 0; color: inherit; font-size: 16px; line-height: 1.15; }
.fleet-out-of-service-content { display: grid; gap: 12px; padding: 18px 26px; background: var(--canvas); }
.fleet-out-of-service-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; overflow: visible; border: 0; border-radius: 0; background: transparent; }
.fleet-out-of-service-summary > div { display: flex; min-height: 56px; align-items: center; justify-content: flex-start; gap: 9px; padding: 9px 13px; border: 1px solid #dce5e8; border-radius: 9px; background: #fff; }
.fleet-out-of-service-summary > div:nth-child(odd), .fleet-out-of-service-summary > div:nth-child(-n+2) { border-color: #dce5e8; }
.fleet-out-of-service-summary small { color: #526b78; font-size: 11px; font-weight: 760; }
.fleet-out-of-service-summary strong { color: #00688b; font-size: 16px; line-height: 1; }
.fleet-out-of-service-date { display: grid; width: 100%; height: 56px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 10px; color: #00688b; font-size: 13px; font-weight: 760; text-transform: none; }
.fleet-out-of-service-date > span { min-width: 0; min-height: 0; height: 56px; box-sizing: border-box; border: 1px solid #dce5e8; border-radius: 9px; background: #fff; }
.fleet-out-of-service-date > span:first-child { display: flex; align-items: center; padding: 9px 13px; border-color: #00688b; white-space: nowrap; }
.fleet-out-of-service-date-picker { display: block; overflow: hidden; }
.fleet-out-of-service-date-picker input { display: block; width: 100%; min-width: 0; height: 54px; min-height: 0; margin: 0; padding: 9px 13px; border: 0; border-radius: 0; color: #24343d; background: transparent; font: inherit; font-weight: 760; outline: 0; }
.fleet-out-of-service-datetime { display: grid; grid-template-columns: minmax(0, 1fr) 120px; overflow: hidden; }
.fleet-out-of-service-datetime .fleet-out-of-service-date-picker { height: 54px; border: 0; border-radius: 0; }
.fleet-out-of-service-datetime #fleet-out-of-service-time { width: 100%; height: 54px; min-height: 0; margin: 0; padding: 9px 13px; border: 0; border-left: 1px solid #dce5e8; border-radius: 0; color: #24343d; background: transparent; font: inherit; font-weight: 760; outline: 0; }
.fleet-out-of-service-label { margin: 2px 0 -4px; color: #526b78; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.fleet-out-of-service-reasons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fleet-return-to-service-state { grid-template-columns: 1fr; }
.fleet-return-to-service-dialog .fleet-out-of-service-label:has(+ .fleet-out-of-service-reasons > [data-return-stop-reason]), .fleet-return-to-service-dialog .fleet-out-of-service-reasons:has(> [data-return-stop-reason]) { display: none; }
.fleet-out-of-service-reasons button { display: grid; min-height: 56px; grid-template-columns: 30px 1fr; align-items: center; justify-items: start; gap: 10px; padding: 9px 13px; border: 1px solid #dce5e8; border-radius: 9px; color: #24343d; background: #f8fafb; font: inherit; font-size: 13px; font-weight: 760; cursor: pointer; text-align: left; }
.fleet-out-of-service-reasons button svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.fleet-out-of-service-reasons button:hover, .fleet-out-of-service-reasons button:focus-visible, .fleet-out-of-service-reasons button.is-selected { border-color: #00688b; color: #00688b; background: #f1fbfc; box-shadow: inset 0 0 0 1px #00688b; outline: none; }
.fleet-out-of-service-notes { display: grid; gap: 6px; color: #526b78; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.fleet-out-of-service-notes textarea { min-height: 68px; box-sizing: border-box; padding: 11px 13px; border: 1px solid #d1dde1; border-radius: 8px; color: #172d42; font: inherit; font-size: 13px; resize: vertical; }
.fleet-out-of-service-notes textarea:focus { border-color: #00688b; outline: 3px solid rgba(0, 123, 135, .14); }
.fleet-out-of-service-note-display { display: grid; gap: 6px; margin: 0; color: #526b78; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.fleet-out-of-service-note-display p { min-height: 68px; margin: 0; padding: 11px 13px; border: 1px solid #d1dde1; border-radius: 8px; color: #24343d; background: #fff; font-size: 13px; font-weight: 650; line-height: 1.4; text-transform: none; white-space: pre-wrap; }
.fleet-out-of-service-footer { display: flex; min-height: 62px; align-items: center; justify-content: space-between; gap: 16px; padding: 0 26px; border-top: 1px solid #dce5e8; background: var(--canvas); }
.fleet-out-of-service-footer p { display: flex; align-items: center; gap: 9px; margin: 0; color: #526b78; font-size: 11px; font-weight: 650; }
.fleet-out-of-service-footer p span { display: inline-grid; width: 22px; height: 22px; place-items: center; border: 1.5px solid #00688b; border-radius: 50%; color: #00688b; font-family: Georgia, serif; font-size: 15px; font-weight: 700; }
.fleet-out-of-service-footer > div { display: flex; gap: 14px; }
.fleet-out-of-service-footer .button { height: 42px; min-height: 42px; justify-content: center; padding: 0 18px; font-size: 13px; }

.fleet-planned-selection-dialog { width: min(720px, calc(100vw - 40px)); }
.fleet-planned-selection-dialog .dialog-header { min-height: 0; padding: 18px 22px 0; border: 0; background: transparent; color: #24343d; }
.fleet-planned-selection-dialog .dialog-header h2 { color: #24343d; font-size: 16px; }
.fleet-planned-selection-dialog .dialog-header .icon-button { color: #24343d; background: #fff; border-color: #d5e0e4; }
.fleet-planned-selection-list { display: grid; gap: 10px; margin-top: 18px; }
.fleet-planned-selection-option { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid #d9e3e6; border-radius: 9px; background: #fff; cursor: pointer; }
.fleet-planned-selection-option:has(input:checked) { border-color: #00688b; background: #f1fbfc; box-shadow: inset 0 0 0 1px #00688b; }
.fleet-planned-selection-option input { width: 18px; height: 18px; accent-color: #00688b; }
.fleet-planned-selection-option strong, .fleet-planned-selection-option small { display: block; }
.fleet-planned-selection-option strong { color: #203844; font-size: 14px; }
.fleet-planned-selection-option small { margin-top: 3px; color: #657985; font-size: 12px; font-weight: 650; }
.fleet-planned-selection-option em { padding: 4px 8px; border-radius: 999px; color: #9b6500; background: #fff0c9; font-size: 11px; font-style: normal; font-weight: 800; white-space: nowrap; }
.fleet-planned-selection-option em.is-anticipated { color: #45616c; background: #eaf0f2; }
.fleet-corrective-confirm-dialog { width: min(840px, calc(100vw - 40px)); padding: 0; overflow: hidden; border: 0; border-radius: 16px; box-shadow: 0 20px 54px rgba(10, 35, 43, .3); }
.fleet-corrective-confirm-dialog::backdrop { background: rgba(11, 30, 37, .62); backdrop-filter: blur(3px); }
.fleet-corrective-confirm-content { padding: 34px 42px 30px; background: #fff; }
.fleet-corrective-confirm-heading { display: flex; align-items: center; gap: 18px; }
.fleet-corrective-confirm-heading .fleet-out-of-service-title-icon { width: 74px; height: 74px; border-width: 2px; }
.fleet-corrective-confirm-heading .fleet-out-of-service-title-icon svg { width: 40px; height: 40px; stroke-width: 1.45; }
.fleet-corrective-confirm-heading h2 { margin: 0; color: #24343d; font-size: 30px; }
.fleet-corrective-confirm-content > p { margin: 32px 0 0; color: #24343d; font-size: 20px; line-height: 1.35; }
.fleet-corrective-confirm-content > p + p { margin-top: 22px; color: #60737e; }
.fleet-corrective-confirm-footer { display: flex; justify-content: flex-end; gap: 18px; padding: 26px 42px; border-top: 1px solid #dce5e8; background: #fff; }
.fleet-corrective-confirm-footer .button { min-width: 154px; height: 54px; justify-content: center; font-size: 17px; }
.inline-maintainer-expiries-dialog { width: min(1420px, 94vw); height: fit-content !important; min-height: min(520px, calc(100vh - 16px)); max-height: calc(100vh - 16px); background: #edf5f6; }
.inline-maintainer-expiries-dialog .dialog-header { min-height: 0; align-items: center; padding: 14px 18px; border-bottom: 1px solid #dce5e8; background: #fff; color: #24343d; }
.inline-maintainer-expiries-dialog .dialog-header h2 { color: #24343d; font-size: 16px; }
.inline-maintainer-expiries-title { display: flex; align-items: center; gap: 10px; }
.inline-maintainer-expiries-title-icon { display: inline-grid; width: 32px; height: 32px; place-items: center; border: 1px solid #8fc4ca; border-radius: 50%; color: #00688b; background: #f1fbfc; }
.inline-maintainer-expiries-title-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.65; }
.inline-maintainer-expiries-dialog .dialog-header .icon-button { color: #24343d; background: #fff; border-color: #d5e0e4; }
.inline-maintainer-expiries-content.competency-monitoring-matrix { width: min(1340px, calc(100% - 40px)); height: auto; max-height: calc(100vh - 82px); box-sizing: border-box; margin: 18px auto; padding: 0; overflow: auto; background: var(--canvas); border-radius: 9px; box-shadow: none; }
.inline-maintainer-expiries-content .competency-monitoring-table th, .inline-maintainer-expiries-content .competency-monitoring-table td { padding: 7px 9px; }
.inline-maintainer-expiries-content .competency-monitoring-table tbody th { font-size: 13px; }
.inline-maintainer-expiries-content .competency-monitoring-renewal { font-size: 12px; }
.inline-maintainer-expiries-content .competency-monitoring-days { margin-top: 2px; font-size: 9px; }
@media (max-width: 720px) { .fleet-out-of-service-header { min-height: 92px; padding: 0 24px; gap: 14px; } .fleet-out-of-service-title-icon { width: 46px; height: 46px; } .fleet-out-of-service-title-icon svg { width: 25px; height: 25px; } .fleet-out-of-service-header h2 { font-size: 21px; } .fleet-out-of-service-content { padding: 24px; } .fleet-out-of-service-reasons { grid-template-columns: 1fr; gap: 10px; } .fleet-out-of-service-reasons button { min-height: 82px; grid-template-columns: 42px 1fr; justify-items: start; gap: 12px; text-align: left; } .fleet-out-of-service-reasons button svg { width: 38px; height: 38px; } .fleet-out-of-service-footer { align-items: stretch; flex-direction: column; padding: 20px 24px; } .fleet-out-of-service-footer > div { justify-content: stretch; } .fleet-out-of-service-footer .button { flex: 1; padding: 0 12px; } }

/* Piani manutentivi: inserimento e piani configurati */
.scheduled-catalog-panel { padding: 0; }
.scheduled-plans-layout { display: grid; grid-template-columns: 296px minmax(0, 1fr); gap: 16px; align-items: stretch; }
.scheduled-plan-form { height: 100%; box-sizing: border-box; margin: 0; border-radius: 12px; box-shadow: none; }
.scheduled-plan-form-heading { display: flex; height: 48px; align-items: center; box-sizing: border-box; padding: 0 20px; background: linear-gradient(120deg, var(--brand-dark), var(--brand)); }
.scheduled-plan-form-heading h2 { font-size: 18px; }
.scheduled-plan-grid { display: grid; grid-template-columns: 1fr; gap: 15px; padding: 18px 20px; }
.scheduled-plan-type-options { padding: 0; border-radius: 7px; background: #fff; }
.scheduled-plan-type-options span { padding: 9px 10px; border-radius: 5px; }
.scheduled-plan-grid > label > select,
.scheduled-plan-type-options,
.scheduled-plan-input-suffix,
.scheduled-plan-upload,
.scheduled-plan-actions .button { height: 42px; min-height: 42px; }
.scheduled-plan-input-suffix input { height: 40px; min-height: 40px; }
.scheduled-plan-mode { display: grid; grid-template-columns: 1fr; gap: 15px; }
.scheduled-plan-mode[hidden] { display: none; }
.scheduled-plan-file { grid-column: auto; cursor: pointer; }
.scheduled-plan-file:has(input[name="operationFile"]) { margin-top: 28px; }
.scheduled-plan-upload { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 40px; padding: 0 12px; border: 1px solid var(--brand); border-radius: 7px; color: #fff; font-size: 13px; background: var(--brand); box-shadow: inset 0 1px 0 rgba(255,255,255,.16); transition: color .15s ease, background .15s ease, border-color .15s ease; }
.scheduled-plan-upload:hover { color: #fff; border-color: var(--brand-dark); background: var(--brand-dark); }
.scheduled-plan-file:has(input[name="operationFile"]):not([data-import-ready]) .scheduled-plan-upload { cursor: not-allowed; }
.scheduled-plan-file:has(input[name="operationFile"]):not([data-import-ready]) .scheduled-plan-upload:hover { color: #fff; border-color: var(--brand); background: var(--brand); }
.scheduled-plan-file:has(input[name="manualFile"]):not([data-import-ready]) .scheduled-plan-upload { cursor: not-allowed; }
.scheduled-plan-file:has(input[name="manualFile"]):not([data-import-ready]) .scheduled-plan-upload:hover { color: #fff; border-color: var(--brand); background: var(--brand); }
.scheduled-plan-upload svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.scheduled-plan-file #scheduled-manual-upload-status { display: block; overflow: hidden; margin-top: -3px; color: #64747d; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.scheduled-plan-file #scheduled-manual-upload-status[hidden] { display: none; }
.scheduled-plan-file #scheduled-manual-upload-status.is-loading { color: #00688b; }
.scheduled-plan-file #scheduled-manual-upload-status.is-success { color: #24734f; }
.scheduled-plan-file #scheduled-manual-upload-status.is-error { color: #b4353e; }
.scheduled-manual-upload-overlay { position: fixed; z-index: 10000; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(18, 34, 42, .42); backdrop-filter: blur(2px); }
.scheduled-manual-upload-overlay[hidden] { display: none; }
.scheduled-manual-upload-dialog { display: grid; justify-items: center; gap: 12px; min-width: 280px; padding: 28px 34px; border: 1px solid rgba(255,255,255,.7); border-radius: 14px; color: #22323c; background: #fff; box-shadow: 0 22px 48px rgba(0,0,0,.24); }
.scheduled-manual-upload-dialog > strong { font-size: 16px; }
.scheduled-manual-upload-dialog small { color: #61717a; text-align: center; }
.scheduled-manual-upload-ring { --upload-progress: 0%; position: relative; display: grid; width: 104px; height: 104px; place-items: center; border-radius: 50%; background: conic-gradient(var(--brand) var(--upload-progress), #dce6e9 0); transition: background .14s linear; }
.scheduled-manual-upload-ring::before { position: absolute; width: 84px; height: 84px; border-radius: 50%; background: #fff; content: ""; }
.scheduled-manual-upload-ring strong { position: relative; z-index: 1; color: var(--brand-dark); font-size: 20px; }
.scheduled-plan-actions { padding: 14px 20px 20px; border-top: 0; background: #fff; }
.scheduled-plan-actions .button { width: 100%; justify-content: center; }
.scheduled-plan-actions .button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.scheduled-plans-results { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, .6fr); align-content: start; gap: 20px; }
.scheduled-plan-list, .scheduled-plan-files { overflow: hidden; margin: 0; border: 1px solid #cbd6df; border-radius: 12px; background: #fff; }
.scheduled-plan-list:empty, .scheduled-plan-files:empty { display: block; }
.scheduled-plan-list-heading, .scheduled-plan-files-heading { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 20px; color: #fff; background: linear-gradient(120deg, var(--brand-dark), var(--brand)); }
.scheduled-plan-list-heading h3, .scheduled-plan-files-heading h3 { margin: 0; color: #fff; font-size: 17px; }
.scheduled-plan-list-toggle { display: inline-flex; overflow: hidden; border: 1px solid rgba(255,255,255,.75); border-radius: 7px; background: #fff; }
.scheduled-plan-list-toggle button { min-width: 92px; padding: 7px 14px; border: 0; color: #3c4b55; background: #fff; font: inherit; font-size: 12px; cursor: pointer; }
.scheduled-plan-list-toggle button.is-active { color: #fff; background: var(--brand-dark); }
.scheduled-plan-card { min-height: 42px; grid-template-columns: 32px minmax(145px, .7fr) minmax(190px, 1fr) auto; gap: 10px; margin: 6px 12px; padding: 4px 8px; border-radius: 8px; box-shadow: none; }
.scheduled-plan-card:not(:has(.scheduled-plan-card-manuals)) { height: 42px; }
.scheduled-plan-card .scheduled-plan-card-icon { display: grid; width: 32px; height: 32px; margin-top: 0; place-items: center; align-self: center; justify-self: center; border-radius: 0; color: var(--brand); background: transparent; }
.scheduled-plan-card-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.scheduled-plan-card strong { display: block; color: var(--brand); font-size: 16px; }
.scheduled-plan-card span { display: block; margin-top: 5px; color: #315a6c; font-size: 13px; font-weight: 700; }
.scheduled-plan-card-summary { display: flex; min-width: 0; align-items: baseline; gap: 7px; white-space: nowrap; }
.scheduled-plan-card-summary strong { display: inline; }
.scheduled-plan-card-summary span { display: inline; margin-top: 0; }
.scheduled-plan-card-file { display: flex; min-width: 0; align-items: center; gap: 9px; }
.scheduled-plan-card-file b { flex: 0 0 auto; padding: 4px 8px; border-radius: 5px; color: #087a69; background: #e1f6f0; font-size: 11px; white-space: nowrap; }
.scheduled-plan-card-file small { min-width: 0; overflow: hidden; color: #465661; text-overflow: ellipsis; white-space: nowrap; }
.scheduled-plan-card-actions { display: flex; gap: 9px; }
.scheduled-plan-card-actions button, .scheduled-plan-files button { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--brand); border-radius: 7px; color: var(--brand); background: #fff; font-size: 16px; cursor: pointer; }
.scheduled-plan-card-actions button:hover, .scheduled-plan-files button:hover { color: #fff; background: var(--brand); }
.scheduled-plan-files button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.scheduled-plan-files table { width: 100%; border-collapse: collapse; }
.scheduled-plan-files th, .scheduled-plan-files td { padding: 10px 20px; border-bottom: 1px solid #dce4e7; color: #40515d; font-size: 13px; text-align: left; }
.scheduled-plan-files th { color: #00688b; font-size: 12px; }
.scheduled-plan-files td:nth-child(2) { color: var(--brand); font-weight: 800; }
.scheduled-plan-files td:last-child { width: 60px; text-align: center; }
.scheduled-plan-files button { width: 28px; height: 28px; margin: auto; font-size: 15px; }
.scheduled-plan-card-manuals { display: flex; grid-column: 2 / -1; flex-wrap: wrap; align-items: center; gap: 7px; padding-top: 9px; border-top: 1px solid #dce4e7; }
.scheduled-plan-card-manuals > b { margin-right: 3px; color: #40515d; font-size: 11px; }
.scheduled-plan-card-manuals > span { color: #718089; font-size: 11px; }
.scheduled-plan-card-manuals > button { overflow: hidden; max-width: 260px; padding: 6px 9px; border: 1px solid #9fc7ce; border-radius: 6px; color: var(--brand); background: #f3fafb; font: inherit; font-size: 11px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.scheduled-plan-card-manuals > button:hover { color: #fff; background: var(--brand); }
.scheduled-plan-files { display: flex; min-height: 0; flex-direction: column; }
.scheduled-manual-viewer-frame { width: 100%; min-height: 0; border: 0; flex: 1; background: #eef2f3; }
.scheduled-manual-viewer-empty, .scheduled-manual-viewer-loading { display: grid; min-height: 0; place-content: center; justify-items: center; gap: 10px; flex: 1; padding: 24px; color: #667780; text-align: center; }
.scheduled-manual-viewer-empty span { color: var(--brand); font-size: 42px; }
.scheduled-manual-viewer-empty p { margin: 0; }
.scheduled-manual-library { display: grid; align-content: start; gap: 7px; min-height: 0; padding: 12px; overflow-y: auto; }
.scheduled-manual-library-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.scheduled-plan-files .scheduled-manual-library-file { display: flex; width: 100%; height: 42px; min-height: 42px; align-items: center; justify-content: flex-start; gap: 9px; margin: 0; padding: 4px 9px; border-color: #c5d8dc; color: #33454e; text-align: left; }
.scheduled-plan-files .scheduled-manual-library-file:hover { color: #fff; background: var(--brand); }
.scheduled-manual-library-file > span:first-child { flex: 0 0 auto; color: var(--brand); font-size: 21px; }
.scheduled-manual-library-file:hover > span:first-child { color: #fff; }
.scheduled-manual-library b, .scheduled-manual-library small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scheduled-manual-library b { min-width: 0; font-size: 12px; }
.scheduled-manual-library small { margin-top: 3px; color: #718089; font-size: 10px; }
.scheduled-manual-library-actions { display: flex; gap: 6px; }
.scheduled-plan-files .scheduled-manual-library-actions { align-items: center; }
.scheduled-plan-files .scheduled-manual-library-actions button { width: 32px; height: 32px; margin: 0; font-size: 15px; }
.scheduled-plan-empty { margin: 0; padding: 18px 20px; color: #667780; }
.scheduled-catalog-preview-summary { margin: 0; padding: 16px 20px; color: #53646e; font-weight: 700; }
#scheduled-catalog-preview-dialog .scheduled-checklist-table { table-layout: auto; }
#scheduled-catalog-preview-dialog .scheduled-checklist-table th:nth-child(1),
#scheduled-catalog-preview-dialog .scheduled-checklist-table td:nth-child(1) { width: 72px; }
#scheduled-catalog-preview-dialog .scheduled-checklist-table th:nth-child(2),
#scheduled-catalog-preview-dialog .scheduled-checklist-table td:nth-child(2) { width: 58px; }
.scheduled-catalog-panel > .scheduled-catalog-heading,
.scheduled-catalog-panel > #scheduled-catalog-feedback,
.scheduled-catalog-panel > .scheduled-catalog-list { display: none; }
@media (max-width: 900px) {
  .scheduled-plans-layout { grid-template-columns: 1fr; }
  .scheduled-plans-results { grid-template-columns: 1fr; }
  .scheduled-plan-card { grid-template-columns: 32px 1fr auto; }
  .scheduled-plan-card-file { grid-column: 2; }
  .scheduled-manual-viewer-frame { min-height: 520px; }
}
@media (min-width: 901px) {
  #personnel-management-view [data-settings-panel="scheduled-catalog"] .scheduled-plans-layout { height: 100%; min-height: 0; }
  #personnel-management-view [data-settings-panel="scheduled-catalog"] .scheduled-plan-form { display: flex; min-height: 0; flex-direction: column; }
  #personnel-management-view [data-settings-panel="scheduled-catalog"] .scheduled-plan-grid { min-height: 0; overflow-y: auto; flex: 1; }
  #personnel-management-view [data-settings-panel="scheduled-catalog"] .scheduled-plan-grid { display: flex; flex-direction: column; }
  #personnel-management-view [data-settings-panel="scheduled-catalog"] .scheduled-plan-file:has(input[name="operationFile"]) { margin-top: auto; }
  #personnel-management-view [data-settings-panel="scheduled-catalog"] .scheduled-plans-results { min-height: 0; align-content: stretch; align-items: stretch; }
  #personnel-management-view [data-settings-panel="scheduled-catalog"] :is(.scheduled-plan-list, .scheduled-plan-files) { height: 100%; min-height: 0; overflow: auto; }
  #personnel-management-view [data-settings-panel="scheduled-catalog"] .scheduled-plan-list { display: flex; flex-direction: column; gap: 0; }
  #personnel-management-view [data-settings-panel="scheduled-catalog"] .scheduled-plan-list-heading,
  #personnel-management-view [data-settings-panel="scheduled-catalog"] .scheduled-plan-card { flex: 0 0 auto; }
}

/* Adattamento desktop per Full HD, zoom 125% e finestre non massimizzate. */
@media (min-width: 901px) and (max-width: 1600px) {
  #archive-view .filters {
    grid-template-columns: minmax(170px, 1fr) minmax(130px, .65fr) minmax(210px, 1fr) minmax(130px, .65fr) minmax(125px, .65fr);
  }
  #archive-view .filters .button { width: 100%; }
  #archive-view .filters .archive-clear-button,
  #archive-view .filters .archive-export-button { width: auto; min-width: 124px; }
  #archive-view .scheduled-maintenance-card,
  #archive-view .closed-corrective-card { gap: 4px 14px; padding-right: 12px !important; padding-left: 12px !important; }
  #personnel-management-view .settings-tabs { max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
  #personnel-management-view .settings-tab { flex: 0 0 auto; white-space: nowrap; }
  .alerts-dashboard-alerts { gap: 10px; }
  .fleet-alert-table th, .fleet-alert-table td { padding-right: 7px; padding-left: 7px; }
}

@media (min-width: 901px) and (max-width: 1250px) {
  #archive-view .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #archive-view .filters .search-field { grid-column: 1 / -1; }
  #archive-view .scheduled-maintenance-card {
    grid-template-columns: minmax(115px, auto) minmax(210px, 1fr) minmax(190px, auto) minmax(170px, auto) max-content;
    height: auto;
    min-height: 46px;
  }
  #archive-view .closed-corrective-card {
    grid-template-columns: minmax(115px, auto) minmax(190px, 1fr) minmax(190px, auto) minmax(170px, auto) max-content;
    height: auto;
    min-height: 46px;
  }
  #archive-list .record-card.scheduled-maintenance-card,
  #archive-list .record-card.closed-corrective-card { height: auto; min-height: 46px; }
  #alerts-view .alerts-dashboard { grid-template-columns: minmax(230px, .85fr) minmax(230px, .85fr) minmax(360px, 1.2fr); gap: 12px; }
  #alerts-view .alerts-operational-summary { grid-column: 1; grid-row: 1; }
  #alerts-view .alerts-forecast-panel { grid-column: 2 / -1; grid-row: 1; }
  #alerts-view .alerts-circulation-panel { grid-column: 1; grid-row: 2; }
  #alerts-view .alerts-depot-panel { grid-column: 2; grid-row: 2; }
  #alerts-view .alerts-calendar-panel { grid-column: 3; grid-row: 2; }
}

@media (max-width: 900px) {
  #archive-view .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #archive-view .filters .search-field { grid-column: 1 / -1; }
  #archive-view .filters .button { width: 100%; }
  #archive-view .scheduled-maintenance-card,
  #archive-view .closed-corrective-card,
  #archive-list .record-card.scheduled-maintenance-card {
    grid-template-columns: repeat(2, minmax(0, 1fr)) max-content;
    height: auto;
    min-height: 58px;
    row-gap: 7px;
  }
  #archive-list .record-card.closed-corrective-card { height: auto; min-height: 58px; }
  #archive-view .scheduled-maintenance-card .record-actions,
  #archive-view .closed-corrective-card .record-actions { grid-column: 3; grid-row: 1 / 3; align-self: center; }
  #personnel-management-view .settings-tabs { overflow-x: auto; }
  #personnel-management-view .settings-tab { flex: 0 0 auto; white-space: nowrap; }
}

@media (max-width: 560px) {
  #archive-view .filters { grid-template-columns: 1fr; }
  #archive-view .filters .search-field { grid-column: auto; }
  #archive-view .scheduled-maintenance-card,
  #archive-view .closed-corrective-card,
  #archive-list .record-card.scheduled-maintenance-card,
  #archive-list .record-card.closed-corrective-card { grid-template-columns: minmax(0, 1fr) max-content; }
  #archive-view .scheduled-maintenance-card > div:not(.record-actions),
  #archive-view .closed-corrective-card > div:not(.record-actions) { display: grid; gap: 2px; }
  #archive-view .scheduled-maintenance-card .record-actions,
  #archive-view .closed-corrective-card .record-actions { grid-column: 2; grid-row: 1 / 5; flex-direction: column; }
}

/* Su schermi bassi nessun comando deve restare fuori dall'area raggiungibile. */
@media (min-width: 901px) and (max-height: 800px) {
  .app-header { top: 8px; bottom: 8px; min-height: calc(100dvh - 16px); padding-top: 18px; padding-bottom: 12px; }
  .brand { min-height: 58px; padding-bottom: 12px; }
  .app-header .brand-mark { flex-basis: 46px; width: 46px; height: 46px; }
  .tabs { margin-top: 10px; }
  .tab { height: 38px; min-height: 38px; }
  .session-actions { padding-top: 10px; }
  #scheduled-maintenance-view .scheduled-inline-actions { overflow-y: auto; }
  .operational-summary-dialog-content { min-height: 0; }
}

@media (min-width:901px) {
  #personnel-management-view .maintainer-workspace { grid-template-columns:260px minmax(0,1fr); gap:18px; }
  #personnel-management-view .maintainer-sidebar { border-color:var(--line); border-radius:12px; box-shadow:var(--shadow); }
  #personnel-management-view .maintainer-sidebar-heading { min-height:70px; padding:14px 18px; background:#f6fafb; }
  #personnel-management-view .maintainer-sidebar-heading { padding:13px 20px; }
  #personnel-management-view .workspace-new-maintainer-icon { display:grid; width:40px; height:40px; flex:0 0 40px; place-items:center; border:1px solid #b9dde2 !important; border-radius:6px; color:#00688b !important; background:#e4f5f7 !important; box-shadow:none; }
  #personnel-management-view .workspace-new-maintainer-icon::before,
  #personnel-management-view .workspace-new-maintainer-icon::after { display:none; }
  #personnel-management-view .workspace-new-maintainer-icon svg { display:block; width:20px; height:20px; fill:none !important; stroke:currentColor !important; stroke-width:1.8; stroke-linecap:round; }
  #personnel-management-view .workspace-new-maintainer:hover .workspace-new-maintainer-icon { border-color:#9bcfd6 !important; color:#00688b !important; background:#dff2f5 !important; }
  #personnel-management-view .maintainer-workspace-list { display:grid; align-content:start; gap:7px; padding:10px; border-top:0; }
  #personnel-management-view .maintainer-list-item { min-height:66px; grid-template-columns:40px minmax(0,1fr) 18px; gap:2px 10px; box-sizing:border-box; padding:10px; border:1px solid #dce5e9; border-radius:9px; }
  #personnel-management-view .maintainer-list-item:hover,
  #personnel-management-view .maintainer-list-item.is-selected { border-color:#00688b; background:#eefbfc; }
  #personnel-management-view .maintainer-list-item > .maintainer-list-avatar { width:40px; height:40px; box-sizing:border-box; border:1px solid #b9dde2; border-radius:6px; color:#00688b; background:#e4f5f7; }
  #personnel-management-view .maintainer-detail-summary > span { border:1px solid #b9dde2; border-radius:7px; color:#00688b; background:#e4f5f7; }
  #personnel-management-view .maintainer-detail-summary { min-height:70px; box-sizing:border-box; gap:12px; padding:10px 16px; box-shadow:none; }
  #personnel-management-view .maintainer-detail-summary > span { width:40px; height:40px; padding:0; font-size:14px; }
  #personnel-management-view .maintainer-detail-summary h2 { font-size:20px; line-height:1.1; }
  #personnel-management-view .maintainer-detail-summary p { margin-top:2px; font-size:11px; }
  #personnel-management-view .maintainer-detail-summary,
  #personnel-management-view .maintainer-competency-card,
  #personnel-management-view .maintainer-matrix { background:#fff; }
  #personnel-management-view .maintainer-detail { background:transparent; }
  #personnel-management-view .maintainer-matrix thead th { color:#17445a; border-color:#c8e3e7; background:#e4f5f7; }
  #personnel-management-view .access-hero { min-height:70px; box-sizing:border-box; gap:12px; padding:10px 16px; border-radius:12px; }
  #personnel-management-view .access-hero-icon { width:40px; height:40px; flex-basis:40px; }
  #personnel-management-view .access-hero-icon svg { width:20px; height:20px; }
  #personnel-management-view .access-hero h2 { font-size:20px; line-height:1.1; }
  #personnel-management-view .access-hero p { margin-top:2px; font-size:11px; }
  #personnel-management-view .access-new-user { min-height:34px; font-size:12px; }
  #personnel-management-view .access-users-sidebar header { min-height:70px; padding:13px 20px; }
  #personnel-management-view .access-user-list-item { min-height:66px; }
  #personnel-management-view .access-user-list-item strong { font-size:14px; }
  #personnel-management-view .access-user-list-item small { color:#5c6b72; font-size:12px; font-weight:400; }
  #personnel-management-view .access-hero,
  #personnel-management-view .access-users-sidebar,
  #personnel-management-view .access-editor-empty,
  #personnel-management-view .access-user-card,
  #personnel-management-view .access-permissions-card { border:1px solid #c9d2d6; }
  #personnel-management-view .access-editor-empty,
  #personnel-management-view .access-user-card,
  #personnel-management-view .access-permissions-card { border-radius:12px; }
  #personnel-management-view .access-hero,
  #personnel-management-view .access-user-card { box-shadow:none; }
}

@media (max-width:1000px) {
  #personnel-management-view #personnel-admin-panel { grid-template-columns:1fr; grid-template-rows:auto auto minmax(0,1fr); }
  #personnel-management-view #personnel-admin-panel > .access-hero { grid-column:1; grid-row:1; }
  #personnel-management-view .access-users-sidebar { height:auto; min-height:150px; grid-column:1; grid-row:2; }
  #personnel-management-view #personnel-admin-panel > .account-access-form,
  #personnel-management-view #personnel-admin-panel > .access-editor-empty { grid-column:1; grid-row:3; }
}

@media (max-width:900px) {
  #personnel-management-view .access-user-card,
  #personnel-management-view .access-user-card.is-editing { grid-template-columns:50px minmax(0,1fr); }
  #personnel-management-view .access-user-card .access-account-toggles { grid-column:1/-1; flex-wrap:wrap; }
  #personnel-management-view .access-user-card > label,
  #personnel-management-view .access-user-card .access-active-field,
  #personnel-management-view .access-user-card .access-role-field,
  #personnel-management-view .access-user-card .access-password-field,
  #personnel-management-view .access-user-card .access-username-field { grid-column:1/-1; }
  #personnel-management-view .access-permissions-card { grid-template-columns:1fr; grid-template-rows:auto; }
  #personnel-management-view .access-permission-column { border-right:0; border-bottom:1px solid #e1e7eb; overflow:visible; }
  #personnel-management-view .access-permissions-card footer { grid-column:1; }
}

@media (max-width:700px) {
  #personnel-management-view .access-users-side-list { grid-template-columns:1fr; }
}

#personnel-management-view .personnel-layout,
#personnel-management-view #personnel-admin-panel,
#personnel-management-view .maintainer-workspace,
#personnel-management-view .maintainer-detail {
  background-color:#eef2f3;
  background-image:none;
}
#personnel-management-view .maintainer-detail { gap:16px; background-color:#eef2f3; }
#personnel-management-view .email-notifications-grid { grid-template-columns:260px minmax(0,1fr); gap:18px; }
#personnel-management-view .email-recipients-card { width:260px; min-width:260px; }
#personnel-management-view .email-notifications-card { min-height:0; height:100%; border-color:var(--line); border-radius:12px; box-shadow:var(--shadow); }
#personnel-management-view .email-recipients-card { display:flex; flex-direction:column; }
#personnel-management-view .email-recipients-card .email-card-heading { min-height:70px; box-sizing:border-box; padding:14px 18px; background:#f6fafb; }
#personnel-management-view .email-recipient-add { display:flex; width:100%; min-height:40px; align-items:center; gap:10px; padding:0; border:0; border-radius:0; color:#26343a; background:transparent; box-shadow:none; font:inherit; font-size:14px; font-weight:800; text-align:left; cursor:pointer; }
#personnel-management-view .email-recipient-add .email-card-heading-icon { width:40px; height:40px; flex:0 0 40px; border-radius:6px; color:#00688b; background:#e4f5f7; }
#personnel-management-view .email-recipient-add .email-card-heading-icon svg { width:20px; height:20px; stroke-width:1.8; }
#personnel-management-view .email-recipient-add:hover { color:#00688b; background:transparent; }
#personnel-management-view .email-recipient-add:hover .email-card-heading-icon { border-color:#9bcfd6; background:#dff2f5; }
#personnel-management-view .email-recipients-card .email-card-body { display:flex; min-height:0; flex:1; flex-direction:column; padding:10px; }
#personnel-management-view .email-recipients-card .email-recipient-form { grid-template-columns:1fr; gap:8px; margin:0 0 10px; }
#personnel-management-view .email-recipients-card .email-recipient-list { display:grid; align-content:start; flex:1; gap:7px; overflow:auto; border:0; border-radius:0; }
#personnel-management-view .email-recipients-card .email-recipient-row { min-height:66px; box-sizing:border-box; padding:10px; border:1px solid #dce5e9; border-radius:9px; }
#personnel-management-view .email-recipients-card .email-recipient-avatar { width:40px; height:40px; flex:0 0 40px; border-radius:6px; color:#00688b; background:#e4f5f7; }
#personnel-management-view .email-recipients-card .email-recipient-delete { width:30px; height:30px; flex:0 0 30px; font-size:20px; }
#personnel-management-view .email-recipients-card .email-recipient-row { width:100%; color:#26343a; text-align:left; cursor:pointer; }
#personnel-management-view .email-recipients-card .email-recipient-row.is-selected { border-color:#00688b; background:#eefbfc; }
#personnel-management-view .email-recipients-footer { flex:0 0 auto; margin-top:auto; padding:16px; border-top:1px solid #d5dde0; background:#fff; }
#personnel-management-view .email-recipient-delete-sidebar { display:inline-flex; min-height:40px; align-items:center; padding:0; border:0; color:#20282d; background:transparent; box-shadow:none; font:inherit; cursor:pointer; }
#personnel-management-view .email-recipient-delete-sidebar > span { display:grid; width:40px; height:40px; margin-right:9px; place-items:center; border:1px solid #dfb6b2; border-radius:6px; color:#94372f; background:#f9e9e7; }
#personnel-management-view .email-recipient-delete-sidebar svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
#personnel-management-view .email-recipient-delete-sidebar:hover:not(:disabled) { color:#20282d; background:transparent; }
#personnel-management-view .email-recipient-delete-sidebar:hover:not(:disabled) > span { border-color:#c57f78; color:#7f2b25; background:#f5d9d5; }
#personnel-management-view .email-recipient-delete-sidebar:disabled { color:#20282d; cursor:not-allowed; opacity:.55; }
#personnel-management-view .email-events-card .email-card-heading { min-height:70px; box-sizing:border-box; padding:14px 18px; background:#f6fafb; }
#personnel-management-view .email-events-card .email-card-heading-icon { width:40px; height:40px; flex:0 0 40px; border-radius:6px; color:#00688b; background:#e4f5f7; }
#personnel-management-view .email-events-card .email-event-list { padding:0 20px; }
#personnel-management-view .email-events-card .email-notifications-actions { padding:16px; }
#personnel-management-view .email-events-card .email-notifications-actions .button { min-width:112px; min-height:39px; padding:9px 18px; font-size:14px; font-weight:700; }
#personnel-management-view .email-events-card { overflow:hidden; }
#personnel-management-view .email-configuration-body { min-height:0; flex:1; overflow:auto; }
#personnel-management-view .email-recipient-editor { padding:14px 20px; border-bottom:1px solid #e1e7eb; background:#fbfcfd; }
#personnel-management-view .email-recipient-editor h3,#personnel-management-view .email-template-editor h3 { margin:0; color:#183553; font-size:14px; }
#personnel-management-view .email-recipient-editor p,#personnel-management-view .email-template-editor p { margin:3px 0 9px; color:#6a7b90; font-size:11px; }
#personnel-management-view .email-recipient-editor .email-recipient-form { grid-template-columns:minmax(150px,.7fr) minmax(220px,1fr) auto; margin:0; }
#personnel-management-view .email-recipient-editor .button { min-height:34px; padding:7px 14px; font-size:12px; }
#personnel-management-view .email-input-with-icon { position:relative; display:block; min-width:0; }
#personnel-management-view .email-input-with-icon svg { position:absolute; z-index:1; top:50%; left:12px; width:18px; height:18px; color:#657b90; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; transform:translateY(-50%); pointer-events:none; }
#personnel-management-view .email-input-with-icon input { padding-left:40px; }
#personnel-management-view .email-template-editor { display:grid; grid-template-columns:minmax(210px,.45fr) minmax(180px,.55fr) minmax(300px,1fr); gap:10px 14px; align-items:start; padding:14px 20px; border-top:1px solid #e1e7eb; background:#fbfcfd; }
#personnel-management-view .email-template-editor label { display:grid; gap:4px; color:#44576d; font-size:10px; font-weight:800; text-transform:uppercase; }
#personnel-management-view .email-template-editor input,#personnel-management-view .email-template-editor textarea { box-sizing:border-box; width:100%; border:1px solid #ccd8df; border-radius:5px; padding:7px 9px; color:#17304e; background:#fff; font:inherit; font-size:12px; }
#personnel-management-view .email-template-editor textarea { min-height:98px; resize:vertical; line-height:1.35; }
#personnel-management-view .email-template-editor code { padding:1px 3px; border-radius:3px; color:#00688b; background:#e5f4f6; font-family:inherit; }
#personnel-management-view .email-template-variables { display:flex; flex-wrap:wrap; gap:7px; margin-top:8px; }
#personnel-management-view .email-template-variables button { padding:4px 8px; border:0; border-radius:5px; color:#00688b; background:#e4f5f7; font:inherit; font-size:11px; font-weight:700; cursor:pointer; }
#personnel-management-view .email-template-preview { padding:12px; border:1px solid #d7e7ea; border-radius:8px; background:#f3fafb; }
#personnel-management-view .email-template-preview h3 { margin:0 0 4px; font-size:13px; }
#personnel-management-view .email-template-preview p { margin:0 0 6px; padding-bottom:6px; border-bottom:1px solid #d7e7ea; color:#29465f; font-size:11px; font-weight:700; }
#personnel-management-view .email-template-preview pre { margin:0; color:#385069; white-space:pre-wrap; font:inherit; font-size:11px; line-height:1.35; }
#personnel-management-view .email-configuration-body { display:grid; grid-template-columns:minmax(420px,.95fr) minmax(470px,1.05fr); grid-template-rows:auto minmax(0,1fr); gap:0 20px; padding:0 20px; }
#personnel-management-view .email-recipient-editor { grid-column:1; grid-row:1; padding:14px 0; }
#personnel-management-view .email-configuration-body > .email-event-list { grid-column:1; grid-row:2; align-content:start; padding:0; border-top:1px solid #e1e7eb; border-left:0; }
#personnel-management-view .email-event-row { min-height:48px; padding-left:0; }
#personnel-management-view .email-event-copy { display:flex; min-width:0; align-items:center; gap:14px; }
#personnel-management-view .email-event-copy > span:last-child { display:grid; gap:3px; }
#personnel-management-view .email-event-copy b { color:#102950; font-size:14px; }
#personnel-management-view .email-event-copy small { color:#61718a; font-size:12px; font-weight:500; }
#personnel-management-view .email-event-icon { display:none; }
#personnel-management-view .email-event-copy small { display:none; }
#personnel-management-view .email-template-editor { grid-column:2; grid-row:1 / span 2; display:grid; grid-template-columns:1fr; align-content:start; padding:14px 0; border-top:0; background:transparent; }
#personnel-management-view > .email-notifications-panel:not([hidden]) { display:grid; height:100%; grid-template-columns:260px minmax(0,1fr); grid-template-rows:auto minmax(0,1fr); gap:16px; box-sizing:border-box; }
#personnel-management-view .email-notifications-panel > .email-notifications-heading { grid-column:2; grid-row:1; margin:0; }
#personnel-management-view .email-notifications-panel > .email-notifications-grid { display:contents; }
#personnel-management-view .email-notifications-panel .email-recipients-card { grid-column:1; grid-row:1 / span 2; width:auto; min-width:0; }
#personnel-management-view .email-notifications-panel .email-events-card { grid-column:2; grid-row:2; }
#personnel-management-view > .email-notifications-panel:not([hidden]) { grid-template-rows:minmax(0,1fr); }
#personnel-management-view .email-notifications-panel > .email-notifications-heading { display:none; }
#personnel-management-view .email-notifications-panel .email-recipients-card { grid-row:1; }
#personnel-management-view .email-notifications-panel .email-events-card { grid-row:1; }
#personnel-management-view .email-events-history-shortcut { display:grid; width:40px; height:40px; flex:0 0 40px; place-items:center; border:1px solid #b9dde2; border-radius:6px; color:#00688b; background:#e4f5f7; cursor:pointer; }
#personnel-management-view .email-events-history-shortcut svg { width:21px; height:21px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
#personnel-management-view .email-events-card { overflow:visible; border:0; background:transparent; box-shadow:none; }
#personnel-management-view .email-events-card > .email-card-heading { height:70px; min-height:70px; box-sizing:border-box; margin:0 0 20px; padding:10px 16px; border:1px solid var(--line); border-radius:12px; background:#f6fafb; box-shadow:var(--shadow); }
#personnel-management-view .email-events-card > .email-configuration-body { overflow:auto; border:1px solid var(--line); border-radius:12px; background:#fff; box-shadow:var(--shadow); }
#personnel-management-view .email-events-card > .email-configuration-body[hidden] { display:none; }
#personnel-management-view .email-notifications-empty-editor { display:grid; min-height:230px; flex:1; box-sizing:border-box; place-content:center; justify-items:center; gap:8px; padding:32px; border:1px solid var(--line); border-radius:12px; color:#66778f; background:#fff; box-shadow:var(--shadow); text-align:center; }
#personnel-management-view .email-notifications-empty-editor[hidden] { display:none; }
#personnel-management-view .email-notifications-empty-editor > span { display:grid; width:48px; height:48px; place-items:center; border:1px solid #b9dde2; border-radius:7px; color:#00688b; background:#e4f5f7; }
#personnel-management-view .email-notifications-empty-editor svg { width:24px; height:24px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
#personnel-management-view .email-notifications-empty-editor h2 { margin:4px 0 0; color:#173a50; font-size:20px; }
#personnel-management-view .email-notifications-empty-editor p { max-width:430px; margin:0; font-size:12px; line-height:1.5; }
#personnel-management-view .email-events-card > .email-configuration-body { grid-template-columns:minmax(380px,.82fr) minmax(480px,1.18fr); grid-template-rows:minmax(0,1fr); gap:16px; overflow:visible; padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; }
#personnel-management-view .email-recipient-events-card { display:flex; min-height:0; grid-column:1; grid-row:1; flex-direction:column; overflow:auto; border:1px solid var(--line); border-radius:12px; background:#fff; box-shadow:var(--shadow); }
#personnel-management-view .email-recipient-events-card .email-recipient-editor { padding:11px 20px; border:0; border-bottom:1px solid #e1e7eb; border-radius:0; box-shadow:none; }
#personnel-management-view .email-recipient-events-card .email-event-list { display:grid; align-content:start; padding:0 20px; border:0; }
#personnel-management-view .email-recipient-events-card .email-event-row { min-height:70px; padding-left:0; }
#personnel-management-view .email-recipient-events-card .email-event-icon { display:grid; width:42px; height:42px; flex:0 0 42px; place-items:center; border-radius:50%; color:#00688b; background:#f0f8fa; }
#personnel-management-view .email-recipient-events-card .email-event-icon svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
#personnel-management-view .email-recipient-events-card .email-event-copy { gap:12px; }
#personnel-management-view .email-recipient-events-card .email-event-copy b { font-size:13px; }
#personnel-management-view .email-recipient-events-card .email-event-copy small { font-size:11px; }
#personnel-management-view .email-recipient-events-card .email-event-copy small { display:block; }
#personnel-management-view .email-recipient-events-card .email-notifications-actions { display:flex; justify-content:flex-end; margin-top:auto; padding:12px 16px; border-top:1px solid #e1e7eb; background:#fff; }
#personnel-management-view .email-template-editor { min-height:0; grid-column:2; grid-row:1; align-content:start; padding:14px 20px; overflow:auto; border:1px solid var(--line); border-radius:12px; background:#fff; box-shadow:var(--shadow); }
#personnel-management-view .email-template-editor { grid-template-rows:auto auto minmax(0,1fr) minmax(0,1fr); gap:12px; overflow:hidden; }
#personnel-management-view .email-template-editor > label { padding:9px 10px; border:1px solid #d7e2e7; border-radius:8px; background:#fff; }
#personnel-management-view .email-template-editor > label:first-of-type { min-height:48px; box-sizing:border-box; grid-template-columns:70px minmax(0,1fr); align-items:center; padding:6px 10px; }
#personnel-management-view .email-template-editor > label:first-of-type input { padding:0 0 0 8px; }
#personnel-management-view .email-template-editor > label input,#personnel-management-view .email-template-editor > label textarea { border:0; border-radius:0; padding:5px 0 0; background:transparent; }
#personnel-management-view .email-template-editor > label:nth-of-type(2) { min-height:0; grid-template-rows:auto minmax(0,1fr); }
#personnel-management-view .email-template-editor > label:nth-of-type(2),
#personnel-management-view .email-template-preview { height:100%; min-height:0; box-sizing:border-box; align-self:stretch; }
#personnel-management-view .email-template-editor textarea { min-height:0; height:100%; resize:none; }
#personnel-management-view .email-template-preview { min-height:0; overflow:auto; padding:12px; border-color:#cfe4e8; background:#f3fafb; }
#personnel-management-view .email-template-preview h3 { display:flex; align-items:center; gap:9px; }
#personnel-management-view .email-template-preview h3::before { display:grid; width:30px; height:30px; place-items:center; border:1px solid #b9dde2; border-radius:6px; color:#00688b; background:#e4f5f7; font-size:17px; content:"✉"; }
#personnel-management-view .email-template-preview pre { font-size:10px; line-height:1.25; }
#personnel-management-view .maintainer-workspace-empty { display:grid; min-height:230px; height:100%; box-sizing:border-box; place-content:center; justify-items:center; gap:8px; margin:0; padding:32px; border:1px solid var(--line); border-radius:12px; color:#66778f; background:#fff; box-shadow:var(--shadow); text-align:center; }
#personnel-management-view .maintainer-workspace-empty-icon { display:grid; width:48px; height:48px; place-items:center; border:1px solid #b9dde2; border-radius:7px; color:#00688b; background:#e4f5f7; }
#personnel-management-view .maintainer-workspace-empty-icon svg { width:24px; height:24px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; }
#personnel-management-view .maintainer-detail-summary > span > svg { width:24px; height:24px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; }
#personnel-management-view .maintainer-workspace-empty h2 { margin:4px 0 0; color:#173a50; font-size:20px; }
#personnel-management-view .maintainer-workspace-empty p { max-width:430px; margin:0; font-size:12px; line-height:1.5; }
#personnel-management-view #maintainer-detail > .maintainer-matrix { margin:0; overflow:auto; border:0; border-radius:0; box-shadow:none; }
#personnel-management-view #maintainer-detail > .maintainer-matrix th,
#personnel-management-view #maintainer-detail > .maintainer-matrix td { height:28px !important; min-height:0 !important; padding:2px 7px !important; line-height:1; }
#personnel-management-view #maintainer-detail > .maintainer-matrix thead th { height:28px !important; font-size:10px; }
#personnel-management-view #maintainer-detail > .maintainer-matrix tbody th { min-width:230px; font-size:12px; }
#personnel-management-view #maintainer-detail > .maintainer-matrix .matrix-check { width:20px; height:20px; font-size:13px; }
#personnel-management-view #maintainer-detail .maintainer-matrix table { height:auto !important; }
#personnel-management-view #maintainer-detail .maintainer-matrix tbody tr { height:28px !important; min-height:28px !important; }
#personnel-management-view #maintainer-detail .maintainer-matrix tbody tr > th,
#personnel-management-view #maintainer-detail .maintainer-matrix tbody tr > td { height:28px !important; min-height:28px !important; padding-top:2px !important; padding-bottom:2px !important; }
#personnel-management-view .maintainer-editor-card { display:flex; min-height:0; flex:1; flex-direction:column; gap:16px; overflow:visible; border:0; background:transparent; box-shadow:none; }
#personnel-management-view #maintainer-detail > .maintainer-editor-card #user-access-form { min-height:168px; margin:0; border:1px solid var(--line); border-radius:12px; background:#fff; box-shadow:var(--shadow); }
#personnel-management-view #maintainer-detail #user-access-form .maintainer-profile-summary { display:none; }
#personnel-management-view #maintainer-detail #user-access-form .maintainer-profile-card { margin:0; border:0; border-radius:12px; background:#fff; box-shadow:none; }
#personnel-management-view #maintainer-detail #user-access-form .maintainer-profile-card > .personnel-data-grid { display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:8px 12px; padding:12px 14px; }
#personnel-management-view #maintainer-detail #user-access-form .personnel-data-grid label { gap:3px; font-size:10px; }
#personnel-management-view #maintainer-detail #user-access-form .personnel-data-grid input { min-height:32px; padding:5px 7px; font-size:12px; }
#personnel-management-view #maintainer-detail #user-access-form .maintainer-profile-card .access-enabled-field:has(input[name="monitorCompetencyExpiry"]) { display:flex; min-height:32px; }
#personnel-management-view #maintainer-detail #user-access-form .competency-expiry-section { display:none; }
#personnel-management-view #maintainer-detail #user-access-form > .personnel-inline-actions { justify-content:flex-end; margin:0; padding:12px 16px; border-top:1px solid #d5dde0; }
#personnel-management-view #maintainer-detail #user-access-form > .personnel-inline-actions .button { min-width:112px; min-height:39px; font-size:14px; }
#personnel-management-view .maintainer-editor-card .maintainer-matrix { margin:0; border:0; border-radius:0; box-shadow:none; }
#personnel-management-view .maintainer-editor-card .maintainer-matrix th,
#personnel-management-view .maintainer-editor-card .maintainer-matrix td { height:28px !important; min-height:0 !important; padding:2px 7px !important; line-height:1; }
#personnel-management-view .maintainer-editor-card .maintainer-matrix thead th { height:28px; font-size:10px; }
#personnel-management-view .maintainer-editor-card .maintainer-matrix tbody th { min-width:230px; font-size:12px; }
#personnel-management-view .maintainer-editor-card .maintainer-matrix input[type="date"] { min-height:27px; padding:3px 5px; font-size:11px; }
#personnel-management-view .maintainer-editor-card .workspace-check,
#personnel-management-view .maintainer-editor-card .workspace-check span { width:20px !important; height:20px !important; font-size:13px; }

#personnel-management-view .access-users-sidebar .access-new-user-sidebar { display:flex; width:100%; min-height:40px; align-items:center; justify-content:flex-start; gap:10px; padding:0; border:0; border-radius:0; color:#26343a; background:transparent; box-shadow:none; font:inherit; font-size:14px; font-weight:800; line-height:1; text-align:left; white-space:nowrap; cursor:pointer; }
#personnel-management-view .access-users-sidebar .access-new-user-sidebar > span:last-child { margin:0; color:#26343a; font-size:14px; font-weight:800; line-height:1; }
#personnel-management-view .access-users-sidebar .access-new-user-sidebar:hover { color:#00688b; background:transparent; }
#personnel-management-view .access-users-sidebar .access-new-user-sidebar:hover .access-users-sidebar-icon { border-color:#9bcfd6; color:#00688b; background:#dff2f5; }
#personnel-management-view .access-editor-empty-icon { border:1px solid #b9dde2; border-radius:7px; }
#personnel-management-view .maintainer-workspace-empty-icon,
#personnel-management-view .fleet-registry-empty-icon,
#personnel-management-view .email-notifications-empty-editor > span { width:58px; height:58px; border-radius:7px; }
#personnel-management-view .maintainer-workspace-empty-icon svg,
#personnel-management-view .email-notifications-empty-editor svg { width:30px; height:30px; }
#personnel-management-view .fleet-registry-empty-icon img { width:30px; height:30px; }

/* Allineamento finale Agenda manutentiva. */
#maintenance-agenda-view { padding-bottom: 0; }
#maintenance-agenda-view .agenda-layout { grid-template-columns: minmax(0, 1fr) 500px; }
@media (max-width:1100px) { #maintenance-agenda-view .agenda-layout { grid-template-columns: 1fr; } }

/* Calendario e dettaglio: una sola finestra con divisore interno. */
#maintenance-agenda-view .agenda-layout { gap: 0; overflow: hidden; border: 1px solid #dbe5e8; border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
#maintenance-agenda-view .agenda-calendar-shell { border: 0; border-radius: 0; box-shadow: none; }
#maintenance-agenda-view .agenda-day-detail { border: 0; border-left: 1px solid #dbe5e8; border-radius: 0; box-shadow: none; }
@media (max-width:1100px) { #maintenance-agenda-view .agenda-day-detail { border-top: 1px solid #dbe5e8; border-left: 0; } }
#maintenance-agenda-view .forecast-calendar-day.is-adjacent-month { background: #fafcfc; }
#maintenance-agenda-view .forecast-calendar-day.is-adjacent-month { display:block; cursor:pointer; }
#maintenance-agenda-view .forecast-calendar-day.is-adjacent-month { background:#eef2f3; }
#maintenance-agenda-view .forecast-calendar-date.is-adjacent-month { color:#7d9098; background:#e1e8ea; }
#alerts-view .forecast-calendar-day.is-adjacent-month { background:#eef2f3; }
#alerts-view .forecast-calendar-day { min-height:56px; }
#alerts-view .forecast-calendar-date.is-adjacent-month { color:#7d9098; background:#e1e8ea; }
#alerts-view .alerts-calendar-panel { position:relative; }
#alerts-view .alerts-dashboard { grid-template-columns:270px minmax(280px, .50fr) minmax(400px, .75fr) minmax(608px, 1fr); }
#alerts-view .forecast-calendar-day:nth-child(7n + 6) .forecast-calendar-date { color:#007b9f; } #alerts-view .forecast-calendar-day:nth-child(7n + 7) .forecast-calendar-date { color:#cf3f4a; } #alerts-view .forecast-calendar-day.is-adjacent-month .forecast-calendar-date { color:#7d9098; }
#alerts-view .forecast-calendar-count { display:inline-flex; width:max-content; max-width:calc(100% - 6px); margin:7px 5px 0; padding:6px 12px; align-items:center; border:0; border-radius:5px; color:#263c45; background:#fff0dc; font:inherit; font-size:11px; font-weight:800; line-height:1.1; white-space:nowrap; cursor:pointer; } #alerts-view .forecast-calendar-count.is-warning { color:#216844; background:#e4f3e9; } #alerts-view .forecast-calendar-count.is-overdue { color:#a6303d; background:#ffebed; }
#alerts-view .forecast-calendar-day.is-selected { z-index:2; box-shadow:inset 0 0 0 2px #1684d5; }
#alerts-view .dashboard-calendar-popover { position:absolute; z-index:8; top:74px; right:18px; width:235px; padding:13px; border:1px solid #d7e3e7; border-radius:8px; background:#fff; box-shadow:0 8px 22px rgba(27,55,65,.18); } #alerts-view .dashboard-calendar-popover > button { position:absolute; top:7px; right:8px; border:0; background:transparent; font-size:22px; cursor:pointer; } #alerts-view .dashboard-calendar-popover h3 { margin:0 24px 10px 0; font-size:13px; } .dashboard-calendar-popover-event { display:grid; grid-template-columns:8px 1fr auto; gap:6px; align-items:center; font-size:10px; }.dashboard-calendar-popover-event i { width:8px; height:8px; border-radius:50%; background:#f08b17; }.dashboard-calendar-popover-event.is-warning i { background:#36a767; }.dashboard-calendar-popover-event.is-overdue i { background:#db4450; }.dashboard-calendar-popover-event em { padding:3px 5px; border-radius:3px; color:#b75f0a; background:#fff0dc; font-size:8px; font-style:normal; font-weight:800; }.dashboard-calendar-popover-event.is-warning em { color:#216844; background:#e4f3e9; }.dashboard-calendar-popover-event.is-overdue em { color:#a6303d; background:#ffebed; }
#alerts-view .dashboard-calendar-popover { top:auto !important; bottom:12px; }
#alerts-view .dashboard-calendar-popover-event { display:none; } #alerts-view .dashboard-calendar-popover-event.is-current { display:block; }
#alerts-view .dashboard-calendar-popover .dashboard-calendar-popover-event { display:none !important; } #alerts-view .dashboard-calendar-popover .dashboard-calendar-popover-event.is-current { display:block !important; }
#alerts-view .dashboard-calendar-popover-event small { grid-column:2 / -1; color:#657983; font-size:9px; } #alerts-view .dashboard-calendar-popover-event small b { color:#263c45; } #alerts-view .dashboard-open-agenda { position:static; width:100%; margin-top:10px; padding:7px; border:1px solid #007b9f; border-radius:5px; color:#007b9f; background:#fff; font:inherit; font-size:11px; font-weight:800; cursor:pointer; } #alerts-view .calendar-expand-button { width:auto; gap:5px; padding:0 7px; } #alerts-view .calendar-expand-button span { font-size:10px; font-weight:800; }
#alerts-view .alerts-calendar-panel .calendar-expand-button { display:inline-flex; width:auto; height:26px; padding:0 8px; align-items:center; gap:6px; white-space:nowrap; } #alerts-view .alerts-calendar-panel .calendar-expand-button svg { width:14px; height:14px; } #alerts-view .alerts-calendar-panel .calendar-expand-button span { font-size:10px; font-weight:800; } #alerts-view .dashboard-calendar-popover .dashboard-open-agenda { position:static !important; top:auto; right:auto; display:block; width:100%; height:auto; margin-top:10px; padding:7px; color:#007b9f; background:#fff; font-size:11px; line-height:1.2; } #alerts-view .dashboard-calendar-popover > button:first-child { position:absolute; top:7px; right:8px; width:auto; height:auto; padding:0; }
#alerts-view .alerts-circulation-panel > .alerts-dashboard-heading,
#alerts-view .alerts-depot-panel > .alerts-dashboard-heading,
#alerts-view .alerts-calendar-panel > .alerts-dashboard-heading { box-sizing:border-box; height:40px; min-height:40px; padding-top:0; padding-bottom:0; }
#alerts-view .alerts-calendar-panel > .alerts-dashboard-heading { padding-right:10px; padding-left:10px; }
#alerts-view .alerts-calendar-panel .calendar-header-navigation { grid-template-columns:28px 160px 28px; gap:10px; }
#alerts-view .alerts-calendar-panel .calendar-header-navigation strong { min-width:160px; font-size:14px; }
#alerts-view .alerts-calendar-panel .calendar-header-navigation .forecast-calendar-nav { width:28px; height:28px; font-size:22px; }
#alerts-view .alerts-calendar-panel #open-forecast-calendar-dialog { height:28px; padding:0 4px; }
#alerts-view .alerts-calendar-panel #open-forecast-calendar-dialog svg { width:22px; height:22px; }
#alerts-view .alerts-calendar-panel #open-forecast-calendar-dialog span { font-size:12px; }
#alerts-view .alerts-calendar-panel #open-forecast-calendar-dialog:hover,
#alerts-view .alerts-calendar-panel #open-forecast-calendar-dialog:focus-visible { color:#fff; background:rgba(255,255,255,.14); outline:0; }
#alerts-view .alerts-calendar-panel #open-forecast-calendar-dialog { height:22px; padding:0 2px; border:0; border-radius:0; background:transparent; box-shadow:none; }
#alerts-view .dashboard-calendar-popover { width:340px; padding:18px; } #alerts-view .dashboard-calendar-popover h3 { margin-bottom:16px; font-size:17px; } #alerts-view .dashboard-calendar-popover-event { display:block; font-size:12px; } #alerts-view .popover-train { display:grid; grid-template-columns:12px minmax(0,1fr) auto; gap:8px; align-items:center; } #alerts-view .popover-train i { width:12px; height:12px; } #alerts-view .popover-train strong { font-size:17px; } #alerts-view .popover-train b { color:#007b9f; font-size:13px; } #alerts-view .dashboard-calendar-popover-event p { margin:7px 0 12px 20px; color:#263c45; font-size:13px; } #alerts-view .dashboard-calendar-popover-event dl { margin:0; border-top:1px solid #d9e3e6; } #alerts-view .dashboard-calendar-popover-event dl div { display:grid; grid-template-columns:1fr auto; padding:7px 0; border-bottom:1px solid #d9e3e6; } #alerts-view .dashboard-calendar-popover-event dt { color:#526a74; } #alerts-view .dashboard-calendar-popover-event dd { margin:0; color:#1f3540; font-weight:800; } #alerts-view .dashboard-calendar-popover-event em { display:inline-block; margin-top:12px; font-size:10px; }
#alerts-view .dashboard-calendar-popover-nav { display:flex; align-items:center; justify-content:center; gap:14px; margin-top:14px; color:#31515e; font-size:12px; font-weight:800; } #alerts-view .dashboard-calendar-popover-nav button { position:static !important; display:grid; width:28px !important; height:28px !important; padding:0 !important; place-items:center; border:1px solid #a9c7d2 !important; border-radius:5px; color:#007b9f; background:#fff; font-size:20px !important; cursor:pointer; } #alerts-view .dashboard-calendar-popover-nav button:disabled { opacity:.35; cursor:default; }
#alerts-view .dashboard-calendar-popover { box-sizing:border-box; max-height:none !important; overflow:visible !important; padding:16px 18px 18px; }
#alerts-view .dashboard-calendar-popover h3 { margin:0 28px 14px 0; }
#alerts-view .dashboard-calendar-popover-event p { margin:8px 0 12px 20px; }
#alerts-view .dashboard-calendar-popover-event dl div { padding:8px 0; }
#alerts-view .dashboard-calendar-popover-nav { margin:16px 0 2px; }
#alerts-view .alerts-forecast-panel .fleet-alert-list { overflow:hidden; }
#alerts-view .alerts-forecast-panel .fleet-alert-table th,
#alerts-view .alerts-forecast-panel .fleet-alert-table td { padding-top:10px; padding-bottom:10px; }
#alerts-view .alerts-forecast-panel .fleet-alert-table { width:100%; table-layout:fixed; font-size:11px; }
#alerts-view .alerts-forecast-panel .fleet-alert-table th { white-space:normal; line-height:1.15; }
#alerts-view .alerts-forecast-panel .fleet-alert-table th:nth-child(1), #alerts-view .alerts-forecast-panel .fleet-alert-table td:nth-child(1) { width:2.5%; }
#alerts-view .alerts-forecast-panel .fleet-alert-table th:nth-child(2), #alerts-view .alerts-forecast-panel .fleet-alert-table td:nth-child(2) { width:3%; }
#alerts-view .alerts-forecast-panel .fleet-alert-table th:nth-child(3), #alerts-view .alerts-forecast-panel .fleet-alert-table td:nth-child(3) { width:6%; }
#alerts-view .alerts-forecast-panel .fleet-alert-table th:nth-child(4), #alerts-view .alerts-forecast-panel .fleet-alert-table td:nth-child(4) { width:5%; }
#alerts-view .alerts-forecast-panel .fleet-alert-table th:nth-child(5), #alerts-view .alerts-forecast-panel .fleet-alert-table td:nth-child(5) { width:10%; }
#alerts-view .alerts-forecast-panel .fleet-alert-table th:nth-child(6), #alerts-view .alerts-forecast-panel .fleet-alert-table td:nth-child(6) { width:9%; }
#alerts-view .alerts-forecast-panel .fleet-alert-table th:nth-child(7), #alerts-view .alerts-forecast-panel .fleet-alert-table td:nth-child(7) { width:7%; }
#alerts-view .alerts-forecast-panel .fleet-alert-table th:nth-child(8), #alerts-view .alerts-forecast-panel .fleet-alert-table td:nth-child(8) { width:9%; }
#alerts-view .alerts-forecast-panel .fleet-alert-table th:nth-child(9), #alerts-view .alerts-forecast-panel .fleet-alert-table td:nth-child(9) { width:10%; }
#alerts-view .alerts-forecast-panel .fleet-alert-table th:nth-child(10), #alerts-view .alerts-forecast-panel .fleet-alert-table td:nth-child(10) { width:10%; }
#alerts-view .alerts-forecast-panel .fleet-alert-table th:nth-child(11), #alerts-view .alerts-forecast-panel .fleet-alert-table td:nth-child(11) { width:9%; }
#alerts-view .alerts-forecast-panel .fleet-alert-table th:nth-child(12), #alerts-view .alerts-forecast-panel .fleet-alert-table td:nth-child(12) { width:9%; }
#alerts-view .alerts-forecast-panel .fleet-alert-table th:nth-child(13), #alerts-view .alerts-forecast-panel .fleet-alert-table td:nth-child(13) { width:10.5%; }
#maintenance-agenda-view .agenda-event-card.is-warning i { background:#36a767; }
#maintenance-agenda-view .agenda-event-card.is-warning em { color:#216844; background:#e4f3e9; }
#maintenance-agenda-view .agenda-event-metrics { grid-column:1 / -1; margin:8px 0 0; border-top:1px solid #dce6e9; }
#maintenance-agenda-view .agenda-event-metrics div { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; padding:5px 0; border-bottom:1px solid #e5ecee; }
#maintenance-agenda-view .agenda-event-metrics div:last-child { border-bottom:0; }
#maintenance-agenda-view .agenda-event-metrics dt { color:#607782; font-size:10px; font-weight:650; }
#maintenance-agenda-view .agenda-event-metrics dd { margin:0; color:#263c45; font-size:10px; font-weight:800; text-align:right; }
#maintenance-agenda-view .agenda-day-detail { overflow-y:auto; overscroll-behavior:contain; }
#maintenance-agenda-view .agenda-notes-list { height:246px; overflow-y:auto; overscroll-behavior:contain; padding-right:5px; scrollbar-color:#a9c7d2 transparent; scrollbar-width:thin; }
#maintenance-agenda-view .agenda-notes-list:empty { height:0; }
#maintenance-agenda-view .agenda-notes-list::-webkit-scrollbar { width:7px; }
#maintenance-agenda-view .agenda-notes-list::-webkit-scrollbar-thumb { border-radius:8px; background:#c8dce2; }
#maintenance-agenda-view .agenda-notes-list .agenda-empty-note { margin:0; }
#maintenance-agenda-view .agenda-notes-list .agenda-note-card { min-height:74px; box-sizing:border-box; }
#maintenance-agenda-view .agenda-notes > label { flex:0 0 auto; }
#maintenance-agenda-view #agenda-selected-day { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:26px; }
#maintenance-agenda-view #agenda-selected-day .agenda-day-count { display:inline-grid; min-width:26px; height:26px; padding:0 7px; place-items:center; border-radius:7px; color:#31708a; background:#eaf4f7; font-size:14px; font-weight:800; line-height:1; }
#maintenance-agenda-view .agenda-toolbar { grid-template-columns:1fr; }
#maintenance-agenda-view .agenda-toolbar-spacer { display:none; }
#maintenance-agenda-view .agenda-month { justify-content:center; width:100%; }
#maintenance-agenda-view #agenda-month-title { display:block; min-width:190px; color:#263c45; font-size:16px; font-weight:800; text-align:center; text-transform:capitalize; }
#maintenance-agenda-view .agenda-calendar .forecast-calendar-grid.is-week-view { grid-template-rows:36px minmax(0,1fr); grid-auto-rows:auto; min-height:0; }
#maintenance-agenda-view .agenda-calendar .forecast-calendar-grid.is-week-view .forecast-calendar-day[hidden] { display:none !important; }
#maintenance-agenda-view .agenda-calendar .forecast-calendar-grid.is-week-view .forecast-calendar-day { min-height:520px; overflow:hidden; }
#maintenance-agenda-view .agenda-week-time { position:absolute; top:10px; right:10px; color:#6b7f87; font-size:11px; font-weight:800; }
#maintenance-agenda-view .forecast-calendar-date.is-adjacent-month { color: #a2b0b6; background: #f5f7f8; }
#maintenance-agenda-view .agenda-calendar .forecast-calendar-event { box-sizing: border-box; display: block; width: calc(100% - 6px); max-width: none; margin: 6px 3px 0; padding: 5px 7px; border-radius: 4px; font-size: 11px; font-weight: 800; line-height: 1.15; box-shadow: none; }
#maintenance-agenda-view .agenda-calendar .forecast-calendar-grid { border-bottom: 0; border-radius: 10px 10px 0 0; }
#maintenance-agenda-view .agenda-bottom-legend { border-top: 0; }
#maintenance-agenda-view .agenda-calendar .forecast-calendar-grid { border-bottom: 0 !important; }
#maintenance-agenda-view .agenda-calendar .forecast-calendar-day:nth-last-child(-n + 7) { border-bottom: 0; }
#maintenance-agenda-view .agenda-calendar-shell,
#maintenance-agenda-view .agenda-calendar,
#maintenance-agenda-view .agenda-calendar .forecast-calendar-grid { border-radius: 0 !important; }
#maintenance-agenda-view .agenda-layout { border-radius: 10px; }
#maintenance-agenda-view .agenda-calendar-shell { gap: 0 !important; grid-template-rows: minmax(0, 1fr) 48px; }
#maintenance-agenda-view .agenda-calendar { margin: 0 !important; padding: 0 !important; border: 0 !important; }
#maintenance-agenda-view .agenda-bottom-legend { position: relative; z-index: 1; margin-top: -1px; }
#maintenance-agenda-view .agenda-calendar .forecast-calendar-day.is-selected { z-index: 2; box-shadow: inset 0 0 0 2px #007b9f; }

/* Dettaglio Agenda: schede compatte e leggibili come il pannello di riferimento. */
#maintenance-agenda-view .agenda-detail-heading { display:flex; align-items:center; gap:8px; min-height:40px; padding:0 16px; font-size:13px; }
#maintenance-agenda-view .agenda-detail-heading svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.9; }
#maintenance-agenda-view .agenda-day-detail h2 { margin:15px 16px 10px; font-size:16px; }
#maintenance-agenda-view .agenda-day-events { margin:0 16px; padding:0 0 12px; border-bottom:0; }
#maintenance-agenda-view .agenda-section-heading { display:flex; align-items:center; justify-content:space-between; min-height:24px; margin:0 0 8px; }
#maintenance-agenda-view .agenda-section-heading h3 { margin:0; color:#263c45; font-size:12px; font-weight:800; }
#maintenance-agenda-view .agenda-section-heading b { display:inline-grid; min-width:20px; height:20px; padding:0 5px; place-items:center; border-radius:6px; color:#31708a; background:#eaf4f7; font-size:11px; }
#maintenance-agenda-view .agenda-empty-events { margin:0; padding:0 0 10px; color:#73858c; font-size:11px; }
#maintenance-agenda-view .agenda-event-card { position:relative; display:grid; grid-template-columns:10px minmax(0,1fr) auto; gap:3px 7px; margin:0 0 8px; padding:10px; border:1px solid #d7e3e7; border-radius:7px; background:#fff; font-size:11px; }
#maintenance-agenda-view .agenda-event-card i { grid-row:1 / span 2; width:8px; height:8px; margin-top:3px; border-radius:50%; background:#f08b17; }
#maintenance-agenda-view .agenda-event-card strong { color:#263c45; font-size:12px; }
#maintenance-agenda-view .agenda-event-card > b { justify-self:end; color:#48616b; font-size:11px; }
#maintenance-agenda-view .agenda-event-card small { grid-column:2 / 3; color:#6b7f87; font-size:10px; font-weight:650; }
#maintenance-agenda-view .agenda-event-card em { grid-column:3; grid-row:2; align-self:end; padding:3px 6px; border-radius:4px; color:#b75f0a; background:#fff0dc; font-size:9px; font-style:normal; font-weight:800; }
#maintenance-agenda-view .agenda-event-card.is-overdue i { background:#db4450; }
#maintenance-agenda-view .agenda-event-card.is-overdue em { color:#be3e49; background:#ffebed; }
#maintenance-agenda-view .agenda-notes { padding:12px 16px 16px; border-top:1px solid #e3eaec; }
#maintenance-agenda-view .agenda-notes-heading { margin-bottom:8px; }
#maintenance-agenda-view .agenda-notes-list article { grid-template-columns:24px 1fr; padding:9px; border-radius:7px; }
#maintenance-agenda-view .agenda-note-icon { display:grid; width:24px; height:24px; place-items:center; border-radius:5px; color:#007b9f; background:#e8f5fb; }
#maintenance-agenda-view .agenda-notes label { margin-top:10px; font-size:11px; }
#maintenance-agenda-view .agenda-notes textarea { min-height:66px; border-radius:6px; font-size:11px; }
#maintenance-agenda-view .agenda-notes .button { height:38px; margin-top:8px; border-radius:6px; font-size:12px; }
#maintenance-agenda-view .agenda-notes label { display:none; }
#maintenance-agenda-view .agenda-notes.is-composing label { display:grid; }
#maintenance-agenda-view .agenda-notes.is-composing > label { gap:6px; }
#maintenance-agenda-view .agenda-note-meta { display:grid; grid-template-columns:minmax(0,1fr) 92px; gap:8px; }
#maintenance-agenda-view .agenda-note-meta label,
#maintenance-agenda-view .agenda-notes.is-composing > label > label { display:grid; gap:5px; color:#526e79; font-size:10px; font-weight:750; }
#maintenance-agenda-view .agenda-note-meta input,
#maintenance-agenda-view .agenda-notes.is-composing > label > label input { height:32px; box-sizing:border-box; border:1px solid #cbdde2; border-radius:5px; padding:0 8px; color:#2d444e; background:#fff; font:inherit; font-size:11px; }
#maintenance-agenda-view .agenda-notes.is-composing > label > span { margin-top:2px; }
#maintenance-agenda-view .agenda-notes .button { margin-top:12px; border:1px solid #007b9f; color:#007b9f; background:#fff; box-shadow:none; }
#maintenance-agenda-view .agenda-notes .button:hover { color:#fff; background:#007b9f; }
#maintenance-agenda-view .agenda-notes .button:disabled { border-color:#c9d7dc; color:#99aab1; background:#f4f7f8; cursor:not-allowed; }
#maintenance-agenda-view .agenda-note-card { display:grid; grid-template-columns:24px minmax(0,1fr) auto; gap:5px 8px; margin:0 0 8px; padding:10px; border:1px solid #d7e3e7; border-radius:7px; background:#fff; }
#maintenance-agenda-view .agenda-note-card[data-note-open] { cursor:pointer; }
#maintenance-agenda-view .agenda-note-card[data-note-open]:hover { border-color:#a9cbd6; background:#fbfdfe; }
#maintenance-agenda-view .agenda-note-kind { display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; }
#maintenance-agenda-view .agenda-note-kind label { display:grid; gap:5px; color:#526e79; font-size:10px; font-weight:750; }
#maintenance-agenda-view .agenda-note-kind select,
#maintenance-agenda-view .agenda-note-kind input { height:32px; box-sizing:border-box; border:1px solid #cbdde2; border-radius:5px; padding:0 7px; color:#2d444e; background:#fff; font:inherit; font-size:11px; }
#maintenance-agenda-view .agenda-note-kind > label:first-child { grid-column:1 / -1; }
#maintenance-agenda-view .agenda-note-kind > label[hidden] { display:none !important; }
#maintenance-agenda-view .agenda-note-description-field textarea { min-height:72px; box-sizing:border-box; padding:9px; border:1px solid #cbdde2; border-radius:5px; font:inherit; font-size:11px; }
#maintenance-agenda-view .agenda-notes.is-composing { margin-top:0; border-top:2px solid #b8d0d8; background:#f3f7f8; box-shadow:inset 0 8px 12px -14px rgba(22,61,75,.7); }
#maintenance-agenda-view .agenda-day-detail:has(.agenda-notes.is-composing) .agenda-day-events { height:250px; min-height:250px; max-height:250px; flex-basis:250px; }
#maintenance-agenda-view .agenda-notes.is-composing > .button { min-height:40px; }
#maintenance-agenda-view #agenda-note-form-fields { display:grid; gap:9px; }
#maintenance-agenda-view .agenda-notes.is-composing #agenda-note-form-fields { display:flex; min-height:0; flex:0 0 auto; flex-direction:column; }
#maintenance-agenda-view #agenda-note-form-fields .agenda-note-kind { order:1; }
#maintenance-agenda-view #agenda-note-form-fields .agenda-note-title-field { order:2; }
#maintenance-agenda-view #agenda-note-form-fields .agenda-note-description-field { display:flex; min-height:0; flex:0 0 auto; flex-direction:column; order:3; }
#maintenance-agenda-view #agenda-note-form-fields > label,
#maintenance-agenda-view #agenda-note-form-fields .agenda-note-kind > label { display:grid; gap:5px; color:#526e79; font-size:10px; font-weight:750; }
#maintenance-agenda-view #agenda-note-form-fields textarea,
#maintenance-agenda-view #agenda-note-form-fields input,
#maintenance-agenda-view #agenda-note-form-fields select { width:100%; box-sizing:border-box; border:1px solid #cbdde2; border-radius:5px; padding:7px 8px; color:#2d444e; background:#fff; font:inherit; font-size:11px; }
#maintenance-agenda-view #agenda-note-form-fields textarea { resize:vertical; }
#maintenance-agenda-view #agenda-note-form-fields #agenda-note-text { min-height:38px; height:38px; resize:none; }
#maintenance-agenda-view #agenda-note-form-fields #agenda-note-description { min-height:82px; height:82px; flex:0 0 82px; resize:none; }
#maintenance-agenda-view #agenda-note-form-fields .agenda-note-kind { grid-template-columns:repeat(3, minmax(0, 1fr)); gap:8px; }
#maintenance-agenda-view #agenda-note-form-fields .agenda-note-kind { grid-template-areas:"start middle type"; }
#maintenance-agenda-view #agenda-note-form-fields .agenda-note-kind > label:first-child { grid-area:start; }
#maintenance-agenda-view #agenda-note-form-fields .agenda-note-kind > label:nth-child(2) { grid-area:middle; }
#maintenance-agenda-view #agenda-note-form-fields .agenda-note-kind > label:nth-child(3) { grid-area:type; }
#maintenance-agenda-view #agenda-note-form-fields .agenda-note-time-field:not([hidden]) { grid-area:middle; }
#maintenance-agenda-view #agenda-day-detail:has(.agenda-notes.is-composing) .agenda-day-events { height:205px; min-height:205px; max-height:205px; flex-basis:205px; }
#alerts-view .agenda-reminder-popup { position:fixed; z-index:30; right:24px; bottom:24px; display:grid; grid-template-columns:34px minmax(0,1fr) 28px; gap:12px; width:360px; padding:16px; border:1px solid #b9dbe5; border-radius:9px; color:#263c45; background:#fff; box-shadow:0 10px 28px rgba(27,55,65,.24); }
#alerts-view .agenda-reminder-bell { display:grid; width:34px; height:34px; place-items:center; border-radius:50%; background:#e8f5fb; font-size:18px; }
#alerts-view .agenda-reminder-popup strong { display:block; font-size:14px; }
#alerts-view .agenda-reminder-popup p { margin:4px 0 0; color:#617984; font-size:12px; line-height:1.35; }
#alerts-view .agenda-reminder-popup button { width:28px; height:28px; padding:0; border:0; color:#53707b; background:transparent; font-size:21px; cursor:pointer; }
#alerts-view .forecast-calendar-counts { display:flex; width:100%; flex-wrap:wrap; justify-content:flex-start; gap:2px; margin:7px 1px 0; }
#alerts-view .forecast-calendar-counts .forecast-calendar-count { display:inline-grid; width:18px; height:18px; min-width:18px; margin:0; padding:0; place-items:center; border:1px solid #f0c68d; border-radius:4px; color:#9b5000; background:#fffaf2; font-size:10px; line-height:1; }
#alerts-view .forecast-calendar-counts .forecast-calendar-count.is-warning { border-color:#93d1ad; color:#216844; background:#f4fbf6; }
#alerts-view .forecast-calendar-counts .forecast-calendar-count.is-overdue { border-color:#db4450; color:#c13b47; background:#fff6f7; }
#alerts-view .forecast-calendar-counts .forecast-calendar-count.is-note { border-color:#83bae7; color:#0870bb; background:#f2f9ff; }
#alerts-view .forecast-calendar-counts .forecast-calendar-count.is-planned { border-color:#ad98dc; color:#6548a9; background:#f8f5ff; }
#alerts-view .dashboard-calendar-popover-event.is-note i { background:#1684d5; }
#alerts-view .dashboard-calendar-popover-event.is-note em { color:#0870bb; background:#e8f5fb; }
#alerts-view .forecast-calendar-weekday { padding-top:3px; padding-bottom:3px; }
#fleet-availability-view { display:none; min-height:0; flex-direction:column; gap:0; }
#fleet-availability-view.is-active { display:flex; }
#fleet-availability-view .fleet-availability-heading { flex:0 0 auto; min-height:75px; box-sizing:border-box; margin-bottom:16px; padding:16px 30px; }
#fleet-availability-view .fleet-availability-heading h1 { margin:0; font-size:29px; line-height:1.1; }
#fleet-availability-content { display:grid; gap:14px; min-height:0; }
.fleet-availability-fleet, .fleet-availability-summary, .fleet-availability-actions > section, .fleet-availability-empty { border:1px solid #d5e2e6; border-radius:10px; background:#fff; box-shadow:0 5px 15px rgba(27,55,65,.06); }
.fleet-availability-fleet { padding:14px; }.fleet-availability-toolbar { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:12px; }.fleet-availability-toolbar h2, .fleet-availability-actions h2 { margin:0; color:#183d4d; font-size:16px; }.fleet-availability-toolbar label { display:none; }
.fleet-availability-trains { display:grid; grid-template-columns:repeat(5,minmax(150px,1fr)); min-height:266px; max-height:266px; gap:10px; padding-right:4px; overflow-y:auto; align-content:start; }.fleet-availability-train { display:grid; grid-template-columns:58px minmax(72px,1fr) 1px minmax(66px,1fr) 1px minmax(82px,1.1fr); gap:8px; min-height:78px; padding:6px 10px; align-items:center; border:1px solid #cbdde2; border-radius:7px; color:#183d4d; background:#fff; font:inherit; text-align:left; cursor:pointer; }.fleet-availability-train.is-selected { border:2px solid #007b9f; padding:5px 9px; background:#f8fcfd; }.fleet-availability-train-icon { color:#007b9f; }.fleet-availability-train img, .fleet-availability-summary img, .fleet-availability-state img { display:block; width:54px; height:54px; object-fit:contain; }.fleet-availability-train-data, .fleet-availability-deadline { display:grid; align-content:center; gap:4px; min-width:0; }.fleet-availability-train strong { font-size:14px; white-space:nowrap; }.fleet-availability-train small { color:#5b7480; font-size:10px; font-weight:700; white-space:nowrap; }.fleet-availability-train-data em, .fleet-availability-summary em { width:max-content; padding:2px 6px; border-radius:4px; color:#17643b; background:#e7f5eb; font-size:9px; font-style:normal; font-weight:800; }.fleet-availability-train-data em.is-out, .fleet-availability-summary em.is-out { color:#a6303d; background:#ffebed; }.fleet-availability-divider { display:block; align-self:stretch; width:1px; background:#dce7e9; }.fleet-availability-deadline b { color:#183d4d; font-size:17px; line-height:1; white-space:nowrap; }.fleet-availability-deadline b i { display:inline-block; margin-right:2px; color:#f1a52c; font-size:11px; font-style:normal; vertical-align:2px; }.fleet-availability-deadline b i.is-time { color:#159ac1; }.fleet-availability-deadline em { color:#6b838c; font-size:9px; font-style:normal; font-weight:700; white-space:nowrap; }
.fleet-availability-summary { display:none; }
.fleet-availability-actions { display:grid; grid-template-columns:1fr 1fr; gap:14px; }.fleet-availability-actions > section { padding:16px; }.fleet-availability-state { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:14px 0; }.fleet-availability-state button { display:flex; min-height:88px; align-items:center; gap:10px; padding:12px; border:1px solid #cbdde2; border-radius:7px; color:#1d4b5c; background:#fff; font:inherit; text-align:left; cursor:pointer; }.fleet-availability-state button.is-stop { border-color:#e6a5a8; color:#b63642; }.fleet-availability-state button.is-return { border-color:#9dceb1; color:#216844; }.fleet-availability-state button:disabled { opacity:.42; cursor:default; }.fleet-availability-state span { display:grid; gap:4px; }.fleet-availability-state b { font-size:14px; }.fleet-availability-state small { color:#607983; font-size:11px; font-weight:650; }.fleet-availability-note { display:grid; gap:4px; padding:11px; border:1px solid #d9e6e9; border-radius:6px; color:#526d78; background:#f8fbfc; font-size:11px; }.fleet-availability-note b { color:#264855; }.fleet-availability-info { margin:14px 0; padding:11px; border:1px solid #b9dbe5; border-radius:6px; color:#1c5972; background:#eef8fc; font-size:12px; font-weight:700; }.fleet-availability-work dl { margin:0; }.fleet-availability-work dl div { display:grid; grid-template-columns:100px 1fr; padding:9px 0; border-bottom:1px solid #e0e9eb; font-size:12px; }.fleet-availability-work dt { color:#617984; }.fleet-availability-work dd { margin:0; color:#203f4c; font-weight:800; }.fleet-availability-empty { padding:30px; color:#637a84; text-align:center; }
.fleet-availability-train { grid-template-columns:58px minmax(64px,1fr) 1px minmax(94px,1.15fr) 1px minmax(94px,1.15fr); min-height:82px; }.fleet-availability-train.is-selected { padding:5px 9px; }.fleet-availability-deadline { gap:2px; }.fleet-availability-deadline b { display:flex; align-items:center; min-height:54px; gap:5px; font-size:21px; }.fleet-availability-deadline b > span { line-height:1; }.fleet-availability-deadline b i { margin:0; vertical-align:initial; }.fleet-availability-deadline em { font-size:9px; line-height:1; }.deadline-icon { position:relative; display:block; flex:0 0 42px; width:42px; height:42px; border:3px solid currentColor; border-radius:5px; color:#ef8b16; box-sizing:border-box; }.deadline-icon.is-km::before { content:""; position:absolute; top:8px; left:-3px; right:-3px; border-top:3px solid currentColor; }.deadline-icon.is-km::after { content:""; position:absolute; top:-7px; left:7px; width:20px; height:7px; border-left:3px solid currentColor; border-right:3px solid currentColor; }.deadline-icon.is-time { border-radius:50%; color:#159ac1; }.deadline-icon.is-time::before { content:""; position:absolute; top:8px; left:18px; width:3px; height:13px; background:currentColor; transform-origin:bottom; transform:rotate(-35deg); }.deadline-icon.is-time::after { content:""; position:absolute; top:19px; left:19px; width:5px; height:5px; border-radius:50%; background:currentColor; }.deadline-state { display:block; width:11px; height:11px; margin-left:auto !important; border-radius:50%; background:#2aae67; }.deadline-state.is-due { background:#f0a22c; }.deadline-state.is-overdue { background:#e24a55; }@media (max-width:1100px) { .fleet-availability-trains { grid-template-columns:repeat(3,1fr); }.fleet-availability-actions { grid-template-columns:1fr; } }
#maintenance-agenda-view .agenda-note-card p { margin:0; color:#273c45; font-size:14px; font-weight:800; line-height:1.3; }
#maintenance-agenda-view .agenda-note-card small { grid-column:1 / -1; color:#617984; font-size:11px; font-weight:650; line-height:1.35; }
#maintenance-agenda-view .agenda-note-icon svg { width:15px; height:15px; fill:none; stroke:currentColor; stroke-linecap:round; stroke-linejoin:round; stroke-width:1.8; }
#maintenance-agenda-view .agenda-note-actions { display:flex; gap:3px; }
#maintenance-agenda-view .agenda-note-actions { position:relative; }
#maintenance-agenda-view .agenda-note-actions button { width:22px; height:22px; padding:0; border:0; border-radius:4px; color:#37708a; background:transparent; font-size:15px; cursor:pointer; }
#maintenance-agenda-view .agenda-note-actions button:hover { background:#eaf4f7; }
#maintenance-agenda-view .agenda-note-menu { position:absolute; z-index:4; top:25px; right:0; padding:4px; border:1px solid #cbdde2; border-radius:5px; background:#fff; box-shadow:0 5px 14px rgba(27,55,65,.16); }
#maintenance-agenda-view .agenda-note-menu button { width:auto; height:28px; padding:0 9px; color:#bc3e49; font-size:11px; white-space:nowrap; }
#maintenance-agenda-view .agenda-calendar .forecast-calendar-event.is-note { color:#007b9f; background:#e8f5fb; }
#maintenance-agenda-view .agenda-calendar .forecast-calendar-day {
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  grid-auto-rows:min-content;
  align-content:start;
  gap:5px;
}
#maintenance-agenda-view .agenda-calendar .forecast-calendar-date { grid-column:1 / -1; }
#maintenance-agenda-view .agenda-calendar .forecast-calendar-event {
  width:100%;
  min-width:0;
  max-width:none;
  margin:0;
  padding:5px 6px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* Editor nota: resta subito sotto alle notifiche e non viene spinto in fondo. */
#maintenance-agenda-view .agenda-notes.is-composing {
  flex:0 0 auto;
  margin-top:0;
}
#maintenance-agenda-view .agenda-notes.is-composing #agenda-note-form-fields { margin-top:0; }
#maintenance-agenda-view .agenda-notes.is-composing > .button {
  margin-top:10px !important;
  flex:0 0 auto;
}
#maintenance-agenda-view .agenda-day-detail:has(.agenda-notes.is-composing) .agenda-day-events {
  height:205px;
  min-height:205px;
  max-height:205px;
  flex:0 0 205px;
}
#maintenance-agenda-view .agenda-day-detail.is-editing-note .agenda-day-events {
  height:330px !important;
  min-height:0 !important;
  max-height:330px !important;
  flex:0 1 330px !important;
  overflow-y:auto !important;
}
#maintenance-agenda-view .agenda-day-detail.is-editing-note .agenda-notes.is-composing {
  display:flex;
  min-height:0;
  flex:1 1 auto !important;
}
#maintenance-agenda-view .agenda-day-detail.is-editing-note .agenda-notes.is-composing {
  border:1px solid #cbdde2;
  border-radius:8px;
  background:#fff;
  box-shadow:none;
}
#maintenance-agenda-view .agenda-day-detail.is-editing-note .agenda-notes.is-composing > .button {
  margin-top:auto !important;
  flex:0 0 auto;
}
#maintenance-agenda-view .agenda-notes:not(.is-composing) #agenda-note-form-fields { display:none; }

/* Nel dettaglio resta fisso il comando per le note: scorrono solo gli elenchi. */
#maintenance-agenda-view .agenda-day-detail {
  overflow:hidden;
  overscroll-behavior:auto;
}
#maintenance-agenda-view .agenda-day-events {
  height:526px;
  min-height:526px;
  max-height:526px;
  flex:0 0 526px;
  overflow-y:auto;
  overscroll-behavior:contain;
  padding-right:5px;
  scrollbar-color:#a9c7d2 transparent;
  scrollbar-width:thin;
}
#maintenance-agenda-view .agenda-day-events::-webkit-scrollbar,
#maintenance-agenda-view .agenda-notes-list::-webkit-scrollbar { width:7px; }
#maintenance-agenda-view .agenda-day-events::-webkit-scrollbar-thumb,
#maintenance-agenda-view .agenda-notes-list::-webkit-scrollbar-thumb { border-radius:8px; background:#c8dce2; }
#maintenance-agenda-view .agenda-notes {
  min-height:0;
  flex:0 0 auto;
}
#maintenance-agenda-view .agenda-notes-list {
  height:auto;
  max-height:246px;
  overflow-y:auto;
}
#maintenance-agenda-view .agenda-day-events > .agenda-notes-list {
  height:auto;
  max-height:none;
  overflow:visible;
  padding:0;
}
#maintenance-agenda-view .agenda-day-events > .agenda-notes-list .agenda-note-card:last-child { margin-bottom:0; }
#maintenance-agenda-view .agenda-day-detail { display:flex; flex-direction:column; }
#maintenance-agenda-view .agenda-notes { display:flex; min-height:0; flex:1; flex-direction:column; }
#maintenance-agenda-view .agenda-notes > .button { margin-top:auto !important; }
#maintenance-agenda-view .agenda-notes.is-composing > label { margin-top:auto; margin-bottom:8px; }
#maintenance-agenda-view .agenda-notes.is-composing > .button { margin-top:0 !important; }

/* Proporzioni calendario agenda: celle quasi quadrate e legenda separata. */
#maintenance-agenda-view { max-width: 1650px; margin-right: auto; margin-left: auto; }
.agenda-toolbar { grid-template-columns: auto auto minmax(0, 1fr) auto; }
.agenda-toolbar-spacer { min-width: 0; }
.agenda-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: stretch; }
.agenda-calendar-shell { display: grid; grid-template-rows: minmax(0, 1fr) auto; overflow: hidden; border: 1px solid #dbe5e8; border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
.agenda-calendar { min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
.agenda-calendar .forecast-calendar-grid { grid-auto-rows: 1fr; min-height: 650px; }
.agenda-calendar .forecast-calendar-day { min-height: 0; }
.agenda-bottom-legend { display: flex; align-items: center; gap: 18px; min-height: 48px; padding: 0 16px; border-top: 0; color: #536c75; background: #fff; font-size: 11px; font-weight: 700; }
.agenda-bottom-legend span::before { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 2px; content: ""; background: #f08b17; }
.agenda-bottom-legend .is-warning::before { background:#36a767; }
.agenda-bottom-legend .is-planned::before { background: #7656b8; }.agenda-bottom-legend .is-limit::before { background: #db4450; }.agenda-bottom-legend .is-note::before { background: #1684d5; }.agenda-bottom-legend em { margin-left: auto; color: #778a91; font-style: normal; font-weight: 600; }
.agenda-day-detail { min-height: 698px; }

/* Agenda ampia: il calendario mantiene celle regolari, il dettaglio usa lo spazio residuo. */
#maintenance-agenda-view { max-width: none; }
.agenda-layout { grid-template-columns: minmax(0, 1fr) 430px; }
.agenda-calendar .forecast-calendar-grid { grid-auto-rows: auto; min-height: 0; }
.agenda-calendar .forecast-calendar-day { aspect-ratio: auto; min-height: 138px; }
.agenda-day-detail { min-height: 0; height: auto; }
@media (max-width:1100px) { .agenda-layout { grid-template-columns: 1fr; } }
#maintenance-agenda-view, .agenda-layout, .agenda-calendar-shell, .agenda-calendar { min-width: 0; max-width: 100%; }
.agenda-calendar .forecast-calendar-grid { width: 100%; min-width: 0; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.agenda-calendar .forecast-calendar-day { min-width: 0; overflow: hidden; }

@media (min-width:901px) {
  html:has(body[data-active-view="maintenance-agenda-view"]), body[data-active-view="maintenance-agenda-view"] { height: 100%; overflow: hidden; }
  body[data-active-view="maintenance-agenda-view"] main { height: calc(100vh - 8px); height: calc(100dvh - 8px); margin-bottom: 0; }
  #maintenance-agenda-view.is-active { display: flex; height: 100%; min-height: 0; flex-direction: column; }
  #maintenance-agenda-view .agenda-layout { min-height: 0; flex: 1; }
  #maintenance-agenda-view .agenda-calendar-shell, #maintenance-agenda-view .agenda-day-detail { min-height: 0; height: auto; }
  #maintenance-agenda-view .agenda-calendar { display: flex; min-height: 0; flex: 1; }
#maintenance-agenda-view .agenda-calendar .forecast-calendar-grid { flex: 1; min-height: 0; grid-template-rows: 36px; grid-auto-rows: minmax(0, 1fr); }
  #maintenance-agenda-view .agenda-calendar .forecast-calendar-day { min-height: 0; }
}

/* Pagina completa avvisi: proporzioni coerenti con la barra del titolo. */
#alerts-all-view .alerts-all-toolbar { grid-template-columns: minmax(340px, 520px) 1fr auto; margin-right: 0; margin-left: 0; padding-right: 18px; padding-left: 18px; border-radius: 0; }
#alerts-all-view .alerts-all-list { margin-right: 0; margin-left: 0; }
#alerts-all-view .alerts-all-group { padding-right: 18px; padding-left: 18px; }
#alerts-all-view .alerts-all-filters { justify-content: flex-start; gap: 8px; }
#alerts-all-view .alerts-all-filters button { padding-right: 12px; padding-left: 12px; }
#alerts-all-view .alerts-all-filters b { display: inline-grid; min-width: 19px; height: 19px; margin-left: 6px; place-items: center; border-radius: 4px; color: #9b5000; background: #fff0dc; font-size: 10px; }
#alerts-all-view .alerts-all-filters button.is-active b { color: #00688b; background: #fff; }
#alerts-all-view .alerts-all-search svg { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 2; }
#alerts-all-view .alerts-all-search > span { display: none; }

/* Rifiniture elenco avvisi completo. */
#alerts-all-view .alerts-all-toolbar { border-radius: 10px; }
#alerts-all-view .alerts-all-search::before { width: 20px; height: 20px; flex: 0 0 20px; content: ""; background: center / 20px 20px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23607983' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='10.8' cy='10.8' r='6.2'/%3E%3Cpath d='m15.4 15.4 4.2 4.2'/%3E%3C/svg%3E"); }
#alerts-all-view .alerts-all-filters { gap: 14px; }
#alerts-all-view .alerts-all-filters button { min-height: 42px; padding-right: 14px; padding-left: 14px; }
#alerts-all-view .alerts-all-filters b { min-width: 23px; height: 23px; margin-left: 8px; border-radius: 5px; font-size: 11px; }
#alerts-all-view .alerts-all-group { padding-right: 0; padding-left: 0; }
#alerts-all-view .alerts-all-group h2 { padding-right: 18px; padding-left: 18px; }
#alerts-all-view .alerts-all-row { border-right: 1px solid #dce6e9; border-left: 1px solid #dce6e9; }
#alerts-all-view .alerts-all-row:first-of-type { border-radius: 9px 9px 0 0; }
#alerts-all-view .alerts-all-row:last-child { border-radius: 0 0 9px 9px; }
#alerts-all-view .alerts-all-row { border-radius: 10px !important; }
#alerts-all-view .alerts-all-row + .alerts-all-row { margin-top: 8px; border-top: 1px solid #dce6e9; }
#alerts-all-view .alerts-all-row b { box-sizing: border-box; width: 98px; text-align: center; }

/* Agenda manutentiva -------------------------------------------------------- */
#maintenance-agenda-view { padding-bottom: 24px; }
#maintenance-agenda-view > .agenda-heading { min-height: 75px; margin-bottom: 16px; padding: 16px 30px; }
#maintenance-agenda-view > .agenda-heading h1 { margin: 0; font-size: 29px; }
.agenda-toolbar { display:flex; align-items:center; gap:18px; margin-bottom:16px; padding:12px 16px; border:1px solid #dbe5e8; border-radius:10px; background:#fff; box-shadow:var(--shadow); }
.agenda-month { display:flex; align-items:center; gap:12px; margin:auto; }.agenda-month strong { min-width:160px; text-align:center; font-size:15px; text-transform:capitalize; }.agenda-month button { width:30px; height:30px; border:1px solid #cbdde2; border-radius:5px; color:#00688b; background:#fff; font-size:22px; cursor:pointer; }
.agenda-legend { display:flex; gap:14px; color:#516a74; font-size:12px; font-weight:750; }.agenda-legend span::before { display:inline-block; width:9px; height:9px; margin-right:6px; border-radius:2px; content:""; background:#f08b17; }.agenda-legend .is-planned::before { background:#36a767; }.agenda-legend .is-limit::before { background:#db4450; }
.agenda-layout { display:grid; grid-template-columns:minmax(0,1fr) 340px; gap:16px; }.agenda-calendar { min-height:620px; padding:14px; border:1px solid #dbe5e8; border-radius:10px; background:#fff; box-shadow:var(--shadow); }.agenda-calendar .forecast-calendar-grid { height:100%; }.agenda-calendar .forecast-calendar-day { min-height:96px; padding:8px; }.agenda-calendar .forecast-calendar-event { margin-top:5px; padding:4px 6px; font-size:11px; box-shadow:inset 3px 0 currentColor; }
.agenda-day-detail { overflow:hidden; border:1px solid #dbe5e8; border-radius:10px; background:#fff; box-shadow:var(--shadow); }.agenda-detail-heading { padding:12px 16px; color:#fff; background:#00688b; font-size:14px; font-weight:800; }.agenda-day-detail h2 { margin:18px 16px 10px; color:#263c45; font-size:17px; }.agenda-day-events { margin:0 16px; padding-bottom:12px; border-bottom:1px solid #e3eaec; color:#647881; font-size:12px; }.agenda-notes { padding:16px; }.agenda-notes h3 { margin:0 0 10px; color:#263c45; font-size:14px; }.agenda-notes label { display:grid; gap:6px; margin-top:12px; color:#506872; font-size:12px; font-weight:750; }.agenda-notes textarea { resize:vertical; }.agenda-notes .button { width:100%; margin-top:10px; }.agenda-notes-list article { display:grid; grid-template-columns:22px 1fr; gap:8px; padding:10px; border:1px solid #dce6e9; border-radius:7px; color:#314750; background:#fbfcfc; }.agenda-notes-list article + article { margin-top:8px; }.agenda-notes-list article span { color:#00688b; }.agenda-notes-list article p { margin:0; font-size:12px; font-weight:650; line-height:1.35; }.agenda-empty-note { color:#71848c; font-size:12px; }
@media (max-width:1100px) { .agenda-layout { grid-template-columns:1fr; }.agenda-calendar { min-height:500px; }.agenda-toolbar { flex-wrap:wrap; }.agenda-month { order:-1; width:100%; }.agenda-legend { margin-left:auto; } }

/* Agenda: composizione fedele alla vista di pianificazione. */
.agenda-toolbar { display:grid; grid-template-columns:auto auto 1fr auto; gap:14px; min-height:56px; padding:10px 16px; }.agenda-month { margin:0; }.agenda-view-switch { display:flex; overflow:hidden; border:1px solid #cbdde2; border-radius:6px; }.agenda-view-switch button { min-width:74px; height:34px; border:0; border-right:1px solid #cbdde2; color:#40555e; background:#fff; font:inherit; font-size:12px; font-weight:750; }.agenda-view-switch button:last-child { border-right:0; }.agenda-view-switch button.is-active { color:#fff; background:#00688b; }.agenda-view-switch button:disabled { opacity:.62; }.agenda-legend { align-items:center; gap:0; justify-content:flex-start; }.agenda-legend span { padding:8px 11px; border:1px solid #d7e2e5; border-right:0; background:#fff; }.agenda-legend span:last-child { border-right:1px solid #d7e2e5; border-radius:0 6px 6px 0; }.agenda-legend span:first-child { border-radius:6px 0 0 6px; }.agenda-legend .is-all { color:#fff; background:#00688b; }.agenda-legend .is-all::before { display:none; }.agenda-back-link { display:none; }.agenda-calendar { min-height:0; padding:0; overflow:hidden; }.agenda-calendar .forecast-calendar-grid { border:0; border-radius:10px; box-shadow:none; }.agenda-calendar .forecast-calendar-weekday { padding:10px 2px; font-size:11px; }.agenda-calendar .forecast-calendar-day { min-height:105px; padding:9px; }.agenda-calendar .forecast-calendar-date { width:22px; height:22px; display:inline-grid; place-items:center; border-radius:50%; background:#f0f4f5; }.agenda-calendar .forecast-calendar-event { max-width:calc(100% - 4px); margin:5px 0 0; padding:4px 6px; font-size:11px; }.agenda-day-detail { min-height:620px; }.agenda-day-events .agenda-event-card { display:grid; grid-template-columns:9px minmax(0,1fr); gap:8px; margin:8px 0; padding:10px; border:1px solid #dce6e9; border-radius:7px; color:#30464f; background:#fff; font-size:12px; font-weight:750; }.agenda-event-card i { width:9px; height:9px; margin-top:3px; border-radius:50%; background:#f08b17; }.agenda-event-card.is-overdue i { background:#db4450; }
#alerts-view .dashboard-notice-status { box-sizing: border-box; width: 98px; text-align: center; }

/* Il pannello mantiene la quota della dashboard; gli avvisi in eccesso scorrono internamente. */
#alerts-view .alerts-circulation-panel .fleet-alert-list { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
#alerts-view .alerts-circulation-panel .fleet-alert-list::-webkit-scrollbar { display: none; }

/* Titolo compatto del Cruscotto operativo: gli altri titoli restano invariati. */
#alerts-view > .alerts-heading { min-height: 75px; margin-bottom: 16px; padding: 16px 30px; }
#alerts-view .alerts-dashboard { margin-bottom: 0; }
#alerts-view > .alerts-heading h1 { margin: 0; font-size: 29px; line-height: 1.1; }
#alerts-all-view > .alerts-all-heading { min-height: 75px; padding: 16px 30px; }
#alerts-all-view > .alerts-all-heading h1 { margin: 0; font-size: 29px; line-height: 1.1; }
#personnel-management-view .account-access-form .personnel-inline-actions .button,
#personnel-management-view .fleet-registry-actions .button { min-width:112px; min-height:39px; padding:9px 18px; font-size:14px; font-weight:700; }

/* Gestione flotta: stesso workspace compatto delle sezioni Accessi e Manutentori. */
#personnel-management-view .fleet-management-panel { display:grid; grid-template-columns:260px minmax(0,1fr); grid-template-rows:minmax(0,1fr); gap:16px; align-items:stretch; }
#personnel-management-view #personnel-admin-panel,
#personnel-management-view .maintainer-workspace,
#personnel-management-view .fleet-management-panel { gap:16px; background:#eef2f3; }
#personnel-management-view .access-users-sidebar,
#personnel-management-view .maintainer-sidebar,
#personnel-management-view .fleet-registry-sidebar { border-color:var(--line); border-radius:12px; background:#fff; box-shadow:var(--shadow); }
#personnel-management-view .access-users-sidebar > header,
#personnel-management-view .maintainer-sidebar-heading,
#personnel-management-view .fleet-registry-sidebar > header { min-height:70px; box-sizing:border-box; background:#f6fafb; }
#personnel-management-view .access-hero,
#personnel-management-view .maintainer-detail-summary,
#personnel-management-view .fleet-registry-summary,
#personnel-management-view .fleet-registry-detail-heading,
#personnel-management-view .email-events-card > .email-card-heading { background:#f6fafb; }
#personnel-management-view .access-hero-icon,
#personnel-management-view .maintainer-detail-summary > span,
#personnel-management-view .fleet-registry-summary-icon,
#personnel-management-view .email-events-history-shortcut { width:40px; height:40px; flex:0 0 40px; box-sizing:border-box; border:1px solid #b9dde2; border-radius:6px; color:#00688b; background:#e4f5f7; }
#personnel-management-view .access-hero-icon svg,
#personnel-management-view .maintainer-detail-summary > span svg,
#personnel-management-view .email-events-history-shortcut svg { width:20px; height:20px; }
#personnel-management-view .fleet-registry-summary-icon img { width:24px; height:24px; }
#personnel-management-view .email-notifications-panel { gap:16px; background:#f6fafb; }
#personnel-management-view .email-recipients-card,
#personnel-management-view .email-events-card > .email-card-heading,
#personnel-management-view .email-recipient-events-card,
#personnel-management-view .email-template-editor { border-color:var(--line); border-radius:12px; box-shadow:var(--shadow); }
#personnel-management-view .email-recipients-card .email-card-heading { min-height:70px; box-sizing:border-box; background:#f6fafb; }
#personnel-management-view .fleet-registry-sidebar { min-height:0; border:1px solid var(--line); border-radius:12px; background:#fff; box-shadow:var(--shadow); }
#personnel-management-view .fleet-registry-sidebar { display:flex; min-height:420px; flex-direction:column; overflow:hidden; }
#personnel-management-view .fleet-registry-sidebar > header { min-height:70px; box-sizing:border-box; padding:13px 20px; border-bottom:1px solid #e1e7eb; background:#f6fafb; }
#personnel-management-view .fleet-registry-sidebar .fleet-registry-new { display:flex; width:100%; min-height:40px; align-items:center; justify-content:flex-start; gap:10px; padding:0; border:0; border-radius:0; color:#26343a; background:transparent; box-shadow:none; font:inherit; font-size:14px; font-weight:800; line-height:1; text-align:left; white-space:nowrap; cursor:pointer; }
#personnel-management-view .fleet-registry-sidebar .fleet-registry-new > span:last-child { display:block; margin:0; color:#26343a; font-size:14px; font-weight:800; line-height:1; transform:none; }
#personnel-management-view .fleet-registry-new-icon,
#personnel-management-view .fleet-registry-list-icon,
#personnel-management-view .fleet-registry-detail-icon,
#personnel-management-view .fleet-registry-empty-icon { display:grid; width:40px; height:40px; flex:0 0 40px; place-items:center; border:1px solid #b9dde2; border-radius:6px; color:#00688b; background:#e4f5f7; }
#personnel-management-view .fleet-registry-new-icon svg,
#personnel-management-view .fleet-registry-detail-icon svg,
#personnel-management-view .fleet-registry-empty-icon svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
#personnel-management-view .fleet-registry-new-icon img { width:28px; height:28px; object-fit:contain; }
#personnel-management-view .fleet-registry-sidebar .fleet-registry-new:hover { color:#00688b; background:transparent; }
#personnel-management-view .fleet-registry-new:hover .fleet-registry-new-icon { border-color:#9bcfd6; background:#dff2f5; }
#personnel-management-view .fleet-registry-list { display:grid; align-content:start; gap:7px; padding:10px; overflow:auto; }
#personnel-management-view .fleet-registry-sidebar-footer { flex:0 0 auto; padding:16px; border-top:1px solid #d5dde0; background:#fff; }
#personnel-management-view .fleet-registry-delete-sidebar { display:inline-flex; min-height:40px; align-items:center; padding:0; border:0; color:#20282d; background:transparent; box-shadow:none; font:inherit; cursor:pointer; }
#personnel-management-view .fleet-registry-delete-sidebar-icon { display:grid; width:40px; height:40px; margin-right:9px; place-items:center; border:1px solid #dfb6b2; border-radius:6px; background:#f9e9e7; }
#personnel-management-view .fleet-registry-delete-sidebar-icon { color:#7f2b25; }
#personnel-management-view .fleet-registry-delete-sidebar-icon svg { width:25px; height:25px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
#personnel-management-view .fleet-registry-delete-sidebar-icon img { display:block; width:27px; height:27px; object-fit:contain; opacity:.78; }
#personnel-management-view .fleet-registry-delete-sidebar:hover .fleet-registry-delete-sidebar-icon { border-color:#c57f78; background:#f5d9d5; }
#personnel-management-view .fleet-registry-list-empty { margin:6px; color:#66778f; font-size:12px; }
#personnel-management-view .fleet-registry-list-item { display:grid; min-height:66px; grid-template-columns:40px minmax(0,1fr); align-items:center; gap:10px; box-sizing:border-box; padding:10px; border:1px solid #dce5e9; border-radius:9px; color:#26343a; background:#fff; font:inherit; text-align:left; cursor:pointer; }
#personnel-management-view .fleet-registry-list-item:hover,
#personnel-management-view .fleet-registry-list-item.is-selected { border-color:#00688b; background:#eefbfc; }
#personnel-management-view .fleet-registry-list-icon img { width:29px; height:29px; object-fit:contain; }
#personnel-management-view .fleet-registry-list-item strong { display:block; overflow:hidden; font-size:14px; text-overflow:ellipsis; white-space:nowrap; }
#personnel-management-view .fleet-registry-list-item small { display:block; overflow:hidden; margin-top:2px; color:#5c6b72; font-size:12px; font-weight:400; text-overflow:ellipsis; white-space:nowrap; }
#personnel-management-view .fleet-registry-detail { display:flex; min-height:0; flex-direction:column; gap:16px; overflow:auto; background:#f6fafb; }
#personnel-management-view .fleet-registry-sidebar,
#personnel-management-view .fleet-registry-summary,
#personnel-management-view .fleet-registry-empty,
#personnel-management-view #fleet-registry-form { box-shadow:none; }
#personnel-management-view .fleet-registry-summary { display:flex; min-height:70px; align-items:center; gap:12px; box-sizing:border-box; padding:10px 16px; border:1px solid var(--line); border-radius:12px; background:#f6fafb; box-shadow:var(--shadow); }
#personnel-management-view .fleet-registry-summary-icon { display:grid; width:40px; height:40px; flex:0 0 40px; place-items:center; border:1px solid #b9dde2; border-radius:7px; background:#e4f5f7; }
#personnel-management-view .fleet-registry-summary-icon img { width:27px; height:27px; object-fit:contain; }
#personnel-management-view .fleet-registry-summary h2 { margin:0; color:#173a50; font-size:20px; line-height:1.1; }
#personnel-management-view .fleet-registry-summary p { margin:2px 0 0; color:#66778f; font-size:11px; }
#personnel-management-view .fleet-registry-empty { display:grid; min-height:230px; flex:1; place-content:center; justify-items:center; gap:8px; padding:32px; border:1px solid var(--line); border-radius:12px; background:#fff; box-shadow:var(--shadow); text-align:center; }
#personnel-management-view .fleet-registry-empty[hidden],
#personnel-management-view #fleet-registry-form[hidden] { display:none !important; }
#personnel-management-view .fleet-registry-empty-icon { width:48px; height:48px; }
#personnel-management-view .fleet-registry-empty-icon img { width:31px; height:31px; object-fit:contain; }
#personnel-management-view .fleet-registry-empty h2 { margin:4px 0 0; color:#173a50; font-size:20px; }
#personnel-management-view .fleet-registry-empty p { max-width:360px; margin:0; color:#66778f; font-size:12px; line-height:1.5; }
#personnel-management-view #fleet-registry-form { display:flex; min-height:0; flex:1; flex-direction:column; margin:0; overflow:hidden; border:1px solid var(--line); border-radius:12px; background:#fff; box-shadow:var(--shadow); }
#personnel-management-view .fleet-registry-detail-heading { display:flex; min-height:70px; align-items:center; gap:12px; box-sizing:border-box; padding:10px 16px; border-bottom:1px solid #d5dde0; background:#f6fafb; }
#personnel-management-view .fleet-registry-detail-heading h2 { margin:0; color:#173a50; font-size:20px; line-height:1.1; }
#personnel-management-view .fleet-registry-detail-heading p { margin:2px 0 0; color:#66778f; font-size:11px; }
#personnel-management-view .fleet-registry-band { padding:18px; border:0; background:transparent; }
#personnel-management-view .fleet-registry-grid { display:flex; align-items:stretch; flex-direction:column; gap:14px; }
#personnel-management-view .fleet-registry-row { display:grid; grid-template-columns:repeat(7, minmax(0,1fr)); align-items:end; gap:14px; }
#personnel-management-view .fleet-registry-grid label { gap:5px; color:#52636d; font-size:11px; }
#personnel-management-view .fleet-registry-grid input,
#personnel-management-view .fleet-registry-grid select { min-height:36px; padding:7px 8px; font-size:13px; }
#personnel-management-view .fleet-registry-actions { justify-content:flex-end; margin-top:auto; margin-bottom:0; padding:14px 18px 18px; border-top:0; background:#fff; }
#personnel-management-view .fleet-registry-actions .button { min-width:112px; min-height:39px; padding:9px 18px; font-size:14px; font-weight:700; }
#personnel-management-view .fleet-registry-delete-detail { display:grid; width:34px; height:34px; place-items:center; padding:0; border:1px solid #f0a7b0; border-radius:6px; color:#df5263; background:#fff; box-shadow:none; }
#personnel-management-view .fleet-registry-delete-detail svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
#personnel-management-view .fleet-registry-delete-detail:hover { border-color:#dd5263; color:#fff; background:#dd5263; }

@media (min-width:901px) {
  #personnel-management-view .fleet-management-panel { height:100%; min-height:0; grid-template-rows:minmax(0, 1fr); }
  #personnel-management-view .fleet-registry-sidebar,
  #personnel-management-view .fleet-registry-detail { height:100%; min-height:0; }
  #personnel-management-view .fleet-registry-list { min-height:0; flex:1; }
}

@media (max-width:900px) {
  #personnel-management-view .fleet-management-panel { grid-template-columns:1fr; }
  #personnel-management-view .fleet-registry-sidebar { min-height:150px; }
  #personnel-management-view .fleet-registry-row { grid-template-columns:repeat(2, minmax(0,1fr)); }
}
@media (max-width:560px) {
  #personnel-management-view .fleet-registry-row { grid-template-columns:1fr; }
}

/* Stato vuoto Flotta: stessa icona dello stato vuoto in Gestione accessi. */
#personnel-management-view .fleet-registry-empty-icon { width:58px; height:58px; }
#personnel-management-view .fleet-registry-empty-icon img { width:30px; height:30px; }

/* Agenda: due elementi per riga, fino a sei elementi leggibili nella giornata. */
#maintenance-agenda-view .agenda-calendar .forecast-calendar-day {
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  grid-auto-rows:min-content;
  align-content:start;
  gap:5px;
}
#maintenance-agenda-view .agenda-calendar .forecast-calendar-date { grid-column:1 / -1; }
#maintenance-agenda-view .agenda-calendar .forecast-calendar-event {
  width:100%;
  min-width:0;
  max-width:none;
  margin:0;
  padding:5px 6px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
/* Tre settori uguali: treno, scadenza chilometrica e scadenza temporale. */
.fleet-availability-train { --fleet-card-gap:8px; grid-template-columns:48px minmax(64px,1fr) 1px minmax(96px,1.5fr) 1px minmax(96px,1.5fr); gap:var(--fleet-card-gap); }
.fleet-availability-deadline .deadline-icon { flex-basis:46px; width:46px; height:46px; }
.fleet-availability-deadline b { min-height:46px; }
.fleet-availability-deadline svg.deadline-icon { display:block; flex:0 0 32px; width:32px; height:32px; border:0; border-radius:0; fill:none; stroke:currentColor; stroke-linecap:round; stroke-linejoin:round; stroke-width:1.8; }.fleet-availability-deadline svg.deadline-icon.is-km { color:#ef981b; }.fleet-availability-deadline svg.deadline-icon.is-time { color:#159ac1; }
/* Icone delle scadenze: stessa presenza visiva dell'icona treno. */
.fleet-availability-deadline svg.deadline-icon { flex-basis:40px; width:40px; height:40px; }
/* Modulo fuori servizio integrato nella pagina Gestione Servizi. */
.fleet-inline-stop { display:grid; gap:10px; margin-top:12px; }.fleet-inline-stop p, .fleet-inline-stop > label { margin:0; color:#284a58; font-size:12px; font-weight:800; }.fleet-inline-stop input, .fleet-inline-stop textarea, .fleet-inline-email input, .fleet-inline-email textarea { width:100%; box-sizing:border-box; margin-top:4px; }.fleet-inline-datetime, .fleet-inline-reasons { display:grid; grid-template-columns:1fr 1fr; gap:10px; }.fleet-inline-datetime label { color:#284a58; font-size:12px; font-weight:800; }.fleet-inline-reasons button { min-height:52px; border:1px solid #cbdde2; border-radius:7px; color:#41616e; background:#fff; font:inherit; font-size:12px; font-weight:800; }.fleet-inline-reasons button.is-selected { border-color:#007b9f; color:#007b9f; background:#eef9fc; }.fleet-inline-stop footer { display:flex; align-items:center; justify-content:space-between; gap:8px; padding-top:10px; border-top:1px solid #dce7e9; color:#536f7a; font-size:11px; }.fleet-inline-stop footer div { display:flex; gap:8px; }.fleet-inline-email { display:grid; gap:9px; margin-top:16px; padding-top:14px; border-top:1px solid #dce7e9; }.fleet-inline-email h3 { margin:0; color:#183d4d; font-size:14px; }.fleet-inline-email > label { color:#355564; font-size:12px; font-weight:750; }.fleet-inline-email > label:first-of-type input { width:auto; margin:0 5px 0 0; }.fleet-inline-manage-email { justify-self:end; margin-top:-28px; border:0; color:#007b9f; background:none; font:inherit; font-size:11px; font-weight:800; }.fleet-inline-recipients { display:flex; flex-wrap:wrap; gap:8px; }.fleet-inline-recipients label { padding:6px 8px; border-radius:5px; background:#f2f7f8; color:#375762; font-size:11px; }.fleet-inline-recipients input { width:auto; margin:0 4px 0 0; }
/* Il messaggio iniziale non serve: il modulo è già disponibile. */
.fleet-availability-note { display:none; }
.fleet-inline-stop { gap:7px; margin-top:8px; }.fleet-inline-stop textarea { min-height:58px; }.fleet-inline-stop footer { padding-top:7px; }.fleet-inline-email { gap:6px; margin-top:10px; padding-top:10px; }.fleet-inline-email textarea { min-height:58px; }
.fleet-availability-fleet.is-inline-stop .fleet-availability-trains { min-height:266px; max-height:266px; }
.fleet-availability-actions > section:first-child .fleet-availability-state button { min-height:66px; padding:8px; }.fleet-availability-actions > section:first-child .fleet-availability-state img { width:38px; height:38px; }.fleet-inline-reasons button { min-height:42px; }.fleet-inline-stop textarea, .fleet-inline-email textarea { min-height:42px; }.fleet-inline-stop { gap:5px; }.fleet-inline-email { gap:5px; }
.fleet-availability-actions { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }.fleet-availability-actions > section, .fleet-inline-stop, .fleet-inline-email { min-width:0; }.fleet-inline-recipients { min-width:0; }.fleet-inline-recipients label { white-space:nowrap; }
@media (min-width:561px) { body[data-active-view="fleet-availability-view"] { height:100%; overflow:hidden; } body[data-active-view="fleet-availability-view"] main { height:calc(100vh - 30px); height:calc(100dvh - 30px); margin-bottom:0; overflow:hidden; } #fleet-availability-view.is-active { height:100%; min-height:0; } #fleet-availability-view.is-active #fleet-availability-content { min-height:0; } }
@media (min-width:561px) { #fleet-availability-view.is-active #fleet-availability-content { flex:1; grid-template-rows:auto minmax(0,1fr); } #fleet-availability-view.is-active .fleet-availability-actions { min-height:0; } #fleet-availability-view.is-active .fleet-availability-actions > section { min-height:0; } }
.fleet-inline-reasons { grid-template-columns:1fr 1fr 1fr; position:relative; }.fleet-inline-other-reasons { position:relative; }.fleet-inline-other-reasons summary { display:flex; min-height:42px; align-items:center; justify-content:center; gap:8px; border:1px solid #8fc4ca; border-radius:7px; color:#007b9f; background:#fff; font-size:12px; font-weight:800; cursor:pointer; list-style:none; }.fleet-inline-other-reasons summary::-webkit-details-marker { display:none; }.fleet-inline-other-reasons[open] > div { position:absolute; z-index:5; top:47px; right:0; display:grid; width:250px; padding:5px; border:1px solid #cbdde2; border-radius:7px; background:#fff; box-shadow:0 8px 18px rgba(27,55,65,.17); }.fleet-inline-other-reasons[open] button { min-height:30px; padding:6px 8px; border:0; border-radius:4px; color:#274b59; background:#fff; font:inherit; font-size:11px; font-weight:700; text-align:left; }.fleet-inline-other-reasons[open] button:hover { background:#eef8fb; }
.fleet-inline-stop { height:auto; align-content:start; gap:8px; }.fleet-inline-stop footer { margin-top:26px; }
.fleet-availability-actions { grid-template-rows:auto minmax(0,1fr); }.fleet-availability-actions > section:first-child { grid-column:1; grid-row:1 / span 2; }.fleet-availability-work { grid-column:2; grid-row:1; align-self:start; }.fleet-email-panel { grid-column:2; grid-row:2; min-height:0; padding:16px; border:1px solid #d5e2e6; border-radius:10px; background:#fff; box-shadow:0 5px 15px rgba(27,55,65,.06); }.fleet-email-panel h2 { margin:0; color:#183d4d; font-size:16px; }

/* Cruscotto: pannelli chiari come Gestione Servizi. */
@media (min-width:901px) {
  #alerts-view .alerts-dashboard-heading,
  #alerts-view .alerts-calendar-panel > .alerts-dashboard-heading {
    min-height:40px;
    box-sizing:border-box;
    padding:0 14px;
    color:#183d4d;
    background:#fff;
    border-bottom:1px solid #e3eaec;
  }
  #alerts-view .alerts-dashboard-heading p {
    color:#17252c;
    font-family:Bahnschrift, "Segoe UI", sans-serif;
    font-size:16px;
    font-weight:600;
    letter-spacing:.015em;
  }
  #alerts-view .dashboard-heading-link {
    color:#006f97;
    border-bottom-color:#9fc8d4;
  }
  #alerts-view .alerts-calendar-panel > .alerts-dashboard-heading { padding-right:10px; padding-left:10px; }
  #alerts-view .alerts-calendar-panel .calendar-header-navigation strong { color:#183d4d; }
  #alerts-view .alerts-calendar-panel .calendar-header-navigation .forecast-calendar-nav {
    border-color:#cbdde2;
    color:#006f97;
    background:#fff;
  }
  #alerts-view .alerts-calendar-panel .calendar-header-navigation .forecast-calendar-nav:hover,
  #alerts-view .alerts-calendar-panel .calendar-header-navigation .forecast-calendar-nav:focus-visible {
    color:#fff;
    background:#006f97;
  }
  #alerts-view .alerts-calendar-panel #open-forecast-calendar-dialog { color:#17252c; }
  #alerts-view .alerts-calendar-panel #open-forecast-calendar-dialog:hover,
  #alerts-view .alerts-calendar-panel #open-forecast-calendar-dialog:focus-visible { color:#17252c; background:transparent; }
  #alerts-view .alerts-forecast-panel .fleet-alert-table th { background:#f2f4f5; }
  #alerts-view .forecast-calendar-weekday { background:#f2f4f5; }
}

/* Agenda: intestazione coerente con le finestre di Gestione Servizi. */
#maintenance-agenda-view .agenda-detail-heading {
  color:#17252c;
  background:#fff;
  border-bottom:1px solid #e3eaec;
  font-family:Bahnschrift, "Segoe UI", sans-serif;
  font-size:16px;
  font-weight:600;
  letter-spacing:.015em;
}
#maintenance-agenda-view .agenda-detail-heading svg { color:#17252c; }

/* Mese Agenda e controlli del calendario con la stessa tipografia dei Servizi. */
#maintenance-agenda-view .agenda-month { justify-content:flex-start; width:auto; }
#maintenance-agenda-view #agenda-month-title {
  min-width:0;
  color:#17252c;
  font-family:Bahnschrift, "Segoe UI", sans-serif;
  font-size:16px;
  font-weight:600;
  letter-spacing:.015em;
  text-align:left;
}
@media (min-width:901px) {
  #alerts-view .alerts-calendar-panel .calendar-header-navigation strong,
  #alerts-view .alerts-calendar-panel #open-forecast-calendar-dialog span {
    font-family:Bahnschrift, "Segoe UI", sans-serif;
    font-weight:600;
    letter-spacing:.015em;
  }
  #alerts-view .alerts-calendar-panel .calendar-header-navigation strong { color:#17252c; }
}

/* Il motivo selezionato resta leggibile in nero. */
.fleet-inline-reasons button.is-selected,
.fleet-inline-other-reasons summary { color:#17252c; }
/* Phase 5: localized additions inside the existing service/plan panels. */
.fleet-availability-trains:has(.has-temporal-plans) { grid-template-columns:repeat(auto-fit,minmax(min(100%,350px),1fr)); }
.fleet-availability-deadline.has-temporal-cycles b { min-height: 18px; font-size: 13px; }
.fleet-availability-deadline.has-temporal-cycles em { white-space: normal; font-size: 10px; line-height: 1.3; margin-bottom: 5px; }
.temporal-order-list small { font-size: 12px; line-height: 1.5; }
.temporal-order-list small { display: block; margin-top: 4px; }

/* Densità adattiva: le viste reagiscono alla larghezza utile di main, non al viewport. */
main {
  container-name:workspace;
  container-type:inline-size;
  --ui-gap:16px;
  --ui-pad:16px;
  --ui-table-pad-y:10px;
  --ui-table-pad-x:12px;
  --ui-secondary-font:12px;
}
main > .view { min-width:0; }

/* La sidebar è esterna al container: solo questo adattamento resta viewport-based. */
@media (min-width:901px) and (max-width:1600px) {
  body:not(.maintenance-active) main { margin-left:calc(var(--sidebar-width) + 30px); }
  .app-header { padding:20px 13px 14px; }
  .brand { min-height:60px; padding-bottom:14px; }
  .app-header .brand-mark { flex-basis:46px; width:46px; height:46px; }
  .tabs { margin-top:14px; }
}
@media (min-width:901px) and (max-width:1450px) {
  :root { --sidebar-width:235px; }
  .tab { height:40px; min-height:40px; padding-right:36px; font-size:10.5px; }
  .tab .count,
  .tab .backup-nav-alert,
  .tab .competency-nav-alert { right:8px; }
}

/* Desktop compatto: main compreso tra 1200 e 1799 px. */
@container workspace (min-width:1200px) and (max-width:1799px) {
  main > .view {
    --ui-gap:12px;
    --ui-pad:14px;
    --ui-table-pad-y:8px;
    --ui-table-pad-x:7px;
    --ui-secondary-font:11px;
  }
  #alerts-view .alerts-dashboard {
    grid-template-columns:230px repeat(3,minmax(0,1fr));
    gap:var(--ui-gap);
  }
  #alerts-view .alerts-operational-summary { grid-column:1; grid-row:1; }
  #alerts-view .alerts-forecast-panel { grid-column:2 / -1; grid-row:1; }
  #alerts-view .alerts-circulation-panel { grid-column:1 / span 2; grid-row:2; }
  #alerts-view .alerts-depot-panel { grid-column:3; grid-row:2; }
  #alerts-view .alerts-calendar-panel { grid-column:4; grid-row:2; }
  #alerts-view .alerts-dashboard-alerts { gap:10px; }
  #alerts-view .fleet-alert-table { font-size:var(--ui-secondary-font); }
  #alerts-view .fleet-alert-table th,
  #alerts-view .fleet-alert-table td { padding:var(--ui-table-pad-y) var(--ui-table-pad-x); }
  #alerts-view .fleet-alert-table th { white-space:normal; line-height:1.15; }

  #fleet-availability-view .fleet-availability-trains:not(:has(.has-temporal-plans)) {
    grid-template-columns:repeat(auto-fit,minmax(min(100%,360px),1fr));
  }
  #fleet-availability-view .fleet-availability-train {
    grid-template-columns:40px minmax(84px,1.2fr) 1px minmax(68px,.9fr) 1px minmax(118px,1.35fr);
    gap:6px;
    padding:5px 7px;
  }
  #fleet-availability-view .fleet-availability-train.is-selected { padding:4px 6px; }
  #fleet-availability-view .fleet-availability-train img { width:40px; height:40px; }
  #fleet-availability-view .fleet-availability-train-data strong { font-size:13.5px; }
  #fleet-availability-view .fleet-availability-train-data small { font-size:9px; }
  #fleet-availability-view .fleet-availability-deadline svg.deadline-icon { flex-basis:22px; width:22px; height:22px; }
  #fleet-availability-view .fleet-availability-deadline b { min-height:36px; gap:2px; font-size:17px; }
  #fleet-availability-view .fleet-availability-deadline em { font-size:8.5px; line-height:1.15; white-space:normal; }
  #fleet-availability-view .deadline-state { width:9px; height:9px; }
  #maintenance-agenda-view .agenda-layout { grid-template-columns:minmax(0,1fr) 400px; }
  #personnel-management-view .maintainer-workspace,
  #personnel-management-view .email-notifications-grid { grid-template-columns:240px minmax(0,1fr); gap:var(--ui-gap); }
  #personnel-management-view [data-settings-panel="scheduled-catalog"] .scheduled-plans-layout { grid-template-columns:250px minmax(0,1fr); gap:var(--ui-gap); }

  #work-center-view .scheduled-document-sheet,
  #work-center-view .scheduled-inline-table-wrap .scheduled-checklist-table {
    width:100%;
    min-width:0;
  }
  #work-center-view .scheduled-inline-table-wrap { overflow-x:hidden; }
  #work-center-view .scheduled-inline-table-wrap .scheduled-checklist-table { table-layout:fixed; font-size:10px; }
  #work-center-view .scheduled-inline-table-wrap .scheduled-checklist-table th,
  #work-center-view .scheduled-inline-table-wrap .scheduled-checklist-table td {
    padding:7px 5px;
    overflow-wrap:anywhere;
    white-space:normal;
  }
  #scheduled-maintenance-view .scheduled-execution-table { min-width:0; table-layout:fixed; }
  #scheduled-maintenance-view .scheduled-execution-table th,
  #scheduled-maintenance-view .scheduled-execution-table td {
    padding:8px 7px;
    overflow-wrap:anywhere;
    white-space:normal;
  }
}

/* Desktop stretto: main inferiore a 1200 px. */
@container workspace (max-width:1199px) {
  main > .view {
    --ui-gap:10px;
    --ui-pad:12px;
    --ui-table-pad-y:6px;
    --ui-table-pad-x:5px;
    --ui-secondary-font:10px;
  }
  .page-heading,
  #fleet-availability-view .fleet-availability-heading,
  #alerts-view .alerts-heading { min-height:64px; padding:12px 20px; }
  .page-heading h1,
  #fleet-availability-view .fleet-availability-heading h1,
  #alerts-view .alerts-heading h1 { font-size:25px; }

  #alerts-view .alerts-dashboard {
    grid-template-columns:repeat(2,minmax(0,1fr));
    grid-template-rows:minmax(130px,auto) minmax(250px,auto) minmax(180px,auto) minmax(300px,auto);
    gap:var(--ui-gap);
    min-height:0;
    flex:0 0 auto;
  }
  #alerts-view .alerts-operational-summary {
    grid-column:1 / -1;
    grid-row:1;
    grid-template-columns:repeat(3,minmax(0,1fr));
    grid-template-rows:minmax(0,1fr);
  }
  #alerts-view .alerts-operational-summary article { margin:8px; }
  #alerts-view .alerts-operational-summary article + article { margin-left:0; }
  #alerts-view .alerts-forecast-panel { grid-column:1 / -1; grid-row:2; }
  #alerts-view .alerts-circulation-panel { grid-column:1; grid-row:3; }
  #alerts-view .alerts-depot-panel { grid-column:2; grid-row:3; }
  #alerts-view .alerts-calendar-panel { grid-column:1 / -1; grid-row:4; }
  #alerts-view .fleet-alert-table { font-size:var(--ui-secondary-font); table-layout:fixed; }
  #alerts-view .fleet-alert-table th,
  #alerts-view .fleet-alert-table td {
    padding:var(--ui-table-pad-y) var(--ui-table-pad-x);
    white-space:normal;
    line-height:1.1;
  }
  #alerts-view .fleet-alert-icon,
  #alerts-view .fleet-alert-sync-icon { width:23px; height:23px; }

  #fleet-availability-view .fleet-availability-trains:not(:has(.has-temporal-plans)) {
    grid-template-columns:repeat(auto-fit,minmax(min(100%,330px),1fr));
    gap:var(--ui-gap);
  }
  #fleet-availability-view .fleet-availability-fleet,
  #fleet-availability-view .fleet-availability-actions > section,
  #fleet-availability-view .fleet-email-panel { padding:var(--ui-pad); }
  #fleet-availability-view .fleet-availability-train {
    grid-template-columns:36px minmax(82px,1.25fr) 1px minmax(66px,.8fr) 1px minmax(107px,1.25fr);
    gap:5px;
    padding:5px 6px;
  }
  #fleet-availability-view .fleet-availability-train.is-selected { padding:4px 5px; }
  #fleet-availability-view .fleet-availability-train img { width:36px; height:36px; }
  #fleet-availability-view .fleet-availability-train-data strong { font-size:13px; }
  #fleet-availability-view .fleet-availability-train-data small { font-size:8.5px; }
  #fleet-availability-view .fleet-availability-deadline svg.deadline-icon { flex-basis:20px; width:20px; height:20px; }
  #fleet-availability-view .fleet-availability-deadline b { min-height:34px; gap:2px; font-size:15px; }
  #fleet-availability-view .fleet-availability-deadline .deadline-state { width:9px; height:9px; }
  #fleet-availability-view .fleet-availability-deadline em { font-size:8px; line-height:1.15; white-space:normal; }
  #fleet-availability-view .deadline-state { width:8px; height:8px; }

  #maintenance-agenda-view .agenda-layout { grid-template-columns:minmax(0,1fr) 320px; }
  #maintenance-agenda-view .agenda-toolbar { gap:8px; padding:8px 10px; }
  #maintenance-agenda-view .agenda-legend span { padding:6px 7px; font-size:10px; }
  #maintenance-agenda-view .agenda-calendar .forecast-calendar-day { padding:5px; }

  #personnel-management-view .maintainer-workspace,
  #personnel-management-view .email-notifications-grid { grid-template-columns:210px minmax(0,1fr); gap:var(--ui-gap); }
  #personnel-management-view [data-settings-panel="scheduled-catalog"] .scheduled-plans-layout { grid-template-columns:220px minmax(0,1fr); gap:var(--ui-gap); }
  #personnel-management-view .settings-tabs { max-width:100%; overflow-x:auto; scrollbar-width:thin; }
  #personnel-management-view .settings-tab { flex:0 0 auto; white-space:nowrap; }

  #work-center-view.is-active { grid-template-columns:minmax(205px,220px) minmax(0,1fr); }
  #work-center-view .scheduled-inline-workspace { grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(320px,1fr) auto; }
  #work-center-view .scheduled-inline-actions { max-height:260px; overflow-y:auto; }
  #work-center-view .scheduled-document-sheet,
  #work-center-view .scheduled-inline-table-wrap .scheduled-checklist-table { width:100%; min-width:0; }
  #work-center-view .scheduled-inline-table-wrap { overflow-x:hidden; overflow-y:auto; }
  #work-center-view .scheduled-inline-table-wrap .scheduled-checklist-table { table-layout:fixed; font-size:9.5px; }
  #work-center-view .scheduled-inline-table-wrap .scheduled-checklist-table th,
  #work-center-view .scheduled-inline-table-wrap .scheduled-checklist-table td {
    padding:5px 3px;
    overflow-wrap:anywhere;
    white-space:normal;
    line-height:1.15;
  }

  #scheduled-maintenance-view .scheduled-operator-workspace {
    grid-template-columns:minmax(205px,220px) minmax(0,1fr);
    grid-template-rows:minmax(0,1fr) auto;
    gap:var(--ui-gap);
  }
  #scheduled-maintenance-view .scheduled-operator-side {
    grid-column:1 / -1;
    grid-template-columns:repeat(2,minmax(0,1fr));
    grid-template-rows:auto;
    max-height:180px;
  }
  #scheduled-maintenance-view .scheduled-execution-table { min-width:0; table-layout:fixed; font-size:10px; }
  #scheduled-maintenance-view .scheduled-execution-table th,
  #scheduled-maintenance-view .scheduled-execution-table td {
    padding:6px 4px;
    overflow-wrap:anywhere;
    white-space:normal;
  }

  .material-table { min-width:1050px; }
}

/* Vincoli condivisi dalle modalità compatta e stretta. */
@container workspace (max-width:1799px) {
  #alerts-view .alerts-forecast-panel .fleet-alert-table {
    width:100%;
    min-width:0;
    table-layout:fixed;
  }
  #alerts-view .alerts-forecast-panel .fleet-alert-table th,
  #alerts-view .alerts-forecast-panel .fleet-alert-table td {
    overflow-wrap:normal;
    word-break:normal;
    white-space:normal;
  }
  #alerts-view .alerts-forecast-panel .fleet-alert-table :is(th,td):nth-child(1) { width:5%; }
  #alerts-view .alerts-forecast-panel .fleet-alert-table :is(th,td):nth-child(2) { width:7%; }
  #alerts-view .alerts-forecast-panel .fleet-alert-table :is(th,td):nth-child(3) { width:6%; }
  #alerts-view .alerts-forecast-panel .fleet-alert-table :is(th,td):nth-child(4) { width:5%; }
  #alerts-view .alerts-forecast-panel .fleet-alert-table :is(th,td):nth-child(5) { width:10%; }
  #alerts-view .alerts-forecast-panel .fleet-alert-table :is(th,td):nth-child(6) { width:11%; }
  #alerts-view .alerts-forecast-panel .fleet-alert-table :is(th,td):nth-child(7) { width:7%; }
  #alerts-view .alerts-forecast-panel .fleet-alert-table :is(th,td):nth-child(8) { width:8%; }
  #alerts-view .alerts-forecast-panel .fleet-alert-table :is(th,td):nth-child(9) { width:8%; }
  #alerts-view .alerts-forecast-panel .fleet-alert-table :is(th,td):nth-child(10) { width:8%; }
  #alerts-view .alerts-forecast-panel .fleet-alert-table :is(th,td):nth-child(11) { width:14%; }
  #alerts-view .alerts-forecast-panel .fleet-alert-table :is(th,td):nth-child(12) { width:11%; }

  #fleet-availability-view.is-active #fleet-availability-content { width:100%; min-width:0; overflow:hidden; }
  #fleet-availability-view .fleet-availability-train,
  #fleet-availability-view .fleet-availability-train > *,
  #fleet-availability-view .fleet-availability-train-data,
  #fleet-availability-view .fleet-availability-deadline { min-width:0; }
  #fleet-availability-view .fleet-availability-actions { min-width:0; min-height:0; overflow:hidden; }
  #fleet-availability-view .fleet-availability-actions > section,
  #fleet-availability-view .fleet-email-panel { max-height:100%; overflow-y:auto; scrollbar-gutter:stable; }

  .fleet-register-table-wrap,
  .scheduled-table-wrap,
  .scheduled-execution-table-wrap,
  .scheduled-inline-table-wrap,
  .competency-monitoring-table-wrap,
  .competency-train-table-wrap,
  .personnel-table-wrap,
  .maintenance-table-wrap { max-width:100%; }
}

/* Sui desktop bassi il Cruscotto usa lo scroll verticale della pagina, mai quello orizzontale. */
@media (min-width:901px) and (max-width:1450px) {
  html:has(body[data-active-view="alerts-view"]),
  body[data-active-view="alerts-view"] { height:auto; min-height:100%; overflow-x:hidden; overflow-y:auto; }
  body[data-active-view="alerts-view"] main { height:auto; min-height:calc(100dvh - 30px); overflow:visible; }
  #alerts-view.is-active { height:auto; min-height:calc(100dvh - 30px); }
}

/* Dialog operativi: contenuto verticale locale e azioni sempre raggiungibili. */
@media (min-width:901px) and (max-width:2199px) {
  #fleet-out-of-service-dialog,
  #fleet-return-to-service-dialog {
    max-width:calc(100vw - 32px);
    max-height:calc(100dvh - 32px);
  }
  #fleet-out-of-service-dialog[open],
  #fleet-return-to-service-dialog[open] { display:flex; flex-direction:column; }
  #fleet-out-of-service-dialog .fleet-out-of-service-content,
  #fleet-return-to-service-dialog .fleet-out-of-service-content { min-height:0; overflow-y:auto; }
  #fleet-out-of-service-dialog .fleet-out-of-service-footer,
  #fleet-return-to-service-dialog .fleet-out-of-service-footer { flex:0 0 auto; flex-wrap:wrap; }
}

/* Flotta: lo scorrimento resta verticale; le card distribuiscono i tre blocchi senza overflow laterale. */
#fleet-availability-view .fleet-availability-trains { overflow-x:hidden; }

@container workspace (min-width:1800px) {
  #fleet-availability-view .fleet-availability-train {
    grid-template-columns:40px minmax(80px,1.2fr) 1px minmax(73px,.85fr) 1px minmax(112px,1.25fr);
    gap:5px;
    padding:6px;
  }
  #fleet-availability-view .fleet-availability-train.is-selected { padding:5px; }
  #fleet-availability-view .fleet-availability-train img { width:40px; height:40px; }
  #fleet-availability-view .fleet-availability-deadline svg.deadline-icon { flex-basis:22px; width:22px; height:22px; }
  #fleet-availability-view .fleet-availability-deadline b { min-height:38px; gap:2px; font-size:17px; }
  #fleet-availability-view .fleet-availability-deadline .deadline-state { width:9px; height:9px; }
}

/* Calendario previsioni: tre aree indipendenti quando il pannello ha spazio. */
@container workspace (min-width:1400px) and (max-width:1799px) {
  #alerts-view .alerts-calendar-panel > .alerts-dashboard-heading {
    display:grid;
    grid-template-columns:minmax(105px,1fr) auto minmax(72px,1fr);
    align-items:center;
    gap:6px;
  }
  #alerts-view .alerts-calendar-panel > .alerts-dashboard-heading > p {
    min-width:0;
    font-size:12.5px;
    line-height:1;
    white-space:normal;
  }
  #alerts-view .alerts-calendar-panel .calendar-header-navigation {
    position:static;
    left:auto;
    grid-template-columns:22px minmax(88px,112px) 22px;
    gap:4px;
    justify-self:center;
    transform:none;
  }
  #alerts-view .alerts-calendar-panel .calendar-header-navigation strong {
    min-width:0;
    font-size:12px;
  }
  #alerts-view .alerts-calendar-panel .calendar-header-navigation .forecast-calendar-nav {
    width:22px;
    height:22px;
    font-size:18px;
  }
  #alerts-view .alerts-calendar-panel #open-forecast-calendar-dialog {
    position:static;
    justify-self:end;
    min-width:0;
    padding:0 2px;
  }
  #alerts-view .alerts-calendar-panel #open-forecast-calendar-dialog span { font-size:9.5px; }
}

/* Pannello calendario più stretto: solo la testata passa su due righe. */
@container workspace (max-width:1399px) {
  #alerts-view .alerts-calendar-panel > .alerts-dashboard-heading {
    display:grid;
    height:64px;
    min-height:64px;
    grid-template-columns:minmax(0,1fr) auto;
    grid-template-rows:28px 28px;
    align-items:center;
    gap:0 8px;
    padding:4px 10px;
  }
  #alerts-view .alerts-calendar-panel > .alerts-dashboard-heading > p {
    grid-column:1;
    grid-row:1;
    min-width:0;
    font-size:13px;
    line-height:1.1;
    white-space:nowrap;
  }
  #alerts-view .alerts-calendar-panel #open-forecast-calendar-dialog {
    position:static;
    grid-column:2;
    grid-row:1;
    justify-self:end;
    min-width:0;
  }
  #alerts-view .alerts-calendar-panel #open-forecast-calendar-dialog span { font-size:10px; }
  #alerts-view .alerts-calendar-panel .calendar-header-navigation {
    position:static;
    left:auto;
    grid-column:1 / -1;
    grid-row:2;
    grid-template-columns:22px minmax(100px,150px) 22px;
    gap:6px;
    justify-self:center;
    transform:none;
  }
  #alerts-view .alerts-calendar-panel .calendar-header-navigation strong {
    min-width:0;
    font-size:12px;
  }
  #alerts-view .alerts-calendar-panel .calendar-header-navigation .forecast-calendar-nav {
    width:22px;
    height:22px;
    font-size:18px;
  }
}

/* Gestione Servizi: badge flotta piu compatto e distribuito sul contenuto. */
#fleet-availability-view .fleet-availability-train {
  grid-template-columns:34px minmax(78px,max-content) 1px minmax(86px,1fr) 1px minmax(106px,1fr);
  gap:5px;
  min-height:72px;
  padding:4px 7px;
}
#fleet-availability-view .fleet-availability-train.is-selected { padding:3px 6px; }
#fleet-availability-view .fleet-availability-train img { width:34px; height:34px; }
#fleet-availability-view .fleet-availability-train-data,
#fleet-availability-view .fleet-availability-deadline { gap:2px; }
#fleet-availability-view .fleet-availability-train-data strong { font-size:12.5px; }
#fleet-availability-view .fleet-availability-deadline svg.deadline-icon {
  flex-basis:20px;
  width:20px;
  height:20px;
}
#fleet-availability-view .fleet-availability-deadline b {
  min-height:32px;
  gap:3px;
  font-size:15px;
}
#fleet-availability-view .fleet-availability-deadline em {
  overflow-wrap:anywhere;
  white-space:normal;
}
