/* ========================================
   CFO VIRTUAL - PROFESSIONAL STYLESHEET
   ======================================== */

/* CSS Variables - Paleta Cyan/Turquesa */
:root {
    --primary: #5BBFCC;
    --primary-dark: #3BA8B6;
    --primary-light: #7DD3DE;
    --secondary: #2D9CDB;
    --accent: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #0f172a;
    --dark-light: #1e293b;
    --gray-900: #111827;
    --gray-800: #1f2937;
    --gray-700: #374151;
    --gray-600: #4b5563;
    --gray-500: #6b7280;
    --gray-400: #9ca3af;
    --gray-300: #d1d5db;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --white: #ffffff;
    --gradient-1: linear-gradient(135deg, #5BBFCC 0%, #2D9CDB 100%);
    --gradient-2: linear-gradient(135deg, #3BA8B6 0%, #5BBFCC 50%, #7DD3DE 100%);
    --gradient-3: linear-gradient(135deg, #2D9CDB 0%, #5BBFCC 100%);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 40px rgba(91, 191, 204, 0.3);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--dark);
    color: var(--gray-100);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========================================
   LOGIN PAGE STYLES
   ======================================== */

.login-page {
    background: var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
}

/* Animated Background */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.gradient-sphere {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 20s ease-in-out infinite;
}

.sphere-1 {
    width: 600px;
    height: 600px;
    background: var(--gradient-2);
    top: -200px;
    right: -100px;
    animation-delay: 0s;
}

.sphere-2 {
    width: 400px;
    height: 400px;
    background: var(--gradient-3);
    bottom: -100px;
    left: -100px;
    animation-delay: -5s;
}

.sphere-3 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #22c55e 0%, #0ea5e9 100%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(50px, -50px) rotate(90deg); }
    50% { transform: translate(0, 50px) rotate(180deg); }
    75% { transform: translate(-50px, -25px) rotate(270deg); }
}

/* Floating Icons */
.floating-icons {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.icon-float {
    position: absolute;
    font-size: 24px;
    color: rgba(91, 191, 204, 0.2);
    animation: iconFloat 15s ease-in-out infinite;
}

.icon-float:nth-child(1) { top: 10%; left: 10%; animation-delay: 0s; }
.icon-float:nth-child(2) { top: 20%; right: 15%; animation-delay: -2s; }
.icon-float:nth-child(3) { top: 60%; left: 5%; animation-delay: -4s; }
.icon-float:nth-child(4) { top: 80%; right: 10%; animation-delay: -6s; }
.icon-float:nth-child(5) { top: 40%; left: 20%; animation-delay: -8s; }
.icon-float:nth-child(6) { top: 70%; right: 25%; animation-delay: -10s; }

@keyframes iconFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.2; }
    50% { transform: translateY(-30px) rotate(180deg); opacity: 0.4; }
}

/* Login Container */
.login-container {
    display: flex;
    gap: 0;
    max-width: 1000px;
    width: 100%;
    z-index: 10;
    position: relative;
    justify-content: center;
}

/* When only card (no info panel) - center it */
.login-container:has(.register-card),
.login-container:has(.verify-card),
.login-container:has(.platforms-card) {
    justify-content: center;
}

.login-container:has(.register-card) .login-card,
.login-container:has(.verify-card) .login-card,
.login-container .register-card,
.login-container .verify-card,
.login-container .platforms-card {
    border-radius: var(--border-radius);
}

/* Login Card */
.login-card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    padding: 50px 40px;
    width: 400px;
    animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Logo Section */
.logo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
}

.logo-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-2);
    border-radius: 20px;
    display: grid;
    place-items: center;
    margin-bottom: 20px;
    font-size: 36px;
    color: var(--white);
    box-shadow: var(--shadow-glow);
}

.logo-title {
    font-size: 28px;
    font-weight: 700;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
}

.logo-subtitle {
    color: var(--gray-400);
    font-size: 14px;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: 25px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gray-600), transparent);
}

.divider span {
    padding: 0 15px;
    color: var(--gray-500);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Login Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-500);
    transition: var(--transition);
    z-index: 2;
}

.login-form input {
    width: 100%;
    padding: 15px 15px 15px 50px;
    background: var(--dark);
    border: 2px solid var(--gray-700);
    border-radius: var(--border-radius);
    color: var(--white);
    font-size: 15px;
    transition: var(--transition);
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(91, 191, 204, 0.1);
}

.login-form input:focus + .input-highlight + .input-icon,
.login-form input:focus ~ .input-icon {
    color: var(--primary);
}

.input-group:has(input:focus) .input-icon {
    color: var(--primary);
}

.login-form input::placeholder {
    color: var(--gray-500);
}

/* Login Button */
.login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 30px;
    background: var(--gradient-2);
    border: none;
    border-radius: var(--border-radius);
    color: var(--white);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 10px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn i {
    transition: transform 0.3s ease;
}

.login-btn:hover i {
    transform: translateX(5px);
}

/* Login Footer */
.login-footer {
    margin-top: 30px;
    text-align: center;
}

.login-footer p {
    color: var(--gray-500);
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-footer i {
    color: var(--accent);
}

/* Info Panel */
.info-panel {
    background: var(--gradient-2);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    padding: 50px 40px;
    width: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    animation: slideInRight 0.6s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.info-panel h2 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 10px;
}

.info-panel > p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 40px;
}

/* Features */
.features {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.feature-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.feature-icon {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.feature-text h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 3px;
}

.feature-text p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
}

/* ========================================
   DASHBOARD PAGE STYLES
   ======================================== */

.dashboard-page {
    display: flex;
    min-height: 100vh;
    background: var(--dark);
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--dark-light);
    border-right: 1px solid var(--gray-800);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    animation: slideInLeft 0.4s ease-out;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid var(--gray-800);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 45px;
    height: 45px;
    background: var(--gradient-2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 700;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-divider {
    height: 1px;
    background: var(--gray-700);
    margin: 10px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: 10px;
    color: var(--gray-400);
    text-decoration: none;
    transition: var(--transition);
    font-size: 14px;
}

.nav-item:hover {
    background: var(--gray-800);
    color: var(--white);
}

.nav-item.active {
    background: var(--primary);
    color: var(--white);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--gray-800);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    background: var(--gray-700);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--white);
}

.user-role {
    font-size: 12px;
    color: var(--gray-500);
}

.logout-btn {
    width: 38px;
    height: 38px;
    background: var(--gray-800);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    text-decoration: none;
    transition: var(--transition);
}

.logout-btn:hover {
    background: var(--danger);
    color: var(--white);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    min-height: 100vh;
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: fadeInDown 0.5s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-title h1 {
    font-size: 26px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 5px;
}

.header-title h1 i {
    color: var(--primary);
}

.header-title p {
    color: var(--gray-500);
    font-size: 14px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    width: 42px;
    height: 42px;
    background: var(--dark-light);
    border: 1px solid var(--gray-700);
    border-radius: 10px;
    color: var(--gray-400);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--gray-800);
    color: var(--white);
    border-color: var(--gray-600);
}

/* Alerts */
.alerts-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alert {
    padding: 15px 20px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    animation: slideIn 0.3s ease-out;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    opacity: 0.7;
    transition: var(--transition);
}

.alert-close:hover {
    opacity: 1;
}

/* Query Section */
.query-section {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.query-card {
    background: var(--dark-light);
    border: 1px solid var(--gray-800);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.query-header {
    padding: 15px 20px;
    background: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--gray-300);
}

.query-header i {
    color: var(--primary);
}

.query-form {
    padding: 20px;
}

.textarea-wrapper {
    position: relative;
    margin-bottom: 15px;
}

.query-form textarea {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    background: var(--dark);
    border: 2px solid var(--gray-700);
    border-radius: var(--border-radius);
    color: var(--white);
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    transition: var(--transition);
}

.query-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(91, 191, 204, 0.1);
}

.query-form textarea::placeholder {
    color: var(--gray-500);
}

.textarea-actions {
    position: absolute;
    bottom: 10px;
    right: 10px;
}

.char-count {
    font-size: 12px;
    color: var(--gray-500);
}

.query-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-primary,
.btn-secondary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: var(--gradient-2);
    color: var(--white);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--gray-800);
    color: var(--gray-300);
    border: 1px solid var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-700);
    color: var(--white);
}

/* Response Section */
.response-section {
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.response-card {
    background: var(--dark-light);
    border: 1px solid var(--gray-800);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.response-header {
    padding: 15px 20px;
    background: var(--gray-800);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.response-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--gray-300);
}

.response-title i {
    color: var(--accent);
}

.response-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.typing-indicator {
    display: flex;
    gap: 4px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: typing 1.4s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-8px); opacity: 1; }
}

