/* Estudio · Black Ring Business — hoja de estilos */
:root {
  --navy: #0f2238;
  --navy-2: #173353;
  --navy-3: #1f4370;
  --ink: #16202c;
  --muted: #65717f;
  --line: #dfe5ee;
  --line-2: #cfd7e2;
  --bg: #f3f5f8;
  --card: #ffffff;
  --accent: #3f82c9;
  --accent-2: #2d6cb0;
  --accent-soft: #e8f0fa;
  --gold: #b8923c;
  --gold-soft: #f7efdc;
  --ok: #1f8a5b;
  --ok-soft: #e4f4ec;
  --warn: #c2731a;
  --warn-soft: #fbefdf;
  --bad: #b73838;
  --bad-soft: #fae6e6;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 34, 56, .06), 0 6px 20px rgba(15, 34, 56, .05);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; margin: 0 0 .4em; line-height: 1.2; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; font-family: var(--sans); font-weight: 700; color: var(--navy-2); text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; margin: 1.2em 0 .5em; }
p { margin: 0 0 .9em; }
code { font-family: var(--mono); font-size: .85em; background: var(--bg); padding: .1em .35em; border-radius: 4px; }
small, .small { font-size: .86rem; }
.muted { color: var(--muted); }
.kicker { font-size: .74rem; text-transform: uppercase; letter-spacing: .18em; color: var(--muted); margin: 0 0 .45em; font-weight: 600; }
.inline { display: inline; }
.der { text-align: right; }
.mono { font-family: var(--mono); font-size: .85rem; }

/* Layout */
.wrap { width: min(1180px, 100% - 40px); margin: 0 auto; }
.main { flex: 1; padding: 28px 0 48px; }
.topbar { background: var(--navy); color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.topbar-in { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 34px; width: auto; }
.brand-sep { width: 1px; height: 26px; background: rgba(255,255,255,.25); }
.brand-name { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; letter-spacing: .02em; }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a { color: rgba(255,255,255,.78); padding: 8px 12px; border-radius: 8px; font-weight: 500; }
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.nav a.activo { color: #fff; background: rgba(255,255,255,.14); }
.usuario { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.usuario-nombre { display: flex; align-items: center; gap: 8px; color: #fff; }
.usuario-nombre:hover { text-decoration: none; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; letter-spacing: .02em; }
.avatar-sm { width: 26px; height: 26px; font-size: .68rem; vertical-align: middle; margin-right: 4px; }
.pie { border-top: 1px solid var(--line); background: #fff; color: var(--muted); font-size: .82rem; }
.pie-in { display: flex; justify-content: space-between; gap: 20px; padding: 16px 0; flex-wrap: wrap; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; line-height: 1.2; white-space: nowrap; }
.btn:hover { border-color: var(--accent); color: var(--accent-2); text-decoration: none; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: inherit; }
.topbar .btn-ghost { color: rgba(255,255,255,.75); }
.topbar .btn-ghost:hover { color: #fff; background: rgba(255,255,255,.08); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger { color: var(--bad); border-color: var(--bad-soft); }
.btn-sm { padding: 6px 11px; font-size: .84rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.acciones { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.acciones.col { flex-direction: column; align-items: stretch; }
.acciones form { margin: 0; }

/* Tarjetas */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 20px; box-shadow: var(--shadow); }
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.card-alerta { border-color: #efc9c9; background: #fffafa; }
.card-realidad { border-left: 4px solid var(--gold); }
.card-propuestas { border-left: 4px solid var(--warn); }
.intro { color: var(--muted); margin-bottom: 16px; }
.vacio { color: var(--muted); font-style: italic; }
.vacio-card { text-align: center; padding: 48px 24px; }
.vacio-card p { color: var(--muted); max-width: 520px; margin: 0 auto 10px; }
.vacio-card .acciones { justify-content: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3-1 { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.field-full { grid-column: 1 / -1; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin-bottom: .2em; }
.page-head p.muted { margin: 0; }
.page-head .acciones { margin-top: 0; }
.h-sec { margin-top: 1.4em; }

/* Flash */
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; font-weight: 500; }
.flash-ok { background: var(--ok-soft); border-color: #bfe3cf; color: #145a3a; }
.flash-warn { background: var(--warn-soft); border-color: #f0d3ad; color: #7a4a0f; }
.flash-bad { background: var(--bad-soft); border-color: #efc3c3; color: #7d2525; }

/* Formularios */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field > span { font-size: .82rem; font-weight: 600; color: var(--navy-2); letter-spacing: .02em; }
.field small { color: var(--muted); }
.field input, .field select, .field textarea { font: inherit; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; color: var(--ink); width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus, .seccion textarea:focus, #chat-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input[disabled] { background: var(--bg); color: var(--muted); }
.field-grow { flex: 1; }
.form-inline { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.form-inline .field { margin-bottom: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; cursor: pointer; }
.check input { margin-top: 4px; }
textarea { resize: vertical; }

/* Tags, pills, chips */
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--navy-2); font-size: .78rem; font-weight: 600; }
.tag-gold { background: var(--gold-soft); color: #7a5a14; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--bg); color: var(--muted); font-size: .76rem; font-weight: 600; border: 1px solid var(--line); vertical-align: middle; }
.pill-ok { background: var(--ok-soft); color: var(--ok); border-color: #bfe3cf; }
.pill-warn { background: var(--warn-soft); color: var(--warn); border-color: #f0d3ad; }
.pill-bad { background: var(--bad-soft); color: var(--bad); border-color: #efc3c3; }
.puntaje-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 30px; padding: 0 8px; border-radius: 8px; font-family: var(--serif); font-weight: 700; font-size: 1.05rem; background: var(--bg); }
.puntaje-chip.ok, .stat-n.ok, .g-dot.ok, .bar span.ok, .gauge-fg.ok { color: var(--ok); }
.puntaje-chip.warn, .stat-n.warn, .g-dot.warn, .gauge-fg.warn { color: var(--warn); }
.puntaje-chip.bad, .stat-n.bad, .g-dot.bad, .gauge-fg.bad { color: var(--bad); }
.puntaje-chip.ok { background: var(--ok-soft); }
.puntaje-chip.warn { background: var(--warn-soft); }
.puntaje-chip.bad { background: var(--bad-soft); }
.cnt { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: rgba(15,34,56,.08); font-size: .74rem; text-align: center; margin-left: 4px; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tabs a, .tabs button { font: inherit; font-weight: 600; font-size: .92rem; color: var(--muted); padding: 10px 14px; border: none; border-bottom: 2px solid transparent; background: none; cursor: pointer; margin-bottom: -1px; }
.tabs a:hover, .tabs button:hover { color: var(--navy); text-decoration: none; }
.tabs a.activo, .tabs button.activo { color: var(--navy); border-bottom-color: var(--navy); }
.tabs-sm a, .tabs-sm button { padding: 8px 10px; font-size: .86rem; }

/* Estadísticas */
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 14px; box-shadow: var(--shadow); }
.stat-n { font-family: var(--serif); font-size: 2.1rem; font-weight: 600; line-height: 1; color: var(--navy); }
.stat-l { font-size: .76rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-top: 8px; font-weight: 600; }

/* Hero perfil */
.hero-perfil { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 28px 30px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; margin-bottom: 20px; }
.hero-perfil h1 { color: #fff; margin-bottom: .3em; }
.hero-perfil .kicker { color: rgba(255,255,255,.6); }
.hero-sub { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }
.hero-perfil .tag { background: rgba(255,255,255,.12); color: #fff; }
.hero-perfil .tag-gold { background: var(--gold); color: #fff; }
.hero-perfil-meta { align-self: center; }
.meta-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .16em; color: rgba(255,255,255,.65); font-weight: 600; margin-bottom: 8px; }
.meta-nums { margin-top: 8px; color: rgba(255,255,255,.85); }
.meta-nums strong { color: #fff; font-family: var(--serif); font-size: 1.2rem; }
.meta-sig { color: rgba(255,255,255,.65); font-size: .86rem; margin-top: 4px; }
.hero-perfil .bar { background: rgba(255,255,255,.14); }
.hero-perfil .bar span { background: var(--gold); }

/* Barras */
.bar { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s ease; }
.bar span.ok { background: var(--ok); }
.bar span.warn { background: var(--warn); }
.bar span.bad { background: var(--bad); }
.bar-lg { height: 12px; }
.barras { display: flex; flex-direction: column; gap: 10px; }
.barra-fila { display: grid; grid-template-columns: 1.4fr 2fr 48px; gap: 12px; align-items: center; font-size: .9rem; }
.barra-lbl { color: var(--ink); }
.barra-val { text-align: right; font-weight: 700; color: var(--navy-2); font-family: var(--serif); }
.ejes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.eje { background: var(--bg); border-radius: 10px; padding: 12px; text-align: center; }
.eje-n { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; color: var(--navy); line-height: 1; }
.eje-n small { font-size: .8rem; color: var(--muted); font-weight: 400; }
.eje-l { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-top: 6px; font-weight: 600; }
.ejes-detalle { grid-template-columns: 1fr 1fr; margin-top: 0; }
.ejes-detalle .eje { text-align: left; }
.eje-c { font-size: .86rem; color: var(--ink); margin: 8px 0 0; }

/* Gráfica */
.grafica { width: 100%; height: auto; display: block; }
.g-grid { stroke: var(--line); stroke-width: 1; }
.g-umbral { stroke: var(--gold); stroke-width: 1; stroke-dasharray: 4 4; }
.g-lbl { font-size: 11px; fill: var(--muted); font-family: var(--sans); }
.g-lbl-umbral { fill: var(--gold); }
.g-line { fill: none; stroke: var(--navy); stroke-width: 2.5; stroke-linejoin: round; }
.g-dot { fill: currentColor; stroke: #fff; stroke-width: 2; }
.g-val { font-size: 12px; font-weight: 700; fill: var(--navy); font-family: var(--serif); }

/* Listas */
.lista { display: flex; flex-direction: column; }
.lista-item { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); color: inherit; }
.lista-item:first-child { border-top: none; }
.lista-item:hover { text-decoration: none; background: var(--bg); margin: 0 -12px; padding: 11px 12px; border-radius: 8px; }
.lista-cod { font-family: var(--mono); font-size: .78rem; color: var(--muted); font-weight: 600; letter-spacing: .04em; }
.lista-tit { font-weight: 600; color: var(--ink); }
.lista-tit small { display: block; color: var(--muted); font-weight: 400; }
.lista-meta { color: var(--muted); font-size: .86rem; white-space: nowrap; }
.lista-simple { padding-left: 1.2em; margin: 0; }
.lista-simple li { margin-bottom: .4em; }
.lista-simple li.bad { color: var(--bad); font-weight: 600; }
.ok-list li::marker { color: var(--ok); }
.mejora-list li::marker { color: var(--warn); }
.preguntas { padding-left: 1.3em; margin: 0; }
.preguntas li { margin-bottom: .5em; }
.pasos { padding-left: 1.2em; margin: 0; font-size: .92rem; color: var(--ink); }
.pasos li { margin-bottom: .55em; }
.fuentes { padding-left: 1.2em; margin: 0; font-size: .88rem; }
.fuentes li { margin-bottom: .35em; }
.nota-verif { background: var(--warn-soft); border-radius: 8px; padding: 10px 12px; font-size: .9rem; color: #6d4410; }
.ficha { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: .92rem; }
.ficha dt { color: var(--muted); font-weight: 600; }
.ficha dd { margin: 0; }
.versiones { list-style: none; padding: 0; margin: 0; }
.versiones li { padding: 8px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.versiones li:first-child { border-top: none; }
.versiones li.activa strong::after { content: " · vigente"; color: var(--ok); font-weight: 600; font-size: .78rem; }
.versiones small { color: var(--muted); }
.rubrica-lista { list-style: none; padding: 0; margin: 0 0 14px; }
.rubrica-lista li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: .92rem; }
.rubrica-lista li:first-child { border-top: none; }

/* Casos */
.casos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.caso-card { display: flex; flex-direction: column; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; color: inherit; box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease; }
.caso-card:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--accent); }
.caso-card h3 { margin: 0; }
.caso-card p { color: var(--muted); font-size: .9rem; margin: 0; flex: 1; }
.caso-card-top { display: flex; justify-content: space-between; align-items: center; }
.caso-card-meta { font-size: .8rem; color: var(--muted); }
.caso-card-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .8rem; margin-top: 4px; }

/* Tablas */
.tabla { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tabla th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 700; }
.tabla td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tabla tbody tr:last-child td { border-bottom: none; }
.tabla tbody tr:hover { background: var(--bg); }
.tabla-sm td, .tabla-sm th { padding: 8px 12px; font-size: .86rem; }
.tabla .lnk { color: var(--ink); font-weight: 600; }
.ranking .pos { font-family: var(--serif); font-weight: 700; color: var(--muted); width: 40px; }
.ranking tr.yo td { background: var(--accent-soft); }
.tabla-wrap { overflow-x: auto; margin: 10px 0 16px; }
.md table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.md th, .md td { padding: 8px 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.md th { background: var(--bg); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* Markdown */
.md h2 { font-size: 1.25rem; margin: 1.4em 0 .5em; }
.md h2:first-child, .md h3:first-child { margin-top: 0; }
.md h3 { font-size: 1.05rem; margin: 1.2em 0 .4em; }
.md h4, .md h5 { margin: 1em 0 .4em; }
.md ul, .md ol { padding-left: 1.3em; margin: 0 0 1em; }
.md li { margin-bottom: .3em; }
.md blockquote { margin: 0 0 1em; padding: 12px 18px; border-left: 4px solid var(--navy); background: var(--bg); font-family: var(--serif); font-size: 1.05rem; font-style: italic; border-radius: 0 8px 8px 0; }
.md hr { border: none; border-top: 1px solid var(--line); margin: 1.4em 0; }
.md-compacto { font-size: .93rem; }
.md-compacto h2 { font-size: 1.1rem; }
.md-doc { font-size: 1.02rem; }
.md-doc h2 { font-size: 1.4rem; margin-top: 1.8em; padding-top: .6em; border-top: 1px solid var(--line); }
.md-doc h2:first-child { border-top: none; padding-top: 0; }
.nota-cambio { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }

/* Insignias */
.insignias { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.insignia { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; opacity: .55; }
.insignia.ok { opacity: 1; border-color: var(--gold); background: var(--gold-soft); }
.insignia-ico { grid-row: 1 / 3; align-self: center; color: var(--gold); font-size: 1.3rem; }
.insignia-n { font-weight: 700; font-size: .9rem; }
.insignia-d { font-size: .78rem; color: var(--muted); }

/* Trabajo */
.barra-trabajo { position: sticky; top: 0; z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 18px; display: grid; grid-template-columns: 1fr auto auto; gap: 18px; align-items: center; margin-bottom: 18px; box-shadow: var(--shadow); }
.bt-caso { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bt-caso strong { font-family: var(--serif); font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-timer { display: flex; align-items: center; gap: 12px; }
.timer { font-family: var(--serif); font-variant-numeric: tabular-nums; font-size: 1.7rem; font-weight: 600; color: var(--navy); min-width: 110px; text-align: right; }
.timer.pausado { color: var(--muted); }
.guardado { font-size: .78rem; color: var(--muted); min-width: 120px; }
.guardado.ok { color: var(--ok); }
.guardado.bad { color: var(--bad); }
.bt-acciones form { margin: 0; }
.trabajo { display: grid; grid-template-columns: minmax(300px, 5fr) minmax(0, 7fr); gap: 20px; align-items: start; }
.trabajo-izq { position: sticky; top: 92px; max-height: calc(100vh - 110px); display: flex; flex-direction: column; }
.trabajo-izq .tabs { margin-bottom: 12px; flex-shrink: 0; }
.trabajo-izq .card { overflow: auto; max-height: calc(100vh - 170px); margin-bottom: 0; }
.secciones { display: flex; flex-direction: column; gap: 18px; }
.seccion label { display: block; margin-bottom: 6px; }
.seccion-tit { display: block; font-family: var(--serif); font-weight: 600; font-size: 1.05rem; color: var(--navy); }
.seccion-ayuda { display: block; font-size: .84rem; color: var(--muted); margin-top: 2px; }
.seccion textarea { width: 100%; font: inherit; font-size: .95rem; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; min-height: 120px; line-height: 1.5; }
.seccion.llena .seccion-tit::after { content: " ✓"; color: var(--ok); }
.seccion textarea[readonly] { background: var(--bg); color: var(--ink); }
.solicitar-datos { background: var(--bg); border-radius: 10px; padding: 16px; text-align: center; }
.solicitar-datos p { color: var(--muted); font-size: .9rem; }
.evidencias { list-style: none; padding: 0; margin: 0 0 14px; }
.evidencias li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.evidencias li:first-child { border-top: none; }
.ev-ext { font-family: var(--mono); font-size: .68rem; font-weight: 700; background: var(--navy); color: #fff; padding: 3px 6px; border-radius: 4px; letter-spacing: .04em; }
.subir { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.subir input[type=file] { font: inherit; font-size: .9rem; }
.enviar-card { border-left: 4px solid var(--navy); }

/* Chat */
.chat { display: flex; flex-direction: column; }
.chat-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.chat-msgs { display: flex; flex-direction: column; gap: 10px; flex: 1; overflow: auto; padding: 4px 0; }
.chat-msgs-static { max-height: 480px; }
.msg { max-width: 92%; padding: 10px 14px; border-radius: 12px; font-size: .93rem; }
.msg-consultor { align-self: flex-end; background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
.msg-cliente { align-self: flex-start; background: var(--bg); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg-rol { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; opacity: .7; margin-bottom: 3px; }
.msg-pensando { color: var(--muted); font-style: italic; }
.chat-form { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }
.chat-form textarea { flex: 1; font: inherit; font-size: .93rem; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px; resize: none; }

/* Veredicto */
.veredicto { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 30px; margin-bottom: 20px; box-shadow: var(--shadow); }
.gauge-wrap { text-align: center; }
.gauge { width: 190px; height: 190px; transform: rotate(-90deg); }
.gauge-bg { fill: none; stroke: var(--bg); stroke-width: 10; }
.gauge-fg { fill: none; stroke: currentColor; stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset .8s ease; }
.gauge-n { font-family: var(--serif); font-size: 36px; font-weight: 700; fill: var(--navy); transform: rotate(90deg); transform-origin: 60px 60px; }
.gauge-l { font-size: 10px; fill: var(--muted); text-transform: uppercase; letter-spacing: 1.5px; transform: rotate(90deg); transform-origin: 60px 60px; }
.gauge-real { font-size: .86rem; color: var(--muted); margin-top: 6px; }
.veredicto-txt h2 { font-size: 1.6rem; margin: 6px 0; }
.nivel-chip { display: inline-block; background: var(--navy); color: #fff; padding: 4px 12px; border-radius: 999px; font-size: .84rem; }
.veredicto-cond { color: var(--ink); font-weight: 500; }
.resumen-ejec { color: var(--ink); }
.resumen-ejec p:last-child { margin-bottom: 0; }
.criterios { display: flex; flex-direction: column; gap: 16px; }
.criterio-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.criterio-p { font-family: var(--serif); font-weight: 700; color: var(--navy); }
.criterio-j { font-size: .88rem; color: var(--muted); margin: 6px 0 0; }
.comparativo { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.comp-col { background: var(--bg); border-radius: 10px; padding: 16px; }
.comp-head { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 1.15rem; font-weight: 600; }
.comp-col h4 { margin-top: 12px; }
.comp-col ul, .comp-listas ul { padding-left: 1.2em; margin: 0; font-size: .92rem; }
.comp-col li, .comp-listas li { margin-bottom: .4em; }
.comp-listas { margin-top: 18px; }
.comp-nota { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-style: italic; color: var(--muted); }
.detalles summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.detalles summary::-webkit-details-marker { display: none; }
.detalles summary h2 { margin: 0; }
.detalles summary h2::before { content: "▸ "; color: var(--muted); }
.detalles[open] summary h2::before { content: "▾ "; }
.propuesta { padding: 12px 0; border-top: 1px solid var(--line); }
.propuesta:first-of-type { border-top: none; }
.propuesta p { margin-bottom: 6px; }
.propuesta .acciones { margin-top: 4px; }

/* Menú */
.menu { position: relative; display: inline-block; }
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu-box { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 10px; z-index: 10; display: flex; flex-direction: column; gap: 8px; min-width: 260px; text-align: left; }
.menu-box form { display: flex; gap: 6px; flex-wrap: wrap; margin: 0; }
.menu-box input { font: inherit; font-size: .86rem; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 6px; flex: 1; }

/* Overlay y spinner */
.overlay { position: fixed; inset: 0; background: rgba(15,34,56,.72); display: flex; align-items: center; justify-content: center; z-index: 100; }
.overlay[hidden] { display: none; }
.overlay-box { background: #fff; border-radius: 14px; padding: 28px 32px; display: flex; gap: 20px; align-items: center; max-width: 520px; }
.cargando { display: flex; gap: 16px; align-items: center; margin-top: 16px; padding: 16px; background: var(--bg); border-radius: 10px; }
.cargando[hidden] { display: none; }
.spinner { width: 34px; height: 34px; border: 4px solid var(--line); border-top-color: var(--navy); border-radius: 50%; animation: giro .9s linear infinite; flex-shrink: 0; }
@keyframes giro { to { transform: rotate(360deg); } }

/* Login */
.login-body { background: var(--navy); }
.login-grid { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-hero { padding: 64px 72px; color: #fff; display: flex; flex-direction: column; justify-content: center; }
.login-logo { width: 300px; height: auto; margin-bottom: 56px; }
.login-hero .kicker { color: rgba(255,255,255,.6); }
.login-hero h1 { font-size: 4rem; color: #fff; margin-bottom: .3em; }
.login-lead { font-family: var(--serif); font-size: 1.2rem; font-style: italic; color: rgba(255,255,255,.85); max-width: 520px; line-height: 1.5; }
.login-puntos { margin: 28px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; color: rgba(255,255,255,.8); max-width: 520px; }
.login-puntos li { padding-left: 18px; position: relative; }
.login-puntos li::before { content: ""; position: absolute; left: 0; top: .6em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.login-panel { background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 48px 32px; }
.login-form { width: min(420px, 100%); background: #fff; border-radius: 16px; padding: 36px 38px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.login-form h2 { font-size: 1.6rem; margin-bottom: 18px; }
.login-nota { font-size: .82rem; color: var(--muted); margin: 16px 0 0; }

/* Responsivo */
@media (max-width: 1024px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .casos-grid { grid-template-columns: repeat(2, 1fr); }
  .trabajo { grid-template-columns: 1fr; }
  .trabajo-izq { position: static; max-height: none; }
  .trabajo-izq .card { max-height: none; }
  .grid-3-1 { grid-template-columns: 1fr; }
  .login-grid { grid-template-columns: 1fr; }
  .login-hero { padding: 40px 28px; }
  .login-hero h1 { font-size: 3rem; }
}
@media (max-width: 720px) {
  .wrap { width: min(1180px, 100% - 24px); }
  .topbar-in { height: auto; padding: 10px 0; flex-wrap: wrap; gap: 10px; }
  .nav { order: 3; width: 100%; overflow-x: auto; margin-left: 0; }
  .usuario-txt { display: none; }
  .grid-2, .grid-form { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .casos-grid { grid-template-columns: 1fr; }
  .hero-perfil { grid-template-columns: 1fr; padding: 22px; }
  .veredicto { grid-template-columns: 1fr; text-align: center; }
  .comparativo { grid-template-columns: 1fr; }
  .ejes { grid-template-columns: repeat(2, 1fr); }
  .barra-trabajo { grid-template-columns: 1fr; gap: 10px; position: static; }
  .barra-fila { grid-template-columns: 1fr; gap: 4px; }
  .barra-val { text-align: left; }
  .lista-item { grid-template-columns: 1fr; gap: 4px; }
  .insignias { grid-template-columns: 1fr; }
  h1 { font-size: 1.6rem; }
  .tabla { font-size: .84rem; }
  .tabla th, .tabla td { padding: 8px; }
}
