:root {
  color-scheme: light;
  --bg: #eef1f4;
  --surface: #ffffff;
  --panel: #f6f8fa;
  --inset: #eceff2;
  --ink: #121a21;
  --muted: #5c6b77;
  --faint: #8695a1;
  --line: #dde3e8;
  --accent: #0d6f8c;
  --accent-soft: #d7edf3;
  --ok: #1b8a5a;
  --ok-soft: #d8efe3;
  --warning: #b5730b;
  --warning-soft: #f7e9cf;
  --critical: #c23b34;
  --critical-soft: #f6dcda;
  --purple: #6b4fb0;
  --purple-soft: #e9e3f7;
  --shadow: 0 1px 2px rgba(16, 30, 40, .06), 0 6px 20px rgba(16, 30, 40, .06);
  --sans: "IBM Plex Sans", Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

.chat-spaces { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--inset); }
.chat-spaces button { min-height: 40px; padding: 8px 16px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-weight: 700; cursor: pointer; }
.chat-spaces button[aria-pressed="true"] { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
.chat-spaces button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chat-privacy { margin: 0 0 14px; color: var(--muted); font-size: 12px; }

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c141a;
  --surface: #121e26;
  --panel: #16232c;
  --inset: #0f1a21;
  --ink: #e7eef2;
  --muted: #9fb0bb;
  --faint: #6f828e;
  --line: #24353f;
  --accent: #3bb6d6;
  --accent-soft: #113039;
  --ok: #3fc88a;
  --ok-soft: #102a20;
  --warning: #e0a53f;
  --warning-soft: #2f2412;
  --critical: #f0756c;
  --critical-soft: #331715;
  --purple: #a995e8;
  --purple-soft: #2a2340;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 8px; color: var(--accent); font: 700 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; }

/* Estructura: reproduce la consola aprobada sin copiar sus datos de muestra. */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 232px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
.brand b, .brand small { display: block; }
.brand b { font-size: 15px; letter-spacing: .01em; }
.brand small { color: var(--faint); font-size: 11px; margin-top: 1px; }
.brand-mark { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, var(--accent), var(--purple)); font-weight: 800; letter-spacing: -.03em; box-shadow: var(--shadow); flex: none; }
.brand-mark.small { width: 30px; height: 30px; border-radius: 8px; font-size: 13px; box-shadow: none; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; }
.nav-button { width: 100%; display: flex; align-items: center; gap: 11px; padding: 9px 11px; border: 0; border-radius: 9px; background: none; color: var(--muted); text-align: left; font-size: 13.5px; font-weight: 550; }
.nav-button svg { width: 18px; height: 18px; stroke-width: 1.7; flex: none; }
.nav-button:hover { background: var(--inset); color: var(--ink); }
.nav-button.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.sidebar-foot { margin-top: auto; padding: 14px; border-top: 1px solid var(--line); }
.sidebar-user { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.sidebar-user b, .sidebar-user small { display: block; }
.sidebar-user b { font-size: 12.5px; }
.sidebar-user small { color: var(--faint); font-size: 11px; }
.avatar-mini { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--purple); font-size: 12px; font-weight: 750; }
.live-line { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.live-line i, .agent-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.live-line i { box-shadow: 0 0 0 4px var(--ok-soft); }
.quiet { margin: 12px 0 0 15px; padding: 0; border: 0; background: none; color: var(--faint); font-size: 11px; }
.quiet:hover { color: var(--ink); }

.app-shell > main { min-width: 0; padding-bottom: 60px; }
.topbar { position: sticky; top: 0; z-index: 5; min-height: 72px; display: flex; align-items: center; gap: 14px; padding: 14px 26px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(8px); }
.topbar h1 { margin: 0; font-size: 18px; font-weight: 650; }
.topbar p { margin: 1px 0 0; color: var(--muted); font-size: 12.5px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.agent-pill, .channel-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 650; }
.live-tag { padding: 2px 8px; border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); border-radius: 5px; color: var(--ok); background: var(--ok-soft); font: 650 10.5px var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--muted); }
.icon-button:hover { color: var(--ink); border-color: var(--faint); }
.icon-button svg { width: 17px; height: 17px; stroke-width: 1.7; }

