/* Sistema de diseño DUNAS — paleta tonal M3 (HCT) generada con
   TonalPalette.fromHueAndChroma: primary = hue 50 / chroma 18 (arena/terracota
   suave), neutral = hue 50 / chroma 4 (fondos y texto, mismo matiz que primary
   pero casi sin saturación). Reemplaza a Siete Colinas; la mecánica de tokens
   no cambia — siguen siendo variables CSS en un solo bloque.

   El fondo N-98 (#FFF8F5) se usa en vez de blanco puro (N-100) a propósito:
   comparte matiz con el resto de la paleta, así que la composición se siente
   de una sola familia en vez de "arena flotando sobre blanco clínico".

   Reglas de uso:
   - --accent nunca en texto chico (falla APCA aunque pase WCAG AA) — solo
     rellenos, círculos e íconos grandes. Para texto de acento usa --primary.
   - Texto secundario usa --muted-foreground, ya validado por contraste.
   - Todo color nuevo entra como token de dominio, nunca suelto en pantalla. */

:root {
  --background: 18 100% 98%;  /* #FFF8F5 — N-98 */
  --foreground: 20 16% 11%;   /* #201A17 — N-10 */

  --card: 300 100% 99%;       /* #FFFBFF — N-99, surface-bright */
  --card-foreground: 20 16% 11%;

  --primary: 22 28% 37%;      /* #785744 — primary-40, 6.2:1 sobre el fondo */
  --primary-foreground: 0 0% 100%;

  --secondary: 18 31% 89%;    /* #ECE0DB — neutral-90, surface-container-high */
  --secondary-foreground: 20 16% 11%;

  --accent: 22 32% 62%;       /* #BD967F — primary-65, solo relleno */
  --accent-foreground: 24 73% 10%; /* #2D1607 — primary-10 */

  --muted: 20 41% 91%;        /* #F2E6E0 — neutral-92 */
  --muted-foreground: 20 6% 37%;   /* #655D59 — neutral-40, 6.1:1 */

  --destructive: 0 65% 45%;
  --destructive-foreground: 0 0% 100%;

  --warning: 35 85% 42%;
  --warning-foreground: 0 0% 100%;

  --success: 145 45% 33%;
  --success-foreground: 0 0% 100%;

  --border: 22 76% 82%;       /* #F4C9B0 — primary-84 */
  --input: 22 76% 82%;
  --ring: 22 28% 37%;

  --radius: 0.75rem;

  --shadow-sm: 0 1px 2px hsl(var(--foreground) / 0.06);
  --shadow-md: 0 4px 12px hsl(var(--foreground) / 0.08);
  --shadow-lg: 0 12px 28px hsl(var(--foreground) / 0.14);

  --font-display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  /* --- Tokens de dominio (§13 del contexto del proyecto) ---
     Todo color nuevo de la app entra aquí, nunca suelto en una pantalla. */

  --priority-low: 14 15% 45%;
  --priority-medium: 35 85% 42%;
  --priority-high: 22 28% 37%;
  --priority-urgent: 0 70% 42%;

  --status-pending: 14 15% 45%;
  --status-progress: 22 32% 62%;
  --status-done: 145 45% 33%;
  --status-overdue: 0 70% 42%;
  --status-anticipated: 200 45% 40%;

  /* Hallazgo 14 de UX-FEEDBACK.md: un color por etapa de proyecto
     (reemplazan a los --project-* de los estados viejos). */
  --stage-survey: 190 45% 36%;
  --stage-sourcing: 35 85% 40%;
  --stage-bidding: 270 35% 48%;
  --stage-running: 18 70% 45%;
  --stage-monitoring: 205 50% 42%;
  --stage-closed: 145 45% 33%;

  /* Calificación del proveedor en estrellas (feedback de la fase 4). */
  --rating-star: 38 92% 45%;

  --money-paid: 145 45% 33%;
  --money-pending: 35 85% 42%;
  --warranty-expiring: 22 28% 37%;

  /* Hallazgo 5 de UX-FEEDBACK.md: un color por status de reporte. */
  --report-new: 142 55% 38%;
  --report-review: 205 55% 45%;
  --report-attended: 175 40% 35%;
  --report-discarded: 14 10% 50%;
  --report-converted: 250 35% 48%;
}

