﻿/* ========================================
   CNID IA Estudio â€” Super Modern Theme
   Inspired by ChatGPT but next-gen
   ======================================== */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-tertiary: #16161f;
    --bg-card: rgba(22, 22, 31, 0.7);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --bg-hover: rgba(255, 255, 255, 0.05);
    --bg-active: rgba(255, 255, 255, 0.08);
    
    /* Light theme vars (toggled via class) */
    --light-bg-primary: #f8f9fb;
    --light-bg-secondary: #ffffff;
    --light-bg-tertiary: #f1f3f6;
    --light-text-primary: #111827;
    --light-text-secondary: #4b5563;
    --light-text-tertiary: #9ca3af;
    --light-border: rgba(0,0,0,0.08);

    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-medium: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.15);

    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b0;
    --text-tertiary: #6b6b7b;
    --text-muted: #4a4a5a;

    --accent-cyan: #06b6d4;
    --accent-violet: #8b5cf6;
    --accent-pink: #ec4899;
    --accent-green: #10b981;
    --accent-amber: #f59e0b;
    --accent-red: #ef4444;

    --gradient-primary: linear-gradient(135deg, #06b6d4, #8b5cf6);
    --gradient-glow: radial-gradient(circle at 50% 0%, rgba(6, 182, 212, 0.15), transparent 60%);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 20px rgba(6, 182, 212, 0.15);

    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Glassmorphism backgrounds (dark default) */
    --bg-glass-heavy: rgba(17, 17, 24, 0.98);
    --bg-glass-medium: rgba(17, 17, 24, 0.85);
    --bg-glass-light: rgba(10, 10, 15, 0.8);
    --bg-glass-toast: rgba(17, 17, 24, 0.95);
    --shadow-modal: 0 25px 50px rgba(0,0,0,0.5);
    --shadow-toast: var(--shadow-lg);

    --sidebar-width: 240px;
    --sidebar-collapsed: 0px;
    --header-height: 60px;
    --input-height: 64px;
}

/* ========================================
   LIGHT THEME
   ======================================== */
body.light-theme {
    --bg-primary: #f8f9fb;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f3f6;
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-glass: rgba(0, 0, 0, 0.02);
    --bg-hover: rgba(0, 0, 0, 0.04);
    --bg-active: rgba(0, 0, 0, 0.06);

    --border-subtle: rgba(0, 0, 0, 0.06);
    --border-medium: rgba(0, 0, 0, 0.1);
    --border-strong: rgba(0, 0, 0, 0.15);

    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-tertiary: #9ca3af;
    --text-muted: #6b7280;

    /* Light glassmorphism */
    --bg-glass-heavy: rgba(255, 255, 255, 0.98);
    --bg-glass-medium: rgba(255, 255, 255, 0.92);
    --bg-glass-light: rgba(248, 249, 251, 0.9);
    --bg-glass-toast: rgba(255, 255, 255, 0.98);
    --shadow-modal: 0 25px 50px rgba(0,0,0,0.12);
    --shadow-toast: 0 8px 30px rgba(0,0,0,0.15);

    --gradient-glow: radial-gradient(circle at 50% 0%, rgba(6, 182, 212, 0.08), transparent 60%);
}

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

/* Splash Screen */
.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s;
}

.splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-content {
    text-align: center;
    animation: splash-in 0.6s ease;
}

@keyframes splash-in {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.splash-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    color: var(--accent-cyan);
    position: relative;
}

.splash-logo svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 20px rgba(6, 182, 212, 0.5));
}

.splash-path {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: draw-path 1.5s ease forwards;
}

@keyframes draw-path {
    to { stroke-dashoffset: 0; }
}

.splash-fill {
    opacity: 0;
    animation: fade-fill 0.5s ease 1s forwards;
}

.splash-dot {
    transform: scale(0);
    transform-origin: center;
    animation: pop-dot 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) 1.2s forwards;
}

@keyframes fade-fill {
    to { opacity: 0.4; }
}

@keyframes pop-dot {
    to { transform: scale(1); }
}

.splash-title {
    font-size: 24px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
}

.splash-subtitle {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 32px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.splash-loader {
    width: 200px;
    height: 2px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    margin: 0 auto;
    overflow: hidden;
}

.splash-bar {
    height: 100%;
    width: 0;
    background: var(--gradient-primary);
    border-radius: 2px;
    animation: load-bar 2s ease-in-out forwards;
}

@keyframes load-bar {
    0% { width: 0; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    background: var(--bg-glass-toast);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-medium);
    box-shadow: var(--shadow-toast);
    font-size: 13px;
    color: var(--text-primary);
    pointer-events: all;
    animation: toast-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    max-width: 360px;
}

.toast.hiding {
    animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(40px) scale(0.95); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toast-out {
    to { opacity: 0; transform: translateX(40px) scale(0.95); }
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
}

.toast-success .toast-icon { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.toast-error .toast-icon { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }
.toast-info .toast-icon { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }
.toast-warning .toast-icon { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }

.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.toast-close:hover {
    color: var(--text-primary);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background 0.5s ease, color 0.5s ease;
}

/* Animated background mesh */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 40%, rgba(6, 182, 212, 0.08), transparent),
        radial-gradient(ellipse 60% 40% at 80% 60%, rgba(139, 92, 246, 0.06), transparent),
        radial-gradient(ellipse 50% 60% at 50% 100%, rgba(236, 72, 153, 0.04), transparent);
    animation: bg-drift 20s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes bg-drift {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(2%, -1%) scale(1.02); }
    66% { transform: translate(-1%, 2%) scale(0.98); }
    100% { transform: translate(1%, 1%) scale(1.01); }
}

/* Floating orbs */
.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
}
.orb-1 {
    width: 400px;
    height: 400px;
    background: rgba(6, 182, 212, 0.15);
    top: -10%;
    left: -5%;
    animation: orb-float-1 25s ease-in-out infinite;
}
.orb-2 {
    width: 300px;
    height: 300px;
    background: rgba(139, 92, 246, 0.12);
    bottom: 10%;
    right: -5%;
    animation: orb-float-2 30s ease-in-out infinite;
}
.orb-3 {
    width: 250px;
    height: 250px;
    background: rgba(236, 72, 153, 0.08);
    top: 40%;
    left: 50%;
    animation: orb-float-3 22s ease-in-out infinite;
}

@keyframes orb-float-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(60px, 40px) scale(1.1); }
}
@keyframes orb-float-2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-40px, -60px) scale(0.9); }
}
@keyframes orb-float-3 {
    0%, 100% { transform: translate(-50%, 0) scale(1); }
    50% { transform: translate(-50%, -30px) scale(1.15); }
}

#app {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.2);
}

/* Shimmer effect for loading/featured elements */
.shimmer {
    position: relative;
    overflow: hidden;
}
.shimmer::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transform: translateX(-100%);
    animation: shimmer 2.5s infinite;
}
@keyframes shimmer {
    100% { transform: translateX(100%); }
}

/* Glow text animation */
.glow-text {
    animation: text-glow 3s ease-in-out infinite alternate;
}
@keyframes text-glow {
    from { text-shadow: 0 0 10px rgba(6, 182, 212, 0.3); }
    to { text-shadow: 0 0 20px rgba(6, 182, 212, 0.6), 0 0 40px rgba(139, 92, 246, 0.2); }
}

/* Card hover lift with glow */
.hover-glow {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.hover-glow:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4), 0 0 30px rgba(6, 182, 212, 0.1);
}

/* Magnetic button effect base */
.magnetic {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Particle canvas behind chat */
#particleCanvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.3;
}

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-glass-medium);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform 0.3s ease, width 0.3s ease;
    position: relative;
    z-index: 100;
}

.sidebar.collapsed {
    width: 0;
    transform: translateX(-100%);
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--border-subtle);
}

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

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--accent-cyan);
    filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.4));
}

.logo-icon svg {
    width: 100%;
    height: 100%;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.logo-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-subtitle {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-tertiary);
    letter-spacing: 1.5px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-new-chat {
    margin: 12px 16px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-medium);
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-new-chat:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px;
}

.nav-section {
    margin-bottom: 20px;
}

.nav-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 0 8px;
    margin-bottom: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    position: relative;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--bg-active);
    color: var(--text-primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    background: var(--gradient-primary);
    border-radius: 0 3px 3px 0;
}

.nav-item svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-item.active svg {
    opacity: 1;
    color: var(--accent-cyan);
}

.nav-badge {
    margin-left: auto;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 20px;
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
}

.nav-badge.new {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
}

.nav-badge.pulse {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Chat History */
.chat-history {
    padding: 0 16px;
    margin-bottom: 12px;
}

.history-list {
    margin-top: 8px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: var(--radius-md);
    color: var(--text-tertiary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item:hover {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.history-item.active {
    background: var(--bg-active);
    color: var(--text-primary);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-subtle);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: white;
    position: relative;
}

.user-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
}

.user-status.online {
    background: var(--accent-green);
}

.user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

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

.mi-plan-card {
    margin: 0 12px 12px;
    padding: 12px;
    border-radius: var(--radius-lg);
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
}

.mi-plan-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.mi-plan-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.mi-plan-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.mi-plan-badge.gratis {
    background: rgba(16, 185, 129, 0.12);
    color: var(--accent-green);
}

.mi-plan-badge.premium {
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent-amber);
}

.mi-plan-body {
    margin-bottom: 10px;
}

.mi-plan-counter {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.mi-plan-counter span:first-child {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

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

.mi-plan-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 2px;
}

.mi-plan-bar {
    height: 4px;
    border-radius: 2px;
    background: var(--bg-tertiary);
    overflow: hidden;
    margin-bottom: 6px;
}

.mi-plan-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.mi-plan-fill.warning {
    background: var(--accent-amber);
}

.mi-plan-fill.danger {
    background: var(--accent-red);
}

.mi-plan-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

.mi-plan-upgrade {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-medium);
    background: transparent;
    color: var(--accent-amber);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.mi-plan-upgrade:hover {
    background: rgba(245, 158, 11, 0.08);
    border-color: var(--accent-amber);
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    background: var(--bg-primary);
}

.main-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 400px;
    background: var(--gradient-glow);
    pointer-events: none;
    z-index: 0;
}

/* Mobile Header */
.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-secondary);
    z-index: 10;
}

