:root {
  --bg: #eaf5fb;
  --bg-soft: #f6fbff;
  --surface: #ffffff;
  --surface-2: #eef6fc;
  --ink: #091936;
  --muted: #607089;
  --line: #d7e3ef;
  --navy: #0b2346;
  --navy-2: #071733;
  --blue: #1767f2;
  --blue-soft: #e7f0ff;
  --red: #e30613;
  --accent: #fe048b;
  --teal: #0b7f86;
  --orange: #ef6c00;
  --purple: #7b2fb0;
  --green: #14884a;
  --warning: #a96900;
  --danger: #c0182a;
  --shadow: 0 22px 60px rgba(7, 23, 51, 0.11);
  --shadow-soft: 0 12px 34px rgba(7, 23, 51, 0.08);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --max: 1420px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(23, 103, 242, 0.11), transparent 30rem),
    radial-gradient(circle at 93% 10%, rgba(254, 4, 139, 0.08), transparent 24rem),
    linear-gradient(180deg, #f7fcff 0%, var(--bg) 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: .45;
}

.site-shell {
  width: min(100%, 1480px);
  margin: 0 auto;
}

.hero,
.dashboard-slide,
.org-section,
.checklist-section,
.rule-card {
  border: 1px solid rgba(215, 227, 239, .95);
  background: rgba(255, 255, 255, .9);
  box-shadow: var(--shadow-soft);
}

.hero {
  position: relative;
  overflow: hidden;
  margin: 18px;
  padding: 28px;
  border-radius: var(--radius-lg);
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255,255,255,.98), rgba(236,247,255,.94)),
    linear-gradient(90deg, rgba(23, 103, 242, .16), rgba(254, 4, 139, .10));
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.hero::before {
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0 70%, rgba(254, 4, 139, 0.09) 70% 78%, transparent 78%),
    radial-gradient(circle at 86% 20%, rgba(23, 103, 242, 0.13), transparent 14rem),
    radial-gradient(circle at 8% 10%, rgba(227, 6, 19, 0.06), transparent 12rem);
}

.hero::after {
  top: 0;
  left: 0;
  width: 190px;
  height: 130px;
  background:
    linear-gradient(90deg, var(--red) 0 26px, transparent 26px 52px, rgba(7, 23, 51, .17) 52px 78px, transparent 78px),
    linear-gradient(#071733 0 21px, transparent 21px 42px, rgba(227,6,19,.15) 42px 63px, transparent 63px);
  opacity: .07;
}

.topbar,
.hero-grid {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  max-width: var(--max);
  margin: 0 auto;
}

.brand-block {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  color: var(--ink);
  text-decoration: none;
}

.brand-block img {
  width: 300px;
  max-width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 10px 22px rgba(7, 23, 51, .10));
}

.brand-block span {
  margin-left: 4px;
  color: rgba(9, 25, 54, .52);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .28em;
  line-height: 1.25;
  text-transform: uppercase;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.primary-btn,
.ghost-btn,
.slide-controls button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 900;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--red));
  box-shadow: 0 14px 28px rgba(254, 4, 139, .20);
}

.ghost-btn {
  color: var(--navy);
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(9, 25, 54, .14);
}

.toolbar .ghost-btn {
  color: var(--navy);
  background: #fff;
  border-color: var(--line);
}

.ghost-btn.danger {
  color: var(--danger);
}

.primary-btn:hover,
.ghost-btn:hover,
.slide-controls button:hover {
  transform: translateY(-1px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr);
  gap: 34px;
  align-items: end;
  max-width: var(--max);
  margin: 92px auto 28px;
}

.eyebrow,
.section-kicker,
.stat-label,
.mission-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .78rem;
  font-weight: 950;
}

.hero h1 {
  max-width: 900px;
  margin: 14px 0 18px;
  font-size: clamp(2.7rem, 6vw, 5.8rem);
  line-height: .92;
  letter-spacing: -0.07em;
  color: var(--ink);
}

.hero h1 span {
  color: var(--blue);
}