html.dark {
  --background: 20 23% 8%;    /* #18120F — N-6 */
  --foreground: 18 31% 89%;   /* #ECE0DB — N-90 */

  --card: 20 14% 12%;         /* #241E1B — N-12 */
  --card-foreground: 18 31% 89%;

  --primary: 21 60% 78%;      /* #E9BEA6 — primary-80, sube de luminosidad para contrastar */
  --primary-foreground: 22 45% 19%; /* #452A1A — primary-20 */

  --secondary: 18 9% 21%;     /* #3A3330 — N-22 */
  --secondary-foreground: 18 31% 89%;

  --accent: 22 38% 67%;       /* #CBA38C — primary-70 */
  --accent-foreground: 24 73% 10%;  /* #2D1607 — primary-10 */

  --muted: 18 10% 19%;        /* #362F2C — N-20 */
  --muted-foreground: 18 15% 78%;  /* #D0C4BF — N-80, 10.9:1 */

  --destructive: 0 62% 55%;
  --destructive-foreground: 0 0% 100%;

  --warning: 35 80% 58%;
  --warning-foreground: 0 0% 100%;

  --success: 145 40% 48%;
  --success-foreground: 0 0% 100%;

  --border: 20 8% 28%;        /* #4D4541 — N-30 */
  --input: 20 8% 28%;
  --ring: 21 60% 78%;

  --shadow-sm: 0 1px 2px hsl(0 0% 0% / 0.35);
  --shadow-md: 0 4px 14px hsl(0 0% 0% / 0.4);
  --shadow-lg: 0 16px 32px hsl(0 0% 0% / 0.5);

  --priority-low: 23 12% 62%;
  --priority-medium: 35 80% 58%;
  --priority-high: 21 60% 78%;
  --priority-urgent: 0 62% 58%;

  --status-pending: 23 12% 62%;
  --status-progress: 22 38% 67%;
  --status-done: 145 40% 48%;
  --status-overdue: 0 62% 58%;
  --status-anticipated: 200 50% 58%;

  --stage-survey: 190 45% 58%;
  --stage-sourcing: 35 80% 58%;
  --stage-bidding: 270 45% 70%;
  --stage-running: 18 75% 62%;
  --stage-monitoring: 205 55% 62%;
  --stage-closed: 145 40% 48%;

  --rating-star: 40 90% 58%;

  --money-paid: 145 40% 48%;
  --money-pending: 35 80% 58%;
  --warranty-expiring: 21 60% 78%;

  --report-new: 142 50% 52%;
  --report-review: 205 50% 60%;
  --report-attended: 175 38% 50%;
  --report-discarded: 20 8% 65%;
  --report-converted: 250 45% 68%;
}

* { box-sizing: border-box; }

/* [hidden] tiene que ganar siempre. Varias clases (.stack-form, .field-row,
   .info-grid, .stats…) fijan `display: flex/grid` con la misma especificidad
   que la regla [hidden] del user-agent, y como son CSS de autor le ganan a la
   del navegador — el elemento se sigue viendo aunque tenga el atributo. Sin
   esta regla, cualquier `el.hidden = true` sobre un elemento con esas clases
   no oculta nada (bug detectado en el tab Licitación: el formulario de
   cotización y el de "+ Nuevo proveedor" quedaban siempre expuestos). */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  transition: background .25s ease, color .25s ease;
}

/* ============================ LAYOUT DE DASHBOARD ==========================
   Escritorio: barra lateral fija + área de contenido.
   Celular: la lateral se vuelve un cajón deslizante y las vistas de trabajo
   viven en una barra inferior, al alcance del pulgar.
   ========================================================================== */

.shell { display: flex; min-height: 100vh; }

/* ------------------------------ barra lateral ------------------------------ */

.sidebar {
  width: 244px; flex: none;
  display: flex; flex-direction: column;
  background: hsl(var(--card));
  border-right: 1px solid hsl(var(--border));
  position: sticky; top: 0; height: 100vh;
  z-index: 40;
}

.sidebar-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 18px 16px;
  border-bottom: 1px solid hsl(var(--border));
}
.logo {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--secondary)));
  color: hsl(var(--primary-foreground));
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 16px;
}
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.brand-sub { font-size: 11.5px; color: hsl(var(--muted-foreground)); }

.sidenav { flex: 1; overflow-y: auto; padding: 14px 10px; }
.nav-group + .nav-group { margin-top: 18px; }
.nav-group-title {
  font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .08em; color: hsl(var(--muted-foreground));
  padding: 0 8px 7px;
}

.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 10px; margin-bottom: 2px;
  border: 0; border-radius: calc(var(--radius) - 2px);
  background: transparent; color: hsl(var(--muted-foreground));
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  text-align: left; cursor: pointer;
  transition: background .15s, color .15s;
}
.nav-item svg {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.nav-emoji { width: 18px; flex: none; text-align: center; font-size: 14px; }
.nav-item:hover { background: hsl(var(--accent) / .6); color: hsl(var(--foreground)); }
.nav-item.active {
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
}
.nav-item-sm { font-size: 13px; padding: 7px 10px; }
.nav-count {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: hsl(var(--destructive)); color: #fff;
  font-size: 11px; font-weight: 600; line-height: 18px; text-align: center;
}
.nav-item-danger:hover { background: hsl(var(--destructive) / .1); color: hsl(var(--destructive)); }

.sidebar-foot { border-top: 1px solid hsl(var(--border)); padding: 10px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px; }
.side-user-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: hsl(var(--accent)); color: hsl(var(--accent-foreground));
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
}
.side-user-info { min-width: 0; }
.side-user-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-role { font-size: 11.5px; color: hsl(var(--muted-foreground)); }

.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 35;
  background: hsl(222 47% 5% / .5);
}
.sidebar-backdrop.show { display: block; }

