/* custom-theme.css */

/* --- Fontes Modernas --- */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&family=Inter:wght@300;400;500;600&display=swap');
@import url('./g3-footer.css');

:root {
    --font-display: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --primary-glow: 255, 0, 128;
    /* Magenta Neon */
    --secondary-glow: 0, 255, 255;
    /* Cyan Neon */
}

body {
    font-family: var(--font-body);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
}

/* --- Fundo Estático (Gradiente do canto direito para esquerdo) --- */
/* NOTA: Fundo animado original documentado no CHANGELOG v1.9.12 para reversão */
.bg-animated {
    background:
        radial-gradient(ellipse at 85% 30%, rgba(0, 180, 216, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 70%, rgba(5, 117, 230, 0.10) 0%, transparent 55%),
        radial-gradient(circle at 90% 50%, rgb(0, 20, 40) 0%, rgb(0, 0, 0) 75%);
    width: 100%;
}

/* --- Scrollbar Global (Tema Azul) --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: rgba(5, 117, 230, 0.3);
    border-radius: 4px;
    border: 1px solid rgba(5, 117, 230, 0.1);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(5, 117, 230, 0.5);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(5, 117, 230, 0.3) rgba(0, 0, 0, 0.2);
}

/* --- Glassmorphism Card --- */
.glass-card {
    background: rgba(30, 30, 30, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    border-radius: 24px;
    position: relative;
    z-index: 10;
}

/* --- Sidebar legado: limitado ao renderer marcado explicitamente --- */
.g3-navigation-legacy #sidebar-menu {
    background: linear-gradient(180deg, rgba(15, 15, 25, 0.95) 0%, rgba(10, 10, 20, 0.98) 100%) !important;
    border-right: 1px solid rgb(55, 65, 81) !important; /* border-gray-700: igual ao topbar border-b */
    border-radius: 0 !important;
    border-top: none !important;
    border-left: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
    /* Transição combinada: transform (slide mobile) + width/opacity (collapse desktop) */
    transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1),
                width 0.3s ease,
                min-width 0.3s ease,
                opacity 0.3s ease !important;
}

/* Mobile: usa svh (small viewport height) para não ultrapassar a barra de nav do sistema */
@media (max-width: 767px) {
    .g3-navigation-legacy #sidebar-menu {
        bottom: auto !important; /* remove o bottom:0 do inset-y-0 no mobile */
        height: 100svh !important; /* small viewport height = área visível sem barra de nav */
    }
}

/* Sidebar colapsado via hamburger no desktop */
.g3-navigation-legacy #sidebar-menu.sidebar-collapsed {
    width: 0 !important;
    min-width: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
}

/* Menu title separators */
.g3-navigation-legacy .menu-title {
    letter-spacing: 0.1em;
    position: relative;
    padding-left: 24px;
}

.g3-navigation-legacy .menu-title::before {
    content: '';
    position: absolute;
    left: 24px;
    bottom: 0;
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, #0575e6, transparent);
    border-radius: 1px;
}

/* Active menu item */
.g3-navigation-legacy li>a.active,
.g3-navigation-legacy li>a[href*="home"] {
    background: linear-gradient(90deg, rgba(5, 117, 230, 0.15), transparent) !important;
    border-left: 3px solid #0575e6;
    color: white !important;
}

.g3-navigation-legacy li>a.active i,
.g3-navigation-legacy li>a[href*="home"] i {
    color: #0575e6 !important;
}

/* Hover glow on menu items */
.g3-navigation-legacy li>a:hover {
    background: rgba(255, 255, 255, 0.04) !important;
    border-left: 3px solid rgba(5, 117, 230, 0.4);
}

/* Submenu styling */
.g3-navigation-legacy .submenu {
    border-left: 2px solid rgba(5, 117, 230, 0.15);
    margin-left: 32px;
    position: relative !important;
    z-index: 1;
    width: auto;
}

.g3-navigation-legacy .submenu li a {
    transition: all 0.2s ease;
}

.g3-navigation-legacy .submenu li a:hover {
    color: #60a5fa !important;
    padding-left: 44px;
}

/* Sidebar logo area — mesma cor do topbar (bg-gray-900) */
.g3-navigation-legacy #sidebar-menu>div:first-child>div:first-child {
    background: rgb(17, 24, 39) !important; /* = bg-gray-900, igual ao topbar */
}

