/* ============================================================
   MERKDO · Control Center — UI inmersiva (glass + animaciones)
   Tema oscuro por defecto · claro vía [data-theme="light"]
   ============================================================ */

/* ---------- Tokens de marca ---------- */
:root {
  /* 🎨 Colores de marca MERKDO — centralizados para swap inmediato */
  --brand:      #ff2d55;   /* rojo MERKDO          */
  --brand-2:    #b3122f;   /* rojo profundo        */
  --brand-3:    #ff6b8a;   /* rosa claro / highlight */
  --accent:     #5b8cff;   /* azul acento (datos)  */
  --accent-2:   #8a5bff;   /* violeta acento       */
  --gold:       #ffb627;

  --green: #2fd6a0;
  --amber: #ffb02e;
  --blue:  #57b6f5;
  --red:   #ff5468;
  --gray:  #8a90a6;

  --grad-brand: linear-gradient(135deg, #ff2d55 0%, #b3122f 100%);
  --radius: 18px;
  --radius-sm: 12px;
  --ease: cubic-bezier(.16,.84,.44,1);
}

/* ---- Tema OSCURO (default) ---- */
:root, [data-theme="dark"] {
  --bg0: #07080f;
  --bg1: #0c0e1a;
  --text: #eef0f8;
  --text-soft: #c4c8da;
  --muted: #8d93ab;
  --line: rgba(255,255,255,.10);
  --glass-bg: rgba(22,25,43,.55);
  --glass-bg-2: rgba(30,34,56,.45);
  --glass-brd: rgba(255,255,255,.12);
  --glass-hi: rgba(255,255,255,.06);
  --shadow: 0 10px 40px rgba(0,0,0,.45);
  --chart-grid: rgba(255,255,255,.07);
  --kpi-icon-bg: rgba(255,45,85,.16);
}

/* ---- Tema CLARO ---- */
[data-theme="light"] {
  --bg0: #eef0f8;
  --bg1: #f6f7fc;
  --text: #16182a;
  --text-soft: #3a3f55;
  --muted: #6b7188;
  --line: rgba(20,24,50,.10);
  --glass-bg: rgba(255,255,255,.65);
  --glass-bg-2: rgba(255,255,255,.55);
  --glass-brd: rgba(255,255,255,.85);
  --glass-hi: rgba(255,255,255,.6);
  --shadow: 0 10px 35px rgba(30,35,80,.12);
  --chart-grid: rgba(20,24,50,.08);
  --kpi-icon-bg: rgba(255,45,85,.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg0);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .4s var(--ease), color .4s var(--ease);
}

.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; }
.r { text-align: right; }

/* ============================================================
   Fondo AURORA animado
   ============================================================ */
.aurora {
  position: fixed; inset: 0; z-index: -2; overflow: hidden;
  background:
    radial-gradient(1200px 800px at 80% -10%, rgba(255,45,85,.10), transparent 60%),
    radial-gradient(1000px 700px at -10% 110%, rgba(91,140,255,.10), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}
.blob {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55;
  will-change: transform;
}
.b1 { width: 46vw; height: 46vw; left: -8vw; top: -10vw; background: radial-gradient(circle, #ff2d55, transparent 70%); animation: float1 26s var(--ease) infinite; }
.b2 { width: 40vw; height: 40vw; right: -6vw; top: 18vh; background: radial-gradient(circle, #8a5bff, transparent 70%); animation: float2 32s var(--ease) infinite; opacity: .4; }
.b3 { width: 38vw; height: 38vw; left: 30vw; bottom: -14vw; background: radial-gradient(circle, #5b8cff, transparent 70%); animation: float3 30s var(--ease) infinite; opacity: .35; }
[data-theme="light"] .blob { opacity: .35; }

@keyframes float1 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(8vw,6vh) scale(1.15)} }
@keyframes float2 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(-7vw,8vh) scale(1.1)} }
@keyframes float3 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(5vw,-7vh) scale(1.2)} }

.grain {
  position: absolute; inset: 0; opacity: .035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============================================================
   Glass base
   ============================================================ */
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--glass-brd);
}

