/* ═══════════════════════════════════════════════════════════════════
   Spotlight — Universal Component Library
   Все переиспользуемые UI-компоненты. Подключён глобально в _Layout.
   Использует CSS-переменные из soc.css.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Global input placeholder fix ──────────────────────────────── */
::placeholder { color: var(--soc-text-muted) !important; opacity: 1; }

/* ═══════════════════════════════════════════════════════════════════
   1. BADGES
   ─────────────────────────────────────────────────────────────────
   Base:   <span class="soc-badge sev-critical">Critical</span>
   + dot:  <span class="soc-badge sev-active"><i class="bd"></i>Active</span>
   ═══════════════════════════════════════════════════════════════════ */

.soc-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--soc-badge-radius);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .4px;
  white-space: nowrap;
  line-height: 1.6;
  /* inset тени работают в dark mode — создают рельеф на самом бейдже */
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.13),
    inset 0 -1px 0 rgba(0,0,0,.22),
    0 1px 2px rgba(0,0,0,.45);
}

/* ── Dot inside badge ── */
.soc-badge .bd {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
  flex-shrink: 0;
}

/* ── Severity variants ── */
.soc-badge.sev-critical { background: var(--soc-critical-bg); color: var(--soc-critical); border: 1px solid rgba(248,81,73,.4); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), inset 0 -1px 0 rgba(0,0,0,.2), 0 0 6px rgba(248,81,73,.25); }
.soc-badge.sev-high     { background: var(--soc-high-bg);     color: var(--soc-high);     border: 1px solid rgba(227,179,65,.4); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), inset 0 -1px 0 rgba(0,0,0,.2), 0 0 6px rgba(227,179,65,.22); }
.soc-badge.sev-medium   { background: var(--soc-medium-bg);   color: var(--soc-medium);   border: 1px solid rgba(210,153,34,.4); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), inset 0 -1px 0 rgba(0,0,0,.2), 0 0 6px rgba(210,153,34,.22); }
.soc-badge.sev-low      { background: var(--soc-low-bg);      color: var(--soc-low);      border: 1px solid rgba(56,139,253,.4);  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), inset 0 -1px 0 rgba(0,0,0,.2), 0 0 6px rgba(56,139,253,.2); }
.soc-badge.sev-info     { background: var(--soc-low-bg);      color: var(--soc-accent);   border: 1px solid rgba(56,139,253,.4);  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), inset 0 -1px 0 rgba(0,0,0,.2), 0 0 6px rgba(56,139,253,.2); }

/* ── Lifecycle / status variants ── */
.soc-badge.ls-active    { background: var(--soc-ok-bg);       color: var(--soc-ok);         border: 1px solid rgba(63,185,80,.4);   box-shadow: inset 0 1px 0 rgba(255,255,255,.1), inset 0 -1px 0 rgba(0,0,0,.2), 0 0 7px rgba(63,185,80,.3); }
.soc-badge.ls-shadow    { background: var(--soc-medium-bg);   color: var(--soc-medium);     border: 1px solid rgba(210,153,34,.4);  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), inset 0 -1px 0 rgba(0,0,0,.2), 0 0 7px rgba(210,153,34,.3); }
.soc-badge.ls-draft     { background: rgba(139,148,158,.1);   color: var(--soc-text-muted); border: 1px solid rgba(139,148,158,.3); box-shadow: inset 0 1px 0 rgba(255,255,255,.06), inset 0 -1px 0 rgba(0,0,0,.2); }
.soc-badge.ls-disabled  { background: var(--soc-critical-bg); color: var(--soc-critical);   border: 1px solid rgba(248,81,73,.3);   box-shadow: inset 0 1px 0 rgba(255,255,255,.08), inset 0 -1px 0 rgba(0,0,0,.2); }
.soc-badge.ls-validated,.soc-badge.ls-simulated {
  background: var(--soc-low-bg); color: var(--soc-accent); border: 1px solid rgba(56,139,253,.35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), inset 0 -1px 0 rgba(0,0,0,.2), 0 0 5px rgba(56,139,253,.2);
}

/* Animated dot for live states */
.soc-badge.ls-active .bd   { animation: bd-pulse 1.4s infinite; box-shadow: 0 0 5px var(--soc-ok); }
.soc-badge.ls-shadow .bd   { animation: bd-pulse 2s   infinite; box-shadow: 0 0 5px var(--soc-medium); }
@keyframes bd-pulse { 0%,100%{opacity:1} 50%{opacity:.25} }

/* ── Generic / neutral ── */
.soc-badge.bd-ok      { background: var(--soc-ok-bg);       color: var(--soc-ok);         border: 1px solid rgba(63,185,80,.4);   box-shadow: inset 0 1px 0 rgba(255,255,255,.1), inset 0 -1px 0 rgba(0,0,0,.2), 0 0 6px rgba(63,185,80,.25); }
.soc-badge.bd-warn    { background: var(--soc-high-bg);     color: var(--soc-high);       border: 1px solid rgba(227,179,65,.4);  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), inset 0 -1px 0 rgba(0,0,0,.2), 0 0 6px rgba(227,179,65,.22); }
.soc-badge.bd-err     { background: var(--soc-critical-bg); color: var(--soc-critical);   border: 1px solid rgba(248,81,73,.4);   box-shadow: inset 0 1px 0 rgba(255,255,255,.1), inset 0 -1px 0 rgba(0,0,0,.2), 0 0 6px rgba(248,81,73,.25); }
.soc-badge.bd-neutral { background: rgba(139,148,158,.1);   color: var(--soc-text-muted); border: 1px solid rgba(139,148,158,.25); box-shadow: inset 0 1px 0 rgba(255,255,255,.06), inset 0 -1px 0 rgba(0,0,0,.18); }
.soc-badge.bd-accent  { background: var(--soc-accent-dim);  color: var(--soc-accent);     border: 1px solid rgba(56,139,253,.35); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), inset 0 -1px 0 rgba(0,0,0,.2), 0 0 6px rgba(56,139,253,.2); }

/* ── Global tag (e.g. "global", "system") ── */
.soc-tag-global {
  display: inline-block; font-size: 10px; padding: 1px 5px; border-radius: var(--soc-badge-radius);
  background: rgba(56,139,253,.1); color: var(--soc-accent);
  border: 1px solid rgba(56,139,253,.25); margin-left: 5px; vertical-align: middle;
  font-weight: 600; text-transform: uppercase; letter-spacing: .3px;
}

/* ═══════════════════════════════════════════════════════════════════
   2. RISK SCORE CHIP
   ─────────────────────────────────────────────────────────────────
   <span class="soc-risk risk-crit">87</span>
   ═══════════════════════════════════════════════════════════════════ */