/* Logout button enhancement */
.g3-navigation-legacy .border-t a[href*="logout"] {
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* --- Input Moderno --- */
.input-group-modern {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-modern {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem 1rem 1rem 3rem;
    /* Espaço para ícone */
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.input-modern:focus {
    border-color: rgba(var(--secondary-glow), 0.8);
    box-shadow: 0 0 15px rgba(var(--secondary-glow), 0.3);
    background: rgba(0, 0, 0, 0.5);
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.2rem;
    transition: color 0.3s;
}

.input-modern:focus+.input-icon {
    color: rgba(var(--secondary-glow), 1);
}

/* --- Botão Neon --- */
.btn-neon {
    background: linear-gradient(135deg, #00f260 0%, #0575e6 100%);
    border: none;
    color: white;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    width: 100%;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: var(--font-display);
    text-transform: uppercase;
}

.btn-neon:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(5, 117, 230, 0.4);
}

.btn-neon:active {
    transform: translateY(0);
}

/* --- Utilitários de Texto --- */
.text-gradient {
    background: linear-gradient(to right, #00f260, #0575e6);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.text-white-dim {
    color: rgba(255, 255, 255, 0.7);
}

/* --- Checkbox Personalizado --- */
.custom-checkbox-modern {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.custom-checkbox-modern input {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    margin-right: 10px;
    position: relative;
    transition: all 0.2s;
}

.custom-checkbox-modern input:checked+.checkmark {
    background: #0575e6;
    border-color: #0575e6;
}

.custom-checkbox-modern input:checked+.checkmark::after {
    content: '✓';
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
}

/* ========================================================
   DataTables - Estilos Customizados para Clientes Vencendo
   ======================================================== */

/* --- Wrapper geral --- */
.glass-table-wrapper .dataTables_wrapper {
    color: #d1d5db;
}

/* A disposição dos controles é compartilhada em g3-datatable.css. */
.g3-log-table { overflow: visible !important; }
.g3-log-table .dataTables_scroll { width: 100%; }
.g3-log-table .dataTables_scrollBody { overscroll-behavior-inline: contain; }

/* --- Select "Mostrar X registros" --- */
.glass-table-wrapper .dataTables_length select {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #e5e7eb;
    padding: 6px 28px 6px 12px;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 6px center;
    background-repeat: no-repeat;
    background-size: 18px;
}

.glass-table-wrapper .dataTables_length select:focus {
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}

.glass-table-wrapper .dataTables_length label {
    font-size: 0.85rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Campo de Busca */
.glass-table-wrapper .dataTables_filter {
    margin-left: auto;
    margin-bottom: 0 !important;
}

.glass-table-wrapper .dataTables_filter label {
    font-size: 0.85rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.glass-table-wrapper .dataTables_filter input {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #e5e7eb;
    padding: 8px 14px 8px 32px;
    font-size: 0.85rem;
    outline: none;
    transition: all 0.2s ease;
    min-width: 180px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280' stroke-width='2'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: 10px center;
    background-size: 14px;
}

.glass-table-wrapper .dataTables_filter input:focus {
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
    background-color: rgba(255, 255, 255, 0.12);
}

.glass-table-wrapper .dataTables_filter input::placeholder {
    color: #6b7280;
}

/* --- Radio Buttons (Scope Filter) --- */
.glass-table-wrapper .scope-filter {
    margin-bottom: 12px;
}

.glass-table-wrapper .scope-filter label {
    font-size: 0.85rem;
    color: #9ca3af;
    cursor: pointer;
    padding: 5px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.glass-table-wrapper .scope-filter label:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e5e7eb;
}

.glass-table-wrapper .scope-filter input[type="radio"] {
    accent-color: #ef4444;
    margin-right: 4px;
}

/* --- Cabeçalho da Tabela --- */
.glass-table-wrapper table.dataTable thead th {
    background: rgba(255, 255, 255, 0.05);
    color: #9ca3af;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

/* --- Linhas da Tabela --- */
.glass-table-wrapper table.dataTable tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.15s ease;
}

.glass-table-wrapper table.dataTable tbody tr:hover {
    background: rgba(239, 68, 68, 0.06) !important;
}

.glass-table-wrapper table.dataTable tbody td {
    padding: 10px 16px;
    font-size: 0.85rem;
    color: #d1d5db;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    vertical-align: middle;
}

.glass-table-wrapper table.dataTable tbody tr:last-child td {
    border-bottom: none;
}

/* --- Botões de Ação da Tabela --- */
.glass-table-wrapper table.dataTable .btn,
.glass-table-wrapper table.dataTable a[class*="btn"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: #d1d5db;
    transition: all 0.2s;
    cursor: pointer;
    margin: 0 2px;
    padding: 0;
    text-decoration: none;
}

.glass-table-wrapper table.dataTable .btn:hover,
.glass-table-wrapper table.dataTable a[class*="btn"]:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Botão renovar (verde) */
.glass-table-wrapper .renovar_cliente {
    background: rgba(16, 185, 129, 0.15) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
    color: #6ee7b7 !important;
}

.glass-table-wrapper .renovar_cliente:hover {
    background: rgba(16, 185, 129, 0.3) !important;
    border-color: rgba(16, 185, 129, 0.5) !important;
    color: #a7f3d0 !important;
}

/* Botão WhatsApp */
.glass-table-wrapper .whatsapp_aviso {
    background: rgba(37, 211, 102, 0.15) !important;
    border-color: rgba(37, 211, 102, 0.3) !important;
    color: #25d366 !important;
}

.glass-table-wrapper .whatsapp_aviso:hover {
    background: rgba(37, 211, 102, 0.3) !important;
    border-color: rgba(37, 211, 102, 0.5) !important;
    color: #4ade80 !important;
}

/* --- Info "Mostrando de X até Y" --- */
.glass-table-wrapper .dataTables_info {
    font-size: 0.8rem;
    color: #6b7280;
    padding-top: 12px;
}

/* --- Paginação --- */
.glass-table-wrapper .dataTables_paginate {
    padding-top: 12px;
}

.glass-table-wrapper .dataTables_paginate .paginate_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    margin: 0 3px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #9ca3af !important;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none !important;
}

.glass-table-wrapper .dataTables_paginate .paginate_button:hover {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #f87171 !important;
}

.glass-table-wrapper .dataTables_paginate .paginate_button.current {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    border-color: transparent !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.glass-table-wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* --- Processing indicator --- */
.glass-table-wrapper .dataTables_processing {
    background: rgba(15, 15, 20, 0.9) !important;
    color: #e5e7eb;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px 24px;
    font-size: 0.9rem;
}

/* --- Responsivo: collapse children --- */
.glass-table-wrapper table.dataTable.dtr-inline.collapsed>tbody>tr>td.dtr-control::before {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
    border-radius: 6px;
}

/* --- Custom scrollbar para overflow horizontal --- */
.glass-table-wrapper {
    overflow-x: auto;
}

.glass-table-wrapper::-webkit-scrollbar {
    height: 6px;
}

.glass-table-wrapper::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 3px;
}

.glass-table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(239, 68, 68, 0.3);
    border-radius: 3px;
}

.glass-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(239, 68, 68, 0.5);
}

/* =========================================
   Alertify — Tema Dark Glassmorphism
   ========================================= */

/* Dialog container */
.alertify .ajs-dialog {
    background: rgba(20, 20, 30, 0.95) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 1px rgba(255, 255, 255, 0.1) !important;
    color: #e5e7eb !important;
    overflow: hidden;
}

/* Header */
.alertify .ajs-header {
    background: rgba(255, 255, 255, 0.04) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: white !important;
    font-weight: 700 !important;
    padding: 16px 20px !important;
    border-radius: 16px 16px 0 0 !important;
}

/* Body */
.alertify .ajs-body {
    color: #d1d5db !important;
}

.alertify .ajs-body .ajs-content {
    color: #d1d5db !important;
    padding: 20px !important;
}

/* Textarea dentro do dialog */
.alertify .ajs-body textarea,
.alertify .ajs-body .form-control {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 10px !important;
    color: #e5e7eb !important;
    padding: 12px !important;
    font-size: 0.9rem !important;
}

.alertify .ajs-body textarea:focus,
.alertify .ajs-body .form-control:focus {
    border-color: rgba(5, 117, 230, 0.5) !important;
    box-shadow: 0 0 0 2px rgba(5, 117, 230, 0.15) !important;
    outline: none !important;
}

/* Select/input dentro do dialog */
.alertify .ajs-body select.form-control {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 10px !important;
    color: #e5e7eb !important;
    padding: 8px 12px !important;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 16px;
}

/* Texto dentro do dialog */
.alertify .ajs-body p,
.alertify .ajs-body strong,
.alertify .ajs-body label {
    color: #d1d5db !important;
}

.alertify .ajs-body strong {
    color: white !important;
}

.alertify .ajs-body hr {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Footer */
.alertify .ajs-footer {
    background: rgba(255, 255, 255, 0.03) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 12px 20px !important;
    border-radius: 0 0 16px 16px !important;
}

/* Botões */
.alertify .ajs-footer .ajs-buttons .ajs-button {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 8px !important;
    color: #d1d5db !important;
    padding: 8px 18px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    transition: all 0.2s !important;
    cursor: pointer !important;
}

.alertify .ajs-footer .ajs-buttons .ajs-button:hover {
    background: rgba(5, 117, 230, 0.2) !important;
    border-color: rgba(5, 117, 230, 0.4) !important;
    color: white !important;
}

/* Botão OK/Primary */
.alertify .ajs-footer .ajs-buttons .ajs-button.ajs-ok {
    background: linear-gradient(135deg, #0575e6, #00b4d8) !important;
    border: none !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(5, 117, 230, 0.3) !important;
}

.alertify .ajs-footer .ajs-buttons .ajs-button.ajs-ok:hover {
    box-shadow: 0 4px 12px rgba(5, 117, 230, 0.5) !important;
    transform: translateY(-1px);
}

/* Botão Cancel */
.alertify .ajs-footer .ajs-buttons .ajs-button.ajs-cancel {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #f87171 !important;
}

.alertify .ajs-footer .ajs-buttons .ajs-button.ajs-cancel:hover {
    background: rgba(239, 68, 68, 0.3) !important;
}

@media (max-width: 575.98px) {
    .alertify .ajs-footer {
        padding: 10px 12px !important;
    }

    .alertify .ajs-footer .ajs-buttons.ajs-primary,
    .alertify .ajs-footer .ajs-buttons {
        display: flex !important;
        gap: 8px !important;
        width: 100% !important;
        flex-wrap: nowrap !important;
        text-align: initial !important;
    }

    .alertify .ajs-footer .ajs-buttons .ajs-button {
        width: 100% !important;
        flex: 1 1 0 !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0.72rem 0.45rem !important;
        font-size: 0.8rem !important;
        line-height: 1.1 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .alertify .ajs-footer .ajs-buttons .ajs-button:only-child {
        flex-basis: 100% !important;
    }

    .modal-footer {
        display: flex !important;
        gap: 8px !important;
        justify-content: stretch !important;
        flex-wrap: nowrap !important;
    }

    .modal-footer > .btn {
        width: 100% !important;
        flex: 1 1 0 !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding-left: 0.55rem !important;
        padding-right: 0.55rem !important;
        font-size: 0.82rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .modal-footer > .btn:only-child {
        flex-basis: 100% !important;
    }

    .swal2-actions {
        display: flex !important;
        gap: 8px !important;
        width: 100% !important;
        padding: 0 0.25rem !important;
        flex-wrap: nowrap !important;
    }

    .swal2-actions > button {
        width: 100% !important;
        flex: 1 1 0 !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0.72rem 0.45rem !important;
        font-size: 0.82rem !important;
        line-height: 1.1 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .swal2-actions > button:only-child {
        flex-basis: 100% !important;
    }

    [id^="modal"] .border-t.flex.justify-end.gap-3,
    [id^="modal"] .border-t.flex.justify-end.gap-4 {
        justify-content: stretch !important;
        gap: 8px !important;
        flex-wrap: nowrap !important;
    }

    [id^="modal"] .border-t.flex.justify-end.gap-3 > button,
    [id^="modal"] .border-t.flex.justify-end.gap-4 > button {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        padding-left: 0.55rem !important;
        padding-right: 0.55rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
}

/* Dimmer/overlay */
.alertify .ajs-dimmer {
    background: rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(4px);
}

/* Close/resize buttons */
.alertify .ajs-close,
.alertify .ajs-maximize,
.alertify .ajs-reset {
    color: #9ca3af !important;
}

.alertify .ajs-close:hover {
    color: white !important;
}

/* =========================================
   Modal Recado — Estilos de conteúdo
   ========================================= */
#modal-recado-conteudo {
    font-size: 0.9rem;
    line-height: 1.7;
}

#modal-recado-conteudo p {
    margin-bottom: 0.75em;
}

#modal-recado-conteudo a {
    color: #60a5fa;
    text-decoration: underline;
}

#modal-recado-conteudo a:hover {
    color: #93c5fd;
}

#modal-recado-conteudo img {
    max-width: 100%;
    border-radius: 8px;
    margin: 8px 0;
}

.recado-modal-card {
    border-left-color: rgba(96, 165, 250, 0.78) !important;
}

.recado-card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    width: 100%;
    margin-left: auto;
}

.recado-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 32px;
    padding: 0.42rem 0.78rem;
    border: 1px solid rgba(96, 165, 250, 0.28);
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.10);
    color: #bfdbfe;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.recado-action-button:hover,
.recado-action-button:focus {
    background: rgba(96, 165, 250, 0.22);
    border-color: rgba(147, 197, 253, 0.65);
    color: #eff6ff;
    outline: none;
}

.recado-action-open {
    background: rgba(59, 130, 246, 0.16);
    border-color: rgba(147, 197, 253, 0.45);
    color: #dbeafe;
}

.recado-action-copy {
    background: rgba(30, 41, 59, 0.70);
}

@media (min-width: 640px) {
    .recado-card-actions {
        width: auto;
    }
}

.copy-aware-content,
.copy-rich-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.g3-copy-modal-content {
    width: 100%;
    max-height: min(56vh, 430px);
    overflow-y: auto;
    padding: 0.85rem;
    border: 1px solid rgba(96, 165, 250, 0.22);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.55);
    box-sizing: border-box;
}

.g3-copy-modal-content.copy-aware-content,
.g3-copy-modal-content .copy-aware-content {
    color: #e5e7eb;
    font-size: 0.88rem;
    line-height: 1.65;
}

.g3-copy-monospace {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.copy-snippet-block {
    margin: 0.85rem 0;
    padding: 0.9rem;
    border: 1px solid rgba(96, 165, 250, 0.22);
    border-left: 3px solid rgba(96, 165, 250, 0.78);
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.055);
}

.copy-snippet-block:first-child {
    margin-top: 0;
}

.copy-snippet-block:last-child {
    margin-bottom: 0;
}

.copy-snippet-text {
    color: #e5e7eb;
}

.copy-snippet-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.75rem;
}

.copy-segment-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 32px;
    padding: 0.45rem 0.75rem;
    border: 1px solid rgba(96, 165, 250, 0.34);
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.14);
    color: #bfdbfe;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.copy-segment-button:hover,
