/* ═══════════════════════════════════════════════════════
   DiSPaC — Convenzioni Tirocini
   Colori istituzionali: #bd1824 (rosso), #000000, #FFFFFF
   ═══════════════════════════════════════════════════════ */

:root {
  --dispac-red: #bd1824;
  --dispac-red-dark: #9a1420;
  --dispac-red-light: #d42030;
  --dispac-black: #000000;
  --dispac-white: #ffffff;
  --dispac-gray-light: #f5f5f5;
  --dispac-gray: #6c757d;
  --dispac-border: #e0e0e0;
  --dispac-card-shadow: 0 2px 12px rgba(0,0,0,0.08);
  --dispac-card-shadow-hover: 0 6px 24px rgba(189,24,36,0.15);
}

* { box-sizing: border-box; }

body {
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 400;
  color: #1a1a1a;
  background: #fafafa;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main.main-content { flex: 1; }

h1, h2, h3, h4, h5 {
  font-family: 'Playfair Display', serif;
}

/* ── HEADER ── */
.dispac-header {
  background: var(--dispac-white);
  border-bottom: 1px solid var(--dispac-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.header-red-bar {
  height: 4px;
  background: var(--dispac-red);
}

.header-inner {
  display: flex;
  align-items: center;
  padding: 14px 0;
  gap: 0;
}

.header-divider {
  width: 3px;
  height: 60px;
  background: var(--dispac-red);
  margin: 0 20px;
  flex-shrink: 0;
  border-radius: 2px;
}

.header-divider--neutro {
  background: var(--dispac-border);
}

.logo-unisa {
  height: 80px;
  flex-shrink: 0;
}

.header-title {
  flex: 1;
}

.header-titolo {
  font-family: 'Playfair Display', serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--dispac-black);
  margin: 0 0 2px 0;
  line-height: 1.2;
}

.header-sottotitolo {
  font-size: 0.85rem;
  color: var(--dispac-gray);
  margin: 0;
  font-weight: 400;
}

/* ── LOGO ── */
.logo-link {
  text-decoration: none;
  color: inherit;
}

.dispac-logo {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.logo-main {
  font-family: 'Playfair Display', serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--dispac-black);
  letter-spacing: -1px;
  line-height: 1;
}

.logo-main em {
  font-style: italic;
  color: var(--dispac-red);
}

.logo-sub {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--dispac-red);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
  line-height: 1.3;
}

.dispac-logo--white .logo-main { color: var(--dispac-white); }
.dispac-logo--white .logo-main em { color: rgba(255,255,255,0.7); }
.dispac-logo--white .logo-sub { color: rgba(255,255,255,0.8); }

/* ── HEADER NAV ── */
.header-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  margin-left: 20px;
}

.nav-link-header {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dispac-black);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
  margin-left: 4px;
}

.nav-link-header:hover,
.nav-link-header.active {
  background: var(--dispac-gray-light);
  color: var(--dispac-red);
}

.btn-header-action {
  background: var(--dispac-red) !important;
  color: var(--dispac-white) !important;
  padding: 4px 14px;
}

.btn-header-action:hover {
  background: var(--dispac-red-dark) !important;
  color: white !important;
}

.header-auth {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
}

.user-badge {
  color: var(--dispac-gray);
  font-weight: 600;
}

.btn-login, .btn-logout {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 4px;
  text-decoration: none;
  border: 1.5px solid var(--dispac-red);
  color: var(--dispac-red);
  transition: all 0.2s;
}

.btn-login:hover, .btn-logout:hover {
  background: var(--dispac-red);
  color: white;
}

/* ── LINGUA ── */
.lang-form { display: inline-flex; align-items: center; gap: 2px; }
.lang-btn {
  background: none;
  border: none;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--dispac-gray);
  cursor: pointer;
  padding: 2px 4px;
  letter-spacing: 0.05em;
}
.lang-btn.active { color: var(--dispac-red); }
.lang-btn:hover { color: var(--dispac-red); }
.lang-sep { color: var(--dispac-border); font-size: 0.75rem; }

