/* =====================================================================================================
   mediato-detalhe.css — PRJ453 (23/09/2026): layout das telas de CLIENTE e PROCESSO (e do detalhe das Fontes).

   Pedido do Fundador: "distribuir os dados"; "temos problemas de secoes verticais que estao muito ruins".
   A regra (validada no prototipo de 23/09):
     1. secoes em LARGURA TOTAL, empilhadas por importancia — nada de cartoes de 340px lado a lado e alturas desiguais;
     2. dentro da secao os campos se distribuem na HORIZONTAL (3-5 colunas), rotulo EM CIMA do valor;
     3. texto longo ocupa a LINHA INTEIRA e e legivel (nada espremido em 60% de uma coluna estreita);
     4. faixas de fatos em 3 por linha, 2 colunas de campos em cada — fileiras iguais;
     5. indicadores (kpi) e selos (fontes, status) no topo.
   Usa SO os tokens de mediato-tokens.css / akme-tokens.css (--f-*, --akme-*). Prefixo md- para nao colidir.
   ===================================================================================================== */

.md-pagina { padding-top: 1rem; padding-bottom: 3rem; }
.md-crumb { font-size: .75rem; color: var(--f-text-muted); margin-bottom: .5rem; }
.md-crumb a { color: var(--akme-primary-text); }

