/* ---------------------------------------------------------------------------
   custom.css — components, plus overrides for the vendor behaviour layer.

   Bootstrap is kept only for modal/dropdown/tooltip BEHAVIOUR; everything it
   paints is overridden here.
--------------------------------------------------------------------------- */

/* =========================================================================
   PANELS
   ========================================================================= */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 11px 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    min-height: 46px;
}

.card-header h5 {
    font-size: 12px;
    font-weight: 700;
    margin: 0;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--fg);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h5 i { color: var(--fg-dim); font-size: 11.5px; }

.card-body { padding: 14px; }
.card-body.p-0 { padding: 0; }

.row { display: flex; flex-wrap: wrap; margin: 0 -6px; }
.row.g-3 > [class*="col-"] { padding: 6px; }
.g-3 { margin: -6px; }

/* =========================================================================
   DASHBOARD HERO — posture panel
   ========================================================================= */
.posture {
    display: grid;
    grid-template-columns: minmax(260px, 320px) 1fr;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 14px;
}

.posture-lead {
    padding: 18px 20px;
    border-right: 1px solid var(--line);
    background:
        radial-gradient(130% 100% at 0% 0%, var(--brand-bg), transparent 66%),
        var(--surface-2);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.posture-lead .eyebrow { margin-bottom: 8px; }

.posture-total {
    font-family: var(--mono);
    font-size: 46px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.035em;
    font-variant-numeric: tabular-nums;
    color: var(--fg);
}

.posture-total small {
    display: block;
    font-family: var(--ui);
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--fg-muted);
    margin-top: 7px;
}

/* Severity stack: one bar, proportional, colour-coded. The fastest read of
   "how bad is this" on the whole page. */
.sev-stack {
    display: flex;
    height: 7px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--surface-3);
    margin-top: 16px;
}

.sev-stack span { display: block; height: 100%; transition: width .35s ease; }
.sev-stack .s-crit { background: var(--fill-crit); }
.sev-stack .s-high { background: var(--fill-high); }
.sev-stack .s-med  { background: var(--fill-med); }
.sev-stack .s-low  { background: var(--fill-low); }

.sev-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    font-size: 10.5px;
    color: var(--fg-muted);
}

.sev-legend i {
    width: 7px;
    height: 7px;
    border-radius: 2px;
    display: inline-block;
    margin-right: 4px;
}

.sev-legend b { font-family: var(--mono); color: var(--fg); font-weight: 700; }

/* Metric strip. Reused on the Job Details page via .metric-grid. */
.posture-metrics,
.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.metric-grid {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 14px;
}

.metric {
    padding: 14px 16px;
    border-right: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
    min-width: 0;
}

.metric .eyebrow { display: block; margin-bottom: 6px; font-size: 9.5px; }

.metric-value {
    font-family: var(--mono);
    font-size: 21px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -.025em;
    font-variant-numeric: tabular-nums;
    display: flex;
    align-items: baseline;
    gap: 6px;
    color: var(--fg);
}

.metric-sub { font-size: 10.5px; color: var(--fg-dim); margin-top: 3px; }

.metric.alert .metric-value { color: var(--crit); }
.metric.good  .metric-value { color: var(--brand); }

/* Every posture figure is a link to the screen that explains it. Styled as a
   whole-tile affordance rather than an underlined number, so the strip still
   reads as data first and navigation second. */
a.drill { display: block; text-decoration: none; color: inherit; position: relative; }
a.drill:hover { color: inherit; }

a.metric.drill:hover { background: var(--surface-2); }
a.metric.drill:hover .metric-value { text-decoration: underline; text-underline-offset: 3px; }

a.metric.drill::after {
    content: "\f061"; /* fa-arrow-right */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 9px;
    color: var(--fg-dim);
    opacity: 0;
    transition: opacity .13s ease, transform .13s ease;
    transform: translateX(-3px);
}

a.metric.drill:hover::after { opacity: 1; transform: translateX(0); }

a.posture-total.drill:hover { text-decoration: underline; text-underline-offset: 5px; }
a.posture-total.drill:hover small { text-decoration: none; }

/* Severity legend entries link to that severity's findings. */
.sev-legend a { color: inherit; text-decoration: none; }
.sev-legend a:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 2px; }