/* ── PULSANTI ── */
.btn-dispac {
  background: var(--dispac-red);
  color: white;
  border: none;
  font-weight: 600;
  font-family: 'Source Sans 3', sans-serif;
  letter-spacing: 0.03em;
  transition: background 0.2s, transform 0.1s;
}

.btn-dispac:hover {
  background: var(--dispac-red-dark);
  color: white;
  transform: translateY(-1px);
}

.btn-dispac-outline {
  background: transparent;
  color: var(--dispac-red);
  border: 1.5px solid var(--dispac-red);
  font-weight: 600;
  transition: all 0.2s;
}

.btn-dispac-outline:hover {
  background: var(--dispac-red);
  color: white;
}

/* ── PAGE HEADER ── */
.page-header {
  background: var(--dispac-black);
  color: white;
  padding: 40px 0 32px;
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: 'DiSPaC';
  position: absolute;
  right: -20px;
  top: -10px;
  font-family: 'Playfair Display', serif;
  font-size: 9rem;
  font-weight: 700;
  color: rgba(255,255,255,0.04);
  pointer-events: none;
  letter-spacing: -4px;
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.page-header .subtitle {
  color: rgba(255,255,255,0.6);
  font-size: 0.95rem;
  font-weight: 300;
}

.page-header .red-accent {
  display: inline-block;
  width: 40px;
  height: 3px;
  background: var(--dispac-red);
  margin-bottom: 12px;
}

/* ── FILTRI ── */
.filtri-card {
  background: white;
  border: 1px solid var(--dispac-border);
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 28px;
  box-shadow: var(--dispac-card-shadow);
}

.filtri-card .form-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dispac-gray);
  margin-bottom: 4px;
}

.filtri-card .form-control,
.filtri-card .form-select {
  border-color: var(--dispac-border);
  font-size: 0.9rem;
}

.filtri-card .form-control:focus,
.filtri-card .form-select:focus {
  border-color: var(--dispac-red);
  box-shadow: 0 0 0 0.2rem rgba(189,24,36,0.15);
}

/* ── CARD CONVENZIONE ── */
.conv-card {
  background: white;
  border-radius: 8px;
  border: 1px solid var(--dispac-border);
  box-shadow: var(--dispac-card-shadow);
  overflow: hidden;
  transition: box-shadow 0.25s, transform 0.2s;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.conv-card:hover {
  box-shadow: var(--dispac-card-shadow-hover);
  transform: translateY(-3px);
}

.conv-card-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--dispac-gray-light);
  position: relative;
  flex-shrink: 0;
}

.conv-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.conv-card-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0f0f0, #e8e8e8);
  color: #bbb;
}

.conv-card-img-placeholder .placeholder-logo {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: #d0d0d0;
  letter-spacing: -1px;
  line-height: 1;
}

.conv-card-img-placeholder .placeholder-logo em {
  font-style: italic;
  color: rgba(189,24,36,0.3);
}

.conv-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.conv-card-tipo {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dispac-red);
  margin-bottom: 6px;
}

.conv-card-nome {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--dispac-black);
  margin-bottom: 6px;
  line-height: 1.3;
}

.conv-card-citta {
  font-size: 0.82rem;
  color: var(--dispac-gray);
  margin-bottom: 10px;
}

.conv-card-citta i { margin-right: 3px; }

.conv-card-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--dispac-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── BADGE STATO ── */
.badge-stato {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.04em;
}

.badge-disponibile { background: #e8f5e9; color: #2e7d32; }
.badge-non-disponibile { background: #fff3e0; color: #e65100; }
.badge-disattivata { background: #f5f5f5; color: #9e9e9e; }

/* ── CONTATORE ── */
.risultati-count {
  font-size: 0.85rem;
  color: var(--dispac-gray);
  margin-bottom: 16px;
}

.risultati-count strong { color: var(--dispac-red); }

/* ── DETTAGLIO ── */
.dettaglio-header {
  background: white;
  border-bottom: 1px solid var(--dispac-border);
  padding: 32px 0;
  margin-bottom: 36px;
}

.dettaglio-img-wrap {
  width: 200px;
  height: 200px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--dispac-border);
  flex-shrink: 0;
}

.dettaglio-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dettaglio-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f5f5f5, #ebebeb);
}

.info-section {
  background: white;
  border: 1px solid var(--dispac-border);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--dispac-card-shadow);
}

