/* ── Buttons (shared base) ──────────────────────── */
.btn-primary,
.btn-secondary,
.btn-danger {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.9rem;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    line-height: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    cursor: pointer;
    transition-property: color, background-color, border-color;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-panel-text);
    border: 2px solid var(--color-accent);
}
.btn-primary::before,
.btn-primary::after {
    display: inline-block;
    opacity: 0;
    transition: opacity 150ms ease, transform 150ms ease;
    font-weight: 400;
}
.btn-primary::before {
    content: "[ ";
    transform: translateX(4px);
}
.btn-primary::after {
    content: " ]";
    transform: translateX(-4px);
}
.btn-primary:hover {
    background-color: var(--color-text);
    border-color: var(--color-text);
}
.btn-primary:hover::before,
.btn-primary:hover::after {
    opacity: 1;
    transform: translateX(0);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-border-section);
}
.btn-secondary:hover {
    background-color: var(--color-text);
    color: var(--color-bg);
}

.btn-danger {
    background-color: var(--color-accent);
    color: var(--color-panel-text);
    border: 2px solid var(--color-accent);
}
.btn-danger:hover {
    background-color: var(--color-text);
    border-color: var(--color-text);
}

/* ── Ghost Button (Quick Actions) ───────────────── */
.btn-ghost {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--color-border-section);
    background: transparent;
    font-family: var(--font-mono);
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text);
    cursor: pointer;
    transition: all 150ms ease;
}
.btn-ghost:hover {
    background: var(--color-panel-dark);
    color: var(--color-panel-text);
}
.btn-ghost:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.btn-ghost:disabled:hover {
    background: transparent;
    color: var(--color-text);
}

/* ── Panel ──────────────────────────────────────── */
.panel {
    border: 1px solid var(--color-border-section);
    background-color: var(--color-bg);
    padding: 1.5rem;
}

/* ── Section ─────────────────────────────────── */
.section {
    border: 1px solid var(--color-border-section);
    margin-bottom: 0;
}

.section-header {
    background: var(--color-surface-active);
    border-bottom: 1px solid var(--color-border-section);
    padding: 6px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 32px;
}

.section-header-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--color-text);
}

.section-header-meta {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
}

.section-header-action {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text);
    text-decoration: none;
    border-bottom: 1px solid var(--color-text);
    padding-bottom: 1px;
}
.section-header-action:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
}

.section-body {
    padding: 20px 16px;
    background: var(--color-bg);
}

/* Stacked sections — no double borders */
.section-stack .section {
    border-bottom: none;
}
.section-stack .section:last-child {
    border-bottom: 1px solid var(--color-border-section);
}

/* State variants */
.section-critical .section-header { background: rgba(232, 71, 42, 0.08); }
.section-warning  .section-header { background: rgba(217, 158, 0, 0.08); }
.section-success  .section-header { background: rgba(59, 166, 105, 0.08); }

/* ── Tables ──────────────────────────────────── */
/* Section tables always use collapsed borders (required for tr/td borders) */
.section table {
    border-collapse: collapse;
}

/* Override Tailwind's default border color (0 solid #e5e7eb) on all table elements */
table {
    border-color: var(--color-border-section);
}

.th-taw {
    padding: 0.625rem 1rem;
    text-align: left;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border-color: var(--color-border-section);
}

/* Dark header row (used in overview tab tables) */
.thead-dark {
    background-color: var(--color-panel-dark);
}
.thead-dark .th-taw {
    color: var(--color-panel-text);
}

/* Light header row (used in section tables) */
.thead-light tr {
    border-bottom: 1px solid var(--color-border-section);
}
.thead-light .th-taw {
    color: var(--color-text);
}

.tr-taw {
    border-bottom: 1px solid var(--color-border-section);
    border-color: var(--color-border-section);
    transition: background-color 100ms ease;
}
.tr-taw:hover {
    background-color: var(--color-surface-hover);
}

.td-taw {
    padding: 0.625rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.5;
    border-color: var(--color-border-section);
}

/* ── Empty state ─────────────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}
.empty-state-label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    opacity: 0.4;
}
.empty-state-hint {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    opacity: 0.3;
    margin-top: 0.25rem;
}

/* ── Stat Block ──────────────────────────────── */
.stat-block {
    background-color: var(--color-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border-section);
    padding: 1.5rem;
}

