/* activity.css — styles for the Activity feature modules (LockTreePanel, TransactionsPanel). */

/* ---- shared */
.act-toolbar .act-updated {
    font-size: 11px;
    white-space: nowrap;
}

/* Auto-refresh selector + the "sampled N ago" stamp, kept together at the end of the toolbar. */
.act-toolbar .act-auto-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
}

.act-toolbar .act-auto {
    font-size: 11px;
    padding: 2px 4px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface-2);
    color: var(--text-2);
}

.act-toolbar .act-redacted {
    background: var(--warn-soft);
    color: var(--warn);
    border-color: transparent;
}

.act-ok {
    color: var(--ok);
}

.act-warn {
    color: var(--warn);
}

.act-bad {
    color: var(--danger);
    font-weight: 600;
}

table.grid td.act-query,
table.grid td.act-rels,
table.grid td.act-setting-name,
table.grid td.act-rel {
    font-family: var(--mono);
    font-size: 11px;
}

table.grid td.act-query {
    max-width: 360px;
    cursor: default;
}

table.grid.act-tx td.act-query {
    max-width: 520px;
}

table.grid td.act-rel {
    cursor: pointer;
}

table.grid td.act-wait {
    font-size: 11px;
    color: var(--text-2);
}

table.grid td.act-desc {
    max-width: 560px;
    white-space: normal;
    line-height: 1.3;
    height: auto;
    padding-top: 4px;
    padding-bottom: 4px;
    font-size: 11px;
}

.act-hint {
    margin: 0 0 8px;
    max-width: 960px;
    font-size: 11.5px;
    line-height: 1.45;
}

.act-empty-note {
    margin: 4px 0 6px;
    font-size: 12px;
}

.act-sec-wrap {
    max-height: 46vh;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
}

.act-sub {
    margin: 12px 0 6px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-2);
    letter-spacing: 0.01em;
}

/* ---- blocking tree */
.act-cards {
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.act-tree-wrap {
    flex: 1;
    min-height: 120px;
}

table.grid td.act-col-pid {
    white-space: nowrap;
}

.act-toggle {
    width: 18px;
    height: 18px;
    padding: 0;
    margin: 0 4px 0 0;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--text-2);
    font-size: 11px;
    line-height: 16px;
    cursor: pointer;
    vertical-align: middle;
}

.act-toggle:hover:not(:disabled) {
    border-color: var(--border-strong);
    color: var(--text);
}

.act-toggle.act-toggle-leaf {
    border-color: transparent;
    background: transparent;
    color: var(--muted);
    cursor: default;
}

.act-pid {
    font-family: var(--mono);
    font-size: 11.5px;
    font-weight: 600;
    vertical-align: middle;
}

.act-badge-root,
.act-badge-self,
.act-badge-pin {
    margin-left: 6px;
    font-size: 9.5px;
    padding: 0 5px;
    vertical-align: middle;
}

.act-badge-root {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: transparent;
}

tr.act-cycle .act-badge-root {
    background: var(--danger);
    color: #fff;
}

.act-badge-self {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: transparent;
}

.act-badge-pin {
    background: var(--warn-soft);
    color: var(--warn);
    border-color: transparent;
    margin-left: 0;
}

tr.act-root > td {
    background: var(--surface-2);
}

tr.act-root > td.act-col-pid {
    box-shadow: inset 3px 0 0 var(--danger);
}

tr.act-cycle > td.act-col-pid {
    box-shadow: inset 3px 0 0 var(--danger);
}

tr.act-node:not(.act-root) > td.act-col-pid {
    box-shadow: inset 3px 0 0 var(--warn-soft);
}

table.grid td.act-waiters {
    font-weight: 600;
    color: var(--danger);
}

table.grid td.act-col-actions {
    white-space: nowrap;
    max-width: none;
}

.act-col-actions button + button {
    margin-left: 4px;
}

button.act-danger-ghost {
    color: var(--danger);
    border-color: var(--danger-soft);
}

button.act-danger-ghost:hover:not(:disabled) {
    background: var(--danger-soft);
    border-color: var(--danger);
}

.act-confirm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 6px;
    border: 1px solid var(--danger);
    border-radius: var(--r-sm);
    background: var(--danger-soft);
}

.act-confirm-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--danger);
}

.act-foot > span:first-child {
    white-space: nowrap;
}

.act-foot {
    gap: 16px;
}

/* idle-in-transaction bulk control */
.act-idle-box {
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.act-idle-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 12px;
    flex-wrap: wrap;
}

.act-idle-row .eyebrow {
    margin-right: 4px;
}

.act-idle-secs {
    width: 72px;
    text-align: right;
}

.act-idle-exclude {
    width: 220px;
}

.act-idle-aborted {
    font-size: 11.5px;
    color: var(--text-2);
}

.act-idle-preview {
    padding: 0 16px 10px;
}

.act-idle-preview-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    margin: 2px 0 6px;
}

.act-idle-preview-head button {
    margin-left: auto;
}

.act-idle-wrap {
    max-height: 30vh;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
}

/* ---- transactions */
.act-structure {
    padding-top: 14px;
}

.act-sec-body {
    margin-bottom: 4px;
}

.act-verdict {
    font-weight: 600;
}

.act-verdict.act-ok {
    background: var(--ok-soft);
    color: var(--ok);
}

.act-verdict.act-warn,
.act-sev-chip.act-warn {
    background: var(--warn-soft);
    color: var(--warn);
}

.act-verdict.act-bad,
.act-sev-chip.act-bad {
    background: var(--danger-soft);
    color: var(--danger);
}

.act-sev-chip.act-ok {
    background: var(--ok-soft);
    color: var(--ok);
}

.act-sev-chip {
    font-weight: 600;
    font-size: 10px;
    letter-spacing: 0.04em;
}

.act-verdict-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 6px;
    font-size: 12.5px;
    font-weight: 500;
}

.act-verdict-line.act-bad {
    font-weight: 600;
}

tr.act-pins > td {
    background: var(--warn-soft);
}

tr.act-current > td {
    font-weight: 600;
}

tr.act-inactive > td {
    color: var(--muted);
}

table.grid td.act-col-bar,
table.grid th.act-col-bar {
    min-width: 160px;
}

.act-bar {
    position: relative;
    height: 8px;
    width: 150px;
    background: var(--surface-3);
    border-radius: var(--r-sm);
    overflow: hidden;
}

.act-bar-fill {
    height: 100%;
    background: var(--ok);
    border-radius: var(--r-sm);
    transition: width 240ms ease;
}

.act-bar-fill.act-warn {
    background: var(--warn);
}

.act-bar-fill.act-bad {
    background: var(--danger);
}

.act-bar-mark {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: var(--border-strong);
}

table.grid.act-settings td.act-setting-name {
    font-weight: 600;
}
