/* === Dashboard V2 — contrasto alto, glass, responsive === */
:root {
   --dash-bg: #0b1020;
  --dash-grad1: #0b1020;
  --dash-grad2: #111a3a;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.18);
  --ink: #e5e7eb;
  --ink-dim: #9ca3af;
  --brand: #2563eb;
}

/* Background */
.dash-surface {
  min-height: 100vh;
  background:
    radial-gradient(90% 70% at 100% 0%, rgba(13,110,253,.35) 0%, rgba(13,110,253,0) 60%),
    radial-gradient(70% 60% at -10% 100%, rgba(99,102,241,.35) 0%, rgba(99,102,241,0) 60%),
    linear-gradient(180deg, var(--dash-grad1) 0%, var(--dash-grad2) 100%);
  color: var(--ink);
}

/* Sidebar */
.dash-side {
  padding-top: 22px;
  position: fixed;
  inset: 0 auto 0 0;
  width: 280px;
  min-width: 280px;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
  border-right: 1px solid var(--glass-border);
  backdrop-filter: saturate(120%) blur(10px);
  z-index: 1020;
}
.dash-logo {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand) 0%, #1ea0ff 100%);
  color: #fff; font-weight: 700;
}
.dash-item { color: var(--ink); border-radius: 10px; margin: 2px 6px; }
.dash-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.dash-item.active { background: var(--brand); color: #fff; }

/* Topbar */
.dash-top {
  position: sticky; top: 0; z-index: 1030; height: 58px;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.02));
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
}