/* ========================================
   LOADING OVERLAY STYLES
   ======================================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.loading-container {
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 30px;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid transparent;
}

.spinner-ring:nth-child(1) {
    border-top-color: var(--primary);
    animation: spin 1.5s linear infinite;
}

.spinner-ring:nth-child(2) {
    width: 85%;
    height: 85%;
    top: 7.5%;
    left: 7.5%;
    border-right-color: var(--secondary);
    animation: spin 2s linear infinite reverse;
}

.spinner-ring:nth-child(3) {
    width: 70%;
    height: 70%;
    top: 15%;
    left: 15%;
    border-bottom-color: var(--accent);
    animation: spin 1s linear infinite;
}

.spinner-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 28px;
    color: var(--primary-light);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
}

.loading-text {
    font-size: 22px;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.loading-dots span {
    animation: loadingDots 1.4s ease-in-out infinite;
    opacity: 0;
}

.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes loadingDots {
    0%, 60%, 100% { opacity: 0; }
    30% { opacity: 1; }
}

.loading-subtitle {
    font-size: 14px;
    color: var(--gray-400);
    margin-top: 12px;
    min-height: 20px;
    transition: all 0.3s ease;
}

.loading-progress {
    width: 200px;
    height: 4px;
    background: var(--gray-700);
    border-radius: 2px;
    margin: 20px auto 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--gradient-3);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Light Theme Loading Overlay */
body.theme-light .loading-overlay {
    background: rgba(255, 255, 255, 0.95);
}

body.theme-light .loading-text {
    color: var(--gray-900);
}

body.theme-light .loading-subtitle {
    color: var(--gray-600);
}

body.theme-light .loading-progress {
    background: var(--gray-200);
}

/* ========================================
   END LOADING OVERLAY STYLES
   ======================================== */

.status-text {
    font-size: 13px;
    color: var(--gray-400);
}

.response-content {
    padding: 20px;
    min-height: 100px;
    max-height: 400px;
    overflow-y: auto;
}

.response-text {
    font-size: 15px;
    line-height: 1.7;
    word-wrap: break-word;
}

/* Markdown Rendering Styles */
.response-text h1,
.response-text h2,
.response-text h3,
.response-text h4 {
    margin-top: 1em;
    margin-bottom: 0.5em;
    font-weight: 600;
    color: var(--white);
}

.response-text h1 { font-size: 1.5em; }
.response-text h2 { font-size: 1.3em; }
.response-text h3 { font-size: 1.15em; }
.response-text h4 { font-size: 1em; }

.response-text p {
    margin-bottom: 0.8em;
}

.response-text ul,
.response-text ol {
    margin: 0.5em 0;
    padding-left: 1.5em;
}

.response-text li {
    margin-bottom: 0.3em;
}

.response-text strong {
    color: var(--primary);
    font-weight: 600;
}

.response-text code {
    background: var(--gray-800);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9em;
}

.response-text pre {
    background: var(--gray-800);
    padding: 12px 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0.8em 0;
}

.response-text pre code {
    background: transparent;
    padding: 0;
}

.response-text table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

.response-text th,
.response-text td {
    padding: 8px 12px;
    border: 1px solid var(--gray-700);
    text-align: left;
}

.response-text th {
    background: var(--gray-800);
    font-weight: 600;
}

.response-text blockquote {
    border-left: 3px solid var(--primary);
    padding-left: 1em;
    margin: 0.8em 0;
    color: var(--gray-400);
    font-style: italic;
}

.response-cursor {
    display: none;
    width: 2px;
    height: 18px;
    background: var(--primary);
    animation: blink 0.8s ease-in-out infinite;
    vertical-align: middle;
    margin-left: 2px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.response-actions {
    padding: 15px 20px;
    border-top: 1px solid var(--gray-800);
    display: flex;
    gap: 10px;
}

.btn-action {
    width: 38px;
    height: 38px;
    background: var(--gray-800);
    border: 1px solid var(--gray-700);
    border-radius: 8px;
    color: var(--gray-400);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-action:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.error-text {
    color: var(--danger);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Charts Section */
.charts-section {
    animation: slideIn 0.5s ease-out;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.charts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.charts-header h2 {
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.charts-header h2 i {
    color: var(--primary);
}

.charts-controls {
    display: flex;
    gap: 5px;
}

.btn-small {
    width: 36px;
    height: 36px;
    background: var(--gray-800);
    border: 1px solid var(--gray-700);
    border-radius: 8px;
    color: var(--gray-400);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-small:hover {
    background: var(--gray-700);
    color: var(--white);
}

.btn-small.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

/* ==================== THEME & CHART CONTROLS ==================== */

.theme-select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--gray-700);
    background: var(--dark);
    color: var(--gray-100);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.theme-select:hover {
    border-color: var(--primary);
    background: var(--dark-light);
}

.chart-options-dropdown {
    position: relative;
    display: inline-block;
}

.chart-options-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 8px;
    background: var(--dark-light);
    border: 1px solid var(--gray-700);
    border-radius: 8px;
    padding: 12px;
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
}

.chart-options-menu label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    cursor: pointer;
    color: var(--gray-300);
    font-size: 14px;
    transition: var(--transition);
}

.chart-options-menu label:hover {
    color: var(--primary);
    background: var(--dark);
    border-radius: 4px;
}

.chart-options-menu input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.chart-options-menu hr {
    border: none;
    border-top: 1px solid var(--gray-700);
    margin: 8px 0;
}

.btn-export-all,
.btn-cache-stats {
    display: block;
    width: 100%;
    padding: 8px;
    margin-top: 8px;
    border: none;
    border-radius: 4px;
    background: var(--primary);
    color: var(--white);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-export-all:hover,
.btn-cache-stats:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-export-chart {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    z-index: 10;
}

.chart-card:hover .btn-export-chart {
    opacity: 1;
}

.btn-export-chart:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.chart-filters {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 10px;
    background: var(--dark);
    border-radius: 8px;
    margin-bottom: 15px;
}

.chart-filters label {
    color: var(--gray-300);
    font-weight: 500;
}

.chart-filters select {
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid var(--gray-700);
    background: var(--dark-light);
    color: var(--gray-100);
    cursor: pointer;
}

.chart-zoom-controls {
    display: flex;
    gap: 8px;
    padding: 10px;
    background: var(--dark);
    border-radius: 8px;
    justify-content: flex-end;
}

.chart-zoom-controls button {
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid var(--gray-700);
    background: var(--dark-light);
    color: var(--gray-300);
    cursor: pointer;
    transition: var(--transition);
    font-size: 12px;
}

.chart-zoom-controls button:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.chart-comparison {
    padding: 10px;
    background: var(--dark);
    border-radius: 8px;
    margin-bottom: 15px;
}

.chart-comparison button {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--gray-700);
    background: var(--dark-light);
    color: var(--gray-300);
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
}

.chart-comparison button:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* Charts Grid */
.charts-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    width: 100%;
    justify-content: center;
    align-items: flex-start;
}

/* When only one chart, center it with max-width */
.charts-grid:has(.chart-card:only-child) {
    justify-content: center;
}

.charts-grid.list-view {
    flex-direction: column;
    align-items: center;
}

.charts-grid.list-view .chart-card {
    width: 100%;
    max-width: 800px;
}

.chart-card {
    background: linear-gradient(145deg, var(--dark-light) 0%, rgba(30, 30, 40, 0.95) 100%);
    border: 1px solid var(--gray-800);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    width: 100%;
    min-width: 350px;
    max-width: 500px;
    flex: 1 1 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.chart-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark), rgba(139, 92, 246, 0.8));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chart-card:hover::before {
    opacity: 1;
}

.chart-card:hover {
    border-color: var(--primary);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.25), 0 4px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(-8px) scale(1.02);
}

/* Wrapper para el canvas del gráfico */
.chart-canvas-wrapper {
    width: 100%;
    height: 300px;
    position: relative;
    display: block;
}

.chart-card canvas {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    display: block !important;
    transition: transform 0.3s ease;
}

.chart-card:hover canvas {
    transform: scale(1.01);
}

/* Chart Expand Button */
.chart-expand-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: var(--dark);
    border: 1px solid var(--gray-700);
    border-radius: 6px;
    color: var(--gray-400);
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.chart-card:hover .chart-expand-btn {
    opacity: 1;
}

.chart-expand-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

/* Chart Modal */
.chart-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.chart-modal-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    height: auto;
    max-height: 85vh;
    background: var(--dark-light);
    border: 1px solid var(--gray-700);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    animation: modalZoomIn 0.3s ease-out;
    aspect-ratio: auto;
}

@keyframes modalZoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.chart-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-700);
}

.chart-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--white);
}

