/* ==========================================================================
   NEBULOSA GROWTH & GRUPO ZA - DASHBOARD STYLESHEET (PREMIUM)
   ========================================================================== */

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

:root {
    /* Cores Nebulosa */
    --black: #020617;
    --navy: #0A192F;
    --royal: #1D4ED8;
    --royal-light: #3B82F6;
    --white: #FFFFFF;
    
    /* Cores de Acento Grupo ZA */
    --za-green: #10B981;
    --za-green-glow: rgba(16, 185, 129, 0.15);
    --za-yellow: #F59E0B;
    --za-yellow-glow: rgba(245, 158, 11, 0.15);
    --za-blue: #0ea5e9;
    --za-blue-glow: rgba(14, 165, 233, 0.15);
    --za-red: #EF4444;
    --za-red-glow: rgba(239, 68, 68, 0.15);
    
    /* Design Tokens */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --glass-bg: rgba(15, 23, 42, 0.4);
    --glass-border: rgba(255, 255, 255, 0.05);
    --text-muted: #94A3B8;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--black);
    color: var(--white);
    font-family: var(--font-body);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Background Effects */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: 40px 40px;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    z-index: -2;
    pointer-events: none;
    mask-image: radial-gradient(circle at center, black, transparent 90%);
    -webkit-mask-image: radial-gradient(circle at center, black, transparent 90%);
}

.bg-glow {
    position: fixed;
    top: -20%;
    left: 30%;
    width: 60vw;
    height: 60vh;
    background: radial-gradient(circle, rgba(29, 78, 216, 0.12) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
    filter: blur(120px);
}

.bg-glow-secondary {
    position: fixed;
    bottom: -10%;
    right: 10%;
    width: 50vw;
    height: 50vh;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, transparent 75%);
    z-index: -1;
    pointer-events: none;
    filter: blur(100px);
}

/* Utility Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
}

.text-gradient {
    background: linear-gradient(135deg, var(--royal-light) 0%, var(--za-green) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.text-muted {
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--royal) 0%, var(--royal-light) 100%);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(29, 78, 216, 0.4);
    filter: brightness(1.1);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--white);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.btn-logout {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.25);
    transform: translateY(-2px);
}

/* Glass Card */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   LOGIN PAGE STYLES
   ========================================================================== */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.login-logo img {
    height: 48px;
}

.login-header h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.form-input-wrapper {
    position: relative;
}

.form-input-wrapper i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
}

.form-input {
    width: 100%;
    padding: 12px 12px 12px 42px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--white);
    font-family: var(--font-body);
    font-size: 14px;
    transition: var(--transition);
    outline: none;
}

.form-input:focus {
    border-color: var(--royal-light);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.login-btn {
    width: 100%;
    margin-top: 10px;
    padding: 12px;
    font-size: 15px;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 20px;
    display: none;
    align-items: center;
    gap: 8px;
}

/* ==========================================================================
   PERIOD SELECTOR OVERLAY
   ========================================================================== */
.period-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(2, 6, 23, 0.7);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: var(--transition);
}

.period-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.05);
}

.period-content {
    width: 100%;
    max-width: 600px;
    text-align: center;
}

.period-content h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.period-content p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 32px;
}

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

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

.period-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 28px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.period-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--royal-light);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(29, 78, 216, 0.15);
}

.period-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--royal-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.period-card:hover .period-icon-wrapper {
    background: var(--royal);
    color: var(--white);
    box-shadow: 0 0 15px rgba(29, 78, 216, 0.4);
}

.period-card h3 {
    font-size: 15px;
    font-weight: 600;
}

.period-card .date-tag {
    font-size: 13px;
    color: var(--text-muted);
}

.period-card .status-tag {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 20px;
}

.status-tag.active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--za-green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-tag.previous {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
}

/* ==========================================================================
   DASHBOARD CORE STRUCTURE
   ========================================================================== */
.dashboard-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.dashboard-wrapper.hidden {
    display: none;
}

/* Header */
.dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--glass-border);
}

.dash-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dash-header-left img {
    height: 38px;
}

.dash-header-title h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.dash-header-title p {
    font-size: 13px;
    color: var(--text-muted);
}

.dash-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.client-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
}

.client-badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--za-green);
    box-shadow: 0 0 8px var(--za-green);
}

/* Selector Tabs */
.tabs-container {
    display: flex;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    padding: 4px;
    border-radius: 12px;
    width: fit-content;
}

.tab-btn {
    padding: 8px 18px;
    border-radius: 8px;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 13px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    color: var(--white);
}

.tab-btn.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Grid Layouts */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.kpi-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--royal-light);
    border-radius: 2px;
}

.kpi-card.royal::before { background-color: var(--royal-light); }
.kpi-card.green::before { background-color: var(--za-green); }
.kpi-card.yellow::before { background-color: var(--za-yellow); }
.kpi-card.blue::before { background-color: var(--za-blue); }

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

.kpi-header i {
    font-size: 20px;
    opacity: 0.8;
}

.kpi-value {
    font-size: 32px;
    font-weight: 700;
    font-family: var(--font-heading);
    letter-spacing: -0.5px;
}

.kpi-footer {
    font-size: 11px;
    color: var(--text-muted);
}

.kpi-footer span {
    font-weight: 600;
}

