@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=Manrope:wght@600;700;800&display=swap');

/* ========== 1. Tokens ========== */
:root {
  /* Marca: verde Yunta */
  --green-900: #0f3b2e;
  --green-800: #155440;
  --green-700: #1d6d54;
  --green-600: #2a8566;
  --green-200: #c7e0d2;
  --green-100: #e2efe7;
  --green-50: #f1f7f3;

  /* Neutros (contraste AA sobre --bg) */
  --ink: #16212a;
  --text: #2a3540;
  --text-muted: #56636b;
  --text-subtle: #6b777e;
  --line: #e2e7e3;
  --line-strong: #cbd5ce;
  --bg: #f7f9f7;
  --surface: #ffffff;
  --surface-soft: #f2f5f2;

  /* Estados */
  --amber-700: #8a5a00;
  --amber-100: #fdf1d6;
  --red-700: #a8281f;
  --red-100: #fde9e7;
  --blue-700: #1f5a8a;
  --blue-100: #e5f0f9;

  /* Tipografía */
  --font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-head: 'Manrope', var(--font-body);
  --fs-xs: 0.8125rem; /* 13 */
  --fs-sm: 0.875rem; /* 14 */
  --fs-md: 1rem; /* 16 */
  --fs-lg: 1.125rem; /* 18 */
  --fs-xl: 1.375rem; /* 22 */
  --fs-2xl: 1.75rem; /* 28 */
  --fs-3xl: 2.25rem; /* 36 */
  --fs-display: clamp(2.5rem, 5vw, 3.75rem);

  /* Espacios (escala de 4/8) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;

  /* Forma y profundidad */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-full: 999px;
  --shadow-sm: 0 1px 2px rgb(16 40 30 / 6%), 0 1px 1px rgb(16 40 30 / 4%);
  --shadow-md: 0 6px 20px rgb(16 40 30 / 8%), 0 2px 6px rgb(16 40 30 / 5%);
  --shadow-lg: 0 24px 64px rgb(16 40 30 / 18%);
  --focus: 0 0 0 3px var(--surface), 0 0 0 5px var(--green-600);
  --control-h: 48px;
  --header-h: 72px;
  --tabbar-h: 64px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ========== 2. Base ========== */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: var(--s-6);
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3 {
  font-family: var(--font-head);
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-wrap: balance;
}
h1 {
  font-size: var(--fs-display);
  font-weight: 800;
  line-height: 1.08;
  margin: var(--s-3) 0 var(--s-5);
}
h1.page-title,
.narrow > h1,
.topline h1 {
  font-size: var(--fs-3xl);
}
h2 {
  font-size: var(--fs-2xl);
  font-weight: 700;
  margin: var(--s-10) 0 var(--s-4);
}
h3 {
  font-size: var(--fs-lg);
  font-weight: 700;
  margin: var(--s-2) 0;
}
.card h2,
dialog h2 {
  font-size: var(--fs-xl);
  margin-top: 0;
}
p {
  margin: 0 0 var(--s-4);
  color: var(--text-muted);
  text-wrap: pretty;
}
a {
  color: var(--green-700);
  text-decoration: none;
  text-underline-offset: 3px;
}
a:hover {
  text-decoration: underline;
}
small {
  display: block;
  margin-top: var(--s-3);
  font-size: var(--fs-xs);
  color: var(--text-subtle);
}
strong {
  color: var(--ink);
  font-weight: 600;
}
li {
  line-height: 1.9;
  color: var(--text-muted);
}
img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--r-md);
  background: var(--surface-soft);
}
.icon {
  width: 1.25em;
  height: 1.25em;
  flex-shrink: 0;
  vertical-align: -0.25em;
}
:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: var(--r-sm);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ========== 3. Estructura: encabezado, contenido, pie ========== */
header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: var(--header-h);
  padding: var(--s-3) max(var(--s-8), calc((100% - 1136px) / 2));
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-6);
  background: rgb(247 249 247 / 92%);
  backdrop-filter: saturate(1.4) blur(10px);
}
.logo {
  font-family: var(--font-head);
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.05em;
  line-height: 1;
}
.logo:hover {
  text-decoration: none;
}
.logo span {
  color: var(--green-700);
}
header nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--s-1);
  font-size: var(--fs-sm);
}
header nav a,
.nav-button {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 40px;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-full);
  color: var(--text);
  font-weight: 500;
  font-size: var(--fs-sm);
  background: transparent;
  border: 0;
  cursor: pointer;
  transition:
    background 0.15s var(--ease),
    color 0.15s var(--ease);
}
header nav a .icon,
.nav-button .icon {
  color: var(--text-subtle);
}
header nav a:hover,
.nav-button:hover {
  background: var(--green-50);
  color: var(--green-800);
  text-decoration: none;
  filter: none;
}
header nav a[aria-current='page'] {
  background: var(--green-100);
  color: var(--green-800);
  font-weight: 600;
}
header nav a[aria-current='page'] .icon {
  color: var(--green-700);
}
header nav > a.button {
  color: var(--surface);
  background: var(--green-700);
  padding: var(--s-2) var(--s-5);
  margin-left: var(--s-2);
}
header nav > a.button.outline {
  color: var(--green-700);
  background: var(--surface);
}
main {
  max-width: 1140px;
  margin: 0 auto;
  padding: var(--s-12) var(--s-8) var(--s-16);
  min-height: 72vh;
}
footer {
  max-width: 1140px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: var(--s-8);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3) var(--s-5);
  align-items: center;
  color: var(--text-subtle);
  font-size: var(--fs-sm);
}
footer strong {
  font-family: var(--font-head);
  font-weight: 800;
  letter-spacing: -0.03em;
}
footer span {
  margin-left: auto;
}

/* Barra inferior (solo celular) */
.tab-bar {
  display: none;
}

/* ========== 4. Componentes ========== */
/* Botones */
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: var(--control-h);
  padding: var(--s-3) var(--s-5);
  font: inherit;
  font-size: var(--fs-md);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  color: var(--surface);
  background: var(--green-700);
  border: 1px solid var(--green-700);
  border-radius: var(--r-md);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition:
    background 0.15s var(--ease),
    border-color 0.15s var(--ease),
    transform 0.1s var(--ease);
}
button:hover,
.button:hover {
  background: var(--green-800);
  border-color: var(--green-800);
  text-decoration: none;
}
button:active,
.button:active {
  transform: translateY(1px);
}
.outline,
button.outline,
.button.outline {
  color: var(--green-800);
  background: var(--surface);
  border-color: var(--line-strong);
  box-shadow: none;
}
.outline:hover,
button.outline:hover,
.button.outline:hover {
  background: var(--green-50);
  border-color: var(--green-600);
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
button[aria-busy='true'] {
  cursor: progress;
}
.full {
  width: 100%;
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin: var(--s-5) 0;
}
.tabs button,
.tabs .button {
  min-height: 44px;
  padding: var(--s-2) var(--s-4);
  font-size: var(--fs-sm);
}
.tabs > a:not(.button) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--s-2);
  font-weight: 600;
}
.tabs:has(form) {
  display: block;
}