.info-section h5 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--dispac-red);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--dispac-red);
}

.info-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.info-label {
  font-weight: 600;
  color: var(--dispac-gray);
  min-width: 140px;
  flex-shrink: 0;
  font-size: 0.82rem;
}

.info-value { color: #1a1a1a; }

.sede-item {
  padding: 8px 12px;
  background: var(--dispac-gray-light);
  border-left: 3px solid var(--dispac-red);
  border-radius: 0 4px 4px 0;
  margin-bottom: 6px;
  font-size: 0.88rem;
}

.note-box {
  background: #fff8f8;
  border: 1px solid rgba(189,24,36,0.2);
  border-left: 4px solid var(--dispac-red);
  border-radius: 0 6px 6px 0;
  padding: 16px;
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-line;
}

/* ── FORM ── */
.form-section {
  background: white;
  border: 1px solid var(--dispac-border);
  border-radius: 8px;
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--dispac-card-shadow);
}

fieldset legend {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dispac-black);
  border-bottom: 2px solid var(--dispac-red);
  padding-bottom: 6px;
  margin-bottom: 20px;
  width: 100%;
}

.form-control:focus, .form-select:focus {
  border-color: var(--dispac-red);
  box-shadow: 0 0 0 0.2rem rgba(189,24,36,0.15);
}

/* ── TABELLA GESTIONE ── */
.table-dispac thead {
  background: var(--dispac-black);
  color: white;
}

.table-dispac thead th {
  color: white;                 /* Bootstrap 5.3 imposta il colore sulle singole celle: va forzato qui */
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 16px;
  border: none;
}

.table-dispac tbody tr:hover { background: #fff5f5; }

.table-dispac tbody td {
  padding: 12px 16px;
  vertical-align: middle;
  border-color: var(--dispac-border);
  font-size: 0.88rem;
}

/* ── LOGIN ── */
.login-card {
  max-width: 420px;
  margin: 80px auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.12);
  overflow: hidden;
}

.login-header {
  background: var(--dispac-red);
  padding: 32px;
  text-align: center;
}

.login-body { padding: 32px; }

/* ── FOOTER ── */
.dispac-footer {
  background: var(--dispac-black);
  color: white;
  margin-top: auto;
}

.footer-red-bar {
  height: 4px;
  background: var(--dispac-red);
}

.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  padding: 36px 0 24px;
  flex-wrap: wrap;
}

.footer-info {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.6;
}

.footer-info strong { color: white; }
.text-muted-footer { color: rgba(255,255,255,0.45) !important; }

.footer-link {
  display: block;
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  text-decoration: none;
  transition: color 0.2s;
}
.footer-link:hover { color: var(--dispac-red); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 12px 0;
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
}

.footer-bottom p { margin: 0; }

.footer-credits {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
  margin-bottom: 6px;
}

.footer-credits strong {
  color: rgba(255,255,255,0.65);
}