.mobile-title {
    font-size: 15px;
    font-weight: 600;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mobile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

/* Views */
.view {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
    position: relative;
    z-index: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(12px) scale(0.98);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.view.active {
    display: flex;
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ========================================
   CHAT VIEW
   ======================================== */
#view-chat {
    padding: 0;
    max-width: 100%;
    margin: 0;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-glass-light);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.model-selector {
    position: relative;
}

.model-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.model-btn:hover {
    background: var(--bg-hover);
}

.model-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.model-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 280px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    padding: 8px;
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 50;
}

.model-dropdown.show {
    display: block;
    animation: dropdown-in 0.2s ease;
}

@keyframes dropdown-in {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.model-option {
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.model-option:hover {
    background: var(--bg-hover);
}

.model-option.active {
    background: var(--bg-active);
}

.model-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.model-desc {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.chat-header-actions {
    display: flex;
    gap: 4px;
}

/* Messages Area */
.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Welcome Screen */
.welcome-screen {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.welcome-content {
    text-align: center;
    max-width: 600px;
    animation: welcome-in 0.6s ease;
}

@keyframes welcome-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.welcome-logo {
    position: relative;
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    color: var(--accent-cyan);
}

.logo-glow {
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.3), transparent 70%);
    animation: glow-pulse 3s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.welcome-logo svg {
    position: relative;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 12px rgba(6, 182, 212, 0.4));
}

.welcome-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #f0f0f5, #a0a0b0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.6;
}

.suggestions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.suggestion-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
}

.suggestion-card:hover {
    background: var(--bg-hover);
    border-color: var(--border-medium);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.suggestion-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--icon-color, var(--accent-cyan));
    flex-shrink: 0;
}

/* Chat Messages */
.message {
    display: flex;
    gap: 16px;
    padding: 4px 20px;
    animation: message-in 0.3s ease;
}

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

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

.message.user .message-avatar {
    background: var(--gradient-primary);
    color: white;
}

.message.assistant .message-avatar {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-medium);
    color: var(--accent-cyan);
}

.message-content {
    max-width: 80%;
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    line-height: 1.7;
    word-wrap: break-word;
}

.message.user .message-content {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-bottom-right-radius: 4px;
}

.message.assistant .message-content {
    background: transparent;
    padding-left: 0;
}

.message-content p {
    margin-bottom: 12px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

/* Thinking / Loading */
.message-thinking {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 0;
}

.thinking-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: thinking-bounce 1.4s ease-in-out infinite;
}

.thinking-dot:nth-child(2) { animation-delay: 0.2s; }
.thinking-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes thinking-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* ================================
   CHAT INPUT — Estilo ChatGPT
   ================================ */
.input-area {
    padding: 8px 16px 16px;
    position: relative;
    z-index: 10;
    max-width: 768px;
    margin: 0 auto;
    width: 100%;
}

.chat-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-input-box {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    padding: 10px 14px 10px 12px;
    border-radius: 24px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 1px transparent, 0 2px 12px rgba(0,0,0,0.15);
    transition: all 0.25s ease;
    position: relative;
}

.chat-input-box:focus-within {
    border-color: rgba(6, 182, 212, 0.4);
    box-shadow: 0 0 0 1px rgba(6, 182, 212, 0.15), 0 2px 16px rgba(6, 182, 212, 0.08);
}

.chat-input-field {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    resize: none;
    max-height: 200px;
    padding: 6px 4px;
    line-height: 1.5;
    min-height: 24px;
}

.chat-input-field::placeholder {
    color: var(--text-muted);
}

.chat-input-tool {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    margin-bottom: 2px;
}

.chat-input-tool:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.chat-input-right {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    margin-bottom: 2px;
}

.chat-input-send {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--gradient-primary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    margin-left: 2px;
}

.chat-input-send:hover {
    filter: brightness(1.15);
    transform: scale(1.05);
}

.chat-input-send:active {
    transform: scale(0.95);
}

.chat-input-send:disabled {
    background: var(--border-medium);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

.chat-input-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 0 0;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
}

/* ================================
   AUDIO RECORDER OVERLAY
   ================================ */
.audio-recorder-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.audio-recorder-box {
    background: var(--bg-secondary);
    border-radius: 24px;
    padding: 24px 32px;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    min-width: 320px;
    animation: scaleIn 0.2s ease;
}

.audio-recorder-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.audio-recorder-header span {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.audio-recorder-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-hover);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    transition: all 0.2s;
}

.audio-recorder-close:hover {
    background: var(--border-medium);
    color: var(--text-primary);
}

#audioWaveCanvas {
    width: 100%;
    height: 60px;
    border-radius: 8px;
}

.audio-recorder-done {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 20px;
    border: none;
    background: var(--gradient-primary);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.audio-recorder-done:hover {
    filter: brightness(1.1);
    transform: scale(1.02);
}

/* Footer anterior (compat) */
.input-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 4px 0;
    font-size: 11px;
    color: var(--text-muted);
}

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

.input-action {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-tertiary);
    font-family: inherit;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.input-action:hover {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

/* ========================================
   PAGE VIEWS (Directorio, Marketplace, etc)
   ======================================== */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}

.page-title h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
    background: linear-gradient(135deg, #f0f0f5, #a0a0b0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-title p {
    font-size: 14px;
    color: var(--text-secondary);
}

.page-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.btn-primary, .btn-secondary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.2);
}

.btn-primary:hover {
    filter: brightness(1.1);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: var(--bg-glass);
    border: 1px solid var(--border-medium);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-medium);
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ghost:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.05);
}

.btn-small {
    padding: 6px 10px;
    font-size: 11px;
}

.import-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.input-with-btn {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    margin-bottom: 24px;
}

.search-bar svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    padding: 8px 16px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--gradient-primary);
    color: white;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.search-btn:hover {
    filter: brightness(1.1);
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 32px;
}

.cat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all 0.2s;
}

.cat-card:hover {
    background: var(--bg-hover);
    border-color: var(--border-medium);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.cat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--cat-color, var(--accent-cyan));
    opacity: 0.15;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cat-color, var(--accent-cyan));
}

.cat-card span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cat-card small {
    font-size: 11px;
    color: var(--text-muted);
}

/* Section Header */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.link {
    color: var(--accent-cyan);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: opacity 0.2s;
}

.link:hover {
    opacity: 0.8;
}

/* Business Grid */
.business-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.business-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    overflow: hidden;
    transition: all 0.2s;
    position: relative;
}

.business-card:hover {
    border-color: var(--border-medium);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.business-card.featured {
    border-color: rgba(245, 158, 11, 0.3);
}

.biz-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--accent-amber);
    font-size: 11px;
    font-weight: 600;
    z-index: 2;
}

.biz-image {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.biz-logo {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
}

.biz-content {
    padding: 14px 16px;
}

.biz-content h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.biz-cat {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 10px;
}

.biz-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.biz-rating {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-amber);
}

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

.biz-status {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
}

.biz-status.open {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.biz-status.closed {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.biz-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.biz-tags span {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 20px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* Marketplace */
.marketplace-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.tab {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.tab:hover {
    background: var(--bg-hover);
}

.tab.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
}

.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.listing-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    overflow: hidden;
    transition: all 0.2s;
}

.listing-card:hover {
    border-color: var(--border-medium);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.listing-image {
    height: 160px;
    position: relative;
}

.listing-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}

.listing-condition {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(10px);
    font-size: 11px;
    font-weight: 600;
    color: white;
}

.listing-fav {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.listing-fav:hover {
    background: rgba(236, 72, 153, 0.8);
}

.listing-content {
    padding: 14px 16px;
}

.listing-content h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.listing-location {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 10px;
}

.listing-price {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.price-current {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-green);
}

.price-negotiable {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
}

.price-old {
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: line-through;
}

.listing-attrs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.listing-attrs span {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 20px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.listing-seller {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
    font-size: 12px;
    color: var(--text-secondary);
}

.seller-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    color: white;
}

/* Company Dashboard */
.company-dashboard {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.company-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    padding: 24px;
}

.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
}

.company-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.company-avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: white;
    box-shadow: var(--shadow-glow);
}

.company-info h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 2px;
}

.company-info p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.company-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.badge.verified {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.badge.active {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
}

.badge.premium {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-amber);
}

.company-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-item {
    text-align: center;
    padding: 14px;
    border-radius: var(--radius-md);
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
}

.stat-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.dash-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    padding: 20px;
}

.dash-card.wide {
    grid-column: span 2;
}

.dash-card h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 14px;
}

.ia-config {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.config-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
}

.config-row select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 12px;
    outline: none;
}

.toggle {
    position: relative;
    width: 40px;
    height: 22px;
}

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

.toggle span {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: all 0.2s;
}

.toggle span::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: all 0.2s;
}

.toggle input:checked + span {
    background: rgba(6, 182, 212, 0.2);
    border-color: var(--accent-cyan);
}

.toggle input:checked + span::before {
    transform: translateX(18px);
    background: var(--accent-cyan);
}

.mini-products {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mini-prod {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    font-size: 13px;
}

.mini-prod span:last-child {
    font-weight: 600;
    color: var(--accent-green);
}

.leads-table {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lead-row {
    display: grid;
    grid-template-columns: 1fr 1.5fr 0.8fr 0.8fr;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    align-items: center;
}

.lead-row.header {
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
}

.lead-row:not(.header):hover {
    background: var(--bg-hover);
}

.urgency {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    width: fit-content;
}

.urgency.high {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.urgency.medium {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-amber);
}

.status {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    width: fit-content;
}

.status.new {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
}

.status.contacted {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-violet);
}

.status.converted {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

/* Super Admin */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.admin-stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
}

.admin-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--icon-bg);
    color: var(--icon-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.admin-stat-info {
    display: flex;
    flex-direction: column;
}

.admin-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.admin-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.admin-section {
    margin-bottom: 24px;
}

.admin-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 14px;
}

.moderation-queue {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mod-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    background: var(--bg-glass);
    gap: 16px;
}

.mod-item.flagged {
    border-left: 3px solid var(--accent-red);
}

.mod-item.review {
    border-left: 3px solid var(--accent-amber);
}

.mod-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mod-info strong {
    font-size: 13px;
    font-weight: 600;
}

.mod-info span {
    font-size: 12px;
    color: var(--text-secondary);
}

