/* ==========================================================================
   Componentes das telas administrativas (skill ifce-dual-ui)
   Extraidos de templates/administrativo/lista-inscritos.php (referencia
   validada em 2026-09-22) para as demais telas usarem os MESMOS nomes, sem
   classes paralelas. Ja sem os anti-padroes da skill: nada de border-left
   colorido, nada de faixa com rolagem lateral, alvo de toque >= 44px.
   Uma tela que define estas classes no proprio <style> continua valendo
   (o <style> da pagina vem depois deste arquivo).
   ========================================================================== */
:root {
    --adm-card: #fff;
    --adm-card-alt: #fafbfd;
    --adm-borda: #e9ecef;
    --adm-texto: #2c3e50;
    --adm-texto-2: #4a5568;   /* frase que precisa ser lida: escura (skill 1) */
    --adm-suave: #6c757d;     /* so metadado dispensavel */
    --adm-verde: #155e21;
    --adm-verde-esc: #114e1a;
    --adm-verde-claro: #e8f5e9;
    --adm-hover: #f4f7f5;
}
html[data-theme="dark"] {
    --adm-card: #1f2329;
    --adm-card-alt: #252a31;
    --adm-borda: #343b44;
    --adm-texto: #e6e9ec;
    --adm-texto-2: #cfd6dc;
    --adm-suave: #a9b3bc;
    --adm-verde-claro: #1d3a22;
    --adm-hover: #2a3037;
}

/* ---------- Indicadores: grade 2x2 no celular, linha no computador ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card {
    background: var(--adm-card); border: 1px solid var(--adm-borda); border-radius: 12px;
    padding: 1rem 1.25rem; display: flex; align-items: center; gap: .9rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.03); min-width: 0;
}
.stat-icon { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.stat-icon.green  { background: #e8f5e9; color: #155e21; }
.stat-icon.blue   { background: #e3f2fd; color: #1565c0; }
.stat-icon.orange { background: #fff3e0; color: #b45309; }
.stat-icon.gray   { background: #eceff1; color: #455a64; }
.stat-icon.red    { background: #fee2e2; color: #b91c1c; }
.stat-value { font-size: 1.55rem; font-weight: 800; color: var(--adm-texto); line-height: 1; overflow-wrap: anywhere; }
.stat-label { font-size: .8rem; color: var(--adm-texto-2); margin-top: .25rem; font-weight: 500; }
@media (max-width: 767.98px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin-bottom: 1.25rem; }
    .stat-card { padding: .75rem .8rem; gap: .6rem; }
    .stat-value { font-size: 1.35rem; }
    .stat-icon { width: 36px; height: 36px; font-size: 1rem; }
}

/* ---------- Cartao de conteudo ---------- */
.content-card { background: var(--adm-card); border: 1px solid var(--adm-borda); border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.04); overflow: hidden; margin-bottom: 1rem; }
.content-card .card-header {
    background: var(--adm-card-alt); border-bottom: 1px solid var(--adm-borda); padding: .9rem 1.25rem;
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
}
.content-card .card-header .titulo-secao { font-weight: 700; color: var(--adm-texto); font-size: 1rem; margin: 0; }
.content-card .card-body { color: var(--adm-texto); }
.secao-titulo { font-size: 1.1rem; font-weight: 700; color: var(--adm-texto); margin: 1.5rem 0 .75rem; }
.texto-apoio { font-size: .9rem; color: var(--adm-texto-2); line-height: 1.5; }

