/* === INHERITED FROM F:\repos\automation-lab\src\app\automation-lab\audits\audit-system.module.css === */

@import url('/css/theme-base.css');

.audit-page {
    min-height: 100vh;
    background:
        radial-gradient(68% 52% at 6% 14%, rgba(112, 58, 139, 0.34) 0%, rgba(255, 110, 199, 0.22) 34%, transparent 72%),
        linear-gradient(135deg, rgba(7, 17, 31, 0.96), rgba(13, 27, 47, 0.98)),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 80px);
    background-attachment: fixed;
    color: var(--foreground);
    font-family: 'Inter Tight', sans-serif;
}

.audit-shell {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 36px 0 72px;
}

.audit-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.audit-title {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.15;
    margin: 0;
    color: var(--foreground);
}

.audit-subtitle {
    color: var(--muted);
    margin: 8px 0 0;
    line-height: 1.6;
}

.audit-link {
    color: var(--accent-cyan);
    font-weight: 700;
    text-decoration: none;
}

.audit-link:hover {
    text-decoration: underline;
}

.audit-panel {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.045));
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 22px 64px rgba(0, 0, 0, 0.32);
    padding: 24px;
}

/* Tab switcher */
.audit-tab-group {
    display: flex;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    font-size: 14px;
    font-weight: 700;
}

.audit-tab {
    padding: 8px 16px;
    text-decoration: none;
    color: var(--accent-cyan);
    background: transparent;
}

.audit-tab:hover {
    background: rgba(255, 255, 255, 0.08);
}

.audit-tab--active {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    color: var(--foreground);
}

/* Report host - audit template content */
.audit-report-host .audit-template {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.045));
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
}

.audit-report-host .audit-template__header {
    border-bottom: 1px solid var(--line);
    padding-bottom: 18px;
}

.audit-report-host .audit-template__eyebrow {
    color: var(--accent-cyan);
    font-size: 12px;
    font-weight: 800;
    margin: 0 0 8px;
    text-transform: uppercase;
}

.audit-report-host .audit-template__title {
    font-size: 30px;
    margin: 0 0 8px;
}

.audit-report-host .audit-template__subtitle,
.audit-report-host .audit-template__body p,
.audit-report-host .audit-template__body li {
    color: var(--muted);
    line-height: 1.7;
}

.audit-report-host .audit-template__meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.audit-report-host .audit-template__meta div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
}

.audit-report-host .audit-template__meta dt {
    color: var(--muted);
    font-size: 12px;
}

.audit-report-host .audit-template__meta dd {
    font-weight: 800;
    margin: 4px 0 0;
}

.audit-report-host .audit-template__body h1,
.audit-report-host .audit-template__body h2,
.audit-report-host .audit-template__body h3 {
    margin: 24px 0 10px;
    color: var(--foreground);
}

.audit-report-host .audit-template__body hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 18px 0;
}

.audit-report-host .audit-template__table-wrap {
    overflow-x: auto;
    margin: 12px 0 18px;
}

.audit-report-host .audit-template__table {
    border-collapse: collapse;
    width: 100%;
}

.audit-report-host .audit-template__table th,
.audit-report-host .audit-template__table td {
    border-bottom: 1px solid var(--line);
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

.audit-report-host .audit-template__table th {
    color: var(--accent-cyan);
}

/* Journey map */
.journey-timeline {
    position: relative;
    padding-left: 52px;
    margin-bottom: 16px;
}

.journey-axis {
    position: absolute;
    left: 24px;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 2px;
    background: linear-gradient(to bottom, var(--accent-cyan), var(--accent-purple));
}

.journey-entry {
    position: relative;
    margin-bottom: 14px;
}

.journey-node {
    position: absolute;
    left: -40px;
    top: 14px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid var(--accent-cyan);
    background: #0d1b2f;
    color: var(--accent-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
}

.journey-stage {
    border-left: 3px solid rgba(78, 231, 240, 0.45);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 16px;
}

.journey-stage-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.journey-stage-title {
    font-size: 18px;
    font-weight: 800;
    margin: 0;
    color: var(--foreground);
}

.journey-badge {
    align-self: flex-start;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: #bccbe4;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
    padding: 5px 10px;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.04);
}

.journey-badge[data-severity="critical"] {
    background: rgba(255, 121, 144, 0.2);
    border-color: rgba(255, 121, 144, 0.44);
    color: #ff7990;
}

.journey-badge[data-severity="high"] {
    background: rgba(255, 204, 76, 0.2);
    border-color: rgba(255, 204, 76, 0.45);
    color: var(--accent-yellow);
}

.journey-badge[data-severity="medium"] {
    background: rgba(125, 211, 252, 0.2);
    border-color: rgba(125, 211, 252, 0.44);
    color: #7dd3fc;
}

.journey-badge[data-severity="low"] {
    background: rgba(123, 228, 149, 0.2);
    border-color: rgba(123, 228, 149, 0.42);
    color: #7be495;
}

.journey-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.journey-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.journey-detail {
    color: var(--muted);
    line-height: 1.65;
}

.journey-detail strong {
    color: var(--foreground);
    display: block;
    margin-bottom: 4px;
}

.journey-actions-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.journey-action-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    min-width: 0;
    overflow: hidden;
}

.journey-action-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 800;
    color: var(--foreground);
}

.journey-action-list {
    margin: 0;
    padding-left: 20px;
    color: var(--muted);
    line-height: 1.55;
    list-style: decimal;
}

.journey-action-item {
    margin-bottom: 14px;
}

.journey-action-item:last-child {
    margin-bottom: 0;
}

.journey-action-lead {
    margin: 0;
    color: var(--foreground);
    line-height: 1.5;
}

.journey-action-body {
    margin: 6px 0 0 0;
    color: var(--muted);
}

.journey-action-meta {
    margin: 8px 0 0 0;
    color: var(--muted);
}

.journey-action-meta strong {
    color: var(--accent-cyan);
}

/* Loading */
.journey-loader-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
    padding: 14px 6px;
}

.journey-loader-headline {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.25;
    margin: 0;
    color: var(--foreground);
}

.journey-loader-spinner {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 0;
    border-bottom: 2px solid var(--accent-cyan);
    animation: journey-spin 1s linear infinite;
}

.journey-loader-bar {
    width: min(560px, 100%);
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.journey-loader-fill {
    display: block;
    min-width: 2px;
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
    transition: width 1s ease;
}

@keyframes journey-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@media (max-width: 760px) {
    .audit-shell {
        width: min(1180px, calc(100% - 24px));
        padding: 22px 0 44px;
    }
    .audit-topbar {
        flex-direction: column;
        align-items: stretch;
    }
    .journey-detail-grid,
    .journey-summary-grid,
    .journey-actions-grid {
        grid-template-columns: 1fr;
    }
    .audit-report-host .audit-template__meta {
        grid-template-columns: 1fr;
    }
    .journey-timeline { padding-left: 40px; }
    .journey-axis { left: 18px; }
    .journey-node { left: -30px; }
}