/* Formularios */
label {
  display: block;
  margin-bottom: var(--s-5);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink);
}
select,
input,
textarea {
  display: block;
  width: 100%;
  min-height: var(--control-h);
  margin-top: var(--s-2);
  padding: var(--s-3) var(--s-4);
  font: inherit;
  font-size: var(--fs-md);
  font-weight: 400;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  transition:
    border-color 0.15s var(--ease),
    box-shadow 0.15s var(--ease);
}
select {
  appearance: none;
  padding-right: var(--s-10);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2356636b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
}
input:hover,
select:hover,
textarea:hover {
  border-color: var(--text-subtle);
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--green-700);
  box-shadow: 0 0 0 3px var(--green-100);
}
input:user-invalid,
select:user-invalid,
textarea:user-invalid {
  border-color: var(--red-700);
  box-shadow: 0 0 0 3px var(--red-100);
}
textarea {
  min-height: 112px;
  resize: vertical;
  line-height: 1.5;
}
input[type='file'] {
  padding: var(--s-2);
  font-size: var(--fs-sm);
  min-height: auto;
}
input[type='file']::file-selector-button {
  margin-right: var(--s-3);
  padding: var(--s-2) var(--s-4);
  font: inherit;
  font-weight: 600;
  color: var(--green-800);
  background: var(--green-50);
  border: 1px solid var(--green-200);
  border-radius: var(--r-sm);
  cursor: pointer;
}
fieldset {
  margin: var(--s-5) 0;
  padding: var(--s-4) var(--s-5) var(--s-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
legend {
  padding: 0 var(--s-2);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--ink);
}
.check {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-height: 44px;
  margin: 0;
  font-size: var(--fs-md);
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
}
.check input {
  width: 20px;
  height: 20px;
  min-height: auto;
  margin: 0;
  accent-color: var(--green-700);
  flex-shrink: 0;
}
.form-error {
  margin: var(--s-3) 0 0;
  color: var(--red-700);
  font-size: var(--fs-sm);
  font-weight: 500;
  white-space: pre-wrap;
}
.form-error:empty {
  display: none;
}
.form-error:not(:empty) {
  padding: var(--s-3) var(--s-4);
  background: var(--red-100);
  border-radius: var(--r-sm);
}
.location-status:empty {
  display: none;
}
.location-status {
  font-size: var(--fs-sm);
}

/* Tarjetas */
.card,
.search {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  box-shadow: var(--shadow-sm);
}
.card > :first-child {
  margin-top: 0;
}
.card > :last-child {
  margin-bottom: 0;
}
.card p {
  font-size: var(--fs-sm);
}
.narrow > .card,
.narrow > section.card,
.narrow > details.card {
  margin-top: var(--s-5);
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-5);
}
.narrow {
  max-width: 780px;
  margin: 0 auto;
}
.topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-5);
  margin-bottom: var(--s-6);
}
.topline h1,
.topline h2 {
  margin: 0;
}

/* Etiquetas y pastillas */
.eyebrow {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green-700);
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  margin: var(--s-3) 0;
  padding: 4px 10px;
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.4;
  color: var(--green-800);
  background: var(--green-100);
  border-radius: var(--r-full);
}
.badge::first-letter {
  text-transform: uppercase;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin: var(--s-3) 0;
  padding: 0;
  list-style: none;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  padding: 3px 10px;
  font-size: var(--fs-xs);
  line-height: 1.6;
  color: var(--text-muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
}
.verified {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  padding: 3px 10px 3px 8px;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--green-800);
  background: var(--green-100);
  border-radius: var(--r-full);
  white-space: nowrap;
}
.verified .icon {
  width: 15px;
  height: 15px;
}
.star,
.rating-line .icon {
  color: var(--amber-700);
}
.rating-line {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--ink);
  font-weight: 600;
}
.rating-line .icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
.rating-line span {
  color: var(--text-subtle);
  font-weight: 400;
}
.muted,
.empty-description {
  font-size: var(--fs-sm);
  color: var(--text-subtle);
}

/* Persona / avatar */
.avatar {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--green-100);
  color: var(--green-800);
  font-family: var(--font-head);
  font-size: var(--fs-lg);
  font-weight: 800;
  text-transform: uppercase;
}
.person {
  display: flex;
  gap: var(--s-4);
  align-items: center;
}
.person h3 {
  margin: 0 0 2px;
}
.person p {
  margin: 0;
  font-size: var(--fs-sm);
}
.person img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Tarjeta de trabajador */
.worker-card {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-5);
  transition:
    box-shadow 0.2s var(--ease),
    transform 0.2s var(--ease),
    border-color 0.2s var(--ease);
}
.worker-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
  transform: translateY(-2px);
}
.worker-card .person {
  align-items: flex-start;
}
.worker-card .person > div {
  min-width: 0;
  flex: 1;
}
.worker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  flex-wrap: wrap;
}
.worker-head h3 {
  font-size: var(--fs-md);
}
.worker-meta {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.worker-card .chips {
  margin: 0;
}
.worker-card > p {
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.worker-card > .button {
  margin-top: auto;
}

/* Estados vacíos y de carga */
.empty {
  display: grid;
  justify-items: center;
  gap: var(--s-2);
  padding: var(--s-10) var(--s-6);
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
  grid-column: 1 / -1;
}
.empty .empty-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: var(--s-2);
  border-radius: 50%;
  color: var(--green-700);
  background: var(--green-50);
}
.empty h3 {
  margin: 0;
}
.empty p {
  max-width: 420px;
  margin: 0 0 var(--s-2);
  font-size: var(--fs-sm);
}
.skeleton {
  display: grid;
  gap: var(--s-4);
}
.skeleton span {
  display: block;
  height: 18px;
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--surface-soft) 25%, #e8ede9 50%, var(--surface-soft) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
.skeleton span:nth-child(1) {
  width: 40%;
  height: 34px;
}
.skeleton span:nth-child(2) {
  width: 70%;
}
.skeleton span:nth-child(3) {
  height: 140px;
  border-radius: var(--r-lg);
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* Avisos */
#notice:not(:empty) {
  position: fixed;
  left: 50%;
  bottom: var(--s-6);
  z-index: 50;
  max-width: min(560px, 92vw);
  padding: var(--s-4) var(--s-5);
  transform: translateX(-50%);
  color: var(--surface);
  background: var(--ink);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  font-size: var(--fs-sm);
  font-weight: 500;
  animation: rise 0.25s var(--ease);
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
}

/* Desplegables */
details {
  margin-top: var(--s-6);
}
summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  list-style: none;
}
summary::-webkit-details-marker {
  display: none;
}
summary::before {
  content: '';
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s var(--ease);
  color: var(--green-700);
  flex-shrink: 0;
}
details[open] > summary::before {
  transform: rotate(45deg);
}

