/* ═══════════════════════════════════════════════════════════════════════════
   EVO Panel — Professional Dark Theme
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    --evo-primary: #00d4aa;
    --evo-primary-dim: #00a88a;
    --evo-primary-glow: rgba(0, 212, 170, 0.15);
    --evo-bg-body: #0c0e14;
    --evo-bg-surface: #141720;
    --evo-bg-elevated: #1a1e2a;
    --evo-bg-hover: #222838;
    --evo-border: #2a2f3d;
    --evo-border-light: #353b4d;
    --evo-text: #e4e7ec;
    --evo-text-muted: #8b92a5;
    --evo-danger: #ef4444;
    --evo-warning: #f59e0b;
    --evo-info: #6366f1;
    --sidebar-w: 260px;
}

* { scrollbar-width: thin; scrollbar-color: var(--evo-border) transparent; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--evo-border); border-radius: 3px; }

body {
    background: var(--evo-bg-body);
    color: var(--evo-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    height: 100vh;
    max-height: 100vh;
    position: fixed;
    top: 0; left: 0;
    background: var(--evo-bg-surface);
    border-right: 1px solid var(--evo-border);
    z-index: 100;
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar .brand {
    padding: 1.4rem 1.2rem;
    border-bottom: 1px solid var(--evo-border);
    background: linear-gradient(135deg, rgba(0,212,170,0.03) 0%, transparent 60%);
    flex-shrink: 0;
}

.sidebar .brand h5 {
    color: var(--evo-primary);
    margin: 0;
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.sidebar .brand small {
    color: var(--evo-text-muted);
    font-size: .72rem;
    opacity: .7;
}

.sidebar .nav-link {
    color: var(--evo-text-muted);
    padding: .6rem 1rem;
    border-radius: 8px;
    margin: 2px 10px;
    font-size: .85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: .6rem;
    transition: all .15s ease;
    position: relative;
}

.sidebar .nav-link:hover {
    color: var(--evo-text);
    background: var(--evo-bg-hover);
}

.sidebar .nav-link.active {
    color: var(--evo-primary);
    background: var(--evo-primary-glow);
    font-weight: 600;
}

.sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--evo-primary);
    border-radius: 0 3px 3px 0;
}

.sidebar .nav-link i { width: 20px; text-align: center; font-size: 1rem; }

/* ── Main Content ────────────────────────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-w);
    padding: 1.8rem 2rem;
    min-height: 100vh;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.stat-card {
    background: var(--evo-bg-surface);
    border: 1px solid var(--evo-border);
    border-radius: 14px;
    padding: 1.3rem 1.4rem;
    transition: border-color .2s, box-shadow .2s;
}

.stat-card:hover {
    border-color: var(--evo-border-light);
    box-shadow: 0 4px 24px rgba(0,0,0,.2);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--evo-primary) 0%, #00f0c0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card .stat-label {
    color: var(--evo-text-muted);
    font-size: .8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table {
    font-size: .85rem;
    --bs-table-bg: transparent;
    --bs-table-hover-bg: var(--evo-bg-hover);
    --bs-table-striped-bg: rgba(255,255,255,.02);
}

.table thead th {
    background: var(--evo-bg-elevated);
    border-bottom: 1px solid var(--evo-border);
    color: var(--evo-text-muted);
    font-weight: 600;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .7rem .8rem;
    white-space: nowrap;
}

.table td {
    border-color: var(--evo-border);
    padding: .65rem .8rem;
    vertical-align: middle;
}

.table-responsive {
    background: var(--evo-bg-surface);
    border: 1px solid var(--evo-border);
    border-radius: 12px;
    overflow: hidden;
}

.table-responsive .table {
    margin-bottom: 0;
}

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge-active { background: var(--evo-primary); color: #000; font-weight: 600; }
.badge-blocked { background: var(--evo-danger); }
.badge-guest { background: var(--evo-info); }
.badge-premium { background: var(--evo-warning); color: #000; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-primary, .btn-success {
    background: var(--evo-primary);
    border-color: var(--evo-primary);
    color: #000;
    font-weight: 600;
}

.btn-primary:hover, .btn-success:hover {
    background: var(--evo-primary-dim);
    border-color: var(--evo-primary-dim);
    color: #000;
    box-shadow: 0 4px 16px rgba(0,212,170,.25);
}

.btn-outline-warning { border-color: #f59e0b; color: #f59e0b; }
.btn-outline-warning:hover { background: rgba(245,158,11,.1); color: #f59e0b; border-color: #f59e0b; }
.btn-outline-danger { border-color: #ef4444; color: #ef4444; }
.btn-outline-danger:hover { background: rgba(239,68,68,.1); color: #ef4444; border-color: #ef4444; }
.btn-outline-info { border-color: #6366f1; color: #6366f1; }
.btn-outline-info:hover { background: rgba(99,102,241,.1); color: #6366f1; border-color: #6366f1; }
.btn-outline-secondary { border-color: var(--evo-border-light); color: var(--evo-text-muted); }
.btn-outline-secondary:hover { background: var(--evo-bg-hover); color: var(--evo-text); border-color: var(--evo-border-light); }

.btn-group .btn { border-radius: 8px; margin: 0 1px; }
.btn-sm { font-size: .82rem; padding: .35rem .7rem; border-radius: 8px; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-control, .form-select {
    background: var(--evo-bg-elevated);
    border-color: var(--evo-border);
    color: var(--evo-text);
}

.form-control:focus, .form-select:focus {
    background: var(--evo-bg-elevated);
    border-color: var(--evo-primary);
    box-shadow: 0 0 0 3px var(--evo-primary-glow);
    color: var(--evo-text);
}

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert {
    border-radius: 10px;
    font-size: .88rem;
}

/* ── Toast ───────────────────────────────────────────────────────────────── */
.toast-notification {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    padding: .8rem 1.2rem;
    border-radius: 10px;
    font-size: .88rem;
    font-weight: 500;
    animation: slideIn .3s ease;
    box-shadow: 0 8px 32px rgba(0,0,0,.3);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ── Login Page ──────────────────────────────────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--evo-bg-body);
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(0,212,170,0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(99,102,241,0.03) 0%, transparent 50%);
}

