@import url('/style/pages/web/web-console.css');

/* ==========================================================================
   Website Audit - Executive Audit Reports & Crawl History Hub (v10)
   Route: /web/reports
   Strict Standards: 100% :root CSS Tokens, Zero Hardcoded Colors, Print & RTL Ready
   ========================================================================== */

[v-cloak] {
    display: none !important;
}

#reports-app,
.rep-page {
    --rep-on-accent: var(--card-bg);
}

[data-theme="dark"] #reports-app,
[data-theme="sunmoon"] #reports-app,
[data-theme="dark"] .rep-page,
[data-theme="sunmoon"] .rep-page {
    --rep-on-accent: var(--text-main);
}

.rep-page {
    width: 100%;
    max-width: 1480px;
    margin-inline: auto;
    padding: 16px 20px 72px;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rep-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rep-ico svg,
.rep-ico i {
    width: 15px !important;
    height: 15px !important;
}

[dir="rtl"] .rep-flip-rtl svg,
[dir="rtl"] .rep-flip-rtl i {
    transform: rotate(180deg);
}

.rep-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.rep-ltr {
    direction: ltr;
    unicode-bidi: isolate;
}

/* --- 1. Top Utility Bar --- */
.rep-util-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.rep-util-grp {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rep-pill-link,
.rep-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    border-radius: 10px;
    font: inherit;
    font-size: 0.79rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.rep-pill-link:hover,
.rep-pill-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.rep-pill-link.is-cta,
.rep-btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--rep-on-accent);
}

.rep-pill-link.is-cta:hover,
.rep-btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: var(--rep-on-accent);
}

.rep-pill-btn:disabled,
.rep-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Custom Glassmorphic Dropdown System (Zero Native <select>) */
.rep-dd {
    position: relative;
    display: inline-flex;
    min-width: 0;
}

.rep-dd.is-full {
    width: 100%;
}

.rep-dd-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 7px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-main);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
    min-width: 0;
}

.rep-util-bar .rep-dd-trigger {
    background: var(--card-bg);
}

.rep-dd-trigger:hover,
.rep-dd.is-open .rep-dd-trigger {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.rep-dd-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
    text-align: start;
}

.rep-dd-chev svg,
.rep-dd-chev i {
    width: 14px !important;
    height: 14px !important;
    transition: transform 0.18s ease;
}

.rep-dd.is-open .rep-dd-chev svg,
.rep-dd.is-open .rep-dd-chev i {
    transform: rotate(180deg);
}

.rep-dd-menu {
    position: absolute;
    top: calc(100% + 6px);
    inset-inline-start: 0;
    min-width: 100%;
    width: max-content;
    max-width: 320px;
    max-height: 250px;
    overflow-y: auto;
    padding: 6px;
    border-radius: 13px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 90;
    animation: rep-dd-in 0.15s ease;
}

.rep-dd-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border-radius: 9px;
    border: none;
    background: transparent;
    color: var(--text-main);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    text-align: start;
    transition: background 0.14s ease, color 0.14s ease;
}

.rep-dd-item:hover {
    background: var(--bg-body);
}

.rep-dd-item.is-selected {
    background: color-mix(in srgb, var(--primary-color) 12%, var(--bg-body));
    color: var(--primary-color);
    font-weight: 800;
}

.rep-dd-chk {
    color: var(--primary-color);
}

@keyframes rep-dd-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.rep-domain-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 13px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.rep-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 20%, transparent);
}

/* --- 2. Executive Hero + Health Cockpit --- */
.rep-hero-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 22px 24px;
    border-radius: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.rep-hero-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.rep-hero-brand {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.rep-hero-ico {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--primary-color) 12%, var(--bg-body));
    border: 1px solid color-mix(in srgb, var(--primary-color) 30%, var(--border-color));
    color: var(--primary-color);
    flex-shrink: 0;
}

.rep-hero-ico svg,
.rep-hero-ico i {
    width: 24px !important;
    height: 24px !important;
}

.rep-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--text-main);
    line-height: 1.25;
}

