/* ── PatchWarden dark admin theme ───────────────────────────────────────────── */

/* ── Environment badge ──────────────────────────────────────────────────── */
.env-badge {
    display:        inline-block;
    padding:        2px 8px;
    border-radius:  4px;
    font-size:      0.65rem;
    font-weight:    700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    vertical-align: middle;
    font-family:    var(--as-font-mono, monospace);
}

.env-badge--prod {
    background: #b91c1c;
    color:      #fff;
}

.env-badge--staging {
    background: #d97706;
    color:      #1c1100;
}

.env-badge--dev {
    background: #1d4ed8;
    color:      #fff;
}

/* ── System Info table ───────────────────────────────────────────────────── */
.as-info-table td:first-child {
    width:   200px;
    color:   var(--as-muted);
    font-size: 0.85rem;
}

.as-info-table .as-info-section-header td {
    padding-top: 1rem;
    font-size:   0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--as-muted);
    border-bottom: 1px solid var(--as-border);
}

:root {
    --as-bg:          #0d1117;
    --as-surface:     #161b22;
    --as-border:      #30363d;
    --as-text:        #e6edf3;
    --as-muted:       #8b949e;
    --as-accent:      #58a6ff;
    --as-accent-dark: #1f6feb;
    --as-danger:      #f85149;
    --as-success:     #3fb950;
    --as-warning:     #d29922;
    --as-sidebar-w:   240px;
}

/* ── Base ──────────────────────────────────────────────────────────────────── */

html, body {
    margin: 0;
    padding: 0;
    background-color: var(--as-bg);
    color: var(--as-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
}

/* ── Page layout ───────────────────────────────────────────────────────────── */

.as-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────────────────────────── */

.as-sidebar {
    width: var(--as-sidebar-w);
    flex-shrink: 0;
    background-color: var(--as-surface);
    border-right: 1px solid var(--as-border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.as-sidebar-brand {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--as-border);
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--as-accent);
    text-decoration: none;
}

.as-sidebar-brand i { font-size: 1.4rem; }

.as-nav {
    list-style: none;
    margin: 0;
    padding: .5rem 0;
    flex: 1;
}

.as-nav-item { margin: 1px 0; }

.as-nav-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem 1rem;
    color: var(--as-muted);
    text-decoration: none;
    border-radius: 6px;
    margin: 0 .5rem;
    transition: background .15s, color .15s;
    font-size: .875rem;
}

.as-nav-link:hover {
    background-color: rgba(88, 166, 255, .08);
    color: var(--as-text);
}

.as-nav-link.active {
    background-color: rgba(88, 166, 255, .15);
    color: var(--as-accent);
    font-weight: 500;
}

.as-nav-link i { font-size: 1rem; width: 1.1rem; text-align: center; }

.as-nav-section {
    padding: .75rem 1rem .25rem;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--as-muted);
}

/* ── Top bar ───────────────────────────────────────────────────────────────── */

.as-topbar {
    background-color: var(--as-surface);
    border-bottom: 1px solid var(--as-border);
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.as-topbar-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--as-text);
    flex: 1;
}

.as-user-menu .dropdown-toggle {
    background: none;
    border: 1px solid var(--as-border);
    color: var(--as-text);
    border-radius: 6px;
    padding: .35rem .75rem;
    font-size: .875rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.as-user-menu .dropdown-menu {
    background-color: var(--as-surface);
    border: 1px solid var(--as-border);
    min-width: 200px;
}

.as-user-menu .dropdown-item {
    color: var(--as-text);
    font-size: .875rem;
}

.as-user-menu .dropdown-item:hover {
    background-color: rgba(88, 166, 255, .08);
    color: var(--as-accent);
}

/* ── Main content ──────────────────────────────────────────────────────────── */

.as-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.as-content {
    flex: 1;
    padding: 1.5rem;
}

/* ── Page header ───────────────────────────────────────────────────────────── */

.as-page-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--as-border);
}

.as-page-header h1 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
    color: var(--as-text);
}

/* ── Cards ─────────────────────────────────────────────────────────────────── */