.copy-segment-button:focus {
    background: rgba(96, 165, 250, 0.28);
    border-color: rgba(147, 197, 253, 0.72);
    color: #eff6ff;
    outline: none;
}

#modal-recado-copy.modal-copy-all {
    background: rgba(59, 130, 246, 0.14) !important;
    border-color: rgba(147, 197, 253, 0.55) !important;
    color: #dbeafe !important;
}

#modal-recado-copy.modal-copy-all:hover,
#modal-recado-copy.modal-copy-all:focus {
    background: rgba(96, 165, 250, 0.28) !important;
    border-color: rgba(191, 219, 254, 0.85) !important;
    color: #eff6ff !important;
    outline: none;
}

.copy-segment-button.is-copied,
.copiar_recado.is-copied,
.copiar_regra.is-copied,
#modal-recado-copy.is-copied {
    background: rgba(34, 197, 94, 0.18) !important;
    border-color: rgba(34, 197, 94, 0.35) !important;
    color: #86efac !important;
}

.g3-copy-segment-button.is-copied,
#cn-ok-btn.is-copied {
    background: rgba(34, 197, 94, 0.18) !important;
    border-color: rgba(34, 197, 94, 0.35) !important;
    color: #86efac !important;
}

.copiar_recado:disabled,
.copiar_regra:disabled,
#modal-recado-copy:disabled {
    pointer-events: none;
}

