.todo-page {
  display: grid;
  gap: 18px;
}

.todo-hero {
  position: relative;
  padding: 24px 26px;
  border: 1px solid rgba(251, 191, 36, 0.16);
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(251, 191, 36, 0.14), transparent 34%),
    linear-gradient(145deg, rgba(24, 33, 49, 0.98), rgba(12, 20, 33, 0.98));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.todo-hero::after {
  content: "";
  position: absolute;
  left: -60px;
  bottom: -90px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.12), transparent 72%);
  pointer-events: none;
}

.todo-hero .page-head-copy {
  max-width: 700px;
}

.todo-hero .page-head-copy h1 {
  font-size: clamp(34px, 4vw, 52px);
  letter-spacing: -0.05em;
}

.todo-hero .page-head-copy p {
  max-width: 56ch;
  color: var(--muted-strong);
  line-height: 1.65;
}

.todo-hero-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.todo-stat {
  display: grid;
  gap: 4px;
  min-height: 104px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.todo-stat strong {
  color: #fff;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.todo-stat span {
  color: var(--muted-strong);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.todo-stat.is-warning {
  border-color: rgba(245, 158, 11, 0.22);
}

.todo-stat.is-danger {
  border-color: rgba(239, 68, 68, 0.22);
}

.todo-stat.is-success {
  border-color: rgba(16, 185, 129, 0.22);
}

.todo-stat.is-review {
  border-color: rgba(245, 158, 11, 0.36);
}

.todo-flash {
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(24, 33, 49, 0.96));
}

.topbar-alert-todo {
  border-color: rgba(239, 68, 68, 0.24);
  background: rgba(239, 68, 68, 0.14);
  color: #ffe2e2;
}

.topbar-alert-todo:hover {
  background: rgba(239, 68, 68, 0.2);
}

.topbar-alert-dot-todo,
.operator-todo-alert-dot {
  background: #ef4444;
  box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.14);
}

.nav-badge-todo,
.operator-todo-badge {
  background: rgba(239, 68, 68, 0.22);
  color: #ffe2e2;
}

.operator-todo-alert {
  border-color: rgba(239, 68, 68, 0.24);
  background: rgba(239, 68, 68, 0.14);
  color: #ffe2e2;
}

.operator-todo-alert:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fff;
}

.todo-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.todo-layout.is-readonly {
  grid-template-columns: minmax(0, 1fr);
}

.todo-composer,
.todo-board {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
}

.todo-composer {
  border: 1px solid rgba(251, 191, 36, 0.14);
  background:
    linear-gradient(180deg, rgba(245, 158, 11, 0.07), rgba(245, 158, 11, 0.02) 120px, transparent 120px),
    linear-gradient(180deg, rgba(20, 30, 47, 0.98), rgba(12, 20, 33, 0.98));
}

.todo-board {
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(180deg, rgba(148, 163, 184, 0.05), transparent 180px),
    linear-gradient(180deg, rgba(18, 28, 46, 0.98), rgba(11, 20, 34, 0.98));
}

.todo-panel-head {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.todo-panel-head h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.05;
}

.todo-panel-head p {
  margin: 0;
  color: var(--muted-strong);
  line-height: 1.6;
}

.todo-composer .stack-form,
.todo-board .stack-form {
  gap: 16px;
}

.todo-board-caption {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.todo-board .compact-filters {
  margin-bottom: 20px;
}

.todo-form-label label {
  margin-bottom: 8px;
  color: var(--muted-strong);
  letter-spacing: 0.08em;
}

.todo-composer input,
.todo-composer select,
.todo-composer textarea,
.todo-board input,
.todo-board select,
.todo-board textarea {
  border-color: rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(7, 13, 24, 0.46);
}

.todo-composer textarea,
.todo-note-form textarea {
  resize: vertical;
}

.todo-card {
  position: relative;
  gap: 16px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(23, 35, 57, 0.98), rgba(14, 23, 39, 0.98));
  overflow: hidden;
}

.todo-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.88), rgba(251, 191, 36, 0.24));
}

.todo-card.is-in_corso::before {
  background: linear-gradient(180deg, rgba(124, 225, 255, 0.9), rgba(165, 243, 252, 0.26));
}