.view { display: none; max-width: 1180px; padding: 22px 26px; }
.view.active { display: block; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.metric { min-width: 0; padding: 14px 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow); }
.metric-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: .035em; text-transform: uppercase; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.ok { background: var(--ok); }
.dot.critical { background: var(--critical); }
.dot.warning { background: var(--warning); }
.metric strong { display: block; margin-top: 7px; font-size: 27px; line-height: 1; font-weight: 650; font-variant-numeric: tabular-nums; }
.metric strong small { color: var(--faint); font-size: 14px; font-weight: 500; }
.metric p { min-height: 17px; margin: 5px 0 0; overflow: hidden; color: var(--faint); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.two-columns { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
.panel-card, .chat-card { border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.card-head { min-height: 47px; display: flex; align-items: center; gap: 9px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.card-title { display: flex; align-items: center; gap: 9px; }
.card-head h2 { margin: 0; font-size: 14px; font-weight: 700; }
.count-label { margin-left: auto; color: var(--faint); font: 11.5px var(--mono); }
.badge { margin-left: auto; padding: 3px 8px; border-radius: 20px; font-size: 10.5px; font-weight: 700; }
.badge.neutral { color: var(--accent); background: var(--accent-soft); }
.list { padding: 6px 8px; }
.list:empty::after { content: "No hay incidentes abiertos."; display: block; padding: 22px 12px; color: var(--muted); font-size: 13px; }
.list-row { display: flex; align-items: flex-start; gap: 12px; padding: 11px 12px; border-radius: 10px; }
.list-row:hover { background: var(--inset); }
.list-row .status-dot { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--critical-soft); color: var(--critical); flex: none; }
.list-row .status-dot::after { content: "!"; font: 750 13px var(--mono); }
.list-row b, .list-row small { display: block; }
.list-row b { font-size: 13.5px; font-weight: 650; }
.list-row small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.agent-status { padding: 16px; }
.big-copy { min-height: 44px; margin: 0 0 14px; font-size: 13px; line-height: 1.55; }
.cost-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.cost-row strong { color: var(--ink); font: 650 13px var(--mono); }
.notice { margin-top: 9px; padding: 10px 12px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 11.5px; line-height: 1.5; }

.section-intro { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-intro h2 { margin: 0; font-size: 18px; font-weight: 650; }
.section-intro p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; }
.channel-chip { color: var(--ok); }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 15px; border-bottom: 1px solid var(--line); }
.chat-head b, .chat-head small { display: block; }
.chat-head b { font-size: 13.5px; }
.chat-head small { color: var(--faint); font-size: 11px; }
.channel-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: #fff; background: var(--accent); font-size: 10px; font-weight: 800; }
.timeline { height: clamp(420px, 58vh, 650px); overflow: auto; display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--inset); }
.message { max-width: min(680px, 78%); padding: 9px 12px; border-radius: 12px; background: var(--surface); box-shadow: 0 1px 1px rgba(0, 0, 0, .06); font-size: 13px; line-height: 1.5; }
.message.inbound { align-self: flex-end; border-bottom-right-radius: 4px; background: var(--ok-soft); }
.message.internal { align-self: center; max-width: 90%; background: var(--warning-soft); color: var(--warning); font-size: 11px; }
.message .message-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; color: var(--accent); font-size: 10px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.message.inbound .message-meta { color: var(--ok); }
.message time { margin-left: auto; color: var(--faint); font: 9.5px var(--mono); }
.composer { padding: 11px 13px; border-top: 1px solid var(--line); }
.composer textarea { width: 100%; padding: 8px 12px; resize: none; border: 1px solid var(--line); border-radius: 12px; outline: 0; background: var(--inset); color: var(--ink); font-size: 13px; }
.composer textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer > div { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.composer span { color: var(--faint); font-size: 10.5px; }
.primary, .secondary { padding: 9px 15px; border-radius: 9px; font-size: 12px; font-weight: 750; }
.primary { border: 0; background: var(--accent); color: #fff; }
.primary:hover { filter: brightness(.95); }
.primary:disabled { opacity: .55; }
.secondary { border: 1px solid var(--line); background: var(--surface); color: var(--ink); }

.systems-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.system-card { position: relative; min-height: 128px; padding: 15px 15px 14px 18px; overflow: hidden; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.system-card.bad { border-left-color: var(--critical); }
.system-card.pending { border-left-color: var(--warning); }
.system-head { display: flex; justify-content: space-between; gap: 12px; }
.system-head b { font-size: 13.5px; line-height: 1.35; }
.system-state { color: var(--ok); font: 750 10px var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.system-card.bad .system-state { color: var(--critical); }
.system-card.pending .system-state { color: var(--warning); }
.system-detail { margin: 14px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.system-time { display: block; margin-top: 11px; color: var(--faint); font: 10px var(--mono); }

/* Data Center: el inventario real conserva la lectura de rack del mock aprobado. */
.view[data-view="sistemas"] { max-width: 1480px; }
.dc-orientation { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 12px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.dc-orientation b { display: block; font-size: 12.5px; }
.dc-orientation p { margin: 2px 0 0; color: var(--muted); font-size: 11.5px; }
.dc-orientation > span { margin-left: auto; white-space: nowrap; color: var(--accent); font: 650 10px var(--mono); }
.dc-legend { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; margin-bottom: 14px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.dc-legend b { color: var(--faint); font: 700 9px var(--mono); letter-spacing: .07em; }
.dc-legend span { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10.5px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; }
.swatch.network { background: var(--accent); }
.swatch.physical { background: var(--purple); }
.swatch.virtual { background: var(--ok); }
.swatch.cloud { background: var(--warning); }
.swatch.backup { background: #4f5bd5; }
.dc-map { display: grid; grid-template-columns: minmax(650px, 1.28fr) minmax(370px, .72fr); gap: 15px; align-items: start; }
.dc-loading { padding: 30px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--muted); }
.dc-location { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow); }
.dc-location-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 45px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.dc-location-head > span { display: flex; align-items: center; gap: 7px; }
.dc-location-head b { font-size: 13.5px; }
.dc-location-head small { color: var(--faint); font: 10px var(--mono); }
.dc-rack { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(390px, 1.2fr); gap: 9px; padding: 10px; background: #182f3b; }
.dc-rack-column { min-width: 0; }
.dc-group-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 1px 3px 7px; color: #aec0c8; }
.dc-group-title b { font: 700 9.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.dc-group-title span { color: #78929e; font-size: 9.5px; }
.dc-physical-list, .dc-vm-list, .dc-host-list { display: grid; gap: 6px; }
.dc-host-list { gap: 9px; }
.dc-host { overflow: hidden; border: 1px solid rgba(255,255,255,.13); border-radius: 9px; background: rgba(0,0,0,.12); }
.dc-host-head { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px; border: 0; border-left: 4px solid var(--purple); background: rgba(255,255,255,.08); color: #eef4f6; text-align: left; }
.dc-host-head > span:last-child { text-align: right; }
.dc-host-head b, .dc-host-head small, .dc-host-head strong { display: block; }
.dc-host-head b { font-size: 12px; }
.dc-host-head small { color: #91a8b2; font: 9px var(--mono); }
.dc-host-head strong { color: var(--ok); font: 700 9px var(--mono); }
.dc-vm-list { padding: 7px; }
.dc-unit { --asset-color: var(--accent); width: 100%; min-width: 0; display: grid; grid-template-columns: 8px minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 8px 9px; border: 1px solid rgba(0,0,0,.28); border-left: 4px solid var(--asset-color); border-radius: 7px; background: linear-gradient(180deg,#294754,#253f4d); color: #e1ebef; text-align: left; }
.dc-unit:hover, .dc-cloud-item:hover, .dc-peripheral:hover, .dc-continuity-item:hover, .dc-host-head:hover { outline: 2px solid color-mix(in srgb,var(--accent) 45%,transparent); outline-offset: 1px; }
.dc-unit.compact { padding: 6px 8px; }
.dc-light { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 7px color-mix(in srgb,var(--ok) 75%,transparent); }
.dc-unit-copy { min-width: 0; }
.dc-unit-copy b, .dc-unit-copy small, .dc-unit-copy em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-unit-copy b { font-size: 11.5px; }
.dc-unit-copy small { color: #b8c8cf; font-size: 9.5px; }
.dc-unit-copy em { margin-top: 1px; color: #829aa5; font: normal 8.5px var(--mono); }
.dc-unit-state { text-align: right; }
.dc-unit-state strong, .dc-unit-state small { display: block; }
.dc-unit-state strong { color: var(--asset-color); font: 700 8px var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.dc-unit-state small { color: var(--ok); font: 700 8px var(--mono); }
.type-physical { --asset-color: var(--purple); }
.type-virtual { --asset-color: var(--ok); }
.type-cloud { --asset-color: var(--warning); }
.type-backup { --asset-color: #4f5bd5; }
.type-energy { --asset-color: #9b6e17; }
.type-telephony { --asset-color: #c13f79; }
.state-alarm .dc-light { background: var(--critical); box-shadow: 0 0 7px var(--critical); }
.state-alarm .dc-unit-state small, .state-alarm .asset-status { color: var(--critical); }
.state-pending .dc-light, .state-documented .dc-light { background: var(--warning); box-shadow: none; }
.state-pending .dc-unit-state small, .state-documented .dc-unit-state small { color: var(--warning); }
.state-off { opacity: .58; }
.state-off .dc-light { background: var(--faint); box-shadow: none; }
.state-off .dc-unit-state small { color: #91a0a8; }
.dc-off { border-top: 1px solid rgba(255,255,255,.11); color: #9fb1ba; }
.dc-off summary { padding: 7px 9px; cursor: pointer; font-size: 9.5px; }
.dc-off > div { display: grid; gap: 5px; padding: 0 7px 7px; }
.dc-right-stack { display: grid; gap: 13px; }
.dc-provider-list { display: grid; gap: 9px; padding: 9px; background: var(--panel); }
.dc-provider { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.dc-provider > header { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.dc-provider > header b { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; }
.dc-provider > header span { color: var(--faint); font: 9px var(--mono); }
.dc-provider > div { display: grid; gap: 6px; padding: 7px; }
.dc-cloud-item, .dc-peripheral { --asset-color: var(--warning); width: 100%; display: grid; grid-template-columns: 8px minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 9px; border: 1px solid var(--line); border-left: 4px solid var(--asset-color); border-radius: 8px; background: var(--surface); color: var(--ink); text-align: left; }
.dc-cloud-item .dc-unit-copy b, .dc-peripheral .dc-unit-copy b { font-size: 11.5px; }
.dc-cloud-item .dc-unit-copy small, .dc-peripheral .dc-unit-copy small { color: var(--muted); }
.dc-section-title { display: flex; justify-content: space-between; gap: 10px; margin: 2px 0 7px; color: var(--muted); }
.dc-section-title b { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; }
.dc-section-title span { color: var(--faint); font-size: 9.5px; }
.dc-peripherals { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dc-peripheral { min-height: 81px; }
.dc-continuity { display: grid; gap: 7px; }
.dc-continuity-item { width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-left: 4px solid #4f5bd5; border-radius: 9px; background: var(--surface); color: var(--ink); text-align: left; box-shadow: var(--shadow); }
.dc-continuity-item b { font-size: 11.5px; }
.dc-continuity-item p { margin: 3px 0 6px; color: var(--muted); font-size: 10.5px; }
.dc-continuity-item span { padding: 2px 6px; border-radius: 4px; background: var(--inset); color: var(--faint); font: 8.5px var(--mono); }
.dc-continuity-item.state-alarm { border-left-color: var(--critical); }
.dc-continuity-item.state-pending { border-left-color: var(--warning); }

.asset-drawer { position: fixed; inset: 0; z-index: 50; display: none; }
.asset-drawer.open { display: block; }
.asset-drawer-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(7,15,20,.58); }
.asset-sheet { position: absolute; top: 0; right: 0; bottom: 0; width: min(470px,94vw); overflow: auto; background: var(--surface); box-shadow: -14px 0 42px rgba(0,0,0,.22); }
.asset-sheet > header { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; gap: 10px; padding: 17px 19px; border-bottom: 1px solid var(--line); background: var(--surface); }
.asset-sheet h2 { margin: 0; font-size: 17px; }
.asset-sheet header p { margin: 2px 0 0; color: var(--muted); font: 10.5px var(--mono); }
.asset-close { margin-left: auto; width: 30px; height: 30px; border: 0; border-radius: 8px; background: var(--inset); color: var(--muted); font-size: 18px; }
.asset-detail { padding: 16px 19px 28px; }
.asset-status { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; padding: 3px 8px; border-radius: 20px; background: var(--ok-soft); color: var(--ok); font-size: 10px; font-weight: 750; text-transform: uppercase; }
.asset-status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.asset-status.state-alarm { background: var(--critical-soft); color: var(--critical); }
.asset-status.state-pending, .asset-status.state-documented { background: var(--warning-soft); color: var(--warning); }
.asset-status.state-off { background: var(--inset); color: var(--faint); }
.asset-plain { margin: 0; padding: 11px 12px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 12.5px; line-height: 1.55; }
.asset-detail h3 { margin: 17px 0 7px; color: var(--faint); font: 700 9.5px var(--mono); letter-spacing: .07em; text-transform: uppercase; }
.asset-facts { border-top: 1px solid var(--line); }
.asset-facts > div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 11.5px; }
.asset-facts span { color: var(--muted); }
.asset-facts b { text-align: right; font-family: var(--mono); font-weight: 500; }
.asset-dependencies { display: flex; flex-wrap: wrap; gap: 5px; }
.asset-dependencies span { padding: 3px 7px; border-radius: 20px; background: var(--inset); color: var(--muted); font-size: 9.5px; }
.asset-checks { display: grid; gap: 6px; }
.asset-check { display: flex; align-items: flex-start; gap: 8px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 7px; }
.asset-check i { width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; background: var(--ok); flex: none; }
.asset-check.state-bad i { background: var(--critical); }
.asset-check.state-pending i { background: var(--warning); }
.asset-check b, .asset-check small { display: block; }
.asset-check b { font-size: 10.5px; }
.asset-check small { color: var(--muted); font-size: 9.5px; }
.asset-empty { color: var(--muted); font-size: 11px; }
.asset-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.asset-photos > div { min-height: 92px; display: grid; place-items: center; align-content: center; border: 1px dashed var(--faint); border-radius: 8px; background: var(--panel); color: var(--faint); text-align: center; font-size: 9.5px; }
.asset-photos b, .asset-photos span { display: block; }
.asset-photos b { color: var(--muted); font-size: 10.5px; }

.table-wrap { overflow: auto; padding: 0; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 12px 15px; border-bottom: 1px solid var(--line); text-align: left; }
th { background: var(--panel); color: var(--muted); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.users-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.user-card { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; margin-bottom: 14px; border-radius: 50%; background: var(--purple); color: #fff; font-weight: 750; }
.user-card h3 { margin: 0; font-size: 14px; }
.user-card p { margin: 4px 0 13px; color: var(--muted); font-size: 11.5px; }
.user-card footer { display: flex; flex-wrap: wrap; gap: 6px; }
.user-actions { display: flex; gap: 7px; margin-top: 11px; }
.user-actions button { flex: 1; }
.user-state.suspend { border-color: color-mix(in srgb,var(--critical) 45%,var(--line)); color: var(--critical); }
.user-state.reactivate { border-color: color-mix(in srgb,var(--ok) 45%,var(--line)); color: var(--ok); }
.user-invite { width: 100%; margin-top: 14px; }
.mini-chip { padding: 3px 8px; border-radius: 20px; background: var(--ok-soft); color: var(--ok); font-size: 10.5px; font-weight: 650; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; padding: 11px 15px; border-radius: 9px; background: var(--ink); color: var(--surface); box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s; font-size: 11px; }
.toast.show { opacity: 1; transform: none; }
.owner-only.hidden { display: none; }
.hidden { display: none !important; }

/* Login con el mismo lenguaje visual del tablero aprobado. */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 32px; background: var(--bg); }
.login-shell { width: min(850px, 100%); min-height: 540px; display: grid; grid-template-columns: 360px 1fr; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 24px 70px rgba(16, 30, 40, .13); }
.login-brand { display: flex; flex-direction: column; padding: 34px; border-right: 1px solid var(--line); background: linear-gradient(145deg, var(--surface), var(--accent-soft)); }
.login-brand-title { display: flex; align-items: center; gap: 11px; }
.login-brand-title b, .login-brand-title small { display: block; }
.login-brand-title b { font-size: 16px; }
.login-brand-title small { color: var(--faint); font-size: 11px; }
.login-intro { margin: auto 0; }
.login-intro h1 { margin: 0 0 16px; font-size: 37px; line-height: 1.08; letter-spacing: -.04em; font-weight: 680; }
.login-intro > p:last-child { max-width: 29ch; margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.trust-list { display: grid; gap: 8px; }
.trust-list span { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.trust-list i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.login-card { display: flex; flex-direction: column; justify-content: center; padding: 48px 54px; }
.login-card h2 { margin: 0 0 6px; font-size: 27px; letter-spacing: -.025em; }
.login-card > .muted { margin: 0 0 7px; font-size: 13px; line-height: 1.55; }
.login-card label { display: block; margin-top: 15px; color: var(--muted); font-size: 10.5px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.login-card input { width: 100%; margin-top: 6px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: var(--panel); color: var(--ink); }
.login-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.login-card input:-webkit-autofill, .login-card input:-webkit-autofill:hover, .login-card input:-webkit-autofill:focus { -webkit-text-fill-color: var(--ink); box-shadow: 0 0 0 1000px var(--panel) inset; transition: background-color 9999s ease-out; }
.login-card .primary { width: 100%; margin-top: 22px; padding: 11px 15px; }
.form-error { min-height: 20px; margin: 12px 0 0; color: var(--critical); font-size: 11px; }
.login-mobile-brand { display: none; }

/* Alta de usuarios: el secreto se muestra solo durante la activación. */
.invite-dialog { width: min(520px, calc(100% - 28px)); padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); box-shadow: 0 28px 80px rgba(10,25,32,.28); }
.invite-dialog::backdrop { background: rgba(7,15,20,.58); }
.invite-dialog form { padding: 22px; }
.invite-dialog header { display: flex; align-items: flex-start; gap: 12px; }
.invite-dialog h2 { margin: 0; font-size: 22px; }
.invite-dialog .muted { margin: 10px 0 18px; line-height: 1.55; }
.invite-dialog label, .activation-card label { display: block; margin-top: 13px; color: var(--muted); font-size: 10.5px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.invite-dialog input, .invite-dialog select, .activation-card input { width: 100%; margin-top: 6px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: var(--panel); color: var(--ink); }
.invite-dialog input:focus, .invite-dialog select:focus, .activation-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 9.5px; font-weight: 800; letter-spacing: .12em; }
.field-help { margin: 8px 0 0; color: var(--faint); font-size: 10.5px; line-height: 1.45; }
.activation-primary { width: 100%; margin-top: 18px; padding: 11px 15px; }
.activation-shell { width: min(560px, 100%); }
.activation-head { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 0 4px; }
.activation-head b, .activation-head small { display: block; }
.activation-head small { color: var(--muted); font-size: 10.5px; }
.activation-card { padding: 30px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: 0 24px 70px rgba(16,30,40,.13); }
.activation-card h1 { margin: 0 0 9px; font-size: 27px; letter-spacing: -.025em; }
.activation-card > p:not(.eyebrow) { color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.activation-summary { margin: 18px 0; border-top: 1px solid var(--line); }
.activation-summary > div { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.activation-summary dt { color: var(--muted); font-size: 11px; }
.activation-summary dd { margin: 0; font: 11px var(--mono); }
.secret-box { display: flex; align-items: center; gap: 9px; margin: 17px 0 10px; padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.secret-box span { min-width: 0; flex: 1; overflow-wrap: anywhere; font: 12px var(--mono); letter-spacing: .07em; }
.activation-link { display: inline-block; color: var(--accent); font-size: 11.5px; font-weight: 700; }
.activation-button { display: block; margin-top: 20px; padding: 12px; text-align: center; text-decoration: none; }
.activation-message { min-height: 18px; margin: 10px 4px 0; color: var(--ok); font-size: 11px; }
.activation-message.error { color: var(--critical); }

/* Tareas: validaciones personales, trazables y cómodas desde el teléfono. */
.nav-badge { margin-left: auto; min-width: 19px; padding: 1px 5px; border-radius: 20px; background: var(--critical); color: #fff; font: 700 9px var(--mono); text-align: center; }
.task-layout { display: grid; grid-template-columns: minmax(230px, .42fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.task-list { display: grid; gap: 9px; }
.task-card { width: 100%; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-align: left; box-shadow: var(--shadow); }
.task-card:hover, .task-card.selected { border-color: var(--accent); }
.task-card.selected { box-shadow: 0 0 0 3px var(--accent-soft); }
.task-card-top, .task-card-foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.task-card-top strong { font-size: 13px; line-height: 1.35; }
.task-card-top em { padding: 2px 7px; border-radius: 20px; font-size: 9px; font-style: normal; font-weight: 750; white-space: nowrap; }
.task-card-top em.state-pending { background: var(--warning-soft); color: var(--warning); }
.task-card-top em.state-in_progress { background: var(--accent-soft); color: var(--accent); }
.task-card-top em.state-completed { background: var(--ok-soft); color: var(--ok); }
.task-card > small, .task-card-foot small { color: var(--faint); font-size: 10.5px; }
.task-card > small { display: block; margin-top: 5px; }
.task-progress { height: 5px; display: block; margin: 12px 0 7px; overflow: hidden; border-radius: 10px; background: var(--inset); }
.task-progress i { height: 100%; display: block; border-radius: inherit; background: var(--ok); }
.task-empty { padding: 24px; color: var(--muted); text-align: center; }
.task-workspace { overflow: visible; }
.task-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px; border-bottom: 1px solid var(--line); }
.task-head h2 { margin: 0; font-size: 21px; }
.task-head .muted { max-width: 65ch; margin: 5px 0 0; font-size: 12px; }
.task-status { padding: 4px 9px; border-radius: 20px; font-size: 10px; font-weight: 750; white-space: nowrap; }
.task-status.state-pending { background: var(--warning-soft); color: var(--warning); }
.task-status.state-in_progress { background: var(--accent-soft); color: var(--accent); }
.task-status.state-completed { background: var(--ok-soft); color: var(--ok); }
#task-form { padding: 20px; }
.task-guide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 14px; padding: 13px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 11px; }
.task-guide > b { grid-column: 1 / -1; }
.task-guide strong { font-family: var(--mono); }
.task-checklist { display: grid; gap: 2px; margin: 18px 0; padding: 0; border: 0; }
.task-checklist legend { margin-bottom: 8px; font-size: 13px; font-weight: 750; }
.task-checklist label { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--ink); font-size: 12px; cursor: pointer; }
.task-checklist label:hover { background: var(--panel); }
.task-checklist input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--ok); flex: none; }
.task-checklist input:disabled + span { color: var(--muted); }
.task-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.task-fields label { display: block; color: var(--muted); font-size: 10.5px; font-weight: 750; letter-spacing: .035em; text-transform: uppercase; }
.task-fields label:first-child, .task-fields label:last-child { grid-column: 1 / -1; }
.task-fields textarea { width: 100%; margin-top: 6px; padding: 11px 12px; resize: vertical; border: 1px solid var(--line); border-radius: 9px; outline: none; background: var(--panel); color: var(--ink); font-size: 12px; line-height: 1.5; text-transform: none; }
.task-fields textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.task-fields textarea:disabled { opacity: 1; }
.task-photos { margin-top: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); }
.task-photos > div:first-child { display: inline-block; }
.task-photos h3 { margin: 0; font-size: 13px; }
.task-photos p { margin: 3px 0 0; color: var(--muted); font-size: 10.5px; }
.photo-picker { float: right; display: inline-flex; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--accent); font-size: 10.5px; font-weight: 750; cursor: pointer; }
.photo-picker.busy { opacity: .55; pointer-events: none; }
.photo-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.task-photo-list { clear: both; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; padding-top: 12px; }
.task-photo-list a { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); text-decoration: none; }
.task-photo-list a span { padding: 2px 5px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); font-size: 9px; font-weight: 750; }
.task-photo-list a b { overflow: hidden; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.task-photo-list a small { color: var(--faint); font: 9px var(--mono); }
.task-no-photos { grid-column: 1 / -1; }
.task-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.task-actions > span { margin-right: auto; color: var(--faint); font-size: 10.5px; }
.invite-task-note { margin-top: 13px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.invite-task-note b, .invite-task-note small { display: block; }
.invite-task-note b { font-size: 12px; }
.invite-task-note small { margin-top: 2px; color: var(--muted); font-size: 10.5px; }

/* Conocimiento técnico compartido con proveedores, versionado y no ejecutable. */
.knowledge-chat-option { display: flex; align-items: center; gap: 7px; padding: 8px 12px 0; color: var(--muted); font-size: 10.5px; }
.knowledge-chat-option input { accent-color: var(--accent); }
.knowledge-safety { margin-bottom: 14px; padding: 11px 14px; border: 1px solid var(--warning); border-radius: 10px; background: var(--warning-soft); color: var(--ink); font-size: 11px; }
.knowledge-layout { display: grid; grid-template-columns: minmax(250px,.42fr) minmax(0,1fr); gap: 16px; align-items: start; }
.knowledge-list { display: grid; gap: 9px; }
.knowledge-card { width: 100%; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink); text-align: left; box-shadow: var(--shadow); }
.knowledge-card:hover, .knowledge-card.selected { border-color: var(--accent); }
.knowledge-card.selected { box-shadow: 0 0 0 3px var(--accent-soft); }
.knowledge-card > span, .knowledge-card footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.knowledge-card b { font-size: 12px; }
.knowledge-card small, .knowledge-card footer { color: var(--faint); font-size: 9.5px; }
.knowledge-card p { display: -webkit-box; margin: 8px 0; overflow: hidden; color: var(--muted); font-size: 10.5px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.knowledge-state { padding: 2px 7px; border-radius: 20px; font-size: 8.5px; font-style: normal; font-weight: 750; white-space: nowrap; }
.knowledge-state.state-draft { background: var(--panel); color: var(--muted); }
.knowledge-state.state-review { background: var(--warning-soft); color: var(--warning); }
.knowledge-state.state-validated { background: var(--ok-soft); color: var(--ok); }
.knowledge-state.state-obsolete { background: var(--critical-soft); color: var(--critical); }
.knowledge-workspace { overflow: visible; }
.knowledge-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 20px; border-bottom: 1px solid var(--line); }
.knowledge-head h2 { margin: 0; font-size: 20px; }
.knowledge-fields { display: grid; grid-template-columns: 1fr .45fr; gap: 13px; padding: 20px; }
.knowledge-fields label { color: var(--muted); font-size: 10.5px; font-weight: 750; letter-spacing: .035em; text-transform: uppercase; }
.knowledge-fields label:nth-child(n+3) { grid-column: 1 / -1; }
.knowledge-fields input, .knowledge-fields select, .knowledge-fields textarea { width: 100%; margin-top: 6px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; outline: none; background: var(--panel); color: var(--ink); font-size: 12px; line-height: 1.5; text-transform: none; }
.knowledge-fields textarea { resize: vertical; }
.knowledge-fields input:focus, .knowledge-fields select:focus, .knowledge-fields textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.knowledge-files { margin: 0 20px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.knowledge-files h3 { display: inline-block; margin: 0; font-size: 12px; }
.knowledge-file-list { clear: both; display: grid; gap: 6px; padding-top: 11px; }
.knowledge-file-list a { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 3px 10px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); text-decoration: none; }
.knowledge-file-list b { overflow: hidden; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-file-list span, .knowledge-file-list small { color: var(--faint); font: 9px var(--mono); }
.knowledge-file-list small { grid-column: 1 / -1; }
.knowledge-workspace .task-actions { margin: 18px 20px 20px; }

@media (max-width: 1280px) {
  .dc-map { grid-template-columns: 1fr; }
  .dc-right-stack { grid-template-columns: 1fr 1fr; }
  .dc-right-stack > .dc-location, .dc-right-stack > section { grid-column: 1 / -1; }
}

@media (max-width: 1000px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .systems-grid, .users-grid { grid-template-columns: repeat(2, 1fr); }
  .task-layout { grid-template-columns: 1fr; }
  .knowledge-layout { grid-template-columns: 1fr; }
  .task-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; }
  .brand { padding: 14px 16px 8px; }
  .sidebar nav { flex-direction: row; overflow-x: auto; padding: 8px; }
  .nav-button { width: auto; flex-direction: column; gap: 4px; padding: 8px 10px; font-size: 10.5px; white-space: nowrap; }
  .sidebar-foot { display: none; }
  .topbar { min-height: 64px; padding: 11px 16px; }
  .agent-pill { display: none; }
  .view { padding: 16px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .two-columns, .systems-grid, .users-grid { grid-template-columns: 1fr; }
  .task-list, .task-fields, .knowledge-fields { grid-template-columns: 1fr; }
  .knowledge-fields label:nth-child(n+3) { grid-column: auto; }
  .task-fields label:first-child, .task-fields label:last-child { grid-column: auto; }
  .dc-rack { grid-template-columns: 1fr; }
  .dc-orientation { display: block; }
  .dc-orientation > span { display: block; margin: 7px 0 0; }
  .section-intro { align-items: flex-start; }
  .message { max-width: 92%; }
  .login-page { padding: 16px; }
  .login-shell { min-height: 0; grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-card { min-height: 570px; padding: 34px 26px; }
  .login-mobile-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 46px; }
}

@media (max-width: 460px) {
  .metric-grid { grid-template-columns: 1fr; }
  .topbar-actions .live-tag { display: none; }
  .composer > div { align-items: flex-end; gap: 8px; }
  .dc-peripherals { grid-template-columns: 1fr; }
  .dc-unit { grid-template-columns: 8px minmax(0,1fr); }
  .dc-unit-state { grid-column: 2; text-align: left; }
  .task-guide, .task-photo-list { grid-template-columns: 1fr; }
  .task-actions { flex-wrap: wrap; }
  .task-actions > span { width: 100%; margin: 0; }
  .task-actions button { flex: 1; }
}

.live-line.state-pending i, .agent-pill.state-pending i { background: var(--warning); box-shadow: none; }
#notification-state { margin-bottom: 16px; }