.md-card { background: var(--f-bg, #fff); border: 1px solid var(--f-border); border-radius: 10px; box-shadow: var(--f-shadow-sm); }
.md-sec { margin-top: 1rem; }
.md-sec-hd { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
             padding: .75rem 1rem; border-bottom: 1px solid var(--f-border-subtle); }
.md-sec-hd h2 { font-size: .95rem; font-weight: 700; margin: 0; }
.md-sub { font-size: .75rem; color: var(--f-text-muted); font-weight: 400; margin-left: .5rem; }
.md-sec-bd { padding: .9rem 1rem; }

/* cabecalho */
.md-hero { padding: 1.1rem 1.25rem; display: flex; justify-content: space-between; gap: 1.25rem; flex-wrap: wrap; align-items: flex-start; }
.md-hero h1 { font-size: 1.4rem; font-weight: 800; margin: 0; }
.md-meta { color: var(--f-text-secondary); margin-top: .4rem; display: flex; gap: .9rem; flex-wrap: wrap; font-size: .82rem; }
.md-meta b { color: var(--f-text); }

/* campos na HORIZONTAL: rotulo em cima, valor embaixo */
.md-campos { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .85rem 1.4rem; }
.md-campo .l { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--f-text-muted); font-weight: 600; }
.md-campo .v { margin-top: .1rem; font-weight: 500; word-break: break-word; font-size: .875rem; }
.md-campo .v.vazio { color: var(--f-text-disabled); font-weight: 400; }
.md-campo.largo { grid-column: 1 / -1; }
.md-campo.largo .v { white-space: pre-wrap; line-height: 1.55; font-weight: 400; }

/* faixas de fatos: 3 por linha, 2 colunas de campos em cada */
.md-faixas { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; }
.md-faixa { padding: .85rem 1rem; }
.md-faixa h3 { font-size: .72rem; margin: 0 0 .6rem; color: var(--akme-primary-700, #c2410c); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.md-faixa .md-campos { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* indicadores */
.md-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin-top: .9rem; }
.md-kpi { background: var(--f-bg, #fff); border: 1px solid var(--f-border); border-radius: 10px; padding: .75rem .9rem; }
.md-kpi .n { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.md-kpi .t { font-size: .75rem; color: var(--f-text-muted); margin-top: .15rem; }

/* selos */
.md-selos { display: flex; gap: .35rem; flex-wrap: wrap; }
.md-b { display: inline-flex; align-items: center; gap: .25rem; padding: .1rem .5rem; border-radius: 999px; font-size: .72rem;
        font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.md-b-fonte { background: var(--f-surface); border-color: var(--f-border); color: var(--f-text-secondary); }
.md-b-ok { background: #ecfdf5; color: #047857; }
.md-b-warn { background: #fffbeb; color: #b45309; }
.md-b-err { background: #fef2f2; color: #b91c1c; }
.md-b-info { background: #ecfeff; color: #0e7490; }
.md-b-pri { background: var(--akme-primary-100, #ffedd5); color: var(--akme-primary-700, #c2410c); }
.md-b-muted { background: var(--f-surface); color: var(--f-text-muted); }

/* visao do mediador */
.md-mediador { border-left: 4px solid var(--akme-primary); }
.md-relato { font-size: .95rem; line-height: 1.65; white-space: pre-wrap; max-width: 115ch; }
.md-notas { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: .85rem; margin-top: .9rem; }
.md-nota { background: var(--f-surface); border: 1px solid var(--f-border); border-radius: 8px; padding: .6rem .75rem; }
.md-nota .l { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--f-text-muted); font-weight: 600; margin-bottom: .25rem; }
.md-nota .v { white-space: pre-wrap; line-height: 1.55; font-size: .875rem; }

/* alertas */
.md-alerta { display: flex; gap: .6rem; align-items: flex-start; padding: .6rem .9rem; border-radius: 8px; font-size: .82rem; margin-top: .75rem; }
.md-alerta.warn { background: #fffbeb; border: 1px solid #fde68a; }
.md-alerta.info { background: #ecfeff; border: 1px solid #a5f3fc; }

/* grade */
.md-tabela { width: 100%; border-collapse: collapse; }
.md-tabela th, .md-tabela td { text-align: left; padding: .55rem .75rem; border-bottom: 1px solid var(--f-border-subtle); vertical-align: top; font-size: .85rem; }
.md-tabela th { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--f-text-muted); font-weight: 600; background: var(--f-surface); }
.md-tabela tr.md-link { cursor: pointer; }
.md-tabela tr.md-link:hover td { background: var(--akme-primary-50, #fff7ed); }
.md-nw { white-space: nowrap; }
.md-rolar { overflow-x: auto; }

/* filtro */
.md-filtro { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .6rem .9rem; padding: .9rem 1rem; align-items: end; }
.md-filtro label { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--f-text-muted); font-weight: 600; display: block; margin-bottom: .25rem; }
.md-filtro input, .md-filtro select { width: 100%; padding: .45rem .6rem; border: 1px solid var(--f-border); border-radius: 8px; font: inherit; background: #fff; }
.md-paginacao { display: flex; justify-content: space-between; align-items: center; padding: .6rem 1rem; color: var(--f-text-muted); font-size: .75rem; gap: .5rem; flex-wrap: wrap; }

/* abas */
.md-abas { display: flex; gap: 2px; border-bottom: 1px solid var(--f-border); padding: 0 .75rem; overflow-x: auto; }
.md-abas button { border: 0; background: none; padding: .6rem .75rem; font: inherit; font-weight: 600; color: var(--f-text-muted);
                  cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; font-size: .85rem; }
.md-abas button.on { color: var(--akme-primary-700, #c2410c); border-color: var(--akme-primary); }

/* linha do tempo */
.md-tl { position: relative; margin-left: .5rem; }
.md-tl::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--f-border); }
.md-ev { position: relative; padding: 0 0 .85rem 1.75rem; }
.md-ev::before { content: ""; position: absolute; left: 0; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--akme-primary); }
.md-ev.cinza::before { border-color: var(--f-border-muted); }
.md-ev .q { font-size: .75rem; color: var(--f-text-muted); }
.md-ev .o { font-weight: 600; font-size: .875rem; }
.md-ev .x { color: var(--f-text-secondary); font-size: .82rem; white-space: pre-wrap; }

.md-duas { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; }
@media (max-width: 900px) { .md-duas { grid-template-columns: 1fr; } }
.md-vazio { color: var(--f-text-muted); font-size: .85rem; }
details.md-recolhe > summary { cursor: pointer; list-style: none; }
details.md-recolhe > summary::-webkit-details-marker { display: none; }
details.md-recolhe > summary h2::before { content: "▸ "; color: var(--f-text-muted); }
details.md-recolhe[open] > summary h2::before { content: "▾ "; }