.app { display: flex; min-height: 100vh; }

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
  width: 256px; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; z-index: 50;
  border-right: 1px solid var(--glass-brd);
  border-radius: 0;
}
.brand { display: flex; align-items: center; gap: 13px; padding: 22px 20px 18px; }
.brand-logo {
  width: 44px; height: 44px; border-radius: 13px; overflow: hidden;
  box-shadow: 0 6px 18px rgba(255,45,85,.5);
  animation: pop .6s var(--ease) both;
}
.brand-logo svg { display: block; }
.brand-name { font-weight: 800; letter-spacing: .5px; font-size: 17px; }
.brand-sub {
  font-size: 9.5px; letter-spacing: 2.4px; text-transform: uppercase;
  background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent;
  font-weight: 800; margin-top: 1px;
}

.nav { flex: 1; padding: 6px 12px; overflow-y: auto; }
.nav-group {
  font-size: 10px; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--muted); margin: 16px 14px 7px; opacity: .85;
}
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 12px;
  color: var(--text-soft); cursor: pointer; font-size: 14.5px; font-weight: 500;
  position: relative; transition: background .25s var(--ease), color .25s, transform .25s var(--ease);
}
.nav-item .ico { font-size: 17px; width: 22px; text-align: center; transition: transform .25s var(--ease); }
.nav-item:hover { background: var(--glass-hi); color: var(--text); transform: translateX(3px); }
.nav-item:hover .ico { transform: scale(1.18); }
.nav-item.active {
  color: #fff; background: var(--grad-brand);
  box-shadow: 0 8px 22px rgba(255,45,85,.42);
}
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 22px; border-radius: 4px; background: var(--brand);
  box-shadow: 0 0 12px var(--brand);
}

.sidebar-foot {
  padding: 14px 16px; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 10px;
}
.role-box { display: flex; flex-direction: column; gap: 6px; }
.role-lbl { font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); }
.role-select { width: 100%; }
.role-pill {
  align-self: flex-start; font-size: 10.5px; font-weight: 700; color: var(--brand);
  background: var(--kpi-icon-bg); border: 1px solid var(--glass-brd); padding: 2px 9px; border-radius: 20px;
}
.btn-reset { width: 100%; font-size: 12px; }
.demo-tag {
  display: inline-block; background: linear-gradient(135deg,#ffb627,#ff8a00); color: #2a1c00;
  font-weight: 800; font-size: 10.5px; padding: 3px 9px; border-radius: 7px; letter-spacing: 1px;
}

/* ---------- Botones ---------- */
.btn-add {
  border: none; cursor: pointer; font-weight: 700; font-size: 13px; color: #fff;
  background: var(--grad-brand); padding: 8px 15px; border-radius: 10px;
  box-shadow: 0 6px 16px rgba(255,45,85,.4); transition: transform .2s var(--ease), box-shadow .2s;
}
.btn-add:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(255,45,85,.5); }
.btn-add:active { transform: scale(.96); }
.btn-ghost {
  border: 1px solid var(--glass-brd); background: var(--glass-hi); color: var(--text);
  cursor: pointer; font-weight: 600; font-size: 13px; padding: 8px 15px; border-radius: 10px; transition: background .2s;
}
.btn-ghost:hover { background: var(--glass-bg-2); }
.card-tools { display: flex; gap: 8px; align-items: center; }
.bar-tools { display: flex; justify-content: flex-end; margin-bottom: 12px; }

/* Acciones de fila */
td.acts, th.acts { width: 1%; white-space: nowrap; text-align: right; }
.ic-act {
  border: 1px solid var(--glass-brd); background: var(--glass-hi); color: var(--text-soft);
  cursor: pointer; border-radius: 8px; padding: 4px 9px; font-size: 13px; margin-left: 5px; transition: all .2s;
}
.ic-act:hover { background: var(--glass-bg-2); color: var(--text); transform: translateY(-1px); }
.ic-act.danger:hover { color: var(--red); border-color: var(--red); }
.event-acts { display: flex; gap: 7px; margin-top: 10px; }

