/**
 * Padrão visual para páginas de listagem (hero em gradiente + card + toolbar em pílulas).
 *
 * Resumo:
 * - Novas telas ou listagens “ricas”: use o bloco .list-page-modern (ver exemplos em Financeiro/ListarBoletos).
 * - Telas Gentelella com tabela: o CSS aplica o mesmo estilo a qualquer
 *   .x_panel que tenha .x_content table.table (ou use class="x_panel list-page-shell" – equivalente).
 *   Opt-out: class="x_panel list-page-no-shell" se um painel com tabela não deva usar este tema.
 * - Ações na última coluna (ícones + botão largo): ver Fono/Index — <td class="list-page-row-actions">
 *   com .list-page-actions > .list-page-actions__compact + .list-page-actions__footer.
 * - Link Abrir + copiar (pílula dividida): partial Views/Shared/_SplitOpenCopyLink.cshtml + classes
 *   .list-page-split-link (estilos neste ficheiro; script ~/js/copy-payment-link.js no layout).
 *
 * Uso A — markup dedicado (ex.: Cobranças Asaas):
 *   <div class="list-page-modern laudo-index-container">
 *     <div class="container-fluid">
 *       <div class="list-page-hero">…</div>
 *       <div class="list-page-card">… tabela …</div>
 *     </div>
 *   </div>
 *
 * Uso B — páginas Gentelella existentes: acrescente só a classe no painel raiz:
 *   <div class="x_panel list-page-shell"> … x_title + x_content … </div>
 */

/* ---------- Modo A: página “moderna” completa ---------- */

.list-page-modern.laudo-index-container {
    padding-top: 1rem;
    padding-bottom: 2rem;
}

.list-page-hero {
    text-align: left;
    padding: 2rem 2.25rem 1.75rem;
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    margin-bottom: 0;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.28);
    color: #fff;
}

.list-page-hero h1 {
    color: #fff;
    font-weight: 700;
    font-size: 1.75rem;
    margin-bottom: 0.35rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.list-page-hero h1 i {
    color: #fff;
}

.list-page-hero__sub {
    font-size: 1rem;
    opacity: 0.92;
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.95);
}

.list-page-hero__sub strong {
    color: #fff;
}

.list-page-hero__rule {
    height: 2px;
    margin: 1.35rem -2.25rem 0;
    border: 0;
    border-radius: 2px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.85) 12%,
        rgba(255, 255, 255, 0.85) 88%,
        transparent
    );
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}

.list-page-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-end;
    margin-top: 1.25rem;
    width: 100%;
}

.list-page-toolbar .btn-tool {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-radius: 999px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    font-size: 0.875rem;
    border: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
}

.list-page-toolbar .btn-tool:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    color: inherit;
}