/* ── ALERT ── */
.alert-success { border-left: 4px solid #2e7d32; }
.alert-danger { border-left: 4px solid var(--dispac-red); }
.alert-info { border-left: 4px solid #1565c0; }
.alert-warning { border-left: 4px solid #e65100; }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--dispac-gray);
}

.empty-state i {
  font-size: 4rem;
  color: var(--dispac-border);
  display: block;
  margin-bottom: 16px;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }

  .header-divider {
    display: none;
  }

  .header-title {
    text-align: center;
  }

  .header-nav {
    align-items: center;
  }
}



/* ═══════════════════════════════════════════════════════
   ESTENSIONI — Calendario Appelli d'Esame
   ═══════════════════════════════════════════════════════ */

:focus-visible { outline: 2px solid var(--dispac-red); outline-offset: 2px; }
a { color: var(--dispac-red); }
a:hover { color: var(--dispac-red-dark); }
.form-check-input:checked { background-color: var(--dispac-red); border-color: var(--dispac-red); }
.form-check-input:focus { border-color: var(--dispac-red); box-shadow: 0 0 0 0.2rem rgba(189,24,36,0.15); }
.btn-dispac:focus-visible, .btn-dispac-outline:focus-visible { box-shadow: 0 0 0 0.25rem rgba(189,24,36,0.3); }
.btn-dispac:disabled { background: #c9c9c9; }

/* ── LOGIN ── */
.login-nota {
  font-size: 0.82rem;
  color: var(--dispac-gray);
  border-top: 1px solid var(--dispac-border);
  padding-top: 16px;
  line-height: 1.5;
}

/* ── PAGE HEADER: varianti ── */
.page-header--compatto { padding: 28px 0 24px; margin-bottom: 28px; }
.breadcrumb-dark .breadcrumb-item a { color: rgba(255,255,255,0.65); text-decoration: none; }
.breadcrumb-dark .breadcrumb-item a:hover { color: white; }
.breadcrumb-dark .breadcrumb-item.active,
.breadcrumb-dark .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,0.4); }
.breadcrumb { font-size: 0.85rem; }
.breadcrumb a { text-decoration: none; }

/* ── HOME DOCENTI ── */
.campagna-home {
  background: white;
  border: 1px solid var(--dispac-border);
  border-top: 4px solid var(--dispac-red);
  border-radius: 0 0 8px 8px;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.campagna-home-body { padding: 28px 28px 8px; flex: 1; }
.campagna-home-titolo { font-size: 1.45rem; font-weight: 700; margin-bottom: 10px; }
.campagna-home-meta { list-style: none; padding: 0; margin: 0 0 12px; font-size: 0.92rem; color: #333; }
.campagna-home-meta li { padding: 6px 0; border-bottom: 1px dashed var(--dispac-border); display: flex; gap: 10px; }
.campagna-home-meta li:last-child { border-bottom: 0; }
.campagna-home-meta i { color: var(--dispac-red); }
.campagna-home-cta { margin: 0 28px 28px; padding: 12px; font-size: 1.05rem; }

/* ── WIZARD ── */
.wizard-head {
  background: white;
  border-bottom: 1px solid var(--dispac-border);
  padding: 22px 0 18px;
  margin-bottom: 32px;
}
.wizard-campagna { font-size: 0.85rem; color: var(--dispac-gray); font-weight: 600; }

.wizard-stepper {
  list-style: none;
  display: flex;
  padding: 0;
  margin: 10px 0 0;
  counter-reset: step;
}
.wizard-stepper li {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  color: #9a9a9a;
  font-weight: 600;
  font-size: 0.92rem;
}
.wizard-stepper li:not(:last-child)::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--dispac-border);
  margin: 0 12px;
}
.wizard-stepper li.fatto:not(:last-child)::after { background: var(--dispac-red); }
.wizard-num {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2px solid var(--dispac-border);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  background: white;
  flex-shrink: 0;
}
.wizard-stepper li.attivo { color: var(--dispac-black); }
.wizard-stepper li.attivo .wizard-num { border-color: var(--dispac-red); color: var(--dispac-red); }
.wizard-stepper li.fatto { color: var(--dispac-black); }
.wizard-stepper li.fatto .wizard-num { background: var(--dispac-red); border-color: var(--dispac-red); color: white; }

.wizard-panel {
  max-width: 760px;
  margin: 0 auto;
  background: white;
  border: 1px solid var(--dispac-border);
  border-radius: 8px;
  padding: 36px 40px;
}
.wizard-panel--largo { max-width: 1000px; }
.wizard-titolo { font-size: 1.9rem; font-weight: 700; margin-bottom: 8px; }
.wizard-intro { color: #444; max-width: 68ch; margin-bottom: 28px; line-height: 1.6; }
.wizard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--dispac-border);
}