.hero-text {
  max-width: 870px;
  margin: 0;
  color: rgba(9, 25, 54, .72);
  font-size: clamp(1.02rem, 1.55vw, 1.28rem);
  line-height: 1.62;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.hero-tags span {
  padding: 9px 14px;
  border: 1px solid rgba(9,25,54,.13);
  border-radius: 999px;
  color: var(--navy);
  background: rgba(255,255,255,.72);
  font-size: .88rem;
  font-weight: 900;
}

.mission-card {
  position: relative;
  padding: 28px;
  min-height: 250px;
  border: 1px solid rgba(9, 25, 54, .12);
  border-radius: 26px;
  background: rgba(255,255,255,.58);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85);
  backdrop-filter: blur(16px);
}

.status-dot {
  position: absolute;
  top: 26px;
  right: 26px;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: #25d97f;
  box-shadow: 0 0 0 9px rgba(37, 217, 127, .13);
}

.mission-card h2 {
  margin: 42px 0 12px;
  font-size: clamp(1.8rem, 3vw, 2.25rem);
  line-height: 1;
  color: var(--ink);
  letter-spacing: -.04em;
}

.mission-card p:last-child {
  margin: 0;
  color: rgba(9,25,54,.66);
  line-height: 1.55;
  font-weight: 650;
}

main {
  width: min(calc(100% - 36px), var(--max));
  margin: 0 auto 28px;
}

.dashboard-slide,
.org-section,
.checklist-section,
.rule-card {
  margin-top: 18px;
  padding: 26px;
  border-radius: var(--radius-lg);
}

.stats-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.stat-card,
.progress-card,
.org-main,
.org-card,
.stream-card {
  border: 1px solid rgba(215, 227, 239, .95);
  background: #fff;
  box-shadow: 0 14px 30px rgba(7, 23, 51, .06);
}

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border-radius: 22px;
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -20px;
  bottom: -24px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: rgba(23,103,242,.07);
}

.stat-label {
  color: #607089;
  letter-spacing: .14em;
}

.stat-card strong {
  display: block;
  margin: 10px 0 4px;
  font-size: clamp(2.05rem, 4vw, 3.55rem);
  line-height: .95;
  color: var(--blue);
  letter-spacing: -.065em;
}

.stat-card:nth-child(2) strong { color: #19b76c; }
.stat-card:nth-child(3) strong { color: var(--orange); }
.stat-card:nth-child(4) strong { color: var(--purple); }

.stat-card small {
  color: var(--muted);
  font-weight: 780;
}

.progress-card {
  margin-top: 18px;
  padding: 24px;
  border-radius: 24px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 22px;
}

.section-heading.compact {
  margin-bottom: 14px;
}

.section-kicker {
  color: var(--blue);
}

.section-heading h2,
.rule-card h2 {
  margin: 6px 0 0;
  font-size: clamp(1.55rem, 3vw, 2.4rem);
  letter-spacing: -0.045em;
  color: var(--ink);
}

.section-heading p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-weight: 620;
}

#progressText {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--blue);
  background: var(--blue-soft);
  font-weight: 950;
}

.progress-track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe8f4;
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--accent));
  transition: width .35s ease;
}

.last-update {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: .92rem;
  font-weight: 750;
}

.org-flow {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 8px 0 0;
}

.org-main {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: min(100%, 380px);
  padding: 20px;
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(135deg, var(--navy-2), var(--navy));
}

.org-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  color: #fff;
  background: var(--blue);
  font-weight: 950;
}

.org-main .org-icon {
  background: rgba(255,255,255,.13);
}

.org-main small,
.org-card small,
.stream-card small {
  color: var(--muted);
  line-height: 1.45;
}

.org-main small {
  color: rgba(255,255,255,.68);
}

.org-connectors {
  width: 2px;
  height: 22px;
  background: var(--line);
}

.org-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 16px;
  width: min(100%, 780px);
}

.org-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 20px;
}

.mp-card { border-left: 7px solid var(--red); }
.director-card { border-left: 7px solid var(--blue); }
.territorial-card {
  width: min(100%, 560px);
  border-left: 7px solid var(--teal);
}

.workstreams {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  margin-top: 12px;
}

