/* ============================================
   TAG — Technical AutoGrade  ·  Design System
   ============================================ */

/* --- Design Tokens --- */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111;
    --bg-tertiary: #1a1a1a;
    --bg-hover: rgba(255,255,255,0.04);

    --border-subtle: rgba(255,255,255,0.06);
    --border-default: rgba(255,255,255,0.1);

    --text-primary: #ededed;
    --text-secondary: #a1a1a1;
    --text-muted: #666;

    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-subtle: rgba(99,102,241,0.12);

    --success: #22c55e;
    --success-subtle: rgba(34,197,94,0.12);
    --warning: #f59e0b;
    --warning-subtle: rgba(245,158,11,0.12);
    --danger: #ef4444;
    --danger-subtle: rgba(239,68,68,0.12);
    --info: #3b82f6;
    --info-subtle: rgba(59,130,246,0.12);

    --glass-bg: rgba(255,255,255,0.03);
    --glass-border: rgba(255,255,255,0.08);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

/* --- Base Reset --- */
html, body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--accent);
    color: white;
}

/* --- Links --- */
a, .btn-link {
    color: var(--accent-hover);
    text-decoration: none;
    transition: color 0.15s;
}
a:hover, .btn-link:hover {
    color: var(--accent);
}

/* --- Focus Ring --- */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus, .form-select:focus {
    box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px var(--accent);
    outline: none;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
}

h1 { font-size: 1.75rem; letter-spacing: -0.02em; }
h3 { font-size: 1.25rem; }
h5 { font-size: 1rem; }

.text-muted { color: var(--text-secondary) !important; }

/* --- Content Area --- */
.content {
    padding-top: 1.1rem;
}

h1:focus { outline: none; }

/* --- Forms --- */
.form-control, .form-select {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus, .form-select:focus {
    background-color: var(--bg-tertiary);
    border-color: var(--accent);
    color: var(--text-primary);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.form-check-input {
    background-color: var(--bg-tertiary);
    border-color: var(--border-default);
}

.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

.form-check-label {
    color: var(--text-secondary);
}

/* --- Validation --- */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--success);
}

.invalid {
    outline: 1px solid var(--danger);
}

.validation-message {
    color: var(--danger);
    font-size: 0.85rem;
}

/* --- Buttons --- */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    transition: all 0.15s;
    border: 1px solid transparent;
}

.btn-primary {
    color: #fff;
    background-color: var(--accent);
    border-color: var(--accent);
}
.btn-primary:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-success {
    background-color: var(--success);
    border-color: var(--success);
    color: #fff;
}

.btn-danger {
    background-color: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.btn-warning {
    background-color: var(--warning);
    border-color: var(--warning);
    color: #111;
}

.btn-outline-primary {
    color: var(--accent-hover);
    border-color: var(--accent);
}
.btn-outline-primary:hover {
    background-color: var(--accent);
    color: #fff;
}

.btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--border-default);
}
.btn-outline-secondary:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-default);
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    border-color: var(--border-default);
    color: var(--text-primary);
}
.btn-secondary:hover {
    background-color: var(--bg-hover);
    border-color: var(--border-default);
}

.btn-sm {
    padding: 0.3rem 0.65rem;
    font-size: 0.8rem;
}

/* --- Cards --- */
.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
}

.card-body {
    padding: 1.25rem;
}

.card-title {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.card-text {
    color: var(--text-secondary);
}

/* --- Tables --- */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    --bs-table-border-color: var(--border-subtle);
    --bs-table-striped-bg: rgba(255,255,255,0.02);
    --bs-table-striped-color: var(--text-primary);
    --bs-table-hover-bg: rgba(255,255,255,0.04);
    --bs-table-hover-color: var(--text-primary);
    color: var(--text-primary);
}

.table th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border-default);
}

.table td {
    border-color: var(--border-subtle);
    vertical-align: middle;
}

/* --- Badges --- */
.badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.3em 0.7em;
    border-radius: 9999px;
    white-space: nowrap;
}

