﻿/* =========================================
   CHILECOMPRA AI - MASTER PREMIUM LIGHT THEME
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@400;500;600&display=swap');

:root {
    /* Paleta de Colores Premium Light */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --secondary: #7c3aed;
    --accent: #0891b2;
    --bg-app: #f8fafc;
    --bg-surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --brand-gradient: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* =========================================
   UTILITIES (Tailwind replacements)
   ========================================= */
.flex {
    display: flex;
}

.hidden {
    display: none !important;
}

.flex-col {
    flex-direction: column;
}

/* Visibility Utilities */
.mobile-only {
    display: none !important;
}

.desktop-only {
    display: flex !important;
}

@media (max-width: 1024px) {
    .mobile-only {
        display: flex !important;
    }

    .desktop-only {
        display: none !important;
    }

    /* Forzar visibilidad de botones hamburguesa */
    .mobile-menu-btn,
    .mobile-nav-toggle,
    .admin-mobile-toggle {
        display: flex !important;
        cursor: pointer !important;
        position: relative;
        z-index: 9999 !important;
    }
}

.flex-1 {
    flex: 1 1 0%;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 0.75rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.ml-1 {
    margin-left: 0.25rem;
}

.ml-2 {
    margin-left: 0.5rem;
}

.ml-3 {
    margin-left: 0.75rem;
}

.ml-4 {
    margin-left: 1rem;
}

/* =========================================
   COMPONETES PREMIUM
   ========================================= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1.6rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    font-size: 0.95rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.3);
    filter: brightness(1.1);
}

.btn-secondary {
    background: white;
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.form-input {
    width: 100%;
    padding: 0.85rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
    background: white;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* =========================================
   APP LAYOUT (Chat & Tools)
   ========================================= */
.app-layout {
    display: grid;
    /* Usar minmax(0, 1fr) es el salvavidas definitivo para evitar que el Grid explote */
    grid-template-columns: 280px minmax(0, 1fr);
    height: 100vh;
    width: 100vw;
    max-width: 100%;
    overflow: hidden;
    background: var(--bg-app);
    position: relative;
}

/* --- APP NAVBAR (Top) --- */
.app-navbar {
    height: 70px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-navbar .nav-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.app-navbar .nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.app-navbar .mobile-logo {
    text-decoration: none;
    display: none;
}

.app-navbar .mobile-logo i {
    color: var(--primary);
}

.app-navbar .mobile-logo .text-main {
    font-weight: 800;
    color: var(--text-main);
}

.app-navbar .mobile-logo .text-muted-part {
    font-weight: 300;
    color: var(--text-muted);
}

#admin-link-nav a.btn-ghost {
    font-weight: 700;
}

@media (max-width: 1024px) {
    .app-layout {
        grid-template-columns: 1fr;
    }

    .app-navbar {
        padding: 0 1.25rem;
    }

    .sidebar {
        position: fixed;
        left: -320px;
        top: 0;
        bottom: 0;
        width: 280px;
        background: white !important;
        /* Forza el fondo opaco en móviles */
        z-index: 2000;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
    }

    .sidebar.open {
        transform: translateX(320px);
    }

    .sidebar.open+.sidebar-mask {
        display: block;
        opacity: 1;
    }

    .mobile-menu-btn {
        display: flex !important;
    }
}

.sidebar-mask {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-btn {
    display: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-main);
    cursor: pointer;
    font-size: 1.25rem;
    box-shadow: var(--shadow-sm);
    z-index: 2005;
}

/* Sidebar Modernizado (Light) */
.sidebar {
    background: white;
    border-right: 1px solid var(--border);
    padding: 2rem 1.25rem;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.02);

    /* 👇 AÑADE ESTAS DOS LÍNEAS PARA REVIVIR LOS CLICS 👇 */
    position: relative;
    z-index: 100;
}

.sidebar .logo {
    margin-bottom: 2.5rem;
    text-decoration: none;
}

.sidebar .logo i {
    color: var(--primary);
    font-size: 1.5rem;
}

.sidebar .logo .logo-text {
    color: var(--text-main);
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: -0.04em;
}

.sidebar .logo .logo-subtext {
    font-weight: 300;
    color: var(--text-muted);
    font-size: 0.9em;
}

.koda-brand {
    font-family: 'Outfit', sans-serif !important;
    font-weight: 800 !important;
    font-size: 1.5rem;
    letter-spacing: -0.04em !important;
    color: var(--text-main) !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 2px !important;
}

.brand-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
    margin-right: 8px;
}

.koda-brand-lg .brand-logo {
    height: 40px;
}

.koda-brand .brand-accent {
    background: var(--brand-gradient) !important;
    display: inline-block !important;
    background-clip: text !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
    font-weight: 500 !important;
}

.koda-brand-lg {
    font-size: 1.85rem;
}

.koda-brand-sm {
    font-size: 1.25rem;
}

.sidebar-menu-scroll {
    overflow-y: auto;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 0.4rem;
    cursor: pointer;
}

.sidebar-item:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.sidebar-item.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 700;
}