/* =========================================================================
   FINDINGS MATRIX — field x category heatmap
   Domain-specific: shows at a glance WHICH column of the log leaks WHAT.
   ========================================================================= */
.matrix-scroll { overflow-x: auto; padding: 4px 0 2px; }

table.matrix {
    border-collapse: separate;
    border-spacing: 3px;
    font-size: 11px;
    margin: 0;
}

table.matrix th {
    font-weight: 600;
    color: var(--fg-muted);
    font-size: 10px;
    letter-spacing: .04em;
    padding: 4px 6px;
    text-transform: none;
    background: none;
    border: 0;
    white-space: nowrap;
    position: static;
}

/* Rotated column headers keep long category names readable without forcing a
   very wide table. */
table.matrix thead th.cat {
    height: 96px;
    vertical-align: bottom;
    padding: 0 0 6px;
    width: 34px;
}

table.matrix thead th.cat span {
    display: inline-block;
    transform: rotate(-60deg);
    transform-origin: left bottom;
    white-space: nowrap;
    font-size: 10px;
    line-height: 1;
}

table.matrix thead th.corner {
    text-align: right;
    padding-right: 9px;
    vertical-align: bottom;
    font-family: var(--mono);
    font-size: 9px;
    color: var(--fg-dim);
    letter-spacing: 0;
}

table.matrix tbody th.field {
    text-align: right;
    font-family: var(--mono);
    color: var(--fg-muted);
    padding-right: 9px;
    white-space: nowrap;
    max-width: 190px;
}

/* Axis headers carry a severity tick: the worst thing found anywhere along
   that row or column, so a field or category can be triaged before reading a
   single cell. */
table.matrix th.field.sev-Critical,
table.matrix th.cat.sev-Critical { color: var(--crit); }
table.matrix th.field.sev-High,
table.matrix th.cat.sev-High { color: var(--high); }
table.matrix th.field.sev-Critical,
table.matrix th.field.sev-High { font-weight: 700; }

table.matrix td {
    width: 34px;
    height: 26px;
    border-radius: var(--r-sm);
    text-align: center;
    background: var(--surface-2);
    border: 1px solid var(--line-soft);
    color: var(--fg-dim);
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
    padding: 0;
}

/* Colour = worst severity, opacity = occurrence volume. Text colour flips on
   the light amber fills so the count stays readable. */
