/**
 * Seguimiento Ejecutivo — Portal App Theme Blue 1.0.27
 * Adaptación visual del Portal App Theme 1.0.0.
 * Solo capa visual: no modifica lógica, rutas, SSO, BD ni permisos.
 */
body.portal-theme {
  --portal-navy: #142d50;
  --portal-navy-deep: #102745;
  --portal-blue: #2574e8;
  --portal-cyan: #35b8c8;
  --portal-sky: #63c9f1;
  --portal-blue-soft: #e8f5ff;
  --portal-ink: #25334a;
  --portal-muted: #748096;
  --portal-bg: #f4f7fb;
  --portal-panel: #ffffff;
  --portal-line: #dfe6ef;
  --portal-green: #20a96b;
  --portal-orange: #ed9f32;
  --portal-red: #ec5361;
  --portal-shadow-sm: 0 10px 28px rgba(25,45,77,.06);
  --portal-shadow: 0 18px 55px rgba(25,45,77,.09);
  --portal-shadow-hover: 0 22px 60px rgba(25,45,77,.14);
  background:
    radial-gradient(circle at 78% 2%, rgba(99,201,241,.13), transparent 26rem),
    var(--portal-bg);
  color: var(--portal-ink);
}

body.portal-theme *, body.portal-theme *::before, body.portal-theme *::after { box-sizing: border-box; }