.mod-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-small {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    border: none;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-small.approve {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.btn-small.approve:hover {
    background: rgba(16, 185, 129, 0.25);
}

.btn-small.reject {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.btn-small.reject:hover {
    background: rgba(239, 68, 68, 0.25);
}

/* App Footer */
.app-footer {
    padding: 16px 32px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: auto;
}

.footer-links {
    display: flex;
    gap: 16px;
}

.footer-links a {
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--text-secondary);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
    .admin-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .company-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 200;
        transform: translateX(0);
    }
    .sidebar.collapsed {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }
    .mobile-header {
        display: flex;
    }
    .suggestions-grid {
        grid-template-columns: 1fr;
    }
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .business-grid {
        grid-template-columns: 1fr;
    }
    .listings-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .dash-card.wide {
        grid-column: span 1;
    }
    .admin-stats-grid {
        grid-template-columns: 1fr;
    }
    .page-header {
        flex-direction: column;
    }
    .view {
        padding: 16px;
    }
    .messages-area {
        padding: 12px;
    }
    .app-footer {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* Animations for view transitions */
.view {
    /* transition handled above */
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Stagger animation for cards */
.stagger-in > * {
    opacity: 0;
    transform: translateY(20px);
    animation: stagger-item 0.5s ease forwards;
}
.stagger-in > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-in > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-in > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-in > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-in > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-in > *:nth-child(6) { animation-delay: 0.3s; }

@keyframes stagger-item {
    to { opacity: 1; transform: translateY(0); }
}

/* Cursor blink for code blocks */
.cursor-blink::after {
    content: '|';
    animation: blink 1s step-end infinite;
    color: var(--accent-cyan);
}
@keyframes blink {
    50% { opacity: 0; }
}

/* Neon border pulse for featured elements */
.neon-pulse {
    animation: neon-pulse 2s ease-in-out infinite;
}

/* ================================
   GLITCH EFFECT
   ================================ */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch-1 3s infinite linear alternate-reverse;
    color: var(--accent-cyan);
    z-index: -1;
    clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
}

.glitch::after {
    animation: glitch-2 2.5s infinite linear alternate-reverse;
    color: var(--accent-pink);
    z-index: -2;
    clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
}

@keyframes glitch-1 {
    0%, 90%, 100% { transform: translate(0); }
    92% { transform: translate(-2px, 1px); }
    94% { transform: translate(2px, -1px); }
    96% { transform: translate(-1px, 2px); }
    98% { transform: translate(1px, -2px); }
}

@keyframes glitch-2 {
    0%, 85%, 100% { transform: translate(0); }
    87% { transform: translate(2px, -1px); }
    89% { transform: translate(-2px, 1px); }
    91% { transform: translate(1px, 2px); }
    93% { transform: translate(-1px, -2px); }
}

/* ================================
   MESSAGE ANIMATIONS
   ================================ */
.message.user {
    animation: message-slide-right 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.message.assistant {
    animation: message-slide-left 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes message-slide-right {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes message-slide-left {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Code blocks */
pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    margin: 12px 0;
    position: relative;
}

code {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--accent-cyan);
}

pre code {
    color: var(--text-primary);
}

pre::before {
    content: attr(data-lang);
    position: absolute;
    top: 4px;
    right: 8px;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Syntax highlighting colors */
.code-keyword { color: #c678dd; }
.code-string { color: #98c379; }
.code-function { color: #61afef; }
.code-comment { color: #5c6370; font-style: italic; }
.code-number { color: #d19a66; }

/* ================================
   FLOATING ACTIONS
   ================================ */
.fab-scroll {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s;
    z-index: 50;
    box-shadow: var(--shadow-md);
}

.fab-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

.fab-scroll:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--accent-cyan);
}

/* ================================
   CONFETTI CANVAS
   ================================ */
#confettiCanvas {
    position: fixed;
    inset: 0;
    z-index: 9994;
    pointer-events: none;
}

/* ================================
   TERMINAL MODE
   ================================ */
.terminal-mode {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #111111;
    --text-primary: #00ff00;
    --text-secondary: #00cc00;
    --text-tertiary: #008800;
    --accent-cyan: #00ff00;
    --accent-violet: #00ff00;
}

.terminal-mode .sidebar,
.terminal-mode .input-container,
.terminal-mode .modal-content,
.terminal-mode .palette-box {
    background: #000 !important;
    border-color: #003300 !important;
}

.terminal-mode .message-content {
    font-family: var(--font-mono) !important;
}

.terminal-mode .message-avatar {
    font-family: var(--font-mono) !important;
    border-color: #00ff00 !important;
    color: #00ff00 !important;
}

.terminal-mode * {
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.3) !important;
}

/* CRT effect overlay */
.crt-overlay {
    position: fixed;
    inset: 0;
    z-index: 9993;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 0, 0.03) 2px,
        rgba(0, 255, 0, 0.03) 4px
    );
    opacity: 0;
    transition: opacity 0.5s;
}

.terminal-mode .crt-overlay {
    opacity: 1;
}

/* ================================
   ACHIEVEMENTS
   ================================ */
.achievement-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    z-index: 9998;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 24px;
    border-radius: var(--radius-lg);
    background: var(--bg-glass-heavy);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-medium);
    box-shadow: var(--shadow-toast), 0 0 30px rgba(245, 158, 11, 0.2);
    animation: achievement-in 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.achievement-toast.hiding {
    animation: achievement-out 0.4s ease forwards;
}

@keyframes achievement-in {
    from { transform: translateX(-50%) translateY(100px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

@keyframes achievement-out {
    to { transform: translateX(-50%) translateY(100px); opacity: 0; }
}

.achievement-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
    animation: achievement-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.3s both;
}

@keyframes achievement-pop {
    from { transform: scale(0) rotate(-180deg); }
    to { transform: scale(1) rotate(0); }
}

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

.achievement-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-amber);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.achievement-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.achievement-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Typing indicator enhanced */
.typing-enhanced {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 16px 0;
}

.typing-enhanced .wave {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-cyan);
    animation: typing-wave 1.4s ease-in-out infinite;
}

.typing-enhanced .wave:nth-child(2) { animation-delay: 0.15s; }
.typing-enhanced .wave:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing-wave {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-8px); opacity: 1; box-shadow: 0 0 8px rgba(6, 182, 212, 0.5); }
}
@keyframes neon-pulse {
    0%, 100% { box-shadow: 0 0 5px rgba(6, 182, 212, 0.2), 0 0 10px rgba(6, 182, 212, 0.1); }
    50% { box-shadow: 0 0 15px rgba(6, 182, 212, 0.4), 0 0 30px rgba(6, 182, 212, 0.2); }
}

/* Theme toggle transition */
.theme-transitioning * {
    transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease !important;
}

/* ================================
   COMMAND PALETTE
   ================================ */
.command-palette {
    position: fixed;
    inset: 0;
    z-index: 9997;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
}

.command-palette.active {
    display: flex;
}

.palette-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    animation: fade-in 0.2s ease;
}

.palette-box {
    position: relative;
    width: 100%;
    max-width: 560px;
    background: var(--bg-glass-heavy);
    backdrop-filter: blur(30px);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
    overflow: hidden;
    animation: palette-in 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes palette-in {
    from { opacity: 0; transform: scale(0.96) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.palette-input-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.palette-input-wrap svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.palette-input-wrap input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
}

.palette-input-wrap input::placeholder {
    color: var(--text-muted);
}

.palette-kbd {
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
}

.palette-results {
    max-height: 320px;
    overflow-y: auto;
    padding: 8px;
}

.palette-section {
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.palette-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s;
}

.palette-item:hover,
.palette-item.selected {
    background: var(--bg-hover);
}

.palette-item-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.palette-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.palette-item-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.palette-item-desc {
    font-size: 11px;
    color: var(--text-muted);
}

.palette-item-shortcut {
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

/* ================================
   MODAL
   ================================ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 9996;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    animation: fade-in 0.2s ease;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    background: var(--bg-glass-heavy);
    backdrop-filter: blur(30px);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
    display: flex;
    flex-direction: column;
    animation: modal-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modal-in {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border-subtle);
}

.setting-group {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.setting-group:last-child {
    border-bottom: none;
}

.setting-group h4 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
}

.setting-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.setting-info span {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.setting-info small {
    font-size: 11px;
    color: var(--text-tertiary);
}

/* ================================
   SKELETON LOADING
   ================================ */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 12px;
    margin-bottom: 8px;
}

.skeleton-text.short { width: 40%; }

.skeleton-text.medium { width: 70%; }

.skeleton-text.long { width: 90%; }

.skeleton-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-card {
    height: 120px;
    border-radius: var(--radius-lg);
}

/* Focus Mode */
.focus-mode .sidebar,
.focus-mode .chat-header,
.focus-mode .input-footer {
    opacity: 0.3;
    transition: opacity 0.3s;
}

.focus-mode .sidebar:hover,
.focus-mode .chat-header:hover,
.focus-mode .input-footer:hover {
    opacity: 1;
}

.focus-mode .messages-area {
    background: radial-gradient(ellipse at center, rgba(6, 182, 212, 0.02) 0%, transparent 70%);
}

/* ================================
   CONSOLE MODE (Terminal/Developer)
   ================================ */
.console-mode {
    --console-bg: #0c0c0c;
    --console-text: #00ff88;
    --console-text-dim: #00aa55;
    --console-accent: #00d4aa;
    --console-border: #1a1a1a;
    --console-user: #66d9ef;
    --console-system: #f92672;
}

.console-mode .messages-area {
    background: var(--console-bg) !important;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace !important;
}

.console-mode .message {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 4px 16px !important;
    margin: 2px 0 !important;
    border-radius: 0 !important;
}

.console-mode .message.assistant {
    border-left: 2px solid var(--console-accent) !important;
}

.console-mode .message.user {
    border-left: 2px solid var(--console-user) !important;
}

.console-mode .message-avatar {
    display: none !important;
}

.console-mode .message-content {
    color: var(--console-text) !important;
    font-size: 13px !important;
    line-height: 1.7 !important;
    text-shadow: 0 0 2px rgba(0, 255, 136, 0.3);
}

.console-mode .message.user .message-content {
    color: var(--console-user) !important;
    text-shadow: 0 0 2px rgba(102, 217, 239, 0.3);
}

.console-mode .message-content::before {
    content: '❯ ';
    color: var(--console-accent);
    font-weight: bold;
}

.console-mode .message.user .message-content::before {
    content: '$ ';
    color: var(--console-user);
}

.console-mode .message-actions {
    opacity: 0.6;
    border-top: 1px solid var(--console-border);
}

.console-mode .msg-action-btn {
    filter: grayscale(100%) brightness(2) !important;
    font-size: 11px;
}

.console-mode .welcome-screen {
    background: var(--console-bg) !important;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace !important;
}

.console-mode .welcome-title {
    color: var(--console-text) !important;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.4);
}

.console-mode .suggestion-card {
    background: var(--console-border) !important;
    border: 1px solid var(--console-accent) !important;
    color: var(--console-text) !important;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace !important;
    font-size: 12px;
}

.console-mode .suggestion-card:hover {
    background: rgba(0, 212, 170, 0.1) !important;
    box-shadow: 0 0 15px rgba(0, 212, 170, 0.2);
}

.console-mode .chat-input-box {
    background: var(--console-bg) !important;
    border: 1px solid var(--console-border) !important;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace !important;
}

.console-mode .chat-input-field {
    color: var(--console-text) !important;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace !important;
    caret-color: var(--console-accent);
}

.console-mode .chat-input-field::placeholder {
    color: var(--console-text-dim) !important;
}

.console-mode .chat-input-send {
    background: var(--console-accent) !important;
}

/* Scanline effect */
.console-mode .messages-area::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 136, 0.015) 2px,
        rgba(0, 255, 136, 0.015) 4px
    );
    pointer-events: none;
    z-index: 1;
}