.chart-modal-close {
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--gray-700);
    border-radius: 8px;
    color: var(--gray-400);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.chart-modal-close:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: var(--white);
}

.chart-modal-body {
    flex: 1;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 400px;
    max-height: 600px;
}

.chart-modal-body canvas {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
}

/* Expanded Modal - Two Column Layout */
.chart-modal-content.chart-modal-expanded {
    max-width: 1200px;
    width: 95%;
}

.chart-modal-body-split {
    flex: 1;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    min-height: 450px;
    max-height: 650px;
}

/* Explanation Panel - Left */
.chart-explanation-panel {
    width: 40%;
    padding: 24px;
    border-right: 1px solid var(--gray-700);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.explanation-header {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    font-weight: 600;
    font-size: 1rem;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-800);
}

.explanation-header i {
    font-size: 1.2rem;
}

.explanation-content {
    flex: 1;
    color: var(--gray-300);
    font-size: 0.95rem;
    line-height: 1.7;
}

.explanation-content p {
    margin-bottom: 12px;
}

.explanation-content p:last-child {
    margin-bottom: 0;
}

.explanation-content .no-explanation {
    color: var(--gray-500);
    font-style: italic;
}

.chart-metadata {
    background: var(--dark);
    border-radius: var(--border-radius);
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.metadata-item {
    display: flex;
    gap: 8px;
    font-size: 0.85rem;
}

.metadata-label {
    color: var(--gray-400);
    font-weight: 500;
}

.metadata-value {
    color: var(--gray-300);
}

/* Chart Visual Panel - Right */
.chart-visual-panel {
    width: 60%;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.chart-visual-panel canvas {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
}

/* Chart Card Info Indicator */
.chart-info-indicator {
    position: absolute;
    top: 8px;
    right: 48px;
    color: var(--primary);
    font-size: 0.85rem;
    opacity: 0.7;
    transition: var(--transition);
}

.chart-card:hover .chart-info-indicator {
    opacity: 1;
}

/* Responsive Modal */
@media (max-width: 900px) {
    .chart-modal-body-split {
        flex-direction: column;
        max-height: none;
    }
    
    .chart-explanation-panel {
        width: 100%;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--gray-700);
    }
    
    .chart-visual-panel {
        width: 100%;
        min-height: 300px;
    }
}

/* Fade In Animation - Enhanced */
.fade-in {
    animation: chartSlideIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes chartSlideIn {
    0% {
        opacity: 0.3;
        transform: translateY(20px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Staggered animation for multiple charts */
.chart-card.fade-in:nth-child(1) { animation-delay: 0s; }
.chart-card.fade-in:nth-child(2) { animation-delay: 0.15s; }
.chart-card.fade-in:nth-child(3) { animation-delay: 0.3s; }
.chart-card.fade-in:nth-child(4) { animation-delay: 0.45s; }
.chart-card.fade-in:nth-child(5) { animation-delay: 0.6s; }

/* Pulse effect on chart load */
.chart-card.chart-loaded {
    animation: chartPulse 0.5s ease-out;
}

@keyframes chartPulse {
    0% { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2); }
    50% { box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4); }
    100% { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2); }
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--dark-light);
    border: 1px solid var(--gray-700);
    border-radius: var(--border-radius);
    padding: 15px 25px;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-xl);
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast i {
    color: var(--accent);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-700);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-600);
}

/* ========================================
   DASHBOARD PAGE SPECIFIC STYLES
   ======================================== */

/* KPI Section */
.kpi-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.kpi-card {
    background: var(--dark-light);
    border: 1px solid var(--gray-800);
    border-radius: var(--border-radius);
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}

.kpi-card:hover {
    border-color: var(--gray-700);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.kpi-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--white);
}

.kpi-content {
    display: flex;
    flex-direction: column;
}

.kpi-label {
    color: var(--gray-400);
    font-size: 13px;
    margin-bottom: 5px;
}

.kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--white);
}

.kpi-change {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 5px;
}

.kpi-change.positive {
    color: var(--accent);
}

.kpi-change.negative {
    color: var(--danger);
}

.kpi-change.neutral {
    color: var(--gray-500);
}

/* Dashboard Charts */
.dashboard-charts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.chart-container {
    background: var(--dark-light);
    border: 1px solid var(--gray-800);
    border-radius: var(--border-radius);
    padding: 25px;
}

.chart-container.full-width {
    grid-column: 1 / -1;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-header h3 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--gray-300);
}

.chart-header h3 i {
    color: var(--primary);
}

.chart-filter {
    background: var(--dark);
    border: 1px solid var(--gray-700);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--gray-300);
    font-size: 13px;
}

.chart-container canvas {
    width: 100% !important;
    height: 250px !important;
}

/* Activity Section */
.activity-section {
    background: var(--dark-light);
    border: 1px solid var(--gray-800);
    border-radius: var(--border-radius);
    padding: 25px;
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.activity-header h3 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--gray-300);
}

.activity-header h3 i {
    color: var(--primary);
}

.view-all {
    color: var(--primary);
    text-decoration: none;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}

.view-all:hover {
    color: var(--primary-light);
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--dark);
    border-radius: 10px;
    transition: var(--transition);
}

.activity-item:hover {
    background: var(--gray-800);
}

.activity-icon {
    width: 40px;
    height: 40px;
    background: var(--gray-800);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.activity-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.activity-text {
    font-size: 14px;
    color: var(--white);
}

.activity-time {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 3px;
}

/* ========================================
   HISTORIAL PAGE STYLES
   ======================================== */

.filters-section {
    display: flex;
    gap: 20px;
    background: var(--dark-light);
    border: 1px solid var(--gray-800);
    border-radius: var(--border-radius);
    padding: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
}

.filter-group label {
    font-size: 13px;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-input {
    background: var(--dark);
    border: 1px solid var(--gray-700);
    border-radius: 8px;
    padding: 10px 15px;
    color: var(--white);
    font-size: 14px;
    transition: var(--transition);
}

.filter-input:focus {
    outline: none;
    border-color: var(--primary);
}

.history-section {
    flex: 1;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-item {
    background: var(--dark-light);
    border: 1px solid var(--gray-800);
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    gap: 20px;
    transition: var(--transition);
}

.history-item:hover {
    border-color: var(--gray-700);
}

.history-icon {
    width: 50px;
    height: 50px;
    background: var(--dark);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 20px;
    flex-shrink: 0;
}

.history-content {
    flex: 1;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.history-query {
    font-size: 16px;
    font-weight: 600;
    color: var(--white);
}

.history-date {
    font-size: 12px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 5px;
}

.history-response {
    font-size: 14px;
    color: var(--gray-400);
    line-height: 1.5;
    margin-bottom: 12px;
}

.history-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tag-clientes { background: rgba(91, 191, 204, 0.2); color: #7DD3DE; }
.tag-facturas { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.tag-productos { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.tag-vendedores { background: rgba(14, 165, 233, 0.2); color: #38bdf8; }
.tag-chart { background: rgba(139, 92, 246, 0.2); color: #a78bfa; }

.history-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-actions .btn-action.delete:hover {
    background: var(--danger);
    border-color: var(--danger);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state i {
    font-size: 60px;
    color: var(--gray-700);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 20px;
    color: var(--gray-300);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--gray-500);
    margin-bottom: 20px;
}

.pagination-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 20px;
}

.btn-pagination {
    background: var(--dark-light);
    border: 1px solid var(--gray-700);
    border-radius: 8px;
    padding: 10px 20px;
    color: var(--gray-300);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-pagination:hover:not(:disabled) {
    background: var(--gray-800);
    color: var(--white);
}

.btn-pagination:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    color: var(--gray-400);
    font-size: 14px;
}

/* ========================================
   CONFIGURACION PAGE STYLES
   ======================================== */

.settings-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.settings-card {
    background: var(--dark-light);
    border: 1px solid var(--gray-800);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.settings-header {
    padding: 20px;
    background: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    color: var(--gray-300);
}

.settings-header i {
    color: var(--primary);
    font-size: 18px;
}

.settings-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-item label {
    font-size: 14px;
    color: var(--gray-300);
}

.setting-input {
    background: var(--dark);
    border: 1px solid var(--gray-700);
    border-radius: 8px;
    padding: 12px 15px;
    color: var(--white);
    font-size: 14px;
    transition: var(--transition);
}

.setting-input:focus {
    outline: none;
    border-color: var(--primary);
}

.setting-input:read-only {
    opacity: 0.7;
    cursor: not-allowed;
}

.setting-range {
    -webkit-appearance: none;
    height: 6px;
    border-radius: 3px;
    background: var(--gray-700);
}

.setting-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
}

.range-value {
    font-size: 14px;
    color: var(--primary);
    font-weight: 600;
}

.toggle-item {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.toggle-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.toggle-description {
    font-size: 12px;
    color: var(--gray-500);
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gray-700);
    border-radius: 26px;
    transition: var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    bottom: 3px;
    background: var(--white);
    border-radius: 50%;
    transition: var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.theme-options {
    display: flex;
    gap: 10px;
}

.theme-btn {
    flex: 1;
    padding: 12px;
    background: var(--dark);
    border: 2px solid var(--gray-700);
    border-radius: 8px;
    color: var(--gray-400);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
}

.theme-btn:hover {
    border-color: var(--gray-600);
    color: var(--white);
}

.theme-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(91, 191, 204, 0.1);
}

.setting-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-danger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--border-radius);
    color: #fca5a5;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-danger:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: var(--white);
}

.btn-save {
    align-self: flex-start;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.info-label {
    font-size: 12px;
    color: var(--gray-500);
}

.info-value {
    font-size: 14px;
    color: var(--white);
}

.status-online {
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-online i {
    font-size: 8px;
}

/* ==================== CONFIG TABS ==================== */
.config-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0 2rem;
    margin-bottom: 1.5rem;
    background: var(--dark);
    border-radius: 12px;
    padding: 0.5rem;
    width: fit-content;
}

.config-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--gray-500);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.config-tab:hover {
    color: var(--white);
    background: var(--gray-800);
}

.config-tab.active {
    background: var(--primary);
    color: white;
}

.config-tab i {
    font-size: 1rem;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================== CONNECTIONS TAB ==================== */
.connections-container {
    padding: 0 0 2rem 0;
}

.connections-header {
    margin-bottom: 2rem;
}

.connections-intro h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.connections-intro p {
    color: var(--gray-500);
    font-size: 0.95rem;
}

.connections-section {
    background: var(--dark);
    border: 1px solid var(--gray-800);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-800);
}

.section-title h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--white);
    margin: 0;
}

.section-title i {
    font-size: 1.1rem;
}

/* Large Platform Grid for Connections Tab */
.platforms-grid-large {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.platforms-grid-large .platform-card {
    padding: 1.25rem;
}

.platforms-grid-large .platform-icon {
    width: 56px;
    height: 56px;
    font-size: 1.5rem;
}

.platforms-grid-large .platform-name {
    font-size: 1.05rem;
}

.platforms-grid-large .platform-desc,
.platforms-grid-large .platform-status {
    font-size: 0.85rem;
}

.platforms-grid-large .btn-connect {
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
}

/* ==================== PLATFORM CONNECTIONS ==================== */
.platforms-section {
    padding: 0.5rem 0;
}

.platforms-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.platform-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--dark);
    border: 1px solid var(--gray-700);
    border-radius: 10px;
    transition: var(--transition);
}

.platform-card:hover {
    border-color: var(--gray-600);
}

.platform-card.connected {
    border-color: var(--accent);
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.05);
}

.platform-card.available {
    border-color: var(--gray-700);
}

.platform-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-800);
    border-radius: 10px;
    font-size: 1.25rem;
    color: var(--primary);
}