/* ── Badge ───────────────────────────────────── */
.badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.125rem 0.375rem;
}

/* Modifier: neutral — transparent with 1px section border (default/open/pending) */
.badge-neutral {
    border: 1px solid var(--color-border-section);
    color: var(--color-text);
}

/* Modifier: dark — ink fill, cream text (synced/configured/probable) */
.badge-dark {
    background-color: var(--color-panel-dark);
    color: var(--color-panel-text);
}

/* Modifier: accent — coral fill, cream text (critical/failed/IR/TLP:RED) */
.badge-accent {
    background-color: var(--color-accent);
    color: var(--color-panel-text);
}

/* Modifier: accent-outline — coral border, coral text (admin/not configured) */
.badge-accent-outline {
    border: 1px solid var(--color-accent);
    color: var(--color-accent);
}

/* Modifier: success — green fill (resolved/completed/mitigated/TLP:GREEN) */
.badge-success {
    background-color: var(--color-badge-success);
    color: var(--color-badge-success-text);
}

/* Modifier: warning — amber fill (contained/high/TLP:AMBER/partial) */
.badge-warning {
    background-color: var(--color-badge-warning);
    color: var(--color-badge-warning-text);
}

/* Modifier: info — teal fill (investigating/in-progress/medium/threat-hunt) */
.badge-info {
    background-color: var(--color-badge-info);
    color: var(--color-badge-info-text);
}

/* Modifier: muted — wash bg, dimmed text (closed/won't fix/low/coming soon) */
.badge-muted {
    background-color: var(--color-badge-muted-bg);
    color: var(--color-badge-muted-text);
}

/* Modifier: purple — plum fill (TLP:EX:CHR / Chatham House Rule) */
.badge-purple {
    background-color: var(--color-badge-purple);
    color: var(--color-badge-purple-text);
}

