/* ============================================================
   Feltrero Intelligence · Holding — VERSIÓN FINAL
   Spatial UI / VisionOS (08) × Inmersivo claro (A), ruido
   rebajado para dashboard de gobernanza. Tema claro + glass.
   ============================================================ */
:root {
  --bg:#f4f0e8; --bg2:#ece6da;
  --ink:#1d1a16; --soft:#5d574d; --muted:#8f8778;
  --accent:#b8893a; --gold:#d9a94a;
  --glass:rgba(255,255,255,.55); --glass-border:rgba(255,255,255,.65);
  --line:rgba(29,26,22,.10);
  --shadow:0 10px 34px rgba(60,45,20,.08), inset 0 1px 0 rgba(255,255,255,.7);
  --radius:20px;
  --green:#4c9a70; --amber:#e0a02f; --red:#d05c3a;
  --font:'Segoe UI',system-ui,-apple-system,sans-serif;
  --maxw:1280px;
}
* { box-sizing:border-box; }
html { scroll-behavior:smooth; }
body { margin:0; font-family:var(--font); color:var(--ink); line-height:1.6;
  background:
    radial-gradient(900px 500px at 12% -6%, rgba(217,169,74,.10), transparent 60%),
    radial-gradient(800px 500px at 96% 4%, rgba(140,120,200,.10), transparent 60%),
    linear-gradient(160deg,var(--bg),var(--bg2));
  min-height:100vh; -webkit-font-smoothing:antialiased; }
a { color:var(--accent); text-decoration:none; }
a:hover { text-decoration:underline; }

.glass { background:var(--glass); backdrop-filter:blur(20px) saturate(1.35); -webkit-backdrop-filter:blur(20px) saturate(1.35);
  border:1px solid var(--glass-border); border-radius:var(--radius); box-shadow:var(--shadow); }

.shell { display:flex; min-height:100vh; }
.side { width:246px; flex:0 0 246px; padding:24px 18px; margin:18px 0 18px 18px; align-self:flex-start;
  position:sticky; top:18px; height:calc(100vh - 36px); display:flex; flex-direction:column;
  background:var(--glass); backdrop-filter:blur(20px) saturate(1.35); -webkit-backdrop-filter:blur(20px) saturate(1.35);
  border:1px solid var(--glass-border); border-radius:var(--radius); box-shadow:var(--shadow); }
.brand { display:flex; gap:12px; align-items:center; margin-bottom:26px; }
.brand-mark { width:38px; height:38px; border-radius:12px; background:linear-gradient(135deg,var(--accent),var(--gold)); color:#fff;
  font-weight:800; display:grid; place-items:center; font-size:18px; box-shadow:0 6px 16px rgba(184,137,58,.3); }
.brand-name strong { display:block; font-size:16px; letter-spacing:-.01em; color:var(--ink); }
.brand-name span { font-size:10px; letter-spacing:.18em; color:var(--muted); text-transform:uppercase; }
.nav { display:flex; flex-direction:column; gap:3px; }
.nav a { color:var(--soft); text-decoration:none; padding:10px 13px; border-radius:12px; font-size:14px; font-weight:500;
  transition:background .2s,color .2s,transform .2s; }
.nav a:hover { background:var(--glass); color:var(--ink); transform:translateX(2px); text-decoration:none; }
.side-foot { margin-top:auto; }
.who { padding:12px 14px; border-radius:14px; margin-bottom:10px; background:rgba(255,255,255,.5); border:1px solid var(--glass-border); }
.who-name { font-weight:600; font-size:14px; color:var(--ink); }
.who-role { color:var(--accent); font-size:11px; text-transform:uppercase; letter-spacing:.5px; margin-top:2px; font-weight:600; }

.content { flex:1; min-width:0; padding:30px clamp(16px,4vw,56px) 60px; max-width:var(--maxw); }
.topbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:24px; padding-bottom:16px; border-bottom:1px solid var(--line); }
.crumbs { color:var(--muted); font-size:12px; letter-spacing:.4px; }
.top-actions { display:flex; gap:8px; }

h1 { font-size:clamp(28px,4.5vw,44px); letter-spacing:-.02em; line-height:1.05; margin:0 0 10px; font-weight:650; color:var(--ink); }
h2 { font-size:17px; font-weight:650; margin:0 0 14px; color:var(--ink); letter-spacing:-.01em; }
h3 { font-size:14px; font-weight:600; margin:0 0 6px; color:var(--ink); }
.sub { color:var(--soft); margin:0 0 26px; max-width:720px; }

.btn { display:inline-flex; align-items:center; gap:7px; padding:11px 18px; border-radius:13px; font-weight:600; font-size:14px;
  border:1px solid transparent; cursor:pointer; transition:transform .18s,box-shadow .18s,background .2s; }