.as-card {
    background-color: var(--as-surface);
    border: 1px solid var(--as-border);
    border-radius: 8px;
    padding: 1.25rem;
}

/* ── Login page ────────────────────────────────────────────────────────────── */

.as-auth-page {
    background-color: var(--as-bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.as-login-card {
    background-color: var(--as-surface);
    border: 1px solid var(--as-border);
    border-radius: 12px;
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
}

.as-login-logo {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--as-accent);
    font-size: 1.6rem;
    font-weight: 700;
}

.as-login-logo i { font-size: 2rem; display: block; margin-bottom: .5rem; }

/* ── Toast notifications ────────────────────────────────────────────────────── */

.as-toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    min-width: 320px;
    max-width: 480px;
}

.as-toast {
    background-color: var(--as-surface);
    border: 1px solid var(--as-border);
    border-radius: 8px;
    padding: .75rem 1rem;
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    box-shadow: 0 4px 16px rgba(0,0,0,.4);
    animation: as-toast-in .2s ease-out;
}

@keyframes as-toast-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.as-toast-info    { border-left: 3px solid var(--as-accent); }
.as-toast-success { border-left: 3px solid var(--as-success); }
.as-toast-warning { border-left: 3px solid var(--as-warning); }
.as-toast-error   { border-left: 3px solid var(--as-danger); }

.as-toast-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: .1rem; }
.as-toast-info    .as-toast-icon { color: var(--as-accent); }
.as-toast-success .as-toast-icon { color: var(--as-success); }
.as-toast-warning .as-toast-icon { color: var(--as-warning); }
.as-toast-error   .as-toast-icon { color: var(--as-danger); }

.as-toast-body { flex: 1; font-size: .875rem; color: var(--as-text); }

/* ── Bootstrap dark overrides ──────────────────────────────────────────────── */

.form-control, .form-select {
    background-color: var(--as-bg);
    border-color: var(--as-border);
    color: var(--as-text);
}

.form-control:focus, .form-select:focus {
    background-color: var(--as-bg);
    border-color: var(--as-accent);
    color: var(--as-text);
    box-shadow: 0 0 0 .2rem rgba(88, 166, 255, .25);
}

.form-control::placeholder { color: var(--as-muted); }
.form-label               { color: var(--as-text); font-size: .875rem; }

.btn-primary {
    background-color: var(--as-accent-dark);
    border-color: var(--as-accent-dark);
}

.btn-primary:hover  { background-color: var(--as-accent); border-color: var(--as-accent); }
.btn-outline-secondary { border-color: var(--as-border); color: var(--as-muted); }
.btn-outline-secondary:hover { border-color: var(--as-muted); color: var(--as-text); background: none; }

.table { color: var(--as-text); }
.table td, .table th { border-color: var(--as-border); }
.table thead th { color: var(--as-muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }

.badge { font-size: .7rem; }

/* ── Blazor error UI ───────────────────────────────────────────────────────── */

#blazor-error-ui {
    background: var(--as-danger);
    color: white;
    bottom: 0;
    left: 0;
    right: 0;
    position: fixed;
    padding: .5rem 1rem;
    display: none;
    z-index: 10000;
}

#blazor-error-ui .dismiss { cursor: pointer; float: right; }

.blazor-error-boundary::after {
    content: "An error occurred.";
    background-color: var(--as-danger);
    color: white;
    padding: .5rem 1rem;
    border-radius: 6px;
    display: block;
}

/* ── Metric cards (dashboard) ──────────────────────────────────────────────── */

.as-metric-card {
    background-color: var(--as-surface);
    border: 1px solid var(--as-border);
    border-radius: 8px;
    padding: 1.5rem 1.25rem;
    text-align: center;
}

.as-metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: .35rem;
}

.as-metric-label {
    font-size: .75rem;
    color: var(--as-muted);
    text-transform: uppercase;
    letter-spacing: .08em;
}

/* ── Section headers (within cards) ───────────────────────────────────────── */

.as-section-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--as-border);
}

.as-section-header h2 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: var(--as-text);
}

/* ── Status badges ─────────────────────────────────────────────────────────── */