@media (max-width: 640px) {
    .g3-copy-modal-content {
        max-height: 52vh;
        padding: 0.75rem;
    }

    .copy-snippet-actions {
        justify-content: stretch;
    }

    .copy-segment-button {
        width: 100%;
    }
}

/* --- Select / Dropdown Dark Theme (global v2) --- */
select option {
    background: #1e293b !important;
    color: #e5e7eb !important;
}

select option:hover,
select option:checked {
    background: #3b82f6 !important;
    color: #fff !important;
}

/* ============================== */
/* Glass DataTable Theme (v2)     */
/* ============================== */

/* Table base */
.glass-datatable {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    width: 100% !important;
}

.glass-datatable thead th {
    background: rgba(255, 255, 255, 0.03) !important;
    color: #9ca3af !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    padding: 14px 16px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-top: none !important;
    white-space: nowrap !important;
}

.glass-datatable tbody tr {
    background: transparent !important;
    transition: all 0.15s ease !important;
}

.glass-datatable tbody tr:hover {
    background: rgba(255, 255, 255, 0.03) !important;
}

.glass-datatable tbody td {
    color: #e5e7eb !important;
    font-size: 0.85rem !important;
    padding: 12px 16px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
    border-top: none !important;
    vertical-align: middle !important;
}

/* Stripe alternation */
.glass-datatable tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.015) !important;
}

/* Pagination Buttons (Global override for .glass-table-wrapper context) */
.glass-table-wrapper .dataTables_paginate .paginate_button {
    padding: 6px 12px !important;
    margin: 0 2px !important;
    border-radius: 8px !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: transparent !important;
    color: #9ca3af !important;
    font-size: 0.8rem !important;
    transition: all 0.15s !important;
    cursor: pointer !important;
}

.glass-table-wrapper .dataTables_paginate .paginate_button:hover {
    background: rgba(96, 165, 250, 0.15) !important;
    color: #60a5fa !important;
    border-color: rgba(96, 165, 250, 0.3) !important;
}

.glass-table-wrapper .dataTables_paginate .paginate_button.current {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6) !important;
    color: #fff !important;
    border-color: transparent !important;
    font-weight: 600 !important;
}

.glass-table-wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.3 !important;
    cursor: default !important;
}

/* Processing indicator */
.dataTables_processing {
    background: rgba(15, 23, 42, 0.95) !important;
    color: #60a5fa !important;
    border: 1px solid rgba(96, 165, 250, 0.2) !important;
    border-radius: 12px !important;
    padding: 16px 24px !important;
    font-size: 0.85rem !important;
    z-index: 50 !important;
}

/* Force dtr-control (Plus/Minus icon) visibility — supports both inline and column modes */
table.dataTable td.dtr-control,
table.dataTable th.dtr-control {
    position: relative;
    padding-left: 30px !important;
    cursor: pointer;
}

table.dataTable td.dtr-control:before,
table.dataTable th.dtr-control:before {
    top: 50%;
    left: 5px;
    height: 14px;
    width: 14px;
    margin-top: -7px;
    display: block;
    position: absolute;
    color: white;
    border: 2px solid white;
    border-radius: 14px;
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.4);
    box-sizing: content-box;
    text-align: center;
    text-indent: 0 !important;
    font-family: 'Courier New', Courier, monospace;
    line-height: 14px;
    content: '+';
    background-color: #3b82f6;
}

table.dataTable tr.dtr-expanded td.dtr-control:before,
table.dataTable tr.parent td.dtr-control:before,
table.dataTable tr.dtr-expanded th.dtr-control:before,
table.dataTable tr.parent th.dtr-control:before {
    content: '-';
    background-color: #d33333;
    box-shadow: 0 0 6px rgba(211, 51, 51, 0.4);
}

/* Hide control column header text */
table.dataTable thead th.dtr-control {
    font-size: 0;
}

/* =========================================
   Bootstrap text-colors restaurados (Tailwind CDN sobrescreve)
   Afeta: indicadores de status em tabelas v2
   (gerador_evolution, revendedores, etc.)
   ========================================= */
.text-success,
i.text-success,
span.text-success {
    color: #28a745 !important;
}

.text-danger,
i.text-danger,
span.text-danger {
    color: #dc3545 !important;
}

.text-warning,
i.text-warning,
span.text-warning {
    color: #ffc107 !important;
}

.text-info,
i.text-info,
span.text-info {
    color: #17a2b8 !important;
}

.text-muted,
i.text-muted,
span.text-muted {
    color: #6c757d !important;
}

/* Bolinha de status — fa-circle com tamanho menor e alinhamento vertical */
i.fa-circle {
    font-size: 0.6rem;
    vertical-align: middle;
    margin-right: 5px;
}

/* =========================================
   Tooltip customizado para botões v2
   ========================================= */