.btn.solid { background:linear-gradient(135deg,var(--accent),var(--gold)); color:#fff; box-shadow:0 8px 20px rgba(184,137,58,.22); }
.btn.solid:hover { transform:translateY(-2px); text-decoration:none; }
.btn.ghost { background:rgba(255,255,255,.4); border-color:var(--line); color:var(--soft); }
.btn.ghost:hover { color:var(--ink); transform:translateY(-2px); text-decoration:none; }
.btn.sm { padding:7px 13px; font-size:12px; }
.btn.danger { background:var(--red); color:#fff; }

.grid { display:grid; gap:16px; }
.grid.cards { grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); }
.grid.cols-3 { grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); }

.card { border-radius:var(--radius); padding:20px; background:var(--glass); backdrop-filter:blur(20px) saturate(1.35);
  -webkit-backdrop-filter:blur(20px) saturate(1.35); border:1px solid var(--glass-border); box-shadow:var(--shadow);
  transition:transform .22s ease, box-shadow .22s ease; }
a.card:hover { transform:translateY(-3px); box-shadow:0 18px 40px rgba(60,45,20,.10), inset 0 1px 0 rgba(255,255,255,.8); text-decoration:none; }
.card .num { font-size:30px; font-weight:650; letter-spacing:-.02em; color:var(--accent); line-height:1; }
.card .lbl { color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.14em; }

.badge { display:inline-flex; align-items:center; gap:6px; font-size:10px; font-weight:700; padding:3px 10px; border-radius:20px; text-transform:uppercase; letter-spacing:.4px; }
.badge.ALTA, .badge.ALTO { background:rgba(208,92,58,.12); color:var(--red); }
.badge.MEDIA, .badge.MEDIO { background:rgba(224,160,47,.14); color:var(--amber); }
.badge.BAJA, .badge.BAJO { background:rgba(76,154,112,.13); color:var(--green); }
.badge.INFO { background:rgba(184,137,58,.12); color:var(--accent); }
.badge.ACTIVA { background:rgba(76,154,112,.13); color:var(--green); }
.badge.POTENCIAL { background:rgba(184,137,58,.12); color:var(--accent); }
.badge.PENDIENTE { background:rgba(184,137,58,.12); color:var(--accent); }
.badge.EN_REVISION, .badge.EN_SEGUIMIENTO, .badge.EN_EJECUCION { background:rgba(224,160,47,.14); color:var(--amber); }
.badge.APROBADA, .badge.CERRADO, .badge.HECHO { background:rgba(76,154,112,.13); color:var(--green); }
.badge.PROPUESTA { background:rgba(29,26,22,.07); color:var(--soft); }

.dot { width:9px; height:9px; border-radius:50%; display:inline-block; }
.dot.up { background:var(--green); box-shadow:0 0 0 3px rgba(76,154,112,.16); }
.dot.down { background:var(--red); box-shadow:0 0 0 3px rgba(208,92,58,.16); }
.dot.flat { background:var(--muted); }

.tag { font-size:10px; font-weight:700; padding:3px 9px; border-radius:7px; background:rgba(29,26,22,.06); color:var(--accent); letter-spacing:.4px; }
.tag.new { background:rgba(76,154,112,.14); color:var(--green); }

.flashes { margin-bottom:20px; }
.flash { padding:12px 16px; border-radius:12px; margin-bottom:9px; font-weight:500; }
.flash.error { background:rgba(208,92,58,.1); color:var(--red); border:1px solid rgba(208,92,58,.2); }
.flash.info { background:rgba(184,137,58,.1); color:var(--accent); border:1px solid rgba(184,137,58,.2); }

.muted { color:var(--muted); }
.row { display:flex; gap:16px; flex-wrap:wrap; align-items:center; }
.grow { flex:1; }

.table { width:100%; border-collapse:collapse; }
.table th, .table td { text-align:left; padding:12px 14px; border-bottom:1px solid var(--line); }
.table th { color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.6px; }
.table tr:last-child td { border-bottom:0; }

.demo-note { background:rgba(217,169,74,.10); border:1px dashed rgba(184,137,58,.4); color:var(--soft); border-radius:14px; padding:14px 18px; font-size:13px; margin-bottom:24px; max-width:780px; }

/* Home */
.hero { padding:22px 0 6px; }
.hero h1 { font-size:clamp(34px,6vw,54px); max-width:780px; }
.hero .lede { color:var(--soft); font-size:clamp(16px,2vw,19px); max-width:640px; margin-top:16px; }
.chip-row { display:flex; gap:10px; flex-wrap:wrap; margin:24px 0; }
.pill { border:1px solid var(--line); background:rgba(255,255,255,.5); color:var(--soft); padding:7px 15px; border-radius:20px; font-size:13px; font-weight:500; }
.pill b { color:var(--accent); }