.soc-risk {
  font-size: 11px;
  font-family: var(--soc-mono);
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--soc-badge-radius);
  white-space: nowrap;
  display: inline-block;
}
.soc-risk.risk-crit { background: var(--soc-critical-bg); color: var(--soc-critical); border: 1px solid rgba(248,81,73,.35); }
.soc-risk.risk-high { background: var(--soc-high-bg);     color: var(--soc-high);     border: 1px solid rgba(227,179,65,.35); }
.soc-risk.risk-med  { background: var(--soc-medium-bg);   color: var(--soc-medium);   border: 1px solid rgba(210,153,34,.35); }
.soc-risk.risk-low  { background: var(--soc-ok-bg);       color: var(--soc-ok);       border: 1px solid rgba(63,185,80,.35); }

/* Colored tag: any color, one look. The color is the only thing a page passes:
   <span class="soc-tag" style="--c:#58a6ff">Mobile</span>   (tint background, 35% border)
   Use it instead of page-local *-badge classes and inline background/color/border triples. */
.soc-tag {
  --c: var(--soc-text-muted);
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 7px; border-radius: var(--soc-badge-radius);
  font-size: 10px; font-weight: 600; line-height: 1.6; white-space: nowrap; vertical-align: middle;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
}
.soc-tag[role="button"] { cursor: pointer; }
.soc-tag[role="button"]:hover { background: color-mix(in srgb, var(--c) 22%, transparent); }

/* ISP / tenant tag shown in a table cell */
.isp-badge {
  display: inline-block; padding: 2px 8px; border-radius: var(--soc-badge-radius);
  font-family: var(--soc-mono); font-weight: 600; letter-spacing: .2px; white-space: nowrap;
  background: #1a3a5c; color: #79c0ff; border: 1px solid #388bfd55;
}

/* ═══════════════════════════════════════════════════════════════════
   2b. KEY–VALUE LIST  (profile / attribute cards)
   ─────────────────────────────────────────────────────────────────
   <div class="soc-kv-group">
     <div class="soc-kv"><span class="k">Name</span><span class="v">Value</span></div>
   </div>
   <div class="soc-kv-note">long free text (narrative, summary)</div>
   Same font as tables: 11px system-ui; label muted, value bold.
   ═══════════════════════════════════════════════════════════════════ */
.soc-kv {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 4px 0; border-bottom: 1px solid var(--soc-border);
  font-family: var(--soc-ui-font); font-size: 11px; font-variant-numeric: tabular-nums;
}
.soc-kv:last-child { border-bottom: none; }
.soc-kv .k { color: var(--soc-text-muted); flex-shrink: 0; }
.soc-kv .v { color: var(--soc-text); font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.soc-kv-group + .soc-kv-group { margin-top: 10px; }
.soc-kv-note {
  font-size: .72rem; line-height: 1.55; color: var(--soc-text-muted);
  white-space: pre-wrap; padding: 6px 0 4px;
}

/* ═══════════════════════════════════════════════════════════════════
   3. STAT TILES  (mini KPI cards in toolbars / page tops)
   ─────────────────────────────────────────────────────────────────
   <div class="soc-stat-bar">
     <div class="soc-stat">
       <div class="sv" style="color:var(--soc-ok)">42</div>
       <div class="sl">Active</div>
     </div>
   </div>
   ═══════════════════════════════════════════════════════════════════ */

.soc-stat-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.soc-stat {
  background: var(--soc-surface-2);
  border: 1px solid var(--soc-border-2);
  border-radius: 7px;
  padding: .4rem .9rem;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 72px;
  text-align: center;
}

.soc-stat .sv {
  font-size: 1.25rem;
  font-weight: 700;
  font-family: var(--soc-mono);
  line-height: 1.1;
  color: var(--soc-text);
}

.soc-stat .sl {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--soc-text-muted);
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════
   4. FILTER TAB BAR  (category tabs with count badges)
   ─────────────────────────────────────────────────────────────────
   <div class="soc-tab-bar">
     <a href="?cat=ids" class="soc-tab-btn active">IDS <span class="tc">23</span></a>
     <a href="?cat=behavioral" class="soc-tab-btn">Behavioral <span class="tc">16</span></a>
   </div>
   ═══════════════════════════════════════════════════════════════════ */

.soc-tab-bar {
  display: flex;
  gap: 2px;
  background: var(--soc-surface-2);
  border: 1px solid var(--soc-border);
  border-radius: 6px;
  padding: 3px;
  flex-wrap: wrap;
}

.soc-tab-btn {
  font-size: 12px;
  font-weight: 600;
  padding: .28rem .9rem;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--soc-text-muted);
  cursor: pointer;
  transition: background .12s, color .12s;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.soc-tab-btn:hover:not(.active) {
  background: rgba(56,139,253,.1);
  color: var(--soc-accent);
  text-decoration: none;
}

.soc-tab-btn.active {
  background: var(--soc-accent);
  color: #fff;
  text-decoration: none;
}

/* count badge inside tab */
.soc-tab-btn .tc {
  font-size: 10px;
  font-weight: 600;
  background: rgba(139,148,158,.22);
  color: var(--soc-text-muted);
  padding: 0 5px;
  border-radius: 3px;
  min-width: 18px;
  text-align: center;
  line-height: 1.7;
}
.soc-tab-btn.active .tc {
  background: rgba(255,255,255,.2);
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════════════
   5. ICON ACTION BUTTONS  (table row actions with tooltip)
   ─────────────────────────────────────────────────────────────────
   <div class="soc-actions">
     <button class="soc-icon-btn"         data-tip="Edit"><i class="bi bi-pencil-square"></i></button>
     <button class="soc-icon-btn ok"      data-tip="Activate"><i class="bi bi-arrow-up-circle"></i></button>
     <button class="soc-icon-btn warn"    data-tip="Deactivate"><i class="bi bi-pause-circle"></i></button>
     <button class="soc-icon-btn danger"  data-tip="Delete"><i class="bi bi-trash3"></i></button>
   </div>
   ═══════════════════════════════════════════════════════════════════ */

.soc-actions {
  display: flex;
  gap: 2px;
  align-items: center;
  justify-content: flex-end;
}

.soc-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border: none;
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  color: var(--soc-text-muted);
  font-size: 14px;
  transition: background .12s, color .12s;
  text-decoration: none;
  flex-shrink: 0;
}

.soc-icon-btn:hover         { background: rgba(56,139,253,.12);  color: var(--soc-accent); }
.soc-icon-btn.ok:hover      { background: rgba(63,185,80,.12);   color: var(--soc-ok); }
.soc-icon-btn.warn:hover    { background: rgba(210,153,34,.12);  color: var(--soc-medium); }
.soc-icon-btn.danger:hover  { background: rgba(248,81,73,.12);   color: var(--soc-critical); }

/* Tooltip via data-tip attribute */
.soc-icon-btn::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--soc-surface-2);
  color: var(--soc-text);
  font-size: 11px;
  white-space: nowrap;
  padding: 3px 7px;
  border-radius: 4px;
  border: 1px solid var(--soc-border);
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
  z-index: 300;
}
.soc-icon-btn:hover::after { opacity: 1; }

