/* Lifted verbatim from assignment-overview.blade.php.
   Inline it was 16,961 bytes of HTML on every render;
   as a file the browser fetches it once. */
/* ══════════════════════════════════════════════════════════════════
   PEERS / OVERVIEW — clean dashboard aligned with Insights/AI Results.
   Uses global theme tokens so dark mode flips automatically.
   ══════════════════════════════════════════════════════════════════ */

.ov-page {
    max-width: 1480px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem 4rem;
    background: var(--background, #ffffff);
    color: var(--foreground, #0a0a0a);
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ── shared "what does this mean?" tooltip helper ──────── */
.cq-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 13px;
    height: 13px;
    margin-left: 0.3rem;
    border-radius: 50%;
    border: 1px solid currentColor;
    color: var(--muted-foreground, #6b7280);
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    cursor: help;
    position: relative;
    opacity: 0.55;
    transition: opacity 0.15s;
    user-select: none;
    vertical-align: middle;
    flex-shrink: 0;
}
.cq-tip::after { content: "?"; }
.cq-tip:hover, .cq-tip:focus-visible { opacity: 1; outline: none; }
.cq-tip:hover::before,
.cq-tip:focus-visible::before {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 60;
    width: max-content;
    max-width: 280px;
    padding: 8px 11px;
    background: #0f172a;
    color: #f8fafc;
    font-size: 11.5px;
    font-weight: 400;
    line-height: 1.45;
    border-radius: 6px;
    white-space: normal;
    text-align: left;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    pointer-events: none;
}

/* ── header ───────────────────────────────────────────── */
.ov-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1rem 0 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border, #e5e7eb);
    flex-wrap: wrap;
}
.ov-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.55rem 0.25rem 0.4rem;
    background: color-mix(in srgb, var(--foreground, #0a0a0a) 6%, transparent);
    color: var(--muted-foreground, #6b7280);
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 0.5rem;
}
.ov-title { margin: 0; font-size: 1.625rem; font-weight: 700; letter-spacing: -0.025em; }
.ov-subtitle { margin: 0.2rem 0 0; font-size: 0.875rem; color: var(--muted-foreground, #6b7280); }

.ov-head-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(86px, 1fr));
    gap: 0;
    background: var(--border, #e5e7eb);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    overflow: hidden;
}
.ov-hstat {
    padding: 0.6rem 0.85rem;
    background: var(--card, var(--background, #ffffff));
    text-align: left;
    min-width: 0;
}
.ov-hstat-val {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}
.ov-hstat-lbl {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted-foreground, #6b7280);
    margin-top: 0.1rem;
    display: block;
}

/* ── shared block ─────────────────────────────────────── */
.ov-block {
    background: var(--card, var(--background, #ffffff));
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px;
    padding: 1.1rem 1.25rem 1.25rem;
    margin-bottom: 1.5rem;
}
.ov-block-head { margin-bottom: 1rem; }
.ov-block-head h2 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}
.ov-block-head p {
    margin: 0.15rem 0 0;
    font-size: 0.8125rem;
    color: var(--muted-foreground, #6b7280);
}
.ov-block-head-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.ov-count {
    display: inline-flex;
    padding: 0.05rem 0.45rem;
    background: var(--muted, #f3f4f6);
    color: var(--muted-foreground, #6b7280);
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 999px;
    margin-left: 0.3rem;
}
.ov-baseline-pills { display: flex; gap: 0.45rem; flex-wrap: wrap; justify-content: flex-end; }
.ov-baseline-pills span {
    padding: 0.32rem 0.55rem;
    border-radius: 7px;
    background: var(--muted, #f3f4f6);
    color: var(--muted-foreground, #6b7280);
    font-size: 0.7rem;
    white-space: nowrap;
}
.ov-baseline-pills strong { color: var(--foreground, #0a0a0a); font-variant-numeric: tabular-nums; }
.ov-review-table { min-width: 860px; }
.ov-review-reason { color: var(--muted-foreground, #6b7280); font-size: 0.78rem; }
.ov-delta { color: var(--muted-foreground, #6b7280); font-weight: 650; font-variant-numeric: tabular-nums; }
.ov-delta.is-up { color: #dc2626; }
.ov-review-score { display: flex; align-items: center; gap: 0.6rem; font-variant-numeric: tabular-nums; }
.ov-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.45rem;
    background: color-mix(in srgb, var(--foreground, #0a0a0a) 8%, transparent);
    color: var(--foreground, #0a0a0a);
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 5px;
    margin-left: 0.5rem;
}

/* ── risk distribution bar ────────────────────────────── */
.ov-risk-bar {
    display: flex;
    height: 16px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--muted, #f3f4f6);
}
.ov-risk-seg {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 0;
    transition: flex 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.ov-seg-green { background: #10b981; }
.ov-seg-amber { background: #f59e0b; }
.ov-seg-red   { background: #ef4444; }

.ov-risk-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-top: 0.85rem;
    font-size: 0.78125rem;
    color: var(--muted-foreground, #6b7280);
}
.ov-risk-legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.ov-risk-legend strong { color: var(--foreground, #0a0a0a); }

.ov-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.ov-dot-green { background: #10b981; }
.ov-dot-amber { background: #f59e0b; }
.ov-dot-red   { background: #ef4444; }

/* ── network card ─────────────────────────────────────── */
.ov-block-net { padding-bottom: 1rem; }

.ov-net-actions { display: inline-flex; gap: 0.4rem; align-items: center; }
.ov-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    background: transparent;
    color: var(--foreground, #0a0a0a);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 7px;
    font-size: 0.78125rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}
.ov-btn:hover { background: var(--muted, #f3f4f6); }
.ov-btn-primary {
    background: var(--foreground, #0a0a0a);
    color: var(--background, #ffffff);
    border-color: var(--foreground, #0a0a0a);
}
.ov-btn-primary:hover { opacity: 0.92; background: var(--foreground, #0a0a0a); color: var(--background, #ffffff); }

.ov-net-legend {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--muted, #f3f4f6);
    border-radius: 8px;
    font-size: 0.75rem;
    color: var(--muted-foreground, #6b7280);
}
.ov-net-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.ov-net-hint {
    margin-left: auto;
    font-style: italic;
    opacity: 0.85;
}

.ov-net-wrap {
    position: relative;
    height: 540px;
    background: color-mix(in srgb, var(--foreground, #0a0a0a) 2%, transparent);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    overflow: hidden;
}
#networkGraph { width: 100%; height: 100%; }

.ov-net-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background: var(--card, var(--background, #ffffff));
    color: var(--muted-foreground, #6b7280);
    font-size: 0.85rem;
    transition: opacity 0.3s;
}
.ov-spin {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border, #e5e7eb);
    border-top-color: var(--foreground, #0a0a0a);
    border-radius: 50%;
    animation: ov-spin 0.7s linear infinite;
}
@keyframes ov-spin { to { transform: rotate(360deg); } }

/* ── cluster list (appears after detection) ───────────── */
.ov-cluster-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.6rem;
    margin-top: 0.85rem;
}
.ov-cluster-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    border-left: 3px solid;
    background: var(--muted, #f3f4f6);
}
.ov-cluster-num {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: var(--card, var(--background, #ffffff));
    color: var(--foreground, #0a0a0a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78125rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.ov-cluster-meta { display: flex; flex-direction: column; min-width: 0; }
.ov-cluster-title { font-size: 0.825rem; font-weight: 600; color: var(--foreground, #0a0a0a); }
.ov-cluster-sub { font-size: 0.7rem; color: var(--muted-foreground, #6b7280); margin-top: 0.05rem; }

/* ── search + pills ───────────────────────────────────── */
.ov-matches-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}
.ov-search {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.65rem;
    background: var(--muted, #f3f4f6);
    border: 1px solid transparent;
    border-radius: 8px;
    transition: border-color 0.15s;
    min-width: 220px;
}
.ov-search:focus-within { border-color: color-mix(in srgb, var(--foreground, #0a0a0a) 30%, transparent); }
.ov-search svg { color: var(--muted-foreground, #6b7280); }
.ov-search input {
    flex: 1;
    border: 0;
    background: transparent;
    outline: none;
    font-size: 0.8125rem;
    color: var(--foreground, #0a0a0a);
    min-width: 0;
}
.ov-search input::placeholder { color: var(--muted-foreground, #6b7280); }

.ov-pills {
    display: inline-flex;
    background: var(--muted, #f3f4f6);
    padding: 0.2rem;
    border-radius: 7px;
    gap: 0.15rem;
}
.ov-pill {
    padding: 0.35rem 0.75rem;
    background: transparent;
    border: 0;
    color: var(--muted-foreground, #6b7280);
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.ov-pill:hover { color: var(--foreground, #0a0a0a); }
.ov-pill-active {
    background: var(--card, var(--background, #ffffff));
    color: var(--foreground, #0a0a0a);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* ── matches table ────────────────────────────────────── */
.ov-table-wrap {
    margin: 0 -1.25rem -1.25rem;
    overflow-x: auto;
    border-top: 1px solid var(--border, #e5e7eb);
}
.ov-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
    min-width: 760px;
}
.ov-table thead th {
    text-align: left;
    padding: 0.7rem 1rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted-foreground, #6b7280);
    border-bottom: 1px solid var(--border, #e5e7eb);
    background: color-mix(in srgb, var(--muted, #f3f4f6) 50%, transparent);
}
.ov-th-rank { width: 56px; padding-left: 1.25rem !important; text-align: center; }
.ov-th-arrow { width: 28px; }
.ov-th-sim { width: 180px; }
.ov-th-end { width: 28px; }
.ov-table tbody td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border, #e5e7eb);
    vertical-align: middle;
}
.ov-table tbody tr:last-child td { border-bottom: 0; }
.ov-match-tr { cursor: pointer; transition: background 0.12s; }
.ov-match-tr:hover { background: var(--muted, #f3f4f6); }
.ov-td-rank { text-align: center; padding-left: 1.25rem !important; }
.ov-td-end { text-align: right; color: var(--muted-foreground, #6b7280); padding-right: 1.25rem !important; }
.ov-match-tr:hover .ov-td-end { color: var(--foreground, #0a0a0a); }
.ov-td-arrow { text-align: center; color: var(--muted-foreground, #6b7280); }

.ov-rank {
    display: inline-flex;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--muted, #f3f4f6);
    color: var(--muted-foreground, #6b7280);
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.ov-rank-top {
    background: var(--foreground, #0a0a0a);
    color: var(--background, #ffffff);
}

.ov-file { display: flex; align-items: center; gap: 0.55rem; min-width: 0; }
.ov-file-icon {
    display: inline-flex;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: var(--muted, #f3f4f6);
    color: var(--muted-foreground, #6b7280);
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ov-fname {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.ov-sim { display: flex; align-items: center; gap: 0.55rem; }
.ov-sim-track {
    flex: 1;
    height: 6px;
    background: var(--muted, #f3f4f6);
    border-radius: 999px;
    overflow: hidden;
    min-width: 60px;
}
.ov-sim-fill { height: 100%; border-radius: 999px; transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
.ov-sim-val {
    font-size: 0.78125rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    min-width: 38px;
    text-align: right;
}

.ov-badge {
    display: inline-flex;
    padding: 0.2rem 0.55rem;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ov-badge-safe    { background: rgba(16, 185, 129, 0.12); color: #047857; }
.ov-badge-warning { background: rgba(245, 158, 11, 0.14); color: #b45309; }
.ov-badge-danger  { background: rgba(239, 68, 68, 0.12);  color: #b91c1c; }

/* ── tones ────────────────────────────────────────────── */
.ov-tone-green { color: #059669; }
.ov-tone-amber { color: #d97706; }
.ov-tone-red   { color: #dc2626; }
.ov-tone-green-bg { background: #10b981; }
.ov-tone-amber-bg { background: #f59e0b; }
.ov-tone-red-bg   { background: #ef4444; }
.ov-tone-green-bg-light { background: rgba(16, 185, 129, 0.08); }
.ov-tone-amber-bg-light { background: rgba(245, 158, 11, 0.10); }
.ov-tone-red-bg-light   { background: rgba(239, 68, 68, 0.08); }

/* ── empty states ─────────────────────────────────────── */
.ov-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2.5rem 1.5rem;
    gap: 0.4rem;
}
.ov-empty-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    background: var(--muted, #f3f4f6);
    color: var(--muted-foreground, #6b7280);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.4rem;
}
.ov-empty h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.ov-empty p { margin: 0; font-size: 0.8125rem; color: var(--muted-foreground, #6b7280); }

.ov-empty-mini {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem;
    color: var(--muted-foreground, #6b7280);
    font-size: 0.8125rem;
    background: var(--muted, #f3f4f6);
    border-radius: 8px;
}

/* ── responsive ───────────────────────────────────────── */
@media (max-width: 900px) {
    .ov-page { padding: 1rem 1rem 3rem; }
    .ov-header { flex-direction: column; align-items: stretch; }
    .ov-head-stats { grid-template-columns: repeat(5, minmax(64px, 1fr)); }
    .ov-block { padding: 1rem; }
    .ov-net-wrap { height: 420px; }
    .ov-matches-controls { flex-direction: column; align-items: stretch; }
    .ov-search { min-width: 0; }
    .ov-table-wrap { margin: 0 -1rem -1rem; }
    .ov-th-rank, .ov-td-rank { padding-left: 1rem !important; }
    .ov-td-end { padding-right: 1rem !important; }
}
@media (max-width: 600px) {
    .ov-head-stats { grid-template-columns: repeat(2, 1fr); }
    .ov-net-hint { display: none; }
}

/* ── print ────────────────────────────────────────────── */
@media print {
    .no-print { display: none !important; }
    .ov-page { max-width: 100%; padding: 0; background: #ffffff; }
    .ov-block, .ov-head-stats { box-shadow: none !important; break-inside: avoid; }
    .ov-net-wrap { break-inside: avoid; }
    .ov-match-tr { cursor: default; }
}
