/* ============================================
   FONTE DE CANAIS - DESIGN SYSTEM PROFISSIONAL
   Padrão: White (Light) Mode Corporativo & Confiável
   Dark Mode Premium: Obsidian & Red (#E53935)
   Design Responsivo estilo App Nativo para Celular
   ============================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ============ CSS VARIABLES (PADRÃO: WHITE / LIGHT MODE) ============ */
:root, [data-theme="light"], body.light-theme {
    --bg-primary: #F8FAFC;
    --bg-secondary: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F1F5F9;
    --bg-input: #FFFFFF;
    --border-color: #E2E8F0;
    --border-light: #CBD5E1;
    
    --text-primary: #0F172A;
    --text-secondary: #334155;
    --text-muted: #64748B;
    
    --red-primary: #E53935;
    --red-dark: #C62828;
    --red-light: #EF4444;
    --red-glow: rgba(229, 57, 53, 0.2);
    
    --green: #10B981;
    --green-dark: #059669;
    --yellow: #F59E0B;
    --blue: #2563EB;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.08);
    --shadow-red: 0 8px 25px rgba(229, 57, 53, 0.25);
    
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============ TEMA DARK (MODO ESCURO OBSIDIAN) ============ */
[data-theme="dark"], body.dark-theme {
    --bg-primary: #0A0A0A;
    --bg-secondary: #121212;
    --bg-card: #161616;
    --bg-card-hover: #1F1F1F;
    --bg-input: #121212;
    --border-color: #262626;
    --border-light: #333333;
    
    --text-primary: #FFFFFF;
    --text-secondary: #D4D4D8;
    --text-muted: #A1A1AA;
    
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.6);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.7);
    --shadow-red: 0 8px 30px rgba(229, 57, 53, 0.35);
}

/* ============ RESET & BASE ============ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden !important;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden !important;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: var(--red-primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--red-light);
}

/* ============ NAVBAR ============ */
.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 32px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.3px;
    text-decoration: none;
}

.navbar-brand span {
    color: var(--red-primary);
}

.site-logo {
    max-height: 40px;
    width: auto;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
    transition: var(--transition);
}

.site-logo:hover {
    transform: scale(1.02);
}

.site-logo-sm {
    max-height: 30px;
    width: auto;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}

.site-logo-lg {
    max-height: 56px;
    width: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 16px;
    list-style: none;
}

.navbar-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.navbar-links a:hover,
.navbar-links a.active {
    color: var(--red-primary);
    background: rgba(229, 57, 53, 0.08);
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: inherit;
    transition: var(--transition);
    user-select: none;
    box-shadow: var(--shadow-sm);
}

.theme-toggle-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--red-primary);
    color: var(--red-primary);
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .navbar {
        padding: 10px 16px;
        height: auto;
        min-height: 60px;
        flex-wrap: wrap;
        gap: 10px;
    }
    .navbar-brand {
        font-size: 1.1rem;
    }
    .navbar-links {
        gap: 6px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    .navbar-links a {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    .theme-toggle-btn {
        padding: 6px 10px;
        font-size: 0.78rem;
    }
}

/* ============ CONTAINER ============ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 20px;
}

.container-fluid {
    padding: 32px 40px;
}

/* ============ CARDS ============ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h2,
.card-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

/* ============ STATS GRID ============ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-light);
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1.1;
    color: var(--text-primary);
}

.stat-value.red { color: var(--red-primary); }
.stat-value.green { color: var(--green); }
.stat-value.yellow { color: var(--yellow); }
.stat-value.blue { color: var(--blue); }

.stat-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ============ CARROUSEL INTERATIVO DE PLANOS ============ */
.plans-carousel-container {
    width: 100%;
    max-width: 100%;
    position: relative;
    padding: 10px 0 30px;
    overflow: hidden;
}

.plans-carousel-wrapper {
    position: relative;
    overflow: hidden;
    padding: 16px 4px 24px;
    width: 100%;
}

.plans-carousel-track {
    display: flex;
    gap: 24px;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    cursor: grab;
    user-select: none;
    will-change: transform;
}

.plans-carousel-track.dragging {
    cursor: grabbing;
    transition: none !important;
}

.plan-card-carousel {
    flex: 0 0 330px;
    min-width: 310px;
    max-width: 350px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px 24px;
    text-align: center;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.plan-card-carousel:hover {
    transform: translateY(-6px);
    border-color: var(--red-primary);
    box-shadow: var(--shadow-red);
}

.plan-card-carousel.featured {
    border-color: var(--red-primary);
    background: linear-gradient(180deg, rgba(229, 57, 53, 0.04) 0%, var(--bg-card) 100%);
    box-shadow: var(--shadow-md);
}

.plan-badge-top {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--red-primary), var(--red-dark));
    color: #FFFFFF;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 4px 16px;
    border-radius: 20px;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(229, 57, 53, 0.4);
    white-space: nowrap;
}