/* -------------------------------- contenido -------------------------------- */

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.pagebar {
  position: sticky; top: 0; z-index: 25;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 24px;
  background: hsl(var(--background) / .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid hsl(var(--border));
}
.pagebar-titles { flex: 1; min-width: 0; }
.pagebar-title {
  font-family: var(--font-display); font-size: 19px; font-weight: 600;
  letter-spacing: -0.01em; margin: 0;
}
.pagebar-sub { font-size: 12.5px; color: hsl(var(--muted-foreground)); margin: 2px 0 0; }
.pagebar-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--card)); color: hsl(var(--foreground));
  cursor: pointer;
}
.icon-btn:hover { border-color: hsl(var(--ring)); }
.icon-btn svg {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

.content { flex: 1; padding: 20px 24px 40px; max-width: 1180px; width: 100%; }
.only-mobile { display: none; }

.page { display: none; }
.page.active { display: block; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* La primera tarjeta de cada vista no necesita separarse del encabezado */
.page > .card:first-child, .page > .stats:first-child { margin-top: 0; }

/* Dos columnas cuando hay espacio */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.grid-2 > .card { margin-top: 16px; }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } }

/* --------------------------- barra inferior (celular) ---------------------- */

.bottomnav {
  display: none;
  position: sticky; bottom: 0; z-index: 30;
  background: hsl(var(--card));
  border-top: 1px solid hsl(var(--border));
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.bottomnav button {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  border: 0; background: transparent; cursor: pointer;
  color: hsl(var(--muted-foreground));
  font-family: var(--font-body); font-size: 10.5px; font-weight: 500;
  padding: 6px 2px; border-radius: calc(var(--radius) - 4px);
}
.bottomnav button svg {
  width: 21px; height: 21px;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.bottomnav button.active { color: hsl(var(--primary)); }

/* --------------------------------- móvil ----------------------------------- */

@media (max-width: 860px) {
  .only-mobile { display: grid; }

  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; height: 100%;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }

  .pagebar { padding: 12px 16px; }
  .pagebar-title { font-size: 17px; }
  .content { padding: 16px 16px 24px; }
  .bottomnav { display: flex; }
}

/* -------------------------------- card ----------------------------------- */

.card {
  background: hsl(var(--card)); color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow-sm);
  margin-top: 16px;
}
.card-header { padding: 20px 20px 0; }
.card-title { font-family: var(--font-display); font-size: 16px; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.card-desc { font-size: 13px; color: hsl(var(--muted-foreground)); margin: 4px 0 0; }
.card-content { padding: 16px 20px 20px; }
.card-content.flush { padding: 8px 8px 8px; }

/* ------------------------------- buttons --------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid transparent;
  font-family: var(--font-body); font-weight: 600; font-size: 13.5px;
  cursor: pointer; white-space: nowrap;
  transition: opacity .15s, background .15s, border-color .15s;
}
.btn:active { transform: translateY(0.5px); }
/* El botón "Guardar cambios" del detalle (Hallazgo 21) y otros que ya
   alternaban `disabled` por JS no tenían ningún estado visual distinto: se
   veían idénticos a un botón habilitado. Sin esto, "deshabilitado" no se
   puede verificar a simple vista. */
.btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.btn-primary:hover { opacity: .9; }
.btn-outline { background: transparent; border-color: hsl(var(--border)); color: hsl(var(--foreground)); }
.btn-outline:hover { border-color: hsl(var(--ring)); }
.btn-ghost { background: transparent; color: hsl(var(--muted-foreground)); }
.btn-ghost:hover { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; }
.btn-icon { width: 32px; height: 32px; padding: 0; }
.btn-danger { color: hsl(var(--destructive)); }
.btn-danger:hover { background: hsl(var(--destructive) / 0.1); }

/* -------------------------------- inputs --------------------------------- */

.input {
  height: 38px; width: 100%;
  padding: 0 12px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--input));
  border-radius: calc(var(--radius) - 2px);
  color: inherit; font-family: var(--font-body); font-size: 14px;
  outline: none;
  transition: box-shadow .15s, border-color .15s;
}
.input:focus { border-color: hsl(var(--ring)); box-shadow: 0 0 0 3px hsl(var(--ring) / .25); }
.input::placeholder { color: hsl(var(--muted-foreground)); }

/* los <select> comparten el aspecto de .input, con su propia flecha */
select.input {
  appearance: none; -webkit-appearance: none;
  padding-right: 30px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, hsl(var(--muted-foreground)) 50%),
                    linear-gradient(135deg, hsl(var(--muted-foreground)) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* ------------------------------- checklist -------------------------------- */

.check-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 12px;
  border-radius: calc(var(--radius) - 2px);
  user-select: none;
  transition: background .15s;
}
.check-row:hover { background: hsl(var(--accent) / .5); }
.check-row + .check-row { border-top: 1px solid hsl(var(--border)); border-radius: 0; }
.check-row.status-in_progress, .check-row.status-done { cursor: pointer; }
/* Hallazgo 25: filas de Mi día que abren el detalle compartido. */
.check-row.is-clicable { cursor: pointer; }