.as-status-badge {
    display: inline-block;
    padding: .2rem .5rem;
    border-radius: 4px;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .03em;
    white-space: nowrap;
}

.as-status-badge.badge-success   { background: rgba(63,185,80,.15);  color: var(--as-success); border: 1px solid rgba(63,185,80,.3); }
.as-status-badge.badge-danger    { background: rgba(248,81,73,.12);  color: var(--as-danger);  border: 1px solid rgba(248,81,73,.3); }
.as-status-badge.badge-pending   { background: rgba(210,153,34,.12); color: var(--as-warning); border: 1px solid rgba(210,153,34,.3); }
.as-status-badge.badge-info      { background: rgba(88,166,255,.12); color: var(--as-accent);  border: 1px solid rgba(88,166,255,.3); }
.as-status-badge.badge-running   { background: rgba(88,166,255,.2);  color: var(--as-accent);  border: 1px solid var(--as-accent-dark); }
.as-status-badge.badge-secondary { background: rgba(139,148,158,.1); color: var(--as-muted);   border: 1px solid var(--as-border); }

/* ── Pipeline visualizer ───────────────────────────────────────────────────── */

.as-pipeline {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: .2rem;
    overflow-x: auto;
    padding: .25rem 0;
}

.as-step {
    display: inline-block;
    padding: .25rem .65rem;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 500;
    border: 1px solid;
    white-space: nowrap;
    transition: all .15s;
}

.as-step-pending { background: transparent;             border-color: var(--as-border);       color: var(--as-muted); }
.as-step-active  { background: rgba(88,166,255,.15);    border-color: var(--as-accent);        color: var(--as-accent); font-weight: 600; }
.as-step-done    { background: rgba(63,185,80,.1);      border-color: rgba(63,185,80,.4);      color: var(--as-success); }
.as-step-error   { background: rgba(248,81,73,.1);      border-color: rgba(248,81,73,.4);      color: var(--as-danger); }

.as-pipeline-arrow { font-size: .65rem; color: var(--as-border); flex-shrink: 0; }

/* ── Clickable table rows ──────────────────────────────────────────────────── */

.as-table-clickable tbody tr {
    cursor: pointer;
    transition: background .1s;
}

.as-table-clickable tbody tr:hover {
    background: rgba(88, 166, 255, .05);
}

/* ── Spinner / empty state ─────────────────────────────────────────────────── */

.as-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

.as-empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--as-muted);
    font-size: .875rem;
}

/* ── Job detail: metadata list ─────────────────────────────────────────────── */

.as-metadata {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: .4rem .75rem;
    font-size: .875rem;
    margin: 0;
}

.as-metadata dt {
    color: var(--as-muted);
    font-weight: 400;
    font-size: .8rem;
    padding-top: .1rem;
}

.as-metadata dd { margin: 0; color: var(--as-text); word-break: break-all; }

/* ── Findings pills ────────────────────────────────────────────────────────── */

.as-finding-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: .5rem .85rem;
    border-radius: 8px;
    border: 1px solid var(--pill-color, var(--as-border));
    background: color-mix(in srgb, var(--pill-color, var(--as-muted)) 10%, transparent);
    min-width: 60px;
}

.as-finding-pill .val {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--pill-color, var(--as-text));
    line-height: 1;
}

.as-finding-pill .lbl {
    font-size: .65rem;
    color: var(--as-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-top: .15rem;
}

/* ── Code / pre block ──────────────────────────────────────────────────────── */

.as-code-block {
    background: var(--as-bg);
    border: 1px solid var(--as-border);
    border-radius: 6px;
    padding: .75rem 1rem;
    font-size: .8rem;
    color: var(--as-muted);
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
}

/* ── Collapse button ───────────────────────────────────────────────────────── */

.as-collapse-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--as-muted);
    cursor: pointer;
}

.as-collapse-btn:hover { color: var(--as-text); }

/* ── text-monospace util ───────────────────────────────────────────────────── */

.text-monospace { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; }

/* ── Report viewer prose ───────────────────────────────────────────────────── */

.as-report-body {
    color: var(--as-text);
    font-size: .9rem;
    line-height: 1.7;
}