.plan-name-lg {
    font-size: 1.15rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.plan-price-brl {
    font-size: 2.6rem;
    font-weight: 900;
    color: var(--red-primary);
    line-height: 1;
    margin-bottom: 6px;
    letter-spacing: -1px;
}

.plan-price-period {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
}

.plan-price-btc {
    background: rgba(245, 158, 11, 0.1);
    color: var(--yellow);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: monospace;
    display: inline-block;
    margin-bottom: 20px;
}

[data-theme="light"] .plan-price-btc {
    color: #B45309;
    border-color: #FCD34D;
    background: #FEF3C7;
}

.plan-connections-badge {
    background: rgba(16, 185, 129, 0.1);
    color: var(--green);
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
}

.plan-features-list {
    list-style: none;
    text-align: left;
    margin: 20px 0 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.plan-features-list li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 7px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.plan-features-list li span.check-icon {
    color: var(--green);
    font-weight: 900;
    font-size: 1rem;
}

/* Controles de Navegação do Carrossel */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    font-size: 1.2rem;
}

.carousel-btn:hover {
    background: var(--red-primary);
    color: #FFFFFF;
    border-color: var(--red-primary);
    transform: translateY(-50%) scale(1.08);
}

.carousel-btn.prev { left: -16px; }
.carousel-btn.next { right: -16px; }

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-light);
    cursor: pointer;
    transition: var(--transition);
}

.carousel-dot.active {
    width: 24px;
    border-radius: 6px;
    background: var(--red-primary);
}

/* ============ DADOS DE ACESSO (ESTILO FONTE DO MAGAL) ============ */
.access-box-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.access-field-group {
    margin-bottom: 18px;
}

.access-field-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: block;
}

.access-copy-input-box {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 4px 6px 4px 14px;
    transition: var(--transition);
}

.access-copy-input-box:focus-within {
    border-color: var(--red-primary);
    box-shadow: 0 0 0 3px var(--red-glow);
}

.access-copy-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: monospace;
    font-size: 0.95rem;
    font-weight: 700;
    outline: none;
    padding: 8px 0;
}

.access-copy-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.access-copy-btn:hover {
    background: var(--red-primary);
    color: #FFFFFF;
    border-color: var(--red-primary);
}

/* ============ BANNER DE VENCIMENTO / STATUS ============ */
.subscription-status-banner {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(245, 158, 11, 0.04) 100%);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

[data-theme="light"] .subscription-status-banner {
    background: #FFFDF5;
    border-color: #FCD34D;
}

.subscription-status-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.subscription-status-icon {
    font-size: 2rem;
    line-height: 1;
}

.subscription-status-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.subscription-status-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ============ BOTÕES ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    text-align: center;
    user-select: none;
    font-family: inherit;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--red-primary), var(--red-dark));
    color: #FFFFFF;
    box-shadow: 0 4px 15px rgba(229, 57, 53, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 57, 53, 0.5);
    color: #FFFFFF;
}

.btn-secondary {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    color: var(--text-primary);
}