/* ── 5b. BORDERED ICON BUTTON  (row / card actions, one look on every page)
   ─────────────────────────────────────────────────────────────────
   Same look as the Edit / Clone buttons of the DLP policy list. The hint is the native title, not data-tip.
   <button class="soc-icon-btn bordered" title="Edit" aria-label="Edit"><i class="bi bi-pencil"></i></button>
   <button class="soc-icon-btn bordered danger" title="Delete" aria-label="Delete"><i class="bi bi-trash"></i></button>
   (.dlp-icon-btn in dlp.css is an alias of this look.) */
.soc-icon-btn.bordered {
  width: auto; height: auto;
  padding: 2px 7px;
  font-size: .75rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 5px;
  background: transparent;
  color: var(--bs-body-color);
}
.soc-icon-btn.bordered:hover        { border-color: var(--soc-accent);   color: var(--soc-accent);   background: transparent; }
.soc-icon-btn.bordered.ok:hover     { border-color: var(--soc-ok);       color: var(--soc-ok);       background: transparent; }
.soc-icon-btn.bordered.warn:hover   { border-color: var(--soc-medium);   color: var(--soc-medium);   background: transparent; }
.soc-icon-btn.bordered.danger:hover { border-color: var(--soc-critical); color: var(--soc-critical); background: transparent; }
.soc-icon-btn.bordered::after       { display: none; }
.soc-icon-btn.bordered:focus-visible { outline: 2px solid var(--soc-accent); outline-offset: 1px; }

/* ── 5c. UNSAVED CHANGES  (js/dirty-guard.js: Save button + the "Unsaved changes" note next to it) */
.btn-soc.primary.is-dirty { box-shadow: 0 0 0 3px var(--soc-accent-dim); }
.gen-save-msg.dirty, .soc-save-msg.dirty { color: var(--soc-medium); }
.soc-save-msg { font-size: .7rem; transition: opacity .3s; }
.soc-save-msg.ok { color: var(--soc-ok); }
.soc-save-msg.err { color: var(--soc-critical); }

/* Divider between button groups */
.soc-icon-divider {
  width: 1px; height: 18px;
  background: var(--soc-border);
  margin: 0 2px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   6. CARD / SECTION LABELS
   ─────────────────────────────────────────────────────────────────
   <div class="soc-sect-lbl">Configuration</div>
   <div class="soc-sect-lbl accent">Live Events</div>
   ═══════════════════════════════════════════════════════════════════ */

.soc-sect-lbl {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--soc-text-muted);
  margin-bottom: 10px;
}

.soc-sect-lbl.accent { color: var(--soc-accent); }

/* ═══════════════════════════════════════════════════════════════════
   7. KEY-VALUE ROWS
   ─────────────────────────────────────────────────────────────────
   <div class="soc-kv-grid">
     <div class="soc-kv"><span class="k">Tenant</span><span class="v">isp1</span></div>
   </div>
   ═══════════════════════════════════════════════════════════════════ */

.soc-kv-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 5px 12px;
  align-items: center;
}

.soc-kv {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 12.5px;
}

.soc-kv .k {
  color: var(--soc-text-muted);
  font-size: 11px;
  min-width: 130px;
  flex-shrink: 0;
}

.soc-kv .v {
  color: var(--soc-text);
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.soc-kv .v.mono { font-family: var(--soc-mono); font-size: 12px; }

/* ═══════════════════════════════════════════════════════════════════
   8. BREADCRUMB
   ─────────────────────────────────────────────────────────────────
   <nav class="soc-breadcrumb">
     <a href="/Rules">Rules</a>
     <span class="sep">/</span>
     <a href="/Rules/Detail/...">Rule name</a>
     <span class="sep">/</span>
     <span>Builder</span>
   </nav>
   ═══════════════════════════════════════════════════════════════════ */

.soc-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--soc-text-muted);
  margin-bottom: 4px;
}

.soc-breadcrumb a {
  color: var(--soc-text-muted);
  text-decoration: none;
  transition: color .12s;
}

.soc-breadcrumb a:hover { color: var(--soc-accent); }
.soc-breadcrumb .sep    { opacity: .4; }
.soc-breadcrumb span:last-child { color: var(--soc-text); }

/* ═══════════════════════════════════════════════════════════════════
   9. EMPTY STATE
   ─────────────────────────────────────────────────────────────────
   <div class="soc-empty">No rules match your search.</div>
   ═══════════════════════════════════════════════════════════════════ */

.soc-empty {
  text-align: center;
  padding: 36px 16px;
  color: var(--soc-text-muted);
  font-size: 13px;
}

.soc-empty .empty-icon {
  font-size: 28px;
  display: block;
  margin-bottom: 8px;
  opacity: .4;
}

/* ═══════════════════════════════════════════════════════════════════
   10. TABLE ROW SEVERITY BORDERS
   ─────────────────────────────────────────────────────────────────
   <tr class="soc-row sev-critical">...</tr>
   ═══════════════════════════════════════════════════════════════════ */

tr.soc-row { transition: background .1s; }
tr.soc-row:hover { background: var(--soc-surface-2); }
tr.soc-row.sev-critical { border-left: 3px solid var(--soc-critical); }
tr.soc-row.sev-high     { border-left: 3px solid var(--soc-high); }
tr.soc-row.sev-medium   { border-left: 3px solid var(--soc-medium); }
tr.soc-row.sev-low      { border-left: 3px solid var(--soc-low); }

/* ═══════════════════════════════════════════════════════════════════
   11. COST / PROGRESS BAR  (used in rules, subscribers, etc.)
   ─────────────────────────────────────────────────────────────────
   <div class="soc-bar-wrap">
     <div class="soc-bar"><div class="fill ok" style="width:30%"></div></div>
     <span class="pct">30%</span>
   </div>
   ═══════════════════════════════════════════════════════════════════ */

.soc-bar-wrap { display: flex; align-items: center; gap: 6px; }

.soc-bar {
  height: 4px;
  width: 44px;
  background: var(--soc-border);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}

.soc-bar .fill       { height: 100%; border-radius: 3px; }
.soc-bar .fill.ok    { background: var(--soc-ok); }
.soc-bar .fill.warn  { background: var(--soc-medium); }
.soc-bar .fill.err   { background: var(--soc-critical); }

.soc-bar-wrap .pct {
  font-size: 10.5px;
  color: var(--soc-text-muted);
  font-family: var(--soc-mono);
  min-width: 28px;
}

/* ═══════════════════════════════════════════════════════════════════
   12. TOOLBAR  (flex row: tab bar + search + actions)
   ─────────────────────────────────────────────────────────────────
   <div class="soc-toolbar">
     <div class="soc-tab-bar">...</div>
     <input class="soc-search" placeholder="Search..." />
     <a href="..." class="soc-tool-btn">Simulation Lab</a>
     <a href="..." class="btn-soc primary ms-auto">+ New Rule</a>
   </div>
   ═══════════════════════════════════════════════════════════════════ */