.new-chat-btn {
    width: 100%;
    padding: 0.8rem;
    background: var(--primary-light);
    color: var(--primary);
    border: 1px dashed var(--primary);
    border-radius: 12px;
    font-weight: 700;
    margin-bottom: 2rem;
    cursor: pointer;
    transition: 0.2s;
}

.new-chat-btn:hover {
    background: #dbeafe;
}

/* Main Chat Area */
/* Main Chat Area Refined */
.main-chat,
.main-content {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--bg-app);
    width: 100%;
    /* Vital: obliga al flexbox a respetar los límites del Grid */
    min-width: 0;
    overflow: hidden;

}

.content-header {
    padding: 1.5rem 2.5rem 0.5rem;
    background: var(--bg-app);
}

.welcome-message-static h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.04em;
    margin-bottom: 4px;
}

.welcome-message-static p {
    color: var(--text-muted);
    font-size: 1rem;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    /* Permitir scroll aquí */
    padding: 0;
    position: relative;
    scroll-behavior: smooth;
}

.messages-container {
    /* Eliminamos flex: 1; y overflow-y: auto; de aquí para que el scroll sea manejado por el padre */
    padding: 1.5rem 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.message {
    display: flex;
    gap: 1.25rem;
    max-width: 85%;
    width: fit-content;
    will-change: transform, opacity;
}

.message.ai {
    align-self: flex-start;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

/* Avatar Refinements */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
    transition: transform 0.2s ease;
}

.message:hover .avatar {
    transform: scale(1.05);
}

.avatar.ai {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.avatar.user {
    background: white;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* Bubble Refinements */
.bubble {
    padding: 0.9rem 1.25rem;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.55;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    transition: box-shadow 0.2s ease;
}

.message:hover .bubble {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.message.ai .bubble {
    background: white;
    color: var(--text-main);
    border-top-left-radius: 4px;
    border: 1px solid var(--border);
}

.message.user .bubble {
    background: var(--primary);
    color: white;
    border-top-right-radius: 4px;
    border: none;
}

/* Copy Button Styles Refined */
.copy-btn {
    position: absolute;
    top: 10px;
    right: 12px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.message.ai:hover .copy-btn {
    opacity: 1;
}

@media (max-width: 1024px) {
    .copy-btn {
        opacity: 0.8;
        top: 8px;
        right: 8px;
    }
}

.copy-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.1);
    opacity: 1 !important;
}

.copy-btn i {
    font-size: 0.9rem;
}

.copy-btn.copied {
    color: #10b981;
    border-color: #10b981;
    background: #ecfdf5;
}

/* Adjust bubble for copy button */
.message.ai .bubble {
    padding-top: 1.25rem;
    padding-right: 3rem;
    /* More space for the button */
    min-width: 120px;
    position: relative;
    /* Safety */
}

/* Input Area (Sticky Bottom) */
.input-area {
    padding: 1.25rem 2.5rem 2rem;
    background: var(--bg-surface);
    width: 100%;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    /* Asegura que no se encoja */
}

.input-container {
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 8px 12px 8px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
}

.input-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 8px 30px rgba(37, 99, 235, 0.08);
}

textarea {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 1rem;
    resize: none;
    max-height: 150px;
    color: var(--text-main);
    padding: 8px 0;
}

.btn-send {
    background: var(--primary);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-send:hover:not(:disabled) {
    transform: scale(1.05);
    background: var(--primary-hover);
}

.btn-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Animations & Typing */
.animate-in {
    animation: message-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes message-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1.1em;
    background-color: var(--primary);
    margin-left: 2px;
    animation: blink 0.8s infinite;
    vertical-align: middle;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* =========================================
   ADMIN INTERFACE (Premium Light)
   ========================================= */
.admin-sidebar {
    background: #0f172a;
    color: white;
}

.admin-sidebar .nav-link {
    color: #94a3b8;
}

.admin-sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.admin-sidebar .nav-link.active {
    background: var(--primary);
    color: white;
}

.admin-header-ui h1 {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    letter-spacing: -1px;
}

.admin-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.admin-table-container {
    background: white;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    overflow-x: auto;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin-bottom: 3rem;
    width: 100%;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
    /* Force scroll on mobile/tablet */
}

.admin-table th {
    background: #f8fafc;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.admin-table td {
    border-bottom: 1px solid var(--border);
}

.admin-table tr:hover {
    background: #fafafa;
}

/* Badges Administrativos */
.badge {
    padding: 6px 12px;
    border-radius: 30px;
    font-weight: 800;
    font-size: 0.7rem;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-primary {
    background: #eff6ff;
    color: #2563eb;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

/* Dashboard Cards */
.card-stat {
    background: white;
    border-radius: var(--radius-md);
    padding: 2rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: 0.3s;
}

.card-stat:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 2rem;
}

/* =========================================
   MODALS (Premium Auth)
   ========================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: white;
    width: 95%;
    max-width: 460px;
    padding: 3.5rem;
    border-radius: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2);
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.2s;
    font-size: 1.25rem;
}

.modal-close:hover {
    background: #e2e8f0;
    color: var(--text-main);
    transform: rotate(90deg);
}

/* --- AUTH SPECIFIC UI --- */
.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.04em;
    margin-bottom: 0.75rem;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.auth-tabs {
    display: flex;
    background: #f1f5f9;
    padding: 6px;
    border-radius: 16px;
    margin-bottom: 2.5rem;
}

.auth-tab {
    flex: 1;
    padding: 0.75rem;
    border: none;
    background: transparent;
    border-radius: 12px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
}

.auth-tab.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.6rem;
}

.auth-submit {
    width: 100%;
    margin-top: 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    padding: 1.15rem;
    border-radius: 16px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.2);
}

.auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px rgba(37, 99, 235, 0.3);
    filter: brightness(1.1);
}

.auth-link {
    display: block;
    text-align: center;
    margin-top: 1.5rem;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fee2e2;
    padding: 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
    padding: 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Tablas Modernas (Buscador Mercado) */
.modern-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
}

.modern-table th {
    text-align: left;
    padding: 1.25rem 1.5rem;
    background: #f8fafc;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.modern-table td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}






.hidden {
    display: none !important;
}

/* =========================================
   DETALLE DE MERCADO PÚBLICO (MODAL)
   ========================================= */
.detail-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    z-index: 2500;
    justify-content: center;
    align-items: center;
}

.detail-modal-content {
    background: white;
    width: 90%;
    max-width: 950px;
    max-height: 85vh;
    border-radius: var(--radius-lg);
    overflow-y: auto;
    position: relative;
    padding: 40px;
    box-shadow: var(--shadow-xl);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-modal-detail {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-muted);
    transition: 0.2s;
    line-height: 1;
}


.close-modal-detail:hover {
    color: var(--primary);
    transform: scale(1.1);
}

/* Botón de Descarga XML */
.btn-download {
    background: #10b981;
    /* Emerald 500 */
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.85rem;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-download:hover {
    background: #059669;
    /* Emerald 600 */
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(16, 185, 129, 0.3);
}

.btn-download:active {
    transform: translateY(0);
}

.btn-download i {
    font-size: 1rem;
}

/* Tablas dentro del modal */
.detail-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.detail-table th,
.detail-table td {
    border: 1px solid var(--border);
    padding: 14px;
    text-align: left;
    font-size: 14px;
}

.detail-table th {
    background: var(--bg-app);
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.detail-header {
    border-bottom: 2px solid var(--primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
}

.detail-header h2 {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
    margin-bottom: 5px;
}

/* =========================================
   PREMIUM LANDING PAGE OVERRIDES (LIGHT MODE)
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@400;500;600&display=swap');

:root {
    --landing-bg-1: #ffffff;
    --landing-bg-2: #f8fafc;
    --landing-primary: #2563eb;
    /* Blue 600 */
    --landing-secondary: #7c3aed;
    /* Violet 600 */
    --landing-accent: #0891b2;
    /* Cyan 600 */
    --landing-text: #0f172a;
    /* Slate 900 */
    --landing-muted: #64748b;
    /* Slate 500 */
    --landing-glass: rgba(255, 255, 255, 0.7);
    --landing-glass-border: rgba(226, 232, 240, 0.8);
    /* Slate 200 */
    --landing-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

body.landing-page {
    font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--landing-bg-1);
    background-image:
        radial-gradient(circle at 15% 50%, rgba(37, 99, 235, 0.05), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(124, 58, 237, 0.05), transparent 25%);
    color: var(--landing-text);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Typography Enhancements */
.landing-page h1,
.landing-page h2,
.landing-page h3 {
    font-family: 'Outfit', sans-serif;
    color: var(--landing-text);
}

/* Header */
.landing-page .landing-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--landing-glass-border);
    z-index: 1000;
}

.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--landing-text);
    cursor: pointer;
    padding: 0.5rem;
}

@media (max-width: 1024px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-nav-toggle {
        display: flex;
    }
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff !important;
    /* Cambiado a blanco sólido para evitar superposición visual */
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content {
    background-color: #ffffff !important;
    width: 100%;
    height: 100%;
    padding: 2.5rem 2rem;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
}

.mobile-menu-overlay.active .mobile-menu-content {
    transform: translateY(0);
    opacity: 1;
}



.mobile-nav-link {
    display: block;
    padding: 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--landing-text);
    text-decoration: none;
    border-bottom: 1px solid #f1f5f9;
    transition: color 0.2s;
}

.mobile-nav-link:hover {
    color: var(--landing-primary);
}


.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--landing-muted);
    cursor: pointer;
}