.btn-outline {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--red-primary);
    color: var(--red-primary);
    background: rgba(229, 57, 53, 0.05);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 15px 28px;
    font-size: 1rem;
    border-radius: var(--radius-md);
}

.btn-block {
    width: 100%;
}

/* ============ FORM CONTROLS ============ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--red-primary);
    box-shadow: 0 0 0 3px var(--red-glow);
}

/* ============ BADGES ============ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.badge-success, .badge-active {
    background: rgba(16, 185, 129, 0.12);
    color: var(--green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-danger, .badge-inactive {
    background: rgba(239, 68, 68, 0.12);
    color: var(--red-primary);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-warning, .badge-pending {
    background: rgba(245, 158, 11, 0.12);
    color: var(--yellow);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

[data-theme="light"] .badge-warning {
    color: #B45309;
}

.badge-info {
    background: rgba(37, 99, 235, 0.12);
    color: var(--blue);
    border: 1px solid rgba(37, 99, 235, 0.3);
}

.badge-primary {
    background: rgba(229, 57, 53, 0.12);
    color: var(--red-primary);
    border: 1px solid rgba(229, 57, 53, 0.3);
}

/* ============ ALERTS ============ */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.9rem;
    line-height: 1.5;
    display: block;
    animation: slideDown 0.3s ease;
}

.alert-flex {
    display: flex;
    align-items: center;
    gap: 12px;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #065F46;
}

[data-theme="dark"] .alert-success {
    color: #34D399;
}

.alert-danger, .alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #991B1B;
}

[data-theme="dark"] .alert-danger {
    color: #F87171;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #92400E;
}

[data-theme="dark"] .alert-warning {
    color: #FBBF24;
}

/* ============ SIDEBAR & ADMIN/CLIENT LAYOUT ============ */
.admin-layout,
.client-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 999;
    transition: var(--transition);
}

.sidebar-logo {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--text-primary);
    padding: 0 12px 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.sidebar-logo span {
    color: var(--red-primary);
}

.sidebar-section {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    padding: 12px 12px 6px;
    font-weight: 700;
}

.sidebar-nav {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
}

.sidebar-nav a:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.sidebar-nav a.active {
    background: rgba(229, 57, 53, 0.09);
    color: var(--red-primary);
    font-weight: 700;
}

.admin-content,
.client-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px 40px;
    min-height: 100vh;
    transition: var(--transition);
}

/* User Profile Header */
.user-profile-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    margin-bottom: 24px;
}

.user-avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--red-primary), var(--red-dark));
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(229, 57, 53, 0.3);
}

/* ============ TABLES ============ */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background: var(--bg-secondary);
}

table th {
    padding: 14px 18px;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

table td {
    padding: 14px 18px;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

table tbody tr:hover {
    background: var(--bg-card-hover);
}

table tbody tr:last-child td {
    border-bottom: none;
}

/* Connection Progress Bar */
.connection-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.connection-progress {
    flex: 1;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    min-width: 60px;
}

.connection-progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.connection-progress-bar.low { background: var(--green); }
.connection-progress-bar.medium { background: var(--yellow); }
.connection-progress-bar.high { background: var(--red-primary); }

/* ============ MODAL ============ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 540px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.25s ease;
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ============ MOBILE BOTTOM BAR (APP NATIVO) ============ */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    z-index: 9999;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
}

.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    gap: 3px;
    text-decoration: none;
    transition: var(--transition);
}

.mobile-nav-item span.icon {
    font-size: 1.25rem;
}

.mobile-nav-item.active {
    color: var(--red-primary);
}

/* ============ RESPONSIVE & MOBILE ============ */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }
    
    .admin-content,
    .client-content {
        margin-left: 0;
        padding: 20px 16px 84px; /* Espaço para barra inferior */
    }
    
    .mobile-bottom-nav {
        display: flex;
    }
    
    .navbar {
        padding: 0 16px;
    }

    .plans-carousel-track {
        gap: 16px;
    }

    .plan-card-carousel {
        flex: 0 0 280px;
        min-width: 270px;
    }

    .carousel-btn {
        display: none; /* No mobile usa swipe touch */
    }
}

