/*
 * Estilo global do painel PixTo (sobre o AdminLTE/Bootstrap 4).
 * Carregado em todas as telas pelo plugin "PxSkin" (config/adminlte.php).
 * As telas com layout próprio (classes px-*, dash-*, swap-*) sobrescrevem o que precisarem.
 */
:root {
    --px-navy: #1e3a8a;
    --px-blue: #2563eb;
    --px-cyan: #0ea5e9;
    --px-ink: #0f172a;
    --px-text: #334155;
    --px-muted: #64748b;
    --px-border: #e2e8f0;
    --px-soft: #f8fafc;
    --px-bg: #f1f5f9;
    --px-radius: 1rem;
    --px-gradient: linear-gradient(135deg, #1e3a8a 0%, #2563eb 60%, #0ea5e9 100%);
}

/* ---------- Página ---------- */
body { color: var(--px-text); }
.content-wrapper { background: var(--px-bg); }
.content-header h1 { font-size: 1.5rem; font-weight: 600; color: var(--px-ink); }
.content-header h1 h2 { margin: 0; font-size: inherit; font-weight: inherit; line-height: 1.2; color: inherit; }
.main-footer { background: transparent; border-top: 1px solid var(--px-border); color: var(--px-muted); }

/* ---------- Navegação ---------- */
.main-header.navbar { border-bottom: 0; box-shadow: 0 2px 12px rgba(15, 23, 42, .06); }

/* Barra lateral: o fundo é o mesmo do logotipo (#0e1522), então ele se integra sem "caixa" visível. */
.main-sidebar { background: #0e1522; }
.main-sidebar .sidebar { padding-left: .6rem; padding-right: .6rem; }

/* Marca: logotipo largo com o menu aberto; só a moeda com o menu recolhido (o AdminLTE alterna a visibilidade). */
.brand-link.logo-switch { position: relative; height: 72px; padding: 0; background: #0e1522; border-bottom: 1px solid rgba(255, 255, 255, .08) !important; }
.brand-link .logo-xl,
.brand-link .logo-xs { top: 50%; left: 50%; transform: translate(-50%, -50%); margin: 0; float: none; width: auto; }
.brand-link .logo-xl { height: 50px; max-width: calc(100% - 24px); }
.brand-link .logo-xs { height: 42px; max-height: none; border-radius: .6rem; }

/* Usuário logado */
.px-side-user { display: flex; align-items: center; gap: .7rem; margin: .9rem 0 .4rem; padding: .6rem .7rem; border-radius: .85rem; background: rgba(255, 255, 255, .05); color: #e2e8f0; text-decoration: none; overflow: hidden; }
.px-side-user:hover { background: rgba(255, 255, 255, .09); color: #fff; text-decoration: none; }
.px-side-user__avatar { flex: none; width: 2.3rem; height: 2.3rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 700; color: #fff; background: var(--px-gradient); box-shadow: 0 4px 12px rgba(37, 99, 235, .4); }
.px-side-user__text { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; white-space: nowrap; }
.px-side-user__text strong { overflow: hidden; text-overflow: ellipsis; font-size: .9rem; font-weight: 600; }
.px-side-user__text small { color: #94a3b8; font-size: .72rem; }
/* Menu recolhido: só o avatar (volta a mostrar o nome ao passar o mouse, quando a barra expande). */
.sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .px-side-user { justify-content: center; padding: .5rem 0; background: transparent; }
.sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .px-side-user__text { display: none; }

/* Seções */
.sidebar-dark-primary .nav-sidebar > .nav-header {
    padding: 1.15rem .8rem .4rem;
    color: #64748b;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.sidebar-dark-primary .nav-sidebar > .nav-header:first-child { padding-top: .6rem; }

/* Itens */
.sidebar-dark-primary .nav-sidebar > .nav-item { margin-bottom: .15rem; }
.sidebar-dark-primary .nav-sidebar .nav-link { color: #cbd5e1; border-radius: .65rem; transition: background .15s ease, color .15s ease; }
.sidebar-dark-primary .nav-sidebar .nav-link .nav-icon { color: #64748b; transition: color .15s ease; }
.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link:hover,
.sidebar-dark-primary .nav-sidebar > .nav-item.menu-open > .nav-link { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link:hover .nav-icon,
.sidebar-dark-primary .nav-sidebar > .nav-item.menu-open > .nav-link .nav-icon { color: #93c5fd; }
.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active,
.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active:hover {
    background: var(--px-gradient);
    color: #fff;
    box-shadow: 0 6px 16px rgba(37, 99, 235, .35);
}
.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active .nav-icon { color: #fff; }

/* Submenus: recuo com uma linha guia à esquerda */
.sidebar-dark-primary .nav-treeview { margin: .15rem 0 .25rem 1.15rem; padding-left: .4rem; border-left: 1px solid rgba(255, 255, 255, .1); }
.sidebar-dark-primary .nav-treeview > .nav-item > .nav-link { font-size: .9rem; padding-top: .4rem; padding-bottom: .4rem; }
.sidebar-dark-primary .nav-treeview > .nav-item > .nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar-dark-primary .nav-treeview > .nav-item > .nav-link.active,
.sidebar-dark-primary .nav-treeview > .nav-item > .nav-link.active:hover { background: rgba(37, 99, 235, .28); color: #fff; box-shadow: none; }
.sidebar-dark-primary .nav-treeview > .nav-item > .nav-link.active .nav-icon { color: #93c5fd; }
.sidebar-dark-primary .nav-sidebar .nav-link .right,
.sidebar-dark-primary .nav-sidebar .nav-link .badge { color: inherit; }
.sidebar-dark-primary .nav-sidebar .nav-link .badge { padding: .25em .55em; font-size: .65rem; text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Cartões ---------- */
.card { border: 0; border-radius: var(--px-radius); box-shadow: 0 6px 20px rgba(15, 23, 42, .07); }
.card-header {
    background: var(--px-soft);
    border-bottom: 1px solid var(--px-border);
    border-radius: var(--px-radius) var(--px-radius) 0 0;
    padding: .85rem 1.1rem;
}
.card-title { font-weight: 600; color: var(--px-ink); }
.card-footer {
    background: var(--px-soft);
    border-top: 1px solid var(--px-border);
    border-radius: 0 0 var(--px-radius) var(--px-radius);
}
/* Cartões "card-primary" (azul chapado do AdminLTE) usam o gradiente da marca. */
.card-primary:not(.card-outline) > .card-header,
.card-info:not(.card-outline) > .card-header {
    background: var(--px-gradient);
    border-bottom: 0;
}
.card-primary:not(.card-outline) > .card-header .card-title,
.card-info:not(.card-outline) > .card-header .card-title,
.card-primary:not(.card-outline) > .card-header .btn-tool,
.card-info:not(.card-outline) > .card-header .btn-tool { color: #fff; }
.card-success:not(.card-outline) > .card-header { background: linear-gradient(135deg, #15803d, #22c55e); border-bottom: 0; }
.card-danger:not(.card-outline) > .card-header { background: linear-gradient(135deg, #b91c1c, #f87171); border-bottom: 0; }
.card-warning:not(.card-outline) > .card-header { background: linear-gradient(135deg, #d97706, #fbbf24); border-bottom: 0; }
.card-success:not(.card-outline) > .card-header .card-title,
.card-danger:not(.card-outline) > .card-header .card-title { color: #fff; }

/* ---------- Tabelas e DataTables ---------- */
.table thead th {
    border-top: 0;
    border-bottom: 0;
    background: #f1f5f9;
    color: var(--px-muted);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    white-space: nowrap;
}
.table td, .table th { vertical-align: middle; }
.table td { border-top: 1px solid #f1f5f9; }
.table tbody tr:hover { background: #f8fafc; }
.table-striped tbody tr:nth-of-type(odd) { background: #fafcff; }
.table-bordered, .table-bordered td, .table-bordered th { border-color: #f1f5f9; }

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--px-border);
    border-radius: .6rem;
    padding: .3rem .65rem;
    outline: 0;
}
.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus { border-color: var(--px-blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.dataTables_wrapper .dataTables_info { color: var(--px-muted); font-size: .85rem; }
.page-link { border-radius: .5rem; margin: 0 2px; border: 1px solid var(--px-border); color: var(--px-blue); }
.page-item.active .page-link { background: var(--px-gradient); border-color: transparent; }
.page-item.disabled .page-link { color: #94a3b8; }

/* ---------- Botões ---------- */
.btn { border-radius: .6rem; font-weight: 500; }
.btn-lg { border-radius: .8rem; }
.btn-primary { background: linear-gradient(135deg, #2563eb, #0ea5e9); border: 0; box-shadow: 0 4px 12px rgba(37, 99, 235, .25); }
.btn-primary:hover, .btn-primary:focus,
.btn-primary:not(:disabled):not(.disabled):active { background: linear-gradient(135deg, #2563eb, #0ea5e9); filter: brightness(1.07); }
.btn-primary:disabled, .btn-primary.disabled { opacity: .6; box-shadow: none; }
.btn-success { background: linear-gradient(135deg, #16a34a, #22c55e); border: 0; box-shadow: 0 4px 12px rgba(22, 163, 74, .25); }
.btn-success:hover, .btn-success:focus,
.btn-success:not(:disabled):not(.disabled):active { background: linear-gradient(135deg, #16a34a, #22c55e); filter: brightness(1.07); }
.btn-danger { background: linear-gradient(135deg, #dc2626, #f87171); border: 0; }
.btn-danger:hover, .btn-danger:focus { background: linear-gradient(135deg, #dc2626, #f87171); filter: brightness(1.07); }
.btn-default { background: #fff; border: 1px solid var(--px-border); color: var(--px-text); }
.btn-default:hover, .btn-default:focus { background: var(--px-soft); border-color: #93c5fd; color: var(--px-ink); }
.btn-secondary { background: #64748b; border-color: #64748b; }
.btn-outline-primary { border-color: #93c5fd; color: var(--px-blue); }
.btn-outline-primary:hover { background: var(--px-blue); border-color: var(--px-blue); }
.btn-xs, .btn-sm { border-radius: .5rem; }

/* ---------- Formulários ---------- */
label:not(.form-check-label):not(.custom-control-label):not(.custom-file-label) { font-weight: 600; color: var(--px-text); }
.form-control, .custom-select, .custom-file-label {
    border-radius: .65rem;
    border: 1px solid var(--px-border);
}
.form-control:focus, .custom-select:focus {
    border-color: var(--px-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(220, 53, 69, .15); }
.input-group-text { background: var(--px-soft); border-color: var(--px-border); color: var(--px-muted); }
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple { border-radius: .65rem; border-color: var(--px-border); }
.select2-dropdown { border-radius: .65rem; border-color: var(--px-border); }

/* Linhas de detalhe (th dentro do corpo da tabela): rótulo discreto à esquerda */
.table tbody th { color: var(--px-muted); font-weight: 600; }

/* ---------- Cartões de resumo (números em destaque) ---------- */
.px-stat { display: flex; align-items: center; gap: 1rem; height: 100%; padding: 1rem 1.1rem; background: #fff; border: 1px solid var(--px-border); border-radius: var(--px-radius); box-shadow: 0 4px 14px rgba(15, 23, 42, .05); }
.px-stat__icon { flex: none; width: 3rem; height: 3rem; border-radius: .85rem; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; color: #fff; }
.px-stat__body { min-width: 0; flex: 1; }
.px-stat__label { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--px-muted); }
.px-stat__value { display: block; font-size: 1.35rem; font-weight: 700; line-height: 1.25; color: var(--px-ink); word-break: break-word; }
.px-stat__value small { font-size: .8rem; font-weight: 600; color: var(--px-muted); }
.px-stat--info .px-stat__icon { background: linear-gradient(135deg, #0ea5e9, #38bdf8); }
.px-stat--danger .px-stat__icon { background: linear-gradient(135deg, #ef4444, #f87171); }
.px-stat--success .px-stat__icon { background: linear-gradient(135deg, #16a34a, #22c55e); }
.px-stat--primary .px-stat__icon { background: linear-gradient(135deg, #2563eb, #60a5fa); }
.px-stat--warning .px-stat__icon { background: linear-gradient(135deg, #f59e0b, #fbbf24); }

/* Caixa de informação/observação (no lugar de parágrafos soltos) */
.px-note { padding: .85rem 1rem; background: #f1f5f9; border-radius: .85rem; font-size: .85rem; color: #475569; }
.px-note p:last-child { margin-bottom: 0; }

/* ---------- Classes utilitárias no estilo Tailwind, usadas em várias telas antigas ---------- */
.text-xs { font-size: .75rem; }
.text-sm { font-size: .875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.leading-tight { line-height: 1.25; }
.leading-normal { line-height: 1.5; }
.text-gray-200 { color: #e2e8f0; }
.text-gray-300 { color: #cbd5e1; }
.text-gray-400 { color: #94a3b8; }
.text-gray-500 { color: #64748b; }
.text-gray-600 { color: #475569; }
.text-gray-700 { color: #334155; }
.text-gray-800 { color: #1e293b; }
.text-gray-900 { color: #0f172a; }
.text-green-600 { color: #16a34a; }
.text-red-600 { color: #dc2626; }
.underline { text-decoration: underline; }
.block { display: block; }
.w-full { width: 100%; }

/* ---------- Etiquetas, avisos e modais ---------- */
.badge { border-radius: 2rem; padding: .35em .75em; font-weight: 600; }
.alert { border: 0; border-radius: .85rem; }
.modal-content { border: 0; border-radius: var(--px-radius); overflow: hidden; box-shadow: 0 24px 60px rgba(15, 23, 42, .25); }
.modal-header { background: var(--px-soft); border-bottom: 1px solid var(--px-border); }
.modal-title { font-weight: 600; color: var(--px-ink); }
.modal-footer { background: var(--px-soft); border-top: 1px solid var(--px-border); }

/* Etiquetas de status geradas por public/js/px-status-badges (tabelas) */
.px-status { display: inline-block; padding: .35em .75em; border-radius: 2rem; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.px-status--success { background: #dcfce7; color: #166534; }
.px-status--primary { background: #dbeafe; color: #1e40af; }
.px-status--info { background: #e0f2fe; color: #075985; }
.px-status--warning { background: #fef3c7; color: #92400e; }
.px-status--danger { background: #fee2e2; color: #991b1b; }
.px-status--secondary { background: #e2e8f0; color: #475569; }

/* ---------- Telas de acesso (login, cadastro, recuperação de senha) ---------- */
.login-page, .register-page { background: var(--px-gradient); }
.login-logo a, .register-logo a { color: #fff; font-weight: 300; }
.login-logo a b, .register-logo a b { font-weight: 700; }
.login-box .card, .register-box .card { border-radius: var(--px-radius); border-top: 0; box-shadow: 0 24px 60px rgba(15, 23, 42, .30); overflow: hidden; }
.login-box .card-header, .register-box .card-header { background: #fff; border-bottom: 0; padding-top: 1.4rem; }
.login-box .card-title, .register-box .card-title { font-size: 1.1rem; color: var(--px-ink); }
.login-box .btn-flat, .register-box .btn-flat { border-radius: .7rem; height: 44px; font-weight: 600; }
.login-box .form-control, .register-box .form-control { height: 44px; }
.login-box .input-group .form-control { border-radius: .65rem 0 0 .65rem; }
.login-box .input-group-append .input-group-text, .register-box .input-group-append .input-group-text { border-radius: 0 .65rem .65rem 0; }
.login-card-body, .register-card-body { border-radius: 0 0 var(--px-radius) var(--px-radius); }