.login-card {
    max-width: 420px;
    width: 100%;
    background: var(--evo-bg-surface);
    border: 1px solid var(--evo-border);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    box-shadow: 0 16px 64px rgba(0,0,0,.3);
}

.login-card h3 {
    color: var(--evo-primary);
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 1rem; }
}

/* ── Animations ──────────────────────────────────────────────────────────── */
.fade-in {
    animation: fadeIn .4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Chart.js overrides ──────────────────────────────────────────────────── */
canvas { border-radius: 12px; }

/* ── Modals ──────────────────────────────────────────────────────────────── */
.modal-content {
    background: var(--evo-bg-surface) !important;
    border: 1px solid var(--evo-border);
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(0,0,0,.5);
}

.modal-header {
    border-bottom-color: var(--evo-border) !important;
    padding: 1.2rem 1.5rem;
}

.modal-footer {
    border-top-color: var(--evo-border) !important;
    padding: 1rem 1.5rem;
}

.modal-title {
    font-weight: 700;
    font-size: 1.05rem;
}

/* ── Page Header ─────────────────────────────────────────────────────────── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--evo-border);
}

.page-header h4 {
    font-weight: 700;
    font-size: 1.3rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.page-header h4 i {
    color: var(--evo-primary);
    font-size: 1.1rem;
}

/* ── Cards (enhanced) ────────────────────────────────────────────────────── */
.card {
    background: var(--evo-bg-surface);
    border: 1px solid var(--evo-border);
    border-radius: 14px;
}

.card-header {
    background: var(--evo-bg-elevated);
    border-bottom: 1px solid var(--evo-border);
    font-weight: 600;
    font-size: .9rem;
    padding: .9rem 1.2rem;
    border-radius: 14px 14px 0 0 !important;
}

.card-body { padding: 1.2rem; }

/* ── Progress bars ───────────────────────────────────────────────────────── */
.progress {
    background: var(--evo-bg-elevated);
    border-radius: 6px;
    height: 6px;
}

.progress-bar { border-radius: 6px; }

/* ── Nav tabs ────────────────────────────────────────────────────────────── */
.nav-tabs {
    border-bottom-color: var(--evo-border);
}

.nav-tabs .nav-link {
    color: var(--evo-text-muted);
    font-weight: 500;
    font-size: .88rem;
    border: none;
    padding: .6rem 1rem;
    border-radius: 8px 8px 0 0;
}

.nav-tabs .nav-link:hover {
    color: var(--evo-text);
    border-color: transparent;
}

.nav-tabs .nav-link.active {
    background: var(--evo-bg-surface);
    color: var(--evo-primary);
    border: 1px solid var(--evo-border);
    border-bottom-color: var(--evo-bg-surface);
    font-weight: 600;
}

/* ── Alerts (enhanced) ───────────────────────────────────────────────────── */
.alert {
    border-radius: 10px;
    font-size: .85rem;
    border: 1px solid;
}

.alert-info {
    background: rgba(99,102,241,.08);
    border-color: rgba(99,102,241,.2);
    color: #a5b4fc;
}

.alert-success {
    background: rgba(0,212,170,.08);
    border-color: rgba(0,212,170,.2);
    color: var(--evo-primary);
}

.alert-danger {
    background: rgba(239,68,68,.08);
    border-color: rgba(239,68,68,.2);
    color: #fca5a5;
}

.alert-warning {
    background: rgba(245,158,11,.08);
    border-color: rgba(245,158,11,.2);
    color: #fcd34d;
}

/* ── Code blocks ─────────────────────────────────────────────────────────── */
code {
    color: var(--evo-primary);
    font-size: .82rem;
    background: rgba(0,212,170,.06);
    padding: .15rem .4rem;
    border-radius: 4px;
}

pre {
    background: var(--evo-bg-body) !important;
    border: 1px solid var(--evo-border);
    border-radius: 10px;
    padding: 1rem;
    font-size: .8rem;
    color: var(--evo-text);
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--evo-text-muted);
}