/* ============ UTILITIES ============ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-red { color: var(--red-primary); }
.text-green { color: var(--green); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.font-weight-bold { font-weight: 700; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.flex-1 { flex: 1; }
.w-100 { width: 100%; }
.hidden { display: none !important; }

/* ========================================================
   DESIGN SYSTEM PREMIUM - FONTE DO MAGAL (INSPIRAÇÃO)
   Design Corporativo, Amigável e Fluido
   Suporte a Light Mode (Fundo Branco Padrão) & Dark Mode (Obsidian)
   ======================================================== */

.magal-body {
    min-height: 100vh;
    background: var(--bg-primary);
    color: var(--text-primary);
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden !important;
}

.magal-app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Sidebar Desktop */
.magal-sidebar {
    width: 250px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: var(--transition);
}

[data-theme="dark"] .magal-sidebar {
    background: #0E1015;
    border-right-color: #1A1E26;
}

.magal-sidebar-header {
    padding: 24px 20px 20px;
    border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .magal-sidebar-header {
    border-bottom-color: #1A1E26;
}

.magal-brand-link {
    text-decoration: none;
    display: block;
}

.magal-brand-name {
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: -0.3px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

[data-theme="dark"] .magal-brand-name {
    color: #F87171;
}

.magal-brand-sub {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 2px;
}

.magal-nav-menu {
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    overflow-y: auto;
}

.magal-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    transition: var(--transition);
}

[data-theme="dark"] .magal-nav-item {
    color: #94A3B8;
}

.magal-nav-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    transform: translateX(2px);
}

.magal-nav-item.active {
    background: rgba(229, 57, 53, 0.1);
    color: var(--red-primary);
    font-weight: 700;
}

[data-theme="dark"] .magal-nav-item.active {
    background: #1C1917;
    color: #F59E0B;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.magal-nav-icon {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
}

.magal-nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 12px 4px;
}

[data-theme="dark"] .magal-nav-divider {
    background: #1A1E26;
}

.magal-nav-item.logout-item:hover {
    color: var(--red-primary);
    background: rgba(239, 68, 68, 0.08);
}