.checkbox {
  flex: none; width: 26px; height: 26px;
  border: 2px solid hsl(var(--border));
  border-radius: 7px;
  display: grid; place-items: center;
  transition: background .15s, border-color .15s;
}
.checkbox svg { width: 15px; height: 15px; stroke: hsl(var(--success-foreground)); stroke-width: 3.2; opacity: 0; transition: opacity .15s; }

/* en progreso: medio lleno, en ámbar */
.check-row.status-in_progress .checkbox {
  border-color: hsl(var(--warning));
  background: linear-gradient(to right, hsl(var(--warning)) 50%, transparent 50%);
}
/* realizada: palomita verde */
.check-row.status-done .checkbox { background: hsl(var(--success)); border-color: hsl(var(--success)); }
.check-row.status-done .checkbox svg { opacity: 1; }

.check-body { min-width: 0; flex: 1; }
.check-name { font-weight: 500; }
.check-row.status-done .check-name { color: hsl(var(--muted-foreground)); text-decoration: line-through; }
/* Hallazgo 23: los badges de la fila ("Prioridad: Media", "Estado: Realizada")
   ahora llevan texto más largo que antes — se ponen en flex-wrap para que
   cada badge envuelva como bloque completo a la siguiente línea en vez de
   partirse internamente o desbordar el ancho de la fila. */
.check-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11.5px; color: hsl(var(--muted-foreground)); margin-top: 3px; line-height: 1.6; }
.check-row .task-next { flex: none; }

.early-note {
  font-size: 11.5px; color: hsl(var(--warning-foreground));
  background: hsl(var(--warning) / .16);
  border-radius: 6px; padding: 2px 8px; margin-top: 4px; display: inline-block;
}
html.dark .early-note { color: hsl(var(--warning)); }

.evidence-links { margin-top: 4px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* --------------------------- grupos por categoría -------------------------- */

.group-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 16px 20px 4px;
}
/* Dentro de .card-content ya hay padding horizontal: el de .group-head lo
   duplicaría y el título quedaría más metido hacia la derecha que el resto
   del contenido de la tarjeta. */
.card-content > .group-head { padding-left: 0; padding-right: 0; }
.card-content.flush > .group-head { padding: 10px 12px 6px; }
.card.is-off { opacity: .62; }
.card.is-off:hover { opacity: 1; } /* se pueden marcar igual, por si se adelanta trabajo */

.detail-group + .detail-group { margin-top: 20px; }
.detail-head {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  padding-bottom: 6px; border-bottom: 1px solid hsl(var(--border));
}
.detail-group table td { font-size: 14px; }

/* --------------------------- días de la semana ----------------------------- */

.days-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 10px 0 14px; }
.days-label { font-size: 12px; color: hsl(var(--muted-foreground)); margin-right: 2px; }
.day {
  width: 34px; height: 34px; flex: none;
  border-radius: calc(var(--radius) - 3px);
  border: 1px solid hsl(var(--border));
  background: transparent; color: hsl(var(--muted-foreground));
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.day:hover { border-color: hsl(var(--ring)); }
.day.on {
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}
.days-text { font-family: var(--font-mono); font-size: 11.5px; color: hsl(var(--muted-foreground)); margin-left: 4px; }

/* --------------------------- bloques de categoría -------------------------- */

.cat-block {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 14px 16px;
}
.cat-block + .cat-block { margin-top: 14px; }

/* Listas de tarjetas cortas (roles, categorías, proveedores): en columnas
   cuando hay espacio, para no dejar la mitad de la pantalla en blanco junto
   a un bloque de dos líneas de texto. */
#roles-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px; align-items: start;
}
/* #admin-cats muestra un solo .cat-block a la vez (el de la tab activa de
   Tareas recurrentes) — sin grid, para que ocupe el ancho completo. */
#admin-cats > .cat-block { margin-top: 0; }
#roles-list > .cat-block { margin-top: 0; }

/* Hallazgo 13.1: el directorio pasa de grid a lista apilada (patrón de
   Reportes), una tarjeta de ancho completo por proveedor. */
#suppliers-list .group-head { flex-wrap: wrap; }
#suppliers-list .group-head > div:first-child { min-width: 0; overflow-wrap: anywhere; }
#suppliers-list .row-actions { flex-wrap: wrap; justify-content: flex-start; }
.cat-head { display: flex; align-items: center; gap: 8px; }
.input-title { font-family: var(--font-display); font-weight: 600; border-color: transparent; background: transparent; padding-left: 8px; }
.input-title:hover { border-color: hsl(var(--input)); }
.input-title:focus { background: hsl(var(--card)); }
.cat-block .add-task { margin-top: 12px; }

/* Lista de categorías (pantalla Sistema → Categorías): filas .cat-head
   apiladas dentro de una sola tarjeta, separadas por un borde fino. */
#categorias-list {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 4px 16px;
}
#categorias-list .cat-head { padding: 10px 0; }
#categorias-list .cat-head + .cat-head { border-top: 1px solid hsl(var(--border)); }

