/* CRM Ríos & Co. — mismos colores que los paneles de la agencia. */
:root {
  --bg: #f2f5f3; --surface: #ffffff; --ink: #16211c; --muted: #5d6b64; --line: #d8e1dc;
  --accent: #1d6a4f; --accent-ink: #ffffff; --accent-soft: #e0efe7; --del: #b4472a; --del-soft: #fbe9e3;
  --warn-soft: #fff4d6; --warn: #7a5a00; --info-soft: #e5eefb; --info: #234f8c;
  --radio: 14px; --sombra: 0 1px 2px rgb(0 0 0 / .04), 0 4px 16px rgb(0 0 0 / .04);
  --display: ui-serif, Georgia, "Times New Roman", serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1512; --surface: #18201c; --ink: #e5ece8; --muted: #9eaca5; --line: #2a3530;
    --accent: #62c79d; --accent-ink: #0f1512; --accent-soft: #1a3027; --del: #f0906c; --del-soft: #3a2119;
    --warn-soft: #3a3115; --warn: #f1cf6e; --info-soft: #1a2738; --info: #9cc0f0;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--body); }
a { color: var(--accent); }
h1, h2 { font-family: var(--display); font-weight: 500; line-height: 1.15; margin: 0 0 .5rem; }
h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h2 { font-size: 1.15rem; }
main { max-width: 1240px; margin: 0 auto; padding: 24px 16px 64px; }
.suave { color: var(--muted); } .pequeno { font-size: .85rem; } .fuerte { font-weight: 600; text-decoration: none; }
.antetitulo { text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; color: var(--muted); margin: 0 0 .25rem; }
.estrecha { max-width: 640px; margin: 0 auto; }
.vacio { color: var(--muted); font-style: italic; }
.texto-largo { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Menú */
.menu { position: sticky; top: 0; z-index: 5; display: flex; gap: 4px; align-items: center; flex-wrap: wrap;
  padding: 10px 16px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); }
.menu a { padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--ink); }
.menu a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.menu .marca { font-family: var(--display); font-size: 1.1rem; margin-right: 8px; }
.menu .marca span { font-family: var(--body); font-size: .7rem; letter-spacing: .1em; margin-left: 6px; color: var(--muted); }
.menu .hueco { flex: 1; }
.menu .yo { color: var(--muted); }
.salir { margin: 0; }
.banda-demo { background: var(--warn-soft); color: var(--warn); text-align: center; padding: 6px 16px; font-size: .85rem; }

/* Tarjetas y estructura */
.tarjeta { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radio); padding: 20px; box-shadow: var(--sombra); margin-bottom: 16px; }
.cabecera { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.acciones { display: flex; gap: 8px; flex-wrap: wrap; }
.dos-columnas { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; }
.dos-columnas .tarjeta { margin: 0; }
.cifras { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.cifra { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radio); padding: 14px 16px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 4px; }
.cifra span { color: var(--muted); font-size: .82rem; }
.cifra strong { font-family: var(--display); font-size: 2rem; font-weight: 500; line-height: 1; }
.cifra.destacada { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.cifra.destacada span { color: inherit; opacity: .85; }

/* Embudo */
.embudo { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.embudo a { display: grid; grid-template-columns: 150px 1fr 40px; gap: 10px; align-items: center; color: var(--ink); text-decoration: none; padding: 2px 0; }
.embudo a:hover .embudo-nombre { color: var(--accent); }
.embudo-n { text-align: right; font-variant-numeric: tabular-nums; }
progress.barra { appearance: none; width: 100%; height: 10px; border: 0; border-radius: 99px; background: var(--accent-soft); overflow: hidden; }
progress.barra::-webkit-progress-bar { background: var(--accent-soft); border-radius: 99px; }
progress.barra::-webkit-progress-value { background: var(--accent); border-radius: 99px; }
progress.barra::-moz-progress-bar { background: var(--accent); border-radius: 99px; }

/* Tablas */
.tabla-envoltura { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radio); margin-bottom: 16px; }
.tabla { width: 100%; border-collapse: collapse; }
.tabla th, .tabla td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tabla th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.tabla tbody tr:hover { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.tabla tr:last-child td { border-bottom: 0; }
.tabla.compacta td { padding: 8px 4px; }
.tabla .apagada td { opacity: .55; }

/* Estados */
.estado { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.e-nuevo { background: var(--info-soft); color: var(--info); }
.e-curso { background: var(--warn-soft); color: var(--warn); }
.e-bien { background: var(--accent-soft); color: var(--accent); }
.e-cliente { background: var(--accent); color: var(--accent-ink); }
.e-apagado { background: var(--line); color: var(--muted); }
.e-mal { background: var(--del-soft); color: var(--del); }

/* Formularios */
label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); font-weight: 500; margin-bottom: 12px; }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); }
input, select, textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; width: 100%; }
input[type="checkbox"] { width: auto; }
input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:disabled, select:disabled, textarea:disabled { opacity: .7; }
textarea { resize: vertical; }
.rejilla { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 0 16px; }
.rejilla.dos { grid-template-columns: 1fr 1fr; }
.rejilla .ancho { grid-column: 1 / -1; }
.boton { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent);
  border-radius: 999px; padding: 9px 18px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.boton.secundario { background: transparent; color: var(--accent); }
.boton:hover { filter: brightness(1.05); }
.boton-texto { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 6px 10px; text-decoration: underline; }
.filtros { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filtros label { margin: 0; min-width: 140px; flex: 1; }
.filtros .buscar { flex: 3; min-width: 220px; }

/* Avisos */
.aviso { padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; }
.aviso.ok { background: var(--accent-soft); color: var(--accent); }
.aviso.error { background: var(--del-soft); color: var(--del); }
.aviso.clave { background: var(--warn-soft); color: var(--warn); }
.aviso code { font-size: 1.05rem; padding: 2px 8px; background: var(--surface); border-radius: 6px; user-select: all; }

/* Ficha */
.ficha { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
@media (max-width: 960px) { .ficha { grid-template-columns: 1fr; } }
.datos { display: grid; grid-template-columns: 180px 1fr; gap: 8px 16px; margin: 0; }
.datos dt { color: var(--muted); font-size: .85rem; }
.datos dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .datos { grid-template-columns: 1fr; } .datos dd { margin-bottom: 8px; } .embudo a { grid-template-columns: 110px 1fr 32px; } }
.plegable summary { cursor: pointer; list-style: none; }
.plegable summary::-webkit-details-marker { display: none; }
.plegable summary h2 { display: inline; }
.plegable summary::after { content: "▾"; float: right; color: var(--muted); }
.plegable[open] summary { margin-bottom: 12px; }
.cronologia { list-style: none; margin: 16px 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.cronologia li { position: relative; padding: 0 0 14px 6px; }
.cronologia li::before { content: ""; position: absolute; left: -21px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.cronologia li.vacio::before { background: var(--line); }
.cronologia p { margin: 0; }
.lista-simple { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.seguimiento-form { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.paginas { display: flex; justify-content: space-between; align-items: center; }

/* Acceso */
.acceso { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; min-height: 80vh; }
.acceso-marca h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.acceso-marca em { color: var(--accent); }
.acceso-form { max-width: 420px; width: 100%; justify-self: center; }
@media (max-width: 760px) { .acceso { grid-template-columns: 1fr; min-height: 0; } }