.platform-card.connected .platform-icon {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent);
}

/* Connected Status Indicator - Pulsing Dot */
.platform-card.connected {
    position: relative;
}

.connected-indicator {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 500;
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(91, 191, 204, 0.7);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(91, 191, 204, 0.7);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(91, 191, 204, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(91, 191, 204, 0);
    }
}

.platform-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.platform-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--white);
}

.platform-status {
    font-size: 0.8rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 6px;
}

.platform-desc {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.btn-connect {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}

.btn-connect:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-disconnect {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--gray-700);
    border-radius: 8px;
    color: var(--gray-500);
    cursor: pointer;
    transition: var(--transition);
}

.btn-disconnect:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
    color: var(--danger);
}

.platform-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-config {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--gray-700);
    border-radius: 8px;
    color: var(--gray-500);
    cursor: pointer;
    transition: var(--transition);
}

.btn-config:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

.no-platforms {
    text-align: center;
    color: var(--gray-500);
    padding: 1.5rem;
    font-size: 0.9rem;
}

.loading-platforms {
    text-align: center;
    color: var(--gray-500);
    padding: 1.5rem;
}

/* ==================== PLATFORM CONNECTION MODAL ==================== */
.platform-modal {
    max-width: 500px;
    width: 95%;
}

.platform-modal .modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, #3BA8B6 100%);
    padding: 1.25rem 1.5rem;
    border-radius: 12px 12px 0 0;
}

.platform-modal .modal-header h2 {
    color: white;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.platform-modal .modal-close {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.platform-modal .modal-close:hover {
    background: rgba(255,255,255,0.3);
}

.platform-modal .modal-body {
    padding: 1.5rem;
}

.platform-description {
    margin-bottom: 1.5rem;
}

.platform-description p {
    color: var(--gray-400);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.platform-help {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.75rem 1rem;
    background: rgba(91, 191, 204, 0.1);
    border: 1px solid rgba(91, 191, 204, 0.2);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--primary);
}

.platform-help i {
    flex-shrink: 0;
}

.platform-form .form-group {
    margin-bottom: 1.25rem;
}

.platform-form label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.platform-form label .required {
    color: #ef4444;
}

.platform-form .form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--gray-800);
    border: 1px solid var(--gray-700);
    border-radius: 8px;
    color: var(--white);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.platform-form .form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(91, 191, 204, 0.15);
}

.platform-form .form-input::placeholder {
    color: var(--gray-600);
}

.field-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: var(--gray-500);
}

.field-hint i {
    font-size: 0.75rem;
    color: var(--primary);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-800);
}

.modal-actions .btn-secondary,
.modal-actions .btn-primary {
    flex: 1;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Responsive */
@media (max-width: 1200px) {
    .login-container {
        flex-direction: column;
        max-width: 450px;
    }
    
    .login-card,
    .info-panel {
        width: 100%;
        border-radius: var(--border-radius);
    }
    
    .login-card {
        border-radius: var(--border-radius) var(--border-radius) 0 0;
    }
    
    .info-panel {
        border-radius: 0 0 var(--border-radius) var(--border-radius);
        padding: 30px;
    }
    
    .dashboard-charts {
        grid-template-columns: 1fr;
    }
    
    .settings-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .charts-grid {
        flex-direction: column;
        align-items: center;
    }
    
    .chart-card {
        min-width: 280px;
        max-width: 100%;
    }
    
    .kpi-section {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .main-content {
        padding: 15px;
    }
    
    .main-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .query-buttons {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
    
    .kpi-section {
        grid-template-columns: 1fr;
    }
    
    .filters-section {
        flex-direction: column;
    }
    
    .history-item {
        flex-direction: column;
    }
    
    .history-actions {
        flex-direction: row;
    }
}

/* ========================================
   ENHANCED DASHBOARD STYLES
   ======================================== */

/* Date Range Picker */
.date-range-picker {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-select {
    background: var(--dark);
    border: 1px solid var(--gray-700);
    border-radius: 8px;
    padding: 8px 15px;
    color: var(--white);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.date-select:hover {
    border-color: var(--primary);
}

.date-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* KPI Sublabel */
.kpi-sublabel {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 5px;
}

.kpi-sublabel span {
    color: var(--primary-light);
    font-weight: 600;
}

/* Chart Sizes */
.chart-container.chart-large {
    flex: 2;
}

.chart-container.chart-small {
    flex: 1;
    min-width: 300px;
}

.chart-container.chart-medium {
    flex: 1;
}

.dashboard-charts {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

/* Chart Legend Custom */
.chart-legend-custom {
    display: flex;
    gap: 15px;
    font-size: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--gray-400);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.chart-subtitle {
    font-size: 12px;
    color: var(--gray-500);
    font-weight: normal;
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stats-card {
    background: var(--dark-light);
    border: 1px solid var(--gray-800);
    border-radius: var(--border-radius);
    padding: 20px;
}

.stats-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--gray-800);
}

.stats-header i {
    color: var(--primary);
    font-size: 18px;
}

.stats-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-300);
}

.stats-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    font-size: 13px;
    color: var(--gray-500);
}

.stat-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--white);
}

.stat-value.status-online {
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-value.status-online i {
    font-size: 8px;
    animation: pulse 2s infinite;
}

/* Activity Meta */
.activity-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 5px;
    font-size: 12px;
}

.entity-badge {
    background: rgba(91, 191, 204, 0.2);
    color: var(--primary-light);
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: capitalize;
}

.tokens-badge {
    color: var(--gray-500);
}

/* Loading & Error States */
.loading-message,
.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    color: var(--gray-500);
}

.loading-message i,
.error-message i {
    font-size: 32px;
    margin-bottom: 15px;
}

.error-message i {
    color: var(--warning);
}