.landing-page .logo {
    color: var(--landing-text);
    font-weight: 800;
}

.landing-page .logo i {
    color: var(--landing-primary);
}

.landing-page .nav-link {
    color: var(--landing-muted);
}

.landing-page .nav-link:hover {
    color: var(--landing-primary);
}

/* Premium Buttons */
.landing-page .btn-primary {
    background: linear-gradient(135deg, var(--landing-primary) 0%, var(--landing-secondary) 100%);
    color: white !important;
    border: none;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2);
    position: relative;
    z-index: 1;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.landing-page .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.3);
    filter: brightness(1.1);
}

.landing-page .btn-secondary {
    background: white;
    border: 1px solid var(--landing-glass-border);
    color: var(--landing-text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.landing-page .btn-secondary:hover {
    border-color: var(--landing-primary);
    color: var(--landing-primary);
    background: #f1f5f9;
}

.landing-page .btn-hero {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 14px;
    justify-content: center;
    min-width: 200px;
}

.landing-page .btn-accent {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white !important;
    border: none;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.landing-page .btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
    filter: brightness(1.1);
}


/* Hero Section */
.landing-page .hero {
    padding: 180px 0 100px;
}

.landing-page .hero-title {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -1.5px;
    color: var(--landing-text);
}

.landing-page .hero-title .highlight {
    background: linear-gradient(135deg, var(--landing-primary), var(--landing-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Glassmorphism Chat Preview */
.landing-page .chat-preview-card {
    background: white;
    border: 1px solid var(--landing-glass-border);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    transform: perspective(1000px) rotateY(-5deg) rotateX(2deg);
    transition: transform 0.5s ease;
}

.landing-page .chat-preview-card:hover {
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg) translateY(-5px);
}

.landing-page .preview-header {
    background: #f8fafc;
    border-bottom: 1px solid var(--landing-glass-border);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.landing-page .preview-header .dots {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.landing-page .preview-header .dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e2e8f0;
}

.landing-page .preview-header .dots span:nth-child(1) {
    background: #ff5f56;
}

.landing-page .preview-header .dots span:nth-child(2) {
    background: #ffbd2e;
}

.landing-page .preview-header .dots span:nth-child(3) {
    background: #27c93f;
}


.landing-page .preview-header .status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
}

.landing-page .preview-header span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.landing-page .preview-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-height: 320px;
}

.preview-message {
    padding: 1rem 1.25rem;
    border-radius: 20px;
    font-size: 0.95rem;
    line-height: 1.5;
    max-width: 85%;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.landing-page .preview-message.user {
    align-self: flex-end;
    background: var(--landing-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.landing-page .preview-message.bot {
    align-self: flex-start;
    background: white;
    color: var(--landing-text);
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}

/* Features Grid */
.landing-page .feature-card {
    background: white;
    border: 1px solid var(--landing-glass-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.landing-page .feature-card:hover {
    border-color: var(--landing-primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
    background: white;
}

/* Pricing Overrides */
.landing-page .feature-card.premium-plan {
    border: 2px solid var(--landing-primary);
    background: #f0f7ff;
}

.landing-page .premium-plan .popular-badge {
    background: var(--landing-primary);
}

.landing-page .pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

/* Sections */
.landing-page .section-title {
    font-size: 2.5rem;
    font-weight: 800;
}

.landing-page .section-desc {
    color: var(--landing-muted);
    font-size: 1.1rem;
}

/* Gemni Badge */
.landing-page .gemini-badge {
    background: #eff6ff;
    border: 1px solid #dbeafe;
    color: var(--landing-primary);
}

/* Footer */
.landing-page .footer {
    background: #f8fafc;
    border-top: 1px solid var(--landing-glass-border);
    color: var(--landing-text);
}

.landing-page .footer a {
    color: var(--landing-muted);
}

.landing-page .footer a:hover {
    color: var(--landing-primary);
}

/* Responsive */
@media (max-width: 1024px) {
    .landing-page .hero {
        padding: 140px 0 60px;
    }

    .landing-page .hero-title {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    .landing-page .hero-title {
        font-size: 2.5rem;
    }

    .landing-page .hero {
        padding: 120px 0 40px;
        text-align: center;
    }

    .landing-page .chat-preview-card,
    .landing-page .feature-card {
        transform: none !important;
        margin-top: 2rem;
    }

    .landing-page .section {
        padding: 4rem 0;
    }

    .landing-page .section-title {
        font-size: 2rem;
    }
}

/* css/components.css */

/* --- SKELETON LOADERS --- */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
    width: 100%;
}

.skeleton-title {
    height: 1.5rem;
    margin-bottom: 1rem;
    width: 60%;
}

.skeleton-row {
    height: 3rem;
    margin-bottom: 0.5rem;
}

/* --- SUGGESTION PILLS --- */
.suggestion-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.pill {
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.pill:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* --- STATUS BADGES --- */
.badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef9c3;
    color: #854d0e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #e0f2fe;
    color: #075985;
}

/* --- RESPONSIVE TABLE CONTAINER --- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: white;
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.modern-table th {
    background: var(--bg-app);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.modern-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.modern-table tr:last-child td {
    border-bottom: none;
}

.modern-table tr:hover {
    background-color: #f8fafc;
}

.modern-table .btn-view {
    padding: 0.5rem 1rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.8rem;
    text-decoration: none;
    transition: 0.2s;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.modern-table .btn-view:hover {
    background: var(--primary);
    color: white;
}

.modern-table .badge-type {
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #475569;
    font-weight: 800;
    letter-spacing: 0.05em;
}

/* --- CITATION TOOLTIPS/LINKS --- */
.citation-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    border-bottom: 1px dashed var(--primary);
    cursor: help;
}

.citation-list {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.citation-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

/* --- AI MESSAGE BUBBLE IMPROVEMENTS --- */
.message.ai .bubble {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    line-height: 1.6;
    color: #1e293b;
    max-width: 85%;
}

/* Estilos internos para el Markdown parseado */
.bubble h1,
.bubble h2,
.bubble h3 {
    margin-top: 10px;
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 700;
}

.bubble ul,
.bubble ol {
    padding-left: 20px;
    margin: 10px 0;
}

.bubble li {
    margin-bottom: 5px;
}

/* Estilo para tablas en la burbuja */
.bubble table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.85rem;
}

.bubble th,
.bubble td {
    border: 1px solid #e2e8f0;
    padding: 8px;
    text-align: left;
}

.bubble th {
    background: #f8fafc;
    font-weight: 600;
}

/* Estilo para las fuentes (Citations) */
.citation-list {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dashed #cbd5e1;
    font-size: 0.85rem;
}

.citation-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    padding: 6px 10px;
    border-radius: 6px;
    margin-top: 5px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.citation-item:hover {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.citation-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

/* =========================================
   UTILITIES & ADDITIONAL RESPONSIVE DEFAULTS
   ========================================= */
.flex {
    display: flex;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-1 {
    flex: 1;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

.gap-3 {
    gap: 1.5rem;
}

.gap-4 {
    gap: 2rem;
}

.gap-5 {
    gap: 3rem;
}

.w-full {
    width: 100%;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.relative {
    position: relative;
}

.grid-2-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

@media (max-width: 768px) {
    .grid-2-cols {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .text-center-mobile {
        text-align: center;
    }

    .hero-content {
        text-align: center;
        align-items: center;
        display: flex;
        flex-direction: column;
    }

    .hero-text {
        margin-bottom: 2rem;
    }
}

/* Margin Utilities */
.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

.mt-5 {
    margin-top: 3rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.ml-2 {
    margin-left: 0.5rem;
}

.mr-2 {
    margin-right: 0.5rem;
}

/* Mobile Menu Support */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-main);
}

@media (max-width: 1024px) {
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0.5rem;
    }

    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        z-index: 1001;
        transition: left 0.3s ease;
        width: 280px;
        box-shadow: var(--shadow-xl);
        background: white;
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar-mask {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.4);
        backdrop-filter: blur(4px);
        z-index: 1000;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .sidebar.open+.sidebar-mask {
        display: block;
        opacity: 1;
    }

    .main-chat {
        width: 100%;
        flex: 1;
        display: flex;
        flex-direction: column;
        min-width: 0;
        /* Prevent grid blowouts */
    }
}

/* --- ADMIN PREMIUM UI --- */
.admin-layout {
    grid-template-columns: 280px 1fr !important;
}

/* Admin Responsive: En móvil, el sidebar se oculta como en el app */
@media (max-width: 1024px) {
    .admin-layout {
        grid-template-columns: 1fr !important;
    }

    .admin-layout .admin-sidebar {
        position: fixed;
        left: -300px;
        top: 0;
        bottom: 0;
        width: 280px;
        background: #0f172a !important;
        z-index: 2000;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .admin-layout .admin-sidebar.open {
        transform: translateX(300px);
    }

    .admin-layout .admin-sidebar.open+.sidebar-mask {
        display: block !important;
        opacity: 1;
        z-index: 1999;
    }

    .admin-layout .main-content {
        width: 100%;
        min-width: 0;
    }

    .admin-header {
        padding: 0 1.25rem !important;
    }

    .admin-mobile-toggle {
        display: flex !important;
    }
}

.admin-mobile-toggle {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 10px;
    color: var(--text-main);
    cursor: pointer;
    font-size: 1.1rem;
    border: none;
}


.admin-sidebar {
    background: #0f172a !important;
    border-right: none !important;
    padding: 2rem 1.25rem !important;
    display: flex !important;
    flex-direction: column !important;
}

.admin-sidebar .brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 0.5rem;
    margin-bottom: 3.5rem;
}

.admin-sidebar .brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.admin-sidebar .brand-text {
    color: white;
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: -0.04em;
}

.admin-sidebar .brand-text .thin {
    font-weight: 300;
    opacity: 0.7;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-section-label {
    font-size: 0.65rem;
    color: #475569;
    text-transform: uppercase;
    font-weight: 800;
    margin: 1.5rem 0 0.75rem 0.5rem;
    letter-spacing: 0.15em;
}

.admin-sidebar .sidebar-item {
    padding: 0.875rem 1rem;
    border-radius: 12px;
    color: #94a3b8;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-sidebar .sidebar-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.admin-sidebar .sidebar-item.active {
    background: #2563eb;
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-link {
    font-size: 0.875rem !important;
    opacity: 0.8;
}

/* Admin Main Content */
.main-content {
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.admin-header {
    height: 80px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2.5rem;
    flex-shrink: 0;
    z-index: 100;
}

.header-path {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.path-root {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
}

.path-current {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.separator {
    font-size: 0.65rem;
    color: #cbd5e1;
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.profile-info {
    text-align: right;
}

.profile-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: #0f172a;
}

.profile-role {
    font-size: 0.7rem;
    font-weight: 800;
    color: #6366f1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

.profile-avatar {
    width: 44px;
    height: 44px;
    background: #e0e7ff;
    color: #4338ca;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.admin-scroll-content {
    flex: 1;
    overflow-y: auto;
    padding: 2.5rem;
}

/* Admin Specific Components */
.admin-section-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.admin-section-title i {
    color: #2563eb;
}

/* --- UTILITIES & STATS --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    width: 100%;
}

.card-stat {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.card-stat:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.stat-label {
    font-size: 0.7rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    font-family: 'Outfit', sans-serif;
}

.section-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
    padding-left: 0.75rem;
    margin-top: 1.5rem;
}

.dashboard-content {
    flex: 1;
    width: 100%;
    max-width: 1600px;
    /* More room for wide screens */
    margin: 0 auto;
    padding: 2.5rem;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .dashboard-content {
        padding: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.admin-login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(circle at top right, #f8fafc, #eff6ff);
    width: 100%;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 440px;
    padding: 3.5rem !important;
    border-radius: 32px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1) !important;
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-icon {
    width: 80px;
    height: 80px;
    background: white;
    color: #2563eb;
    border-radius: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.login-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #0f172a;
}

.login-subtitle {
    color: #64748b;
    font-size: 0.95rem;
    margin-top: 0.75rem;
}

.login-submit {
    width: 100%;
    padding: 1.15rem !important;
    border-radius: 16px !important;
    margin-top: 2rem;
    font-size: 1rem;
    font-weight: 700 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.admin-top-actions {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-body {
    background: #f8fafc;
}

/* --- SEARCH COMPONENTS --- */
.search-hero {
    margin-bottom: 4rem;
    text-align: center;
}

.search-hero h2 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 2rem;
    color: var(--text-main);
}

.search-form-container {
    max-width: 800px;
    margin: 0 auto;
}

.search-form-container .input-container {
    background: white;
    padding: 0.75rem 1.5rem;
    border-radius: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.search-form-container .input-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 20px 25px -5px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

.search-form-container .input-container i {
    color: var(--text-muted);
    font-size: 1.25rem;
    margin-right: 1rem;
}

.search-form-container input {
    border: none;
    outline: none;
    font-size: 1.15rem;
    padding: 0.75rem 0;
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background: transparent;
}

.search-form-container .btn-primary {
    padding: 0.85rem 2.25rem;
    border-radius: 16px;
    margin-left: 1rem;
    font-weight: 700;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.suggestion-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.suggestion-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* --- EXTRACCION DE UTILITIES (index.html) --- */
.h-80px {
    height: 80px;
}

.logo-ai-sub {
    font-weight: 300;
    font-size: 0.9em;
    margin-left: 4px;
    color: var(--landing-muted);
}

.text-landing-primary {
    color: var(--landing-primary) !important;
}

.text-800 {
    font-weight: 800;
}

.menu-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1rem 0;
}

.max-w-540 {
    max-width: 540px;
}

.hero-btn-large {
    flex: 1;
    min-width: 200px;
    justify-content: center;
    font-size: 1.1rem;
    padding: 1.2rem 2rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: #22c55e;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--landing-muted);
}

.bg-landing-2 {
    background: var(--landing-bg-2);
}

.list-none {
    list-style: none;
}

.p-0 {
    padding: 0;
}

.mr-2 {
    margin-right: 0.5rem;
}

.card-rotate-right {
    padding: 2rem;
    max-width: 400px;
    transform: rotate(2deg);
}

.card-rotate-left {
    padding: 2rem;
    max-width: 400px;
    transform: rotate(-2deg);
    border-color: #10b981;
}

.text-landing-muted {
    color: var(--landing-muted);
}

.text-sm {
    font-size: 0.9rem;
}

.dir-rtl {
    direction: rtl;
}

.dir-ltr {
    direction: ltr;
}

.gap-6 {
    gap: 1.5rem;
}

.p-6 {
    padding: 1.5rem;
}

.icon-warning {
    color: #f59e0b;
}

.icon-success {
    color: #10b981;
}

.large-icon {
    font-size: 1.5rem;
}

.block {
    display: block;
}

.text-xs {
    font-size: 0.85rem;
}

.bg-success-light {
    background: #ecfdf5;
    color: #10b981;
}

.pricing-padding {
    padding: 3rem 2rem;
}

.text-2xl {
    font-size: 1.5rem;
}

.price-large {
    font-size: 3rem;
    font-weight: 800;
    color: var(--landing-text);
}

.feature-list {
    list-style: none;
    color: var(--landing-text);
    padding-left: 1rem;
    font-size: 0.95rem;
}

.btn-bold-pad {
    padding: 1rem;
    font-weight: 700;
}

.popular-badge-style {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    padding: 6px 16px;
    border-radius: 14px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.btn-pro-pad {
    padding: 1rem;
    font-size: 1.05rem;
    font-weight: 700;
}

.mt-8 {
    margin-top: 2rem;
}

.mt-20 {
    margin-top: 5rem;
}

.footer-top-padding {
    padding: 4rem 0 2rem;
}

.footer-bottom {
    border-top: 1px solid var(--landing-glass-border);
    padding: 2rem 0;
    font-size: 0.9rem;
    color: var(--landing-muted);
}

.font-600 {
    font-weight: 600;
}

.text-landing-text {
    color: var(--landing-text);
}

.no-underline {
    text-decoration: none;
}

.text-center {
    text-align: center;
}

/* --- EXTRACCION DE UTILITIES (admin_files.php) --- */
.mb-8 {
    margin-bottom: 2rem;
}

.border-l-success {
    border-left: 4px solid #10b981;
}

.text-emerald {
    color: #059669;
}

.text-emerald-lg {
    color: #059669;
    font-size: 1.5rem;
}

.flex-wrap-gap {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.text-xxs {
    font-size: 0.65rem;
}

.flex-between-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.flex-min-w {
    flex: 1;
    min-width: 300px;
}

.font-800-lg {
    font-weight: 800;
    color: var(--text-main);
    font-size: 1.1rem;
}

.text-sm-muted-mt {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.btn-pad-lg {
    padding: 0.8rem 2rem;
}

.mr-8px {
    margin-right: 8px;
}

.hidden-mt-6 {
    display: none;
    margin-top: 1.5rem;
}

.code-log-box {
    background: #0f172a;
    color: #38bdf8;
    padding: 1.5rem;
    border-radius: 12px;
    font-family: "Fira Code", monospace;
    font-size: 0.85rem;
    max-height: 300px;
    overflow-y: auto;
}

.text-right {
    text-align: right;
}

.flex-center-gap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-danger {
    color: #ef4444;
}

.text-center-p3 {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.mb-6-font-800 {
    margin: 0 0 1.5rem;
    color: var(--text-main);
    font-weight: 800;
}

.icon-primary {
    color: var(--primary);
}

.upload-box {
    background: #f8fafc;
    border: 2px dashed #e2e8f0;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 1rem;
}

.icon-upload-lg {
    font-size: 2.5rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
    display: block;
}

.cursor-pointer {
    cursor: pointer;
}

.upload-filename {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 1rem;
}

.btn-upload {
    width: 100%;
    padding: 1rem;
}

/* --- EXTRACCION DE UTILITIES (admin_users.php) --- */
.font-700-main {
    font-weight: 700;
    color: var(--text-main);
}

.text-mono-xs {
    font-size: 10px;
    color: var(--text-muted);
    font-family: monospace;
}

.font-600-sm-mb {
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.font-400-muted {
    font-weight: 400;
    color: var(--text-muted);
}

.progress-bg {
    height: 6px;
    background: #f1f5f9;
}

.progress-rounded {
    border-radius: 3px;
}

.progress-container {
    width: 100%;
    overflow: hidden;
    border-radius: 3px;
}

.badge-ghost {
    background: #f1f5f9;
    color: #64748b;
}

.text-11px {
    font-size: 11px;
}

.text-success {
    color: var(--success) !important;
}

.inline-form {
    display: inline;
}

.btn-min-w {
    min-width: 110px;
}

/* --- EXTRACCION DE UTILITIES (admin_header.php) --- */
.mt-6 {
    margin-top: 1.5rem;
}

.color-error-mt {
    color: var(--error);
    margin-top: 1rem;
    text-align: center;
}

/* --- EXTRACCION DE UTILITIES (chat.html) --- */
.redirect-body {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: #f8fafc;
}

.spinner-chat {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

.redirect-text {
    font-family: 'Outfit', sans-serif;
    color: #64748b;
    font-weight: 600;
}

.redirect-link {
    color: #2563eb;
    text-decoration: none;
    font-size: 0.8rem;
    margin-top: 10px;
    display: block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* --- EXTRACCION DE UTILITIES (scripts JS) --- */
.results-loading-container {
    grid-column: 1/-1;
    text-align: center;
    padding: 4rem;
}

.typing-dots-center {
    justify-content: center;
    margin-bottom: 2rem;
}

.text-muted-700 {
    color: var(--text-muted);
    font-weight: 700;
}

.span-full {
    grid-column: 1/-1;
}

.no-results-container {
    grid-column: 1/-1;
    text-align: center;
    padding: 5rem 2rem;
    border: 2px dashed var(--border);
    border-radius: 24px;
    background: white;
}

.no-results-icon {
    font-size: 3rem;
    color: #e2e8f0;
    margin-bottom: 2rem;
    display: block;
}

.text-main-800 {
    color: var(--text-main);
    font-weight: 800;
}

.text-muted {
    color: var(--text-muted);
}

.text-right {
    text-align: right;
}

.whitespace-nowrap {
    white-space: nowrap;
}

.text-main-800-sm {
    font-weight: 800;
    color: var(--text-main);
    font-size: 0.9rem;
}

.text-main-500-md {
    font-weight: 500;
    color: var(--text-main);
    line-height: 1.4;
    max-width: 400px;
}

.text-primary-600-sm {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.85rem;
}

.text-primary-800-xs {
    font-size: 0.7rem;
    color: var(--primary);
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.text-800-sm {
    font-weight: 800;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.w-full-border {
    width: 100%;
    border: 1px solid var(--border);
}

.text-primary-700-uppercase {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.text-95rem-mb {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.text-muted-85rem-mb {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.inline-block-pad {
    display: inline-block;
    margin: 0;
    padding: 2px 8px;
}

.w-full-flex-center {
    width: 100%;
    justify-content: center;
}

.text-xs-font {
    font-size: 0.7rem;
}

.text-center-p-60-40 {
    text-align: center;
    padding: 60px 40px;
}

.typing-dot1 {
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot2 {
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    animation: typing 1.4s infinite 0.2s;
}

.typing-dot3 {
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    animation: typing 1.4s infinite 0.4s;
}

.text-muted-outfit-700 {
    color: var(--text-muted);
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

.p-3rem-center-muted {
    padding: 3rem;
    text-align: center;
    color: var(--text-muted);
}

.no-details-icon {
    font-size: 3rem;
    margin-bottom: 2rem;
    opacity: 0.3;
    color: var(--accent);
}

.text-main-800-mb-10 {
    color: var(--text-main);
    font-weight: 800;
    margin-bottom: 10px;
}

.text-85rem-bg-app {
    font-size: 0.85rem;
    margin-top: 15px;
    background: var(--bg-app);
    padding: 10px;
    border-radius: 8px;
}

.flex-between-start-20 {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.flex-1 {
    flex: 1;
}

.detail-header-eyebrow {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}

.detail-meta-row {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    gap: 15px;
    align-items: center;
    margin-top: 10px;
    flex-wrap: wrap;
}

.inline-flex-gap-6 {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.text-primary {
    color: var(--primary);
}

.text-main {
    color: var(--text-main);
}

.text-accent {
    color: var(--accent);
}

.grid-auto-fit-280 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card-info-box {
    background: var(--bg-app);
    padding: 24px;
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.card-info-label {
    color: var(--text-muted);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 10px;
}

.card-info-value {
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--text-main);
    line-height: 1.3;
}

.card-info-sub {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.text-xs {
    font-size: 0.8rem;
}

.card-info-sub-small {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Refuerzo para Responsividad Admin */
@media (max-width: 1024px) {
    .admin-layout {
        grid-template-columns: 1fr !important;
    }

    .admin-scroll-content {
        padding: 1.25rem !important;
    }

    .admin-header {
        padding: 1rem !important;
    }

    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .admin-card {
        padding: 1.5rem !important;
    }

    .admin-table-container {
        overflow-x: auto;
    }

    .admin-table {
        min-width: 900px !important;
        /* Asegura que el scroll horizontal aparezca en tablas densas */
    }

    .flex-between-wrap {
        flex-direction: column;
        gap: 1.5rem;
        align-items: flex-start;
    }

    .btn-pad-lg {
        width: 100% !important;
    }
}

/* =========================================
   NEW SEO & PREMIUM FOOTER STYLES
   ========================================= */

.trust-banner {
    padding: 2.5rem 0;
    background: white;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.trust-logo {
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
}

.grayscale {
    filter: grayscale(1);
}

.opacity-50 {
    opacity: 0.5;
}

.tracking-widest {
    letter-spacing: 0.15em;
}

.py-4 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.bg-white {
    background-color: white !important;
}

.border-y {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.grid-footer {
    display: grid;
    grid-template-columns: 1.5fr 3fr;
    gap: 4rem;
}

.footer-links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.footer-col h4 {
    font-size: 0.9rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-list {
    list-style: none;
    padding: 0;
}

.footer-list li {
    margin-bottom: 0.75rem;
}

.footer-list a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-list a:hover {
    color: var(--primary);
}

.max-w-300 {
    max-width: 300px;
}

@media (max-width: 991px) {
    .grid-footer {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

@media (max-width: 640px) {
    .footer-links-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* =========================================
   SEARCH MARKET - DIRECT ID PROMPT
   ========================================= */
.id-search-prompt {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    max-width: 450px;
    margin: 1.5rem auto 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.id-search-prompt p {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
}

.flex-center-gap-2 {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.input-modern-sm {
    flex: 1;
    padding: 0.7rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
}

.input-modern-sm:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.btn-primary-sm {
    padding: 0.7rem 1.25rem;
    background: var(--brand-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-primary-sm:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.2);
}

.mt-6 {
    margin-top: 1.5rem;
}