/* ============================================================
   Topbar
   ============================================================ */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 14px 26px;
  position: sticky; top: 0; z-index: 40; border-bottom: 1px solid var(--glass-brd);
  border-left: 0; border-right: 0; border-top: 0;
}
.topbar-titles { flex: 1; min-width: 0; }
.topbar h1 { font-size: 20px; font-weight: 800; letter-spacing: .2px; }
.topbar h1, .topbar p { animation: fadeUp .5s var(--ease) both; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--glass-brd);
  background: var(--glass-hi); color: var(--text); font-size: 17px; cursor: pointer;
  display: grid; place-items: center; transition: transform .2s var(--ease), background .2s;
}
.icon-btn:hover { transform: translateY(-2px); background: var(--glass-bg-2); }
.icon-btn:active { transform: scale(.94); }
#burger { display: none; }

.select {
  padding: 9px 13px; border: 1px solid var(--glass-brd); border-radius: 12px;
  background: var(--glass-hi); color: var(--text); font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: background .2s;
}
.select:hover { background: var(--glass-bg-2); }
.select option { background: var(--bg1); color: var(--text); }
.clock { font-size: 12.5px; white-space: nowrap; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--grad-brand); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 800;
  box-shadow: 0 6px 16px rgba(255,45,85,.45); border: 2px solid rgba(255,255,255,.25);
}

.view { padding: 24px 26px; }
.foot { padding: 18px 26px 30px; text-align: center; }

/* ============================================================
   Grid
   ============================================================ */
.grid { display: grid; gap: 18px; margin-bottom: 18px; }
.grid.kpis { grid-template-columns: repeat(auto-fit, minmax(214px, 1fr)); }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }

/* Entrada escalonada de hijos */
.view .grid > *, .view > .card, .view .event-card {
  animation: fadeUp .55s var(--ease) both;
}

/* ============================================================
   KPI
   ============================================================ */
.kpi {
  background: var(--glass-bg); border: 1px solid var(--glass-brd); border-radius: var(--radius);
  -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%);
  padding: 16px 17px; display: flex; gap: 13px; align-items: flex-start;
  position: relative; overflow: hidden; box-shadow: var(--shadow);
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
}
.kpi-body { min-width: 0; flex: 1; }
.kpi::after {
  content: ""; position: absolute; inset: 0; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--glass-hi), transparent 40%); pointer-events: none;
}
.kpi:hover { transform: translateY(-5px); border-color: rgba(255,45,85,.5); box-shadow: 0 18px 44px rgba(0,0,0,.5); }
.kpi-icon {
  width: 46px; height: 46px; border-radius: 13px; background: var(--kpi-icon-bg);
  display: grid; place-items: center; font-size: 22px; flex-shrink: 0;
  border: 1px solid var(--glass-brd);
}
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi-value { font-size: 22px; font-weight: 800; line-height: 1.15; margin-top: 3px; letter-spacing: 0; white-space: nowrap; }
.kpi-sub { font-size: 11.5px; color: var(--muted); }
.kpi-trend { font-size: 12px; font-weight: 700; margin-top: 4px; display: inline-flex; align-items: center; gap: 3px; }
.kpi-trend.up { color: var(--green); }
.kpi-trend.down { color: var(--red); }

/* ============================================================
   Card
   ============================================================ */
.card {
  background: var(--glass-bg); border: 1px solid var(--glass-brd); border-radius: var(--radius);
  -webkit-backdrop-filter: blur(20px) saturate(150%); backdrop-filter: blur(20px) saturate(150%);
  box-shadow: var(--shadow); overflow: hidden;
  transition: transform .3s var(--ease), border-color .3s;
}
.card:hover { border-color: var(--glass-hi); }
.card-h {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 16px 19px; border-bottom: 1px solid var(--line);
}
.card-h h3 { font-size: 15px; font-weight: 700; }
.card-b { padding: 17px 19px; }
.card-b canvas { max-height: 290px; }

