/* ════════════════════════════════════════════════════════════════════ */
/*  P447 — PREMIUM LAYER Fortune 500 (Stripe · Linear · Notion · Vercel)  */
/*  Solo estilos — capa sobre P437/P393/P394. Rollback: P447_ENABLED=0   */
/* ════════════════════════════════════════════════════════════════════ */

html.u447-premium {
    color-scheme: light;
    scroll-behavior: smooth;
}

html.u447-premium :where(body) {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif !important;
    font-feature-settings: "ss01" on, "cv11" on, "kern" on;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* ─── Tokens premium (alias sobre u437) ─── */
html.u447-premium {
    --u447-indigo: #6366f1;
    --u447-indigo-dark: #4f46e5;
    --u447-indigo-soft: #eef2ff;
    --u447-gold: #d4af37;
    --u447-gold-soft: #fef9e7;
    --u447-surface: #ffffff;
    --u447-canvas: #f8fafc;
    --u447-border: #e2e8f0;
    --u447-text: #0f172a;
    --u447-text-muted: #64748b;
    --u447-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --u447-shadow-card: 0 1px 2px rgb(15 23 42 / 0.04), 0 4px 12px rgb(15 23 42 / 0.03);
    --u447-shadow-hover: 0 8px 24px -6px rgb(99 102 241 / 0.14), 0 2px 8px rgb(15 23 42 / 0.04);
}

/* ═══ TOPBAR P337 ═══ */
html.u447-premium #p337-topbar {
    background: rgb(255 255 255 / 0.92) !important;
    backdrop-filter: blur(12px) saturate(1.4);
    -webkit-backdrop-filter: blur(12px) saturate(1.4);
    border-bottom: 1px solid var(--u447-border) !important;
    box-shadow: 0 1px 0 rgb(15 23 42 / 0.03);
}

html.u447-premium #p337-topbar .crumb-base {
    color: var(--u447-text-muted);
    font-weight: 500;
    font-size: 13px;
}

html.u447-premium #p337-topbar .crumb-now {
    color: var(--u447-text);
    font-weight: 700;
    font-size: 13px;
}

html.u447-premium #p337-search-btn {
    border-radius: 10px !important;
    border: 1px solid var(--u447-border) !important;
    background: var(--u447-canvas) !important;
    transition: all 0.2s var(--u447-ease) !important;
}

html.u447-premium #p337-search-btn:hover {
    border-color: #c7d2fe !important;
    background: var(--u447-indigo-soft) !important;
    box-shadow: 0 0 0 3px rgb(99 102 241 / 0.08);
}

/* ═══ SIDEBAR P334 — menú premium ═══ */
html.u447-premium #p334-sidebar {
    background: linear-gradient(180deg, #fff 0%, #fafbfc 100%) !important;
    border-right: 1px solid var(--u447-border) !important;
    box-shadow: 1px 0 0 rgb(15 23 42 / 0.02);
}

html.u447-premium #p334-sidebar .p334-section-head {
    font-size: 10px !important;
    font-weight: 800 !important;
    letter-spacing: 0.12em !important;
    color: #94a3b8 !important;
    text-transform: uppercase;
    padding: 16px 16px 8px !important;
}

html.u447-premium #p334-sidebar .p334-item,
html.u447-premium #p334-sidebar a.p334-item {
    border-radius: 10px !important;
    margin: 2px 10px !important;
    padding: 9px 12px !important;
    color: var(--u447-text-muted) !important;
    font-weight: 500 !important;
    font-size: 13.5px !important;
    transition: all 0.18s var(--u447-ease) !important;
    border: 1px solid transparent !important;
    position: relative;
}

html.u447-premium #p334-sidebar .p334-item:hover,
html.u447-premium #p334-sidebar a.p334-item:hover {
    background: var(--u447-indigo-soft) !important;
    color: var(--u447-indigo-dark) !important;
    border-color: rgb(99 102 241 / 0.12) !important;
    transform: translateX(2px);
}

html.u447-premium #p334-sidebar .p334-item.u447-nav-active,
html.u447-premium #p334-sidebar .p334-item.active,
html.u447-premium #p334-sidebar a.p334-item.u447-nav-active {
    background: linear-gradient(135deg, var(--u447-indigo-soft), #f5f3ff) !important;
    color: var(--u447-indigo-dark) !important;
    font-weight: 600 !important;
    border-color: rgb(99 102 241 / 0.18) !important;
    box-shadow: inset 3px 0 0 var(--u447-indigo);
}

html.u447-premium #p334-sidebar .p334-item svg,
html.u447-premium #p334-sidebar .p334-ic {
    opacity: 0.85;
    transition: transform 0.2s var(--u447-ease);
}

html.u447-premium #p334-sidebar .p334-item:hover svg {
    transform: scale(1.06);
    opacity: 1;
}

html.u447-premium .pos-wahio-nav-item {
    border-radius: 10px !important;
    transition: all 0.18s var(--u447-ease) !important;
}

html.u447-premium .pos-wahio-nav-item:hover {
    background: var(--u447-indigo-soft) !important;
}