/* LED dot indicator — prepends a 6px circle before badge text */
.badge-led {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.badge-led::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.badge-led.badge-neutral::before  { background-color: var(--color-border-solid); }
.badge-led.badge-dark::before     { background-color: var(--color-panel-text); }
.badge-led.badge-accent::before   { background-color: var(--color-panel-text); }
.badge-led.badge-accent-outline::before { background-color: var(--color-accent); }
.badge-led.badge-success::before  { background-color: var(--color-badge-success-text); }
.badge-led.badge-warning::before  { background-color: var(--color-badge-warning-text); }
.badge-led.badge-info::before     { background-color: var(--color-badge-info-text); }
.badge-led.badge-purple::before   { background-color: var(--color-badge-purple-text); }
.badge-led.badge-muted::before    { background-color: var(--color-badge-muted-text); }

/* ── Label ───────────────────────────────────── */
.label-taw {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 0.25rem;
}

/* ── Input ───────────────────────────────────── */
.input-taw {
    width: 100%;
    border: 1px solid var(--color-border-section);
    background-color: var(--color-bg);
    padding: 0.375rem 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1rem;
    color: var(--color-text);
    transition: border-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.input-taw:focus {
    outline: 2px solid var(--color-text);
    outline-offset: 0;
    border-color: var(--color-text);
}

/* Textarea variant — taller default for comment boxes */
textarea.input-taw {
    min-height: 6rem;
}

/* ── Select ─────────────────────────────────── */
.select-taw {
    border: 1px solid var(--color-border-section);
    background-color: var(--color-bg);
    padding: 0.375rem 2rem 0.375rem 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1rem;
    color: var(--color-text);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%231A1A1A' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1em 1em;
    cursor: pointer;
    transition: border-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.select-taw:focus {
    outline: 2px solid var(--color-text);
    outline-offset: 0;
    border-color: var(--color-text);
}

/* ── Workflow Stepper — progress meter (small bar next to %) ────── */
.workflow-progress-meter {
    width: 12rem;
    height: 0.175rem;
    background: var(--color-border);
    flex-shrink: 0;
}
.workflow-progress-meter-fill {
    height: 100%;
    background: var(--color-panel-dark);
    transition: width 300ms ease;
}

/* ── Workflow Stepper ───────────────────────────── */
.workflow-stepper {
    display: flex;
    align-items: flex-start;
    width: 100%;
    /* List reset so an <ol> can carry this class without inheriting the
       default browser markers / padding. */
    list-style: none;
    margin: 0;
    padding: 0;
}
.workflow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    min-width: 0;
}
.workflow-step-indicator {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    border: 1px solid var(--color-border-section);
    color: var(--color-text);
    background: var(--color-bg);
    transition: all 150ms ease;
}
.workflow-step-indicator--active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-panel-text);
}
.workflow-step-indicator--done {
    background: var(--color-panel-dark);
    border-color: var(--color-panel-dark);
    color: var(--color-panel-text);
}
.workflow-step-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.375rem;
    text-align: center;
    color: var(--color-text);
    opacity: 0.5;
}
.workflow-step-label--active {
    opacity: 1;
    font-weight: 700;
}
.workflow-step-label--done {
    opacity: 0.7;
}
.workflow-step-timestamp {
    margin-top: 0.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    font-family: var(--font-mono);
    font-size: 0.59375rem;
    line-height: 1.25;
    text-align: center;
    color: var(--color-text);
    max-width: 100%;
}
.workflow-step-timestamp-label {
    opacity: 0.55;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.workflow-step-timestamp-value {
    opacity: 0.85;
    white-space: nowrap;
}
.workflow-step-timestamp-empty {
    opacity: 0.3;
}
.workflow-connector {
    flex: 1;
    height: 1px;
    background: var(--color-border);
    align-self: flex-start;
    /* Connector sits between two indicators (28px tall) — align to the
       indicator centre by offsetting half the indicator height. */
    margin-top: 14px;
    margin-left: 2px;
    margin-right: 2px;
    min-width: 4px;
}
.workflow-connector--done {
    background: var(--color-panel-dark);
}
.workflow-stepper-divider {
    border: 0;
    border-top: 1px solid var(--color-border-section);
    margin: 0 0 0.875rem 0;
    height: 0;
}

/* ── Left Rail ──────────────────────────────────── */
.left-rail {
    width: 220px;
    position: sticky;
    top: 1rem;
}
.left-rail-group-label {
    font-family: var(--font-mono);
    font-size: 0.5625rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-text);
    opacity: 0.4;
    padding: 0.75rem 0.75rem 0.25rem;
}
.left-rail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-text);
    opacity: 0.6;
    border-left: 3px solid transparent;
    transition: all 100ms ease;
}
.left-rail-item:hover {
    opacity: 0.85;
    background: var(--color-surface-hover);
}
.left-rail-item--active {
    opacity: 1;
    border-left-color: var(--color-accent);
    background: var(--color-surface-active);
}

/* ── Context Panel Cards ────────────────────────── */
.context-card {
    border: 1px solid var(--color-border-section);
    background: var(--color-bg);
}
.context-card-header {
    background: var(--color-surface-active);
    border-bottom: 1px solid var(--color-border-section);
    padding: 0.375rem 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.5625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-text);
}
.context-card-body {
    padding: 0.75rem;
}

/* ── Progress Ring (SVG) ────────────────────────── */
.progress-ring {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    max-width: 18px;
    max-height: 18px;
    flex-shrink: 0;
    overflow: hidden;
}
.progress-ring-bg {
    fill: none;
    stroke: var(--color-border);
    stroke-width: 2;
}
.progress-ring-fill {
    fill: none;
    stroke: var(--color-panel-dark);
    stroke-width: 2;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: center;
    transition: stroke-dasharray 300ms ease;
}
.progress-ring-fill--done {
    stroke: var(--color-accent);
}

/* ── Status Dot ─────────────────────────────────── */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Initials Avatar ────────────────────────────── */
.initials-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-panel-dark);
    color: var(--color-panel-text);
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════════
   Migrated from ir-design-system.css
   ══════════════════════════════════════════════════ */

/* ── Form Components (Numbered Sections) ─────── */

.t-formsection {
    counter-increment: formsection;
    margin-bottom: 2rem;
    position: relative;
    padding-left: 1.25rem;
    border-left: 2px solid var(--color-border-section);
}

