/* ═══════════════════════════════════════════════════════════════════════════════
   Sulla Soglia — admin-widgets.css
   Widget riutilizzabili per pagine admin: toggle switch, accordion, timeline.
   Carica dopo admin.css. Dark mode via [data-theme="dark"].
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Toggle switch (checkbox stilizzato) */
.toggle {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}
.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #ccc;
  border-radius: 20px;
  transition: 0.2s;
}
.toggle .slider::before {
  content: '';
  position: absolute;
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.2s;
}
.toggle input:checked + .slider {
  background: #49a078;
}
.toggle input:checked + .slider::before {
  transform: translateX(18px);
}
.toggle input:disabled + .slider {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Accordion — header clickable toggla .open sul parent .accordion */
.accordion {
  margin-bottom: 8px;
}
.accordion-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: white;
  border: 1px solid #e8e8e4;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}
.accordion-header:hover {
  background: #fafaf8;
}
.accordion-header .acc-date {
  color: #888;
  font-size: 11px;
}
.accordion-header .acc-note {
  color: #aaa;
  font-size: 11px;
}
.accordion-body {
  display: none;
  padding: 14px;
  background: white;
  border: 1px solid #e8e8e4;
  border-top: none;
  border-radius: 0 0 8px 8px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}
.accordion.open .accordion-body {
  display: block;
}
.accordion.open .accordion-header {
  border-radius: 8px 8px 0 0;
}

/* Timeline — lista verticale di step con stati (done/current/default) */
.timeline {
  position: relative;
  padding-left: 24px;
}
.timeline.timeline--spaced {
  margin-top: 14px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e8e8e4;
}
.timeline-item {
  position: relative;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: white;
  border-radius: 10px;
  border: 1px solid #e8e8e4;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 16px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ccc;
  border: 2px solid #f5f4f0;
}
.timeline-item.current::before {
  background: #b53a1e;
}
.timeline-item.done::before {
  background: #49a078;
}
.timeline-item .tl-stato {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #888;
}
.timeline-item .tl-date {
  font-size: 11px;
  color: #aaa;
  margin-left: 8px;
}
.timeline-item .tl-note {
  font-size: 13px;
  color: #444;
  margin-top: 4px;
}

/* Dark mode overrides */
[data-theme='dark'] .toggle .slider {
  background: #5c5852;
}
[data-theme='dark'] .toggle input:checked + .slider {
  background: #49a078;
}
[data-theme='dark'] .accordion-header {
  background: #2b2720;
  border-color: #3c3830;
}
[data-theme='dark'] .accordion-header:hover {
  background: #302a21;
}
[data-theme='dark'] .accordion-body {
  background: #2b2720;
  border-color: #3c3830;
  color: #c8c4bc;
}
[data-theme='dark'] .accordion-header .acc-date,
[data-theme='dark'] .accordion-header .acc-note {
  color: #9a9690;
}
[data-theme='dark'] .timeline::before {
  background: #3c3830;
}
[data-theme='dark'] .timeline-item {
  background: #2b2720;
  border-color: #3c3830;
}
[data-theme='dark'] .timeline-item::before {
  border-color: #1c1916;
}
[data-theme='dark'] .timeline-item .tl-note {
  color: #c8c4bc;
}