.rep-subtitle {
    margin: 5px 0 0;
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.5;
    max-width: 780px;
}

.rep-hero-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.rep-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    border-radius: 12px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    font-size: 0.77rem;
    font-weight: 800;
    color: var(--text-muted);
}

.rep-meta-chip strong {
    color: var(--text-main);
}

/* Health Ring + 4 KPI Cards Grid */
.rep-cockpit-grid {
    display: grid;
    grid-template-columns: 310px 1fr;
    gap: 16px;
    align-items: stretch;
}

.rep-health-card {
    --rep-grade: var(--success);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 20px;
    border-radius: 16px;
    background: var(--bg-body);
    border: 1px solid color-mix(in srgb, var(--rep-grade) 32%, var(--border-color));
    position: relative;
    overflow: hidden;
}

.rep-health-card.grade-success { --rep-grade: var(--success); }
.rep-health-card.grade-warning { --rep-grade: var(--warning); }
.rep-health-card.grade-danger { --rep-grade: var(--danger); }

.rep-gauge-wrap {
    position: relative;
    width: 136px;
    height: 136px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rep-gauge-svg {
    width: 136px;
    height: 136px;
    transform: rotate(-90deg);
}

.rep-gauge-track {
    fill: none;
    stroke: color-mix(in srgb, var(--border-color) 70%, transparent);
    stroke-width: 10;
}

.rep-gauge-arc {
    fill: none;
    stroke: var(--rep-grade);
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 346;
    transition: stroke-dashoffset 0.55s ease;
}

.rep-gauge-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.rep-gauge-num {
    font-size: 1.9rem;
    font-weight: 900;
    color: var(--text-main);
    line-height: 1;
}

.rep-gauge-cap {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
}

.rep-health-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.rep-health-lbl {
    font-size: 0.92rem;
    font-weight: 900;
    color: var(--text-main);
}

.rep-grade-pill {
    padding: 2px 9px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 900;
    background: color-mix(in srgb, var(--rep-grade) 15%, var(--card-bg));
    border: 1px solid color-mix(in srgb, var(--rep-grade) 35%, var(--border-color));
    color: var(--rep-grade);
}

.rep-health-foot {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-muted);
}

.rep-health-foot-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rep-health-foot-row strong {
    color: var(--text-main);
}

/* 4 KPI Bento Cards */
.rep-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.rep-kpi-card {
    --kpi-c: var(--primary-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 18px;
    border-radius: 16px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.18s ease, transform 0.18s ease;
}

.rep-kpi-card:hover {
    border-color: var(--kpi-c);
    transform: translateY(-2px);
}

.rep-kpi-card.is-blue { --kpi-c: var(--blue); }
.rep-kpi-card.is-danger { --kpi-c: var(--danger); }
.rep-kpi-card.is-success { --kpi-c: var(--success); }
.rep-kpi-card.is-primary { --kpi-c: var(--primary-color); }

.rep-kpi-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.rep-kpi-lbl {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--text-muted);
}

.rep-kpi-ico {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--kpi-c) 12%, var(--card-bg));
    color: var(--kpi-c);
}

.rep-kpi-val {
    font-size: 1.65rem;
    font-weight: 900;
    color: var(--text-main);
    line-height: 1.1;
}

.rep-kpi-meter {
    height: 5px;
    width: 100%;
    border-radius: 999px;
    background: color-mix(in srgb, var(--border-color) 65%, transparent);
    overflow: hidden;
}

.rep-kpi-meter span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--kpi-c);
    transition: width 0.35s ease;
}

.rep-kpi-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-muted);
}

/* --- 3. Analytics & Scan Diff Split Grid --- */
.rep-analytics-grid {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 16px;
    align-items: stretch;
}

.rep-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px 22px;
    border-radius: 18px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.rep-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.rep-panel-title-grp {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.rep-panel-ico {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--primary-color) 11%, var(--bg-body));
    border: 1px solid color-mix(in srgb, var(--primary-color) 28%, var(--border-color));
    color: var(--primary-color);
    flex-shrink: 0;
}

.rep-panel-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 900;
    color: var(--text-main);
}