.badge.bg-primary, .bg-primary { background-color: var(--accent) !important; }
.badge.bg-success, .bg-success { background-color: var(--success) !important; }
.badge.bg-warning, .bg-warning { background-color: var(--warning) !important; color: #111 !important; }
.badge.bg-danger, .bg-danger { background-color: var(--danger) !important; }
.badge.bg-info, .bg-info { background-color: var(--info) !important; }
.badge.bg-secondary, .bg-secondary { background-color: var(--bg-tertiary) !important; border: 1px solid var(--border-default); color: var(--text-secondary) !important; }

/* --- Progress Bars --- */
.progress {
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.progress-bar {
    transition: width 0.5s ease;
}

.progress-bar.bg-success { background-color: var(--success) !important; }
.progress-bar.bg-warning { background-color: var(--warning) !important; }
.progress-bar.bg-danger { background-color: var(--danger) !important; }

/* --- Nav Tabs --- */
.nav-tabs {
    border-bottom: 1px solid var(--border-subtle);
}

.nav-tabs .nav-link {
    color: var(--text-secondary);
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 0.65rem 1rem;
    font-weight: 500;
    font-size: 0.9rem;
    background: none;
    transition: color 0.15s, border-color 0.15s;
}

.nav-tabs .nav-link:hover {
    color: var(--text-primary);
    border-bottom-color: var(--border-default);
}

.nav-tabs .nav-link.active {
    color: var(--accent-hover);
    border-bottom-color: var(--accent);
    background: none;
}

/* --- Alerts --- */
.alert-danger {
    background-color: var(--danger-subtle);
    border-color: rgba(239,68,68,0.2);
    color: var(--danger);
}

/* --- Dropdowns / Selects --- */
option {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

/* --- Details/Summary --- */
details summary {
    cursor: pointer;
    color: var(--text-secondary);
}

details summary:hover {
    color: var(--text-primary);
}

/* --- Blazor Error Boundary --- */
.blazor-error-boundary {
    background: var(--danger);
    padding: 1rem 1rem 1rem 1.5rem;
    color: white;
    border-radius: var(--radius-sm);
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.darker-border-checkbox.form-check-input {
    border-color: var(--border-default);
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--text-muted);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* --- Spinner --- */
.spinner-border {
    color: var(--accent);
}
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* ============================================
   TAG Component Classes
   ============================================ */

/* --- Glass Card --- */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 1.25rem;
    transition: border-color 0.2s, background 0.2s;
}

.glass-card:hover {
    border-color: rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
}

/* --- KPI Card --- */
.tag-kpi-card {
    position: relative;
    overflow: hidden;
}

.tag-kpi-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 3px 0 0 3px;
}

.tag-kpi-card.kpi-accent::before { background: var(--accent); }
.tag-kpi-card.kpi-success::before { background: var(--success); }
.tag-kpi-card.kpi-warning::before { background: var(--warning); }
.tag-kpi-card.kpi-info::before { background: var(--info); }

.tag-kpi-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.tag-kpi-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

/* --- Gallery Grid --- */
.tag-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

/* --- Thumbnail --- */
.tag-thumbnail {
    width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--bg-tertiary);
}

.tag-thumbnail-sm {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--bg-tertiary);
}

/* --- Dropzone --- */
.tag-dropzone {
    position: relative;
    border: 2px dashed var(--border-default);
    border-radius: var(--radius-lg);
    padding: 2.5rem 1.5rem;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    background: var(--glass-bg);
}

.tag-dropzone:hover {
    border-color: var(--accent);
    background: var(--accent-subtle);
}

.tag-dropzone-active {
    border-color: var(--accent) !important;
    background: var(--accent-subtle) !important;
    box-shadow: 0 0 0 4px rgba(99,102,241,0.15);
}

.tag-dropzone-icon {
    font-size: 2.5rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.tag-dropzone-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.tag-dropzone-text strong {
    color: var(--accent-hover);
}

.tag-dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* --- Status Badge --- */
.tag-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.3em 0.75em;
    border-radius: 9999px;
}