table.matrix td.hit { border-color: transparent; color: #fff; }
table.matrix td.sev-Critical { background: var(--fill-crit); }
table.matrix td.sev-High     { background: var(--fill-high); color: #452c00; }
table.matrix td.sev-Medium   { background: var(--fill-med);  color: #4a3708; }
table.matrix td.sev-Low      { background: var(--fill-low); }
table.matrix td.i1 { opacity: .38; }
table.matrix td.i2 { opacity: .58; }
table.matrix td.i3 { opacity: .78; }
table.matrix td.i4 { opacity: 1; }
table.matrix td.hit:hover { outline: 2px solid var(--fg); outline-offset: 1px; }

/* An empty cell is information too — that field never leaked that category —
   so it is drawn as a faint placeholder rather than left blank. */
table.matrix td.miss { background: var(--surface); border-style: dashed; }

/* The whole cell is the hit area; the anchor fills it so there is no dead
   margin around the number. */
table.matrix td.hit a,
table.matrix td.total a {
    display: block;
    line-height: 26px;
    color: inherit;
    text-decoration: none;
}

table.matrix td.hit a:hover, table.matrix td.total a:hover { color: inherit; }

/* Row / column totals: deliberately unfilled, so they read as a summary rather
   than as another heat cell competing for attention. */
table.matrix td.total {
    background: var(--surface-2);
    border-color: var(--line);
    color: var(--fg-muted);
}

table.matrix td.total:hover { border-color: var(--fg-dim); }
table.matrix td.total.grand { background: var(--surface-3); color: var(--fg); }
table.matrix tr.total-row th.field { color: var(--fg-dim); }
table.matrix thead th.total-head span { color: var(--fg-dim); }

.matrix-note {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    font-size: 10.5px;
    color: var(--fg-dim);
    padding: 8px 14px 12px;
    border-top: 1px dashed var(--line);
    margin-top: 4px;
}

.matrix-note > span { display: inline-flex; align-items: center; gap: 5px; }
.matrix-note i.fa-solid { font-size: 9.5px; color: var(--fg-dim); }

.matrix-note .sev-key { gap: 9px; }
.matrix-note .sev-key b { font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.matrix-note .sev-key i {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    display: inline-block;
}

/* =========================================================================
   RANKED BAR LIST — "most frequently detected"
   ========================================================================= */
.rank-list { padding: 4px 0; }

.rank-row {
    display: grid;
    grid-template-columns: 1fr 74px;
    gap: 12px;
    align-items: center;
    padding: 8px 14px;
    border-bottom: 1px solid var(--line-soft);
}

.rank-row:last-child { border-bottom: 0; }
.rank-row:hover { background: var(--surface-2); }

.rank-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    min-width: 0;
}

.rank-label span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-bar {
    height: 4px;
    background: var(--surface-3);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 6px;
}

.rank-bar i { display: block; height: 100%; border-radius: 2px; }
.rank-bar i.sev-Critical { background: var(--fill-crit); }
.rank-bar i.sev-High     { background: var(--fill-high); }
.rank-bar i.sev-Medium   { background: var(--fill-med); }
.rank-bar i.sev-Low      { background: var(--fill-low); }

.rank-count {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.rank-count small { display: block; font-size: 9.5px; color: var(--fg-dim); font-weight: 400; }

/* =========================================================================
   CHARTS
   ========================================================================= */
.chart-box { position: relative; height: 258px; }
.chart-box.tall { height: 310px; }

.chart-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--fg-dim);
    font-size: 12px;
    text-align: center;
    padding: 20px;
}

/* =========================================================================
   TOOLBARS + FILTERS
   ========================================================================= */
.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.toolbar-right { margin-left: auto; }

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    align-items: flex-end;
    padding: 12px 14px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
}

.filter-bar .filter-item { min-width: 158px; }
.filter-bar .filter-item.ms-auto { margin-left: auto; }

.filter-bar label {
    display: block;
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--fg-dim);
    margin-bottom: 4px;
}

/* =========================================================================
   FORM CONTROLS
   ========================================================================= */
.form-control, .form-select {
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--fg);
    border-radius: var(--r-sm);
    font-size: 12.5px;
    padding: 6px 9px;
    height: auto;
    font-family: var(--ui);
    transition: border-color .13s ease, box-shadow .13s ease;
}

.form-control:focus, .form-select:focus {
    background: var(--surface);
    color: var(--fg);
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-glow);
    outline: none;
}

.form-control::placeholder { color: var(--fg-dim); }

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%235b6676' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 11px;
    padding-right: 28px;
    appearance: none;
}

textarea.form-control { font-family: var(--mono); font-size: 12px; line-height: 1.6; }

.form-label { color: var(--fg-muted); font-weight: 600; font-size: 12px; margin-bottom: 4px; }
.form-label-sm { font-size: 11.5px; }

.form-check-input {
    background-color: var(--surface);
    border-color: var(--line);
    border-radius: 3px;
}
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 3px var(--brand-glow); border-color: var(--brand); }
.form-check-label { font-size: 12.5px; color: var(--fg-muted); }

.input-group-text {
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--fg-dim);
    font-size: 12px;
    border-radius: var(--r-sm);
}

#showCount, #modal_showCount { width: 76px; }
#inp_searchInDT, #modal_inp_searchInDT { width: 208px; }

/* =========================================================================
   BUTTONS
   ========================================================================= */
.btn {
    border-radius: var(--r-sm);
    font-size: 12.5px;
    font-weight: 550;
    padding: 6px 12px;
    font-family: var(--ui);
    border: 1px solid transparent;
    transition: background .13s ease, border-color .13s ease, color .13s ease;
}

.btn-sm { font-size: 11.5px; padding: 4.5px 9px; }

.btn-success, .btn-primary {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--brand-ink);
    font-weight: 600;
}
.btn-success:hover, .btn-primary:hover,
.btn-success:focus, .btn-primary:focus {
    background: var(--brand-hover);
    border-color: var(--brand-hover);
    color: var(--brand-ink);
}