/* Área Principal */
.magal-main-wrapper {
    flex: 1;
    margin-left: 250px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    transition: var(--transition);
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

[data-theme="dark"] .magal-main-wrapper {
    background: #0B0D11;
}

/* Topbar Superior */
.magal-topbar {
    height: 68px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

[data-theme="dark"] .magal-topbar {
    background: #0E1015;
    border-bottom-color: #1A1E26;
}

.magal-topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.magal-mobile-brand {
    display: none;
    font-weight: 900;
    font-size: 1.1rem;
    color: var(--red-primary);
}

.magal-page-title {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.4px;
    color: var(--text-primary);
    margin: 0;
}

.magal-topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.magal-user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 6px 4px 12px;
    border-radius: 30px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

[data-theme="dark"] .magal-user-profile {
    background: #151922;
    border-color: #232A38;
}

.magal-user-email {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

[data-theme="dark"] .magal-user-email {
    color: #CBD5E1;
}

.magal-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #D97706;
    color: #FFFFFF;
    font-weight: 800;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Conteúdo */
.magal-content-container {
    padding: 28px 32px 80px;
    max-width: 1180px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    min-width: 0;
}

/* 1. Banner do Telegram */
.magal-telegram-notice {
    background: rgba(14, 165, 233, 0.08);
    border: 1px solid rgba(14, 165, 233, 0.25);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 0.88rem;
    color: var(--text-primary);
}

[data-theme="dark"] .magal-telegram-notice {
    background: #0C1E2E;
    border-color: #134E4A;
    color: #7DD3FC;
}

.telegram-icon-badge {
    font-size: 1.15rem;
}

.telegram-text {
    flex: 1;
}

.telegram-btn {
    color: #0284C7;
    font-weight: 700;
    text-decoration: underline;
    font-size: 0.85rem;
    white-space: nowrap;
}

[data-theme="dark"] .telegram-btn {
    color: #38BDF8;
}

/* 2. Banner de Renovação / Vencimento */
.magal-renew-banner {
    background: #FFFDF5;
    border: 1px solid #FCD34D;
    border-radius: var(--radius-lg);
    padding: 22px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .magal-renew-banner {
    background: #1C1917;
    border: 1px solid #78350F;
}

.renew-banner-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.renew-shield-icon {
    font-size: 2.2rem;
    line-height: 1;
}

.renew-banner-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 3px;
}

[data-theme="dark"] .renew-banner-title {
    color: #FEF3C7;
}

.renew-banner-desc {
    font-size: 0.86rem;
    color: var(--text-secondary);
}

[data-theme="dark"] .renew-banner-desc {
    color: #D6D3D1;
}

.btn-warning-solid {
    background: #F59E0B;
    color: #000000;
    font-weight: 800;
    font-size: 0.9rem;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-warning-solid:hover {
    background: #D97706;
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
}

/* 3. Grid de 3 Cards de Status */
.magal-status-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 26px;
}

.magal-metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

[data-theme="dark"] .magal-metric-card {
    background: #11141C;
    border-color: #1F2633;
}

.magal-metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-light);
}

.metric-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.metric-title {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
}

.metric-icon {
    font-size: 1.15rem;
    opacity: 0.7;
}

.metric-main-value {
    font-size: 2.2rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 8px;
}

.metric-main-value.text-online {
    color: #10B981;
}

.metric-main-value.text-offline {
    color: #EF4444;
}

.metric-main-value.text-highlight {
    color: var(--text-primary);
}

[data-theme="dark"] .metric-main-value.text-highlight {
    color: #FFFFFF;
}

.metric-main-value.text-expire {
    color: var(--text-primary);
}

[data-theme="dark"] .metric-main-value.text-expire {
    color: #FFFFFF;
}

.metric-sub-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* 4. Seções / Avisos */
.magal-section-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 26px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .magal-section-card {
    background: #11141C;
    border-color: #1F2633;
}

.section-card-header {
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .section-card-header {
    border-bottom-color: #1F2633;
}

.section-card-header h2,
.section-card-header h3 {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: var(--text-primary);
    margin: 0;
}

.magal-avisos-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.magal-aviso-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

[data-theme="dark"] .magal-aviso-item {
    background: #0E1017;
    border-color: #1C222E;
}

.aviso-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.aviso-content {
    flex: 1;
}

.aviso-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.aviso-desc {
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.aviso-link {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--red-primary);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    background: rgba(229, 57, 53, 0.08);
    white-space: nowrap;
}

.aviso-link:hover {
    background: var(--red-primary);
    color: #FFFFFF;
}

/* 5. Ações Rápidas */
.magal-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 10px;
}

.magal-quick-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .magal-quick-btn {
    background: #11141C;
    border-color: #1F2633;
}

.magal-quick-btn:hover {
    transform: translateY(-2px);
    border-color: var(--red-primary);
    box-shadow: var(--shadow-md);
}

.magal-quick-btn .icon {
    font-size: 1.6rem;
}

.magal-quick-btn .quick-text {
    display: flex;
    flex-direction: column;
}

.magal-quick-btn .quick-text strong {
    font-size: 0.92rem;
    color: var(--text-primary);
}

.magal-quick-btn .quick-text span {
    font-size: 0.76rem;
    color: var(--text-muted);
}

/* 6. Dados de Acesso */
.magal-access-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

[data-theme="dark"] .magal-access-card {
    background: #11141C;
    border-color: #1F2633;
}

.magal-access-header {
    padding: 20px 26px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

[data-theme="dark"] .magal-access-header {
    border-bottom-color: #1F2633;
}

.access-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.access-tv-icon {
    font-size: 1.4rem;
}

.access-service-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #F59E0B;
}

.access-meta-badge {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.magal-access-body {
    padding: 26px;
}

.access-fields-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
}

.access-field-box {
    margin-bottom: 18px;
}

.access-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.access-input-wrap {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 4px 6px 4px 14px;
    transition: var(--transition);
    max-width: 100%;
    min-width: 0;
}

[data-theme="dark"] .access-input-wrap {
    background: #0A0C10;
    border-color: #1F2633;
}

.access-input-wrap:focus-within {
    border-color: #F59E0B;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.access-input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 700;
    padding: 10px 0;
    outline: none;
}

.access-input.font-mono {
    font-family: monospace;
    font-size: 0.88rem;
}

.access-btn-copy,
.access-btn-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    margin-left: 6px;
}