.rep-panel-sub {
    margin: 3px 0 0;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.rep-chart-box {
    width: 100%;
    height: 260px;
}

/* Scan Diff Selectors & Cards */
.rep-diff-pickers {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.rep-picker-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rep-picker-lbl {
    font-size: 0.71rem;
    font-weight: 800;
    color: var(--text-muted);
}

.rep-select-sm {
    padding: 7px 10px;
    border-radius: 9px;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-main);
    font-size: 0.77rem;
    font-weight: 700;
    outline: none;
}

.rep-select-sm:focus {
    border-color: var(--primary-color);
}

.rep-diff-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.rep-diff-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
}

.rep-diff-lbl {
    font-size: 0.71rem;
    font-weight: 700;
    color: var(--text-muted);
}

.rep-diff-val {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.05rem;
    font-weight: 900;
    color: var(--text-main);
    flex-wrap: wrap;
}

.rep-delta-tag {
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 800;
}

.rep-delta-tag.is-pos {
    background: color-mix(in srgb, var(--success) 13%, var(--card-bg));
    color: var(--success);
}

.rep-delta-tag.is-neg {
    background: color-mix(in srgb, var(--danger) 13%, var(--card-bg));
    color: var(--danger);
}

.rep-delta-tag.is-flat {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.rep-diff-hint {
    padding: 18px;
    border-radius: 12px;
    background: var(--bg-body);
    border: 1px dashed var(--border-color);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-align: center;
    margin: auto 0;
}

/* --- 4. Executive Deliverables & Export Hub --- */
.rep-exports-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.rep-export-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    padding: 18px;
    border-radius: 16px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    transition: border-color 0.18s ease;
}

.rep-export-card:hover {
    border-color: var(--primary-color);
}

.rep-export-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.rep-export-ico {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--primary-color) 12%, var(--card-bg));
    color: var(--primary-color);
    flex-shrink: 0;
}

.rep-export-title {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 900;
    color: var(--text-main);
}

.rep-export-desc {
    margin: 4px 0 0;
    font-size: 0.76rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.rep-export-meta {
    font-size: 0.73rem;
    font-weight: 800;
    color: var(--success);
}

.rep-export-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rep-btn-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 9px;
    font: inherit;
    font-size: 0.76rem;
    font-weight: 800;
    color: var(--text-main);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.18s ease, color 0.18s ease;
}

.rep-btn-action:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.rep-btn-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.rep-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 9px;
    font: inherit;
    font-size: 0.76rem;
    font-weight: 800;
    border: 1px solid var(--primary-color);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.18s ease;
}

.rep-xml-drawer {
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    overflow: hidden;
}

.rep-xml-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border-color);
    background: var(--card-bg);
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-muted);
}

.rep-xml-code {
    margin: 0;
    padding: 14px;
    max-height: 260px;
    overflow: auto;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--text-main);
    direction: ltr;
    text-align: left;
}

/* --- 5. Historical Scan Audit Table --- */
.rep-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.rep-search-shell {
    position: relative;
    display: flex;
    align-items: center;
    width: 240px;
    max-width: 100%;
}

.rep-search-ico {
    position: absolute;
    inset-inline-start: 10px;
    color: var(--text-muted);
    pointer-events: none;
}

.rep-search-input {
    width: 100%;
    padding: 7px 12px;
    padding-inline-start: 31px;
    border-radius: 9px;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-main);
    font-size: 0.79rem;
    outline: none;
}

.rep-search-input:focus {
    border-color: var(--primary-color);
}

.rep-filter-pill {
    padding: 6px 11px;
    border-radius: 9px;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-muted);
    font: inherit;
    font-size: 0.74rem;
    font-weight: 800;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.rep-filter-pill.is-active {
    border-color: var(--primary-color);
    background: color-mix(in srgb, var(--primary-color) 12%, var(--bg-body));
    color: var(--primary-color);
}

.rep-table-shell {
    border-radius: 14px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.rep-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.rep-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.81rem;
    text-align: start;
}