/* ============================================================
   Tablas
   ============================================================ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line);
}
tbody td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr { transition: background .2s; }
tbody tr:hover { background: var(--glass-hi); }
tbody tr:last-child td { border-bottom: none; }
td .muted { font-size: 11.5px; }

/* ============================================================
   Badge
   ============================================================ */
.badge {
  display: inline-block; padding: 3px 11px; border-radius: 20px; font-size: 11.5px; font-weight: 700;
  border: 1px solid transparent;
}
.badge.green { background: rgba(47,214,160,.16); color: var(--green); border-color: rgba(47,214,160,.3); }
.badge.blue  { background: rgba(87,182,245,.16); color: var(--blue);  border-color: rgba(87,182,245,.3); }
.badge.amber { background: rgba(255,176,46,.16); color: var(--amber); border-color: rgba(255,176,46,.3); }
.badge.red   { background: rgba(255,84,104,.16); color: var(--red);   border-color: rgba(255,84,104,.3); }
.badge.gray  { background: rgba(138,144,166,.16); color: var(--muted); border-color: rgba(138,144,166,.25); }

/* ============================================================
   Progress bar
   ============================================================ */
.progress-cell { display: flex; align-items: center; gap: 9px; min-width: 135px; }
.bar { flex: 1; height: 7px; background: var(--glass-hi); border-radius: 20px; overflow: hidden; min-width: 70px; border: 1px solid var(--line); }
.bar-fill { height: 100%; border-radius: 20px; width: 0; transition: width 1.1s var(--ease); }
.bar-fill.green { background: linear-gradient(90deg,#2fd6a0,#1aa87c); }
.bar-fill.blue  { background: linear-gradient(90deg,#57b6f5,#3a7fd6); }
.bar-fill.amber { background: linear-gradient(90deg,#ffce6b,#ff9f1c); }
.bar-fill.red   { background: linear-gradient(90deg,#ff7a88,#e6483b); }
.bar-pct { font-size: 12px; font-weight: 700; color: var(--muted); min-width: 36px; }

/* ============================================================
   Alertas
   ============================================================ */
.alerts { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.alerts li {
  display: flex; align-items: center; gap: 11px; font-size: 13.5px; padding: 9px 11px;
  border-radius: 11px; transition: background .2s;
}
.alerts li:hover { background: var(--glass-hi); }
.alerts .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; position: relative; }
.alerts .dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; opacity: .5;
  animation: pulse 2s ease-out infinite;
}
.al-danger .dot, .al-danger .dot::after { background: var(--red); }
.al-warn .dot, .al-warn .dot::after { background: var(--amber); }
.al-info .dot, .al-info .dot::after { background: var(--blue); }
.link {
  background: none; border: none; color: var(--brand); font-weight: 700; cursor: pointer;
  font-size: 12.5px; margin-left: auto; white-space: nowrap; padding: 0; transition: opacity .2s;
}
.link:hover { opacity: .7; text-decoration: underline; }

/* ============================================================
   Event cards
   ============================================================ */
.event-card {
  background: var(--glass-bg); border: 1px solid var(--glass-brd); border-radius: var(--radius);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: var(--shadow); padding: 15px; display: flex; gap: 15px; align-items: flex-start;
  transition: transform .3s var(--ease), border-color .3s;
}
.event-card:hover { transform: translateY(-4px); border-color: rgba(255,45,85,.45); }
.event-date {
  background: var(--grad-brand); color: #fff; border-radius: 13px; padding: 11px 15px; text-align: center;
  flex-shrink: 0; box-shadow: 0 6px 16px rgba(255,45,85,.4);
}
.event-date .d { display: block; font-size: 23px; font-weight: 800; line-height: 1; }
.event-date .m { display: block; font-size: 11px; text-transform: uppercase; opacity: .9; }
.event-body { flex: 1; min-width: 0; }
.event-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 5px; }
.event-meta { display: flex; flex-wrap: wrap; gap: 13px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }

/* ============================================================
   Headcount
   ============================================================ */
.hc { display: flex; flex-direction: column; gap: 15px; }
.hc-row { display: flex; align-items: center; gap: 13px; font-size: 13.5px; }
.hc-row > span:first-child { min-width: 135px; }
.hc-row strong { min-width: 36px; text-align: right; }

/* ============================================================
   Animaciones
   ============================================================ */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.6) rotate(-12deg); } to { opacity: 1; transform: none; } }
@keyframes pulse { from { transform: scale(.6); opacity: .5; } to { transform: scale(1.8); opacity: 0; } }

/* Retardos escalonados */
.stagger > *:nth-child(1){animation-delay:.03s} .stagger > *:nth-child(2){animation-delay:.08s}
.stagger > *:nth-child(3){animation-delay:.13s} .stagger > *:nth-child(4){animation-delay:.18s}
.stagger > *:nth-child(5){animation-delay:.23s} .stagger > *:nth-child(6){animation-delay:.28s}
.stagger > *:nth-child(7){animation-delay:.33s} .stagger > *:nth-child(8){animation-delay:.38s}

/* Scrollbars */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--glass-brd); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: padding-box; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .blob { animation: none; }
}

/* ============================================================
   Responsive
   ============================================================ */
.scrim {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 45;
  opacity: 0; pointer-events: none; transition: opacity .3s; backdrop-filter: blur(2px);
}
.scrim.show { opacity: 1; pointer-events: auto; }

/* ============================================================
   Modal CRUD
   ============================================================ */
.modal-root { position: fixed; inset: 0; z-index: 80; display: none; }
.modal-root.show { display: block; }
.modal-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(4px); animation: fadeIn .2s; }
.modal {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto;
  border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: modalIn .3s var(--ease);
}
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-h h3 { font-size: 17px; font-weight: 800; }
.modal-b { padding: 20px 22px; }
.fld-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fld { display: flex; flex-direction: column; gap: 6px; }
.fld span { font-size: 12px; font-weight: 600; color: var(--muted); }
.fld input, .fld select {
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--glass-brd);
  background: var(--glass-hi); color: var(--text); font-size: 14px; font-family: inherit; width: 100%;
}
.fld input:focus, .fld select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,45,85,.18); }
.fld select option { background: var(--bg1); color: var(--text); }
.modal-f { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translate(-50%,-46%) scale(.96); } to { opacity: 1; transform: translate(-50%,-50%) scale(1); } }