.t-formsection-header {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.t-formsection-header::before {
    content: counter(formsection, decimal-leading-zero);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: var(--color-panel-dark);
    color: var(--color-panel-text);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    border-radius: 0;
    flex-shrink: 0;
}

.t-formsection.emphasis {
    border-left-color: var(--color-accent);
    border-left-width: 3px;
    background: rgba(232, 71, 42, 0.03);
    padding: 1.5rem;
    padding-left: 2rem;
    margin-left: -1.5rem;
    margin-right: -1.5rem;
}

.t-formsection.emphasis .t-formsection-header::before {
    background: var(--color-accent);
    color: var(--color-panel-text);
}

.t-required::after {
    content: " *";
    color: var(--color-accent);
    margin-left: 0.125rem;
}

.t-formsection-desc {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--color-text);
    opacity: 0.5;
    margin-left: 2.75rem;
}

/* ── Info Callouts ────────────────────────────── */

.t-info {
    border-left: 3px solid var(--color-border-section);
    background: rgba(26, 26, 26, 0.03);
    padding: 1rem 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.6;
}

.t-info-warn {
    border-left-color: var(--color-badge-warning);
    background: rgba(139, 94, 0, 0.05);
}

.t-info-danger {
    border-left-color: var(--color-accent);
    background: rgba(232, 71, 42, 0.05);
}

/* ── Segmented Pills ──────────────────────────── */

.t-segpill {
    display: inline-flex;
    border: 1px solid var(--color-border-section);
    background: var(--color-bg);
}

.t-segpill > button {
    padding: 0.375rem 0.75rem;
    border-right: 1px solid var(--color-border-section);
    background: transparent;
    color: var(--color-text);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    transition: all 150ms ease;
    cursor: pointer;
}

.t-segpill > button:last-child {
    border-right: none;
}

.t-segpill > button:hover {
    background: var(--color-surface-hover);
}

.t-segpill > button.active {
    background: var(--color-accent);
    color: var(--color-panel-text);
    border-right-color: var(--color-accent);
}

/* ── KV Grid Helpers ──────────────────────────── */

.t-kvk {
    opacity: 0.6;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
}

.t-kvv {
    font-weight: 500;
}

.t-kvv-mono {
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

/* ── Activity Timeline Cards ──────────────────── */

.t-actcard {
    display: flex;
    padding: 1rem;
    border-left: 3px solid transparent;
    background: var(--color-bg);
    transition: background 150ms ease;
    border-bottom: 1px solid var(--color-border);
}

.t-actcard:hover {
    background: var(--color-surface-hover);
}

.t-actcard.active {
    border-left-color: var(--color-accent);
    background: var(--color-surface-active);
}

/* ── Modal System ─────────────────────────────── */

.t-modal-ish {
    position: fixed;
    z-index: 30;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90vw;
    border: 1px solid var(--color-border-section);
    background: var(--color-bg);
}

.t-modal-head {
    background: rgba(26, 26, 26, 0.03);
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-border-section);
    position: relative;
}

.t-modal-body {
    padding: 1.5rem;
}

.t-modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: rgba(26, 26, 26, 0.03);
    border-top: 1px solid var(--color-border-section);
}

/* ── Dirty-form-guard modal ─────────────────────
   Browser-level unsaved-changes confirmation triggered from
   dirty-form-guard.js. Floats above any other stacking context. */
.dirty-form-guard-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
}
.dirty-form-guard-modal.is-open { display: block; }
.dirty-form-guard-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}
.dirty-form-guard-modal__dialog {
    position: relative;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 460px;
    max-width: calc(100vw - 2rem);
    background: var(--color-bg);
    border: 1px solid var(--color-border-solid);
    padding: 1.25rem 1.5rem 1rem;
}
.dirty-form-guard-modal__title {
    margin: 0 0 0.5rem 0;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--color-text);
}
.dirty-form-guard-modal__body {
    margin: 0 0 1.25rem 0;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--color-text);
}
.dirty-form-guard-modal__actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* ── Avatar Stack ─────────────────────────────── */

.avatar-stack {
    display: flex;
    align-items: center;
}

.avatar-stack-item {
    margin-left: -8px;
    border: 2px solid var(--color-bg);
    z-index: 0;
}

.avatar-stack-item:first-child {
    margin-left: 0;
    z-index: 2;
}