.stream-card {
  min-height: 235px;
  overflow: hidden;
  border-radius: 20px;
}

.stream-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 12px;
  color: #fff;
  background: var(--stream-color, var(--navy));
}

.stream-head span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: rgba(255,255,255,.16);
}

.stream-head strong {
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: .84rem;
}

.stream-card ul {
  list-style: none;
  padding: 14px;
  margin: 0;
}

.stream-card li {
  display: flex;
  align-items: start;
  gap: 8px;
  padding: 10px 0;
  color: var(--ink);
  border-bottom: 1px solid #edf3f8;
  font-size: .9rem;
  line-height: 1.35;
  font-weight: 650;
}

.stream-card li:last-child { border-bottom: 0; }

.stream-card li::before {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-top: 7px;
  border-radius: 999px;
  background: var(--stream-color, var(--navy));
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1.2fr) minmax(190px, .7fr) minmax(170px, .55fr) auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface-2);
}

.toolbar label {
  display: grid;
  gap: 6px;
  color: var(--navy);
  font-size: .78rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .09em;
}

.toolbar input,
.toolbar select,
.date-input,
.note-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.toolbar input,
.toolbar select {
  min-height: 44px;
  padding: 0 12px;
}

.toolbar input:focus,
.toolbar select:focus,
.date-input:focus,
.note-input:focus {
  border-color: rgba(23,103,242,.62);
  box-shadow: 0 0 0 4px rgba(23,103,242,.10);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1040px;
}

caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 14px 12px;
  color: #fff;
  background: var(--navy);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .72rem;
}

tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

tbody tr:nth-child(even):not(.group-row) td {
  background: #f8fbff;
}