/* Ventanas */
dialog {
  max-height: 90dvh;
  overflow: auto;
  padding: var(--s-8);
  color: var(--text);
  border: 0;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
}
dialog::backdrop {
  background: rgb(15 40 32 / 55%);
  backdrop-filter: blur(3px);
}

/* ========== 5. Estructura de Yunta ========== */
[hidden] {
  display: none !important;
}
.saltar {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 100;
  padding: var(--s-2) var(--s-4);
  background: var(--surface);
  border-radius: var(--r-sm);
}
.saltar:focus {
  left: 8px;
}
header nav a {
  position: relative;
}
.contador {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  color: var(--surface);
  background: var(--red-700);
  border-radius: var(--r-full);
}
footer {
  flex-wrap: wrap;
}
footer .pie-texto {
  margin-left: 0;
  flex: 1;
}
footer a {
  color: var(--text-muted);
  font-weight: 500;
}
footer small {
  flex-basis: 100%;
  margin: 0;
}
.narrow.ancho {
  max-width: 1080px;
}
.centro {
  text-align: center;
}
.card.centro > .icon:first-child {
  width: 44px;
  height: 44px;
  padding: 10px;
  margin: 0 auto var(--s-2);
  color: var(--green-700);
  background: var(--green-50);
  border-radius: 50%;
  display: block;
}
.eyebrow .icon {
  width: 1.1em;
  height: 1.1em;
  margin-right: 4px;
  vertical-align: -0.2em;
}
.nota {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin: var(--s-3) 0;
}
.nota .icon {
  margin-right: 4px;
}
span.neg {
  color: var(--red-700);
  font-weight: 600;
}
.alerta {
  color: var(--amber-700);
}
p.ok {
  display: flex;
  gap: var(--s-2);
  align-items: flex-start;
  color: var(--green-800);
  font-weight: 500;
}
.fila {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4);
}
.lista {
  display: grid;
  gap: var(--s-3);
}
.acciones {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--s-3);
  margin-top: var(--s-5);
}
code {
  padding: 1px 6px;
  background: var(--surface-soft);
  border-radius: 6px;
  font-size: 0.9em;
}

/* Botones extra */
button.chico,
.button.chico {
  min-height: 38px;
  padding: var(--s-2) var(--s-3);
  font-size: var(--fs-sm);
}
button.texto {
  min-height: 36px;
  padding: var(--s-1) var(--s-2);
  color: var(--text-muted);
  background: transparent;
  border: 0;
  box-shadow: none;
  font-weight: 500;
  font-size: var(--fs-sm);
}
button.texto:hover {
  color: var(--red-700);
  background: var(--red-100);
}
button.peligro,
.button.peligro {
  background: var(--red-700);
  border-color: var(--red-700);
}
button.peligro:hover {
  background: #8a1f18;
  border-color: #8a1f18;
}

/* Pastillas de estado */
.chip.fuerte {
  color: var(--green-800);
  background: var(--green-100);
  border-color: var(--green-200);
  font-weight: 700;
}
.chip.urgente {
  color: var(--red-700);
  background: var(--red-100);
  border-color: #f6c9c4;
  font-weight: 700;
}
.chip.atencion {
  color: var(--amber-700);
  background: var(--amber-100);
  border-color: #f1d99a;
  font-weight: 600;
}
.chip .icon {
  width: 14px;
  height: 14px;
}
.chip.estado,
.chip.estado-envio {
  font-weight: 700;
}
.chip.estado.abierto,
.chip.estado-envio.espera,
.chip.estado-envio.enviado,
.chip.estado-envio.pausa {
  color: var(--blue-700);
  background: var(--blue-100);
  border-color: #c9ddef;
}
.chip.estado.concretado,
.chip.estado-envio.ok,
.chip.estado-envio.presupuestado,
.chip.estado-envio.aceptado,
.chip.estado.cerrado {
  color: var(--green-800);
  background: var(--green-100);
  border-color: var(--green-200);
}
.chip.estado-envio.atencion,
.chip.estado-envio.otra_fecha {
  color: var(--amber-700);
  background: var(--amber-100);
  border-color: #f1d99a;
}
.chip.estado-envio.neg,
.chip.estado-envio.rechazado,
.chip.estado-envio.vencido,
.chip.estado-envio.no_elegido,
.chip.estado-envio.cancelado,
.chip.estado.cancelado,
.chip.estado.ausencia {
  color: var(--text-muted);
  background: var(--surface-soft);
}
.fila-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-bottom: var(--s-3);
}

/* Avisos dentro de pantallas */
.aviso {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  margin: var(--s-4) 0;
  padding: var(--s-4) var(--s-5);
  font-size: var(--fs-sm);
  color: var(--text);
  background: var(--blue-100);
  border: 1px solid #c9ddef;
  border-radius: var(--r-md);
}
.aviso > .icon {
  margin-top: 2px;
  color: var(--blue-700);
}
.aviso p {
  margin: 0;
  color: inherit;
}
.aviso > div,
.aviso > p,
.aviso > span {
  flex: 1;
}
.aviso .button,
.aviso .tabs {
  margin: 0;
  flex-shrink: 0;
}
.aviso.atencion {
  background: var(--amber-100);
  border-color: #f1d99a;
}
.aviso.atencion > .icon {
  color: var(--amber-700);
}
.aviso.peligro {
  background: var(--red-100);
  border-color: #f6c9c4;
}
.aviso.peligro > .icon {
  color: var(--red-700);
}

/* Progreso */
.progress {
  height: 8px;
  margin: var(--s-2) 0;
  background: var(--surface-soft);
  border-radius: var(--r-full);
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--green-600);
  border-radius: inherit;
}

/* Avatares */
img.avatar {
  object-fit: cover;
  background: var(--green-100);
}
.avatar.grande {
  width: 96px;
  height: 96px;
  font-size: var(--fs-2xl);
}

