/* Incubatio — estilos. La marca de cada incubadora se inyecta en --brand. */
:root {
  --brand: #7a2418;
  --brand-2: #2f5232;
  --brand-3: #2b3149;
  --brand-gold: #c79228;
  --brand-ink: #6f5737;
  --brand-soft: color-mix(in srgb, var(--brand) 12%, transparent);
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-2: #f8fafb;
  --text: #17212b;
  --muted: #5d6b78;
  --line: #e2e7ec;
  --ok: #15803d;
  --warn: #b45309;
  --bad: #b91c1c;
  --info: #1d4ed8;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --radius: 10px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1419; --panel: #161d24; --panel-2: #1b232b; --text: #e6edf3; --muted: #93a1ae;
    --line: #26313b; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1419; --panel: #161d24; --panel-2: #1b232b; --text: #e6edf3; --muted: #93a1ae;
  --line: #26313b; --shadow: none; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.45; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 10px; }
h3 { font-size: 14px; margin: 0 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }

/* Layout */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 14px 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.brand-logo { width: 38px; height: 38px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex: none; overflow: hidden; }
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-name { font-weight: 700; font-size: 13px; line-height: 1.2; }
.nav-group { margin: 12px 8px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.nav a { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; color: var(--text); font-size: 13.5px; }
.nav a:hover { background: var(--panel-2); text-decoration: none; }
.nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav .ico { width: 20px; text-align: center; }
.main { min-width: 0; }
.top { display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top .grow { flex: 1; }
.page { padding: 22px 24px 60px; max-width: 1400px; }
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .grow { flex: 1; min-width: 200px; }
.btn.menu-btn { display: none; }

/* Componentes */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { padding: 14px 16px; }
.kpi .v { font-size: 24px; font-weight: 750; letter-spacing: -.01em; }
.kpi .l { color: var(--muted); font-size: 12.5px; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 8px; padding: 7px 12px; font: inherit; font-weight: 550; cursor: pointer; }
.btn:hover { background: var(--panel-2); }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 9px; font-size: 12.5px; }
.btn:disabled { opacity: .55; cursor: default; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--panel-2); border: 1px solid var(--line); white-space: nowrap; }
.badge.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.badge.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.badge.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.badge.info { color: var(--info); border-color: color-mix(in srgb, var(--info) 35%, transparent); background: color-mix(in srgb, var(--info) 10%, transparent); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.verde { background: var(--ok); } .dot.ambar { background: #f59e0b; } .dot.rojo { background: var(--bad); }

table { width: 100%; border-collapse: collapse; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--panel-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--panel-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

input, select, textarea { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
textarea { min-height: 90px; resize: vertical; }
input[type=checkbox] { width: auto; }
input[type=range] { padding: 0; }
label.f { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 4px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.help { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input[type=search] { max-width: 280px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 9px 14px; font: inherit; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

.modal-bg { position: fixed; inset: 0; background: rgba(15, 20, 25, .45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--panel); border-radius: 12px; width: min(760px, 100%); max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.modal header { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); }
.modal header h2 { margin: 0; flex: 1; }
.modal .body { padding: 18px; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--panel); }

.toast { position: fixed; right: 18px; bottom: 18px; background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 9px; z-index: 80; max-width: 420px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); }
.toast.err { background: var(--bad); color: #fff; }

.list-clean { list-style: none; padding: 0; margin: 0; }
.list-clean li { padding: 9px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: flex-start; }
.list-clean li:last-child { border-bottom: 0; }
.bar { height: 8px; background: var(--panel-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.bar > span { display: block; height: 100%; background: var(--brand); }
.notice { border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 8%, transparent); padding: 10px 12px; border-radius: 9px; font-size: 13px; }
.notice.info { border-color: color-mix(in srgb, var(--info) 35%, transparent); background: color-mix(in srgb, var(--info) 7%, transparent); }
.tool-card { display: flex; flex-direction: column; gap: 8px; }
.tool-card .t-ico { font-size: 26px; }
.stage-line { display: flex; gap: 4px; margin: 10px 0; }
.stage-line span { flex: 1; height: 10px; border-radius: 3px; background: var(--panel-2); border: 1px solid var(--line); }
.stage-line span.on { background: var(--brand); border-color: var(--brand); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.empty { text-align: center; padding: 30px; color: var(--muted); }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
svg text { fill: var(--muted); font-size: 10px; }

/* Login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-hero { background: #fff; color: #3b2f22; position: relative; padding: 48px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 22px; border-right: 1px solid #eadfce; }
.login-logo { width: min(420px, 80%); height: auto; }
.login-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: linear-gradient(90deg, #2f5232 0 20%, #2b3149 20% 40%, #7a2418 40% 60%, #c4581f 60% 80%, #c79228 80%); }
.login-hero ul { max-width: 520px; padding-left: 18px; color: #5a4632; }
.login-hero li { margin: 6px 0; }
.login-box { display: grid; place-items: center; padding: 30px; }
.login-box form { width: min(380px, 100%); display: grid; gap: 12px; }
.demo-users { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

@media (max-width: 1000px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; width: 260px; left: -270px; transition: left .2s; }
  .side.open { left: 0; }
  .btn.menu-btn { display: inline-flex; }
  .page { padding: 16px; }
  .top { padding: 10px 16px; }
  .g2, .g3, .g4, .form-grid { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-hero { padding: 28px 16px; }
  .kv { grid-template-columns: 1fr; }
}
@media print {
  .side, .top, .no-print { display: none !important; }
  .app { display: block; }
  .card { box-shadow: none; break-inside: avoid; }
}

.page:focus { outline: none; }

.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 44px; }
.pass-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; cursor: pointer; font-size: 18px; padding: 4px 8px; border-radius: 6px; opacity: .65; }
.pass-eye[aria-pressed="true"] { opacity: 1; background: var(--brand-soft); }
.impersona { background: var(--brand-gold); color: #241a0e; padding: 6px 24px; font-size: 13px; display: flex; gap: 12px; align-items: center; }
.impersona { flex-wrap: wrap; }
.imp-roles { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.role-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 14px; cursor: pointer; font: inherit; color: var(--text); transition: border-color .15s, box-shadow .15s, transform .15s; }
.role-btn:hover { border-color: var(--brand); box-shadow: 0 4px 14px rgba(122, 36, 24, .15); transform: translateY(-1px); }
.role-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.role-btn .ico { font-size: 28px; }
.role-btn b { font-size: 15px; }