/* Offcanvas mobile */
.dash-canvas { background: #0f172a; color: #e2e8f0; }
.dash-canvas .dash-item { color: #e2e8f0; }
.dash-canvas .dash-item.active { background: var(--brand); color: #fff; }

/* Main offset */
.dash-main { margin-left: 0; }
@media (min-width: 992px){ .dash-main { margin-left: 280px; } }

/* Cards “glass” */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
}
.hero { max-width: 880px; text-align: left; }
.hero-badge {
  display: inline-block; padding: .35rem .6rem; border-radius: 999px;
  background: rgba(255,255,255,.12); color: #fff; margin-bottom: .5rem; font-weight: 600;
}
.page-title { font-weight: 800; letter-spacing: .3px; }

/* Inputs/table */
.sleek{
  background:#fff !important; color:#0f172a !important;
  border:1px solid rgba(0,0,0,.15) !important; border-radius:12px !important;
  background-image: var(--bs-form-select-bg-img), var(--bs-form-select-bg-icon, none);
  background-repeat: no-repeat; background-position: right .75rem center; background-size:16px 12px;
  padding-right: 2.25rem;
}
.dash-table thead th { background: rgba(255,255,255,.05); }
.dash-table tbody tr + tr { border-top: 1px solid rgba(255,255,255,.08); }
.row-hover:hover { background: rgba(255,255,255,.05); }

/* Buttons */
.btn-icon{ --bs-btn-padding-x:.6rem; --bs-btn-padding-y:.45rem; --bs-btn-border-radius:10px; }
.btn-ghost{ color:#e5e7eb; border:1px solid var(--glass-border); background:transparent; }
.btn-ghost:hover{ background:rgba(255,255,255,.1); color:#fff; }

.btn-cta{
  --_bg1:#2563eb; --_bg2:#06b6d4;
  color:#fff !important; border:0 !important;
  background: linear-gradient(135deg, var(--_bg1), var(--_bg2));
  box-shadow: 0 10px 28px rgba(6,182,212,.35);
}
.btn-cta:hover{ filter:brightness(1.05); transform: translateY(-1px); }

.btn-solid-success{
  color:#0b1220 !important; background:#22c55e !important; border:1px solid #16a34a !important;
  font-weight:600; padding:.45rem .9rem; border-radius:10px;
}
.btn-solid-success:hover{ background:#16a34a !important; }

.btn-download{
  color:#0b1220 !important;
  background: linear-gradient(135deg,#fbbf24,#f59e0b) !important;
  border:1px solid #f59e0b !important; font-weight:600; border-radius:10px;
  padding:.35rem .7rem; box-shadow:0 6px 16px rgba(245,158,11,.35);
}
.btn-download:hover{ filter:brightness(1.05); transform: translateY(-1px); }
.btn-download:focus{ outline:0; box-shadow:0 0 0 .2rem rgba(245,158,11,.25); }

/* Search */
.search-wrap{ position:relative; width:300px; }
.search-wrap i{ position:absolute; left:12px; top:50%; transform:translateY(-50%); color:var(--ink-dim); }
.search-input{
  width:100%; padding:10px 12px 10px 38px; border-radius:12px;
  border:1px solid rgba(255,255,255,.25); background: rgba(0,0,0,.25); color:#fff;
}
.search-input::placeholder{ color:#cbd5e1; }

/* Alerts */
.alert.glass{
  border-radius:14px; border:1px solid var(--glass-border);
  background: rgba(255,255,255,.08); color:#fff;
}

/* Login */
.auth-shell{ min-height:100vh; display:grid; align-items:center; }
.auth-brand-fixed{ position:fixed; top:20px; left:20px; z-index:1040; }
.auth-tabs .nav-link{ color:#e5e7eb; border:1px solid var(--glass-border); background:transparent; }
.auth-tabs .nav-link.active{ background:var(--brand); color:#fff; border-color:var(--brand); }
.btn-outline-light{
  --bs-btn-color:#e5e7eb; --bs-btn-border-color:rgba(255,255,255,.3);
  --bs-btn-hover-bg:rgba(255,255,255,.15); --bs-btn-hover-border-color:rgba(255,255,255,.5);
}
.form-text{ color:#fff; }

/* Offcanvas mobile -> nascosto su desktop */
@media (min-width: 992px){
  #mobSide.offcanvas{ display:none !important; visibility:hidden !important; }
}

/* ===== Helpers form ===== */
.section-card{ margin-bottom:22px; }
.section-head{ display:flex; align-items:center; gap:.75rem; margin-bottom:14px; }
.section-head .title{ font-weight:800; letter-spacing:.2px; font-size:1.05rem; }
.section-divider{
  position:relative; text-transform:uppercase; font-weight:700; font-size:.8rem; letter-spacing:.08em;
  color:var(--ink-dim); padding:.4rem .75rem; margin:18px 0 10px; display:inline-block;
  border:1px solid var(--glass-border); border-radius:999px; background:rgba(255,255,255,.06);
}
.hr-soft{ height:1px; border:0; background:rgba(255,255,255,.12); margin:18px 0; }
.fieldset{ padding:14px; border:1px dashed rgba(255,255,255,.18); border-radius:12px; background:rgba(255,255,255,.03); }
.table-section .dash-table thead th{ background:rgba(255,255,255,.06); }

/* Documenti */
.docs-section .form-select.sleek{
  height:44px; padding:.375rem 2.25rem .375rem .75rem; line-height:1.5;
}
.docs-section .file-slim{ height:44px; padding:.375rem .75rem; line-height:1.5; }
.docs-section .file-slim::-webkit-file-upload-button,
.docs-section .file-slim::file-selector-button{
  height:100%; padding:.375rem .75rem; margin:-.375rem -.75rem;
  border:0; border-right:1px solid rgba(0,0,0,.08);
  border-radius:12px 0 0 12px; background:#f8fafc;
}

/* Nascondi colonna ID in Cards desktop */
#cards-section .dash-table thead th:first-child,
#cards-section .dash-table tbody td:first-child{ display:none; }

/* Mobile tweaks comuni */
@media (max-width: 576px){
  #cards-section td form{ display:flex; flex-direction:column; gap:.5rem; }
  #cards-section td form .form-control{ width:100%; }
  #cards-section td .btn-icon{ padding:.5rem .7rem; font-size:1rem; }
  .search-wrap{ width:100%; }
}
/* Boost contrasto campi sleek nella sezione Cards */
#cards-section .sleek{
  background: rgba(255,255,255,.96) !important;
  border-color: rgba(0,0,0,.18) !important;
}

/* ===== Scadenzario (calendar) ===== */
.fc .fc-toolbar-title{ text-transform:uppercase; }
.fc .fc-col-header-cell-cushion{ text-transform:none; font-weight:600; text-decoration:none; }
.fc .fc-daygrid-day-number, .fc .fc-daygrid-week-number{ color:#fff; text-decoration:none; }
.fc .fc-daygrid-day-number.fc-day-number-contrast{ color:#fff; text-decoration:none; }
.fc-day-has-deadlines{ background:rgba(255,255,255,.02); position:relative; }
.fc-day-has-deadlines:hover{ outline:1px solid rgba(255,255,255,.12); box-shadow: inset 0 0 0 9999px rgba(255,255,255,.02); cursor:pointer; }
.fc-deadline-badge{
  position:absolute; right:6px; bottom:6px; min-width:24px; height:24px; line-height:22px;
  padding:0 6px; text-align:center; font-weight:700; border-radius:999px; color:#fff;
  border:1px solid rgba(255,255,255,.25); background:green; backdrop-filter:blur(6px);
  box-shadow:0 2px 8px rgba(0,0,0,.35), 0 0 0 2px rgba(13,110,253,.15) inset;
}
.fc-day-has-deadlines .fc-deadline-badge::after{
  content:''; position:absolute; inset:-3px; border-radius:inherit; box-shadow:0 0 18px rgba(99,102,241,.35); pointer-events:none;
}

/* Modale scura */
.modal-dark .modal-content{
  background:
    radial-gradient(90% 70% at 100% 0%, rgba(13,110,253,.35) 0%, rgba(13,110,253,0) 60%),
    radial-gradient(70% 60% at -10% 100%, rgba(99,102,241,.35) 0%, rgba(99,102,241,0) 60%),
    linear-gradient(180deg, var(--dash-grad1) 0%, var(--dash-grad2) 100%);
  color:#fff; border:1px solid rgba(255,255,255,.08);
}
.modal-dark .modal-header,.modal-dark .modal-footer{ border-color: rgba(255,255,255,.12); }
.modal-dark .btn-close{ filter: invert(1) grayscale(100%); }
.modal{ z-index:1080; } .modal-backdrop{ z-index:1070; }

/* Scadenzario – mobile custom view */
#mobileSchedule .mobile-acc-item{
  background:transparent; border:1px solid rgba(255,255,255,.08);
  border-radius:.75rem; overflow:hidden; margin-bottom:.75rem;
}
#mobileSchedule .mobile-acc-header{ background:rgba(255,255,255,.04); color:#fff; }
#mobileSchedule .mobile-acc-header:focus{ box-shadow:none; }
#mobileSchedule .acc-date{ font-weight:700; }
#mobileSchedule .acc-badge{
  display:inline-block; min-width:28px; height:28px; line-height:26px; text-align:center; font-weight:700;
  border-radius:999px; color:#fff; border:1px solid rgba(255,255,255,.25); background:green;
}
#mobileSchedule .accordion-body{ background:rgba(255,255,255,.02); border-top:1px solid rgba(255,255,255,.08); }
#mobileSchedule .deadline-card{
  background: rgba(0,0,0,.25); border:1px solid rgba(255,255,255,.08);
  border-radius:.75rem; padding:.75rem; margin-bottom:.5rem; color:#fff;
}
#mobileSchedule .mini-label{ font-size:.75rem; color:rgba(255,255,255,.7); }
#mobileSchedule .mini-val{ font-weight:600; }
#mobileSchedule .btn.btn-primary{ padding:.25rem .5rem; font-size:.85rem; border-radius:.5rem; }
#mobileSchedule .empty-month{
  padding:1rem; border:1px dashed rgba(255,255,255,.25); border-radius:.75rem; text-align:center;
}

/* ===== Cards: mobile card-view ===== */
@media (max-width: 576px){
  .cards-table thead{ display:none; }
  .cards-table tbody tr{
    display:block; margin:.75rem; border:1px solid rgba(255,255,255,.12);
    border-radius:.75rem; background:rgba(255,255,255,.03); padding:.75rem .75rem .5rem;
  }
  .cards-table tbody td{
    display:flex; justify-content:space-between; gap:.75rem;
    padding:.35rem 0 !important; border:0 !important;
  }
  .cards-table tbody td::before{
    content:attr(data-label); font-weight:600; color:rgba(255,255,255,.8); margin-right:1rem;
  }
  #cards-section input[name="tipo"]{ min-width:0; width:100%; }
  .cards-table .mob-stack{ width:100%; justify-content:stretch !important; flex-direction:column; }
  .cards-table .mob-stack .btn, .cards-table .mob-stack .mob-btn{ width:100%; }
}
.cards-table tbody tr.row-hover:hover{ background: rgba(255,255,255,.02); }

/* Tessere – mobile refined */
.mob-sticky-search{ position:sticky; top:.5rem; z-index:5; }
.fab-add{
  position:fixed; right:14px; bottom:80px; width:52px; height:52px; border-radius:999px;
  display:inline-flex; align-items:center; justify-content:center; box-shadow:0 8px 24px rgba(0,0,0,.35);
}
.cards-mob-list{ display:grid; gap:.75rem; }
.card-mob{
  border:1px solid rgba(255,255,255,.12); border-radius:.9rem;
  padding:.75rem .75rem .6rem; backdrop-filter: blur(2px);
}
.card-mob__header{ display:flex; align-items:center; justify-content:space-between; margin-bottom:.5rem; }
.badge-id{
  display:inline-block; font-weight:700; border:1px solid rgba(255,255,255,.22);
  border-radius:.5rem; padding:.15rem .5rem; color:#fff; background:rgba(255,255,255,.06);
}
.card-mob .mini-label{ font-size:.8rem; color:rgba(255,255,255,.7); margin-bottom:.25rem; }
.card-mob .form-control{ margin-bottom:.6rem; }
.card-mob__actions{ display:grid; grid-template-columns:1fr 1fr; gap:.5rem; }
.card-mob__actions .btn{ border-radius:.6rem; }
@media (max-width:360px){ .card-mob__actions{ grid-template-columns:1fr; } }
@media (min-width:768px){ .dash-table tbody tr.row-hover:hover{ background: rgba(255,255,255,.02); } }

/* ===== Chiusure – mobile refined ===== */
.closures-mob-list{ display:grid; gap:.75rem; }
.closure-card{
  border:1px solid rgba(255,255,255,.12); border-radius:.9rem;
  padding:.75rem .75rem .6rem; backdrop-filter: blur(2px);
}
.closure-card__dates{ display:grid; grid-template-columns:1fr 1fr; gap:.5rem; }
.closure-card .mini-label{ font-size:.8rem; color:rgba(255,255,255,.7); margin-bottom:.25rem; }
.closure-card__actions{ display:grid; grid-template-columns:1fr 1fr; gap:.5rem; margin-top:.6rem; }
.closure-card__actions .btn{ border-radius:.6rem; }
@media (max-width:360px){
  .closure-card__dates{ grid-template-columns:1fr; }
  .closure-card__actions{ grid-template-columns:1fr; }
}

/* ==== FIX overflow mobile chiusure (XS) ==== */
@media (max-width: 576px){
  .closures-mob-list{
    padding-inline: .75rem;
    margin: 0;
    max-width: 100%;
  }

  .closure-card{
    margin: .5rem 0;
    max-width: 100%;
    box-sizing: border-box;
  }
  .closure-card__dates,
  .closure-card__actions{ gap: .5rem; }

  .closure-card__dates > div,
  .closure-card__actions > *{
    min-width: 0;
  }

  .closure-card input.form-control{
    width: 100%;
    max-width: 100%;
  }
  .closure-card__actions .btn{ width: 100%; }

  .mob-sticky-search .input-group{
    width: 100%;
    max-width: 100%;
  }
  .mob-sticky-search .input-group > .form-control{
    min-width: 0;
  }

  #closures-section{ padding-inline: .5rem; }
}

/* cintura di sicurezza globale */
html, body, .dash-surface{ overflow-x: hidden; }

/* ===== Tratte – mobile refined ===== */
.routes-mob-list{ display:grid; gap:.75rem; padding-inline:.75rem; }
.route-card{
  border:1px solid rgba(255,255,255,.12);
  border-radius:.9rem;
  padding:.75rem .75rem .6rem;
  backdrop-filter: blur(2px);
}
.route-card .mini-label{ font-size:.8rem; color:rgba(255,255,255,.7); margin:.25rem 0; }
.route-card__actions{ display:grid; grid-template-columns:1fr 1fr; gap:.5rem; margin-top:.6rem; }
.route-card__actions .btn{ border-radius:.6rem; }
@media (max-width:360px){
  .route-card__actions{ grid-template-columns:1fr; }
}

/* Documenti – mobile */
.docs-mob-list{ display:grid; gap:.75rem; padding-inline:.75rem; }
.doc-card{
  border:1px solid rgba(255,255,255,.12);
  border-radius:.9rem;
  padding:.75rem .75rem .6rem;
  backdrop-filter: blur(2px);
}
.doc-card .mini-label{ font-size:.8rem; color:rgba(255,255,255,.7); margin:.25rem 0; }
.doc-card__actions{ display:grid; grid-template-columns:1fr 1fr; gap:.5rem; margin-top:.6rem; }
.doc-card__actions .btn{ border-radius:.6rem; }
@media (max-width:360px){ .doc-card__actions{ grid-template-columns:1fr; } }

/* ===== Clienti – mobile card view ===== */
.clients-mob-list{ display:grid; gap:.75rem; }
.client-card{
  border:1px solid rgba(255,255,255,.12);
  border-radius:.9rem;
  padding:.75rem .75rem .6rem;
  backdrop-filter: blur(2px);
}
.client-card__head{
  display:flex; align-items:center; justify-content:space-between; gap:.75rem; margin-bottom:.35rem;
}
.client-card__name{ font-weight:700; font-size:1rem; }
.badge-id{
  display:inline-block; font-weight:700;
  border:1px solid rgba(255,255,255,.22);
  border-radius:.5rem; padding:.15rem .5rem;
  color:#fff; background:rgba(255,255,255,.06);
  white-space:nowrap;
}
.client-row{ margin:.25rem 0 .35rem; }
.client-row .mini-label{ font-size:.8rem; color:rgba(255,255,255,.7); }
.client-row .mini-val{ font-weight:600; }

.client-actions{ margin-top:.5rem; display:grid; grid-template-columns:1fr; gap:.5rem; }
.client-actions .btn{ border-radius:.6rem; }

@media (max-width: 576px){
  .clients-mob-list{ padding-inline:.5rem; }
  .client-card, .client-card *{ min-width:0; }
}

/* ===== Client detail – mobile form safety ===== */
#clients-detail-section .input-group > *{ min-width:0; }
#clients-detail-section .badge{ margin-right:.25rem; margin-bottom:.25rem; }

#tratte-list .badge{
  background: rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.18);
  color:#fff;
}

/* Documenti – mobile cards */
.docs-mob-list{ display:grid; gap:.75rem; padding-inline:.5rem; }
.doc-card{
  border:1px solid rgba(255,255,255,.12);
  border-radius:.9rem;
  padding:.75rem .75rem .6rem;
  backdrop-filter: blur(2px);
}
.doc-row{ margin:.15rem 0 .35rem; }
.doc-row .mini-label{ font-size:.8rem; color:rgba(255,255,255,.7); }
.doc-row .mini-val{ font-weight:600; word-break:break-word; }
.doc-row.grid-2{ display:grid; grid-template-columns:1fr 1fr; gap:.5rem; }
@media (max-width:360px){ .doc-row.grid-2{ grid-template-columns:1fr; } }
.doc-actions{ display:grid; grid-template-columns:1fr 1fr; gap:.5rem; margin-top:.6rem; }
.doc-actions .btn{ border-radius:.6rem; }
@media (max-width:360px){ .doc-actions{ grid-template-columns:1fr; } }

/* Modal dark (coerente con resto) */
.modal-dark .modal-content{
  background:
    radial-gradient(90% 70% at 100% 0%, rgba(13,110,253,.35) 0%, rgba(13,110,253,0) 60%),
    radial-gradient(70% 60% at -10% 100%, rgba(99,102,241,.35) 0%, rgba(99,102,241,0) 60%),
    linear-gradient(180deg, var(--dash-grad1) 0%, var(--dash-grad2) 100%);
  color:#fff;
  border:1px solid rgba(255,255,255,.08);
}
.modal-dark .modal-header,.modal-dark .modal-footer{ border-color: rgba(255,255,255,.12); }
.modal-dark .btn-close{ filter: invert(1) grayscale(100%); }

/* Section spacing on XS */
@media (max-width:576px){
  #clients-detail-section .section-card{ padding: 1rem; }
}

/* Readonly look coerente con .sleek */
.ro-field{
  display:block;
  width:100%;
  min-height:44px;
  padding:.5rem .75rem;
  border-radius:12px;
  background:#fff;
  color:#0f172a;
  border:1px solid rgba(0,0,0,.15);
  line-height:1.5;
  word-break:break-word;
}

/* Sezione customer: sicurezza XS */
@media (max-width:576px){
  #customer-profile-section .section-card{ padding:1rem; }
  #customer-profile-section .ro-field{ min-width:0; }
}

/* ===== FAQ – customer ===== */
.faq-group{
  margin-bottom: 26px;
}

.faq-group h2{
  font-weight: 800;
  letter-spacing: .02em;
  font-size: 1rem;
  text-transform: uppercase;
  margin-bottom: .75rem;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

.faq-group h2::before{
  content: '';
  width: 7px;
  height: 20px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--brand), #06b6d4);
}

/* wrapper accordion con look “glass” coerente */
.faq-accordion{
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: linear-gradient(145deg, rgba(15,23,42,.85), rgba(15,23,42,.6));
  overflow: hidden;
}

/* card singola FAQ */
.faq-accordion .accordion-item{
  border: 0;
  background: transparent;
}

.faq-accordion .accordion-item + .accordion-item{
  border-top: 1px solid rgba(255,255,255,.08);
}

/* bottone domanda */
.faq-accordion .accordion-button{
  background: transparent;
  color: var(--ink);
  padding: .85rem 1rem;
  font-weight: 600;
  font-size: .95rem;
  border-radius: 0;
  box-shadow: none;
}

.faq-accordion .accordion-button::after{
  filter: invert(1) brightness(1.2);
  opacity: .7;
}

.faq-accordion .accordion-button:not(.collapsed){
  background: rgba(15,23,42,.9);
  color: #fff;
}

/* corpo risposta */
.faq-accordion .accordion-body{
  background: radial-gradient(90% 80% at 100% 0%, rgba(37,99,235,.24) 0%, rgba(37,99,235,0) 60%),
              radial-gradient(70% 70% at 0% 100%, rgba(56,189,248,.18) 0%, rgba(56,189,248,0) 60%);
  padding: .85rem 1rem 1rem;
  color: green;
  font-size: .9rem;
  line-height: 1.5;
}

/* liste dentro le risposte */
.faq-accordion .accordion-body ul{
  padding-left: 1.1rem;
  margin-bottom: .25rem;
}

.faq-accordion .accordion-body li{
  margin-bottom: .15rem;
}

/* link nei testi FAQ */
.faq-accordion .accordion-body a{
  color: #7dd3fc;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.faq-accordion .accordion-body a:hover{
  color: #e0f2fe;
}

/* badge tipo card in testa alla pagina FAQ */
#customer-faq-section .section-head .small strong{
  display: inline-flex;
  align-items: center;
  padding: .15rem .6rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(15,23,42,.8);
  font-weight: 600;
}

/* XS: stringiamo padding per non schiacciare tutto */
@media (max-width: 576px){
  #customer-faq-section .section-card{
    padding: 1rem;
  }
  .faq-accordion .accordion-button{
    padding: .7rem .8rem;
    font-size: .9rem;
  }
  .faq-accordion .accordion-body{
    padding: .7rem .8rem .85rem;
  }
}

/* ===== Prossime partenze – shell ===== */
.nextdep-shell{
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background:
    radial-gradient(90% 70% at 100% 0%, rgba(37,99,235,.35) 0%, rgba(37,99,235,0) 60%),
    radial-gradient(70% 60% at -10% 100%, rgba(56,189,248,.22) 0%, rgba(56,189,248,0) 60%),
    linear-gradient(180deg, rgba(15,23,42,.98) 0%, rgba(15,23,42,.9) 100%);
  border: 1px solid var(--glass-border);
  box-shadow: 0 18px 40px rgba(0,0,0,.6);
}

/* toolbars filtri */
.nextdep-toolbar{
  margin-bottom: .75rem;
}

.nextdep-select{
  min-width: 220px;
}

.nextdep-note{
  font-size: .78rem;
}

/* tabella */
.nextdep-table-wrap{
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,.35);
  background: rgba(15,23,42,.9);
}

.nextdep-table thead th{
  background: rgba(15,23,42,.98);
  border-bottom: 1px solid rgba(148,163,184,.35);
  color: var(--ink-dim);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.nextdep-table tbody tr:nth-child(odd){
  background: rgba(15,23,42,.9);
}
.nextdep-table tbody tr:nth-child(even){
  background: rgba(15,23,42,.94);
}
.nextdep-table tbody tr:hover{
  background: rgba(30,64,175,.9);
}

/* linea di separazione data */
.nextdep-sep-row td{
  background: rgba(15,23,42,1);
  border-bottom: 1px solid rgba(148,163,184,.4);
  padding-top: .45rem;
  padding-bottom: .45rem;
}
.nextdep-sep-chip{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .2rem .7rem;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.7);
  background: rgba(15,23,42,1);
  font-size: .8rem;
  font-weight: 700;
}

/* pillola orario */
.nextdep-time{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: .28rem .7rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: .9rem;
  background: linear-gradient(135deg, var(--brand), #06b6d4);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(15,23,42,1), 0 6px 16px rgba(37,99,235,.45);
}

/* dot status */
.nextdep-dot{
  display:inline-block;
  width:10px;
  height:10px;
  border-radius:999px;
  margin-right:.35rem;
  box-shadow:0 0 0 2px rgba(15,23,42,1);
}
.nextdep-dot.open{ background:#22c55e; }
.nextdep-dot.pending{ background:#fbbf24; }
.nextdep-dot.closed{ background:#ef4444; }

/* bottone prenota nella tabella */
.nextdep-book-btn{
  padding-inline: .9rem;
}

/* ===== Vista cards (mobile) ===== */
.nextdep-cards{
  margin-top: .75rem;
  display: grid;
  gap: .6rem;
}

.nextdep-cards-sep{
  font-weight: 700;
  font-size: .8rem;
  padding: .3rem .6rem;
  border-radius: .75rem;
  border: 1px solid rgba(148,163,184,.6);
  background: rgba(15,23,42,1);
}

.nextdep-card{
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: .75rem;
  padding: .75rem .75rem .6rem;
  border-radius: .9rem;
  border: 1px solid rgba(148,163,184,.55);
  background:
    radial-gradient(110% 120% at 100% 0%, rgba(37,99,235,.35) 0%, transparent 60%),
    rgba(15,23,42,.98);
  box-shadow: 0 14px 28px rgba(0,0,0,.6);
}

.nextdep-card-time{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:.3rem;
  font-size:.78rem;
  color:rgba(148,163,184,.9);
}

.nextdep-card-body{
  min-width:0;
}

.nextdep-route{
  font-weight:700;
  font-size:.95rem;
  margin-bottom:.1rem;
}

.nextdep-status-pill{
  display:inline-flex;
  align-items:center;
  gap:.25rem;
  margin-bottom:.3rem;
  font-size:.82rem;
}

.nextdep-meta{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(130px,1fr));
  gap:.3rem;
  font-size:.8rem;
  color:#d1d5db;
}

.nextdep-pill{
  display:inline-flex;
  align-items:center;
  gap:.25rem;
  padding:.2rem .55rem;
  border-radius:999px;
  border:1px dashed rgba(148,163,184,.7);
  background:rgba(15,23,42,.9);
}

.nextdep-pill .truncate{
  font-size:.8rem;
}

/* Responsive tweaks */
@media (max-width: 992px){
  .nextdep-select{ min-width: 160px; }
}
@media (max-width: 768px){
  .nextdep-shell{ padding: 1.25rem; }
  .nextdep-table-wrap{ border-radius: 10px; }
}
@media (max-width: 576px){
  #next-departures-section .section-card{ padding: 1rem; }
  .nextdep-toolbar{ margin-bottom: .6rem; }
  .nextdep-card{
    grid-template-columns: 1fr;
  }
  .nextdep-card-time{
    flex-direction:row;
    justify-content:flex-start;
  }
}

/* Select sleek: compat con 7.4 / Bootstrap */
.form-select.sleek {
  appearance: auto;
  -webkit-appearance: auto;
  -moz-appearance: auto;
  background-image: none !important;
  padding-right: 2.5rem;
  position: relative;
}
.form-select.sleek:after { content: ""; }