/* Sidebar: conserva estructura y logo actual, cambia solo la piel visual. */
body.portal-theme .sidebar {
  overflow:hidden;
  border-right:1px solid rgba(37,116,232,.14);
  box-shadow:10px 0 34px rgba(22,44,75,.06);
  background:
    radial-gradient(circle at 78% 8%, rgba(255,255,255,.96) 0 15%, transparent 36%),
    radial-gradient(ellipse at 12% 76%, rgba(99,201,241,.34) 0 18%, transparent 47%),
    radial-gradient(ellipse at 92% 92%, rgba(37,116,232,.30) 0 17%, transparent 45%),
    linear-gradient(155deg,#f7fdff 0%,#d9f2ff 46%,#91d8f5 100%);
  background-size:155% 155%,175% 175%,165% 165%,125% 125%;
  background-position:80% 0%,0% 82%,100% 100%,0% 0%;
  animation:seBlueFlow 10s ease-in-out infinite alternate;
  will-change:background-position;
}
body.portal-theme .sidebar::before,
body.portal-theme .sidebar::after {
  content:none !important;
}
body.portal-theme .sidebar > * { position:relative; z-index:2; }
body.portal-theme .sidebar-caption { color:#71839a; letter-spacing:1.7px; }
body.portal-theme .sidebar nav a {
  border:1px solid transparent;
  border-radius:12px;
  color:#5e7086;
  transition:transform .18s ease,background .18s ease,color .18s ease,box-shadow .18s ease,border-color .18s ease;
}
body.portal-theme .sidebar nav a:hover {
  transform:translateX(2px);
  color:var(--portal-navy);
  background:rgba(255,255,255,.70);
  border-color:rgba(37,116,232,.10);
}
body.portal-theme .sidebar nav a.active {
  color:#1f69d5;
  border-color:rgba(37,116,232,.16);
  background:linear-gradient(120deg,#e6f4ff,rgba(255,255,255,.88));
  box-shadow:0 9px 22px rgba(37,116,232,.13);
}
body.portal-theme .sidebar-bottom { border-top-color:rgba(37,116,232,.14); }
body.portal-theme .user-avatar {
  background:linear-gradient(145deg,#eaf7ff,#cfeeff);
  color:#1769c9;
  box-shadow:0 5px 16px rgba(37,116,232,.13);
}

/* El logo actual se conserva; giro continuo suave con leve inclinación 3D.
   Se usa la propiedad individual `rotate` porque ui-fix-1.0.12.css fija
   `transform:none!important` en .brand-logo. */
body.portal-theme .sidebar .brand {
  min-height:118px;
  perspective:900px;
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  color:transparent;
  font-size:0;
}
body.portal-theme .sidebar .brand img.brand-logo,
body.portal-theme .sidebar .brand img {
  width:112px;
  height:112px;
  max-width:112px;
  object-fit:contain;
  display:block;
  filter:drop-shadow(0 13px 18px rgba(22,44,67,.22));
  transform-origin:50% 50%;
  transform:perspective(800px) rotateX(5deg) rotateY(-3deg) !important;
  rotate:0deg;
  will-change:rotate;
  animation:seLogoSpin 8s linear infinite !important;
}
body.portal-theme .sidebar .brand-mark,
body.portal-theme .sidebar .brand-dot { display:none !important; }

/* Barra superior */
body.portal-theme .topbar {
  min-height:72px;
  background:rgba(255,255,255,.80);
  border-bottom:1px solid rgba(37,116,232,.10);
  backdrop-filter:blur(16px);
  box-shadow:0 7px 24px rgba(58,39,108,.025);
}

/* Contenido y tarjetas */
body.portal-theme main { animation:seViewIn .34s ease; }
body.portal-theme .card,
body.portal-theme .metric,
body.portal-theme .attention-card {
  border-color:var(--portal-line);
  box-shadow:var(--portal-shadow-sm);
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
body.portal-theme .card:hover,
body.portal-theme .metric:hover,
body.portal-theme .attention-card:hover {
  transform:translateY(-2px);
  border-color:#c7def5;
  box-shadow:var(--portal-shadow-hover);
}
body.portal-theme .metric { border-radius:16px; }
body.portal-theme .attention-card { border-radius:16px; }
body.portal-theme .card { border-radius:16px; }

body.portal-theme .page-title h1,
body.portal-theme h1 { color:#1d2338; letter-spacing:-.5px; }
body.portal-theme .eyebrow { color:#397bb8; letter-spacing:1.7px; }
body.portal-theme .muted { color:var(--portal-muted); }

/* Botones */
body.portal-theme .btn {
  border-radius:10px;
  border-color:#dbe5ef;
  transition:transform .17s ease,box-shadow .17s ease,background .17s ease,border-color .17s ease;
}
body.portal-theme .btn:hover { transform:translateY(-1px); box-shadow:0 8px 20px rgba(72,51,132,.08); }
body.portal-theme .btn.primary {
  color:#fff;
  border-color:#6d50dc;
  background:linear-gradient(135deg,#7659e8,#6245cf);
  box-shadow:0 9px 22px rgba(98,69,207,.20);
}
body.portal-theme .btn.primary:hover {
  background:linear-gradient(135deg,#8065ed,#5a3fc3);
  box-shadow:0 12px 28px rgba(98,69,207,.28);
}
body.portal-theme .link { color:#684bd3; }

/* Formularios */
body.portal-theme input,
body.portal-theme select,
body.portal-theme textarea,
body.portal-theme .search {
  border-color:#dedbea;
  border-radius:10px;
  transition:border-color .17s ease,box-shadow .17s ease,background .17s ease;
}
body.portal-theme input:focus,
body.portal-theme select:focus,
body.portal-theme textarea:focus,
body.portal-theme .search:focus {
  outline:none;
  border-color:#9179e6;
  box-shadow:0 0 0 3px rgba(37,116,232,.13);
}

/* Tablas */
body.portal-theme table { border-collapse:separate; border-spacing:0; }
body.portal-theme thead th { background:#faf9fe; color:#706b84; }
body.portal-theme tbody tr { transition:background .15s ease; }
body.portal-theme tbody tr:hover { background:#f5fcff; }

/* Segmentados y checks */
body.portal-theme .segmented { background:#f4f0ff; border-color:#e0d9f6; }
body.portal-theme .segmented button.active,
body.portal-theme .segmented .active { color:#563abd; background:#fff; box-shadow:0 4px 13px rgba(91,62,191,.12); }
body.portal-theme input[type="checkbox"] { accent-color:#7257e8; }

/* Gantt: NO uniformar colores de estado. Solo profundidad y legibilidad. */
body.portal-theme .gantt-card { box-shadow:var(--portal-shadow); }
body.portal-theme .gantt-track.selected { background:rgba(114,87,232,.055); }
body.portal-theme .gantt-bar {
  box-shadow:0 3px 10px rgba(49,42,73,.09);
  transition:transform .16s ease,filter .16s ease,box-shadow .16s ease;
}
body.portal-theme .gantt-bar:hover {
  transform:translateY(-1px);
  filter:saturate(1.08);
  box-shadow:0 6px 15px rgba(49,42,73,.15);
}
body.portal-theme .today-line { background:#8a70e8; box-shadow:0 0 0 1px rgba(138,112,232,.08); }
body.portal-theme .today-line::before { background:#8a70e8; }

/* Modales / drawer */
body.portal-theme .modal-card,
body.portal-theme .drawer,
body.portal-theme dialog {
  border-radius:18px;
  border-color:#dfe6ef;
  box-shadow:0 28px 80px rgba(25,45,77,.18);
}

/* Estados y notas */
body.portal-theme .success-note { border:1px solid #cdeedd; box-shadow:0 8px 20px rgba(32,169,107,.07); }
body.portal-theme .error-box { box-shadow:0 8px 20px rgba(236,83,97,.06); }

@keyframes seBlueFlow {
  0%   { background-position: 80% 0%,   -12% 88%, 112% 108%, 0% 0%; }
  25%  { background-position: 68% 10%,  2% 74%,  96% 92%,  22% 18%; }
  50%  { background-position: 82% 18%,  15% 60%,  84% 78%,  45% 42%; }
  75%  { background-position: 92% 8%,   5% 68%,  92% 70%,  72% 65%; }
  100% { background-position: 74% -4%, -8% 82%, 108% 86%, 100% 100%; }
}

@keyframes seViewIn { from { opacity:0; transform:translateY(5px) } to { opacity:1; transform:none } }
@keyframes seLogoSpin {
  from { rotate:0deg; }
  to   { rotate:360deg; }
}

@media (prefers-reduced-motion: reduce) {
  body.portal-theme .sidebar,
  body.portal-theme main,
  body.portal-theme .sidebar::before,
  body.portal-theme .sidebar::after { animation:none !important; }
  body.portal-theme .card,
  body.portal-theme .metric,
  body.portal-theme .attention-card,
  body.portal-theme .btn,
  body.portal-theme .gantt-bar { transition:none !important; }
}

@media (max-width:760px) {
  body.portal-theme .sidebar { background:linear-gradient(160deg,#f5fcff 0%,#dff4ff 100%); }
  body.portal-theme .topbar { backdrop-filter:blur(10px); }
}

/* 1.0.32 — KPI cards: contenido centrado sin alterar dimensiones ni layout */
body.portal-theme .metrics .metric {
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
}
body.portal-theme .metrics .metric-label {
  width:100%;
  text-align:center;
}
body.portal-theme .metrics .metric > strong {
  width:100%;
  text-align:center;
}