/* Ventanas */
dialog.modal {
  width: min(640px, 94vw);
  padding: var(--s-8);
}
dialog.modal.chica {
  width: min(520px, 94vw);
}
dialog.modal.grande {
  width: min(900px, 96vw);
}
dialog.modal h2 {
  margin: var(--s-1) 0 var(--s-3);
  padding-right: var(--s-10);
}
dialog .cerrar {
  position: absolute;
  top: var(--s-4);
  right: var(--s-4);
  width: 40px;
  min-height: 40px;
  padding: 0;
  color: var(--text-muted);
  background: var(--surface-soft);
  border: 0;
  box-shadow: none;
  border-radius: 50%;
}
dialog .cerrar:hover {
  background: var(--line);
}
.opcion {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 0;
  padding: var(--s-3) var(--s-4);
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: none;
}
.opcion:hover {
  background: var(--green-50);
  border-color: var(--green-600);
}
.opcion span {
  font-weight: 400;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Pestañas */
.pestanas {
  display: flex;
  gap: var(--s-1);
  padding: var(--s-1);
  margin-bottom: var(--s-5);
  background: var(--surface-soft);
  border-radius: var(--r-md);
}
.pestanas > button,
.pestanas > a {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 42px;
  padding: var(--s-2) var(--s-3);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: var(--r-sm);
  text-decoration: none;
}
.pestanas > [aria-selected='true'] {
  color: var(--green-800);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.pestanas.grande {
  margin: var(--s-5) 0;
}
.pestanas.chica > button {
  min-height: 38px;
}

/* ========== 6. Inicio ========== */
.hero {
  display: grid;
  grid-template-columns: 1fr minmax(0, 480px);
  gap: var(--s-12);
  align-items: start;
  padding: var(--s-4) 0 var(--s-10);
}
.hero-texto {
  padding-top: var(--s-8);
}
.hero h1 .accent {
  color: var(--green-700);
}
.hero-texto > p {
  font-size: var(--fs-lg);
  max-width: 38ch;
}
.sello {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  max-width: 44ch;
  padding: var(--s-4);
  font-size: var(--fs-sm) !important;
  background: var(--surface);
  border: 1px solid var(--green-200);
  border-radius: var(--r-md);
}
.sello .icon {
  width: 36px;
  height: 36px;
  padding: 7px;
  color: var(--green-700);
  background: var(--green-100);
  border-radius: var(--r-sm);
}
.buscador {
  padding: var(--s-6);
  box-shadow: var(--shadow-md);
}
.buscador form {
  display: grid;
}
.buscador .centro {
  margin-top: var(--s-4);
}
.buscador textarea {
  min-height: 120px;
}
.fila-dictado {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin: calc(-1 * var(--s-3)) 0 var(--s-4);
}
.fila-dictado small {
  margin: 0;
}
.dictar[aria-pressed='true'] {
  color: var(--red-700);
  border-color: var(--red-700);
  background: var(--red-100);
}

/* Selector de fotos */
.fotos-campo {
  margin-bottom: var(--s-5);
}
.fotos-titulo {
  display: block;
  margin-bottom: var(--s-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink);
}
.fotos-lista {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.fotos-lista:not(:empty) {
  margin-bottom: var(--s-3);
}
.fotos-lista figure {
  position: relative;
  margin: 0;
}
.fotos-lista img {
  width: 84px;
  height: 84px;
  border-radius: var(--r-sm);
}
.fotos-lista .quitar {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 26px;
  min-height: 26px;
  padding: 0;
  background: var(--ink);
  border-color: var(--ink);
  border-radius: 50%;
}
.fotos-lista .quitar .icon {
  width: 14px;
  height: 14px;
}
.fotos-botones {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.fotos-botones label {
  margin: 0;
}
.fotos-campo small {
  margin-top: var(--s-2);
}

/* Resultado del asistente */
#resultado-ia:not(:empty) {
  margin-bottom: var(--s-10);
  scroll-margin-top: calc(var(--header-h) + var(--s-4));
}
.diagnostico {
  margin-bottom: var(--s-8);
  border-left: 4px solid var(--green-600);
}
.diag-cabeza {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
}
.diag-cabeza .eyebrow {
  margin-right: auto;
}
.diag-texto {
  margin: var(--s-4) 0;
  font-size: var(--fs-lg) !important;
  color: var(--ink);
}
.datos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: var(--s-3);
  margin: var(--s-4) 0;
}
.dato {
  padding: var(--s-3) var(--s-4);
  background: var(--surface-soft);
  border-radius: var(--r-md);
}
.dato.ancho {
  grid-column: 1 / -1;
}
.dato span {
  display: block;
  font-size: var(--fs-xs);
  color: var(--text-subtle);
}
.dato strong {
  font-size: var(--fs-md);
}
.dato small {
  margin-top: 2px;
}
.barra-accion {
  position: sticky;
  bottom: var(--s-4);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  margin-top: var(--s-6);
  padding: var(--s-4) var(--s-5);
  background: var(--surface);
  border: 1px solid var(--green-200);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
}
.barra-accion p {
  margin: 0;
  font-size: var(--fs-sm);
}

/* Tarjeta de trabajador */
.worker-card {
  position: relative;
}
.worker-card a.person {
  color: inherit;
  text-decoration: none;
}
.worker-card a.person:hover h3 {
  color: var(--green-700);
}
.medalla {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: var(--fs-xs);
  font-weight: 700;
  border-radius: var(--r-full);
  color: #7a5a00;
  background: #fbefc4;
}
.medalla .icon {
  width: 14px;
  height: 14px;
}
.medalla.m2 {
  color: #4b5560;
  background: #e6eaee;
}
.medalla.m3 {
  color: #7a4420;
  background: #f5dfcc;
}
.medalla.coincide {
  color: var(--green-800);
  background: var(--green-100);
}
.urgencias {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--red-700);
}
.urgencias .icon {
  width: 14px;
  height: 14px;
}
.chip.insignia .icon,
.chip.atributo .icon {
  color: var(--green-700);
}
.chip.insignia.oro {
  color: #7a5a00;
  background: #fbefc4;
  border-color: #f1dc8e;
  font-weight: 600;
}
.chip.insignia.oro .icon {
  color: #a37800;
}
.chip.atributo {
  color: var(--green-800);
  background: var(--green-50);
  border-color: var(--green-200);
}
.worker-pie {
  margin-top: auto;
}
.pie-doble {
  display: flex;
  gap: var(--s-2);
  align-items: center;
}
.pie-doble .button {
  flex: 1;
}
.elegir {
  min-height: 44px;
  padding: 0 var(--s-3);
  font-size: var(--fs-sm);
  font-weight: 600;
  background: var(--green-50);
  border: 1px solid var(--green-200);
  border-radius: var(--r-md);
}

.trust {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-5);
  padding: var(--s-8) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.trust span {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text);
}
.trust .icon {
  width: 40px;
  height: 40px;
  padding: 9px;
  color: var(--green-700);
  background: var(--green-50);
  border-radius: var(--r-md);
}
.destacados {
  margin-top: var(--s-12);
}
.destacados h2 {
  margin-top: var(--s-2);
}
.oficio-titulo {
  margin: var(--s-8) 0 var(--s-3);
  font-size: var(--fs-lg);
}
.como {
  margin-top: var(--s-16);
}
.pasos {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-5);
  padding: 0;
  list-style: none;
}
.pasos li {
  line-height: 1.5;
}
.pasos li > span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  font-family: var(--font-head);
  font-weight: 800;
  color: var(--surface);
  background: var(--green-700);
  border-radius: 50%;
}
.pasos p {
  font-size: var(--fs-sm);
}
.banda-trabajador {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-6);
  margin-top: var(--s-12);
  padding: var(--s-8);
  background: var(--green-900);
  border: 0;
}
.banda-trabajador h2,
.banda-trabajador .eyebrow {
  color: var(--surface);
}
.banda-trabajador h2 {
  margin: var(--s-2) 0;
}
.banda-trabajador p {
  margin: 0;
  color: var(--green-200);
}
.banda-trabajador .button {
  flex-shrink: 0;
  color: var(--green-900);
  background: var(--surface);
  border-color: var(--surface);
}

