:root {
  --page: #f4f7fb;
  --surface: #ffffff;
  --soft: #eef5ff;
  --ink: #172033;
  --muted: #64748b;
  --line: #d8e2ef;
  --primary: #0d6efd;
  --primary-dark: #084298;
  --accent: #c97b2b;
  --danger: #b5413d;
  --ok: #0b5ed7;
  --shadow: 0 18px 42px rgba(15, 23, 42, 0.10);
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; color: var(--ink); background: var(--page); font-family: Arial, Helvetica, sans-serif; line-height: 1.45; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 1.55rem; line-height: 1.15; }
h2 { margin-bottom: 0; font-size: 1.14rem; }
h3 { margin: 0; font-size: 1rem; }
.app-shell { width: min(1240px, 100%); margin: 0 auto; padding: 18px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0 20px; }
.brand-block, .top-actions { display: flex; align-items: center; gap: 12px; min-width: 0; }
.top-actions { justify-content: flex-end; flex-wrap: wrap; }
.brand-icon { width: 44px; height: 44px; flex: 0 0 auto; }
.eyebrow { margin: 0 0 3px; color: var(--muted); font-size: 0.78rem; text-transform: uppercase; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 18px; }
.work-grid { display: grid; grid-template-columns: minmax(360px, 1fr) minmax(320px, 430px); gap: 18px; align-items: start; }
.summary-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-heading.compact { margin-bottom: 12px; }
.summary-pill, .status-badge { min-height: 32px; display: inline-flex; align-items: center; justify-content: center; padding: 6px 10px; border-radius: 999px; border: 1px solid rgba(13,110,253,.25); background: var(--soft); color: var(--primary-dark); font-weight: 700; font-size: .85rem; white-space: nowrap; }
.summary-pill.muted { color: var(--muted); border-color: var(--line); background: #f7faff; }
.summary-pill.warn, .status-badge.offline { color: var(--danger); border-color: rgba(181,65,61,.28); background: #fff1ef; }
.wide-pill { width: 100%; margin: 10px 0; }
.report-form, .filters-form { display: grid; gap: 12px; }
.form-row { display: grid; gap: 12px; }
.form-row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
label { display: grid; gap: 6px; color: var(--muted); font-weight: 700; font-size: .88rem; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); outline: none; }
input, select { min-height: 46px; padding: 10px 12px; }
textarea { padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,110,253,.14); }