/* Tabs horizontales de categoría (Tareas recurrentes) */
.cat-tabs {
  display: flex; gap: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin-bottom: 14px; border-bottom: 1px solid hsl(var(--border));
}
.cat-tab {
  flex: none; padding: 9px 16px; border: none; background: transparent;
  color: hsl(var(--muted-foreground));
  font-family: var(--font-display); font-weight: 600; font-size: 13.5px;
  cursor: pointer; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.cat-tab:hover { color: hsl(var(--foreground)); }
.cat-tab.active { color: hsl(var(--primary)); border-bottom-color: hsl(var(--primary)); }

/* --------------------------------- switch ---------------------------------- */

.switch {
  display: flex; align-items: center; gap: 9px;
  margin-top: 14px; font-size: 13px; color: hsl(var(--muted-foreground));
  cursor: pointer; user-select: none;
}
.switch input { width: 16px; height: 16px; accent-color: hsl(var(--primary)); cursor: pointer; }

/* -------------------------------- badges ---------------------------------- */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .01em;
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
  background: hsl(var(--muted)); color: hsl(var(--muted-foreground));
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .55; flex: none; }
.badge-success { background: hsl(var(--success) / .12); color: hsl(var(--success)); }
.badge-warning { background: hsl(var(--warning) / .16); color: hsl(38 75% 32%); }
html.dark .badge-warning { color: hsl(var(--warning)); }
.badge-muted { background: transparent; color: hsl(var(--muted-foreground)); }
.badge-muted::before { display: none; }
.badge-danger { background: hsl(var(--destructive) / .12); color: hsl(var(--destructive)); }

/* Status de reporte (Hallazgo 5): un token de color por status. "Nuevo"
   parpadea en verde de forma permanente mientras esté en ese status. */
.badge-report-nuevo { background: hsl(var(--report-new) / .14); color: hsl(var(--report-new)); animation: report-blink 1.3s ease-in-out infinite; }
.badge-report-en_revision { background: hsl(var(--report-review) / .14); color: hsl(var(--report-review)); }
.badge-report-atendido { background: hsl(var(--report-attended) / .14); color: hsl(var(--report-attended)); }
.badge-report-descartado { background: hsl(var(--report-discarded) / .14); color: hsl(var(--report-discarded)); }
.badge-report-convertido { background: hsl(var(--report-converted) / .14); color: hsl(var(--report-converted)); }
/* Hallazgo 14: badge de etapa de proyecto, uno por token --stage-*. */
.badge-stage-levantamiento { background: hsl(var(--stage-survey) / .14); color: hsl(var(--stage-survey)); }
.badge-stage-busqueda_proveedores { background: hsl(var(--stage-sourcing) / .14); color: hsl(var(--stage-sourcing)); }
.badge-stage-licitacion { background: hsl(var(--stage-bidding) / .14); color: hsl(var(--stage-bidding)); }
.badge-stage-en_ejecucion { background: hsl(var(--stage-running) / .14); color: hsl(var(--stage-running)); }
.badge-stage-monitoreo { background: hsl(var(--stage-monitoring) / .14); color: hsl(var(--stage-monitoring)); }
.badge-stage-cerrado { background: hsl(var(--stage-closed) / .14); color: hsl(var(--stage-closed)); }
@keyframes report-blink { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

/* Estado de taskInstance en Supervisión (Hallazgo 12): reusa los tokens
   --status-* ya definidos (§13), sin declarar ninguno nuevo. */
.badge-status-pending { background: hsl(var(--status-pending) / .12); color: hsl(var(--status-pending)); }
.badge-status-progress { background: hsl(var(--status-progress) / .16); color: hsl(var(--status-progress)); }
.badge-status-done { background: hsl(var(--status-done) / .12); color: hsl(var(--status-done)); }
.badge-status-overdue { background: hsl(var(--status-overdue) / .12); color: hsl(var(--status-overdue)); }

/* Hallazgo 22: fecha de vencimiento en la lista de Supervisión, resaltada
   cuando está vencida. Reusa --status-overdue, sin token nuevo. */
.due-overdue { color: hsl(var(--status-overdue)); font-weight: 600; }

/* Hallazgo 13.3: estado de factura. "Vencida" reusa --status-overdue (mismo
   criterio que .due-overdue); "Pagada"/"Pendiente" reusan los tokens de
   dinero --money-paid/--money-pending ya declarados desde la fase 1. */
.badge-money-paid { background: hsl(var(--money-paid) / .14); color: hsl(var(--money-paid)); }
.badge-money-pending { background: hsl(var(--money-pending) / .14); color: hsl(var(--money-pending)); }

/* ------------------------------- progreso --------------------------------- */

.progress-legend { font-size: 13px; color: hsl(var(--muted-foreground)); margin-top: 10px; }
.progress { height: 8px; background: hsl(var(--muted)); border-radius: 999px; overflow: hidden; }
.progress > span {
  display: block; height: 100%; border-radius: 999px; transition: width .35s ease;
  background: linear-gradient(90deg, hsl(var(--primary)), hsl(var(--secondary)));
}

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.stat {
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 4px); padding: 16px;
  box-shadow: var(--shadow-sm);
  min-width: 0; /* permite que el grid la encoja sin desbordar el monto */
}
.stat .label { font-size: 12px; color: hsl(var(--muted-foreground)); }
.stat .value {
  font-family: var(--font-mono); font-size: 25px; font-weight: 600; letter-spacing: -0.01em; margin-top: 2px;
  overflow-wrap: break-word;
}
/* .stats-compact .value tiene la MISMA especificidad que .stat .value de
   arriba (dos clases cada una); declarada después, gana ella. Bug encontrado
   en verificación visual: en contenedores angostos (el modal de sobrepago,
   420px) el monto a 25px se veía recortado porque este override en realidad
   nunca aplicaba. */