[data-theme="dark"] .access-btn-copy,
[data-theme="dark"] .access-btn-toggle {
    background: #181E29;
    border-color: #273142;
    color: #CBD5E1;
}

.access-btn-copy:hover {
    background: #F59E0B;
    color: #000000;
    border-color: #F59E0B;
}

.access-btn-copy.copied {
    background: #10B981 !important;
    color: #FFFFFF !important;
    border-color: #10B981 !important;
}

.access-helper-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 20px 0 24px;
    line-height: 1.5;
}

.btn-change-line-pass {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

[data-theme="dark"] .btn-change-line-pass {
    border-color: #273142;
    color: #CBD5E1;
}

.btn-change-line-pass:hover {
    border-color: #F59E0B;
    color: #F59E0B;
}

/* 7. Conexões */
.magal-connections-metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 24px;
}

.magal-filter-pills {
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 3px;
    gap: 2px;
}

[data-theme="dark"] .magal-filter-pills {
    background: #0E1017;
    border-color: #1F2633;
}

.pill-btn {
    padding: 6px 14px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 20px;
    transition: var(--transition);
}

.pill-btn.active {
    background: #181E29;
    color: #FFFFFF;
}

[data-theme="light"] .pill-btn.active {
    background: #0F172A;
    color: #FFFFFF;
}

.empty-connections-state {
    text-align: center;
    padding: 48px 20px;
}

.empty-connections-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.7;
}

.empty-connections-text {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.magal-limit-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px 26px;
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .magal-limit-card {
    background: #11141C;
    border-color: #1F2633;
}

.limit-card-header h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.limit-card-block {
    margin-bottom: 18px;
}

.limit-card-block:last-child {
    margin-bottom: 0;
}

.limit-block-label {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.limit-block-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* 8. Uptime */
.magal-uptime-metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 24px;
}

/* 9. Mobile Responsive (App Nativo) */
@media (max-width: 900px) {
    .magal-sidebar {
        display: none !important;
    }

    .magal-main-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
        min-width: 0 !important;
    }

    .magal-topbar {
        padding: 0 12px;
        height: 56px;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
    }

    .magal-topbar-left {
        gap: 8px;
        min-width: 0;
    }

    .magal-mobile-brand {
        display: block;
    }

    .magal-page-title {
        display: none;
    }

    .magal-topbar-right {
        gap: 8px;
        flex-shrink: 0;
    }

    .theme-toggle-btn .theme-text {
        display: none !important;
    }

    .theme-toggle-btn {
        width: 36px;
        height: 36px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
        min-width: 36px;
    }

    .magal-user-email {
        display: none !important;
    }

    .magal-user-profile {
        padding: 0;
        background: transparent;
        border: none;
        box-shadow: none;
    }

    .magal-content-container {
        padding: 16px 14px 90px;
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
        min-width: 0 !important;
    }

    .magal-status-cards-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .magal-connections-metrics-grid,
    .magal-uptime-metrics-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .access-fields-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .access-input-wrap {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .access-input {
        min-width: 0 !important;
        flex: 1;
        width: 100%;
    }

    .magal-telegram-notice {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 14px 16px;
    }

    .magal-telegram-notice .telegram-btn {
        align-self: flex-start;
    }

    .magal-renew-banner {
        flex-direction: column;
        align-items: stretch;
        padding: 18px 16px;
        gap: 14px;
    }

    .renew-banner-content {
        flex-direction: row;
        align-items: flex-start;
        gap: 12px;
    }

    .renew-banner-action .btn {
        width: 100%;
    }

    .magal-aviso-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 14px 16px;
    }

    .aviso-link {
        align-self: flex-start;
    }

    .magal-section-card {
        padding: 18px 16px;
    }

    .table-container {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .plans-carousel-container {
        overflow: hidden;
        max-width: 100%;
    }

    .carousel-btn {
        display: none !important;
    }

    .dashboard-split-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }

    .mobile-bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 62px;
        background: var(--bg-card);
        border-top: 1px solid var(--border-color);
        z-index: 9999;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
        backdrop-filter: blur(10px);
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    [data-theme="dark"] .mobile-bottom-nav {
        background: rgba(14, 16, 21, 0.95);
        border-top-color: #1A1E26;
    }

    .mobile-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 0.72rem;
        font-weight: 700;
        gap: 2px;
        transition: var(--transition);
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-nav-item .icon {
        font-size: 1.25rem;
    }

    .mobile-nav-item.active {
        color: var(--red-primary);
    }

    [data-theme="dark"] .mobile-nav-item.active {
        color: #F59E0B;
    }

    .mobile-nav-item:active {
        transform: scale(0.92);
    }
}