.soc-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.soc-search {
  font-size: 12px;
  padding: .3rem .7rem;
  border-radius: 5px;
  border: 1px solid var(--soc-border);
  background: var(--soc-surface-2);
  color: var(--soc-text);
  outline: none;
  width: 200px;
  transition: border-color .12s;
}
.soc-search:focus { border-color: rgba(56,139,253,.45); }

/* secondary toolbar button (outline style) */
.soc-tool-btn {
  font-size: 12px;
  font-weight: 500;
  padding: .3rem .9rem;
  border-radius: 5px;
  border: 1px solid var(--soc-border);
  background: transparent;
  color: var(--soc-text-muted);
  cursor: pointer;
  text-decoration: none;
  transition: border-color .12s, color .12s, background .12s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.soc-tool-btn:hover {
  border-color: rgba(56,139,253,.4);
  color: var(--soc-accent);
  background: rgba(56,139,253,.06);
  text-decoration: none;
}

/* ═══════════════════════════════════════════════════════════════════
   13. FORM CONTROLS  (inside cards, not login forms)
   ─────────────────────────────────────────────────────────────────
   <div class="soc-field">
     <label>Severity</label>
     <select class="soc-ctrl">...</select>
     <p class="soc-hint">Affects risk scoring.</p>
   </div>
   ═══════════════════════════════════════════════════════════════════ */

.soc-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.soc-field label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--soc-text-muted);
}

.soc-ctrl {
  background: var(--soc-surface-2);
  border: 1px solid var(--soc-border);
  color: var(--soc-text);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12.5px;
  font-family: inherit;
  transition: border-color .12s;
}
.soc-ctrl:focus { outline: none; border-color: rgba(56,139,253,.5); }

.soc-hint {
  font-size: 11px;
  color: var(--soc-text-muted);
  line-height: 1.45;
  margin: 1px 0 0;
}

/* ═══════════════════════════════════════════════════════════════════
   14. APP CATEGORY BADGE  (AppCatalog, subscriber profile)
   ─────────────────────────────────────────────────────────────────
   <span class="soc-app-cat">Social Media</span>
   ═══════════════════════════════════════════════════════════════════ */

.soc-app-cat {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 10px;
  border: 1px solid var(--soc-border);
  background: var(--soc-surface-2);
  color: var(--soc-text-muted);
  white-space: nowrap;
}

/* Per-category accent colors */
.soc-app-cat.cat-social    { border-color: rgba(56,139,253,.35);  background: rgba(56,139,253,.08);  color: var(--soc-accent); }
.soc-app-cat.cat-streaming { border-color: rgba(248,81,73,.3);    background: rgba(248,81,73,.08);   color: var(--soc-critical); }
.soc-app-cat.cat-gaming    { border-color: rgba(139,92,246,.3);   background: rgba(139,92,246,.08);  color: #9370db; }
.soc-app-cat.cat-voip      { border-color: rgba(63,185,80,.3);    background: rgba(63,185,80,.08);   color: var(--soc-ok); }
.soc-app-cat.cat-p2p       { border-color: rgba(210,153,34,.3);   background: rgba(210,153,34,.08);  color: var(--soc-medium); }
.soc-app-cat.cat-vpn       { border-color: rgba(227,179,65,.3);   background: rgba(227,179,65,.08);  color: var(--soc-high); }
.soc-app-cat.cat-security  { border-color: rgba(248,81,73,.3);    background: rgba(248,81,73,.08);   color: var(--soc-critical); }
.soc-app-cat.cat-mail      { border-color: rgba(56,139,253,.25);  background: rgba(56,139,253,.06);  color: var(--soc-accent); }

/* ═══════════════════════════════════════════════════════════════════
   15. NAME + DESCRIPTION CELL  (table primary column)
   ─────────────────────────────────────────────────────────────────
   <td>
     <div class="soc-name"><a href="...">Rule Name</a></div>
     <div class="soc-desc">Short description text here…</div>
   </td>
   ═══════════════════════════════════════════════════════════════════ */

.soc-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--soc-text);
}

.soc-name a {
  color: inherit;
  text-decoration: none;
  transition: color .12s;
}
.soc-name a:hover { color: var(--soc-accent); }

.soc-desc {
  font-size: 11px;
  color: var(--soc-text-muted);
  margin-top: 2px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════════
   16. LAST HIT / TIMESTAMP
   ─────────────────────────────────────────────────────────────────
   <span class="soc-ts">06/24 14:32</span>
   <span class="soc-ts never">never</span>
   ═══════════════════════════════════════════════════════════════════ */

.soc-ts {
  font-family: var(--soc-mono);
  font-size: 11.5px;
  color: var(--soc-text-muted);
  white-space: nowrap;
}

.soc-ts.never {
  opacity: .55;
  font-style: italic;
  font-family: inherit;
}

/* ═══════════════════════════════════════════════════════════════════
   17. SWAL2 SOC THEME  (confirmation dialogs — global)
   ═══════════════════════════════════════════════════════════════════ */

.swal-soc .swal2-popup {
  background: var(--soc-surface) !important;
  border: 1px solid var(--soc-border) !important;
  border-radius: 10px !important;
  color: var(--soc-text) !important;
  font-family: inherit !important;
}
.swal-soc .swal2-title { color: var(--soc-text) !important; font-size: 16px !important; }
.swal-soc .swal2-html-container { color: var(--soc-text-muted) !important; font-size: 13px !important; }
.swal-soc .swal2-confirm {
  background: var(--soc-accent) !important;
  border-radius: 6px !important;
  font-size: 13px !important;
  padding: 8px 18px !important;
}
.swal-soc .swal2-cancel {
  background: transparent !important;
  border: 1px solid var(--soc-border) !important;
  color: var(--soc-text-muted) !important;
  border-radius: 6px !important;
  font-size: 13px !important;
  padding: 8px 18px !important;
}
.swal-soc.danger .swal2-confirm { background: var(--soc-critical) !important; }
.swal-soc.warn   .swal2-confirm { background: var(--soc-medium)   !important; }
.swal-soc.ok     .swal2-confirm { background: var(--soc-ok)       !important; }

/* ═══════════════════════════════════════════════════════════════════
   18. ALERT — SUCCESS VARIANT  (add to soc.css soc-alert group)
   ─────────────────────────────────────────────────────────────────
   <div class="soc-alert ok">Operation successful.</div>
   ═══════════════════════════════════════════════════════════════════ */

.soc-alert.ok {
  background: var(--soc-ok-bg);
  border-color: rgba(63,185,80,.35);
  color: var(--soc-ok);
}

/* ═══════════════════════════════════════════════════════════════════
   19. SOLID BADGE VARIANTS  (filled background — roles, system labels)
   ─────────────────────────────────────────────────────────────────
   <span class="soc-badge solid-accent">admin</span>
   <span class="soc-badge solid-ok">Active</span>
   ═══════════════════════════════════════════════════════════════════ */

.soc-badge.solid-accent  { background: var(--soc-accent);   color: #fff; border-color: transparent; }
.soc-badge.solid-ok      { background: var(--soc-ok);       color: #fff; border-color: transparent; }
.soc-badge.solid-warn    { background: var(--soc-medium);   color: #fff; border-color: transparent; }
.soc-badge.solid-err     { background: var(--soc-critical); color: #fff; border-color: transparent; }
.soc-badge.solid-neutral { background: var(--soc-border-2); color: var(--soc-text-muted); border-color: transparent; }

/* ═══════════════════════════════════════════════════════════════════
   20. MODAL  (backdrop + dialog box)
   ─────────────────────────────────────────────────────────────────
   <div class="soc-modal-backdrop" id="my-modal" onclick="if(e.target===this)closeModal()">
     <div class="soc-modal" style="width:520px">
       <div class="soc-modal-hdr">
         <h2>Dialog Title</h2>
         <button class="soc-modal-close" onclick="closeModal()">✕</button>
       </div>
       <!-- content -->
       <div class="soc-modal-footer">
         <span class="flex-1"></span>
         <button class="btn-soc">Cancel</button>
         <button class="btn-soc primary">Save</button>
       </div>
     </div>
   </div>
   ═══════════════════════════════════════════════════════════════════ */

.soc-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.soc-modal-backdrop.open { display: flex; }

.soc-modal {
  background: var(--soc-surface);
  border: 1px solid var(--soc-border);
  border-radius: 10px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}

.soc-modal h2 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: var(--soc-text);
}

.soc-modal-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.soc-modal-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--soc-border);
}

.soc-modal-close {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--soc-text-muted);
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: color .12s, background .12s;
}
.soc-modal-close:hover {
  color: var(--soc-text);
  background: var(--soc-surface-2);
}

/* ── Modal form grid ── */
.soc-modal-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 520px) { .soc-modal-row { grid-template-columns: 1fr; } }