.todo-card.is-bloccato::before {
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.9), rgba(252, 165, 165, 0.3));
}

.todo-card.is-completato::before {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.88), rgba(110, 231, 183, 0.26));
}

.todo-card-shell {
  display: grid;
  gap: 16px;
  padding: 20px 20px 20px 24px;
}

.todo-card-head {
  align-items: flex-start;
}

.todo-title-wrap {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.todo-card h3 {
  margin: 0;
  color: #fff;
  font-size: 24px;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.todo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.todo-dates {
  display: grid;
  gap: 8px;
  text-align: right;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.todo-description {
  margin: 0;
  color: #e2e8f0;
  line-height: 1.7;
}

.todo-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.todo-facts span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-strong);
  font-size: 13px;
}

.todo-facts strong {
  color: #fff;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.todo-card-actions {
  display: grid;
  gap: 14px;
  padding-top: 2px;
}

.todo-inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.todo-note-form {
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
}

.todo-note-form label {
  margin-bottom: 0;
}

.todo-empty-state {
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.02);
}

@media (max-width: 1200px) {
  .todo-hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .todo-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .todo-card-head,
  .todo-inline-form {
    grid-template-columns: 1fr;
  }

  .todo-dates {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .todo-hero {
    padding: 18px;
  }

  .todo-hero-stats {
    grid-template-columns: 1fr 1fr;
  }

  .todo-composer,
  .todo-board {
    padding: 18px;
  }

  .todo-card h3 {
    font-size: 20px;
  }
}

/* Ticket queue refresh */
.todo-page {
  gap: 14px;
}

.todo-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  padding: 16px 18px;
  border-radius: 8px;
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.72);
  box-shadow: none;
}

.todo-hero::after {
  display: none;
}

.todo-hero .page-head-copy h1 {
  margin: 2px 0 0;
  font-size: 28px;
  letter-spacing: 0;
}

.todo-hero .page-head-copy p {
  display: none;
}

.todo-hero-stats {
  grid-template-columns: repeat(4, minmax(78px, 1fr));
  gap: 8px;
  margin-top: 0;
}

.todo-stat {
  min-height: 62px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.todo-stat strong {
  font-size: 22px;
  letter-spacing: 0;
}

.todo-stat span,
.todo-board-caption,
.todo-form-label label,
.todo-facts strong {
  letter-spacing: 0;
}

.todo-layout {
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.todo-create-fold {
  margin: 0;
}

.todo-create-fold > summary {
  display: none;
}

.todo-board-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.todo-board-actions .btn {
  min-height: 36px;
  padding: 8px 14px;
}

.todo-create-fold[open] {
  margin-bottom: 14px;
}

.todo-create-fold[open] > summary {
  display: flex;
  margin-bottom: 10px;
  color: var(--muted-strong);
  font-weight: 700;
}

.todo-create-fold > summary::after {
  display: none;
}

.todo-composer,
.todo-board,
.todo-note-form,
.todo-empty-state {
  border-radius: 8px;
}

.todo-composer,
.todo-board {
  border-color: rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.74);
}

.todo-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
}

.todo-panel-head h2 {
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0;
}

.todo-panel-head p {
  display: none;
}

.todo-board-caption {
  min-height: 28px;
  border-radius: 999px;
  font-size: 12px;
  text-transform: none;
}

.todo-composer input,
.todo-composer select,
.todo-composer textarea,
.todo-board input,
.todo-board select,
.todo-board textarea {
  border-radius: 8px;
}

.todo-list {
  display: grid;
  gap: 10px;
}

.todo-mobile-cards,
.todo-mobile-closed {
  display: none;
}