/* Búsqueda */
.filtros {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr auto;
  gap: var(--s-3);
  align-items: center;
  margin-bottom: var(--s-6);
  padding: var(--s-4);
}
.filtros select,
.filtros input {
  margin: 0;
}
.filtros .form-error {
  grid-column: 1 / -1;
}

/* ========== 7. Perfil público ========== */
.profile-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-6);
  align-items: center;
}
.profile-hero .avatar {
  width: 112px;
  height: 112px;
  font-size: var(--fs-3xl);
}
.profile-hero h1 {
  margin: 0 0 var(--s-1);
  font-size: var(--fs-3xl);
}
.profile-hero .worker-meta {
  margin: 0 0 var(--s-2);
}
.presentacion {
  margin-top: var(--s-4);
  font-size: var(--fs-md) !important;
  color: var(--text) !important;
}
.ficha {
  display: grid;
  gap: var(--s-3);
  margin: var(--s-5) 0 0;
}
.ficha div {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px solid var(--line);
}
.ficha dt {
  display: flex;
  gap: var(--s-2);
  align-items: center;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink);
}
.ficha dt .icon {
  color: var(--green-700);
}
.ficha dd {
  margin: 0;
  font-size: var(--fs-sm);
}
.profile-section {
  margin-top: var(--s-8);
}
.profile-section h2 {
  margin: 0 0 var(--s-4);
  font-size: var(--fs-xl);
}
.samples {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--s-4);
}
.trabajo {
  padding: var(--s-3);
}
.trabajo img {
  height: 170px;
}
.trabajo h3 {
  margin: var(--s-3) 0 var(--s-1);
  font-size: var(--fs-md);
}
.trabajo p {
  margin: 0;
}
.quote {
  padding: var(--s-4) 0;
  border-top: 1px solid var(--line);
}
.quote .chip {
  margin-left: var(--s-2);
}
.quote p {
  margin: var(--s-1) 0 0;
  font-size: var(--fs-md);
  color: var(--text);
}
.quote .eyebrow {
  display: block;
  margin-bottom: var(--s-1);
}
.estrellas {
  color: var(--amber-700);
  letter-spacing: 2px;
  white-space: nowrap;
}
.estrellas span {
  color: var(--line-strong);
}
.subscores {
  display: grid;
  gap: var(--s-2);
  margin-bottom: var(--s-4);
}
.subscores > div {
  display: grid;
  grid-template-columns: 170px 1fr 36px;
  gap: var(--s-3);
  align-items: center;
  font-size: var(--fs-sm);
}
.subscores .progress {
  margin: 0;
}
.profile-cta {
  position: sticky;
  bottom: var(--s-4);
  z-index: 5;
  margin-top: var(--s-8);
  padding: var(--s-4) var(--s-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--green-200);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
}
.profile-cta p {
  margin: 0;
  font-size: var(--fs-sm);
}
.back-link {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: var(--s-2);
  min-height: 44px;
  margin-bottom: var(--s-2);
  font-weight: 600;
}

/* ========== 8. Acceso ========== */
.auth {
  max-width: 520px;
}
.auth form {
  display: grid;
}
.auth .card {
  padding: var(--s-8);
}
.enlaces-auth {
  margin: var(--s-5) 0 0;
  text-align: center;
}
.enlaces-auth a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
}
.check.legal {
  align-items: flex-start;
  margin-bottom: var(--s-5);
  font-size: var(--fs-sm);
}
.check.legal input {
  margin-top: 2px;
}

/* ========== 9. Hogar ========== */
.problema-item {
  display: block;
  color: inherit;
  text-decoration: none;
  transition:
    box-shadow 0.2s var(--ease),
    border-color 0.2s var(--ease);
}
.problema-item:hover {
  text-decoration: none;
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}
.problema-item.resaltado {
  border-color: #f1d99a;
  background: #fffbf0;
}
.problema-texto {
  margin: 0 0 var(--s-2);
  color: var(--text) !important;
  font-size: var(--fs-md) !important;
}
.problema-item .problema-texto,
.solicitud-item .problema-texto {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.problema-item small,
.solicitud-item small {
  margin: 0;
}
.problema-item small .icon,
.solicitud-item small .icon {
  width: 14px;
  height: 14px;
  margin-right: 4px;
}
.problema-cabeza h1 {
  margin: var(--s-1) 0 var(--s-3);
}
.fotos-problema {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--s-2);
  margin: var(--s-4) 0;
}
.fotos-problema img {
  height: 140px;
}
.cuando {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  margin: var(--s-3) 0;
  font-weight: 600;
  color: var(--ink);
}
.cuando .icon {
  color: var(--green-700);
}
.envio {
  margin-bottom: var(--s-3);
  border-left: 4px solid var(--line-strong);
}
.envio.ok {
  border-left-color: var(--green-600);
}
.envio.espera {
  border-left-color: var(--blue-700);
}
.envio.atencion {
  border-left-color: var(--amber-700);
}
.envio.neg {
  opacity: 0.75;
}
.envio-cabeza {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-3);
}
.envio-cabeza a.person {
  color: inherit;
  text-decoration: none;
}
.envio .tabs {
  margin-bottom: 0;
}
.presupuesto {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3);
  margin: var(--s-3) 0;
  padding: var(--s-4);
  background: var(--green-50);
  border-radius: var(--r-md);
}
.presupuesto span {
  display: block;
  font-size: var(--fs-xs);
  color: var(--text-subtle);
}
.presupuesto strong {
  font-family: var(--font-head);
  font-size: var(--fs-xl);
}
.presupuesto .mensaje,
.presupuesto small {
  grid-column: 1 / -1;
  margin: 0;
}
.mensaje {
  font-style: italic;
  color: var(--text) !important;
}