.avatar-stack-item:nth-child(2) {
    z-index: 1;
}

/* ── IOC Object Grouping ──────────────────────── */

.t-ioc-object-header {
    font-weight: 700;
}

.t-ioc-object-child {
    padding-left: 36px;
    background: rgba(26, 26, 26, 0.02);
}

.sightings-count.active {
    color: var(--color-accent);
    font-weight: 700;
}

/* ── Advisory Checks (Closure Dialog) ─────────── */

.advisory-check-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.advisory-check-row.check-pass {
    background: rgba(47, 122, 58, 0.08);
    border-left: 3px solid var(--color-badge-success);
}

.advisory-check-row.check-fail {
    background: rgba(139, 94, 0, 0.08);
    border-left: 3px solid var(--color-badge-warning);
}

/* ── Header Strip ─────────────────────────────── */

.header-strip {
    background: rgba(26, 26, 26, 0.02);
    border-bottom: 1px solid var(--color-border-section);
    padding: 1rem 0;
}


/* ── IOC disclosure list (IR/Hunt IOCs tab) ─────────────────── */
.ioc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ioc-list > li + li {
    border-top: 1px solid var(--color-border-section);
}

.ioc-row {
    border-left: 2px solid transparent;
    transition: border-color 100ms ease, background-color 100ms ease;
}
.ioc-row[open] {
    border-left-color: var(--color-accent);
    background-color: var(--color-surface-hover);
}

.ioc-row__summary {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 1rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.ioc-row__summary::-webkit-details-marker { display: none; }
.ioc-row__summary:hover {
    background-color: var(--color-surface-hover);
}

.ioc-row__chevron {
    flex: 0 0 auto;
    width: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--color-text);
    opacity: 0.45;
    transition: transform 120ms ease, opacity 120ms ease;
    transform: rotate(0deg);
    text-align: center;
}
.ioc-row[open] .ioc-row__chevron {
    transform: rotate(90deg);
    opacity: 0.85;
}

.ioc-row__type {
    flex: 0 0 auto;
}

.ioc-row__value {
    flex: 1 1 auto;
    min-width: 0;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.4;
    word-break: break-all;
    overflow-wrap: anywhere;
    color: var(--color-text);
}

.ioc-row__meta {
    flex: 0 0 auto;
    display: flex;
    gap: 0.375rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.ioc-row__panel {
    padding: 0.75rem 1rem 1rem 2.25rem;
    background-color: rgba(26, 26, 26, 0.025);
    border-top: 1px dashed var(--color-border-section);
}

.ioc-row__panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem 1rem;
}

.ioc-row__panel-block--full {
    grid-column: 1 / -1;
}

.ioc-row__panel-label {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    opacity: 0.55;
    margin-bottom: 0.25rem;
}

.ioc-row__panel-value {
    font-size: 0.8125rem;
    line-height: 1.45;
}

.ioc-row__panel-actions {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* ── IOC pager (top + bottom toolbars) ──────────────────────── */
.ioc-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    flex-wrap: wrap;
    background-color: rgba(26, 26, 26, 0.02);
    border-bottom: 1px solid var(--color-border-section);
}
.ioc-pager--bottom {
    border-top: 1px solid var(--color-border-section);
    border-bottom: none;
}

.ioc-pager__info {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    opacity: 0.7;
}