/* Login */
.login-wrap { max-width:460px; margin:60px auto; }
.login-card { padding:30px; background:var(--glass); backdrop-filter:blur(20px) saturate(1.35); -webkit-backdrop-filter:blur(20px) saturate(1.35); border:1px solid var(--glass-border); box-shadow:var(--shadow); }
.field { margin-bottom:15px; }
.field label { display:block; color:var(--muted); font-size:11px; margin-bottom:6px; text-transform:uppercase; letter-spacing:.5px; }
.field input { width:100%; padding:11px 13px; border-radius:12px; border:1px solid var(--line); background:rgba(255,255,255,.6); color:var(--ink); font-size:14px; transition:border-color .2s,box-shadow .2s; }
.field input:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 3px rgba(184,137,58,.15); }
.demo-logins { margin-top:22px; }
.demo-logins h3 { margin-bottom:10px; }
.demo-logins a { display:flex; justify-content:space-between; align-items:center; padding:11px 14px; border-radius:13px; background:rgba(255,255,255,.5); border:1px solid var(--line); margin-bottom:8px; transition:border-color .2s,transform .15s; }
.demo-logins a:hover { border-color:var(--accent); transform:translateX(2px); text-decoration:none; }
.demo-logins .r { color:var(--accent); font-size:10px; font-weight:700; letter-spacing:.4px; }

/* Org chart */
.org { padding:6px 0 26px; }
.org-node { border-radius:14px; padding:14px 16px; min-width:180px; max-width:220px; background:var(--glass); backdrop-filter:blur(18px) saturate(1.3);
  -webkit-backdrop-filter:blur(18px) saturate(1.3); border:1px solid var(--glass-border); box-shadow:0 8px 24px rgba(60,45,20,.06); transition:transform .18s ease; }
a.org-node:hover { transform:translateY(-2px); text-decoration:none; }
.org-node .t { font-weight:650; font-size:13px; color:var(--ink); }
.org-node .r { color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.4px; margin-top:3px; }
.org-node .owner { color:var(--soft); font-size:12px; margin-top:7px; }
.org-division { border-color:color-mix(in srgb, var(--dcol,var(--accent)) 45%, transparent); }
.org-division .t { font-size:14px; color:color-mix(in srgb, var(--dcol,var(--accent)) 78%, var(--ink)); }
.org-title { display:inline-flex; align-items:center; gap:9px; }
.org-links { margin-top:9px; display:flex; gap:6px; }
.org-links a { font-size:11px; font-weight:700; }
.legend { display:flex; gap:18px; flex-wrap:wrap; margin:6px 0 24px; }
.legend .it { display:inline-flex; align-items:center; gap:7px; color:var(--soft); font-size:12px; }
.legend .sw { width:12px; height:12px; border-radius:4px; }

.branches { display:flex; gap:26px; flex-wrap:wrap; align-items:flex-start; }
.branch { display:flex; flex-direction:column; align-items:center; gap:12px; }
.branch-areas { display:flex; gap:18px; flex-wrap:wrap; justify-content:center; }
.area-col { display:flex; flex-direction:column; align-items:center; gap:12px; }
.area-col .org-node { min-width:164px; }
.connector { width:1px; height:14px; background:var(--line); }

/* Proposals */
.proposal { display:flex; gap:16px; align-items:stretch; }
.proposal .pillar { flex:0 0 5px; border-radius:8px; }
.proposal .p-body { flex:1; }
.proposal .meta { color:var(--muted); font-size:12px; margin-top:8px; }
.scorebar { height:6px; border-radius:4px; background:rgba(29,26,22,.08); overflow:hidden; margin-top:10px; }
.scorebar i { display:block; height:100%; background:linear-gradient(90deg,var(--accent),var(--gold)); }

@media (max-width:900px) {
  .shell { flex-direction:column; }
  .side { width:100%; flex:none; height:auto; position:static; margin:12px; }
  .nav { flex-direction:row; flex-wrap:wrap; }
  .side-foot { margin-left:auto; display:flex; align-items:center; gap:8px; }
  .content { padding:20px 14px 50px; }
}

@media (prefers-reduced-motion:reduce) {
  * { transition:none !important; animation:none !important; }
}

/* ============================================================
   Logo
   ============================================================ */
.brand-mark { position:relative; width:46px; height:64px; border-radius:12px; flex:0 0 auto;
  background:linear-gradient(135deg,var(--accent),var(--gold)); box-shadow:0 6px 16px rgba(184,137,58,.32), inset 0 1px 0 rgba(255,255,255,.4);
  display:grid; place-items:center; padding:6px; }
