/* FS Processos Obras — Layout fiel ao Portal da Transparência */
:root {
    --fs-po-primary: #0d6e6e;
    --fs-po-primary-dark: #0a5757;
    --fs-po-primary-hover: #1a9e9e;
    --fs-po-bg: #f7f9fb;
    --fs-po-card-bg: #ffffff;
    --fs-po-border: #e3e8ee;
    --fs-po-text: #2d3748;
    --fs-po-muted: #718096;
    --fs-po-badge-andamento: #1a9e9e;
    --fs-po-badge-concluido: #0d6e6e;
    --fs-po-badge-paralisado: #e74c3c;
    --fs-po-badge-homologado: #2563eb;
    --fs-po-badge-suspenso: #f59e0b;
    --fs-po-badge-anulado: #6b7280;
    --fs-po-radius: 10px;
    --fs-po-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.fs-po-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--fs-po-text);
    background: var(--fs-po-bg);
    border-radius: var(--fs-po-radius);
    overflow: hidden;
    border: 1px solid var(--fs-po-border);
    box-shadow: var(--fs-po-shadow);
    margin: 16px 0;
}

/* ==== Header ==== */
.fs-po-header {
    background: linear-gradient(180deg, var(--fs-po-primary) 0%, var(--fs-po-primary-dark) 100%);
    color: #fff;
    padding: 18px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.fs-po-header-left { display:flex; align-items:center; gap:12px; }
.fs-po-header-icon {
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.15);
    border-radius: 6px;
    font-size: 16px;
}
.fs-po-header-title {
    color: #fff;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: .2px;
}
.fs-po-header-right { display:flex; align-items:center; gap:10px; }
.fs-po-header-label { color: #fff; font-size: 13px; opacity:.9; }
.fs-po-select-ano {
    background: #fff;
    color: var(--fs-po-text);
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    min-width: 90px;
}

/* ==== Filtros ==== */
.fs-po-filtros { padding: 18px 22px; background: #fff; }
.fs-po-filtros-row { display:flex; flex-direction:column; gap: 12px; margin-bottom: 12px; }
.fs-po-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.fs-po-field { display:flex; flex-direction:column; gap:4px; }
.fs-po-field-full { width: 100%; }
.fs-po-field label {
    font-size: 11px;
    color: var(--fs-po-muted);
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
}
.fs-po-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--fs-po-border);
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    color: var(--fs-po-text);
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
}
.fs-po-input:focus {
    outline: none;
    border-color: var(--fs-po-primary);
    box-shadow: 0 0 0 3px rgba(13,110,110,.12);
}
.fs-po-actions { display:flex; justify-content:flex-end; }

