/* ==========================================================================
   Eclipse SSH — painel v3
   ========================================================================== */

:root {
    --ecl-accent: #7c5cff;
    --ecl-accent-2: #22d3ee;
    --ecl-gradient: linear-gradient(135deg, var(--ecl-accent) 0%, var(--ecl-accent-2) 100%);
    --ecl-radius: 16px;
    --ecl-radius-sm: 10px;
    --ecl-sidebar-w: 260px;
    --ecl-topbar-h: 72px;
    --bs-font-sans-serif: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --bs-primary: #7c5cff;
    --bs-primary-rgb: 124, 92, 255;
    --bs-link-color: #7c5cff;
    --bs-link-color-rgb: 124, 92, 255;
    --bs-link-hover-color: #6a48f5;
    --bs-border-radius: 10px;
    --bs-border-radius-lg: 14px;
}

[data-bs-theme="dark"] {
    --ecl-bg: #0b0d14;
    --ecl-surface: #131722;
    --ecl-surface-2: #1a1f2d;
    --ecl-border: rgba(255, 255, 255, .07);
    --ecl-muted: #8a93a8;
    --ecl-text: #e7eaf2;
    --ecl-shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --bs-body-bg: var(--ecl-bg);
    --bs-body-color: var(--ecl-text);
    --bs-secondary-color: var(--ecl-muted);
    --bs-border-color: var(--ecl-border);
    --bs-tertiary-bg: var(--ecl-surface-2);
    --bs-secondary-bg: var(--ecl-surface-2);
    --bs-link-color: #a38bff;
    --bs-link-color-rgb: 163, 139, 255;
    --bs-link-hover-color: #c2b3ff;
    --bs-emphasis-color: #fff;
}

[data-bs-theme="light"] {
    --ecl-bg: #f4f5fb;
    --ecl-surface: #ffffff;
    --ecl-surface-2: #f1f2f8;
    --ecl-border: rgba(20, 24, 40, .08);
    --ecl-muted: #6b7288;
    --ecl-text: #171a26;
    --ecl-shadow: 0 10px 30px rgba(30, 35, 60, .08);
    --bs-body-bg: var(--ecl-bg);
    --bs-body-color: var(--ecl-text);
    --bs-secondary-color: var(--ecl-muted);
    --bs-border-color: var(--ecl-border);
}

