/* ==========================================================================
   FICHA TÉCNICA E EXPEDIENTE INSTITUCIONAL - SAMCI (CGE-RO)
   Folha de estilos editorial e institucional inspirada no padrão CGE-RO/e-SIC
   ========================================================================== */

/* 1. Documento Principal Centralizado e Alinhamento do Breadcrumb */
.pagetitle {
    max-width: 1140px;
    margin: 0 auto 0.5rem;
}

.ficha-document {
    max-width: 1140px;
    margin: 0.5rem auto 1rem;
    background-color: var(--card-bg, #ffffff);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 2.25rem 2.75rem 2.5rem;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

[data-theme="dark"] .ficha-document {
    background-color: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

/* 2. Barra Superior e Cabeçalho Institucional Centralizado */
.ficha-topbar {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 0.75rem;
}

.btn-ficha-voltar {
    font-size: 0.8rem;
    font-weight: 500;
    color: #475569;
    text-decoration: none;
    padding: 0.35rem 0.85rem;
    border: 1px solid #cbd5e1;
    border-radius: 9999px;
    background: #f8fafc;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-ficha-voltar:hover {
    color: #1e40af;
    border-color: #93c5fd;
    background: #eff6ff;
}

[data-theme="dark"] .btn-ficha-voltar {
    background: #161e31;
    color: #cbd5e1;
    border-color: #334155;
}

[data-theme="dark"] .btn-ficha-voltar:hover {
    background: #334155;
    color: #ffffff;
    border-color: #475569;
}

.ficha-header {
    background: transparent !important;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 1.75rem;
    margin-bottom: 2.25rem;
}

[data-theme="dark"] .ficha-header {
    border-bottom-color: #334155;
}

.ficha-title {
    font-size: 1.85rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.65rem 0;
    letter-spacing: -0.02em;
}

[data-theme="dark"] .ficha-title {
    color: #f8fafc;
}

.ficha-lead {
    font-size: 0.92rem;
    color: #64748b;
    margin: 0 auto;
    line-height: 1.6;
    max-width: 720px;
}

[data-theme="dark"] .ficha-lead {
    color: #94a3b8;
}

/* 3. Seções Editoriais com Ícone e Título em Azul Institucional */
.ficha-section {
    margin-bottom: 2.5rem;
}

.ficha-section-last {
    margin-bottom: 0;
}

.ficha-section-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e40af;
    padding-bottom: 0.65rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid #e2e8f0;
}

.ficha-section-title i {
    font-size: 1rem;
    color: #2563eb;
}

[data-theme="dark"] .ficha-section-title {
    color: #60a5fa;
    border-bottom-color: #334155;
}

[data-theme="dark"] .ficha-section-title i {
    color: #93c5fd;
}

.ficha-section-desc {
    font-size: 0.875rem;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

[data-theme="dark"] .ficha-section-desc {
    color: #cbd5e1;
}

/* 4. Grade de Governança Institucional (4 Colunas em Cards Sutis) */
.ficha-gov-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.ficha-gov-card {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem 1.15rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ficha-gov-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

[data-theme="dark"] .ficha-gov-card {
    background-color: #161e31;
    border-color: #334155;
}

[data-theme="dark"] .ficha-gov-card:hover {
    border-color: #475569;
}

.ficha-gov-card dt {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 0.35rem;
}

[data-theme="dark"] .ficha-gov-card dt {
    color: #94a3b8;
}

.ficha-gov-card dd {
    font-size: 0.86rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
    line-height: 1.45;
}

[data-theme="dark"] .ficha-gov-card dd {
    color: #f1f5f9;
}

/* 5. Fundamentação Legal e Diretrizes (Cards 2x2 com Borda Lateral Azul) */
.ficha-legal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.ficha-legal-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 3.5px solid #2563eb;
    border-radius: 10px;
    padding: 1.15rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.ficha-legal-card:hover {
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
    transform: translateY(-1px);
}

[data-theme="dark"] .ficha-legal-card {
    background-color: #161e31;
    border-color: #334155;
    border-left-color: #3b82f6;
}

.ficha-legal-icon {
    color: #2563eb;
    font-size: 1.35rem;
    line-height: 1;
    margin-top: 0.15rem;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
}

[data-theme="dark"] .ficha-legal-icon {
    color: #60a5fa;
}

.ficha-legal-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.3rem 0;
}

[data-theme="dark"] .ficha-legal-title {
    color: #f8fafc;
}

.ficha-legal-text {
    font-size: 0.81rem;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
}

[data-theme="dark"] .ficha-legal-text {
    color: #94a3b8;
}

/* 6. Faixa de Lotação Institucional e Tabela de Expediente Técnico */
.ficha-unit-callout {
    background-color: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.15rem;
    font-size: 0.86rem;
    color: #1e40af;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.ficha-unit-callout i {
    color: #2563eb;
    flex-shrink: 0;
}

[data-theme="dark"] .ficha-unit-callout {
    background-color: rgba(30, 58, 138, 0.25);
    border-color: rgba(59, 130, 246, 0.35);
    color: #bfdbfe;
}

[data-theme="dark"] .ficha-unit-callout i {
    color: #60a5fa;
}

.ficha-table-wrapper {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

[data-theme="dark"] .ficha-table-wrapper {
    border-color: #334155;
}

.ficha-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
    background: #ffffff;
}

[data-theme="dark"] .ficha-table {
    background: #1e293b;
}

.ficha-table thead th,
.ficha-table thead th.col-nome,
.ficha-table thead th.col-papel {
    font-size: 0.78rem;
    font-weight: 700;
    color: #ffffff;
    background: #1e40af;
    padding: 0.8rem 1.15rem;
    border-bottom: none;
    text-align: left;
    letter-spacing: 0.01em;
}

[data-theme="dark"] .ficha-table thead th,
[data-theme="dark"] .ficha-table thead th.col-nome,
[data-theme="dark"] .ficha-table thead th.col-papel {
    background: #1e3a8a;
    color: #f8fafc;
}

.ficha-table tbody td {
    font-size: 0.86rem;
    padding: 0.75rem 1.15rem;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    vertical-align: middle;
    transition: background-color 0.15s ease;
}

.ficha-table tbody tr:not(.ficha-category-row):hover td {
    background-color: #f8fafc;
}

[data-theme="dark"] .ficha-table tbody td {
    border-bottom-color: rgba(51, 65, 85, 0.55);
    color: #e2e8f0;
}

[data-theme="dark"] .ficha-table tbody tr:not(.ficha-category-row):hover td {
    background-color: rgba(30, 41, 59, 0.8);
}

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

.ficha-table tbody tr.ficha-category-row td {
    background-color: #eef2ff;
    color: #1e3a8a;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.55rem 1.15rem;
    border-top: 1px solid #e0e7ff;
    border-bottom: 1px solid #e0e7ff;
}

[data-theme="dark"] .ficha-table tbody tr.ficha-category-row td {
    background-color: rgba(22, 30, 49, 0.85);
    color: #93c5fd;
    border-top-color: #334155;
    border-bottom-color: #334155;
}

.ficha-category-meta {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: #475569;
}

[data-theme="dark"] .ficha-category-meta {
    color: #94a3b8;
}

.ficha-table tbody td.col-nome {
    font-weight: 600;
    color: #0f172a;
    width: 38%;
}

[data-theme="dark"] .ficha-table tbody td.col-nome {
    color: #f8fafc;
}

.ficha-table tbody td.col-papel {
    color: #475569;
    font-weight: 400;
    width: 62%;
}

[data-theme="dark"] .ficha-table tbody td.col-papel {
    color: #cbd5e1;
}

/* 7. Grade Uniforme de Blocos (Metodologia COSO e Arquitetura Tecnológica) */
.ficha-tiles-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
}

.ficha-spec-tile {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.75rem 0.65rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #334155;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.ficha-spec-tile:hover {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

[data-theme="dark"] .ficha-spec-tile {
    background-color: #161e31;
    border-color: #334155;
    color: #cbd5e1;
}

[data-theme="dark"] .ficha-spec-tile:hover {
    background-color: rgba(30, 58, 138, 0.25);
    border-color: rgba(59, 130, 246, 0.4);
    color: #93c5fd;
}

/* 8. Caixa Final de Transparência Pública */
.ficha-footer-note {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 3.5px solid #475569;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-top: 2rem;
    font-size: 0.8rem;
    color: #475569;
    line-height: 1.6;
}

.ficha-footer-note strong {
    color: #0f172a;
}

[data-theme="dark"] .ficha-footer-note {
    background-color: #161e31;
    border-color: #334155;
    border-left-color: #64748b;
    color: #94a3b8;
}

[data-theme="dark"] .ficha-footer-note strong {
    color: #f8fafc;
}

/* 9. Responsividade */
@media (max-width: 991px) {
    .ficha-gov-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .ficha-tiles-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .ficha-document {
        padding: 1.5rem 1.25rem;
    }
    .ficha-gov-grid,
    .ficha-legal-grid {
        grid-template-columns: 1fr;
    }
    .ficha-tiles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .ficha-table .col-nome {
        width: 42%;
    }
    .ficha-table .col-papel {
        width: 58%;
    }
}