/* Cursor blink for typing indicator */
.console-mode .typing-indicator {
    color: var(--console-accent) !important;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace !important;
}

.console-mode .typing-indicator::after {
    content: '▋';
    animation: blink 1s step-end infinite;
    color: var(--console-accent);
}

@keyframes blink {
    50% { opacity: 0; }
}

/* ================================
   DRAG & DROP ZONE
   ================================ */
.drop-zone {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(6, 182, 212, 0.08);
    backdrop-filter: blur(4px);
    border: 2px dashed var(--accent-cyan);
    border-radius: var(--radius-lg);
    margin: 8px;
}

.drop-zone.active {
    display: flex;
}

.drop-zone-content {
    text-align: center;
    color: var(--accent-cyan);
    animation: drop-pulse 1.5s ease-in-out infinite;
}

@keyframes drop-pulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.05); opacity: 1; }
}

.drop-zone-content svg {
    margin-bottom: 12px;
    filter: drop-shadow(0 0 10px rgba(6, 182, 212, 0.5));
}

.drop-zone-content h3 {
    font-size: 18px;
    font-weight: 600;
}

.drop-zone-content p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ================================
   FILE ATTACHMENT PREVIEW
   ================================ */
.attachment-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    margin-bottom: 8px;
    animation: slide-up 0.3s ease;
}

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

.attachment-preview img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.attachment-preview .file-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.attachment-preview .file-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
}

.attachment-preview .file-size {
    font-size: 11px;
    color: var(--text-muted);
}

.attachment-preview .file-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.attachment-preview .file-remove:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

/* ================================
   TOOLTIPS
   ================================ */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s;
    box-shadow: var(--shadow-md);
    z-index: 1000;
}

[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

[data-tooltip-pos="right"]::after {
    bottom: auto;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
}

[data-tooltip-pos="right"]:hover::after {
    transform: translateY(-50%) translateX(0);
}

/* ================================
   SCAN LINES (optional cyberpunk effect)
   ================================ */
.scan-lines::after {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.03) 2px,
        rgba(0,0,0,0.03) 4px
    );
    pointer-events: none;
    z-index: 9990;
    opacity: 0.3;
}

/* ================================
   SCROLL PROGRESS BAR
   ================================ */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    background: var(--gradient-primary);
    z-index: 9995;
    transition: width 0.1s;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

/* ================================
   MESSAGE REACTIONS
   ================================ */
.message-reactions {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.message:hover .message-reactions {
    opacity: 1;
}

.reaction-btn {
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background: transparent;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.reaction-btn:hover {
    background: var(--bg-hover);
    transform: scale(1.1);
}


/* ================================
   PARALLAX CARD EFFECT
   ================================ */
.parallax-card {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.parallax-card:hover {
    transform: perspective(1000px) rotateX(2deg) rotateY(-2deg) translateZ(10px);
}

/* Live indicator */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-green);
}

.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-green);
    animation: live-pulse 1.5s ease-in-out infinite;
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* Push notification popup */
.push-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9998;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    background: var(--bg-glass-heavy);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-medium);
    box-shadow: var(--shadow-toast);
    font-size: 13px;
    color: var(--text-primary);
    animation: push-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    max-width: 320px;
    cursor: pointer;
}

.push-notification.hiding {
    animation: push-out 0.3s ease forwards;
}

@keyframes push-in {
    from { opacity: 0; transform: translateX(60px) scale(0.95); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes push-out {
    to { opacity: 0; transform: translateX(60px) scale(0.95); }
}

.push-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.push-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.push-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.push-body {
    font-size: 12px;
    color: var(--text-secondary);
}

.push-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.push-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ================================
   RESPONSIVE
   ================================ */
@media (max-width: 1024px) {
    .admin-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .company-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 200;
        transform: translateX(0);
    }
    .sidebar.collapsed {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }
    .mobile-header {
        display: flex;
    }
    .suggestions-grid {
        grid-template-columns: 1fr;
    }
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .business-grid {
        grid-template-columns: 1fr;
    }
    .listings-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .dash-card.wide {
        grid-column: span 1;
    }
    .admin-stats-grid {
        grid-template-columns: 1fr;
    }
    .page-header {
        flex-direction: column;
    }
    .view {
        padding: 16px;
    }
    .messages-area {
        padding: 12px;
    }
    .app-footer {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    .palette-box {
        max-width: calc(100vw - 32px);
    }
    .modal-content {
        max-height: 90vh;
    }
    .command-palette {
        padding-top: 10vh;
    }
    .push-notification {
        left: 16px;
        right: 16px;
        max-width: none;
    }
}


/* ================================
   CUSTOM CURSOR
   ================================ */
    position: fixed;
    width: 20px;
    height: 20px;
    border: 2px solid var(--accent-cyan);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transition: transform 0.15s ease, opacity 0.15s ease, border-color 0.3s;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
}

    transform: translate(-50%, -50%) scale(1.8);
    border-color: var(--accent-violet);
    background: rgba(139, 92, 246, 0.1);
}

    transform: translate(-50%, -50%) scale(0.8);
}

    position: fixed;
    width: 8px;
    height: 8px;
    background: var(--accent-cyan);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.4;
    transition: opacity 0.3s;
    transform: translate(-50%, -50%);
}

/* Hide default cursor on desktop */
@media (pointer: fine) {
    }
}

/* ================================
   VOICE WAVE ANIMATION
   ================================ */
.voice-wave-container {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 32px;
    padding: 0 12px;
}

.voice-wave-container.active {
    display: flex;
}

.voice-bar {
    width: 3px;
    background: var(--gradient-primary);
    border-radius: 3px;
    animation: voice-wave 0.5s ease-in-out infinite alternate;
}

.voice-bar:nth-child(1) { height: 8px; animation-delay: 0s; }
.voice-bar:nth-child(2) { height: 14px; animation-delay: 0.1s; }
.voice-bar:nth-child(3) { height: 20px; animation-delay: 0.2s; }
.voice-bar:nth-child(4) { height: 14px; animation-delay: 0.3s; }
.voice-bar:nth-child(5) { height: 8px; animation-delay: 0.4s; }

@keyframes voice-wave {
    from { transform: scaleY(0.5); opacity: 0.5; }
    to { transform: scaleY(1); opacity: 1; }
}


/* ================================
   MODELS CONFIG (SuperAdmin)
   ================================ */
.models-config {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    padding: 20px;
}

.models-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.models-count {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.models-filter {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.models-filter .tab {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.models-filter .tab:hover {
    background: var(--bg-hover);
}

.models-filter .tab.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
}

.models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.model-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    background: var(--bg-glass);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.model-card:hover {
    border-color: var(--border-medium);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.model-card.selected {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2), var(--shadow-md);
}

.model-card.selected::before {
    content: 'âœ“';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-cyan);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

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

.model-provider {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.model-info {
    flex: 1;
    min-width: 0;
}

.model-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.model-provider-name {
    font-size: 11px;
    color: var(--text-muted);
}

.model-tier {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.model-tier.free { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.model-tier.economico { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }
.model-tier.premium { background: rgba(139, 92, 246, 0.15); color: var(--accent-violet); }
.model-tier.vision { background: rgba(236, 72, 153, 0.15); color: var(--accent-pink); }
.model-tier.especializado { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }

.model-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.model-cost {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-amber);
}

.model-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.model-vision {
    font-size: 10px;
    font-weight: 600;
    color: var(--accent-pink);
    background: rgba(236, 72, 153, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.model-ctx {
    font-size: 10px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Search results highlight */
.highlight {
    background: rgba(6, 182, 212, 0.2);
    padding: 0 2px;
    border-radius: 2px;
}


/* ================================
   AUTH SCREEN (Login / Register)
   ================================ */
.auth-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    animation: auth-in 0.5s ease;
}

@keyframes auth-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-brand {
    text-align: center;
    margin-bottom: 32px;
}

.auth-brand .splash-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    color: var(--accent-cyan);
}

.auth-brand h1 {
    font-size: 24px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-brand p {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: var(--bg-glass);
    border-radius: var(--radius-lg);
    padding: 4px;
    border: 1px solid var(--border-subtle);
}

.auth-tab {
    flex: 1;
    padding: 10px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-tab.active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.auth-form {
    display: none;
    flex-direction: column;
    gap: 14px;
}

.auth-form.active {
    display: flex;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-medium);
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

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

.btn-auth {
    padding: 14px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--gradient-primary);
    color: white;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 6px;
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.2);
}

.btn-auth:hover {
    filter: brightness(1.1);
    box-shadow: var(--shadow-glow);
}

.demo-accounts {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-subtle);
}

.demo-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    text-align: center;
}

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

.demo-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-glass);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.demo-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-cyan);
}