/* Dashboard Split Grid (Admin) */
.dashboard-split-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* ====================================================
   FOOTERS MODERNOS (ANTES E DEPOIS DO LOGIN)
   ==================================================== */

/* 1. Footer da Landing Page (Antes do Login) */
.landing-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 60px 0 28px;
    margin-top: 60px;
    color: var(--text-secondary);
    transition: var(--transition);
}

[data-theme="dark"] .landing-footer {
    background: #0E1015;
    border-top-color: #1A1E26;
}

.landing-footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
    gap: 40px;
    margin-bottom: 48px;
}

.landing-footer-logo {
    display: inline-block;
    margin-bottom: 16px;
    text-decoration: none;
}

.landing-footer-desc {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.landing-uptime-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 30px;
    font-size: 0.8rem;
    color: #10B981;
    font-weight: 600;
}

.status-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10B981;
    box-shadow: 0 0 10px #10B981;
    display: inline-block;
}

.landing-footer-heading {
    font-size: 0.95rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-primary);
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 8px;
}

.landing-footer-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 28px;
    height: 2px;
    background: var(--red-primary);
    border-radius: 2px;
}

.landing-footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.landing-footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.landing-footer-links a:hover {
    color: var(--red-primary);
    transform: translateX(4px);
}

.landing-trust-badges {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trust-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

[data-theme="dark"] .trust-badge-pill {
    background: #151922;
    border-color: #232A38;
}

.landing-footer-bottom {
    padding-top: 28px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.landing-footer-tech {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    font-weight: 600;
}

@media (max-width: 900px) {
    .landing-footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .landing-footer {
        padding: 40px 0 24px;
        margin-top: 40px;
    }
    .landing-footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
}

/* 2. Footer dos Painéis Internos (Depois do Login) */
.portal-footer {
    margin-top: 48px;
    padding: 24px 0 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

[data-theme="dark"] .portal-footer {
    border-top-color: #1A1E26;
}

.portal-footer-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.portal-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 20px;
    color: #10B981;
    font-weight: 700;
    font-size: 0.78rem;
}

.portal-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10B981;
    box-shadow: 0 0 6px #10B981;
    display: inline-block;
}

.portal-version-text {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.portal-footer-links {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.portal-footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    transition: var(--transition);
}

.portal-footer-links a:hover {
    color: var(--red-primary);
}

.portal-footer-right {
    font-size: 0.8rem;
}

@media (max-width: 900px) {
    .portal-footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
        margin-top: 32px;
        padding-bottom: 24px;
    }
    .portal-footer-left,
    .portal-footer-links {
        justify-content: center;
    }
}

/* ====================================================
   PÁGINAS DE AUTENTICAÇÃO (LOGIN & CADASTRO) - PREMIUM
   ==================================================== */

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 32px 16px;
    position: relative;
    background: var(--bg-primary);
    overflow-x: hidden;
}

