﻿/* Deficiencies grid. The filter section, table, chips and pagination shells come from
   v2-styles.css; this file adds the multi-menu filter bar and the deficiency-specific
   severity / status / age vocabulary. */

/* ===== Filter bar ===== */
.filter-bar {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.filter-search {
    flex: 1;
    min-width: 260px;
}

/* Anchors each dropdown under its own toggle - the shared .filter-dropdown is
   absolutely positioned, so without this every menu would open at the far right. */
.filter-menu {
    position: relative;
}

.filter-dropdown-wide {
    width: 340px;
}

.filter-dropdown-search {
    padding: 10px 12px;
    border-bottom: 1px solid #e1e8ef;
}

.filter-dropdown-search .filter-input {
    width: 100%;
    font-size: 13px;
}

.filter-dropdown-body {
    padding: 12px 16px;
    overflow-y: auto;
}

.filter-options-scroll {
    max-height: 260px;
    overflow-y: auto;
}

.filter-option-count {
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
    margin-left: 4px;
}

/* ===== Severity ===== */
.severity-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

/* Blank is the state every deficiency is created in, and the business reads it as
   severe - so it is styled as a warning, never as "missing". */
.severity-unclassified {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.severity-critical {
    background: #fee2e2;
    color: #7f1d1d;
    border: 1px solid #fca5a5;
}

.severity-noncritical {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.severity-impairment {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* ===== Status ===== */
.status-badge.status-open {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.status-badge.status-resolved {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* ===== Age ===== */
.age-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.age-fresh {
    background: #f1f5f9;
    color: #475569;
}

.age-watch {
    background: #fffbeb;
    color: #92400e;
}

.age-warn {
    background: #ffedd5;
    color: #9a3412;
}

.age-critical {
    background: #fee2e2;
    color: #991b1b;
}

.age-resolved {
    background: #f0fdf4;
    color: #166534;
}

/* ===== Finding cell ===== */
.finding-link {
    font-weight: 500;
    color: #1e40af;
    text-decoration: none;
}

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

.finding-sub {
    margin-top: 3px;
    font-size: 12px;
    color: #64748b;
}

/* Severity badge plus the row markers that used to live in the Finding cell. */
.severity-cell {
    display: inline-flex;
    align-items: center;
}

.row-marker {
    margin-left: 8px;
    color: #94a3b8;
    font-size: 11px;
}

.row-marker-quoted {
    color: #059669;
}

@media (max-width: 900px) {
    .filter-search {
        min-width: 100%;
    }
}

/* ===== Copy-to-clipboard cells ===== */
.copy-cell {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.copy-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 2px 4px;
    border-radius: 4px;
    cursor: pointer;
    color: #cbd5e1;
    font-size: 12px;
    line-height: 1;
    /* Held back until the row is hovered so the column stays readable, but never
       display:none - the button has to keep its space or the text reflows on hover. */
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
}

tr:hover .copy-btn,
.copy-btn:focus-visible {
    opacity: 1;
}

.copy-btn:hover {
    color: #1e40af;
    background: #eff6ff;
}

.copy-btn:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 1px;
}
