:root {
  /* Colores corporativos Minima Arquitectos */
  --brand: #201815;
  --brand-accent: #D58500;

  --bg: #f6f4f1;
  --surface: #ffffff;
  --surface-2: #f1eeea;
  --ink: #201815;
  --ink-2: #51473f;
  --ink-3: #847970;
  --line: #e7e2dc;
  --line-2: #d6cec6;
  --accent: #D58500;
  --accent-ink: #201815;
  --accent-soft: #fbefd9;
  --accent-text: #8f5900;
  --on-brand: #ffffff;
  --on-brand-2: rgba(255, 255, 255, .72);
  --ok: #157f3b; --ok-soft: #e3f4e8;
  --warn: #8a6100; --warn-soft: #fbf3dc;
  --bad: #b42318; --bad-soft: #fde8e6;
  --violet: #6b46c1; --violet-soft: #efe9fb;
  --blue: #1d5fd1; --blue-soft: #e6eefc;
  --teal: #0f766e; --teal-soft: #dff3f0;
  --orange: #c2410c; --orange-soft: #fdede4;
  --gray-soft: #ece9e5;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(32, 24, 21, .05), 0 6px 24px rgba(32, 24, 21, .07);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-input: Tahoma, Verdana, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15100e; --surface: #201815; --surface-2: #2b221e;
    --ink: #f4efeb; --ink-2: #c4b9b1; --ink-3: #94887f;
    --line: #342a25; --line-2: #463a33;
    --accent: #D58500; --accent-ink: #201815; --accent-soft: #3b2a10; --accent-text: #f0a93a;
    --ok: #4cc47a; --ok-soft: #13301f; --warn: #e3b04b; --warn-soft: #33270f;
    --bad: #ff7b6e; --bad-soft: #3a1714; --violet: #b49cf5; --violet-soft: #2a2244;
    --blue: #7ea6ff; --blue-soft: #1a2542; --teal: #4fd1c5; --teal-soft: #11302d;
    --orange: #ff9a63; --orange-soft: #3a2116; --gray-soft: #2e2622;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 28px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-text); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 20px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
[hidden] { display: none !important; }

/* ---------- barra superior ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--brand); color: var(--on-brand); border-bottom: 3px solid var(--brand-accent); }
.top-in { max-width: 1240px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--on-brand); flex: none; }
.brand-logo { height: 34px; width: auto; display: block; }
.brand-sep { width: 1px; height: 30px; background: rgba(255,255,255,.22); }
.brand-txt b { display: block; font-size: 15px; letter-spacing: .02em; }
.brand-txt span { display: block; font-size: 11.5px; color: var(--on-brand-2); margin-top: -2px; }
.brand-txt b { color: var(--brand-accent); }
.nav { display: flex; gap: 4px; margin-left: 8px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav a { color: var(--on-brand-2); padding: 7px 12px; border-radius: 999px; white-space: nowrap; font-size: 14px; display: inline-flex; gap: 6px; align-items: center; }
.nav a:hover { background: rgba(255,255,255,.08); color: var(--on-brand); }
.nav a.on { background: var(--brand-accent); color: var(--brand); font-weight: 600; }
.nav .count { background: var(--bad); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 6px; font-weight: 700; }
.me { display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.live.on { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 20%, transparent); }

main { max-width: 1240px; margin: 0 auto; padding: 28px 20px 80px; }
.narrow { max-width: 860px; margin: 0 auto; }

/* ---------- botones y campos ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); padding: 9px 16px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 14px; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.dark { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.top .btn.ghost { color: var(--on-brand-2); }
.top .btn.ghost:hover { background: rgba(255,255,255,.08); color: var(--on-brand); }
.top .muted { color: var(--on-brand-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--bad); }
.btn.lg { padding: 13px 22px; font-size: 15px; border-radius: 12px; }
.btn svg { width: 18px; height: 18px; }

.f { display: block; margin-bottom: 16px; }
.f > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.f > span em { font-style: normal; font-weight: 400; color: var(--ink-3); }
.in, select.in, textarea.in { font-family: var(--font-input); font-size: 10pt; width: 100%; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.in { min-height: 120px; resize: vertical; }
.in:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 7px 14px; cursor: pointer; font-size: 14px; transition: all .15s; }
.chip:hover { border-color: var(--ink-3); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg button { text-align: left; border: 1px solid var(--line-2); background: var(--surface); border-radius: 12px; padding: 12px; cursor: pointer; }
.seg button b { display: block; font-size: 14px; }
.seg button span { font-size: 12.5px; color: var(--ink-3); }
.seg button { position: relative; transition: border-color .15s, background .15s; }
.seg button:hover { border-color: var(--ink-3); }
.seg button.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.seg button.on b { color: var(--accent-text); }
.seg button.on::after { content: "✓"; position: absolute; top: 10px; right: 12px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.falta-msg { display: none; color: var(--bad); font-size: 12.5px; font-weight: 600; margin-top: 6px; }
.f.falta .falta-msg { display: block; }
.f.falta > span { color: var(--bad); }
.f.falta .in, .f.falta .seg button, .f.falta .chip { border-color: var(--bad); }

/* ---------- tarjetas ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 22px; }
.section-h { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 34px 0 14px; }

.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: stretch; }
.hero-main { padding: 30px; background: var(--brand); color: var(--on-brand); border-bottom: 4px solid var(--brand-accent); border-radius: 20px; position: relative; overflow: hidden; }
.hero-main h1 { font-size: 32px; max-width: 18ch; }
.hero-main p { color: var(--on-brand-2); max-width: 44ch; margin: 10px 0 22px; }
.hero-main .btn.primary { background: var(--brand-accent); color: var(--brand); border-color: var(--brand-accent); }
.hero-main::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border: 1px solid rgba(213,133,0,.35); border-radius: 50%; box-shadow: 0 0 0 40px rgba(255,255,255,.03), 0 0 0 80px rgba(255,255,255,.02); }
.hero-side { display: grid; grid-template-rows: 1fr 1fr; gap: 12px; }
.stat { padding: 18px 20px; display: flex; flex-direction: column; justify-content: center; }
.stat b { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.stat span { color: var(--ink-3); font-size: 13px; }

.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.cat { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; cursor: pointer; display: flex; flex-direction: column; gap: 10px; min-height: 110px; transition: border-color .15s, transform .15s, box-shadow .15s; }
.cat:hover { border-color: var(--ink-3); transform: translateY(-2px); box-shadow: var(--shadow); }
.cat.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cat .ic { width: 38px; height: 38px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; }
.cat .ic svg { width: 20px; height: 20px; }
.cat b { font-size: 14px; line-height: 1.3; }

/* ---------- tickets ---------- */
.tlist { display: grid; gap: 10px; }
.trow { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; color: var(--ink); transition: border-color .15s; }
.trow:hover { border-color: var(--ink-3); }
.trow .ic { width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; }
.trow .ic svg { width: 20px; height: 20px; }
.trow .t { font-weight: 600; }
.trow .meta { font-size: 13px; color: var(--ink-3); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.trow .right { display: flex; flex-direction: column; align-items: end; gap: 6px; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-nuevo { background: var(--accent-soft); color: var(--accent-text); }
.st-asignado { background: var(--violet-soft); color: var(--violet); }
.st-progreso { background: var(--blue-soft); color: var(--blue); }
.st-espera { background: var(--teal-soft); color: var(--teal); }
.st-resuelto { background: var(--ok-soft); color: var(--ok); }
.st-cerrado, .st-cancelado { background: var(--gray-soft); color: var(--ink-3); }
.pr { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; border: 1px solid currentColor; }
.pr-critica { color: var(--bad); } .pr-alta { color: var(--orange); } .pr-media { color: var(--warn); } .pr-baja { color: var(--ok); }
.sla { font-size: 12.5px; }
.sla.late { color: var(--bad); font-weight: 700; }
.sla.soon { color: var(--warn); font-weight: 600; }

.tabs { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 4px; gap: 2px; }
.tabs button { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; cursor: pointer; font-weight: 600; color: var(--ink-2); font-size: 14px; }
.tabs button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.empty { text-align: center; padding: 48px 20px; color: var(--ink-3); }
.empty svg { width: 40px; height: 40px; opacity: .5; margin-bottom: 8px; }

/* ---------- asistente nueva solicitud ---------- */
.steps { display: flex; gap: 8px; margin: 18px 0 24px; }
.steps div { flex: 1; }
.steps i { display: block; height: 4px; border-radius: 4px; background: var(--line); }
.steps div.on i { background: var(--accent); }
.steps span { font-size: 12.5px; color: var(--ink-3); display: block; margin-top: 6px; }
.steps div.on span { color: var(--ink); font-weight: 600; }
.wizard-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.prio-box { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); margin: 4px 0 18px; }
.prio-box b { font-size: 18px; }
.drop { border: 1.5px dashed var(--line-2); border-radius: 14px; padding: 22px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop svg { width: 28px; height: 28px; color: var(--ink-3); }
.thumbs { display: flex; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.thumb { position: relative; width: 120px; height: 90px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; cursor: pointer; line-height: 1; }
.thumb small { position: absolute; left: 0; right: 0; bottom: 0; font-size: 11px; background: rgba(0,0,0,.55); color: #fff; padding: 2px 6px; }
.summary { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; font-size: 14px; }
.summary dt { color: var(--ink-3); }
.summary dd { margin: 0; }
.done { text-align: center; padding: 40px 20px; }
.done .check { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; margin: 0 auto 16px; }
.done .check svg { width: 32px; height: 32px; }
.done .code { font-size: 26px; font-weight: 800; letter-spacing: .04em; margin: 6px 0 10px; }

/* ---------- detalle del ticket ---------- */
.tk-head { display: flex; justify-content: space-between; gap: 16px; align-items: start; flex-wrap: wrap; }
.tk-head .code { font-weight: 700; color: var(--ink-3); letter-spacing: .04em; font-size: 13px; }
.tk-grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; margin-top: 20px; align-items: start; }
.progress { display: flex; margin: 22px 0 4px; }
.progress div { flex: 1; position: relative; text-align: center; font-size: 12px; color: var(--ink-3); }
.progress div::before { content: ""; position: absolute; top: 9px; left: -50%; right: 50%; height: 2px; background: var(--line); }
.progress div:first-child::before { display: none; }
.progress i { position: relative; z-index: 1; display: grid; place-items: center; width: 20px; height: 20px; margin: 0 auto 6px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-2); }
.progress div.on { color: var(--ink); font-weight: 600; }
.progress div.on i { background: var(--accent); border-color: var(--accent); }
.progress div.on::before { background: var(--accent); }
.progress div.now i { box-shadow: 0 0 0 5px var(--accent-soft); }
.desc { white-space: pre-wrap; margin: 0; }
.photos { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.photos img { width: 150px; height: 110px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); cursor: zoom-in; }
.kv { display: grid; gap: 12px; font-size: 14px; }
.kv div { display: grid; grid-template-columns: 120px 1fr; gap: 10px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.side-h { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 12px; }

.thread { display: grid; gap: 14px; margin-top: 8px; }
.msg { display: flex; gap: 10px; align-items: start; }
.msg .bubble { background: var(--surface-2); border-radius: 4px 14px 14px 14px; padding: 10px 14px; max-width: 78%; }
.msg .bubble p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg .who { font-size: 12.5px; color: var(--ink-3); margin-bottom: 2px; }
.msg.mine { flex-direction: row-reverse; }
.msg.mine .bubble { background: var(--accent); color: var(--accent-ink); border-radius: 14px 4px 14px 14px; }
.msg.mine .who { color: color-mix(in srgb, var(--accent-ink) 75%, transparent); text-align: right; }
.msg.internal .bubble { background: var(--warn-soft); border: 1px dashed var(--warn); color: var(--ink); }
.msg.internal .who { color: var(--warn); }
.ev { font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 10px; }
.ev::before, .ev::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.composer { margin-top: 18px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface); overflow: hidden; }
.composer textarea { font-family: var(--font-input); font-size: 10pt; border: 0; width: 100%; min-height: 80px; padding: 12px 14px; resize: vertical; outline: none; background: transparent; }
.composer .bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-top: 1px solid var(--line); background: var(--surface-2); gap: 10px; }
.composer.internal { border-color: var(--warn); }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.toggle input { accent-color: var(--warn); width: 16px; height: 16px; }
.stars { display: inline-flex; gap: 4px; }
.stars button { border: 0; background: none; font-size: 28px; cursor: pointer; color: var(--line-2); padding: 0 2px; line-height: 1; }
.stars button.on { color: #f5a524; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- panel IT ---------- */
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.kpi { padding: 16px 18px; }
.kpi span { font-size: 12.5px; color: var(--ink-3); display: block; }
.kpi b { font-size: 26px; font-weight: 700; letter-spacing: -.02em; display: block; margin-top: 2px; }
.kpi.kpi-alert b { color: var(--bad); }
.panel-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; margin-top: 12px; }
.chart svg { width: 100%; height: auto; display: block; }
.bars { display: grid; gap: 8px; }
.bars > div { display: grid; grid-template-columns: 1fr 34px; gap: 10px; align-items: center; font-size: 13px; }
.bars .bar { height: 8px; border-radius: 4px; background: var(--accent); margin-top: 4px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 24px 0 12px; }
.filters .in { width: auto; padding: 8px 12px; font-size: 10pt; }
.filters .search { flex: 1; min-width: 220px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr { cursor: pointer; }
table.t tbody tr:hover { background: var(--surface-2); }
.tbl-wrap { overflow-x: auto; }

/* ---------- tablero ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.col { background: var(--surface-2); border-radius: var(--radius); padding: 10px; min-height: 300px; transition: background .15s, box-shadow .15s; }
.col.over { box-shadow: inset 0 0 0 2px var(--accent); }
.col-h { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 10px; }
.col-h span { font-size: 12px; color: var(--ink-3); font-weight: 700; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 8px; cursor: grab; display: grid; gap: 8px; }
.kcard:active { cursor: grabbing; }
.kcard.drag { opacity: .4; }
.kcard .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); }
.kcard b { font-size: 14px; line-height: 1.35; }

/* ---------- inicio de sesión ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: var(--brand); color: var(--on-brand); border-right: 4px solid var(--brand-accent); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art .big { font-size: 84px; font-weight: 800; letter-spacing: .02em; line-height: 1; }
.login-art .login-logo { height: 52px; width: auto; max-width: 100%; align-self: flex-start; object-fit: contain; display: block; position: relative; }
.login-art .big { color: var(--brand-accent); }
.login-art p { color: var(--on-brand-2); max-width: 40ch; font-size: 17px; }
.login-art .grid-bg { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 48px 48px; mask-image: linear-gradient(135deg, transparent 30%, #000); pointer-events: none; }
.login-form { display: grid; place-items: center; padding: 40px 24px; }
.login-form > div { width: 100%; max-width: 380px; }
.ms-btn { width: 100%; justify-content: center; padding: 13px; font-size: 15px; }
.ms-logo { width: 18px; height: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.ms-logo i:nth-child(1) { background: #f25022; } .ms-logo i:nth-child(2) { background: #7fba00; } .ms-logo i:nth-child(3) { background: #00a4ef; } .ms-logo i:nth-child(4) { background: #ffb900; }
.alert { padding: 12px 14px; border-radius: 10px; background: var(--bad-soft); color: var(--bad); font-size: 14px; margin-bottom: 16px; }
.devbox { margin-top: 28px; padding-top: 20px; border-top: 1px dashed var(--line-2); }

/* ---------- varios ---------- */
#toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 100; }
.toast { background: var(--brand); color: var(--on-brand); border-left: 4px solid var(--brand-accent); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); font-size: 14px; max-width: 360px; animation: up .25s ease-out; cursor: pointer; }
.toast.err { background: var(--bad); color: #fff; }
@keyframes up { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: grid; place-items: center; z-index: 200; cursor: zoom-out; padding: 20px; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.spinner { width: 22px; height: 22px; border: 2.5px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 14px; margin-bottom: 14px; }
.back:hover { color: var(--ink); }
.back svg { width: 16px; height: 16px; }

@media (max-width: 980px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .tk-grid, .panel-grid, .hero { grid-template-columns: 1fr; }
  .hero-side { grid-template-rows: none; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  main { padding: 18px 16px 70px; }
  .top-in { padding: 10px 16px; gap: 10px; flex-wrap: wrap; }
  .nav { order: 3; flex-basis: 100%; margin: 0; }
  .brand-txt span, .me .name { display: none; }
  .brand-logo { height: 26px; }
  .brand { gap: 10px; }
  .me { margin-left: auto; }
  .login { grid-template-columns: 1fr; }
  .login-art { padding: 28px; min-height: 220px; }
  .login-art .big { font-size: 56px; }
  .grid2, .seg { grid-template-columns: 1fr; }
  .cats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .cat { min-height: 96px; padding: 12px; }
  .cat b { font-size: 13px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .hero-main { padding: 22px; }
  .hero-main h1 { font-size: 26px; }
  .trow { grid-template-columns: 1fr; }
  .trow .ic { display: none; }
  .trow .right { flex-direction: row; align-items: center; }
  .summary { grid-template-columns: 1fr; gap: 2px; }
  .summary dd { margin-bottom: 8px; }
  .msg .bubble { max-width: 90%; }
  .progress div { font-size: 10.5px; }
}

/* ---------- informes para gerencia ---------- */
:root { --s1: #C07800; --s2: #1F6FA8; }
@media (prefers-color-scheme: dark) { :root { --s1: #C98000; --s2: #4C9BD6; } }
.rep-rango { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.rep-rango label { font-size: 13px; color: var(--ink-2); display: grid; gap: 4px; }
.rep-rango .in { width: auto; }
.rep { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.rep-head { display: flex; align-items: center; gap: 24px; padding: 22px 28px; background: var(--brand); color: var(--on-brand); border-bottom: 4px solid var(--brand-accent); }
.rep-head img { height: 44px; width: auto; flex: none; }
.rep-head h2 { font-size: 22px; margin: 2px 0 4px; }
.rep-eyebrow { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--brand-accent); font-weight: 700; }
.rep-meta { font-size: 12.5px; color: var(--on-brand-2); }
.rep-kpis { display: grid; grid-template-columns: repeat(6, 1fr); border-bottom: 1px solid var(--line); }
.rep-kpi { padding: 18px 20px; border-right: 1px solid var(--line); display: grid; gap: 2px; align-content: start; }
.rep-kpi:last-child { border-right: 0; }
.rep-kpi b { font-size: 28px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.rep-kpi span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.rep-kpi small { font-size: 11.5px; color: var(--ink-3); }
.rep-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.rep-card { padding: 20px 24px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); break-inside: avoid; }
.rep-card:nth-child(2n+1) { border-right: 0; }
.rep-card:first-child { grid-column: 1 / -1; border-right: 0; }
.rep-card h3 { font-size: 14px; margin-bottom: 4px; }
.rep-sub { font-size: 12px; color: var(--ink-3); margin: 0 0 10px; }
.rep-card > h3 + :not(.rep-sub) { margin-top: 12px; }
.rep-bars { display: grid; gap: 7px; }
.rep-bar { display: grid; grid-template-columns: minmax(120px, 38%) 1fr 74px; gap: 10px; align-items: center; font-size: 12.5px; }
.rb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.rb-t { height: 12px; background: var(--surface-2); border-radius: 0 4px 4px 0; overflow: hidden; }
.rb-t i { display: block; height: 100%; background: var(--s1); border-radius: 0 4px 4px 0; }
.rb-v { text-align: right; font-weight: 700; color: var(--ink); }
.rb-v em { font-style: normal; font-weight: 400; color: var(--ink-3); font-size: 11.5px; }
.rep-t { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.rep-t th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); padding: 6px 8px; border-bottom: 1px solid var(--line-2); }
.rep-t td { padding: 7px 8px; border-bottom: 1px solid var(--line); }
.rep-t tr:last-child td { border-bottom: 0; }
.rep-t .num { text-align: right; }
.rep-legend { display: flex; gap: 18px; font-size: 12.5px; color: var(--ink-2); margin: 6px 0 4px; }
.rep-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rep-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.rep-legend .s1 { background: var(--s1); } .rep-legend .s2 { background: var(--s2); }
.rep-svg { width: 100%; height: auto; display: block; }
.rep-svg .g-s1 { fill: var(--s1); } .rep-svg .g-s2 { fill: var(--s2); }
.rep-svg .g-grid { stroke: var(--line); stroke-width: 1; }
.rep-svg .g-base { stroke: var(--line-2); stroke-width: 1; }
.rep-svg .g-ax { fill: var(--ink-3); font-size: 12px; }
.rep-svg .g-val { fill: var(--ink-2); font-size: 12px; font-weight: 600; }
.rep-svg path:hover { opacity: .8; }
.rep-foot { padding: 12px 24px; font-size: 11.5px; color: var(--ink-3); text-align: right; }
@media (max-width: 980px) {
  .rep-kpis { grid-template-columns: repeat(3, 1fr); }
  .rep-kpi:nth-child(3n) { border-right: 0; }
  .rep-grid { grid-template-columns: 1fr; }
  .rep-card { border-right: 0; }
}
@media (max-width: 720px) {
  .rep-head { flex-direction: column; align-items: start; gap: 12px; padding: 18px; }
  .rep-kpis { grid-template-columns: 1fr 1fr; }
  .rep-kpi:nth-child(3n) { border-right: 1px solid var(--line); }
  .rep-kpi:nth-child(2n) { border-right: 0; }
  .rep-bar { grid-template-columns: 1fr 64px; }
  .rep-bar .rb-t { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- impresión / PDF del informe ---------- */
@media print {
  @page { size: A4 landscape; margin: 9mm; }
  :root {
    --bg: #ffffff; --surface: #ffffff; --surface-2: #f1eeea;
    --ink: #201815; --ink-2: #51473f; --ink-3: #847970;
    --line: #e7e2dc; --line-2: #d6cec6;
    --accent: #D58500; --accent-ink: #201815; --accent-soft: #fbefd9; --accent-text: #8f5900;
    --s1: #C07800; --s2: #1F6FA8;
    --ok: #157f3b; --warn: #8a6100; --bad: #b42318; --orange: #c2410c;
    color-scheme: light;
  }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff; font-size: 12px; }
  .top, .no-print, #toasts, .back { display: none !important; }
  main { padding: 0; max-width: none; }
  .rep { border: 0; box-shadow: none; border-radius: 0; }
  .rep-head { padding: 14px 20px; }
  .rep-kpi { padding: 12px 14px; }
  .rep-kpi b { font-size: 22px; }
  .rep-card { padding: 12px 16px; }
  .rep-card:first-child .rep-svg { max-height: 46mm; margin: 0 auto; }
  .rep-foot { display: none; }
  .rep-card h3 { font-size: 12.5px; }
  .rep-bars { gap: 4px; }
  .rep-bar { font-size: 11px; }
  .rb-t { height: 10px; }
  .rep-t { font-size: 11px; }
  .rep-t td { padding: 4px 8px; }
  .rep-t th { padding: 4px 8px; }
  .rep-grid > .rep-card:nth-child(4) { break-before: page; }
  .rep-svg path:hover { opacity: 1; }
}

.aviso-version { background: var(--bad); color: #fff; padding: 12px 20px; font-size: 14px; text-align: center; }
@media print { .aviso-version { display: none; } }