.ioc-pager__controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ioc-pager__per-page {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.ioc-pager__select {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.2rem 0.45rem;
    background-color: var(--color-bg);
    border: 1px solid var(--color-border-section);
    border-radius: 2px;
    color: var(--color-text);
    cursor: pointer;
}
.ioc-pager__select:focus {
    outline: none;
    border-color: var(--color-accent);
}

/* ── Inline spinner ──────────────────────────────────────
   Used inside Alpine-driven `<span x-show="submitting">` blocks on
   submit buttons across HTMX/non-HTMX forms. CurrentColor-driven so
   it adopts the button's text colour. */
.t-spinner {
    display: inline-block;
    width: 0.875em;
    height: 0.875em;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: t-spin 0.7s linear infinite;
    vertical-align: -2px;
    flex-shrink: 0;
}
@keyframes t-spin {
    to { transform: rotate(360deg); }
}

/* ══════════════════════════════════════════════════
   Indicator Workbench — layout components
   ══════════════════════════════════════════════════ */

/* Soft surface utilities — use the platform tokens. */
.surface-hover { background-color: var(--color-surface-hover); }
.surface-active { background-color: var(--color-surface-active); }
.hover\:surface-hover:hover { background-color: var(--color-surface-hover); }

/* Workbench mini correlation graph (in the expand panel).
   Visual spec from the design doc — cream frame with a subtle 18px grid
   pattern, hairline border, satellite SVG nodes drawn inline. */
.workbench-mini-graph {
    position: relative;
    height: 170px;
    border: 1px solid #cdc6ba;
    background-color: #f3efe7;
    background-image:
        linear-gradient(#dcd6ca 1px, transparent 1px),
        linear-gradient(90deg, #dcd6ca 1px, transparent 1px);
    background-size: 18px 18px;
    overflow: hidden;
}
.workbench-mini-graph svg {
    width: 100%;
    height: 100%;
    font-family: var(--font-mono);
}
.workbench-mini-graph-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 0.375rem;
}
.workbench-mini-graph-label {
    font-family: var(--font-mono);
    font-size: 0.5625rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #7a7268;
}
.workbench-mini-graph-link {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--color-text);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.workbench-mini-graph-link:hover {
    color: var(--color-accent);
}
.workbench-mini-graph-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    /* Match the header's padding (workbench-expand-card-header uses
       0.375rem 0.75rem) so the footer text isn't flush against the card
       border on any side. */
    padding: 0.375rem 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.59375rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #7a7268;
    min-width: 0;
}
.workbench-mini-graph-footer > span {
    /* Allow the left summary span ("1 cases · 1 asn · …") to wrap onto
       multiple lines instead of forcing the row wider than the card. */
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.workbench-mini-graph-footer > span:last-child {
    /* "depth 1" stays a single line on the right edge. */
    flex-shrink: 0;
    white-space: nowrap;
}

/* Full IOC correlation graph page (templates/iocs/ioc_graph.html).
   Two-pane layout: left controls (260px) + flex graph canvas. Same cream
   palette + 18px grid as the mini preview, scaled up. */
.ioc-graph-shell {
    display: flex;
    gap: 0;
    border: 1px solid var(--color-border-solid);
    height: calc(100vh - 200px);
    min-height: 500px;
}
.ioc-graph-controls {
    width: 260px;
    min-width: 260px;
    border-right: 1px solid var(--color-border-solid);
    overflow-y: auto;
    padding: 1rem;
    background: var(--color-bg);
    display: flex;
    flex-direction: column;
}
.ioc-graph-controls-block {
    margin-bottom: 1.25rem;
}
.ioc-graph-controls-block:last-child {
    margin-bottom: 0;
}
.ioc-graph-controls-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-text);
    opacity: 0.6;
}
.ioc-graph-controls-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.375rem;
}
.ioc-graph-controls-col {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-top: 0.375rem;
}
.ioc-graph-controls-row label,
.ioc-graph-controls-col label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}
.ioc-graph-controls-stats {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--color-text);
    opacity: 0.4;
}
.ioc-graph-canvas {
    flex: 1;
    position: relative;
    overflow: hidden;
    background-color: #f3efe7;
    background-image:
        linear-gradient(#dcd6ca 1px, transparent 1px),
        linear-gradient(90deg, #dcd6ca 1px, transparent 1px);
    background-size: 18px 18px;
}
.ioc-graph-canvas svg {
    width: 100%;
    height: 100%;
    font-family: var(--font-mono);
}
.ioc-graph-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--color-text);
    opacity: 0.4;
}
.ioc-graph-node-group.selected circle,
.ioc-graph-node-group.selected rect,
.ioc-graph-node-group.selected polygon {
    stroke: var(--color-accent) !important;
    stroke-width: 3px !important;
}

/* Bulleted list — small square markers, left-padded, gap between items.
   Square fits the brutalist editorial aesthetic better than disc. */
.bullet-list {
    list-style: square outside;
    padding-left: 1.25rem;
    margin: 0;
}
.bullet-list > li {
    margin-bottom: 0.375rem;
}
.bullet-list > li:last-child {
    margin-bottom: 0;
}
.bullet-list > li::marker {
    color: var(--color-text);
    opacity: 0.5;
}