.btn-outline-secondary {
    background: var(--surface);
    border-color: var(--line);
    color: var(--fg-muted);
}
.btn-outline-secondary:hover, .btn-outline-secondary:focus {
    background: var(--surface-2);
    border-color: #c9d2e0;
    color: var(--fg);
}

.btn-outline-primary {
    background: var(--surface);
    border-color: var(--brand-line);
    color: var(--brand);
}
.btn-outline-primary:hover { background: var(--brand-bg); border-color: var(--brand); color: var(--brand-hover); }

.btn-warning {
    background: var(--surface);
    border-color: var(--line);
    color: var(--fg-muted);
}
.btn-warning:hover { background: var(--surface-2); color: var(--fg); border-color: #c9d2e0; }

.btn-info {
    background: var(--info-bg);
    border-color: var(--info-line);
    color: var(--info);
}
.btn-info:hover { background: #d6ecfa; border-color: var(--info); color: var(--info); }

.btn-link { color: var(--fg-muted); text-decoration: none; }

.btn:disabled, .btn.disabled { opacity: .5; }

/* =========================================================================
   TABLES — dense, monospace data, hairline rows, severity rail
   ========================================================================= */
.table-responsive { overflow-x: auto; }

table.table {
    font-size: 12.5px;
    margin-bottom: 0;
    color: var(--fg);
    border-color: var(--line-soft);
    --bs-table-bg: transparent;
    --bs-table-color: var(--fg);
    --bs-table-striped-bg: transparent;
    --bs-table-striped-color: var(--fg);
    --bs-table-hover-bg: var(--surface-2);
    --bs-table-hover-color: var(--fg);
    --bs-table-border-color: var(--line-soft);
}

table.table > thead > tr > th {
    background: var(--surface-2);
    color: var(--fg-dim);
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    white-space: nowrap;
    border-bottom: 1px solid var(--line);
    padding: 8px 10px;
    position: sticky;
    top: 0;
    z-index: 2;
}

table.table > tbody > tr > td {
    padding: 7px 10px;
    vertical-align: middle;
    border-color: var(--line-soft);
    border-bottom-width: 1px;
}

table.table > tbody > tr { transition: background .1s ease; }
table.table > tbody > tr:hover > * { background: var(--surface-2); }

table.table.table-bordered > :not(caption) > * > * { border-width: 0 0 1px 0; }

table.table td.text-end, table.table th.text-end { text-align: right; }
table.table td.text-end { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* Severity rail: a 2px colour edge on the row's first cell. Lets the eye scan
   a long findings grid by risk without reading a single word. */
tr[data-sev] > td:first-child { position: relative; }
tr[data-sev] > td:first-child::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
}
tr[data-sev="Critical"] > td:first-child::before { background: var(--fill-crit); }
tr[data-sev="High"]     > td:first-child::before { background: var(--fill-high); }
tr[data-sev="Medium"]   > td:first-child::before { background: var(--fill-med); }
tr[data-sev="Low"]      > td:first-child::before { background: var(--fill-low); }

/* Row action buttons */
.btn_row {
    color: var(--fg-dim);
    padding: 3px 6px;
    border-radius: var(--r-sm);
    display: inline-block;
    font-size: 12px;
    transition: background .12s ease, color .12s ease;
}
.btn_row:hover { background: var(--surface-3); color: var(--brand); }
.btn_row.danger:hover { background: var(--crit-bg); color: var(--crit); }

/* =========================================================================
   SAMPLE VALUE CHIP
   Masking is disabled — this is the ACTUAL matched value, not a redaction.
   Solid border and no lock glyph, so it reads as real data rather than as
   something deliberately withheld.
   ========================================================================= */
.sample-value {
    font-family: var(--mono);
    font-size: 11px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 2px 7px;
    display: inline-block;
    max-width: 460px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
    color: var(--fg);
}

/* Full, untruncated rendering — no ellipsis, no clipping. Used wherever the
   whole value matters (detail modals, occurrence lists) rather than a grid
   cell that has to stay one line tall. Long unbroken tokens (URLs, JWTs,
   encoded payloads) wrap mid-string instead of overflowing the container. */
.sample-value.full {
    max-width: 100%;
    white-space: pre-wrap;
    overflow: visible;
    text-overflow: clip;
    word-break: break-all;
    line-height: 1.55;
}

/* Occurrence count rendered as the drill-down affordance in the Findings grid.
   Underlined on hover only, so the column still reads as a number first. */
.link-count {
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dotted var(--brand);
}
.link-count:hover { color: var(--brand); border-bottom-style: solid; }

/* =========================================================================
   PROGRESS
   ========================================================================= */
.progress {
    height: 4px;
    background: var(--surface-3);
    border-radius: 2px;
    overflow: hidden;
}
.progress-bar { background: var(--brand); transition: width .3s ease; }

.progress-cell { min-width: 108px; }
.progress-cell small {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--fg-dim);
    font-variant-numeric: tabular-nums;
}

/* =========================================================================
   EMPTY STATE
   ========================================================================= */
.empty-state { padding: 46px 20px; text-align: center; color: var(--fg-dim); }
.empty-state > i {
    font-size: 22px;
    color: var(--fg-dim);
    margin-bottom: 12px;
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 1px dashed var(--line);
    border-radius: var(--r);
    background: var(--surface-2);
}
.empty-state h6 { font-size: 13px; color: var(--fg-muted); font-weight: 650; margin: 0 0 4px; }
.empty-state p { font-size: 12px; margin: 0; color: var(--fg-dim); }

/* =========================================================================
   UPLOAD DROPZONE
   ========================================================================= */
.dropzone {
    display: block;
    border: 1px dashed var(--line);
    border-radius: var(--r);
    background:
        radial-gradient(95% 75% at 50% 0%, var(--brand-bg), transparent 68%),
        var(--surface-2);
    padding: 30px 20px;
    text-align: center;
    transition: border-color .15s ease, background .15s ease;
    cursor: pointer;
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--brand);
    background: var(--brand-bg);
}

