/* Identidad visual inspirada en digitaldatahub.cc: azul marino profundo, acentos azul acero, etiquetas en mayúsculas
   espaciadas, paneles con borde fino y botones de 8 px. Oscuro por defecto; claro con la paleta "app" del sitio. */
:root {
  color-scheme: dark;
  --bg: #071b2f; --surface: #0c2540; --surface-2: #123152; --border: #22374f; --input-bg: #0a2038;
  --text: #ffffff; --muted: #a3b1c2;
  --brand: #7db4d1; --brand-soft: rgb(125 180 209 / .14);
  --primary-bg: #b4c2d3; --primary-fg: #071b2f; --btn-border: rgb(255 255 255 / .38);
  --ok: #4fd1a1; --ok-soft: rgb(79 209 161 / .14); --warn: #f5a45a; --warn-soft: rgb(245 164 90 / .14);
  --bad: #ff8f86; --bad-soft: rgb(255 143 134 / .14); --info: #8db8ff; --info-soft: rgb(141 184 255 / .14);
  --radius: 10px; --shadow: none;
  --glow: radial-gradient(55% 70% at 82% -5%, rgb(42 92 135 / .55) 0%, rgb(42 92 135 / 0) 70%);
  --font-head: Inter, "SF Pro Display", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "DM Sans", Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --bg: #f3f6fb; --surface: #ffffff; --surface-2: #eef2f9; --border: #e1e6ef; --input-bg: #ffffff;
    --text: #20263c; --muted: #5d6a7e;
    --brand: #2563eb; --brand-soft: #f0f7ff;
    --primary-bg: #2563eb; --primary-fg: #ffffff; --btn-border: #cfd7e6;
    --ok: #0d8a62; --ok-soft: #e6f7ef; --warn: #b45309; --warn-soft: #fff4e0;
    --bad: #c0362c; --bad-soft: #fdeceb; --info: #1d56c4; --info-soft: #e8f0fd;
    --shadow: 0 8px 20px -16px rgb(15 23 42 / .28);
    --glow: none;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font-body); background-image: var(--glow); background-repeat: no-repeat; background-attachment: fixed; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
