/* ── LIST VIEW ── */

.list-view {
  padding: 16px 20px 48px;
  min-width: 700px;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── GROUP ── */

.list-group {
  margin-bottom: 28px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(13,46,64,0.06), 0 0 0 1px rgba(13,46,64,0.05);
  background: #fff;
}

.list-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  background: var(--warm-white);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  transition: background var(--duration-sm) ease;
}

.list-group-header:hover { background: #f0eeea; }

.list-group-chevron {
  width: 16px;
  height: 16px;
  color: var(--gray-light);
  transition: transform var(--duration-md) var(--ease-out);
  flex-shrink: 0;
}

.list-group-header.collapsed .list-group-chevron { transform: rotate(-90deg); }

.list-group-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--black);
  letter-spacing: -0.1px;
}

.list-group-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.list-group-del {
  margin-left: 6px;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent;
  color: var(--gray-light);
  border-radius: 5px; cursor: pointer;
  opacity: 0;
  transition: opacity var(--duration-sm) ease, color var(--duration-sm) ease, background var(--duration-sm) ease;
}
.list-group-header:hover .list-group-del { opacity: 1; }
.list-group-del:hover { color: #b83030; background: rgba(184,48,48,0.10); }

.list-add-section {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray);
  background: rgba(255,255,255,0.5);
  border: 1.5px dashed var(--border-cool);
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--duration-sm) ease;
}
.list-add-section:hover {
  color: var(--blue);
  border-color: var(--blue);
  background: rgba(42,109,144,0.05);
}

/* Colori per sezioni stato */
.list-group[data-group-label="Da fare"]        .list-group-name { color: #b91c1c; }
.list-group[data-group-label="In svolgimento"] .list-group-name { color: #ca8a04; }
.list-group[data-group-label="Fatto"]          .list-group-name { color: #15803d; }

.list-group[data-group-label="Da fare"]        .list-group-count { background: #dc2626; }
.list-group[data-group-label="In svolgimento"] .list-group-count { background: #eab308; color: #78350f; }
.list-group[data-group-label="Fatto"]          .list-group-count { background: #22c55e; color: #14532d; }

.list-group-count {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: var(--gray-light);
  border-radius: 10px;
  padding: 1px 7px;
  letter-spacing: 0;
}

/* ── TABLE ── */

.list-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.list-table thead th {
  padding: 7px 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gray-light);
  background: var(--warm-white);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  border-right: 1px solid rgba(0,0,0,0.05);
  text-align: left;
  white-space: nowrap;
}

.list-table thead th:last-child { border-right: none; }

/* ── RESIZE COLONNE ── */

.list-table thead th { position: relative; }

.col-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Linea divisoria sempre visibile (affordance) */
.col-resize-handle::after {
  content: '';
  width: 2px;
  height: 55%;
  background: rgba(0,0,0,0.10);
  border-radius: 2px;
  transition: background var(--duration-sm) ease, height var(--duration-sm) ease;
}

.col-resize-handle:hover::after,
.col-resize-handle.resizing::after {
  background: var(--blue);
  height: 100%;
  width: 3px;
}

/* Badge larghezza durante il resize */
.col-resize-badge {
  position: fixed;
  z-index: 9999;
  background: var(--blue-deep);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 4px 9px;
  border-radius: 6px;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  letter-spacing: 0.3px;
}

/* ── DRAG & DROP COLONNE ── */

.col-draggable {
  cursor: grab;
}

.col-draggable:active { cursor: grabbing; }

.col-dragging {
  opacity: 0.45;
}

.col-drag-over-left {
  border-left: 3px solid var(--blue) !important;
}

.col-drag-over-right {
  border-right: 3px solid var(--blue) !important;
}

/* ── */

.col-sortable {
  transition: color var(--duration-sm) ease, background var(--duration-sm) ease;
}

.col-sortable:hover {
  color: var(--blue);
  background: rgba(42,109,144,0.07) !important;
}

.col-sortable svg {
  display: inline-block;
  vertical-align: middle;
  margin-left: 4px;
  opacity: 0.45;
  transition: opacity var(--duration-sm) ease;
}

.col-sortable:hover svg { opacity: 0.75; }

.col-sorted {
  color: var(--blue) !important;
}

.col-sorted svg {
  opacity: 1 !important;
  color: var(--blue);
}

.col-elemento { width: auto; min-width: 200px; }
.col-persona  { width: 110px; }
.col-stato    { width: 140px; }
.col-data     { width: 110px; }
.col-timeline { width: 170px; }
.col-note     { width: 190px; }
.col-actions  { width: 44px; }

/* ── ROW ── */

.list-row {
  border-bottom: 1px solid rgba(0,0,0,0.05);
  transition: background var(--duration-xs) ease;
  cursor: default;
}

.list-row:hover { background: rgba(42,109,144,0.04); }

.list-row:last-child { border-bottom: none; }

.list-row td {
  padding: 9px 12px;
  font-size: 13px;
  color: var(--black);
  vertical-align: middle;
  border-right: 1px solid rgba(0,0,0,0.04);
}

.list-row td:last-child { border-right: none; }

/* Colored left stripe on first cell */
.list-row td:first-child {
  position: relative;
  padding-left: 14px;
}

/* ── ELEMENT (name) ── */

.cell-name {
  display: flex;
  align-items: center;
  gap: 9px;
}

.cell-name-dot {
  width: 9px;
  height: 9px;
  border-radius: 2.5px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.cell-name-text {
  font-weight: 500;
  cursor: pointer;
  transition: color var(--duration-sm) ease;
  letter-spacing: -0.1px;
}

.cell-name-text:hover { color: var(--blue); }

/* ── PERSONA ── */

.cell-persona {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  align-items: center;
}

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform var(--duration-sm) var(--ease-spring), opacity var(--duration-sm) ease;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.14);
}

.avatar:hover { transform: scale(1.15); opacity: 0.9; }

.avatar-add {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px dashed var(--border-cool);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--gray-light);
  cursor: pointer;
  transition: border-color var(--duration-sm) ease, color var(--duration-sm) ease, transform var(--duration-sm) var(--ease-spring);
}

.avatar-add:hover {
  border-color: var(--blue);
  color: var(--blue);
  transform: scale(1.1);
}

/* ── STATUS BADGE ── */

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 11px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--duration-xs) var(--ease-spring), opacity var(--duration-sm) ease, box-shadow var(--duration-sm) ease;
}

.status-badge:hover { transform: scale(0.97); opacity: 0.85; }
.status-badge:active { transform: scale(0.93); }

.status-da-fare {
  background: rgba(220,38,38,0.12);
  color: #a81c1c;
  border: 1px solid rgba(220,38,38,0.25);
}

.status-in-svolgimento {
  background: rgba(234,179,8,0.16);
  color: #8a6800;
  border: 1px solid rgba(234,179,8,0.35);
}

.status-fatto {
  background: rgba(34,197,94,0.15);
  color: #166534;
  border: 1px solid rgba(34,197,94,0.28);
}

.status-ritiro {
  background: rgba(107,114,128,0.14);
  color: #4b5563;
  border: 1px solid rgba(107,114,128,0.25);
}

/* ── DATE ── */

.cell-date {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ── TIMELINE ── */

.timeline-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timeline-bar {
  height: 7px;
  border-radius: 4px;
  min-width: 6px;
  max-width: 100%;
  background: var(--blue);
  position: relative;
  overflow: hidden;
}

.timeline-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0.25) 0%, transparent 60%);
}