/* Workbench header strip — adds horizontal inset to the shared
   .header-strip so its title (left) and action buttons (right) don't
   butt against the strip's edges. The base .header-strip uses
   `padding: 1rem 0` and ships in the same stylesheet, so this class
   relies on source-order to override only the horizontal axis. */
.header-strip.header-strip--workbench {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* Two-column page grid: filter rail (240px) + main column (flex). */
.workbench-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: start;
}
@media (min-width: 1024px) {
    .workbench-grid {
        grid-template-columns: 240px minmax(0, 1fr);
    }
}

/* KPI strip — "Morning brief".
   Follows the platform two-part section pattern:
     · 1px black frame (border-solid)
     · warm-grey header strip (rgba 0.06)
     · cream content cells (--color-bg) divided by 1px black gap-lines.
   No dark fills — matches the brutalist editorial palette. */
.workbench-kpi {
    border: 1px solid var(--color-border-solid);
    background-color: var(--color-bg);
}
.workbench-kpi-header {
    background: rgba(26, 26, 26, 0.06);
    border-bottom: 1px solid var(--color-border-solid);
    padding: 6px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 32px;
    gap: 0.75rem;
}
.workbench-kpi-header-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--color-text);
}
.workbench-kpi-header-meta {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(26, 26, 26, 0.5);
}
/* The grid uses gap:1px on a black background so each cell appears
   as a cream tile separated by a clean 1px ink line — no per-cell
   border math is needed. */
.workbench-kpi-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
    background-color: var(--color-border-solid);
}
@media (min-width: 640px) {
    .workbench-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 768px) {
    .workbench-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .workbench-kpi-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
.workbench-kpi-cell {
    padding: 18px 20px;
    background-color: var(--color-bg);
}
.workbench-kpi-value {
    font-family: var(--font-mono);
    font-size: 3.25rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--color-text);
}
/* Accent is reserved for "needs action" KPIs (Unreviewed, Stale)
   when their count > 0. Never used for decoration. */
.workbench-kpi-value--alert {
    color: var(--color-accent);
}
.workbench-kpi-label {
    margin-top: 0.625rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-text);
}
.workbench-kpi-hint {
    margin-top: 0.25rem;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: rgba(26, 26, 26, 0.5);
}

/* Workbench section — same look as .section but always clips child overflow. */
.workbench-section {
    border: 1px solid var(--color-border-section);
    background-color: var(--color-bg);
    overflow: hidden;
    margin-bottom: 0;
}
.workbench-table-scroll {
    overflow-x: auto;
}
.workbench-table {
    width: 100%;
    min-width: 100%;
    border-collapse: collapse;
    background-color: var(--color-bg);
}
.workbench-table thead tr {
    background-color: rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid var(--color-border-section);
}
.workbench-table th {
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-text);
    opacity: 0.6;
    white-space: nowrap;
}
.workbench-table th.workbench-th-center { text-align: center; }
.workbench-table tbody tr {
    border-bottom: 1px solid var(--color-border-section);
    transition: background-color 100ms ease;
}
.workbench-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.04);
}
.workbench-table tbody tr.workbench-row-expanded,
.workbench-table tbody tr.workbench-row--expanded {
    background-color: rgba(0, 0, 0, 0.05);
}
.workbench-table td {
    padding: 0.5rem 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--color-text);
    vertical-align: middle;
}
.workbench-table td.workbench-td-center { text-align: center; }
.workbench-table td.workbench-td-nowrap { white-space: nowrap; }
.workbench-table td.workbench-td-truncate {
    max-width: 0;          /* let truncate kick in inside flex */
    overflow: hidden;
    text-overflow: ellipsis;
}