/* Background com iluminação ambiente e gradientes suaves */
.auth-wrapper::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(229, 57, 53, 0.12) 0%, rgba(229, 57, 53, 0) 70%);
    top: -150px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 0;
}

[data-theme="dark"] .auth-wrapper::before {
    background: radial-gradient(circle, rgba(229, 57, 53, 0.18) 0%, rgba(229, 57, 53, 0) 70%);
}

.auth-topbar {
    position: absolute;
    top: 24px;
    right: 24px;
    left: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.auth-brand-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 800;
    font-size: 1.05rem;
    transition: var(--transition);
}

.auth-brand-mini:hover {
    opacity: 0.85;
}

.auth-brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #E53935 0%, #B71C1C 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    box-shadow: 0 4px 14px rgba(229, 57, 53, 0.4);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px 36px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="dark"] .auth-card {
    background: rgba(20, 20, 23, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65), 0 0 1px rgba(255, 255, 255, 0.1);
}

.auth-card-wide {
    max-width: 480px;
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-logo-badge {
    width: 58px;
    height: 58px;
    margin: 0 auto 16px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(229, 57, 53, 0.15) 0%, rgba(229, 57, 53, 0.05) 100%);
    border: 1px solid rgba(229, 57, 53, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.85rem;
    box-shadow: 0 8px 20px rgba(229, 57, 53, 0.15);
}

.auth-title {
    font-size: 1.65rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

/* Campos de Formulário Modernos */
.auth-field {
    margin-bottom: 18px;
    text-align: left;
}

.auth-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 7px;
    letter-spacing: 0.2px;
}

.auth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
    transition: color 0.2s ease;
    user-select: none;
}

.auth-input {
    width: 100%;
    padding: 13px 44px 13px 42px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 500;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.auth-input:focus {
    outline: none;
    border-color: var(--red-primary);
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.15);
}

.auth-input-wrapper:focus-within .auth-input-icon {
    color: var(--red-primary);
}

/* Botão de Toggle Senha (Olho) */
.auth-toggle-pass {
    position: absolute;
    right: 10px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.05rem;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.auth-toggle-pass:hover {
    color: var(--text-primary);
}

/* Botão Principal com Efeito Hover e Sombra Glow */
.auth-btn-submit {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #E53935 0%, #C62828 100%);
    color: #FFFFFF;
    font-size: 1rem;
    font-weight: 800;
    font-family: inherit;
    letter-spacing: 0.3px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(229, 57, 53, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.auth-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(229, 57, 53, 0.45);
    filter: brightness(1.05);
}

.auth-btn-submit:active {
    transform: translateY(0);
}

/* Divisor */
.auth-divider-box {
    display: flex;
    align-items: center;
    margin: 22px 0;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
}

.auth-divider-box::before,
.auth-divider-box::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-divider-box span {
    padding: 0 12px;
}

/* Botão Secundário (Trocar tela) */
.auth-btn-switch {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    display: block;
    transition: all 0.2s ease;
}

.auth-btn-switch:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    transform: translateY(-1px);
}

/* Rodapé do Auth */
.auth-footer {
    text-align: center;
    margin-top: 24px;
}

.auth-footer a {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-footer a:hover {
    color: var(--red-primary);
}

/* Selo de Segurança e Benefícios */
.auth-security-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px dashed var(--border-color);
}

.auth-security-badge span {
    color: var(--green);
}

/* Requisitos de senha no cadastro */
.auth-requirements {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.auth-requirements-title {
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Responsividade Mobile */
@media (max-width: 480px) {
    .auth-card {
        padding: 30px 20px;
        border-radius: 20px;
    }
    
    .auth-topbar {
        position: static;
        width: 100%;
        margin-bottom: 20px;
        padding: 0 4px;
    }
    
    .auth-title {
        font-size: 1.45rem;
    }
}