.timeline-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-light);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ── NOTE ── */

.cell-note {
  font-size: 12px;
  color: var(--gray);
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--duration-sm) ease;
}

.cell-note:hover { color: var(--blue); }

.cell-note-empty {
  color: var(--gray-light);
  font-style: italic;
  font-size: 12px;
}

/* ── ROW ACTIONS ── */

.row-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity var(--duration-sm) ease;
}

.list-row:hover .row-actions { opacity: 1; }

.row-action-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-light);
  border-radius: 6px;
  transition: color var(--duration-sm) ease, background var(--duration-sm) ease, transform var(--duration-xs) var(--ease-spring);
  cursor: pointer;
}

.row-action-btn:hover {
  color: var(--blue);
  background: rgba(42,109,144,0.10);
  transform: scale(1.1);
}

.row-action-btn.delete:hover {
  color: #9b2424;
  background: rgba(220,38,38,0.09);
}

.row-action-btn svg { width: 14px; height: 14px; }

/* ── ADD ROW ── */

.list-add-row td {
  padding: 7px 12px;
  border-bottom: none;
}

.list-add-row button {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--gray-light);
  font-size: 13px;
  font-weight: 500;
  transition: color var(--duration-sm) ease;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font);
}

.list-add-row button:hover { color: var(--blue); }

.list-add-row button svg { width: 14px; height: 14px; }

/* ── EMPTY STATE ── */

.list-empty {
  padding: 72px 20px;
  text-align: center;
}

.list-empty-icon {
  width: 56px;
  height: 56px;
  background: rgba(42,109,144,0.08);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.list-empty-icon svg { width: 28px; height: 28px; color: var(--blue); opacity: 0.6; }

.list-empty h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}

.list-empty p {
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 20px;
  max-width: 300px;
  margin-inline: auto;
  line-height: 1.6;
}

/* ── INLINE EDITING ── */

.cell-editable { cursor: text; }

.cell-editable input,
.cell-editable textarea {
  width: 100%;
  padding: 3px 6px;
  border: 1.5px solid var(--blue);
  border-radius: 5px;
  background: #fff;
  font-size: 13px;
  color: var(--black);
  outline: none;
  resize: vertical;
  font-family: var(--font);
  box-shadow: 0 0 0 3px rgba(42,109,144,0.10);
}