/* ==== Botões ==== */
.fs-po-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--fs-po-border);
    border-radius: 8px;
    background: #fff;
    color: var(--fs-po-text);
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
    font-family: inherit;
}
.fs-po-btn:hover:not(:disabled) { background: #f5f7fa; border-color: #cbd5e0; }
.fs-po-btn:disabled { opacity: .4; cursor: not-allowed; }
.fs-po-btn-ghost { background: transparent; }
.fs-po-btn-light { background: #f7f9fb; }
.fs-po-btn-ver {
    background: var(--fs-po-primary);
    color: #fff;
    border-color: var(--fs-po-primary);
    border-radius: 999px;
    padding: 6px 18px;
    font-weight: 500;
}
.fs-po-btn-ver:hover { background: var(--fs-po-primary-hover); border-color: var(--fs-po-primary-hover); color: #fff; }

/* Botões de exportação coloridos */
.fs-po-btn-csv     { background: #e8f7e8; border-color: #b8e0b8; color: #2f7a2f; }
.fs-po-btn-excel   { background: #e0f0fb; border-color: #a8cfe8; color: #1d5b8a; }
.fs-po-btn-json    { background: #fef7c5; border-color: #e8d869; color: #6b5a09; }
.fs-po-btn-pdf     { background: #fbe0e0; border-color: #e8a8a8; color: #8a1d1d; }
.fs-po-btn-imprimir{ background: var(--fs-po-primary); border-color: var(--fs-po-primary); color: #fff; }

/* ==== Link bar ==== */
.fs-po-linkbar {
    padding: 12px 22px;
    background: #fafbfc;
    border-top: 1px solid var(--fs-po-border);
    border-bottom: 1px solid var(--fs-po-border);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.fs-po-linkbar-label { font-size: 12px; font-weight: 600; color: var(--fs-po-muted); white-space: nowrap; }
.fs-po-link-input { flex: 1; min-width: 280px; background: #f0f3f7; font-size: 12px; }
.fs-po-linkbar-hint { font-size: 12px; color: var(--fs-po-muted); }

/* ==== Cards de resumo ==== */
.fs-po-resumo {
    padding: 18px 22px;
    background: #fff;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 18px;
    border-bottom: 1px solid var(--fs-po-border);
}
.fs-po-card { display:flex; flex-direction:column; gap: 4px; }
.fs-po-card-label {
    font-size: 11px;
    color: var(--fs-po-muted);
    font-weight: 600;
    letter-spacing: .5px;
}
.fs-po-card-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--fs-po-primary);
}
.fs-po-card-value-money { font-size: 18px; }

/* ==== Pills / Badges ==== */
.fs-po-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .4px;
    background: #f0f3f7;
    color: var(--fs-po-muted);
    border: 1px solid var(--fs-po-border);
}
.fs-po-pill-em-andamento  { background: #d6f5f0; color: #0a7d6e; border-color: #a2e6da; }
.fs-po-pill-concluido,
.fs-po-pill-concluido     { background: #e0f0fb; color: #0d6e6e; border-color: #a2d7f5; }
.fs-po-pill-paralisado    { background: #fbe0e0; color: #b71c1c; border-color: #e8a8a8; }
.fs-po-pill-homologado    { background: #e0e9fb; color: #1d3a8a; border-color: #b3c4f0; }
.fs-po-pill-suspenso      { background: #fff3cd; color: #856404; border-color: #ffeaa7; }
.fs-po-pill-anulado       { background: #f0f3f7; color: #4a5568; border-color: #cbd5e0; }
.fs-po-pill-muted         { background: #f0f3f7; color: var(--fs-po-muted); }

/* ==== Exportar bar ==== */
.fs-po-exportar {
    padding: 12px 22px;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--fs-po-border);
}
.fs-po-exportar-label {
    font-size: 11px;
    color: var(--fs-po-muted);
    font-weight: 600;
    letter-spacing: .5px;
    margin-right: 8px;
}
.fs-po-total-filtrado {
    margin-left: auto;
    font-size: 12px;
    color: var(--fs-po-primary);
    font-weight: 500;
}

/* ==== Tabela ==== */
.fs-po-tabela-wrap { background: #fff; overflow-x: auto; }
.fs-po-tabela {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 1000px;
    table-layout: fixed;
}
.fs-po-tabela thead th {
    background: var(--fs-po-primary);
    color: #fff;
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: .5px;
    text-transform: uppercase;
    white-space: nowrap;
    border-right: 1px solid rgba(255,255,255,.1);
}
.fs-po-tabela thead th:last-child { border-right: none; }
.fs-po-tabela tbody td {
    padding: 14px;
    border-bottom: 1px solid var(--fs-po-border);
    vertical-align: middle;
    line-height: 1.45;
    color: var(--fs-po-text);
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.fs-po-tabela tbody tr:nth-child(even) { background: #fafbfc; }
.fs-po-tabela tbody tr:hover { background: #f0f6f6; }
.fs-po-tabela .fs-po-th-right,
.fs-po-tabela .fs-po-td-right { text-align: right; }

/* Larguras de coluna fixas (8 colunas com VALOR ESTIMADO + VALOR CONTRATADO) */
.fs-po-tabela col.fs-po-col-numero      { width: 8%; }
.fs-po-tabela col.fs-po-col-data        { width: 10%; }
.fs-po-tabela col.fs-po-col-modalidade  { width: 11%; }
.fs-po-tabela col.fs-po-col-secretaria  { width: 13%; }
.fs-po-tabela col.fs-po-col-objeto      { width: auto; }
.fs-po-tabela col.fs-po-col-situacao    { width: 11%; }
.fs-po-tabela col.fs-po-col-valor       { width: 11%; }
.fs-po-tabela col.fs-po-col-detalhes    { width: 8%; }

.fs-po-tabela .fs-po-cel-numero { font-weight: 600; }
.fs-po-tabela .fs-po-cel-objeto {
    color: var(--fs-po-text);
    line-height: 1.45;
    cursor: help;
}
.fs-po-tabela .fs-po-cel-objeto .fs-po-objeto-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    max-height: 2.9em;
}
.fs-po-tabela .fs-po-cel-acao { text-align: center; }
.fs-po-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--fs-po-muted);
    font-style: italic;
}

/* ==== Paginação ==== */
.fs-po-paginacao {
    padding: 14px 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #fff;
    border-top: 1px solid var(--fs-po-border);
}
.fs-po-btn-page {
    min-width: 36px;
    padding: 6px 10px;
    font-weight: 600;
}
.fs-po-page-info {
    font-size: 13px;
    color: var(--fs-po-muted);
    margin: 0 12px;
}

/* ==== Modal ==== */
.fs-po-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 30px 16px;
    overflow-y: auto;
}
.fs-po-modal[hidden] { display: none; }
.fs-po-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(2px);
}
.fs-po-modal-dialog {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    max-width: 920px;
    width: 100%;
    overflow: hidden;
    z-index: 1;
    margin: auto;
}
.fs-po-modal-content { max-height: 88vh; overflow-y: auto; }
.fs-po-modal-loading { padding: 60px; text-align: center; color: var(--fs-po-muted); }

.fs-po-modal-header {
    background: linear-gradient(180deg, var(--fs-po-primary) 0%, var(--fs-po-primary-dark) 100%);
    color: #fff;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}
.fs-po-modal-header-left { flex: 1; }
.fs-po-modal-eyebrow { font-size: 12px; font-weight: 600; opacity: .85; letter-spacing: .5px; }
.fs-po-modal-title { color: #fff; font-size: 22px; font-weight: 700; margin: 4px 0 2px; }
.fs-po-modal-sub { font-size: 13px; opacity: .85; }
.fs-po-modal-header-actions { display: flex; gap: 8px; align-items: center; }
.fs-po-modal-close {
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.fs-po-modal-close:hover { background: rgba(255,255,255,.25); }
.fs-po-modal-header .fs-po-btn-light { background: rgba(255,255,255,.92); color: var(--fs-po-text); }

.fs-po-modal-body { padding: 24px; }

.fs-po-detail-block { margin-bottom: 22px; }
.fs-po-detail-block-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--fs-po-primary);
    letter-spacing: .4px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--fs-po-border);
    display: flex;
    align-items: center;
    gap: 8px;
}
.fs-po-detail-objeto {
    background: #e8f4f4;
    border-left: 4px solid var(--fs-po-primary);
    padding: 14px 18px;
    border-radius: 8px;
}
.fs-po-detail-objeto .fs-po-detail-block-title { color: var(--fs-po-primary); border-bottom: none; padding-bottom: 0; margin-bottom: 8px; }
.fs-po-detail-objeto-text { font-size: 14px; line-height: 1.55; color: var(--fs-po-text); }

.fs-po-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.fs-po-detail-cell {
    background: #fafbfc;
    border: 1px solid var(--fs-po-border);
    border-radius: 8px;
    padding: 10px 14px;
}
.fs-po-detail-cell-full { grid-column: 1 / -1; }
.fs-po-detail-label {
    font-size: 10px;
    color: var(--fs-po-muted);
    font-weight: 600;
    letter-spacing: .6px;
    text-transform: uppercase;
    margin-bottom: 2px;
}
.fs-po-detail-value { font-size: 14px; color: var(--fs-po-text); font-weight: 500; }
.fs-po-detail-warn { color: #b71c1c; font-weight: 600; }

.fs-po-progress { height: 10px; background: #e3e8ee; border-radius: 999px; overflow: hidden; }
.fs-po-progress-bar { height: 100%; background: linear-gradient(90deg, var(--fs-po-primary), var(--fs-po-primary-hover)); transition: width .3s; }

.fs-po-inner-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--fs-po-border);
    border-radius: 8px;
    overflow: hidden;
}
.fs-po-inner-table thead th {
    background: var(--fs-po-primary);
    color: #fff;
    text-align: left;
    padding: 10px 14px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.fs-po-inner-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--fs-po-border);
    font-size: 13px;
}
.fs-po-inner-table tbody tr:last-child td { border-bottom: none; }
.fs-po-inner-table tbody tr:nth-child(even) { background: #fafbfc; }

/* ==== Responsividade ==== */
@media (max-width: 900px) {
    .fs-po-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .fs-po-detail-grid { grid-template-columns: 1fr; }
    .fs-po-modal-dialog { max-width: 100%; }
}
@media (max-width: 600px) {
    .fs-po-grid-4 { grid-template-columns: 1fr; }
    .fs-po-header { flex-direction: column; align-items: flex-start; }
    .fs-po-modal-header { flex-direction: column; }
    .fs-po-modal-header-actions { flex-wrap: wrap; }
}

/* Restringe ícones inline (emojis) a um tamanho controlado */
.fs-po-icon { display: inline-block; font-size: 14px; line-height: 1; vertical-align: middle; }

/* ==== Impressão ==== */
@media print {
    .fs-po-filtros, .fs-po-linkbar, .fs-po-exportar, .fs-po-paginacao,
    .fs-po-modal-header-actions, .fs-po-modal-backdrop { display: none !important; }
    .fs-po-wrap, .fs-po-modal-dialog { box-shadow: none; border: none; }
    .fs-po-modal { position: static; padding: 0; }
    .fs-po-tabela { font-size: 11px; }
    /* Esconde TODOS os emojis durante a impressão padrão do navegador */
    .fs-po-icon, .fs-po-header-icon { display: none !important; }
    .fs-po-detail-block-title, .fs-po-card-label { font-size: 11px; }
}