.docente-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--dispac-gray-light);
  border-left: 3px solid var(--dispac-red);
  padding: 10px 14px;
  border-radius: 0 6px 6px 0;
  font-size: 0.9rem;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.docente-chip i { color: var(--dispac-red); font-size: 1.1rem; }
.docente-chip a { font-weight: 600; text-decoration: none; font-size: 0.85rem; }

/* ── STEP 3: blocchi appello ── */
.appelli-lista { list-style: none; padding: 0; margin: 0; }
.appello-blocco {
  position: relative;
  padding: 0 0 28px 56px;
  border-left: 2px solid var(--dispac-border);
  margin-left: 18px;
}
.appello-blocco:last-child { border-left-color: transparent; padding-bottom: 4px; }
.appello-testa { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.appello-num {
  position: absolute;
  left: -19px; top: -2px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--dispac-black);
  color: white;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.05rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 4px white;
  transition: background 0.2s;
}
.appello-blocco--ok .appello-num { background: #2e7d32; }
.appello-nome { font-size: 1.2rem; font-weight: 700; margin: 0; }

.badge-conflitto {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  background: #fde2e4;
  color: var(--dispac-red);
  white-space: nowrap;
  cursor: default;
}

/* ── STEP 4 / SUCCESSO ── */
.riepilogo-dati {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px 28px;
  margin-bottom: 28px;
}
.riepilogo-dati dt { font-size: 0.8rem; color: var(--dispac-gray); font-weight: 600; margin-bottom: 2px; }
.riepilogo-dati dd { margin: 0; font-weight: 600; }

.successo-icona {
  width: 72px; height: 72px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--dispac-red);
  color: white;
  font-size: 2.4rem;
  display: flex; align-items: center; justify-content: center;
}
.successo-lista { list-style: none; padding: 0; margin: 0 auto 32px; max-width: 720px; border-top: 1px solid var(--dispac-border); }
.successo-lista li {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 2fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--dispac-border);
  font-size: 0.92rem;
}
.successo-azioni { display: flex; flex-direction: column; gap: 12px; align-items: center; }

