/* Panel privado de prospección.
   Valores copiados de frontend/src/styles/tokens.css (esta imagen no incluye el frontend):
   si cambian allí, se cambian aquí. Sin sombras, sin degradados, radios 3/6 px, sin JS. */

@font-face { font-family: "Inter"; src: url("/fuentes/inter_latest_latin-400-normal.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fuentes/inter_latest_latin-600-normal.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("/fuentes/SpaceGrotesk-VariableFont_wght.ttf") format("truetype"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fuentes/ibm-plex-mono_latest_latin-400-normal.ttf") format("truetype"); font-weight: 400; font-display: swap; }

:root {
  --ink: #0B1F2A;
  --corten: #B86543;
  --corten-text: #9E5231;
  --concrete: #DDE2DF;
  --mist: #F5F7F5;
  --steel: #5C686F;
  --white: #FFFFFF;
  --hairline: rgba(11, 31, 42, .14);
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --r-xs: 3px;
  --r-sm: 6px;
  --pad: clamp(1rem, .6rem + 2vw, 2rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font: 400 1rem/1.55 var(--font-body);
}

a { color: var(--corten-text); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--corten); outline-offset: 2px; }
.barra :focus-visible { outline-color: var(--white); }

/* --- Barra --- */
.barra {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem 1rem;
  padding: .5rem var(--pad);
  background: var(--ink);
  color: var(--white);
}
.barra a, .barra .enlace { color: var(--white); text-decoration: none; }
.marca { font: 600 1.125rem/1 var(--font-display); letter-spacing: -.02em; margin-right: auto; padding: .75rem 0; }
.barra nav { display: flex; flex-wrap: wrap; gap: 0 .25rem; }
.barra nav a, .barra .enlace { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .5rem; }
.barra form { margin: 0; }
.enlace { background: none; border: 0; font: inherit; cursor: pointer; text-decoration: underline; }

/* --- Contenido --- */
main { max-width: 1100px; margin: 0 auto; padding: 1.5rem var(--pad) 4rem; }
h1, h2 { font-family: var(--font-display); letter-spacing: -.02em; line-height: 1.15; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.25rem); margin: .5rem 0 1rem; }
h2 { font-size: 1.25rem; margin: 2.5rem 0 .75rem; padding-top: 1rem; border-top: 1px solid var(--hairline); }
section:first-of-type h2 { border-top: 0; padding-top: 0; }
.mono { font-family: var(--font-mono); font-size: .8125rem; }
h1 .mono, h2 .mono { color: var(--steel); font-weight: 400; }
.tenue { color: var(--steel); }
.cifra { font: 600 1.375rem/1 var(--font-display); }
.mal { color: var(--corten-text); }
.miga { margin: 0; }
.miga a { display: inline-flex; align-items: center; min-height: 44px; }

/* --- Avisos --- */
.aviso {
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--ink);
  border-radius: var(--r-xs);
  background: var(--white);
  padding: .75rem 1rem;
}
.aviso--error { border-left-color: var(--corten); }
.aviso--error span { font-weight: 600; color: var(--corten-text); }

.alertas { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hairline); }
.alertas li { padding: .75rem 0; border-bottom: 1px solid var(--hairline); }
.alerta--error { border-left: 3px solid var(--corten); padding-left: .75rem !important; }

/* --- Tablas --- */
.tabla { overflow-x: auto; margin: 0 0 1.5rem; border: 1px solid var(--hairline); border-radius: var(--r-sm); background: var(--white); }
table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
caption { text-align: left; padding: .75rem .75rem .25rem; font-weight: 600; }
th, td { text-align: left; vertical-align: top; padding: .625rem .75rem; border-bottom: 1px solid var(--hairline); }
th { font: 400 .75rem/1.3 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--steel); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.detalle { max-width: 36rem; overflow-wrap: anywhere; }
td a { display: inline-block; min-height: 24px; }

.datos { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1rem; margin: 0 0 1rem; }
.datos dt { color: var(--steel); }
.datos dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 559px) {
  .datos { grid-template-columns: 1fr; gap: 0; }
  .datos dd { margin-bottom: .625rem; }
}

.filtros { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0 0 1rem; }
.filtros a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 .75rem;
  border: 1px solid var(--hairline); border-radius: var(--r-xs); background: var(--white);
  color: var(--ink); text-decoration: none; font-size: .875rem;
}
.filtros a[aria-current="page"] { background: var(--ink); color: var(--white); border-color: var(--ink); }

.lista { padding-left: 1.25rem; }
.lista li { padding: .25rem 0; }
.lista a { display: inline-flex; align-items: center; min-height: 44px; }

.mensaje { border-top: 1px solid var(--hairline); padding: .75rem 0; }
.mensaje p { margin: .25rem 0; }
.mensaje pre {
  white-space: pre-wrap; overflow-wrap: anywhere; margin: .5rem 0 0; padding: .75rem;
  background: var(--white); border: 1px solid var(--hairline); border-radius: var(--r-xs);
  font: .875rem/1.5 var(--font-body); max-height: 20rem; overflow-y: auto;
}

/* --- Formularios --- */
.formulario { display: grid; gap: .5rem; max-width: 40rem; }
.estrecho { max-width: 22rem; }
.en-linea { margin-top: 1rem; }
label { font-weight: 600; font-size: .9375rem; margin-top: .5rem; }
.casilla { display: flex; align-items: center; gap: .5rem; min-height: 44px; font-weight: 400; }
.casilla input { width: 1.25rem; height: 1.25rem; accent-color: var(--ink); }
input[type="text"], input[type="password"], textarea, select {
  width: 100%; min-height: 44px; padding: .625rem .75rem;
  font: 400 1rem/1.4 var(--font-body); /* 16 px: iOS no hace zoom */
  color: var(--ink); background: var(--white);
  border: 1px solid var(--steel); border-radius: var(--r-sm);
}
textarea { resize: vertical; }
.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.acciones { display: flex; flex-wrap: wrap; gap: .5rem; }
.acciones form { margin: 0; }
.boton {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 1rem;
  font: 600 .9375rem/1 var(--font-body); color: var(--white); background: var(--ink);
  border: 1px solid var(--ink); border-radius: var(--r-sm); cursor: pointer;
}
.boton--secundario { color: var(--ink); background: var(--white); }
.formulario .boton { justify-self: start; margin-top: .5rem; }

@media (hover: hover) and (pointer: fine) {
  .boton:hover { background: var(--corten-text); border-color: var(--corten-text); color: var(--white); }
  .filtros a:hover { border-color: var(--ink); }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
