/* ─────────────────────────────────────────────────────────────
   SentinelIQ — Design tokens
   Scoped to .soc so they don't bleed into the design-canvas chrome.
   ───────────────────────────────────────────────────────────── */
.soc {
  /* ── Surface (monocromo negro) ───────────────────────── */
  --bg:        #000000;          /* negro puro */
  --surface:   #0a0a0a;          /* paneles */
  --surface-2: #141414;          /* hover, elevado */
  --surface-3: #1c1c1c;          /* niveles más altos */
  --code-bg:   #050505;          /* code blocks */

  --border:        rgba(255,255,255,.10);
  --border-strong: rgba(255,255,255,.18);
  --border-focus:  rgba(255,255,255,.55);

  /* ── Text ──────────────────────────────────────────────── */
  --text:       #ffffff;         /* blanco puro */
  --text-2:     #e5e5e5;
  --muted:      #a3a3a3;
  --muted-2:    #737373;

  /* ── Accent (mono: blanco) ─────────────────────────────── */
  --accent:        #ffffff;
  --accent-soft:   rgba(255,255,255,.08);
  --accent-ring:   rgba(255,255,255,.30);
  --ai:            #d4d4d4;       /* AI Studio: gris claro distintivo */
  --ai-soft:       rgba(212,212,212,.12);

  /* ── Semantics ─────────────────────────────────────────── */
  --ok:        #22c55e;
  --ok-soft:   rgba(34,197,94,.16);
  --warn:      #fbbf24;
  --warn-soft: rgba(251,191,36,.16);
  --crit:      #ef4444;
  --crit-soft: rgba(239,68,68,.18);
  --info:      #22d3ee;
  --info-soft: rgba(34,211,238,.15);

  /* ── Org areas ─────────────────────────────────────────── */
  --org-fin:   #22c55e;
  --org-rrhh:  #f97316;
  --org-leg:   #a855f7;
  --org-ops:   #06b6d4;
  --org-ti:    #3b82f6;
  --org-com:   #ec4899;
  --org-cml:   #ef4444;
  --org-dir:   #eab308;

  /* ── Type ──────────────────────────────────────────────── */
  --font-ui:      "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --fs-micro: 10px;
  --fs-body:  12px;
  --fs-h3:    13px;
  --fs-h2:    16px;
  --fs-h1:    22px;
  --fs-kpi:   34px;

  /* ── Radius / shadow ───────────────────────────────────── */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 10px;
  --r-pill: 99px;

  --sh-card:  0 1px 0 rgba(255,255,255,.03) inset, 0 1px 2px rgba(0,0,0,.4);
  --sh-pop:   0 8px 32px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.06);
  --sh-glow-crit: 0 0 0 4px color-mix(in oklab, var(--crit) 18%, transparent);

  /* ── Motion ────────────────────────────────────────────── */
  --t-fast: 120ms;
  --t-base: 160ms;
  --t-slow: 220ms;
  --ease:   cubic-bezier(.2,.6,.2,1);
}

/* ── Resets scoped to .soc ─────────────────────────────────── */
.soc, .soc * {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.soc {
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
  font-feature-settings: "cv11", "ss01", "ss03";
  letter-spacing: -0.005em;
}
.soc button {
  font-family: inherit; font-size: inherit;
  color: inherit; background: transparent; border: 0; padding: 0;
  cursor: pointer;
}
.soc input, .soc textarea, .soc select {
  font-family: inherit; font-size: inherit; color: inherit;
  background: transparent; border: 0; outline: 0;
}
.soc h1, .soc h2, .soc h3, .soc h4, .soc p { margin: 0; }
.soc ::selection { background: var(--accent-soft); color: #fff; }

/* ── Primitives ────────────────────────────────────────────── */
.soc .mono { font-family: var(--font-mono); }
.soc .display { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; }
.soc .micro { font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 500; }
.soc .h1 { font-family: var(--font-display); font-size: var(--fs-h1); font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.soc .h2 { font-size: var(--fs-h2); font-weight: 600; letter-spacing: -0.01em; }
.soc .h3 { font-size: var(--fs-h3); font-weight: 600; }

/* ── Card / panel ──────────────────────────────────────────── */
.soc .panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
}
.soc .panel-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.soc .panel-hd .title { font-size: var(--fs-h3); font-weight: 600; letter-spacing: -0.005em; }
.soc .panel-hd .sub   { font-size: var(--fs-micro); color: var(--muted); }
.soc .panel-body { padding: 14px; }

/* ── Status dot ────────────────────────────────────────────── */
.soc .dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted); flex: none;
  box-shadow: 0 0 0 0 transparent;
}
.soc .dot.ok   { background: var(--ok);   box-shadow: 0 0 0 3px color-mix(in oklab, var(--ok)   40%, transparent); }
.soc .dot.crit { background: var(--crit); box-shadow: 0 0 0 3px color-mix(in oklab, var(--crit) 40%, transparent); animation: dotpulse 1.2s ease-out infinite; }
.soc .dot.warn { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in oklab, var(--warn) 35%, transparent); }
.soc .dot.info { background: var(--info); box-shadow: 0 0 0 3px color-mix(in oklab, var(--info) 35%, transparent); }
.soc .dot.live { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); animation: dotpulse 1.4s ease-out infinite; }
@keyframes dotpulse {
  0%   { box-shadow: 0 0 0 0   color-mix(in oklab, currentColor 60%, transparent); }
  100% { box-shadow: 0 0 0 7px color-mix(in oklab, currentColor 0%,  transparent); }
}

