/* ============================================================
   gg-admin.css – Estilos Visuais do Painel Admin GG (Vanilla CSS)
   ============================================================ */

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

:root {
    --bg-primary: #0a0915;
    --bg-secondary: #121124;
    --bg-surface: rgba(22, 21, 43, 0.7);
    --bg-glass: rgba(18, 17, 36, 0.6);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-active: rgba(99, 102, 241, 0.35);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --brand-primary: #6366f1; /* Indigo */
    --brand-secondary: #3f3dbc; /* G2G Brand Blue */
    --brand-gradient: linear-gradient(135deg, #6366f1 0%, #3f3dbc 100%);
    --brand-glow: rgba(99, 102, 241, 0.25);
    
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --sidebar-width: 260px;
    --header-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(63, 61, 188, 0.1) 0%, transparent 45%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================================
   Layout Principal (Sidebar + Main Content)
   ============================================================ */
.gg-layout-wrapper {
    display: flex;
    min-height: 100vh;
}

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

.gg-sidebar-logo {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-glass);
}

.gg-sidebar-logo img {
    height: 38px;
    width: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
}

.gg-sidebar-logo span {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(to right, #ffffff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gg-sidebar-menu {
    flex: 1;
    padding: 24px 16px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

.gg-sidebar-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.gg-sidebar-item a i {
    font-size: 18px;
}

.gg-sidebar-item a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
    transform: translateX(4px);
}

.gg-sidebar-item.active a {
    color: #ffffff;
    background: var(--brand-gradient);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
}

.gg-sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-glass);
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Área de Conteúdo Principal */
.gg-main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition-normal);
}

/* Cabeçalho */
.gg-header {
    height: var(--header-height);
    background: rgba(18, 17, 36, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-glass);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
}

.gg-header-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.gg-header-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.gg-user-info {
    text-align: right;
}

.gg-user-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.gg-user-role {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--brand-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gg-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--brand-gradient);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    border: 2px solid var(--border-glass);
    box-shadow: var(--shadow-sm);
}

.gg-btn-logout {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition-fast);
}

.gg-btn-logout:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.08);
}

/* Corpo da Página */
.gg-page-body {
    flex: 1;
    padding: 32px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* ============================================================
   Componentes Visuais
   ============================================================ */

/* Glass Cards */
.gg-card {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.gg-card:hover {
    border-color: var(--border-glass-active);
}

/* Dashboard Grid */
.gg-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.gg-stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gg-stat-info h3 {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.gg-stat-info .value {
    font-size: 28px;
    font-weight: 800;
    color: #ffffff;
}

.gg-stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: var(--shadow-sm);
}

.gg-stat-icon.primary { background: rgba(99, 102, 241, 0.12); color: var(--brand-primary); }
.gg-stat-icon.success { background: rgba(16, 185, 129, 0.12); color: var(--success); }
.gg-stat-icon.danger  { background: rgba(239, 68, 68, 0.12); color: var(--danger); }
.gg-stat-icon.warning { background: rgba(245, 158, 11, 0.12); color: var(--warning); }

/* Form Controls */
.gg-form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gg-form-group label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gg-input, .gg-select, .gg-textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2) !important;
    border: 1px solid var(--border-glass) !important;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    color: #ffffff !important;
    outline: none;
    transition: var(--transition-fast);
}

.gg-input:focus, .gg-select:focus, .gg-textarea:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18) !important;
    background: rgba(0, 0, 0, 0.3) !important;
}

.gg-textarea {
    resize: vertical;
    min-height: 100px;
}

.gg-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Switch */
.gg-switch-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.gg-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.gg-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.gg-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .3s;
    border-radius: 34px;
    border: 1px solid var(--border-glass);
}

.gg-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .gg-slider {
    background-color: var(--brand-primary);
}

input:checked + .gg-slider:before {
    transform: translateX(20px);
}

/* Botões */
.gg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
}

.gg-btn-primary {
    background: var(--brand-gradient);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.gg-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.gg-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-glass);
    color: var(--text-primary);
}

.gg-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.gg-btn-danger {
    background: var(--danger);
    color: #ffffff;
}

.gg-btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.gg-btn-icon {
    padding: 8px;
    border-radius: 8px;
    font-size: 16px;
}

.gg-btn-xs {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

/* Tabelas */
.gg-table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-glass);
}

.gg-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
    background: rgba(18, 17, 36, 0.2);
}

.gg-table th {
    background: rgba(0, 0, 0, 0.25);
    padding: 16px 20px;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-glass);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.gg-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-glass);
    color: var(--text-secondary);
}

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