.list-page-toolbar .btn-tool--light {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.list-page-toolbar .btn-tool--danger {
    background: #dc3545;
    color: #fff;
}

.list-page-toolbar .btn-tool--dark {
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.list-page-toolbar .btn-tool--info {
    background: rgba(255, 255, 255, 0.98);
    color: #4338ca;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.list-page-toolbar .btn-tool--ghost {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.list-page-card {
    margin-top: 1.25rem;
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-top: 3px solid transparent;
    background-image:
        linear-gradient(#fff, #fff),
        linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    overflow: visible;
}

.list-page-modern .exam-table {
    margin-top: 0;
    overflow: visible;
}

.list-page-modern .exam-table .table {
    overflow: visible;
}

.list-page-modern .dataTables_wrapper {
    overflow: visible;
}

@media (max-width: 768px) {
    .list-page-hero h1 {
        font-size: 1.4rem;
    }
}

/* ---------- Modo B: Gentelella (auto) ----------
   Aplica o tema a:
   - .x_panel.list-page-shell (manual)
   - ou qualquer .x_panel com tabela dentro de .x_content (automático)
   Opt-out: .x_panel.list-page-no-shell
*/

.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0;
    margin-bottom: 0;
}

.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_title {
    position: relative;
    float: none;
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 20px;
    padding: 1.65rem 2.25rem 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.28);
    color: #fff;
    overflow: visible;
}

.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_title h2,
.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_title h2 i {
    float: none;
    width: auto;
    margin: 0 0 0.35rem 0;
    padding: 0;
    border: none;
    color: #fff !important;
    font-size: 1.65rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_title .pull-right {
    float: none;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.85rem;
    padding: 0;
}

.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_title .pull-right > a.btn,
.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_title .pull-right > a.btn.pull-right {
    float: none;
    margin: 0;
    border-radius: 999px;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* !important: site_.css define .btn-primary com fundo roxo e !important */
.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_title .pull-right .btn-primary,
.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_title .pull-right a.btn-primary {
    background: rgba(255, 255, 255, 0.98) !important;
    background-color: rgba(255, 255, 255, 0.98) !important;
    color: #4338ca !important;
    border-color: rgba(255, 255, 255, 0.75) !important;
    border: 1px solid rgba(255, 255, 255, 0.75) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_title .pull-right .btn-primary .fa,
.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_title .pull-right .btn-primary .fas,
.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_title .pull-right .btn-primary .far {
    color: #4338ca !important;
}

.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_title .pull-right .btn-primary:hover,
.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_title .pull-right .btn-primary:focus {
    filter: brightness(1.03);
    color: #312e81 !important;
    background-color: #fff !important;
}

.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_title .pull-right .btn-default,
.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_title .pull-right a.btn-default {
    background: rgba(255, 255, 255, 0.15) !important;
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
}

.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_title .pull-right .btn-default .fa,
.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_title .pull-right .btn-default .fas {
    color: #fff !important;
}

.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_title .pull-right .btn-default:hover,
.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_title .pull-right .btn-default:focus {
    background-color: rgba(255, 255, 255, 0.28) !important;
    color: #fff !important;
}

.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_title .pull-right .btn-danger,
.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_title .pull-right a.btn-danger {
    background: #dc3545 !important;
    background-color: #dc3545 !important;
    color: #fff !important;
    border: none !important;
    border-color: #dc3545 !important;
}

.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_title .pull-right .btn-success,
.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_title .pull-right a.btn-success {
    background: rgba(16, 185, 129, 0.95) !important;
    background-color: rgba(16, 185, 129, 0.95) !important;
    color: #fff !important;
    border: none !important;
}

.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_title .pull-right .btn-info,
.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_title .pull-right a.btn-info {
    background: rgba(255, 255, 255, 0.22) !important;
    background-color: rgba(255, 255, 255, 0.22) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
}

.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_title .panel_toolbox {
    float: none;
    margin: 0;
    min-width: auto;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_title .panel_toolbox a {
    color: rgba(255, 255, 255, 0.9) !important;
}

.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_content {
    margin-top: 0;
    padding: 1.5rem;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-top: 3px solid transparent;
    background-image:
        linear-gradient(#fff, #fff),
        linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_content .dataTables_wrapper {
    overflow: visible;
}

/* Tabela: botões e etiquetas sem “negrito” pesado (Bootstrap/custom usam 600/700) */
.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_content .btn,
.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_content a.btn,
.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_content button.btn {
    font-weight: 500 !important;
}

.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_content .table .label {
    font-weight: 500;
}

/* ---------- Ações por linha (grelha compacta + botão largo em baixo) ---------- */
.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .list-page-row-actions {
    vertical-align: top;
    min-width: 10.5rem;
    max-width: 14rem;
    text-align: right;
}

.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .list-page-actions {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    align-items: flex-end;
    margin-left: auto;
    width: fit-content;
    max-width: 100%;
}

.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .list-page-actions__compact {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    justify-content: flex-end;
}

.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .list-page-actions__compact > .btn {
    flex: 0 0 auto;
    min-width: 2.35rem;
    min-height: 2.35rem;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0.4rem !important;
    margin-bottom: 0 !important;
    margin-right: 0 !important;
    border-radius: 8px;
    line-height: 1;
}

.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .list-page-actions__compact > .btn.fa {
    font-size: 0.95rem;
    font-family: FontAwesome !important; /* garante ícones quando o .fa está no próprio <a> */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: auto;
}

.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .list-page-actions__compact > .btn.fa::before {
    display: block;
    line-height: 1;
}

/* Compat: quando FA5 sobrescreve e alguns ícones FA4 não têm content */
.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .list-page-actions__compact .fa-money::before {
    content: "\f0d6";
}

.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .list-page-actions__compact .fa-search-plus::before {
    content: "\f00e";
}

/* ---------- Compat global: botões <a class="btn fa fa-..."> direto na tabela ----------
   Em várias telas antigas, os botões de ação são âncoras sem <i> filho.
   Se FA5 estiver presente, alguns ícones FA4 ficam “quadrados” (sem glyph).
   Aqui forçamos o FontAwesome no ::before e mapeamos os ícones mais comuns.
*/
.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_content table .btn.fa::before {
    font-family: FontAwesome !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: auto;
    display: inline-block;
    line-height: 1;
}

.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_content table .btn.fa.fa-search-plus::before {
    content: "\f00e";
}

.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_content table .btn.fa.fa-edit::before {
    content: "\f044";
}

.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_content table .btn.fa.fa-trash::before {
    content: "\f1f8";
}

.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .x_content table .btn.fa.fa-money::before {
    content: "\f0d6";
}

/* Contraste: btn-default no fundo claro + ícone visível (ex.: lápis Editar) */
.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .list-page-actions__compact > .btn-default {
    background-color: #fff !important;
    color: #1e293b !important;
    border: 1px solid #94a3b8 !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .list-page-actions__compact > .btn-default:hover,
.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .list-page-actions__compact > .btn-default:focus {
    background-color: #f8fafc !important;
    color: #0f172a !important;
    border-color: #64748b !important;
}

.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .list-page-actions__compact > .btn-default .fa {
    color: #334155 !important;
}

.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .list-page-actions__compact > .btn-primary .fa {
    color: #fff !important;
}

.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .list-page-actions__compact > .btn-danger .fa {
    color: #fff !important;
}

/* Ícones FA aplicados no próprio <a class="btn fa fa-..."> (sem <i> filho) */
.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .list-page-actions__compact > .btn.btn-primary.fa {
    color: #fff !important;
}

.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .list-page-actions__compact > .btn.btn-danger.fa {
    color: #fff !important;
}

.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .list-page-actions__compact > .btn.btn-default.fa {
    color: #334155 !important;
}

.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .list-page-actions__footer .list-page-actions__footer-btn {
    width: 100%;
    margin-bottom: 0 !important;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.8rem;
    padding: 0.5rem 0.45rem !important;
    white-space: normal;
    line-height: 1.25;
    text-align: center;
}

.container.body .right_col2 :is(
    .x_panel.list-page-shell,
    .x_panel:not(.list-page-no-shell):has(.x_content table)
) .list-page-actions__footer .list-page-actions__footer-btn .fa {
    margin-right: 0.25rem;
}

/* ---------- Botão dividido: Abrir (gradiente) + copiar (lateral claro) ---------- */
.list-page-split-link,
.boleto-link-wrap {
    display: inline-flex;
    align-items: stretch;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    vertical-align: middle;
}

.list-page-split-link__primary,
.btn-boleto-open {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 500;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff !important;
    text-decoration: none !important;
    border: none;
    white-space: nowrap;
}

.list-page-split-link__primary:hover,
.list-page-split-link__primary:focus,
.btn-boleto-open:hover,
.btn-boleto-open:focus {
    color: #fff !important;
    filter: brightness(1.05);
}

.list-page-split-link__primary .fa,
.btn-boleto-open .fa {
    color: #fff !important;
}

.list-page-split-link__side,
.btn-boleto-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    padding: 0 0.65rem;
    border: none;
    border-left: 1px solid rgba(226, 232, 240, 0.9);
    background: #fff;
    color: #475569;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.list-page-split-link__side:hover,
.list-page-split-link__side:focus,
.btn-boleto-copy:hover,
.btn-boleto-copy:focus {
    background: #f1f5f9;
    color: #1e293b;
}

.list-page-split-link__side .fa,
.btn-boleto-copy .fa {
    font-size: 0.95rem;
}