/* ---------- Filtros (computador) e chips (celular): sempre quebram linha ---------- */
.filter-btns, .filter-chips-wrapper { display: flex; gap: .4rem; flex-wrap: wrap; }
.filter-chips-wrapper { padding-top: .75rem; }
.filter-btn, .filter-chip {
    font-size: .82rem; padding: .35rem .9rem; border-radius: 20px; min-height: 36px;
    border: 1.5px solid var(--adm-borda); background: var(--adm-card); color: var(--adm-texto);
    cursor: pointer; font-weight: 600; transition: background .15s, color .15s;
}
.filter-chip { min-height: 44px; padding: .45rem .95rem; }
.filter-btn:hover, .filter-btn.active, .filter-chip.active { background: var(--adm-verde); color: #fff; border-color: var(--adm-verde); }

/* ---------- Busca do celular ---------- */
.mobile-search-card { background: var(--adm-card); border: 1px solid var(--adm-borda); border-radius: 12px; padding: .85rem 1rem; margin-bottom: 1rem; }
.mobile-search-input-group { position: relative; display: flex; align-items: center; }
.mobile-search-icon { position: absolute; left: 14px; color: var(--adm-suave); font-size: .9rem; pointer-events: none; }
.mobile-search-input {
    width: 100%; min-height: 46px; padding: .65rem .85rem .65rem 2.4rem; border-radius: 25px;
    border: 1px solid #ced4da; font-size: 1rem; background: var(--adm-card); color: var(--adm-texto); outline: none;
}
.mobile-search-input:focus { border-color: var(--adm-verde); box-shadow: 0 0 0 3px rgba(21,94,33,.15); }
.contagem-info { font-size: .82rem; color: var(--adm-texto-2); margin-top: .6rem; }

/* ---------- Cartao de pessoa/item no celular ---------- */
.participant-card {
    background: var(--adm-card); border: 1px solid var(--adm-borda); border-radius: 12px;
    padding: 1rem; margin-bottom: .85rem; box-shadow: 0 2px 6px rgba(0,0,0,.03);
}
.participant-card .pc-nome { font-size: .98rem; font-weight: 700; color: var(--adm-texto); margin: 0; line-height: 1.3; word-break: break-word; }
.participant-card .pc-meta { font-size: .82rem; color: var(--adm-texto-2); margin: .15rem 0 0; }
.participant-card .pc-acoes { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .85rem; }
.participant-card .pc-acoes > .btn-acao { flex: 1 1 100%; }
.avatar-circle {
    width: 42px; height: 42px; border-radius: 50%; background: #e8f5e9; color: #155e21;
    display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem; flex-shrink: 0;
}
.avatar-circle.ok { background: #155e21; color: #fff; }

/* ---------- Botoes com rotulo ---------- */
.btn-acao {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    min-height: 44px; padding: .5rem 1rem; border-radius: 10px; font-weight: 600; font-size: .92rem;
    border: 1.5px solid transparent; text-decoration: none !important; cursor: pointer; line-height: 1.2;
    transition: background .15s, color .15s, border-color .15s;
}
.btn-acao-pri { background: var(--adm-verde); color: #fff; }
.btn-acao-pri:hover, .btn-acao-pri:focus { background: var(--adm-verde-esc); color: #fff; }
.btn-acao-sec { background: var(--adm-card); color: var(--adm-texto); border-color: var(--adm-borda); }
.btn-acao-sec:hover, .btn-acao-sec:focus { background: var(--adm-hover); color: var(--adm-texto); }
.btn-acao-sec i { color: var(--adm-verde); }
html[data-theme="dark"] .btn-acao-sec i { color: #8fd19e; }
.btn-acao-perigo { background: var(--adm-card); color: #b91c1c; border-color: #fecaca; }
.btn-acao-perigo:hover, .btn-acao-perigo:focus { background: #b91c1c; color: #fff; border-color: #b91c1c; }
.btn-acao[disabled], .btn-acao.carregando { opacity: .65; cursor: default; }
.btn-acao-bloco { width: 100%; }
.btn-touch-action {
    width: 44px; height: 44px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
    font-size: 1rem; border: 1px solid var(--adm-borda); background: var(--adm-card); color: var(--adm-texto); text-decoration: none !important;
}
.btn-touch-action.whatsapp { background: #25d366; border-color: #25d366; color: #fff; }

/* ---------- Selos de status (skill 1) ---------- */
.badge-completo, .badge-pendente, .badge-neutro, .badge-erro, .badge-info {
    font-size: .75rem; padding: .3rem .65rem; border-radius: 20px; font-weight: 700; white-space: nowrap;
    display: inline-flex; align-items: center; gap: .3rem; border: 1px solid transparent;
}
.badge-completo { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.badge-pendente { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.badge-erro     { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.badge-info     { background: #e0f2fe; color: #075985; border-color: #bae6fd; }
.badge-neutro   { background: #eceff1; color: #37474f; border-color: #dfe3e6; }

/* ---------- Tabela enxuta (computador) ---------- */
.tabela-enxuta { width: 100% !important; }
.tabela-enxuta td { vertical-align: middle !important; color: var(--adm-texto); }
.tabela-enxuta .td-nome { font-weight: 700; color: var(--adm-texto); display: block; word-break: break-word; }
.tabela-enxuta .td-meta { font-size: .82rem; color: var(--adm-texto-2); }
.tabela-enxuta tr.linha-ficha { cursor: pointer; }
.tabela-enxuta tr.linha-ok td { background: rgba(21,94,33,.045); }
.tabela-enxuta .td-acao { text-align: right; white-space: nowrap; }
.tabela-enxuta .td-acao .btn-acao { min-height: 38px; padding: .35rem .85rem; font-size: .86rem; }

/* ---------- Botao que abre a ficha ---------- */
.btn-ver-ficha {
    display: inline-flex; align-items: center; gap: .35rem; border: 1.5px solid var(--adm-verde); border-radius: 8px;
    background: var(--adm-card); color: var(--adm-verde); font-size: .84rem; font-weight: 700; padding: .35rem .75rem;
    white-space: nowrap; cursor: pointer; min-height: 38px;
}
.btn-ver-ficha:hover { background: var(--adm-verde); color: #fff; }
.btn-ver-ficha-card { display: flex; width: 100%; min-height: 44px; margin-top: .6rem; background: var(--adm-verde-claro); border-color: transparent; }
html[data-theme="dark"] .btn-ver-ficha, html[data-theme="dark"] .btn-ver-ficha-card { color: #8fd19e; border-color: #8fd19e; }

/* ---------- Ficha: painel lateral (computador) / tela cheia (celular) ---------- */
.modal-ficha .modal-dialog { position: fixed; right: 0; top: 0; bottom: 0; margin: 0; width: 460px; max-width: 100%; transform: translateX(100%); transition: transform .25s ease-out; }
.modal-ficha.show .modal-dialog { transform: none; }
.modal-ficha .modal-content { height: 100%; border: none; border-radius: 0; display: flex; flex-direction: column; background: var(--adm-card); color: var(--adm-texto); }
.ficha-topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1.2rem 1.25rem 1rem; border-bottom: 1px solid var(--adm-borda); border-top: 4px solid var(--adm-verde); }
.ficha-nome { font-size: 1.1rem; font-weight: 700; color: var(--adm-texto); margin: 0 0 .35rem; line-height: 1.3; }
.ficha-fechar { flex-shrink: 0; width: 44px; height: 44px; border: none; border-radius: 50%; background: var(--adm-hover); color: var(--adm-texto); cursor: pointer; }
.ficha-corpo { flex: 1; overflow-y: auto; padding: 1rem 1.25rem; }
.ficha-secao { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--adm-texto-2); margin: 1.1rem 0 .6rem; }
.ficha-secao:first-child { margin-top: 0; }
.ficha-acoes { display: grid; gap: .5rem; }
.ficha-acoes .btn-acao { justify-content: flex-start; }
@media (max-width: 575.98px) { .modal-ficha .modal-dialog { width: 100%; } }

/* ---------- Aviso rapido com Desfazer (marcacao em serie) ---------- */
.aviso-desfazer {
    position: fixed; left: 50%; bottom: 1rem; transform: translate(-50%, 160%); z-index: 1060;
    width: min(540px, calc(100% - 1.5rem)); display: flex; align-items: center; gap: .75rem;
    background: #1f2937; color: #fff; border-radius: 12px; padding: .75rem 1rem;
    box-shadow: 0 12px 30px rgba(0,0,0,.25); transition: transform .25s ease;
}
.aviso-desfazer.visivel { transform: translate(-50%, 0); }
.aviso-desfazer.erro { background: #7a1a12; }
.aviso-desfazer-texto { flex: 1; font-size: .95rem; line-height: 1.4; }
.aviso-desfazer button { background: none; border: 1px solid rgba(255,255,255,.55); color: #fff; border-radius: 8px; min-height: 44px; padding: 0 1rem; font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .aviso-desfazer { transition: none; } }

/* ---------- Estados vazio / sem resultado ---------- */
.estado-vazio { text-align: center; padding: 2rem 1rem; background: var(--adm-card); border: 1px dashed var(--adm-borda); border-radius: 12px; color: var(--adm-texto); }
.estado-vazio i.estado-icone { font-size: 1.8rem; color: var(--adm-suave); display: block; margin-bottom: .6rem; }
.estado-vazio p { margin: 0 0 1rem; color: var(--adm-texto-2); }

/* ---------- Mensagem da tela (flash renderizado pela propria tela) ---------- */
.aviso-tela { display: flex; gap: .75rem; align-items: flex-start; padding: .85rem 1rem; margin-bottom: 1rem; border-radius: 10px; font-size: .95rem; line-height: 1.5; }
.aviso-tela > i { margin-top: .2rem; }
.aviso-tela .aviso-tela-texto { flex: 1; }
.aviso-tela .aviso-tela-fechar { background: none; border: none; color: inherit; opacity: .75; min-width: 44px; min-height: 44px; margin: -.6rem -.6rem -.6rem 0; font-size: 1.3rem; }
.aviso-tela a { color: inherit; font-weight: 700; text-decoration: underline; }
.aviso-tela-success { background: #dcfce7; color: #14532d; }
.aviso-tela-warning { background: #fef3c7; color: #78350f; }
.aviso-tela-danger  { background: #fee2e2; color: #7f1d1d; }
.aviso-tela-info    { background: #e0f2fe; color: #0c4a6e; }

/* ---------- Modal de confirmacao no padrao do sistema ---------- */
.modal-ifce .modal-dialog { max-width: 460px; }
.modal-ifce .modal-content {
    position: relative; border: none; border-radius: 18px; overflow: hidden; padding: 1.75rem 1.4rem 1.3rem;
    background: var(--adm-card); color: var(--adm-texto); box-shadow: 0 24px 60px rgba(15,32,20,.28);
}
.modal-ifce .modal-content::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, #155e21, #4caf50); }
.modal-ifce.modal-perigo .modal-content::before { background: linear-gradient(90deg, #b91c1c, #ef4444); }
.modal-ifce .modal-titulo { font-size: 1.2rem; font-weight: 700; margin: 0 0 .6rem; color: var(--adm-texto); }
.modal-ifce .modal-item { font-weight: 600; background: var(--adm-hover); border-radius: 10px; padding: .6rem .8rem; margin: 0 0 1rem; word-break: break-word; }
.modal-ifce .modal-texto { font-size: .93rem; color: var(--adm-texto-2); line-height: 1.55; }
.modal-ifce .modal-botoes { display: flex; flex-direction: column-reverse; gap: .5rem; margin-top: 1.1rem; }
@media (min-width: 576px) { .modal-ifce .modal-botoes { flex-direction: row; justify-content: flex-end; } }
.modal-ifce textarea, .modal-ifce input[type=text] { width: 100%; border: 1px solid var(--adm-borda); border-radius: 10px; padding: .6rem .8rem; background: var(--adm-card); color: var(--adm-texto); font-size: .95rem; }

/* ---------- Formularios curtos ---------- */
.campo-adm { margin-bottom: 1rem; }
.campo-adm label { display: block; font-weight: 600; margin-bottom: .3rem; color: var(--adm-texto); }
.campo-adm input:not([type=file]), .campo-adm textarea {
    width: 100%; min-height: 48px; padding: .6rem .8rem; font-size: 1.02rem;
    border: 1px solid #ced4da; border-radius: 10px; background: var(--adm-card); color: var(--adm-texto);
}
.campo-adm input:focus, .campo-adm textarea:focus { outline: none; border-color: var(--adm-verde); box-shadow: 0 0 0 3px rgba(21,94,33,.15); }
.campo-adm .campo-dica { font-size: .86rem; color: var(--adm-texto-2); margin-top: .3rem; }

/* ---------- Barra de progresso ---------- */
.barra-progresso { height: 8px; border-radius: 999px; background: #eef1ef; overflow: hidden; }
html[data-theme="dark"] .barra-progresso { background: #2c3238; }
.barra-progresso span { display: block; height: 100%; background: var(--adm-verde); border-radius: 999px; }

/* ---------- Cabecalho padrao (partials/cabecalho_admin.php) ---------- */
.header-premium-ifce .cab-linha { gap: .75rem; }
.header-premium-ifce .cab-textos { min-width: 0; flex: 1 1 auto; }
.header-premium-ifce .cab-botoes { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; flex-shrink: 0; }
.header-premium-ifce .cab-acoes-computador { display: contents; }
.header-premium-ifce .cab-acoes-celular { display: none; }
@media (max-width: 767.98px) {
    /* Voltar circular ao lado do titulo; acoes com rotulo na linha de baixo */
    .header-premium-ifce > .cab-linha { flex-wrap: nowrap !important; }
    .header-premium-ifce .cab-acoes-computador { display: none; }
    .header-premium-ifce .cab-acoes-celular { display: flex; flex-direction: column; gap: .5rem; margin-top: .75rem; }
    .header-premium-ifce .cab-acoes-celular .btn-header-action { width: 100%; justify-content: center; }
}