.demo-btn span {
    font-weight: 600;
}

.demo-btn small {
    color: var(--text-tertiary);
    font-size: 11px;
}

/* ================================
   LOGOUT BUTTON
   ================================ */
.logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    margin-top: 8px;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
}


/* ================================
   EMPRESA FORM - MI EMPRESA
   ================================ */
.empresa-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.empresa-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 4px;
    background: var(--bg-glass);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
}

.emp-tab {
    padding: 8px 14px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.emp-tab:hover {
    background: var(--bg-hover);
}

.emp-tab.active {
    background: var(--gradient-primary);
    color: white;
}

.emp-tab-content {
    display: none;
    animation: fade-in 0.3s ease;
}

.emp-tab-content.active {
    display: block;
}

.form-section {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
}

.form-section h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.form-help {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.5;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 768px) {
    .form-grid-2, .form-grid-3 {
        grid-template-columns: 1fr;
    }
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}

/* Logo upload */
.logo-upload-area {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.logo-preview {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-lg);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: white;
    box-shadow: var(--shadow-glow);
    overflow: hidden;
}

.logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.logo-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.color-picker input[type="color"] {
    width: 50px;
    height: 36px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    background: none;
}

/* Mapa */
.empresa-map {
    width: 100%;
    height: 400px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    margin: 16px 0;
    background: var(--bg-secondary);
}

.gps-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.coord-display {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.coord-display input {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 12px;
    width: 140px;
}

/* Horarios */
.horario-row {
    display: grid;
    grid-template-columns: 100px 1fr 1fr 80px 80px;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    margin-bottom: 6px;
}

.horario-row.header {
    background: transparent;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.horario-row input[type="time"] {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
}

.horario-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-cyan);
    justify-self: center;
}

/* Items list (servicios, productos, prompts) */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.item-card {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    animation: slide-up 0.3s ease;
}

.item-card input, .item-card textarea {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    outline: none;
}

.item-card input:focus, .item-card textarea:focus {
    border-color: var(--accent-cyan);
}

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

.item-card .item-price {
    width: 120px;
    text-align: right;
    font-family: var(--font-mono);
}

.item-card .btn-remove {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.item-card .btn-remove:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* Prompt card specific */
.prompt-card {
    grid-template-columns: 1fr 1fr 80px auto;
}

.prompt-card .prompt-keyword {
    font-size: 12px;
    color: var(--accent-cyan);
}

/* SuperAdmin empresa list */
.admin-empresas-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-empresa-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto auto auto;
    gap: 14px;
    align-items: center;
    padding: 14px 16px;
    border-radius: var(--radius-lg);
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    transition: all 0.2s;
}

.admin-empresa-item:hover {
    border-color: var(--border-medium);
}

.empresa-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.empresa-status.activa { background: var(--accent-green); box-shadow: 0 0 8px rgba(16,185,129,0.4); }
.empresa-status.pendiente { background: var(--accent-amber); }
.empresa-status.suspendida { background: var(--accent-red); }

.empresa-pago {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.empresa-pago.pagado { background: rgba(16,185,129,0.15); color: var(--accent-green); }
.empresa-pago.moroso { background: rgba(239,68,68,0.15); color: var(--accent-red); }

.admin-actions {
    display: flex;
    gap: 6px;
}

.btn-icon-small {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
}

.btn-icon-small:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-icon-small.approve:hover { background: rgba(16,185,129,0.2); color: var(--accent-green); }
.btn-icon-small.reject:hover { background: rgba(239,68,68,0.2); color: var(--accent-red); }
.btn-icon-small.pause:hover { background: rgba(245,158,11,0.2); color: var(--accent-amber); }

/* Select dark theme fix */
select, option {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}
select {
    appearance: auto;
    -webkit-appearance: menulist;
}
option {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 8px;
}
option:hover, option:focus, option:checked {
    background-color: var(--bg-hover);
}

/* Image messages in chat */
.message-image {
    max-width: 260px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 8px;
}

.message-image img {
    max-width: 260px;
    max-height: 260px;
    width: auto;
    height: auto;
    object-fit: cover;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    display: block;
}

/* ========================================
   DIRECTORIO EMPRESARIAL — REDISEÑO 2025
   ======================================== */

/* Hero */
.dir-hero {
    position: relative;
    padding: 48px 32px 32px;
    margin: -24px -24px 0;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(6,182,212,0.08) 0%, rgba(59,130,246,0.06) 50%, rgba(139,92,246,0.08) 100%);
    border-bottom: 1px solid var(--border-subtle);
}
.dir-hero-bg {
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 20% 50%, rgba(6,182,212,0.12) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 50%, rgba(139,92,246,0.1) 0%, transparent 50%);
    pointer-events: none;
}
.dir-hero-content {
    position: relative; z-index: 1;
    max-width: 900px; margin: 0 auto;
    text-align: center;
}
.dir-hero h1 {
    font-size: 42px; font-weight: 800;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-cyan));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}
.dir-hero-subtitle {
    font-size: 16px; color: var(--text-secondary);
    max-width: 600px; margin: 0 auto 28px;
    line-height: 1.6;
}
.dir-hero-stats {
    display: flex; justify-content: center; gap: 40px;
    flex-wrap: wrap;
}
.dir-stat {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.dir-stat-num {
    font-size: 32px; font-weight: 800;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.dir-stat-label {
    font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em;
}

/* Search Section */
.dir-search-section {
    padding: 24px 32px;
    background: var(--bg-glass);
    border-bottom: 1px solid var(--border-subtle);
    margin: 0 -24px;
    backdrop-filter: blur(20px);
    position: sticky; top: 0; z-index: 10;
}
.dir-search-box {
    display: flex; align-items: center; gap: 12px;
    max-width: 800px; margin: 0 auto 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 6px 6px 6px 18px;
    transition: all 0.3s;
}
.dir-search-box:focus-within {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(6,182,212,0.15);
}
.dir-search-icon { color: var(--text-muted); flex-shrink: 0; }
.dir-search-box input {
    flex: 1; background: transparent; border: none; outline: none;
    color: var(--text-primary); font-size: 15px; padding: 10px 0;
}
.dir-search-box input::placeholder { color: var(--text-muted); }
.dir-search-btn {
    background: var(--gradient-primary); color: white; border: none;
    padding: 10px 24px; border-radius: var(--radius-lg);
    font-weight: 600; font-size: 14px; cursor: pointer;
    transition: all 0.2s; white-space: nowrap;
}
.dir-search-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(6,182,212,0.3); }

/* Filters Row */
.dir-filters-row {
    display: flex; align-items: center; gap: 12px;
    max-width: 800px; margin: 0 auto;
    flex-wrap: wrap; justify-content: center;
}
.dir-filter {
    background: var(--bg-secondary); border: 1px solid var(--border-subtle);
    color: var(--text-primary); padding: 8px 14px; border-radius: var(--radius-md);
    font-size: 13px; cursor: pointer; outline: none;
    transition: all 0.2s; min-width: 160px;
}
.dir-filter:focus { border-color: var(--accent-cyan); }
.dir-toggle {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--text-secondary); cursor: pointer;
    user-select: none; padding: 6px 12px; border-radius: var(--radius-md);
    background: var(--bg-secondary); border: 1px solid var(--border-subtle);
    transition: all 0.2s;
}
.dir-toggle:hover { border-color: var(--border-medium); }
.dir-toggle input { display: none; }
.dir-toggle input:checked + span { color: var(--accent-green); font-weight: 600; }
.dir-toggle:has(input:checked) { border-color: var(--accent-green); background: rgba(16,185,129,0.08); }

/* Categorías */
.dir-cats-section { padding: 32px 8px 16px; }
.dir-section-title { margin-bottom: 20px; }
.dir-section-title h3 { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.dir-cats-scroll {
    display: flex; gap: 14px; overflow-x: auto;
    padding-bottom: 8px; scrollbar-width: thin;
}
.dir-cats-scroll::-webkit-scrollbar { height: 4px; }
.dir-cats-scroll::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: 4px; }
.dir-cat-pill {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 18px; border-radius: 50px;
    background: var(--bg-glass); border: 1px solid var(--border-subtle);
    color: var(--text-primary); font-size: 14px; font-weight: 500;
    cursor: pointer; white-space: nowrap; transition: all 0.25s;
    backdrop-filter: blur(10px);
}
.dir-cat-pill:hover {
    border-color: var(--accent-cyan); background: rgba(6,182,212,0.08);
    transform: translateY(-2px);
}
.dir-cat-pill.active {
    background: var(--gradient-primary); color: white; border-color: transparent;
    box-shadow: 0 4px 16px rgba(6,182,212,0.3);
}
.dir-cat-pill .dir-cat-icon {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; background: rgba(255,255,255,0.15);
}
.dir-cat-pill small { opacity: 0.7; font-size: 11px; margin-left: 4px; }

/* Results */
.dir-results-section { padding: 16px 8px 40px; }
.dir-results-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px; flex-wrap: wrap; gap: 8px;
}
.dir-results-header h3 { font-size: 20px; font-weight: 700; }
.dir-results-count { font-size: 13px; color: var(--text-muted); }

/* Grid */
.dir-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* ====== TARJETA PROFESIONAL DE EMPRESA ====== */
.dir-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex; flex-direction: column;
    backdrop-filter: blur(10px);
}
.dir-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-medium);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15), 0 0 0 1px rgba(6,182,212,0.1);
}
.dir-card.featured {
    border-color: rgba(245,158,11,0.3);
    box-shadow: 0 0 20px rgba(245,158,11,0.08);
}
.dir-card.featured:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.15), 0 0 30px rgba(245,158,11,0.12);
}