.btn-retry {
    margin-top: 15px;
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-retry:hover {
    background: var(--primary-dark);
}

/* ========================================
   ENHANCED HISTORIAL STYLES
   ======================================== */

/* Total Badge */
.total-badge {
    background: var(--primary);
    color: var(--white);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

/* Filter Button */
.btn-filter-apply {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    align-self: flex-end;
}

.btn-filter-apply:hover {
    background: var(--primary-dark);
}

/* History Stats */
.history-stats {
    display: flex;
    gap: 30px;
    background: var(--dark-light);
    border: 1px solid var(--gray-800);
    border-radius: var(--border-radius);
    padding: 20px 30px;
}

.stat-mini {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-mini i {
    font-size: 20px;
    color: var(--primary);
}

.stat-mini span {
    font-size: 20px;
    font-weight: 700;
    color: var(--white);
}

.stat-mini small {
    font-size: 12px;
    color: var(--gray-500);
    margin-left: 5px;
}

/* Enhanced Tags */
.tag-entity {
    background: rgba(91, 191, 204, 0.2);
    color: #7DD3DE;
    text-transform: capitalize;
}

.tag-tokens {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.tag-time {
    background: rgba(14, 165, 233, 0.2);
    color: #38bdf8;
}

/* History Actions Enhanced */
.history-actions {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.btn-action.expand {
    background: transparent;
    color: var(--gray-500);
}

.btn-action.expand:hover {
    background: var(--gray-800);
    color: var(--primary);
}

/* Responsive Stats Row */
@media (max-width: 1200px) {
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-row {
        grid-template-columns: 1fr;
    }
    
    .history-stats {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .dashboard-charts {
        flex-direction: column;
    }
    
    .chart-container.chart-large,
    .chart-container.chart-small,
    .chart-container.chart-medium {
        flex: 1;
        min-width: 100%;
    }
}

/* ========================================
   LIGHT THEME STYLES
   ======================================== */

/* Light Theme Variables */
body.theme-light,
[data-theme="light"] {
    --dark: #ffffff;
    --dark-light: #f8fafc;
    --gray-900: #f1f5f9;
    --gray-800: #e2e8f0;
    --gray-700: #cbd5e1;
    --gray-600: #94a3b8;
    --gray-500: #64748b;
    --gray-400: #475569;
    --gray-300: #334155;
    --gray-200: #1e293b;
    --gray-100: #0f172a;
    --white: #0f172a;
}

/* Light Theme Specific Overrides */
body.theme-light {
    background: #f1f5f9;
    color: #1e293b;
}

body.theme-light .sidebar {
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
}

body.theme-light .sidebar-header h2,
body.theme-light .nav-item span,
body.theme-light .user-name {
    color: #1e293b;
}

body.theme-light .nav-item {
    color: #64748b;
}

body.theme-light .nav-item:hover,
body.theme-light .nav-item.active {
    background: rgba(91, 191, 204, 0.1);
    color: #5BBFCC;
}

body.theme-light .main-content {
    background: #f1f5f9;
}

body.theme-light .main-header h1,
body.theme-light .kpi-value,
body.theme-light .chart-header h3,
body.theme-light .settings-header h3,
body.theme-light .activity-text,
body.theme-light .history-query {
    color: #1e293b;
}

body.theme-light .main-header p,
body.theme-light .kpi-label,
body.theme-light .activity-time,
body.theme-light .toggle-description {
    color: #64748b;
}

body.theme-light .kpi-card,
body.theme-light .chart-container,
body.theme-light .settings-card,
body.theme-light .activity-section,
body.theme-light .history-item,
body.theme-light .stats-card,
body.theme-light .filters-section,
body.theme-light .history-stats {
    background: #ffffff;
    border-color: #e2e8f0;
}

body.theme-light .activity-item,
body.theme-light .setting-input,
body.theme-light .filter-input {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #1e293b;
}

body.theme-light .setting-input:focus,
body.theme-light .filter-input:focus {
    border-color: #5BBFCC;
}

body.theme-light .btn-icon {
    background: #f8fafc;
    color: #64748b;
    border-color: #e2e8f0;
}

body.theme-light .btn-icon:hover {
    background: #e2e8f0;
    color: #5BBFCC;
}

body.theme-light .btn-secondary {
    background: #f8fafc;
    color: #1e293b;
    border-color: #e2e8f0;
}

body.theme-light .btn-secondary:hover {
    background: #e2e8f0;
}

body.theme-light .theme-btn {
    background: #f8fafc;
    color: #64748b;
    border-color: #e2e8f0;
}

body.theme-light .theme-btn:hover,
body.theme-light .theme-btn.active {
    background: #5BBFCC;
    color: #ffffff;
    border-color: #5BBFCC;
}

body.theme-light .info-grid {
    background: #f8fafc;
}

body.theme-light .info-label {
    color: #64748b;
}

body.theme-light .info-value {
    color: #1e293b;
}

body.theme-light .toast {
    background: #1e293b;
    color: #ffffff;
}

body.theme-light .history-response,
body.theme-light .stat-label {
    color: #64748b;
}

body.theme-light .stat-value {
    color: #1e293b;
}

body.theme-light .tag {
    background: rgba(91, 191, 204, 0.1);
}

body.theme-light .history-icon,
body.theme-light .activity-icon,
body.theme-light .kpi-icon {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Light Theme Login Page */
body.theme-light.login-page {
    background: #f1f5f9;
}

body.theme-light .login-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

body.theme-light .login-form input {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #1e293b;
}

body.theme-light .login-form input::placeholder {
    color: #94a3b8;
}

body.theme-light .login-title,
body.theme-light .info-panel h3 {
    color: #1e293b;
}

body.theme-light .login-subtitle,
body.theme-light .info-panel p,
body.theme-light .feature-item span {
    color: #64748b;
}

body.theme-light .info-panel {
    background: linear-gradient(135deg, #5BBFCC 0%, #3BA8B6 100%);
}

body.theme-light .info-panel h3,
body.theme-light .info-panel p,
body.theme-light .feature-item span {
    color: #ffffff;
}

/* Light Theme Query Page */
body.theme-light .response-section,
body.theme-light .charts-section {
    background: #ffffff;
    border-color: #e2e8f0;
}

body.theme-light .response-text {
    color: #1e293b;
}

body.theme-light .response-text h1,
body.theme-light .response-text h2,
body.theme-light .response-text h3,
body.theme-light .response-text h4 {
    color: #1e293b;
}

body.theme-light .response-text strong {
    color: #5BBFCC;
}

body.theme-light .response-text code {
    background: #f1f5f9;
}

body.theme-light .response-text pre {
    background: #f1f5f9;
}

body.theme-light .response-text th,
body.theme-light .response-text td {
    border-color: #e2e8f0;
}

body.theme-light .response-text th {
    background: #f1f5f9;
}

body.theme-light .query-form textarea {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #1e293b;
}

body.theme-light .query-form textarea:focus {
    border-color: #5BBFCC;
}

body.theme-light .query-form textarea::placeholder {
    color: #94a3b8;
}

body.theme-light .chart-card {
    background: #f8fafc;
    border-color: #e2e8f0;
}

body.theme-light .chart-expand-btn {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #64748b;
}

body.theme-light .chart-modal-content {
    background: #ffffff;
    border-color: #e2e8f0;
}

body.theme-light .chart-modal-header {
    border-color: #e2e8f0;
}

body.theme-light .chart-modal-header h3 {
    color: #1e293b;
}

body.theme-light .chart-modal-close {
    border-color: #e2e8f0;
    color: #64748b;
}

body.theme-light .chart-explanation-panel {
    border-color: #e2e8f0;
}

body.theme-light .explanation-header {
    border-color: #e2e8f0;
}

body.theme-light .explanation-content {
    color: #475569;
}

body.theme-light .chart-metadata {
    background: #f8fafc;
}

body.theme-light .metadata-label {
    color: #64748b;
}

body.theme-light .metadata-value {
    color: #334155;
}

body.theme-light .chart-modal-body-split {
    background: #ffffff;
}

/* Light Theme Scrollbar */
body.theme-light ::-webkit-scrollbar-track {
    background: #f1f5f9;
}

body.theme-light ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
}

body.theme-light ::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Smooth Theme Transition */
body,
body * {
    transition: background-color 0.3s ease, 
                border-color 0.3s ease, 
                color 0.3s ease,
                box-shadow 0.3s ease;
}

/* ========================================
   REGISTRATION, VERIFICATION & PLATFORMS
   ======================================== */

/* Register Card */
.register-card,
.verify-card,
.platforms-card {
    max-width: 450px;
    margin: 0 auto;
    border-radius: var(--border-radius) !important;
}

.verify-card {
    max-width: 420px;
}

.platforms-card {
    max-width: 650px;
}

.register-form .form-row {
    margin-bottom: 16px;
}

/* Progress Steps */
.register-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 25px 0;
    padding: 0 10px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.step.active,
.step.completed {
    opacity: 1;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-700);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-400);
    transition: all 0.3s ease;
}

.step.active .step-number {
    background: var(--gradient-2);
    color: white;
    box-shadow: 0 0 20px rgba(91, 191, 204, 0.4);
}

.step.completed .step-number {
    background: var(--accent);
    color: white;
}

.step span {
    font-size: 12px;
    color: var(--gray-500);
}

.step.active span,
.step.completed span {
    color: var(--gray-300);
}

.step-line {
    flex: 1;
    height: 2px;
    background: var(--gray-700);
    max-width: 60px;
    transition: all 0.3s ease;
}

.step-line.active {
    background: var(--gradient-2);
}

/* Password Strength */
.password-strength {
    margin: -10px 0 16px;
    padding: 0 5px;
}

.strength-bar {
    height: 4px;
    background: var(--gray-700);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}

.strength-fill {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.strength-text {
    font-size: 12px;
    color: var(--gray-500);
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 5px;
    z-index: 2;
}

.password-toggle:hover {
    color: var(--primary);
}

/* Input Validation Icon */
.input-validation {
    position: absolute;
    right: 45px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
}

/* Terms Checkbox */
.terms-check {
    margin: 20px 0;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 13px;
    color: var(--gray-400);
    line-height: 1.5;
}

.checkbox-container input {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid var(--gray-600);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.checkbox-container input:checked + .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-container input:checked + .checkmark::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 12px;
    color: white;
}

/* Links */
.link {
    color: var(--primary-light);
    text-decoration: none;
    transition: color 0.2s ease;
}

.link:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Alert Close Button */
.alert-close {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
    padding: 5px;
    margin-left: auto;
}

.alert-close:hover {
    opacity: 1;
}

.alert {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ========================================
   VERIFICATION PAGE
   ======================================== */

.verify-card {
    max-width: 420px;
}

.verify-icon {
    background: var(--gradient-3) !important;
}

.verify-email-info {
    text-align: center;
    margin: 20px 0;
}

.verify-email-info p {
    color: var(--gray-400);
    font-size: 14px;
    margin-bottom: 8px;
}

.email-display {
    color: var(--primary-light);
    font-weight: 600;
    font-size: 16px;
}

/* Code Inputs */
.verify-form {
    margin: 25px 0;
}

.verify-form .login-btn {
    width: 100%;
    justify-content: center;
}

.code-inputs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 25px;
}

.code-input {
    width: 52px;
    height: 64px;
    border: 2px solid var(--gray-700);
    border-radius: 12px;
    background: var(--dark-light);
    color: var(--white);
    font-size: 26px;
    font-weight: 700;
    text-align: center;
    outline: none;
    transition: all 0.2s ease;
}

.code-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(91, 191, 204, 0.2);
}

.code-input:not(:placeholder-shown) {
    border-color: var(--primary-light);
}

/* Resend Section */
.resend-section {
    text-align: center;
    margin-top: 25px;
}

.resend-section p {
    color: var(--gray-500);
    font-size: 14px;
    margin-bottom: 10px;
}

.resend-btn {
    background: transparent;
    border: 1px solid var(--gray-600);
    color: var(--primary-light);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.resend-btn:hover:not(:disabled) {
    background: rgba(91, 191, 204, 0.1);
    border-color: var(--primary);
}

.resend-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.resend-timer {
    color: var(--gray-500);
    font-size: 13px;
}

.resend-timer span {
    color: var(--primary-light);
    font-weight: 600;
}

/* ========================================
   PLATFORMS PAGE
   ======================================== */

.platforms-container {
    max-width: 800px;
    justify-content: center;
}

.platforms-card {
    width: 100%;
    max-width: 750px;
    padding: 30px 40px;
}

.platforms-card .logo-section {
    margin-bottom: 20px;
}

.platforms-card .logo-icon {
    width: 60px;
    height: 60px;
    font-size: 28px;
    margin-bottom: 15px;
}

.platforms-card .logo-title {
    font-size: 24px;
}

.platforms-card .register-steps {
    margin: 15px 0;
}

.platforms-card .login-footer {
    margin-top: 15px;
}

.success-icon {
    background: linear-gradient(135deg, #22c55e, #10b981) !important;
}

/* Platforms Grid */
.platforms-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.platform-card {
    background: var(--dark-light);
    border: 2px solid var(--gray-700);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.platform-card:hover:not(.coming-soon) {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.platform-card.selected {
    border-color: var(--accent);
    background: rgba(34, 197, 94, 0.05);
}

.platform-card.coming-soon {
    opacity: 0.6;
}

.platform-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--gradient-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    margin-bottom: 12px;
}

.platform-card.coming-soon .platform-icon {
    background: var(--gray-600);
}

.platform-info h3 {
    color: var(--white);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.platform-info p {
    color: var(--gray-500);
    font-size: 12px;
    line-height: 1.4;
}

.platform-status {
    margin: 8px 0;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.available {
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent);
}

.status-badge.coming {
    background: rgba(107, 114, 128, 0.2);
    color: var(--gray-400);
}

.platform-btn {
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.platform-btn.select-btn {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary-light);
}

.platform-btn.select-btn:hover {
    background: var(--primary);
    color: white;
}

.platform-btn.selected-btn {
    background: var(--accent);
    border: 1px solid var(--accent);
    color: white;
}

.platform-btn.disabled {
    background: var(--gray-700);
    border: 1px solid var(--gray-600);
    color: var(--gray-500);
    cursor: not-allowed;
}

/* Selected Summary */
.selected-summary {
    background: rgba(91, 191, 204, 0.1);
    border: 1px solid rgba(91, 191, 204, 0.3);
    border-radius: 10px;
    padding: 12px 15px;
    margin: 15px 0;
}

.selected-summary h4 {
    color: var(--primary-light);
    font-size: 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.selected-tag {
    background: var(--primary);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.selected-tag i {
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.selected-tag i:hover {
    opacity: 1;
}

/* Platforms Actions */
.platforms-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.skip-btn {
    flex: 1;
}

.continue-btn {
    flex: 2;
}

.continue-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Login Footer Improvements */
.login-footer .secure-text {
    margin-top: 10px;
    font-size: 12px;
    color: var(--gray-500);
}

/* ========================================
   LIGHT THEME - REGISTRATION
   ======================================== */

body.theme-light .step-number {
    background: var(--gray-200);
    color: var(--gray-500);
}

body.theme-light .step-line {
    background: var(--gray-300);
}

body.theme-light .step span {
    color: var(--gray-500);
}

body.theme-light .step.active span,
body.theme-light .step.completed span {
    color: var(--gray-700);
}

body.theme-light .strength-bar {
    background: var(--gray-200);
}

body.theme-light .checkmark {
    border-color: var(--gray-400);
}

body.theme-light .checkbox-container {
    color: var(--gray-600);
}

body.theme-light .code-input {
    background: var(--white);
    border-color: var(--gray-300);
    color: var(--gray-900);
}

body.theme-light .code-input:focus {
    border-color: var(--primary);
}

body.theme-light .verify-email-info p {
    color: var(--gray-600);
}

body.theme-light .resend-btn {
    border-color: var(--gray-300);
}

body.theme-light .resend-section p,
body.theme-light .resend-timer {
    color: var(--gray-600);
}

body.theme-light .platform-card {
    background: var(--white);
    border-color: var(--gray-200);
}

body.theme-light .platform-card:hover:not(.coming-soon) {
    border-color: var(--primary);
}

body.theme-light .platform-card.selected {
    background: rgba(34, 197, 94, 0.05);
    border-color: var(--accent);
}

body.theme-light .platform-info h3 {
    color: var(--gray-900);
}

body.theme-light .platform-info p {
    color: var(--gray-600);
}

body.theme-light .platform-btn.disabled {
    background: var(--gray-100);
    border-color: var(--gray-200);
    color: var(--gray-400);
}

body.theme-light .selected-summary {
    background: rgba(91, 191, 204, 0.05);
    border-color: rgba(91, 191, 204, 0.2);
}

/* Responsive */
@media (max-width: 600px) {
    .platforms-grid {
        grid-template-columns: 1fr;
    }
    
    .code-input {
        width: 42px;
        height: 52px;
        font-size: 20px;
    }
    
    .register-steps {
        gap: 5px;
    }
    
    .step-number {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .step span {
        font-size: 10px;
    }
    
    .platforms-actions {
        flex-direction: column;
    }
}

/* ========================================
   ADMIN DASHBOARD
   ======================================== */

.admin-nav-item {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05)) !important;
    border-left: 3px solid var(--danger) !important;
}

.admin-nav-item i {
    color: var(--danger) !important;
}

/* Admin Tabs */
.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--gray-700);
    padding-bottom: 15px;
}

.admin-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: 1px solid var(--gray-700);
    border-radius: 8px;
    color: var(--gray-400);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-tab:hover {
    background: var(--dark-light);
    color: var(--white);
}

.admin-tab.active {
    background: var(--gradient-2);
    border-color: transparent;
    color: var(--white);
}

.admin-tab i {
    font-size: 16px;
}

/* Tab Content */
.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Admin Stats Grid */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.admin-stat-card {
    background: var(--dark-light);
    border: 1px solid var(--gray-700);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}

.admin-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.users { background: linear-gradient(135deg, #818cf8, #6366f1); color: white; }
.stat-icon.verified { background: linear-gradient(135deg, #22c55e, #16a34a); color: white; }
.stat-icon.active { background: linear-gradient(135deg, #5BBFCC, #3BA8B6); color: white; }
.stat-icon.new { background: linear-gradient(135deg, #f59e0b, #d97706); color: white; }
.stat-icon.queries { background: linear-gradient(135deg, #8b5cf6, #7c3aed); color: white; }
.stat-icon.tokens { background: linear-gradient(135deg, #ec4899, #db2777); color: white; }
.stat-icon.today { background: linear-gradient(135deg, #06b6d4, #0891b2); color: white; }
.stat-icon.errors { background: linear-gradient(135deg, #ef4444, #dc2626); color: white; }

.stat-content {
    flex: 1;
}

.stat-content .stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--white);
    line-height: 1.2;
}

.stat-content .stat-label {
    display: block;
    font-size: 13px;
    color: var(--gray-400);
    margin-top: 4px;
}

/* Admin Charts */
.admin-charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.admin-chart-card {
    background: var(--dark-light);
    border: 1px solid var(--gray-700);
    border-radius: 16px;
    padding: 20px;
}

.admin-chart-card.wide {
    grid-column: 1 / -1;
}

.admin-chart-card h3 {
    color: var(--white);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-chart-card h3 i {
    color: var(--primary);
}

.admin-chart-card canvas {
    height: 250px !important;
}

/* Quick Stats */
.admin-quick-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.quick-stat {
    background: var(--dark-light);
    border: 1px solid var(--gray-700);
    border-radius: 12px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.quick-stat i {
    font-size: 24px;
    color: var(--primary);
}

.quick-stat .quick-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--white);
}

.quick-stat .quick-label {
    display: block;
    font-size: 12px;
    color: var(--gray-400);
}

/* Users Table */
.users-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-500);
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    background: var(--dark-light);
    border: 1px solid var(--gray-700);
    border-radius: 10px;
    color: var(--white);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.search-box input:focus {
    border-color: var(--primary);
}

.toolbar-stats {
    color: var(--gray-400);
    font-size: 14px;
}

.users-table-container {
    background: var(--dark-light);
    border: 1px solid var(--gray-700);
    border-radius: 16px;
    overflow: hidden;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table thead {
    background: rgba(91, 191, 204, 0.1);
}

.users-table th {
    padding: 15px;
    text-align: left;
    color: var(--gray-300);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.users-table td {
    padding: 15px;
    border-top: 1px solid var(--gray-700);
    color: var(--gray-300);
    font-size: 14px;
}

.users-table tbody tr:hover {
    background: rgba(91, 191, 204, 0.05);
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--gradient-2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
}

.user-cell .user-name {
    display: block;
    color: var(--white);
    font-weight: 500;
}

.user-cell .user-username {
    display: block;
    color: var(--gray-500);
    font-size: 12px;
}

.status-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge.verified {
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent);
}

.badge.pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.badge.active {
    background: rgba(91, 191, 204, 0.15);
    color: var(--primary-light);
}

.badge.inactive {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-action {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-action.danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.btn-action.danger:hover {
    background: var(--danger);
    color: white;
}

.btn-action.success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent);
}

.btn-action.success:hover {
    background: var(--accent);
    color: white;
}

.btn-action.primary {
    background: rgba(91, 191, 204, 0.15);
    color: var(--primary);
}

.btn-action.primary:hover {
    background: var(--primary);
    color: white;
}

.btn-action.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.btn-action.warning:hover {
    background: var(--warning);
    color: white;
}

.btn-action.delete {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

.btn-action.delete:hover {
    background: #dc2626;
    color: white;
}

/* Admin Badge */
.badge.admin {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(245, 158, 11, 0.2));
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.admin-badge-icon {
    color: #fbbf24;
    font-size: 12px;
    margin-left: 6px;
}

.admin-row {
    background: rgba(245, 158, 11, 0.03) !important;
}

.admin-row:hover {
    background: rgba(245, 158, 11, 0.08) !important;
}

.user-avatar-small.admin-avatar {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: translateX(120%);
    transition: transform 0.3s ease;
    z-index: 10000;
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
}

.toast-error {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: white;
}

.toast-info {
    background: linear-gradient(135deg, #3BA8B6, #5BBFCC);
    color: white;
}

/* =========================================
   ALERTAS, REPORTES Y NOTIFICACIONES
   ========================================= */

/* Alert Items */
.alert-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    background: var(--bg-dark);
    border-left: 4px solid var(--text-muted);
    transition: all 0.2s ease;
}

.alert-item:hover {
    background: var(--bg-darker);
}

.alert-item.severity-critical {
    border-left-color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
}

.alert-item.severity-critical .alert-icon {
    background: rgba(220, 38, 38, 0.2);
    color: #dc2626;
}

.alert-item.severity-high,
.alert-item.severity-warning {
    border-left-color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.alert-item.severity-warning .alert-icon,
.alert-item.severity-high .alert-icon {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.alert-item.severity-medium,
.alert-item.severity-info {
    border-left-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.alert-item.severity-info .alert-icon,
.alert-item.severity-medium .alert-icon {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.alert-item.severity-low {
    border-left-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.alert-item.severity-low .alert-icon {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.alert-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-darker);
    color: var(--primary);
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
    min-width: 0;
}

.alert-content strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.alert-content p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
}

.alert-content small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.btn-dismiss {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s;
}

.btn-dismiss:hover {
    color: #dc2626;
}

/* Threshold Settings */
.threshold-setting {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.threshold-setting label {
    flex: 1;
    color: var(--text-secondary);
}

.threshold-input {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-dark);
    color: var(--text-primary);
    text-align: center;
}

.threshold-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Report Items */
.report-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.report-item:hover {
    border-color: var(--primary);
}

.report-item.active {
    border-left: 3px solid var(--primary);
}

.report-item.inactive {
    opacity: 0.6;
    border-left: 3px solid var(--text-muted);
}

.report-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.report-info strong {
    color: var(--text-primary);
}

.report-frequency {
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 500;
}

.report-info small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.report-actions {
    display: flex;
    gap: 0.5rem;
}

.report-actions button {
    background: var(--bg-darker);
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.report-actions button:hover {
    background: var(--primary);
    color: white;
}

/* Button Group */
.button-group {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Section Description */
.section-description {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

/* No Data Message */
.no-data {
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
    font-style: italic;
}

/* Alerts List */
.alerts-list {
    max-height: 400px;
    overflow-y: auto;
}

/* Toggle Switch for Settings */
.toggle-setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.toggle-setting:last-child {
    border-bottom: none;
}

.toggle-setting label {
    color: var(--text-secondary);
}

.toggle-switch {
    position: relative;
    width: 48px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-darker);
    border: 1px solid var(--border);
    border-radius: 24px;
    transition: 0.3s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-muted);
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary);
    border-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
    background-color: white;
}

/* Setting Select */
.setting-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-dark);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.setting-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.toast i {
    font-size: 18px;
}

.loading-cell, .empty-cell {
    text-align: center;
    padding: 40px !important;
    color: var(--gray-500);
}

.loading-cell i, .empty-cell i {
    margin-right: 10px;
}

/* Users Pagination */
.users-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.page-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--gray-700);
    background: var(--dark-light);
    color: var(--gray-400);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-dots {
    color: var(--gray-500);
    display: flex;
    align-items: center;
    padding: 0 5px;
}

/* Top Users List */
.top-users-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.top-user-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    background: rgba(91, 191, 204, 0.05);
    border-radius: 10px;
}

.top-user-item .rank {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--gradient-2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 700;
}

.top-user-item .username {
    flex: 1;
    color: var(--white);
    font-weight: 500;
}

.top-user-item .user-stats {
    display: flex;
    gap: 20px;
    color: var(--gray-400);
    font-size: 13px;
}

.top-user-item .user-stats i {
    margin-right: 5px;
    color: var(--primary);
}

.empty-state {
    text-align: center;
    padding: 30px;
    color: var(--gray-500);
}

/* Light Theme - Admin */
body.theme-light .admin-stat-card,
body.theme-light .admin-chart-card,
body.theme-light .quick-stat,
body.theme-light .users-table-container {
    background: var(--white);
    border-color: var(--gray-200);
}

body.theme-light .stat-content .stat-value,
body.theme-light .quick-stat .quick-value,
body.theme-light .admin-chart-card h3,
body.theme-light .user-cell .user-name,
body.theme-light .top-user-item .username {
    color: var(--gray-900);
}

body.theme-light .users-table th {
    color: var(--gray-700);
}

body.theme-light .users-table td {
    border-color: var(--gray-200);
    color: var(--gray-600);
}

body.theme-light .users-table tbody tr:hover {
    background: rgba(91, 191, 204, 0.08);
}

body.theme-light .search-box input {
    background: var(--white);
    border-color: var(--gray-300);
    color: var(--gray-900);
}

body.theme-light .admin-tab {
    border-color: var(--gray-300);
    color: var(--gray-600);
}

body.theme-light .admin-tab:hover {
    background: var(--gray-100);
}

body.theme-light .page-btn {
    background: var(--white);
    border-color: var(--gray-300);
    color: var(--gray-600);
}

body.theme-light .top-user-item {
    background: rgba(91, 191, 204, 0.08);
}

/* Responsive Admin */
@media (max-width: 768px) {
    .admin-tabs {
        flex-wrap: wrap;
    }
    
    .admin-tab {
        flex: 1;
        justify-content: center;
        min-width: 100px;
    }
    
    .admin-charts-row {
        grid-template-columns: 1fr;
    }
    
    .users-table {
        font-size: 12px;
    }
    
    .users-table th,
    .users-table td {
        padding: 10px;
    }
    
    .user-cell {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* ========================================
   ADMIN PANEL - NEW TABS (Analytics, System, Logs, Subscriptions)
   ======================================== */

/* System Tab Styles */
.system-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.system-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--gray-200);
}

.system-items {
    display: flex;
    flex-direction: column;
}

.system-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-700);
}

.system-item:last-child {
    border-bottom: none;
}

.system-item .label {
    color: var(--gray-400);
    font-size: 0.9rem;
}

.system-item .value {
    font-weight: 600;
    color: var(--gray-200);
}

.status-online {
    color: #22c55e !important;
}

.status-offline {
    color: #ef4444 !important;
}

/* Logs Tab Styles */
.logs-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.log-filter-select {
    padding: 10px 16px;
    background: var(--dark-light);
    border: 1px solid var(--gray-700);
    border-radius: 8px;
    color: var(--gray-200);
    font-size: 14px;
    cursor: pointer;
    outline: none;
}

.log-filter-select:focus {
    border-color: var(--primary);
}

.btn-refresh {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--dark-light);
    border: 1px solid var(--gray-700);
    border-radius: 8px;
    color: var(--gray-200);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-refresh:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.logs-container {
    min-height: 400px;
}

.log-list {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 16px;
    max-height: 500px;
    overflow-y: auto;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 13px;
}

.log-entry {
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-700);
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-time {
    color: var(--gray-500);
    min-width: 70px;
    font-size: 12px;
}

.log-level {
    min-width: 60px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
}

.log-level.info {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.15);
}

.log-level.warn {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
}

.log-level.error {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

.log-level.success {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.15);
}

.log-message {
    color: var(--gray-300);
    flex: 1;
    word-break: break-word;
}

/* Responsive for new tabs */
@media (max-width: 768px) {
    .system-grid {
        grid-template-columns: 1fr;
    }
    
    .logs-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .log-entry {
        flex-direction: column;
        gap: 8px;
    }
    
    .log-time, .log-level {
        min-width: auto;
    }
}

/* ========================================
   MODAL: EDITAR CONSULTAS GRATUITAS
   ======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-overlay.show {
    display: flex;
}

.modal-container {
    background: var(--dark-light);
    border: 1px solid var(--gray-700);
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-700);
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 i {
    color: var(--primary);
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--gray-400);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.modal-body {
    padding: 24px;
}

.user-info-card {
    background: rgba(91, 191, 204, 0.1);
    border: 1px solid rgba(91, 191, 204, 0.3);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
}

.user-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(91, 191, 204, 0.2);
}

.user-info-row:last-child {
    border-bottom: none;
}

.user-info-row .label {
    color: var(--gray-400);
    font-size: 0.9rem;
}

.user-info-row .value {
    color: var(--white);
    font-weight: 600;
}

.user-info-row .value.highlight {
    color: var(--primary);
    font-size: 1.1rem;
}

.form-section {
    margin-bottom: 24px;
}

.form-section h4 {
    color: var(--white);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-help {
    color: var(--gray-400);
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.input-row {
    display: flex;
    gap: 12px;
}

.input-row input {
    flex: 1;
    padding: 12px 16px;
    background: var(--dark);
    border: 1px solid var(--gray-700);
    border-radius: 8px;
    color: var(--white);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.input-row input:focus {
    border-color: var(--primary);
}

.input-row input::placeholder {
    color: var(--gray-500);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(91, 191, 204, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(34, 197, 94, 0.3);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-600);
    color: var(--gray-300);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline.warning {
    border-color: var(--danger);
    color: #fca5a5;
}

.btn-outline.warning:hover {
    background: rgba(239, 68, 68, 0.1);
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.quick-actions .btn {
    justify-content: center;
}

/* Botón de consultas en tabla de usuarios */
.btn-queries {
    background: rgba(91, 191, 204, 0.15);
    color: var(--primary);
    padding: 6px 10px;
    border: 1px solid rgba(91, 191, 204, 0.3);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-queries:hover {
    background: rgba(91, 191, 204, 0.25);
    transform: translateY(-1px);
}

.queries-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(91, 191, 204, 0.15);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
}

.queries-badge.exhausted {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

/* Responsive Modal */
@media (max-width: 600px) {
    .modal-container {
        margin: 16px;
        max-height: calc(100vh - 32px);
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .input-row {
        flex-direction: column;
    }
}

/* Light Theme - Platform Connections */
body.theme-light .platform-card {
    background: #ffffff;
    border-color: #e2e8f0;
}

body.theme-light .platform-card:hover {
    border-color: #cbd5e1;
}

body.theme-light .platform-card.connected {
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.3);
}

body.theme-light .platform-icon {
    background: #f1f5f9;
}

body.theme-light .platform-card.connected .platform-icon {
    background: rgba(16, 185, 129, 0.15);
}

body.theme-light .connected-indicator {
    color: #5BBFCC;
}

body.theme-light .pulse-dot {
    background: #5BBFCC;
}

body.theme-light .platform-name {
    color: #1e293b;
}

body.theme-light .platform-desc {
    color: #64748b;
}

body.theme-light .btn-disconnect {
    border-color: #e2e8f0;
    color: #64748b;
}

body.theme-light .btn-disconnect:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

body.theme-light .btn-config {
    border-color: #e2e8f0;
    color: #64748b;
}

body.theme-light .btn-config:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
    color: #3b82f6;
}

body.theme-light .no-platforms,
body.theme-light .loading-platforms {
    color: #64748b;
}

/* Light Theme - Config Tabs */
body.theme-light .config-tabs {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

body.theme-light .config-tab {
    color: #64748b;
}

body.theme-light .config-tab:hover {
    color: #1e293b;
    background: #f1f5f9;
}

body.theme-light .config-tab.active {
    background: #5BBFCC;
    color: white;
}

body.theme-light .connections-intro h2 {
    color: #1e293b;
}

body.theme-light .connections-intro p {
    color: #64748b;
}

body.theme-light .connections-section {
    background: #ffffff;
    border-color: #e2e8f0;
}

body.theme-light .section-title {
    border-color: #e2e8f0;
}

body.theme-light .section-title h3 {
    color: #1e293b;
}

/* Light Theme - Platform Modal */
body.theme-light .platform-modal .modal-body {
    background: #ffffff;
}

body.theme-light .platform-description p {
    color: #64748b;
}

body.theme-light .platform-help {
    background: rgba(91, 191, 204, 0.1);
    border-color: rgba(91, 191, 204, 0.2);
}

body.theme-light .platform-form label {
    color: #1e293b;
}

body.theme-light .platform-form .form-input {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #1e293b;
}

body.theme-light .platform-form .form-input:focus {
    border-color: #5BBFCC;
}

body.theme-light .platform-form .form-input::placeholder {
    color: #94a3b8;
}

body.theme-light .field-hint {
    color: #64748b;
}

body.theme-light .modal-actions {
    border-color: #e2e8f0;
}