/* ============================================================
   Drawer (drill-down 360°)
   ============================================================ */
.drawer-root { position: fixed; inset: 0; z-index: 85; display: none; }
.drawer-root.show { display: block; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(3px); animation: fadeIn .2s; }
.drawer {
  position: absolute; top: 0; right: 0; height: 100%; width: min(480px, 100vw);
  border-left: 1px solid var(--glass-brd); box-shadow: -20px 0 60px rgba(0,0,0,.5);
  animation: drawerIn .32s var(--ease); display: flex; flex-direction: column;
}
.drawer-body { padding: 22px 24px 40px; overflow-y: auto; }
.drawer-x { position: absolute; top: 14px; right: 16px; z-index: 2; }
@keyframes drawerIn { from { transform: translateX(40px); opacity: .4; } to { transform: none; opacity: 1; } }

.dh { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-right: 44px; margin-bottom: 18px; }
.dh h2 { font-size: 19px; font-weight: 800; margin: 3px 0 8px; line-height: 1.2; }
.dh-tags { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.chip { font-size: 11.5px; font-weight: 600; color: var(--text-soft); background: var(--glass-hi); border: 1px solid var(--glass-brd); padding: 3px 10px; border-radius: 20px; }

.d-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 6px; }
.dk { background: var(--glass-hi); border: 1px solid var(--glass-brd); border-radius: 12px; padding: 11px 13px; }
.dk-l { font-size: 11px; color: var(--muted); font-weight: 600; }
.dk-v { font-size: 18px; font-weight: 800; margin-top: 2px; }