/* Header de tarjeta */
.dir-card-header {
    position: relative; height: 110px;
    background-size: cover; background-position: center;
    overflow: hidden;
}
.dir-card-header::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.6) 100%);
}
.dir-card-badges {
    position: absolute; top: 10px; left: 10px; right: 10px;
    display: flex; gap: 6px; z-index: 2; flex-wrap: wrap;
}
.dir-badge {
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
    padding: 4px 10px; border-radius: 20px; backdrop-filter: blur(10px);
}
.dir-badge.premium { background: rgba(245,158,11,0.9); color: #fff; }
.dir-badge.verif { background: rgba(16,185,129,0.9); color: #fff; }
.dir-badge.abierto { background: rgba(16,185,129,0.9); color: #fff; }
.dir-badge.cerrado { background: rgba(100,116,139,0.9); color: #fff; }

/* Logo */
.dir-card-logo-wrap {
    position: relative; margin-top: -32px; margin-left: 16px; z-index: 3;
    width: 64px; height: 64px;
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    border: 3px solid var(--bg-glass);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 800; color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    overflow: hidden;
}
.dir-card-logo-wrap img { width: 100%; height: 100%; object-fit: cover; }

/* Body */
.dir-card-body {
    padding: 12px 16px 16px;
    flex: 1; display: flex; flex-direction: column;
}
.dir-card-title {
    font-size: 17px; font-weight: 700; color: var(--text-primary);
    margin-bottom: 2px; line-height: 1.3;
}
.dir-card-title-row {
    display: flex; align-items: center; gap: 6px;
}
.dir-card-cat {
    font-size: 12px; color: var(--accent-cyan); font-weight: 500;
    margin-bottom: 8px;
}
.dir-card-desc {
    font-size: 13px; color: var(--text-secondary); line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Meta row */
.dir-card-meta {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-bottom: 10px;
}
.dir-card-rating {
    display: flex; align-items: center; gap: 4px;
    font-size: 13px; font-weight: 600; color: var(--accent-amber);
}
.dir-card-rating .stars {
    display: flex; gap: 1px;
}
.dir-card-rating .star {
    font-size: 13px; color: var(--border-medium);
}
.dir-card-rating .star.filled { color: var(--accent-amber); }
.dir-card-reviews { font-size: 12px; color: var(--text-muted); }
.dir-card-status {
    display: flex; align-items: center; gap: 4px;
    font-size: 11px; font-weight: 600;
    padding: 3px 8px; border-radius: 20px;
}
.dir-card-status.open { background: rgba(16,185,129,0.12); color: var(--accent-green); }
.dir-card-status.closed { background: rgba(100,116,139,0.12); color: var(--text-muted); }
.dir-card-status .dot { width: 6px; height: 6px; border-radius: 50%; }
.dir-card-status.open .dot { background: var(--accent-green); box-shadow: 0 0 6px var(--accent-green); }
.dir-card-status.closed .dot { background: var(--text-muted); }

/* Ubicación */
.dir-card-loc {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--text-muted); margin-bottom: 10px;
}
.dir-card-loc svg { flex-shrink: 0; }

/* Tags */
.dir-card-tags {
    display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px;
}
.dir-card-tag {
    font-size: 11px; color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 4px 10px; border-radius: 20px;
    border: 1px solid var(--border-subtle);
}

/* Actions */
.dir-card-actions {
    display: flex; gap: 8px; margin-top: auto;
    padding-top: 12px; border-top: 1px solid var(--border-subtle);
}
.dir-card-btn {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 0; border-radius: var(--radius-md);
    font-size: 12px; font-weight: 600; cursor: pointer;
    border: 1px solid var(--border-subtle); background: var(--bg-secondary);
    color: var(--text-primary); transition: all 0.2s; text-decoration: none;
}
.dir-card-btn:hover { background: var(--bg-hover); border-color: var(--border-medium); }
.dir-card-btn.primary { background: var(--gradient-primary); color: white; border-color: transparent; }
.dir-card-btn.primary:hover { box-shadow: 0 4px 12px rgba(6,182,212,0.3); }

/* Skeleton Loading */
.dir-skeleton-card {
    background: var(--bg-glass); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl); overflow: hidden;
    animation: sk-pulse 1.5s ease-in-out infinite;
}
@keyframes sk-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}
.dir-sk-img { height: 110px; background: var(--bg-secondary); }
.dir-sk-body { padding: 16px; }
.dir-sk-line { height: 12px; background: var(--bg-secondary); border-radius: 6px; margin-bottom: 10px; }
.dir-sk-line.sk-lg { width: 70%; }
.dir-sk-line.sk-md { width: 50%; }
.dir-sk-line.sk-sm { width: 40%; height: 10px; }

/* Pagination */
.dir-pagination {
    display: flex; justify-content: center; align-items: center;
    gap: 8px; margin-top: 32px; padding-bottom: 20px;
}
.dir-page-btn {
    min-width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-md); border: 1px solid var(--border-subtle);
    background: var(--bg-glass); color: var(--text-secondary);
    font-size: 13px; font-weight: 600; cursor: pointer;
    transition: all 0.2s;
}
.dir-page-btn:hover { border-color: var(--border-medium); color: var(--text-primary); }
.dir-page-btn.active { background: var(--gradient-primary); color: white; border-color: transparent; }
.dir-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Responsive */
@media (max-width: 768px) {
    .dir-hero { padding: 32px 16px 24px; margin: -16px -16px 0; }
    .dir-hero h1 { font-size: 28px; }
    .dir-hero-stats { gap: 20px; }
    .dir-stat-num { font-size: 24px; }
    .dir-search-section { padding: 16px; margin: 0 -16px; }
    .dir-search-box { flex-direction: column; padding: 12px; }
    .dir-search-btn { width: 100%; }
    .dir-filters-row { flex-direction: column; align-items: stretch; }
    .dir-filter { width: 100%; }
    .dir-grid { grid-template-columns: 1fr; }
}

/* Sin resultados */
.dir-empty {
    grid-column: 1 / -1; text-align: center; padding: 60px 20px;
}
.dir-empty-icon { font-size: 56px; margin-bottom: 16px; opacity: 0.5; }
.dir-empty h4 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.dir-empty p { color: var(--text-muted); font-size: 14px; }


/* ========================================
   HISTORIAL DE CHATS — SIDEBAR
   ======================================== */

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    margin-bottom: 8px;
}

.history-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    margin: 0 12px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}
.history-search svg { color: var(--text-muted); flex-shrink: 0; }
.history-search input {
    flex: 1; background: transparent; border: none; outline: none;
    color: var(--text-primary); font-size: 12px;
}
.history-search input::placeholder { color: var(--text-muted); }

.history-filters {
    display: flex;
    gap: 4px;
    padding: 0 12px 10px;
    overflow-x: auto;
    scrollbar-width: none;
}
.history-filters::-webkit-scrollbar { display: none; }

.hist-filter {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}
.hist-filter:hover { border-color: var(--border-medium); color: var(--text-primary); }
.hist-filter.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 8px;
    max-height: calc(100vh - 420px);
    overflow-y: auto;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
    font-size: 13px;
    position: relative;
}
.history-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.history-item.active {
    background: rgba(6,182,212,0.1);
    color: var(--accent-cyan);
}
.history-item svg { flex-shrink: 0; opacity: 0.6; }
.history-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}
.history-item .hist-date {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
}
.history-item .hist-actions {
    display: none;
    gap: 2px;
}
.history-item:hover .hist-actions {
    display: flex;
}
.history-item .hist-actions button {
    width: 20px; height: 20px;
    border-radius: var(--radius-sm);
    border: none; background: transparent;
    color: var(--text-muted); cursor: pointer;
    font-size: 11px; display: flex; align-items: center; justify-content: center;
}
.history-item .hist-actions button:hover { color: var(--text-primary); background: var(--bg-tertiary); }

.history-empty {
    text-align: center;
    padding: 24px 16px;
    color: var(--text-muted);
    font-size: 12px;
}

/* Panel de Guardados */
.guardados-panel {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-primary);
    z-index: 100;
    display: none;
    flex-direction: column;
    padding: 12px;
}
.guardados-panel.show { display: flex; }

.guardados-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 4px 16px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 12px;
}
.guardados-header span { font-weight: 600; font-size: 15px; }

.guardados-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    margin-bottom: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}
.guardados-search svg { color: var(--text-muted); flex-shrink: 0; }
.guardados-search input {
    flex: 1; background: transparent; border: none; outline: none;
    color: var(--text-primary); font-size: 12px;
}

.guardados-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex: 1;
}

.guardado-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.guardado-card:hover { border-color: var(--border-medium); }
.guardado-card .gd-title {
    font-size: 13px; font-weight: 600;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.guardado-card .gd-preview {
    font-size: 12px; color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.guardado-card .gd-meta {
    display: flex; align-items: center; gap: 8px;
    margin-top: 8px;
    font-size: 11px; color: var(--text-muted);
}

/* ========================================
   ACCIONES DE MENSAJE (footer)
   ======================================== */

.message-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
    opacity: 0;
    transition: opacity 0.2s;
}
.message:hover .message-actions,
.message-actions:hover {
    opacity: 1;
}

.msg-action-btn {
    width: 28px; height: 28px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.2s;
    filter: grayscale(100%) brightness(1.8);
}
.msg-action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    filter: grayscale(0%) brightness(1);
}
.msg-action-btn.liked { color: var(--accent-green); filter: grayscale(0%); }
.msg-action-btn.disliked { color: var(--accent-red); filter: grayscale(0%); }
.msg-action-btn.saved { color: var(--accent-amber); filter: grayscale(0%); }

.msg-action-divider {
    width: 1px; height: 16px;
    background: var(--border-subtle);
    margin: 0 4px;
}

/* Guardar modal */
.guardar-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}
.guardar-modal-overlay.show { display: flex; }
.guardar-modal {
    background: var(--bg-glass);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    padding: 24px;
    width: 90%; max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.guardar-modal h3 { margin-bottom: 12px; font-size: 18px; }
.guardar-modal input {
    width: 100%; padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 16px;
}
.guardar-modal input:focus { outline: none; border-color: var(--accent-cyan); }
.guardar-modal .modal-actions {
    display: flex; gap: 10px; justify-content: flex-end;
}
.guardar-modal .modal-actions button {
    padding: 8px 20px; border-radius: var(--radius-md);
    font-size: 13px; font-weight: 600; cursor: pointer;
    border: none;
}
.guardar-modal .btn-cancel { background: var(--bg-secondary); color: var(--text-secondary); }
.guardar-modal .btn-save { background: var(--gradient-primary); color: white; }


/* ================================
   UPGRADE MODAL (Límite de consultas)
   ================================ */
.upgrade-modal .modal-content {
    max-width: 480px;
}

.upgrade-body {
    padding: 0 !important;
}

.upgrade-hero {
    text-align: center;
    padding: 32px 24px 24px;
    background: linear-gradient(135deg, rgba(6,182,212,0.08), rgba(139,92,246,0.08));
}

.upgrade-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.upgrade-hero h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.upgrade-hero p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.upgrade-plans {
    padding: 24px;
}

.upgrade-plan-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    text-align: center;
}