/* ── Pill / badge ──────────────────────────────────────────── */
.soc .pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: var(--r-pill);
  font-size: var(--fs-micro); font-weight: 600; letter-spacing: .04em;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.soc .pill.ok    { background: color-mix(in oklab, var(--ok)   22%, transparent); border-color: color-mix(in oklab, var(--ok)   55%, transparent); color: #86efac; }
.soc .pill.warn  { background: color-mix(in oklab, var(--warn) 22%, transparent); border-color: color-mix(in oklab, var(--warn) 55%, transparent); color: #fcd34d; }
.soc .pill.crit  { background: color-mix(in oklab, var(--crit) 22%, transparent); border-color: color-mix(in oklab, var(--crit) 55%, transparent); color: #fca5a5; }
.soc .pill.info  { background: color-mix(in oklab, var(--info) 22%, transparent); border-color: color-mix(in oklab, var(--info) 55%, transparent); color: #67e8f9; }
.soc .pill.accent{ background: var(--accent-soft); border-color: var(--accent-ring); color: var(--accent); }
.soc .pill.ai    { background: var(--ai-soft);     border-color: color-mix(in oklab, var(--ai) 55%, transparent); color: #c4b5fd; }
.soc .pill.ghost { background: transparent; }

/* ── Buttons ──────────────────────────────────────────────── */
.soc .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 28px; padding: 0 12px;
  border-radius: var(--r-md);
  font-size: var(--fs-body); font-weight: 500;
  border: 1px solid var(--border-strong);
  background: rgba(255,255,255,.04);
  color: var(--text);
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
  white-space: nowrap;
}
.soc .btn:hover { background: rgba(255,255,255,.08); }
.soc .btn.primary {
  background: var(--accent);
  color: #051022;
  border-color: transparent;
  font-weight: 600;
}
.soc .btn.primary:hover { filter: brightness(1.08); }
.soc .btn.ai {
  background: linear-gradient(180deg, color-mix(in oklab, var(--ai) 90%, white 0%), var(--ai));
  color: #fff; border-color: transparent; font-weight: 600;
}
.soc .btn.ghost { background: transparent; }
.soc .btn.danger { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.35); color: #ffffff; }
.soc .btn.sm { height: 24px; padding: 0 8px; font-size: 11px; }
.soc .btn.icon { width: 28px; padding: 0; }
.soc .btn:disabled { opacity: .45; cursor: not-allowed; }

/* ── Inputs ───────────────────────────────────────────────── */
.soc .input, .soc .field {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--r-md);
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  color: var(--text);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.soc .input:focus, .soc .field:focus {
  border-color: var(--border-focus);
  background: rgba(255,255,255,.05);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 18%, transparent);
}
.soc .input::placeholder { color: var(--muted-2); }
.soc .input.sm { height: 26px; font-size: 11.5px; }

/* ── Table ────────────────────────────────────────────────── */
.soc table.dense {
  width: 100%; border-collapse: collapse; font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.soc table.dense th {
  text-align: left; font-weight: 500;
  color: var(--muted); font-size: 10.5px; letter-spacing: .04em;
  text-transform: uppercase;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.015);
  white-space: nowrap;
}
.soc table.dense td {
  padding: 0 12px; height: 36px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  color: var(--text-2);
  vertical-align: middle;
  white-space: nowrap;
}
.soc table.dense tr:hover td { background: rgba(255,255,255,.025); }
.soc table.dense tr:last-child td { border-bottom: 0; }

/* ── KPI / Stat card ─────────────────────────────────────── */
.soc .kpi {
  position: relative;
  padding: 14px 16px 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.soc .kpi::before {
  content: ""; position: absolute; top: 12px; bottom: 12px; left: 0;
  width: 3px; border-radius: 0 2px 2px 0;
  background: var(--muted);
}
.soc .kpi.ok::before   { background: var(--ok); }
.soc .kpi.crit::before { background: var(--crit); }
.soc .kpi.warn::before { background: var(--warn); }
.soc .kpi.info::before { background: var(--info); }
.soc .kpi.accent::before { background: var(--accent); }
.soc .kpi .label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); font-weight: 500;
}
.soc .kpi .value {
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--fs-kpi); line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}
.soc .kpi .sub {
  margin-top: 6px;
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--muted);
}
.soc .delta.up   { color: var(--ok); }
.soc .delta.down { color: var(--crit); }
.soc .delta { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ── Code block ───────────────────────────────────────────── */
.soc .code {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-2);
  line-height: 1.55;
  white-space: pre;
  overflow: auto;
}
.soc .code .ln { color: var(--muted-2); padding-right: 12px; user-select: none; }
.soc .code .c-key  { color: #c4b5fd; }
.soc .code .c-str  { color: #86efac; }
.soc .code .c-num  { color: #fcd34d; }
.soc .code .c-com  { color: var(--muted-2); font-style: italic; }
.soc .code .c-ip   { color: var(--accent); }

/* ── Skeleton shimmer ────────────────────────────────────── */
.soc .skl {
  background: linear-gradient(90deg, rgba(255,255,255,.04) 0%, rgba(255,255,255,.1) 50%, rgba(255,255,255,.04) 100%);
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Misc ─────────────────────────────────────────────────── */
.soc .divider { height: 1px; background: var(--border); margin: 0; }
.soc .v-divider { width: 1px; align-self: stretch; background: var(--border); }
.soc .row { display: flex; align-items: center; gap: 8px; }
.soc .col { display: flex; flex-direction: column; }
.soc .grow { flex: 1; min-width: 0; }
.soc .nowrap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Icon stroke uses currentColor; size via width attr */
.soc svg.ico { display: inline-block; vertical-align: middle; flex: none; }