.gg-table tr:hover td {
    background: rgba(255, 255, 255, 0.015);
    color: var(--text-primary);
}

/* Badges */
.gg-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gg-tag-success { background: rgba(16, 185, 129, 0.12); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }
.gg-tag-danger  { background: rgba(239, 68, 68, 0.12); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }
.gg-tag-warning { background: rgba(245, 158, 11, 0.12); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.2); }
.gg-tag-info    { background: rgba(6, 182, 212, 0.12); color: var(--info); border: 1px solid rgba(6, 182, 212, 0.2); }
.gg-tag-purple  { background: rgba(139, 92, 246, 0.12); color: #8b5cf6; border: 1px solid rgba(139, 92, 246, 0.2); }

/* Modals */
.gg-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.gg-modal.active {
    display: flex;
    opacity: 1;
}

.gg-modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass-active);
    box-shadow: var(--shadow-lg);
    border-radius: 20px;
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    animation: ggModalSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.gg-modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gg-modal-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
}

.gg-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: var(--transition-fast);
}

.gg-modal-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.gg-modal-body {
    padding: 24px;
}

.gg-modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-glass);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: rgba(0, 0, 0, 0.1);
}

/* ============================================================
   Telas Específicas
   ============================================================ */

/* Tela de Login */
.gg-login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(circle at center, #111026 0%, #06050e 70%, #020205 100%);
}

.gg-login-card {
    width: 100%;
    max-width: 440px;
    background: rgba(18, 17, 36, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.gg-login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
}

.gg-login-logo img {
    height: 64px;
    width: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(99, 102, 241, 0.4);
    filter: drop-shadow(0 8px 16px rgba(99, 102, 241, 0.3));
}

.gg-login-logo h1 {
    font-size: 24px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.gg-login-logo p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Cabeçalho da Seção com Ações (ex: Adicionar Novo) */
.gg-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.gg-section-title h2 {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
}

.gg-section-title p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Grid de Listagem de Cards (Mensagens/Fluxos) */
.gg-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.gg-item-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 20px;
    min-height: 190px;
}

.gg-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.gg-item-title h3 {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
}

.gg-item-title .subtitle {
    font-size: 11px;
    color: var(--brand-primary);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.gg-item-body {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    background: rgba(0, 0, 0, 0.15);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.02);
    flex: 1;
}

.gg-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border-glass);
    padding-top: 16px;
}

.gg-item-meta {
    display: flex;
    gap: 8px;
    font-size: 11px;
}

.gg-item-actions {
    display: flex;
    gap: 8px;
}

/* ============================================================
   Animações
   ============================================================ */
@keyframes ggModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Loading Spinner */
.gg-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: gg-spin 0.8s linear infinite;
}

@keyframes gg-spin {
    to { transform: rotate(360deg); }
}

/* Sidebar Overlay */
.gg-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 95;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

/* Mobile Menu Control Buttons */
.gg-mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition-fast);
    margin-right: 12px;
}

.gg-mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.gg-close-sidebar-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: var(--transition-fast);
    margin-left: auto;
}

.gg-close-sidebar-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

/* PWA Install Banner */
.gg-install-banner {
    position: fixed;
    bottom: 24px;
    right: 24px;
    max-width: 400px;
    background: rgba(22, 21, 43, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass-active);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transform: translateY(120%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.gg-install-banner.show {
    transform: translateY(0);
}

.gg-install-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.gg-install-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gg-install-title i {
    font-size: 20px;
    color: var(--brand-primary);
}

.gg-install-title h4 {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
}

.gg-install-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    transition: var(--transition-fast);
}

.gg-install-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.gg-install-body {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.gg-install-body strong {
    color: var(--text-primary);
}

.gg-install-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .gg-sidebar {
        transform: translateX(-100%);
    }
    .gg-main-content {
        margin-left: 0;
    }
    .gg-sidebar.active {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.6);
    }
    .gg-sidebar-overlay.active {
        display: block;
        opacity: 1;
    }
    .gg-header {
        padding: 0 16px;
    }
    .gg-header-left {
        display: flex;
        align-items: center;
    }
    .gg-mobile-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .gg-close-sidebar-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .gg-page-body {
        padding: 16px;
    }
    .gg-dashboard-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .gg-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .gg-section-header .gg-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .gg-install-banner {
        bottom: 0;
        left: 0;
        right: 0;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
        padding: 16px;
    }
}