.upgrade-plan-card.featured {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.1);
}

.plan-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gradient-primary);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.upgrade-plan-card h4 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.plan-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    margin-bottom: 4px;
}

.price-amount {
    font-size: 32px;
    font-weight: 800;
    color: var(--accent-cyan);
}

.price-period {
    font-size: 14px;
    color: var(--text-muted);
}

.plan-price-anual {
    font-size: 12px;
    color: var(--accent-green);
    margin-bottom: 16px;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    text-align: left;
}

.plan-features li {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 6px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.plan-features li:last-child {
    border-bottom: none;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.upgrade-free-info {
    text-align: center;
    padding: 16px 24px 24px;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-subtle);
}

/* Contador de consultas en sidebar */
.consultas-counter {
    padding: 10px 16px;
    margin: 8px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 12px;
    color: var(--text-secondary);
}

.consultas-counter .counter-bar {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.consultas-counter .counter-bar-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 2px;
    transition: width 0.3s;
}

.consultas-counter .counter-bar-fill.warning {
    background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.consultas-counter .counter-text {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 11px;
}


/* ================================
   PROMPTS GLOBALES (SuperAdmin)
   ================================ */
.prompts-global-form .form-group input,
.prompts-global-form .form-group textarea {
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    width: 100%;
    outline: none;
    transition: all 0.2s;
}

.prompts-global-form .form-group input:focus,
.prompts-global-form .form-group textarea:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.prompts-global-form .form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.prompt-global-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: all 0.2s;
}

.prompt-global-card:hover {
    border-color: var(--border-medium);
}

.prompt-global-card .pg-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(139,92,246,0.2), rgba(6,182,212,0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.prompt-global-card .pg-content {
    flex: 1;
    min-width: 0;
}

.prompt-global-card .pg-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.prompt-global-card .pg-keywords {
    font-size: 11px;
    color: var(--accent-cyan);
    margin-bottom: 4px;
}

.prompt-global-card .pg-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.prompt-global-card .pg-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.prompt-global-card .pg-actions button {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.2s;
}

.prompt-global-card .pg-actions button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.prompt-global-card .pg-actions .btn-delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
}


/* ========================================
   RIGHT PANEL - Historial & Guardados
   ======================================== */
.right-panel {
    width: 300px;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 50;
}

.right-panel.collapsed {
    transform: translateX(100%);
    width: 0;
    overflow: hidden;
}

.right-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-subtle);
    gap: 8px;
}

.rp-tabs {
    display: flex;
    gap: 4px;
    flex: 1;
}

.rp-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.rp-tab:hover {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.rp-tab.active {
    background: var(--bg-active);
    color: var(--text-primary);
}

.rp-close {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.rp-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.rp-section {
    flex: 1;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.rp-section.active {
    display: flex;
}

.rp-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin: 10px 12px 8px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.rp-search input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    font-family: inherit;
}

.rp-search input::placeholder {
    color: var(--text-muted);
}

.rp-filters {
    display: flex;
    gap: 4px;
    padding: 0 12px 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

.rp-filters::-webkit-scrollbar {
    display: none;
}

.rp-filter {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: inherit;
}

.rp-filter:hover {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.rp-filter.active {
    background: var(--bg-active);
    color: var(--text-primary);
}

.rp-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 10px 10px;
}

.rp-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 13px;
}

.rp-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 13px;
    color: var(--text-secondary);
    position: relative;
    margin-bottom: 2px;
}

.rp-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.rp-item.active {
    background: var(--bg-active);
    color: var(--text-primary);
}

.rp-item svg {
    flex-shrink: 0;
    opacity: 0.6;
}

.rp-item span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rp-item .rp-date {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.rp-item .rp-actions {
    display: none;
    gap: 2px;
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 2px;
}

.rp-item:hover .rp-actions {
    display: flex;
}

.rp-item.active:hover .rp-actions {
    background: var(--bg-tertiary);
}

.rp-actions button {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.15s;
}

.rp-actions button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Mobile toggle for right panel */
.rp-mobile-toggle {
    display: none;
    position: fixed;
    bottom: 80px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-medium);
    background: var(--bg-glass-heavy);
    backdrop-filter: blur(12px);
    color: var(--text-primary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    z-index: 150;
    box-shadow: var(--shadow-md);
    transition: all 0.2s;
}

.rp-mobile-toggle:hover {
    transform: scale(1.05);
}

.rp-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(2px);
    z-index: 45;
}

.rp-overlay.active {
    display: block;
}

/* Toggle right panel button in chat header */
.rp-toggle-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-left: 8px;
}

.rp-toggle-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.rp-toggle-btn.active {
    background: var(--bg-active);
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

/* ========================================
   CONFIRM & PROMPT MODAL
   ======================================== */
.confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.confirm-modal.active {
    display: flex;
}

.confirm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.confirm-box {
    position: relative;
    width: 100%;
    max-width: 380px;
    background: var(--bg-glass-heavy);
    backdrop-filter: blur(30px);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
    padding: 28px 24px 24px;
    text-align: center;
    animation: modal-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.confirm-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 16px;
}

.confirm-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.confirm-message {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 24px;
}

.prompt-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-medium);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    margin-bottom: 20px;
    outline: none;
    transition: border-color 0.2s;
}

.prompt-input:focus {
    border-color: var(--accent-cyan);
}

.confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.confirm-btn {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-medium);
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    min-width: 100px;
}

.confirm-btn:hover {
    background: var(--bg-hover);
}

.confirm-btn.cancel {
    color: var(--text-secondary);
}

.confirm-btn.danger {
    background: var(--accent-red);
    color: white;
    border-color: transparent;
}

.confirm-btn.danger:hover {
    filter: brightness(1.1);
}

.confirm-btn.primary {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
}

.confirm-btn.primary:hover {
    filter: brightness(1.1);
}

/* ========================================
   RESPONSIVE - Right Panel
   ======================================== */
@media (max-width: 1200px) {
    .right-panel {
        position: fixed;
        top: 0;
        right: 0;
        transform: translateX(100%);
        box-shadow: var(--shadow-lg);
    }
    .right-panel.open {
        transform: translateX(0);
    }
    .rp-mobile-toggle {
        display: flex;
    }
}

@media (max-width: 768px) {
    .right-panel {
        width: 85vw;
        max-width: 320px;
    }
}


/* ========================================
   USER HEADER MENU (Avatar + Dropdown)
   ======================================== */
.user-header-menu {
    position: relative;
}

.user-header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border-medium);
    background: var(--gradient-primary);
    color: white;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.2s;
    padding: 0;
    font-family: inherit;
}

.user-header-avatar:hover {
    border-color: var(--accent-cyan);
    transform: scale(1.05);
}

.user-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-header-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: var(--bg-glass-heavy);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
    padding: 8px;
    display: none;
    z-index: 100;
    animation: dropdown-in 0.2s ease;
}

.user-header-dropdown.show {
    display: block;
}

.user-header-info {
    padding: 10px 12px;
}

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

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

.user-header-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 4px 0;
}

.user-header-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    text-align: left;
}

.user-header-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.user-header-item svg {
    flex-shrink: 0;
    opacity: 0.7;
}

/* ========================================
   PERFIL MODAL
   ======================================== */
.perfil-box {
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
}

.perfil-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.perfil-avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    font-size: 28px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 3px solid var(--border-medium);
}

.perfil-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.perfil-avatar-upload {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-medium);
    background: transparent;
    color: var(--accent-cyan);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.perfil-avatar-upload:hover {
    background: rgba(6, 182, 212, 0.08);
    border-color: var(--accent-cyan);
}

.perfil-avatar-upload input {
    display: none;
}

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

.perfil-row {
    display: flex;
    gap: 12px;
}

.perfil-row .perfil-field {
    flex: 1;
}

.perfil-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

.perfil-field label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.perfil-field input {
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-medium);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.perfil-field input:focus {
    border-color: var(--accent-cyan);
}

.perfil-field input::placeholder {
    color: var(--text-muted);
}

.perfil-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 4px 0 16px;
}

.perfil-password-section {
    margin-bottom: 20px;
}

.perfil-password-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    text-align: left;
}

/* Scrollbar para modal de perfil */
.perfil-box::-webkit-scrollbar {
    width: 4px;
}
.perfil-box::-webkit-scrollbar-track {
    background: transparent;
}
.perfil-box::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 2px;
}


/* ========================================
   ANALYTICS DASHBOARD
   ======================================== */
.analytics-filters {
    display: flex;
    gap: 8px;
    align-items: center;
}

.analytics-filter {
    padding: 6px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.analytics-filter:hover {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.analytics-filter.active {
    background: var(--bg-active);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.analytics-container {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.analytics-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 80px 20px;
    text-align: center;
}

.analytics-empty-icon {
    font-size: 64px;
}

.analytics-empty h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.analytics-empty p {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 400px;
}

.analytics-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.analytics-kpi-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 16px;
    border-radius: var(--radius-lg);
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    transition: all 0.2s;
}

.analytics-kpi-card:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
}

.kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--icon-bg, rgba(6,182,212,0.12));
    color: var(--kpi-color, var(--accent-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.kpi-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.kpi-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.analytics-charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 16px;
    margin-bottom: 24px;
}

.analytics-chart-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.analytics-chart-card.large {
    grid-row: span 2;
}

.analytics-chart-card h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.chart-wrapper {
    position: relative;
    height: 220px;
}

.analytics-chart-card.large .chart-wrapper {
    height: 460px;
}

.analytics-bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.analytics-info-card,
.analytics-events-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.analytics-info-card h4,
.analytics-events-card h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.info-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 13px;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row-label {
    color: var(--text-secondary);
}

.info-row-value {
    font-weight: 600;
    color: var(--text-primary);
}

.info-row-value.active {
    color: var(--accent-green);
}

.info-row-value.inactive {
    color: var(--accent-red);
}

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

.event-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    font-size: 12px;
}

.event-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.event-info {
    flex: 1;
    color: var(--text-secondary);
}