/* ═══════════════════════════════════════════════════════════════════
   21. FORM FIELD — extended  (validation error + password toggle)
   ─────────────────────────────────────────────────────────────────
   <div class="soc-field">
     <label>Password *</label>
     <div class="soc-pwd-wrap">
       <input class="soc-ctrl" type="password" id="pwd" />
       <button class="soc-pwd-eye" type="button" onclick="togglePwd('pwd',this)">
         <i class="bi bi-eye"></i>
       </button>
     </div>
     <p class="soc-field-err" style="display:none">Invalid value</p>
   </div>
   ═══════════════════════════════════════════════════════════════════ */

.soc-ctrl.error { border-color: var(--soc-critical); }

.soc-field-err {
  font-size: 11px;
  color: var(--soc-critical);
  margin: 3px 0 0;
}

.soc-pwd-wrap {
  position: relative;
}
.soc-pwd-wrap .soc-ctrl { padding-right: 36px; width: 100%; }

.soc-pwd-eye {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--soc-text-muted);
  font-size: 14px;
  padding: 2px 4px;
  line-height: 1;
  transition: color .12s;
}
.soc-pwd-eye:hover { color: var(--soc-accent); }

/* ═══════════════════════════════════════════════════════════════════
   22. MULTI-SELECT PILL TAGS  (checkbox-style selectable chips)
   ─────────────────────────────────────────────────────────────────
   <div class="soc-pills">
     <label class="soc-pill">
       <input type="checkbox" name="tenants" value="isp1" />
       isp1
     </label>
   </div>
   ═══════════════════════════════════════════════════════════════════ */

.soc-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.soc-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--soc-border);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--soc-text-muted);
  background: transparent;
  user-select: none;
  transition: border-color .12s, color .12s, background .12s;
}

.soc-pill input[type="checkbox"],
.soc-pill input[type="radio"] { display: none; }

.soc-pill:hover {
  border-color: var(--soc-accent);
  color: var(--soc-text);
}

.soc-pill.checked,
.soc-pill:has(input:checked) {
  border-color: var(--soc-accent);
  background: rgba(56,139,253,.15);
  color: var(--soc-accent);
}

/* ═══════════════════════════════════════════════════════════════════
   23. DELTA / COMPARISON STATS  (before vs after metric grid)
   ─────────────────────────────────────────────────────────────────
   <div class="soc-delta-grid">
     <div class="soc-delta"><div class="dv text-ok">-12</div><div class="dl">Alert delta</div></div>
   </div>
   ═══════════════════════════════════════════════════════════════════ */

.soc-delta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.soc-delta {
  text-align: center;
  padding: 6px 4px;
  background: var(--soc-surface-2);
  border: 1px solid var(--soc-border);
  border-radius: 6px;
}

.soc-delta .dv {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: var(--soc-text);
}

.soc-delta .dl {
  font-size: 10px;
  color: var(--soc-text-muted);
  text-transform: uppercase;
  letter-spacing: .3px;
  margin-top: 3px;
}

/* ═══════════════════════════════════════════════════════════════════
   24. SCROLLABLE CHECKBOX LIST  (rule/item picker in forms)
   ─────────────────────────────────────────────────────────────────
   <div class="soc-check-list">
     <label class="soc-check-item">
       <input type="checkbox" checked /> <span>Rule name</span>
       <span class="soc-badge bd-neutral ms-auto">IDS</span>
     </label>
   </div>
   ═══════════════════════════════════════════════════════════════════ */

.soc-check-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  border: 1px solid var(--soc-border);
  border-radius: 5px;
  padding: 7px;
  max-height: 220px;
  overflow-y: auto;
}

.soc-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  transition: background .1s;
  color: var(--soc-text);
}
.soc-check-item:hover { background: var(--soc-surface-2); }
.soc-check-item input { margin: 0; accent-color: var(--soc-accent); flex-shrink: 0; }

/* ── Shared data table (soc-table) ─────────────────────────────────────────────
   Framed, sortable, filterable list with progressive reveal. See js/soc-table.js. */
.soc-table-card {
  border: 1px solid var(--soc-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--soc-surface);
}
.soc-table-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 8px 10px;
  border-bottom: 1px solid var(--soc-border);
}
.soc-table-toolbar .soc-table-search { max-width: 280px; }
.soc-table-scroll { max-height: 72vh; overflow: auto; }
.soc-table { width: 100%; margin: 0; font-size: .78rem; }
.soc-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--soc-surface-2);
  white-space: nowrap;
}
.soc-table th[data-sort] { cursor: pointer; user-select: none; }
.soc-table th[data-sort]:hover { color: var(--soc-text); }
.soc-table .sort-icon { font-size: .65rem; color: var(--soc-text-muted); margin-left: 3px; }
.soc-table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-top: 1px solid var(--soc-border);
}
.soc-table-info { font-size: .72rem; color: var(--soc-text-muted); }

/* Sidebar nav icons: Bootstrap Icons, monochrome (inherit currentColor) */
.soc-nav a .nav-icon { display: inline-flex; align-items: center; justify-content: center; }
.soc-nav a .nav-icon .bi { font-size: 15px; line-height: 1; }