html.u447-premium .pos-wahio-nav-item.u447-nav-active {
    background: var(--u447-indigo-soft) !important;
    box-shadow: inset 3px 0 0 var(--u447-indigo);
}

/* ═══ DASHBOARD CEO (P326) — bloque hero + guía visual ═══ */
html.u447-premium .head {
    background: linear-gradient(135deg, #fff 0%, #f8fafc 45%, var(--u447-indigo-soft) 100%) !important;
    border: 1px solid var(--u447-border) !important;
    border-radius: 20px !important;
    padding: 28px 32px !important;
    margin-bottom: 24px !important;
    box-shadow: var(--u447-shadow-card) !important;
    position: relative;
    overflow: hidden;
}

html.u447-premium .head::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--u447-indigo), var(--u447-gold), var(--u447-indigo));
    opacity: 0.85;
}

html.u447-premium .head::after {
    content: "→ Accesos rápidos abajo";
    position: absolute;
    bottom: 12px;
    right: 20px;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 0.02em;
    opacity: 0.7;
}

@media (max-width: 720px) {
    html.u447-premium .head::after { display: none; }
}

html.u447-premium .head h1 {
    font-size: 28px !important;
    font-weight: 800 !important;
    letter-spacing: -0.03em !important;
    color: var(--u447-text) !important;
    line-height: 1.15 !important;
}

html.u447-premium .head .sub {
    font-size: 14px !important;
    color: var(--u447-text-muted) !important;
    margin-top: 6px;
}

html.u447-premium .live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    margin-right: 6px;
    box-shadow: 0 0 0 0 rgb(16 185 129 / 0.5);
    animation: u447-live-pulse 2s ease infinite;
    vertical-align: middle;
}

@keyframes u447-live-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgb(16 185 129 / 0.45); }
    50% { box-shadow: 0 0 0 6px rgb(16 185 129 / 0); }
}

/* Accesos rápidos — grid premium */
html.u447-premium .quick {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    gap: 12px !important;
    margin-bottom: 24px !important;
    position: relative;
}

html.u447-premium .quick::before {
    content: "Accesos directos";
    grid-column: 1 / -1;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--u447-indigo-dark);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

html.u447-premium .quick::after {
    content: "";
    grid-column: 1 / -1;
    height: 1px;
    background: linear-gradient(90deg, var(--u447-indigo), transparent);
    opacity: 0.25;
    margin-bottom: 8px;
}

html.u447-premium .qa {
    background: var(--u447-surface) !important;
    border: 1px solid var(--u447-border) !important;
    border-radius: 14px !important;
    padding: 16px 18px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    color: var(--u447-text) !important;
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    box-shadow: var(--u447-shadow-card) !important;
    transition: all 0.22s var(--u447-ease) !important;
    animation: u447-fade-up 0.5s var(--u447-ease) both;
    position: relative;
    overflow: hidden;
}

html.u447-premium .qa::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--u447-indigo), var(--u447-gold));
    opacity: 0;
    transition: opacity 0.2s;
}

html.u447-premium .qa:hover {
    background: var(--u447-indigo-soft) !important;
    border-color: #c7d2fe !important;
    color: var(--u447-indigo-dark) !important;
    transform: translateY(-3px) !important;
    box-shadow: var(--u447-shadow-hover) !important;
}

html.u447-premium .qa:hover::before {
    opacity: 1;
}

html.u447-premium .qa-icon,
html.u447-premium .u447-icon-box {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px;
    border-radius: 11px !important;
    background: linear-gradient(135deg, var(--u447-indigo-soft), #f5f3ff) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
    border: 1px solid rgb(99 102 241 / 0.12);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.8);
}

html.u447-premium .qa:hover .qa-icon {
    transform: scale(1.05);
    background: linear-gradient(135deg, #e0e7ff, #ede9fe) !important;
}

/* KPIs dashboard */
html.u447-premium .kpis,
html.u447-premium #p366-kpis {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)) !important;
    gap: 14px !important;
    margin-bottom: 24px !important;
}

html.u447-premium .kpis > div,
html.u447-premium #p366-kpis > div,
html.u447-premium .u447-kpi-card {
    background: var(--u447-surface) !important;
    border: 1px solid var(--u447-border) !important;
    border-radius: 16px !important;
    padding: 18px 20px !important;
    box-shadow: var(--u447-shadow-card) !important;
    transition: all 0.22s var(--u447-ease) !important;
    animation: u447-fade-up 0.55s var(--u447-ease) both;
}

html.u447-premium .kpis > div:hover,
html.u447-premium #p366-kpis > div:hover {
    transform: translateY(-2px);
    box-shadow: var(--u447-shadow-hover) !important;
    border-color: #c7d2fe !important;
}

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

/* Cards dashboard */
html.u447-premium .card {
    background: var(--u447-surface) !important;
    border: 1px solid var(--u447-border) !important;
    border-radius: 16px !important;
    padding: 22px 24px !important;
    box-shadow: var(--u447-shadow-card) !important;
    transition: box-shadow 0.22s var(--u447-ease) !important;
}