.brand-mark::after { content:""; position:absolute; inset:2px; border:1px solid rgba(255,255,255,.35); border-radius:9px; pointer-events:none; }
.brand-mark img { width:100%; height:100%; object-fit:contain; display:block; }
.brand-name strong { position:relative; display:flex; align-items:center; gap:6px; font-size:17px; letter-spacing:-.01em; }
.brand-name strong em { width:20px; height:3px; border-radius:3px; background:linear-gradient(90deg,var(--accent),var(--gold)); }

/* ============================================================
   Dashboard — densidad
   ============================================================ */
.kpi-strip { display:flex; gap:12px; flex-wrap:wrap; margin-bottom:22px; }
.kpi-mini { flex:1 1 140px; background:var(--glass); backdrop-filter:blur(18px) saturate(1.3); -webkit-backdrop-filter:blur(18px) saturate(1.3);
  border:1px solid var(--glass-border); border-radius:16px; padding:14px 16px; box-shadow:var(--shadow); }
.kpi-mini .lbl { color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.14em; }
.kpi-mini b { font-size:26px; font-weight:650; letter-spacing:-.02em; display:block; margin-top:2px; color:var(--ink); }
.kpi-mini b.warn { color:var(--red); }
.dash-list { display:flex; flex-direction:column; gap:14px; }
.divrow { border-radius:18px; padding:18px 20px; }
.divrow-head { display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; margin-bottom:14px; }
.divrow-name { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.divrow-name b { font-size:16px; color:var(--ink); }
.divrow-name a { color:var(--ink); } .divrow-name a:hover { color:var(--accent); }
.divrow-meta { display:flex; gap:14px; color:var(--muted); font-size:12px; }
.divrow-meta .warn { color:var(--red); font-weight:600; }
.divrow-kpis { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:10px; }
.kpi-cell { background:rgba(255,255,255,.45); border:1px solid var(--line); border-radius:12px; padding:10px 12px; }
.kpi-cell .lbl { color:var(--muted); font-size:9px; text-transform:uppercase; letter-spacing:.12em; display:block; }
.kpi-cell .val { font-size:20px; font-weight:650; color:var(--ink); display:flex; align-items:center; gap:6px; margin-top:2px; }
.kpi-cell .dot { margin-left:auto; }
.small { font-size:12px; } .tiny { font-size:11px; }

/* ============================================================
   Mapa Vivo — jerarquía
   ============================================================ */
.mapa-control { display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; margin-bottom:26px; }
.mapa-control .legend { margin:0; }
.filtros { display:flex; gap:6px; }
.chip { padding:7px 14px; border-radius:20px; border:1px solid var(--line); background:rgba(255,255,255,.5); color:var(--soft); font-size:12px; font-weight:600; cursor:pointer; transition:all .18s; }
.chip:hover { color:var(--ink); }
.chip.on { background:linear-gradient(135deg,var(--accent),var(--gold)); border-color:transparent; color:#fff; }

.org-tree { padding:8px 0 30px; }
.org-root { display:flex; justify-content:center; margin-bottom:0; }
.org-cols { display:flex; gap:20px; flex-wrap:wrap; align-items:flex-start; padding-top:18px; position:relative; justify-content:center; }
.org-cols::before { content:""; position:absolute; top:0; left:4%; right:4%; height:2px; background:var(--line); }

.org-col { flex:1 1 200px; max-width:260px; min-width:180px; position:relative; }
.org-col::before { content:""; position:absolute; top:-18px; left:50%; transform:translateX(-50%); width:2px; height:18px; background:var(--line); }

.node { display:block; text-align:left; width:100%; }
.node.division { border-radius:16px; padding:14px 16px; background:var(--glass); backdrop-filter:blur(18px) saturate(1.3); -webkit-backdrop-filter:blur(18px) saturate(1.3);
  border:1px solid var(--glass-border); box-shadow:var(--shadow); position:relative; }
.node.division .collapse { position:absolute; top:10px; right:10px; width:24px; height:24px; border-radius:8px; border:1px solid var(--line);
  background:rgba(255,255,255,.6); color:var(--accent); font-size:14px; line-height:1; cursor:pointer; }
.node.division .node-main { display:block; text-decoration:none; color:inherit; padding-right:24px; }
.node-main:hover .t { color:var(--accent); }
.node .t { font-weight:650; font-size:14px; color:var(--ink); display:block; letter-spacing:-.01em; }
.node .r { color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.14em; display:block; margin-top:4px; }
.node .o { color:var(--soft); font-size:12px; display:block; margin-top:8px; }
.node .dot { margin-right:7px; }

.org-branch { padding-top:12px; display:flex; flex-direction:column; }
.org-col.closed .org-branch { display:none; }
.area { position:relative; padding:0 0 10px 16px; }
.area::before { content:""; position:absolute; left:0; top:6px; bottom:6px; width:2px; background:var(--line); }
.area::after { content:""; position:absolute; left:0; top:20px; width:16px; height:2px; background:var(--line); }
.node.area { border-radius:12px; padding:10px 12px; background:rgba(255,255,255,.5); border:1px solid var(--line); margin-bottom:8px; }
.node.area:hover { border-color:var(--accent); }
.node.area .t { font-size:13px; }
.cargos { display:flex; flex-direction:column; gap:6px; padding-left:0; }
.node.cargo { border-radius:11px; padding:9px 12px; background:rgba(255,255,255,.55); border:1px solid var(--line); text-decoration:none; color:inherit; transition:border-color .16s,transform .16s; }
.node.cargo:hover { border-color:var(--accent); transform:translateX(3px); text-decoration:none; }
.node.cargo .t { font-size:13px; font-weight:600; }
.node.cargo .r { font-size:9px; }
.node.cargo .o { font-size:11px; margin-top:4px; color:var(--muted); }

@media (max-width:900px) {
  .org-cols { justify-content:flex-start; }
  .org-col { max-width:none; }
}
/* ============================================================
   Ronda de mejoras — panel de detalle, breadcrumb, micro-UI
   ============================================================ */
:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.kicker { font-size:11px; letter-spacing:.24em; text-transform:uppercase; color:var(--accent); font-weight:600; margin-bottom:14px; }
.breadcrumb { font-size:12px; color:var(--muted); letter-spacing:.3px; margin:2px 0 18px; }
.breadcrumb b { color:var(--accent); font-weight:600; }
.node[data-api] { cursor:pointer; }
.node.selected { box-shadow:0 0 0 2px var(--accent), var(--shadow); }

.table.glass { border-collapse:separate; border-spacing:0; background:var(--glass); backdrop-filter:blur(18px) saturate(1.3); -webkit-backdrop-filter:blur(18px) saturate(1.3); }
.table.glass th, .table.glass td { padding:14px; }

.panel-overlay { position:fixed; inset:0; background:rgba(29,26,22,.32); backdrop-filter:blur(3px); z-index:60; opacity:0; transition:opacity .22s ease; }
.panel-overlay.show { opacity:1; }
.node-panel { position:fixed; top:0; right:0; bottom:0; width:min(400px,92vw); background:var(--bg); border-left:1px solid var(--line);
  box-shadow:-20px 0 50px rgba(60,45,20,.14); z-index:70; transform:translateX(100%); transition:transform .28s cubic-bezier(.2,.7,.2,1);
  display:flex; flex-direction:column; }
.node-panel.open { transform:translateX(0); }
.np-head { display:flex; align-items:center; justify-content:space-between; padding:18px 22px; border-bottom:1px solid var(--line); }
.np-head #npTitle { font-size:17px; font-weight:650; letter-spacing:-.01em; }
.np-close { width:32px; height:32px; border-radius:10px; border:1px solid var(--line); background:rgba(255,255,255,.5); color:var(--soft); font-size:20px; line-height:1; cursor:pointer; }
.np-close:hover { color:var(--ink); }
.np-body { padding:20px 22px; overflow-y:auto; }
.np-loading { color:var(--muted); }
.np-row { padding:12px 0; border-bottom:1px solid var(--line); }
.np-row:last-child { border-bottom:0; }
.np-label { font-size:10px; text-transform:uppercase; letter-spacing:.16em; color:var(--muted); margin-bottom:4px; }
.np-value { font-size:14px; color:var(--ink); }
.np-tag { display:inline-block; font-size:10px; font-weight:700; padding:2px 8px; border-radius:6px; background:rgba(184,137,58,.12); color:var(--accent); text-transform:uppercase; letter-spacing:.3px; }
.np-pill { display:inline-flex; align-items:center; gap:6px; font-size:11px; font-weight:600; padding:3px 9px; border-radius:20px; background:rgba(255,255,255,.5); border:1px solid var(--line); margin:0 6px 6px 0; }
.np-list { list-style:none; margin:0; padding:0; }
.np-list li { padding:6px 0; color:var(--soft); font-size:13px; border-bottom:1px dashed var(--line); }
.np-list li:last-child { border-bottom:0; }
.np-cta { display:inline-block; margin-top:14px; }
.demo-logins .l { color:var(--ink); font-weight:600; }

/* ============================================================
   Optimización gráfica — iconos, sparklines, trends, empty
   ============================================================ */
.nav a { display:flex; align-items:center; }
.nav a svg { width:17px; height:17px; fill:currentColor; margin-right:9px; flex:0 0 auto; }
@media (max-width:900px){ .nav a svg { display:none; } }

.trend { display:inline-flex; align-items:center; gap:2px; font-size:12px; font-weight:700; }
.trend.up { color:var(--green); } .trend.down { color:var(--red); } .trend.flat { color:var(--muted); }
.spark { display:block; width:100%; height:26px; margin-top:8px; }
.spark polyline { fill:none; stroke:var(--accent); stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.spark.up polyline { stroke:var(--green); }
.spark.down polyline { stroke:var(--red); }
.spark.flat polyline { stroke:var(--muted); }

.empty { text-align:center; padding:34px 20px; color:var(--muted); }
.empty svg { width:40px; height:40px; fill:none; stroke:var(--muted); stroke-width:1.4; margin-bottom:10px; }
.empty p { margin:0; font-size:14px; }

/* Acento de color por división en el mapa */
.org-col > .node.division { border-left:4px solid color-mix(in srgb, var(--dcol,var(--accent)) 70%, transparent); }
.node.division .alert-chip { display:inline-flex; align-items:center; gap:4px; font-size:10px; font-weight:700; color:var(--red);
  background:rgba(208,92,58,.1); border-radius:12px; padding:1px 8px; margin-left:6px; }

/* Presión táctil en botones */
.btn:active { transform:translateY(0) scale(.98); }
.card, .node { will-change:transform; }

/* Reveal on scroll (solo transform/opacity) */
.reveal { opacity:0; transform:translateY(16px); transition:opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity:1; transform:none; }
@media (prefers-reduced-motion:reduce){ .reveal{opacity:1;transform:none;transition:none;} }

/* ============================================================
   Gráficos — salud del holding (donut + barras)
   ============================================================ */
.health-grid { display:grid; grid-template-columns:minmax(200px,1fr) 1.6fr; gap:20px; margin-bottom:26px; }
.donut-wrap { display:flex; align-items:center; gap:22px; }
.donut { width:150px; height:150px; border-radius:50%; position:relative; flex:0 0 auto; }
.donut::after { content:""; position:absolute; inset:26px; border-radius:50%; background:var(--bg); }
.donut .center { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; z-index:1; }
.donut .center b { font-size:30px; font-weight:650; letter-spacing:-.02em; }
.donut .center span { font-size:10px; text-transform:uppercase; letter-spacing:.14em; color:var(--muted); }
.health-legend { display:flex; flex-direction:column; gap:10px; }
.health-legend .it { display:flex; align-items:center; gap:10px; font-size:13px; color:var(--soft); }
.health-legend .sw { width:12px; height:12px; border-radius:3px; }
.health-legend b { margin-left:auto; color:var(--ink); }
.bars { display:flex; flex-direction:column; gap:12px; }
.bar-row { display:grid; grid-template-columns:150px 1fr 30px; align-items:center; gap:12px; }
.bar-row .name { font-size:13px; color:var(--soft); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.bar-row .track { height:10px; border-radius:6px; background:rgba(29,26,22,.08); overflow:hidden; }
.bar-row .track i { display:block; height:100%; border-radius:6px; background:linear-gradient(90deg,var(--green),#6fcf97); }
.bar-row .track i.warn { background:linear-gradient(90deg,var(--amber),#f0b64a); }
.bar-row .track i.crit { background:linear-gradient(90deg,var(--red),#e0765c); }
.bar-row .n { font-size:12px; font-weight:600; color:var(--ink); text-align:right; }
@media (max-width:820px){ .health-grid{grid-template-columns:1fr;} .bar-row{grid-template-columns:110px 1fr 26px;} }

/* ============================================================
   Modo oscuro (toggle) — sobreescribe las variables y paneles claros
   ============================================================ */
[data-theme="dark"] {
  --bg:#0f0e0c; --bg2:#16130f;
  --ink:#f3eee4; --soft:#c6bdaa; --muted:#8b8374;
  --accent:#e0a02f; --gold:#ffcf21;
  --glass:rgba(255,255,255,.05); --glass-border:rgba(255,255,255,.08);
  --line:rgba(255,255,255,.10);
  --shadow:0 10px 34px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.04);
  --green:#6fcf97; --amber:#f0a631; --red:#e0765c;
  --radius:20px;
}
[data-theme="dark"] body {
  background:
    radial-gradient(900px 500px at 12% -6%, rgba(224,160,47,.08), transparent 60%),
    radial-gradient(800px 500px at 96% 4%, rgba(120,110,190,.08), transparent 60%),
    linear-gradient(160deg,var(--bg),var(--bg2));
}
[data-theme="dark"] .who,
[data-theme="dark"] .btn.ghost,
[data-theme="dark"] .field input,
[data-theme="dark"] .demo-logins a,
[data-theme="dark"] .chip,
[data-theme="dark"] .pill,
[data-theme="dark"] .np-close,
[data-theme="dark"] .node.division .collapse { background:rgba(255,255,255,.05); border-color:var(--line); }
[data-theme="dark"] .kpi-mini,
[data-theme="dark"] .kpi-cell,
[data-theme="dark"] .node.area,
[data-theme="dark"] .node.cargo { background:rgba(255,255,255,.04); border-color:var(--line); }
[data-theme="dark"] .field input { color:var(--ink); }
[data-theme="dark"] .scorebar,
[data-theme="dark"] .bar-row .track,
[data-theme="dark"] .kpi-cell .track { background:rgba(255,255,255,.08); }
[data-theme="dark"] .table th { color:var(--muted); }
[data-theme="dark"] .nav a:hover { background:rgba(255,255,255,.05); }
[data-theme="dark"] .tag { background:rgba(255,255,255,.06); }

/* Toggle de tema */
.theme-toggle { display:flex; align-items:center; justify-content:center; gap:8px; width:100%;
  padding:9px; border-radius:12px; border:1px solid var(--line); background:rgba(255,255,255,.35);
  color:var(--soft); cursor:pointer; margin-bottom:10px; transition:background .2s,color .2s; }
.theme-toggle:hover { color:var(--ink); }
.theme-toggle svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.icon-moon { display:none; }
[data-theme="dark"] .theme-toggle .icon-sun { display:none; }
[data-theme="dark"] .theme-toggle .icon-moon { display:block; }

/* Micro-animación de entrada al donut */
.donut { animation:donutIn .8s cubic-bezier(.2,.7,.2,1); }
@keyframes donutIn { 0%{opacity:0; transform:scale(.7) rotate(-90deg);} 100%{opacity:1; transform:scale(1) rotate(0);} }
@media (prefers-reduced-motion:reduce){ .donut{animation:none;} }

/* ============================================================
   Integración ronda integral — componentes nuevos
   ============================================================ */
.crumbs { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.crumbs a { color:var(--muted); }
.crumbs a:hover { color:var(--accent); }
.crumbs .sep { color:var(--line); }
.crumbs .current { color:var(--soft); }

.dash-panels { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:22px; }
.trend-count { display:flex; gap:18px; flex-wrap:wrap; margin-top:8px; }
.tc { display:inline-flex; align-items:center; gap:6px; font-size:13px; color:var(--soft); }
.tc b { font-size:20px; }
.tc.up { color:var(--green); } .tc.down { color:var(--red); } .tc.flat { color:var(--muted); }
.decision-list { list-style:none; margin:8px 0 0; padding:0; }
.decision-list li { display:flex; align-items:center; gap:10px; padding:6px 0; border-bottom:1px dashed var(--line); font-size:13px; color:var(--soft); }
.decision-list li:last-child { border-bottom:0; }
.dash-filters { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:16px; }
.dash-filters .muted { margin-right:4px; }

.mini-org { display:flex; flex-direction:column; gap:14px; }
.mini-area { }
.mini-area-name { font-weight:650; color:var(--accent); font-size:14px; }
.mini-area-name:hover { text-decoration:underline; }
.mini-cargos { display:flex; flex-direction:column; gap:6px; margin-top:8px; padding-left:12px; border-left:2px solid var(--line); }
.mini-cargo { background:rgba(255,255,255,.45); border:1px solid var(--line); border-radius:10px; padding:8px 12px; color:var(--ink); font-size:13px; display:flex; align-items:center; justify-content:space-between; gap:8px; transition:border-color .16s,transform .16s; }
.mini-cargo:hover { border-color:var(--accent); transform:translateX(3px); text-decoration:none; }
.mini-cargo span { font-size:9px; text-transform:uppercase; letter-spacing:.1em; color:var(--muted); }
[data-theme="dark"] .mini-cargo { background:rgba(255,255,255,.04); }

.mando { padding:8px 12px; border-radius:10px; margin-bottom:8px; font-size:13px; }
.mando.self { background:rgba(184,137,58,.12); color:var(--ink); font-weight:650; }
.mando.up-link { color:var(--soft); }
.mando.up-link a { font-weight:600; }
.mando.down { display:flex; flex-direction:column; gap:6px; }
.mando.down a { color:var(--soft); }
.mando.down a:hover { color:var(--accent); }

.rent { display:flex; align-items:center; gap:8px; min-width:120px; }
.rent i { height:8px; width:var(--rent,40%); border-radius:6px; background:linear-gradient(90deg,var(--accent),var(--gold)); }
.rent span { font-size:11px; color:var(--soft); text-transform:uppercase; letter-spacing:.08em; }

.login-group { margin-top:14px; }
.login-group-name { font-size:11px; text-transform:uppercase; letter-spacing:.16em; color:var(--muted); margin-bottom:8px; }
.pwd { position:relative; }
.pwd input { padding-right:52px; }
.pwd-toggle { position:absolute; top:50%; right:8px; transform:translateY(-50%); padding:5px 10px; border:1px solid var(--line); border-radius:8px; background:rgba(255,255,255,.5); color:var(--accent); font-size:12px; font-weight:600; cursor:pointer; }
[data-theme="dark"] .pwd-toggle { background:rgba(255,255,255,.05); }

.mapa-search { display:flex; align-items:center; gap:8px; background:rgba(255,255,255,.5); border:1px solid var(--line); border-radius:12px; padding:0 12px; flex:1 1 240px; max-width:340px; }
[data-theme="dark"] .mapa-search { background:rgba(255,255,255,.05); }
.mapa-search svg { width:16px; height:16px; fill:none; stroke:var(--muted); stroke-width:1.8; }
.mapa-search input { flex:1; border:0; background:transparent; padding:10px 0; color:var(--ink); font-size:14px; }
.mapa-search input:focus { outline:none; }
.org-col.matched { outline:2px solid var(--accent); outline-offset:3px; }
.org-col.hidden { display:none; }
.node.match-glow { outline:2px solid var(--gold); outline-offset:2px; }

@media (max-width:820px){ .dash-panels{grid-template-columns:1fr;} .mapa-search{max-width:none;} }

/* ============================================================
   Salto premium — preloader, cursor, reduced-motion
   ============================================================ */
#preloader { position:fixed; inset:0; z-index:100; background:var(--bg); display:flex; align-items:center; justify-content:center;
  animation:preOut 1s ease .9s forwards; pointer-events:none; }
.pre-bar { width:120px; height:3px; border-radius:3px; background:linear-gradient(90deg,var(--accent),var(--gold));
  transform-origin:left; animation:preBar .8s ease .1s both; }
@keyframes preBar { from{transform:scaleX(0);} to{transform:scaleX(1);} }
@keyframes preOut { to{opacity:0; visibility:hidden;} }
@media (prefers-reduced-motion:reduce){ #preloader{display:none;} }

/* Cursor custom (solo pointer fine) */
body.has-cursor .c-dot, body.has-cursor .c-ring { position:fixed; top:0; left:0; pointer-events:none; border-radius:50%;
  transform:translate(0,0); z-index:120; }
body.has-cursor .c-dot { width:8px; height:8px; margin:-4px 0 0 -4px; background:var(--accent); }
body.has-cursor .c-ring { width:34px; height:34px; margin:-17px 0 0 -17px; border:1px solid rgba(184,137,58,.5);
  transition:width .25s,height .25s,margin .25s,border-color .25s; }
body.has-cursor a:hover ~ .c-ring, body.has-cursor .c-ring.grow { width:46px; height:46px; margin:-23px 0 0 -23px; }
body.has-cursor { cursor:none; }
body.has-cursor a, body.has-cursor button, body.has-cursor .btn { cursor:none; }
@media (hover:none){ body.has-cursor{ cursor:auto; } }

/* ============ Módulo operativo (kanban) ============ */
.kanban { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:14px; align-items:start; }
.kb-col { background:var(--glass); backdrop-filter:blur(16px) saturate(1.3); -webkit-backdrop-filter:blur(16px) saturate(1.3);
  border:1px solid var(--glass-border); border-radius:16px; padding:12px; }
.kb-head { font-size:11px; text-transform:uppercase; letter-spacing:.14em; color:var(--muted); display:flex; justify-content:space-between; padding:0 4px 10px; }
.kb-count { background:rgba(184,137,58,.12); color:var(--accent); border-radius:10px; padding:0 8px; font-weight:700; }
.kb-body { display:flex; flex-direction:column; gap:8px; }
.kb-card { display:block; background:rgba(255,255,255,.5); border:1px solid var(--line); border-radius:12px; padding:10px 12px; color:var(--ink); text-decoration:none; transition:border-color .16s,transform .16s; }
.kb-card:hover { border-color:var(--accent); transform:translateY(-2px); text-decoration:none; }
.kb-card b { display:block; font-size:13px; }
.kb-card .small { font-size:11px; }
[data-theme="dark"] .kb-card { background:rgba(255,255,255,.04); }