.todo-desktop-split {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.todo-ticket-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.todo-ticket-list.is-closed {
  margin-top: 8px;
}

.todo-ticket-row {
  cursor: pointer;
  display: grid;
  gap: 6px;
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  background: rgba(11, 18, 32, 0.64);
  color: var(--text);
  text-align: left;
}

.todo-ticket-row:hover,
.todo-ticket-row.is-active {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(120, 53, 15, 0.18);
}

.todo-ticket-title {
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
}

.todo-ticket-meta {
  color: var(--muted);
  font-size: 12px;
}

.todo-ticket-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.todo-ticket-detail {
  min-width: 0;
}

.todo-detail-panel {
  display: none;
  gap: 14px;
  min-height: 420px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  background: rgba(11, 18, 32, 0.72);
}

.todo-detail-panel.is-active {
  display: grid;
}

.todo-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.todo-detail-head h3 {
  margin: 4px 0 0;
  color: #fff;
  font-size: 22px;
  line-height: 1.2;
}

.todo-detail-id {
  color: var(--muted);
  font-size: 12px;
}

.todo-card {
  border-radius: 8px;
  background: rgba(11, 18, 32, 0.86);
}

.todo-card:hover {
  border-color: rgba(148, 163, 184, 0.28);
}

.todo-card-shell {
  gap: 12px;
  padding: 14px 14px 14px 18px;
}

.todo-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.todo-card h3 {
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}

.todo-dates {
  gap: 4px;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

.todo-description {
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  line-height: 1.5;
}

.todo-claim-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 8px;
  background: rgba(8, 47, 73, 0.28);
}

.todo-claim-link > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-width: 0;
}

.todo-claim-link strong {
  color: #e0f2fe;
  font-size: 14px;
}

.todo-claim-link span {
  color: var(--muted-strong);
  font-size: 13px;
}

.todo-claim-link .btn {
  white-space: nowrap;
}

.todo-facts {
  gap: 8px 14px;
}

.todo-facts strong {
  font-size: 12px;
  text-transform: none;
}

.todo-card-actions {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.todo-update-form {
  max-width: 720px;
}

.todo-card-details {
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  padding-top: 10px;
}

.todo-card-details > summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 700;
  list-style: none;
}

.todo-card-details > summary::-webkit-details-marker {
  display: none;
}

.todo-card-details > summary::after {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  color: #fff;
}

.todo-card-details[open] > summary {
  margin-bottom: 10px;
}

.todo-card-details[open] > summary::after {
  content: "-";
}

.todo-closed-section {
  margin-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  padding-top: 12px;
}

.todo-closed-section > summary {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 800;
  list-style: none;
}

.todo-closed-section > summary::-webkit-details-marker {
  display: none;
}

.todo-closed-section > summary::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  color: #fff;
}

.todo-closed-section[open] > summary {
  margin-bottom: 10px;
}

.todo-closed-section[open] > summary::before {
  content: "-";
}

.todo-closed-section > summary span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: #fff;
  font-size: 12px;
}

.todo-note-form {
  padding: 12px;
}

.priority-badge,
.status-badge {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
}

@media (max-width: 1050px) {
  .todo-hero {
    grid-template-columns: 1fr;
  }

  .todo-layout,
  .todo-card-actions {
    grid-template-columns: 1fr;
  }

  .todo-desktop-split {
    display: none;
  }

  .todo-mobile-cards {
    display: grid;
  }

  .todo-mobile-closed {
    display: block;
  }
}

@media (max-width: 700px) {
  .todo-hero-stats,
  .todo-card-head {
    grid-template-columns: 1fr 1fr;
  }

  .todo-panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .todo-claim-link {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Align todo workspace with Dossiero cards */
.todo-page {
  gap: 16px;
  font-family: inherit;
}

.todo-page input,
.todo-page select,
.todo-page textarea,
.todo-page button {
  font-family: inherit;
}

.todo-layout {
  grid-template-columns: minmax(0, 1fr);
}

.todo-create-fold:not([open]) {
  display: none;
}

.todo-hero,
.todo-board,
.todo-composer,
.todo-detail-panel,
.todo-ticket-row,
.todo-card,
.todo-note-form,
.todo-description,
.todo-claim-link {
  border-color: var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: none;
}

.todo-hero {
  padding: 18px;
  overflow: visible;
}

.todo-hero::after {
  display: none;
}

.todo-hero .page-head-copy h1 {
  font-size: 30px;
  letter-spacing: 0;
}

.todo-hero .page-head-copy p,
.todo-panel-head p,
.todo-description,
.todo-ticket-meta,
.todo-claim-link span {
  font-size: 13px;
}

.todo-stat {
  border: 1px solid var(--line);
  background: var(--card-muted);
  border-radius: var(--radius);
}

.todo-stat strong {
  color: var(--text);
  letter-spacing: 0;
}

.todo-board {
  padding: 18px;
  width: 100%;
}

.todo-panel-head {
  border-bottom: 1px solid var(--line);
}

.todo-panel-head h2,
.todo-detail-head h3,
.todo-card h3 {
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: 0;
}

.todo-desktop-split {
  grid-template-columns: minmax(320px, 390px) minmax(760px, 1fr);
  gap: 18px;
}

.todo-ticket-row {
  position: relative;
  padding: 14px;
  border-left: 5px solid var(--line-strong);
}

.todo-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-muted);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.todo-section-label span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--card);
  color: var(--muted-strong);
}