/* ── ADMIN: elenco campagne ── */
.campagne-lista { display: flex; flex-direction: column; gap: 14px; }
.campagna-riga {
  background: white;
  border: 1px solid var(--dispac-border);
  border-radius: 8px;
  padding: 18px 22px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 20px;
  align-items: center;
}
.campagna-riga-nome { font-size: 1.15rem; font-weight: 700; margin-bottom: 4px; }
.campagna-riga-nome a { color: var(--dispac-black); text-decoration: none; }
.campagna-riga-nome a:hover { color: var(--dispac-red); }
.campagna-riga-meta { font-size: 0.84rem; color: var(--dispac-gray); margin: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.campagna-riga-meta i { margin-right: 4px; }
.campagna-riga-azioni { display: flex; gap: 6px; align-items: center; }

.stato-switch { display: inline-flex; border: 1px solid var(--dispac-border); border-radius: 6px; overflow: hidden; background: white; }
.stato-switch form { display: contents; }
.stato-btn {
  border: 0;
  background: white;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--dispac-gray);
  display: inline-flex; align-items: center; gap: 5px;
  border-right: 1px solid var(--dispac-border);
  transition: background 0.15s, color 0.15s;
}
.stato-switch form:last-child .stato-btn { border-right: 0; }
.stato-btn:hover:not(.attivo) { background: var(--dispac-gray-light); color: var(--dispac-black); }
.stato-btn.attivo { cursor: default; opacity: 1; }
.stato-aperta.attivo { background: #2e7d32; color: white; }
.stato-pausa.attivo { background: #e65100; color: white; }
.stato-chiusa.attivo { background: var(--dispac-black); color: white; }

.link-pubblico { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; margin-top: 8px; flex-wrap: wrap; }
.link-pubblico code { color: var(--dispac-black); background: var(--dispac-gray-light); padding: 2px 8px; border-radius: 4px; }
.link-pubblico--box { background: white; border: 1px solid var(--dispac-border); border-left: 4px solid #2e7d32; padding: 12px 16px; border-radius: 0 8px 8px 0; font-size: 0.9rem; }
.link-pubblico i { color: var(--dispac-red); font-size: 1.1rem; }

/* ── ADMIN: configurazione ── */
.cdl-riga, .appelli-admin li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--dispac-border);
}
.appelli-admin { padding-left: 1.4rem; margin-bottom: 20px; }
.appelli-admin li { display: flex; }
.appelli-admin { list-style: decimal; }
.appelli-admin li::marker { color: var(--dispac-red); font-weight: 700; }
.cdl-nuovo { background: var(--dispac-gray-light); border-radius: 6px; padding: 16px; }

.regola { padding: 14px 0; border-bottom: 1px solid var(--dispac-border); }
.regola:last-of-type { border-bottom: 0; }
.regola-desc { font-size: 0.86rem; color: var(--dispac-gray); margin: 4px 0 10px 2.5em; }
.regola #gruppo-distanza { margin-left: 2.5em; }

/* ── ADMIN: calendario appello ── */
.calendario-wrap .flatpickr-calendar.inline { box-shadow: none; border: 1px solid var(--dispac-border); width: 100%; max-width: 640px; }
.flatpickr-day.selected, .flatpickr-day.selected:hover,
.flatpickr-day.startRange, .flatpickr-day.endRange,
.flatpickr-day.selected.prevMonthDay, .flatpickr-day.selected.nextMonthDay {
  background: var(--dispac-red); border-color: var(--dispac-red);
}
.flatpickr-day.inRange { box-shadow: -5px 0 0 #fde2e4, 5px 0 0 #fde2e4; background: #fde2e4; border-color: #fde2e4; }
.flatpickr-day.today { border-color: var(--dispac-black); }
.intervallo-box { background: var(--dispac-gray-light); padding: 12px 14px; border-radius: 6px; max-width: 640px; }

.slot-tabella-wrap { border: 1px solid var(--dispac-border); border-radius: 6px; max-height: 460px; overflow-y: auto; }
.slot-tabella thead th { position: sticky; top: 0; background: var(--dispac-black); color: white; font-size: 0.8rem; font-weight: 700; z-index: 1; }
.slot-tabella thead small { font-weight: 400; color: rgba(255,255,255,0.6); }
.slot-tabella td { vertical-align: middle; font-size: 0.88rem; }
.slot-tabella .form-check-input { width: 1.2em; height: 1.2em; }
/* ora di inizio sotto ogni data (step 3) */
.ora-wrap { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.ora-wrap .form-control { max-width: 120px; }
.ora-wrap .form-control:disabled { opacity: 0.5; }

/* ── ADMIN: tabella riepilogo ── */
.btn-export { box-shadow: 0 0 0 3px rgba(255,255,255,0.15); }
.riepilogo-wrap { position: relative; background: white; border: 1px solid var(--dispac-border); border-radius: 8px; }
.table-riepilogo { font-size: 0.86rem; }
.table-riepilogo thead th { white-space: nowrap; vertical-align: middle; }
.table-riepilogo thead th.sortable { cursor: pointer; user-select: none; }
.table-riepilogo thead th.sortable::after { content: ' ↕'; color: rgba(255,255,255,0.35); font-size: 0.8em; }
.table-riepilogo thead th[aria-sort="ascending"]::after { content: ' ↑'; color: white; }
.table-riepilogo thead th[aria-sort="descending"]::after { content: ' ↓'; color: white; }
.table-riepilogo .th-appello { text-align: center; background: var(--dispac-red); border-left: 2px solid white !important; }
.table-riepilogo .th-sub th { background: #222; color: white; font-size: 0.7rem; }
.table-riepilogo .th-appello-inizio { border-left: 2px solid var(--dispac-border) !important; }
.table-riepilogo thead .th-appello-inizio { border-left-color: #444 !important; }
.table-riepilogo .td-slot { min-width: 190px; font-size: 0.82rem; }
.table-riepilogo .td-conflitto { background: #fde2e4 !important; color: var(--dispac-red); font-weight: 700; }
.table-riepilogo .td-alt-evidenza { background: #fff8e1 !important; font-weight: 600; }
.table-riepilogo tr.riga-conflitto > td:first-child { box-shadow: inset 4px 0 0 var(--dispac-red); }
.table-riepilogo .td-alt-libera { background: #f1f8f2 !important; }
.table-riepilogo .td-scelta-assegnata { background: #e8f5e9 !important; color: #1b5e20; font-weight: 700; }
.table-riepilogo .td-scartata { color: var(--dispac-gray); text-decoration: line-through; }
.table-riepilogo .th-sub .th-assegnata { background: #3a3a3a; }
.table-riepilogo .td-assegnata { background: #fafafa; }
.table-riepilogo .td-assegnata--conflitto { background: #fff5f5 !important; }
.table-riepilogo .td-assegnata--modificata { background: #f3f7ff !important; }
.assegnata-data { font-weight: 600; }
.assegnata-azioni { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.assegnata-azioni .btn-assegna { padding: 1px 10px; font-size: 0.75rem; }
.assegnata-azioni .btn-link.btn-assegna { padding: 0 4px; }
.badge-modificata { background: #e3ecfd; color: #1a4fa0; }
.pref-nota { display: inline-block; font-size: 0.7rem; font-weight: 700; padding: 1px 7px; border-radius: 20px; white-space: nowrap; }
.pref-nota--libera { background: #e8f5e9; color: #2e7d32; }
.pref-nota--occupata { background: #fff3e0; color: #b45309; }
.pref-nota--assegnata { background: #c8e6c9; color: #1b5e20; }

/* ── ADMIN: finestra di assegnazione data ── */
.assegna-intro { text-align: left; margin-bottom: 12px; font-size: 0.95rem; }
.assegna-opzioni { list-style: none; padding: 0; margin: 0; text-align: left; }
.assegna-opzioni li { border: 1px solid var(--dispac-border); border-radius: 8px; margin-bottom: 8px; }
.assegna-opzioni label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; cursor: pointer; margin: 0; }
.assegna-opzioni li:has(input:checked) { border-color: var(--dispac-red); background: #fff8f8; }
.assegna-opzioni .form-check-input { margin-top: 4px; flex-shrink: 0; }
.assegna-tipo { display: block; font-size: 0.75rem; font-weight: 700; color: var(--dispac-gray); text-transform: uppercase; letter-spacing: 0.03em; }
.assegna-stato { display: block; font-size: 0.8rem; margin-top: 2px; }
.assegna-stato--libera { color: #2e7d32; }
.assegna-stato--occupata { color: #b45309; }
.assegna-stato--regola { color: var(--dispac-red); }
.assegna-opzioni select { margin-top: 6px; }
.assegna-ora { display: flex; align-items: center; gap: 10px; margin-top: 12px; text-align: left; }
.assegna-ora .form-control { max-width: 130px; }
.ora-cella { white-space: nowrap; color: var(--dispac-gray); font-weight: 600; }

/* ── RESPONSIVE: estensioni ── */
@media (max-width: 992px) {
  .campagna-riga { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .wizard-panel { padding: 24px 20px; }
  .wizard-titolo { font-size: 1.5rem; }
  .wizard-label { display: none; }
  .wizard-stepper li.attivo .wizard-label { display: inline; }
  .appello-blocco { padding-left: 34px; margin-left: 16px; }
  .successo-lista li { grid-template-columns: 1fr; gap: 2px; }
  .wizard-actions { flex-direction: column-reverse; gap: 12px; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
.btn-link:not(.text-secondary) { color: var(--dispac-red); }
.btn-link:not(.text-secondary):hover { color: var(--dispac-red-dark); }