.btn2-tooltip {
    background: rgba(15, 15, 25, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 7px;
    pointer-events: none;
    white-space: normal;
    word-break: break-word;
    max-width: min(320px, 90vw);
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    animation: tooltipFadeIn 0.12s ease;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.01em;
    line-height: 1.4;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(3px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   Alertify — Largura mínima e alinhamento
   ========================================= */
.alertify .ajs-dialog {
    min-width: 420px !important;
    max-width: 600px !important;
    width: auto !important;
}

@media (max-width: 500px) {
    .alertify .ajs-dialog {
        min-width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px) !important;
    }
}

/* Garante que os elementos dentro do content não transbordem */
.alertify .ajs-body .ajs-content>div,
.alertify .ajs-body .ajs-content form {
    width: 100% !important;
    box-sizing: border-box !important;
}

.alertify .ajs-body .ajs-content input[type="text"],
.alertify .ajs-body .ajs-content input[type="number"],
.alertify .ajs-body .ajs-content select,
.alertify .ajs-body .ajs-content textarea {
    width: 100% !important;
    box-sizing: border-box !important;
}

/* =========================================
   Action Toolbar — Botões de Ações Rápidas (v2)
   Clientes : .action-toolbar > div.action   > buttons
   Revendedores: .action-toolbar > div.action > div.actions > buttons
   Desktop: 40×40px, gap: 10px
   Mobile : 44×44px, gap: 12px
   ========================================= */

/* Wrapper externo */
.action-toolbar {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Container intermediário (JS injeta div.action) — vira flex */
.action-toolbar .action {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Container PHP dos revendedores (div.actions text-center) — também flex */
.action-toolbar .actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 0 !important;
    margin: 0 !important;
    text-align: left !important;
}

/* Zera margens Bootstrap em TODOS os descendentes
   (PHP injeta mr-2, ml-1 etc. que conflitam com gap) */
.action-toolbar .action>*,
.action-toolbar .action>*>*,
.action-toolbar .actions>*,
.action-toolbar .actions>*>* {
    margin: 0 !important;
}

/* ── Reset total + tamanho fixo em TODOS os botões ── */
.action-toolbar .action>a,
.action-toolbar .action>button,
.action-toolbar .action .btn,
.action-toolbar .actions>a,
.action-toolbar .actions>button,
.action-toolbar .actions .btn {
    /* Tamanho */
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
    margin: 0 !important;

    /* Layout interno */
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    /* Visual */
    border-radius: 10px !important;
    font-size: 14px !important;
    line-height: 1 !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    background: rgba(255, 255, 255, 0.07) !important;
    color: #cbd5e1 !important;
    cursor: pointer !important;
    text-decoration: none !important;
    transition: background 0.15s, border-color 0.15s, transform 0.12s, color 0.15s !important;
    box-shadow: none !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
}

/* ── Hover — desktop ── */
.action-toolbar .action>a:hover,
.action-toolbar .action>button:hover,
.action-toolbar .action .btn:hover,
.action-toolbar .actions>a:hover,
.action-toolbar .actions>button:hover,
.action-toolbar .actions .btn:hover {
    background: rgba(255, 255, 255, 0.14) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    color: #fff !important;
    transform: translateY(-1px) !important;
}

/* ══════════════════════════════════════════
   VARIANTES DE COR — Clientes
══════════════════════════════════════════ */

/* Renovar — verde */
.action-toolbar .renovar_cliente {
    background: rgba(16, 185, 129, 0.12) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
    color: #6ee7b7 !important;
}

.action-toolbar .renovar_cliente:hover {
    background: rgba(16, 185, 129, 0.25) !important;
    border-color: rgba(16, 185, 129, 0.5) !important;
    color: #a7f3d0 !important;
}

/* Excluir cliente — vermelho */
.action-toolbar .excluir_cliente {
    background: rgba(239, 68, 68, 0.12) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #fca5a5 !important;
}

.action-toolbar .excluir_cliente:hover {
    background: rgba(239, 68, 68, 0.25) !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
    color: #fecaca !important;
}

/* Banir / Desbanir — laranja */
.action-toolbar .banirDesbanir_cliente {
    background: rgba(249, 115, 22, 0.12) !important;
    border-color: rgba(249, 115, 22, 0.3) !important;
    color: #fdba74 !important;
}

.action-toolbar .banirDesbanir_cliente:hover {
    background: rgba(249, 115, 22, 0.25) !important;
    border-color: rgba(249, 115, 22, 0.5) !important;
}

/* Bloquear/Desbloquear cliente — amarelo */
.action-toolbar .blockDesblock_cliente {
    background: rgba(250, 204, 21, 0.10) !important;
    border-color: rgba(250, 204, 21, 0.3) !important;
    color: #fde68a !important;
}

.action-toolbar .blockDesblock_cliente:hover {
    background: rgba(250, 204, 21, 0.22) !important;
    border-color: rgba(250, 204, 21, 0.5) !important;
}

/* Link de Pagamento — azul */
.action-toolbar .gerar_link_pagamento {
    background: rgba(59, 130, 246, 0.12) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
    color: #93c5fd !important;
}

.action-toolbar .gerar_link_pagamento:hover {
    background: rgba(59, 130, 246, 0.25) !important;
    border-color: rgba(59, 130, 246, 0.5) !important;
}

/* ══════════════════════════════════════════
   VARIANTES DE COR — Revendedores
══════════════════════════════════════════ */

/* Créditos — verde esmeralda */
.action-toolbar .credito_revendedor {
    background: rgba(16, 185, 129, 0.12) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
    color: #6ee7b7 !important;
}

.action-toolbar .credito_revendedor:hover {
    background: rgba(16, 185, 129, 0.25) !important;
    border-color: rgba(16, 185, 129, 0.5) !important;
    color: #a7f3d0 !important;
}

/* Detalhes — azul */
.action-toolbar .detalhes_revendedor {
    background: rgba(59, 130, 246, 0.12) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
    color: #93c5fd !important;
}

.action-toolbar .detalhes_revendedor:hover {
    background: rgba(59, 130, 246, 0.25) !important;
    border-color: rgba(59, 130, 246, 0.5) !important;
}

/* Bloquear/Desbloquear revendedor — amarelo */
.action-toolbar .blockDesblock_revendedor {
    background: rgba(250, 204, 21, 0.10) !important;
    border-color: rgba(250, 204, 21, 0.3) !important;
    color: #fde68a !important;
}

.action-toolbar .blockDesblock_revendedor:hover {
    background: rgba(250, 204, 21, 0.22) !important;
    border-color: rgba(250, 204, 21, 0.5) !important;
}

/* Excluir revendedor — vermelho */
.action-toolbar .excluir_revendedor {
    background: rgba(239, 68, 68, 0.12) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #fca5a5 !important;
}

.action-toolbar .excluir_revendedor:hover {
    background: rgba(239, 68, 68, 0.25) !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
    color: #fecaca !important;
}

/* Restaurar revendedor — teal/ciano */
.action-toolbar .restaurar_revendedor {
    background: rgba(20, 184, 166, 0.12) !important;
    border-color: rgba(20, 184, 166, 0.3) !important;
    color: #5eead4 !important;
}

.action-toolbar .restaurar_revendedor:hover {
    background: rgba(20, 184, 166, 0.25) !important;
    border-color: rgba(20, 184, 166, 0.5) !important;
}

/* ══════════════════════════════════════════
   RESPONSIVO — Mobile (≤768px)
   Botões maiores para toque com dedos
══════════════════════════════════════════ */
@media (max-width: 768px) {

    .action-toolbar .action,
    .action-toolbar .actions {
        gap: 12px !important;
    }

    .action-toolbar .action>a,
    .action-toolbar .action>button,
    .action-toolbar .action .btn,
    .action-toolbar .actions>a,
    .action-toolbar .actions>button,
    .action-toolbar .actions .btn {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        border-radius: 12px !important;
        font-size: 15px !important;
    }
}

/* Renovação de confiança — aperto de mãos em ciano */
.action .renovacao_confianca_cliente,
.action-toolbar .renovacao_confianca_cliente {
    background: rgba(6, 182, 212, 0.12) !important;
    border-color: rgba(6, 182, 212, 0.32) !important;
    color: #67e8f9 !important;
}

.action .renovacao_confianca_cliente:hover,
.action-toolbar .renovacao_confianca_cliente:hover {
    background: rgba(6, 182, 212, 0.25) !important;
    border-color: rgba(6, 182, 212, 0.55) !important;
    color: #cffafe !important;
}

/* Ajuste proporcional da data — calendário em violeta */
.action .ajustar_vencimento_cliente,
.action-toolbar .ajustar_vencimento_cliente {
    background: rgba(139, 92, 246, 0.12) !important;
    border-color: rgba(139, 92, 246, 0.32) !important;
    color: #c4b5fd !important;
}

.action .ajustar_vencimento_cliente:hover,
.action-toolbar .ajustar_vencimento_cliente:hover {
    background: rgba(139, 92, 246, 0.25) !important;
    border-color: rgba(139, 92, 246, 0.55) !important;
    color: #ede9fe !important;
}
/* ================================================================
   Home (/home.php) — otimização de rolagem (evita jitter de texto)
   ================================================================ */

.is-scrollable {
    overflow-anchor: none;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
    contain: layout paint;
    will-change: scroll-position;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Títulos estáveis no fluxo visual durante rolagem */
.is-scrollable h1,
.is-scrollable h2,
.is-scrollable h3,
.is-scrollable h4,
.is-scrollable h5,
.is-scrollable .section-title {
    text-rendering: optimizeLegibility;
    will-change: transform, color;
}

/* Menor custo de repintura no dashboard da home */
.is-scrollable .glass-card {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition-property: color, background-color, border-color, opacity, box-shadow;
}

.is-scrollable .glass-card:hover {
    transform: translateZ(0);
}

/* Home: cards de métricas mantêm texto e ícone em áreas independentes. */
.g3-metric-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}

.g3-metric-card {
    position: relative;
    min-width: 0;
    min-height: 7.5rem;
    padding-right: 5.5rem !important;
}

.g3-metric-copy {
    width: 100%;
    min-width: 0;
}

.g3-metric-label {
    max-width: 100%;
    line-height: 1.25;
    overflow-wrap: normal;
    word-break: normal;
}

.g3-metric-value {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transform: none !important;
}

.g3-metric-icon {
    position: absolute;
    z-index: 10;
    top: 50%;
    right: 1.25rem;
    width: 3rem;
    height: 3rem;
    min-width: 3rem;
    min-height: 3rem;
    aspect-ratio: 1 / 1;
    flex: 0 0 3rem;
    flex-shrink: 0;
    border-radius: 50%;
    transform: translateY(-50%);
}

@media (min-width: 640px) {
    .g3-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .g3-metric-grid--iptv {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .g3-metric-grid--p2p {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1800px) {
    .g3-metric-grid--iptv {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

/* ================================================================
   G3 Unified Shell - fundo unico, rodapes alinhados e dropdown seguro
   ================================================================ */
:root {
    --g3-shell-footer-height: 80px;
    --g3-shell-border: rgba(55, 65, 81, 0.72);
}

.g3-unified-surface {
    background-color: #000;
    min-height: 100vh;
}

.g3-unified-surface > main,
.g3-unified-surface > footer,
.g3-unified-main {
    background: transparent !important;
}

.g3-unified-main {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding-bottom: 0 !important;
}

.g3-sidebar-footer {
    min-height: var(--g3-shell-footer-height);
    padding: 1rem !important;
    border-top-color: var(--g3-shell-border) !important;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.g3-sidebar-footer > a {
    width: 100%;
}

.profile-dropdown-menu {
    background: rgba(15, 23, 42, 0.98) !important;
    z-index: 70 !important;
}

/* Telas legadas Bootstrap ainda acessiveis fora do shell V2. */
body[data-topbar="colored"] .main-content {
    background:
        radial-gradient(ellipse at 85% 30%, rgba(0, 180, 216, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 70%, rgba(5, 117, 230, 0.10) 0%, transparent 55%),
        radial-gradient(circle at 90% 50%, rgb(0, 20, 40) 0%, rgb(0, 0, 0) 75%);
    min-height: 100vh;
}

body[data-topbar="colored"] .page-content,
body[data-topbar="colored"] .page-content-wrapper {
    background: transparent !important;
}

@media (max-width: 767px) {
    :root {
        --g3-shell-footer-height: 72px;
    }

}

/* Implementação histórica do shell. Mantida temporariamente para referência,
   mas desativada: g3-navigation.css é a única fonte visual do menu novo. */
@media not all {
/* ================================================================
   G3 Sidebar Shell - inspirado no blueprint XPlay, com tema Gestor3
   ================================================================ */
:root {
    --shell-sidebar-collapsed: 5.25rem;
    --shell-sidebar-expanded: 16.75rem;
    --shell-sidebar-mobile: min(18rem, calc(100vw - 1.5rem));
    --shell-sidebar-bg: linear-gradient(180deg, rgba(8, 12, 24, 0.98) 0%, rgba(6, 10, 20, 0.99) 100%);
    --shell-topbar-bg: rgba(17, 24, 39, 0.9);
    --shell-border: rgba(55, 65, 81, 0.72);
    --shell-control-bg: rgba(255, 255, 255, 0.055);
    --shell-control-hover: rgba(59, 130, 246, 0.14);
    --shell-nav-text: #cbd5e1;
    --shell-nav-muted: #7f8da3;
    --shell-nav-active-bg: rgba(5, 117, 230, 0.18);
    --shell-nav-active-text: #ffffff;
    --focus-ring: rgba(96, 165, 250, 0.55);
    --shadow-float: 0 22px 60px rgba(0, 0, 0, 0.52), 0 0 0 1px rgba(96, 165, 250, 0.12);
}

#sidebar {
    width: var(--shell-sidebar-expanded) !important;
    min-width: var(--shell-sidebar-expanded) !important;
    max-width: var(--shell-sidebar-expanded) !important;
    background: var(--shell-sidebar-bg) !important;
    border-right: 1px solid var(--shell-border) !important;
    transition:
        transform 250ms ease,
        width 250ms ease,
        min-width 250ms ease,
        max-width 250ms ease,
        opacity 180ms ease !important;
}

#sidebar a,
#sidebar button {
    outline: none;
}

#sidebar a:focus-visible,
#sidebar button:focus-visible,
.g3-sidebar-flyout a:focus-visible {
    box-shadow: 0 0 0 2px var(--focus-ring);
}

#sidebar .submenu-toggle[aria-expanded="true"],
#sidebar .submenu-toggle.active {
    color: var(--shell-nav-active-text) !important;
    background: var(--shell-nav-active-bg) !important;
}

#sidebar .submenu a {
    border-radius: 0.75rem;
    margin: 0.125rem 0.75rem;
    transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

#sidebar .submenu a:hover {
    transform: translateX(2px);
}

.bottom-nav-glass {
    display: none !important;
}

@media (max-width: 767px) {
    .bottom-nav-glass {
        display: flex !important;
        height: 4rem !important;
        min-height: 4rem !important;
        max-height: 4rem !important;
        padding-bottom: 0 !important;
        box-sizing: border-box;
        background: rgba(13, 13, 22, 0.85) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
    }

    .is-scrollable,
    main,
    .main-content,
    .page-content {
        padding-bottom: 5rem !important;
    }
}

.bottom-nav-fab-btn {
    width: 3.25rem;
    height: 3.25rem;
    background: linear-gradient(135deg, #0575e6 0%, #3b82f6 100%) !important;
    box-shadow: 0 0 0 3px rgba(13, 13, 22, 0.85), 0 4px 20px rgba(5, 117, 230, 0.45) !important;
}

.bottom-nav-fab-btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%) !important;
    box-shadow: 0 0 0 3px rgba(13, 13, 22, 0.85), 0 6px 24px rgba(5, 117, 230, 0.6) !important;
}

.bottom-nav-item.active,
.bottom-nav-item.active i {
    color: #3b82f6 !important;
}

.bottom-nav-item.active i {
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

.bottom-nav-item i {
    transition: transform 0.2s ease, color 0.2s ease;
}

.bottom-nav-item:active i {
    transform: scale(0.9);
}

.g3-sidebar-scroll-lock {
    overflow: hidden !important;
}

.g3-sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: block;
    border: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.g3-sidebar-overlay[hidden] {
    display: none !important;
}

@media (min-width: 768px) {
    #sidebar {
        position: relative !important;
        transform: none !important;
        opacity: 1 !important;
        overflow: hidden !important;
    }

    body.g3-sidebar-collapsed #sidebar,
    #sidebar.sidebar-collapsed {
        width: var(--shell-sidebar-collapsed) !important;
        min-width: var(--shell-sidebar-collapsed) !important;
        max-width: var(--shell-sidebar-collapsed) !important;
        opacity: 1 !important;
        overflow: visible !important;
    }

    body.g3-sidebar-collapsed #sidebar .h-20 {
        justify-content: center !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    body.g3-sidebar-collapsed #sidebar img {
        max-width: 2.7rem;
        object-fit: contain;
    }

    body.g3-sidebar-collapsed #sidebar .menu-title {
        height: 0;
        margin: 0;
        padding: 0 !important;
        opacity: 0;
        overflow: hidden;
        pointer-events: none;
    }

    body.g3-sidebar-collapsed #sidebar #side-menu > li > a {
        width: 3.25rem;
        min-height: 3.25rem;
        margin: 0.35rem auto;
        padding: 0 !important;
        justify-content: center !important;
        border-radius: 1rem;
        border-left: 0 !important;
    }

    body.g3-sidebar-collapsed #sidebar #side-menu > li > a > div {
        justify-content: center !important;
    }

    body.g3-sidebar-collapsed #sidebar #side-menu > li > a .w-8 {
        width: 3.25rem !important;
    }

    body.g3-sidebar-collapsed #sidebar ul > li > a {
        width: 3.25rem;
        min-height: 3.25rem;
        margin-left: auto;
        margin-right: auto;
        padding-left: 0 !important;
        padding-right: 0 !important;
        justify-content: center !important;
        border-radius: 1rem;
    }

    body.g3-sidebar-collapsed #sidebar ul > li > a > div {
        justify-content: center !important;
    }

    body.g3-sidebar-collapsed #sidebar #side-menu > li > a span,
    body.g3-sidebar-collapsed #sidebar #side-menu > li > a .fa-chevron-down,
    body.g3-sidebar-collapsed #sidebar ul > li > a span,
    body.g3-sidebar-collapsed #sidebar ul > li > a .fa-chevron-down {
        width: 0 !important;
        max-width: 0 !important;
        margin: 0 !important;
        opacity: 0 !important;
        overflow: hidden !important;
        pointer-events: none !important;
    }

    body.g3-sidebar-collapsed #sidebar .submenu {
        display: none !important;
    }

    body.g3-sidebar-collapsed #sidebar .g3-sidebar-footer a {
        width: 3.25rem;
        height: 3.25rem;
        padding: 0 !important;
        margin: 0 auto;
        border-radius: 1rem;
    }

    body.g3-sidebar-collapsed #sidebar .g3-sidebar-footer a span {
        white-space: nowrap;
    }

    body.g3-sidebar-collapsed #sidebar .g3-sidebar-footer a {
        font-size: 0;
    }

    body.g3-sidebar-collapsed #sidebar .g3-sidebar-footer a i {
        margin: 0 !important;
        font-size: 1rem;
    }
}

