/* ============================================================================
   MAPA GAZO - Estilização
   Sistema de gestão de escala de anestesistas
   ============================================================================ */

/* Reset e Variáveis */
:root {
    --primary: #4A90E2;
    --success: #4CAF50;
    --warning: #FF9800;
    --danger: #F44336;
    --info: #2196F3;
    
    --bg-main: #f5f7fa;
    --bg-card: #ffffff;
    --bg-hover: #f0f2f5;
    
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --border: #dfe4ea;
    
    --sidebar-width: 280px;
    --header-height: 70px;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.15);
    
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================================================
   HEADER
   ============================================================================ */

.header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-content {
    max-width: 100%;
    padding: 0 20px;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: -4px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

#username {
    font-weight: 600;
    font-size: 14px;
}

.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.admin {
    background: var(--success);
    color: white;
}

.badge.guest {
    background: var(--text-secondary);
    color: white;
}

/* ============================================================================
   CONTAINER & LAYOUT
   ============================================================================ */

.container {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr) 300px;
    gap: 15px;
    padding: 15px;
    min-height: calc(100vh - var(--header-height));
    transition: grid-template-columns 0.2s;
}
/* Quando sidebar esquerda colapsa, grid expande */
.container:has(.sidebar-left.collapsed) {
    grid-template-columns: 40px minmax(0, 1fr) 300px;
}

/* ============================================================================
   SIDEBAR
   ============================================================================ */

.sidebar {
    background: var(--bg-card);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}
.sidebar-right {
    position: sticky;
    top: 15px;
    overflow-y: auto;
    font-size: 0.85em;
    min-width: 280px;
}

.sidebar-header {
    padding: 15px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 16px;
    font-weight: 700;
}

.sidebar-footer {
    padding: 10px 15px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
}