.dropzone > i {
    font-size: 17px;
    color: var(--brand);
    margin-bottom: 11px;
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: var(--r);
    background: var(--surface);
    border: 1px solid var(--brand-line);
}

.dropzone h6 { font-weight: 600; margin-bottom: 4px; font-size: 13px; }
.dropzone p { color: var(--fg-dim); font-size: 11px; margin: 0; font-family: var(--mono); }

.file-chip {
    display: none;
    align-items: center;
    gap: 10px;
    margin-top: 11px;
    padding: 9px 12px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
}

.file-chip.show { display: flex; }
.file-chip .fw-semibold { font-family: var(--mono); font-size: 11.5px; word-break: break-all; }
.file-chip small { font-family: var(--mono); font-size: 10px; color: var(--fg-dim); }

/* Multi-file selection queue. Each file is uploaded on its own request, so each
   row carries its own outcome rather than one shared result for the batch. */
.file-queue {
    display: none;
    margin-top: 11px;
    max-height: 260px;
    overflow-y: auto;
}
.file-queue.show { display: block; }
.file-queue .file-chip { display: flex; margin-top: 0; margin-bottom: 6px; }

.file-queue-foot {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 11px;
    padding-top: 2px;
}
.file-queue-foot.show { display: flex; }
.file-queue-foot a { color: var(--crit); font-size: 11px; }

/* Per-file outcome. Colour is the only signal that changes — the row itself
   stays put so the list does not reflow as uploads complete. */
.file-state {
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--fg-dim);
    white-space: nowrap;
}
.file-chip.is-busy   { border-color: var(--brand-line); background: var(--brand-bg); }
.file-chip.is-busy   .file-state { color: var(--brand); }
.file-chip.is-done   .file-state { color: var(--brand); }
.file-chip.is-failed { border-color: var(--crit-line); background: var(--crit-bg); }
.file-chip.is-failed .file-state { color: var(--crit); }