@media (max-width: 767px) {
    #sidebar {
        position: fixed !important;
        inset: 0 auto 0 0 !important;
        width: var(--shell-sidebar-mobile) !important;
        min-width: var(--shell-sidebar-mobile) !important;
        max-width: var(--shell-sidebar-mobile) !important;
        transform: translateX(-105%) !important;
        z-index: 60 !important;
        opacity: 1 !important;
        overflow: hidden !important;
    }

    body.g3-mobile-sidebar-open #sidebar {
        transform: translateX(0) !important;
    }

    #sidebar.sidebar-collapsed {
        width: var(--shell-sidebar-mobile) !important;
        min-width: var(--shell-sidebar-mobile) !important;
        max-width: var(--shell-sidebar-mobile) !important;
    }
}

.g3-sidebar-flyout {
    position: fixed;
    z-index: 90;
    width: min(19rem, calc(100vw - 1.5rem));
    overflow: auto;
    padding: 0.7rem;
    color: var(--shell-nav-text);
    background: rgba(9, 15, 30, 0.98);
    border: 1px solid rgba(96, 165, 250, 0.18);
    border-radius: 1rem;
    box-shadow: var(--shadow-float);
    opacity: 0;
    transform: translateX(-4px) scale(0.98);
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease;
}

.g3-sidebar-flyout.is-open {
    opacity: 1;
    transform: translateX(0) scale(1);
    pointer-events: auto;
}