.as-report-body h1,
.as-report-body h2,
.as-report-body h3,
.as-report-body h4 {
    color: var(--as-text);
    margin-top: 1.75em;
    margin-bottom: .5em;
    font-weight: 600;
}

.as-report-body h1 { font-size: 1.5rem; border-bottom: 1px solid var(--as-border); padding-bottom: .4em; }
.as-report-body h2 { font-size: 1.2rem; border-bottom: 1px solid var(--as-border); padding-bottom: .3em; }
.as-report-body h3 { font-size: 1rem; }

.as-report-body p  { margin: .75em 0; }
.as-report-body ul,
.as-report-body ol { padding-left: 1.5em; margin: .5em 0; }
.as-report-body li { margin: .25em 0; }

.as-report-body code {
    background: var(--as-bg);
    border: 1px solid var(--as-border);
    border-radius: 4px;
    padding: .1em .35em;
    font-size: .85em;
    font-family: "SFMono-Regular", Consolas, monospace;
    color: var(--as-accent);
}

.as-report-body pre {
    background: var(--as-bg);
    border: 1px solid var(--as-border);
    border-radius: 6px;
    padding: 1em;
    overflow-x: auto;
    margin: 1em 0;
}

.as-report-body pre code {
    background: none;
    border: none;
    padding: 0;
    color: var(--as-text);
    font-size: .8rem;
}

.as-report-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    font-size: .85rem;
}

.as-report-body th,
.as-report-body td {
    border: 1px solid var(--as-border);
    padding: .4em .7em;
    text-align: left;
}

.as-report-body th {
    background: var(--as-bg);
    color: var(--as-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: .75rem;
    letter-spacing: .04em;
}

.as-report-body blockquote {
    border-left: 3px solid var(--as-accent-dark);
    margin: 1em 0;
    padding: .5em 1em;
    color: var(--as-muted);
    background: var(--as-bg);
    border-radius: 0 4px 4px 0;
}

.as-report-body a { color: var(--as-accent); }
.as-report-body a:hover { color: var(--as-text); }

.as-report-body hr {
    border: none;
    border-top: 1px solid var(--as-border);
    margin: 1.5em 0;
}

/* ── Severity badge variant ─────────────────────────────────────────────────── */

.as-status-badge.badge-high {
    background: rgba(255, 107, 53, .15);
    color: #ff6b35;
    border-color: rgba(255, 107, 53, .35);
}

/* ── Tab control ────────────────────────────────────────────────────────────── */

.as-tabs { }

.as-tab-bar {
    display: flex;
    gap: .25rem;
    border-bottom: 1px solid var(--as-border);
    margin-bottom: 1rem;
    padding-bottom: 0;
}

.as-tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--as-muted);
    cursor: pointer;
    font-size: .875rem;
    font-weight: 500;
    margin-bottom: -1px;
    padding: .5rem .9rem;
    transition: color .15s, border-color .15s;
}

.as-tab-btn:hover { color: var(--as-text); }

.as-tab-btn.active {
    border-bottom-color: var(--as-accent);
    color: var(--as-accent);
}

.as-tab-content { }

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

.as-modal-backdrop {
    align-items: center;
    background: rgba(0, 0, 0, .55);
    bottom: 0;
    display: flex;
    justify-content: center;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 1000;
}

.as-modal {
    background: var(--as-surface);
    border: 1px solid var(--as-border);
    border-radius: 8px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 0;
    width: min(540px, 92vw);
}

.as-modal-header {
    align-items: center;
    border-bottom: 1px solid var(--as-border);
    display: flex;
    justify-content: space-between;
    padding: .9rem 1.2rem;
}

.as-modal-title {
    color: var(--as-text);
    font-size: 1rem;
    font-weight: 600;
}

.as-modal-close {
    background: none;
    border: none;
    color: var(--as-muted);
    cursor: pointer;
    font-size: 1.3rem;
    line-height: 1;
    padding: 0 .2rem;
}

.as-modal-close:hover { color: var(--as-text); }

.as-modal-body {
    padding: 1.2rem;
}