.todo-section-label.is-review {
  border-color: rgba(245, 158, 11, 0.55);
  background: rgba(245, 158, 11, 0.16);
}

.todo-ticket-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

.todo-ticket-row:hover,
.todo-ticket-row.is-active {
  border-color: var(--line-strong);
  background: var(--card-muted);
}

.todo-ticket-row.is-active {
  outline: 2px solid rgba(59, 130, 246, 0.26);
  outline-offset: -2px;
}

.todo-ticket-row.is-aperto,
.todo-detail-panel.is-aperto,
.todo-card.is-aperto {
  border-left-color: #38bdf8;
}

.todo-ticket-row.is-in_corso,
.todo-detail-panel.is-in_corso,
.todo-card.is-in_corso {
  border-left-color: #f59e0b;
}

.todo-ticket-row.is-bloccato,
.todo-detail-panel.is-bloccato,
.todo-card.is-bloccato {
  border-left-color: #ef4444;
}

.todo-ticket-row.is-completato,
.todo-detail-panel.is-completato,
.todo-card.is-completato {
  border-left-color: #22c55e;
  opacity: 0.82;
}

.todo-ticket-row.is-review-needed,
.todo-detail-panel.is-review-needed,
.todo-card.is-review-needed {
  border-left-color: #f59e0b;
  opacity: 1;
}

.todo-seen-form {
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(245, 158, 11, 0.42);
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.14);
}

.todo-ticket-title,
.todo-detail-head h3,
.todo-card h3 {
  color: var(--text);
}

.todo-detail-panel {
  min-height: 620px;
  padding: 18px;
  border-left: 5px solid var(--line-strong);
}

.todo-detail-head,
.todo-card-details,
.todo-closed-section {
  border-color: var(--line);
}

.todo-claim-link {
  border-color: rgba(56, 189, 248, 0.36);
  background: rgba(14, 116, 144, 0.16);
}

.todo-claim-link strong {
  color: var(--text);
}

.todo-description {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.36);
  color: var(--text);
}

.todo-card::before {
  display: none;
}

.todo-card.is-in_corso::before,
.todo-card.is-bloccato::before,
.todo-card.is-completato::before {
  display: none;
}

.todo-card-shell {
  padding: 16px 16px 16px 20px;
}

.todo-update-form,
.todo-note-form {
  width: 100%;
  max-width: none;
  border-color: rgba(59, 130, 246, 0.22);
  background: rgba(30, 41, 59, 0.78);
}

.todo-update-form textarea,
.todo-note-form textarea {
  width: 100%;
  min-height: 240px;
  resize: vertical;
}

.todo-update-form select,
.todo-update-form textarea,
.todo-composer input,
.todo-composer select,
.todo-composer textarea,
.todo-board input,
.todo-board select,
.todo-board textarea {
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  border-radius: 10px;
}

.todo-update-form label,
.todo-form-label label {
  color: var(--muted-strong);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

.todo-facts {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-muted);
}

.todo-facts span {
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.34);
}

.todo-meta {
  gap: 6px;
}

.todo-page span.priority-badge,
.todo-page span.status-badge {
  border: 1px solid transparent;
  font-weight: 700;
}

.todo-page span.priority-bassa {
  border-color: rgba(34, 197, 94, 0.34);
  background: rgba(34, 197, 94, 0.14);
  color: #bbf7d0;
}

