/* =====================================================================
   ESTILOS ENTERPRISE GLASSMORPHISM - ASISTENTE IA DE NEGOCIOS
   ===================================================================== */

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

:root {
    --bg-dark: #070C18;
    --bg-card: rgba(15, 23, 42, 0.75);
    --bg-card-hover: rgba(30, 41, 59, 0.85);
    --border-glass: rgba(255, 255, 255, 0.12);
    --border-accent: rgba(56, 189, 248, 0.3);
    
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    
    --accent-cyan: #38BDF8;
    --accent-indigo: #6366F1;
    --accent-emerald: #10B981;
    --accent-rose: #F43F5E;
    --accent-amber: #F59E0B;
    
    --shadow-glow: 0 0 25px rgba(56, 189, 248, 0.15);
    --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
    --radius-xl: 20px;
    --radius-lg: 14px;
    --radius-md: 10px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

h1, h2, h3, h4, .brand-title {
    font-family: 'Outfit', sans-serif;
}

body {
    background: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(56, 189, 248, 0.12) 0%, transparent 40%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* AUTHENTICATION OVERLAY / SCREEN */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(7, 12, 24, 0.95);
    backdrop-filter: blur(20px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: opacity 0.3s ease;
}

.auth-card {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-card), var(--shadow-glow);
    text-align: center;
}

.auth-logo {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin: 0 auto 20px;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 28px;
}

.form-group {
    margin-bottom: 18px;
    text-align: left;
}

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

.form-input {
    width: 100%;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--border-glass);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.btn-auth-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
    color: white;
    border: none;
    padding: 13px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.2s;
    margin-top: 10px;
}

.btn-auth-primary:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.btn-google {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: 12px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
    transition: background 0.2s;
}

.btn-google:hover {
    background: rgba(255, 255, 255, 0.14);
}

/* LAYOUT PRINCIPAL */
.sidebar {
    width: 270px;
    background: rgba(15, 23, 42, 0.85);
    border-right: 1px solid var(--border-glass);
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    backdrop-filter: blur(12px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 40px;
}

.brand-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.brand-title {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #FFFFFF, var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 18px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.25), rgba(56, 189, 248, 0.1));
    color: var(--accent-cyan);
    border-left: 4px solid var(--accent-cyan);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
}

.topbar {
    height: 76px;
    border-bottom: 1px solid var(--border-glass);
    padding: 0 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(7, 12, 24, 0.7);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-glass);
    padding: 10px 18px;
    border-radius: 30px;
    width: 360px;
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    outline: none;
    margin-left: 10px;
    width: 100%;
    font-size: 14px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-emerald), var(--accent-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: var(--bg-dark);
}

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

.user-name {
    font-size: 14px;
    font-weight: 700;
}

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

.btn-logout {
    background: rgba(244, 63, 94, 0.15);
    color: var(--accent-rose);
    border: 1px solid rgba(244, 63, 94, 0.3);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-logout:hover {
    background: rgba(244, 63, 94, 0.3);
}

.content-area {
    padding: 36px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* CARDS & METRICS */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    padding: 26px;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-card);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--border-accent);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
}

.card-value {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.card-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.badge-positive {
    background: rgba(16, 185, 129, 0.18);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-negative {
    background: rgba(244, 63, 94, 0.18);
    color: var(--accent-rose);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    padding: 28px;
    backdrop-filter: blur(12px);
}

.table-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    padding: 28px;
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.custom-table th, .custom-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-glass);
    font-size: 14px;
}

.custom-table th {
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.8px;
}

.custom-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.chat-feed {
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 10px;
}

.chat-bubble {
    padding: 16px 22px;
    border-radius: var(--radius-lg);
    max-width: 82%;
    line-height: 1.6;
    font-size: 14.5px;
}

.bubble-user {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(56, 189, 248, 0.15));
    border: 1px solid rgba(99, 102, 241, 0.4);
    align-self: flex-end;
}

.bubble-assistant {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid var(--border-glass);
    align-self: flex-start;
}
