/**
 * Dashboard unificado — Estilo Hostinger 2026
 * Alineado con product_form_modal.css: limpio, minimalista, táctil.
 * CSS único para todo el dashboard: variables, layout, componentes, home, ai-studio.
 */

/* ===== HOSTINGER 2026 — Design tokens (product_form_modal) ===== */
:root {
    /* Colores */
    --h26-primary: #4f46e5;
    --h26-primary-hover: #4338ca;
    --h26-primary-light: #eef2ff;
    --h26-primary-border: #c7d2fe;
    --h26-focus-ring: rgba(99, 102, 241, 0.12);
    --h26-focus-ring-strong: rgba(99, 102, 241, 0.2);
    --h26-accent: #6366f1;
    --h26-text: #0f172a;
    --h26-text-secondary: #64748b;
    --h26-text-muted: #94a3b8;
    --h26-border: #e2e8f0;
    --h26-border-light: #f1f5f9;
    --h26-bg: #fff;
    --h26-bg-subtle: #f8fafc;
    --h26-bg-hover: #fafbff;
    --h26-overlay: rgba(15, 23, 42, 0.4);
    --h26-shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04);
    --h26-shadow-modal: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    /* Bordes — pfm */
    --h26-radius-sm: 8px;
    --h26-radius: 10px;
    --h26-radius-lg: 12px;
    --h26-radius-xl: 16px;
    /* Espaciado — pfm (20px 24px header/form, 18px 20px cards, 12px 16px gaps) */
    --pfm-pad: 20px;
    --pfm-pad-lg: 24px;
    --pfm-pad-card: 18px 20px;
    --pfm-gap: 12px;
    --pfm-gap-md: 16px;
    --pfm-gap-lg: 20px;
    --pfm-mb-section: 20px;
    --pfm-mb-title: 12px;
    --h26-success: #10b981;
    --h26-danger: #dc2626;
    --h26-warning: #f59e0b;
    --h26-info: #3b82f6;
}

/* ===== VARIABLES Y BASE (compatibilidad) ===== */
:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #eef2ff;
    --success: #10b981;
    --success-dark: #059669;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --warning: #f59e0b;
    --info: #3b82f6;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f8fafc;
    color: var(--gray-800);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    min-height: 100vh;
}

html, body { overflow-x: hidden; overflow-y: auto; }

/* Scrollbars ocultos en toda la app — el scroll sigue funcionando con rueda/touch */
*,
html,
body,
.dashboard-container,
.scrollable-container,
.modal .modal-content,
.modal-products .modal-content,
#filtersPanel,
.chat-container {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}
*::-webkit-scrollbar,
html::-webkit-scrollbar,
body::-webkit-scrollbar,
.dashboard-container::-webkit-scrollbar,
.scrollable-container::-webkit-scrollbar,
.modal .modal-content::-webkit-scrollbar,
.modal-products .modal-content::-webkit-scrollbar,
#filtersPanel::-webkit-scrollbar,
.chat-container::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Excepción: carruseles en AI Studio — mostrar barra horizontal cuando hay overflow */
.ai-studio-layout .carousel-container,
.ai-studio-layout .reference-images-section .carousel-container,
.ai-studio-layout .templates-section .templates-carousel,
.ai-studio-layout #product-list,
.ai-studio-layout .content-tabs,
.ai-studio-layout .ai-results-grid {
    scrollbar-width: thin !important;
    scrollbar-color: #9ca3af #e5e7eb !important;
    -ms-overflow-style: scrollbar !important;
}
.ai-studio-layout .carousel-container::-webkit-scrollbar,
.ai-studio-layout .reference-images-section .carousel-container::-webkit-scrollbar,
.ai-studio-layout .templates-section .templates-carousel::-webkit-scrollbar,
.ai-studio-layout #product-list::-webkit-scrollbar,
.ai-studio-layout .content-tabs::-webkit-scrollbar,
.ai-studio-layout .ai-results-grid::-webkit-scrollbar {
    display: block !important;
    width: 8px !important;
    height: 8px !important;
}
.ai-studio-layout #product-list::-webkit-scrollbar,
.ai-studio-layout .content-tabs::-webkit-scrollbar {
    height: 6px !important;
}
.ai-studio-layout .ai-results-grid::-webkit-scrollbar {
    width: 6px !important;
    height: 6px !important;
}

.touch-scroll-y { -webkit-overflow-scrolling: touch; touch-action: pan-y; overscroll-behavior-y: contain; }
.touch-scroll-x { -webkit-overflow-scrolling: touch; touch-action: pan-x; overscroll-behavior-x: contain; }

.card {
    background: var(--h26-bg);
    border: 1px solid var(--h26-border);
    border-radius: var(--h26-radius-lg);
    box-shadow: var(--h26-shadow-card);
    transition: all 0.2s ease;
}
.card:hover {
    border-color: var(--h26-primary-border);
    background: var(--h26-bg-hover);
}

.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border-radius: var(--h26-radius);
    font-weight: 500;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}
.btn-primary {
    background: var(--h26-primary);
    color: #fff;
    border: none;
    box-shadow: 0 1px 3px rgba(79, 70, 229, 0.2);
}
.btn-primary:hover {
    background: var(--h26-primary-hover);
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
}
.btn-primary:active { transform: scale(0.98); }
.btn-secondary {
    background: var(--h26-bg);
    color: var(--h26-text-secondary);
    border: 1px solid var(--h26-border);
}
.btn-secondary:hover {
    background: var(--h26-border-light);
    border-color: var(--h26-border);
    color: var(--h26-text);
}
.btn-secondary:active { transform: scale(0.98); }

/* Header fijo — Hostinger 2026 */
header {
    position: fixed !important;
    top: 0 !important; left: 0 !important; right: 0 !important;
    z-index: 1000 !important;
    height: 60px !important;
    min-height: 60px !important;
    display: flex !important;
    align-items: center !important;
    background: var(--h26-bg) !important;
    border-bottom: 1px solid var(--h26-border-light) !important;
    box-shadow: 0 1px 0 rgba(0,0,0,0.04) !important;
    padding-top: env(safe-area-inset-top) !important;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.notification {
    position: fixed;
    top: var(--space-4);
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 1.25rem;
    border-radius: var(--h26-radius);
    background: var(--h26-bg);
    box-shadow: var(--h26-shadow-modal);
    display: flex;
    align-items: center;
    z-index: 99999 !important;
    max-width: 90%;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid var(--h26-border);
    animation: slideDown 0.3s ease-out;
}
@keyframes slideDown {
    from { transform: translate(-50%, -100%); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}
.notification.success { border-left: 4px solid var(--success); }
.notification.error { border-left: 4px solid var(--danger); }
.notification.info { border-left: 4px solid var(--info); }
/* Notificaciones inline (app/index login, etc.) */
.animate-fade-in .notification {
    position: static;
    transform: none;
    left: auto;
    display: flex;
}

.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); display: inline-block; margin-right: var(--space-2); }
.live-dot.inactive { background: var(--gray-400); }
.stat-number { font-size: 1.5rem; font-weight: 600; color: var(--gray-800); }

/* ===== CONTENEDOR PRINCIPAL ===== */
.dashboard-container {
    margin-top: calc(60px + env(safe-area-inset-top));
    height: calc(100vh - 60px - 96px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    min-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
    padding: var(--pfm-pad) var(--pfm-gap-md) 6rem;
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
    animation: fadeIn 0.5s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 640px) {
    .dashboard-container {
        padding-left: var(--pfm-pad-lg);
        padding-right: var(--pfm-pad-lg);
    }
}

/* ===== Título de página — Hostinger 2026 ===== */
.dash-page-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--h26-text);
    letter-spacing: -0.01em;
    margin: 0;
}

/* ===== Header de página (título + acciones) ===== */
.dash-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--pfm-gap-md);
    margin-bottom: var(--pfm-mb-section);
}

/* ===== Cards — Hostinger 2026 ===== */
.dash-card {
    background: var(--h26-bg);
    border: 1px solid var(--h26-border);
    border-radius: var(--h26-radius-lg);
    box-shadow: var(--h26-shadow-card);
    overflow: hidden;
    transition: all 0.2s ease;
}

.dash-card:hover {
    border-color: var(--h26-primary-border);
    background: var(--h26-bg-hover);
}

.dash-card-body {
    padding: var(--pfm-pad) var(--pfm-pad-lg);
}

@media (min-width: 640px) {
    .dash-card-body {
        padding: var(--pfm-pad) var(--pfm-pad-lg);
    }
}

/* ===== Botones — Hostinger 2026 (pfm-btn) ===== */
.dash-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
    padding: 12px 24px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #fff;
    background: var(--h26-primary);
    border: none;
    border-radius: var(--h26-radius);
    box-shadow: 0 1px 3px rgba(79, 70, 229, 0.2);
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
}