.d-sec { padding: 15px 0; border-bottom: 1px solid var(--line); }
.d-sec:last-child { border-bottom: none; }
.d-sec h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 10px; }
.d-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 7px 0; border-bottom: 1px solid var(--line); }
.d-row:last-child { border-bottom: none; }
.d-row .muted { margin-left: auto; }
.d-table { width: 100%; font-size: 13px; }
.d-table td { padding: 7px 6px; border-bottom: 1px solid var(--line); }

.cell-link {
  background: none; border: none; padding: 0; cursor: pointer; text-align: left;
  font: inherit; font-weight: 700; color: var(--text);
  border-bottom: 1px dashed transparent; transition: color .2s, border-color .2s;
}
.cell-link:hover { color: var(--brand); border-color: var(--brand); }

/* ============================================================
   Buscador global (command palette)
   ============================================================ */
.search-root { position: fixed; inset: 0; z-index: 88; display: none; }
.search-root.show { display: block; }
.search-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(4px); animation: fadeIn .18s; }
.search-box {
  position: absolute; top: 12vh; left: 50%; transform: translateX(-50%);
  width: min(620px, calc(100vw - 28px)); border-radius: 18px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: modalIn .26s var(--ease);
}
#search-input {
  width: 100%; border: none; background: transparent; color: var(--text);
  font-size: 17px; padding: 18px 22px; border-bottom: 1px solid var(--line); font-family: inherit;
}
#search-input:focus { outline: none; }
.search-results { max-height: 56vh; overflow-y: auto; padding: 8px; }
.sr-item {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  background: none; border: none; cursor: pointer; padding: 11px 13px; border-radius: 11px; color: var(--text);
  transition: background .15s;
}
.sr-item:hover, .sr-item.sel { background: var(--glass-hi); }
.sr-ic { font-size: 19px; width: 26px; text-align: center; }
.sr-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sr-empty { padding: 22px; text-align: center; }

/* ============================================================
   Modo presentación
   ============================================================ */
body.presentando .sidebar-foot,
body.presentando .foot { display: none; }
body.presentando .view { padding: 30px 40px; }
body.presentando .topbar h1 { font-size: 23px; }

/* ============================================================
   Impresión / PDF
   ============================================================ */