html, body { min-height: 100%; }
body {
    font-family: var(--bs-font-sans-serif);
    background: var(--ecl-bg);
    color: var(--ecl-text);
    -webkit-font-smoothing: antialiased;
}
.text-muted, .text-secondary { color: var(--ecl-muted) !important; }
.small-muted { font-size: .8125rem; color: var(--ecl-muted); }
.fw-800 { font-weight: 800; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ---------- Botões ---------- */
.btn { font-weight: 600; border-radius: var(--ecl-radius-sm); padding: .6rem 1.1rem; }
.btn-sm { padding: .35rem .7rem; border-radius: 8px; }
.btn-lg { padding: .85rem 1.4rem; border-radius: 12px; }
.btn-primary {
    --bs-btn-bg: var(--ecl-accent);
    --bs-btn-border-color: var(--ecl-accent);
    --bs-btn-hover-bg: #6a48f5;
    --bs-btn-hover-border-color: #6a48f5;
    --bs-btn-active-bg: #5d3ce6;
    --bs-btn-active-border-color: #5d3ce6;
    --bs-btn-disabled-bg: var(--ecl-accent);
    --bs-btn-disabled-border-color: var(--ecl-accent);
}
.btn-gradient {
    background: var(--ecl-gradient);
    color: #fff;
    border: 0;
    box-shadow: 0 8px 24px rgba(124, 92, 255, .35);
}
.btn-gradient:hover, .btn-gradient:focus { color: #fff; filter: brightness(1.08); }
.btn-soft {
    background: var(--ecl-surface-2);
    color: var(--ecl-text);
    border: 1px solid var(--ecl-border);
}
.btn-soft:hover { background: color-mix(in srgb, var(--ecl-surface-2) 80%, var(--ecl-accent)); color: var(--ecl-text); }
.btn-icon {
    width: 42px; height: 42px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 12px; font-size: 1.15rem;
    background: var(--ecl-surface-2); color: var(--ecl-text); border: 1px solid var(--ecl-border);
}
.btn-icon:hover { color: var(--ecl-text); border-color: var(--ecl-accent); }
.btn-icon.btn-sm { width: 34px; height: 34px; font-size: 1rem; border-radius: 9px; }

[data-bs-theme="dark"] .tema-claro, [data-bs-theme="light"] .tema-escuro { display: none; }

/* ---------- Formulários ---------- */
.form-control, .form-select {
    background-color: var(--ecl-surface-2);
    border-color: var(--ecl-border);
    padding: .7rem .9rem;
    border-radius: var(--ecl-radius-sm);
}
.form-control:focus, .form-select:focus {
    background-color: var(--ecl-surface-2);
    border-color: var(--ecl-accent);
    box-shadow: 0 0 0 .2rem rgba(124, 92, 255, .2);
}
.form-label { font-weight: 600; font-size: .875rem; margin-bottom: .4rem; }
.form-text { color: var(--ecl-muted); }
.form-check-input:checked { background-color: var(--ecl-accent); border-color: var(--ecl-accent); }
.input-group .btn { border-color: var(--ecl-border); }

/* ---------- Estrutura do app ---------- */
.app-sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 1040;
    width: var(--ecl-sidebar-w);
    display: flex; flex-direction: column;
    background: var(--ecl-surface);
    border-right: 1px solid var(--ecl-border);
    padding: 1.25rem 1rem;
    transition: transform .25s ease;
}
.app-brand {
    display: flex; align-items: center; gap: .65rem;
    text-decoration: none; color: var(--ecl-text);
    font-weight: 800; letter-spacing: .06em; font-size: 1.05rem;
    padding: .25rem .5rem 1.25rem;
}
.app-brand img { border-radius: 10px; }
.app-brand b {
    background: var(--ecl-gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.app-nav { display: flex; flex-direction: column; gap: .2rem; overflow-y: auto; flex: 1; }
.app-nav-label {
    font-size: .7rem; text-transform: uppercase; letter-spacing: .1em;
    color: var(--ecl-muted); padding: .5rem .75rem .35rem; font-weight: 700;
}
.app-nav-link {
    display: flex; align-items: center; gap: .75rem;
    padding: .7rem .85rem; border-radius: 12px;
    color: var(--ecl-muted); text-decoration: none; font-weight: 500;
    transition: background .15s, color .15s;
}
.app-nav-link i { font-size: 1.15rem; width: 1.25rem; text-align: center; }
.app-nav-link:hover { background: var(--ecl-surface-2); color: var(--ecl-text); }
.app-nav-link.active {
    background: rgba(124, 92, 255, .14); color: var(--ecl-text);
    box-shadow: inset 3px 0 0 var(--ecl-accent);
}
.app-nav-link.active i { color: var(--ecl-accent); }
.app-sidebar-footer { border-top: 1px solid var(--ecl-border); padding-top: 1rem; display: grid; gap: .5rem; }
.app-suporte {
    display: flex; align-items: center; gap: .75rem;
    padding: .8rem .9rem; border-radius: 14px; text-decoration: none;
    background: rgba(37, 211, 102, .1); color: var(--ecl-text); border: 1px solid rgba(37, 211, 102, .25);
}
.app-suporte i { font-size: 1.5rem; color: #25d366; }
.app-suporte strong { display: block; font-size: .875rem; }
.app-suporte small { color: var(--ecl-muted); font-size: .75rem; }

.app-main { margin-left: var(--ecl-sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.app-topbar {
    position: sticky; top: 0; z-index: 1030;
    height: var(--ecl-topbar-h);
    display: flex; align-items: center; gap: 1rem;
    padding: 0 2rem;
    background: color-mix(in srgb, var(--ecl-bg) 82%, transparent);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--ecl-border);
}
.app-topbar-title h1 { font-size: 1.2rem; font-weight: 700; margin: 0; }
.app-topbar-title p { margin: 0; font-size: .8125rem; color: var(--ecl-muted); }
.app-user {
    display: flex; align-items: center; gap: .65rem;
    background: transparent; border: 1px solid var(--ecl-border); color: var(--ecl-text);
    padding: .3rem .75rem .3rem .3rem; border-radius: 999px;
}
.app-user strong { font-size: .85rem; line-height: 1.1; }
.app-user small { font-size: .72rem; color: var(--ecl-muted); }
.app-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--ecl-gradient); color: #fff; font-weight: 700;
}
.app-content { flex: 1; padding: 2rem; width: 100%; max-width: 1400px; }
.app-footer {
    display: flex; gap: 1rem; justify-content: space-between;
    padding: 1.25rem 2rem; font-size: .8125rem; color: var(--ecl-muted);
    border-top: 1px solid var(--ecl-border);
}
.app-footer a { color: var(--ecl-muted); }
.app-backdrop { display: none; }
.faixa-acesso-como {
    position: sticky; top: 0; z-index: 1031;
    display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
    padding: .6rem 2rem; font-size: .875rem; color: #1f1300;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}
.faixa-acesso-como i { font-size: 1.2rem; }
.faixa-acesso-como + .app-topbar { top: 44px; }
@media (max-width: 991.98px) {
    .faixa-acesso-como { padding: .6rem 1rem; }
    .faixa-acesso-como + .app-topbar { top: 0; position: relative; }
}

.dropdown-menu {
    --bs-dropdown-bg: var(--ecl-surface);
    --bs-dropdown-border-color: var(--ecl-border);
    --bs-dropdown-link-hover-bg: var(--ecl-surface-2);
    --bs-dropdown-link-active-bg: var(--ecl-accent);
    border-radius: 12px; padding: .4rem;
}
.dropdown-item { border-radius: 8px; padding: .5rem .75rem; }

/* ---------- Cards ---------- */
.card {
    --bs-card-bg: var(--ecl-surface);
    --bs-card-border-color: var(--ecl-border);
    --bs-card-border-radius: var(--ecl-radius);
    --bs-card-cap-bg: transparent;
    box-shadow: var(--ecl-shadow);
}
.card-header { padding: 1.1rem 1.35rem; border-bottom: 1px solid var(--ecl-border); }
.card-body { padding: 1.35rem; }
.card-title { font-weight: 700; font-size: 1.05rem; margin: 0; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 2rem 0 1rem; }
.section-title h2 { font-size: 1.15rem; font-weight: 700; margin: 0; }

/* Destaque de boas-vindas */
.hero {
    position: relative; overflow: hidden;
    border-radius: 20px; padding: 1.75rem;
    background: var(--ecl-gradient); color: #fff;
    box-shadow: 0 20px 40px rgba(124, 92, 255, .25);
}
.hero::after {
    content: ""; position: absolute; right: -60px; top: -60px;
    width: 240px; height: 240px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .25), transparent 70%);
}
.hero h2 { font-weight: 800; font-size: 1.6rem; margin-bottom: .35rem; }
.hero p { opacity: .9; margin: 0; }
.hero .btn-light { color: #3b2a9e; font-weight: 700; }
.hero .btn-outline-light { border-color: rgba(255, 255, 255, .6); }

/* Cartões de estatística */
.stat {
    display: flex; align-items: center; gap: 1rem;
    padding: 1.15rem 1.25rem; border-radius: var(--ecl-radius);
    background: var(--ecl-surface); border: 1px solid var(--ecl-border);
    box-shadow: var(--ecl-shadow); height: 100%;
}
.stat-icon {
    width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem;
}
.stat-label { font-size: .8125rem; color: var(--ecl-muted); margin: 0; }
.stat-value { font-size: 1.5rem; font-weight: 800; margin: 0; line-height: 1.2; }
.tone-primary { background: rgba(124, 92, 255, .15); color: #9b83ff; }
.tone-success { background: rgba(34, 197, 94, .14); color: #22c55e; }
.tone-warning { background: rgba(245, 158, 11, .15); color: #f59e0b; }
.tone-danger  { background: rgba(239, 68, 68, .14); color: #ef4444; }
.tone-info    { background: rgba(34, 211, 238, .14); color: #22d3ee; }
.tone-secondary { background: var(--ecl-surface-2); color: var(--ecl-muted); }

/* Ações rápidas */
.quick {
    display: flex; align-items: center; gap: .9rem;
    padding: 1rem 1.1rem; border-radius: var(--ecl-radius);
    background: var(--ecl-surface); border: 1px solid var(--ecl-border);
    color: var(--ecl-text); text-decoration: none; text-align: left; width: 100%;
    transition: transform .15s, border-color .15s;
}
.quick:hover { transform: translateY(-2px); border-color: var(--ecl-accent); color: var(--ecl-text); }
.quick .stat-icon { width: 44px; height: 44px; }
.quick strong { display: block; font-size: .95rem; }
.quick small { color: var(--ecl-muted); font-size: .8rem; }

/* ---------- Tokens do cliente ---------- */
.token-card {
    border-radius: var(--ecl-radius); background: var(--ecl-surface);
    border: 1px solid var(--ecl-border); box-shadow: var(--ecl-shadow);
    padding: 1.2rem; height: 100%; display: flex; flex-direction: column; gap: .9rem;
    position: relative; overflow: hidden;
}
.token-card::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--tc, var(--ecl-accent));
}
.token-card[data-situacao="ativo"] { --tc: #22c55e; }
.token-card[data-situacao="vencendo"] { --tc: #f59e0b; }
.token-card[data-situacao="vencido"] { --tc: #ef4444; }
.token-code {
    display: flex; align-items: center; justify-content: space-between; gap: .5rem;
    background: var(--ecl-surface-2); border: 1px dashed var(--ecl-border);
    border-radius: 12px; padding: .6rem .6rem .6rem .9rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1rem; font-weight: 600;
    letter-spacing: .03em; word-break: break-all;
}
.token-meta { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; font-size: .85rem; }
.token-meta span { display: block; color: var(--ecl-muted); font-size: .75rem; }
.token-meta strong { font-weight: 600; word-break: break-all; }
.token-progress { height: 6px; background: var(--ecl-surface-2); border-radius: 99px; overflow: hidden; }
.token-progress div { height: 100%; background: var(--tc, var(--ecl-accent)); border-radius: 99px; }

.pill {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .25rem .65rem; border-radius: 99px; font-size: .75rem; font-weight: 600;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-success { background: rgba(34, 197, 94, .14); color: #22c55e; }
.pill-warning { background: rgba(245, 158, 11, .15); color: #f59e0b; }
.pill-danger  { background: rgba(239, 68, 68, .14); color: #ef4444; }
.pill-primary { background: rgba(124, 92, 255, .15); color: #9b83ff; }
.pill-secondary { background: var(--ecl-surface-2); color: var(--ecl-muted); }
.pill-info { background: rgba(34, 211, 238, .14); color: #22d3ee; }

/* Estado vazio */
.empty {
    text-align: center; padding: 3rem 1.5rem; border-radius: var(--ecl-radius);
    border: 1px dashed var(--ecl-border); background: var(--ecl-surface);
}
.empty i { font-size: 2.5rem; color: var(--ecl-accent); }
.empty h3 { font-size: 1.1rem; font-weight: 700; margin: .75rem 0 .35rem; }
.empty p { color: var(--ecl-muted); margin-bottom: 1.25rem; }

/* Aviso de Pix pendente */
.alert-pix {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    border-radius: var(--ecl-radius); padding: 1rem 1.25rem;
    background: rgba(245, 158, 11, .1); border: 1px solid rgba(245, 158, 11, .35);
}
.alert-pix i { font-size: 1.5rem; color: #f59e0b; }

/* ---------- Planos ---------- */
.planos { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.plano input { position: absolute; opacity: 0; pointer-events: none; }
.plano label {
    display: block; cursor: pointer; height: 100%;
    padding: 1rem; border-radius: 14px;
    background: var(--ecl-surface-2); border: 2px solid var(--ecl-border);
    transition: border-color .15s, transform .15s;
    position: relative;
}
.plano label:hover { transform: translateY(-2px); }
.plano input:checked + label { border-color: var(--ecl-accent); background: rgba(124, 92, 255, .1); }
.plano input:checked + label::after {
    content: "\F26A"; font-family: 'bootstrap-icons'; position: absolute; top: .6rem; right: .75rem;
    color: var(--ecl-accent); font-size: 1.1rem;
}
.plano-nome { font-weight: 700; }
.plano-dias { font-size: .78rem; color: var(--ecl-muted); }
.plano-preco { font-size: 1.35rem; font-weight: 800; margin-top: .4rem; }
.plano-mes { font-size: .75rem; color: var(--ecl-muted); }
.plano-riscado { text-decoration: line-through; color: var(--ecl-muted); font-size: .8rem; margin-left: .25rem; }
.plano-tag {
    display: inline-block; font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    background: var(--ecl-gradient); color: #fff; padding: .15rem .5rem; border-radius: 99px; margin-top: .35rem;
}

/* ---------- Modal ---------- */
.modal-content {
    --bs-modal-bg: var(--ecl-surface);
    --bs-modal-border-color: var(--ecl-border);
    border-radius: 20px;
}
.modal-header { border-bottom-color: var(--ecl-border); padding: 1.1rem 1.4rem; }
.modal-footer { border-top-color: var(--ecl-border); }
.modal-title { font-weight: 700; }
.modal-body { padding: 1.4rem; }

/* Tela do Pix */
.pix-box { text-align: center; }
.pix-qr {
    display: inline-block; padding: 12px; background: #fff; border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.pix-qr img { width: 220px; height: 220px; display: block; image-rendering: pixelated; }
.pix-valor { font-size: 1.9rem; font-weight: 800; margin: 1rem 0 .1rem; }
.pix-copia {
    font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .75rem;
    background: var(--ecl-surface-2); border: 1px solid var(--ecl-border); border-radius: 12px;
    padding: .75rem; max-height: 84px; overflow: auto; word-break: break-all; text-align: left;
}
.pix-status {
    display: inline-flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--ecl-muted);
    background: var(--ecl-surface-2); padding: .4rem .85rem; border-radius: 99px;
}
.pix-status .dot { width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; animation: pulse 1.4s infinite; }
.pix-passos { text-align: left; font-size: .85rem; color: var(--ecl-muted); padding-left: 1.1rem; margin: 1rem 0 0; }
.pix-passos li { margin-bottom: .25rem; }
.pix-ok i { font-size: 4rem; color: #22c55e; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* ---------- Tabelas ---------- */
.table {
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--ecl-border);
    --bs-table-hover-bg: var(--ecl-surface-2);
    margin: 0;
}
.table > :not(caption) > * > * { padding: .85rem 1rem; vertical-align: middle; }
.table thead th {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
    color: var(--ecl-muted); font-weight: 700; white-space: nowrap;
}
.table-card .card-body { padding: 0; }
div.dt-container { padding: 1rem; }
div.dt-container .dt-search input, div.dt-container .dt-length select {
    background: var(--ecl-surface-2); border: 1px solid var(--ecl-border); border-radius: 10px; padding: .45rem .75rem;
}
div.dt-container .dt-paging .dt-paging-button.current { background: var(--ecl-accent) !important; color: #fff !important; border-radius: 8px; }
.pagination { --bs-pagination-bg: transparent; --bs-pagination-border-color: var(--ecl-border); --bs-pagination-active-bg: var(--ecl-accent); --bs-pagination-active-border-color: var(--ecl-accent); }

/* Vídeos */
.video-card {
    display: block; text-decoration: none; color: var(--ecl-text);
    border-radius: var(--ecl-radius); overflow: hidden; background: var(--ecl-surface);
    border: 1px solid var(--ecl-border); box-shadow: var(--ecl-shadow); height: 100%;
    transition: transform .15s;
}
.video-card:hover { transform: translateY(-3px); color: var(--ecl-text); }
.video-thumb {
    aspect-ratio: 16/9; background: var(--ecl-surface-2) center/cover no-repeat;
    display: flex; align-items: center; justify-content: center; position: relative;
}
.video-thumb i {
    font-size: 2.6rem; color: #fff; background: rgba(0, 0, 0, .45);
    width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.video-card .body { padding: 1rem; }
.video-card h3 { font-size: .98rem; font-weight: 700; margin: 0 0 .25rem; }
.video-card p { font-size: .82rem; color: var(--ecl-muted); margin: 0; }

/* Seletor de gateway (admin) */
.gw-opcao input { position: absolute; opacity: 0; }
.gw-opcao label {
    display: flex; align-items: center; gap: .85rem; cursor: pointer; height: 100%;
    padding: 1rem; border-radius: 14px; border: 2px solid var(--ecl-border); background: var(--ecl-surface-2);
}
.gw-opcao input:checked + label { border-color: var(--ecl-accent); background: rgba(124, 92, 255, .1); }
.gw-logo {
    width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
    font-weight: 800; color: #fff; flex-shrink: 0;
}
.nav-pills .nav-link { color: var(--ecl-muted); font-weight: 600; border-radius: 10px; }
.nav-pills .nav-link.active { background: var(--ecl-accent); color: #fff; }
.copy-field { display: flex; gap: .5rem; }
.copy-field input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; }

/* ---------- Páginas de acesso ---------- */
body.auth { min-height: 100vh; }
.auth-bg {
    position: fixed; inset: 0; z-index: -1;
    background:
        radial-gradient(600px circle at 15% 20%, rgba(124, 92, 255, .35), transparent 60%),
        radial-gradient(500px circle at 85% 80%, rgba(34, 211, 238, .25), transparent 60%),
        var(--ecl-bg);
}
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-card {
    width: 100%; max-width: 440px;
    background: color-mix(in srgb, var(--ecl-surface) 88%, transparent);
    backdrop-filter: blur(16px);
    border: 1px solid var(--ecl-border); border-radius: 24px;
    padding: 2.25rem 2rem; box-shadow: var(--ecl-shadow);
}
.auth-title { font-size: 1.5rem; font-weight: 800; text-align: center; margin-bottom: .35rem; }
.auth-sub { text-align: center; color: var(--ecl-muted); margin-bottom: 1.75rem; }
.auth-footer { margin-top: 1.5rem; font-size: .8rem; color: var(--ecl-muted); }
.auth-footer a { color: var(--ecl-muted); }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: .95rem; top: 50%; transform: translateY(-50%); color: var(--ecl-muted); }
.input-icon > .form-control { padding-left: 2.6rem; }
.input-icon > .toggle-senha {
    position: absolute; right: .5rem; top: 50%; transform: translateY(-50%);
    background: none; border: 0; color: var(--ecl-muted); padding: .35rem .5rem;
}
.codigo-input { text-align: center; font-size: 1.6rem; letter-spacing: .5rem; font-weight: 700; text-transform: uppercase; }

/* SweetAlert no tema */
.swal2-popup { background: var(--ecl-surface) !important; color: var(--ecl-text) !important; border-radius: 20px !important; }
.swal2-title, .swal2-html-container { color: var(--ecl-text) !important; }
.swal2-confirm { background: var(--ecl-accent) !important; border-radius: 10px !important; }
.swal2-cancel { border-radius: 10px !important; }

/* ---------- Responsivo ---------- */
@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-100%); box-shadow: var(--ecl-shadow); }
    body.menu-aberto .app-sidebar { transform: none; }
    body.menu-aberto .app-backdrop { display: block; position: fixed; inset: 0; z-index: 1035; background: rgba(0, 0, 0, .5); }
    .app-main { margin-left: 0; }
    .app-topbar { padding: 0 1rem; height: 64px; }
    .app-topbar-title p { display: none; }
    .app-content { padding: 1.25rem 1rem; }
    .app-cliente .app-content { padding-bottom: 6rem; }
    .app-footer { padding: 1rem; }
    .app-cliente .app-footer { margin-bottom: 4.5rem; }
    .hero { padding: 1.35rem; }
    .hero h2 { font-size: 1.3rem; }
}
@media (max-width: 575.98px) {
    .planos { grid-template-columns: 1fr 1fr; gap: .5rem; }
    .plano label { padding: .8rem; }
    .plano-preco { font-size: 1.15rem; }
    .stat { padding: .9rem; gap: .75rem; }
    .stat-icon { width: 40px; height: 40px; font-size: 1.1rem; }
    .stat-value { font-size: 1.2rem; }
    .auth-card { padding: 1.75rem 1.25rem; }
    .modal-body { padding: 1.1rem; }
    .pix-qr img { width: 200px; height: 200px; }
}
.app-bottomnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    display: grid; grid-template-columns: repeat(4, 1fr);
    background: color-mix(in srgb, var(--ecl-surface) 92%, transparent);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--ecl-border);
    padding: .4rem .25rem calc(.4rem + env(safe-area-inset-bottom));
}
.app-bottomnav a {
    display: flex; flex-direction: column; align-items: center; gap: .1rem;
    color: var(--ecl-muted); text-decoration: none; font-size: .7rem; font-weight: 600; padding: .35rem 0;
}
.app-bottomnav a i { font-size: 1.3rem; }
.app-bottomnav a.active { color: var(--ecl-accent); }
.app-bottomnav a[data-abrir-compra] i {
    background: var(--ecl-gradient); color: #fff; width: 44px; height: 44px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center; margin-top: -1.1rem;
    box-shadow: 0 8px 20px rgba(124, 92, 255, .4);
}

/* ---------- Chat ---------- */
.chat {
    display: grid; grid-template-columns: 330px 1fr;
    height: calc(100vh - var(--ecl-topbar-h) - 4rem - 60px); min-height: 480px;
    background: var(--ecl-surface); border: 1px solid var(--ecl-border);
    border-radius: var(--ecl-radius); box-shadow: var(--ecl-shadow); overflow: hidden;
}
.chat-lista { display: flex; flex-direction: column; border-right: 1px solid var(--ecl-border); min-height: 0; }
.chat-lista-topo { padding: 1rem; display: grid; gap: .75rem; border-bottom: 1px solid var(--ecl-border); }
.chat-filtro { display: grid; grid-template-columns: 1fr 1fr; background: var(--ecl-surface-2); border-radius: 10px; padding: 3px; }
.chat-filtro button { border: 0; background: transparent; color: var(--ecl-muted); font-size: .82rem; font-weight: 600; padding: .4rem; border-radius: 8px; }
.chat-filtro button.active { background: var(--ecl-surface); color: var(--ecl-text); box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.chat-itens { flex: 1; overflow-y: auto; padding: .5rem; }
.chat-item {
    width: 100%; display: flex; align-items: center; gap: .75rem; text-align: left;
    padding: .7rem; border: 0; border-radius: 12px; background: transparent; color: var(--ecl-text);
}
.chat-item:hover { background: var(--ecl-surface-2); }
.chat-item.active { background: rgba(124, 92, 255, .14); }
.chat-item-icone { width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.chat-item-corpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.chat-item-linha { display: flex; justify-content: space-between; gap: .5rem; }
.chat-item-linha strong { font-size: .9rem; }
.chat-item-linha small { color: var(--ecl-muted); font-size: .7rem; flex-shrink: 0; }
.chat-item-quem { font-size: .78rem; color: var(--ecl-muted); }
.chat-item-quem .pill { font-size: .62rem; padding: .05rem .45rem; }
.chat-item-previa { font-size: .8rem; color: var(--ecl-muted); }
.chat-badge {
    min-width: 22px; height: 22px; padding: 0 .4rem; border-radius: 99px; flex-shrink: 0;
    background: var(--ecl-accent); color: #fff; font-size: .72rem; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.chat-sep { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ecl-muted); padding: .9rem .7rem .35rem; }
.chat-vazio-lista { font-size: .85rem; color: var(--ecl-muted); padding: .5rem .7rem; }
.chat-eu { padding: .75rem 1rem; border-top: 1px solid var(--ecl-border); }

.chat-conversa { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-cab { display: flex; align-items: center; gap: .75rem; padding: .85rem 1.1rem; border-bottom: 1px solid var(--ecl-border); }
.chat-titulo { font-weight: 700; }
.chat-sub { font-size: .8rem; color: var(--ecl-muted); }
.chat-sub .pill { font-size: .65rem; padding: .05rem .45rem; }
.min-w-0 { min-width: 0; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: .6rem; background: var(--ecl-bg); }
.chat-vazio { margin: auto; color: var(--ecl-muted); }
.chat-msg { display: flex; }
.chat-msg.minha { justify-content: flex-end; }
.chat-bolha {
    max-width: min(640px, 80%); padding: .6rem .85rem; border-radius: 16px 16px 16px 4px;
    background: var(--ecl-surface); border: 1px solid var(--ecl-border);
}
.chat-msg.minha .chat-bolha { border-radius: 16px 16px 4px 16px; background: rgba(124, 92, 255, .16); border-color: rgba(124, 92, 255, .35); }
.chat-msg-topo { display: flex; align-items: center; gap: .45rem; font-size: .78rem; margin-bottom: .2rem; }
.chat-msg-topo .pill { font-size: .62rem; padding: .05rem .45rem; }
.chat-msg-topo small { color: var(--ecl-muted); font-size: .68rem; }
.chat-texto { font-size: .92rem; line-height: 1.45; word-break: break-word; }
.chat-texto a { color: var(--bs-link-color); }
.chat-apagar { border: 0; background: none; color: var(--ecl-muted); padding: 0 .15rem; margin-left: auto; opacity: 0; font-size: .75rem; }
.chat-bolha:hover .chat-apagar { opacity: 1; }
.chat-apagar:hover { color: #ef4444; }
.chat-envio { display: flex; gap: .6rem; align-items: flex-end; padding: .85rem 1rem; border-top: 1px solid var(--ecl-border); }
.chat-envio textarea {
    flex: 1; resize: none; max-height: 160px; border-radius: 14px; overflow-y: hidden;
    background: var(--ecl-surface-2); border: 1px solid var(--ecl-border); color: var(--ecl-text);
    padding: .65rem .9rem; font-size: .92rem; outline: none;
}
.chat-envio textarea:focus { border-color: var(--ecl-accent); }
.chat-envio .btn-icon { width: 44px; height: 44px; border-radius: 14px; }
.nav-contador {
    margin-left: auto; min-width: 20px; height: 20px; padding: 0 .35rem; border-radius: 99px;
    background: var(--ecl-accent); color: #fff; font-size: .7rem; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
@media (max-width: 991.98px) {
    .chat { grid-template-columns: 1fr; height: calc(100vh - 64px - 2.5rem - 5rem); border-radius: 14px; }
    .chat .chat-conversa { display: none; }
    .chat.ver-conversa .chat-lista { display: none; }
    .chat.ver-conversa .chat-conversa { display: flex; }
    .chat-bolha { max-width: 88%; }
}
.chat-img { display: block; margin: .3rem 0 .15rem; }
.chat-img img { display: block; max-width: min(320px, 100%); max-height: 320px; border-radius: 12px; border: 1px solid var(--ecl-border); background: var(--ecl-surface-2); }
.chat-anexo { display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem; border-top: 1px solid var(--ecl-border); background: var(--ecl-surface-2); }
.chat-anexo img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; }
.chat-conversa.arrastando { outline: 2px dashed var(--ecl-accent); outline-offset: -8px; }
.chat-audio { display: block; width: min(300px, 100%); height: 40px; margin: .3rem 0 .15rem; }
.chat-anexo audio { height: 36px; max-width: 260px; }
.chat-somente-leitura { padding: .9rem 1rem; border-top: 1px solid var(--ecl-border); font-size: .85rem; color: var(--ecl-muted); text-align: center; }
.chat-gravando { display: flex; align-items: center; gap: .6rem; padding: .85rem 1rem; border-top: 1px solid var(--ecl-border); }
.chat-rec { width: 12px; height: 12px; border-radius: 50%; background: #ef4444; animation: pulse 1s infinite; }
.chat-gravando.d-none { display: none !important; }