.todo-page span.priority-media {
  border-color: rgba(245, 158, 11, 0.38);
  background: rgba(245, 158, 11, 0.16);
  color: #fde68a;
}

.todo-page span.priority-alta {
  border-color: rgba(239, 68, 68, 0.42);
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
}

.todo-page span.status-aperto {
  border-color: rgba(56, 189, 248, 0.38);
  background: rgba(56, 189, 248, 0.15);
  color: #bae6fd;
}

.todo-page span.status-in_corso {
  border-color: rgba(245, 158, 11, 0.38);
  background: rgba(245, 158, 11, 0.16);
  color: #fde68a;
}

.todo-page span.status-bloccato {
  border-color: rgba(239, 68, 68, 0.42);
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
}

.todo-page span.status-completato {
  border-color: rgba(34, 197, 94, 0.38);
  background: rgba(34, 197, 94, 0.16);
  color: #bbf7d0;
}

.todo-board-caption,
.todo-dates,
.todo-facts strong,
.todo-detail-id,
.priority-badge,
.status-badge {
  font-size: 12px;
  letter-spacing: 0;
}

@media (max-width: 1300px) {
  .todo-desktop-split {
    grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  }
}

/* Light theme contrast overrides for todo surfaces. */
body.theme-light .todo-hero,
body.theme-light .todo-board,
body.theme-light .todo-composer,
body.theme-light .todo-detail-panel,
body.theme-light .todo-ticket-row,
body.theme-light .todo-card,
body.theme-light .todo-note-form,
body.theme-light .todo-description,
body.theme-light .todo-claim-link,
body.theme-light .todo-update-form {
  border-color: var(--line);
  background: var(--card);
  color: var(--text);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

body.theme-light .todo-ticket-row:hover,
body.theme-light .todo-ticket-row.is-active {
  background: var(--card-muted);
}

body.theme-light .todo-section-label {
  border-color: var(--line);
  background: var(--card-muted);
  color: var(--text);
}

body.theme-light .todo-section-label.is-review {
  border-color: rgba(180, 83, 9, 0.42);
  background: #fef3c7;
  color: #854d0e;
}

body.theme-light .todo-section-label span {
  background: #ffffff;
  color: var(--text);
}

body.theme-light .todo-seen-form {
  border-color: rgba(180, 83, 9, 0.42);
  background: #fef3c7;
}

body.theme-light .todo-description,
body.theme-light .todo-facts,
body.theme-light .todo-facts span {
  border-color: var(--line);
  background: var(--card-muted);
  color: var(--text);
}

body.theme-light .todo-update-form,
body.theme-light .todo-note-form {
  border-color: var(--line-strong);
  background: var(--card-muted);
}

body.theme-light .todo-update-form select,
body.theme-light .todo-update-form textarea,
body.theme-light .todo-composer input,
body.theme-light .todo-composer select,
body.theme-light .todo-composer textarea,
body.theme-light .todo-board input,
body.theme-light .todo-board select,
body.theme-light .todo-board textarea {
  border-color: var(--line-strong);
  background: #ffffff;
  color: var(--text);
}

body.theme-light .todo-page span.priority-bassa {
  border-color: rgba(21, 128, 61, 0.42);
  background: #dcfce7;
  color: #166534;
}

body.theme-light .todo-page span.priority-media,
body.theme-light .todo-page span.status-in_corso {
  border-color: rgba(180, 83, 9, 0.42);
  background: #fef3c7;
  color: #854d0e;
}

body.theme-light .todo-page span.priority-alta,
body.theme-light .todo-page span.status-bloccato {
  border-color: rgba(185, 28, 28, 0.42);
  background: #fee2e2;
  color: #991b1b;
}

body.theme-light .todo-page span.status-aperto {
  border-color: rgba(3, 105, 161, 0.42);
  background: #e0f2fe;
  color: #075985;
}

body.theme-light .todo-page span.status-completato {
  border-color: rgba(21, 128, 61, 0.42);
  background: #dcfce7;
  color: #166534;
}

body.theme-light .briefing-page {
  color: var(--text);
}

body.theme-light .briefing-hero,
body.theme-light .briefing-sidebar-card,
body.theme-light .briefing-focus,
body.theme-light .briefing-agenda,
body.theme-light .briefing-empty,
body.theme-light .briefing-lane,
body.theme-light .briefing-agenda-column,
body.theme-light .briefing-column-head,
body.theme-light .briefing-pool-item,
body.theme-light .briefing-item,
body.theme-light .briefing-mini-stat {
  border-color: var(--line);
  background: var(--card);
  color: var(--text);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

body.theme-light .briefing-hero-copy .eyebrow,
body.theme-light .briefing-hero-copy p,
body.theme-light .briefing-hero .todo-stat span,
body.theme-light .briefing-focus-head p,
body.theme-light .briefing-mini-stat span,
body.theme-light .briefing-list-item small,
body.theme-light .briefing-lane-head p,
body.theme-light .briefing-pool-item span,
body.theme-light .briefing-pool-item small,
body.theme-light .briefing-item-head p,
body.theme-light .briefing-item-body,
body.theme-light .briefing-archive-form,
body.theme-light .briefing-checkbox,
body.theme-light .briefing-page .eyebrow,
body.theme-light .briefing-page .todo-form-label label,
body.theme-light .briefing-page .todo-board-caption,
body.theme-light .briefing-page .briefing-checkbox span {
  color: var(--text-muted);
}

body.theme-light .briefing-page h1,
body.theme-light .briefing-page h2,
body.theme-light .briefing-page h3,
body.theme-light .briefing-page strong,
body.theme-light .briefing-hero .todo-stat strong,
body.theme-light .briefing-item-type,
body.theme-light .briefing-list-item {
  color: var(--text);
}

body.theme-light .briefing-hero,
body.theme-light .briefing-sidebar-actions,
body.theme-light .briefing-focus,
body.theme-light .briefing-lane {
  background: var(--card);
}

body.theme-light .briefing-list-item {
  border-color: var(--line);
  background: var(--card-muted);
}

body.theme-light .briefing-list-item:hover,
body.theme-light .briefing-list-item.is-active,
body.theme-light .briefing-pool-link:hover,
body.theme-light .briefing-pool-link:focus-visible {
  border-color: var(--line-strong);
  background: var(--card-muted);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

body.theme-light .briefing-column-head span {
  background: #f3f4f6;
  color: var(--text);
}

body.theme-light .briefing-item-type {
  border-color: var(--line);
  background: #eef2ff;
}

body.theme-light .briefing-page input,
body.theme-light .briefing-page select,
body.theme-light .briefing-page textarea {
  border-color: var(--line-strong);
  background: #ffffff;
  color: var(--text);
}

.briefing-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #e6edf7;
}

.briefing-checkbox input {
  width: 18px;
  height: 18px;
}

.briefing-note-sidecard {
  margin-top: 18px;
}

.briefing-note-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.briefing-note-pill {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(251, 191, 36, 0.14);
  border-radius: 14px;
  background: rgba(245, 158, 11, 0.06);
}

.briefing-page {
  display: grid;
  gap: 22px;
  color: #eef4fb;
}

.briefing-page .eyebrow,
.briefing-page .todo-form-label label,
.briefing-page .todo-board-caption,
.briefing-page .briefing-checkbox span {
  color: #e6edf7;
}

.briefing-page h1,
.briefing-page h2,
.briefing-page h3,
.briefing-page strong {
  color: #ffffff;
}

.briefing-shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.briefing-hero {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(0, 1.8fr);
  gap: 20px;
  padding: 22px 24px;
  border: 1px solid rgba(125, 211, 252, 0.22);
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(125, 211, 252, 0.26), transparent 30%),
    linear-gradient(135deg, #12304f 0%, #184d77 48%, #0f2740 100%);
  box-shadow: var(--shadow);
}

.briefing-hero-copy {
  display: grid;
  gap: 8px;
  align-content: start;
}

.briefing-hero-copy h1,
.briefing-hero-copy p {
  margin: 0;
}

.briefing-hero-copy .eyebrow {
  color: #f8fbff;
  letter-spacing: 0.14em;
}

.briefing-hero-copy h1 {
  color: #ffffff;
  font-size: clamp(30px, 3vw, 42px);
  letter-spacing: -0.05em;
}

.briefing-hero-copy p {
  max-width: 48ch;
  color: #f2f7ff;
  font-size: 15px;
  line-height: 1.65;
}

.briefing-hero-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
}

.briefing-hero .todo-stat {
  min-height: 88px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
}

.briefing-hero .todo-stat strong {
  color: #ffffff;
  font-size: 31px;
  letter-spacing: -0.04em;
}

.briefing-hero .todo-stat span {
  color: #f2f7ff;
  font-size: 11px;
  letter-spacing: 0.12em;
}

.briefing-sidebar {
  display: grid;
  gap: 20px;
  position: sticky;
  top: 18px;
}

.briefing-sidebar-card {
  padding: 20px;
  border-radius: 20px;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 34px rgba(3, 8, 18, 0.22);
}

.briefing-sidebar-actions {
  background:
    linear-gradient(180deg, rgba(14, 165, 233, 0.12), rgba(11, 20, 34, 0.96) 110px),
    linear-gradient(180deg, rgba(18, 28, 46, 0.98), rgba(11, 20, 34, 0.98));
}

.briefing-sidebar-archive {
  max-height: calc(100vh - 210px);
  overflow: auto;
}

.briefing-focus,
.briefing-agenda,
.briefing-pool,
.briefing-empty {
  padding: 22px;
  border-radius: 22px;
}

.briefing-focus-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
  margin-bottom: 18px;
}