/* Pool de Anestesistas */
.pool {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.pool-item {
    background: var(--bg-hover);
    border: 2px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: grab;
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pool-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pool-item:active {
    cursor: grabbing;
    opacity: 0.7;
}

.pool-item-name {
    font-weight: 600;
    font-size: 14px;
}

.pool-item-quota {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--primary);
    color: white;
}

.pool-item-count {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ============================================================================
   MAIN GRID
   ============================================================================ */

.main-grid {
    background: var(--bg-card);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.grid-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.grid-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.grid-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.grid-wrapper {
    flex: 1;
    overflow: auto;
    padding: 20px;
}

.grid-scroll {
    min-width: 700px;
}

/* Tabela de Escala */
.schedule-grid {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.schedule-grid thead th {
    background: var(--bg-hover);
    padding: 12px 8px;
    text-align: center;
    font-weight: 700;
    font-size: 13px;
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.col-position {
    width: 100px;
    text-align: left !important;
    padding-left: 15px !important;
}

/* FDS: Escondido por padrão */
.col-weekend {
    display: none;
}

.show-weekend .col-weekend {
    display: table-cell;
    background: #f0f0f0 !important;
}

.schedule-grid tbody td {
    padding: 8px;
    text-align: center;
    border: 1px solid var(--border);
    min-height: 50px;
    height: 50px;
    transition: var(--transition);
    position: relative;
}

.schedule-grid tbody td.cell-position {
    background: var(--bg-hover);
    font-weight: 600;
    font-size: 13px;
    text-align: left;
    padding-left: 15px;
}

.schedule-grid tbody td.cell-editable {
    cursor: pointer;
    background: #fafbfc;
}

.schedule-grid tbody td.cell-editable:hover {
    background: var(--bg-hover);
}

.schedule-grid tbody td.cell-fixed {
    background: #fff9e6;
    cursor: not-allowed;
}

.schedule-grid tbody td.cell-occupied {
    font-weight: 600;
    font-size: 13px;
}

.schedule-grid tbody td.drop-valid {
    background: #c8e6c9 !important;
    border: 2px dashed var(--success);
}

.schedule-grid tbody td.drop-invalid {
    background: #ffcdd2 !important;
    border: 2px dashed var(--danger);
}

.schedule-grid tbody td.violation {
    border: 2px solid var(--danger) !important;
    background: #ffebee !important;
}

/* ============================================================================
   PAINÉIS
   ============================================================================ */

.panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 15px;
    overflow: hidden;
}

.panel-header {
    background: var(--bg-hover);
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.panel-header h3 {
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.violations-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.violations-badge.has-violations {
    color: var(--danger);
}

.panel-toggle {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-content {
    padding: 12px;
    max-height: 50vh;
    overflow-y: auto;
}

.panel.collapsed .panel-content {
    display: none;
}

.panel.collapsed .panel-toggle::before {
    content: '+';
}

/* Scores Table */
.scores-table {
    width: 100%;
    font-size: 12px;
}

.scores-table th {
    text-align: left;
    padding: 6px 4px;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    font-size: 11px;
}

.scores-table td {
    padding: 8px 4px;
    border-bottom: 1px solid var(--border);
}

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

.score-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.score-bar {
    flex: 1;
    height: 16px;
    background: var(--bg-hover);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.score-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    transition: var(--transition);
}

.score-value {
    font-weight: 700;
    font-size: 13px;
    min-width: 35px;
    text-align: right;
}

.score-below-quota {
    color: var(--danger);
    font-weight: 700;
}

/* Pares */
.pair-item {
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

.pair-item:last-child {
    border-bottom: none;
}

.pair-header {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pair-emoji {
    font-size: 16px;
}

.pair-bar {
    height: 24px;
    background: var(--bg-hover);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

.pair-bar-fill {
    height: 100%;
    background: var(--success);
    transition: var(--transition);
}

.pair-bar-fill.warning {
    background: var(--warning);
}

.pair-bar-fill.critical {
    background: var(--danger);
}

.pair-delta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* Fairness Metrics - Cards */
.fairness-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.metric-card {
    background: var(--bg-hover);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.metric-icon {
    font-size: 24px;
}

.metric-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
}

.metric-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.metric-value.good {
    color: var(--success);
}

.metric-value.bad {
    color: var(--danger);
}

/* Violações */
.violations-list {
    font-size: 13px;
}

.violation-item {
    padding: 10px;
    border-left: 4px solid;
    margin-bottom: 8px;
    border-radius: 4px;
    background: var(--bg-hover);
}

.violation-item.critical {
    border-color: var(--danger);
    background: #ffebee;
}

.violation-item.warning {
    border-color: var(--warning);
    background: #fff8e1;
}

.violation-item.info {
    border-color: var(--info);
    background: #e3f2fd;
}

.violation-description {
    font-weight: 600;
    margin-bottom: 4px;
}

.violation-details {
    font-size: 11px;
    color: var(--text-secondary);
}

.no-violations {
    text-align: center;
    color: var(--success);
    font-weight: 600;
    padding: 20px;
}

/* ============================================================================
   SEÇÃO INFORMATIVA
   ============================================================================ */

.info-section {
    background: var(--bg-card);
    margin: 15px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
    width: auto;
    display: block;
    box-sizing: border-box;
}

.info-section.collapsed .info-content {
    display: none;
}

.info-header {
    padding: 15px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.info-content {
    padding: 20px;
}

.info-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
    flex-wrap: wrap;
}

.info-tab {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.info-tab:hover {
    color: var(--primary);
}

.info-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.info-tab-content {
    display: none;
}

.info-tab-content.active {
    display: block;
}

.info-tab-content h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--primary);
}

.info-list {
    list-style: disc;
    padding-left: 20px;
    margin: 0;
}

.info-list > li {
    padding: 6px 0;
}

.info-list > li::marker {
    color: var(--primary);
}

.info-list ul {
    margin-top: 6px;
    padding-left: 18px;
    list-style: circle;
}

.info-list ul li {
    padding: 3px 0;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.info-table th,
.info-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.info-table th {
    background: var(--bg-hover);
    font-weight: 700;
    font-size: 13px;
}

.info-table td {
    font-size: 13px;
}

.info-table tbody tr:hover {
    background: var(--bg-hover);
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

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

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-secondary {
    background: var(--text-secondary);
    color: white;
}

.btn-info {
    background: var(--info);
    color: white;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

/* ============================================================================
   MODAL
   ============================================================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.spinner {
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================================================
   TOAST
   ============================================================================ */

.toast-container {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-card);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    border-left: 4px solid;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-color: var(--success);
}

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

.toast.info {
    border-color: var(--info);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================================================
   STATUS BAR
   ============================================================================ */

.status-bar {
    padding: 10px 15px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}

/* ============================================================================
   RESPONSIVIDADE
   ============================================================================ */

@media (max-width: 1200px) {
    .container {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    
    .sidebar-left {
        grid-row: 1;
        display: none;
    }
    
    .sidebar-left.mobile-open {
        display: flex;
    }
    
    .main-grid {
        grid-row: 1;
    }
    
    .sidebar-right {
        grid-row: 2;
        min-width: unset;
    }
    
    .sidebar {
        max-height: none;
    }
    
    .panel-content {
        max-height: 300px;
    }
    
    .fairness-metrics {
        grid-template-columns: 1fr;
    }
    
    .mobile-toggle-pool {
        display: inline-flex !important;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 100%;
    }
    
    /* Header compact — single row */
    .header { position: sticky; top: 0; z-index: 100; background: var(--bg-card); height: auto !important; }
    .header-content {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px 12px;
        padding: 6px 10px;
        height: auto;
        align-items: center;
        justify-content: center;
    }
    .header-left { text-align: center; }
    .header-left h1 { font-size: 1.1em; margin: 0; }
    .header-left .subtitle { display: none; }
    .header-right {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 11px;
    }
    
    /* Main grid: contained */
    .main-grid {
        max-width: 100vw;
        overflow: hidden;
        padding: 0 4px;
        box-sizing: border-box;
    }
    
    /* Controls: wrap properly */
    .grid-controls {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 4px;
    }
    .btn {
        font-size: 10px;
        padding: 4px 8px;
    }
    
    /* Grid: fit all 6 cols on screen */
    .grid-header h2 { font-size: 1em; }
    .grid-wrapper {
        overflow-x: auto;
        padding: 4px 2px;
    }
    .grid-scroll {
        min-width: 0;
        width: 100%;
    }
    .schedule-table {
        width: 100%;
        table-layout: fixed;
        border-collapse: collapse;
    }
    .schedule-table th,
    .schedule-table td {
        padding: 5px 1px;
        font-size: 9px;
        text-align: center;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    /* Hide position column on mobile */
    .col-position,
    .cell-position {
        display: none !important;
    }
    
    /* Show position number as mini-label on first day cell */
    .cell-pos-indicator::before {
        content: attr(data-pos-num);
        position: absolute;
        top: 1px;
        left: 2px;
        font-size: 7px;
        color: rgba(0,0,0,0.4);
        font-weight: 700;
        line-height: 1;
    }
    .cell-pos-indicator {
        position: relative;
    }
    
    /* Container padding zero */
    .container { padding: 4px 2px; gap: 6px; }
    
    /* Scores table: full-width, all columns visible */
    .scores-table { font-size: 11px; width: 100%; table-layout: fixed; }
    .scores-table th, .scores-table td { padding: 5px 3px; }
    .score-bar-wrapper { gap: 3px; }
    .score-bar { height: 10px; }
    .score-value { font-size: 11px; min-width: 24px; }
    
    /* Pairs compact */
    .pair-item { padding: 8px 10px; }
    .pair-bar { height: 16px; }
    .pair-delta { font-size: 11px; }
    
    /* Fairness 2x2 grid */
    .fairness-metrics {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px;
    }
    .metric-card { padding: 8px; gap: 6px; }
    .metric-icon { font-size: 16px; }
    .metric-value { font-size: 15px; }
    .metric-label { font-size: 10px; }
    
    /* Panels compact */
    .panel { margin-bottom: 6px; }
    .panel-header { padding: 8px 12px; font-size: 13px; }
    .panel-content { padding: 8px 10px; }
    
    /* Info section: full-width, not floating */
    .info-section {
        margin: 8px;
        border-radius: 8px;
        max-width: calc(100vw - 16px);
        box-sizing: border-box;
    }
    .info-header { padding: 10px 12px; }
    .info-content { padding: 12px; font-size: 13px; }
    .info-tabs {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
    }
    .info-tab {
        padding: 8px 12px;
        font-size: 12px;
    }
    .info-tab-content h3 { font-size: 15px; margin-bottom: 10px; }
    .info-list li { padding: 6px 0; font-size: 13px; }
    
    /* Toast */
    .toast-container {
        top: auto;
        bottom: 20px;
        left: 10px;
        right: 10px;
    }
    .toast { min-width: auto; }
    
    /* Sidebar right: full-width when stacked */
    .sidebar-right { min-width: unset !important; max-width: 100vw; }
    
    /* Container: prevent horizontal overflow but allow grid scroll */
    .container {
        max-width: 100vw;
        overflow-x: auto;
    }
}

/* ============================================================================
   SCROLLBAR CUSTOM
   ============================================================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-hover);
}

::-webkit-scrollbar-thumb {
    background: var(--text-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ---- Cell Picker (bottom-sheet) ---- */
#cell-picker {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.picker-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    transition: opacity 0.2s;
}
.picker-active .picker-overlay { opacity: 1; }
.picker-sheet {
    position: relative;
    background: var(--bg-card);
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: 480px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.25s ease-out;
}
.picker-active .picker-sheet { transform: translateY(0); }
.picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px 12px;
    font-weight: 600;
    font-size: 1.05em;
    border-bottom: 1px solid var(--border);
}
.picker-close {
    background: none;
    border: none;
    font-size: 1.3em;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px 8px;
}
.picker-options {
    overflow-y: auto;
    padding: 8px 12px 20px;
}
.picker-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    margin: 4px 0;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95em;
    cursor: pointer;
    transition: background 0.15s;
}
.picker-option:hover:not(.picker-disabled) { background: var(--bg-hover); }
.picker-option.picker-disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.picker-option.picker-clear {
    border-left: 4px solid #999;
    color: var(--text-secondary);
}
.picker-quota {
    font-size: 0.8em;
    color: var(--text-secondary);
}

/* ---- Mobile toggle pool button ---- */
.mobile-toggle-pool {
    display: none;
    align-items: center;
    gap: 4px;
}

/* ---- Sidebar colapsável ---- */
.sidebar-collapse-btn {
    position: absolute;
    top: 8px;
    right: -14px;
    z-index: 10;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #dee2e6;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.sidebar-left { position: relative; transition: width 0.2s, min-width 0.2s, padding 0.2s; overflow: hidden; }
.sidebar-left.collapsed { width: 40px !important; min-width: 40px !important; padding: 8px 4px !important; }
.sidebar-left.collapsed .sidebar-header,
.sidebar-left.collapsed .pool,
.sidebar-left.collapsed .sidebar-footer { display: none; }
.sidebar-left.collapsed .sidebar-collapse-btn { right: 6px; }

/* ---- Tabela pesos colorida ---- */
.peso-group-critico td { background: #fff0f0; }
.peso-group-pesado td { background: #fff8e1; }
.peso-group-inter td { background: #f5f5f5; }
.peso-group-leve td { background: #e8f5e9; }
.info-intro { color: #555; font-size: 0.9em; margin-bottom: 12px; line-height: 1.5; }
.info-note { color: #777; font-size: 0.85em; margin-top: 10px; padding: 8px 12px; background: #f9f9f9; border-left: 3px solid #ffc107; border-radius: 4px; }
.info-table th:nth-child(4), .info-table td:nth-child(4) { font-size: 0.85em; color: #555; max-width: 350px; }

/* ---- Sidebar direita compacta ---- */
.sidebar-right .panel { margin-bottom: 8px; }
.sidebar-right .panel-header { padding: 8px 12px; }
.sidebar-right .panel-header h3 { font-size: 0.95em; }
.sidebar-right .panel-content { padding: 6px 10px; }
.sidebar-right .scores-table { font-size: 0.85em; }
.sidebar-right .scores-table td,
.sidebar-right .scores-table th { padding: 3px 5px; }
.sidebar-right .pair-item { margin-bottom: 8px; padding: 6px 8px; }
.sidebar-right .pair-header { font-size: 0.9em; }
.sidebar-right .pair-delta { font-size: 0.8em; }
.sidebar-right .pair-bar { height: 4px; margin: 3px 0; }
.sidebar-right .metric { padding: 6px 8px; font-size: 0.85em; }
.sidebar-right .fairness-metrics { gap: 6px; }
.sidebar-right .violation-item { padding: 4px 8px; font-size: 0.85em; }

/* Score bar mais fina */
.score-bar { height: 6px; border-radius: 3px; background: #e0e0e0; margin-top: 2px; }
.score-bar-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, #2196F3, #4CAF50); }