.group-row td {
  padding: 13px 14px;
  color: #fff;
  background: var(--navy-2);
  border-bottom: 0;
  font-size: .86rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.number-cell {
  color: var(--navy);
  font-weight: 950;
  text-align: center;
}

.task-title {
  display: block;
  max-width: 470px;
  line-height: 1.45;
  font-weight: 820;
}

.responsible {
  display: block;
  min-width: 170px;
  color: #26364d;
  line-height: 1.4;
  font-weight: 760;
}

.check-cell { text-align: center; }

.check-cell input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.date-input {
  min-width: 150px;
  padding: 10px;
}

.note-input {
  min-width: 220px;
  min-height: 40px;
  padding: 10px;
  resize: vertical;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 104px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 950;
  white-space: nowrap;
}

.badge.pending {
  color: var(--warning);
  background: #fff4dd;
}

.badge.done {
  color: var(--green);
  background: #e7f7ee;
}

.badge.no {
  color: var(--danger);
  background: #ffe8ec;
}

.badge.overdue {
  color: #fff;
  background: var(--danger);
}

tr.is-done td {
  color: #4b5f7a;
}

tr.is-done .task-title {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(20, 136, 74, .55);
}

.rule-card {
  display: grid;
  align-content: center;
  gap: 18px;
  color: var(--ink);
  line-height: 1.62;
  border-left: 9px solid var(--accent);
}

.rule-card p {
  max-width: 920px;
  margin: 0;
  color: rgba(9,25,54,.72);
  font-size: clamp(1.1rem, 2vw, 1.45rem);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: min(calc(100% - 36px), var(--max));
  margin: 24px auto 40px;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 800;
}

.hidden-row {
  display: none;
}

.slide-controls {
  display: none;
}

/* ===========================
   ESCRITORIO · MODO SLIDE
   =========================== */
@media (min-width: 941px) {
  body.desktop-slide-mode {
    overflow: hidden;
  }

  body.desktop-slide-mode .site-shell {
    width: 100%;
    max-width: none;
    padding: 0;
  }

  body.desktop-slide-mode main {
    width: 100%;
    margin: 0;
  }

  body.desktop-slide-mode .slide-section {
    display: none;
  }

  body.desktop-slide-mode .slide-section.is-active {
    display: block;
  }

  body.desktop-slide-mode .hero,
  body.desktop-slide-mode .dashboard-slide,
  body.desktop-slide-mode .org-section,
  body.desktop-slide-mode .checklist-section,
  body.desktop-slide-mode .rule-card {
    width: min(calc(100vw - 80px), 1480px);
    height: min(calc(100vh - 116px), 830px);
    min-height: 640px;
    margin: 28px auto 0;
    padding: clamp(28px, 3.3vw, 54px);
    border-radius: 30px;
    overflow: auto;
    box-shadow: var(--shadow);
  }

  body.desktop-slide-mode .hero {
    display: none;
  }

  body.desktop-slide-mode .hero.is-active {
    display: block;
  }

  body.desktop-slide-mode .topbar,
  body.desktop-slide-mode .hero-grid,
  body.desktop-slide-mode .section-heading,
  body.desktop-slide-mode .org-flow,
  body.desktop-slide-mode .stats-panel,
  body.desktop-slide-mode .progress-card,
  body.desktop-slide-mode .toolbar,
  body.desktop-slide-mode .table-wrap,
  body.desktop-slide-mode .rule-card > * {
    max-width: 100%;
  }

  body.desktop-slide-mode .topbar {
    align-items: flex-start;
  }

  body.desktop-slide-mode .brand-block img {
    width: clamp(260px, 20vw, 360px);
  }

  body.desktop-slide-mode .hero-grid {
    margin-top: clamp(70px, 12vh, 130px);
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, .65fr);
  }

  body.desktop-slide-mode .hero h1 {
    font-size: clamp(4rem, 6.2vw, 6.9rem);
  }

  body.desktop-slide-mode .hero-text {
    max-width: 960px;
  }

  body.desktop-slide-mode .dashboard-slide {
    display: none;
  }

  body.desktop-slide-mode .dashboard-slide.is-active {
    display: grid;
    align-content: center;
  }

  body.desktop-slide-mode .stats-panel {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin: 28px 0;
  }

  body.desktop-slide-mode .stat-card {
    padding: 28px;
  }

  body.desktop-slide-mode .progress-card {
    padding: 28px;
  }

  body.desktop-slide-mode .org-section.is-active {
    display: grid;
    align-content: center;
  }

  body.desktop-slide-mode .workstreams {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  body.desktop-slide-mode .checklist-section.is-active {
    display: flex;
    flex-direction: column;
  }

  body.desktop-slide-mode .checklist-section .table-wrap {
    flex: 1 1 auto;
    min-height: 0;
  }

  body.desktop-slide-mode .checklist-section table {
    min-width: 1080px;
  }

  body.desktop-slide-mode .rule-card.is-active {
    display: grid;
  }

  body.desktop-slide-mode .slide-controls {
    position: fixed;
    left: 50%;
    bottom: 26px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-width: min(520px, calc(100vw - 48px));
    padding: 12px 18px;
    border: 1px solid rgba(9, 25, 54, .10);
    border-radius: 999px;
    background: rgba(255,255,255,.82);
    box-shadow: 0 18px 50px rgba(7, 23, 51, .14);
    backdrop-filter: blur(14px);
    transform: translateX(-50%);
  }

  .slide-controls button {
    padding: 9px 14px;
    color: var(--navy);
    background: transparent;
    font-size: .92rem;
  }

  .slide-status {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-weight: 950;
  }

  .slide-dots {
    display: inline-flex;
    align-items: center;
    gap: 7px;
  }

  .slide-dot {
    width: 10px;
    height: 10px;
    min-width: 0;
    padding: 0 !important;
    border-radius: 999px !important;
    background: #d4e0ec !important;
  }

  .slide-dot.is-active {
    width: 24px;
    background: var(--blue) !important;
  }

  body.desktop-slide-mode footer {
    display: none;
  }
}

@media (max-width: 1120px) {
  .workstreams {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 940px) {
  .hero {
    margin: 10px;
    padding: 18px;
    border-radius: 24px;
  }

  .topbar,
  .hero-grid,
  .section-heading,
  footer {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    display: grid;
  }

  .top-actions {
    justify-content: stretch;
  }

  .top-actions button {
    flex: 1 1 auto;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    margin-top: 52px;
  }

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

  .org-row,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .workstreams {
    grid-template-columns: 1fr;
  }

  main,
  footer {
    width: min(calc(100% - 20px), var(--max));
  }

  .dashboard-slide,
  .progress-card,
  .org-section,
  .checklist-section,
  .rule-card {
    padding: 18px;
    border-radius: 24px;
  }
}

/* ==========================================================
   MÓVIL PREMIUM · sin desplazamiento horizontal
   ========================================================== */
@media (max-width: 760px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    background:
      radial-gradient(circle at top left, rgba(23,103,242,0.10), transparent 19rem),
      var(--bg);
  }

  .site-shell {
    width: 100%;
    overflow: hidden;
  }

  .hero {
    margin: 8px;
    padding: 16px;
    border-radius: 24px;
  }

  .topbar {
    gap: 14px;
  }

  .brand-block img {
    width: 220px;
    max-width: 100%;
  }

  .brand-block span {
    max-width: 250px;
    font-size: 8.5px;
    letter-spacing: 2px;
    line-height: 1.25;
    color: rgba(9,25,54,.55);
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .top-actions button {
    width: 100%;
    min-height: 44px;
  }

  .hero-grid {
    margin-top: 38px;
    gap: 18px;
  }

  .hero h1 {
    font-size: clamp(2.1rem, 12vw, 3.3rem);
    line-height: .96;
    letter-spacing: -0.055em;
  }

  .hero-text {
    font-size: .98rem;
    line-height: 1.55;
  }

  .hero-tags {
    gap: 8px;
    margin-top: 20px;
  }

  .hero-tags span {
    padding: 8px 10px;
    font-size: .78rem;
  }

  .mission-card {
    min-height: auto;
    padding: 20px;
    border-radius: 22px;
  }

  .mission-card h2 {
    margin: 24px 0 10px;
    font-size: 1.55rem;
  }

  main,
  footer {
    width: calc(100% - 16px);
  }

  .stats-panel {
    gap: 10px;
  }

  .stat-card {
    padding: 16px;
    border-radius: 18px;
  }

  .section-heading {
    gap: 10px;
  }

  .section-heading p {
    font-size: .95rem;
  }

  .dashboard-slide,
  .progress-card,
  .org-section,
  .checklist-section,
  .rule-card {
    padding: 16px;
    border-radius: 22px;
  }

  .toolbar {
    padding: 12px;
    border-radius: 18px;
    gap: 10px;
  }

  .toolbar input,
  .toolbar select,
  .toolbar .ghost-btn {
    min-height: 46px;
  }

  .toolbar .ghost-btn {
    width: 100%;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
  }

  thead {
    display: none;
  }

  tbody tr.group-row {
    margin: 18px 0 10px;
  }

  .group-row td {
    display: block;
    padding: 13px 15px;
    border-radius: 18px;
    font-size: .74rem;
    line-height: 1.35;
    white-space: normal;
  }

  tbody tr[data-id] {
    position: relative;
    margin: 0 0 14px;
    padding: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(7, 23, 51, .07);
  }

  tbody tr[data-id] td {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border: 0;
    background: transparent !important;
    text-align: left;
  }

  tbody tr[data-id] td::before {
    content: attr(data-label);
    color: var(--navy);
    font-size: .68rem;
    font-weight: 950;
    letter-spacing: .08em;
    line-height: 1.2;
    text-transform: uppercase;
  }

  tbody tr[data-id] .number-cell {
    position: absolute;
    top: 13px;
    right: 13px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 38px;
    padding: 5px 10px;
    border-radius: 999px;
    color: var(--blue);
    background: var(--blue-soft) !important;
    font-size: .78rem;
    font-weight: 950;
  }

  tbody tr[data-id] .number-cell::before {
    content: "#";
    margin-right: 2px;
    color: var(--blue);
    font-size: .78rem;
    letter-spacing: 0;
  }

  tbody tr[data-id] td:nth-child(2) {
    display: block;
    padding-top: 2px;
    padding-right: 58px;
    padding-bottom: 12px;
    margin-bottom: 4px;
    border-bottom: 1px solid #edf3f8;
  }

  tbody tr[data-id] td:nth-child(2)::before {
    display: block;
    margin-bottom: 7px;
    color: var(--blue);
  }

  .task-title {
    max-width: none;
    font-size: .98rem;
    line-height: 1.36;
    overflow-wrap: anywhere;
  }

  .responsible {
    min-width: 0;
    font-size: .92rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  .check-cell {
    text-align: left;
  }

  .check-cell input {
    width: 26px;
    height: 26px;
  }

  .date-input,
  .note-input {
    min-width: 0;
    width: 100%;
  }

  .date-input {
    padding: 11px;
  }

  .note-input {
    min-height: 46px;
    resize: vertical;
  }

  .badge {
    min-width: auto;
    justify-self: start;
    padding: 8px 12px;
  }

  .empty-cell {
    display: block;
    padding: 18px;
    border: 1px dashed var(--line);
    border-radius: 18px;
    background: #fff;
    color: var(--muted);
    text-align: center;
  }

  footer {
    flex-direction: column;
    margin-bottom: 26px;
  }
}

@media (max-width: 520px) {
  .stats-panel {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    letter-spacing: -0.055em;
  }
}

@media (max-width: 430px) {
  tbody tr[data-id] {
    padding: 13px;
    border-radius: 18px;
  }

  tbody tr[data-id] td {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 8px;
  }

  tbody tr[data-id] td::before {
    font-size: .64rem;
  }

  .task-title {
    font-size: .95rem;
  }

  .badge {
    font-size: .72rem;
  }
}

@media print {
  body {
    overflow: visible !important;
    background: #fff;
  }

  .hero,
  .dashboard-slide,
  .stat-card,
  .progress-card,
  .org-section,
  .checklist-section,
  .rule-card {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    box-shadow: none !important;
  }

  .slide-controls,
  .top-actions,
  .toolbar,
  .note-input,
  .date-input {
    display: none !important;
  }

  .hero {
    color: #111;
    background: #fff;
    border: 1px solid #ddd;
  }

  table {
    min-width: 0;
    font-size: 10px;
  }

  thead th,
  .group-row td {
    background: #1f2937 !important;
    color: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}


/* ==========================================================
   AJUSTE FINAL · SLIDE 3 ELIMINADO / LISTADO LIBRE / NAV COMPACTA
   ========================================================== */
@media (min-width: 941px) {
  body.desktop-slide-mode {
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  body.desktop-slide-mode .hero,
  body.desktop-slide-mode .dashboard-slide,
  body.desktop-slide-mode .checklist-section,
  body.desktop-slide-mode .rule-card {
    height: auto !important;
    min-height: min(calc(100vh - 116px), 830px) !important;
    overflow: visible !important;
    padding-bottom: clamp(86px, 9vh, 116px) !important;
  }

  body.desktop-slide-mode .checklist-section.is-active {
    display: block !important;
    min-height: auto !important;
  }

  body.desktop-slide-mode .checklist-section .table-wrap {
    flex: none !important;
    min-height: 0 !important;
    max-height: none !important;
    height: auto !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
  }

  body.desktop-slide-mode .checklist-section table {
    min-width: 1080px;
  }

  body.desktop-slide-mode .slide-controls {
    bottom: 18px !important;
    width: min(430px, calc(100vw - 48px)) !important;
    min-width: 0 !important;
    gap: 10px !important;
    padding: 8px 14px !important;
    border-radius: 999px !important;
  }

  body.desktop-slide-mode .slide-controls button {
    padding: 6px 10px !important;
    font-size: .82rem !important;
    line-height: 1 !important;
  }

  body.desktop-slide-mode .slide-status {
    gap: 9px !important;
  }

  body.desktop-slide-mode #slideCounter {
    min-width: 42px;
    text-align: center;
    font-size: .88rem;
  }

  body.desktop-slide-mode .slide-dots {
    gap: 6px !important;
  }

  body.desktop-slide-mode .slide-dot {
    width: 8px !important;
    height: 8px !important;
  }

  body.desktop-slide-mode .slide-dot.is-active {
    width: 18px !important;
  }
}