.briefing-focus-head h2,
.briefing-focus-head p {
  margin: 0;
}

.briefing-focus-head p,
.briefing-card-copy,
.briefing-pool-head p {
  color: #dfe7f2;
}

.briefing-focus-head h2 {
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.briefing-focus-head p {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.55;
}

.briefing-focus {
  background:
    linear-gradient(180deg, rgba(14, 165, 233, 0.08), rgba(12, 20, 33, 0.98) 90px),
    linear-gradient(180deg, rgba(18, 28, 46, 0.98), rgba(11, 20, 34, 0.98));
}

.briefing-focus-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(92px, 1fr));
  gap: 10px;
}

.briefing-mini-stat {
  display: grid;
  gap: 4px;
  padding: 14px 14px;
  border: 1px solid rgba(125, 211, 252, 0.12);
  border-radius: 14px;
  background: rgba(5, 10, 18, 0.34);
  text-align: center;
}

.briefing-mini-stat strong {
  color: #fff;
  font-size: 24px;
  line-height: 1;
}

.briefing-mini-stat span {
  color: #e6edf7;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.briefing-notes-form {
  max-width: 820px;
}

.briefing-actions {
  display: grid;
  gap: 12px;
}

.briefing-actions form,
.briefing-actions .btn {
  width: 100%;
}