/* Panel surface (framed card). Was referenced by pages but never defined — several pages
   use <div class="soc-panel"> for a bordered block (cards, side panels). */
.soc-panel {
  background: var(--soc-surface);
  border: 1px solid var(--soc-border);
  border-radius: 10px;
  padding: 14px 16px;
}

/* Shared time-range preset buttons (Activity, and reusable elsewhere) */
.soc-time-btn { font-size:.7rem; padding:.25rem .6rem; border-radius:4px; border:1px solid var(--soc-border); background:transparent; color:var(--soc-text-muted); cursor:pointer; transition:all .15s; }
.soc-time-btn.active { background:var(--soc-accent-dim, rgba(88,166,255,.13)); color:var(--soc-accent); border-color:var(--soc-accent); }
.soc-time-btn:hover:not(.active) { color:var(--soc-text); border-color:var(--soc-accent); }

/* ═══════════════════════════════════════════════════════════════════
   25. SWITCH  (one look for every on/off toggle — Bootstrap .form-switch)
   ─────────────────────────────────────────────────────────────────
   Inline:   <label class="soc-switch form-switch">
               <input class="form-check-input" type="checkbox" /> <span>Label</span>
             </label>
   Existing  <div class="form-check form-switch"> markup gets the same look.
   Bootstrap is loaded after this file, hence the :root prefix.
   ═══════════════════════════════════════════════════════════════════ */
:root .form-switch .form-check-input {
  width: 2.5em; height: 1.35em; margin-top: 0; cursor: pointer; flex: none;
  background-color: var(--soc-surface-2);
  border: 1px solid var(--soc-border-2, var(--soc-border));
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%238b949e'/%3e%3c/svg%3e");
  transition: background-color .15s, border-color .15s, background-position .15s, box-shadow .15s;
}
:root .form-switch .form-check-input:checked {
  background-color: var(--soc-accent); border-color: var(--soc-accent);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}
:root .form-switch .form-check-input:focus {
  border-color: var(--soc-accent);
  box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--soc-accent) 22%, transparent);
}
:root .form-switch .form-check-input:focus:not(:checked) {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%238b949e'/%3e%3c/svg%3e");
}
:root .form-switch .form-check-input:disabled { opacity: .55; cursor: default; }

.soc-switch.form-switch {
  display: inline-flex; align-items: center; gap: 10px;
  padding-left: 0; margin: 0; min-height: 0; cursor: pointer;
}
:root .soc-switch.form-switch .form-check-input { float: none; margin-left: 0; }
.soc-switch:has(.form-check-input:disabled) { cursor: default; }

/* Button size step between the default and a page's main action; disabled = dimmed, not clickable */
.btn-soc.md { padding: 7px 16px; font-size: 13px; font-weight: 600; }
.btn-soc:disabled, .btn-soc.disabled { opacity: .45; cursor: default; pointer-events: none; }

/* ══ Tables: one typography on every page ════════════════════════════════════
   Every table inside a page (and the rows pages build in JS) uses the same font: 11px system-ui,
   numbers with tabular figures. Inline font sizes / families inside cells are overridden, so pages
   no longer drift apart. Deliberate exceptions, by meaning:
     small, .t-sub   — a note next to / under the value: 10px, muted
     strong, b       — an important value: same size, bold (browser default weight)
     badges          — .soc-badge, .soc-tag, .badge, .soc-risk, *-badge, *-pill, *-chip, .mini-grp: 10px,
                       and one corner radius (--soc-badge-radius) whatever the page styled them with
   Icons (.bi) keep their own size. The doubled .soc-main raises the exceptions above the reset. */