/* The thin coloured ribbon in the leftmost cell — workflow state indicator. */
.workbench-state-ribbon {
    width: 3px;
    padding: 0 !important;
}
.workbench-state-ribbon--new { background-color: #d1d5db; }
.workbench-state-ribbon--inv { background-color: #f59e0b; }
.workbench-state-ribbon--c2  { background-color: #dc2626; }
.workbench-state-ribbon--wl  { background-color: #d1d5db; }
.workbench-state-ribbon--fp  { background-color: #e5e7eb; }

/* Date-bucket header row used by the Timeline view. */
.workbench-bucket-row td {
    background-color: rgba(0, 0, 0, 0.06);
    border-top: 1px solid var(--color-border-section);
    border-bottom: 1px solid var(--color-border-section);
    font-family: var(--font-mono);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 0.375rem 0.75rem;
}

/* Persistent bulk-action bar — visible at all times so analysts know
   the feature exists. Goes "active" with a tinted background and colour
   transition once a row is selected. */
.workbench-bulk-bar {
    position: sticky;
    top: 0;
    z-index: 30;
    background-color: var(--color-surface-active);
    color: var(--color-text);
    border: 1px solid var(--color-border-section);
    border-radius: 2px;
    /* Right padding bumped to leave room for the absolutely-positioned ✕. */
    padding: 0.5rem 2.25rem 0.5rem 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    transition: background-color 150ms ease, border-color 150ms ease;
}
.workbench-bulk-bar .workbench-bulk-bar__close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    width: 1.25rem;
    height: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--color-text);
    opacity: 0.55;
    cursor: pointer;
    line-height: 1;
    font-size: 0.95rem;
    transition: opacity 120ms ease;
}
.workbench-bulk-bar .workbench-bulk-bar__close:hover {
    opacity: 1;
}
.workbench-bulk-bar.workbench-bulk-bar--active {
    background-color: var(--color-bg);
    border-color: var(--color-text);
    border-left-width: 3px;
}
.workbench-bulk-bar .workbench-bulk-bar__hint {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-text);
    opacity: 0.55;
}
.workbench-bulk-bar .workbench-bulk-bar__count {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    line-height: 1;
    color: var(--color-text);
}
.workbench-bulk-bar .workbench-bulk-bar__count-label {
    margin-left: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--color-text);
    opacity: 0.7;
}
.workbench-bulk-bar .workbench-bulk-bar__sep {
    color: var(--color-text);
    opacity: 0.25;
}
.workbench-bulk-bar button[disabled],
.workbench-bulk-bar button[disabled]:hover {
    opacity: 0.35;
    cursor: not-allowed;
    background-color: transparent;
    color: var(--color-text);
}

/* Expanded panel inner grid (3 columns on lg+, stacks on smaller). */
.workbench-expand {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.04);
}
@media (min-width: 1024px) {
    .workbench-expand {
        grid-template-columns: 1.4fr 1fr 1fr;
    }
}
.workbench-expand-card {
    border: 1px solid var(--color-border-section);
    background-color: var(--color-bg);
    /* Stop overflow from grid children with long unbroken text (e.g. the
       Shodan port list "993,2082,443,…") from extending past the card. */
    min-width: 0;
    overflow: hidden;
}
/* Long values inside the enrichment card grid must wrap, even when they
   contain no break opportunities (commas-without-spaces, long hashes,
   etc.). ``min-width: 0`` lets the grid column shrink; ``overflow-wrap:
   anywhere`` makes wrap-on-overflow work for unbroken strings. */
.workbench-expand-card dl,
.workbench-expand-card dt,
.workbench-expand-card dd {
    min-width: 0;
}
.workbench-expand-card dd,
.workbench-expand-card dt {
    overflow-wrap: anywhere;
    word-break: break-word;
}
.workbench-expand-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.375rem 0.75rem;
    background-color: rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid var(--color-border-section);
    font-family: var(--font-mono);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    opacity: 0.7;
}

/* ── Tab bar ─────────────────────────────────────────
   Used on settings + future paginated detail pages. Tinted strip with
   no border; the active button surfaces a 2px accent underline at its
   own baseline. */
.tab-bar {
    display: flex;
    gap: 0.5rem;
    background: var(--color-surface-active);
    padding: 0 0.5rem;
}
.tab-bar__btn {
    background: transparent;
    border: none;
    padding: 0.625rem 0.875rem 0.625rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.25;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-text);
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 150ms ease, border-color 150ms ease;
}
.tab-bar__btn:hover {
    opacity: 1;
}
.tab-bar__btn--active,
.tab-bar__btn--active:hover {
    opacity: 1;
    border-bottom: 2px solid var(--color-accent);
}