/* Selector de horario */
.selector-dias {
  display: flex;
  gap: var(--s-2);
  overflow-x: auto;
  padding-bottom: var(--s-2);
  scroll-snap-type: x mandatory;
}
.selector-dias .dia {
  flex: 0 0 auto;
  display: grid;
  min-width: 128px;
  min-height: 64px;
  padding: var(--s-2) var(--s-3);
  font-size: var(--fs-sm);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: none;
  scroll-snap-align: start;
}
.selector-dias .dia small {
  margin: 0;
  font-weight: 400;
}
.selector-horas {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: var(--s-2);
  margin-top: var(--s-4);
}
.selector-horas .hora {
  min-height: 44px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: none;
}
.selector-dias .dia:hover,
.selector-horas .hora:hover {
  background: var(--green-50);
  border-color: var(--green-600);
}
.selector-dias .dia[aria-pressed='true'],
.selector-horas .hora[aria-pressed='true'] {
  color: var(--surface);
  background: var(--green-700);
  border-color: var(--green-700);
}
.selector-dias .dia[aria-pressed='true'] small {
  color: var(--green-100);
}

/* Servicio */
.servicio {
  margin: var(--s-5) 0;
  border: 2px solid var(--green-200);
}
.servicio .topline {
  margin-bottom: var(--s-2);
}
.servicio h2 {
  margin: var(--s-1) 0 0;
}
.servicio .tabs {
  margin-bottom: 0;
}
.estrellas-input {
  margin: 0 0 var(--s-4);
  padding: 0;
  border: 0;
}
.estrellas-input legend {
  padding: 0;
  margin-bottom: var(--s-1);
}
.estrellas-input > div {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 2px;
}
.estrellas-input input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.estrellas-input label {
  margin: 0;
  font-size: 34px;
  line-height: 1;
  color: var(--line-strong);
  cursor: pointer;
}
.estrellas-input label:hover,
.estrellas-input label:hover ~ label,
.estrellas-input input:checked ~ label {
  color: var(--amber-700);
}
.estrellas-input input:focus-visible + label {
  outline: 2px solid var(--green-600);
  border-radius: 4px;
}
.criterios {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-3);
}
.criterios .estrellas-input label {
  font-size: 26px;
}
.si-no {
  display: flex;
  gap: var(--s-4);
  flex-wrap: wrap;
}

/* Avisos */
.avisos {
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.avisos li + li {
  border-top: 1px solid var(--line);
}
.avisos a,
.avisos li > div {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: var(--s-3);
  align-items: baseline;
  padding: var(--s-4) var(--s-5);
  color: inherit;
  text-decoration: none;
}
.avisos a:hover {
  background: var(--green-50);
}
.avisos p {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
}
.avisos small {
  margin: 0;
  white-space: nowrap;
}
.punto {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.avisos .nuevo .punto {
  background: var(--green-600);
}
.avisos .nuevo p {
  font-weight: 600;
  color: var(--ink);
}

/* Cuenta e historial */
.enlaces {
  display: grid;
  gap: var(--s-1);
}
.enlaces a {
  display: flex;
  gap: var(--s-3);
  align-items: center;
  min-height: 48px;
  padding: var(--s-2) var(--s-3);
  font-weight: 600;
  color: var(--ink);
  border-radius: var(--r-md);
}
.enlaces a:hover {
  background: var(--green-50);
  text-decoration: none;
}
.enlaces .icon {
  color: var(--green-700);
}
.historial-item h3 {
  margin: 0 0 var(--s-2);
  font-size: var(--fs-md);
}
.cifras {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-5);
  margin: var(--s-3) 0 0;
  font-size: var(--fs-sm);
}
.cifras.grande {
  gap: var(--s-4) var(--s-8);
  margin-bottom: var(--s-4);
}
.cifras.grande strong {
  display: block;
  font-family: var(--font-head);
  font-size: var(--fs-2xl);
}
.historial-item .tabs {
  margin: var(--s-3) 0 0;
}

/* ========== 10. Trabajador ========== */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--s-4);
  margin: var(--s-5) 0;
}
.metric {
  display: grid;
  align-content: start;
  gap: var(--s-1);
  color: inherit;
  text-decoration: none;
}
a.metric:hover {
  text-decoration: none;
  border-color: var(--green-600);
}
.metric > span {
  display: flex;
  gap: var(--s-2);
  align-items: center;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.metric > span .icon {
  color: var(--green-700);
}
.metric strong {
  font-family: var(--font-head);
  font-size: var(--fs-2xl);
  line-height: 1.2;
}
.metric small {
  margin: 0;
}
section.card {
  margin-bottom: var(--s-5);
}
section.card .topline {
  margin-bottom: var(--s-3);
}
section.card .topline h2 {
  font-size: var(--fs-xl);
}
.agenda {
  margin: 0;
  padding: 0;
  list-style: none;
}
.agenda a {
  display: grid;
  padding: var(--s-3) 0;
  color: inherit;
  border-top: 1px solid var(--line);
}
.agenda a span {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.panel-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-4);
}
.panel-links a {
  display: grid;
  gap: var(--s-2);
  font-weight: 600;
  color: var(--ink);
}
.panel-links a .icon {
  width: 36px;
  height: 36px;
  padding: 8px;
  color: var(--green-700);
  background: var(--green-50);
  border-radius: var(--r-md);
}
.panel-links a:hover {
  text-decoration: none;
  border-color: var(--green-600);
}
.pasos-alta {
  display: grid;
  gap: var(--s-3);
  margin: var(--s-6) 0;
  padding: 0;
  list-style: none;
}
.pasos-alta li {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: var(--s-4);
  align-items: center;
  padding: var(--s-4) var(--s-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.pasos-alta h3 {
  margin: 0;
  font-size: var(--fs-md);
}
.pasos-alta p {
  margin: 0;
  font-size: var(--fs-sm);
}
.pasos-alta .marca {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
}
.pasos-alta .hecho .marca {
  color: var(--surface);
  background: var(--green-600);
  border-color: var(--green-600);
}
.pasos-alta .hecho .marca .icon {
  width: 18px;
  height: 18px;
}
.foto-perfil {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  margin-bottom: var(--s-5);
}
.foto-perfil label {
  margin: 0;
}
.checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0 var(--s-4);
}
.checks.barrios {
  max-height: 280px;
  overflow-y: auto;
  padding: var(--s-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.checks .check[hidden] {
  display: none;
}
.filtro-barrios {
  margin: 0 0 var(--s-3);
}
.atributos-campos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--s-2);
}
.atributos-campos input {
  margin: 0;
}
.fila-horario {
  display: grid;
  grid-template-columns: 140px 1fr auto 1fr;
  gap: var(--s-3);
  align-items: center;
  padding: var(--s-1) 0;
}
.fila-horario select {
  margin: 0;
  min-height: 42px;
}
.fila-horario span {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.destacado-check {
  margin: var(--s-2) 0 var(--s-5);
  padding: var(--s-3) var(--s-4);
  font-weight: 600;
  background: var(--red-100);
  border-radius: var(--r-md);
}
.destacado-check .icon {
  color: var(--red-700);
}
.docs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-4);
  margin: var(--s-4) 0;
}
.doc {
  display: grid;
  align-content: start;
  gap: var(--s-2);
}
.doc h3 {
  margin: 0;
  font-size: var(--fs-md);
}
.doc p {
  margin: 0;
  font-size: var(--fs-sm);
}
.doc img,
.doc-vacio {
  height: 160px;
}
.doc-vacio {
  display: grid;
  place-items: center;
  font-size: var(--fs-sm);
  color: var(--text-subtle);
  background: var(--surface-soft);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
}
.doc label {
  margin: 0;
  justify-self: start;
}
.doc small {
  margin: 0;
}
.dato-fijo {
  padding: var(--s-3) var(--s-4);
  background: var(--surface-soft);
  border-radius: var(--r-md);
}

