/* Backoffice Fons · misma tinta, crema y cobre del sitio. Pensado primero para el celular. */
@font-face { font-family: "Manrope"; src: url("/static/manrope.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
:root {
  --ink: #0E0F12; --ink2: #17181C; --paper: #F2EFE8; --bg: #F6F3EC; --white: #FFFFFF;
  --line: #E2DDD3; --sub: #5B6168; --muted: #8A857B; --copper: #C58C5A; --copper-dk: #8A5A34;
  --red: #B5483C; --red-bg: #F7E3DF; --amber: #9A6A12; --amber-bg: #F7EBD3; --green: #3F6B52;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.5; }
a { color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }

/* barra superior */
.top { position: sticky; top: 0; z-index: 20; background: var(--ink); color: var(--paper); display: flex; align-items: center; gap: 24px;
  padding: 12px max(20px, env(safe-area-inset-right)) 12px max(20px, env(safe-area-inset-left)); padding-top: calc(12px + env(safe-area-inset-top)); }
.logo { font-weight: 800; letter-spacing: -.05em; font-size: 22px; text-decoration: none; color: var(--paper); white-space: nowrap; }
.logo span { font-weight: 500; letter-spacing: 0; font-size: 13px; color: #A39E94; margin-left: 4px; }
.logo.grande { font-size: 40px; color: var(--ink); }
.tabs { display: flex; gap: 4px; flex: 1; }
.tabs a { text-decoration: none; color: #A39E94; font-weight: 600; font-size: 14px; padding: 8px 12px; border-radius: 999px; }
.tabs a[aria-current] { background: var(--paper); color: var(--ink); }
.who { display: flex; gap: 12px; align-items: center; font-size: 14px; color: #A39E94; }
.who a { color: var(--paper); }
.bottom { display: none; }

.main { max-width: 1180px; margin: 0 auto; padding: 24px max(16px, env(safe-area-inset-right)) 96px max(16px, env(safe-area-inset-left)); display: flex; flex-direction: column; gap: 16px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
h1 { margin: 0; font-size: clamp(26px, 4vw, 34px); letter-spacing: -.04em; line-height: 1.1; }
h2 { margin: 0 0 10px; font-size: 17px; letter-spacing: -.01em; }
h2 span { color: var(--muted); font-weight: 600; }
.sub { margin: 4px 0 0; color: var(--sub); font-size: 15px; }
.volver { font-size: 14px; color: var(--sub); text-decoration: none; display: inline-block; margin-bottom: 4px; }
.acciones { display: flex; gap: 8px; flex-wrap: wrap; }
.ayuda { color: var(--sub); font-size: 14px; margin: 0 0 8px; }

.card { background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.card-head h2 { margin: 0; }
.card.urgente { border-color: #E6B8B0; background: #FFF8F6; }
.card.urgente h2 { color: var(--red); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--ink);
  background: var(--ink); color: var(--paper); font: inherit; font-weight: 700; font-size: 14.5px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn.ghost { background: transparent; color: var(--ink); border-color: #CFC9BD; }
.btn.chico { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn.grande { min-height: 52px; padding: 0 28px; font-size: 16px; }
.link { color: var(--copper-dk); font-weight: 600; font-size: 14px; }

.lista { list-style: none; margin: 0 0 8px; padding: 0; }
.lista li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.lista li:first-child { border-top: 0; }
.lista li > a, .lista li > div { display: flex; flex-direction: column; text-decoration: none; min-width: 0; flex: 1; }
.lista b { font-weight: 700; }
.lista span { color: var(--sub); font-size: 14px; }
.lista .resp { margin: 4px 0 0; font-size: 14px; color: var(--ink); }
.lista li.hecho b { text-decoration: line-through; color: var(--muted); }
.vacio { color: var(--muted); font-size: 14.5px; }

.pill { display: inline-block; white-space: nowrap; font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #EFEBE3; color: var(--sub); text-decoration: none; }
.pill.rojo { background: var(--red-bg); color: var(--red); }
.pill.ambar { background: var(--amber-bg); color: var(--amber); }

.cifras { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cifras a { text-decoration: none; background: var(--bg); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; }
.cifras b { font-size: 28px; letter-spacing: -.04em; }
.cifras span { color: var(--sub); font-size: 13.5px; }

.filtros { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.filtros a { white-space: nowrap; text-decoration: none; font-size: 14px; font-weight: 600; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); color: var(--sub); }
.filtros a[aria-current] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.buscar { display: flex; gap: 8px; }
.buscar input { flex: 1; }

.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; font-weight: 600; color: var(--sub); flex: 1; min-width: 0; }
.form .row { display: flex; gap: 12px; flex-wrap: wrap; }
.form .row > label { min-width: 200px; }
.form.inline { flex-direction: row; flex-wrap: wrap; align-items: flex-end; margin-top: 8px; }
.form.inline label { min-width: 160px; }
.form .check { flex-direction: row; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); }
input, select, textarea { font: inherit; font-size: 16px; color: var(--ink); background: var(--white); border: 1px solid #D6D0C4; border-radius: 12px; padding: 10px 12px; width: 100%; min-height: 44px; }
textarea { resize: vertical; }
.stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }

.datos { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; margin: 0; font-size: 15px; }
.datos dt { color: var(--sub); font-size: 13.5px; font-weight: 600; padding-top: 2px; }
.datos dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.aviso { background: var(--amber-bg); color: #5E430C; border-radius: 12px; padding: 10px 12px; font-size: 14px; margin: 0 0 12px; }
.error { background: var(--red-bg); color: var(--red); border-radius: 12px; padding: 10px 12px; }
.convertir { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.convertir summary { cursor: pointer; font-weight: 700; color: var(--copper-dk); margin-bottom: 10px; }

.log { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 10px; }
.log li { font-size: 15px; display: flex; flex-direction: column; border-left: 2px solid var(--line); padding-left: 12px; }
.log .meta { font-size: 12.5px; color: var(--muted); }

/* tablero de casos */
.tablero { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; align-items: start; }
.col { background: #EEEAE2; border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.col h2 { margin: 2px 4px 4px; font-size: 15px; }
.tarjeta { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; text-decoration: none; display: flex; flex-direction: column; gap: 3px; }
.tarjeta span { color: var(--sub); font-size: 14px; }
.tarjeta .pie { font-size: 12.5px; color: var(--muted); }
.tarjeta .pill { align-self: flex-start; margin-top: 4px; }

/* etapas y checklist */
.etapas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.etapa input { position: absolute; opacity: 0; }
.etapa span { display: flex; justify-content: center; align-items: center; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); font-weight: 700; font-size: 14px; color: var(--sub); cursor: pointer; text-align: center; }
.etapa input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.etapa input:focus-visible + span { outline: 2px solid var(--copper); outline-offset: 2px; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.check-btn { width: 100%; display: flex; gap: 12px; align-items: center; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: 11px 2px; font: inherit; font-size: 15px; color: var(--ink); cursor: pointer; min-height: 44px; }
.checks li:first-child .check-btn { border-top: 0; }
.check-btn .box { flex: 0 0 22px; height: 22px; border: 2px solid #C9C2B4; border-radius: 7px; }
.check-btn.on .box { background: var(--green); border-color: var(--green); box-shadow: inset 0 0 0 3px var(--white); }
.check-btn.on .txt { color: var(--muted); text-decoration: line-through; }
.check-btn .meta { margin-left: auto; font-size: 12.5px; color: var(--muted); }

.tabla-wrap { overflow-x: auto; }
.tabla { border-collapse: collapse; width: 100%; font-size: 14.5px; }
.tabla th, .tabla td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }

.entrar { max-width: 420px; margin: 12vh auto 0; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.entrar p { margin: 0; color: var(--sub); }

@media (max-width: 860px) {
  .tabs, .who span { display: none; }
  .top { justify-content: space-between; }
  .grid2 { grid-template-columns: 1fr; }
  .cifras { grid-template-columns: repeat(2, 1fr); }
  .etapas { grid-template-columns: repeat(2, 1fr); }
  .datos { grid-template-columns: 1fr; gap: 2px; }
  .datos dd { margin-bottom: 8px; }
  .bottom { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--ink);
    padding: 6px max(6px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left)); gap: 4px; }
  .bottom a { flex: 1; text-align: center; text-decoration: none; color: #A39E94; font-weight: 700; font-size: 12.5px; padding: 10px 2px; border-radius: 12px; }
  .bottom a[aria-current] { background: var(--ink2); color: var(--paper); }
  .tablero { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 82%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .col { scroll-snap-align: start; }
}