.briefing-actions .btn {
  min-height: 46px;
  justify-content: center;
  font-weight: 700;
}

.briefing-list {
  display: grid;
  gap: 10px;
}

.briefing-list-item {
  display: grid;
  gap: 5px;
  padding: 14px 15px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(7, 13, 24, 0.54);
  color: inherit;
  text-decoration: none;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.briefing-list-item:hover {
  transform: translateY(-1px);
  border-color: rgba(125, 211, 252, 0.18);
  background: rgba(12, 20, 33, 0.82);
}

.briefing-list-item.is-active {
  border-color: rgba(14, 165, 233, 0.46);
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.16), rgba(10, 20, 34, 0.86));
  box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.1);
}

.briefing-list-item small {
  color: #dde6f1;
  font-size: 12px;
  line-height: 1.45;
}

.briefing-main,
.briefing-items {
  display: grid;
  gap: 20px;
}

.briefing-board-lanes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.briefing-lane {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  margin: 0;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(10, 16, 28, 0.96)),
    linear-gradient(180deg, rgba(18, 28, 46, 0.98), rgba(11, 20, 34, 0.98));
  box-shadow: 0 16px 34px rgba(3, 8, 18, 0.2);
}

.briefing-lane-head {
  display: grid;
  gap: 6px;
  min-height: 104px;
  margin-bottom: 14px;
  padding: 4px 2px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  align-content: start;
}

