/* ===== Vera CRM Responsive System ===== */
:root {
    --vera-radius: 12px;
    --vera-radius-sm: 8px;
}

/* Mobile-first touch targets */
.vera-touch { min-height: 44px; min-width: 44px; }

/* Responsive card */
.vera-card {
    border-radius: var(--vera-radius);
    transition: box-shadow 0.2s ease;
}
.vera-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.08); }

/* KPI card */
.vera-kpi {
    border-radius: var(--vera-radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.vera-kpi:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.1); }

/* Pipeline stepper responsive */
.vera-pipeline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    gap: 4px;
    padding: 8px 0;
}

/* Kanban scroll */
.vera-kanban {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding-bottom: 12px;
}
.vera-kanban > * { scroll-snap-align: start; }

/* Table container for mobile scroll */
.vera-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--vera-radius);
}

/* Action bar (filters + buttons) */
.vera-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

/* Empty state */
.vera-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--mud-palette-text-secondary);
}
.vera-empty .mud-icon-root { font-size: 3rem !important; margin-bottom: 12px; opacity: 0.5; }

/* Breadcrumb style */
.vera-breadcrumb { margin-bottom: 16px; }

/* Mobile adjustments */
@media (max-width: 959px) {
    .mud-main-content { padding-left: 8px !important; padding-right: 8px !important; }
    .vera-hide-mobile { display: none !important; }
    .vera-kpi { padding: 12px; gap: 10px; }
    .vera-kpi .mud-avatar { width: 40px !important; height: 40px !important; }
    .vera-kpi .mud-typography-h4 { font-size: 1.4rem !important; }
    .vera-pipeline { gap: 2px; }
    .vera-pipeline .mud-avatar { width: 32px !important; height: 32px !important; font-size: 0.85rem !important; }
    .vera-pipeline .mud-typography { font-size: 0.8rem !important; }
}

@media (max-width: 599px) {
    .vera-page-title { font-size: 1.4rem !important; }
    .vera-btn-primary { font-size: 0.95rem !important; padding: 8px 16px !important; }
    .vera-kpi .mud-typography-h4 { font-size: 1.2rem !important; }
    .vera-kpi .mud-typography-body2 { font-size: 0.8rem !important; }
}

/* Submitting overlay */
.vera-submitting { opacity: 0.7; pointer-events: none; }

/* ── Splash de carga WASM (mientras bootea el runtime ~3.3MB la 1ra vez) ── */
#wasm-splash {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1565C0 0%, #0D47A1 100%);
    transition: opacity 0.35s ease;
}
#wasm-splash.wasm-splash--hidden { opacity: 0; pointer-events: none; }
.wasm-splash-box { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.wasm-splash-logo {
    font-family: 'Inter', 'Roboto', sans-serif;
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: -1px;
    color: #fff;
    opacity: 0.97;
}
.wasm-splash-spinner {
    width: 42px;
    height: 42px;
    border: 4px solid rgba(255, 255, 255, 0.28);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wasm-splash-spin 0.8s linear infinite;
}
.wasm-splash-text {
    color: rgba(255, 255, 255, 0.85);
    font-family: 'Inter', 'Roboto', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
}
@keyframes wasm-splash-spin { to { transform: rotate(360deg); } }

/* Respeta usuarios con reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .wasm-splash-spinner { animation-duration: 2s; }
    #wasm-splash { transition: none; }
}