.dash-btn-primary:hover {
    background: var(--h26-primary-hover);
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

.dash-btn-primary:active {
    transform: scale(0.98);
}

.dash-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
    padding: 12px 24px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--h26-text-secondary);
    background: #f1f5f9;
    border: none;
    border-radius: var(--h26-radius);
    cursor: pointer;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.dash-btn-secondary:hover {
    background: #e2e8f0;
}

.dash-btn-secondary:active {
    transform: scale(0.98);
}

.dash-btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
    padding: 12px 24px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #fff;
    background: var(--h26-danger);
    border: none;
    border-radius: var(--h26-radius);
    cursor: pointer;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.dash-btn-danger:hover {
    background: #b91c1c;
}

.dash-btn-danger:active {
    transform: scale(0.98);
}

.dash-btn-success {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
    padding: 12px 24px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #fff;
    background: var(--h26-success);
    border: none;
    border-radius: var(--h26-radius);
    cursor: pointer;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.dash-btn-success:hover {
    background: #059669;
}

.dash-btn-success:active {
    transform: scale(0.98);
}

.dash-btn-icon {
    min-width: 44px;
    min-height: 44px;
    padding: 0.5rem;
    border-radius: var(--h26-radius);
    border: 1px solid var(--h26-border);
    background: var(--h26-bg);
    color: var(--h26-text-secondary);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.dash-btn-icon:hover {
    background: #f1f5f9;
    color: var(--h26-accent);
}

.dash-btn-icon:focus {
    outline: none;
    border-color: var(--h26-accent);
    box-shadow: 0 0 0 3px var(--h26-focus-ring);
}

.dash-btn-icon.dash-btn-icon-danger:hover {
    background: #fef2f2;
    color: var(--h26-danger);
}

/* ===== Tabs / Pestañas — Estilo POS (Inicio, Historial, Resumen) ===== */
.dash-tabs {
    border-bottom: 1px solid var(--h26-border);
    margin-bottom: var(--pfm-mb-section);
    -webkit-tap-highlight-color: transparent;
}

.dash-tabs ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.dash-tabs ul::-webkit-scrollbar {
    display: none;
}

.dash-tabs li {
    flex: 0 0 auto;
}

.dash-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 12px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--h26-text-secondary);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.dash-tab:hover {
    color: var(--h26-accent);
    border-bottom-color: var(--h26-primary-light);
}

.dash-tab.active {
    color: #fff;
    background: var(--h26-primary);
    border-bottom-color: var(--h26-primary);
}

.dash-tab:focus {
    outline: none;
}

.dash-tab:focus-visible {
    box-shadow: 0 0 0 2px var(--h26-focus-ring);
}

@media (max-width: 640px) {
    .dash-tab {
        padding: 10px 12px;
        font-size: 0.8125rem;
    }
}

/* ===== Inputs de búsqueda — Hostinger 2026 (pfm-input) ===== */
.dash-search-input {
    width: 100%;
    min-height: 44px;
    padding: 12px 16px;
    padding-left: 2.5rem;
    font-size: 0.9375rem;
    color: var(--h26-text);
    background: var(--h26-bg);
    border: 1px solid var(--h26-border);
    border-radius: var(--h26-radius);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dash-search-input:focus {
    outline: none;
    border-color: var(--h26-accent);
    box-shadow: 0 0 0 3px var(--h26-focus-ring-strong);
}

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

/* ===== Sección con título ===== */
.dash-section {
    margin-bottom: var(--pfm-mb-section);
}

.dash-section-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 0.75rem 0;
}

/* ===== Estado vacío ===== */
.dash-empty {
    text-align: center;
    padding: 2rem 1rem;
}

.dash-empty-icon {
    font-size: 2.5rem;
    color: #cbd5e1;
    margin-bottom: 0.75rem;
}

.dash-empty-title {
    font-size: 1rem;
    font-weight: 500;
    color: #334155;
    margin: 0 0 0.25rem 0;
}

.dash-empty-text {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0;
}

/* ===== Tarjetas de estadísticas (partner, etc.) ===== */
.dash-stat-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    padding: 1rem 1.25rem;
    transition: box-shadow 0.2s;
}

.dash-stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.dash-stat-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 10px;
    background: #eef2ff;
    color: #4f46e5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* Tabs tipo botón (affiliates, etc.) - compatibilidad */
.tab-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tab-button {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.tab-button:hover {
    color: #334155;
    background: #f8fafc;
}

.tab-button.active {
    color: var(--h26-accent);
    background: var(--h26-primary-light);
    border-color: var(--h26-primary-border);
}

/* ===== Grid de cards (canales, etc.) ===== */
.dash-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .dash-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .dash-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===== Enlace de acción en header ===== */
.dash-header-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--h26-primary);
    text-decoration: none;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.dash-header-link:hover {
    color: var(--h26-primary-hover);
}

/* ===== OPTIMIZACIÓN IMÁGENES PRODUCTOS ===== */
.product-image img, .product-card img, .product-gallery img, .banner-carousel img, .banner-slide,
.thumbnail-item img, #main-media-container img, img[src*="/productos/"], img[src*="/media/"] {
    filter: contrast(1.06) saturate(1.10) brightness(1.02);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    transition: filter 0.3s ease, transform 0.3s ease;
}
.product-image:hover img, .product-card:hover img { filter: contrast(1.08) saturate(1.12) brightness(1.03); transform: scale(1.05) translateZ(0); }

/* ===== HOME / AI-STUDIO: componentes compartidos ===== */
.wave { display: inline-block; animation: wave 2.5s infinite; transform-origin: 70% 70%; }
@keyframes wave {
    0% { transform: rotate(0deg); }
    10% { transform: rotate(14deg); }
    20% { transform: rotate(-8deg); }
    30% { transform: rotate(14deg); }
    40% { transform: rotate(-4deg); }
    50% { transform: rotate(10deg); }
    60%, 100% { transform: rotate(0deg); }
}

.quick-action-btn {
    transition: box-shadow 0.2s, background 0.2s;
    border: 1px solid #f1f5f9;
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem 1rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    min-height: 88px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}
.quick-action-btn:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); background: #fafbfc; }
.quick-action-btn:active { transform: scale(0.98); }

.product-card {
    transition: box-shadow 0.2s;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border: 1px solid #f1f5f9;
}
.product-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