.briefing-lane-head h2,
.briefing-lane-head p {
  margin: 0;
}

.briefing-lane-head h2 {
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.briefing-lane-head p {
  color: #dfe7f2;
  font-size: 14px;
  line-height: 1.6;
}

.briefing-lane-list,
.briefing-agenda-board {
  display: grid;
  gap: 14px;
}

.briefing-composer .briefing-lane-list,
.briefing-lane-list {
  flex: 1;
  align-content: start;
}

.briefing-composer .stack-form,
.briefing-lane-form {
  display: grid;
  gap: 16px;
}

.briefing-lane-form {
  min-height: 100%;
  align-content: start;
}

.briefing-agenda-board {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.briefing-agenda-column {
  display: grid;
  gap: 14px;
  align-content: start;
  min-height: 100%;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: rgba(4, 8, 15, 0.42);
}

.briefing-agenda-column.is-open {
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.08);
}

.briefing-agenda-column.is-done {
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.08);
}

.briefing-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
}

.briefing-column-head h3 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.briefing-column-head span {
  display: inline-flex;
  min-width: 34px;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.16);
  color: #ffe7b8;
  font-size: 12px;
  font-weight: 700;
}

.briefing-pool-item {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 98px;
  padding: 14px 15px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.briefing-pool-item strong {
  color: #f3f8ff;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.briefing-pool-item span,
.briefing-pool-item small {
  color: #e6edf7;
  line-height: 1.55;
}

.briefing-pool-item span {
  font-size: 14px;
}

.briefing-pool-item small {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.briefing-pool-link {
  color: inherit;
  text-decoration: none;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.briefing-pool-link:hover,
.briefing-pool-link:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(125, 211, 252, 0.32);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 12px 24px rgba(2, 6, 16, 0.22);
  outline: none;
}

.briefing-item {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.briefing-item.is-done {
  border-color: rgba(16, 185, 129, 0.28);
  background: rgba(255, 255, 255, 0.03);
}

.briefing-item-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.briefing-item-head h3,
.briefing-item-head p {
  margin: 0;
}

.briefing-item-head h3 {
  font-size: 21px;
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.briefing-item-head p,
.briefing-item-body,
.briefing-archive-form {
  color: #e3ebf5;
}

.briefing-item-head p {
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.55;
}

.briefing-item-body {
  font-size: 15px;
  line-height: 1.7;
}

.briefing-item-type {
  display: inline-flex;
  margin-bottom: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.22);
  background: rgba(255, 255, 255, 0.04);
  color: #e6f4ff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.briefing-item-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.briefing-item-links .btn {
  min-height: 40px;
  padding-inline: 14px;
  font-weight: 700;
}

.briefing-item-form {
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.briefing-item-actions,
.briefing-agenda-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.briefing-item-actions .btn {
  min-height: 42px;
  padding-inline: 16px;
  font-weight: 700;
}

.briefing-archive-form {
  margin-top: -2px;
  padding-top: 2px;
}

.briefing-item .btn.secondary,
.briefing-lane .btn.secondary {
  border-color: rgba(255, 255, 255, 0.14);
}

@media (max-width: 1100px) {
  .briefing-shell,
  .briefing-board-lanes,
  .briefing-agenda-board {
    grid-template-columns: minmax(0, 1fr);
  }

  .briefing-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .briefing-hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .briefing-sidebar {
    position: static;
  }
}

@media (max-width: 760px) {
  .briefing-focus-head,
  .briefing-item-head {
    flex-direction: column;
  }

  .briefing-focus-meta {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* === Riscrivi con AI (note briefing) === */
.briefing-notes-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* Il tasto AI si distingue da "Salva": e' un'azione diversa, viola come Pepper. */
.btn.ai {
  background: #7c5cff;
  color: #fff;
  border: 0;
}

.btn.ai:hover {
  filter: brightness(1.08);
}

.btn.ai[disabled] {
  opacity: .6;
  cursor: default;
}

.briefing-rewrite-msg {
  flex-basis: 100%;
  margin: 6px 0 0;
}

.briefing-rewrite-msg.is-ok {
  color: #3fbe79;
}