.event-time {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Responsive analytics */
@media (max-width: 1200px) {
    .analytics-charts-grid {
        grid-template-columns: 1fr 1fr;
    }
    .analytics-chart-card.large {
        grid-column: span 2;
        grid-row: span 1;
    }
    .analytics-chart-card.large .chart-wrapper {
        height: 220px;
    }
}

@media (max-width: 768px) {
    .analytics-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .analytics-charts-grid {
        grid-template-columns: 1fr;
    }
    .analytics-chart-card.large {
        grid-column: span 1;
    }
    .analytics-bottom-grid {
        grid-template-columns: 1fr;
    }
    .analytics-filters {
        flex-wrap: wrap;
    }
}


/* ================================
   MARKETPLACE UNIFICADO
   ================================ */

/* Hero */
.mp-hero {
    position: relative;
    padding: 40px 32px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(6,182,212,0.1), rgba(139,92,246,0.1));
    border: 1px solid var(--border-subtle);
}
.mp-hero-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 20%, rgba(6,182,212,0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 80%, rgba(139,92,246,0.06) 0%, transparent 50%);
    pointer-events: none;
}
.mp-hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
}
.mp-hero-content h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.mp-hero-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    max-width: 600px;
    margin: 0 auto 20px;
}
.mp-hero-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
}
.mp-stat {
    text-align: center;
}
.mp-stat-num {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}
.mp-stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Search & Filters */
.mp-search-section {
    margin-bottom: 20px;
}
.mp-search-box {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.mp-search-icon {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    pointer-events: none;
}
.mp-search-box input {
    flex: 1;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 14px 16px 14px 48px;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: all 0.2s;
}
.mp-search-box input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(6,182,212,0.15);
}
.mp-search-btn {
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
    color: #fff;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}
.mp-search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(6,182,212,0.3);
}
.mp-filters-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.mp-filter {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    cursor: pointer;
    min-width: 140px;
}
.mp-filter:focus {
    border-color: var(--accent-cyan);
}

/* Type Tabs */
.mp-type-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.mp-type-tab {
    padding: 8px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: 100px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.mp-type-tab:hover {
    border-color: var(--accent-cyan);
    color: var(--text-primary);
}
.mp-type-tab.active {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
    color: #fff;
    border-color: transparent;
}

/* Categories */
.mp-cats-section {
    margin-bottom: 20px;
}
.mp-section-title h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}
.mp-cats-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
}
.mp-cats-scroll::-webkit-scrollbar { height: 4px; }
.mp-cats-scroll::-webkit-scrollbar-thumb { background: var(--border-subtle); border-radius: 4px; }
.mp-cat-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: 100px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.mp-cat-pill:hover {
    border-color: var(--accent-cyan);
    color: var(--text-primary);
}
.mp-cat-pill.active {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
    color: #fff;
    border-color: transparent;
}
.mp-cat-pill small {
    background: rgba(255,255,255,0.15);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
}

/* Results */
.mp-results-section {
    margin-bottom: 24px;
}
.mp-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.mp-results-header h3 {
    font-size: 18px;
    font-weight: 600;
}
.mp-results-count {
    font-size: 13px;
    color: var(--text-muted);
}

/* Grid & Cards */
.mp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}
.mp-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.mp-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.2);
    border-color: var(--accent-cyan);
}
.mp-card.featured {
    border-color: var(--accent-amber);
    box-shadow: 0 0 0 1px rgba(245,158,11,0.2);
}
.mp-card-image {
    position: relative;
    height: 160px;
}
.mp-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}
.mp-condition {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 500;
    text-transform: capitalize;
    backdrop-filter: blur(8px);
}
.mp-badge-dest {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, var(--accent-amber), #f97316);
    color: #fff;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 500;
}
.mp-card-body {
    padding: 14px;
}
.mp-card-tipo {
    font-size: 11px;
    color: var(--accent-cyan);
    font-weight: 500;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.mp-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.3;
}
.mp-card-loc {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.mp-card-price {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.mp-price-current {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-green);
}
.mp-price-tag {
    font-size: 11px;
    background: var(--accent-amber);
    color: #000;
    padding: 2px 8px;
    border-radius: 100px;
    font-weight: 500;
}
.mp-card-attrs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
.mp-card-attrs span {
    font-size: 11px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 3px 8px;
    border-radius: 4px;
}
.mp-card-seller {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-subtle);
    padding-top: 10px;
}
.mp-seller-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
}

/* Skeleton */
.mp-skeleton-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}
.mp-sk-img {
    height: 160px;
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
}
.mp-sk-body {
    padding: 14px;
}
.mp-sk-line {
    height: 12px;
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    margin-bottom: 8px;
}
.mp-sk-line.sk-lg { width: 80%; height: 16px; }
.mp-sk-line.sk-md { width: 60%; }
.mp-sk-line.sk-sm { width: 40%; }

/* Empty */
.mp-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.mp-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}
.mp-empty h4 {
    color: var(--text-primary);
    margin-bottom: 4px;
}

/* Pagination */
.mp-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
}
.mp-page-btn {
    padding: 8px 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.mp-page-btn:hover:not(:disabled) {
    border-color: var(--accent-cyan);
}
.mp-page-btn.active {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
    color: #fff;
    border-color: transparent;
}
.mp-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ================================
   MODAL PUBLICAR & DETALLE
   ================================ */
.publicar-box {
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
}
.publicar-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}
.publicar-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.publicar-form .form-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.publicar-form input,
.publicar-form select,
.publicar-form textarea {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}
.publicar-form input:focus,
.publicar-form select:focus,
.publicar-form textarea:focus {
    border-color: var(--accent-cyan);
}
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.form-toggle {
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}
.form-toggle input {
    accent-color: var(--accent-cyan);
}

/* Detalle publicación */
.pub-detail-box {
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 0;
}
.pub-detail-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-glass-heavy);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
.pub-detail-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.pub-detail-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}
.pub-detail-meta {
    flex: 1;
    min-width: 0;
}
.pub-detail-tipo {
    font-size: 11px;
    color: var(--accent-cyan);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.pub-detail-title {
    font-size: 18px;
    font-weight: 600;
    margin: 2px 0;
    color: var(--text-primary);
}
.pub-detail-loc {
    font-size: 12px;
    color: var(--text-muted);
}
.pub-detail-price {
    text-align: right;
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-green);
    white-space: nowrap;
}
.pub-neg {
    font-size: 12px;
    color: var(--accent-amber);
    font-weight: 500;
}
.pub-detail-body {
    padding: 20px 24px;
}
.pub-detail-desc {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}
.pub-detail-attrs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    margin-bottom: 20px;
}
.pub-detail-attr {
    background: var(--bg-tertiary);
    padding: 8px 10px;
    border-radius: var(--radius-md);
    text-align: center;
}
.pub-attr-key {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.pub-attr-val {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2px;
}
.pub-detail-contact h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}
.pub-contact-btns {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.pub-contact-btn {
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.2s;
}
.pub-contact-btn:hover { transform: translateY(-1px); }
.pub-contact-btn.wa { background: #25d366; color: #fff; }
.pub-contact-btn.tel { background: var(--accent-cyan); color: #fff; }
.pub-contact-btn.email { background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border-subtle); }
.pub-seller-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}
.pub-seller-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
}

/* Moderación */
.mod-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 14px;
}

/* Responsive marketplace */
@media (max-width: 768px) {
    .mp-hero { padding: 24px 16px; }
    .mp-hero-content h1 { font-size: 24px; }
    .mp-filters-row { flex-direction: column; align-items: stretch; }
    .mp-filter { width: 100%; }
    .mp-grid { grid-template-columns: 1fr; }
    .form-grid-2 { grid-template-columns: 1fr; }
    .pub-detail-header { flex-direction: column; }
    .pub-detail-price { text-align: left; margin-top: 8px; }
}


/* ================================
   IMAGE UPLOAD PUBLICAR
   ================================ */
.pub-image-upload {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.pub-image-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-tertiary);
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.pub-image-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--text-primary);
}
.pub-image-count {
    font-size: 12px;
    color: var(--text-muted);
}
.pub-image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}
.pub-image-preview {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}
.pub-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.pub-image-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(239,68,68,0.9);
    color: #fff;
    border: none;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.pub-image-remove:hover {
    background: rgba(239,68,68,1);
}


/* ================================
   NOTIFICACIONES
   ================================ */
.notif-menu {
    position: relative;
}
.notif-btn {
    position: relative;
}
.notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    max-height: 400px;
    background: var(--bg-glass-heavy);
    backdrop-filter: blur(30px);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
    z-index: 10001;
    display: none;
    flex-direction: column;
    overflow: hidden;
}
.notif-dropdown.show {
    display: flex;
}
.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 14px;
    font-weight: 600;
}
.notif-mark-read {
    background: none;
    border: none;
    color: var(--accent-cyan);
    font-size: 12px;
    cursor: pointer;
    padding: 0;
}
.notif-mark-read:hover {
    text-decoration: underline;
}
.notif-list {
    overflow-y: auto;
    max-height: 340px;
    padding: 4px;
}
.notif-empty {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 13px;
}
.notif-item {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.2s;
    font-size: 13px;
}
.notif-item:hover {
    background: var(--bg-tertiary);
}
.notif-item.unread {
    background: rgba(6,182,212,0.08);
}
.notif-item.unread:hover {
    background: rgba(6,182,212,0.15);
}
.notif-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}
.notif-content {
    flex: 1;
    min-width: 0;
}
.notif-title {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notif-msg {
    color: var(--text-muted);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notif-time {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
    white-space: nowrap;
}

/* ================================
   GPS / GEOLOCALIZACIÓN
   ================================ */
.pub-gps-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.pub-gps-row input {
    flex: 1;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 13px;
}
.pub-gps-btn {
    padding: 10px 14px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.2s;
}
.pub-gps-btn:hover {
    transform: translateY(-1px);
}

/* ================================
   BOTONES CONTACTO EN CARDS
   ================================ */
.mp-card-contact-btns {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
}
.mp-card-contact-btn {
    flex: 1;
    padding: 8px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: transform 0.2s;
}
.mp-card-contact-btn:hover {
    transform: translateY(-1px);
}
.mp-card-contact-btn.wa {
    background: #25d366;
    color: #fff;
}
.mp-card-contact-btn.tel {
    background: var(--accent-cyan);
    color: #fff;
}