.activity-item { transition: background 0.2s; padding: 0.875rem 1rem; border-radius: 10px; margin: 0.25rem 0; }
.activity-item:hover { background-color: #f8fafc; }

.tip-card { background: #fff; border-radius: 12px; border: 1px solid #f1f5f9; }

/* Métricas Home — Hostinger 2026 */
.metric-card {
    background: var(--h26-bg);
    border: 1px solid var(--h26-border);
    border-radius: var(--h26-radius-lg);
    padding: 1rem 1.25rem;
    color: var(--h26-text);
    position: relative;
    overflow: hidden;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    box-shadow: var(--h26-shadow-card);
    transition: all 0.2s ease;
}
.metric-card:hover {
    border-color: var(--h26-primary-border);
    background: var(--h26-bg-hover);
}
.metric-card .text-2xl, .metric-card .text-3xl { color: #0f172a; }
.metric-card .text-sm, .metric-card span { color: #64748b; }
.metric-card.indigo { border-left: 4px solid #6366f1; }
.metric-card.indigo i.fas, .metric-card.indigo i.fab { color: #6366f1; }
.metric-card.blue { border-left: 4px solid #3b82f6; }
.metric-card.blue i.fas, .metric-card.blue i.fab { color: #3b82f6; }
.metric-card.green { border-left: 4px solid #10b981; }
.metric-card.green i.fas, .metric-card.green i.fab { color: #10b981; }
.metric-card.orange { border-left: 4px solid #f59e0b; }
.metric-card.orange i.fas, .metric-card.orange i.fab { color: #f59e0b; }
.metric-card.purple { border-left: 4px solid #8b5cf6; }
.metric-card.purple i.fas, .metric-card.purple i.fab { color: #8b5cf6; }
.metric-card.pink { border-left: 4px solid #ec4899; }
.metric-card.pink i.fas, .metric-card.pink i.fab { color: #ec4899; }
.metric-card:not(.indigo):not(.blue):not(.green):not(.orange):not(.purple):not(.pink) { border-left: 4px solid #94a3b8; }
.metric-card:not(.indigo):not(.blue):not(.green):not(.orange):not(.purple):not(.pink) i.fas { color: #64748b; }
.metric-card .relative { width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: space-between; }

.analytics-card {
    min-height: 240px;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #f1f5f9;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.analytics-card .analytics-content { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.analytics-card .dash-analytics-title { font-size: 1.125rem; font-weight: 600; color: #0f172a; margin: 0 0 1rem 0; display: flex; align-items: center; }
.analytics-card .dash-analytics-title .dash-icon-primary { color: #4f46e5; margin-right: 0.5rem; }
.analytics-card .dash-analytics-title .dash-icon-orange { color: #f59e0b; margin-right: 0.5rem; }
.analytics-card .dash-analytics-title .dash-icon-blue { color: #3b82f6; margin-right: 0.5rem; }
.analytics-card .dash-analytics-title .dash-icon-green { color: #10b981; margin-right: 0.5rem; }
.analytics-card .dash-analytics-title .dash-icon-purple { color: #8b5cf6; margin-right: 0.5rem; }
.analytics-card .dash-analytics-title .dash-icon-pink { color: #ec4899; margin-right: 0.5rem; }

.chart-container {
    background: #fff;
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid #f1f5f9;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.chart-container.chart-tall { height: 250px; }
.chart-container.chart-medium { height: 200px; }

.home-stats-header select {
    min-height: 44px;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    font-size: 0.875rem;
    color: #334155;
    -webkit-tap-highlight-color: transparent;
}
.home-stats-header select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.dash-analytics-spinner { width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 2px solid #e2e8f0; border-top-color: #4f46e5; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.home-modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--h26-overlay);
    z-index: 50;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
}
.home-modal-overlay.hidden { display: none !important; }
.home-modal-overlay.flex { display: flex !important; }

/* Variantes de tamaño para modales */
.home-reset-modal-md { max-width: 28rem; max-height: 90vh; overflow-y: auto; }
.home-reset-modal-sm { max-width: 22rem; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; }
.home-reset-modal-sm > .home-modal-header { padding: var(--pfm-pad) var(--pfm-pad-lg); border-bottom: 1px solid var(--h26-border-light); }
.home-reset-modal-sm > .home-modal-actions { padding: var(--pfm-pad) var(--pfm-pad-lg); }
.home-reset-modal-sm .home-modal-body-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: var(--pfm-pad) var(--pfm-pad-lg); }

.home-modal-subtitle { font-size: 0.8125rem; color: var(--h26-text-secondary); margin: 0.25rem 0 0 0; }
.home-modal-close {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--h26-text-muted);
    border-radius: var(--h26-radius);
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.home-modal-close:hover { color: var(--h26-text); background: var(--h26-bg-subtle); }
.home-modal-close:active { transform: scale(0.96); }

/* Modal import producto */
.import-product-list { border: 1px solid var(--h26-border); border-radius: var(--h26-radius); background: var(--h26-bg-subtle); overflow: hidden; max-height: 140px; }
.import-product-loading { padding: 1.5rem; text-align: center; font-size: 0.875rem; color: var(--h26-text-muted); }
.import-product-grid { padding: 8px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-height: 160px; overflow-y: auto; background: var(--h26-bg-subtle); border-radius: var(--h26-radius); }

/* ===== MODAL PUBLICACIÓN MANUAL — contenido del form ===== */
.manual-form { padding-top: 0; }
.manual-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--h26-bg-subtle);
    border-radius: var(--h26-radius);
    margin-bottom: 14px;
}
.manual-tab {
    flex: 1;
    min-height: 44px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--h26-text-secondary);
    background: transparent;
    border: none;
    border-radius: calc(var(--h26-radius) - 2px);
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.manual-tab i { font-size: 1rem; }
.manual-tab:hover { color: var(--h26-text); }
.manual-tab.active {
    background: var(--h26-bg);
    color: var(--h26-accent);
    box-shadow: var(--h26-shadow-card);
}
.manual-tab:active { transform: scale(0.98); }

.manual-section { margin-bottom: 14px; }
.manual-dest-btns {
    display: flex;
    gap: 8px;
}
.manual-dest {
    flex: 1;
    min-height: 44px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--h26-text-secondary);
    background: var(--h26-bg);
    border: 1px solid var(--h26-border);
    border-radius: var(--h26-radius);
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.manual-dest:hover { border-color: var(--h26-primary-border); color: var(--h26-text); }
.manual-dest.active {
    border-color: var(--h26-accent);
    background: var(--h26-primary-light);
    color: var(--h26-primary-hover);
}
.manual-dest:active { transform: scale(0.98); }

.manual-upload-zone {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    background: var(--h26-bg-subtle);
    border: 1px dashed var(--h26-border);
    border-radius: var(--h26-radius);
    transition: border-color 0.2s, background 0.2s;
}
.manual-upload-zone:hover { border-color: var(--h26-primary-border); background: var(--h26-bg-hover); }
.manual-upload-btn {
    flex: 1;
    min-width: 120px;
    min-height: 44px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--h26-text-secondary);
    background: var(--h26-bg);
    border: 1px solid var(--h26-border);
    border-radius: var(--h26-radius);
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.manual-upload-btn:hover { border-color: var(--h26-accent); color: var(--h26-accent); background: var(--h26-primary-light); }
.manual-upload-btn:active { transform: scale(0.98); }
.manual-upload-btn-large {
    flex: 1 1 100%;
    min-height: 64px;
    flex-direction: column;
}
.manual-upload-btn-large i { font-size: 1.5rem; }
.manual-import-btn {
    flex: 1;
    min-height: 44px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--h26-text-secondary);
    background: var(--h26-bg);
    border: 1px solid var(--h26-border);
    border-radius: var(--h26-radius);
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.manual-import-btn:hover { border-color: var(--h26-primary-border); color: var(--h26-accent); background: var(--h26-primary-light); }
.manual-import-btn:active { transform: scale(0.98); }
.manual-import-btn-block { width: 100%; }

.manual-preview-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-bottom: 8px;
}
.manual-preview-grid > div {
    aspect-ratio: 1;
    min-height: 0;
    border-radius: var(--h26-radius);
    overflow: hidden;
    border: 1px solid var(--h26-border);
    position: relative;
}
.manual-preview-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.manual-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 5;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(220, 38, 38, 0.9);
    color: #fff;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.manual-preview-remove:hover { background: #dc2626; }
.manual-preview-remove:active { transform: scale(0.9); }
.manual-video-preview { margin-bottom: 8px; text-align: center; }
.manual-video-wrap {
    position: relative;
    display: inline-block;
    border-radius: var(--h26-radius);
    overflow: hidden;
    border: 1px solid var(--h26-border);
}
.manual-video-wrap video {
    display: block;
    max-height: 160px;
    border-radius: var(--h26-radius);
}
.manual-textarea {
    width: 100%;
    min-height: 72px;
    padding: 10px 14px;
    font-size: 0.9375rem;
    color: var(--h26-text);
    background: var(--h26-bg);
    border: 1px solid var(--h26-border);
    border-radius: var(--h26-radius);
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.manual-textarea:focus {
    outline: none;
    border-color: var(--h26-accent);
    box-shadow: 0 0 0 3px var(--h26-focus-ring-strong);
}
.manual-textarea::placeholder { color: var(--h26-text-muted); }
.manual-textarea-sm { min-height: 52px; }

.manual-platforms {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.manual-platform {
    flex: 1;
    min-width: 100px;
    min-height: 44px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--h26-text-secondary);
    background: var(--h26-bg);
    border: 1px solid var(--h26-border);
    border-radius: var(--h26-radius);
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.manual-platform:hover:not(.disabled) { border-color: var(--h26-primary-border); color: var(--h26-text); }
.manual-platform input { display: none; }
.manual-platform:has(input:checked),
.manual-platform.selected {
    border-color: var(--h26-accent);
    background: var(--h26-primary-light);
    color: var(--h26-primary-hover);
}
.manual-platform .fab.fa-facebook { color: #1877f2; }
.manual-platform.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

.manual-schedule-wrap { margin-bottom: 14px; }
.manual-schedule-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0 4px;
    font-size: 0.875rem;
    color: var(--h26-text-secondary);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.manual-schedule-toggle input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--h26-accent);
}
.manual-schedule-toggle span { display: flex; align-items: center; gap: 0.5rem; }
.manual-schedule-field { margin-top: 8px; }
.manual-datetime {
    width: 100%;
    min-height: 44px;
    padding: 12px 16px;
    font-size: 0.9375rem;
    border: 1px solid var(--h26-border);
    border-radius: var(--h26-radius);
    background: var(--h26-bg);
    color: var(--h26-text);
}
.manual-datetime:focus {
    outline: none;
    border-color: var(--h26-accent);
    box-shadow: 0 0 0 3px var(--h26-focus-ring-strong);
}

.manual-actions {
    display: flex;
    gap: 12px;
    padding-top: 12px;
    margin-top: 4px;
    border-top: 1px solid var(--h26-border-light);
}
.manual-btn {
    flex: 1;
    min-height: 48px;
    padding: 12px 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: var(--h26-radius);
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    -webkit-tap-highlight-color: transparent;
}
.manual-btn-ghost {
    background: var(--h26-bg-subtle);
    color: var(--h26-text-secondary);
}
.manual-btn-ghost:hover { background: var(--h26-border-light); color: var(--h26-text); }
.manual-btn-primary {
    background: var(--h26-primary);
    color: #fff;
    box-shadow: 0 1px 3px rgba(79, 70, 229, 0.2);
}
.manual-btn-primary:hover { background: var(--h26-primary-hover); box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3); }
.manual-btn:active { transform: scale(0.98); }
.manual-btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

@media (max-width: 480px) {
    .home-reset-modal-md { max-width: calc(100% - 1rem); margin: 0.5rem; }
    .home-reset-modal-sm { max-width: calc(100% - 1rem); margin: 0.5rem; }
    .manual-tab span { display: none; }
    .manual-tab { min-width: 44px; }
    .manual-platform { min-width: calc(50% - 4px); }
}

.home-reset-modal {
    width: 100%;
    max-width: 28rem;
    background: var(--h-card-bg);
    border: 1px solid var(--h-card-border);
    border-radius: var(--h26-radius-xl);
    box-shadow: var(--h26-shadow-modal);
}
.home-modal-body { padding: var(--pfm-pad) var(--pfm-pad-lg); }
.home-modal-header {
    display: flex;
    align-items: center;
    gap: var(--pfm-gap-md);
    margin-bottom: 1rem;
}
.home-reset-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: #fef2f2;
    color: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.home-modal-title { font-size: 1.25rem; font-weight: 600; color: var(--h-text-primary); margin: 0; }
.home-modal-content { margin-bottom: var(--pfm-mb-section); }
.home-modal-text { font-size: 0.9375rem; color: var(--h-text-secondary); margin: 0 0 var(--pfm-gap) 0; }
.home-modal-list {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--pfm-gap-md) 0;
}
.home-modal-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--h-text-secondary);
    margin-bottom: 0.5rem;
}
.home-modal-list li i { color: #ef4444; margin-top: 0.2rem; flex-shrink: 0; }
.home-reset-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 0.75rem 1rem;
}
.home-reset-warning p { font-size: 0.875rem; color: #92400e; margin: 0; display: flex; align-items: center; gap: 0.5rem; }
.home-reset-warning i { color: #d97706; }
.home-modal-actions {
    display: flex;
    gap: var(--pfm-gap);
}
.home-modal-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
    padding: 12px 24px;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: var(--h26-radius);
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    -webkit-tap-highlight-color: transparent;
}
.home-modal-btn.secondary {
    background: #f1f5f9;
    color: var(--h26-text-secondary);
}
.home-modal-btn.secondary:hover { background: #e2e8f0; }
.home-modal-btn.danger {
    background: var(--h26-danger);
    color: #fff;
}
.home-modal-btn.danger:hover { background: #b91c1c; }
.dash-plan-name { font-size: 1.125rem; font-weight: 600; color: #0f172a; margin: 0; }
.dash-tip-icon { width: 2.5rem; height: 2.5rem; border-radius: 12px; background: #eef2ff; display: flex; align-items: center; justify-content: center; margin-right: 1rem; flex-shrink: 0; }
.dash-tip-icon i { color: #4f46e5; }
.dash-tip-title { font-size: 1rem; font-weight: 600; color: #0f172a; margin: 0 0 0.5rem 0; }
.dash-tip-text { font-size: 0.875rem; color: #64748b; line-height: 1.6; margin: 0; }

.home-notification {
    display: flex;
    align-items: center;
    gap: var(--pfm-gap-md);
    padding: 1rem 1.25rem;
    background: var(--h-card-bg);
    border: 1px solid var(--h-card-border);
    border-radius: var(--h-card-radius);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1), 0 2px 6px rgba(0,0,0,0.06);
    min-height: 44px;
}
.home-notif-icon { font-size: 1.25rem; flex-shrink: 0; }
.home-notif-success .home-notif-icon { color: #10b981; }
.home-notif-error .home-notif-icon { color: #ef4444; }
.home-notif-warning .home-notif-icon { color: #f59e0b; }
.home-notif-info .home-notif-icon { color: #3b82f6; }
.home-notif-content { flex: 1; min-width: 0; }
.home-notif-text { font-size: 0.9375rem; font-weight: 500; color: var(--h-text-primary); margin: 0; }
.home-notif-close {
    padding: 0.5rem;
    background: none;
    border: none;
    color: var(--h-text-muted);
    cursor: pointer;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}
.home-notif-close:hover { color: var(--h-text-primary); background: #f1f5f9; }
.home-notif-success { border-left: 4px solid #10b981; }
.home-notif-error { border-left: 4px solid #ef4444; }
.home-notif-warning { border-left: 4px solid #f59e0b; }
.home-notif-info { border-left: 4px solid #3b82f6; }

/* Dropdown menú */
#dropdown-menu, #notifications-dropdown {
    position: fixed !important;
    z-index: 100 !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    background-color: rgba(255,255,255,0.95);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-lg);
}
#dropdown-menu.hidden, #notifications-dropdown.hidden { display: none !important; }
#menu-button, #menu-button-header, #notifications-button { position: relative; z-index: 101; }

/* Agent/Chat (ai-studio) */
.agent-header { position: absolute; top: 1rem; left: 1rem; padding: 0; background: transparent; z-index: 1000; display: flex; }
.agent-profile { display: none; }
.agent-avatar {
    width: 4rem; height: 4rem;
    border-radius: 50%;
    background: white;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    border: 2px solid var(--primary);
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    animation: float 3s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.agent-avatar:hover { transform: scale(1.1); animation-play-state: paused; }
.agent-avatar img { width: 100%; height: 100%; object-fit: cover; }
.agent-card { flex: 1; display: flex; flex-direction: column; background: white; overflow: hidden; border-radius: var(--radius-lg); box-shadow: var(--shadow); border: 1px solid var(--gray-200); }
.agent-welcome { padding: var(--space-3) var(--space-4); background: var(--primary); color: white; }
.chat-container { flex: 1; height: auto; overflow-y: auto; padding: var(--space-4); background: var(--gray-50); }
.chat-message { margin-bottom: var(--space-3); max-width: 85%; animation: fadeIn 0.3s ease-out; }
.chat-message.user { margin-left: auto; }
.message-bubble { padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); font-size: 0.95rem; box-shadow: var(--shadow-sm); transition: all 0.3s; }
.message-bubble:hover { box-shadow: var(--shadow); }
.message-bubble:active { transform: scale(0.98); }
.chat-message.user .message-bubble { background: var(--primary); color: white; border-bottom-right-radius: var(--radius-sm); }
.chat-message.assistant .message-bubble { background: white; color: var(--gray-800); border-bottom-left-radius: var(--radius-sm); border: 1px solid var(--gray-200); }
.chat-form { display: flex; align-items: center; padding: var(--space-3) var(--space-4); background: white; border-top: 1px solid var(--gray-200); }
.chat-input { flex: 1; border: 1px solid var(--gray-300); padding: var(--space-3) var(--space-4); padding-left: 2.75rem; border-radius: var(--radius-lg); font-size: 0.95rem; background: var(--gray-50); }
.chat-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); background: white; }
.suggestion-item { padding: var(--space-3); border-radius: var(--radius); background: var(--gray-50); color: var(--primary); font-size: 0.875rem; cursor: pointer; border: 1px solid var(--gray-200); }
.suggestion-item:hover { background: var(--primary-light); border-color: var(--primary); }
.chat-submit { width: 2.5rem; height: 2.5rem; min-width: 44px; min-height: 44px; border-radius: 50%; background: var(--primary); color: white; border: none; margin-left: var(--space-2); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: box-shadow 0.2s, background 0.2s; }
.chat-submit:hover { background: var(--primary-dark); box-shadow: 0 2px 6px rgba(79,70,229,0.3); }
.chat-submit:active { transform: scale(0.98); }
.chat-submit:disabled { background: var(--gray-300); cursor: not-allowed; transform: none; }
.typing-bubble { padding: var(--space-3) var(--space-4); background: white; border-radius: var(--radius-lg); border: 1px solid var(--gray-200); box-shadow: var(--shadow-sm); display: flex; align-items: center; }
.typing-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--gray-400); margin: 0 0.1rem; animation: typingAnimation 1.4s infinite ease-in-out both; }
@keyframes typingAnimation { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.6; } 40% { transform: scale(1); opacity: 1; } }

/* ===== COMPONENTES COMPARTIDOS - Estilo Hostinger ===== */
/* Empty state */
.empty-state { text-align: center; padding: 2rem 1rem; color: #64748b; }
.empty-state-icon {
    width: 56px; height: 56px;
    margin: 0 auto 1rem;
    background: #f8fafc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.empty-state-icon i { font-size: 1.5rem; color: #cbd5e1; }
.empty-state h3 { font-size: 1rem; font-weight: 600; color: #0f172a; margin: 0 0 0.25rem 0; }
.empty-state p { font-size: 0.875rem; color: #64748b; margin: 0 0 1rem 0; }
.empty-state .button, .empty-state .dash-btn-primary { margin-top: 0.5rem; }

/* Tabs principales (channels) — mismo estilo que dash-tab / POS */
.main-tabs-wrap {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--h26-border);
}
.main-tab-link {
    padding: 12px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--h26-text-secondary);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}
.main-tab-link:hover {
    color: var(--h26-accent);
    border-bottom-color: var(--h26-primary-light);
}
.main-tab-link.active {
    color: #fff;
    background: var(--h26-primary);
    border-bottom-color: var(--h26-primary);
}
.main-tab-link i { margin-right: 0.25rem; }
.main-tab-content { display: none; }
.main-tab-content.active { display: block; }

/* Tab content (affiliates) */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Channel card */
.channel-card.dash-card { transition: box-shadow 0.2s; }
.channel-card.dash-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

/* Info section, stats (affiliate-details) */
.info-section {
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.info-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-item {
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.stat-value { font-size: 1.25rem; font-weight: 700; color: #0f172a; margin-bottom: 0.25rem; }
.stat-label { font-size: 0.75rem; color: #64748b; font-weight: 500; }
.commission-item, .client-item {
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
}

/* Status badges */
.status-badge { display: inline-flex; align-items: center; padding: 0.25rem 0.5rem; border-radius: 6px; font-size: 0.6875rem; font-weight: 500; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-paid { background: #d1fae5; color: #065f46; }
.status-approved { background: #d1fae5; color: #065f46; }
.status-rejected { background: #fee2e2; color: #991b1b; }
.tier-badge { display: inline-flex; align-items: center; padding: 0.25rem 0.5rem; border-radius: 6px; font-size: 0.6875rem; font-weight: 500; }
.tier-gold { background: #fef3c7; color: #92400e; }
.tier-silver { background: #f1f5f9; color: #475569; }
.tier-bronze { background: #fed7aa; color: #9a3412; }

/* Filter chips (products) */
.filter-chip { display: inline-flex; align-items: center; padding: 0.25rem 0.5rem; border-radius: 8px; font-size: 0.75rem; background: #eef2ff; color: #4338ca; }
.filter-chip-remove { margin-left: 0.25rem; cursor: pointer; opacity: 0.7; }
.filter-chip-remove:hover { opacity: 1; }

/* Inputs y formularios — Hostinger 2026 (pfm-input) */
.dash-input {
    width: 100%;
    min-height: 44px;
    padding: 12px 16px;
    font-size: 0.9375rem;
    color: var(--h26-text);
    background: var(--h26-bg);
    border: 1px solid var(--h26-border);
    border-radius: var(--h26-radius);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.dash-input:focus {
    outline: none;
    border-color: var(--h26-accent);
    box-shadow: 0 0 0 3px var(--h26-focus-ring-strong);
}

/* form-input, form-select — alias para app/index, login, etc. */
.form-input,
.form-select {
    width: 100%;
    min-height: 44px;
    padding: 12px 16px;
    font-size: 0.9375rem;
    color: var(--h26-text);
    background: var(--h26-bg);
    border: 1px solid var(--h26-border);
    border-radius: var(--h26-radius);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 1.25rem;
}
.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--h26-accent);
    box-shadow: 0 0 0 3px var(--h26-focus-ring-strong);
}

/* form-group, form-label, form-textarea, form-checkbox, form-help — wizard, formularios */
.form-group { margin-bottom: 1rem; }
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--h26-text-secondary);
    margin-bottom: 0.5rem;
}
.form-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px 16px;
    font-size: 0.9375rem;
    color: var(--h26-text);
    background: var(--h26-bg);
    border: 1px solid var(--h26-border);
    border-radius: var(--h26-radius);
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-textarea:focus {
    outline: none;
    border-color: var(--h26-accent);
    box-shadow: 0 0 0 3px var(--h26-focus-ring-strong);
}
.form-checkbox {
    width: 1rem;
    height: 1rem;
    border-radius: 6px;
    border: 1px solid var(--h26-border);
    accent-color: var(--h26-primary);
}
.form-help {
    font-size: 0.75rem;
    color: var(--h26-text-secondary);
    margin-top: 0.25rem;
}

/* wizard-notification — wizard.php */
.wizard-notification-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1050;
    max-width: 400px;
    width: 100%;
}
.wizard-notification {
    background: var(--h26-bg);
    border-radius: var(--h26-radius-lg);
    padding: 16px 20px;
    margin-bottom: 12px;
    box-shadow: var(--h26-shadow-hover);
    border: 1px solid var(--h26-border);
    border-left: 4px solid;
    display: flex;
    align-items: center;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
}
.wizard-notification.show {
    transform: translateX(0);
    opacity: 1;
}
.wizard-notification.error { border-left-color: #ef4444; }
.wizard-notification.success { border-left-color: #10b981; }
.wizard-notification.info { border-left-color: #3b82f6; }
.wizard-notification-icon {
    font-size: 1.25rem;
    margin-right: 12px;
    flex-shrink: 0;
}
.wizard-notification.error .wizard-notification-icon { color: #ef4444; }
.wizard-notification.success .wizard-notification-icon { color: #10b981; }
.wizard-notification.info .wizard-notification-icon { color: #3b82f6; }
.wizard-notification-content {
    flex: 1;
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--h26-text);
}
.wizard-notification-close {
    margin-left: 12px;
    color: var(--h26-text-secondary);
    cursor: pointer;
    transition: color 0.2s;
}
.wizard-notification-close:hover { color: var(--h26-text); }
@media (max-width: 480px) {
    .wizard-notification-container { right: 10px; left: 10px; max-width: none; }
    .wizard-notification { padding: 14px 16px; }
}

/* Botones de icono (filtros, opciones) */
.dash-btn-icon-sm {
    min-width: 44px;
    min-height: 44px;
    padding: 0.5rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.dash-btn-icon-sm:hover { background: #f8fafc; color: #4f46e5; }

/* Products toolbar: buscar, filtro, ordenar — mismo alto */
.products-toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.5rem;
}
.products-toolbar-row form,
.products-toolbar-row .sort-dropdown-container {
    min-height: 44px;
}
.products-toolbar-row form {
    display: flex;
    flex: 1;
    min-width: 0;
    height: 44px;
}
.products-toolbar-row .dash-search-input {
    min-height: 44px;
    height: 44px;
}
.products-toolbar-row .products-toolbar-btn {
    min-height: 44px;
    height: 44px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: var(--h26-radius);
    border: 1px solid var(--h26-border);
    background: var(--h26-bg);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--h26-text-secondary);
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.products-toolbar-row .products-toolbar-btn:hover {
    background: #f8fafc;
    border-color: var(--h26-primary-border);
    color: var(--h26-text);
}
@media (max-width: 640px) {
    .products-toolbar-row .products-toolbar-btn {
        min-width: 44px;
        padding: 0;
    }
}

/* Product card en grid (products.php) — Hostinger 2026 */
.dash-product-card {
    background: var(--h26-bg);
    border: 1px solid var(--h26-border);
    border-radius: var(--h26-radius-lg);
    box-shadow: var(--h26-shadow-card);
    transition: all 0.2s ease;
}
.dash-product-card:hover {
    border-color: var(--h26-primary-border);
    background: var(--h26-bg-hover);
}

/* ===== PRODUCTS - Estilos movidos desde inline ===== */
.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.product-menu { position: relative; display: inline-block; -webkit-tap-highlight-color: transparent; }
.product-menu-dropdown, .product-menu-button { -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.product-menu-button { background: none; border: none; padding: 0.5rem; border-radius: 10px; cursor: pointer; transition: all 0.2s; color: #64748b; display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
.product-menu-button:hover { background: #f1f5f9; color: var(--h26-text); }
.product-menu-button:active { transform: scale(0.98); }
.product-menu-button[aria-expanded="true"] { background: var(--h26-primary-light); color: var(--h26-accent); }
.product-menu-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--h26-bg);
    border-radius: var(--h26-radius);
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
    border: 1px solid var(--h26-border);
    min-width: 180px;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
    margin-top: 2px;
    pointer-events: none;
}
.product-menu-dropdown::before { content: ''; position: absolute; bottom: 100%; left: 0; right: 0; height: 10px; }
.product-menu-dropdown.show { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto; }
.product-menu-item { display: flex; align-items: center; padding: 0.625rem 1rem; color: #334155; font-size: 0.875rem; transition: all 0.15s; border: none; background: none; width: 100%; text-align: left; cursor: pointer; }
.product-menu-item:hover { background: #f8fafc; color: #0f172a; }
.product-menu-item i { width: 1.125rem; margin-right: 0.75rem; font-size: 0.875rem; text-align: center; }
.product-menu-separator { height: 1px; background: #e2e8f0; margin: 0.25rem 0; }
.modal-products { display: none; position: fixed; z-index: 1000; inset: 0; background: var(--h26-overlay); align-items: center; justify-content: center; }
.modal-products .modal-content {
    background: var(--h26-bg);
    padding: 1.5rem;
    border-radius: var(--h26-radius-xl);
    width: 90%;
    max-width: 500px;
    border: 1px solid var(--h26-border);
    box-shadow: var(--h26-shadow-modal);
}
.modal-products .modal-content.modal-md { max-width: 600px; max-height: 90vh; overflow-y: auto; }
.dash-pagination { display: flex; justify-content: center; align-items: center; margin-top: 1.5rem; }
.dash-pagination-btn {
    padding: 0.5rem 1rem;
    margin: 0 0.125rem;
    border-radius: var(--h26-radius);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--h26-text-secondary);
    background: var(--h26-bg);
    border: 1px solid var(--h26-border);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}
.dash-pagination-btn:hover:not(.cursor-not-allowed) {
    background: var(--h26-bg-hover);
    border-color: var(--h26-primary-border);
}
.dash-pagination-btn.active {
    background: var(--h26-primary);
    border-color: var(--h26-primary);
    color: #fff;
    font-weight: 600;
}
.dash-pagination-btn.cursor-not-allowed { opacity: 0.5; cursor: not-allowed; background: #f8fafc; }
.per-page-selector { transition: all 0.2s; }
.per-page-selector:hover { border-color: #4f46e5; }
.per-page-selector:focus { border-color: var(--h26-accent); box-shadow: 0 0 0 3px var(--h26-focus-ring); outline: none; }
.filter-chip-remove:hover { transform: scale(1.1); }
#filtersPanel { max-height: 0; overflow: hidden; transition: max-height 0.3s, opacity 0.2s; }
#filtersPanel:not(.hidden) { max-height: 2000px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 640px) { #filtersPanel:not(.hidden) { max-height: calc(100vh - 250px); } }
.share-btn { padding: 1rem; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: all 0.2s; min-height: 80px; }
.share-btn:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.share-btn-mobile { padding: 1rem; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: all 0.2s; min-height: 90px; }
.share-btn-mobile:active { transform: scale(0.98); }
.share-btn-secondary { padding: 0.75rem 1rem; border-radius: 12px; display: flex; align-items: center; justify-content: center; transition: all 0.2s; font-weight: 500; font-size: 0.875rem; min-height: 48px; }
.rounding-option { position: relative; cursor: pointer; }
.rounding-option input[type="radio"] { position: absolute; opacity: 0; }
.rounding-option-label {
    display: block;
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--h26-border);
    border-radius: var(--h26-radius);
    text-align: center;
    transition: all 0.2s;
}
.rounding-option input[type="radio"]:checked + .rounding-option-label {
    border-color: var(--h26-primary);
    background: var(--h26-primary-light);
    color: var(--h26-primary-hover);
}
.rounding-option:hover .rounding-option-label { border-color: var(--h26-primary-border); }
.modal-products .modal-content { -webkit-overflow-scrolling: touch; touch-action: pan-y; overscroll-behavior-y: contain; }
.modal { display: none; position: fixed; z-index: 1000; inset: 0; background: var(--h26-overlay); align-items: center; justify-content: center; }
.modal.flex { display: flex; }
.modal .modal-content {
    background: var(--h26-bg);
    padding: 1.5rem;
    border-radius: var(--h26-radius-xl);
    width: 90%;
    max-width: 500px;
    border: 1px solid var(--h26-border);
    box-shadow: var(--h26-shadow-modal);
}
.modal .modal-content.modal-md { max-width: 600px; max-height: 90vh; overflow-y: auto; }
.dash-modal-share-header { background: #4f46e5; color: #fff; }

/* ===== BUSINESSES - Estilos Hostinger ===== */
.business-card {
    background: var(--h26-bg);
    border: 2px solid transparent;
    border-radius: var(--h26-radius-xl);
    box-shadow: var(--h26-shadow-card);
    transition: all 0.2s ease;
    overflow: hidden;
}
.business-card:hover {
    border-color: var(--h26-primary-border);
    background: var(--h26-bg-hover);
}
.business-card.current { border-color: var(--h26-primary); background: var(--h26-bg-subtle); }
.business-card.current::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: #4f46e5; }
.dash-business-avatar { background: #4f46e5; }
.dash-upgrade-icon { background: #4f46e5; color: #fff; }
.dash-info-box { background: #f8fafc; }

/* ===== CLIENTS - Estilos Hostinger ===== */
.client-card { transition: box-shadow 0.2s; }
.client-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.client-initial { width: 40px; height: 40px; border-radius: 50%; background: #4f46e5; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: 1rem; text-transform: uppercase; }
.action-button { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border-radius: 10px; border: none; cursor: pointer; transition: all 0.2s; font-size: 0.875rem; }
.action-button.whatsapp { background: #25d366; color: #fff; }
.action-button.whatsapp:hover { background: #128c7e; }
.action-button.edit { background: #f1f5f9; color: #64748b; }
.action-button.edit:hover { background: #e2e8f0; color: #334155; }
.action-button.delete { background: #fef2f2; color: #dc2626; }
.action-button.delete:hover { background: #fee2e2; }
.action-button.view { background: #eef2ff; color: #4f46e5; }
.action-button.view:hover { background: #e0e7ff; }
#import-contacts-modal { z-index: 99999 !important; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); opacity: 0; transition: opacity 0.3s; }
#import-contacts-modal.modal-open { opacity: 1; }
#import-contacts-modal .dash-card { box-shadow: var(--h26-shadow-modal); transition: transform 0.3s; }
#import-contacts-modal.modal-open .dash-card { transform: scale(1); }
#finish-import-btn:hover { box-shadow: 0 4px 12px rgba(79,70,229,0.2); }
.client-modal-tall { height: 80vh; max-height: 600px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: #e2e8f0; display: flex; align-items: center; justify-content: center; font-weight: 500; color: #64748b; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.filter-button {
    padding: 0.5rem 1rem;
    border-radius: var(--h26-radius);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--h26-text-secondary);
    background: var(--h26-bg);
    border: 1px solid var(--h26-border);
    cursor: pointer;
    transition: all 0.2s;
}
.filter-button:hover { background: #f1f5f9; border-color: var(--h26-primary-border); }
.filter-button.active { background: var(--h26-primary); border-color: var(--h26-primary); color: #fff; }
.modal-tab-button { border-bottom: 2px solid transparent; color: #64748b; transition: all 0.2s; background: none; border: none; cursor: pointer; }
.modal-tab-button:hover { color: #334155; border-bottom-color: #e2e8f0; }
.modal-tab-button.active { color: #4f46e5; border-bottom-color: #4f46e5; }
.scrollable-container { -webkit-overflow-scrolling: touch; scrollbar-width: none; -ms-overflow-style: none; }
.scrollable-container::-webkit-scrollbar { display: none; }
#import-step-1.hidden, #import-step-2.hidden, #import-step-3.hidden { opacity: 0; }
@keyframes fadeInUp { from { opacity: 0; } to { opacity: 1; } }
.slide-up { animation: slideUp 0.3s ease-out; }
@keyframes slideUp { from { opacity: 0; } to { opacity: 1; } }
.toast-container { position: fixed; top: 1.25rem; right: 1.25rem; z-index: 10000; pointer-events: none; }
.toast { background: #fff; border-radius: 10px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); border-left: 4px solid #4f46e5; padding: 1rem; margin-bottom: 0.75rem; min-width: 300px; max-width: 400px; transition: transform 0.3s; pointer-events: all; }
@media (max-width: 640px) { .action-button { min-width: 44px; min-height: 44px; } .client-initial { width: 36px; height: 36px; font-size: 0.875rem; } }

/* Breadcrumb */
.dash-breadcrumb { display: flex; align-items: center; font-size: 0.875rem; color: #64748b; margin-bottom: 1.5rem; }
.dash-breadcrumb a { color: #64748b; text-decoration: none; }
.dash-breadcrumb a:hover { color: #4f46e5; }
.dash-breadcrumb span { color: #0f172a; }

/* Responsive - componentes compartidos */
@media (max-width: 640px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .stat-item { padding: 0.75rem; }
    .stat-value { font-size: 1.125rem; }
    .info-section { padding: 1rem; margin-bottom: 1rem; }
    .commission-item, .client-item { padding: 0.625rem 0.75rem; }
    .main-tab-link { font-size: 0.8125rem; padding: 0.375rem 0.5rem; }
    .main-tab-link i { font-size: 0.75rem; }
}

/* Responsive */
@media (min-width: 768px) {
    .metric-card { padding: 1.25rem 1.5rem; min-height: 110px; }
    .analytics-card { min-height: 280px; }
}
@media (max-width: 768px) {
    .metric-card { padding: 0.75rem !important; min-height: 88px !important; max-height: none !important; }
    .metric-card .text-xl, .metric-card .text-2xl { font-size: 1.375rem !important; }
    .metric-card .text-xs { font-size: 0.75rem !important; }
    .metric-card .text-sm { font-size: 0.8rem !important; }
    .dashboard-container .grid { gap: 0.5rem !important; }
    .quick-action-btn { padding: 0.75rem !important; min-height: 72px; }
    .quick-action-btn .w-12 { width: 2rem !important; height: 2rem !important; }
    .quick-action-btn .text-sm { font-size: 0.75rem !important; }
    .analytics-card { min-height: 200px; padding: 1rem; }
    .chart-container { padding: 0.75rem; }
    .home-stats-header { flex-wrap: wrap; gap: 0.5rem; }
    .home-stats-header select { min-width: 100px; }
}
@media (max-width: 374px) {
    .metric-card { padding: 0.5rem !important; min-height: 80px !important; }
    .metric-card .text-xl, .metric-card .text-2xl { font-size: 1.25rem !important; }
    .quick-action-btn { padding: 0.5rem !important; min-height: 64px; }
}
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ===== HOME HPANEL - Hostinger 2026 (product_form_modal) ===== */
/* Variables heredadas de h26 para home */
body {
    --h-card-bg: var(--h26-bg);
    --h-card-border: var(--h26-border);
    --h-card-shadow: var(--h26-shadow-card);
    --h-card-radius: var(--h26-radius-lg);
    --h-card-hover-shadow: 0 4px 12px rgba(0,0,0,0.06);
    --h-text-primary: var(--h26-text);
    --h-text-secondary: var(--h26-text-secondary);
    --h-text-muted: var(--h26-text-muted);
    --h-accent: var(--h26-accent);
    --h-accent-hover: var(--h26-primary-hover);
}
.home-hpanel { padding-top: 1rem; }

/* Bienvenida */
.home-welcome { margin-bottom: var(--pfm-mb-section); }
.home-welcome-title { font-size: 1.5rem; font-weight: 600; color: var(--h26-text); margin: 0 0 0.25rem 0; letter-spacing: -0.01em; }
.home-welcome-subtitle { font-size: 0.9375rem; color: var(--h26-text-secondary); margin: 0; }

/* Métricas - Sección compacta */
.home-metrics-section { margin-bottom: var(--pfm-mb-section); }
.home-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--pfm-gap);
    margin-bottom: var(--pfm-mb-title);
}
.home-section-title { font-size: 1.125rem; font-weight: 600; color: var(--h-text-primary); margin: 0; }
.home-stats-actions { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
.home-select {
    min-height: 44px;
    padding: 12px 2rem 12px 16px;
    border-radius: var(--h26-radius);
    border: 1px solid var(--h-card-border);
    background: var(--h-card-bg);
    font-size: 0.875rem;
    color: var(--h-text-primary);
    -webkit-tap-highlight-color: transparent;
}
.home-select:focus { outline: none; border-color: var(--h-accent); box-shadow: 0 0 0 3px var(--h26-focus-ring); }
.home-btn-icon {
    min-width: 44px; min-height: 44px;
    padding: 12px;
    border-radius: var(--h26-radius);
    border: 1px solid var(--h-card-border);
    background: var(--h-card-bg);
    color: var(--h-text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.home-btn-icon:hover { background: #f1f5f9; color: var(--h-accent); }
.home-btn-icon:focus { outline: none; border-color: var(--h-accent); box-shadow: 0 0 0 3px var(--h26-focus-ring); }
.home-btn-icon.danger:hover { background: #fef2f2; color: #dc2626; }

.home-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--pfm-gap);
}
@media (min-width: 640px) {
    .home-metrics-grid { grid-template-columns: repeat(4, 1fr); gap: var(--pfm-gap-md); }
}
.home-metric-card {
    display: flex;
    align-items: flex-start;
    gap: var(--pfm-gap);
    padding: var(--pfm-pad-card);
    background: var(--h-card-bg);
    border: 1px solid var(--h-card-border);
    border-radius: var(--h-card-radius);
    box-shadow: var(--h-card-shadow);
    transition: box-shadow 0.2s, border-color 0.2s;
}
.home-metric-card:hover {
    box-shadow: var(--h-card-hover-shadow);
    border-color: var(--h26-primary-border);
    background: var(--h26-bg-hover);
}
.home-metric-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    flex-shrink: 0;
}
.home-metric-card.orange .home-metric-icon { background: #fffbeb; color: #f59e0b; }
.home-metric-card.indigo .home-metric-icon { background: #eef2ff; color: #6366f1; }
.home-metric-card.blue .home-metric-icon { background: #eff6ff; color: #3b82f6; }
.home-metric-card.green .home-metric-icon { background: #ecfdf5; color: #10b981; }
.home-metric-content { flex: 1; min-width: 0; }
.home-metric-value { display: block; font-size: 1.125rem; font-weight: 700; color: var(--h-text-primary); line-height: 1.3; }
.home-metric-label { font-size: 0.75rem; color: var(--h-text-secondary); margin-top: 0.25rem; }

/* Plan widget - Compacto */
.plan-widget-simple {
    background: var(--h-card-bg);
    border: 1px solid var(--h-card-border);
    border-radius: var(--h-card-radius);
    padding: var(--pfm-pad-card);
    box-shadow: var(--h-card-shadow);
}
.plan-widget-simple-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
}
.plan-widget-simple-name { font-size: 0.9375rem; font-weight: 600; color: var(--h-text-primary); }
.plan-widget-simple-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 600;
    background: #fef3c7;
    color: #92400e;
}
.plan-widget-simple-date {
    font-size: 0.8125rem;
    color: var(--h-text-secondary);
}
.plan-widget-simple-date.urgent { color: #ea580c; font-weight: 500; }
.plan-widget-simple-links { display: flex; align-items: center; gap: 1rem; margin-left: auto; }
.plan-widget-simple-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--h-accent);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s;
}
.plan-widget-simple-link:hover { color: var(--h-accent-hover); }
.plan-widget-simple-link i { font-size: 0.625rem; }
@media (max-width: 640px) {
    .plan-widget-simple-links { margin-left: 0; width: 100%; }
}

/* Analytics */
.home-analytics-section { margin-bottom: var(--pfm-mb-section); }
.home-analytics-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--pfm-pad) var(--pfm-pad-lg);
    background: var(--h-card-bg);
    border: 1px solid var(--h-card-border);
    border-radius: var(--h-card-radius);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--h-text-primary);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--h-card-shadow);
    -webkit-tap-highlight-color: transparent;
}
.home-analytics-toggle:hover {
    background: var(--h26-bg-hover);
    border-color: var(--h26-primary-border);
    box-shadow: var(--h-card-hover-shadow);
}
.home-analytics-toggle-text { display: flex; align-items: center; gap: 0.5rem; }
.home-analytics-toggle-text i { color: var(--h-accent); }
.home-analytics-chevron {
    font-size: 0.75rem;
    color: var(--h-text-muted);
    transition: transform 0.2s;
}
.home-analytics-chevron.open { transform: rotate(180deg); }
.home-analytics-content {
    overflow: visible;
}
.home-analytics-content.open {
    display: block;
}
.home-analytics-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--pfm-gap-md);
    margin-bottom: var(--pfm-gap-md);
}
.home-analytics-grid:last-child { margin-bottom: 0; }
@media (min-width: 640px) {
    .home-analytics-grid.four { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .home-analytics-grid { grid-template-columns: repeat(2, 1fr); }
    .home-analytics-grid.three { grid-template-columns: repeat(3, 1fr); }
    .home-analytics-grid.four { grid-template-columns: repeat(4, 1fr); }
}
.home-analytics-card {
    background: var(--h-card-bg);
    border: 1px solid var(--h-card-border);
    border-radius: var(--h-card-radius);
    padding: var(--pfm-pad-card);
    box-shadow: var(--h-card-shadow);
    transition: box-shadow 0.2s;
}
.home-analytics-card:hover { box-shadow: var(--h-card-hover-shadow); }
.home-analytics-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--h-text-primary);
    margin: 0 0 var(--pfm-mb-title) 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.home-analytics-title i { color: var(--h-accent); }
.home-chart-wrap { height: 220px; position: relative; }
.home-chart-wrap.medium { height: 180px; }
.home-analytics-list { min-height: 120px; }
.home-analytics-empty {
    font-size: 0.9375rem;
    color: var(--h26-text-secondary);
    text-align: center;
    padding: 1.5rem 1rem;
    margin: 0;
}
.home-analytics-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: var(--h26-text);
    transition: background 0.15s;
}
.home-analytics-item-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.5rem;
    margin: 0 -0.5rem;
    border-radius: var(--h26-radius);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}
.home-analytics-item-link:hover { background: var(--h26-bg-subtle); }
.home-analytics-item-label { font-weight: 500; color: var(--h26-text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.home-analytics-item-link:hover .home-analytics-item-label { color: var(--h26-accent); }
.home-analytics-item-value { font-weight: 600; color: var(--h26-text-secondary); margin-left: 0.75rem; flex-shrink: 0; }
.home-analytics-item-link:hover .home-analytics-item-value { color: var(--h26-accent); }
.home-analytics-product-inner { flex: 1; min-width: 0; }
.home-analytics-ext-icon { font-size: 0.75rem; color: var(--h26-text-muted); margin-left: 0.5rem; }
.home-analytics-bar-wrap { width: 100%; height: 8px; background: var(--h26-border); border-radius: 9999px; overflow: hidden; margin-top: 0.25rem; }
.home-analytics-bar-fill { height: 100%; border-radius: 9999px; background: var(--h26-accent); transition: width 0.3s; }
.home-analytics-bar-fill.orange { background: #f59e0b; }
.home-analytics-badge { font-size: 0.75rem; font-weight: 500; padding: 0.25rem 0.5rem; border-radius: 9999px; }
.home-analytics-badge.green { background: #d1fae5; color: #065f46; }
.home-analytics-badge.purple { background: #e9d5ff; color: #6b21a8; }
.home-analytics-badge.blue { background: #dbeafe; color: #1d4ed8; }
.home-country-flag { width: 20px; height: 15px; object-fit: contain; vertical-align: middle; margin-right: 0.35rem; border-radius: 2px; flex-shrink: 0; }
.home-analytics-country-stats { display: flex; align-items: center; gap: 0.5rem; }
.home-analytics-country-row .home-analytics-item-label { display: flex; align-items: center; min-width: 0; }
.home-analytics-location { white-space: normal; word-break: break-word; line-height: 1.3; }
.home-analytics-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--h26-accent); flex-shrink: 0; margin-right: 0.75rem; }
.home-analytics-trend { display: flex; align-items: center; gap: 0.5rem; }
.home-analytics-trend.up { color: var(--h26-success); }
.home-analytics-trend.down { color: var(--h26-danger); }
.home-analytics-trend.neutral { color: var(--h26-text-secondary); }
.home-analytics-trend-icon { font-size: 0.75rem; }
.home-analytics-category { padding: 0.25rem 0; }
.home-analytics-category-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.25rem; }
.home-analytics-category-name { font-size: 0.875rem; font-weight: 500; color: var(--h26-text); }
.home-analytics-category-pct { font-size: 0.75rem; color: var(--h26-text-muted); margin-left: 0.5rem; }
.home-analytics-bar-fill.pink { background: #ec4899; }
.home-spinner {
    width: 1.5rem; height: 1.5rem;
    border-radius: 50%;
    border: 2px solid var(--h-card-border);
    border-top-color: var(--h-accent);
    animation: spin 0.8s linear infinite;
    margin: 2rem auto;
}

/* Consejo del día - compacto */
.home-tip-card {
    display: flex;
    align-items: flex-start;
    gap: var(--pfm-gap-md);
    padding: var(--pfm-pad-card);
    background: var(--h-card-bg);
    border: 1px solid var(--h-card-border);
    border-radius: var(--h-card-radius);
    box-shadow: var(--h-card-shadow);
}
.home-tip-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: #fef3c7;
    color: #d97706;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.home-tip-content { flex: 1; min-width: 0; }
.home-tip-label { font-size: 0.6875rem; font-weight: 600; color: var(--h-text-muted); text-transform: uppercase; letter-spacing: 0.05em; display: block; margin-bottom: 0.25rem; }
.home-tip-text { font-size: 0.875rem; color: var(--h-text-secondary); line-height: 1.5; margin: 0; }

/* Responsive home hpanel */
@media (max-width: 640px) {
    .home-welcome-title { font-size: 1.25rem; }
    .home-metric-value { font-size: 1rem; }
    .plan-widget { padding: var(--pfm-pad-card); }
}

/* ===== SETTINGS — Estilo Hostinger (pfm) ===== */
.settings-page .dash-page-title {
    margin-bottom: var(--pfm-mb-section);
}
.settings-section {
    background: var(--h26-bg);
    border: 1px solid var(--h26-border);
    border-radius: var(--h26-radius-lg);
    box-shadow: var(--h26-shadow-card);
    margin-bottom: var(--pfm-mb-section);
    overflow: hidden;
}
.settings-header {
    padding: var(--pfm-pad) var(--pfm-pad-lg);
    border-bottom: 1px solid var(--h26-border-light);
    font-size: 1rem;
    font-weight: 600;
    color: var(--h26-text);
}
.settings-content {
    padding: var(--pfm-pad) var(--pfm-pad-lg);
}
.settings-form-group {
    margin-bottom: var(--pfm-mb-title);
}
.settings-form-group:last-child {
    margin-bottom: 0;
}
.settings-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--h26-text-secondary);
    margin-bottom: 0.5rem;
}
/* Inputs settings: usar dash-input o settings-input */
.settings-input,
.settings-form-group input:not([type="checkbox"]):not([type="file"]),
.settings-form-group select,
.settings-form-group textarea {
    width: 100%;
    min-height: 44px;
    padding: 12px 16px;
    border: 1px solid var(--h26-border);
    border-radius: var(--h26-radius);
    font-size: 0.9375rem;
    color: var(--h26-text);
    background: var(--h26-bg);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.settings-form-group textarea {
    min-height: 80px;
    resize: vertical;
}
.settings-input:focus,
.settings-form-group input:focus,
.settings-form-group select:focus,
.settings-form-group textarea:focus {
    outline: none;
    border-color: var(--h26-accent);
    box-shadow: 0 0 0 3px var(--h26-focus-ring);
}
.settings-form-text {
    font-size: 0.75rem;
    color: var(--h26-text-muted);
    margin-top: 0.25rem;
}
/* Cards settings: compatibilidad con card p-4, sin hover - solo dentro del contenido principal (no afectar dropdown del header) */
.settings-page .dashboard-container .card,
.settings-page .dashboard-container .dash-card {
    padding: var(--pfm-pad) var(--pfm-pad-lg);
}
.settings-page .dashboard-container .card:hover,
.settings-page .dashboard-container .dash-card:hover {
    border-color: var(--h26-border);
    background: var(--h26-bg);
}
.settings-page .dashboard-container .card h2,
.settings-page .dashboard-container .dash-card h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--h26-text);
    margin: 0 0 var(--pfm-mb-title) 0;
}
/* Inputs dentro de cards: estilo Hostinger (pfm) */
.settings-page .dashboard-container .card input:not([type="checkbox"]):not([type="file"]):not([type="hidden"]),
.settings-page .dashboard-container .card select,
.settings-page .dashboard-container .card textarea,
.settings-page .dashboard-container .dash-card input:not([type="checkbox"]):not([type="file"]):not([type="hidden"]),
.settings-page .dashboard-container .dash-card select,
.settings-page .dashboard-container .dash-card textarea {
    width: 100%;
    min-height: 44px;
    padding: 12px 16px;
    border: 1px solid var(--h26-border);
    border-radius: var(--h26-radius);
    font-size: 0.9375rem;
    color: var(--h26-text);
    background: var(--h26-bg);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.settings-page .dashboard-container .card textarea,
.settings-page .dashboard-container .dash-card textarea {
    min-height: 80px;
    resize: vertical;
}
.settings-page .dashboard-container .card input:focus,
.settings-page .dashboard-container .card select:focus,
.settings-page .dashboard-container .card textarea:focus,
.settings-page .dashboard-container .dash-card input:focus,
.settings-page .dashboard-container .dash-card select:focus,
.settings-page .dashboard-container .dash-card textarea:focus {
    outline: none;
    border-color: var(--h26-accent);
    box-shadow: 0 0 0 3px var(--h26-focus-ring);
}
/* Theme option: estilo pfm-type-card */
.settings-theme-option {
    display: flex;
    align-items: center;
    gap: var(--pfm-gap-md);
    padding: var(--pfm-pad-card);
    min-height: 72px;
    border: 1px solid var(--h26-border);
    border-radius: var(--h26-radius-lg);
    background: var(--h26-bg);
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.settings-theme-option:hover {
    border-color: var(--h26-primary-border);
    background: var(--h26-bg-hover);
}
.settings-theme-option.selected {
    border-color: var(--h26-accent);
    background: var(--h26-primary-light);
}
.settings-theme-info {
    margin-left: var(--pfm-gap);
}
.settings-theme-name {
    font-weight: 500;
    color: var(--h26-text);
}
.settings-theme-description {
    font-size: 0.75rem;
    color: var(--h26-text-muted);
}
/* Notificación settings: por encima de modales y todo */
.settings-notification {
    position: fixed;
    top: var(--pfm-pad);
    right: var(--pfm-pad);
    padding: var(--pfm-pad) var(--pfm-pad-lg);
    border-radius: var(--h26-radius);
    background: var(--h26-bg);
    border: 1px solid var(--h26-border);
    box-shadow: var(--h26-shadow-modal);
    display: flex;
    align-items: center;
    gap: var(--pfm-gap-md);
    z-index: 99999;
    animation: settingsSlideIn 0.3s ease-out;
}
@keyframes settingsSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
.settings-notification.success { border-left: 4px solid var(--h26-success); }
.settings-notification.error { border-left: 4px solid var(--h26-danger); }
.settings-notification.warning { border-left: 4px solid var(--h26-warning); }
.settings-notification.info { border-left: 4px solid var(--h26-info); }
/* Sub-tabs General en settings */
.general-panel.hidden { display: none !important; }
.general-sub-tab { border-bottom: 2px solid transparent; }
.general-sub-tab.active, .general-sub-tab:hover { color: var(--h26-accent); }
/* Links y botones de texto en settings */
.settings-page a.text-indigo-600,
.settings-page a[class*="indigo"] {
    color: var(--h26-accent) !important;
}
.settings-page a.text-indigo-600:hover,
.settings-page a[class*="indigo"]:hover {
    color: var(--h26-primary-hover) !important;
}
/* Checkbox y radio Hostinger */
.settings-page input[type="checkbox"],
.settings-page input[type="radio"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--h26-accent);
}