.tag-status-badge.status-pending {
    background: var(--warning-subtle);
    color: var(--warning);
}

.tag-status-badge.status-processing {
    background: var(--info-subtle);
    color: var(--info);
}

.tag-status-badge.status-graded {
    background: var(--success-subtle);
    color: var(--success);
}

.tag-status-badge.status-error {
    background: var(--danger-subtle);
    color: var(--danger);
}

.tag-status-badge.status-confirmed {
    background: var(--success-subtle);
    color: var(--success);
}

.tag-status-badge.status-corrected {
    background: var(--warning-subtle);
    color: var(--warning);
}

/* --- Kanban --- */
.tag-kanban {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.tag-kanban-col {
    min-width: 260px;
    flex: 1;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tag-kanban-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
}

.tag-kanban-header h5 {
    margin: 0;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

.tag-kanban-count {
    font-size: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    padding: 0.15em 0.55em;
    border-radius: 9999px;
}

.tag-kanban-col-body {
    max-height: calc(100vh - 280px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tag-kanban-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    transition: border-color 0.15s;
}

.tag-kanban-card:hover {
    border-color: var(--border-default);
}

.tag-kanban-card .filename {
    font-size: 0.8rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.tag-kanban-card .time-ago {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* --- Stacked Bar --- */
.tag-stacked-bar {
    display: flex;
    height: 28px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-tertiary);
}

.tag-stacked-bar-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    min-width: 24px;
    transition: flex 0.3s;
}

/* --- Radial Score --- */
.tag-radial-score {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    position: relative;
    flex-shrink: 0;
}

/* --- Activity Feed --- */
.tag-activity-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.tag-activity-item:last-child {
    border-bottom: none;
}

/* --- Quick Action --- */
.tag-action-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-primary);
}

.tag-action-card:hover {
    color: var(--accent-hover);
}

/* --- Filter Bar --- */
.tag-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--border-default);
    background: var(--glass-bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.tag-filter-pill:hover, .tag-filter-pill.active {
    background: var(--accent-subtle);
    border-color: var(--accent);
    color: var(--accent-hover);
}

/* --- Inspect Labels --- */
.inspect-label {
    position: absolute;
    top: 0.75rem;
    z-index: 10;
    background: rgba(0, 0, 0, 0.9);
    color: var(--accent-hover);
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.4em 1em;
    border-radius: var(--radius-sm);
    pointer-events: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* --- Image Comparison --- */
.tag-image-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 640px) {
    .tag-image-compare {
        grid-template-columns: 1fr;
    }
    .tag-kanban {
        flex-direction: column;
    }
    .tag-kanban-col {
        min-width: 100%;
    }

    /* --- Content overflow guard --- */
    .content {
        max-width: 100vw;
        overflow-x: hidden;
        padding: 0.75rem !important;
    }

    h1 {
        font-size: 1.35rem;
    }

    .glass-card {
        padding: 0.85rem;
    }

    .tag-kpi-number {
        font-size: 1.5rem;
    }

    /* --- Dropzone compact --- */
    .tag-dropzone {
        padding: 1.5rem 1rem;
    }

    /* --- Radial score compact --- */
    .tag-radial-score {
        width: 64px;
        height: 64px;
        font-size: 0.8rem;
    }

    .tag-radial-score > div {
        width: 48px !important;
        height: 48px !important;
    }

    /* --- Gallery grid smaller cards --- */
    .tag-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    /* --- Activity feed wrap --- */
    .tag-activity-item {
        flex-wrap: wrap;
    }

    /* --- Table → mobile cards --- */
    .table-mobile-cards thead {
        display: none;
    }

    .table-mobile-cards tbody tr {
        display: flex;
        flex-direction: column;
        background: var(--glass-bg);
        border: 1px solid var(--glass-border);
        border-radius: var(--radius-md);
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .table-mobile-cards tbody td {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.25rem 0;
        border: none;
        min-width: 0;
    }

    .table-mobile-cards tbody td::before {
        content: attr(data-label);
        font-size: 0.7rem;
        font-weight: 600;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.04em;
        min-width: 80px;
        flex-shrink: 0;
    }

    .table-mobile-cards tbody td:empty {
        display: none;
    }
}

/* --- Utility --- */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }

/* ============================================
   Defect Visualization Components
   ============================================ */

/* --- Hero Canvas --- */
.defect-hero-canvas-wrapper {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #000;
    display: flex;
    justify-content: center;
}

.defect-hero-canvas {
    display: block;
    max-width: 100%;
    max-height: 500px;
    width: auto;
    height: auto;
    border-radius: var(--radius-sm);
}

/* --- Edge Split View --- */
.defect-edge-split-wrapper {
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.defect-edge-split-canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
}

/* --- Inventory Panel --- */
.defect-inventory {
    overflow: hidden;
}

.defect-inventory-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.35rem 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: color 0.15s;
}