.as-modal-footer {
    border-top: 1px solid var(--as-border);
    display: flex;
    justify-content: flex-end;
    padding: .8rem 1.2rem;
}

/* ── File upload ────────────────────────────────────────────────────────────── */

.as-file-upload { }

.as-file-input {
    background: var(--as-bg);
    border-color: var(--as-border);
    color: var(--as-text);
    font-size: .8rem;
}

.as-file-input::file-selector-button {
    background: var(--as-surface);
    border-color: var(--as-border);
    color: var(--as-text);
    font-size: .8rem;
}

.as-file-name {
    color: var(--as-text);
    font-size: .8rem;
    margin-top: .35rem;
}

/* ── Form label util ────────────────────────────────────────────────────────── */

.as-form-label {
    color: var(--as-muted);
    font-size: .75rem;
    font-weight: 500;
    letter-spacing: .04em;
    margin-bottom: .25rem;
    text-transform: uppercase;
}

/* ── Input theming ──────────────────────────────────────────────────────────── */

.as-input {
    background: var(--as-bg) !important;
    border-color: var(--as-border) !important;
    color: var(--as-text) !important;
}

.as-input:focus {
    border-color: var(--as-accent) !important;
    box-shadow: 0 0 0 2px rgba(88,166,255,.15) !important;
}

.as-input option {
    background: var(--as-surface);
    color: var(--as-text);
}

/* ── Activity tab placeholder ───────────────────────────────────────────────── */

.as-activity-tab { min-height: 80px; }

/* ── Wizard ─────────────────────────────────────────────────────────────────── */

.as-wizard {
    max-width: 820px;
    margin: 0 auto;
}

.as-wizard-steps {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.as-wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    flex-shrink: 0;
}

.as-wizard-step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--as-border);
    background: var(--as-surface);
    color: var(--as-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    font-weight: 600;
    transition: background .2s, border-color .2s, color .2s;
}

.as-wizard-step.active .as-wizard-step-dot {
    background: var(--as-accent);
    border-color: var(--as-accent);
    color: #fff;
}

.as-wizard-step.done .as-wizard-step-dot {
    background: var(--as-success);
    border-color: var(--as-success);
    color: #fff;
}

.as-wizard-step-label {
    font-size: .72rem;
    color: var(--as-muted);
    white-space: nowrap;
    text-align: center;
}

.as-wizard-step.active .as-wizard-step-label { color: var(--as-text); font-weight: 600; }
.as-wizard-step.done  .as-wizard-step-label  { color: var(--as-success); }

.as-wizard-connector {
    flex: 1;
    height: 2px;
    background: var(--as-border);
    margin: 0 .35rem;
    margin-bottom: 1.35rem; /* align with dot center */
    transition: background .2s;
}

.as-wizard-connector.done { background: var(--as-success); }

.as-wizard-body {
    margin-bottom: 1rem;
    min-height: 280px;
}

.as-wizard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: .75rem;
    border-top: 1px solid var(--as-border);
}

.as-wizard-step-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--as-text);
    margin-bottom: 1rem;
}

.as-wizard-context-bar {
    background: var(--as-surface);
    border: 1px solid var(--as-border);
    border-radius: 6px;
    padding: .45rem .75rem;
    font-size: .82rem;
    color: var(--as-text);
    margin-bottom: 1rem;
}

.as-wizard-success-box {
    background: rgba(63, 185, 80, .1);
    border: 1px solid var(--as-success);
    border-radius: 6px;
    padding: .75rem 1rem;
    font-size: .9rem;
    color: var(--as-text);
}

/* ── ValidationSummary ──────────────────────────────────────────────────────── */

.as-validation-summary {
    background: rgba(248, 81, 73, .1);
    border: 1px solid var(--as-danger);
    border-radius: 6px;
    padding: .6rem 1rem;
    margin-bottom: 1rem;
    font-size: .82rem;
    color: var(--as-danger);
}

.as-validation-summary ul {
    margin: 0;
    padding-left: 1.1rem;
}

.as-validation-summary li + li { margin-top: .2rem; }

/* ── CronExpressionHelp ─────────────────────────────────────────────────────── */