.soc-main table th,
.soc-main table td {
  font-family: var(--soc-ui-font) !important;
  font-size: 11px !important;
  font-variant-numeric: tabular-nums;
}
.soc-main table td *:not(i):not(.bi),
.soc-main table th *:not(i):not(.bi) {
  font-family: inherit !important;
  font-size: inherit !important;
}
.soc-main.soc-main table td :is(small, .t-sub),
.soc-main.soc-main table th :is(small, .t-sub) {
  font-size: 10px !important;
  color: var(--soc-text-muted);
}
.soc-main.soc-main table td :is(.soc-badge, .soc-tag, .badge, .soc-risk, .mini-grp, [class*="-badge"], [class*="-pill"], [class*="-chip"]),
.soc-main.soc-main table th :is(.soc-badge, .soc-tag, .badge, .soc-risk, .mini-grp, [class*="-badge"], [class*="-pill"], [class*="-chip"]) {
  font-size: 10px !important;
  border-radius: var(--soc-badge-radius) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   26. POLICY BLOCKS  (common "When" / "Who" of every policy and rule editor — js/policy-blocks.js)
   ═══════════════════════════════════════════════════════════════════ */
.pw { display: flex; flex-direction: column; gap: 8px; }
.pw-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pw-hint { font-size: 12px; color: var(--soc-text-muted); }
.pw-windows { display: flex; flex-direction: column; gap: 6px; }
.pw-window { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pw-window .soc-pill { padding: 3px 9px; }
.pw-window input[type="time"] { width: 110px; }
.pw-dash { color: var(--soc-text-muted); }
.pw-add { align-self: flex-start; }
.pw-dates { display: flex; gap: 12px; flex-wrap: wrap; }
.pw-date { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--soc-text-muted); }
.pw-date input { width: 200px; }
.pw-err { font-size: 12px; color: var(--soc-danger, #f85149); min-height: 0; }
.pw-err:empty { display: none; }
.pk { display: flex; flex-direction: column; gap: 4px; }
.pk-label { font-size: 12px; font-weight: 600; margin-top: 4px; }
.pk-hint { font-size: 12px; color: var(--soc-text-muted); }
.pk-check { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 4px 0; }
.pk-pick { position: relative; }
.pk-chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-height: 32px; padding: 3px 6px;
  border: 1px solid var(--soc-border); border-radius: 6px; background: var(--bs-body-bg); }
.pk-chips input { border: none; outline: none; background: transparent; color: inherit; flex: 1; min-width: 140px; font-size: 13px; }
.pk-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px;
  background: color-mix(in srgb, var(--soc-accent) 16%, transparent); }
.pk-chip button { border: none; background: none; color: var(--soc-text-muted); padding: 0; line-height: 1; cursor: pointer; }
.pk-results { position: absolute; z-index: 1060; left: 0; right: 0; top: 100%; max-height: 220px; overflow: auto; margin-top: 2px;
  background: var(--soc-surface); border: 1px solid var(--soc-border); border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.pk-results div { padding: 6px 10px; font-size: 12.5px; cursor: pointer; }
.pk-results div:hover { background: var(--soc-surface-2); }
.pk-results small { color: var(--soc-text-muted); margin-left: 6px; }
.pk-except summary { font-size: 12px; color: var(--soc-text-muted); cursor: pointer; margin-top: 4px; }
.pk-except .pk-pick { margin-top: 6px; }

/* ═══════════════════════════════════════════════════════════════════
   Enterprise configuration pages (Assets, Access, Integrations, Add device)
   Dialog, section titles, tiles, key/value lists, tabs of a card.
   ═══════════════════════════════════════════════════════════════════ */
.ent-modal .modal-content { background: var(--soc-surface); border: 1px solid var(--soc-border); color: var(--bs-body-color); }
.ent-modal .modal-header, .ent-modal .modal-footer { background: var(--soc-surface-2); border-color: var(--soc-border); }
.ent-modal .modal-title { font-size: 14px; font-weight: 700; }
.ent-sec { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--soc-text-muted); margin: 14px 0 8px; }
.ent-sec:first-child { margin-top: 0; }
.ent-label { font-size: 12px; font-weight: 600; margin-bottom: 4px; display: block; }
.ent-hint { font-size: 12px; color: var(--soc-text-muted); margin-top: 3px; }
.ent-err { font-size: 13px; color: var(--soc-critical); min-height: 1.2em; }
.ent-field { margin-bottom: 12px; }
.ent-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.ent-note { font-size: 12px; color: var(--soc-text-muted); }
.ent-mono { font-family: var(--soc-mono, monospace); font-size: 11.5px; }
.ent-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.ent-tile { border: 1px solid var(--soc-border); border-radius: 8px; padding: 12px 14px; cursor: pointer; background: var(--soc-surface); text-align: left; color: inherit; }
.ent-tile:hover { border-color: var(--soc-accent); background: var(--soc-surface-2); }
.ent-tile .t { font-weight: 700; font-size: 13px; display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.ent-tile .d { font-size: 12px; color: var(--soc-text-muted); line-height: 1.4; }
.ent-kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 12px; font-size: 12.5px; align-items: baseline; }
.ent-kv .k { color: var(--soc-text-muted); }
.ent-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--soc-border); margin-bottom: 14px; flex-wrap: wrap; }
.ent-tabs button { border: none; background: transparent; color: var(--soc-text-muted); font-size: 12.5px; padding: 7px 12px; border-bottom: 2px solid transparent; cursor: pointer; }
.ent-tabs button.active { color: var(--soc-accent); border-bottom-color: var(--soc-accent); font-weight: 600; }
.ent-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: color-mix(in srgb, var(--soc-accent) 16%, transparent); margin: 0 4px 4px 0; }
.ent-chip button { border: none; background: none; color: var(--soc-text-muted); padding: 0; line-height: 1; cursor: pointer; }
.ent-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ent-tbl th { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--soc-text-muted); font-weight: 600; padding: 7px 10px; border-bottom: 1px solid var(--soc-border); text-align: left; white-space: nowrap; }
.ent-tbl td { padding: 8px 10px; border-bottom: 1px solid var(--soc-border); vertical-align: middle; }
.ent-tbl tr.click { cursor: pointer; }
.ent-tbl tr.click:hover td { background: rgba(88,166,255,.04); }
.ent-tbl .num { text-align: right; font-family: var(--soc-mono, monospace); }
.ent-demo { display: inline-block; font-size: 10.5px; padding: 0 6px; border-radius: 4px; border: 1px solid var(--soc-border); color: var(--soc-text-muted); margin-left: 6px; text-transform: uppercase; letter-spacing: .04em; }
.ent-seg { display: flex; gap: 2px; flex-wrap: wrap; }
.ent-seg button { font-size: .72rem; padding: .25rem .65rem; border-radius: 4px; border: 1px solid var(--soc-border); background: transparent; color: var(--soc-text-muted); cursor: pointer; }
.ent-seg button.active { background: #58a6ff22; color: #58a6ff; border-color: #58a6ff55; }
.ent-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }

/* Page banner: "not enforced yet" / "demo data" (Pages/Shared/_StatusBanner.cshtml) */
.soc-banner { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; margin-bottom: 12px; font-size: 12.5px; line-height: 1.45;
    background: var(--soc-surface); border: 1px solid var(--soc-border); border-left: 4px solid var(--c, var(--soc-border)); border-radius: 8px; }
.soc-banner > .bi { color: var(--c); font-size: 16px; margin-top: 1px; }
.soc-banner-not_enforced { --c: #d29922; }
.soc-banner-demo { --c: #8b949e; }

/* ═══════════════════════════════════════════════════════════════════
   26. RESPONSE RULES AND ORDER PROPOSALS  (adaptive Kill Switch)
   ─────────────────────────────────────────────────────────────────
   Policies → Response rules (rsp-*), the proposals block on Orders and in an incident (prop-*), the menu counter and the
   pop-up (nav-prop-badge, prop-toast*). Dialog styles of the proposals come from _EnforcementOrders (eord-*).
   ═══════════════════════════════════════════════════════════════════ */
.rsp-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--soc-border); margin-bottom: 14px; }
.rsp-tab { background: none; border: none; border-bottom: 2px solid transparent; padding: 7px 16px; font-size: 13px; font-weight: 600;
    color: var(--soc-text-muted); cursor: pointer; margin-bottom: -1px; }