.g3-sidebar-flyout-arrow {
    position: absolute;
    left: -6px;
    width: 12px;
    height: 12px;
    background: rgba(9, 15, 30, 0.98);
    border-left: 1px solid rgba(96, 165, 250, 0.18);
    border-bottom: 1px solid rgba(96, 165, 250, 0.18);
    transform: rotate(45deg);
}

.g3-sidebar-flyout-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.55rem 0.75rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.g3-sidebar-flyout-icon {
    display: inline-flex;
    width: 2.25rem;
    height: 2.25rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.8rem;
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.14);
}

.g3-sidebar-flyout-head strong,
.g3-sidebar-flyout-head small {
    display: block;
}

.g3-sidebar-flyout-head strong {
    color: #fff;
    font-size: 0.9rem;
}

.g3-sidebar-flyout-head small {
    color: var(--shell-nav-muted);
    font-size: 0.72rem;
    margin-top: 0.1rem;
}

.g3-sidebar-flyout-list {
    display: grid;
    gap: 0.25rem;
    padding-top: 0.55rem;
}

.g3-sidebar-flyout-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.7rem;
    color: var(--shell-nav-text);
    border-radius: 0.75rem;
    text-decoration: none !important;
    transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.g3-sidebar-flyout-item:hover,
.g3-sidebar-flyout-item.is-active {
    color: #fff;
    background: rgba(59, 130, 246, 0.16);
}

