/* ── Painel Solus Mídia: visual vidro líquido (mesmo padrão do site) ── */
:root {
    --bg:        #07070A;
    --sidebar:   rgba(14,14,19,.55);
    --card:      rgba(255,255,255,.045);
    --border:    rgba(255,255,255,.09);
    --primary:   #FF3B3B;
    --primary-h: #E62E2E;
    --glow:      #FF6A57;
    --success:   #10b981;
    --warning:   #f59e0b;
    --info:      #3b82f6;
    --text:      #F1F2F5;
    --muted:     #A1A6B3;
    --input-bg:  rgba(0,0,0,.28);
    --gap:       14px;
    --sidebar-w: 248px;
    --rail-w:    60px;
    --acoes-w:   268px;
    --ease:      cubic-bezier(.22,1,.36,1);
}

*, *::before, *::after { box-sizing: border-box; }
body {
    background: var(--bg); color: var(--text); margin: 0;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}
::selection { background: var(--primary); color: #fff; }
a { color: var(--glow); }
a:hover { color: #fff; }
.text-muted { color: var(--muted) !important; }

/* ── Cenário de fundo ── */
.cena { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
    background: radial-gradient(120% 80% at 50% -10%, #1c0707 0%, transparent 60%), var(--bg); }
.cena .blob { position: absolute; border-radius: 50%; filter: blur(90px); animation: deriva 26s ease-in-out infinite alternate; }
.cena .b1 { width: 48vmax; height: 48vmax; left: -16vmax; top: -18vmax; background: radial-gradient(circle, #FF3B3B 0%, transparent 65%); opacity: .38; }
.cena .b2 { width: 40vmax; height: 40vmax; right: -14vmax; top: 30vh; background: radial-gradient(circle, #FF6A57 0%, transparent 65%); opacity: .16; animation-duration: 32s; animation-direction: alternate-reverse; }
.cena .b3 { width: 36vmax; height: 36vmax; left: 30vw; bottom: -22vmax; background: radial-gradient(circle, #D91E1E 0%, transparent 65%); opacity: .22; animation-duration: 20s; }
.cena .grade { position: absolute; inset: 0; opacity: .45;
    background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 72px 72px;
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, #000 20%, transparent 75%);
            mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, #000 20%, transparent 75%); }
@keyframes deriva {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(5vmax, 3vmax) scale(1.1); }
    100% { transform: translate(-3vmax, 6vmax) scale(.94); }
}
@media (prefers-reduced-motion: reduce) { .cena .blob { animation: none; } }

/* ── Vidro ── */
.glass, .card-stat, .modal-content {
    --mx: 50%; --my: 0%;
    position: relative;
    background: linear-gradient(145deg, rgba(255,255,255,.085) 0%, rgba(255,255,255,.03) 45%, rgba(255,255,255,.05) 100%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
            backdrop-filter: blur(22px) saturate(160%);
    border: 0;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.18),
        inset 0 0 0 1px rgba(255,255,255,.06),
        0 24px 60px -24px rgba(0,0,0,.7),
        0 2px 6px rgba(0,0,0,.25);
}
.glass::before, .card-stat::before, .modal-content::before {
    content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
    background: linear-gradient(135deg, rgba(255,255,255,.4) 0%, rgba(255,255,255,.06) 30%, rgba(255,255,255,.02) 55%, rgba(255,255,255,.12) 85%, rgba(255,255,255,.25) 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
}
/* brilho que acompanha o cursor (só nos cartões) */
.card-stat::after {
    content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
    background: radial-gradient(380px circle at var(--mx) var(--my), rgba(255,255,255,.08), transparent 45%);
    transition: opacity .4s var(--ease);
}
.card-stat:hover::after { opacity: 1; }
.card-stat > * { position: relative; z-index: 1; }

/* ── Menu lateral esquerdo ── */
.sidebar {
    position: fixed; top: var(--gap); left: var(--gap); bottom: var(--gap);
    width: var(--sidebar-w);
    border-radius: 22px;
    display: flex; flex-direction: column;
    z-index: 1030;
    transition: width .45s var(--ease), transform .45s var(--ease);
    overflow: hidden;
}
.sidebar-brand {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 18px 14px 14px 18px;
    border-bottom: 1px solid var(--border);
    min-height: 74px;
}
.sidebar-brand .marca { font-size: 20px; overflow: hidden; }
.sidebar-brand .perfil { display: block; color: var(--muted); font-size: .66rem; letter-spacing: .5px; margin-top: 6px; white-space: nowrap; }
.btn-icone {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; flex-shrink: 0;
    border-radius: 11px; border: 1px solid var(--border);
    background: rgba(255,255,255,.04); color: var(--muted);
    cursor: pointer; transition: all .2s var(--ease);
}
.btn-icone:hover, .btn-icone:focus { color: #fff; background: rgba(255,255,255,.1); outline: none; }

.sidebar-nav { flex: 1; padding: 10px; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.1) transparent; }
.nav-section {
    padding: 12px 10px 6px; font-size: .62rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 1.2px; color: rgba(161,166,179,.7);
    white-space: nowrap;
}
.sidebar .nav-link {
    position: relative;
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; margin: 2px 0;
    border-radius: 12px;
    color: var(--muted); text-decoration: none; font-size: .875rem; white-space: nowrap;
    transition: color .2s, background .2s;
}
.sidebar .nav-link .fa { width: 20px; text-align: center; font-size: .95rem; flex-shrink: 0; }
.sidebar .nav-link:hover { color: #fff; background: rgba(255,255,255,.06); }
.sidebar .nav-link.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(255,59,59,.28), rgba(255,59,59,.06));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 8px 24px -10px rgba(255,59,59,.55);
}
.sidebar .nav-link.active .fa { color: var(--primary); filter: drop-shadow(0 0 6px rgba(255,59,59,.6)); }
.sidebar .nav-link.active::before {
    content: ''; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 3px;
    border-radius: 0 3px 3px 0; background: var(--primary); box-shadow: 0 0 10px var(--primary);
}
.rotulo { transition: opacity .25s; }

.sidebar-user {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px; border-top: 1px solid var(--border); font-size: .8rem;
}
.avatar {
    width: 36px; height: 36px; border-radius: 12px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-family: 'Manrope', sans-serif; font-weight: 800; color: #fff;
    background: linear-gradient(145deg, var(--glow), var(--primary) 55%, #b51616);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 6px 16px -6px rgba(255,59,59,.7);
}
.sidebar-user .info { flex: 1; min-width: 0; }
.sidebar-user .nome { color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .role {
    display: inline-block; padding: 1px 8px; border-radius: 20px;
    font-size: .62rem; font-weight: 600; margin-top: 2px;
    background: rgba(255,59,59,.15); color: var(--primary);
}
.sidebar-user .role.parceiro { background: rgba(16,185,129,.15); color: var(--success); }
.sidebar-user .role.representante { background: rgba(245,158,11,.15); color: var(--warning); }
.btn-sair { color: var(--muted); }
.btn-sair:hover { color: var(--primary); }

/* menu recolhido: só ícones (computador) */
@media (min-width: 992px) {
    html.menu-recolhido { --sidebar-w: 76px; }
    html.menu-recolhido .sidebar .rotulo,
    html.menu-recolhido .sidebar .marca-texto,
    html.menu-recolhido .sidebar .perfil,
    html.menu-recolhido .sidebar-user .info { display: none; }
    html.menu-recolhido .sidebar-brand { flex-direction: column; padding: 16px 0 12px; gap: 12px; }
    html.menu-recolhido .sidebar-brand .marca { gap: 0; }
    html.menu-recolhido .nav-section { font-size: 0; padding: 10px 0 6px; }
    html.menu-recolhido .nav-section::after { content: ''; display: block; height: 1px; margin: 0 14px; background: var(--border); }
    html.menu-recolhido .sidebar .nav-link { justify-content: center; padding: 11px 0; }
    html.menu-recolhido .sidebar-user { flex-direction: column; padding: 12px 0; }
    html.menu-recolhido #btnMenu .fa { transform: rotate(180deg); }
}
#btnMenu .fa { transition: transform .45s var(--ease); }

/* dica com o nome ao passar o mouse no menu recolhido */
.dica {
    position: fixed; z-index: 2000; pointer-events: none;
    padding: 6px 10px; border-radius: 9px; font-size: .78rem; white-space: nowrap;
    background: rgba(20,20,26,.92); border: 1px solid var(--border); color: #fff;
    box-shadow: 0 10px 24px -8px rgba(0,0,0,.7);
    opacity: 0; transform: translateX(-4px); transition: opacity .15s, transform .15s;
}
.dica.visivel { opacity: 1; transform: none; }

/* ── Área principal ── */
.main-content {
    margin-left: calc(var(--sidebar-w) + var(--gap) * 2);
    margin-right: calc(var(--rail-w) + var(--gap) * 2);
    min-height: 100vh;
    padding-top: var(--gap);
    transition: margin .45s var(--ease);
}
.topbar {
    position: sticky; top: var(--gap); z-index: 1020;
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px 12px 22px; border-radius: 18px;
}
.topbar h1 { font-family: 'Manrope', sans-serif; font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em; margin: 0; flex: 1; }
.topbar .data-hoje { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.topbar .so-celular { display: none; }
.page-body { padding: 22px 4px 32px; }

/* ── Menu lateral direito: ações rápidas (sempre começa recolhido) ── */
.acoes {
    position: fixed; top: var(--gap); right: var(--gap); bottom: var(--gap);
    width: var(--rail-w);
    border-radius: 22px;
    display: flex; flex-direction: column; align-items: stretch;
    z-index: 1031; overflow: hidden;
    transition: width .45s var(--ease), transform .45s var(--ease);
}
html.acoes-abertas .acoes { width: var(--acoes-w); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 30px 80px -10px rgba(0,0,0,.85); }
.acoes-topo { display: flex; align-items: center; gap: 10px; padding: 13px; border-bottom: 1px solid var(--border); min-height: 62px; }
.acoes-topo .titulo { font-family: 'Manrope', sans-serif; font-weight: 800; font-size: .95rem; white-space: nowrap; }
.acoes-topo .titulo small { display: block; font-family: 'Inter', sans-serif; font-weight: 400; font-size: .7rem; color: var(--muted); }
#btnAcoes .fa { transition: transform .45s var(--ease); }
html.acoes-abertas #btnAcoes .fa { transform: rotate(45deg); }
.acoes-lista { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 8px; scrollbar-width: none; }
.acao {
    display: flex; align-items: center; gap: 12px;
    padding: 7px; margin: 3px 0; border-radius: 13px;
    color: var(--text); text-decoration: none !important; white-space: nowrap;
    transition: background .2s;
}
.acao:hover { background: rgba(255,255,255,.07); color: #fff; }
.acao .ic {
    width: 30px; height: 30px; border-radius: 10px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center; font-size: .82rem;
    color: var(--c, var(--primary));
    background: color-mix(in srgb, var(--c, #FF3B3B) 16%, transparent);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
}
.acao .txt { font-size: .84rem; line-height: 1.2; }
.acao .txt small { display: block; color: var(--muted); font-size: .7rem; }
.acoes-sep { height: 1px; background: var(--border); margin: 8px 6px; }
html:not(.acoes-abertas) .acoes .titulo,
html:not(.acoes-abertas) .acao .txt { display: none; }
html:not(.acoes-abertas) .acoes-topo { justify-content: center; padding: 13px 0; }
.acoes-fundo { position: fixed; inset: 0; z-index: 1029; background: rgba(0,0,0,.35); opacity: 0; pointer-events: none; transition: opacity .3s; }
html.acoes-abertas .acoes-fundo { opacity: 1; pointer-events: auto; }

/* ── Cartões e números ── */
.card-stat { border-radius: 20px; padding: 20px; }
.card-stat .stat-label { color: var(--muted); font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.card-stat .stat-value { font-family: 'Manrope', sans-serif; font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; margin: 4px 0; font-variant-numeric: tabular-nums; }
.card-stat .stat-icon { font-size: 1.3rem; opacity: .75; filter: drop-shadow(0 0 10px currentColor); }

/* ── Tabelas ── */
.table { color: var(--text); }
.table thead th { border-color: var(--border); border-top: 0; color: var(--muted); font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; }
.table td, .table th { border-color: var(--border); vertical-align: middle; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: rgba(255,255,255,.04); }
table.dataTable { border-collapse: collapse !important; }
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    background: var(--input-bg); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 5px 10px;
}
.dataTables_wrapper .dataTables_info, .dataTables_wrapper .dataTables_paginate { color: var(--muted); font-size: .82rem; }
.page-link { background: rgba(255,255,255,.04); border-color: var(--border); color: var(--text); }
.page-link:hover { background: rgba(255,255,255,.1); border-color: var(--border); color: #fff; }
.page-item.active .page-link { background: var(--primary); border-color: var(--primary); }
.page-item.disabled .page-link { background: transparent; border-color: var(--border); color: var(--muted); }

/* ── Formulários ── */
.form-control, .custom-select {
    background: var(--input-bg); border: 1px solid var(--border);
    color: var(--text); border-radius: 11px;
}
.form-control:focus, .custom-select:focus {
    background: rgba(0,0,0,.4); border-color: rgba(255,59,59,.7);
    color: var(--text); box-shadow: 0 0 0 4px rgba(255,59,59,.14);
}
.form-control::placeholder { color: rgba(161,166,179,.7); }
.form-control:disabled, .form-control[readonly] { background: rgba(255,255,255,.03); }
select.form-control option { background: #15151B; }
.input-group-text { background: rgba(255,255,255,.05); border-color: var(--border); color: var(--muted); border-radius: 11px; }
label { color: var(--muted); font-size: .8rem; font-weight: 500; }

/* ── Botões ── */
.btn { border-radius: 11px; font-weight: 500; transition: transform .2s var(--ease), box-shadow .2s, background .2s; }
.btn:active { transform: scale(.97); }
.btn-primary {
    background: linear-gradient(180deg, var(--glow) 0%, var(--primary) 50%, #D91E1E 100%);
    border: 0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 8px 22px -8px rgba(255,59,59,.75);
}
.btn-primary:hover, .btn-primary:focus { background: linear-gradient(180deg, #FF7B6A 0%, var(--primary) 60%, #D91E1E 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 12px 28px -8px rgba(255,59,59,.9); }
.btn-primary:not(:disabled):not(.disabled):active { background: var(--primary-h); }
.btn-secondary, .btn-outline-light {
    background: rgba(255,255,255,.06); border: 1px solid var(--border); color: var(--text);
}
.btn-secondary:hover, .btn-outline-light:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.18); color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); }
.btn-warning { background: var(--warning); border-color: var(--warning); color: #111; }

/* ── Janelas (modais) ── */
.modal-content { border-radius: 22px; color: var(--text); background: linear-gradient(145deg, rgba(34,34,42,.92), rgba(18,18,24,.94)); }
.modal-header, .modal-footer { border-color: var(--border); }
.modal-title { font-family: 'Manrope', sans-serif; font-weight: 800; }
.modal-backdrop.show { opacity: .65; }
.close { color: var(--muted); text-shadow: none; opacity: 1; }
.close:hover { color: #fff; }

/* ── Etiquetas ── */
.badge-ativo    { background: rgba(16,185,129,.15); color: var(--success); }
.badge-inativo  { background: rgba(255,59,59,.15);  color: var(--primary); }
.badge-pendente { background: rgba(245,158,11,.15); color: var(--warning); }
.badge-pago     { background: rgba(16,185,129,.15); color: var(--success); }
.badge-cancelado{ background: rgba(156,163,175,.15);color: var(--muted);   }
.badge-status   { padding: 4px 10px; border-radius: 20px; font-size: .72rem; font-weight: 600; }

/* ── Aviso flutuante ── */
#alertTop {
    position: fixed; top: 22px; left: 50%; transform: translateX(-50%); z-index: 9999;
    min-width: 280px; max-width: 420px; border-radius: 14px; border: 0;
    font-size: .875rem; box-shadow: 0 16px 40px -10px rgba(0,0,0,.7);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
#alertTop.alert-success { background: rgba(16,185,129,.22); color: #d1fae5; }
#alertTop.alert-danger  { background: rgba(255,59,59,.22);  color: #fee2e2; }
#alertTop.alert-warning { background: rgba(245,158,11,.22); color: #fef3c7; }

/* ── Celular e tablet ── */
@media (max-width: 991.98px) {
    :root { --gap: 10px; }
    .sidebar { transform: translateX(calc(-100% - 30px)); }
    html.menu-aberto .sidebar { transform: none; }
    html.menu-aberto .acoes-fundo { opacity: 1; pointer-events: auto; }
    #btnMenu { display: none; }
    .main-content { margin-left: var(--gap); margin-right: var(--gap); }
    .topbar { padding-left: 12px; }
    .topbar .so-celular { display: inline-flex; }
    .topbar .data-hoje { display: none; }
    .acoes { width: var(--acoes-w); transform: translateX(calc(100% + 30px)); }
    html.acoes-abertas .acoes { transform: none; }
    html:not(.acoes-abertas) .acoes .titulo, html:not(.acoes-abertas) .acao .txt { display: revert; }
}

/* ── Cobranças e financeiro ── */
.badge-vencido   { background: rgba(245,158,11,.15); color: var(--warning); }
.badge-estornado { background: rgba(168,85,247,.16); color: #c4b5fd; }
.aviso-painel {
    padding: 10px 14px; border-radius: 12px; font-size: .84rem; margin-bottom: 16px;
    background: rgba(59,130,246,.12); color: #bfdbfe;
}
.aviso-painel.alerta { background: rgba(245,158,11,.14); color: #fde68a; }
.divisao-valor { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: .84rem; color: var(--muted); margin: -4px 0 6px; }
.divisao-valor strong { color: var(--text); }
.link-pagamento { margin-top: 14px; padding: 14px; border-radius: 14px; background: rgba(16,185,129,.08); box-shadow: inset 0 0 0 1px rgba(16,185,129,.25); }
.link-pagamento .form-control { font-size: .82rem; }
.registro-manual { padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.035); box-shadow: inset 0 0 0 1px var(--border); }
.registro-manual summary { cursor: pointer; color: var(--muted); font-size: .86rem; outline: none; }
.registro-manual[open] summary { color: var(--text); }
.secao-titulo { color: var(--muted); font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.mini-stat { padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px var(--border); height: 100%; }
.mini-stat span { display: block; color: var(--muted); font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; }
.mini-stat strong { display: block; font-family: 'Manrope', sans-serif; font-size: 1.25rem; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* Abas */
.abas-painel { gap: 6px; border: 0; flex-wrap: wrap; }
.abas-painel .nav-link {
    border-radius: 12px; padding: 8px 14px; font-size: .86rem; color: var(--muted);
    background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px var(--border); transition: all .2s;
}
.abas-painel .nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.abas-painel .nav-link.active {
    color: #fff; background: linear-gradient(90deg, rgba(255,59,59,.3), rgba(255,59,59,.08));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 8px 22px -10px rgba(255,59,59,.6);
}

/* Botões das tabelas (exportação) */
.dt-buttons { margin-bottom: 10px; display: inline-flex; gap: 6px; flex-wrap: wrap; }
.dt-buttons .btn { border-radius: 10px !important; }
.barra-tabela { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px; }
.barra-tabela .dataTables_filter { margin-left: auto; }
.table-responsive > table.dataTable { margin-top: 4px !important; }
.table td .btn + .btn { margin-left: 2px; }
