/* Rapport de recherche — écran interne (admin).
   Deux colonnes : les recherches du débouché à gauche, le rapport à droite. La lecture va
   toujours dans le même sens, et la colonne de gauche reste visible pendant qu'on compare
   plusieurs recherches d'un même débouché. */

.sr-wrap {
    padding: 20px 24px 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.sr-header h2 {
    margin: 0 0 4px;
}

.sr-sub {
    color: var(--text-muted, #6b7280);
    font-size: 13px;
    margin: 0;
}

.sr-picker {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 18px 0;
    padding: 14px 16px;
    background: var(--surface-2, #f9fafb);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
}

.sr-picker label {
    font-weight: 600;
}

.sr-picker input {
    flex: 1;
    min-width: 260px;
    padding: 8px 10px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 6px;
    font: inherit;
}

.sr-hint {
    font-size: 12px;
    color: var(--text-muted, #6b7280);
}

.sr-body {
    display: grid;
    grid-template-columns: minmax(240px, 320px) 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 900px) {
    .sr-body { grid-template-columns: 1fr; }
}

/* --- colonne des recherches --- */

.sr-searches {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sr-search {
    width: 100%;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 12px;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
}

.sr-search:hover {
    border-color: var(--accent, #2563eb);
}

.sr-search.is-active {
    border-color: var(--accent, #2563eb);
    box-shadow: inset 3px 0 0 var(--accent, #2563eb);
}

.sr-search-name {
    font-weight: 600;
}

.sr-search-meta,
.sr-search-date {
    font-size: 12px;
    color: var(--text-muted, #6b7280);
}

/* --- rapport --- */

.sr-report-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.sr-report-head h3 {
    margin: 0;
}

.sr-toggle {
    padding: 7px 12px;
    border: 1px solid var(--accent, #2563eb);
    background: transparent;
    color: var(--accent, #2563eb);
    border-radius: 6px;
    cursor: pointer;
    font: inherit;
}

.sr-stats {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0;
    padding: 0;
}

.sr-stats li {
    padding: 6px 12px;
    background: var(--surface-2, #f9fafb);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 999px;
    font-size: 13px;
}

.sr-blocages {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sr-blocages li {
    padding: 8px 12px;
    border-left: 3px solid var(--border, #e5e7eb);
    background: var(--surface-2, #f9fafb);
    font-size: 13px;
}

/* Une donnée à renseigner se corrige ; un blocage avéré, non. La couleur porte cette
   différence, qui est la seule qui compte pour décider quoi faire. */
.sr-blocage-a_renseigner { border-left-color: #f59e0b; }
.sr-blocage-bloquant     { border-left-color: #ef4444; }
.sr-blocage-conforme     { border-left-color: #10b981; }

.sr-motifs ul {
    margin: 6px 0 18px;
    padding-left: 20px;
    font-size: 13px;
}

.sr-group {
    margin: 22px 0;
}

.sr-group h4 {
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sr-badge {
    padding: 2px 9px;
    background: var(--surface-2, #f3f4f6);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}

/* Le tableau défile dans son cadre : la page ne doit jamais partir en travers. */
.sr-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
}

.sr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.sr-table th,
.sr-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border, #f3f4f6);
    vertical-align: top;
}

.sr-table th {
    background: var(--surface-2, #f9fafb);
    font-weight: 600;
    white-space: nowrap;
}

.sr-gis {
    font-weight: 600;
}

.sr-why {
    max-width: 420px;
}

.sr-cat {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.sr-cat-RETENU  { background: #dcfce7; color: #166534; }
.sr-cat-RESERVE { background: #fef3c7; color: #92400e; }
.sr-cat-ECARTE  { background: #fee2e2; color: #991b1b; }
.sr-cat-MASQUE  { background: #e5e7eb; color: #374151; }

.sr-vide,
.sr-loading,
.sr-erreur {
    padding: 16px;
    color: var(--text-muted, #6b7280);
    font-size: 14px;
}

.sr-erreur {
    color: #b91c1c;
}

.sr-teaser {
    margin-top: 16px;
    padding: 10px 12px;
    background: var(--surface-2, #f9fafb);
    border-radius: 8px;
}

@media (prefers-color-scheme: dark) {
    .sr-cat-RETENU  { background: #14532d; color: #bbf7d0; }
    .sr-cat-RESERVE { background: #78350f; color: #fde68a; }
    .sr-cat-ECARTE  { background: #7f1d1d; color: #fecaca; }
    .sr-cat-MASQUE  { background: #374151; color: #e5e7eb; }
}