.kpi-footer.positive span {
    color: var(--za-green);
}

/* Main Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

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

/* Funnel Chart */
.funnel-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.funnel-stage {
    display: flex;
    align-items: center;
    gap: 16px;
}

.funnel-label {
    width: 140px;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.funnel-bar-wrapper {
    flex-grow: 1;
    height: 36px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
}

.funnel-bar {
    height: 100%;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0.6) 100%);
    border-right: 2px solid var(--royal-light);
    transition: var(--transition);
}

.funnel-bar.dedetizacao {
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.15) 0%, rgba(14, 165, 233, 0.5) 100%);
    border-right: 2px solid var(--za-blue);
}

.funnel-bar.desentupimento {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.5) 100%);
    border-right: 2px solid var(--za-green);
}

.funnel-bar-value {
    position: absolute;
    left: 12px;
    font-size: 13px;
    font-weight: 600;
}

.funnel-conversion-rate {
    width: 60px;
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    color: var(--za-green);
}

/* CRM Board Representation */
.crm-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.crm-column {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.crm-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}

.crm-column-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.crm-column-badge {
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}

.crm-card-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.crm-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 10px;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: var(--transition);
}

.crm-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.crm-item-name {
    font-weight: 600;
}

.crm-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 10px;
}

.crm-item-tag {
    background: rgba(59, 130, 246, 0.1);
    color: var(--royal-light);
    padding: 1px 4px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 500;
}

.crm-item-value {
    font-weight: 600;
    color: var(--white);
}

/* Gale Critical Lead Highlight */
.crm-item.critical-lead {
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.04);
    animation: criticalPulse 2s infinite alternate;
}

@keyframes criticalPulse {
    0% { box-shadow: 0 0 4px rgba(245, 158, 11, 0.1); }
    100% { box-shadow: 0 0 10px rgba(245, 158, 11, 0.3); border-color: rgba(245, 158, 11, 0.6); }
}

/* Critical Analysis Box */
.critical-box {
    border-left: 4px solid var(--za-yellow);
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.05) 0%, transparent 100%);
    padding: 16px;
    border-radius: 0 12px 12px 0;
    margin-top: 12px;
}

.critical-box h4 {
    color: var(--za-yellow);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

/* Automation Showcase */
.automation-showcase {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 16px;
}

@media (max-width: 768px) {
    .automation-showcase {
        grid-template-columns: 1fr;
    }
}

.auto-card {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auto-card.positive {
    border-color: rgba(16, 185, 129, 0.2);
    background: rgba(16, 185, 129, 0.01);
}

.auto-title {
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auto-title.red { color: #ef4444; }
.auto-title.green { color: var(--za-green); }

.auto-content {
    font-size: 12px;
    color: var(--text-muted);
}

/* WhatsApp Message Bubble */
.whatsapp-bubble-wrapper {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.whatsapp-header-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--za-green);
    font-weight: 600;
}

.whatsapp-bubble {
    background: #0b3c2d;
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 0 12px 12px 12px;
    padding: 16px;
    font-size: 12px;
    line-height: 1.5;
    position: relative;
    white-space: pre-line;
    max-width: 90%;
}

.whatsapp-bubble::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 0;
    width: 0;
    height: 0;
    border-top: 0px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid #0b3c2d;
}

/* Pros and Cons Diagnosis Cards */
.diagnose-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 16px;
}

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

.diagnose-card {
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--glass-border);
}

.diagnose-card.pros {
    border-color: rgba(16, 185, 129, 0.2);
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.02) 0%, transparent 100%);
}

.diagnose-card.cons {
    border-color: rgba(239, 68, 68, 0.2);
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.02) 0%, transparent 100%);
}

.diagnose-title {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.diagnose-card.pros .diagnose-title { color: var(--za-green); }
.diagnose-card.cons .diagnose-title { color: #f87171; }

.diagnose-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 12px;
}

.diagnose-list li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    line-height: 1.4;
}

.diagnose-list li i {
    font-size: 16px;
    margin-top: 2px;
    flex-shrink: 0;
}

.diagnose-card.pros .diagnose-list li i { color: var(--za-green); }
.diagnose-card.cons .diagnose-list li i { color: #f87171; }

/* Insights Grid */
.insights-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 16px;
}

.insight-item {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 16px;
}

.insight-icon {
    font-size: 24px;
    color: var(--royal-light);
    display: flex;
    align-items: flex-start;
}

.insight-icon.yellow { color: var(--za-yellow); }
.insight-icon.green { color: var(--za-green); }

.insight-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.insight-body h4 {
    font-size: 14px;
    font-weight: 600;
}

.insight-body p {
    font-size: 12px;
    color: var(--text-muted);
}

/* Competitor Comparison Grid */
.comp-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 12px;
}

.comp-card {
    padding: 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    font-size: 12px;
}

.comp-card h5 {
    font-size: 13px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.comp-card.competitor h5 { color: #f87171; }
.comp-card.grupo-za h5 { color: var(--za-green); }

.comp-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--text-muted);
}

.comp-card ul li span {
    font-weight: 600;
    color: var(--white);
}

/* Content Views Control */
.view-section {
    display: none;
    animation: fadeIn 0.4s ease;
}

.view-section.active {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