.stats-compact { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); margin-top: 12px; }
.stats-compact .stat { padding: 10px; }
.stats-compact .value { font-size: 18px; }

/* Hallazgo 17: contadores de atención de Resumen. Reutiliza --warning (ya
   usado en badge-warning/early-note) para destacar los que no están en cero
   — sin token de color nuevo. */
.att-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.att-card {
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 4px); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px; min-width: 0;
}
.att-card.has-value { border-color: hsl(var(--warning)); background: hsl(var(--warning) / .08); }
.att-card .label { font-size: 12px; color: hsl(var(--muted-foreground)); }
.att-card .value { font-family: var(--font-mono); font-size: 25px; font-weight: 600; letter-spacing: -0.01em; }
.att-card .btn { align-self: flex-start; }

/* ------------------------------- historial -------------------------------- */

.history { display: flex; align-items: flex-end; gap: 6px; height: 110px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bar .fill {
  width: 100%; border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, hsl(var(--secondary)), hsl(var(--primary))); min-height: 3px;
  transition: height .3s ease;
}
.bar .fill.empty { background: hsl(var(--muted)); }
.bar .fill.off { background: hsl(var(--muted) / .45); } /* día sin categorías programadas */
.bar .lbl { font-family: var(--font-mono); font-size: 10px; color: hsl(var(--muted-foreground)); }

/* -------------------------------- tabla ----------------------------------- */

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 500; color: hsl(var(--muted-foreground)); padding: 8px 10px; }
td { padding: 11px 10px; border-top: 1px solid hsl(var(--border)); }
td.right, th.right { text-align: right; }

.row-actions { display: flex; gap: 4px; justify-content: flex-end; }

/* -------------------------------- finanzas ---------------------------------- */
/* Barras hechas a mano (Hallazgo 15): sin librerías de gráficas, solo el token
   --accent ("solo relleno") que ya existía, sin crear un color nuevo. */

.fin-bars { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.fin-bar-row { display: flex; align-items: center; gap: 10px; }
.fin-bar-label { flex: 0 0 140px; font-size: 13px; overflow-wrap: break-word; }
.fin-bar-track { flex: 1; height: 10px; border-radius: 999px; background: hsl(var(--muted)); overflow: hidden; }
.fin-bar-fill { height: 100%; border-radius: 999px; background: hsl(var(--accent)); }
.fin-bar-value { flex: 0 0 auto; font-family: var(--font-mono); font-size: 13px; min-width: 90px; text-align: right; }

@media (max-width: 520px) {
  .fin-bar-label { flex-basis: 90px; }
  .fin-bar-value { min-width: 74px; font-size: 12px; }
}
.muted { color: hsl(var(--muted-foreground)); }
.empty-state { text-align: center; padding: 32px 16px; color: hsl(var(--muted-foreground)); font-size: 14px; }

.stack-form { display: flex; flex-direction: column; gap: 8px; }

.activity-panel { margin-top: 10px; padding-top: 10px; border-top: 1px solid hsl(var(--border)); }

/* Separa bloques independientes dentro de una misma pestaña (Licitación,
   Proveedor) sin anidar tarjetas: mismo criterio que .activity-panel. */
.tab-section { margin-top: 24px; padding-top: 16px; border-top: 1px solid hsl(var(--border)); }
.tab-section:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.activity-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; max-height: 220px; overflow-y: auto; }
.activity-item { font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.activity-type { font-weight: 600; }
.activity-user { color: hsl(var(--muted-foreground)); font-weight: 500; }
.activity-text { color: hsl(var(--muted-foreground)); }
.activity-at { color: hsl(var(--muted-foreground)); margin-left: auto; font-size: 11.5px; }

.quote-won { background: hsl(var(--success) / .08); }
/* Detalle del proyecto (Hallazgo 14): datos de solo lectura en rejilla que
   se apila en móvil, y miniaturas de evidencia más grandes que las de archivos. */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 16px; }
.info-grid .field-label { display: block; margin-top: 0; color: hsl(var(--muted-foreground)); }
.project-evidence .report-file-thumb { width: 96px; height: 96px; }
.field-row { display: flex; gap: 8px; }
.field-row .input:first-child { flex: 2; }
.field-row .input:nth-child(2) { flex: 1; }

/* --------------------------------- reportes --------------------------------- */
/* Hallazgos 1, 6 y 7 de UX-FEEDBACK.md: fotos del formulario, filtros del
   backlog y galería de archivos del detalle. */