/* Plan */
.plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-5);
  margin: var(--s-6) 0;
}
.plan {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.plan.actual {
  border: 2px solid var(--green-600);
}
.plan.premium {
  background: linear-gradient(180deg, var(--green-50), var(--surface) 40%);
}
.plan h3 {
  margin: 0;
  font-size: var(--fs-2xl);
}
.big {
  font-family: var(--font-head);
  font-size: var(--fs-3xl);
  font-weight: 800;
  color: var(--ink);
}
.big small {
  display: inline;
  margin-left: var(--s-2);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 500;
}
.plan ul {
  flex: 1;
  margin: var(--s-2) 0;
  padding: 0;
  list-style: none;
}
.plan li {
  display: flex;
  gap: var(--s-2);
  align-items: flex-start;
  line-height: 1.5;
  padding: 3px 0;
  font-size: var(--fs-sm);
}
.plan li .icon {
  margin-top: 2px;
  color: var(--green-700);
}
.plan label {
  margin-bottom: var(--s-3);
}
.resumen-plan .datos {
  margin-top: 0;
}
.tabla-envoltura {
  overflow-x: auto;
}
.tabla {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
.tabla th {
  padding: var(--s-2) var(--s-3);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-align: left;
  color: var(--text-subtle);
  border-bottom: 1px solid var(--line-strong);
}
.tabla td {
  padding: var(--s-3);
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.tabla td small {
  margin: 0;
}

/* Calendario */
.dia-agenda {
  margin-bottom: var(--s-4);
}
.dia-agenda h3 {
  margin: var(--s-5) 0 var(--s-2);
  font-size: var(--fs-md);
}
.ag {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: var(--s-3);
  align-items: center;
  margin-bottom: var(--s-2);
  padding: var(--s-3) var(--s-4);
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: var(--r-md);
}
a.ag:hover {
  text-decoration: none;
  border-color: var(--line-strong);
}
.ag span {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.ag.servicio {
  border-left-color: var(--green-600);
}
.ag.presupuesto {
  border-left-color: var(--blue-700);
}
.ag.ocupado {
  border-left-color: var(--text-subtle);
  background: var(--surface-soft);
}

/* Problemas recibidos */
.solicitud-item {
  display: block;
  color: inherit;
}
.solicitud-item:hover {
  text-decoration: none;
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}
.solicitud-item.enviado {
  border-left: 4px solid var(--blue-700);
}
.solicitud-item.pausa {
  border-left: 4px solid var(--amber-700);
}
.responder {
  border: 2px solid var(--blue-100);
}
.responder h2 {
  margin: 0 0 var(--s-2);
  font-size: var(--fs-xl);
}
.hogar-ficha {
  display: flex;
  gap: var(--s-3);
  align-items: center;
  margin-top: var(--s-4);
  padding: var(--s-3) var(--s-4);
  background: var(--surface-soft);
  border-radius: var(--r-md);
}
.hogar-ficha > .icon {
  width: 36px;
  height: 36px;
  padding: 8px;
  color: var(--green-700);
  background: var(--surface);
  border-radius: 50%;
}
.hogar-ficha > div {
  display: grid;
  gap: 2px;
}
.hogar-ficha small {
  margin: 0;
}

/* Barras */
.barras {
  display: grid;
  gap: var(--s-2);
}
.barra {
  display: grid;
  grid-template-columns: minmax(90px, 38%) 1fr auto;
  gap: var(--s-3);
  align-items: center;
  font-size: var(--fs-sm);
}
.barra > div {
  height: 10px;
  background: var(--surface-soft);
  border-radius: var(--r-full);
  overflow: hidden;
}
.barra i {
  display: block;
  height: 100%;
  background: var(--green-600);
  border-radius: inherit;
}
.barra strong {
  text-align: right;
}

/* Recibo */
.recibo {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--s-10);
}
.recibo-cabeza {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: var(--s-5);
  border-bottom: 2px solid var(--ink);
}
.recibo-cabeza h1 {
  margin: 0;
  font-size: var(--fs-2xl);
  text-align: right;
}
.recibo-cabeza p {
  margin: 0;
  text-align: right;
}
.recibo dl {
  display: grid;
  gap: var(--s-3);
  margin: var(--s-6) 0;
}
.recibo dl div {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: var(--s-3);
}
.recibo dt {
  font-size: var(--fs-sm);
  color: var(--text-subtle);
}
.recibo dd {
  margin: 0;
  color: var(--ink);
}
.total {
  display: flex;
  justify-content: space-between;
  padding: var(--s-4) 0;
  font-size: var(--fs-lg);
  border-top: 1px solid var(--line-strong);
}
.total strong {
  font-family: var(--font-head);
  font-size: var(--fs-2xl);
}

/* ========== 11. Administración ========== */
.admin {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: var(--s-6);
  align-items: start;
}
.admin-nav {
  position: sticky;
  top: calc(var(--header-h) + var(--s-4));
  padding: var(--s-4);
}
.admin-nav nav {
  display: grid;
  gap: 2px;
  margin-top: var(--s-3);
}
.admin-nav a {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: var(--s-2);
  align-items: center;
  min-height: 42px;
  padding: var(--s-2) var(--s-3);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text);
  border-radius: var(--r-sm);
}
.admin-nav a:hover {
  text-decoration: none;
  background: var(--green-50);
}
.admin-nav a[aria-current='page'] {
  font-weight: 700;
  color: var(--green-800);
  background: var(--green-100);
}
.admin-nav .icon {
  width: 18px;
  height: 18px;
  color: var(--green-700);
}
.admin-cuerpo > .topline {
  margin-bottom: var(--s-3);
}
.admin-cuerpo h2 {
  margin-top: var(--s-8);
}
.admin-cuerpo .card {
  margin-bottom: var(--s-4);
}
.revision .docs figure {
  margin: 0;
}
.revision .docs img {
  height: 220px;
  object-fit: contain;
  background: var(--ink);
}
.revision figcaption {
  margin-top: var(--s-1);
  font-size: var(--fs-xs);
  color: var(--text-subtle);
}
.reportes {
  padding: 0;
  list-style: none;
}
.reportes li {
  padding: var(--s-2) 0;
  border-top: 1px solid var(--line);
}
.reportes p {
  margin: 0;
  color: var(--text);
}
.reportes small {
  margin: 0;
}
.dos-columnas {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4);
}
.fila-boton {
  display: flex;
  gap: var(--s-2);
  margin-bottom: var(--s-4);
}
.fila-boton input {
  margin: 0;
}
.fila-boton button {
  flex-shrink: 0;
}

/* ========== 12. Páginas legales ========== */
.legal-cabeza {
  max-width: 780px;
}
.vigencia {
  font-size: var(--fs-sm);
  font-weight: 600;
}
.legal-cuerpo {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: var(--s-8);
  align-items: start;
  margin-top: var(--s-6);
}
.legal-indice {
  position: sticky;
  top: calc(var(--header-h) + var(--s-4));
  font-size: var(--fs-sm);
}
.legal-indice ol {
  margin: var(--s-2) 0 0;
  padding-left: var(--s-5);
}
.legal-indice li {
  line-height: 1.5;
  padding: 3px 0;
}
.legal-texto {
  max-width: 70ch;
}
.legal-texto section {
  scroll-margin-top: calc(var(--header-h) + var(--s-4));
  padding-bottom: var(--s-4);
}
.legal-texto h2 {
  margin: var(--s-8) 0 var(--s-3);
  font-size: var(--fs-xl);
}
.legal-texto section:first-child h2 {
  margin-top: 0;
}
.legal-texto h2 span {
  color: var(--green-700);
}
.legal-texto p,
.legal-texto li {
  color: var(--text);
  line-height: 1.7;
}
.legal-texto li {
  margin-bottom: var(--s-2);
}
.aviso-config .icon {
  width: 40px;
  height: 40px;
  color: var(--amber-700);
}

/* ========== 13. Pantallas medianas ========== */
@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    gap: var(--s-6);
  }
  .hero-texto {
    padding-top: 0;
  }
  .grid,
  .plans {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pasos,
  .panel-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin,
  .legal-cuerpo {
    grid-template-columns: 1fr;
  }
  .admin-nav,
  .legal-indice {
    position: static;
  }
  .admin-nav nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .filtros {
    grid-template-columns: 1fr 1fr;
  }
}