@media print {
  .aurora, .sidebar, .topbar-actions, #burger, .scrim, .modal-root, .search-root, .toast,
  .card-tools, .acts, th.acts, .bar-tools, .event-acts, .link { display: none !important; }
  body { background: #fff !important; color: #111 !important; }
  .app { display: block; }
  .main { display: block; }
  .topbar { position: static; border: none; background: #fff !important; }
  .topbar h1 { color: #111; }
  .view { padding: 0 !important; }
  .card, .kpi, .event-card { background: #fff !important; border: 1px solid #ddd !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; break-inside: avoid; }
  .kpi-value, .card-h h3, td, th, .kpi-label { color: #111 !important; }
  .grid.cols-2 { grid-template-columns: 1fr 1fr; }
  @page { margin: 14mm; }
}

/* ============================================================
   Login
   ============================================================ */
.login-root { position: fixed; inset: 0; z-index: 95; display: none; }
.login-root.show { display: grid; place-items: center; padding: 16px; }
.login-root::before { content: ""; position: absolute; inset: 0; background: rgba(5,6,12,.62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.login-card { position: relative; width: min(560px, 100%); border-radius: 22px; padding: 28px; box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: modalIn .3s var(--ease); }
.login-brand { display: flex; gap: 14px; align-items: center; }
.login-brand .brand-logo { box-shadow: 0 8px 22px rgba(255,45,85,.5); }
.login-title { font-size: 24px; font-weight: 800; letter-spacing: .5px; }
.login-sub { font-size: 11.5px; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; }
.login-hint { color: var(--muted); font-size: 13px; margin: 18px 0 14px; }
.login-users { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.login-user { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--glass-hi); border: 1px solid var(--glass-brd); border-radius: 14px; padding: 12px; cursor: pointer; color: var(--text); transition: transform .2s var(--ease), border-color .2s, background .2s; }
.login-user:hover { transform: translateY(-2px); border-color: var(--brand); background: var(--glass-bg-2); }
.lu-av { width: 42px; height: 42px; border-radius: 50%; background: var(--grad-brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; flex-shrink: 0; }
.lu-txt { display: flex; flex-direction: column; min-width: 0; }
@media (max-width: 560px) { .login-users { grid-template-columns: 1fr; } }

/* ---------- User chip ---------- */
.user-chip { display: flex; align-items: center; gap: 8px; }
.uc-av { width: 36px; height: 36px; border-radius: 50%; background: var(--grad-brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 11px; box-shadow: 0 5px 14px rgba(255,45,85,.42); border: 2px solid rgba(255,255,255,.22); }
.uc-name { font-size: 13px; font-weight: 700; }
.uc-out { width: 36px; height: 36px; font-size: 14px; }
@media (max-width: 760px) { .uc-name { display: none; } }

/* ============================================================
   Gantt
   ============================================================ */
.gantt { font-size: 12.5px; }
.g-head, .g-row { display: grid; grid-template-columns: 174px 1fr; gap: 12px; align-items: center; }
.g-head { margin-bottom: 6px; }
.g-row { padding: 5px 0; }
.g-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-axis { position: relative; height: 16px; }
.g-mo { position: absolute; top: 0; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.g-track { position: relative; height: 26px; background: var(--glass-hi); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.g-gl { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.g-bar { position: absolute; top: 3px; height: 18px; border-radius: 6px; display: flex; align-items: center; min-width: 14px; overflow: hidden; border: 1px solid var(--glass-brd); }
.g-bar.blue { background: rgba(87,182,245,.16); } .g-bar.green { background: rgba(47,214,160,.16); }
.g-bar.amber { background: rgba(255,176,46,.16); } .g-bar.gray { background: rgba(138,144,166,.16); }
.g-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; transition: width 1s var(--ease); }
.g-bar.blue .g-fill { background: linear-gradient(90deg,#57b6f5,#3a7fd6); }
.g-bar.green .g-fill { background: linear-gradient(90deg,#2fd6a0,#1aa87c); }
.g-bar.amber .g-fill { background: linear-gradient(90deg,#ffce6b,#ff9f1c); }
.g-bar.gray .g-fill { background: linear-gradient(90deg,#9aa0b4,#6a7187); }
.g-pct { position: relative; z-index: 1; margin-left: auto; padding: 0 7px; font-size: 10.5px; font-weight: 700; color: var(--text); }
@media (max-width: 760px) { .g-head, .g-row { grid-template-columns: 104px 1fr; } }

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 120%);
  z-index: 90; background: var(--grad-brand); color: #fff; font-weight: 600; font-size: 13.5px;
  padding: 12px 20px; border-radius: 12px; box-shadow: 0 14px 36px rgba(255,45,85,.45);
  transition: transform .35s var(--ease); max-width: calc(100vw - 32px);
}
.toast.show { transform: translate(-50%, 0); }

@media (max-width: 920px) { .grid.cols-2 { grid-template-columns: 1fr; } .fld-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .sidebar {
    position: fixed; left: 0; top: 0; transform: translateX(-100%);
    transition: transform .32s var(--ease); box-shadow: 8px 0 40px rgba(0,0,0,.5);
  }
  .sidebar.open { transform: translateX(0); }
  #burger { display: grid; }
  .clock { display: none; }
  .view { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .topbar h1 { font-size: 17px; }
  .topbar-actions { gap: 9px; }
  .topbar-actions .select { max-width: 130px; }
}