/* Numbered "what happens next" list. */
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; }
.steps li {
    counter-increment: s;
    position: relative;
    padding: 5px 0 5px 26px;
    font-size: 12px;
    color: var(--fg-muted);
}
.steps li::before {
    content: counter(s);
    position: absolute;
    left: 0;
    top: 5px;
    width: 17px;
    height: 17px;
    border-radius: 3px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--fg-dim);
    font-family: var(--mono);
    font-size: 9.5px;
    font-weight: 700;
    display: grid;
    place-items: center;
}

/* =========================================================================
   DETAIL GRID (job details, modals)
   ========================================================================= */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
    gap: 1px;
    background: var(--line-soft);
    border: 1px solid var(--line-soft);
    border-radius: var(--r-sm);
    overflow: hidden;
}

.detail-item { background: var(--surface-2); padding: 9px 12px; }

.detail-item dt {
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--fg-dim);
    font-weight: 700;
    margin-bottom: 3px;
}

.detail-item dd {
    margin: 0;
    font-size: 12.5px;
    font-weight: 500;
    word-break: break-word;
    font-family: var(--mono);
    color: var(--fg);
}

.detail-item dd small { font-family: var(--ui); color: var(--fg-dim); }

/* =========================================================================
   MODALS
   ========================================================================= */
.modal-content {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--line);
    padding: 13px 16px;
    background: var(--surface-2);
}

