/* ── base ─────────────────────────────────────────────────────────────── */
body {
    font-family: "Inter", "Segoe UI", system-ui, sans-serif;
    background-color: #f8f9fa;
}

/* Mínimo 1024px — desktop only */
@media (max-width: 1023px) {
    body::before {
        content: "MapaRede é otimizado para desktop (mínimo 1024px).";
        display: block;
        background: #0d6efd;
        color: white;
        text-align: center;
        padding: 8px;
        font-size: 0.85rem;
    }
}

/* ── navbar ──────────────────────────────────────────────────────────── */
.navbar-brand { letter-spacing: -0.5px; }

/* ── badge de status de salvamento ───────────────────────────────────── */
#badge-save-status[data-status="saving"] {
    opacity: 1 !important;
    background-color: #ffc107 !important;
    color: #000 !important;
}
#badge-save-status[data-status="saved"] {
    opacity: 1 !important;
    background-color: #198754 !important;
    color: #fff !important;
}

/* ── formulários ─────────────────────────────────────────────────────── */
.form-label { font-weight: 500; font-size: 0.875rem; }

/* ── painel de detalhes — links abrem em nova aba via JS ─────────────── */
#detail-panel a { color: #0d6efd; }

/* ── editor 3 colunas ────────────────────────────────────────────────── */
.editor-container {
    display: flex;
    height: calc(100vh - 56px);
    overflow: hidden;
}

.editor-sidebar-left {
    width: 240px;
    min-width: 240px;
    background: #ffffff;
    border-right: 1px solid #dee2e6;
    overflow-y: auto;
    padding: 14px 12px;
    flex-shrink: 0;
}

.editor-canvas {
    flex: 1;
    background: #eef0f4;
    overflow: hidden;
}

.editor-panel-right {
    width: 290px;
    min-width: 290px;
    height: 100%;
    background: #ffffff;
    border-left: 1px solid #dee2e6;
    overflow-y: auto;
    padding: 14px 12px;
    flex-shrink: 0;
}

/* ── sidebar labels de seção ─────────────────────────────────────────── */
.sidebar-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6c757d;
    margin-bottom: 8px;
}

.sidebar-divider {
    border-color: #e9ecef;
    margin: 12px 0;
}

/* ── tag de sub-rede isolada — trunca nomes muito longos em 2 linhas
   (achado real: ator com nome de ~120 caracteres empurrava a sidebar
   inteira pra baixo); título completo aparece no tooltip nativo (title) */
.subnetwork-badge-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── abas do painel de Análise de Rede — cabem "Rede"/"Centralidade"/
   "Grupos" numa linha só dentro dos ~257px úteis do editor-panel-right
   (padding/font-size padrão do Bootstrap nav-link não cabe) ────────────── */
.analysis-tabs .nav-link {
    padding: 0.4rem 0.55rem;
    font-size: 0.8rem;
}

/* ── painel de detalhes ──────────────────────────────────────────────── */
.panel-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6c757d;
    margin-bottom: 4px;
}

.panel-markdown p { margin-bottom: 0.4rem; font-size: 0.85rem; }
.panel-markdown ul, .panel-markdown ol { font-size: 0.85rem; padding-left: 1.2rem; }

.panel-accordion .accordion-button {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6c757d;
    padding: 6px 4px;
    box-shadow: none;
}
.panel-accordion .accordion-button:not(.collapsed) { color: #495057; background: transparent; }
.panel-accordion .accordion-body { padding: 6px 4px 12px; }
.panel-accordion .accordion-item { border: none; border-bottom: 1px solid #f1f1f1; }

/* ── Markdown preview (formulários) ─────────────────────────────────── */
.markdown-preview {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 8px 10px;
    min-height: 120px;
    font-size: 0.85rem;
    overflow-y: auto;
}
.markdown-preview p { margin-bottom: 0.3rem; }

/* ── filtros (sidebar) ───────────────────────────────────────────────── */
.sidebar-filter-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #495057;
    line-height: 1.1;
    margin-bottom: 2px;
    display: block;
}

/* ── barra de filtros (topo, largura inteira) ─────────────────────────────
   O row interno é um dbc.Container(fluid=True) (mesmo componente do navbar,
   ver build_navbar em layout.py) — bordas alinhadas com o logotipo/"Sair"
   por construção, não por CSS solto tentando imitar a largura. Padding
   vertical fica aqui porque Container só cuida do horizontal.
   --Dash-Spacing controla a altura interna dos componentes nativos do Dash
   (dcc.Dropdown/dcc.Slider, ver componentes .dash-dropdown/.dash-slider-*) —
   4px é o default do app inteiro (:root); reduzido só aqui dentro pra deixar
   a barra mais fina, sem afetar dropdowns/sliders em outras telas (sidebar,
   formulários). */
.editor-filters-bar {
    --Dash-Spacing: 2px;
    padding: 6px 0;
    background: #ffffff;
    border-bottom: 1px solid #dee2e6;
}
.editor-filters-bar .container-fluid {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 20px;
    row-gap: 6px;
}
.editor-filters-bar .filter-item { display: flex; flex-direction: column; flex-shrink: 0; }
/* altura do dcc.Dropdown nativo não é controlada por --Dash-Spacing, é
   fixa no componente (34px) — reduzida só aqui via override direto. */
.editor-filters-bar .dash-dropdown { height: 30px; }
/* buscadores mais largos (usam o espaço que sobrava como vão vazio entre
   os itens, quando a distribuição era space-between) */
.editor-filters-bar .filter-item-search { width: 230px; }
.editor-filters-bar .filter-item-keyword { width: 290px; }
.editor-filters-bar .filter-item-dropdown { width: 210px; }
.editor-filters-bar .filter-item-weight { width: 160px; }
.editor-filters-bar .filter-item-connections { width: 200px; }
.editor-filters-bar .filter-item-clear { justify-content: flex-end; margin-left: auto; flex-shrink: 0; }

/* ── upload de foto ──────────────────────────────────────────────────── */
.upload-area {
    border: 2px dashed #ced4da;
    border-radius: 6px;
    padding: 16px;
    text-align: center;
    color: #6c757d;
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.2s;
}
.upload-area:hover { border-color: #0d6efd; color: #0d6efd; }
