/* =========================================================
   ZYRKON MANAGER - ESTILO GLOBAL (DARK NAVY THEME)
   ========================================================= */

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

:root {
    --cor-fundo-site: #161b22;
    --cor-fundo-card: #212833;
    --cor-primaria: #00d2ff;
    --texto-titulo: #ffffff;
    --texto-cyan: #00d2ff;
    --texto-muted: #8b9bb4;
    --status-online: #2ecc71;
    --status-alerta: #f1c40f;
    --status-offline: #e74c3c;
    --fonte-principal: 'Inter', sans-serif;
    --raio-borda: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: var(--fonte-principal); }

body { background-color: var(--cor-fundo-site); color: var(--texto-titulo); }

.card { background-color: var(--cor-fundo-card); border-radius: var(--raio-borda); padding: 20px; }

/* =========================================================
   TELA DE LOGIN
   ========================================================= */
.bg-login { display: flex; justify-content: center; align-items: center; height: 100vh; background-color: var(--cor-fundo-site); }
.login-container { width: 100%; max-width: 400px; padding: 20px; }
.login-header { text-align: center; margin-bottom: 30px; }
.logo-zyrkon { width: 100%; max-width: 120px; margin: 0 auto 15px auto; display: flex; justify-content: center; align-items: center; }
.logo-zyrkon img { width: 100%; height: auto; object-fit: contain; filter: drop-shadow(0 0 10px rgba(0, 210, 255, 0.3)); }
.login-header p { color: var(--texto-cyan); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 2px; }
.login-form .input-group { margin-bottom: 20px; }
.login-form label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; color: var(--texto-muted); }
.login-form input { width: 100%; padding: 14px 15px; background-color: #1a202a; border: 1px solid #2d3748; border-radius: 8px; color: var(--texto-titulo); font-size: 15px; outline: none; transition: 0.3s; }
.login-form input:focus { border-color: var(--cor-primaria); }
.btn-primario { width: 100%; padding: 15px; background-color: var(--cor-primaria); color: #000; border: none; border-radius: 8px; font-size: 16px; font-weight: 800; cursor: pointer; transition: 0.3s; }
.btn-primario:hover { filter: brightness(1.2); }

/* =========================================================
   LAYOUT DO PAINEL (DASHBOARD) - ESTILO MIDDLEWARE
   ========================================================= */
.dashboard-body { overflow-x: hidden; }

/* NAVBAR DE TOPO (Usando Grid para centralização perfeita) */
.top-navbar { 
    height: 90px; 
    background-color: var(--cor-fundo-site); 
    display: grid; 
    grid-template-columns: 1fr auto 1fr;
    align-items: center; 
    padding: 0 40px; 
    border-bottom: 1px solid rgba(255,255,255,0.05); 
}

.navbar-logo { 
    display: flex; 
    align-items: center; 
    justify-content: flex-start;
}

.navbar-logo img { 
    height: 55px !important; 
    width: auto !important; 
    max-width: 150px; 
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(0, 210, 255, 0.4)); 
}

.navbar-menu { 
    display: flex; 
    gap: 30px; 
    justify-content: center;
}

.menu-item { 
    color: var(--texto-cyan); 
    text-decoration: none; 
    font-size: 15px; 
    font-weight: 700; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    transition: 0.3s; 
}

.menu-item:hover, .menu-item.active { filter: brightness(1.3); }

.navbar-user { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    justify-content: flex-end; 
}

.user-info { 
    display: flex; 
    flex-direction: column; 
    text-align: right; 
}

.user-info strong { color: #fff; font-size: 15px; }
.acesso-root { color: var(--texto-cyan); font-size: 12px; font-weight: 700; margin-top: 2px; }
.btn-sair { color: #e74c3c; font-size: 12px; font-weight: 600; text-decoration: none; margin-top: 5px; transition: 0.3s; }
.btn-sair:hover { color: #ff6b6b; }
.user-avatar i { font-size: 45px; color: var(--texto-cyan); }

/* AREA PRINCIPAL E CARDS */
.main-content { padding: 40px; }

/* =========================================================
   DASHBOARD CARDS - MELHORADO COM ANIMAÇÕES
   ========================================================= */

.grid-cards-top {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.topo-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 140px;
    padding: 25px;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.topo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 210, 255, 0.2);
}

.topo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 210, 255, 0.1) 0%, rgba(0, 210, 255, 0.05) 100%);
    z-index: 0;
}

.topo-card > * {
    position: relative;
    z-index: 1;
}

/* Border Esquerda Colorida */
.border-blue { border-left: 5px solid var(--cor-primaria); }
.border-yellow { border-left: 5px solid var(--status-alerta); }
.border-red { border-left: 5px solid var(--status-offline); }
.border-green { border-left: 5px solid var(--status-online); }

/* Dados do Card */
.card-dados {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-dados h3 {
    color: var(--texto-cyan);
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 1px;
    margin: 0;
    opacity: 0.9;
}

.card-dados h2 {
    font-size: 48px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0, 210, 255, 0.1);
}