.empty-state i {
    font-size: 3rem;
    opacity: .4;
    margin-bottom: .8rem;
    display: block;
}

/* ── Search input ────────────────────────────────────────────────────────── */
.search-box {
    position: relative;
}

.search-box input {
    padding-left: 2.5rem;
}

.search-box::before {
    content: '\F52A';
    font-family: 'bootstrap-icons';
    position: absolute;
    left: .8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--evo-text-muted);
    font-size: .9rem;
    z-index: 1;
}

/* ── Spinner ─────────────────────────────────────────────────────────────── */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: .15em;
}

/* ── Tooltip-like badges ─────────────────────────────────────────────────── */
.badge {
    font-weight: 500;
    font-size: .75rem;
    padding: .3rem .6rem;
    border-radius: 6px;
}



/* ── Sidebar Navigation Sections ─────────────────────────────────────────── */
.sidebar-nav {
    padding: .5rem 0;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    min-height: 0;
}

/* Scrollbar visível na navegação da sidebar */
.sidebar-nav::-webkit-scrollbar { width: 8px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--evo-border-light);
    border-radius: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: var(--evo-primary);
}
.sidebar-nav { scrollbar-width: thin; scrollbar-color: var(--evo-border-light) transparent; }

.nav-section-label {
    color: var(--evo-text-muted);
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 1rem 1.2rem .4rem;
    opacity: .6;
}

/* ── Sidebar Footer / Profile ────────────────────────────────────────────── */
.sidebar-footer {
    border-top: 1px solid var(--evo-border);
    position: relative;
    flex-shrink: 0;
}

.profile-section {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .9rem 1rem;
    cursor: pointer;
    transition: background .15s;
    border-radius: 0;
}

.profile-section:hover {
    background: var(--evo-bg-hover);
}

.profile-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--evo-primary-glow);
    border: 2px solid var(--evo-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.profile-avatar i {
    color: var(--evo-primary);
    font-size: 1.1rem;
}

.profile-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.profile-name {
    font-size: .82rem;
    font-weight: 600;
    color: var(--evo-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-role {
    font-size: .68rem;
    color: var(--evo-text-muted);
}

.profile-chevron {
    color: var(--evo-text-muted);
    font-size: .7rem;
    transition: transform .2s;
}

.profile-menu.show ~ .profile-section .profile-chevron,
.profile-section:has(~ .profile-menu.show) .profile-chevron {
    transform: rotate(180deg);
}

/* ── Profile Dropdown Menu ───────────────────────────────────────────────── */
.profile-menu {
    position: absolute;
    bottom: 100%;
    left: .5rem;
    right: .5rem;
    background: var(--evo-bg-elevated);
    border: 1px solid var(--evo-border-light);
    border-radius: 10px;
    padding: .4rem;
    box-shadow: 0 -8px 32px rgba(0,0,0,.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all .2s cubic-bezier(.4,0,.2,1);
    z-index: 200;
}

.profile-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .8rem;
    border-radius: 7px;
    font-size: .82rem;
    font-weight: 500;
    color: var(--evo-text);
    text-decoration: none;
    transition: background .12s;
}

.profile-menu-item:hover {
    background: var(--evo-bg-hover);
    color: var(--evo-text);
}

.profile-menu-item.text-danger:hover {
    background: rgba(239,68,68,.08);
}

.profile-menu-item i {
    width: 18px;
    text-align: center;
    font-size: .9rem;
    opacity: .8;
}

.profile-menu-divider {
    height: 1px;
    background: var(--evo-border);
    margin: .3rem .5rem;
}

/* ── Light Theme Overrides ───────────────────────────────────────────────── */
[data-bs-theme="light"] {
    --evo-bg-body: #f5f7fa;
    --evo-bg-surface: #ffffff;
    --evo-bg-elevated: #f0f2f5;
    --evo-bg-hover: #e8ebf0;
    --evo-border: #e2e5ea;
    --evo-border-light: #d0d5dd;
    --evo-text: #1a1d23;
    --evo-text-muted: #6b7280;
}

[data-bs-theme="light"] .sidebar {
    background: #ffffff;
    box-shadow: 2px 0 12px rgba(0,0,0,.05);
}

[data-bs-theme="light"] .profile-menu {
    box-shadow: 0 -8px 32px rgba(0,0,0,.12);
}

[data-bs-theme="light"] .stat-card {
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

[data-bs-theme="light"] .table-responsive {
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

[data-bs-theme="light"] .modal-content {
    box-shadow: 0 24px 80px rgba(0,0,0,.15) !important;
}

[data-bs-theme="light"] code {
    background: rgba(0,212,170,.08);
}

[data-bs-theme="light"] pre {
    background: #f8f9fa !important;
}