.rep-table th {
    padding: 11px 14px;
    background: var(--bg-body);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.73rem;
    font-weight: 800;
    white-space: nowrap;
}

.rep-table td {
    padding: 12px 14px;
    border-bottom: 1px solid color-mix(in srgb, var(--border-color) 60%, transparent);
    color: var(--text-main);
    vertical-align: middle;
}

.rep-table tr:last-child td {
    border-bottom: none;
}

.rep-table tr:hover td {
    background: color-mix(in srgb, var(--primary-color) 4%, var(--card-bg));
}

.rep-scan-id-cell {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 900;
    color: var(--primary-color);
}

.rep-latest-tag {
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 0.67rem;
    font-weight: 800;
    background: color-mix(in srgb, var(--primary-color) 12%, var(--bg-body));
    color: var(--primary-color);
}

.rep-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.73rem;
    font-weight: 800;
    white-space: nowrap;
}

.rep-status-pill.status-completed {
    background: color-mix(in srgb, var(--success) 13%, var(--bg-body));
    color: var(--success);
}

.rep-status-pill.status-running {
    background: color-mix(in srgb, var(--blue) 13%, var(--bg-body));
    color: var(--blue);
}

.rep-status-pill.status-pending {
    background: color-mix(in srgb, var(--warning) 13%, var(--bg-body));
    color: var(--warning);
}

.rep-status-pill.status-failed {
    background: color-mix(in srgb, var(--danger) 13%, var(--bg-body));
    color: var(--danger);
}

.rep-cov-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
}

.rep-cov-bar {
    flex: 1;
    height: 6px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--border-color) 65%, transparent);
    overflow: hidden;
}

.rep-cov-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--primary-color);
}

.rep-td-end {
    text-align: end;
    white-space: nowrap;
}

.rep-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-body);
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-muted);
}

/* --- 6. Loading, Empty & Toast --- */
.rep-loading-box,
.rep-empty-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 52px 24px;
    text-align: center;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 18px;
}

.rep-empty-box h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 900;
}

.rep-empty-box p {
    margin: 0;
    font-size: 0.83rem;
    color: var(--text-muted);
    max-width: 480px;
}

.rep-spinner {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid color-mix(in srgb, var(--primary-color) 20%, transparent);
    border-top-color: var(--primary-color);
    animation: rep-spin 0.8s linear infinite;
}

.rep-toast {
    position: fixed;
    bottom: 24px;
    inset-inline-end: 24px;
    z-index: 1100;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 12px;
    background: var(--card-bg);
    border: 1px solid var(--success);
    color: var(--success);
    font-size: 0.81rem;
    font-weight: 800;
    box-shadow: var(--shadow-lg);
}

.rep-toast.is-error {
    border-color: var(--danger);
    color: var(--danger);
}

@keyframes rep-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 1120px) {
    .rep-cockpit-grid,
    .rep-analytics-grid {
        grid-template-columns: 1fr;
    }
    .rep-exports-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .rep-kpi-grid,
    .rep-diff-pickers,
    .rep-diff-metrics {
        grid-template-columns: 1fr;
    }
}

@media print {
    .rep-util-bar,
    .rep-export-actions,
    .rep-table-toolbar,
    .rep-pagination,
    .rep-toast {
        display: none !important;
    }
    .rep-page {
        padding: 0;
        max-width: 100%;
    }
}

/* ==========================================================================
   V10 QUIET CHROME SIGNATURE: EXECUTIVE SCORECARD BAND + COVERAGE BULLET CHART
   ========================================================================== */
.rep-page {
    --rep-hairline: color-mix(in srgb, var(--border-color) 52%, transparent);
    --rep-hairline-soft: color-mix(in srgb, var(--border-color) 38%, transparent);
}

.rep-hero-card,
.rep-panel,
.rep-pill-link,
.rep-pill-btn,
.rep-domain-pill,
.rep-dd-trigger,
.rep-table-shell,
.rep-export-card,
.rep-diff-box,
.rep-empty-box {
    border-color: var(--rep-hairline);
}

.rep-export-card,
.rep-diff-box {
    background: color-mix(in srgb, var(--bg-body) 52%, var(--card-bg));
}