/* Ícone do Card */
.card-icone {
    font-size: 50px;
    color: rgba(0, 210, 255, 0.4);
    transition: transform 0.3s ease, color 0.3s ease;
}

.topo-card:hover .card-icone {
    transform: scale(1.1) rotate(5deg);
    color: rgba(0, 210, 255, 0.7);
}

/* Variações de Cards */
.card-red .card-icone { color: rgba(231, 76, 60, 0.4); }
.card-red:hover .card-icone { color: rgba(231, 76, 60, 0.7); }

.card-yellow .card-icone { color: rgba(241, 196, 15, 0.4); }
.card-yellow:hover .card-icone { color: rgba(241, 196, 15, 0.7); }

.card-green .card-icone { color: rgba(46, 204, 113, 0.4); }
.card-green:hover .card-icone { color: rgba(46, 204, 113, 0.7); }

/* Badge de Status em Tempo Real */
.badge-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-live::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #2ecc71;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* =========================================================
   ESTILOS EXCLUSIVOS DO PAINEL DE GESTÃO
   ========================================================= */

.content-section {
    margin-top: 40px;
}

.section-header {
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 20px;
}

.section-header h3 {
    color: var(--texto-cyan); 
    font-weight: 800; 
    text-transform: uppercase; 
    font-size: 14px;
}

/* Customização de Card para Tabelas */
.table-card {
    padding: 0 !important; 
    overflow: hidden;
}

/* Estilização da Tabela Zyrkon */
.zyrkon-table {
    width: 100%; 
    border-collapse: collapse; 
    text-align: left;
}

.zyrkon-table thead tr {
    background: rgba(0, 0, 0, 0.2); 
    color: var(--texto-muted); 
    font-size: 12px; 
    text-transform: uppercase;
}

.zyrkon-table th, .zyrkon-table td {
    padding: 15px 25px;
}

.zyrkon-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: 0.3s;
}

.zyrkon-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Helpers de Texto e Status */
.status-indicator {
    font-weight: 700; 
    font-size: 13px;
}

.server-info {
    display: flex; 
    flex-direction: column;
}

.server-info strong {
    color: #fff; 
    font-size: 14px;
}

.server-info span {
    color: var(--texto-muted); 
    font-size: 12px;
}

.badge-data {
    background: rgba(0, 210, 255, 0.1); 
    color: var(--cor-primaria); 
    padding: 4px 10px; 
    border-radius: 5px; 
    font-weight: 700;
}

/* =========================================================
   ESTILOS PARA FORMULÁRIOS E CADASTROS
   ========================================================= */

.form-container {
    max-width: 850px;
    margin: 0 auto;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-section-title {
    grid-column: 1 / -1;
    color: var(--texto-cyan);
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    margin: 20px 0 10px 0;
    border-bottom: 1px solid rgba(0, 210, 255, 0.1);
    padding-bottom: 5px;
}

/* Inputs e Selects Padronizados */
.zyrkon-input, .zyrkon-select {
    width: 100%;
    padding: 14px 15px;
    background-color: #1a202a;
    border: 1px solid #2d3748;
    border-radius: 8px;
    color: var(--texto-titulo);
    font-size: 15px;
    outline: none;
    transition: 0.3s;
}

.zyrkon-input:focus, .zyrkon-select:focus {
    border-color: var(--cor-primaria);
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.1);
}

/* Alertas de Mensagem */
.alerta {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-weight: 600;
    text-align: center;
}

.alerta.sucesso {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    border: 1px solid #2ecc71;
}

.alerta.erro {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

/* =========================================================
   BOTÕES TOGGLE (LIGA/DESLIGA)
   ========================================================= */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #2d3748;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 4px; bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--cor-primaria);
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.4);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.modulo-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.modulo-info h4 { color: #fff; margin-bottom: 5px; font-size: 15px; }
.modulo-info p { color: var(--texto-muted); font-size: 12px; }

/* Modificadores de Formulário */
.form-container-lg {
    max-width: 900px;
}

.form-grid-address {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 150px 1fr 100px 1fr 80px;
    gap: 15px;
}

.form-footer {
    text-align: right;
    margin-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 20px;
}

.btn-lg {
    width: auto;
    padding: 15px 30px;
    font-size: 14px;
}

/* Responsividade Básica para o Endereço */
@media (max-width: 768px) {
    .form-grid-address {
        grid-template-columns: 1fr 1fr;
    }
}

/* =========================================================
   ESTILOS DO PERFIL DO CLIENTE (CRM)
   ========================================================= */

.profile-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 30px;
}

.profile-title {
    color: #fff;
    margin: 0;
    font-size: 24px;
}

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

.card-header-bordered {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-header-title h3, .card-header-bordered h3 {
    color: var(--texto-cyan);
    font-size: 15px;
    margin: 0;
}

.action-group {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Badges e Botões Secundários */
.badge-success {
    background: rgba(0, 255, 100, 0.1);
    color: #2ecc71;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.btn-danger-outline {
    background: transparent;
    border: 1px solid #e74c3c;
    color: #e74c3c;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: 0.3s;
}

.btn-danger-outline:hover {
    background: #e74c3c;
    color: #fff;
}

.input-mini {
    width: 80px;
    text-align: center;
    font-weight: bold;
    padding: 10px;
}

/* =========================================================
   LAYOUT GRID (4 QUADRANTES) E ELEMENTOS COMPACTOS
   ========================================================= */

.bento-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }
}