/* ========== 14. Celular ========== */
@media (max-width: 720px) {
  :root {
    --header-h: 60px;
  }
  body:has(#tab-bar:not([hidden])) {
    padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  }
  header {
    padding: var(--s-2) var(--s-4);
  }
  .logo {
    font-size: 1.625rem;
  }
  body:has(#tab-bar:not([hidden])) header nav {
    display: none;
  }
  header nav .nav-label {
    display: none;
  }
  header nav a:not(.button) .icon + .nav-label {
    display: none;
  }
  .tab-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    padding: var(--s-1) var(--s-1) calc(var(--s-1) + env(safe-area-inset-bottom));
    background: rgb(255 255 255 / 96%);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 16px rgb(16 40 30 / 6%);
  }
  .tab-bar[hidden] {
    display: none;
  }
  .tab-bar a {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 54px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-subtle);
    border-radius: var(--r-md);
  }
  .tab-bar a:hover {
    text-decoration: none;
  }
  .tab-bar a .icon {
    width: 22px;
    height: 22px;
  }
  .tab-bar a[aria-current='page'] {
    color: var(--green-700);
  }
  .tab-bar a[aria-current='page']::before {
    content: '';
    position: absolute;
    top: 0;
    width: 28px;
    height: 3px;
    background: var(--green-700);
    border-radius: 0 0 3px 3px;
  }
  .tab-bar .contador {
    position: absolute;
    top: 4px;
    left: calc(50% + 6px);
    min-width: 18px;
    height: 18px;
    font-size: 10px;
  }
  main {
    padding: var(--s-6) var(--s-4) var(--s-12);
  }
  h1 {
    font-size: 2.25rem;
  }
  h1.page-title,
  .narrow > h1,
  .topline h1 {
    font-size: var(--fs-2xl);
  }
  .topline {
    flex-wrap: wrap;
  }
  .grid,
  .plans,
  .trust,
  .pasos,
  .docs,
  .dos-columnas,
  .criterios,
  .fila,
  .filtros {
    grid-template-columns: 1fr;
  }
  .panel-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .card,
  .buscador,
  .auth .card,
  dialog.modal {
    padding: var(--s-5);
  }
  .datos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .profile-hero {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: var(--s-4);
  }
  .profile-hero .avatar {
    width: 88px;
    height: 88px;
  }
  .ficha div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .subscores > div {
    grid-template-columns: 1fr 2fr 32px;
  }
  .profile-cta,
  .barra-accion {
    bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + var(--s-2));
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  body:not(:has(#tab-bar:not([hidden]))) .profile-cta,
  body:not(:has(#tab-bar:not([hidden]))) .barra-accion {
    bottom: var(--s-2);
  }
  .fila-horario {
    grid-template-columns: 1fr 1fr auto 1fr;
    gap: var(--s-2);
  }
  .fila-horario .check {
    grid-column: 1 / -1;
  }
  .fila-horario select:first-of-type {
    grid-column: 1 / 3;
  }
  .ag {
    grid-template-columns: 1fr auto;
  }
  .ag span {
    grid-column: 1;
  }
  .pasos-alta li {
    grid-template-columns: 32px 1fr;
  }
  .pasos-alta li .button {
    grid-column: 2;
    justify-self: start;
  }
  .barra {
    grid-template-columns: 1fr 1fr 56px;
  }
  .recibo {
    padding: var(--s-5);
  }
  .recibo dl div {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .admin-nav nav {
    grid-template-columns: 1fr;
  }
  .banda-trabajador {
    flex-direction: column;
    align-items: stretch;
    padding: var(--s-6);
  }
  .envio-cabeza {
    flex-direction: column;
  }
  .aviso {
    flex-wrap: wrap;
  }
  footer {
    padding: var(--s-6) var(--s-4) var(--s-8);
  }
}

/* ========== 15. Impresión (recibo) ========== */
@media print {
  header,
  footer,
  .tab-bar,
  .no-imprimir,
  #notice {
    display: none !important;
  }
  body {
    background: #fff;
    padding: 0 !important;
  }
  main {
    padding: 0;
  }
  .recibo {
    border: 0;
    box-shadow: none;
  }
}