html.u447-premium .card:hover {
    box-shadow: var(--u447-shadow-hover) !important;
}

html.u447-premium .card h2 {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: var(--u447-text) !important;
    letter-spacing: -0.01em;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 16px !important;
}

html.u447-premium .row2,
html.u447-premium .row3 {
    gap: 16px !important;
    margin-bottom: 16px !important;
}

html.u447-premium .wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 28px 48px;
}

/* ═══ BOTONES GLOBALES ═══ */
html.u447-premium .btn,
html.u447-premium button:not([class*="pos-"]):not(.p334-item):not(.a443-):not(.a444-),
html.u447-premium .btn-primary,
html.u447-premium button.primary {
    border-radius: 10px !important;
    font-weight: 600 !important;
    font-size: 13.5px !important;
    letter-spacing: -0.01em;
    min-height: 40px;
    padding: 0 18px !important;
}

html.u447-premium .btn-secondary,
html.u447-premium button.secondary,
html.u447-premium .btn-outline {
    background: var(--u447-surface) !important;
    color: var(--u447-text) !important;
    border: 1.5px solid var(--u447-border) !important;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.04) !important;
    transition: all 0.18s var(--u447-ease) !important;
}

html.u447-premium .btn-secondary:hover,
html.u447-premium button.secondary:hover {
    background: var(--u447-canvas) !important;
    border-color: #cbd5e1 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgb(15 23 42 / 0.06) !important;
}

html.u447-premium .btn-danger,
html.u447-premium button.danger {
    background: linear-gradient(180deg, #ef4444, #dc2626) !important;
    color: white !important;
    border: none !important;
}

/* ═══ FORMULARIOS ═══ */
html.u447-premium input:not([type="checkbox"]):not([type="radio"]),
html.u447-premium select,
html.u447-premium textarea {
    border-radius: 10px !important;
    border: 1.5px solid var(--u447-border) !important;
    padding: 10px 14px !important;
    font-size: 14px !important;
    background: var(--u447-surface) !important;
    color: var(--u447-text) !important;
    transition: border-color 0.18s, box-shadow 0.18s !important;
}

html.u447-premium input:focus,
html.u447-premium select:focus,
html.u447-premium textarea:focus {
    border-color: var(--u447-indigo) !important;
    box-shadow: 0 0 0 4px rgb(99 102 241 / 0.12) !important;
    outline: none !important;
}

/* ═══ TABLAS ═══ */
html.u447-premium table {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--u447-border);
}

html.u447-premium thead th {
    background: var(--u447-canvas) !important;
    color: var(--u447-text-muted) !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 12px 16px !important;
}

html.u447-premium tbody td {
    padding: 12px 16px !important;
    border-bottom: 1px solid #f1f5f9;
    color: var(--u447-text);
}

html.u447-premium tbody tr:hover td {
    background: #fafbfc;
}

/* ═══ MÓDULOS PREMIUM (P408-P416) ═══ */
html.u447-premium .c410-card,
html.u447-premium .p413-card,
html.u447-premium .u408-card,
html.u447-premium .p425-card {
    border-radius: 16px !important;
}

html.u447-premium .c410-top,
html.u447-premium .p413-hero,
html.u447-premium .u408-top {
    border-radius: 20px !important;
    margin-bottom: 24px !important;
}

/* ═══ P393 light pages ═══ */
html.u447-premium.p393-active body:not([data-cc-v2]) {
    background: var(--u447-canvas) !important;
}

/* ═══ AULA /aula (sin romper tema oscuro propio) ═══ */
html.u447-premium .a443-mod-card {
    border-radius: 18px !important;
    border: 1px solid var(--u447-border) !important;
    transition: all 0.25s var(--u447-ease) !important;
}

html.u447-premium .a443-mod-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px -8px rgb(99 102 241 / 0.18) !important;
    border-color: #c7d2fe !important;
}

html.u447-premium .a443-hero-card {
    border-radius: 20px !important;
    overflow: hidden;
}

html.u447-premium .a443-stat {
    border-radius: 16px !important;
    border: 1px solid var(--u447-border) !important;
}

html.u447-premium .a443-btn-primary,
html.u447-premium .a444-btn-primary {
    border-radius: 12px !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 14px rgb(99 102 241 / 0.28) !important;
}

/* ═══ SCROLLBAR refinado ═══ */
html.u447-premium ::-webkit-scrollbar { width: 8px; height: 8px; }
html.u447-premium ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}
html.u447-premium ::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ═══ Badges / pills ═══ */
html.u447-premium .badge,
html.u447-premium [class*="badge"] {
    border-radius: 999px !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em;
}

/* ═══ Footer dashboard ═══ */
html.u447-premium .foot {
    color: #94a3b8 !important;
    font-size: 12px !important;
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

/* ═══ Reduced motion ═══ */
@media (prefers-reduced-motion: reduce) {
    html.u447-premium * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ═══ Mobile ═══ */
@media (max-width: 768px) {
    html.u447-premium .wrap { padding: 16px; }
    html.u447-premium .head { padding: 20px !important; }
    html.u447-premium .quick { grid-template-columns: 1fr !important; }
}