.as-cron-help-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.as-cron-help-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--as-muted);
    cursor: pointer;
    font-size: .9rem;
    line-height: 1;
}

.as-cron-help-btn:hover { color: var(--as-accent); }

.as-cron-popover {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 100;
    background: var(--as-surface);
    border: 1px solid var(--as-border);
    border-radius: 6px;
    padding: .75rem 1rem;
    min-width: 280px;
    box-shadow: 0 4px 16px rgba(0,0,0,.4);
}

.as-cron-popover-title {
    font-size: .7rem;
    font-weight: 600;
    color: var(--as-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .4rem;
}

.as-cron-syntax {
    display: block;
    font-size: .75rem;
    color: var(--as-accent);
    margin-bottom: .5rem;
}

.as-cron-examples {
    border-collapse: collapse;
    width: 100%;
}

.as-cron-examples td {
    padding: .15rem .25rem;
    font-size: .78rem;
    color: var(--as-text);
}

.as-cron-examples td:first-child {
    color: var(--as-accent);
    padding-right: .75rem;
    white-space: nowrap;
}

/* ── JsonEditor ─────────────────────────────────────────────────────────────── */

.as-json-editor {
    font-family: "Cascadia Code", "Fira Code", "Consolas", monospace !important;
    font-size: .8rem !important;
    resize: vertical;
}

/* ── Field validation error ─────────────────────────────────────────────────── */

.as-field-error {
    color: var(--as-danger);
    font-size: .78rem;
    margin-top: .25rem;
}

/* ── Report viewer layout ────────────────────────────────────────────────────── */

.as-report-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.as-report-layout {
    display: grid;
    grid-template-columns: 210px 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 900px) {
    .as-report-layout {
        grid-template-columns: 1fr;
    }
    .as-toc-sidebar {
        display: none;
    }
}

/* ── TOC sidebar ─────────────────────────────────────────────────────────────── */

.as-toc-sidebar {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    background-color: var(--as-surface);
    border: 1px solid var(--as-border);
    border-radius: 8px;
    padding: .75rem;
}

.as-toc-header {
    font-size: .7rem;
    font-weight: 600;
    color: var(--as-muted);
    text-transform: uppercase;
    letter-spacing: .07em;
    margin-bottom: .5rem;
}

.as-toc-link {
    display: block;
    padding: .2rem .35rem;
    border-radius: 4px;
    color: var(--as-muted);
    text-decoration: none;
    font-size: .8rem;
    line-height: 1.4;
    transition: color .12s, background .12s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.as-toc-link:hover {
    color: var(--as-text);
    background-color: rgba(255,255,255,.05);
}

.as-toc-link.active {
    color: var(--as-accent);
    background-color: rgba(88,166,255,.08);
}

.as-toc-l2 {
    font-weight: 500;
}

.as-toc-l3 {
    padding-left: 1rem;
    font-size: .77rem;
}

/* ── GitHub-style markdown prose ─────────────────────────────────────────────── */

.as-report-body {
    color: var(--as-text);
    line-height: 1.7;
    word-break: break-word;
}

.as-report-body h1,
.as-report-body h2,
.as-report-body h3,
.as-report-body h4 {
    margin-top: 1.5em;
    margin-bottom: .5em;
    border-bottom: 1px solid var(--as-border);
    padding-bottom: .3em;
    font-weight: 600;
    color: var(--as-text);
}

.as-report-body h1 { font-size: 1.6rem; }
.as-report-body h2 { font-size: 1.3rem; }
.as-report-body h3 { font-size: 1.1rem; }
.as-report-body h4 { font-size: 1rem; border-bottom: none; }

.as-report-body p {
    margin: .75em 0;
}

.as-report-body a {
    color: var(--as-accent);
    text-decoration: none;
}

.as-report-body a:hover {
    text-decoration: underline;
}

.as-report-body code {
    font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
    font-size: .875em;
    background: rgba(110,118,129,.15);
    border-radius: 4px;
    padding: .15em .35em;
}

.as-report-body pre {
    background: var(--as-surface);
    border: 1px solid var(--as-border);
    border-radius: 6px;
    padding: 1em 1.25em;
    overflow-x: auto;
    margin: 1em 0;
}

.as-report-body pre code {
    background: transparent;
    padding: 0;
    font-size: .85rem;
}

.as-report-body blockquote {
    border-left: 4px solid var(--as-border);
    margin: 1em 0;
    padding: .5em 1em;
    color: var(--as-muted);
}

.as-report-body ul,
.as-report-body ol {
    margin: .75em 0;
    padding-left: 2em;
}

.as-report-body li {
    margin: .3em 0;
}

.as-report-body hr {
    border: none;
    border-top: 1px solid var(--as-border);
    margin: 1.5em 0;
}

/* ── Report tables ───────────────────────────────────────────────────────────── */

.as-table-wrap {
    overflow-x: auto;
    margin: 1em 0;
    border-radius: 6px;
    border: 1px solid var(--as-border);
}

.as-report-body table {
    border-collapse: collapse;
    width: 100%;
    min-width: 400px;
    font-size: .875rem;
}

.as-report-body th,
.as-report-body td {
    border: 1px solid var(--as-border);
    padding: .45em .7em;
    text-align: left;
    vertical-align: top;
}

.as-report-body th {
    background-color: var(--as-surface);
    font-weight: 600;
    white-space: nowrap;
}

.as-report-body tr:nth-child(even) td {
    background-color: rgba(255,255,255,.02);
}

/* ── Collapsible sections (from JS initReport or CollapsibleSection.razor) ────── */

.as-report-section {
    margin-bottom: .5rem;
    border: 1px solid var(--as-border);
    border-radius: 6px;
    overflow: hidden;
}

.as-report-section-title {
    list-style: none;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem .85rem;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--as-text);
    background-color: var(--as-surface);
    user-select: none;
}

.as-report-section-title::-webkit-details-marker { display: none; }

.as-report-section-title::before {
    content: '▶';
    font-size: .65em;
    color: var(--as-muted);
    transition: transform .15s;
    flex-shrink: 0;
}

.as-report-section[open] > .as-report-section-title::before {
    transform: rotate(90deg);
}

.as-report-section-body,
.as-report-section > :not(summary) {
    padding: .75rem 1rem;
}

/* ── Inline findings pills ───────────────────────────────────────────────────── */

.as-metadata-inline {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1.25rem;
}

.as-metadata-inline dt {
    font-size: .75rem;
    font-weight: 600;
    color: var(--as-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.as-metadata-inline dd {
    margin: 0;
    font-size: .875rem;
}

.as-findings-inline {
    display: inline-flex;
    flex-wrap: wrap;
    gap: .25rem;
}

.as-fi {
    font-size: .75rem;
    font-weight: 700;
    padding: .1em .4em;
    border-radius: 4px;
    border: 1px solid currentColor;
}

.fi-critical { color: var(--as-danger); }
.fi-high     { color: #ff6b35; }
.fi-medium   { color: var(--as-warning); }
.fi-low      { color: var(--as-accent); }
.fi-info     { color: var(--as-muted); }

/* ── Print styles ────────────────────────────────────────────────────────────── */

@media print {
    .as-sidebar,
    .as-toc-sidebar,
    .as-report-actions,
    .as-page-header .btn,
    nav[aria-label],
    .as-toast-container {
        display: none !important;
    }

    .as-layout {
        display: block;
    }

    .as-main {
        margin: 0;
        padding: 0;
    }

    .as-report-layout {
        display: block;
    }

    .as-report-body {
        color: #000;
    }

    .as-report-body h1,
    .as-report-body h2,
    .as-report-body h3,
    .as-report-body h4 {
        color: #000;
        border-bottom-color: #ccc;
    }

    .as-report-body pre,
    .as-report-body code {
        background: #f5f5f5;
        color: #000;
        border-color: #ccc;
    }

    .as-report-body table,
    .as-report-body th,
    .as-report-body td {
        border-color: #ccc;
        color: #000;
    }

    .as-report-section {
        border: none;
        break-inside: avoid;
    }

    .as-report-section-title {
        background: transparent;
        color: #000;
        font-size: 1.2rem;
    }

    details { display: block; }
    details > * { display: block; }
}