.card-compact {
    padding: 20px;
}

.card-compact h3 {
    font-size: 14px !important;
}

.zyrkon-input-sm, .zyrkon-select-sm {
    width: 100%;
    padding: 10px 12px;
    background-color: #1a202a;
    border: 1px solid #2d3748;
    border-radius: 6px;
    color: var(--texto-titulo);
    font-size: 13px;
    outline: none;
    transition: 0.3s;
}

.zyrkon-input-sm:focus, .zyrkon-select-sm:focus {
    border-color: var(--cor-primaria);
}

.label-sm {
    font-size: 11px !important;
    margin-bottom: 5px !important;
    color: var(--texto-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-grid-compact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-grid-full {
    grid-column: 1 / -1;
}

/* =========================================================
   CLASSES UTILITÁRIAS (CLEAN CODE)
   ========================================================= */

.form-container-xl { max-width: 1200px; margin: 0 auto; }

/* Espaçamentos */
.mb-20 { margin-bottom: 20px; }
.mb-15 { margin-bottom: 15px; }
.mt-15 { margin-top: 15px; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.m-0 { margin: 0 !important; }
.p-30 { padding: 30px; }

/* Flexbox e Grids Específicos */
.flex-col-gap { 
    display: flex; 
    flex-direction: column; 
    gap: 20px; 
}

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

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

.gap-5 { gap: 5px; }

.info-row { 
    display: flex; 
    justify-content: space-between; 
    margin-bottom: 8px; 
}

.info-row.last { margin-bottom: 0; }

/* Botões Modificados */
.btn-sm { padding: 10px 20px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 10px; }
.btn-block { width: 100%; display: block; text-align: center; }
.btn-h-38 { height: 38px; display: flex; align-items: center; justify-content: center; }

/* Elementos do Card e Textos */
.info-box { 
    background: rgba(0, 0, 0, 0.2); 
    padding: 15px; 
    border-radius: 6px; 
    margin-bottom: 10px; 
}

.text-md-white { font-size: 13px; color: #fff; font-weight: bold; }
.text-sm { font-size: 13px; }
.text-right { text-align: right; }
.text-white { color: #fff; }
.text-center { text-align: center; }
.text-success-bold { color: var(--status-online); font-weight: bold; }
.text-danger-bold { color: #e74c3c; font-weight: bold; cursor: pointer; }

/* Modificadores de Módulos (Tamanho Reduzido) */
.modulo-card-sm { padding: 10px 15px; }
.input-micro { width: 60px; text-align: center; }
.switch-sm { transform: scale(0.8); margin: 0; }
.badge-xs { padding: 2px 8px; font-size: 10px; }

/* Rodapés de Formulário */
.form-footer-compact {
    text-align: right; 
    margin-top: 15px; 
    border-top: 1px solid rgba(255, 255, 255, 0.05); 
    padding-top: 15px;
}

.card-header-bordered.sm { 
    padding-bottom: 10px; 
    margin-bottom: 15px; 
}

/* Grids Específicos */
.grid-col-span-2 { grid-column: 1 / span 2; }

.form-grid-4col-end {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    align-items: end;
    gap: 12px;
}

/* Checkbox Vermelho */
.checkbox-danger { 
    width: 18px; 
    height: 18px; 
    accent-color: #e74c3c; 
    cursor: pointer; 
}

/* Alerta Visual Animado (Pulse) */
.alerta-pulse {
    background: rgba(231, 76, 60, 0.15);
    border: 2px solid #e74c3c;
    color: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 15px;
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(231, 76, 60, 0); }
    100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}

/* =========================================================
   FATURAÇÃO E AÇÕES RÁPIDAS
   ========================================================= */
.btn-whatsapp {
    background-color: #25D366;
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 11px;
    text-decoration: none;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-whatsapp:hover { 
    background-color: #1ebe5d; 
    color: white; 
}

.fatura-box {
    background: linear-gradient(135deg, rgba(0, 210, 255, 0.1) 0%, rgba(45, 55, 72, 0.5) 100%);
    border: 1px solid rgba(0, 210, 255, 0.2);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    margin-top: 15px;
}

.fatura-valor {
    font-size: 24px;
    color: var(--cor-primaria);
    font-weight: bold;
    margin: 5px 0;
}

.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(0,0,0,0.15);
    padding: 10px;
    border-radius: 6px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #cbd5e1;
}

/* =========================================================
   RESPONSIVIDADE GERAL
   ========================================================= */

@media (max-width: 1366px) {
    .grid-cards-top {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .grid-cards-top {
        grid-template-columns: 1fr;
    }
    
    .topo-card {
        height: 120px;
    }
    
    .card-dados h2 {
        font-size: 36px;
    }
    
    .card-icone {
        font-size: 40px;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .top-navbar {
        padding: 0 20px;
    }
}