.rep-score-band {
    --rs-tone: var(--primary-color);
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    align-items: center;
    gap: 24px;
    padding: 18px 20px;
    border-radius: 16px;
    background: color-mix(in srgb, var(--bg-body) 55%, var(--card-bg));
    border: 1px solid var(--rep-hairline-soft);
}

.rep-score-band.grade-success { --rs-tone: var(--success); }
.rep-score-band.grade-warning { --rs-tone: var(--warning); }
.rep-score-band.grade-danger { --rs-tone: var(--danger); }

.rep-score-main {
    display: flex;
    align-items: center;
    gap: 16px;
}

.rep-grade-monogram {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 950;
    color: var(--rs-tone);
    background: color-mix(in srgb, var(--rs-tone) 12%, var(--card-bg));
    border: 1px solid color-mix(in srgb, var(--rs-tone) 32%, transparent);
    flex-shrink: 0;
}

.rep-score-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rep-score-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.rep-score-big {
    font-size: 2rem;
    font-weight: 950;
    color: var(--text-main);
    line-height: 1;
}

.rep-score-denom {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-muted);
}

.rep-status-tag {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--rs-tone);
    background: color-mix(in srgb, var(--rs-tone) 11%, var(--card-bg));
}

.rep-score-caption {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
}

.rep-score-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-inline-start: 20px;
}

.rep-score-bar-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.rep-score-bar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
}

.rep-score-bar-head strong {
    color: var(--text-main);
    font-weight: 900;
}

.rep-score-track {
    height: 7px;
    border-radius: 999px;
    background: var(--rep-hairline-soft);
    overflow: hidden;
}

.rep-score-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    transition: width 0.45s ease;
}

.rep-score-fill.is-ok { background: var(--success); }
.rep-score-fill.is-pri { background: var(--primary-color); }

.rep-hairline-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding-top: 16px;
    border-top: 1px solid var(--rep-hairline-soft);
}

.rep-kpi-cell {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding-inline: 16px;
    border-inline-end: 1px solid var(--rep-hairline-soft);
    text-decoration: none;
    color: var(--text-main);
}

.rep-kpi-cell:first-child { padding-inline-start: 0; }
.rep-kpi-cell:last-child { border-inline-end: none; padding-inline-end: 0; }

.rep-kpi-cell.is-link:hover .rep-kpi-lbl,
.rep-kpi-cell.is-link:hover .rep-kpi-sub {
    color: var(--primary-color);
}

.rep-kpi-val.is-danger { color: var(--danger); }
.rep-kpi-val.is-ok { color: var(--success); }
.rep-kpi-val.is-pri { color: var(--primary-color); }

.rep-kpi-sub {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.rep-kpi-sub.is-action {
    color: var(--primary-color);
}

@media (max-width: 1120px) {
    .rep-score-band { grid-template-columns: 1fr; }
    .rep-score-bars { padding-inline-start: 0; }
    .rep-hairline-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 16px; }
    .rep-kpi-cell { border-inline-end: none; padding-inline: 0; }
}

@media (max-width: 640px) {
    .rep-hairline-kpis { grid-template-columns: 1fr; }
}

.rep-bkl-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 14px;
    border-top: 1px solid var(--rep-hairline-soft);
    font-size: 0.78rem;
}

.rep-bkl-info,
.rep-bkl-acts {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--text-muted);
}

.rep-bkl-info strong {
    color: var(--text-main);
    font-weight: 800;
}

.rep-bkl-stat {
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    background: color-mix(in srgb, var(--bg-body) 68%, var(--card-bg));
    border: 1px solid var(--rep-hairline-soft);
    color: var(--text-main);
}

.rep-bkl-stat.is-danger {
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 11%, var(--card-bg));
    border-color: color-mix(in srgb, var(--danger) 30%, transparent);
}

.rep-bkl-stat.is-ok {
    color: var(--success);
    background: color-mix(in srgb, var(--success) 10%, var(--card-bg));
    border-color: color-mix(in srgb, var(--success) 30%, transparent);
}