.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.filter-bar .input { flex: 1 1 180px; }

.photo-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.photo-thumb {
  position: relative; width: 72px; height: 72px; flex: none;
  border-radius: calc(var(--radius) - 4px); overflow: hidden; border: 1px solid hsl(var(--border));
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-remove {
  position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%;
  border: none; background: hsl(var(--foreground) / .65); color: hsl(var(--background));
  font-size: 12px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
}

.status-confirm { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }

.report-files { display: flex; flex-direction: column; gap: 10px; }
.report-file-item { display: flex; align-items: center; gap: 10px; }
.report-file-thumb, .report-file-icon {
  width: 44px; height: 44px; flex: none; border-radius: calc(var(--radius) - 4px);
  object-fit: cover; border: 1px solid hsl(var(--border));
}
.report-file-icon { display: flex; align-items: center; justify-content: center; background: hsl(var(--muted)); font-size: 18px; text-decoration: none; }
.report-file-meta { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.report-file-upload { margin-top: 6px; }

/* Resalta brevemente una tarjeta a la que se navegó desde otra pantalla
   (ej. "Reporte asignado" en Mi día, Hallazgos 3 y 8). */
.flash-highlight { animation: flash-highlight 1.4s ease; }
@keyframes flash-highlight {
  0%, 100% { box-shadow: 0 0 0 0 hsl(var(--ring) / 0); }
  25% { box-shadow: 0 0 0 4px hsl(var(--ring) / .45); }
}

/* ------------------------------- modal evidencia --------------------------- */

.modal-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 60;
  /* Feedback de verificación visual: a .55 de opacidad el contenido de atrás
     (inputs, montos) se seguía leyendo con claridad — no se sentía como un
     fondo oscurecido uniforme. Sube a .75. */
  background: hsl(222 47% 5% / .75);
  backdrop-filter: blur(3px);
  padding: 16px;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.show { display: flex; animation: fade .15s ease; }

.modal {
  width: 100%; max-width: 420px;
  background: hsl(var(--card)); color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow-lg);
  max-height: 88vh; overflow-y: auto;
}
@media (min-width: 560px) { .modal-overlay { align-items: center; } }

/* ------------------------------ calificación ------------------------------ */
/* Estrellas de solo lectura: una fila gris de fondo y encima la misma fila en
   --rating-star recortada al porcentaje (permite medias estrellas). */
.stars { position: relative; display: inline-block; line-height: 1; letter-spacing: 2px; font-size: 16px; white-space: nowrap; vertical-align: middle; }
.stars-base { color: hsl(var(--border)); }
.stars-fill { position: absolute; inset: 0 auto 0 0; overflow: hidden; color: hsl(var(--rating-star)); }
.stars-count { font-size: 12.5px; color: hsl(var(--muted-foreground)); margin-left: 6px; }

/* Selector de 1 a 5 estrellas: radios accesibles con teclado; el orden
   invertido permite pintar la estrella elegida y las anteriores con "~". */
.star-picker { border: 0; padding: 0; margin: 8px 0 0; }
.star-picker legend { font-size: 12.5px; font-weight: 600; margin-bottom: 4px; padding: 0; }
.star-picker-row { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.star-picker input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-picker label { font-size: 30px; line-height: 1; cursor: pointer; color: hsl(var(--border)); transition: color .1s; }
.star-picker label:hover,
.star-picker label:hover ~ label,
.star-picker input:checked ~ label { color: hsl(var(--rating-star)); }
.star-picker input:focus-visible + label { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; border-radius: 4px; }

/* -------------------------- panel de detalle (Supervisión) ----------------- */
/* Hallazgo 12: a diferencia de .modal-overlay (bottom-sheet en móvil, centrado
   en desktop), este panel es lateral en desktop y solo baja a bottom-sheet en
   móvil — mismo breakpoint que el resto de la app (860px, ver .sidebar). */

.drawer-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 60;
  background: hsl(222 47% 5% / .45);
  justify-content: flex-end;
}
.drawer-overlay.show { display: flex; animation: fade .15s ease; }

.drawer {
  width: 100%; max-width: 440px; height: 100%;
  background: hsl(var(--card)); color: hsl(var(--card-foreground));
  border-left: 1px solid hsl(var(--border));
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
}

.drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 20px 20px 0;
}
.drawer-body { padding: 16px 20px 24px; }

@media (max-width: 860px) {
  .drawer-overlay { align-items: flex-end; justify-content: center; padding: 0; }
  .drawer {
    max-width: 100%; height: auto; max-height: 88vh;
    border-left: 0; border-radius: calc(var(--radius) + 6px) calc(var(--radius) + 6px) 0 0;
  }
}

.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 20px 20px 0;
}
.modal-body { padding: 16px 20px 22px; }
.modal-hint { font-size: 13.5px; color: hsl(var(--muted-foreground)); text-align: center; margin: 6px 0 18px; }