.g3-sidebar-flyout-item:hover {
    transform: translateX(2px);
}

@media (prefers-reduced-motion: reduce) {
    #sidebar,
    .g3-sidebar-flyout,
    #sidebar .submenu a,
    .g3-sidebar-flyout-item {
        transition: none !important;
    }
}


/* G3 XPlay refinement overrides */
:root {
    --shell-solid-bg: #0f1724;
    --shell-page-popup-bg: #0f1724;
    --shell-flyout-border: rgba(59, 130, 246, 0.38);
}

@media (min-width: 768px) {
    body:not(.g3-sidebar-ready) #sidebar,
    body:not(.g3-sidebar-ready) #sidebar *,
    body:not(.g3-sidebar-ready) .g3-sidebar-flyout,
    body:not(.g3-sidebar-ready) .g3-system-content,
    body:not(.g3-sidebar-ready) main,
    body:not(.g3-sidebar-ready) header {
        transition: none !important;
        animation: none !important;
    }

    body:not(.g3-sidebar-expanded) #sidebar {
        width: var(--shell-sidebar-collapsed) !important;
        min-width: var(--shell-sidebar-collapsed) !important;
        max-width: var(--shell-sidebar-collapsed) !important;
        opacity: 1 !important;
        overflow: hidden auto !important;
    }

    body.g3-sidebar-expanded #sidebar {
        width: var(--shell-sidebar-expanded) !important;
        min-width: var(--shell-sidebar-expanded) !important;
        max-width: var(--shell-sidebar-expanded) !important;
        opacity: 1 !important;
    }

    body:not(.g3-sidebar-expanded) #sidebar #side-menu > li > a,
    body:not(.g3-sidebar-expanded) #sidebar ul > li > a {
        width: 3.25rem !important;
        min-height: 3.25rem !important;
        justify-content: center !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    body:not(.g3-sidebar-expanded) #sidebar #side-menu > li > a > div,
    body:not(.g3-sidebar-expanded) #sidebar ul > li > a > div {
        margin: 0 !important;
    }

    body:not(.g3-sidebar-expanded) #sidebar #side-menu > li > a span,
    body:not(.g3-sidebar-expanded) #sidebar #side-menu > li > a .fa-chevron-down,
    body:not(.g3-sidebar-expanded) #sidebar ul > li > a span,
    body:not(.g3-sidebar-expanded) #sidebar ul > li > a .fa-chevron-down,
    body:not(.g3-sidebar-expanded) #sidebar .menu-title,
    body:not(.g3-sidebar-expanded) #sidebar .g3-sidebar-footer a span {
        display: none !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    body:not(.g3-sidebar-expanded) #sidebar .submenu {
        display: none !important;
    }
}

#sidebar,
#sidebar > *,
.g3-sidebar-flyout,
.g3-sidebar-flyout::before,
.g3-sidebar-flyout-arrow {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

#sidebar {
    background: var(--shell-solid-bg) !important;
}

.g3-sidebar-flyout {
    overflow: visible !important;
    isolation: isolate;
    background: var(--shell-page-popup-bg) !important;
    border-color: var(--shell-flyout-border) !important;
    box-shadow: 0 26px 74px rgba(0, 0, 0, 0.56) !important;
}

.g3-sidebar-flyout-arrow {
    position: absolute !important;
    z-index: -1;
    display: block !important;
    width: 1rem !important;
    height: 1rem !important;
    left: -0.5rem !important;
    top: 1.85rem !important;
    background: var(--shell-page-popup-bg) !important;
    border-left: 1px solid var(--shell-flyout-border) !important;
    border-bottom: 1px solid var(--shell-flyout-border) !important;
    border-radius: 0.22rem !important;
    transform: rotate(45deg) !important;
    box-shadow: -9px 9px 24px rgba(0, 0, 0, 0.32) !important;
}

.g3-sidebar-flyout-head,
.g3-sidebar-flyout-list {
    position: relative;
    z-index: 1;
}

.g3-sidebar-flyout.is-title-only {
    min-width: 15.5rem;
}

.g3-sidebar-flyout.is-title-only .g3-sidebar-flyout-head {
    border-bottom: 0 !important;
    padding-bottom: 1rem;
}

.g3-sidebar-flyout.is-title-only .g3-sidebar-flyout-list {
    display: none !important;
}
/* End G3 XPlay refinement overrides */
}
