/* Stili propri dell'area «fleet» nel restyling come HubLEM (docs/restyle). */

/* --- Filtri come VehicleFilters / DeadlineFilters: riquadro bianco -------- */
.fleet-filters {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 1rem; padding: 1rem 1.15rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06); margin-bottom: 1.5rem;
}
.fleet-filters__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin-top: .75rem; }
@media (max-width: 991.98px) { .fleet-filters__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .fleet-filters__grid { grid-template-columns: minmax(0, 1fr); } }
.fleet-filters__grid > * { min-width: 0; }
.fleet-filters__grid .form-select { max-width: 100%; text-overflow: ellipsis; }
.fleet-filters .hub-more { margin: .75rem 0 0; }
.fleet-filters__foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem;
  margin-top: .85rem; padding-top: .75rem; border-top: 1px solid #f3f4f6; font-size: .8rem; color: #6b7280;
}
.fleet-filters__foot strong { color: #111827; }
.fleet-filters__help { font-size: .75rem; color: #6b7280; margin: .6rem 0 0; }
@media (max-width: 767.98px) { .hub-mhero + .fleet-filters { margin: -1rem .25rem 1rem; position: relative; } }

/* --- Card Automezzi: testata grigia, corpo con km e riquadri dei costi ----- */
.fleet-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.fleet-card { background: #fff; border: 2px solid #e5e7eb; border-radius: .9rem; overflow: hidden; display: flex; flex-direction: column; }
.fleet-card.is-muted { opacity: .75; }
.fleet-card__head { background: #f9fafb; border-bottom: 1px solid #e5e7eb; padding: 1.1rem 1.4rem; }
.fleet-card__title-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: .35rem; }
.fleet-card__plate { font-size: 1.25rem; font-weight: 700; color: #111827; text-decoration: none; }
a.fleet-card__plate:hover { text-decoration: underline; color: #000; }
.fleet-card__model { font-size: .875rem; color: #4b5563; margin: 0; }
.fleet-card__driver { font-size: .875rem; color: #6b7280; margin: .25rem 0 0; }
.fleet-card__fuel { font-size: .875rem; font-weight: 700; color: #ea580c; margin: .5rem 0 0; }
.fleet-card__telepass { font-size: .875rem; font-weight: 700; color: #4338ca; margin: .25rem 0 0; }
.fleet-card__body { padding: 1.25rem 1.4rem; display: grid; gap: 1rem; flex: 1 1 auto; align-content: start; }
.fleet-card__facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 0; }
.fleet-card__facts dt { font-size: .75rem; font-weight: 400; color: #6b7280; }
.fleet-card__facts dd { font-size: .875rem; font-weight: 600; margin: 0; }
.fleet-card__body .hub-note small { display: block; font-size: .75rem; margin-bottom: .2rem; }
.fleet-card__body .hub-note strong { font-size: .95rem; }
.fleet-card__actions { display: flex; gap: .5rem; padding-top: 1rem; border-top: 1px solid #e5e7eb; margin-top: auto; }
.fleet-card__actions > .btn, .fleet-card__actions > a { flex: 1 1 0; }
.fleet-card__actions form { flex: 0 0 auto; }

/* Telefono: 4 pulsanti SCAD / DOC / EDIT / DEL. */
.fleet-mcard { border-color: #f3f4f6; }
.fleet-mcard__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.fleet-mcard__grid form, .fleet-mcard__grid form .hub-mbtn { width: 100%; height: 100%; }
.fleet-mbtn--orange { background: #fff7ed; border-color: #fed7aa; color: #c2410c; }
.fleet-mbtn--amber { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.fleet-mbtn--grad-orange { background: linear-gradient(90deg, #ea580c, #dc2626); color: #fff; border: 0; }
.fleet-mbtn--grad-green { background: linear-gradient(90deg, #16a34a, #059669); color: #fff; border: 0; }

/* Elenco vuoto con l'icona grande di HubLEM. */
.fleet-empty { background: #fff; border: 2px solid #e5e7eb; border-radius: .9rem; padding: 3rem 1rem; text-align: center; color: #6b7280; }
.fleet-empty .bi { display: block; font-size: 3.5rem; color: #d1d5db; margin-bottom: .75rem; }
.fleet-empty p { margin: 0; }
.fleet-empty--small { border: 0; padding: 2rem 1rem; background: transparent; }
.fleet-empty--small .bi { font-size: 2.75rem; }
.fleet-empty--ok .bi { color: #22c55e; }

/* --- Dialog: righe con titolo, date, note e azioni a destra --------------- */
.fleet-list { display: grid; gap: .75rem; }
.fleet-item { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; background: #fff; border: 1px solid #e5e7eb; border-radius: .75rem; padding: 1rem; }
.fleet-item__main { min-width: 0; flex: 1 1 auto; }
.fleet-item__title { font-weight: 600; margin: 0 0 .25rem; }
.fleet-item__line { font-size: .85rem; color: #4b5563; margin: 0; }
.fleet-item__location { font-size: .85rem; font-weight: 700; color: #1d4ed8; margin: .2rem 0 0; }
.fleet-item__note { font-size: .78rem; color: #6b7280; font-style: italic; margin: .25rem 0 0; }
.fleet-telepass { border: 2px solid #c7d2fe; background: #eef2ff; border-radius: 1rem; padding: 1rem; color: #3730a3; }
.fleet-telepass__title { font-weight: 900; color: #1e1b4b; margin: 0; }
.fleet-telepass__serial { font-size: .75rem; margin: 0; }
.fleet-telepass__empty { background: rgba(255, 255, 255, .7); border-radius: .75rem; padding: .75rem; font-size: .85rem; margin: 0; }

/* --- Dialog Automezzo: chiavette (arancio) e vendita (verde) -------------- */
.fleet-keys { border: 2px solid #fed7aa; background: #fff7ed; border-radius: .75rem; padding: 1rem; color: #9a3412; }
.fleet-keys__title, .fleet-sale__title { font-size: 1rem; font-weight: 700; margin: 0; }
.fleet-keys__list { display: grid; gap: .5rem; }
.fleet-keys__row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; background: #fff; border: 1px solid #fed7aa; border-radius: .6rem; padding: .6rem .75rem; }
.fleet-keys__row small { display: block; font-size: .68rem; color: #9a3412; }
.fleet-keys__row strong { font-size: .85rem; color: #111827; overflow-wrap: anywhere; }
@media (max-width: 575.98px) { .fleet-keys__row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fleet-sale { border: 2px solid #bbf7d0; background: #f0fdf4; border-radius: .75rem; padding: 1rem; color: #166534; }
.fleet-sale__title { color: #166534; margin-bottom: .75rem; }
.fleet-form .form-label { font-size: .85rem; font-weight: 500; }
.fleet-dialog .btn-dark { background: #111827; }

/* --- Gestione Scadenze: righe larghe a gruppi ----------------------------- */
.fleet-box { background: #fff; border: 2px solid #e5e7eb; border-radius: .9rem; margin-bottom: 1.5rem; }
.fleet-box__head { padding: 1rem 1.25rem; border-bottom: 1px solid #e5e7eb; font-weight: 700; font-size: 1.1rem; }
.fleet-box__body { padding: 1.25rem; display: grid; gap: 1.5rem; }
.fleet-group__title { font-size: .85rem; font-weight: 700; letter-spacing: .03em; margin-bottom: .75rem; display: flex; align-items: center; gap: .4rem; }
.fleet-group--red .fleet-group__title { color: #b91c1c; }
.fleet-group--orange .fleet-group__title { color: #c2410c; }
.fleet-group--yellow .fleet-group__title { color: #a16207; }
.fleet-group__rows { display: grid; gap: .6rem; }
.fleet-drow {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  border: 1px solid #e5e7eb; border-radius: .75rem; padding: .85rem 1rem; background: #fff;
}
.fleet-group--red .fleet-drow { background: #fef2f2; border-color: #fecaca; }
.fleet-drow__left { display: flex; align-items: center; gap: .85rem; min-width: 0; }
.fleet-drow__icon { font-size: 1.25rem; color: #9ca3af; }
.fleet-drow__plate { font-weight: 700; color: #111827; text-decoration: none; }
.fleet-drow__model, .fleet-drow__type { font-size: .78rem; color: #6b7280; margin: 0; }
.fleet-drow__right { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; justify-content: flex-end; }
.fleet-drow__date { font-weight: 600; font-size: .9rem; }
.fleet-drow__days { font-size: .8rem; }
.fleet-days--red { color: #dc2626; font-weight: 700; }
.fleet-days--orange { color: #ea580c; font-weight: 700; }
.fleet-days--gray { color: #6b7280; }
.fleet-history { border: 1px solid #e5e7eb; border-radius: .75rem; padding: 1rem; }
.fleet-history__head { display: flex; flex-wrap: wrap; gap: .5rem; align-items: baseline; margin-bottom: .75rem; }
.fleet-history__row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; padding: .4rem 0; border-top: 1px solid #f3f4f6; font-size: .85rem; }
.fleet-delta--up { color: #dc2626; font-weight: 700; }
.fleet-delta--down { color: #16a34a; font-weight: 700; }

/* Telefono: card arrotondate delle scadenze. */
.fleet-mgroup { font-size: .75rem; font-weight: 900; letter-spacing: .04em; margin: 1rem 0 .5rem; }
.fleet-mgroup--red { color: #b91c1c; }
.fleet-mgroup--orange { color: #c2410c; }
.fleet-mgroup--yellow { color: #a16207; }
.fleet-mstats { display: grid; grid-template-columns: repeat(var(--tiles, 4), minmax(0, 1fr)); gap: .5rem; margin: -1.5rem .75rem 1rem; position: relative; }
.fleet-mstat { background: #fff; border: 2px solid #e5e7eb; border-radius: 1.25rem; padding: .7rem .3rem; text-align: center; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1); }
.fleet-mstat strong { display: block; font-size: 1.35rem; font-weight: 900; line-height: 1; }
.fleet-mstat small { display: block; font-size: .55rem; font-weight: 900; letter-spacing: .04em; margin-top: .2rem; }
.fleet-mstat--red { border-color: #fecaca; } .fleet-mstat--red strong { color: #b91c1c; } .fleet-mstat--red small { color: #dc2626; }
.fleet-mstat--orange { border-color: #fed7aa; } .fleet-mstat--orange strong { color: #9a3412; } .fleet-mstat--orange small { color: #ea580c; }
.fleet-mstat--yellow { border-color: #fef08a; } .fleet-mstat--yellow strong { color: #854d0e; } .fleet-mstat--yellow small { color: #ca8a04; }
.fleet-mstat--gray strong { color: #374151; } .fleet-mstat--gray small { color: #6b7280; }
.fleet-mstat--green { border-color: #bbf7d0; } .fleet-mstat--green strong { color: #14532d; } .fleet-mstat--green small { color: #16a34a; }
.fleet-mstat--indigo { border-color: #c7d2fe; } .fleet-mstat--indigo strong { color: #312e81; } .fleet-mstat--indigo small { color: #4f46e5; }
.hub-mhero:has(+ .fleet-mstats) .hub-mhero__band { padding-bottom: 2.5rem; }

/* --- Manutenzioni: card fornitore ----------------------------------------- */
.fleet-suppliers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 1199.98px) { .fleet-suppliers { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fleet-supplier {
  display: block; background: #fff; border: 2px solid #e5e7eb; border-radius: .9rem; padding: 1.25rem;
  color: inherit; text-decoration: none; transition: box-shadow .2s ease;
}
.fleet-supplier:hover { box-shadow: 0 10px 20px -8px rgba(0, 0, 0, .2); color: inherit; }
.fleet-supplier__name { font-size: 1.05rem; font-weight: 700; margin-bottom: .85rem; }
.fleet-supplier__row { display: flex; justify-content: space-between; align-items: center; font-size: .85rem; color: #4b5563; margin-bottom: .45rem; }
.fleet-supplier__total { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #e5e7eb; padding-top: .6rem; font-weight: 700; }
.fleet-supplier__total span:last-child { font-size: 1.35rem; }
.fleet-mbar { color: #fff; border-radius: .9rem; padding: .6rem 1rem; font-weight: 900; font-size: .85rem; margin: 1rem 0 .5rem; }
.fleet-mbar--blue { background: linear-gradient(90deg, #2563eb, #1d4ed8); }
.fleet-mbar--green { background: linear-gradient(90deg, #16a34a, #15803d); }
.fleet-mcards--indent { margin-left: .5rem; }
.fleet-mlinks { display: flex; gap: 1rem; font-size: .8rem; font-weight: 700; margin: .5rem 0; }

/* --- Sinistri: elenco a righe con cerchio rosso --------------------------- */
.fleet-claim { display: block; padding: 1.1rem 1.25rem; border-top: 1px solid #f3f4f6; color: inherit; text-decoration: none; }
.fleet-claim:first-child { border-top: 0; }
.fleet-claim:hover { background: #f9fafb; color: inherit; }
.fleet-claim__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.fleet-claim__who { display: flex; align-items: center; gap: .75rem; }
.fleet-claim__icon { width: 2.5rem; height: 2.5rem; border-radius: 50%; background: #fee2e2; color: #dc2626; display: grid; place-items: center; font-size: 1.15rem; flex-shrink: 0; }
.fleet-claim__plate { font-weight: 700; }
.fleet-claim__when { font-size: .8rem; color: #6b7280; }
.fleet-claim__desc { font-size: .875rem; color: #374151; margin: .6rem 0 0 3.25rem; white-space: pre-line; }
.fleet-claim__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem 1rem; margin: .6rem 0 0 3.25rem; font-size: .8rem; }
.fleet-claim__grid small { display: block; color: #6b7280; }
.fleet-claim__grid strong { font-weight: 600; }
@media (max-width: 767.98px) { .fleet-claim__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-left: 0; } .fleet-claim__desc { margin-left: 0; } }
.fleet-panel { border-radius: .75rem; padding: 1rem; }
.fleet-panel--gray { background: #f9fafb; border: 1px solid #e5e7eb; }

/* --- Attrezzature: foto grande a sinistra --------------------------------- */
.fleet-photo-pick { border: 2px dashed #d1d5db; border-radius: .9rem; padding: 1.5rem; text-align: center; color: #6b7280; background: #f9fafb; }
.fleet-photo-pick .bi { font-size: 2rem; display: block; margin-bottom: .35rem; }
.fleet-photo-preview { position: relative; }
.fleet-photo-preview img { width: 100%; height: 12rem; object-fit: cover; border-radius: .9rem; border: 1px solid #e5e7eb; }
.fleet-mphoto { width: 100%; height: 10rem; object-fit: cover; border-radius: 1rem; margin-bottom: .75rem; }

/* --- Andamento Automezzi -------------------------------------------------- */
.fleet-picker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1.5rem; }
@media (max-width: 991.98px) { .fleet-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fleet-pick { display: flex; align-items: center; gap: .75rem; background: #fff; border: 2px solid #e5e7eb; border-radius: .9rem; padding: .85rem 1rem; color: inherit; text-decoration: none; }
.fleet-pick:hover { border-color: #a5b4fc; color: inherit; }
.fleet-pick.is-active { border-color: #4f46e5; background: #eef2ff; }
.fleet-pick__icon { width: 2.75rem; height: 2.75rem; border-radius: .75rem; display: grid; place-items: center; background: #f3f4f6; color: #4b5563; font-size: 1.25rem; flex-shrink: 0; }
.fleet-pick.is-active .fleet-pick__icon { background: #4f46e5; color: #fff; }
.fleet-pick__plate { font-weight: 700; display: block; }
.fleet-pick__model { font-size: .78rem; color: #6b7280; }
.fleet-cards3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.fleet-cards2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 991.98px) { .fleet-cards3, .fleet-cards2 { grid-template-columns: 1fr; } }
.fleet-kv { display: flex; justify-content: space-between; font-size: .875rem; padding: .3rem 0; }
.fleet-big { font-size: 1.75rem; font-weight: 700; }
.fleet-bar { height: .75rem; background: #e5e7eb; border-radius: 999px; overflow: hidden; }
.fleet-bar > span { display: block; height: 100%; border-radius: 999px; }
.fleet-anomaly { border-radius: .6rem; padding: .6rem .85rem; border: 1px solid; display: flex; justify-content: space-between; gap: .75rem; font-size: .85rem; }
.fleet-anomaly--high { background: #fee2e2; border-color: #fca5a5; }
.fleet-anomaly--medium { background: #fef9c3; border-color: #fde047; }
.fleet-tabpanel[hidden] { display: none !important; }

/* --- Import satellitare ------------------------------------------------- */
.fleet-narrow { max-width: 56rem; }
.fleet-steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.fleet-steps li { display: flex; gap: .75rem; align-items: flex-start; font-size: .875rem; }
.fleet-steps li::before { counter-increment: step; content: counter(step); width: 1.6rem; height: 1.6rem; border-radius: 50%; background: #dbeafe; color: #1d4ed8; font-weight: 700; display: grid; place-items: center; flex-shrink: 0; font-size: .8rem; }
.fleet-dropzone { display: block; border: 2px dashed #67e8f9; color: #0e7490; background: #ecfeff; border-radius: .75rem; padding: 1rem; text-align: center; font-weight: 600; cursor: pointer; }
.fleet-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; }
.fleet-day { display: flex; align-items: center; gap: 1rem; border: 1px solid #e5e7eb; border-radius: .75rem; padding: .85rem 1rem; color: inherit; text-decoration: none; background: #fff; }
.fleet-day:hover { box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .15); color: inherit; }
.fleet-day__icon { width: 2.75rem; height: 2.75rem; border-radius: .75rem; background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff; display: grid; place-items: center; font-size: 1.2rem; }
.fleet-scroll { max-height: 600px; overflow-y: auto; display: grid; gap: .6rem; }