.rsp-tab.active { color: var(--soc-text); border-bottom-color: var(--soc-accent); }
.rsp-label { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.rsp-hint { font-size: 12px; color: var(--soc-text-muted); margin-top: 3px; line-height: 1.4; }
.rsp-grip { cursor: grab; color: var(--soc-text-muted, #8b949e); padding: 0 4px; border-radius: 4px; display: inline-block; }
.rsp-grip:hover, .rsp-grip:focus-visible { color: var(--soc-text, inherit); background: rgba(139,148,158,.18); outline: none; }
tr.rsp-dragging { opacity: .45; }
tr.rsp-drop-before > td { box-shadow: inset 0 2px 0 0 var(--soc-accent, #58a6ff); }
tr.rsp-drop-after > td { box-shadow: inset 0 -2px 0 0 var(--soc-accent, #58a6ff); }
.rsp-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; margin: 0 14px 4px 0; }
.rsp-cats { max-height: 260px; overflow: auto; padding: 8px 10px; border: 1px solid var(--soc-border); border-radius: 6px; background: var(--soc-surface-2); }
.rsp-cat-group { margin-bottom: 8px; }
.rsp-cat-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--soc-text-muted); margin-bottom: 3px; }
.rsp-preview { padding: 10px 12px; border-radius: 8px; font-size: 13px; line-height: 1.5; border: 1px solid var(--soc-border); background: var(--soc-surface-2); }

.prop-block { margin-bottom: 18px; }
.prop-block-title { font-size: 13px; font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.prop-block-title .bi { color: #d29922; }
.prop-row { grid-template-columns: minmax(160px, 1fr) minmax(150px, 1fr) minmax(170px, 1.1fr) minmax(200px, 1.4fr) minmax(130px, .8fr) auto; }
.prop-btns { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.prop-btns .btn-soc { justify-content: center; white-space: nowrap; }

.nav-prop-badge { margin-left: auto; min-width: 18px; padding: 0 5px; border-radius: var(--soc-badge-radius, 9px); background: #d29922; color: #111;
    font-size: 10.5px; font-weight: 800; line-height: 17px; text-align: center; }
.prop-toast-container { position: fixed; right: 18px; bottom: 76px; z-index: 2100; display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.prop-toast { display: flex; align-items: center; gap: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.35;
    background: var(--soc-surface); border: 1px solid var(--soc-border); border-left: 4px solid #d29922; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.prop-toast.auto { border-left-color: #db6d28; }
.prop-toast > .bi { color: #d29922; font-size: 17px; }
.prop-toast.auto > .bi { color: #db6d28; }
.prop-toast-text { flex: 1; }
.prop-toast-open { font-size: 12px; font-weight: 700; color: var(--soc-accent); text-decoration: none; white-space: nowrap; }
.prop-toast-x { border: none; background: none; color: var(--soc-text-muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; }
@media (max-width: 1100px) { .prop-row { grid-template-columns: 1fr; } }

/* ═══════════════════════════════════════════════════════════════════
   27. POLICY PAGE  (every page of Policies: one header, one publish bar, one table)
   ─────────────────────────────────────────────────────────────────
   <div class="soc-page-header">
     <span style="font-size:20px"><i class="bi bi-…"></i></span>      icon = the menu item's icon, a different one for every item
     <div><h1>Menu name</h1><div class="subtitle">What this is and how it takes effect</div></div>
     <div class="actions">
       <a class="btn-soc md" …>Secondary (Library, Settings, Templates)</a>
       <button class="btn-soc primary md"><i class="bi bi-plus-lg"></i> New policy</button>   "New policy" / "New rule", one word per page
     </div>
   </div>
   @await Html.PartialAsync("_PublishBar")                       publish bar (js/publish-bar.js); pages without Publish: immediate mode
   <div class="soc-table-card">
     <div class="soc-table-toolbar">
       <input class="form-control form-control-sm soc-table-search" …>
       <span class="soc-table-hint"><i class="bi bi-info-circle"></i> hint about the order</span>
     </div>
     <div class="soc-table-scroll"><table class="soc-table">
       <thead><tr> [<th class="soc-grip-col"></th> only where the first match decides] <th>Name</th> <th>Who</th> <th>What</th>
                   <th>Action</th> <th>Enabled</th> <th></th></tr></thead>
       <tr data-id="…"> <td class="soc-grip">…</td>  <td><div class="soc-name">Name</div><div class="soc-desc">…</div></td> … <td><div class="soc-row-actions">
          <button class="soc-icon-btn bordered" title="Edit"><i class="bi bi-pencil"></i></button> … </div></td></tr>
   Order column ONLY on Traffic Control, Web Filtering, Device Policy, Access, Response rules (first match decides).
   DLP and AI Policy check every rule and the strictest action wins: no order column, the hint says so.
   Action colours (PolicyUi.actionBadge): block = critical, warn = high, alert = medium, audit = info, allow = green.
   ═══════════════════════════════════════════════════════════════════ */

.soc-pubbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  margin-bottom: 10px; padding: 9px 14px; font-size: 12.5px;
  border: 1px solid var(--soc-border); border-radius: 8px; background: var(--soc-surface);
}
.soc-pubbar > .bi { font-size: 1rem; color: var(--soc-accent); }
.soc-pubbar-main { flex: 1; min-width: 220px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.soc-pubbar-muted { color: var(--soc-text-muted); }
.soc-pubbar-actions { display: flex; gap: 8px; margin-left: auto; }
.soc-pubbar-problems { flex-basis: 100%; color: var(--soc-critical); font-size: 12px; }
.soc-pubbar-problems ul { margin: 2px 0 0 18px; padding: 0; }
.soc-pub-lines { margin: 0 0 12px 18px; padding: 0; font-size: 12.5px; }
.soc-pub-label { display: block; font-size: 12px; font-weight: 600; margin: 8px 0 4px; }

.soc-toast {
  position: fixed; right: 18px; bottom: 18px; z-index: 2200; max-width: 420px;
  padding: 10px 14px; border-radius: 8px; font-size: 13px; line-height: 1.35;
  background: var(--soc-surface); border: 1px solid var(--soc-border); border-left: 4px solid var(--soc-ok);
  color: var(--soc-text); box-shadow: 0 8px 24px rgba(0,0,0,.35);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.soc-toast.show { opacity: 1; }
.soc-toast.err { border-left-color: var(--soc-critical); }

.soc-table-hint { margin-left: 10px; font-size: 11px; color: var(--soc-text-muted); }
.soc-table-hint .bi { margin-right: 4px; }
.soc-row-actions { display: flex; gap: 4px; justify-content: flex-end; white-space: nowrap; }
.soc-grip-col { width: 38px; }
.soc-grip { width: 38px; text-align: center; color: var(--soc-text-muted); cursor: grab; user-select: none; white-space: nowrap; }
.soc-grip .bi { display: block; font-size: 14px; line-height: 1; }
.soc-grip .num { display: block; font-size: 10px; font-weight: 700; }
.soc-grip.static { cursor: default; }
.soc-grip.static .bi { opacity: .35; }
.soc-table tr.dragging { opacity: .35; }
.soc-table tr.drop-above > td { box-shadow: inset 0 3px 0 var(--soc-accent); }
.soc-table tr.drop-below > td { box-shadow: inset 0 -3px 0 var(--soc-accent); }
.soc-icon-btn.bordered.sure, .soc-icon-btn.bordered.sure:hover { background: var(--soc-critical); border-color: var(--soc-critical); color: #fff; }  /* delete asks twice */
.soc-table tr.is-off > td { opacity: .55; }
.soc-table tr.is-off > td.soc-grip, .soc-table tr.is-off > td:last-child { opacity: 1; }

/* ── Entity Card → AI tab (entity-ai-usage.js) ── */
.aiu-d { font-size: .62rem; font-weight: 600; }
.aiu-heat { display: grid; grid-template-columns: 36px repeat(24, minmax(0, 1fr)); gap: 2px; align-items: center; }
.aiu-hh { font-size: .58rem; color: var(--soc-text-muted); text-align: center; }
.aiu-hd { font-size: .66rem; color: var(--soc-text-muted); }
.aiu-hc { height: 16px; border-radius: 3px; border: 1px solid var(--soc-border); }
.aiu-bars { display: flex; align-items: flex-end; gap: 2px; height: 74px; border-bottom: 1px solid var(--soc-border); }
.aiu-bar { flex: 1 1 0; min-width: 2px; background: #bc8cff; border-radius: 2px 2px 0 0; }
.aiu-sub { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--soc-text-muted); margin: .5rem 0 .25rem; }
.aiu-sub:first-child { margin-top: 0; }
.aiu-line { font-size: .78rem; padding: 2px 0; }