.evidence-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.evidence-choice {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 22px 12px;
  border: 1.5px dashed hsl(var(--border));
  border-radius: var(--radius);
  cursor: pointer; font-size: 13px; font-weight: 500; text-align: center;
  transition: border-color .15s, background .15s;
}
.evidence-choice:hover { border-color: hsl(var(--ring)); background: hsl(var(--accent) / .4); }
.evidence-choice-icon { font-size: 28px; }

.row-wrap { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.evidence-preview { display: flex; justify-content: center; margin-bottom: 6px; }
.evidence-preview img, .evidence-preview video {
  max-width: 100%; max-height: 320px; border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--border));
  background: hsl(var(--muted));
}

.evidence-error {
  background: hsl(var(--destructive) / .1); color: hsl(var(--destructive));
  border-radius: calc(var(--radius) - 2px); padding: 12px 14px;
  font-size: 13.5px; text-align: center; margin-top: 10px;
}

.evidence-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-mono); font-size: 11.5px; color: hsl(var(--secondary));
  text-decoration: none; margin-top: 2px;
}
.evidence-link:hover { text-decoration: underline; }

/* ------------------------------ pantalla de acceso ------------------------- */

.gate {
  display: none;
  position: fixed; inset: 0; z-index: 100;
  background: hsl(var(--background));
  padding: 24px 16px;
  overflow-y: auto;
  align-items: center; justify-content: center;
}
.gate.show { display: flex; }

.gate-card {
  width: 100%; max-width: 380px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow-md);
  padding: 28px 24px 24px;
}
.gate-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.gate-title { font-family: var(--font-display); font-weight: 600; font-size: 18px; letter-spacing: -0.01em; }
.gate-sub { font-size: 12.5px; color: hsl(var(--muted-foreground)); }

.gate-form { display: flex; flex-direction: column; gap: 6px; }
.gate-form .btn { margin-top: 14px; }
.gate-form .switch { margin-top: 10px; }

.field-label { font-size: 12.5px; font-weight: 600; margin-top: 10px; }
.btn-block { width: 100%; }

/* ------------------------------ menú de usuario ---------------------------- */

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid-full { grid-column: 1 / -1; }
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } }

/* permisos por rol */
.perm-group { margin-top: 14px; }
.perm-group-title {
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .06em; color: hsl(var(--muted-foreground)); margin-bottom: 6px;
}
.perm {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 7px 8px; border-radius: calc(var(--radius) - 4px);
  font-size: 13.5px; cursor: pointer; user-select: none;
}
.perm:hover { background: hsl(var(--accent) / .4); }
.perm input { margin-top: 2px; width: 16px; height: 16px; accent-color: hsl(var(--primary)); cursor: pointer; flex: none; }
.perm em { font-style: normal; color: hsl(var(--muted-foreground)); font-size: 12.5px; }
.perm-locked { opacity: .55; cursor: not-allowed; }
.perm-locked input { cursor: not-allowed; }

/* lista de usuarios */
.user-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  padding: 12px 0;
}
.user-row + .user-row { border-top: 1px solid hsl(var(--border)); }
.user-row.is-off { opacity: .6; }
.user-row-main { flex: 1 1 200px; min-width: 0; }
/* Hallazgo 19: el nombre pasó de input editable en línea a texto simple — la
   edición ahora vive en el panel "Editar" (un solo Guardar cambios). */
.user-row-name { font-weight: 600; }
.user-row-meta {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 3px;
  font-size: 12px; color: hsl(var(--muted-foreground));
}
.user-row-side { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mono { font-family: var(--font-mono); }

.input-sm { height: 32px; font-size: 13px; width: auto; min-width: 130px; padding: 0 8px; }

/* contraseña temporal revelada una sola vez */
.pass-reveal {
  font-family: var(--font-mono); font-size: 17px; font-weight: 600;
  text-align: center; letter-spacing: .02em;
  background: hsl(var(--muted));
  border: 1px dashed hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  padding: 14px 12px;
  user-select: all; word-break: break-all;
}

/* etiquetas de especialización */
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.tag {
  font-family: var(--font-mono); font-size: 11px;
  background: hsl(var(--accent)); color: hsl(var(--accent-foreground));
  padding: 2px 8px; border-radius: 999px;
}

/* toast */
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  padding: 10px 18px; border-radius: calc(var(--radius) - 2px);
  font-size: 14px; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
/* en celular sube por encima de la barra inferior */
@media (max-width: 860px) { #toast { bottom: calc(78px + env(safe-area-inset-bottom)); } }

@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat .value { font-size: 22px; }
}

@media (max-width: 520px) {
  .field-row { flex-wrap: wrap; }
  .field-row .input { flex: 1 1 100%; }
  /* en celular, el botón del paso se va abajo para que quepa el nombre */
  .check-row { flex-wrap: wrap; }
  .check-row .check-body { flex: 1 1 60%; }
  .check-row .task-next { margin-left: 40px; }
  /* Hallazgo 23: con la etiqueta antepuesta ("Prioridad: ", "Estado: ") el
     badge es más ancho — se achica antes de arriesgar desbordar la fila. */
  .check-meta .badge { font-size: 10px; padding: 2px 8px; }
}