.modal-title { font-size: 13.5px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.modal-title code { font-size: 12px; }
.modal-body { padding: 16px; }
.modal-footer { border-top: 1px solid var(--line); padding: 11px 16px; gap: 7px; background: var(--surface-2); }
.modal-backdrop { background: #101828; }
.modal-backdrop.show { opacity: .38; }

.btn-close { opacity: .45; --bs-btn-close-focus-shadow: none; }
.btn-close:hover { opacity: .85; }

/* Nested card inside a modal (the detector pattern tester). */
.modal .card { background: var(--surface-2); box-shadow: none; }
.modal .card .card-header { min-height: 40px; padding: 9px 12px; background: var(--surface-2); }

/* =========================================================================
   DROPDOWNS
   ========================================================================= */
.dropdown-menu {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    box-shadow: var(--shadow);
    padding: 4px;
    font-size: 12.5px;
    min-width: 172px;
}

.dropdown-item { color: var(--fg-muted); border-radius: 3px; padding: 6px 9px; font-size: 12.5px; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--surface-2); color: var(--fg); }
.dropdown-item.text-danger { color: var(--crit) !important; }
.dropdown-item.text-danger:hover { background: var(--crit-bg); }
.dropdown-item-text { color: var(--fg-dim); font-size: 11.5px; padding: 6px 9px; }
.dropdown-divider { border-color: var(--line); margin: 4px 0; }
.dropdown-menu label.dropdown-item { display: flex; align-items: center; cursor: pointer; }

/* =========================================================================
   ALERTS
   ========================================================================= */
.alert {
    border-radius: var(--r-sm);
    border: 1px solid var(--line);
    font-size: 12.5px;
    padding: 9px 12px;
    background: var(--surface-2);
    color: var(--fg-muted);
}

.alert code { font-size: 11.5px; }
.alert-danger    { background: var(--crit-bg);  border-color: var(--crit-line);  color: #8f1229; }
.alert-warning   { background: var(--high-bg);  border-color: var(--high-line);  color: #8a4505; }
.alert-info      { background: var(--info-bg);  border-color: var(--info-line);  color: #075681; }
.alert-success   { background: var(--brand-bg); border-color: var(--brand-line); color: #0a7050; }
.alert-secondary { background: var(--surface-2); border-color: var(--line); color: var(--fg-muted); }

/* =========================================================================
   VENDOR: DataTables
   ========================================================================= */
.dt-buttons { display: none !important; }

div.dataTables_wrapper div.dataTables_filter,
div.dataTables_wrapper div.dataTables_length,
.dt-search, .dt-length { display: none !important; }

div.dataTables_wrapper div.dataTables_info,
.dt-info {
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--fg-dim);
    padding: 10px 14px;
    letter-spacing: .02em;
}

div.dataTables_wrapper div.dataTables_paginate,
.dt-paging { padding: 8px 12px; }

.page-link {
    font-size: 12px;
    color: var(--fg-muted);
    background: var(--surface);
    border-color: var(--line);
    padding: 4px 9px;
}
.page-link:hover { background: var(--surface-2); color: var(--fg); border-color: var(--line); }
.page-item.active .page-link {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--brand-ink);
    font-weight: 600;
}
.page-item.disabled .page-link { background: var(--surface-2); color: var(--fg-dim); border-color: var(--line-soft); }

table.dataTable > thead > tr > th.dt-orderable-asc,
table.dataTable > thead > tr > th.dt-orderable-desc { cursor: pointer; }
table.dataTable > thead > tr > th span.dt-column-order::before,
table.dataTable > thead > tr > th span.dt-column-order::after { opacity: .35; }

/* =========================================================================
   VENDOR: Toastr
   ========================================================================= */
#toast-container > div {
    opacity: 1;
    border-radius: var(--r-sm);
    box-shadow: var(--shadow);
    font-size: 12.5px;
    padding: 13px 15px 13px 46px;
    background-size: 17px;
    background-position: 15px center;
    border: 1px solid var(--line);
    font-family: var(--ui);
}

#toast-container > .toast-success { background-color: var(--brand-bg); border-color: var(--brand-line); color: #0a7050; }
#toast-container > .toast-error   { background-color: var(--crit-bg);  border-color: var(--crit-line);  color: #8f1229; }
#toast-container > .toast-warning { background-color: var(--high-bg);  border-color: var(--high-line);  color: #8a4505; }
#toast-container > .toast-info    { background-color: var(--info-bg);  border-color: var(--info-line);  color: #075681; }
.toast-progress { background: currentColor; opacity: .25; }
.toast-close-button { color: inherit; opacity: .6; text-shadow: none; font-weight: 400; }

/* =========================================================================
   VENDOR: SweetAlert2
   ========================================================================= */
.swal2-popup {
    background: var(--surface) !important;
    border: 1px solid var(--line) !important;
    border-radius: var(--r) !important;
    color: var(--fg) !important;
    font-family: var(--ui) !important;
    font-size: 13px !important;
}
.swal2-title { color: var(--fg) !important; font-size: 17px !important; font-weight: 650 !important; }
.swal2-html-container { color: var(--fg-muted) !important; font-size: 12.5px !important; }
.swal2-styled { border-radius: var(--r-sm) !important; font-size: 12.5px !important; font-weight: 600 !important; }
.swal2-styled.swal2-confirm { background: var(--crit) !important; color: #fff !important; }
.swal2-styled.swal2-cancel { background: var(--surface) !important; border: 1px solid var(--line) !important; color: var(--fg-muted) !important; }
.swal2-icon.swal2-warning { border-color: var(--high) !important; color: var(--high) !important; }

/* =========================================================================
   VENDOR: Select2
   ========================================================================= */
.select2-container--default .select2-selection--single {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    height: 32px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered { color: var(--fg); line-height: 30px; font-size: 12.5px; }
.select2-dropdown { background: var(--surface); border-color: var(--line); }
.select2-container--default .select2-results__option { font-size: 12.5px; color: var(--fg-muted); }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--brand); color: var(--brand-ink); }
.select2-search--dropdown .select2-search__field { background: var(--surface); border-color: var(--line); color: var(--fg); }

/* =========================================================================
   MISC BOOTSTRAP UTILITIES USED IN THE VIEWS
   ========================================================================= */
.tooltip-inner { background: #1f2937; border: 0; font-size: 11.5px; border-radius: var(--r-sm); color: #fff; }
.tooltip.bs-tooltip-top .tooltip-arrow::before { border-top-color: #1f2937; }
.text-danger { color: var(--crit) !important; }
.text-primary { color: var(--brand) !important; }
.text-success { color: var(--brand) !important; }
.text-warning { color: var(--high) !important; }
.text-info { color: var(--info) !important; }
.text-secondary { color: var(--fg-muted) !important; }
.text-dark { color: var(--fg) !important; }
hr { border-color: var(--line); opacity: 1; }

.h-100 { height: 100%; }
.w-100 { width: 100%; }

@media (max-width: 991.98px) {
    .posture { grid-template-columns: 1fr; }
    .posture-lead { border-right: 0; border-bottom: 1px solid var(--line); }
    .text-clip { max-width: 190px; }
}