.defect-inventory-toggle:hover {
    color: var(--text-secondary);
}

.defect-inventory-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.defect-inventory-badges {
    display: flex;
    gap: 0.3rem;
}

.defect-inventory-badges .badge {
    font-size: 0.6rem;
    padding: 0.15em 0.45em;
}

.defect-inventory-chevron {
    font-size: 0.65rem;
    transition: transform 0.2s ease;
}

.defect-inventory-chevron.open {
    transform: rotate(180deg);
}

.defect-inventory-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 200px;
    overflow-y: auto;
    padding-top: 0.35rem;
    animation: defect-fade-in 0.2s ease;
}

.defect-inventory-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s;
    font-size: 0.8rem;
}

.defect-inventory-item:hover,
.defect-inventory-item:focus {
    background: var(--bg-hover);
    outline: none;
}

.defect-inventory-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.defect-inventory-item.size-small .defect-inventory-indicator { background: var(--text-muted); }
.defect-inventory-item.size-medium .defect-inventory-indicator { background: var(--warning); }
.defect-inventory-item.size-large .defect-inventory-indicator { background: var(--danger); }

.defect-inventory-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.defect-inventory-class {
    color: var(--text-primary);
    font-weight: 500;
}

.defect-inventory-meta {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.defect-inventory-overflow {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 0.25rem 0;
}

.defect-inventory-full .defect-inventory-list {
    max-height: 400px;
}

/* --- Arc Gauges --- */
.defect-gauges-row {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.defect-gauge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.defect-gauge-svg {
    width: 80px;
    height: 80px;
}

.defect-gauge-fill {
    transition: stroke-dasharray 0.8s ease-out;
}

.defect-gauge-weight {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 500;
}

.defect-gauge-overall {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-subtle);
}

/* --- Reduced Motion overrides --- */
@media (prefers-reduced-motion: reduce) {
    .defect-gauge-fill {
        transition: none;
    }
}

/* --- Mobile overrides for visualization --- */
@media (max-width: 768px) {
    .defect-hero-canvas-wrapper,
    .defect-edge-split-wrapper {
        border-radius: 0;
        margin: 0 -0.5rem;
        width: calc(100% + 1rem);
    }

    .defect-hero-canvas,
    .defect-edge-split-canvas {
        border-radius: 0;
        max-height: 350px;
    }

    .defect-edge-split-canvas {
        touch-action: none;
    }

    .defect-gauges-row {
        gap: 0.25rem;
    }

    .defect-gauge-svg {
        width: 68px;
        height: 68px;
    }

    .defect-inventory-list {
        max-height: 160px;
    }

    .defect-inventory-item {
        padding: 0.35rem 0.4rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .defect-gauges-row {
        gap: 0.15rem;
    }

    .defect-gauge-svg {
        width: 60px;
        height: 60px;
    }

    .defect-gauge-weight {
        font-size: 0.6rem;
    }

    .defect-gauge-overall {
        font-size: 0.8rem;
    }
}

/* --- Sortable Table Headers --- */
.sortable-th {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: color 0.15s;
}

.sortable-th:hover {
    color: var(--accent-hover);
}