.field-hint { display: block; color: var(--muted); font-size: .78rem; font-weight: 600; line-height: 1.25; }
.info-strip { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #f8fbff; color: var(--muted); font-size: .92rem; }
.warn-strip { color: var(--danger); background: #fff7f6; border-color: rgba(181,65,61,.25); }
.primary-button, .secondary-button, .small-button { min-height: 44px; border-radius: 8px; border: 1px solid transparent; font-weight: 800; text-decoration: none; }
.primary-button { padding: 10px 16px; color: #fff; background: var(--primary); }
.primary-button:hover, .primary-button:focus-visible { background: var(--primary-dark); }
.secondary-button, .small-button { padding: 10px 13px; color: var(--ink); background: #fff; border-color: var(--line); }
.secondary-button:hover, .secondary-button:focus-visible, .small-button:hover, .small-button:focus-visible { border-color: var(--primary); }
.nav-button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; }
.danger-button { color: var(--danger); border-color: rgba(181,65,61,.30); background: #fff7f6; }
.danger-button.is-muted { opacity: .55; cursor: pointer; }
.form-actions, .queue-control-row, .filter-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sticky-actions { position: sticky; bottom: 0; padding-top: 8px; background: linear-gradient(rgba(255,255,255,0), #fff 26%); }
.signature-block { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.signature-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border-bottom: 1px solid var(--line); background: #f8fbff; }
.signature-pad { width: 100%; height: 180px; display: block; touch-action: none; background: #fff; }
.file-zone { min-height: 132px; display: grid; place-items: center; gap: 6px; padding: 18px; border: 2px dashed #aab8c8; border-radius: 8px; background: #f8fbff; text-align: center; }
.file-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-zone-title { color: var(--primary-dark); font-weight: 800; font-size: 1.04rem; }
.file-zone-meta { color: var(--muted); font-size: .92rem; }
.queue-list, .photo-grid { display: grid; gap: 10px; }
.queue-item { display: grid; grid-template-columns: 62px 1fr; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.queue-thumb { width: 62px; height: 62px; border-radius: 6px; object-fit: cover; background: var(--soft); }
.queue-body { min-width: 0; display: grid; gap: 6px; }
.queue-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.queue-title { margin: 0; font-weight: 800; overflow-wrap: anywhere; }
.queue-meta { margin: 0; color: var(--muted); font-size: .86rem; overflow-wrap: anywhere; }
.item-status { flex: 0 0 auto; font-size: .78rem; font-weight: 800; color: var(--primary-dark); background: var(--soft); border-radius: 999px; padding: 4px 8px; }
.item-status.failed, .item-status.blocked { color: var(--danger); background: #fff1ef; }
.progress-track { width: 100%; height: 8px; overflow: hidden; border-radius: 999px; background: #e8eef7; }
.progress-bar { width: 0%; height: 100%; border-radius: inherit; background: var(--accent); transition: width 180ms ease; }
.photo-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.compact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.photo-link { display: block; aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); background: var(--soft); }
.photo-link img { width: 100%; height: 100%; display: block; object-fit: cover; }
.gallery-title-row { margin-top: 18px; }
.empty-state { min-height: 88px; display: grid; align-items: center; padding: 16px; color: var(--muted); background: #f7faff; border: 1px solid var(--line); border-radius: 8px; }
.filters-form { grid-template-columns: 1.3fr .8fr .9fr .7fr .7fr auto; align-items: end; }
.table-wrap { overflow-x: auto; }
.reports-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.reports-table th, .reports-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.reports-table th { color: var(--muted); font-size: .78rem; text-transform: uppercase; }
.code-cell { font-weight: 800; color: var(--primary-dark); }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-bottom: 14px; }
.detail-card { padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #f8fbff; }
.detail-card span { display: block; color: var(--muted); font-size: .78rem; text-transform: uppercase; }
.detail-card strong { display: block; overflow-wrap: anywhere; }
.notes-block { display: grid; gap: 8px; margin: 12px 0; }
.signature-preview { max-width: 360px; width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.toast { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); width: min(520px, calc(100% - 28px)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 12px 14px; border-radius: 8px; background: #172033; color: #fff; box-shadow: var(--shadow); transition: opacity 160ms ease, transform 160ms ease; z-index: 20; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 980px) { .work-grid { grid-template-columns: 1fr; } .filters-form { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .app-shell { padding: 14px; } .topbar { align-items: flex-start; flex-direction: column; } .top-actions { width: 100%; justify-content: space-between; } .form-row.two, .form-row.three, .form-actions, .queue-control-row, .filter-actions, .filters-form, .detail-grid { grid-template-columns: 1fr; } .panel { padding: 14px; } .signature-pad { height: 160px; } .compact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }


.queue-control-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 700px) { .queue-control-row { grid-template-columns: 1fr; } }

.inline-form-button {
  align-self: end;
  min-height: 48px;
  width: 100%;
}


.car-pick-row {
  grid-template-columns: minmax(0, 1.15fr) minmax(130px, .45fr) minmax(0, 1fr);
  align-items: end;
}

@media (max-width: 700px) {
  .car-pick-row {
    grid-template-columns: 1fr;
  }
}

/* Menu e nuova interfaccia caricamenti */
.menu-shell { max-width: 760px; }
.menu-grid { display: grid; gap: 14px; margin-top: 6px; }
.menu-card { display: flex; align-items: center; gap: 16px; min-height: 112px; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); text-decoration: none; }
.menu-card:hover, .menu-card:focus-visible { border-color: var(--primary); outline: none; }
.menu-card-icon { width: 54px; height: 54px; flex: 0 0 54px; display: inline-flex; align-items: center; justify-content: center; border-radius: 14px; background: var(--soft); color: var(--primary-dark); font-size: 1.8rem; font-weight: 900; }
.menu-card-body { display: grid; gap: 4px; min-width: 0; }
.menu-card-body strong { font-size: 1.15rem; }
.menu-card-body small { color: var(--muted); font-size: .92rem; line-height: 1.35; }
.new-report-top { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; }
.single-action { grid-template-columns: 1fr; }
.upload-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.upload-detail-grid .detail-card:last-child { grid-column: 1 / -1; }
.uploads-filters-form { grid-template-columns: 1.3fr .75fr .75fr .7fr .7fr auto; }
@media (max-width: 700px) {
  .menu-card { min-height: 104px; padding: 16px; }
  .menu-card-icon { width: 48px; height: 48px; flex-basis: 48px; }
  .upload-detail-grid, .uploads-filters-form { grid-template-columns: 1fr; }
  .new-report-top { flex: 1 1 140px; }
}


/* Dettaglio report, download e visualizzatore foto */
html.photo-viewer-open, html.photo-viewer-open body { overflow: hidden; }
.title-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.table-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.table-actions .small-button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; }
button.photo-link { width: 100%; padding: 0; color: inherit; appearance: none; -webkit-appearance: none; cursor: zoom-in; }
.photo-link:focus-visible { outline: 3px solid rgba(13,110,253,.28); outline-offset: 2px; border-color: var(--primary); }
.report-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.download-note { margin: 8px 0 0; color: var(--muted); font-size: .9rem; }
.photo-viewer { position: fixed; inset: 0; z-index: 1000; display: none; background: rgba(8, 20, 42, .92); color: #fff; }
.photo-viewer.visible { display: block; }
.photo-viewer-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 76px 16px 84px; touch-action: none; }
.photo-viewer-image { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; box-shadow: 0 18px 48px rgba(0,0,0,.35); transform-origin: center center; transition: transform 120ms ease; user-select: none; cursor: zoom-in; touch-action: none; }
.photo-viewer-image.is-zoomed { cursor: grab; }
.photo-viewer-image.is-dragging { cursor: grabbing; transition: none; }
.photo-viewer-toolbar { position: absolute; top: max(14px, env(safe-area-inset-top)); left: 14px; right: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; pointer-events: none; }
.photo-viewer-controls { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; pointer-events: auto; }
.photo-viewer-counter { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 8px 12px; border: 1px solid rgba(255,255,255,.20); border-radius: 999px; background: rgba(255,255,255,.10); backdrop-filter: blur(8px); font-weight: 800; pointer-events: auto; }
.photo-viewer-button { min-width: 42px; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.24); border-radius: 999px; background: rgba(255,255,255,.12); color: #fff; font-weight: 900; text-decoration: none; box-shadow: 0 10px 24px rgba(0,0,0,.18); backdrop-filter: blur(8px); }
.photo-viewer-button:hover, .photo-viewer-button:focus-visible { background: rgba(255,255,255,.22); outline: none; }
.photo-viewer-button:disabled { opacity: .35; cursor: default; }
.photo-viewer-download { min-width: 88px; padding: 0 14px; }
.photo-viewer-zoom-label { min-width: 68px; padding: 0 12px; }
.photo-viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); min-width: 52px; min-height: 52px; font-size: 2.15rem; }
.photo-viewer-prev { left: 14px; }
.photo-viewer-next { right: 14px; }
@media (max-width: 700px) {
  .photo-viewer-stage { padding: 94px 8px 78px; }
  .photo-viewer-toolbar { align-items: flex-start; }
  .photo-viewer-counter { min-height: 34px; padding: 6px 10px; }
  .photo-viewer-button { min-width: 38px; min-height: 38px; }
  .photo-viewer-download { min-width: 76px; }
  .photo-viewer-nav { top: auto; bottom: max(16px, env(safe-area-inset-bottom)); transform: none; min-width: 48px; min-height: 48px; }
  .photo-viewer-prev { left: 18px; }
  .photo-viewer-next { right: 18px; }
}


/* Patch accessi, Damage Form PDF, sedi, parco auto */
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at top left, rgba(13,110,253,.14), transparent 34%), #f4f7fb;
}
.login-card {
  width: min(440px, 100%);
  background: #fff;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 28px;
  box-shadow: 0 24px 70px rgba(15,23,42,.16);
  padding: 28px;
}
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.login-brand h1 { margin: 0; }
.login-state { margin-top: 14px; }
.user-chip { display: inline-flex; flex-direction: column; gap: 2px; border: 1px solid rgba(15,23,42,.12); background: rgba(255,255,255,.82); border-radius: 16px; padding: 8px 12px; line-height: 1.1; }
.user-chip small { color: #64748b; }
.readonly-field { background: #f8fafc; color: #475569; }
.compact-file { min-height: 82px; padding: 12px; }
.damage-form-layout, .fleet-layout { grid-template-columns: minmax(0, 1fr); }
.wide-shell { max-width: 1680px; }
.fleet-table-wrap { max-height: 70vh; overflow: auto; }
.fleet-table th, .fleet-table td { white-space: nowrap; }
.sortable-th { padding: 0; }
.sort-button { width: 100%; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 700; display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; cursor: pointer; text-align: left; }
.sort-button:hover { background: rgba(13,110,253,.08); }
.sort-arrow { color: #0d6efd; font-size: .9em; min-width: 1.2em; text-align: center; }
.table-actions { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.filters-form .check-row, .report-form .check-row { align-items: center; display: flex; gap: 10px; min-height: 44px; }
.filters-form .check-row input, .report-form .check-row input { width: auto; }
@media (max-width: 720px) {
  .top-actions { gap: 8px; }
  .user-chip { order: 5; width: 100%; }
  .sort-button { padding: 10px; }
}

/* Patch parco auto + damage form multipagina */
[hidden], .is-hidden { display: none !important; }
html:not(.auth-ready) [data-admin-only],
html:not(.auth-ready) [data-menu-roles],
html:not(.auth-ready) [data-roles],
html:not(.auth-ready) [data-permission],
html:not(.auth-ready) [data-station-admin-only],
html:not(.auth-ready) [data-requires-edit],
html:not(.auth-ready) .requires-edit,
html:not(.auth-ready) [data-requires-download],
html:not(.auth-ready) .requires-download { display: none !important; }
html.auth-pending [data-admin-only],
html.auth-pending [data-menu-roles],
html.auth-pending [data-roles],
html.auth-pending [data-permission],
html.auth-pending [data-station-admin-only],
html.auth-pending [data-requires-edit],
html.auth-pending .requires-edit,
html.auth-pending [data-requires-download],
html.auth-pending .requires-download { display: none !important; }
.damage-upload-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: end; }
.damage-upload-table { min-width: 980px; }
.damage-upload-table input { min-height: 38px; padding: 8px; }
.damage-upload-table textarea { min-height: 74px; min-width: 280px; }
.car-detail-layout { grid-template-columns: minmax(0, 1fr); }
.car-primary-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.car-extra-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.car-extra-grid .detail-card:last-child { grid-column: 1 / -1; }
.damage-filters-form { grid-template-columns: minmax(190px, 1.15fr) minmax(145px, .58fr) minmax(145px, .58fr) minmax(190px, .85fr) minmax(120px, .45fr) auto; }
.batch-blocks { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 0 0 14px; }
.batch-card { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #f8fbff; }
.batch-card strong { overflow-wrap: anywhere; }
.batch-card span, .batch-card small { color: var(--muted); }
@media (max-width: 1100px) {
  .car-primary-grid, .car-extra-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .damage-upload-actions, .damage-filters-form, .car-primary-grid, .car-extra-grid { grid-template-columns: 1fr; }
  .damage-upload-table textarea { min-width: 220px; }
}

/* Scheda auto a finestra con navigazione interna */
.car-window {
  padding: 0;
  overflow: hidden;
}
.car-window-heading {
  padding: 18px 18px 0;
}
.car-tabs {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(8px);
}
.car-tab {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 8px 14px;
  font: inherit;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}
.car-tab:hover,
.car-tab:focus-visible {
  border-color: var(--primary);
  outline: none;
}
.car-tab.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15,23,42,.08);
  font-size: .78rem;
  font-weight: 900;
}
.car-tab.is-active .tab-count {
  background: rgba(255,255,255,.22);
  color: #fff;
}
.car-window-body {
  padding: 18px;
}
.car-tab-panel {
  display: none;
}
.car-tab-panel.is-active {
  display: block;
}
.car-tab-panel .table-wrap {
  max-height: 58vh;
  overflow: auto;
}
.car-raw-block {
  margin-top: 12px;
}
.car-raw-block .section-heading {
  margin-bottom: 8px;
}
.car-raw-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 1100px) {
  .car-raw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .car-window-heading,
  .car-tabs,
  .car-window-body { padding-left: 14px; padding-right: 14px; }
  .car-tabs { top: 0; }
  .car-raw-grid { grid-template-columns: 1fr; }
}

/* Patch 2026-07-03: blocchi PDF Damage Form e galleria PDF scheda auto */
.batch-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
html.pdf-batch-open,
html.pdf-batch-open body { overflow: hidden; }
.pdf-batch-viewer { position: fixed; inset: 0; z-index: 1001; display: none; padding: 18px; background: rgba(8,20,42,.74); }
.pdf-batch-viewer.visible { display: grid; place-items: center; }
.pdf-batch-dialog { width: min(1280px, 100%); height: min(880px, calc(100vh - 36px)); display: grid; grid-template-rows: auto 1fr; overflow: hidden; border-radius: 14px; background: #fff; box-shadow: 0 24px 70px rgba(0,0,0,.28); }
.pdf-batch-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px; border-bottom: 1px solid var(--line); }
.pdf-batch-header p { margin: 4px 0 0; color: var(--muted); }
.pdf-batch-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; justify-content: flex-end; }
.pdf-batch-content { min-height: 0; display: grid; grid-template-columns: minmax(220px, 300px) 1fr; }
.pdf-batch-list { overflow: auto; border-right: 1px solid var(--line); padding: 10px; background: #f8fbff; }
.pdf-batch-list-item { width: 100%; display: grid; gap: 3px; margin-bottom: 8px; padding: 10px; text-align: left; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.pdf-batch-list-item.is-active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,110,253,.12); }
.pdf-batch-list-item span,
.pdf-batch-list-item small { color: var(--muted); }
.pdf-batch-frame { width: 100%; height: 100%; border: 0; background: #eef5ff; }
.car-damage-filters { grid-template-columns: minmax(150px, .35fr) minmax(150px, .35fr) auto; margin-bottom: 14px; }
.pdf-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin: 0 0 16px; }
.pdf-thumb-card { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.pdf-thumb-button { width: 100%; aspect-ratio: 3 / 4; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #f8fbff; cursor: zoom-in; }
.pdf-thumb-button img { width: 100%; height: 100%; display: block; object-fit: cover; }
.pdf-thumb-placeholder { width: 100%; height: 100%; display: grid; place-items: center; padding: 12px; color: var(--muted); text-align: center; font-weight: 800; }
.pdf-thumb-meta { display: grid; gap: 2px; min-width: 0; }
.pdf-thumb-meta strong,
.pdf-thumb-meta span,
.pdf-thumb-meta small { overflow-wrap: anywhere; }
.pdf-thumb-meta span,
.pdf-thumb-meta small { color: var(--muted); font-size: .86rem; }
.pdf-thumb-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pdf-thumb-actions .small-button { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; padding: 7px 10px; }
@media (max-width: 760px) {
  .pdf-batch-content { grid-template-columns: 1fr; }
  .pdf-batch-list { max-height: 170px; border-right: 0; border-bottom: 1px solid var(--line); }
  .pdf-batch-header { flex-direction: column; }
  .car-damage-filters { grid-template-columns: 1fr; }
  .pdf-batch-viewer { padding: 8px; }
  .pdf-batch-dialog { height: calc(100vh - 16px); }
}

/* Patch 20260703: pacchetto PDF unico + anteprime Damage Form HD */
.damage-packages-table .package-name { overflow-wrap: anywhere; }
.batch-status-ok { font-weight: 800; color: #0f6b2f; }
.batch-status-warning { font-weight: 800; color: #9a5b00; }
.pdf-package-content { display: block; min-height: 0; }
.pdf-package-content .pdf-batch-frame { width: 100%; height: 100%; min-height: 0; }
.pdf-package-dialog { width: min(1180px, 100%); }
.pdf-gallery-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.pdf-thumb-button { aspect-ratio: 210 / 297; background: #fff; }
.pdf-thumb-button img { object-fit: contain; image-rendering: auto; background: #fff; }
.pdf-thumb-placeholder { min-height: 260px; }
@media (max-width: 760px) {
  .pdf-gallery-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .pdf-thumb-placeholder { min-height: 210px; }
}

/* Patch 20260704: turni Damage Form e notifiche */
.damage-shift-grid { grid-template-columns: minmax(170px, .9fr) minmax(150px, .55fr) minmax(220px, 1.1fr) minmax(130px, .45fr); margin-bottom: 12px; }
.damage-contract-policy {
  margin: -3px 0 12px;
  padding: 9px 11px;
  border: 1px solid #b9d9f5;
  border-radius: 8px;
  background: #f3f9ff;
  color: #174f7d;
  font-size: .80rem;
  font-weight: 800;
  line-height: 1.35;
}
.damage-contract-policy strong { color: #0b4f87; }
.damage-contract-policy.is-error {
  border-color: #e5b4b1;
  background: #fff3f2;
  color: #962e2a;
}
.damage-contract-policy.is-admin { border-color: #d0c2f2; background: #f8f5ff; color: #56358a; }
.damage-filters-form { grid-template-columns: minmax(190px, 1.15fr) minmax(145px, .58fr) minmax(145px, .58fr) minmax(190px, .85fr) minmax(120px, .45fr) auto; }
.damage-packages-table { min-width: 1240px; }
.damage-list-page .summary-grid{width:min(100%,1780px);max-width:none;margin-inline:auto}
.damage-list-page .damage-filters-form{gap:9px;align-items:end}
.damage-list-page .damage-list-wrap{width:100%;max-width:100%}
.damage-list-page .damage-packages-table{width:100%;min-width:0!important;table-layout:fixed}
.damage-list-page .damage-packages-table th:nth-child(1),.damage-list-page .damage-packages-table td:nth-child(1){width:14%}
.damage-list-page .damage-packages-table th:nth-child(2),.damage-list-page .damage-packages-table td:nth-child(2){width:9%}
.damage-list-page .damage-packages-table th:nth-child(3),.damage-list-page .damage-packages-table td:nth-child(3){width:8%}
.damage-list-page .damage-packages-table th:nth-child(4),.damage-list-page .damage-packages-table td:nth-child(4){width:8%}
.damage-list-page .damage-packages-table th:nth-child(5),.damage-list-page .damage-packages-table td:nth-child(5){width:5%}
.damage-list-page .damage-packages-table th:nth-child(6),.damage-list-page .damage-packages-table td:nth-child(6){width:5%;text-align:center}
.damage-list-page .damage-packages-table th:nth-child(7),.damage-list-page .damage-packages-table td:nth-child(7){width:10%}
.damage-list-page .damage-packages-table th:nth-child(8),.damage-list-page .damage-packages-table td:nth-child(8){width:8%}
.damage-list-page .damage-packages-table th:nth-child(9),.damage-list-page .damage-packages-table td:nth-child(9){width:8%}
.damage-list-page .damage-packages-table th:nth-child(10),.damage-list-page .damage-packages-table td:nth-child(10){width:8%}
.damage-list-page .damage-packages-table th:nth-child(11),.damage-list-page .damage-packages-table td:nth-child(11){width:8%}
.damage-list-page .damage-packages-table th:nth-child(12),.damage-list-page .damage-packages-table td:nth-child(12){width:9%}
.damage-list-page .damage-packages-table th,.damage-list-page .damage-packages-table td{padding:7px 5px;overflow-wrap:anywhere;vertical-align:top}
.damage-list-page .damage-packages-table .table-actions{display:grid;grid-template-columns:1fr;gap:5px}.damage-list-page .damage-packages-table .table-actions>*{width:100%;min-width:0;white-space:normal}
.damage-expandable-text{line-height:1.35;white-space:normal;overflow-wrap:anywhere}.damage-expandable-block.is-collapsed .damage-expandable-text{display:-webkit-box;max-height:3.65em;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2}.damage-expandable-toggle{margin-top:4px;padding:2px 0;border:0;background:transparent;color:var(--primary-dark);font:inherit;font-size:.76rem;font-weight:800;text-decoration:underline;cursor:pointer}
.damage-delete-form .personnel-note{margin-bottom:12px;padding:12px 14px;border:1px solid #e1b46b;border-radius:12px;background:#fff8e8;color:#744d0b}.damage-delete-form .personnel-note p{margin:5px 0 0}
@media(max-width:1180px){.damage-list-page .damage-filters-form{grid-template-columns:repeat(3,minmax(0,1fr))}.damage-list-page .damage-filters-form .filter-actions{grid-column:1/-1}}
@media(max-width:700px){.damage-list-page .damage-filters-form{grid-template-columns:1fr}.damage-list-page .damage-filters-form .filter-actions{grid-column:auto}}
.batch-status-danger { font-weight: 900; color: var(--danger); }
.status-note { display: inline-block; margin-top: 3px; color: var(--muted); font-size: .78rem; }
.status-note.warning { color: #9a5b00; }
.notification-bell { position: relative; display: inline-flex; align-items: center; }
.notification-bell-button { position: relative; min-width: 42px; padding-inline: 11px; }
.notification-badge { position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; border: 2px solid #fff; font-size: .70rem; font-weight: 900; line-height: 1; }
.notification-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 1100; width: min(360px, calc(100vw - 28px)); max-height: min(470px, calc(100vh - 120px)); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 22px 52px rgba(15,23,42,.22); }
.notification-menu[hidden] { display: none !important; }
.notification-menu-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #f8fbff; }
.notification-menu-close { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font-weight: 900; }
.notification-list { overflow: auto; padding: 8px; }
.notification-item { display: grid; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.notification-item + .notification-item { margin-top: 8px; }
.notification-item p { margin: 0; color: var(--ink); font-size: .88rem; white-space: pre-line; }
.notification-item small { color: var(--muted); }
.notification-item.is-dismissed { opacity: .72; background: #f8fafc; }
.notification-item.is-resolved { border-color: rgba(15,107,47,.22); background: #f4fff7; }
.notification-empty { margin: 0; padding: 12px; color: var(--muted); }
.notification-menu-link { display: block; padding: 12px 14px; border-top: 1px solid var(--line); color: var(--primary-dark); font-weight: 900; text-decoration: none; background: #fff; }
.audit-reason-backdrop { position: fixed; inset: 0; z-index: 12000; display: grid; place-items: center; padding: 18px; background: rgba(8,20,42,.72); }
.audit-reason-card { width: min(620px, 100%); display: grid; gap: 14px; padding: 22px; border: 1px solid #bfd4e6; border-radius: 16px; background: #fff; box-shadow: 0 28px 85px rgba(0,0,0,.34); }
.audit-reason-card h2, .audit-reason-card p { margin: 0; }
.audit-reason-card label { display: grid; gap: 7px; color: var(--ink); font-weight: 800; }
.audit-reason-card textarea { width: 100%; resize: vertical; }
@media (max-width: 1100px) {
  .damage-shift-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .damage-filters-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .damage-shift-grid { grid-template-columns: 1fr; }
  .notification-bell { order: 4; }
  .notification-menu { right: auto; left: 0; }
}

/* R6 2026-07-05: sfondo globale, shell multipagina e modalità embedded */
body {
  background: #d7dde5 url('sfondo.jpg') center center / cover fixed no-repeat;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(238, 241, 245, .76);
  pointer-events: none;
  z-index: -1;
}
.app-shell,
.workspace-shell {
  position: relative;
  z-index: 1;
}
.panel,
.login-card,
.user-chip,
.summary-pill,
.status-badge {
  background-color: rgba(255,255,255,.94);
}
.topbar {
  padding: 12px 0 16px;
}

.workspace-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 14px;
  gap: 12px;
}
.workspace-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}
.workspace-topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 0;
  background: rgba(192,192,192,.96);
  border: 1px solid #7c7c7c;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0,0,0,.12);
}
.workspace-topitem {
  min-height: 44px;
  padding: 9px 16px;
  border: 0;
  border-right: 1px solid #979797;
  background: linear-gradient(#fafafa, #d9d9d9);
  color: #111;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.workspace-topitem:last-child {
  border-right: 0;
}
.workspace-topitem:hover,
.workspace-topitem:focus-visible {
  background: linear-gradient(#ffffff, #dfefff);
  outline: none;
}
.workspace-topitem.is-active {
  background: linear-gradient(#aee7ff, #2aa2ea);
  color: #05263a;
}
.workspace-userbar {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}
.workspace-usericon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(15,23,42,.18);
}
.workspace-body {
  min-height: 0;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 0;
  border: 1px solid #8a8a8a;
  background: rgba(247,247,247,.92);
  box-shadow: 0 10px 30px rgba(0,0,0,.14);
}
.workspace-sidebar {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
  border-right: 1px solid #8a8a8a;
  background: rgba(255,255,255,.93);
}
.workspace-sidebar-head {
  padding: 16px 18px 10px;
  border-bottom: 1px solid #c9c9c9;
}
.workspace-sidebar-head h1 {
  font-size: 1.35rem;
  margin-bottom: 6px;
}
.workspace-sidebar-head p {
  margin: 0;
  color: #576274;
  font-size: .92rem;
}
.workspace-submenu {
  padding: 12px;
  overflow: auto;
}
.workspace-subitem {
  width: 100%;
  display: block;
  margin: 0 0 10px;
  padding: 14px 16px;
  text-align: left;
  border: 1px solid #a7a7a7;
  border-radius: 4px;
  background: linear-gradient(#fff, #efefef);
  color: #111;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.workspace-subitem:hover,
.workspace-subitem:focus-visible {
  background: linear-gradient(#ffffff, #e7f3ff);
  border-color: #3b96da;
  outline: none;
}

/* R91: icone compatte integrate nelle voci Personale, senza cambiare il tema ECH. */
.workspace-subitem {
  display: flex;
  align-items: center;
  gap: 9px;
}
.workspace-subitem-icon {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(23, 77, 130, .22);
  border-radius: 6px;
  background: #eef6fc;
  color: #174d82;
  font-size: .82rem;
  font-weight: 900;
  line-height: 1;
}
.workspace-subitem-icon::before { content: "•"; }
.workspace-subitem-icon.is-profilo::before { content: "P"; }
.workspace-subitem-icon.is-buste::before { content: "€"; }
.workspace-subitem-icon.is-richieste::before { content: "R"; }
.workspace-subitem-icon.is-presenze::before { content: "✓"; }
.workspace-subitem-icon.is-dipendenti::before { content: "D"; }
.workspace-subitem-icon.is-importa::before { content: "↥"; }
.workspace-subitem-icon.is-report::before { content: "▤"; }
.workspace-empty {
  margin: 0;
  padding: 12px;
  color: #64748b;
}
.workspace-main {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  background: rgba(233,233,233,.72);
}
.workspace-tabs {
  min-height: 42px;
  display: flex;
  align-items: end;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 12px 0;
  border-bottom: 1px solid #9fa3aa;
  background: rgba(245,245,245,.94);
}
.workspace-tab {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid #9fa3aa;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(#fafafa, #d9d9d9);
  color: #1f2937;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.workspace-tab.is-active {
  background: #fff;
}
.workspace-tab-label {
  white-space: nowrap;
}
.workspace-tab-close {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(15,23,42,.08);
  font-weight: 900;
}
.workspace-panel {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: rgba(255,255,255,.54);
}
.workspace-welcome,
.workspace-frames,
.workspace-frame {
  position: absolute;
  inset: 0;
}
.workspace-frames {
  background: rgba(255,255,255,.55);
}
.workspace-welcome {
  display: grid;
  place-items: center;
  padding: 24px;
  background: transparent;
}
.workspace-welcome-card {
  width: min(760px, 100%);
  padding: 32px;
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 18px;
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 58px rgba(15,23,42,.14);
  text-align: center;
}
.workspace-welcome-logo {
  width: 96px;
  height: 96px;
  margin-bottom: 14px;
}
.workspace-welcome-card h2 {
  font-size: 1.65rem;
  margin-bottom: 10px;
}
.workspace-welcome-card p {
  margin: 0 auto 18px;
  color: #475569;
  max-width: 58ch;
}
.workspace-welcome-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.workspace-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: none;
  background: rgba(255,255,255,.92);
}
.workspace-frame.is-active {
  display: block;
}
.workspace-frame.is-placeholder {
  padding: 24px;
}
.workspace-placeholder {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.95);
  box-shadow: 0 18px 48px rgba(15,23,42,.10);
}
.workspace-placeholder h3 {
  font-size: 1.4rem;
  margin-bottom: 8px;
}
.workspace-placeholder p {
  margin: 0;
  color: var(--muted);
}

html.embedded-shell body,
body.embedded-shell {
  background: transparent;
}
html.embedded-shell body::before,
body.embedded-shell::before {
  display: none;
}
.embedded-shell .topbar {
  display: none !important;
}
.embedded-shell .app-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 14px;
}
.embedded-shell .panel {
  border-radius: 0;
  box-shadow: none;
  background: rgba(255,255,255,.96);
}
.embedded-shell .summary-grid,
.embedded-shell .work-grid {
  gap: 14px;
}

@media (max-width: 1180px) {
  .workspace-header {
    grid-template-columns: 1fr;
  }
  .workspace-userbar {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .workspace-body {
    grid-template-columns: 260px minmax(0, 1fr);
  }
}
@media (max-width: 920px) {
  .workspace-body {
    grid-template-columns: 1fr;
  }
  .workspace-sidebar {
    border-right: 0;
    border-bottom: 1px solid #8a8a8a;
  }
  .workspace-panel {
    min-height: 70vh;
  }
}
@media (max-width: 700px) {
  .workspace-shell {
    padding: 8px;
  }
  .workspace-topnav {
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .workspace-topitem {
    flex: 0 0 auto;
    padding-inline: 12px;
  }
  .workspace-tabs {
    padding-inline: 8px;
  }
  .workspace-welcome-card {
    padding: 18px;
  }
}

/* R7 2026-07-05: menu più compatti + più blu */
:root {
  --primary: #0788d8;
  --primary-dark: #075985;
  --primary-soft: #e3f4ff;
  --primary-mid: #37a9e8;
  --line: #c8d8ea;
}
body::before {
  background: rgba(239, 247, 252, .70);
}
.primary-button {
  background: linear-gradient(#1aa7ee, #0878bf);
  border-color: #066ba9;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28);
}
.primary-button:hover,
.primary-button:focus-visible {
  background: linear-gradient(#0f95dc, #075f99);
}
.secondary-button,
.small-button {
  border-color: #b7d4e9;
  background: linear-gradient(#ffffff, #eef8ff);
}
.secondary-button:hover,
.secondary-button:focus-visible,
.small-button:hover,
.small-button:focus-visible {
  border-color: #0788d8;
  background: linear-gradient(#ffffff, #dff2ff);
}
.panel {
  border-color: #c7ddeb;
}
.section-heading {
  border-bottom: 1px solid rgba(7,136,216,.14);
  padding-bottom: 8px;
}
.eyebrow,
.reports-table th,
label {
  color: #536b88;
}
.summary-pill,
.status-badge,
.info-strip {
  border-color: rgba(7,136,216,.22);
  background: #eef8ff;
}

.workspace-shell {
  padding: 8px 10px;
  gap: 8px;
}
.workspace-header {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}
.workspace-topnav {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  border-color: #7aaed1;
  border-radius: 5px;
  background: linear-gradient(#ecf8ff, #b9dff5);
  box-shadow: 0 3px 10px rgba(7, 88, 142, .16);
}
.workspace-topitem {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 6px 11px;
  border-right-color: #9ec8df;
  background: linear-gradient(#ffffff, #e4eef5);
  color: #111827;
  font-size: .90rem;
  line-height: 1.15;
  font-weight: 800;
}
.workspace-topitem:hover,
.workspace-topitem:focus-visible {
  background: linear-gradient(#f8fdff, #cfeeff);
}
.workspace-topitem.is-active {
  background: linear-gradient(#76d4ff, #1194dc);
  color: #052234;
  box-shadow: inset 0 -3px 0 rgba(2,62,111,.35);
}
.workspace-userbar {
  gap: 7px;
  padding: 0;
}
.workspace-userbar .user-chip {
  min-height: 34px;
  padding: 5px 10px;
  border-color: #b7d4e9;
  background: rgba(246, 252, 255, .96);
  border-radius: 11px;
  font-size: .88rem;
}
.workspace-userbar .user-chip small {
  font-size: .76rem;
}
.workspace-usericon {
  width: 30px;
  height: 30px;
  border-color: #b7d4e9;
  background: #eef8ff;
}
.workspace-userbar .nav-button {
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: .9rem;
}
.workspace-body {
  grid-template-columns: 245px minmax(0, 1fr);
  border-color: #8fb8d2;
  background: rgba(235, 246, 253, .68);
  box-shadow: 0 8px 20px rgba(7, 88, 142, .14);
}
.workspace-sidebar {
  border-right-color: #a8cce2;
  background: rgba(250, 253, 255, .94);
}
.workspace-sidebar-head {
  padding: 12px 14px 9px;
  border-bottom-color: #bcd8ea;
  background: linear-gradient(90deg, #e5f6ff, #ffffff);
  border-left: 4px solid #0788d8;
}
.workspace-sidebar-head h1 {
  font-size: 1.15rem;
  color: #102033;
}
.workspace-sidebar-head p {
  font-size: .84rem;
  line-height: 1.25;
  color: #536b88;
}
.workspace-submenu {
  padding: 9px;
}
.workspace-subitem {
  min-height: 40px;
  margin-bottom: 7px;
  padding: 9px 12px;
  border-color: #b6cfdf;
  border-radius: 5px;
  background: linear-gradient(#ffffff, #eef8ff);
  color: #102033;
  font-size: .90rem;
  line-height: 1.18;
  font-weight: 800;
  box-shadow: 0 1px 4px rgba(7, 88, 142, .08);
}
.workspace-subitem:hover,
.workspace-subitem:focus-visible {
  background: linear-gradient(#fafdff, #dff3ff);
  border-color: #0788d8;
  color: #064e83;
}
.workspace-main {
  background: rgba(243, 250, 255, .86);
}
.workspace-tabs {
  min-height: 35px;
  gap: 6px;
  padding: 7px 10px 0;
  border-bottom-color: #a8cce2;
  background: linear-gradient(#f8fcff, #e7f5ff);
}
.workspace-tab {
  min-height: 30px;
  gap: 7px;
  padding: 5px 10px;
  border-color: #a8cce2;
  border-radius: 7px 7px 0 0;
  background: linear-gradient(#ffffff, #e9f4fb);
  color: #102033;
  font-size: .89rem;
  line-height: 1.15;
}
.workspace-tab.is-active {
  background: #fff;
  border-top: 3px solid #0788d8;
  color: #073b63;
}
.workspace-tab-close {
  width: 18px;
  height: 18px;
  background: #d8edf9;
  color: #0b4f7d;
  font-size: .92rem;
}
.workspace-panel {
  background: rgba(255,255,255,.68);
}

/* Compattezza anche nelle pagine aperte dentro la multipagina */
.embedded-shell .app-shell {
  padding: 9px;
}
.embedded-shell .panel {
  border-color: #c4ddeb;
}
.embedded-shell .panel,
.embedded-shell .car-window-body,
.embedded-shell .car-window-heading {
  padding: 12px;
}
.embedded-shell .section-heading {
  margin-bottom: 10px;
  padding-bottom: 6px;
}
.embedded-shell h1 { font-size: 1.24rem; }
.embedded-shell h2 { font-size: 1.02rem; }
.embedded-shell label { font-size: .82rem; }
.embedded-shell input,
.embedded-shell select {
  min-height: 36px;
  padding: 7px 10px;
  border-color: #c4ddeb;
}
.embedded-shell textarea {
  padding: 7px 10px;
}
.embedded-shell .primary-button,
.embedded-shell .secondary-button,
.embedded-shell .small-button {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 6px;
  font-size: .88rem;
}
.embedded-shell .summary-pill,
.embedded-shell .status-badge {
  min-height: 28px;
  padding: 4px 8px;
  font-size: .78rem;
}
.embedded-shell .reports-table th,
.embedded-shell .reports-table td {
  padding: 7px 8px;
}
.embedded-shell .reports-table th {
  color: #536b88;
}
.embedded-shell .table-wrap {
  border-top: 3px solid #e0f2ff;
}
.embedded-shell .damage-filters-form {
  gap: 9px;
}
.embedded-shell .car-tabs {
  padding: 9px 12px;
  background: linear-gradient(#f8fcff, #e7f5ff);
}
.embedded-shell .car-tab {
  min-height: 34px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: .86rem;
}
.embedded-shell .car-tab.is-active {
  background: linear-gradient(#1aa7ee, #0878bf);
}

@media (max-width: 1180px) {
  .workspace-header {
    grid-template-columns: 1fr;
  }
  .workspace-userbar {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .workspace-body {
    grid-template-columns: 225px minmax(0, 1fr);
  }
}
@media (max-width: 920px) {
  .workspace-body {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 700px) {
  .workspace-shell {
    padding: 6px;
  }
  .workspace-topitem {
    min-height: 32px;
    padding: 6px 10px;
    font-size: .86rem;
  }
  .workspace-subitem {
    min-height: 38px;
  }
}

/* R7 2026-07-05: menu più compatto e più blu */
:root {
  --primary: #0b8bd3;
  --primary-dark: #075985;
  --soft: #e8f6ff;
  --line: #cfe3f3;
}
body::before {
  background: rgba(238, 246, 252, .68);
}
.workspace-shell {
  padding: 8px;
  gap: 8px;
}
.workspace-header {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}
.workspace-topnav {
  flex-wrap: nowrap;
  overflow-x: auto;
  min-height: 36px;
  border-color: #2f80b7;
  background: linear-gradient(#e9f8ff, #b9d5e7);
  border-radius: 5px;
}
.workspace-topitem {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 6px 10px;
  border-right-color: #92b7d0;
  background: linear-gradient(#ffffff, #dcecf6);
  color: #092a41;
  font-size: 14px;
  line-height: 1.15;
  font-weight: 800;
}
.workspace-topitem:hover,
.workspace-topitem:focus-visible {
  background: linear-gradient(#f7fcff, #bfe8ff);
  color: #063756;
}
.workspace-topitem.is-active {
  background: linear-gradient(#9de4ff, #1588cc);
  color: #041f33;
  box-shadow: inset 0 -3px 0 #056aa6;
}
.workspace-userbar {
  gap: 6px;
}
.workspace-userbar .user-chip,
.top-actions .user-chip {
  padding: 5px 9px;
  border-color: #b9d5e7;
  background: rgba(255,255,255,.90);
}
.workspace-userbar .nav-button,
.top-actions .nav-button,
.workspace-userbar .secondary-button,
.top-actions .secondary-button {
  min-height: 34px;
  padding: 7px 11px;
  border-color: #bed8ea;
}
.workspace-body {
  grid-template-columns: 250px minmax(0, 1fr);
  border-color: #80aac7;
}
.workspace-sidebar {
  background: rgba(250,253,255,.95);
  border-right-color: #9fc6df;
}
.workspace-sidebar-head {
  padding: 12px 14px 9px;
  background: linear-gradient(90deg, rgba(7,133,201,.12), rgba(255,255,255,.82));
  border-bottom-color: #c5dff0;
}
.workspace-sidebar-head h1 {
  font-size: 1.12rem;
  color: #08314d;
  margin-bottom: 4px;
}
.workspace-sidebar-head p {
  font-size: .84rem;
  color: #4d6378;
}
.workspace-submenu {
  padding: 10px;
}
.workspace-subitem {
  min-height: 40px;
  margin: 0 0 8px;
  padding: 9px 12px;
  border-color: #b7cddb;
  border-left: 4px solid #1588cc;
  background: linear-gradient(#ffffff, #eef8ff);
  color: #0b2f48;
  font-size: 14px;
  line-height: 1.2;
  box-shadow: 0 1px 5px rgba(8, 88, 136, .08);
}
.workspace-subitem:hover,
.workspace-subitem:focus-visible {
  background: linear-gradient(#ffffff, #d7f1ff);
  border-color: #1686c8;
  border-left-color: #075985;
}
.workspace-main {
  background: rgba(232, 246, 255, .56);
}
.workspace-tabs {
  min-height: 34px;
  gap: 5px;
  padding: 6px 8px 0;
  border-bottom-color: #9fc6df;
  background: linear-gradient(#f6fbff, #e3f4ff);
}
.workspace-tab {
  min-height: 32px;
  gap: 7px;
  padding: 6px 10px;
  border-color: #a9c9dc;
  background: linear-gradient(#ffffff, #e6f2fa);
  color: #0b2f48;
  border-radius: 7px 7px 0 0;
  font-size: 14px;
  line-height: 1.15;
}
.workspace-tab.is-active {
  background: #fff;
  color: #062b44;
  border-top-color: #0b8bd3;
  box-shadow: inset 0 3px 0 #0b8bd3;
}
.workspace-tab-close {
  width: 18px;
  height: 18px;
  background: rgba(11,139,211,.12);
  color: #075985;
}
.workspace-welcome-card {
  padding: 24px;
  border-color: rgba(11,139,211,.20);
}
.workspace-welcome-logo {
  width: 78px;
  height: 78px;
}
.workspace-placeholder {
  border-color: #bdd9ec;
  box-shadow: 0 12px 28px rgba(8, 88, 136, .10);
}

/* Pagine aperte dentro la multipagina: controlli più bassi e meno ingombranti */
.embedded-shell .app-shell {
  padding: 10px;
}
.embedded-shell .panel {
  padding: 13px;
  border-color: #c7dff0;
}
.embedded-shell .section-heading {
  margin-bottom: 10px;
}
.embedded-shell h1 {
  font-size: 1.28rem;
}
.embedded-shell h2 {
  font-size: 1.02rem;
}
.embedded-shell .eyebrow {
  color: #507092;
  font-size: .72rem;
}
.embedded-shell label {
  gap: 4px;
  color: #425b78;
  font-size: .80rem;
}
.embedded-shell input,
.embedded-shell select {
  min-height: 36px;
  padding: 7px 10px;
  border-color: #c5dced;
  border-radius: 7px;
}
.embedded-shell textarea {
  padding: 8px 10px;
  border-color: #c5dced;
  border-radius: 7px;
}
.embedded-shell .primary-button,
.embedded-shell .secondary-button,
.embedded-shell .small-button {
  min-height: 36px;
  padding: 7px 11px;
  border-radius: 7px;
  font-size: .92rem;
}
.embedded-shell .primary-button,
.primary-button {
  background: #0b8bd3;
}
.embedded-shell .primary-button:hover,
.primary-button:hover,
.embedded-shell .primary-button:focus-visible,
.primary-button:focus-visible {
  background: #075985;
}
.embedded-shell .summary-pill,
.embedded-shell .status-badge {
  min-height: 28px;
  padding: 4px 9px;
  border-color: #b7d8ef;
  background: #eaf7ff;
  color: #075985;
  font-size: .78rem;
}
.embedded-shell .reports-table th,
.embedded-shell .reports-table td {
  padding: 7px 8px;
}
.embedded-shell .reports-table th {
  color: #16496b;
  background: #edf8ff;
}
.embedded-shell .table-wrap {
  border-color: #c7dff0;
}
.embedded-shell .filters-form {
  gap: 10px;
}
.embedded-shell .damage-packages-table {
  min-width: 1100px;
}

@media (max-width: 1360px) {
  .workspace-body {
    grid-template-columns: 235px minmax(0, 1fr);
  }
  .workspace-topitem {
    padding-inline: 8px;
    font-size: 13px;
  }
}
@media (max-width: 1180px) {
  .workspace-header {
    grid-template-columns: 1fr;
  }
  .workspace-userbar {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .workspace-body {
    grid-template-columns: 230px minmax(0, 1fr);
  }
}
@media (max-width: 920px) {
  .workspace-body {
    grid-template-columns: 1fr;
  }
}

/* R7 2026-07-05: menu compatti + più blu */
:root {
  --primary: #0876c9;
  --primary-dark: #054f91;
  --soft: #e6f4ff;
  --line: #c7d9ec;
}
.workspace-shell {
  padding: 10px;
  gap: 8px;
}
.workspace-header {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}
.workspace-topnav {
  border-color: #7daed5;
  background: linear-gradient(#eaf6ff, #b9d8ee);
  box-shadow: 0 3px 14px rgba(8, 118, 201, .18);
}
.workspace-topitem {
  min-height: 34px;
  padding: 6px 11px;
  border-right-color: #9abbd4;
  background: linear-gradient(#ffffff, #e7eef5);
  color: #10243a;
  font-size: .88rem;
  font-weight: 800;
  line-height: 1.15;
}
.workspace-topitem:hover,
.workspace-topitem:focus-visible {
  background: linear-gradient(#f9fdff, #cfefff);
  color: #064b80;
}
.workspace-topitem.is-active {
  background: linear-gradient(#8edcff, #1393dc);
  color: #05253a;
  box-shadow: inset 0 -3px 0 rgba(4, 75, 128, .35);
}
.workspace-userbar {
  gap: 7px;
}
.workspace-userbar .user-chip {
  padding: 5px 9px;
  border-color: #c6dbec;
  background: rgba(255,255,255,.88);
  border-radius: 13px;
  font-size: .86rem;
}
.workspace-userbar .nav-button,
.workspace-userbar .secondary-button {
  min-height: 32px;
  padding: 6px 11px;
  border-color: #c6dbec;
  color: #0a4d82;
}
.workspace-usericon {
  width: 28px;
  height: 28px;
  border-color: #b8d7ed;
  color: #0876c9;
}
.workspace-body {
  grid-template-columns: 245px minmax(0, 1fr);
  border-color: #9bc2dd;
  box-shadow: 0 8px 24px rgba(8, 118, 201, .15);
}
.workspace-sidebar {
  border-right-color: #9bc2dd;
  background: rgba(250, 253, 255, .96);
}
.workspace-sidebar-head {
  padding: 12px 14px 9px;
  border-bottom-color: #b6d5eb;
  background: linear-gradient(90deg, rgba(8,118,201,.13), rgba(255,255,255,.9));
}
.workspace-sidebar-head h1 {
  margin-bottom: 4px;
  color: #0b4778;
  font-size: 1.08rem;
}
.workspace-sidebar-head p {
  font-size: .80rem;
  line-height: 1.25;
}
.workspace-submenu {
  padding: 9px;
}
.workspace-subitem {
  min-height: 38px;
  margin-bottom: 7px;
  padding: 9px 11px;
  border-color: #b7cadb;
  border-left: 4px solid #0e8bd3;
  background: linear-gradient(#ffffff, #f0f7fd);
  color: #10243a;
  font-size: .90rem;
  line-height: 1.2;
  box-shadow: 0 1px 5px rgba(8, 118, 201, .08);
}
.workspace-subitem:hover,
.workspace-subitem:focus-visible {
  background: linear-gradient(#ffffff, #dff3ff);
  border-color: #55a8df;
  border-left-color: #006fba;
  color: #064b80;
}
.workspace-main {
  background: rgba(232, 244, 253, .82);
}
.workspace-tabs {
  min-height: 35px;
  gap: 5px;
  padding: 7px 9px 0;
  border-bottom-color: #9bc2dd;
  background: linear-gradient(#f7fbff, #e5f2fb);
}
.workspace-tab {
  min-height: 30px;
  gap: 7px;
  padding: 6px 9px;
  border-color: #9bc2dd;
  border-radius: 7px 7px 0 0;
  background: linear-gradient(#ffffff, #e8eef5);
  color: #10243a;
  font-size: .88rem;
}
.workspace-tab.is-active {
  background: #ffffff;
  color: #064b80;
  border-top: 3px solid #0e8bd3;
  padding-top: 4px;
}
.workspace-tab-close {
  width: 18px;
  height: 18px;
  background: #d8ecfb;
  color: #064b80;
}
.workspace-panel,
.workspace-frame {
  background: rgba(255,255,255,.86);
}
.workspace-welcome-card {
  padding: 22px;
  border-color: #b8d7ed;
  background: rgba(248, 253, 255, .86);
}
.workspace-welcome-logo {
  width: 74px;
  height: 74px;
}
.workspace-welcome-card h2 {
  color: #0b4778;
  font-size: 1.32rem;
}

.embedded-shell .app-shell {
  padding: 9px;
}
.embedded-shell .panel {
  padding: 13px;
  border-color: #c6dbec;
}
.embedded-shell .section-heading {
  margin-bottom: 10px;
}
.embedded-shell h1 { font-size: 1.30rem; }
.embedded-shell h2 { font-size: 1.02rem; }
.embedded-shell .eyebrow { color: #5f7290; font-size: .70rem; }
.embedded-shell label { font-size: .78rem; }
.embedded-shell input,
.embedded-shell select {
  min-height: 36px;
  padding: 7px 10px;
  border-color: #c6dbec;
  border-radius: 7px;
}
.embedded-shell textarea {
  padding: 7px 10px;
  border-color: #c6dbec;
  border-radius: 7px;
}
.embedded-shell .primary-button,
.embedded-shell .secondary-button,
.embedded-shell .small-button,
.embedded-shell .nav-button {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 7px;
  font-size: .86rem;
}
.embedded-shell .primary-button {
  background: #0876c9;
}
.embedded-shell .primary-button:hover,
.embedded-shell .primary-button:focus-visible {
  background: #054f91;
}
.embedded-shell .summary-pill,
.embedded-shell .status-badge {
  min-height: 28px;
  padding: 4px 9px;
  color: #0b4778;
  border-color: #b8d7ed;
  background: #eaf6ff;
  font-size: .76rem;
}
.embedded-shell .table-wrap {
  border: 1px solid #d3e5f4;
  background: #fff;
}
.embedded-shell .reports-table th,
.embedded-shell .reports-table td {
  padding: 7px 7px;
}
.embedded-shell .reports-table th {
  color: #345b83;
  background: #eef8ff;
  font-size: .70rem;
}
.embedded-shell .damage-filters-form {
  gap: 9px;
}
.embedded-shell .damage-packages-table {
  min-width: 1180px;
}
.embedded-shell .damage-upload-actions,
.embedded-shell .filter-actions,
.embedded-shell .form-actions,
.embedded-shell .queue-control-row {
  gap: 7px;
}
.embedded-shell .file-zone {
  min-height: 96px;
  padding: 12px;
  border-color: #9bc2dd;
  background: #f2f9ff;
}
.embedded-shell .file-zone-title {
  color: #0876c9;
  font-size: .96rem;
}
.embedded-shell .file-zone-meta,
.embedded-shell .field-hint,
.embedded-shell .info-strip {
  font-size: .80rem;
}
.embedded-shell .car-tabs {
  padding: 9px 12px;
  border-bottom-color: #b6d5eb;
  background: #f2f9ff;
}
.embedded-shell .car-tab {
  min-height: 32px;
  padding: 6px 11px;
  border-color: #b6d5eb;
  color: #0b4778;
  font-size: .84rem;
}
.embedded-shell .car-tab.is-active {
  background: #0876c9;
  border-color: #0876c9;
  color: #fff;
}

@media (max-width: 1180px) {
  .workspace-body {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .workspace-topitem {
    padding-inline: 9px;
    font-size: .84rem;
  }
}
@media (max-width: 920px) {
  .workspace-sidebar-head h1 {
    font-size: 1rem;
  }
  .workspace-panel {
    min-height: 72vh;
  }
}

/* R7 2026-07-05: menu più compatti + più blu */
:root {
  --primary: #087fc3;
  --primary-dark: #075985;
  --primary-soft: #e8f5ff;
  --primary-mid: #2ca7e8;
  --line-blue: #b9dcf3;
}
body::before {
  background: rgba(234, 241, 248, .70);
}
.primary-button {
  background: linear-gradient(#18a7ee, #087fc3);
  border-color: #087fc3;
}
.primary-button:hover,
.primary-button:focus-visible {
  background: linear-gradient(#0f94da, #066ca8);
}
.secondary-button:hover,
.secondary-button:focus-visible,
.small-button:hover,
.small-button:focus-visible {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: var(--primary-soft);
}
.workspace-shell {
  padding: 10px;
  gap: 8px;
}
.workspace-header {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}
.workspace-topnav {
  flex-wrap: nowrap;
  overflow-x: auto;
  border-color: #7aaecf;
  background: linear-gradient(#dff3ff, #b7d8ee);
  box-shadow: 0 3px 12px rgba(7,89,133,.16);
}
.workspace-topitem {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 12px;
  border-right-color: #9fc7df;
  background: linear-gradient(#ffffff, #e9f6ff);
  color: #0f2740;
  font-size: 13px;
  line-height: 1.1;
  font-weight: 800;
}
.workspace-topitem:hover,
.workspace-topitem:focus-visible {
  background: linear-gradient(#f7fcff, #d3efff);
  color: #075985;
}
.workspace-topitem.is-active {
  background: linear-gradient(#7fd6ff, #0791d8);
  color: #06263f;
  box-shadow: inset 0 -3px 0 #075985;
}
.workspace-userbar {
  gap: 8px;
}
.workspace-userbar .user-chip {
  padding: 6px 10px;
  border-color: var(--line-blue);
  background: rgba(255,255,255,.9);
}
.workspace-userbar .nav-button,
.workspace-userbar .secondary-button {
  min-height: 34px;
  padding: 7px 12px;
}
.workspace-usericon {
  width: 30px;
  height: 30px;
  border-color: var(--line-blue);
  background: var(--primary-soft);
}
.workspace-body {
  grid-template-columns: 260px minmax(0, 1fr);
  border-color: #8bbbd8;
  background: rgba(245,250,255,.86);
}
.workspace-sidebar {
  border-right-color: #8bbbd8;
  background: rgba(255,255,255,.90);
}
.workspace-sidebar-head {
  padding: 12px 14px 10px;
  border-bottom-color: var(--line-blue);
  background: linear-gradient(90deg, #eaf7ff, rgba(255,255,255,.94));
}
.workspace-sidebar-head h1 {
  font-size: 1.13rem;
  color: var(--primary-dark);
  margin-bottom: 4px;
}
.workspace-sidebar-head p {
  font-size: .82rem;
  line-height: 1.3;
}
.workspace-submenu {
  padding: 10px;
}
.workspace-subitem {
  min-height: 38px;
  margin-bottom: 8px;
  padding: 9px 12px;
  border-color: #aac9dc;
  border-left: 4px solid var(--primary-mid);
  background: linear-gradient(#ffffff, #f2f9ff);
  color: #12243a;
  font-size: 13px;
  line-height: 1.2;
}
.workspace-subitem:hover,
.workspace-subitem:focus-visible {
  background: linear-gradient(#f8fdff, #dff3ff);
  border-color: var(--primary);
  border-left-color: #075985;
  color: #075985;
}
.workspace-tabs {
  min-height: 34px;
  gap: 6px;
  padding: 7px 10px 0;
  border-bottom-color: #8bbbd8;
  background: linear-gradient(#f8fcff, #e4f3fc);
}
.workspace-tab {
  min-height: 30px;
  gap: 7px;
  padding: 6px 10px;
  border-color: #9cc9e2;
  border-top: 3px solid transparent;
  border-radius: 7px 7px 0 0;
  background: linear-gradient(#ffffff, #eef7ff);
  color: #14243b;
  font-size: 13px;
  line-height: 1.1;
}
.workspace-tab:hover,
.workspace-tab:focus-visible {
  color: var(--primary-dark);
  background: #f7fcff;
}
.workspace-tab.is-active {
  border-top-color: var(--primary);
  background: #fff;
  color: var(--primary-dark);
}
.workspace-tab-close {
  width: 17px;
  height: 17px;
  background: #dbeefb;
  color: #075985;
  font-size: 13px;
}
.workspace-panel {
  background: rgba(255,255,255,.62);
}
.workspace-frame {
  background: rgba(255,255,255,.96);
}

.embedded-shell .app-shell {
  padding: 10px;
}
.embedded-shell .panel {
  border-color: #d4e8f6;
  background: rgba(255,255,255,.975);
}
.embedded-shell .section-heading {
  margin-bottom: 10px;
}
.embedded-shell .section-heading h2,
.embedded-shell h2 {
  color: #0f2740;
  font-size: 1.02rem;
}
.embedded-shell .eyebrow {
  color: #4e6d8b;
  font-size: .70rem;
}
.embedded-shell label {
  font-size: .78rem;
  color: #4e6178;
}
.embedded-shell input,
.embedded-shell select {
  min-height: 34px;
  padding: 7px 9px;
  border-color: #d4e8f6;
  border-radius: 7px;
  font-size: 13px;
}
.embedded-shell textarea {
  padding: 7px 9px;
  border-color: #d4e8f6;
  border-radius: 7px;
  font-size: 13px;
}
.embedded-shell .primary-button,
.embedded-shell .secondary-button,
.embedded-shell .small-button {
  min-height: 32px;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 13px;
}
.embedded-shell .summary-pill,
.embedded-shell .status-badge {
  min-height: 28px;
  padding: 5px 9px;
  font-size: .75rem;
}
.embedded-shell .reports-table th,
.embedded-shell .reports-table td {
  padding: 7px 8px;
  font-size: 13px;
}
.embedded-shell .reports-table th {
  color: #245b86;
  background: #f0f8ff;
  border-bottom-color: #c5e2f5;
}
.embedded-shell .filters-form {
  gap: 9px;
}
.embedded-shell .table-wrap {
  border-color: #d4e8f6;
}
.embedded-shell .damage-filters-form,
.embedded-shell .uploads-filters-form {
  align-items: end;
}

@media (max-width: 1180px) {
  .workspace-header { grid-template-columns: 1fr; }
  .workspace-body { grid-template-columns: 240px minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .workspace-topitem { font-size: 12px; padding-inline: 10px; }
  .workspace-body { grid-template-columns: 1fr; }
  .workspace-subitem { font-size: 12px; }
}

/* R7 fine-tuning: barra superiore sempre compatta su una riga */
.workspace-topnav {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
}
.workspace-topitem {
  flex: 0 0 auto;
  white-space: nowrap;
}
.workspace-userbar {
  flex: 0 0 auto;
}
@media (min-width: 1280px) {
  .workspace-topitem {
    padding-left: 9px;
    padding-right: 9px;
    font-size: .84rem;
  }
}

/* R7 2026-07-05: interfaccia più compatta e più blu */
:root {
  --primary: #087cc2;
  --primary-dark: #07558f;
  --soft: #e9f7ff;
  --line: #c9dceb;
}
body::before {
  background: linear-gradient(135deg, rgba(226, 245, 255, .84), rgba(247, 250, 255, .76));
}
.workspace-shell {
  padding: 8px 10px;
  gap: 8px;
  --workspace-blue: #078bd3;
  --workspace-blue-dark: #05629b;
  --workspace-blue-soft: #e7f7ff;
}
.workspace-header {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.workspace-topnav {
  flex-wrap: nowrap;
  overflow-x: auto;
  min-height: 36px;
  border-color: #60b8ec;
  border-radius: 5px;
  background: linear-gradient(#eaf8ff, #bcdff3);
  box-shadow: 0 3px 12px rgba(7, 91, 145, .16);
}
.workspace-topitem {
  min-height: 36px;
  padding: 7px 11px;
  border-right-color: #9ccde9;
  background: linear-gradient(#ffffff, #e6f4ff);
  color: #0b2540;
  font-size: 13px;
  line-height: 1.1;
  white-space: nowrap;
}
.workspace-topitem:hover,
.workspace-topitem:focus-visible {
  background: linear-gradient(#ffffff, #d2edff);
  color: var(--workspace-blue-dark);
}
.workspace-topitem.is-active {
  background: linear-gradient(#67c9ff, #0d92db);
  color: #031d31;
  box-shadow: inset 0 -3px 0 rgba(5, 98, 155, .34);
}
.workspace-userbar {
  gap: 7px;
}
.workspace-usericon {
  width: 28px;
  height: 28px;
  font-size: 15px;
  border-color: #b7d9ee;
  background: #f1fbff;
}
.workspace-userbar .user-chip {
  padding: 5px 9px;
  border-radius: 12px;
  border-color: #c8ddec;
  background: rgba(255,255,255,.88);
}
.workspace-userbar .user-chip strong {
  font-size: 14px;
}
.workspace-userbar .user-chip small {
  font-size: 12px;
  color: #407093;
}
.workspace-userbar .nav-button {
  min-height: 34px;
  padding: 7px 12px;
  border-color: #c4dced;
  background: #f5fbff;
}
.workspace-body {
  grid-template-columns: 250px minmax(0, 1fr);
  border-color: #7fc5ef;
  background: rgba(239, 248, 255, .88);
  box-shadow: 0 8px 24px rgba(6, 84, 140, .13);
}
.workspace-sidebar {
  border-right-color: #9fd0ee;
  background: rgba(250, 253, 255, .94);
}
.workspace-sidebar-head {
  padding: 12px 14px 9px;
  border-bottom-color: #acd7ef;
  background: linear-gradient(90deg, #f7fcff, #e3f6ff);
}
.workspace-sidebar-head h1 {
  font-size: 1.12rem;
  color: #0b4f80;
  margin-bottom: 4px;
}
.workspace-sidebar-head p {
  font-size: .82rem;
  color: #49677d;
}
.workspace-submenu {
  padding: 9px;
}
.workspace-subitem {
  margin-bottom: 7px;
  padding: 9px 11px;
  min-height: 38px;
  border-color: #bdd9eb;
  border-left: 4px solid #1b96d8;
  border-radius: 5px;
  background: linear-gradient(#ffffff, #f0f9ff);
  color: #123047;
  font-size: 14px;
  box-shadow: 0 1px 5px rgba(6,84,140,.07);
}
.workspace-subitem:hover,
.workspace-subitem:focus-visible {
  background: linear-gradient(#fafdff, #dff3ff);
  border-color: #43aee9;
  border-left-color: #05629b;
}
.workspace-main {
  background: rgba(229, 242, 251, .7);
}
.workspace-tabs {
  min-height: 34px;
  gap: 5px;
  padding: 7px 8px 0;
  border-bottom-color: #8fc7e9;
  background: linear-gradient(#f8fdff, #d7ecfb);
}
.workspace-tab {
  min-height: 30px;
  gap: 7px;
  padding: 6px 10px;
  border-color: #9acfe9;
  border-radius: 7px 7px 0 0;
  background: linear-gradient(#fff, #edf8ff);
  color: #103550;
  font-size: 13px;
}
.workspace-tab.is-active {
  background: linear-gradient(#fefeff, #dff3ff);
  color: #07558f;
  border-top-color: #0d92db;
  box-shadow: inset 0 3px 0 #0d92db;
}
.workspace-tab-close {
  width: 17px;
  height: 17px;
  background: rgba(13, 146, 219, .14);
  color: #07558f;
  font-size: 13px;
}
.workspace-panel {
  background: rgba(250, 253, 255, .72);
}
.workspace-welcome-card {
  border-color: rgba(120, 190, 232, .55);
  background: rgba(248, 253, 255, .83);
}
.workspace-placeholder {
  border-color: #b9dcec;
  background: rgba(250,253,255,.96);
}

/* pagine aperte dentro il workspace: meno spazio vuoto, campi e pulsanti più piccoli */
.embedded-shell .app-shell {
  padding: 9px 10px;
  font-size: 13px;
}
.embedded-shell .panel {
  padding: 12px;
  border-color: #c6dfef;
}
.embedded-shell h1 {
  font-size: 1.22rem;
}
.embedded-shell h2 {
  font-size: 1rem;
}
.embedded-shell .section-heading {
  margin-bottom: 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e0eff9;
}
.embedded-shell .eyebrow {
  color: #426d90;
  font-size: .72rem;
}
.embedded-shell label {
  gap: 4px;
  font-size: .80rem;
  color: #49677d;
}
.embedded-shell input,
.embedded-shell select {
  min-height: 36px;
  padding: 7px 9px;
  border-color: #c6dff0;
  border-radius: 7px;
}
.embedded-shell textarea {
  padding: 7px 9px;
  border-color: #c6dff0;
  border-radius: 7px;
}
.embedded-shell .primary-button,
.embedded-shell .secondary-button,
.embedded-shell .small-button,
.embedded-shell .nav-button {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 7px;
  font-size: 13px;
}
.embedded-shell .primary-button {
  background: #087cc2;
}
.embedded-shell .primary-button:hover,
.embedded-shell .primary-button:focus-visible {
  background: #07558f;
}
.embedded-shell .secondary-button,
.embedded-shell .small-button {
  border-color: #bcd9eb;
  background: #f7fcff;
  color: #123047;
}
.embedded-shell .summary-pill,
.embedded-shell .status-badge {
  min-height: 28px;
  padding: 5px 9px;
  font-size: .76rem;
  border-color: #b6d8ed;
  background: #eef9ff;
  color: #07558f;
}
.embedded-shell .filters-form {
  gap: 9px;
}
.embedded-shell .damage-filters-form {
  grid-template-columns: minmax(190px, 1fr) minmax(126px, .48fr) minmax(126px, .48fr) minmax(160px, .65fr) minmax(105px, .38fr) auto;
}
.embedded-shell .table-wrap {
  border: 1px solid #d5e7f3;
  border-radius: 6px;
  background: #fff;
}
.embedded-shell .reports-table th,
.embedded-shell .reports-table td {
  padding: 7px 8px;
}
.embedded-shell .reports-table th {
  color: #0a5a9f;
  background: #eff9ff;
  font-size: .72rem;
}
.embedded-shell .file-zone {
  min-height: 92px;
  padding: 12px;
  border-color: #8bc8ec;
  background: #f1fbff;
}
.embedded-shell .file-zone-title {
  color: #07558f;
}
.embedded-shell .info-strip {
  padding: 8px 10px;
  border-color: #c6dfef;
  background: #f4fbff;
  font-size: .84rem;
}
.embedded-shell .damage-shift-grid {
  grid-template-columns: minmax(150px, .75fr) minmax(132px, .45fr) minmax(200px, 1fr) minmax(110px, .35fr);
  gap: 9px;
}
.embedded-shell .damage-upload-actions {
  gap: 8px;
}

@media (max-width: 1180px) {
  .workspace-body {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .workspace-topitem {
    padding-inline: 9px;
  }
}
@media (max-width: 920px) {
  .workspace-body {
    grid-template-columns: 1fr;
  }
  .workspace-sidebar {
    border-right: 0;
    border-bottom: 1px solid #8fc7e9;
  }
}
@media (max-width: 700px) {
  .workspace-shell {
    padding: 6px;
  }
  .workspace-userbar {
    flex-wrap: wrap;
  }
  .embedded-shell .damage-filters-form,
  .embedded-shell .damage-shift-grid {
    grid-template-columns: 1fr;
  }
}

/* R8 2026-07-05: campanellina solo nella navbar principale e nessuna duplicazione nelle schede */
.workspace-userbar .notification-bell {
  order: -1;
  flex: 0 0 auto;
}
.workspace-userbar .notification-bell-button {
  min-width: 34px;
  min-height: 34px;
  padding: 6px 9px;
  border-color: #9ed0ed;
  background: linear-gradient(#ffffff, #e7f6ff);
  color: #07558f;
}
.workspace-userbar .notification-badge {
  top: -8px;
  right: -8px;
  border-color: #eff9ff;
}
.workspace-userbar .notification-menu {
  top: calc(100% + 7px);
  right: 0;
}
html.embedded-shell .topbar,
html.embedded-shell header.topbar,
body.embedded-shell .topbar,
body.embedded-shell header.topbar {
  display: none !important;
}
html.embedded-shell .notification-bell,
body.embedded-shell .notification-bell {
  display: none !important;
}

/* R9 2026-07-05: responsive mobile e menu hamburger */
.workspace-menu-toggle,
.workspace-mobile-drawer,
.workspace-mobile-backdrop {
  display: none;
}
.workspace-menu-toggle {
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #8fc7e9;
  border-radius: 8px;
  background: linear-gradient(#ffffff, #e6f5ff);
  color: #063f6b;
  font: inherit;
  font-weight: 900;
  box-shadow: 0 2px 8px rgba(6,84,140,.08);
}
.hamburger-lines {
  width: 22px;
  height: 16px;
  display: inline-grid;
  gap: 4px;
}
.hamburger-lines i {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: #07558f;
}
.workspace-mobile-drawer[hidden],
.workspace-mobile-backdrop[hidden] {
  display: none !important;
}
.workspace-mobile-drawer-head,
.workspace-mobile-drawer-body,
.workspace-mobile-modules,
.workspace-mobile-submenu {
  min-width: 0;
}
.workspace-mobile-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #b9dbef;
  background: linear-gradient(135deg, #e5f6ff, #ffffff);
  color: #063f6b;
}
.workspace-mobile-close {
  width: 38px;
  height: 38px;
  border: 1px solid #9ed0ed;
  border-radius: 999px;
  background: #fff;
  color: #07558f;
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
}
.workspace-mobile-drawer-body {
  overflow: auto;
  padding: 12px;
  -webkit-overflow-scrolling: touch;
}
.workspace-mobile-label {
  margin: 10px 4px 8px;
  color: #426d90;
  font-size: .76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.workspace-mobile-modules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.workspace-mobile-module,
.workspace-mobile-action {
  min-height: 42px;
  border: 1px solid #b7d8ec;
  border-radius: 9px;
  background: #f8fcff;
  color: #123047;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  text-align: left;
  padding: 9px 10px;
}
.workspace-mobile-module.is-active {
  border-color: #0d92db;
  background: linear-gradient(135deg, #0e96dc, #46c2ff);
  color: #fff;
  box-shadow: 0 8px 18px rgba(13,146,219,.18);
}
.workspace-mobile-submenu {
  display: grid;
  gap: 8px;
}
.workspace-mobile-action {
  width: 100%;
  border-left: 4px solid #0d92db;
  background: linear-gradient(#ffffff, #eef9ff);
}
.table-wrap,
.fleet-table-wrap,
.car-tab-panel .table-wrap {
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 820px) {
  html.workspace-menu-open,
  body.workspace-menu-open {
    overflow: hidden;
  }
  body::before {
    background: rgba(238, 247, 253, .84);
  }
  .workspace-shell {
    min-height: 100dvh;
    padding: 6px;
    gap: 6px;
  }
  .workspace-header {
    position: sticky;
    top: 0;
    z-index: 1200;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    padding: 6px;
    border: 1px solid #8fc7e9;
    border-radius: 10px;
    background: rgba(238, 248, 255, .96);
    box-shadow: 0 8px 22px rgba(5, 86, 140, .13);
    backdrop-filter: blur(10px);
  }
  .workspace-menu-toggle {
    display: inline-flex;
  }
  .workspace-topnav {
    display: none !important;
  }
  .workspace-userbar {
    min-width: 0;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: nowrap;
  }
  .workspace-usericon {
    display: none;
  }
  .workspace-userbar .user-chip {
    min-width: 0;
    max-width: 136px;
    padding: 6px 8px;
    border-radius: 10px;
    font-size: 12px;
  }
  .workspace-userbar .user-chip strong,
  .workspace-userbar .user-chip small {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .workspace-userbar .notification-bell-button,
  .workspace-userbar .nav-button,
  .workspace-userbar [data-logout] {
    min-height: 36px;
    min-width: 38px;
    padding: 6px 9px;
    border-radius: 9px;
    font-size: 13px;
  }
  .workspace-userbar .notification-menu {
    position: fixed;
    top: 62px;
    left: 8px;
    right: 8px;
    width: auto;
    max-height: min(72dvh, 520px);
  }
  .workspace-mobile-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1290;
    display: block;
    background: rgba(4, 28, 46, .48);
    backdrop-filter: blur(2px);
  }
  .workspace-mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1300;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: min(360px, 88vw);
    background: rgba(250, 253, 255, .98);
    border-right: 1px solid #8fc7e9;
    box-shadow: 14px 0 42px rgba(7, 48, 76, .25);
  }
  .workspace-body {
    min-height: calc(100dvh - 66px);
    height: calc(100dvh - 66px);
    display: block;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255,255,255,.78);
  }
  .workspace-sidebar {
    display: none !important;
  }
  .workspace-main {
    height: 100%;
    min-height: 0;
    grid-template-rows: auto auto minmax(0, 1fr);
  }
  .workspace-tabs {
    min-height: 39px;
    padding: 7px 6px 0;
    gap: 5px;
    overflow-x: auto;
  }
  .workspace-tab {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 6px 9px;
    font-size: 12.5px;
  }
  .workspace-tab-label {
    max-width: 154px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .workspace-panel {
    min-height: 0;
    height: 100%;
  }
  .workspace-welcome {
    align-items: start;
    padding: 12px;
    overflow: auto;
  }
  .workspace-welcome-card {
    padding: 18px;
    border-radius: 14px;
  }
  .workspace-welcome-logo {
    width: 74px;
    height: 74px;
  }
  .workspace-welcome-card h2 {
    font-size: 1.28rem;
  }
  .workspace-welcome-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .workspace-welcome-actions .primary-button,
  .workspace-welcome-actions .secondary-button {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .workspace-header {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .workspace-menu-toggle span:last-child {
    display: none;
  }
  .workspace-menu-toggle {
    min-width: 42px;
    padding-inline: 9px;
  }
  .workspace-userbar .user-chip {
    max-width: 104px;
  }
  .workspace-userbar .user-chip small {
    display: none;
  }
  .workspace-userbar [data-logout] {
    padding-inline: 8px;
  }
  .workspace-mobile-modules {
    grid-template-columns: 1fr;
  }
  .workspace-body {
    min-height: calc(100dvh - 62px);
    height: calc(100dvh - 62px);
  }
}

@media (max-width: 820px) {
  .embedded-shell .app-shell {
    padding: 8px;
    font-size: 14px;
  }
  .embedded-shell .panel {
    padding: 11px;
    border-radius: 10px;
  }
  .embedded-shell .summary-grid,
  .embedded-shell .work-grid {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 10px;
  }
  .embedded-shell .section-heading {
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
  }
  .embedded-shell .form-row,
  .embedded-shell .form-row.two,
  .embedded-shell .form-row.three,
  .embedded-shell .filters-form,
  .embedded-shell .uploads-filters-form,
  .embedded-shell .damage-filters-form,
  .embedded-shell .car-damage-filters,
  .embedded-shell .damage-shift-grid,
  .embedded-shell .damage-upload-actions,
  .embedded-shell .queue-control-row,
  .embedded-shell .filter-actions,
  .embedded-shell .form-actions,
  .embedded-shell .car-pick-row,
  .embedded-shell .upload-detail-grid {
    grid-template-columns: 1fr !important;
  }
  .embedded-shell input,
  .embedded-shell select,
  .embedded-shell textarea,
  .embedded-shell .primary-button,
  .embedded-shell .secondary-button,
  .embedded-shell .small-button,
  .embedded-shell .nav-button {
    min-height: 42px;
    font-size: 15px;
  }
  .embedded-shell .primary-button,
  .embedded-shell .secondary-button,
  .embedded-shell .small-button {
    width: 100%;
    justify-content: center;
  }
  .embedded-shell .filter-actions,
  .embedded-shell .form-actions,
  .embedded-shell .queue-control-row,
  .embedded-shell .table-actions,
  .embedded-shell .title-actions,
  .embedded-shell .pdf-thumb-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .embedded-shell .reports-table {
    min-width: 780px;
  }
  .embedded-shell .damage-packages-table {
    min-width: 1040px;
  }
  .embedded-shell .damage-upload-table {
    min-width: 900px;
  }
  .embedded-shell .fleet-table-wrap,
  .embedded-shell .car-tab-panel .table-wrap {
    max-height: none;
  }
  .embedded-shell .photo-grid,
  .embedded-shell .pdf-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .embedded-shell .pdf-thumb-card {
    padding: 8px;
  }
  .embedded-shell .pdf-thumb-placeholder {
    min-height: 190px;
  }
  .embedded-shell .car-tabs {
    position: sticky;
    top: 0;
    gap: 6px;
    padding: 8px;
  }
  .embedded-shell .car-tab {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 7px 10px;
    font-size: 13px;
  }
  .embedded-shell .car-primary-grid,
  .embedded-shell .car-extra-grid,
  .embedded-shell .car-raw-grid,
  .embedded-shell .detail-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  .embedded-shell .app-shell {
    padding: 6px;
  }
  .embedded-shell h1 {
    font-size: 1.12rem;
  }
  .embedded-shell h2 {
    font-size: .98rem;
  }
  .embedded-shell .panel {
    padding: 9px;
  }
  .embedded-shell .photo-grid,
  .embedded-shell .pdf-gallery-grid {
    grid-template-columns: 1fr;
  }
  .embedded-shell .reports-table th,
  .embedded-shell .reports-table td {
    padding: 8px 7px;
  }
  .notification-popup-card {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }
}

/* R9B 2026-07-05: menu principale compatto in hamburger e workspace utilizzabile da cellulare */
.workspace-mobilebar,
.workspace-menu-backdrop {
  display: none;
}
.workspace-mobile-toggle {
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid #8fc7e9;
  border-radius: 10px;
  background: linear-gradient(#ffffff, #e7f6ff);
  color: #063f6b;
  font: inherit;
  font-weight: 900;
  box-shadow: 0 2px 8px rgba(6,84,140,.08);
}
.hamburger-line {
  width: 22px;
  height: 2px;
  display: block;
  border-radius: 999px;
  background: #07558f;
}
.workspace-mobile-title {
  min-width: 0;
  display: grid;
  gap: 1px;
  line-height: 1.1;
}
.workspace-mobile-title-kicker {
  color: #427391;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
}
.workspace-mobile-title strong {
  max-width: 42vw;
  overflow: hidden;
  color: #073c67;
  font-size: 15px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.workspace-menu-backdrop[hidden] {
  display: none !important;
}

@media (max-width: 820px) {
  .workspace-shell {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    padding: 6px;
    gap: 6px;
  }
  .workspace-header {
    position: sticky;
    top: 0;
    z-index: 1200;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    padding: 6px;
    border: 1px solid #8fc7e9;
    border-radius: 12px;
    background: rgba(237, 248, 255, .96);
    box-shadow: 0 8px 22px rgba(5, 86, 140, .13);
    backdrop-filter: blur(10px);
  }
  .workspace-mobilebar {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
  }
  .workspace-mobile-toggle {
    display: inline-flex;
    flex: 0 0 auto;
  }
  .workspace-topnav {
    position: fixed !important;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1300;
    width: min(340px, 88vw);
    min-height: 100dvh;
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
    overflow-y: auto;
    padding: max(16px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom));
    border: 0;
    border-right: 1px solid #8fc7e9;
    border-radius: 0 18px 18px 0;
    background: linear-gradient(180deg, rgba(236,248,255,.99), rgba(255,255,255,.99));
    box-shadow: 16px 0 42px rgba(7, 48, 76, .25);
    transform: translateX(-105%);
    transition: transform 180ms ease;
    scrollbar-width: thin;
  }
  html.workspace-menu-open .workspace-topnav,
  body.workspace-menu-open .workspace-topnav {
    transform: translateX(0);
  }
  .workspace-topnav::before {
    content: 'Menu ECH';
    display: block;
    padding: 8px 8px 12px;
    color: #073c67;
    font-size: 18px;
    font-weight: 900;
  }
  .workspace-topitem {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 10px 12px;
    border: 1px solid #b7d8ec;
    border-radius: 11px;
    background: #f8fcff;
    color: #123047;
    font-size: 15px;
    text-align: left;
  }
  .workspace-topitem.is-active {
    border-color: #0d92db;
    background: linear-gradient(135deg, #0e96dc, #46c2ff);
    color: #fff;
    box-shadow: 0 8px 18px rgba(13,146,219,.18);
  }
  .workspace-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1290;
    display: block;
    border: 0;
    background: rgba(4, 28, 46, .48);
    backdrop-filter: blur(2px);
  }
  .workspace-userbar {
    min-width: 0;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: nowrap;
  }
  .workspace-usericon {
    display: none;
  }
  .workspace-userbar .user-chip {
    min-width: 0;
    max-width: 132px;
    padding: 6px 8px;
    border-radius: 10px;
  }
  .workspace-userbar .user-chip strong,
  .workspace-userbar .user-chip small {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .workspace-userbar .notification-bell-button,
  .workspace-userbar .nav-button,
  .workspace-userbar [data-logout] {
    min-height: 38px;
    min-width: 40px;
    padding: 6px 9px;
    border-radius: 10px;
    font-size: 13px;
  }
  .workspace-userbar .notification-menu {
    position: fixed;
    top: 62px;
    left: 8px;
    right: 8px;
    width: auto;
    max-height: min(72dvh, 520px);
  }
  .workspace-body {
    min-height: calc(100dvh - 66px);
    height: calc(100dvh - 66px);
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-columns: 1fr !important;
    overflow: hidden;
    border-radius: 12px;
    background: rgba(255,255,255,.80);
  }
  .workspace-sidebar {
    display: block !important;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid #8fc7e9;
    background: rgba(248, 253, 255, .96);
  }
  .workspace-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 8px 4px;
    border-bottom: 0;
  }
  .workspace-sidebar-head h1 {
    margin: 0;
    font-size: .95rem;
  }
  .workspace-sidebar-head p {
    display: none;
  }
  .workspace-submenu {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding: 5px 8px 8px;
    -webkit-overflow-scrolling: touch;
  }
  .workspace-subitem {
    width: auto;
    min-height: 36px;
    flex: 0 0 auto;
    margin: 0;
    padding: 7px 11px;
    border-left-width: 3px;
    border-radius: 9px;
    font-size: 13px;
    white-space: nowrap;
  }
  .workspace-main {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
  }
  .workspace-tabs {
    min-height: 39px;
    gap: 5px;
    overflow-x: auto;
    padding: 7px 6px 0;
    -webkit-overflow-scrolling: touch;
  }
  .workspace-tab {
    min-height: 33px;
    flex: 0 0 auto;
    padding: 6px 9px;
    font-size: 12.5px;
  }
  .workspace-tab-label {
    max-width: 158px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .workspace-panel {
    height: 100%;
    min-height: 0;
  }
  .workspace-welcome {
    align-items: start;
    overflow: auto;
    padding: 12px;
  }
  .workspace-welcome-card {
    padding: 18px;
    border-radius: 14px;
  }
  .workspace-welcome-logo {
    width: 74px;
    height: 74px;
  }
  .workspace-welcome-card h2 {
    font-size: 1.28rem;
  }
  .workspace-welcome-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .workspace-welcome-actions .primary-button,
  .workspace-welcome-actions .secondary-button {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .workspace-shell {
    padding: 5px;
  }
  .workspace-header {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 5px;
  }
  .workspace-mobile-toggle-text {
    display: none;
  }
  .workspace-mobile-toggle {
    min-width: 42px;
    padding-inline: 9px;
  }
  .workspace-userbar .user-chip {
    max-width: 104px;
  }
  .workspace-userbar .user-chip small {
    display: none;
  }
  .workspace-userbar [data-logout] {
    padding-inline: 8px;
  }
  .workspace-body {
    min-height: calc(100dvh - 60px);
    height: calc(100dvh - 60px);
  }
}

@media (max-width: 420px) {
  .workspace-mobile-title strong {
    max-width: 34vw;
    font-size: 14px;
  }
  .workspace-userbar .user-chip {
    max-width: 82px;
  }
  .workspace-userbar [data-logout] {
    min-width: 34px;
    font-size: 0;
  }
  .workspace-userbar [data-logout]::after {
    content: '⇢';
    font-size: 18px;
  }
}

@media (max-width: 820px) {
  .embedded-shell .app-shell {
    padding: 8px;
    font-size: 14px;
  }
  .embedded-shell .panel {
    padding: 11px;
    border-radius: 10px;
  }
  .embedded-shell .summary-grid,
  .embedded-shell .work-grid {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 10px;
  }
  .embedded-shell .section-heading {
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
  }
  .embedded-shell .form-row,
  .embedded-shell .form-row.two,
  .embedded-shell .form-row.three,
  .embedded-shell .filters-form,
  .embedded-shell .uploads-filters-form,
  .embedded-shell .damage-filters-form,
  .embedded-shell .car-damage-filters,
  .embedded-shell .damage-shift-grid,
  .embedded-shell .damage-upload-actions,
  .embedded-shell .queue-control-row,
  .embedded-shell .filter-actions,
  .embedded-shell .form-actions,
  .embedded-shell .car-pick-row,
  .embedded-shell .upload-detail-grid {
    grid-template-columns: 1fr !important;
  }
  .embedded-shell input,
  .embedded-shell select,
  .embedded-shell textarea,
  .embedded-shell .primary-button,
  .embedded-shell .secondary-button,
  .embedded-shell .small-button,
  .embedded-shell .nav-button {
    min-height: 42px;
    font-size: 15px;
  }
  .embedded-shell .primary-button,
  .embedded-shell .secondary-button,
  .embedded-shell .small-button {
    width: 100%;
    justify-content: center;
  }
  .embedded-shell .filter-actions,
  .embedded-shell .form-actions,
  .embedded-shell .queue-control-row,
  .embedded-shell .table-actions,
  .embedded-shell .title-actions,
  .embedded-shell .pdf-thumb-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .embedded-shell .reports-table {
    min-width: 780px;
  }
  .embedded-shell .damage-packages-table {
    min-width: 1040px;
  }
  .embedded-shell .damage-upload-table {
    min-width: 900px;
  }
  .embedded-shell .table-wrap,
  .embedded-shell .fleet-table-wrap,
  .embedded-shell .car-tab-panel .table-wrap {
    max-height: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .embedded-shell .photo-grid,
  .embedded-shell .pdf-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .embedded-shell .pdf-thumb-card {
    padding: 8px;
  }
  .embedded-shell .pdf-thumb-placeholder {
    min-height: 190px;
  }
  .embedded-shell .car-tabs {
    position: sticky;
    top: 0;
    gap: 6px;
    padding: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .embedded-shell .car-tab {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 7px 10px;
    font-size: 13px;
  }
  .embedded-shell .car-primary-grid,
  .embedded-shell .car-extra-grid,
  .embedded-shell .car-raw-grid,
  .embedded-shell .detail-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  .embedded-shell .app-shell {
    padding: 6px;
  }
  .embedded-shell h1 {
    font-size: 1.12rem;
  }
  .embedded-shell h2 {
    font-size: .98rem;
  }
  .embedded-shell .panel {
    padding: 9px;
  }
  .embedded-shell .photo-grid,
  .embedded-shell .pdf-gallery-grid {
    grid-template-columns: 1fr;
  }
  .embedded-shell .reports-table th,
  .embedded-shell .reports-table td {
    padding: 8px 7px;
  }
  .notification-popup-card {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }
}

/* R9 finale: esperienza smartphone con menu a 3 lineette e azioni sempre raggiungibili */
.workspace-mobilebar,
.workspace-menu-backdrop {
  display: none;
}
.workspace-mobile-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid #8bc8ec;
  border-radius: 10px;
  background: linear-gradient(#ffffff, #e4f5ff);
  color: #063f6b;
  font: inherit;
  font-weight: 900;
  box-shadow: 0 2px 8px rgba(6,84,140,.10);
}
.hamburger-line {
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: #07558f;
  display: block;
}
.workspace-mobile-title {
  min-width: 0;
  display: grid;
  line-height: 1.05;
}
.workspace-mobile-title-kicker {
  color: #4380a4;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .05em;
}
.workspace-mobile-title strong {
  color: #063f6b;
  font-size: .96rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workspace-menu-backdrop[hidden] {
  display: none !important;
}

@media (max-width: 820px) {
  html.workspace-menu-open,
  body.workspace-menu-open {
    overflow: hidden;
  }
  body {
    background-attachment: scroll;
  }
  .workspace-shell {
    min-height: 100dvh;
    padding: 5px;
    gap: 5px;
  }
  .workspace-header {
    position: sticky;
    top: 0;
    z-index: 1500;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    padding: 6px;
    border: 1px solid #7cc7ef;
    border-radius: 12px;
    background: rgba(238, 248, 255, .97);
    box-shadow: 0 8px 22px rgba(5, 86, 140, .16);
    backdrop-filter: blur(10px);
  }
  .workspace-mobilebar {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }
  .workspace-mobile-toggle {
    flex: 0 0 auto;
  }
  .workspace-mobile-toggle-text {
    display: inline;
  }
  .workspace-topnav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1700;
    width: min(330px, 86vw);
    min-height: 100dvh;
    display: none !important;
    grid-auto-rows: min-content;
    align-content: start;
    padding: 12px;
    overflow-y: auto;
    border: 0;
    border-right: 1px solid #80c8ef;
    border-radius: 0;
    background: linear-gradient(180deg, rgba(250,253,255,.99), rgba(226,246,255,.99));
    box-shadow: 16px 0 44px rgba(4, 48, 82, .28);
    -webkit-overflow-scrolling: touch;
  }
  html.workspace-menu-open .workspace-topnav,
  body.workspace-menu-open .workspace-topnav {
    display: grid !important;
  }
  .workspace-topnav::before {
    content: 'Menu principale';
    display: block;
    margin: 2px 2px 10px;
    padding: 10px 8px 13px;
    border-bottom: 1px solid #b7d8ec;
    color: #063f6b;
    font-size: 1.04rem;
    font-weight: 900;
  }
  .workspace-topitem,
  .workspace-topitem:last-child {
    width: 100%;
    min-height: 46px;
    justify-content: flex-start;
    padding: 11px 12px;
    border: 1px solid #b7d8ec;
    border-left: 4px solid #0d92db;
    border-radius: 10px;
    margin: 0 0 8px;
    background: #f8fcff;
    color: #123047;
    font-size: 15px;
    text-align: left;
    white-space: normal;
  }
  .workspace-topitem.is-active {
    border-color: #0d92db;
    background: linear-gradient(135deg, #0e96dc, #46c2ff);
    color: #fff;
    box-shadow: 0 8px 18px rgba(13,146,219,.18);
  }
  .workspace-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1600;
    display: block;
    border: 0;
    padding: 0;
    background: rgba(4, 28, 46, .48);
    backdrop-filter: blur(2px);
  }
  .workspace-userbar {
    min-width: 0;
    justify-content: flex-end;
    gap: 5px;
    flex-wrap: nowrap;
  }
  .workspace-usericon {
    display: none;
  }
  .workspace-userbar .user-chip {
    min-width: 0;
    max-width: 132px;
    padding: 6px 8px;
    border-radius: 10px;
  }
  .workspace-userbar .user-chip strong,
  .workspace-userbar .user-chip small {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .workspace-userbar .user-chip strong {
    font-size: 12.5px;
  }
  .workspace-userbar .user-chip small {
    font-size: 11px;
  }
  .workspace-userbar .notification-bell-button,
  .workspace-userbar .nav-button,
  .workspace-userbar [data-logout] {
    min-height: 38px;
    min-width: 39px;
    padding: 6px 9px;
    border-radius: 10px;
    font-size: 13px;
  }
  .workspace-userbar .notification-menu {
    position: fixed;
    top: 62px;
    left: 8px;
    right: 8px;
    width: auto;
    max-height: min(72dvh, 520px);
  }
  .workspace-body {
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: calc(100dvh - 65px);
    height: calc(100dvh - 65px);
    overflow: hidden;
    border-radius: 12px;
    border-color: #7fc5ef;
    background: rgba(255,255,255,.80);
  }
  .workspace-sidebar {
    display: block !important;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid #9fd0ee;
    background: rgba(248,253,255,.96);
  }
  .workspace-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px 6px;
    border-bottom-color: #c5e2f2;
  }
  .workspace-sidebar-head h1 {
    margin: 0;
    font-size: .98rem;
  }
  .workspace-sidebar-head p {
    display: none;
  }
  .workspace-submenu {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding: 7px 8px 8px;
    -webkit-overflow-scrolling: touch;
  }
  .workspace-subitem {
    flex: 0 0 auto;
    margin: 0;
    min-height: 38px;
    padding: 8px 11px;
    border-radius: 999px;
    border-left-width: 1px;
    font-size: 13px;
    white-space: nowrap;
  }
  .workspace-main {
    height: 100%;
    min-height: 0;
    grid-template-rows: auto auto minmax(0, 1fr);
  }
  .workspace-tabs {
    min-height: 39px;
    padding: 7px 6px 0;
    gap: 5px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .workspace-tab {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 6px 9px;
    font-size: 12.5px;
  }
  .workspace-tab-label {
    max-width: 154px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .workspace-panel,
  .workspace-frames,
  .workspace-frame {
    min-height: 0;
    height: 100%;
  }
  .workspace-welcome {
    align-items: start;
    padding: 12px;
    overflow: auto;
  }
  .workspace-welcome-card {
    padding: 18px;
    border-radius: 14px;
  }
  .workspace-welcome-logo {
    width: 74px;
    height: 74px;
  }
  .workspace-welcome-card h2 {
    font-size: 1.28rem;
  }
  .workspace-welcome-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .workspace-welcome-actions .primary-button,
  .workspace-welcome-actions .secondary-button {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .workspace-mobile-title strong {
    max-width: 115px;
  }
  .workspace-mobile-toggle-text {
    display: none;
  }
  .workspace-mobile-toggle {
    min-width: 42px;
    padding-inline: 10px;
  }
  .workspace-userbar .user-chip {
    max-width: 96px;
  }
  .workspace-userbar .user-chip small {
    display: none;
  }
  .workspace-userbar [data-logout] {
    padding-inline: 8px;
  }
  .workspace-body {
    min-height: calc(100dvh - 62px);
    height: calc(100dvh - 62px);
  }
}

/* Mobile anche fuori dal workspace */
@media (max-width: 820px) {
  .app-shell {
    width: 100%;
    padding: 10px;
  }
  body:not(.embedded-shell) .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 10px 0;
  }
  body:not(.embedded-shell) .top-actions {
    justify-content: flex-start;
    gap: 8px;
  }
  .panel {
    padding: 12px;
    border-radius: 12px;
  }
  .form-row,
  .form-row.two,
  .form-row.three,
  .filters-form,
  .uploads-filters-form,
  .damage-filters-form,
  .car-damage-filters,
  .damage-shift-grid,
  .damage-upload-actions,
  .queue-control-row,
  .filter-actions,
  .form-actions,
  .car-pick-row,
  .upload-detail-grid,
  .detail-grid,
  .car-primary-grid,
  .car-extra-grid,
  .car-raw-grid {
    grid-template-columns: 1fr !important;
  }
  input,
  select,
  textarea {
    min-height: 42px;
    font-size: 16px;
  }
  .primary-button,
  .secondary-button,
  .small-button,
  .nav-button {
    min-height: 42px;
    font-size: 15px;
  }
  .table-wrap,
  .fleet-table-wrap,
  .car-tab-panel .table-wrap {
    max-width: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  .reports-table {
    min-width: 760px;
    font-size: 13px;
  }
  .damage-packages-table {
    min-width: 1040px;
  }
  .damage-upload-table {
    min-width: 900px;
  }
  .photo-grid,
  .pdf-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .sticky-actions {
    position: static;
    background: transparent;
  }
  .file-zone {
    min-height: 98px;
  }
}

@media (max-width: 480px) {
  .app-shell {
    padding: 6px;
  }
  h1 {
    font-size: 1.18rem;
  }
  h2 {
    font-size: 1rem;
  }
  .panel {
    padding: 10px;
  }
  .photo-grid,
  .pdf-gallery-grid {
    grid-template-columns: 1fr;
  }
  .reports-table th,
  .reports-table td {
    padding: 8px 7px;
  }
  .notification-popup-card {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }
}

/* R9C 2026-07-05: rifiniture mobile anche fuori dal workspace */
@media (max-width: 820px) {
  body:not(.embedded-shell) .app-shell {
    width: 100%;
    max-width: none;
    padding: 8px;
  }
  body:not(.embedded-shell) .topbar {
    position: sticky;
    top: 0;
    z-index: 800;
    align-items: center;
    padding: 7px;
    border: 1px solid #8fc7e9;
    border-radius: 12px;
    background: rgba(237, 248, 255, .96);
    box-shadow: 0 8px 22px rgba(5, 86, 140, .13);
    backdrop-filter: blur(10px);
  }
  body:not(.embedded-shell) .brand-block {
    gap: 8px;
  }
  body:not(.embedded-shell) .brand-icon {
    width: 36px;
    height: 36px;
  }
  body:not(.embedded-shell) h1 {
    font-size: 1.18rem;
  }
  body:not(.embedded-shell) h2 {
    font-size: 1rem;
  }
  body:not(.embedded-shell) .top-actions {
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
  }
  body:not(.embedded-shell) .top-actions .user-chip {
    flex: 0 0 auto;
    max-width: 150px;
    padding: 6px 8px;
    border-radius: 10px;
  }
  body:not(.embedded-shell) .top-actions .user-chip strong,
  body:not(.embedded-shell) .top-actions .user-chip small {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  body:not(.embedded-shell) .panel {
    padding: 12px;
    border-radius: 10px;
    background: rgba(255,255,255,.96);
  }
  body:not(.embedded-shell) .work-grid,
  body:not(.embedded-shell) .summary-grid,
  body:not(.embedded-shell) .form-row,
  body:not(.embedded-shell) .form-row.two,
  body:not(.embedded-shell) .form-row.three,
  body:not(.embedded-shell) .filters-form,
  body:not(.embedded-shell) .uploads-filters-form,
  body:not(.embedded-shell) .damage-filters-form,
  body:not(.embedded-shell) .car-damage-filters,
  body:not(.embedded-shell) .damage-shift-grid,
  body:not(.embedded-shell) .damage-upload-actions,
  body:not(.embedded-shell) .queue-control-row,
  body:not(.embedded-shell) .form-actions,
  body:not(.embedded-shell) .filter-actions,
  body:not(.embedded-shell) .car-pick-row,
  body:not(.embedded-shell) .upload-detail-grid {
    grid-template-columns: 1fr !important;
  }
  body:not(.embedded-shell) input,
  body:not(.embedded-shell) select,
  body:not(.embedded-shell) textarea,
  body:not(.embedded-shell) .primary-button,
  body:not(.embedded-shell) .secondary-button,
  body:not(.embedded-shell) .small-button,
  body:not(.embedded-shell) .nav-button {
    min-height: 42px;
    font-size: 15px;
  }
  body:not(.embedded-shell) .primary-button,
  body:not(.embedded-shell) .secondary-button,
  body:not(.embedded-shell) .small-button {
    justify-content: center;
  }
  body:not(.embedded-shell) .table-wrap,
  body:not(.embedded-shell) .fleet-table-wrap,
  body:not(.embedded-shell) .car-tab-panel .table-wrap {
    max-height: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  body:not(.embedded-shell) .reports-table {
    min-width: 760px;
  }
  body:not(.embedded-shell) .damage-packages-table {
    min-width: 1040px;
  }
  body:not(.embedded-shell) .damage-upload-table {
    min-width: 900px;
  }
  body:not(.embedded-shell) .photo-grid,
  body:not(.embedded-shell) .pdf-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  body:not(.embedded-shell) .car-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  body:not(.embedded-shell) .car-tab {
    flex: 0 0 auto;
  }
}

@media (max-width: 480px) {
  body:not(.embedded-shell) .app-shell {
    padding: 6px;
  }
  body:not(.embedded-shell) .photo-grid,
  body:not(.embedded-shell) .pdf-gallery-grid {
    grid-template-columns: 1fr;
  }
  body:not(.embedded-shell) .top-actions .user-chip {
    max-width: 104px;
  }
  body:not(.embedded-shell) .top-actions .user-chip small {
    display: none;
  }
}

/* R12 2026-07-06: correzione reale vista cellulare/iPhone dentro iframe */
@media (max-width: 820px) {
  .workspace-shell {
    width: 100vw;
    max-width: 100vw;
    overflow: hidden;
  }
  .workspace-header {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 5px;
  }
  .workspace-mobile-title-kicker {
    font-size: 10px;
  }
  .workspace-mobile-title strong {
    max-width: 42vw;
    font-size: 16px;
  }
  .workspace-userbar {
    gap: 4px;
  }
  .workspace-userbar .notification-bell-button,
  .workspace-userbar .nav-button,
  .workspace-userbar [data-logout] {
    min-width: 38px;
    min-height: 38px;
    padding: 6px 8px;
  }
  .workspace-userbar .user-chip {
    max-width: 110px;
    padding: 5px 7px;
  }
  .workspace-sidebar-head {
    padding: 7px 9px 4px;
  }
  .workspace-sidebar-head h1 {
    font-size: 1.08rem;
  }
  .workspace-submenu {
    padding: 5px 7px 7px;
  }
  .workspace-subitem {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 13px;
  }
  .workspace-tabs {
    min-height: 34px;
    padding: 4px 5px 0;
  }
  .workspace-tab {
    min-height: 30px;
    padding: 5px 8px;
  }
  .workspace-panel,
  .workspace-frames {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }
  .workspace-frame {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
}

@media (max-width: 520px) {
  .workspace-shell {
    padding: 4px;
    gap: 4px;
  }
  .workspace-header {
    border-radius: 11px;
  }
  .workspace-mobile-toggle {
    min-width: 42px;
    min-height: 38px;
    padding: 8px 9px;
  }
  .workspace-mobile-title strong {
    max-width: 36vw;
    font-size: 15px;
  }
  .workspace-userbar .user-chip {
    max-width: 96px;
  }
  .workspace-userbar .user-chip small {
    display: none !important;
  }
  .workspace-body {
    height: calc(100svh - 58px) !important;
    min-height: calc(100svh - 58px) !important;
  }
  .workspace-tabs {
    white-space: nowrap;
  }
  .workspace-tab:not(.is-active) {
    display: none;
  }
  .workspace-tab.is-active {
    width: 100%;
    justify-content: space-between;
  }
  .workspace-tab-label {
    max-width: calc(100vw - 90px);
  }
}

/* R92 - navigazione coerente, icone e nuovi workspace */
.workspace-topitem {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-decoration: none;
}
.workspace-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  pointer-events: none;
}
.workspace-subitem-icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 8px;
  background: #e8f3fb;
  color: #0b72b5;
}
.workspace-subitem-icon::before { content: none !important; }
.workspace-subitem-icon .workspace-icon { width: 17px; height: 17px; }
.workspace-navigation-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 6px 12px;
  border-bottom: 1px solid #d7e4ee;
  background: linear-gradient(90deg, #f8fbfd, #eef7fc);
}
.workspace-back-button { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 5px 11px; }
.workspace-back-button:disabled { opacity: .48; cursor: not-allowed; }

.notification-center-list,
.activity-log-list { display: grid; gap: 12px; }
.notification-center-card,
.activity-log-card {
  overflow: hidden;
  border: 1px solid #cbdce8;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(18, 63, 101, .06);
}
.notification-center-card.is-unread { border-left: 5px solid #0c8fd3; background: #f5fbff; }
.notification-center-card.is-read { opacity: .82; }
.notification-center-main {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 14px 16px 10px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.notification-center-main:hover,
.notification-center-main:focus-visible { background: #eef8fe; outline: none; }
.notification-center-main p { margin: 0; color: #38566d; line-height: 1.45; }
.notification-center-main small { color: #708496; }
.notification-center-actions { display: flex; justify-content: flex-end; padding: 0 12px 12px; }
.activity-log-card { padding: 15px; }
.activity-log-head,
.activity-log-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 14px; }
.activity-log-head > div { display: grid; gap: 3px; }
.activity-log-head span,
.activity-log-head time,
.activity-log-meta { color: #647b8e; font-size: .78rem; }
.activity-log-meta { justify-content: flex-start; margin-top: 10px; }
.activity-log-reason { margin: 12px 0; padding: 9px 11px; border-left: 4px solid #0c8fd3; background: #f2f9fd; }
.activity-log-card details { border-top: 1px solid #dce7ef; padding-top: 10px; }
.activity-log-card summary { color: #0b679e; font-weight: 750; cursor: pointer; }
.activity-diff { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.activity-diff section { min-width: 0; padding: 10px; border-radius: 9px; background: #f6f9fb; }
.activity-diff h3 { margin: 0 0 7px; font-size: .8rem; }
.activity-diff pre { max-height: 360px; margin: 0; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .72rem; }
.activity-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  align-items: end;
  gap: 12px;
}
.activity-filter-grid > * { min-width: 0; }
.activity-filter-field { display: grid; gap: 6px; }
.activity-filter-field > label {
  display: block;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 700;
}
.activity-search-menu { position: relative; min-width: 0; }
.activity-search-options {
  position: absolute;
  z-index: 80;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  max-height: 218px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px;
  border: 1px solid #9fbdd1;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(15, 48, 72, .2);
}
.activity-search-options[hidden] { display: none !important; }
.activity-search-option {
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #173b55;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.activity-search-option:hover,
.activity-search-option:focus-visible,
.activity-search-option.is-active { background: #e8f4fc; outline: none; }
.activity-search-option[aria-selected="true"] { color: #075f94; font-weight: 850; }
.activity-search-empty { padding: 11px; color: #60758a; text-align: center; }
.activity-filter-actions {
  align-self: end;
  justify-content: flex-end;
  margin: 0;
}
.activity-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}
.activity-pagination .status-pill { min-width: 112px; text-align: center; }
@media (max-width: 1120px) {
  .activity-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .workspace-navigation-bar { justify-content: space-between; }
  .activity-diff { grid-template-columns: minmax(0, 1fr); }
  .activity-filter-grid { grid-template-columns: minmax(0, 1fr); }
  .activity-filter-actions,
  .activity-pagination { display: grid; grid-template-columns: minmax(0, 1fr); }
  .activity-pagination .status-pill { order: -1; }
}

html.mobile-embedded-shell,
html.mobile-embedded-shell body,
body.mobile-embedded-shell {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: hidden !important;
  background: transparent !important;
}
html.mobile-embedded-shell * {
  min-width: 0;
}
.mobile-embedded-shell .app-shell {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 6px !important;
  overflow-x: hidden !important;
  font-size: 14px !important;
}
.mobile-embedded-shell .topbar,
.mobile-embedded-shell header.topbar,
.mobile-embedded-shell .notification-bell {
  display: none !important;
}
.mobile-embedded-shell .panel,
.mobile-embedded-shell .car-window,
.mobile-embedded-shell .form-panel,
.mobile-embedded-shell .upload-panel {
  width: 100% !important;
  max-width: 100% !important;
  padding: 10px !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  overflow: hidden !important;
}
.mobile-embedded-shell .summary-grid,
.mobile-embedded-shell .work-grid,
.mobile-embedded-shell .damage-upload-layout,
.mobile-embedded-shell .damage-form-layout,
.mobile-embedded-shell .fleet-layout,
.mobile-embedded-shell .car-detail-layout,
.mobile-embedded-shell .form-row,
.mobile-embedded-shell .form-row.two,
.mobile-embedded-shell .form-row.three,
.mobile-embedded-shell .filters-form,
.mobile-embedded-shell .uploads-filters-form,
.mobile-embedded-shell .damage-filters-form,
.mobile-embedded-shell .car-damage-filters,
.mobile-embedded-shell .damage-shift-grid,
.mobile-embedded-shell .damage-upload-actions,
.mobile-embedded-shell .queue-control-row,
.mobile-embedded-shell .filter-actions,
.mobile-embedded-shell .form-actions,
.mobile-embedded-shell .car-pick-row,
.mobile-embedded-shell .upload-detail-grid,
.mobile-embedded-shell .detail-grid,
.mobile-embedded-shell .car-primary-grid,
.mobile-embedded-shell .car-extra-grid,
.mobile-embedded-shell .car-raw-grid {
  width: 100% !important;
  max-width: 100% !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 9px !important;
}
.mobile-embedded-shell .section-heading {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  align-items: start !important;
  gap: 7px !important;
  margin-bottom: 9px !important;
  padding-bottom: 6px !important;
}
.mobile-embedded-shell h1 {
  font-size: 1.16rem !important;
  line-height: 1.15 !important;
}
.mobile-embedded-shell h2,
.mobile-embedded-shell .section-heading h2 {
  font-size: 1.04rem !important;
  line-height: 1.18 !important;
}
.mobile-embedded-shell .eyebrow {
  font-size: .70rem !important;
}
.mobile-embedded-shell label {
  width: 100% !important;
  max-width: 100% !important;
  gap: 4px !important;
  font-size: .82rem !important;
}
.mobile-embedded-shell input,
.mobile-embedded-shell select,
.mobile-embedded-shell textarea {
  width: 100% !important;
  max-width: 100% !important;
  min-height: 42px !important;
  padding: 9px 10px !important;
  border-radius: 8px !important;
  font-size: 16px !important;
}
.mobile-embedded-shell textarea {
  min-height: 92px !important;
}
.mobile-embedded-shell .primary-button,
.mobile-embedded-shell .secondary-button,
.mobile-embedded-shell .small-button,
.mobile-embedded-shell .nav-button {
  width: 100% !important;
  max-width: 100% !important;
  min-height: 42px !important;
  padding: 9px 11px !important;
  border-radius: 8px !important;
  font-size: 15px !important;
  line-height: 1.15 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  text-align: center !important;
  justify-content: center !important;
}
.mobile-embedded-shell .summary-pill,
.mobile-embedded-shell .status-badge {
  width: auto !important;
  max-width: 100% !important;
  min-height: 30px !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  justify-content: flex-start !important;
}
.mobile-embedded-shell .file-zone {
  width: 100% !important;
  min-height: 108px !important;
  padding: 12px !important;
  overflow: hidden !important;
}
.mobile-embedded-shell .file-zone-title,
.mobile-embedded-shell .file-zone-meta,
.mobile-embedded-shell .field-hint,
.mobile-embedded-shell .info-strip {
  max-width: 100% !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}
.mobile-embedded-shell .info-strip {
  padding: 9px 10px !important;
  font-size: .88rem !important;
  line-height: 1.35 !important;
}
.mobile-embedded-shell .table-wrap,
.mobile-embedded-shell .fleet-table-wrap,
.mobile-embedded-shell .car-tab-panel .table-wrap {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: touch !important;
}
.mobile-embedded-shell .reports-table {
  width: max-content !important;
  min-width: 760px !important;
  font-size: 13px !important;
}
.mobile-embedded-shell .damage-upload-table {
  min-width: 850px !important;
}
.mobile-embedded-shell .damage-packages-table {
  min-width: 980px !important;
}
.mobile-embedded-shell .photo-grid,
.mobile-embedded-shell .pdf-gallery-grid {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 9px !important;
}
.mobile-embedded-shell .pdf-thumb-card,
.mobile-embedded-shell .photo-link {
  width: 100% !important;
  max-width: 100% !important;
}
.mobile-embedded-shell .pdf-thumb-button {
  max-height: 72vh !important;
}
.mobile-embedded-shell .car-tabs {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  padding: 8px 0 !important;
  gap: 6px !important;
}
.mobile-embedded-shell .car-tab {
  flex: 0 0 auto !important;
  min-height: 38px !important;
  padding: 7px 10px !important;
  font-size: 13px !important;
}
.mobile-embedded-shell .pdf-batch-viewer {
  padding: 6px !important;
}
.mobile-embedded-shell .pdf-batch-dialog {
  width: calc(100vw - 12px) !important;
  height: calc(100dvh - 12px) !important;
  border-radius: 10px !important;
}
.mobile-embedded-shell .pdf-batch-header {
  display: grid !important;
  grid-template-columns: 1fr !important;
  padding: 10px !important;
}
.mobile-embedded-shell .pdf-batch-actions {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 7px !important;
}
.mobile-embedded-shell .pdf-package-content .pdf-batch-frame,
.mobile-embedded-shell .pdf-batch-frame {
  min-height: 0 !important;
}

/* R13: Damage Form OCR/batch upload improvements */
.damage-upload-sticky {
  position: sticky;
  top: 0;
  z-index: 25;
  border-color: #9ed2ff;
  box-shadow: 0 10px 28px rgba(13, 110, 253, .10);
}
.embedded-shell .damage-upload-sticky,
.mobile-embedded-shell .damage-upload-sticky {
  top: 0;
}
.damage-upload-table {
  min-width: 1080px;
}
.damage-upload-table .damage-file-cell {
  max-width: 190px;
  overflow-wrap: anywhere;
  font-size: .86rem;
  color: #415a77;
}
.damage-upload-table td small {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: .75rem;
  line-height: 1.2;
}
.damage-upload-table tr.is-skipped {
  opacity: .62;
  background: #f8fafc;
}
.damage-upload-table tr.is-warning {
  background: #fffaf0;
}
.damage-upload-table tr.is-duplicate {
  background: #fff4f2;
}
.damage-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 900;
  font-size: .78rem;
  line-height: 1;
  border: 1px solid transparent;
}
.damage-status.ok {
  color: #0f6b2f;
  background: #effaf2;
  border-color: rgba(15,107,47,.20);
}
.damage-status.warning {
  color: #9a5b00;
  background: #fff3d7;
  border-color: rgba(154,91,0,.24);
}
.damage-status.danger {
  color: #b5413d;
  background: #fff1ef;
  border-color: rgba(181,65,61,.25);
}
.damage-status.muted {
  color: #475569;
  background: #eef2f7;
  border-color: rgba(71,85,105,.20);
}
.damage-upload-table .table-actions {
  gap: 6px;
  justify-content: flex-start;
}
.damage-upload-table .small-button {
  min-height: 34px;
  padding: 7px 10px;
}
.damage-upload-table input {
  min-width: 128px;
}
.damage-upload-table input[data-field="plate"],
.damage-upload-table input[data-field="agreement"] {
  font-weight: 800;
  letter-spacing: .02em;
}
@media (max-width: 760px) {
  .damage-upload-sticky {
    position: sticky;
    top: 0;
  }
  .damage-upload-table {
    min-width: 920px;
  }
  .damage-upload-table .damage-file-cell {
    max-width: 150px;
  }
}

/* R14: pulsanti Parco Auto e tabelle più chiare */
.fleet-mode-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}
.fleet-mode-button {
  min-height: 42px;
  border-color: #99c9ef;
  background: linear-gradient(#fff, #eff8ff);
  color: #0b4f86;
}
.fleet-mode-button.is-active {
  color: #fff;
  background: linear-gradient(#36a8ef, #0d7bc1);
  border-color: #0b79bf;
  box-shadow: 0 6px 18px rgba(13,123,193,.18);
}
.fleet-filter-form {
  grid-template-columns: minmax(190px, .42fr) minmax(240px, 1fr) auto;
}
.fleet-search-highlight {
  padding: 0 .08em;
  border-radius: 3px;
  color: inherit;
  background: #ffeb62;
  box-shadow: 0 0 0 1px rgba(190, 145, 0, .16);
  font-weight: 900;
}
@media (max-width: 760px) {
  .fleet-mode-actions,
  .fleet-filter-form {
    grid-template-columns: 1fr;
  }
}

/* R18: pannello diagnostica salvataggio Damage Form */
.damage-log-panel { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 8px 12px; }
.damage-log-panel summary { cursor: pointer; font-weight: 600; color: #33415c; user-select: none; }
.damage-log-badge { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: #b5413d; color: #fff; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.damage-log-toolbar { display: flex; gap: 8px; margin: 8px 0; }
.damage-log { margin: 0; max-height: 240px; overflow: auto; padding: 10px; border-radius: 8px; background: #0f172a; color: #d7e3f4; font-size: .78rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.damage-log .log-error { color: #ff9d97; }

/* R21 2026-07-08: Damage Form upload più compatto e senza blocco istruzioni */
.damage-upload-layout {
  gap: 10px;
}
.damage-upload-sticky {
  padding: 9px 12px !important;
}
.damage-upload-sticky .section-heading {
  margin-bottom: 7px !important;
}
.damage-upload-sticky .section-heading h2 {
  font-size: 1.02rem !important;
  line-height: 1.15 !important;
}
.damage-upload-sticky .eyebrow {
  margin-bottom: 1px !important;
  font-size: .70rem !important;
}
.damage-upload-sticky .summary-pill {
  min-height: 28px !important;
  padding: 4px 9px !important;
  font-size: .76rem !important;
}
.damage-upload-sticky .damage-shift-grid {
  grid-template-columns: minmax(155px, .9fr) minmax(140px, .55fr) minmax(220px, 1.3fr) minmax(105px, .4fr) !important;
  gap: 7px !important;
  margin-bottom: 7px !important;
}
.damage-upload-sticky label {
  gap: 3px !important;
  font-size: .76rem !important;
}
.damage-upload-sticky input,
.damage-upload-sticky select {
  min-height: 34px !important;
  padding: 6px 9px !important;
  font-size: .86rem !important;
  border-radius: 7px !important;
}
.damage-upload-sticky .form-row.two {
  grid-template-columns: minmax(280px, 1.15fr) minmax(360px, .95fr) !important;
  gap: 8px !important;
  align-items: end !important;
}
.damage-upload-sticky .compact-file,
.damage-upload-sticky .file-zone {
  min-height: 54px !important;
  padding: 7px 10px !important;
  border-radius: 8px !important;
}
.damage-upload-sticky .file-zone-title {
  font-size: .92rem !important;
}
.damage-upload-sticky .file-zone-meta {
  font-size: .74rem !important;
}
.damage-upload-sticky .damage-upload-actions {
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
}
.damage-upload-sticky .primary-button,
.damage-upload-sticky .secondary-button {
  min-height: 34px !important;
  padding: 6px 10px !important;
  font-size: .86rem !important;
  border-radius: 7px !important;
}
.damage-upload-sticky .damage-log-panel {
  margin-top: 7px !important;
  padding: 5px 9px !important;
  border-radius: 8px !important;
}
.damage-upload-sticky .damage-log-panel summary {
  font-size: .78rem !important;
}
.damage-upload-sticky .damage-log-toolbar {
  margin: 6px 0 !important;
}
.damage-upload-sticky .damage-log {
  max-height: 120px !important;
  padding: 8px !important;
  font-size: .72rem !important;
}
.damage-upload-sticky .info-strip {
  display: none !important;
}
.damage-upload-layout > .panel:not(.damage-upload-sticky) {
  padding-top: 12px !important;
}
.damage-upload-layout > .panel:not(.damage-upload-sticky) .section-heading.compact {
  margin-bottom: 8px !important;
}
.damage-upload-table th,
.damage-upload-table td {
  padding-top: 7px !important;
  padding-bottom: 7px !important;
}
@media (max-width: 900px) {
  .damage-upload-sticky .damage-shift-grid,
  .damage-upload-sticky .form-row.two,
  .damage-upload-sticky .damage-upload-actions {
    grid-template-columns: 1fr !important;
  }
  .damage-upload-sticky {
    padding: 8px !important;
  }
  .damage-upload-sticky .section-heading {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 5px !important;
  }
}
@media (max-width: 560px) {
  .damage-upload-sticky .compact-file,
  .damage-upload-sticky .file-zone {
    min-height: 48px !important;
  }
  .damage-upload-sticky .primary-button,
  .damage-upload-sticky .secondary-button {
    min-height: 38px !important;
  }
}

/* R22 2026-07-13: OCR locale Damage Form, controllo qualità e revisione pagina */
body.damage-review-open { overflow: hidden; }
.local-ocr-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 9px;
  margin: 0 0 9px;
  padding: 8px 10px;
  border: 1px solid #b9d9f5;
  border-radius: 8px;
  background: #f3f9ff;
  color: #31536e;
  font-size: .78rem;
  line-height: 1.35;
}
.local-ocr-note strong { color: #0b4f86; }
.local-ocr-note #localOcrState { color: var(--muted); }
.damage-file-actions-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.15fr) minmax(320px, .85fr);
  gap: 9px;
  align-items: stretch;
}
.damage-upload-actions-expanded {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-content: stretch;
}
.damage-progress-panel {
  margin-top: 9px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}
.damage-progress-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  color: #33415c;
  font-size: .78rem;
}
.damage-progress-track {
  position: relative;
  width: 100%;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe9f4;
}
.damage-progress-track > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0d6efd, #36a8ef);
  transition: width 180ms ease;
}
.damage-quality-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  margin-top: 9px;
}
.damage-quality-summary > div {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}
.damage-quality-summary span {
  min-width: 0;
  color: var(--muted);
  font-size: .69rem;
  font-weight: 800;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.damage-quality-summary strong { font-size: 1.03rem; }
.damage-quality-summary .is-success { border-color: #b9dfca; background: #f1fbf5; }
.damage-quality-summary .is-success strong { color: #157347; }
.damage-quality-summary .is-info { border-color: #b9d9f5; background: #f3f9ff; }
.damage-quality-summary .is-info strong { color: #0b5ed7; }
.damage-quality-summary .is-warning { border-color: #f0d49a; background: #fff9eb; }
.damage-quality-summary .is-warning strong { color: #8a5a00; }
.damage-quality-summary .is-danger { border-color: #edc0bd; background: #fff5f4; }
.damage-quality-summary .is-danger strong { color: var(--danger); }
.damage-table-help { color: var(--muted); text-align: right; }
.damage-upload-table {
  min-width: 1120px;
  border-collapse: separate;
  border-spacing: 0 10px;
}
.damage-upload-table td { font-size: .86rem; }
.damage-upload-table td.damage-key-field {
  color: #17263d;
  font-weight: 900;
  letter-spacing: .015em;
}
.damage-file-name {
  display: inline-block;
  max-width: 225px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.damage-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .69rem;
  font-weight: 900;
  letter-spacing: .02em;
  white-space: nowrap;
}
.damage-status-badge.success { color: #11663f; border-color: #a7d8bd; background: #eefaf3; }
.damage-status-badge.info { color: #0b4f86; border-color: #acd0ec; background: #eef7ff; }
.damage-status-badge.warning { color: #7a5000; border-color: #e9ca86; background: #fff8e5; }
.damage-status-badge.danger { color: #9f302d; border-color: #e5b4b1; background: #fff1f0; }
.damage-status-badge.muted { color: #58677c; border-color: #cfdae7; background: #f3f6fa; }
.damage-status-detail {
  display: block;
  max-width: 190px;
  margin-top: 4px;
  color: var(--muted);
  font-size: .69rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.damage-confidence { min-width: 92px; }
.damage-confidence strong { display: block; margin-bottom: 3px; font-size: .78rem; }
.damage-confidence > span {
  display: block;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3eaf2;
}
.damage-confidence > span > i { display: block; height: 100%; border-radius: inherit; }
.damage-confidence.success strong { color: #157347; }
.damage-confidence.success > span > i { background: #2d9d64; }
.damage-confidence.warning strong { color: #8a5a00; }
.damage-confidence.warning > span > i { background: #d59b27; }
.damage-confidence.danger strong { color: var(--danger); }
.damage-confidence.danger > span > i { background: #c74a45; }
.damage-row-actions { display: flex; flex-wrap: wrap; gap: 5px; min-width: 156px; }
.damage-row-actions .small-button { min-height: 30px; padding: 4px 8px; font-size: .72rem; }
.primary-small { color: #fff !important; border-color: var(--primary) !important; background: var(--primary) !important; }
.damage-row-automatico td { background: rgba(32, 143, 83, .025); }
.damage-row-verificato_manualmente td { background: rgba(13, 110, 253, .025); }
.damage-row-da_verificare td { background: rgba(213, 155, 39, .055); }
.damage-row-non_valido td { background: rgba(181, 65, 61, .055); }
.damage-row-saltato td { opacity: .67; }
.damage-row-salvato td { background: rgba(32, 143, 83, .045); }

.damage-review-modal[hidden] { display: none !important; }
.damage-review-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(10, 21, 38, .76);
  backdrop-filter: blur(3px);
}
.damage-review-dialog {
  width: min(1480px, 100%);
  max-height: calc(100vh - 36px);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid #c8d5e4;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(6, 17, 34, .38);
}
.damage-review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: #f7faff;
}
.damage-review-header h2 { overflow-wrap: anywhere; }
.damage-review-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(520px, 1.4fr) minmax(390px, .8fr);
  gap: 0;
  overflow: hidden;
}
.damage-review-preview-column,
.damage-review-form-column { min-height: 0; overflow: auto; padding: 14px; }
.damage-review-preview-column { border-right: 1px solid var(--line); background: #e9eff6; }
.damage-review-preview {
  width: 100%;
  display: block;
  border: 1px solid #bdc9d7;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .13);
}
.damage-crop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 10px;
}
.damage-crop-grid figure {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid #bdc9d7;
  border-radius: 7px;
  background: #fff;
}
.damage-crop-grid figcaption {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  color: #4d5e73;
  font-size: .69rem;
  font-weight: 900;
  text-transform: uppercase;
}
.damage-crop-grid img { width: 100%; min-height: 74px; max-height: 190px; display: block; object-fit: contain; background: #fff; }
.damage-review-form-column { display: grid; align-content: start; gap: 12px; }
.damage-review-validation {
  display: grid;
  gap: 6px;
  min-height: 0;
}
.damage-review-validation:empty { display: none; }
.damage-validation-message { padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; font-size: .78rem; line-height: 1.35; }
.damage-validation-message.error { color: #962e2a; border-color: #e5b4b1; background: #fff3f2; }
.damage-validation-message.warning { color: #765000; border-color: #e9cb88; background: #fff9e9; }
.damage-validation-message.success { color: #10613a; border-color: #acd9bf; background: #f0faf4; }
.damage-review-fields { margin: 0; }
.damage-review-fields input { font-weight: 800; letter-spacing: .01em; }
.damage-review-info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.damage-review-info-grid > div {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fbff;
}
.damage-review-info-grid span { display: block; color: var(--muted); font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.damage-review-info-grid strong { display: block; margin-top: 2px; font-size: .84rem; overflow-wrap: anywhere; }
.damage-ocr-details { border: 1px solid var(--line); border-radius: 7px; background: #f8fbff; }
.damage-ocr-details summary { padding: 9px 10px; cursor: pointer; color: #33415c; font-size: .79rem; font-weight: 800; }
.damage-ocr-details p { margin: 0; padding: 0 10px 8px; color: var(--muted); font-size: .75rem; overflow-wrap: anywhere; }
.damage-ocr-details pre {
  max-height: 230px;
  margin: 0 10px 10px;
  overflow: auto;
  padding: 9px;
  border-radius: 6px;
  background: #111b2c;
  color: #dce8f5;
  font-size: .68rem;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.damage-review-actions { display: grid; grid-template-columns: 1fr auto; gap: 9px; }

@media (max-width: 1050px) {
  .damage-file-actions-grid { grid-template-columns: 1fr; }
  .damage-quality-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .damage-review-layout { grid-template-columns: 1fr; overflow: auto; }
  .damage-review-info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .damage-review-preview-column,
  .damage-review-form-column { overflow: visible; }
  .damage-review-preview-column { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 700px) {
  .local-ocr-note { display: grid; }
  .damage-upload-actions-expanded,
  .damage-quality-summary,
  .damage-review-info-grid,
  .damage-review-actions { grid-template-columns: 1fr; }
  .damage-review-modal { padding: 0; place-items: stretch; }
  .damage-review-dialog { max-height: 100vh; border-radius: 0; }
  .damage-review-header { align-items: flex-start; }
  .damage-review-preview-column,
  .damage-review-form-column { padding: 10px; }
  .damage-crop-grid { grid-template-columns: 1fr; }
  .damage-table-help { text-align: left; }
}

/* Qualità OCR nello storico pacchetti */
.damage-packages-table { min-width: 1380px; }
.damage-quality-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.damage-mini-quality {
  display: inline-flex;
  min-width: 34px;
  min-height: 20px;
  align-items: center;
  justify-content: center;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .65rem;
  font-weight: 900;
}
.damage-mini-quality.automatic { color: #11663f; border-color: #a7d8bd; background: #eefaf3; }
.damage-mini-quality.manual { color: #0b4f86; border-color: #acd0ec; background: #eef7ff; }
.damage-mini-quality.review { color: #7a5000; border-color: #e9ca86; background: #fff8e5; }
.damage-mini-quality.invalid { color: #9f302d; border-color: #e5b4b1; background: #fff1f0; }
html.damage-review-open,
body.damage-review-open { overflow: hidden; }
.damage-validation-message.danger { color: #962e2a; border-color: #e5b4b1; background: #fff3f2; }

/* R24 2026-07-14: rifiniture finali Damage Form, conferma turno e modifica parco auto */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Il pannello di inserimento deve scorrere normalmente: non resta più bloccato in alto. */
.damage-upload-sticky,
.embedded-shell .damage-upload-sticky,
.mobile-embedded-shell .damage-upload-sticky {
  position: static !important;
  inset: auto !important;
  top: auto !important;
  z-index: auto !important;
}
.damage-upload-layout,
.damage-upload-layout > .panel,
.damage-upload-sticky .section-heading,
.damage-upload-sticky .section-heading > div {
  min-width: 0 !important;
}
.damage-upload-sticky .section-heading {
  align-items: flex-start !important;
}
.damage-upload-sticky #statusBox {
  max-width: min(54%, 720px);
  height: auto;
  min-width: 0;
  white-space: normal !important;
  text-align: right;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.damage-upload-sticky .damage-shift-grid {
  grid-template-columns: minmax(150px, .85fr) minmax(145px, .62fr) minmax(220px, 1.25fr) minmax(96px, .42fr) !important;
}

/* Selettore PDF con icona documento. */
.damage-file-picker {
  position: relative;
  cursor: pointer;
  display: grid !important;
  grid-template-columns: 58px minmax(0, 1fr) !important;
  grid-template-areas:
    "icon selection"
    "icon help" !important;
  align-items: center !important;
  justify-items: stretch !important;
  place-items: initial !important;
  column-gap: 13px !important;
  row-gap: 4px !important;
  min-height: 76px !important;
  padding: 10px 13px !important;
  text-align: left !important;
  border-color: #76bdec !important;
  background: linear-gradient(135deg, #f8fcff, #eaf7ff) !important;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.damage-file-picker:hover,
.damage-file-picker:focus-within {
  border-color: #0d82ce !important;
  box-shadow: 0 0 0 3px rgba(13, 130, 206, .12);
}
.damage-file-picker:active { transform: translateY(1px); }
.damage-file-icon {
  grid-area: icon;
  width: 52px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid #8dc9ee;
  border-radius: 11px;
  background: #fff;
  color: #0878bf;
  box-shadow: 0 5px 15px rgba(7, 95, 154, .10);
}
.damage-file-icon svg {
  width: 34px;
  height: 40px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.damage-file-selection {
  grid-area: selection;
  min-width: 0;
  color: #073f69 !important;
  font-size: .84rem !important;
  font-weight: 900;
  line-height: 1.25;
  white-space: normal !important;
  overflow-wrap: anywhere;
}
.damage-file-help {
  grid-area: help;
  min-width: 0;
  font-size: .72rem !important;
  line-height: 1.25;
  white-space: normal !important;
  overflow-wrap: anywhere;
}
.damage-upload-actions-expanded button:disabled,
.damage-upload-actions-expanded button[disabled] {
  cursor: not-allowed;
  opacity: .52;
  filter: saturate(.55);
  box-shadow: none;
}

/* Conferma dinamica di Data Turno e Turno. */
html.context-confirm-open,
html.context-confirm-open body { overflow: hidden !important; }
html.save-success-open,
html.save-success-open body { overflow: hidden !important; }
.context-confirm-modal[hidden] { display: none !important; }
.context-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(7, 23, 40, .72);
  backdrop-filter: blur(3px);
}
.context-confirm-dialog {
  width: min(610px, 100%);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px 16px;
  padding: 20px;
  border: 1px solid #a9cce4;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 26px 78px rgba(4, 23, 40, .36);
}
.context-confirm-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #0b82ce;
  font-size: 1.45rem;
  font-weight: 900;
}
.context-confirm-copy { min-width: 0; }
.context-confirm-copy h2 { margin-bottom: 8px; }
.context-confirm-copy p { margin-bottom: 7px; overflow-wrap: anywhere; }
.context-confirm-summary {
  white-space: pre-line;
  line-height: 1.65;
  font-weight: 800;
}
.context-confirm-hint { color: var(--muted); font-size: .84rem; }
.context-confirm-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.save-success-icon { background: #198754; }
.save-success-actions { grid-template-columns: minmax(0, 1fr); }
.save-success-dialog { border-color: #9fd3b8; }

/* Finestra OCR: dimensioni fluide e nessuna sovrapposizione. */
.damage-review-modal {
  overflow: hidden;
  padding: 12px !important;
}
.damage-review-dialog {
  width: min(1500px, calc(100vw - 24px)) !important;
  height: min(920px, calc(100dvh - 24px));
  max-height: calc(100dvh - 24px) !important;
}
.damage-review-header {
  min-width: 0;
  align-items: flex-start !important;
}
.damage-review-header > div { min-width: 0; }
.damage-review-header h2 {
  max-width: 100%;
  font-size: clamp(.95rem, 1.6vw, 1.18rem);
  line-height: 1.22;
  overflow-wrap: anywhere;
}
.damage-review-layout {
  min-width: 0;
  grid-template-columns: minmax(0, 1.24fr) minmax(350px, .76fr) !important;
}
.damage-review-preview-column,
.damage-review-form-column {
  min-width: 0 !important;
  overscroll-behavior: contain;
}
.damage-review-form-column {
  position: static !important;
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
  align-content: initial !important;
  gap: 12px !important;
}
.damage-review-validation {
  position: static !important;
  inset: auto !important;
  z-index: auto !important;
  flex: 0 0 auto;
  margin: 0 !important;
}
.damage-review-fields {
  flex: 0 0 auto;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
}
.damage-review-fields label,
.damage-review-fields input { min-width: 0 !important; }
.damage-review-fields input {
  min-height: 42px !important;
  padding: 8px 10px !important;
  font-size: .92rem !important;
}
.damage-review-info-grid { flex: 0 0 auto; }
.damage-ocr-details { flex: 0 0 auto; min-width: 0; }
.damage-review-actions { flex: 0 0 auto; }
.damage-review-preview {
  height: auto !important;
  max-width: 100%;
}

/* Tabella risultati trasformata in schede nello spazio ristretto del workspace. */
@media (max-width: 1280px) {
  .damage-upload-sticky .section-heading {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 7px !important;
  }
  .damage-upload-sticky #statusBox {
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
    text-align: left;
  }
  .damage-upload-sticky .damage-shift-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .damage-file-actions-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .damage-upload-layout > .panel:last-child .table-wrap {
    overflow: visible !important;
    border-top: 0 !important;
  }
  .damage-upload-table {
    width: 100% !important;
    min-width: 0 !important;
    display: block;
  }
  .damage-upload-table thead { display: none; }
  .damage-upload-table tbody {
    width: 100%;
    display: grid;
    gap: 16px;
  }
  .damage-upload-table tr {
    width: 100%;
    display: block;
    overflow: hidden;
    padding: 4px 10px;
    border: 1px solid #c8ddeb;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(6, 76, 122, .06);
  }
  .damage-upload-table td {
    width: 100%;
    min-width: 0 !important;
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    padding: 7px 0 !important;
    border-bottom: 1px solid #e3edf5 !important;
    overflow-wrap: anywhere;
  }
  .damage-upload-table td:last-child { border-bottom: 0 !important; }
  .damage-upload-table td::before {
    content: attr(data-label);
    color: #526d86;
    font-size: .69rem;
    font-weight: 900;
    line-height: 1.25;
    text-transform: uppercase;
  }
  .damage-upload-table td[colspan] {
    display: block;
    padding: 15px 4px !important;
    text-align: center;
  }
  .damage-upload-table td[colspan]::before { display: none; }
  .damage-file-name,
  .damage-status-detail {
    max-width: none !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
  .damage-row-actions {
    min-width: 0 !important;
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  .damage-review-dialog {
    width: calc(100vw - 12px) !important;
    height: calc(100dvh - 12px) !important;
    max-height: calc(100dvh - 12px) !important;
    border-radius: 8px !important;
  }
  .damage-review-layout {
    display: block !important;
    overflow-y: auto !important;
  }
  .damage-review-preview-column,
  .damage-review-form-column {
    overflow: visible !important;
  }
  .damage-review-preview-column {
    border-right: 0 !important;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 680px) {
  .damage-upload-sticky .damage-shift-grid,
  .damage-upload-actions-expanded,
  .context-confirm-actions,
  .damage-review-fields,
  .damage-review-info-grid,
  .damage-review-actions {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .damage-file-picker {
    grid-template-columns: 48px minmax(0, 1fr) !important;
    column-gap: 10px !important;
  }
  .damage-file-icon { width: 44px; height: 50px; }
  .damage-file-icon svg { width: 28px; height: 34px; }
  .context-confirm-modal { padding: 8px; }
  .context-confirm-dialog {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px;
  }
  .context-confirm-icon { width: 40px; height: 40px; }
  .damage-upload-table td {
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
  }
  .damage-row-actions .small-button { flex: 1 1 120px; }
}

/* Modifica anagrafica auto. */
.car-info-heading {
  align-items: center;
  gap: 12px;
}
.car-edit-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.car-edit-toolbar [hidden] { display: none !important; }
.car-edit-content { min-width: 0; }
.car-edit-notice {
  display: grid;
  gap: 2px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #b9d9f5;
  border-radius: 8px;
  background: #f3f9ff;
  color: #31536e;
}
.car-edit-notice strong { color: #0b4f86; }
.car-edit-notice span { font-size: .82rem; }
.car-edit-form { min-width: 0; }
.car-edit-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 11px;
}
.car-edit-field {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 5px;
}
.car-edit-field.is-full { grid-column: 1 / -1; }
.car-edit-field input,
.car-edit-field select,
.car-edit-field textarea { min-width: 0; }
.car-edit-field.is-disabled { opacity: .62; }
.car-edit-field.is-disabled input { cursor: not-allowed; background: #edf2f7; }
.pdf-thumb-rental-dates {
  display: block;
  color: #365d7e;
  font-weight: 800;
  line-height: 1.32;
  overflow-wrap: anywhere;
}
.car-damage-table td:nth-child(3),
.car-damage-table td:nth-child(4) { white-space: nowrap; }

@media (max-width: 760px) {
  .car-info-heading {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .car-edit-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
  }
  .car-edit-toolbar button { width: 100%; }
  .car-edit-grid { grid-template-columns: minmax(0, 1fr); }
  .car-edit-field.is-full { grid-column: auto; }
}

/* R26 · conferma Damage Forms, campi da ricontrollare e rotazione anteprime. */
.damage-upload-status-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}
.damage-upload-status-row #statusBox {
  width: 100%;
  max-width: none;
  justify-content: flex-start;
  text-align: left;
}

.context-confirm-dialog-detailed {
  width: min(780px, 100%);
  max-height: calc(100dvh - 36px);
  overflow: auto;
  border-color: #7cb9df;
}
.context-confirm-dialog-detailed .context-confirm-icon {
  background: #c96a00;
}
.context-confirm-dialog-detailed .context-confirm-copy h2 {
  margin-bottom: 12px;
  color: #10243d;
  font-size: clamp(1.05rem, 2.1vw, 1.35rem);
  line-height: 1.25;
  letter-spacing: .01em;
}
.context-confirm-details {
  display: grid;
  gap: 0;
  margin: 0 0 12px !important;
  overflow: hidden;
  border: 1px solid #a9cfe8;
  border-radius: 10px;
  background: #f7fbff;
  white-space: normal;
  font-weight: 400;
  line-height: 1.35;
}
.context-confirm-row {
  display: grid;
  grid-template-columns: minmax(120px, .42fr) minmax(0, 1fr);
  align-items: baseline;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #d8e9f4;
}
.context-confirm-row:last-child { border-bottom: 0; }
.context-confirm-row span {
  color: #38546e;
  font-weight: 400;
}
.context-confirm-row strong {
  min-width: 0;
  color: #092d4a;
  font-size: 1.02rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}
.context-confirm-checklist {
  margin: 0 0 10px;
  padding: 12px 14px;
  border: 1px solid #f0c886;
  border-radius: 10px;
  background: #fff9ed;
  color: #563c16;
  line-height: 1.42;
}
.context-confirm-checklist > strong {
  display: block;
  margin-bottom: 6px;
  color: #593a0d;
}
.context-confirm-checklist ul {
  margin: 0;
  padding-left: 20px;
}
.context-confirm-checklist li + li { margin-top: 4px; }
.context-confirm-files {
  margin: 0 0 7px !important;
  padding: 9px 11px;
  border: 1px solid #d6e4ef;
  border-radius: 8px;
  background: #f7f9fc;
  color: #3b536b;
  font-size: .84rem;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

label.context-field-attention > span {
  color: #9b3d00 !important;
  font-weight: 900 !important;
}
input.context-field-attention,
select.context-field-attention,
label.context-field-attention input,
label.context-field-attention select {
  border-color: #e36b19 !important;
  background: #fff8e8 !important;
  box-shadow: 0 0 0 4px rgba(227, 107, 25, .22) !important;
  animation: context-field-pulse 1.15s ease-in-out 2;
}
@keyframes context-field-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(227, 107, 25, .20); }
  50% { box-shadow: 0 0 0 7px rgba(227, 107, 25, .32); }
}
@media (prefers-reduced-motion: reduce) {
  input.context-field-attention,
  select.context-field-attention,
  label.context-field-attention input,
  label.context-field-attention select { animation: none; }
}

.photo-viewer-rotate {
  min-width: 78px;
  padding: 0 13px;
}
.photo-viewer-image.is-quarter-turned {
  max-width: calc(100dvh - 170px);
  max-height: calc(100vw - 40px);
}
.pdf-thumb-button img {
  transform-origin: center center;
  transition: transform 160ms ease;
}
.pdf-thumb-button.is-quarter-turned img { object-fit: contain; }
.pdf-thumb-rotate { min-width: 74px; }

@media (max-width: 680px) {
  .context-confirm-dialog-detailed {
    max-height: calc(100dvh - 16px);
  }
  .context-confirm-row {
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 8px;
    padding: 9px 10px;
  }
  .context-confirm-checklist {
    padding: 10px 11px;
    font-size: .86rem;
  }
  .photo-viewer-rotate {
    min-width: 66px;
    padding: 0 10px;
  }
  .photo-viewer-image.is-quarter-turned {
    max-width: calc(100dvh - 180px);
    max-height: calc(100vw - 24px);
  }
}

/* R27 2026-07-18: ricerca targa mobile senza datalist nativo */
.plate-search-row { align-items: start; }
.plate-input-field { min-width: 0; }
.plate-input {
  text-transform: uppercase;
  letter-spacing: .035em;
  font-weight: 800;
}
.plate-suggestions-field {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 700;
}
.plate-suggestions-field .field-label {
  display: block;
  line-height: 1.45;
}
.plate-suggestion-status {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.25;
}
.plate-suggestion-status.is-loading::after {
  content: '';
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  margin-left: auto;
  border: 2px solid rgba(8, 118, 201, .22);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: plate-search-spin .7s linear infinite;
}
.plate-suggestion-status.is-error {
  border-color: rgba(181, 65, 61, .28);
  background: #fff7f6;
  color: var(--danger);
}
.plate-suggestion-status.is-selected {
  border-color: rgba(11, 139, 211, .34);
  background: #eaf7ff;
  color: #075985;
}
.plate-suggestion-list {
  display: grid;
  gap: 6px;
  max-height: 268px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 4px;
  border: 1px solid #bfd8ea;
  border-radius: 9px;
  background: #f7fbff;
  contain: layout paint;
}
.plate-suggestion-list[hidden] { display: none !important; }
.plate-suggestion-item {
  width: 100%;
  min-height: 48px;
  display: grid;
  gap: 2px;
  align-content: center;
  padding: 8px 10px;
  border: 1px solid #c8dced;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.plate-suggestion-item:hover,
.plate-suggestion-item:focus-visible,
.plate-suggestion-item.is-active {
  border-color: var(--primary);
  background: #eaf7ff;
  outline: none;
  box-shadow: 0 0 0 2px rgba(13, 110, 253, .12);
}
.plate-suggestion-item strong {
  color: #10243a;
  font-size: 1rem;
  line-height: 1.15;
  letter-spacing: .025em;
}
.plate-suggestion-item span {
  overflow: hidden;
  color: var(--muted);
  font-size: .80rem;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plate-suggestion-item mark {
  padding: 0 1px;
  border-radius: 2px;
  background: #ffe86a;
  color: inherit;
}
@keyframes plate-search-spin { to { transform: rotate(360deg); } }

@media (max-width: 700px) {
  .plate-input,
  .embedded-shell .plate-input {
    min-height: 48px;
    font-size: 16px !important;
  }
  .plate-suggestions-field,
  .embedded-shell .plate-suggestions-field {
    font-size: .88rem;
  }
  .plate-suggestion-status,
  .embedded-shell .plate-suggestion-status {
    min-height: 44px;
    padding: 9px 10px;
  }
  .plate-suggestion-list,
  .embedded-shell .plate-suggestion-list {
    max-height: 210px;
  }
  .plate-suggestion-item,
  .embedded-shell .plate-suggestion-item {
    min-height: 52px;
    padding: 9px 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .plate-suggestion-status.is-loading::after { animation: none; }
}

/* R31 2026-07-23: descrizione report estesa e filtro temporale nella scheda auto */
.car-report-filters {
  grid-template-columns: minmax(180px, .72fr) minmax(150px, .52fr) minmax(150px, .52fr) auto;
  align-items: end;
  margin-bottom: 14px;
}
.reports-table-with-description {
  min-width: 1180px;
}
.reports-table-with-description:not(.car-reports-table) {
  min-width: 1320px;
}
.report-description-heading {
  min-width: 300px;
}
.report-description-cell {
  width: 34%;
  min-width: 300px;
  max-width: 520px;
  vertical-align: top !important;
}
.report-description-block {
  min-width: 0;
}
.report-description-text {
  color: var(--ink);
  font-size: .9rem;
  font-weight: 500;
  line-height: 1.42;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  word-break: break-word;
}
.report-description-block.is-collapsed .report-description-text {
  display: -webkit-box;
  max-height: 4.26em;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.report-description-toggle {
  min-height: 34px;
  margin-top: 4px;
  padding: 4px 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--primary-dark);
  font-size: .82rem;
  font-weight: 800;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.report-description-toggle:hover,
.report-description-toggle:focus-visible {
  color: var(--primary);
  outline: 2px solid rgba(13, 110, 253, .22);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .car-report-filters,
  .embedded-shell .car-report-filters,
  .mobile-embedded-shell .car-report-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .car-report-filters .filter-actions,
  .embedded-shell .car-report-filters .filter-actions,
  .mobile-embedded-shell .car-report-filters .filter-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .car-report-filters,
  .embedded-shell .car-report-filters,
  .mobile-embedded-shell .car-report-filters {
    grid-template-columns: 1fr;
  }
  .car-report-filters .filter-actions,
  .embedded-shell .car-report-filters .filter-actions,
  .mobile-embedded-shell .car-report-filters .filter-actions {
    grid-column: auto;
  }
  .reports-table-with-description,
  .reports-table-with-description:not(.car-reports-table),
  .embedded-shell .reports-table-with-description,
  .mobile-embedded-shell .reports-table-with-description {
    min-width: 1080px;
  }
  .report-description-heading,
  .report-description-cell {
    min-width: 240px;
    max-width: 320px;
  }
  .report-description-toggle {
    min-height: 40px;
    padding: 7px 0;
  }
}

/* R32 2026-07-23: interfaccia più pulita e tabelle Foto Auto senza scorrimento orizzontale */
.photo-auto-label {
  text-transform: none;
}

.report-responsive-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
.report-responsive-wrap .reports-table-with-description {
  width: 100%;
  max-width: 100%;
  min-width: 0 !important;
  table-layout: fixed;
  font-size: .82rem;
}
.report-responsive-wrap .reports-table-with-description th,
.report-responsive-wrap .reports-table-with-description td {
  min-width: 0 !important;
  max-width: none !important;
  padding: 8px 6px;
  line-height: 1.28;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: normal;
}
.report-responsive-wrap .reports-table-with-description th {
  font-size: .70rem;
  letter-spacing: .01em;
}
.report-responsive-wrap .reports-table-with-description .sort-button {
  min-height: 34px;
  gap: 3px;
  padding: 7px 4px;
  line-height: 1.15;
  white-space: normal;
}
.report-responsive-wrap .reports-table-with-description .sort-arrow {
  flex: 0 0 auto;
  min-width: .85em;
}
.report-responsive-wrap .report-description-heading,
.report-responsive-wrap .report-description-cell {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
}
.report-responsive-wrap .report-description-text {
  font-size: .82rem;
  line-height: 1.34;
}
.report-responsive-wrap .report-description-block.is-collapsed .report-description-text {
  max-height: 4.02em;
}
.report-responsive-wrap .code-cell {
  font-size: .80rem;
  line-height: 1.2;
}
.report-responsive-wrap .table-actions {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
  gap: 5px;
}
.report-responsive-wrap .table-actions .small-button {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 7px;
  font-size: .75rem;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
}

/* Elenco Foto Auto: tutte le nove colonne rimangono dentro la larghezza disponibile. */
.photo-reports-list-wrap th:nth-child(1),
.photo-reports-list-wrap td:nth-child(1) { width: 10%; }
.photo-reports-list-wrap th:nth-child(2),
.photo-reports-list-wrap td:nth-child(2) { width: 10%; }
.photo-reports-list-wrap th:nth-child(3),
.photo-reports-list-wrap td:nth-child(3) { width: 10%; }
.photo-reports-list-wrap th:nth-child(4),
.photo-reports-list-wrap td:nth-child(4) { width: 8%; }
.photo-reports-list-wrap th:nth-child(5),
.photo-reports-list-wrap td:nth-child(5) { width: 10%; }
.photo-reports-list-wrap th:nth-child(6),
.photo-reports-list-wrap td:nth-child(6) { width: 10%; }
.photo-reports-list-wrap th:nth-child(7),
.photo-reports-list-wrap td:nth-child(7) { width: 23%; }
.photo-reports-list-wrap th:nth-child(8),
.photo-reports-list-wrap td:nth-child(8) { width: 6%; text-align: center; }
.photo-reports-list-wrap th:nth-child(9),
.photo-reports-list-wrap td:nth-child(9) { width: 13%; }

.photo-auto-list-page .summary-grid{width:100%;max-width:none;margin-inline:0}
.photo-auto-list-page .app-shell.wide-shell{width:100%;max-width:none;margin-inline:0}
.photo-list-refresh-button{min-height:34px;padding:6px 12px;white-space:nowrap}
.photo-list-refresh-button:disabled{cursor:wait;opacity:.72}
.photo-auto-filters-form{grid-template-columns:minmax(180px,1.25fr) minmax(105px,.58fr) minmax(120px,.68fr) minmax(165px,.82fr) minmax(125px,.58fr) minmax(125px,.58fr) auto;align-items:end;gap:9px}
.photo-auto-filters-form .filter-actions{flex-wrap:nowrap;white-space:nowrap}
@media(max-width:1250px){.photo-auto-filters-form{grid-template-columns:repeat(3,minmax(0,1fr))}.photo-auto-filters-form .filter-actions{grid-column:1/-1}}
@media(max-width:700px){.photo-auto-filters-form{grid-template-columns:1fr}.photo-auto-filters-form .filter-actions{grid-column:auto}}

/* Scheda auto: più spazio alla descrizione e alle azioni, senza allargare la tabella. */
.car-reports-wrap th:nth-child(1),
.car-reports-wrap td:nth-child(1) { width: 16%; }
.car-reports-wrap th:nth-child(2),
.car-reports-wrap td:nth-child(2) { width: 11%; }
.car-reports-wrap th:nth-child(3),
.car-reports-wrap td:nth-child(3) { width: 11%; }
.car-reports-wrap th:nth-child(4),
.car-reports-wrap td:nth-child(4) { width: 12%; }
.car-reports-wrap th:nth-child(5),
.car-reports-wrap td:nth-child(5) { width: 29%; }
.car-reports-wrap th:nth-child(6),
.car-reports-wrap td:nth-child(6) { width: 6%; text-align: center; }
.car-reports-wrap th:nth-child(7),
.car-reports-wrap td:nth-child(7) { width: 15%; }

@media (max-width: 1180px) {
  .report-responsive-wrap .reports-table-with-description {
    font-size: .76rem;
  }
  .report-responsive-wrap .reports-table-with-description th,
  .report-responsive-wrap .reports-table-with-description td {
    padding: 7px 4px;
  }
  .report-responsive-wrap .reports-table-with-description th {
    font-size: .65rem;
  }
  .report-responsive-wrap .report-description-text,
  .report-responsive-wrap .code-cell {
    font-size: .75rem;
  }
  .report-responsive-wrap .table-actions .small-button {
    min-height: 30px;
    padding: 4px 5px;
    font-size: .70rem;
  }
}

/* Tablet e smartphone: ogni riga diventa una scheda, quindi non serve alcuna barra orizzontale. */
@media (max-width: 900px) {
  .report-responsive-wrap,
  .embedded-shell .report-responsive-wrap,
  .mobile-embedded-shell .report-responsive-wrap {
    overflow: visible !important;
  }
  .report-responsive-wrap .reports-table-with-description,
  .embedded-shell .report-responsive-wrap .reports-table-with-description,
  .mobile-embedded-shell .report-responsive-wrap .reports-table-with-description {
    display: block;
    width: 100%;
    min-width: 0 !important;
    max-width: 100%;
    border: 0;
    table-layout: auto;
    font-size: .90rem;
  }
  .report-responsive-wrap .reports-table-with-description thead {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }
  .report-responsive-wrap .reports-table-with-description tbody {
    width: 100%;
    display: grid;
    gap: 12px;
  }
  .report-responsive-wrap .reports-table-with-description tbody > tr {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid #bfd8ea;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 5px 14px rgba(10, 69, 107, .08);
  }
  .report-responsive-wrap .reports-table-with-description tbody > tr > td {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    display: grid;
    grid-template-columns: minmax(78px, .42fr) minmax(0, .58fr);
    align-content: start;
    align-items: start;
    gap: 7px;
    padding: 9px 10px;
    border-bottom: 1px solid #e1ebf3;
    background: transparent;
    font-size: .88rem;
    line-height: 1.35;
    text-align: left !important;
    overflow-wrap: anywhere;
    white-space: normal;
  }
  .report-responsive-wrap .reports-table-with-description tbody > tr > td::before {
    content: attr(data-label);
    color: #4c6780;
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .035em;
    line-height: 1.35;
    text-transform: uppercase;
  }
  .report-responsive-wrap .reports-table-with-description tbody > tr > td[data-label="Codice"] {
    grid-column: 1 / -1;
    grid-template-columns: minmax(78px, auto) minmax(0, 1fr);
    border-bottom-color: #bfd8ea;
    background: #edf7ff;
    color: #07578f;
    font-size: .94rem;
  }
  .report-responsive-wrap .reports-table-with-description tbody > tr > td[data-label="Descrizione"],
  .report-responsive-wrap .reports-table-with-description tbody > tr > td[data-label="Azioni"] {
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
  }
  .report-responsive-wrap .reports-table-with-description tbody > tr > td[data-label="Descrizione"]::before,
  .report-responsive-wrap .reports-table-with-description tbody > tr > td[data-label="Azioni"]::before {
    margin-bottom: 1px;
  }
  .report-responsive-wrap .reports-table-with-description tbody > tr > td:last-child {
    border-bottom: 0;
  }
  .report-responsive-wrap .reports-table-with-description tbody > tr > td[colspan] {
    grid-column: 1 / -1;
    display: block;
    padding: 16px;
    color: var(--muted);
    text-align: center !important;
  }
  .report-responsive-wrap .reports-table-with-description tbody > tr > td[colspan]::before {
    content: none;
  }
  .report-responsive-wrap .report-description-text,
  .report-responsive-wrap .code-cell {
    font-size: .88rem;
  }
  .report-responsive-wrap .report-description-block.is-collapsed .report-description-text {
    max-height: 5.4em;
    -webkit-line-clamp: 4;
  }
  .report-responsive-wrap .report-description-toggle {
    min-height: 40px;
    padding: 7px 0;
  }
  .report-responsive-wrap .table-actions {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
  }
  .report-responsive-wrap .table-actions .small-button {
    min-height: 42px;
    padding: 8px 10px;
    font-size: .88rem;
  }
}

@media (max-width: 560px) {
  .report-responsive-wrap .reports-table-with-description tbody > tr {
    grid-template-columns: 1fr;
  }
  .report-responsive-wrap .reports-table-with-description tbody > tr > td,
  .report-responsive-wrap .reports-table-with-description tbody > tr > td[data-label="Codice"] {
    grid-column: 1;
  }
  .report-responsive-wrap .reports-table-with-description tbody > tr > td[data-label="Descrizione"],
  .report-responsive-wrap .reports-table-with-description tbody > tr > td[data-label="Azioni"] {
    grid-column: 1;
  }
}

@media (max-width: 390px) {
  .report-responsive-wrap .reports-table-with-description tbody > tr > td {
    grid-template-columns: 72px minmax(0, 1fr);
    padding: 9px 8px;
  }
  .report-responsive-wrap .reports-table-with-description tbody > tr > td[data-label="Descrizione"],
  .report-responsive-wrap .reports-table-with-description tbody > tr > td[data-label="Azioni"] {
    grid-template-columns: 1fr;
  }
  .report-responsive-wrap .table-actions {
    grid-template-columns: 1fr;
  }
}

/* R33: la sede assegnata resta leggibile anche quando il filtro è bloccato per dipendenti e station manager. */
#stationId:disabled {
  opacity: 1;
  background: #f3f8fd;
  color: var(--ink);
  -webkit-text-fill-color: var(--ink);
  font-weight: 800;
  cursor: not-allowed;
}

/* ========================================================================== */
/* Gestione turni e calendario personale - R34                              */
/* ========================================================================== */
.shift-shell {
  width: min(1540px, 100%);
}

.shift-page-layout {
  display: grid;
  gap: 18px;
}

.shift-control-panel {
  position: relative;
  overflow: visible;
  background:
    radial-gradient(circle at 100% 0%, rgba(13,110,253,.10), transparent 34%),
    #fff;
}

.shift-control-heading {
  align-items: flex-start;
}

.shift-scope-text {
  max-width: 880px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: .92rem;
}

.shift-toolbar {
  display: grid;
  grid-template-columns: auto minmax(390px, 1fr) auto;
  align-items: end;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.shift-month-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.shift-icon-button {
  width: 44px;
  padding-inline: 0;
  font-size: 1.55rem;
  line-height: 1;
}

.shift-month-title {
  min-width: 172px;
  margin-left: 4px;
  color: var(--primary-dark);
  font-size: 1.12rem;
  text-transform: capitalize;
  white-space: nowrap;
}

.shift-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(170px, 1fr));
  gap: 10px;
}

.shift-filter-grid label[hidden] {
  display: none !important;
}

.shift-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}

.shift-toolbar-actions button {
  white-space: nowrap;
}

.shift-summary-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.shift-summary-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 4px;
  min-height: 124px;
  padding: 16px 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15,23,42,.07);
}

.shift-summary-card::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -28px;
  width: 88px;
  height: 88px;
  border-radius: 999px;
  background: rgba(13,110,253,.08);
}

.shift-summary-card span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .035em;
}

.shift-summary-card strong {
  position: relative;
  z-index: 1;
  color: var(--primary-dark);
  font-size: 2rem;
  line-height: 1.1;
}

.shift-summary-card small {
  position: relative;
  z-index: 1;
  color: var(--muted);
}

.shift-calendar-panel {
  overflow: hidden;
  padding: 0;
}

.shift-calendar-heading {
  margin: 0;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.shift-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 13px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
}

.shift-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.shift-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(13,110,253,.12);
}

.shift-dot-night {
  background: #173a72;
  box-shadow: 0 0 0 3px rgba(23,58,114,.13);
}

.shift-dot-absence {
  background: #718096;
  box-shadow: 0 0 0 3px rgba(113,128,150,.14);
}

.shift-calendar-scroll {
  width: 100%;
  overflow: auto;
  overscroll-behavior-inline: contain;
  background: #fff;
}

.shift-calendar {
  min-width: 1040px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-left: 1px solid var(--line);
}

.shift-calendar-weekday {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f5f9ff;
  color: var(--primary-dark);
  font-size: .77rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .045em;
}

.shift-calendar-day {
  min-height: 154px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 7px;
  padding: 9px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
  outline: none;
  transition: background 140ms ease, box-shadow 140ms ease;
}

.shift-calendar-day.is-outside {
  background: #f8fafc;
  color: #94a3b8;
}

.shift-calendar-day.is-editable:hover,
.shift-calendar-day.is-editable:focus-visible,
.shift-calendar-day.has-shifts:hover,
.shift-calendar-day.has-shifts:focus-visible {
  position: relative;
  z-index: 1;
  background: #f7fbff;
  box-shadow: inset 0 0 0 2px rgba(13,110,253,.38);
  cursor: pointer;
}

.shift-calendar-day.is-today {
  background: #f2f8ff;
  box-shadow: inset 0 0 0 2px var(--primary);
}

.shift-calendar-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.shift-calendar-day-number {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--ink);
  font-weight: 900;
  font-size: .88rem;
}

.shift-calendar-day.is-today .shift-calendar-day-number {
  background: var(--primary);
  color: #fff;
}

.shift-calendar-day.is-outside .shift-calendar-day-number {
  color: #94a3b8;
}

.shift-calendar-day-count {
  min-width: 24px;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--primary-dark);
  font-size: .70rem;
  font-weight: 900;
}

.shift-calendar-items {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 5px;
}

.shift-calendar-chip {
  width: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1px 6px;
  padding: 6px 7px 6px 9px;
  border: 1px solid rgba(13,110,253,.22);
  border-left: 4px solid var(--primary);
  border-radius: 7px;
  background: #f2f7ff;
  color: var(--ink);
  text-align: left;
  overflow: hidden;
}

.shift-calendar-chip:hover,
.shift-calendar-chip:focus-visible {
  border-color: var(--primary);
  background: #eaf3ff;
  outline: none;
}

.shift-calendar-chip strong,
.shift-calendar-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shift-calendar-chip strong {
  font-size: .73rem;
}

.shift-calendar-chip span {
  grid-column: 1 / -1;
  color: #365577;
  font-size: .66rem;
  font-weight: 700;
}

.shift-calendar-chip small {
  align-self: center;
  color: var(--primary-dark);
  font-size: .60rem;
  font-weight: 900;
}

.shift-calendar-chip.type-notte,
.shift-agenda-item.type-notte,
.shift-day-item.type-notte {
  border-left-color: #173a72;
  background: #edf2fa;
}

.shift-calendar-chip.type-sera,
.shift-agenda-item.type-sera,
.shift-day-item.type-sera {
  border-left-color: #315b96;
  background: #f1f5fb;
}

.shift-calendar-chip.type-riposo,
.shift-calendar-chip.type-ferie,
.shift-calendar-chip.type-permesso,
.shift-calendar-chip.type-malattia,
.shift-agenda-item.type-riposo,
.shift-agenda-item.type-ferie,
.shift-agenda-item.type-permesso,
.shift-agenda-item.type-malattia,
.shift-day-item.type-riposo,
.shift-day-item.type-ferie,
.shift-day-item.type-permesso,
.shift-day-item.type-malattia {
  border-left-color: #718096;
  border-color: rgba(100,116,139,.24);
  background: #f5f7fa;
}

.shift-calendar-more {
  min-height: 28px;
  padding: 4px 7px;
  border: 1px dashed rgba(13,110,253,.36);
  border-radius: 7px;
  background: #fff;
  color: var(--primary-dark);
  font-size: .70rem;
  font-weight: 900;
}

.shift-calendar-empty-mark {
  align-self: center;
  justify-self: center;
  padding-top: 18px;
  color: #a0aec0;
  font-size: .70rem;
  font-weight: 700;
}

.shift-calendar-day.is-editable .shift-calendar-empty-mark {
  color: var(--primary);
}

.shift-mobile-agenda {
  display: none;
}

.shift-summary-panel {
  overflow: hidden;
}

.shift-summary-table {
  min-width: 920px;
}

.shift-summary-table td:nth-child(n+3),
.shift-summary-table th:nth-child(n+3) {
  text-align: center;
}

.shift-summary-empty {
  padding: 24px !important;
  color: var(--muted);
  text-align: center !important;
}

.shift-calendar-error {
  grid-column: 1 / -1;
  min-height: 180px;
  display: grid;
  place-items: center;
  padding: 20px;
  color: var(--danger);
  text-align: center;
}

.shift-modal-open {
  overflow: hidden !important;
}

.shift-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2300;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8,20,42,.68);
  backdrop-filter: blur(3px);
}

.shift-modal-backdrop[hidden] {
  display: none !important;
}

.shift-modal-card {
  width: min(760px, 100%);
  max-height: min(92vh, 860px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 30px 88px rgba(0,0,0,.34);
}

.shift-day-modal-card {
  width: min(700px, 100%);
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.shift-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 19px 21px 15px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #f7fbff 0%, #edf5ff 100%);
}

.shift-modal-head h2 {
  font-size: 1.35rem;
  color: var(--primary-dark);
}

.shift-modal-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: .88rem;
}

.shift-modal-close {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
}

.shift-modal-close:hover,
.shift-modal-close:focus-visible {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.shift-form {
  overflow: auto;
  padding: 18px 21px 21px;
}

.shift-form input[readonly] {
  background: #f5f8fc;
  color: var(--muted);
}

.shift-form [disabled] {
  cursor: not-allowed;
  opacity: .82;
}

.shift-audit {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--muted);
  font-size: .78rem;
}

.shift-form-actions,
.shift-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}

.shift-form-actions {
  position: sticky;
  bottom: -21px;
  z-index: 2;
  margin: 4px -21px -21px;
  padding: 14px 21px calc(17px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.96);
  box-shadow: 0 -10px 22px rgba(15,23,42,.06);
}

.shift-form-spacer {
  flex: 1 1 auto;
}

.shift-modal-actions {
  padding: 14px 19px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: #fff;
}

.shift-day-list {
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 16px 19px;
}

.shift-day-item {
  width: 100%;
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 13px;
  border: 1px solid rgba(13,110,253,.22);
  border-left: 5px solid var(--primary);
  border-radius: 10px;
  background: #f7fbff;
  color: var(--ink);
  text-align: left;
}

.shift-day-item:hover,
.shift-day-item:focus-visible {
  border-color: var(--primary);
  outline: none;
}

.shift-day-item > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.shift-day-item strong,
.shift-day-item span {
  overflow-wrap: anywhere;
}

.shift-day-item span,
.shift-day-item small {
  color: var(--muted);
}

.shift-day-item small {
  flex: 0 0 auto;
  color: var(--primary-dark);
  font-weight: 900;
}

@media (max-width: 1180px) {
  .shift-toolbar {
    grid-template-columns: 1fr 1fr;
  }
  .shift-toolbar-actions {
    grid-column: 1 / -1;
  }
  .shift-summary-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .shift-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .shift-month-nav {
    flex-wrap: wrap;
  }
  .shift-month-title {
    order: -1;
    width: 100%;
    min-width: 0;
    margin: 0 0 4px;
    font-size: 1.22rem;
  }
  .shift-filter-grid {
    grid-template-columns: 1fr;
  }
  .shift-toolbar-actions {
    grid-column: auto;
    justify-content: stretch;
  }
  .shift-toolbar-actions button {
    flex: 1 1 220px;
  }
  .shift-calendar-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .shift-legend {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .shift-page-layout {
    gap: 12px;
  }
  .shift-summary-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .shift-summary-card {
    min-height: 112px;
    padding: 13px;
  }
  .shift-summary-card strong {
    font-size: 1.65rem;
  }
  .shift-summary-card span {
    font-size: .69rem;
  }
  .shift-summary-card small {
    font-size: .72rem;
  }
  .shift-calendar-scroll {
    display: none;
  }
  .shift-mobile-agenda {
    display: grid;
    gap: 10px;
    padding: 12px;
    background: #f5f8fc;
  }
  .shift-agenda-day {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
  }
  .shift-agenda-day-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
    background: #f8fbff;
  }
  .shift-agenda-day-head > div {
    display: grid;
    gap: 2px;
  }
  .shift-agenda-day-head strong {
    color: var(--primary-dark);
    text-transform: capitalize;
  }
  .shift-agenda-day-head span {
    color: var(--muted);
    font-size: .76rem;
  }
  .shift-agenda-add {
    width: 36px;
    min-height: 34px;
    padding: 0;
    font-size: 1.25rem;
  }
  .shift-agenda-list {
    display: grid;
    gap: 7px;
    padding: 9px;
  }
  .shift-agenda-item {
    width: 100%;
    display: grid;
    gap: 3px;
    padding: 10px 11px;
    border: 1px solid rgba(13,110,253,.22);
    border-left: 5px solid var(--primary);
    border-radius: 9px;
    background: #f7fbff;
    color: var(--ink);
    text-align: left;
  }
  .shift-agenda-item strong {
    font-size: .90rem;
  }
  .shift-agenda-item span,
  .shift-agenda-item small {
    color: var(--muted);
    font-size: .78rem;
    overflow-wrap: anywhere;
  }
  .shift-agenda-empty {
    min-height: 120px;
  }
  .shift-modal-backdrop {
    align-items: end;
    padding: 0;
  }
  .shift-modal-card,
  .shift-day-modal-card {
    width: 100%;
    max-height: 94dvh;
    border-radius: 18px 18px 0 0;
    border-bottom: 0;
  }
  .shift-modal-head {
    padding: 16px 15px 13px;
  }
  .shift-form {
    padding: 14px 15px 18px;
  }
  .shift-form-actions {
    bottom: -18px;
    margin: 4px -15px -18px;
    padding: 12px 15px calc(14px + env(safe-area-inset-bottom));
  }
  .shift-form-spacer {
    display: none;
  }
  .shift-form-actions > button {
    flex: 1 1 calc(50% - 8px);
  }
  .shift-form-actions .danger-button {
    flex-basis: 100%;
    order: 3;
  }
  .shift-day-list {
    padding: 12px;
  }
  .shift-day-item {
    align-items: flex-start;
  }
  .shift-day-item small {
    white-space: nowrap;
  }
  .shift-modal-actions > button {
    flex: 1 1 calc(50% - 8px);
  }
}

@media (max-width: 420px) {
  .shift-summary-cards {
    grid-template-columns: 1fr 1fr;
  }
  .shift-summary-card {
    min-height: 104px;
  }
  .shift-month-nav .secondary-button:not(.shift-icon-button) {
    flex: 1 1 auto;
  }
  .shift-month-nav .shift-icon-button {
    flex: 0 0 44px;
  }
}

html.embedded-shell .shift-shell,
body.embedded-shell .shift-shell {
  width: 100%;
  max-width: none;
}

html.embedded-shell .shift-page-layout,
body.embedded-shell .shift-page-layout {
  padding: 0;
}

html.mobile-embedded-shell .shift-summary-panel,
body.mobile-embedded-shell .shift-summary-panel {
  margin-bottom: calc(10px + env(safe-area-inset-bottom));
}


/* R34: notifiche turni integrate */
.notification-menu-links {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--line);
  background: #fff;
}
.notification-menu-links .notification-menu-link {
  border-top: 0;
}
button.notification-menu-link {
  width: 100%;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  font: inherit;
  font-weight: 900;
  color: var(--primary-dark);
  text-align: left;
  cursor: pointer;
}
.notification-menu-link[hidden] {
  display: none !important;
}
.notification-menu-links .notification-menu-link + .notification-menu-link {
  border-top: 1px solid var(--line);
}
button.notification-item,
button.notification-popup-item {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
}
button.notification-item:hover,
button.notification-item:focus-visible {
  border-color: rgba(13,110,253,.48);
  background: #f6faff;
  outline: none;
}
.notification-source {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef3f8;
  color: #4b6075;
  font-size: .66rem;
  font-weight: 900;
  letter-spacing: .035em;
  text-transform: uppercase;
}
.notification-item.source-shift {
  border-color: rgba(13,110,253,.25);
  background: #f7fbff;
}
.notification-item.source-shift .notification-source,
.notification-item.source-shift .notification-source {
  background: #e8f2ff;
  color: var(--primary-dark);
}
.notification-item.source-damage .notification-source,
.notification-item.source-damage .notification-source {
  background: #fff0ef;
  color: var(--danger);
}

/* R36 2026-08-11: workspace e iframe realmente responsive, senza zoom manuale */
.workspace-shell,
.workspace-header,
.workspace-body,
.workspace-main,
.workspace-panel,
.workspace-welcome,
.workspace-frames,
.workspace-frame {
  min-width: 0;
  max-width: 100%;
}
.workspace-shell {
  width: 100%;
  overflow: hidden;
}
.workspace-body {
  grid-template-columns: clamp(190px, 13.5vw, 225px) minmax(0, 1fr);
}
.workspace-sidebar {
  min-width: 0;
  overflow: hidden auto;
}
.workspace-main {
  overflow: hidden;
}
.workspace-panel,
.workspace-frames {
  width: 100%;
  overflow: hidden;
}
.workspace-frame {
  width: 100%;
  max-width: none;
  border: 0;
}
.workspace-frame.is-active {
  display: block;
}
.workspace-tabs {
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
}
.workspace-tab-label {
  min-width: 0;
}

@media (max-width: 1180px) and (min-width: 821px) {
  .workspace-body {
    grid-template-columns: minmax(190px, 205px) minmax(0, 1fr);
  }
  .workspace-sidebar-head {
    padding-inline: 10px;
  }
  .workspace-submenu {
    padding: 7px;
  }
  .workspace-subitem {
    padding-inline: 9px;
    font-size: 13px;
  }
}

/* R37 2026-08-11: menu funzioni compatto nel workspace su tablet e smartphone */
.workspace-sidebar-copy {
  min-width: 0;
}
.workspace-section-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid #5da8d5;
  border-radius: 9px;
  background: #f4fbff;
  color: #0c4d78;
  font: inherit;
  font-size: .82rem;
  font-weight: 850;
  cursor: pointer;
}
.workspace-section-toggle-icon {
  display: inline-block;
  transition: transform .18s ease;
}
.workspace-section-menu-open .workspace-section-toggle-icon {
  transform: rotate(180deg);
}

@media (max-width: 1000px) {
  .workspace-body {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
  }
  .workspace-sidebar {
    display: block !important;
    min-height: 0 !important;
    overflow: visible !important;
    border-right: 0 !important;
    border-bottom: 1px solid #9fd0ee;
  }
  .workspace-sidebar-head {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    padding: 7px 9px !important;
  }
  .workspace-sidebar-head h1 {
    margin: 0 !important;
    font-size: 1rem !important;
  }
  .workspace-sidebar-head p {
    display: none !important;
  }
  .workspace-section-toggle {
    display: inline-flex;
  }
  .workspace-submenu {
    display: none !important;
    gap: 7px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 6px 8px 8px !important;
    border-top: 1px solid #d0e5f2;
    background: rgba(248, 253, 255, .98);
    -webkit-overflow-scrolling: touch;
  }
  .workspace-section-menu-open .workspace-submenu {
    display: flex !important;
  }
  .workspace-subitem {
    flex: 0 0 auto !important;
    width: auto !important;
    min-height: 36px !important;
    margin: 0 !important;
    padding: 7px 11px !important;
    border-left-width: 1px !important;
    border-radius: 999px !important;
    white-space: nowrap !important;
  }
  .workspace-main {
    min-height: 0 !important;
    overflow: hidden !important;
  }
}

@media (max-width: 620px) {
  .workspace-sidebar-head {
    padding: 5px 7px !important;
  }
  .workspace-section-toggle {
    min-height: 34px;
    padding: 6px 9px;
    font-size: .76rem;
  }
  .workspace-submenu {
    padding: 5px 6px 7px !important;
  }
  .workspace-subitem {
    min-height: 33px !important;
    padding: 6px 9px !important;
    font-size: 12.5px !important;
  }
}

/* R39 2026-08-11: tabelle adattive su tutte le pagine, senza scorrimento orizzontale globale */
.table-wrap,
.excel-table-wrap,
.report-viewer-table-wrap,
.attendance-table-wrap,
.fleet-table-wrap,
.report-responsive-wrap {
  max-width: 100%;
  overflow-x: clip !important;
}
table.ech-adaptive-table,
.reports-table.ech-adaptive-table,
.excel-table.ech-adaptive-table,
.report-viewer-table-wrap .excel-table.ech-adaptive-table {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse;
}
table.ech-adaptive-table th,
table.ech-adaptive-table td,
.report-viewer-table-wrap .excel-table.ech-adaptive-table th,
.report-viewer-table-wrap .excel-table.ech-adaptive-table td {
  min-width: 0 !important;
  max-width: none !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
  padding: 7px 6px;
  line-height: 1.25;
}
table.ech-adaptive-table.ech-cols-many th,
table.ech-adaptive-table.ech-cols-many td {
  padding: 5px 4px;
  font-size: clamp(.66rem, .72vw, .79rem);
}
table.ech-adaptive-table.ech-cols-very-many th,
table.ech-adaptive-table.ech-cols-very-many td {
  padding: 4px 3px;
  font-size: clamp(.58rem, .62vw, .7rem);
}
table.ech-adaptive-table button,
table.ech-adaptive-table .primary-button,
table.ech-adaptive-table .secondary-button,
table.ech-adaptive-table .danger-button,
table.ech-adaptive-table a.button,
table.ech-adaptive-table .report-action-button {
  max-width: 100%;
  min-width: 0;
  padding: 5px 7px;
  white-space: normal;
  overflow-wrap: anywhere;
}
table.ech-adaptive-table img,
table.ech-adaptive-table video,
table.ech-adaptive-table canvas {
  max-width: 100%;
  height: auto;
}
table.ech-adaptive-table input,
table.ech-adaptive-table select,
table.ech-adaptive-table textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.report-viewer-table-wrap .excel-table.ech-adaptive-table th:first-child,
.report-viewer-table-wrap .excel-table.ech-adaptive-table td:first-child {
  position: static !important;
  left: auto !important;
  box-shadow: none !important;
}

@media (max-width: 760px) {
  .table-wrap,
  .excel-table-wrap,
  .report-viewer-table-wrap,
  .attendance-table-wrap,
  .fleet-table-wrap,
  .report-responsive-wrap {
    overflow: visible !important;
  }
  table.ech-adaptive-table:not(.ech-keep-table),
  table.ech-adaptive-table:not(.ech-keep-table) tbody,
  table.ech-adaptive-table:not(.ech-keep-table) tr,
  table.ech-adaptive-table:not(.ech-keep-table) td {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
  }
  table.ech-adaptive-table:not(.ech-keep-table) {
    border: 0 !important;
    background: transparent !important;
  }
  table.ech-adaptive-table:not(.ech-keep-table) thead {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
  }
  table.ech-adaptive-table:not(.ech-keep-table) tbody tr {
    margin: 0 0 10px;
    overflow: hidden;
    border: 1px solid #b8ccdc;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 3px 10px rgba(22,54,78,.06);
  }
  table.ech-adaptive-table:not(.ech-keep-table) tbody tr[hidden] {
    display: none !important;
  }
  table.ech-adaptive-table:not(.ech-keep-table) td {
    display: grid;
    grid-template-columns: minmax(105px, 38%) minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    min-height: 35px;
    padding: 7px 9px !important;
    border: 0 !important;
    border-bottom: 1px solid #e0e8ef !important;
    background: #fff !important;
    color: #1d3448;
    font-size: .78rem !important;
    text-align: left !important;
  }
  table.ech-adaptive-table:not(.ech-keep-table) td:last-child {
    border-bottom: 0 !important;
  }
  table.ech-adaptive-table:not(.ech-keep-table) td::before {
    content: attr(data-label);
    color: #49677d;
    font-size: .67rem;
    font-weight: 850;
    letter-spacing: .02em;
    text-transform: uppercase;
  }
  table.ech-adaptive-table:not(.ech-keep-table) td[data-label=""],
  table.ech-adaptive-table:not(.ech-keep-table) td.ech-colspan {
    display: block;
  }
  table.ech-adaptive-table:not(.ech-keep-table) td[data-label=""]::before,
  table.ech-adaptive-table:not(.ech-keep-table) td.ech-colspan::before {
    display: none;
  }
  table.ech-adaptive-table:not(.ech-keep-table) td > * {
    min-width: 0;
    max-width: 100%;
  }
  table.ech-adaptive-table:not(.ech-keep-table) td .personnel-actions-inline,
  table.ech-adaptive-table:not(.ech-keep-table) td .report-actions,
  table.ech-adaptive-table:not(.ech-keep-table) td .actions,
  table.ech-adaptive-table:not(.ech-keep-table) td:last-child {
    flex-wrap: wrap;
  }
  .report-viewer-table-wrap {
    max-height: none !important;
    min-height: 0 !important;
  }
}

/* R39 2026-08-11: tabelle adattive senza scorrimento orizzontale */
@media screen {
  html,
  body,
  .app-shell,
  .workspace-shell,
  .workspace-main,
  .workspace-panel,
  .workspace-frames,
  .workspace-frame {
    max-width: 100%;
  }

  .adaptive-table-wrap {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  table.adaptive-table {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: fixed !important;
  }

  table.adaptive-table col {
    width: auto !important;
    min-width: 0 !important;
  }

  table.adaptive-table th,
  table.adaptive-table td {
    min-width: 0 !important;
    max-width: none !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: normal;
    text-overflow: clip;
  }

  table.adaptive-table tbody th,
  table.adaptive-table tbody td {
    position: static !important;
    left: auto !important;
    right: auto !important;
    box-shadow: none !important;
  }

  table.adaptive-table input,
  table.adaptive-table select,
  table.adaptive-table textarea,
  table.adaptive-table button,
  table.adaptive-table .button,
  table.adaptive-table .primary-button,
  table.adaptive-table .secondary-button,
  table.adaptive-table .danger-button {
    max-width: 100%;
    min-width: 0;
  }

  table.adaptive-table .personnel-actions-inline,
  table.adaptive-table .table-actions,
  table.adaptive-table .actions-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }

  table.adaptive-table.adaptive-density-normal th,
  table.adaptive-table.adaptive-density-normal td {
    padding: 7px 7px;
  }

  table.adaptive-table.adaptive-density-compact {
    font-size: clamp(.72rem, .72vw, .84rem) !important;
  }
  table.adaptive-table.adaptive-density-compact th,
  table.adaptive-table.adaptive-density-compact td {
    padding: 5px 5px !important;
    line-height: 1.25;
  }
  table.adaptive-table.adaptive-density-compact button,
  table.adaptive-table.adaptive-density-compact .primary-button,
  table.adaptive-table.adaptive-density-compact .secondary-button,
  table.adaptive-table.adaptive-density-compact .danger-button {
    min-height: 30px;
    padding: 4px 6px;
    font-size: .72rem;
  }

  table.adaptive-table.adaptive-density-ultra {
    font-size: clamp(.62rem, .62vw, .74rem) !important;
  }
  table.adaptive-table.adaptive-density-ultra th,
  table.adaptive-table.adaptive-density-ultra td {
    padding: 3px 4px !important;
    line-height: 1.18;
  }
  table.adaptive-table.adaptive-density-ultra button,
  table.adaptive-table.adaptive-density-ultra .primary-button,
  table.adaptive-table.adaptive-density-ultra .secondary-button,
  table.adaptive-table.adaptive-density-ultra .danger-button {
    min-height: 27px;
    padding: 3px 5px;
    font-size: .64rem;
  }

  .report-viewer-table-wrap.adaptive-table-wrap .excel-table,
  .report-preview-table-wrap.adaptive-table-wrap .excel-table,
  .attendance-table-wrap.adaptive-table-wrap .excel-table,
  .excel-table-wrap.adaptive-table-wrap .excel-table {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
}

@media screen and (max-width: 760px) {
  .adaptive-table-wrap {
    overflow: visible !important;
    max-height: none !important;
  }

  table.adaptive-table:not(.adaptive-keep-grid) {
    display: block;
    border: 0 !important;
    background: transparent !important;
  }

  table.adaptive-table:not(.adaptive-keep-grid) thead {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }

  table.adaptive-table:not(.adaptive-keep-grid) tbody,
  table.adaptive-table:not(.adaptive-keep-grid) tbody tr {
    display: block;
    width: 100%;
  }

  table.adaptive-table:not(.adaptive-keep-grid) tbody tr {
    margin: 0 0 10px;
    overflow: hidden;
    border: 1px solid #a9bfd1;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .07);
  }

  table.adaptive-table:not(.adaptive-keep-grid) tbody td,
  table.adaptive-table:not(.adaptive-keep-grid) tbody th {
    display: grid !important;
    grid-template-columns: minmax(105px, 38%) minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    width: 100% !important;
    min-height: 38px;
    padding: 8px 10px !important;
    border: 0 !important;
    border-bottom: 1px solid #e0e8ef !important;
    background: #fff !important;
    text-align: left !important;
    font-size: .82rem !important;
  }

  table.adaptive-table:not(.adaptive-keep-grid) tbody td:last-child,
  table.adaptive-table:not(.adaptive-keep-grid) tbody th:last-child {
    border-bottom: 0 !important;
  }

  table.adaptive-table:not(.adaptive-keep-grid) tbody td::before,
  table.adaptive-table:not(.adaptive-keep-grid) tbody th[data-label]::before {
    content: attr(data-label);
    color: #52677b;
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .025em;
    line-height: 1.25;
    text-transform: uppercase;
  }

  table.adaptive-table:not(.adaptive-keep-grid) .adaptive-full-row {
    display: block !important;
    min-height: 0;
  }

  table.adaptive-table:not(.adaptive-keep-grid) .adaptive-full-row::before {
    display: none;
  }

  table.adaptive-table:not(.adaptive-keep-grid) tbody td > *,
  table.adaptive-table:not(.adaptive-keep-grid) tbody th > * {
    min-width: 0;
    max-width: 100%;
  }
}

@media screen and (max-width: 420px) {
  table.adaptive-table:not(.adaptive-keep-grid) tbody td,
  table.adaptive-table:not(.adaptive-keep-grid) tbody th {
    grid-template-columns: minmax(88px, 35%) minmax(0, 1fr);
    padding: 7px 8px !important;
  }
}

/* R93 2026-09-04: pannello amministrativo Object Storage, senza archivio locale persistente. */
.cloud-admin-shell {
  width: min(1240px, calc(100% - 24px));
  margin: 0 auto;
}
.cloud-admin-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}
.cloud-status-grid,
.cloud-legacy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 16px;
}
.cloud-detail-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #c9dfed;
  border-radius: 11px;
  background: #f7fbff;
}
.cloud-detail-card span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .035em;
}
.cloud-detail-card strong {
  color: var(--primary-dark);
  font-size: 1rem;
  overflow-wrap: anywhere;
}
.cloud-detail-card small {
  color: var(--muted);
  font-weight: 700;
}
.cloud-actions {
  flex-wrap: wrap;
}
.cloud-actions > button {
  min-width: 180px;
}
.cloud-admin-shell code {
  padding: 1px 5px;
  border-radius: 5px;
  background: #eaf4fb;
  color: #0b4f78;
  font-weight: 800;
}
@media (max-width: 900px) {
  .cloud-admin-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 620px) {
  .cloud-admin-shell {
    width: min(100% - 14px, 1240px);
  }
  .cloud-status-grid,
  .cloud-legacy-grid {
    grid-template-columns: 1fr;
  }
  .cloud-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .cloud-actions > button {
    width: 100%;
    min-width: 0;
    min-height: 46px;
  }
}

/* R94 2026-09-06: base responsive coerente per workspace, tabelle e smartphone. */
@media screen {
  html {
    width: 100%;
    max-width: 100%;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body,
  .app-shell,
  .workspace-shell,
  .workspace-body,
  .workspace-main,
  .workspace-panel,
  .workspace-frames,
  .workspace-frame,
  main,
  section,
  article,
  form {
    min-width: 0;
  }

  img,
  video,
  canvas,
  svg {
    max-width: 100%;
  }

  .summary-pill,
  .status-pill,
  .status-badge,
  .request-badge,
  .month-status,
  .notification-source {
    max-width: 100%;
    height: auto;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.2;
  }
}

/* Sopra la vista telefono le tabelle conservano colonne leggibili e scorrono
   soltanto nel proprio riquadro, senza allargare o tagliare l'intera pagina. */
@media screen and (min-width: 761px) {
  .table-wrap,
  .excel-table-wrap,
  .report-viewer-table-wrap,
  .report-preview-table-wrap,
  .attendance-table-wrap,
  .fleet-table-wrap,
  .report-responsive-wrap,
  .adaptive-table-wrap {
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
  }

  table.adaptive-table,
  table.ech-adaptive-table,
  .report-viewer-table-wrap .excel-table.adaptive-table,
  .report-viewer-table-wrap .excel-table.ech-adaptive-table {
    width: 100% !important;
    min-width: 100% !important;
    max-width: none !important;
    table-layout: auto !important;
  }

  table.adaptive-table.adaptive-density-compact {
    min-width: 860px !important;
    font-size: .82rem !important;
  }

  table.adaptive-table.ech-cols-many {
    min-width: 1080px !important;
  }

  table.adaptive-table.adaptive-density-ultra {
    min-width: 1280px !important;
    font-size: .76rem !important;
  }

  table.adaptive-table.ech-cols-very-many {
    min-width: 1440px !important;
  }

  table.adaptive-table th,
  table.adaptive-table td,
  table.ech-adaptive-table th,
  table.ech-adaptive-table td {
    white-space: normal !important;
    overflow-wrap: break-word;
    word-break: normal;
  }

  .mobile-embedded-shell table.adaptive-table .primary-button,
  .mobile-embedded-shell table.adaptive-table .secondary-button,
  .mobile-embedded-shell table.adaptive-table .small-button,
  .mobile-embedded-shell table.adaptive-table .nav-button {
    width: auto !important;
    min-height: 34px !important;
    padding: 6px 8px !important;
    font-size: .82rem !important;
  }
}

/* Nella vista a schede annulliamo anche le vecchie larghezze minime delle
   tabelle (760/850/980 px), che erano la causa del sito tagliato su telefono. */
@media screen and (max-width: 760px) {
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .table-wrap,
  .excel-table-wrap,
  .report-viewer-table-wrap,
  .report-preview-table-wrap,
  .attendance-table-wrap,
  .fleet-table-wrap,
  .report-responsive-wrap,
  .adaptive-table-wrap {
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
  }

  table.adaptive-table:not(.adaptive-keep-grid):not(.ech-keep-table),
  table.ech-adaptive-table:not(.adaptive-keep-grid):not(.ech-keep-table),
  html.mobile-embedded-shell table.adaptive-table:not(.adaptive-keep-grid):not(.ech-keep-table),
  body.mobile-embedded-shell table.adaptive-table:not(.adaptive-keep-grid):not(.ech-keep-table) {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: auto !important;
  }

  table.adaptive-table:not(.adaptive-keep-grid):not(.ech-keep-table) tbody td,
  table.adaptive-table:not(.adaptive-keep-grid):not(.ech-keep-table) tbody th {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: visible;
  }

  table.adaptive-table:not(.adaptive-keep-grid):not(.ech-keep-table) tbody td > *,
  table.adaptive-table:not(.adaptive-keep-grid):not(.ech-keep-table) tbody th > * {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  table.adaptive-table:not(.adaptive-keep-grid):not(.ech-keep-table) tbody td:last-child .primary-button,
  table.adaptive-table:not(.adaptive-keep-grid):not(.ech-keep-table) tbody td:last-child .secondary-button,
  table.adaptive-table:not(.adaptive-keep-grid):not(.ech-keep-table) tbody td:last-child .small-button {
    width: 100% !important;
    justify-content: center !important;
  }
}

@media screen and (max-width: 820px) {
  input,
  select,
  textarea {
    max-width: 100%;
    font-size: 16px !important;
  }

  body:not(.embedded-shell) .top-actions > * {
    flex: 0 0 auto;
  }

  body:not(.embedded-shell) .top-actions .user-chip {
    width: auto;
    order: initial;
  }

  .section-heading,
  .title-actions {
    min-width: 0;
    flex-wrap: wrap;
  }

  .mobile-embedded-shell .panel,
  .mobile-embedded-shell .form-panel,
  .mobile-embedded-shell .upload-panel {
    overflow: visible !important;
  }

  .workspace-shell {
    width: 100% !important;
    height: 100dvh !important;
    min-height: 0 !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    overflow: hidden !important;
  }

  .workspace-body {
    height: auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  .workspace-main,
  .workspace-panel,
  .workspace-frames,
  .workspace-frame {
    min-height: 0 !important;
  }
}

@media screen and (max-width: 420px) {
  .workspace-header {
    gap: 4px !important;
  }

  .workspace-mobile-title strong {
    max-width: 31vw !important;
  }

  .workspace-userbar .user-chip {
    max-width: 78px !important;
  }
}