a { color: var(--brand); }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: var(--surface); padding: 8px; z-index: 99; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.shell { display: grid; grid-template-columns: 220px 1fr; grid-template-rows: auto auto 1fr; min-height: 100vh; }
.devbar { grid-column: 1 / -1; background: var(--warn-soft); color: var(--warn); padding: 6px 16px; font-size: .82rem; }
.topbar { grid-column: 1 / -1; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { font-weight: 700; display: flex; align-items: center; gap: 8px; margin-right: auto; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--brand); display: inline-block; }
.who { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.who label { font-size: .8rem; color: var(--muted); }
.nav { background: var(--surface); border-right: 1px solid var(--border); padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.nav a { padding: 8px 12px; border-radius: 8px; color: var(--text); text-decoration: none; }
.nav a:hover { background: var(--surface-2); }
.nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
main { padding: 24px; max-width: 1100px; width: 100%; }
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  main { padding: 16px; }
}

.page-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .mono { font-family: ui-monospace, Menlo, monospace; font-size: .82rem; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

button, .btn { font: inherit; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 7px 14px; border-radius: 8px; cursor: pointer; }
button:hover:not(:disabled) { background: var(--surface-2); }
button:disabled { opacity: .55; cursor: not-allowed; }
.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
.primary:hover:not(:disabled) { background: var(--brand); filter: brightness(1.08); }
.danger { color: var(--bad); border-color: var(--bad); }
.icon-btn { padding: 2px 9px; border: 0; background: transparent; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; width: 100%; }
textarea { min-height: 96px; resize: vertical; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label { font-weight: 600; font-size: .88rem; }
.hint { margin: 0; color: var(--muted); font-size: .8rem; }
.checks { display: flex; gap: 14px; flex-wrap: wrap; }
.checks label { display: flex; gap: 6px; align-items: center; font-weight: 400; }
.checks input { width: auto; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filters input { max-width: 280px; } .filters select { max-width: 200px; }

.badge { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: .75rem; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge-ok { background: var(--ok-soft); color: var(--ok); } .badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); } .badge-info { background: var(--info-soft); color: var(--info); }
.badge-brand { background: var(--brand-soft); color: var(--brand); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table-wrap { overflow-x: auto; padding: 0; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; }
.tabs button[aria-selected="true"] { border-bottom-color: var(--brand); color: var(--brand); font-weight: 600; }

.empty { text-align: center; padding: 36px 16px; color: var(--muted); background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }
.empty p { margin: 6px 0 0; }
.notice { padding: 10px 14px; border-radius: 8px; background: var(--info-soft); color: var(--info); font-size: .88rem; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.check-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.check-list li { display: flex; gap: 8px; align-items: center; font-size: .86rem; }
.hit { border-left: 3px solid var(--brand); padding-left: 12px; }
.hit p { margin: 4px 0; white-space: pre-wrap; }
.skeleton { height: 90px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }

.modal { border: 1px solid var(--border); border-radius: 14px; padding: 0; background: var(--surface); color: var(--text); width: min(520px, calc(100vw - 24px)); box-shadow: 0 20px 60px rgb(0 0 0 / .35); }
.modal.wide { width: min(760px, calc(100vw - 24px)); }
.modal::backdrop { background: rgb(10 12 25 / .55); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 18px; max-height: 75vh; overflow: auto; }

#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: min(420px, calc(100vw - 32px)); }
.toast { padding: 10px 14px; border-radius: 8px; background: var(--ok-soft); color: var(--ok); box-shadow: var(--shadow); border: 1px solid var(--border); }
.toast-error { background: var(--bad-soft); color: var(--bad); }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }
.grid > .empty { grid-column: 1 / -1; }
a.card { text-decoration: none; color: inherit; display: block; }
a.card:hover { border-color: var(--brand); }
.who select { width: auto; max-width: 300px; }
.nav, main, .topbar { min-width: 0; }
.card > .actions { margin-top: 12px; }

/* ---- Tema Digital Edge ---- */
h1, h2, h3, .brand { font-family: var(--font-head); }
h1 { font-size: clamp(1.6rem, 3.2vw, 2.15rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.12; }
h2 { font-weight: 700; letter-spacing: -.01em; } h3 { font-weight: 600; }
.topbar { background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); padding: 12px 24px; }
.brand { flex-direction: column; align-items: flex-start; gap: 1px; line-height: 1.1; }
.wordmark { font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; }
.tagline, main[data-section] .page-head h1::before { text-transform: uppercase; letter-spacing: .16em; font-weight: 600; }
.tagline { font-size: .62rem; color: var(--muted); }
.devbar { background: var(--warn-soft); border-bottom: 1px solid var(--border); text-align: center; letter-spacing: .02em; }
.nav { background: transparent; padding: 18px 14px; gap: 2px; }
.nav a { border-radius: 8px; color: var(--muted); font-weight: 500; border-left: 2px solid transparent; border-radius: 0 8px 8px 0; }
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a[aria-current="page"] { background: var(--brand-soft); color: var(--text); border-left-color: var(--brand); }
main[data-section] .page-head h1::before { display: block; font-family: var(--font-body); font-size: .7rem; color: var(--brand); margin-bottom: 8px; }
main[data-section="personas"] .page-head h1::before { content: "Catálogo"; }
main[data-section="knowledge"] .page-head h1::before { content: "Conocimiento"; }
main[data-section="team"] .page-head h1::before { content: "Acceso y roles"; }
main[data-section="audit"] .page-head h1::before { content: "Trazabilidad"; }
.card, .empty, .modal { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow); }
.card { border-radius: 8px; }
.empty { border-style: dashed; }
a.card:hover { border-color: var(--brand); transform: translateY(-1px); transition: transform .15s, border-color .15s; }
button, .btn { border: 1px solid var(--btn-border); background: transparent; border-radius: 8px; font-weight: 500; padding: 8px 16px; transition: background .15s, border-color .15s; }
button:hover:not(:disabled) { background: var(--brand-soft); border-color: var(--brand); }
.primary { background: var(--primary-bg); border-color: var(--primary-bg); color: var(--primary-fg); font-weight: 600; }
.primary:hover:not(:disabled) { background: var(--primary-bg); border-color: var(--primary-bg); filter: brightness(1.1); }
.danger { color: var(--bad); border-color: var(--bad); }
.danger:hover:not(:disabled) { background: var(--bad-soft); border-color: var(--bad); }
input, select, textarea { background: var(--input-bg); border-color: var(--border); border-radius: 8px; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
th { letter-spacing: .12em; font-size: .7rem; }
tbody tr:hover { background: var(--brand-soft); }
.badge { letter-spacing: .02em; border: 1px solid transparent; }
.badge-neutral { border-color: var(--border); }
.badge-brand { background: var(--brand-soft); color: var(--brand); }
.tabs { border-bottom-color: var(--border); }
.tabs button { color: var(--muted); }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--brand); }
.notice { border: 1px solid var(--border); }
.hit { border-left-color: var(--brand); }
.toast { background: var(--surface-2); color: var(--text); border: 1px solid var(--ok); }
.toast-error { border-color: var(--bad); }
.modal::backdrop { background: rgb(3 12 22 / .7); backdrop-filter: blur(2px); }
.skeleton { background: linear-gradient(90deg, var(--surface), var(--surface-2), var(--surface)); background-size: 200% 100%; }
::selection { background: var(--brand-soft); }

/* Chat y aprobaciones */
main[data-section="chat"] .page-head h1::before { content: "Runtime"; }
main[data-section="approvals"] .page-head h1::before { content: "Herramientas"; }
.chat-layout { display: grid; grid-template-columns: 280px 1fr; gap: 14px; align-items: start; }
@media (max-width: 900px) { .chat-layout { grid-template-columns: 1fr; } }
.conv-link { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; border: 1px solid transparent; }
.conv-link:hover, .conv-link[aria-current="true"] { background: var(--brand-soft); border-color: var(--border); }
.chat-pane { display: flex; flex-direction: column; min-height: 420px; padding: 0; overflow: hidden; }
.thread { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; max-height: 58vh; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); }
.msg-user { align-self: flex-end; background: var(--brand-soft); }
.msg-role { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.cites { margin-top: 8px; }
.composer { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); align-items: flex-end; }
.composer textarea { min-height: 52px; max-height: 140px; }

/* M08 · contenido, soporte y avisos */
main[data-section="content"] .page-head h1::before { content: "Editorial"; }
main[data-section="support"] .page-head h1::before { content: "Atención"; }
main[data-section="notifications"] .page-head h1::before { content: "Bandeja"; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }

/* M09 · analítica y exportaciones */
main[data-section="analytics"] .page-head h1::before { content: "Métricas"; }
main[data-section="exports"] .page-head h1::before { content: "Datos"; }
.tile-value { margin: 2px 0; font: 600 1.7rem/1.1 var(--font-head); }
.tile-bad { color: var(--bad); } .tile-warn { color: var(--warn); }
.bars { display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 44px 1fr 64px; gap: 8px; align-items: center; }
.bar-track { background: var(--surface-2); border-radius: 4px; height: 12px; overflow: hidden; }
.bar { background: var(--brand); height: 100%; min-width: 2px; }
.notice.bad { background: var(--bad-soft); color: var(--bad); }

/* Inicio de sesión (OIDC) */
.signin { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.signin .card { max-width: 420px; width: 100%; }
a.button { display: inline-block; text-align: center; text-decoration: none; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--btn-border); }
a.button.primary { background: var(--primary-bg); color: var(--primary-fg); border-color: transparent; font-weight: 600; }

/* ---- Consola de plataforma y nueva barra lateral ---- */
:root { --pill: 9999px; --card-r: 16px; --side-w: 264px; }
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.shell.is-collapsed { --side-w: 72px; }
.sidebar { position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--border); padding: 16px 12px; display: flex; flex-direction: column; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; padding: 4px 6px; }
.logo-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--brand); color: var(--primary-fg); font-size: .8rem; font-weight: 800; flex: none; }
.brand-name sup { font-size: .55em; margin-left: 2px; }
.side-nav, .workspaces, .ws-nav { display: flex; flex-direction: column; gap: 2px; }
.side-link, .ws-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); text-decoration: none; font-weight: 500; text-align: left; cursor: pointer; }
.side-link:hover, .ws-head:hover { background: var(--brand-soft); color: var(--text); }
.side-link[aria-current="page"] { background: var(--brand-soft); color: var(--text); font-weight: 600; }
.side-eyebrow { margin: 8px 10px 2px; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ws-nav { margin: 2px 0 6px 18px; padding-left: 8px; border-left: 1px solid var(--border); }
.ws-avatar { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; color: #fff; font-size: .7rem; font-weight: 700; flex: none; background: var(--brand); }
.ws-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.ws-role { font-size: .62rem; }
.workspace.open > .ws-head { background: var(--brand-soft); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.view-as label { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); margin-bottom: 4px; }
.env-banner { text-align: center; font-size: .68rem; font-weight: 700; letter-spacing: .1em; padding: 4px; border-radius: var(--pill); }
.env-dev { background: var(--warn-soft); color: var(--warn); } .env-staging { background: var(--info-soft); color: var(--info); } .env-prod { background: var(--ok-soft); color: var(--ok); }
.account { display: flex; align-items: center; gap: 8px; }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: .78rem; flex: none; }
.account-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.2; } .account-text small { color: var(--muted); }
.icon-link { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--muted); } .icon-link:hover { background: var(--brand-soft); color: var(--text); }
.account-actions { gap: 6px; } .account-actions button { flex: 1; padding: 6px 8px; font-size: .78rem; }
.is-collapsed .label, .is-collapsed .brand-name, .is-collapsed .ws-name, .is-collapsed .ws-role, .is-collapsed .side-eyebrow, .is-collapsed .ws-nav, .is-collapsed .view-as, .is-collapsed .account-text, .is-collapsed .account-actions, .is-collapsed .icon-link { display: none; }
.content { min-width: 0; padding: 0 28px 48px; }
.content-top { display: flex; align-items: center; gap: 12px; padding: 14px 0; }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .85rem; } .crumbs a { color: var(--muted); display: inline-grid; } .crumb-now { color: var(--text); font-weight: 600; }
.menu-toggle { display: none; padding: 6px; border-radius: 10px; }
.dev-note { margin: 0 0 12px; font-size: .78rem; color: var(--muted); }
main#main { max-width: 1180px; }
.icon { vertical-align: -3px; flex: none; }
.pill, .primary { border-radius: var(--pill); }
.card { border-radius: var(--card-r); }
.block { display: flex; justify-content: center; align-items: center; gap: 6px; width: 100%; text-align: center; }
.admin-head { display: flex; align-items: center; gap: 16px; padding: 20px 24px; margin-bottom: 16px; }
.admin-head > div { flex: 1; } .admin-head h1 { margin: 0; } .admin-head p { margin: 2px 0 0; }
.admin-mark { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0 0 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--card-r); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); }
.kpi-label { font-size: .75rem; color: var(--muted); } .kpi-value { font-size: 1.6rem; font-family: var(--font-head); }
.kpi-warn .kpi-value { color: var(--warn); } .kpi-ok .kpi-value { color: var(--ok); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; margin: 0 0 16px; }
.chip, .more-rooms summary { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px solid var(--btn-border); border-radius: var(--pill); color: var(--text); text-decoration: none; background: var(--surface); cursor: pointer; font-weight: 500; list-style: none; }
.more-rooms summary::-webkit-details-marker { display: none; }
.chip:hover, .more-rooms summary:hover { border-color: var(--brand); }
.chip[aria-current="page"] { background: var(--primary-bg); color: var(--primary-fg); border-color: var(--primary-bg); }
.more-rooms { position: relative; } .more-rooms[open] > summary { border-color: var(--brand); }
.more-grid { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: min(560px, 90vw); display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--card-r); box-shadow: 0 20px 50px -20px rgb(0 0 0 / .45); }
.more-item { display: flex; gap: 10px; padding: 8px; border-radius: 10px; color: var(--text); text-decoration: none; } .more-item small { display: block; }
.more-item:hover, .more-item[aria-current="page"] { background: var(--brand-soft); }
.room-title { margin: 8px 0 12px; } .room-title h2 { margin: 0; } .room-title p { margin: 2px 0 0; }
.admin-card { margin-bottom: 16px; } .card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; } .card-head h2 { margin: 0; font-size: 1.05rem; } .card-head p { margin: 2px 0 0; }
.stack.tight { gap: 6px; }
.assign { display: flex; align-items: center; gap: 6px; } .assign-name { min-width: 90px; font-weight: 500; } .assign select { width: auto; padding: 4px 8px; }
.icon-btn { padding: 4px; border-radius: 50%; line-height: 0; }
.narrow { width: 90px; }
ul.plain, ol.plain { margin: 0; padding-left: 20px; }
pre.prompt { white-space: pre-wrap; margin: 0; padding: 12px; border-radius: 10px; background: var(--surface-2); font: .85rem/1.5 ui-monospace, Menlo, monospace; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; } .filters > * { width: auto; min-width: 150px; }
/* Pantalla de acceso */
.signin-page { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(60% 50% at 80% 0%, #1d4a73 0%, #071b2f 70%); color: #fff; }
.signin-top { padding: 20px 32px; } .signin-page .wordmark { font-family: var(--font-head); font-weight: 700; letter-spacing: .02em; }
.signin-page .signin { flex: 1; } .signin-card { width: min(440px, 100%); padding: 32px; border-radius: 20px; background: #0c2540; border: 1px solid #22374f; box-shadow: 0 30px 80px -30px rgb(0 0 0 / .7); }
.signin-card h1 { margin: 0; font-size: 1.8rem; color: #fff; } .signin-card .muted { color: #a3b1c2; }
.eyebrow { margin: 0; font-size: .7rem; letter-spacing: .16em; color: #7db4d1; font-weight: 700; }
.return-box { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 10px; background: #123152; font-size: .85rem; color: #d4deea; }
.signin-card .primary { background: #b4c2d3; color: #071b2f; border-color: #b4c2d3; padding: 11px 16px; text-decoration: none; font-weight: 600; }
.divider { display: flex; align-items: center; gap: 10px; color: #a3b1c2; font-size: .8rem; } .divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: #22374f; }
.center { text-align: center; } .signin-card a { color: #7db4d1; }
.signin-foot { padding: 20px; text-align: center; font-size: .78rem; color: #a3b1c2; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) { --bg: #f6f3ff; --glow: radial-gradient(60% 50% at 85% -10%, #e6dcff 0%, rgb(230 220 255 / 0) 70%); --brand: #6d4fd6; --brand-soft: #efe9ff; --primary-bg: #6d4fd6; --primary-fg: #fff; --btn-border: #d6cdf0; --border: #e5defa; }
}
@media (max-width: 860px) {
  .shell, .shell.is-collapsed { display: block; --side-w: 264px; }
  .sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; width: var(--side-w); transform: translateX(-105%); transition: transform .2s; }
  .sidebar.open { transform: none; } .is-collapsed .label, .is-collapsed .brand-name, .is-collapsed .ws-name, .is-collapsed .ws-role, .is-collapsed .side-eyebrow, .is-collapsed .ws-nav, .is-collapsed .account-text { display: revert; }
  .content { padding: 0 16px 40px; } .menu-toggle { display: inline-flex; } .collapse { display: none; }
  .admin-head { flex-wrap: wrap; } .assign { flex-wrap: wrap; }
}
td select { width: auto; min-width: 120px; } .table-wrap .row { flex-wrap: nowrap; }
.stack.tight { align-items: flex-start; } td .pill { width: auto; white-space: nowrap; }
.ws-group .side-eyebrow { margin-top: 6px; }
.company-head { margin: 4px 0 12px; } .company-head h1 { margin: 6px 0 0; } .company-head p { margin: 4px 0 0; }
.ws-avatar.big { width: 40px; height: 40px; font-size: .95rem; border-radius: 12px; }
.tab-links { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab-link { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab-link:hover { color: var(--text); } .tab-link[aria-current="page"] { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.tile { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); text-decoration: none; background: var(--surface); }
.tile > span { flex: 1; min-width: 0; } .tile small { display: block; } .tile:hover { border-color: var(--brand); }
.empty-slot { border: 1px dashed var(--border); border-radius: 12px; padding: 24px; text-align: center; color: var(--muted); }
dl.details { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 0; } dl.details dt { color: var(--muted); } dl.details dd { margin: 0; }
/* Guía y Markdown */
.guide { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.guide-toc { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 2px; padding: 12px; }
.guide-toc a { padding: 7px 10px; border-radius: 10px; color: var(--muted); text-decoration: none; font-size: .9rem; }
.guide-toc a:hover, .guide-toc a[aria-current="page"] { background: var(--brand-soft); color: var(--text); } .guide-toc a[aria-current="page"] { font-weight: 600; }
.guide-card { padding: 24px 28px; } .guide-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--border); }
.guide-nav a { text-decoration: none; font-weight: 500; } .guide-next { margin-left: auto; }
.md > :first-child { margin-top: 0; } .md h2 { font-size: 1.6rem; margin: 0 0 12px; } .md h3 { font-size: 1.2rem; margin: 28px 0 10px; } .md h4 { font-size: 1.02rem; margin: 20px 0 8px; }
.md p, .md li { line-height: 1.65; } .md ul, .md ol { padding-left: 22px; } .md code { font-family: ui-monospace, Menlo, monospace; font-size: .85em; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.md pre.md-code { overflow-x: auto; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); } .md pre code { background: none; padding: 0; }
.md blockquote { margin: 12px 0; padding: 8px 14px; border-left: 3px solid var(--brand); background: var(--brand-soft); border-radius: 0 10px 10px 0; }
.md .table-wrap { margin: 12px 0; border: 1px solid var(--border); border-radius: 12px; }
.diagram-wrap { margin: 16px 0; padding: 16px; overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); }
.diagram { display: block; margin: 0 auto; max-width: none; height: auto; }
.dg-node { fill: var(--surface); stroke: var(--brand); stroke-width: 1.4; } .dg-decision { fill: var(--warn-soft); stroke: var(--warn); } .dg-dot { fill: var(--brand); }
.dg-text { fill: var(--text); font: 12px var(--font-body); } .dg-label { fill: var(--muted); font: 11px var(--font-body); paint-order: stroke; stroke: var(--surface-2); stroke-width: 4px; }
.dg-edge { fill: none; stroke: var(--muted); stroke-width: 1.4; } .dg-arrow { fill: var(--muted); }
@media (max-width: 860px) { .guide { grid-template-columns: 1fr; } .guide-toc { position: static; flex-direction: row; overflow-x: auto; } .guide-toc .side-eyebrow { display: none; } .guide-toc a { white-space: nowrap; } .guide-card { padding: 16px; } }
/* Inicio: selección de empresa */
.home-head { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; padding: 28px; margin-bottom: 16px; border-radius: 24px; }
.home-head h1 { margin: 10px 0 6px; font-size: 2rem; } .home-head p { margin: 0; max-width: 46ch; }
.home-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.home-stat { min-width: 110px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.home-stat span { font-size: .8rem; color: var(--muted); } .home-stat strong { font-size: 1.7rem; font-family: var(--font-head); }
.company-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.company-card { display: flex; flex-direction: column; gap: 8px; padding: 20px; border: 1px solid var(--border); border-radius: 22px; background: var(--surface); color: var(--text); text-decoration: none; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.company-card:hover { transform: translateY(-2px); border-color: var(--brand); }
.company-card h3 { margin: 6px 0 0; font-size: 1.1rem; } .company-card p { margin: 0; font-size: .9rem; }
.cc-top { display: flex; justify-content: space-between; align-items: flex-start; color: var(--muted); }
.cc-icon { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.cc-open { margin-top: auto; padding-top: 8px; color: var(--brand); font-weight: 600; font-size: .9rem; }

/* Tema explícito (menú de la cuenta): mismas paletas que el modo del sistema */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f3ff; --surface: #ffffff; --surface-2: #eef2f9; --border: #e5defa; --input-bg: #ffffff; --text: #20263c; --muted: #5d6a7e;
  --brand: #6d4fd6; --brand-soft: #efe9ff; --primary-bg: #6d4fd6; --primary-fg: #fff; --btn-border: #d6cdf0;
  --ok: #0d8a62; --ok-soft: #e6f7ef; --warn: #b45309; --warn-soft: #fff4e0; --bad: #c0362c; --bad-soft: #fdeceb; --info: #1d56c4; --info-soft: #e8f0fd;
  --shadow: 0 8px 20px -16px rgb(15 23 42 / .28); --glow: radial-gradient(60% 50% at 85% -10%, #e6dcff 0%, rgb(230 220 255 / 0) 70%);
}
/* Cuenta y menú contraído */
.account-wrap { position: relative; } .account { width: 100%; padding: 6px; border: 0; border-radius: 12px; background: transparent; text-align: left; } .account:hover { background: var(--brand-soft); }
.foot-icons { display: flex; justify-content: space-around; gap: 4px; }
.account-pop { position: fixed; z-index: 60; width: 260px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 24px 60px -20px rgb(0 0 0 / .55); overflow: hidden; }
.pop-head { display: flex; flex-direction: column; padding: 14px 16px; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; } .pop-head small { color: var(--muted); }
.pop-sec { padding: 8px; } .pop-sec + .pop-sec { border-top: 1px solid var(--border); } .pop-sec .side-eyebrow { margin: 4px 8px 6px; }
.pop-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; border-radius: 10px; padding: 9px 10px; background: transparent; text-align: left; }
.seg { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: var(--pill); background: var(--surface-2); }
.seg button { flex: 1; display: inline-flex; justify-content: center; align-items: center; gap: 4px; padding: 5px 6px; border: 0; border-radius: var(--pill); font-size: .78rem; }
.seg button[aria-pressed="true"] { background: var(--surface); box-shadow: var(--shadow); font-weight: 600; }
.is-collapsed .sidebar { align-items: center; padding: 12px 8px; } .is-collapsed .side-nav, .is-collapsed .workspaces, .is-collapsed .side-foot { align-items: center; width: 100%; }
.is-collapsed .brand { justify-content: center; padding: 0; } .is-collapsed .side-link { justify-content: center; width: 44px; padding: 10px 0; }
.is-collapsed .account { width: auto; padding: 4px; } .is-collapsed .foot-icons { flex-direction: column; align-items: center; } .is-collapsed .icon-link { display: inline-grid; }
.is-collapsed .env-banner { font-size: 0; padding: 4px 8px; } .is-collapsed .env-banner::after { content: attr(data-short); font-size: .65rem; }
.is-collapsed .workspaces { gap: 10px; }
.ws-pill { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 6px; border: 1px solid var(--border); border-radius: 26px; background: var(--surface-2); }
.ws-pill.open { background: var(--brand-soft); border-color: var(--brand); }
.rail-avatar { border: 0; cursor: pointer; width: 36px; height: 36px; padding: 0; }
.rail-div { width: 20px; height: 1px; background: var(--border); }
.rail-link { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--muted); } .rail-link:hover { background: var(--surface); color: var(--text); }
.rail-link[aria-current="page"] { background: var(--primary-bg); color: var(--primary-fg); }
.brand-name { white-space: nowrap; font-size: .9rem; letter-spacing: -.01em; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.signin-card h1 { white-space: nowrap; font-size: clamp(1.3rem, 6vw, 1.8rem); }
/* Marca en una línea con separador, como en la referencia */
:root { --side-w: 300px; }
.brand { gap: 12px; padding: 4px 6px 16px; margin: 0 -12px 4px; padding-left: 18px; padding-right: 18px; border-bottom: 1px solid var(--border); }
.logo-mark { width: 40px; height: 40px; border-radius: 12px; font-size: .95rem; }
.brand-name { font-size: 1.02rem; font-weight: 700; letter-spacing: -.015em; }
.is-collapsed .brand { margin: 0 -8px 4px; padding: 4px 0 14px; justify-content: center; width: calc(100% + 16px); }
.brand { flex-direction: row; align-items: center; justify-content: flex-start; }
.is-collapsed .brand { justify-content: center; }
:root { --side-w: 308px; } .brand { gap: 10px; padding-left: 16px; padding-right: 16px; } .brand-name { font-size: .95rem; overflow: visible; }
