/* ============================================================================
   RAPIDS PAYMENTS — GLASSMORPHISM DESIGN SYSTEM
   ============================================================================
   CSS completo: glassmorphism, partículas, emojis animados, tarjetas 3D,
   sidebar con emojis reales. Compatible con config.html, links.html, embed.html.
   ============================================================================ */


/* ==========================================================================
   1. DESIGN TOKENS
   ========================================================================== */
:root {
    /* ── Nukkon Glassmorphism Tokens ── */
    --nk-blue: #2563eb;
    --nk-blue-2: #1d4ed8;
    --nk-blue-soft: #dbeafe;
    --nk-green: #10b981;
    --nk-green-soft: #d1fae5;
    --nk-red: #ef4444;
    --nk-red-soft: #fee2e2;
    --nk-orange: #f59e0b;
    --nk-orange-soft: #fef3c7;
    --nk-dark: #172033;
    --nk-muted: #7b8aa5;
    --nk-card: rgba(255, 255, 255, 0.86);
    --nk-border: rgba(255, 255, 255, 0.72);
    --nk-radius: 28px;
    --nk-shadow: 0 24px 70px rgba(24, 49, 91, 0.14);
    --nk-shadow-blue: 0 22px 48px rgba(37, 99, 235, 0.24);

    /* ── Legacy tokens (config.html, links.html, embed.html) ── */
    --bg-body: #f0f2f5;
    --bg-surface: #ffffff;
    --bg-hover: #f1f5f9;
    --bg-selected: #dbeafe;
    --bg-input: #f0f2f5;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-glow: rgba(59, 130, 246, 0.3);
    --accent-light: #dbeafe;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-info: #3b82f6;
    --border: #e2e8f0;
    --border-focus: #3b82f6;
    --radius-card: 20px;
    --radius-input: 12px;
    --radius-pill: 999px;
    --radius-row: 10px;
    --font-body: 'Inter', 'Segoe UI', sans-serif;
    --font-mono: 'Consolas', 'SFMono-Regular', monospace;

    /* ── Sombras ── */
    --shadow-card: 0 24px 70px rgba(24, 49, 91, 0.14);
    --shadow-card-hover: 0 32px 80px rgba(24, 49, 91, 0.22);
    --shadow-inset: inset 4px 4px 8px rgba(163, 177, 198, 0.2),
                    inset -4px -4px 8px rgba(255, 255, 255, 0.8);
    --shadow-btn: 0 8px 24px rgba(24, 49, 91, 0.12);
    --shadow-btn-hover: 0 12px 32px rgba(24, 49, 91, 0.18);
    --shadow-soft: 0 4px 15px rgba(0, 0, 0, 0.03);
    --shadow-medium: 0 8px 22px rgba(28, 45, 78, 0.08);

    /* ── Transiciones ── */
    --transition: all 0.2s ease;
    --transition-slow: all 0.3s ease;

    /* ── Layout ── */
    --sidebar-width: 300px;

    /* ── Fondo con blobs ── */
    --tb-bg: #eaf0f7;
    --tb-bg-gradient: linear-gradient(180deg, #f7f9fc 0%, #eaf0f7 100%);
}


/* ==========================================================================
   2. RESET
   ========================================================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    color: var(--nk-dark);
    font-family: 'Inter', 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.6;
    background: var(--tb-bg-gradient);
    overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
ul, ol { list-style: none; }
a { text-decoration: none; color: inherit; }
table { border-collapse: collapse; border-spacing: 0; }
button { background: none; border: none; cursor: pointer; }


/* ==========================================================================
   3. SCROLLBAR
   ========================================================================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(155, 170, 195, 0.35); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(130, 150, 180, 0.5); }
* { scrollbar-width: thin; scrollbar-color: rgba(155, 170, 195, 0.35) transparent; }

::selection { background-color: var(--nk-blue); color: #fff; }


/* ==========================================================================
   4. BLOBS FLOTANTES (fondo — pseudo-elementos, sin HTML extra)
   ========================================================================== */
.tb-page::before,
.tb-page::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    opacity: .12;
    pointer-events: none;
    z-index: 0;
}
.tb-page::before {
    width: 600px; height: 600px;
    background: radial-gradient(circle, #2f6fed, #0ea5ff);
    top: -200px; right: -150px;
    animation: tbBlobFloat1 20s ease-in-out infinite;
}
.tb-page::after {
    width: 450px; height: 450px;
    background: radial-gradient(circle, #0dbb7c, #0ea5ff);
    bottom: -100px; left: -100px;
    animation: tbBlobFloat2 25s ease-in-out infinite;
}
@keyframes tbBlobFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-60px, 40px) scale(1.1); }
}
@keyframes tbBlobFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, -50px) scale(1.05); }
}


/* ==========================================================================
   5. LAYOUT
   ========================================================================== */

/* ── Glassmorphism app shell ── */
.app-shell {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 300px 1fr;
    min-height: 100vh;
    padding: 8px;
}

/* ── Legacy layout (config.html, links.html, embed.html) ── */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 32px;
    max-width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
}

.main {
    position: relative;
    padding: 30px 34px 50px;
    overflow: hidden;
}


/* ==========================================================================
   6. SIDEBAR — Panel 3D con profundidad
   ========================================================================== */

/* Wrapper con perspectiva */
.nk-sidebar-wrap {
    width: 280px;
    min-width: 280px;
    position: relative;
    perspective: 1200px;
}

/* Capa de sombra 3D detrás del sidebar */
.nk-sidebar-depth {
    position: absolute;
    inset: 16px -10px 16px 22px;
    border-radius: 0 34px 34px 0;
    background: linear-gradient(145deg, rgba(82,145,255,.16), rgba(255,255,255,.04));
    box-shadow:
        26px 34px 80px rgba(48,93,154,.20),
        0 0 80px rgba(73,168,255,.10);
    transform: rotateY(-7deg) translateZ(-22px);
    pointer-events: none;
}

.sidebar {
    width: 100%;
    min-height: calc(100vh - 16px);
    position: sticky;
    top: 8px;
    padding: 20px 16px;
    border-radius: 0 30px 30px 0;
    overflow: hidden;
    z-index: 20;

    background:
        radial-gradient(circle at var(--mouse-x,50%) var(--mouse-y,20%), rgba(255,255,255,.90), transparent 24%),
        radial-gradient(circle at 16% 12%, rgba(78,149,255,.16), transparent 34%),
        radial-gradient(circle at 0% 88%, rgba(160,210,255,.09), transparent 38%),
        linear-gradient(180deg, rgba(240,247,255,.88), rgba(222,235,250,.78));

    border-top: 1px solid rgba(255,255,255,.86);
    border-right: 1px solid rgba(255,255,255,.92);
    border-bottom: 1px solid rgba(255,255,255,.70);

    box-shadow:
        22px 0 55px rgba(50,89,146,.22),
        0 28px 70px rgba(44,83,133,.14),
        inset -1px 0 0 rgba(255,255,255,.88),
        inset 1px 1px 0 rgba(255,255,255,.95);

    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transform-style: preserve-3d;
    will-change: transform;
}

/* Overlay de cristal */
.sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(120deg, rgba(255,255,255,.82) 0%, rgba(255,255,255,.24) 38%, transparent 64%),
        repeating-linear-gradient(135deg, rgba(255,255,255,.10) 0, rgba(255,255,255,.10) 1px, transparent 1px, transparent 13px);
    pointer-events: none;
    opacity: .72;
    border-radius: inherit;
}

/* Borde luminoso derecho */
.sidebar::after {
    content: "";
    position: absolute;
    top: 18px;
    right: 0;
    bottom: 18px;
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(37,99,235,.42), transparent);
    box-shadow: 0 0 26px rgba(37,99,235,.28);
    pointer-events: none;
}

.nk-sidebar-content {
    position: relative;
    z-index: 2;
    min-height: calc(100vh - 56px);
    display: flex;
    flex-direction: column;
}

/* ── Brand Card ── */
.sidebar-brand,
.brand-card {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 16px;
    border-radius: 24px;
    margin-bottom: 28px;
    overflow: hidden;

    background: linear-gradient(145deg, rgba(255,255,255,.94), rgba(238,246,255,.76));
    border: 1px solid rgba(255,255,255,.95);
    box-shadow:
        0 25px 50px rgba(42,83,140,.17),
        inset 0 1px 0 rgba(255,255,255,.96);
}

.brand-card::before {
    content: "";
    position: absolute;
    width: 125px;
    height: 125px;
    right: -50px;
    top: -46px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(47,111,237,.16), transparent 70%);
    pointer-events: none;
}

.brand-card::after {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(37,99,235,.25), transparent);
    pointer-events: none;
}

.sidebar-brand img,
.brand-card img {
    height: 32px;
    width: 32px;
    border-radius: 50%;
}

.sidebar-logo-icon,
.brand-logo {
    width: 50px; height: 50px;
    min-width: 50px;
    border-radius: 18px;
    background: linear-gradient(145deg, #ff5a35, #f97316);
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 950;
    font-size: 1.18rem;
    box-shadow: 0 14px 24px rgba(249, 115, 22, 0.28);
}

.sidebar-title,
.brand-title {
    font-weight: 950;
    font-size: 1.03rem;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.02em;
}

.sidebar-subtitle,
.brand-sub {
    margin-top: 5px;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 700;
}

/* ── Navegación sidebar ── */
.sidebar-nav {
    flex: 1;
    padding: 4px 0;
    position: relative;
    z-index: 2;
    overflow-y: auto;
}

.nav-section-title {
    position: relative;
    z-index: 2;
    margin: 28px 12px 10px;
    color: #95a3ba;
    font-size: 0.72rem;
    font-weight: 950;
    letter-spacing: 0.09rem;
    text-transform: uppercase;
}

/* ── Side Link (nav-item + side-link) ── */
.nav-item,
.side-link {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 15px;
    margin-bottom: 9px;
    border-radius: 22px;
    color: #687792;
    font-size: 0.94rem;
    font-weight: 900;
    text-decoration: none;
    transition: 0.25s ease;
    overflow: hidden;
}

.nav-item::after,
.side-link::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(219, 234, 254, 0.7));
    opacity: 0;
    transition: 0.25s ease;
    z-index: -1;
}

.nav-item:hover::after,
.nav-item.active::after,
.side-link:hover::after,
.side-link.active::after {
    opacity: 1;
}

.nav-item:hover,
.nav-item.active,
.side-link:hover,
.side-link.active {
    color: #1557df;
    transform: translateX(5px);
    box-shadow: 0 16px 32px rgba(37, 99, 235, 0.13);
}

.nav-item.active::before,
.side-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 14%;
    width: 5px;
    height: 72%;
    border-radius: 999px;
    background: linear-gradient(180deg, #3b82f6, #1d4ed8);
    box-shadow: 0 0 18px rgba(37, 99, 235, 0.65);
}

/* ── Emoji Icon ── */
.emoji-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    font-size: 1.15rem;
    background: rgba(255, 255, 255, 0.78);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.95),
        0 10px 24px rgba(37, 99, 235, 0.12);
    transform-origin: center;
    animation: emojiFloat 3.4s ease-in-out infinite;
    line-height: 1;
}

.nav-item:nth-of-type(2) .emoji-icon,
.side-link:nth-of-type(2) .emoji-icon { animation-delay: 0.2s; }
.nav-item:nth-of-type(3) .emoji-icon,
.side-link:nth-of-type(3) .emoji-icon { animation-delay: 0.4s; }
.nav-item:nth-of-type(4) .emoji-icon,
.side-link:nth-of-type(4) .emoji-icon { animation-delay: 0.6s; }
.nav-item:nth-of-type(5) .emoji-icon,
.side-link:nth-of-type(5) .emoji-icon { animation-delay: 0.8s; }

.nav-item:hover .emoji-icon,
.side-link:hover .emoji-icon {
    animation: emojiWiggle 0.7s ease both;
    background: #ffffff;
}

.nav-item.active .emoji-icon,
.side-link.active .emoji-icon {
    animation: emojiActive 1.5s ease-in-out infinite;
    background: linear-gradient(145deg, #ffffff, #eaf2ff);
}

@keyframes emojiFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-3px) rotate(-3deg); }
}

@keyframes emojiWiggle {
    0% { transform: rotate(0) scale(1); }
    25% { transform: rotate(-9deg) scale(1.12); }
    50% { transform: rotate(8deg) scale(1.08); }
    75% { transform: rotate(-4deg) scale(1.1); }
    100% { transform: rotate(0) scale(1); }
}

@keyframes emojiActive {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-4px) scale(1.08); }
}



/* Ocultar iconos Font Awesome legacy dentro de nav-item */
.nav-item > i,
.side-link > i {
    display: none;
}

/* ── Sidebar Footer ── */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.6);
    position: relative;
    z-index: 2;
}

/* ── Mode Badge / Mode Pill ── */
.mode-badge,
/* ── Sidebar Bottom ── */
.sidebar-bottom {
    margin-top: auto;
    display: grid;
    gap: 12px;
}

.mode-pill {
    position: relative;
    z-index: 2;
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 14px;
    border-radius: 18px;
    font-size: 0.84rem;
    font-weight: 950;
    overflow: hidden;
}

.mode-pill::after {
    content: "";
    position: absolute;
    right: -22px;
    bottom: -28px;
    width: 86px;
    height: 86px;
    border-radius: 50%;
    background: rgba(255,255,255,.36);
    pointer-events: none;
}

.pulse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #8ce99a;
    box-shadow: 0 0 0 6px rgba(140,233,154,.16);
    animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(.72); opacity: .72; }
}

.mode-badge.test,
.mode-pill.test {
    background: rgba(254, 243, 199, 0.9);
    color: #b45309;
    box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.16);
}

.mode-badge.live,
.mode-pill.live {
    background: rgba(209, 250, 229, 0.9);
    color: #047857;
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.16);
}

.mode-badge .dot,
.mode-pill .dot,
.mode-dot {
    width: 10px; height: 10px;
    border-radius: 999px;
    display: inline-block;
}

.mode-badge.test .dot,
.mode-pill.test .dot,
.mode-pill.test .mode-dot { background: #f59e0b; box-shadow: 0 0 0 rgba(245, 158, 11, 0.6); animation: modePulse 1.7s infinite; }
.mode-badge.live .dot,
.mode-pill.live .dot,
.mode-pill.live .mode-dot { background: #10b981; box-shadow: 0 0 0 rgba(16, 185, 129, 0.6); animation: modePulse 1.7s infinite; }

/* Default (no class yet = test) */
.mode-pill:not(.live):not(.test) {
    background: rgba(254, 243, 199, 0.9);
    color: #b45309;
    box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.16);
}
.mode-pill:not(.live):not(.test) .mode-dot {
    background: #f59e0b;
    animation: modePulse 1.7s infinite;
}

@keyframes modePulse {
    0% { box-shadow: 0 0 0 0 rgba(16,185,129,0.5); }
    70% { box-shadow: 0 0 0 13px rgba(16,185,129,0); }
    100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}


/* ==========================================================================
   7. TOPBAR
   ========================================================================== */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 26px;
}

.page-title h1 {
    margin: 0;
    font-size: clamp(1.7rem, 2vw, 2.4rem);
    font-weight: 950;
    letter-spacing: -0.045em;
    color: var(--nk-dark);
}

.page-title p {
    margin: 7px 0 0;
    color: var(--nk-muted);
    font-weight: 750;
}

.top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

/* ── Legacy page-header (config.html, index.html) ── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.page-header .subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ── Update Badge ── */
.update-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid var(--nk-border);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--nk-muted);
}

/* ── Primary Button (nuevo diseño) ── */
.btn-nk-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 18px;
    border: none;
    background: linear-gradient(145deg, var(--nk-blue), var(--nk-blue-2));
    color: #fff;
    font-weight: 800;
    font-size: 0.88rem;
    cursor: pointer;
    box-shadow: var(--nk-shadow-blue);
    transition: 0.3s ease;
    text-decoration: none;
}

.btn-nk-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 28px 56px rgba(37, 99, 235, 0.32);
}

.btn-nk-logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 14px;
    border: 1.5px solid #d1d5db;
    background: #f9fafb;
    color: #6b7280;
    font-weight: 600;
    font-size: 0.84rem;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
}

.btn-nk-logout:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.12);
}


/* ==========================================================================
   8. METRIC CARDS (glassmorphism)
   ========================================================================== */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.metric-card,
.glass-panel,
.action-card {
    background: var(--nk-card);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--nk-border);
    border-radius: var(--nk-radius);
    box-shadow: var(--nk-shadow);
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.metric-card {
    overflow: hidden;
    padding: 22px;
    min-height: 152px;
    transform-style: preserve-3d;
    transition: 0.25s ease;
}

.metric-card:hover {
    transform: translateY(-6px) rotateX(2deg) rotateY(-2deg);
    box-shadow: 0 28px 80px rgba(20, 45, 85, 0.2);
}

.metric-card::after {
    content: "";
    position: absolute;
    width: 170px;
    height: 170px;
    right: -76px;
    top: -76px;
    border-radius: 50%;
    background: var(--glow);
    opacity: 0.3;
}

.metric-icon {
    width: 60px; height: 60px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    font-size: 1.45rem;
    color: var(--icon);
    background: var(--soft);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.7);
}

.metric-icon.blue   { background: var(--nk-blue-soft); color: var(--nk-blue); }
.metric-icon.green  { background: var(--nk-green-soft); color: var(--nk-green); }
.metric-icon.red    { background: var(--nk-red-soft); color: var(--nk-red); }
.metric-icon.orange { background: var(--nk-orange-soft); color: var(--nk-orange); }

.metric-label {
    color: #8997ad;
    font-size: 0.75rem;
    font-weight: 950;
    letter-spacing: 0.055rem;
    text-transform: uppercase;
}

.metric-value {
    margin: 2px 0;
    font-size: 1.85rem;
    font-weight: 950;
    letter-spacing: -0.045em;
}

.metric-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.metric-note {
    color: #8493aa;
    font-size: 0.82rem;
    font-weight: 750;
}

.trend {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 950;
    background: rgba(255,255,255,0.74);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.85);
}

/* ── Stripe Live Badge ── */
.stripe-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #10b981;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    letter-spacing: 0.02em;
}
.stripe-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
    animation: stripePulse 2s ease-in-out infinite;
}
@keyframes stripePulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(16, 185, 129, 0.5); }
    50% { opacity: 0.5; box-shadow: 0 0 12px rgba(16, 185, 129, 0.8); }
}

/* Badge en modo live = verde, modo test = amarillo */
.stripe-live-badge--live {
    color: #10b981;
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
}
.stripe-live-badge:not(.stripe-live-badge--live) {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.2);
}
.stripe-live-badge:not(.stripe-live-badge--live) .stripe-live-dot {
    background: #f59e0b;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
}

/* Toggle modo Test/Live en el dashboard */
.nk-mode-toggle {
    display: inline-flex;
    border-radius: 10px;
    overflow: hidden;
    border: 1.5px solid var(--border);
    background: #f8fafc;
    height: 32px;
}
.nk-mode-btn {
    padding: 0 14px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.75rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.25s ease;
    background: transparent;
    color: var(--text-secondary);
    white-space: nowrap;
    line-height: 30px;
}
.nk-mode-btn:hover:not(.active) {
    background: rgba(0, 0, 0, 0.04);
}
.nk-mode-btn.active[data-mode="test"] {
    background: var(--nk-blue);
    color: #fff;
}
.nk-mode-btn.active[data-mode="live"] {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}
/* ── Card Sparkline (ApexCharts dentro de metric-card) ── */
.card-sparkline {
    width: 100%;
    height: 60px;
    margin: 4px 0 0;
    position: relative;
    z-index: 1;
    overflow: hidden;
}
/* Ocultar leyenda de distributed bars que ApexCharts genera */
.card-sparkline .apexcharts-legend {
    display: none !important;
}

.trend.up {
    background: var(--nk-green-soft);
    color: var(--nk-green);
}

.trend.down {
    background: var(--nk-red-soft);
    color: var(--nk-red);
}

/* ── Legacy stat cards ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--nk-card);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--nk-border);
    border-radius: var(--nk-radius);
    box-shadow: var(--nk-shadow);
    padding: 22px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stat-card:hover {
    transform: translateY(-6px) rotateX(2deg) rotateY(-2deg);
    box-shadow: var(--shadow-card-hover);
}

.stat-icon {
    width: 48px; height: 48px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.stat-icon.blue   { background: var(--nk-blue-soft); color: var(--nk-blue); }
.stat-icon.green  { background: var(--nk-green-soft); color: var(--nk-green); }
.stat-icon.red    { background: var(--nk-red-soft); color: var(--nk-red); }
.stat-icon.yellow { background: var(--nk-orange-soft); color: var(--nk-orange); }

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-label {
    font-size: 0.6875rem;
    color: var(--nk-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 950;
    color: var(--nk-dark);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    letter-spacing: -0.03em;
}


/* ==========================================================================
   9. GLASS PANEL + TABLE
   ========================================================================== */
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 26px;
    border-bottom: 1px solid rgba(235, 240, 248, 0.6);
}

.panel-header h2 {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--nk-dark);
    letter-spacing: -0.02em;
}

.panel-body {
    padding: 22px 26px;
}

.ghost-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: 14px;
    border: 1px solid rgba(235, 240, 248, 0.8);
    background: rgba(255, 255, 255, 0.5);
    color: var(--nk-muted);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

.ghost-btn:hover {
    background: rgba(255, 255, 255, 0.85);
    color: var(--nk-blue);
    border-color: var(--nk-blue-soft);
}

.payment-table {
    width: 100%;
    border-collapse: collapse;
}

.payment-table th {
    background: rgba(248, 250, 253, 0.7);
    color: var(--nk-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid rgba(235, 240, 248, 0.6);
}

.payment-table td {
    padding: 14px 20px;
    border-bottom: 1px solid rgba(240, 244, 250, 0.5);
    font-size: 0.88rem;
    font-weight: 600;
}

.payment-table tr:hover td {
    background: rgba(245, 248, 255, 0.5);
}

.payment-table td.amount {
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

/* ── Status badges (table) ── */
.status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.74rem;
    font-weight: 700;
}

.status.success,
.status.paid {
    background: var(--nk-green-soft);
    color: #059669;
}

.status.pending {
    background: var(--nk-orange-soft);
    color: #d97706;
}

.status.failed,
.status.error {
    background: var(--nk-red-soft);
    color: #dc2626;
}

/* ── Empty State ── */
.empty-state {
    padding: 24px 20px 28px;
    text-align: center;
}

.empty-visual {
    width: 100px;
    height: 100px;
    margin: 0 auto 18px;
    border-radius: 34px;
    display: grid;
    place-items: center;
    font-size: 2.65rem;
    background: linear-gradient(145deg, #ffffff, #e7f0ff);
    box-shadow:
        0 20px 42px rgba(37, 99, 235, 0.18),
        inset 0 0 0 1px rgba(255,255,255,0.9);
    animation: emptyFloat 3.4s ease-in-out infinite;
}

@keyframes emptyFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(-3deg); }
}

.empty-state h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 950;
}

.empty-state p {
    max-width: 430px;
    margin: 8px auto 20px;
    color: #8291a9;
    font-weight: 750;
}


/* ==========================================================================
   10. ACTION CARDS
   ========================================================================== */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 28px;
}

.action-card {
    display: block;
    height: 100%;
    padding: 24px;
    overflow: hidden;
    transition: 0.25s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.action-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 30px 76px rgba(37, 99, 235, 0.18);
}

.action-card::before {
    content: "";
    position: absolute;
    right: -40px;
    bottom: -72px;
    width: 165px;
    height: 165px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.09);
}

.action-icon {
    width: 60px; height: 60px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    font-size: 1.45rem;
    background: var(--nk-blue-soft);
    margin-bottom: 18px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.86);
    animation: actionEmojiFloat 3s ease-in-out infinite;
}

@keyframes actionEmojiFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.action-card h4 {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 950;
}

.action-card p {
    margin: 0;
    color: #8291a9;
    font-size: 0.86rem;
    font-weight: 750;
}


/* ==========================================================================
   11. RIGHT PANEL
   ========================================================================== */
.right-panel {
    padding: 24px;
    height: 100%;
}

.mini-title {
    color: #8795ab;
    font-size: 0.78rem;
    font-weight: 950;
    letter-spacing: 0.06rem;
    text-transform: uppercase;
}

.integration-title {
    margin: 8px 0 14px;
    font-weight: 950;
    letter-spacing: -0.03em;
}

.link-preview {
    margin-top: 16px;
    padding: 18px;
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(37, 99, 235, 0.1), rgba(255, 255, 255, 0.75));
    border: 1px solid rgba(255,255,255,0.84);
}

.preview-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    font-weight: 850;
}

.preview-row span:first-child {
    color: #7d8ca4;
}

.progress-soft {
    height: 12px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    overflow: hidden;
}

.progress-soft div {
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, #3b82f6, #10b981);
    animation: loadBar 1.8s ease forwards;
}

@keyframes loadBar {
    to { width: 72%; }
}

.floating-card {
    position: absolute;
    right: 38px;
    bottom: 34px;
    width: 270px;
    padding: 18px;
    border-radius: 25px;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.84);
    box-shadow: 0 28px 70px rgba(20,45,85,0.16);
}

.preview-row .label {
    color: var(--nk-muted);
    font-weight: 700;
}

.preview-row .value {
    font-weight: 800;
    color: var(--nk-dark);
}

.progress-soft {
    height: 6px;
    border-radius: 999px;
    background: rgba(235, 240, 248, 0.6);
    overflow: hidden;
    margin-top: 8px;
}

.progress-soft .bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--nk-blue), var(--nk-green));
    animation: loadBar 2s ease-out forwards;
}

@keyframes loadBar {
    from { width: 0%; }
}

.floating-card {
    background: var(--nk-card);
    backdrop-filter: blur(18px);
    border: 1px solid var(--nk-border);
    border-radius: 22px;
    box-shadow: var(--nk-shadow);
    padding: 20px;
    margin-top: 16px;
}


/* ==========================================================================
   12. FORMULARIOS (preservados para config.html)
   ========================================================================== */

/* ── card-3d ── */
.card-3d {
    background: var(--nk-card);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--nk-border);
    border-radius: var(--radius-card);
    box-shadow: var(--nk-shadow);
    padding: 24px;
    transition: 0.35s ease;
}

.card-3d:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-header h2,
.card-title {
    font-size: 1.0625rem;
    font-weight: 800;
    color: var(--nk-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body { /* contenedor de contenido */ }

/* ── Inputs ── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--nk-dark);
}

.input-3d {
    background: rgba(240, 243, 248, 0.7);
    border: 2px solid transparent;
    border-radius: var(--radius-input);
    padding: 12px 16px;
    width: 100%;
    box-sizing: border-box;
    box-shadow: var(--shadow-inset);
    color: var(--nk-dark);
    font-size: 0.9375rem;
    font-family: var(--font-body);
    outline: none;
    transition: border 0.2s, box-shadow 0.2s, background 0.2s;
}

.input-3d:focus {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--nk-blue);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.input-3d::placeholder { color: var(--text-muted); }

.select-3d {
    background: rgba(240, 243, 248, 0.7);
    border: 2px solid transparent;
    border-radius: var(--radius-input);
    padding: 12px 40px 12px 16px;
    width: 100%;
    box-shadow: var(--shadow-inset);
    color: var(--nk-dark);
    font-size: 0.9375rem;
    font-family: var(--font-body);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
    outline: none;
    transition: border 0.2s, box-shadow 0.2s, background 0.2s;
}

.select-3d:focus {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--nk-blue);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

/* ── Botones ── */
.btn-3d {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--nk-border);
    border-radius: var(--radius-input);
    padding: 10px 20px;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--nk-dark);
    box-shadow: var(--shadow-btn);
    cursor: pointer;
    transition: 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    backdrop-filter: blur(8px);
}

.btn-3d:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-btn-hover);
    color: var(--nk-blue);
}

.btn-3d:active {
    transform: translateY(1px);
    box-shadow: var(--shadow-inset);
}

.btn-3d.btn-primary {
    background: linear-gradient(145deg, var(--nk-blue), var(--nk-blue-2));
    color: #fff;
    border: none;
    box-shadow: var(--nk-shadow-blue);
}

.btn-3d.btn-primary:hover {
    box-shadow: 0 28px 56px rgba(37, 99, 235, 0.32);
    transform: translateY(-3px);
    color: #fff;
}

.btn-3d.btn-success {
    background: linear-gradient(145deg, #10b981, #059669);
    color: #fff;
    border: none;
    box-shadow: 0 12px 24px rgba(16, 185, 129, 0.3);
}

.btn-3d.btn-success:hover {
    box-shadow: 0 16px 32px rgba(16, 185, 129, 0.4);
    color: #fff;
}

.btn-3d.btn-danger {
    background: linear-gradient(145deg, #ef4444, #dc2626);
    color: #fff;
    border: none;
    box-shadow: 0 12px 24px rgba(239, 68, 68, 0.25);
}

.btn-3d.btn-danger:hover {
    box-shadow: 0 16px 32px rgba(239, 68, 68, 0.35);
    color: #fff;
}

.btn-3d.btn-ghost {
    background: transparent;
    box-shadow: none;
    border: none;
    color: var(--text-secondary);
}

.btn-3d.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.6);
    box-shadow: none;
    color: var(--nk-blue);
    transform: none;
}

.btn-3d.btn-sm {
    padding: 6px 14px;
    font-size: 0.8125rem;
}

.btn-3d.btn-logout {
    background: linear-gradient(145deg, #fde8e8, #f9d0d0);
    color: #c0392b;
    border: 2px solid #fecdd3;
    border-radius: 50%;
    width: 42px; height: 42px;
    padding: 0;
    justify-content: center;
}

/* ── Mode Toggle Button (config.html) ── */
.mode-toggle-btn {
    transition: all 0.2s;
}

.mode-toggle-btn.active {
    font-weight: 700;
}


/* ==========================================================================
   13. TABLAS — data-table (legacy)
   ========================================================================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: rgba(248, 250, 253, 0.7);
    color: var(--nk-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(235, 240, 248, 0.6);
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(240, 244, 250, 0.5);
    font-size: 0.875rem;
    font-weight: 600;
}

.data-table tr:hover td {
    background: rgba(245, 248, 255, 0.5);
}

.data-table td.amount {
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}


/* ==========================================================================
   14. BADGES
   ========================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 700;
}

.badge .dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.badge-success { background: rgba(16, 185, 129, 0.1); color: #059669; }
.badge-success .dot { background: #10b981; }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: #d97706; }
.badge-warning .dot { background: #f59e0b; }
.badge-danger  { background: rgba(239, 68, 68, 0.1); color: #dc2626; }
.badge-danger .dot  { background: #ef4444; }
.badge-info    { background: rgba(59, 130, 246, 0.1); color: #2563eb; }
.badge-info .dot    { background: #3b82f6; }
.badge-neutral { background: rgba(107, 114, 128, 0.1); color: #6b7280; }
.badge-neutral .dot { background: #9ca3af; }


/* ==========================================================================
   15. ALERTAS
   ========================================================================== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-input);
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(8px);
}

.alert-success { background: rgba(16, 185, 129, 0.1); color: #059669; border: 1px solid rgba(16, 185, 129, 0.2); }
.alert-danger  { background: rgba(239, 68, 68, 0.1); color: #dc2626; border: 1px solid rgba(239, 68, 68, 0.2); }
.alert-info    { background: rgba(59, 130, 246, 0.1); color: #2563eb; border: 1px solid rgba(59, 130, 246, 0.2); }
.alert-warning { background: rgba(245, 158, 11, 0.1); color: #d97706; border: 1px solid rgba(245, 158, 11, 0.2); }


/* ==========================================================================
   16. LED INDICATORS
   ========================================================================== */
.led-3d {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: #e0e0e0;
    box-shadow: inset 2px 2px 5px rgba(255, 255, 255, 0.7),
                inset -2px -2px 5px rgba(0, 0, 0, 0.1),
                2px 2px 4px rgba(0, 0, 0, 0.15);
    display: inline-block;
    transition: 0.3s ease;
}

.led-3d.green  { background: radial-gradient(circle at 30% 30%, #4ade80, #16a34a); box-shadow: 0 0 12px var(--color-success); }
.led-3d.red    { background: radial-gradient(circle at 30% 30%, #f87171, #dc2626); box-shadow: 0 0 12px var(--color-danger); }
.led-3d.yellow { background: radial-gradient(circle at 30% 30%, #fcd34d, #d97706); box-shadow: 0 0 12px var(--color-warning); }
.led-3d.grey   { background: radial-gradient(circle at 30% 30%, #f3f4f6, #d1d5db); }


/* ==========================================================================
   17. TOAST
   ========================================================================== */
.toast {
    padding: 14px 20px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 0.875rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    max-width: 420px;
    animation: slideDown 0.3s ease;
    font-family: var(--font-body);
}

.toast.success { background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.3); color: #059669; }
.toast.danger  { background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.3); color: #dc2626; }
.toast.warning { background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.3); color: #d97706; }
.toast.info    { background: rgba(59, 130, 246, 0.12); border: 1px solid rgba(59, 130, 246, 0.3); color: #2563eb; }


/* ==========================================================================
   18. WELCOME PAGE
   ========================================================================== */
.welcome-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 32px;
}

.welcome-card {
    background: var(--nk-card);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--nk-border);
    border-radius: var(--nk-radius);
    box-shadow: var(--nk-shadow);
    padding: 48px 40px;
    max-width: 420px;
    width: 100%;
    text-align: center;
}

.welcome-card .logo {
    width: 64px; height: 64px;
    border-radius: 22px;
    background: linear-gradient(145deg, #ff5a35, #f97316);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 950;
    font-size: 1.5rem;
    margin: 0 auto 20px;
    box-shadow: 0 14px 32px rgba(249, 115, 22, 0.3);
}

.welcome-card h1 {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--nk-dark);
    margin-bottom: 8px;
}

.welcome-card .subtitle {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: 32px;
}

.welcome-card .form-group {
    text-align: left;
    margin-bottom: 24px;
}


/* ==========================================================================
   19. COPY FIELD
   ========================================================================== */
.copy-field {
    display: flex;
    align-items: center;
    gap: 0;
    border-radius: var(--radius-input);
    overflow: hidden;
    box-shadow: var(--shadow-inset);
    background: rgba(240, 243, 248, 0.7);
}

.copy-field input {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--nk-dark);
    outline: none;
}

.copy-field button {
    padding: 12px 16px;
    background: var(--nk-blue);
    color: #fff;
    border: none;
    font-weight: 700;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: 0.2s ease;
}

.copy-field button:hover {
    background: var(--nk-blue-2);
}


/* ==========================================================================
   20. SPINNER
   ========================================================================== */
.spinner {
    width: 20px; height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

.spinner-dark {
    border-color: rgba(37, 99, 235, 0.2);
    border-top-color: var(--nk-blue);
}


/* ==========================================================================
   21. MOBILE TOGGLE
   ========================================================================== */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 16px; left: 16px;
    z-index: 101;
    width: 42px; height: 42px;
    border-radius: 14px;
    background: var(--nk-card);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-btn);
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--nk-muted);
    cursor: pointer;
    border: 1px solid var(--nk-border);
    transition: 0.2s ease;
}

.mobile-toggle:hover {
    box-shadow: var(--shadow-btn-hover);
    color: var(--nk-blue);
}


/* ==========================================================================
   22. EMBED PREVIEW
   ========================================================================== */

/* ── Destination tabs ── */
.embed-destination-tabs {
    display: flex;
    gap: 4px;
    background: rgba(241, 245, 249, 0.8);
    border-radius: 16px;
    padding: 4px;
    margin-bottom: 20px;
}

.embed-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 10px;
    border-radius: 13px;
    border: none;
    background: transparent;
    color: #7b8aa5;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    white-space: nowrap;
}

.embed-tab i {
    font-size: 1rem;
    transition: transform 0.28s ease;
}

.embed-tab:hover {
    color: var(--nk-blue);
    background: rgba(255, 255, 255, 0.6);
}

.embed-tab:hover i {
    transform: scale(1.15);
}

.embed-tab.active {
    background: #fff;
    color: var(--nk-blue);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.13), 0 1px 3px rgba(0,0,0,0.06);
    font-weight: 800;
}

.embed-tab.active i {
    transform: scale(1.1);
}

/* ── Cart-style preview card ── */
.embed-preview {
    background: rgba(248, 250, 253, 0.7);
    border: 2px dashed rgba(200, 212, 230, 0.5);
    border-radius: var(--radius-card);
    padding: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    transition: all 0.3s ease;
}

.embed-cart-card {
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 20px 60px rgba(24, 49, 91, 0.12), 0 2px 6px rgba(0,0,0,0.04);
    padding: 28px 32px;
    min-width: 280px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                box-shadow 0.35s ease;
}

.embed-cart-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 28px 70px rgba(24, 49, 91, 0.18), 0 4px 10px rgba(0,0,0,0.06);
}

.embed-cart-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    font-size: 1.65rem;
    background: linear-gradient(145deg, #f0f5ff, #e0eaff);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.1);
    animation: cartFloat 3s ease-in-out infinite;
}

.embed-cart-card:hover .embed-cart-icon {
    animation: cartBounce 0.6s ease both;
}

.embed-cart-concept {
    font-size: 0.85rem;
    font-weight: 600;
    color: #7b8aa5;
    margin-bottom: 4px;
    letter-spacing: 0.01em;
}

.embed-cart-amount {
    font-size: 2rem;
    font-weight: 950;
    color: var(--nk-dark);
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-bottom: 18px;
    font-variant-numeric: tabular-nums;
}

.embed-cart-amount .embed-cart-currency {
    font-size: 1.1rem;
    font-weight: 700;
    color: #94a3b8;
    margin-left: 2px;
}

.embed-cart-divider {
    width: 50px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--nk-blue), #60a5fa);
    margin: 0 auto 18px;
    opacity: 0.5;
}

/* ── Cart animations ── */
@keyframes cartFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes cartBounce {
    0% { transform: scale(1) rotate(0); }
    20% { transform: scale(1.15) rotate(-5deg); }
    40% { transform: scale(0.95) rotate(3deg); }
    60% { transform: scale(1.08) rotate(-2deg); }
    80% { transform: scale(0.98) rotate(1deg); }
    100% { transform: scale(1) rotate(0); }
}

/* ── Output section (code / email actions) ── */
.embed-output-section {
    margin-top: 20px;
}

.embed-output-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.embed-output-title {
    font-size: 0.9375rem;
    font-weight: 800;
    color: var(--nk-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.code-block {
    background: #1e293b;
    color: #e2e8f0;
    border-radius: var(--radius-input);
    padding: 20px;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    line-height: 1.6;
    overflow-x: auto;
    position: relative;
    max-height: 200px;
    word-break: break-all;
    white-space: pre-wrap;
}

.code-block .copy-btn {
    position: absolute;
    top: 8px; right: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: 0.2s ease;
}

.code-block .copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* ── Email action buttons ── */
.embed-email-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.embed-email-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: 16px;
    border: 2px solid transparent;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.28s ease;
    min-width: 160px;
    text-decoration: none;
}

.embed-email-btn i {
    font-size: 1.15rem;
}

.embed-email-btn.gmail {
    background: linear-gradient(145deg, #fef7f0, #fff5f5);
    color: #ea4335;
    border-color: rgba(234, 67, 53, 0.18);
}

.embed-email-btn.gmail:hover {
    background: linear-gradient(145deg, #fef0e8, #fff0f0);
    border-color: rgba(234, 67, 53, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(234, 67, 53, 0.15);
}

.embed-email-btn.outlook {
    background: linear-gradient(145deg, #f0f5fe, #eef2ff);
    color: #0078d4;
    border-color: rgba(0, 120, 212, 0.18);
}

.embed-email-btn.outlook:hover {
    background: linear-gradient(145deg, #e8f0fe, #e2ecff);
    border-color: rgba(0, 120, 212, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 120, 212, 0.15);
}

.embed-email-btn.copy-link {
    background: linear-gradient(145deg, #f0faf5, #ecf9f2);
    color: #059669;
    border-color: rgba(5, 150, 105, 0.18);
}

.embed-email-btn.copy-link:hover {
    background: linear-gradient(145deg, #e6f7ef, #dff5e9);
    border-color: rgba(5, 150, 105, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(5, 150, 105, 0.15);
}

/* ── Email panel hint ── */
.embed-email-hint {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Toggle option (show cart icon checkbox) ── */
.embed-toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.embed-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

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

.embed-toggle-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 999px;
    cursor: pointer;
    transition: 0.3s ease;
}

.embed-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    top: 3px;
    left: 3px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: 0.3s ease;
}

.embed-toggle input:checked + .embed-toggle-slider {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.embed-toggle input:checked + .embed-toggle-slider::before {
    transform: translateX(20px);
}

.embed-toggle-label {
    font-size: 0.84rem;
    font-weight: 600;
    color: #64748b;
}


/* ==========================================================================
   23. UTILITIES
   ========================================================================== */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--nk-blue); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }


/* ==========================================================================
   24. ANIMACIONES
   ========================================================================== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes pulse-blue {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

.animate-fade-in { animation: fadeIn 0.4s ease forwards; }
.animate-slide-up { animation: slideUp 0.5s ease forwards; }
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }


/* ==========================================================================
   25. RESPONSIVE
   ========================================================================== */

/* ── Glassmorphism responsive ── */
@media (max-width: 1120px) {
    .app-shell {
        grid-template-columns: 96px 1fr;
    }

    .sidebar {
        padding: 18px 12px;
    }

    .brand-card {
        justify-content: center;
        padding: 12px;
    }

    .brand-card div:not(.brand-logo),
    .nav-section-title,
    .side-link span:not(.emoji-icon),
    .mode-pill span:not(.mode-dot) {
        display: none;
    }

    .side-link {
        justify-content: center;
        padding: 13px;
    }

    .mode-pill {
        justify-content: center;
    }

    /* Colapsar nk-menu-item igual que side-link */
    .nk-menu-item {
        justify-content: center;
        padding: 13px;
    }

    .nk-menu-text {
        display: none;
    }
}

/* ── Botón retroceder: oculto en desktop ── */
.mobile-back-btn {
    display: none;
}

@media (max-width: 768px) {

    /* ── App Shell: pantalla completa, sin grid ── */
    .app-shell {
        display: block;
        position: relative;
        min-height: 100vh;
        overflow-x: hidden;
    }

    /* ══════════════════════════════════════════════════
       OVERRIDE: Forzar visibilidad de elementos que
       la media 1120px oculta (cascading fix)
       ══════════════════════════════════════════════════ */
    .brand-card div:not(.brand-logo),
    .nav-section-title,
    .mode-pill span:not(.mode-dot),
    .nk-menu-text,
    .side-link span:not(.emoji-icon) {
        display: block !important;
    }

    .brand-card {
        justify-content: flex-start !important;
    }

    .nk-menu-item,
    .side-link {
        justify-content: flex-start !important;
    }

    /* ══════════════════════════════════════════════════
       MENÚ MÓVIL: Solo mostrar items necesarios
       Visibles: Enlaces de cobro, Cobros realizados,
                 Cobros pendientes
       ══════════════════════════════════════════════════ */

    /* Ocultar por data-page (index.html) */
    .sidebar .nk-menu-item[data-page="dashboard"],
    .sidebar .nk-menu-item[data-page="embed"],
    .sidebar .nk-menu-item[data-page="subscriptions"],
    .sidebar .nk-menu-item[data-page="accounts"],
    .sidebar .nk-menu-item[data-page="config"] {
        display: none !important;
    }

    /* Ocultar por href (links.html, config.html, etc.) */
    .sidebar .nk-menu-item[href="index.html"],
    .sidebar .nk-menu-item[href="embed.html"],
    .sidebar .nk-menu-item[href="subscriptions.html"],
    .sidebar .nk-menu-item[href="accounts.html"],
    .sidebar .nk-menu-item[href="config.html"] {
        display: none !important;
    }

    /* Ocultar secciones que quedan vacías: "Panel" y "Ajustes" */
    /* Panel = 1ª sección, Ajustes = 3ª sección */
    .sidebar .nav-section-title:first-of-type,
    .sidebar .nav-section-title:last-of-type {
        display: none !important;
    }

    /* ── SIDEBAR: pantalla completa tipo menú de app ── */
    .sidebar {
        position: fixed;
        inset: 0;
        height: 100vh;
        height: 100dvh;
        width: 100%;
        padding: 0;
        border-radius: 0;
        border-right: none;
        z-index: 50;
        overflow-y: auto;
        overflow-x: hidden;
        display: flex;
        flex-direction: column;
        background: #f8faff;
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                    opacity 0.3s ease;
        transform: translateX(0);
        opacity: 1;
    }

    /* Cuando se navega a contenido, el sidebar se desliza a la izquierda */
    .sidebar.mobile-hidden {
        transform: translateX(-100%);
        opacity: 0;
        pointer-events: none;
    }

    /* ── Brand Card en móvil: header premium tipo app ── */
    .sidebar .brand-card {
        margin: 0;
        padding: 20px 24px;
        border-radius: 0;
        background: #ffffff;
        box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
        border-bottom: none;
        position: sticky;
        top: 0;
        z-index: 10;
        display: flex !important;
        align-items: center;
        gap: 14px;
    }

    .sidebar .brand-card .brand-logo {
        width: 44px;
        height: 44px;
        min-width: 44px;
        font-size: 1.1rem;
        border-radius: 14px;
    }

    .sidebar .brand-card .brand-title {
        font-size: 1.05rem;
        font-weight: 900;
        letter-spacing: -0.02em;
    }

    .sidebar .brand-card .brand-sub {
        font-size: 0.78rem;
        margin-top: 3px;
        color: #94a3b8;
    }

    /* ── Títulos de sección en móvil ── */
    .sidebar .nav-section-title {
        display: block !important;
        margin: 24px 24px 6px;
        padding-bottom: 6px;
        font-size: 0.68rem;
        letter-spacing: 0.1em;
        color: #a0aec0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    }

    /* Primera sección: menos margen superior */
    .sidebar .nav-section-title:first-of-type {
        margin-top: 12px;
    }


    /* ── Menu items: estilo lista tipo app premium ── */
    .sidebar .nk-menu-item {
        margin: 0 12px;
        padding: 14px 16px;
        border-radius: 16px;
        min-height: auto;
        gap: 14px;
        transition: background 0.15s ease, transform 0.12s ease;
        position: relative;
    }

    .sidebar .nk-menu-item:hover {
        transform: none;
        background: transparent;
    }

    .sidebar .nk-menu-item:active {
        transform: scale(0.98);
        background: rgba(37, 99, 235, 0.05);
    }

    /* Icono más compacto en móvil */
    .sidebar .nk-menu-item .nk-menu-icon {
        width: 38px;
        height: 38px;
        min-width: 38px;
        border-radius: 12px;
        font-size: 16px;
    }

    /* Texto del menú */
    .sidebar .nk-menu-item .nk-menu-text {
        display: inline !important;
        font-size: 0.92rem;
        font-weight: 700;
        color: #334155;
        flex: 1;
    }

    .sidebar .nk-menu-item.active .nk-menu-text {
        color: #1d4ed8;
    }

    /* Chevron / flecha derecha en cada item */
    .sidebar .nk-menu-item .nk-menu-text::after {
        content: "›";
        position: absolute;
        right: 18px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 1.4rem;
        color: #cbd5e1;
        font-weight: 300;
        line-height: 1;
    }

    /* Separador sutil entre items */
    .sidebar .nk-menu-item + .nk-menu-item {
        border-top: 1px solid rgba(0, 0, 0, 0.025);
    }

    /* ── Side-link legacy: mismos estilos ── */
    .sidebar .side-link {
        margin: 0 12px;
        padding: 14px 16px;
        border-radius: 16px;
        min-height: auto;
    }

    .sidebar .side-link:active {
        transform: scale(0.98);
        background: rgba(37, 99, 235, 0.05);
    }

    /* ── Ocultar active bar vertical en menú móvil ── */
    .sidebar .nk-menu-item.active::before,
    .sidebar .side-link.active::before {
        display: none;
    }

    /* Item activo: sutil */
    .sidebar .nk-menu-item.active {
        background: rgba(37, 99, 235, 0.05);
        box-shadow: none;
    }

    /* ── Mode pill en móvil: al fondo, bien formateado ── */
    .sidebar .mode-pill {
        display: flex !important;
        position: relative;
        bottom: auto;
        left: auto;
        right: auto;
        margin: auto 20px 20px;
        border-radius: 14px;
        padding: 12px 16px;
        align-items: center;
        gap: 10px;
    }

    .sidebar .mode-pill span:not(.mode-dot) {
        display: inline !important;
        font-size: 0.82rem;
        font-weight: 800;
    }

    .sidebar .mode-pill .mode-dot {
        display: inline-block !important;
        width: 8px;
        height: 8px;
    }

    /* Ocultar mode badge duplicado */
    .sidebar #modeBadge {
        display: none !important;
    }

    /* ── MAIN: oculto por defecto en móvil ── */
    .main {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        padding: 0;
        overflow-y: auto;
        overflow-x: hidden;
        z-index: 40;
        transform: translateX(100%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                    opacity 0.3s ease;
        background: var(--tb-bg-gradient);
    }

    /* Cuando se navega al contenido, el main aparece */
    .main.mobile-active {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
        padding: 0 16px 32px;
    }

    .main-content {
        margin-left: 0;
        max-width: 100%;
        padding: 0 16px 32px;
        padding-top: 70px;
    }

    /* ── Botón retroceder móvil ── */
    .mobile-back-btn {
        display: flex !important;
        position: sticky;
        top: 0;
        z-index: 60;
        width: 100%;
        padding: 16px 20px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid rgba(0, 0, 0, 0.04);
        align-items: center;
        gap: 10px;
        font-weight: 800;
        font-size: 0.9rem;
        color: var(--nk-blue, #2563eb);
        cursor: pointer;
        border: none;
        border-top: none;
        transition: background 0.2s;
    }

    .mobile-back-btn:active {
        background: rgba(219, 234, 254, 0.9);
    }

    .mobile-back-btn i {
        font-size: 1.2rem;
        transition: transform 0.2s ease;
    }

    .mobile-back-btn:active i {
        transform: translateX(-3px);
    }

    .mobile-back-btn .mobile-back-title {
        font-weight: 900;
        color: var(--nk-dark, #172033);
        font-size: 1.05rem;
        letter-spacing: -0.02em;
        margin-left: auto;
    }

    /* Separador visual entre "‹ Menú" y el título */
    .mobile-back-btn > span:first-of-type {
        padding-right: 10px;
        border-right: 2px solid rgba(37, 99, 235, 0.15);
    }

    /* ── Topbar en móvil ── */
    .topbar {
        align-items: flex-start;
        flex-direction: column;
        padding-top: 8px;
    }

    .top-actions {
        width: 100%;
        justify-content: stretch;
    }

    .top-actions > * {
        flex: 1;
        text-align: center;
    }

    .floating-card {
        position: static;
        width: 100%;
        margin-top: 18px;
    }

    .payment-table {
        min-width: 820px;
    }

    .page-title h1 {
        font-size: 1.4rem;
    }

    /* ── Ocultar toggle hamburguesa viejo ── */
    .mobile-toggle {
        display: none !important;
    }

    /* ══════════════════════════════════════════════════
       TRANSACTIONS: Vista compacta para móvil
       ══════════════════════════════════════════════════ */

    /* Ocultar las 3 metric cards (Total, Nº pagos, Media) */
    #txnStats {
        display: none !important;
    }

    /* Tabla de pagos: quitar min-width y permitir adaptarse */
    .payment-table {
        min-width: 0 !important;
        width: 100%;
        font-size: 0.85rem;
    }

    /* Ocultar columnas: Referencia(1), Origen(5), Método(6), Fecha(7) */
    .payment-table th:nth-child(1),
    .payment-table td:nth-child(1),
    .payment-table th:nth-child(5),
    .payment-table td:nth-child(5),
    .payment-table th:nth-child(6),
    .payment-table td:nth-child(6),
    .payment-table th:nth-child(7),
    .payment-table td:nth-child(7) {
        display: none !important;
    }

    /* Concepto: más legible */
    .payment-table td:nth-child(2) {
        font-weight: 700;
        color: var(--nk-dark, #172033);
        max-width: 160px;
        word-break: break-word;
    }

    /* Importe: destacar */
    .payment-table td:nth-child(3) {
        font-weight: 900;
        white-space: nowrap;
    }

    /* Estado badge: compacto */
    .payment-table td:nth-child(4) .status {
        font-size: 0.72rem;
        padding: 3px 8px;
    }

    /* Header de tabla más compacto */
    .payment-table thead th {
        padding: 10px 12px;
        font-size: 0.7rem;
    }

    .payment-table tbody td {
        padding: 12px;
    }

    /* ══════════════════════════════════════════════════
       DASHBOARD: Ocultar metric cards y tabla en móvil
       (index.html — el dashboard no se ve en móvil)
       ══════════════════════════════════════════════════ */
    #statsGrid {
        display: none !important;
    }

    /* ══════════════════════════════════════════════════
       LINK-HISTORY (Cobros pendientes): Vista compacta
       Columnas: Concepto(1), Importe(2), Estado(4)
       Ocultar: Email(3), Fecha(5), Acciones(6)
       ══════════════════════════════════════════════════ */
    .table-3d {
        width: 100%;
        font-size: 0.85rem;
    }

    .table-3d th:nth-child(3),
    .table-3d td:nth-child(3),
    .table-3d th:nth-child(5),
    .table-3d td:nth-child(5),
    .table-3d th:nth-child(6),
    .table-3d td:nth-child(6) {
        display: none !important;
    }

    .table-3d td:nth-child(1) {
        font-weight: 700;
        color: var(--nk-dark, #172033);
        max-width: 160px;
        word-break: break-word;
    }

    .table-3d td:nth-child(2) {
        font-weight: 900;
        white-space: nowrap;
    }

    .table-3d thead th {
        padding: 10px 12px;
        font-size: 0.7rem;
    }

    .table-3d tbody td {
        padding: 12px;
    }

    /* ══════════════════════════════════════════════════
       LINKS (Crear enlace): Layout vertical en móvil
       ══════════════════════════════════════════════════ */

    /* Grid de 2 columnas → 1 columna vertical */
    .main [style*="grid-template-columns: 1fr 1fr"],
    .main [style*="grid-template-columns:1fr 1fr"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
    }

    /* Cards 3D: sin overflow */
    .card-3d {
        overflow: visible;
        min-width: 0;
    }

    /* Copy field: ajustar al ancho */
    .copy-field {
        flex-direction: column;
        gap: 8px;
    }

    .copy-field input {
        width: 100%;
        font-size: 0.78rem;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .copy-field button {
        width: 100%;
        justify-content: center;
    }

    /* Botones compartir: stack vertical compacto */
    #linkResult [style*="display:flex"][style*="gap:10px"] {
        flex-direction: column !important;
    }

    #linkResult .btn-3d {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    /* QR: centrado y ajustado */
    #linkResult canvas,
    #linkResult img {
        max-width: 100%;
        height: auto;
    }

    /* Page header en móvil: vertical */
    .page-header {
        flex-direction: column;
        gap: 8px;
    }

    .page-header .top-actions {
        width: 100%;
    }

    /* Ocultar el botón "Salir" del topbar en móvil */
    .btn-nk-logout {
        display: none !important;
    }

    /* Botón "Cerrar sesión" inyectado en el menú móvil */
    .mobile-logout-btn {
        margin-top: 12px !important;
        border-top: 1px solid rgba(0, 0, 0, 0.05) !important;
        padding-top: 16px !important;
    }

    .mobile-logout-btn .nk-menu-text::after {
        display: none !important;
    }

    /* ══════════════════════════════════════════════════
       TOAST NOTIFICACIÓN: Burbuja centrada en móvil
       En PC sigue arriba-derecha, aquí se centra
       ══════════════════════════════════════════════════ */

    /* Container: centrar en pantalla, sin overlay */
    #nkToastContainer {
        top: 0 !important;
        right: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        padding: 24px !important;
        gap: 12px !important;
    }

    /* Toast: burbuja centrada más grande */
    .nk-toast {
        min-width: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        padding: 20px 22px !important;
        border-radius: 24px !important;
        background: rgba(255, 255, 255, 0.98) !important;
        border: 2px solid rgba(16, 185, 129, 0.25) !important;
        box-shadow:
            0 20px 60px rgba(0, 0, 0, 0.15),
            0 4px 16px rgba(16, 185, 129, 0.15) !important;
        /* Animación desde el centro (escala) en vez de slide lateral */
        transform: scale(0.8) !important;
        opacity: 0 !important;
        transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                    opacity 0.25s ease !important;
    }

    .nk-toast-show {
        transform: scale(1) !important;
        opacity: 1 !important;
    }

    .nk-toast-exit {
        transform: scale(0.8) !important;
        opacity: 0 !important;
    }

    /* Icono más grande */
    .nk-toast-icon {
        font-size: 36px !important;
    }

    /* Título más prominente */
    .nk-toast-title {
        font-size: 13px !important;
        letter-spacing: 1px !important;
    }

    /* Importe más grande */
    .nk-toast-amount {
        font-size: 28px !important;
        margin: 4px 0 !important;
    }

    /* Descripción */
    .nk-toast-desc {
        font-size: 13px !important;
    }

    /* Botón cerrar: más grande y fácil de tocar */
    .nk-toast-close {
        font-size: 20px !important;
        padding: 8px !important;
        min-width: 36px;
        min-height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ── Dashboard Table Scroll ── */
.dashboard-table-scroll {
    max-height: 260px;
    overflow-y: auto;
    overflow-x: auto;
    scroll-behavior: smooth;
}

.dashboard-table-scroll::-webkit-scrollbar {
    width: 6px;
}

.dashboard-table-scroll::-webkit-scrollbar-track {
    background: rgba(240, 244, 250, 0.5);
    border-radius: 3px;
}

.dashboard-table-scroll::-webkit-scrollbar-thumb {
    background: rgba(37, 99, 235, 0.2);
    border-radius: 3px;
    transition: background 0.2s;
}

.dashboard-table-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(37, 99, 235, 0.4);
}

.dashboard-table-scroll .payment-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(248, 250, 253, 0.95);
    backdrop-filter: blur(8px);
}

/* ── Dashboard Table Footer ── */
.dashboard-table-footer {
    padding: 14px 24px;
    border-top: 1px solid rgba(235, 240, 248, 0.6);
    text-align: center;
    background: rgba(248, 250, 253, 0.4);
}

.table-footer-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--nk-blue);
    font-weight: 700;
    font-size: 0.875rem;
    text-decoration: none;
    padding: 8px 20px;
    border-radius: 12px;
    transition: all 0.25s ease;
}

.table-footer-link:hover {
    background: var(--nk-blue-soft);
    color: var(--nk-blue-2);
    transform: translateX(4px);
}

.table-footer-link .arrow {
    transition: transform 0.25s ease;
}

.table-footer-link:hover .arrow {
    transform: translateX(4px);
}

/* ==========================================================================
   TABLAS — table-3d
   ========================================================================== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-3d {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
}

.table-3d thead th {
    background: var(--nk-blue-soft, #dbeafe);
    color: var(--nk-dark, #172033);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 12px 16px;
    border-bottom: 2px solid rgba(37, 99, 235, 0.12);
    white-space: nowrap;
}

.table-3d thead th:first-child {
    border-radius: 12px 0 0 0;
}

.table-3d thead th:last-child {
    border-radius: 0 12px 0 0;
}

.table-3d tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    vertical-align: middle;
    color: var(--text-primary, #1f2937);
}

.table-3d tbody tr:hover {
    background: rgba(37, 99, 235, 0.04);
}

.table-3d tbody tr:last-child td {
    border-bottom: none;
}

.table-3d tbody tr:last-child td:first-child {
    border-radius: 0 0 0 12px;
}

.table-3d tbody tr:last-child td:last-child {
    border-radius: 0 0 12px 0;
}

/* Status badges para tablas */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge.status-succeeded,
.status-badge.status-active {
    background: var(--nk-green-soft, #d1fae5);
    color: #065f46;
}

.status-badge.status-failed,
.status-badge.status-canceled {
    background: var(--nk-red-soft, #fee2e2);
    color: #991b1b;
}

.status-badge.status-refunded,
.status-badge.status-past_due {
    background: var(--nk-orange-soft, #fef3c7);
    color: #92400e;
}

/* Botones pequeños para tablas */
.btn-sm {
    padding: 6px 14px !important;
    font-size: 0.75rem !important;
    border-radius: 10px !important;
}

.btn-danger-outline {
    background: transparent !important;
    border: 1px solid var(--nk-red) !important;
    color: var(--nk-red) !important;
}

.btn-danger-outline:hover {
    background: var(--nk-red-soft) !important;
}

/* Contenedor de tabla con scroll — máximo 5 filas visibles */
.table-scroll-container {
    max-height: 320px;
    overflow-y: auto;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.table-scroll-container::-webkit-scrollbar {
    width: 6px;
}

.table-scroll-container::-webkit-scrollbar-track {
    background: transparent;
}

.table-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(37, 99, 235, 0.2);
    border-radius: 3px;
}

.table-scroll-container::-webkit-scrollbar-thumb:hover {
    background: rgba(37, 99, 235, 0.4);
}

/* Cabecera fija dentro del scroll */
.table-scroll-container .table-3d thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

/* ==========================================================================
   NK-MENU-ITEM — Botón premium sidebar (Bootstrap Icons)
   ========================================================================== */
.nk-menu-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 58px;
    padding: 10px 13px;
    margin-bottom: 9px;
    border-radius: 22px;
    text-decoration: none;
    color: #6f7f99;
    font-size: 13px;
    font-weight: 850;
    isolation: isolate;
    transition: transform .14s ease, box-shadow .14s ease, background .14s ease, color .14s ease;
}

.nk-menu-item::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(220,238,255,.85), rgba(210,245,235,.55));
    border: 1px solid rgba(190,220,255,.50);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.85),
        0 8px 20px rgba(37,99,235,.10);
    opacity: 0;
    transition: opacity .14s ease;
    z-index: -1;
}

.nk-menu-item:hover {
    color: #1a3a5c;
    transform: translateX(5px) translateY(-1px);
    box-shadow: 0 10px 24px rgba(37,99,235,.12);
}

.nk-menu-item:hover::before {
    opacity: 1;
}

.nk-menu-item.active {
    color: #0f5bdd;
    background: linear-gradient(145deg, rgba(255,255,255,.94), rgba(232,242,255,.88));
    box-shadow:
        0 20px 38px rgba(37,99,235,.17),
        inset 0 1px 0 rgba(255,255,255,.98);
}

.nk-menu-item.active::before {
    opacity: 1;
    border-color: rgba(255,255,255,.92);
}

.nk-menu-item.active::after {
    content: "";
    position: absolute;
    left: -16px;
    top: 12px;
    bottom: 12px;
    width: 5px;
    border-radius: 0 8px 8px 0;
    background: linear-gradient(180deg, #1d4ed8, #4fa3ff);
    box-shadow: 0 0 16px rgba(37,99,235,.55);
}

.nk-menu-icon {
    width: 43px;
    height: 43px;
    min-width: 43px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 18px;
    background: linear-gradient(145deg, rgba(255,255,255,.97), rgba(231,241,255,.84));
    box-shadow:
        0 13px 25px rgba(70,100,150,.16),
        inset 0 1px 0 rgba(255,255,255,.96);
    transition: transform .22s ease, box-shadow .22s ease, background .22s ease;
}

.nk-menu-item:hover .nk-menu-icon {
    transform: translateZ(10px) scale(1.04);
    box-shadow:
        0 16px 30px rgba(70,100,150,.21),
        0 0 0 6px rgba(255,255,255,.36),
        inset 0 1px 0 rgba(255,255,255,1);
}

.nk-menu-item.active .nk-menu-icon {
    color: #0f5bdd;
    background: linear-gradient(145deg, #ffffff, #dceaff);
    box-shadow:
        0 16px 32px rgba(37,99,235,.22),
        inset 0 1px 0 #fff;
}

.nk-menu-text {
    white-space: nowrap;
    line-height: 1;
}

/* ── Variantes de color del icono ── */
.nk-menu-icon.nk-blue {
    color: var(--nk-blue, #2563eb);
    background: var(--nk-blue-soft, #e8f0ff);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.95),
        0 12px 28px rgba(37, 99, 235, 0.16);
}

.nk-menu-icon.nk-green {
    color: #059669;
    background: #e7f8f1;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.95),
        0 12px 28px rgba(16, 185, 129, 0.15);
}

.nk-menu-icon.nk-orange {
    color: var(--nk-orange, #f59e0b);
    background: var(--nk-orange-soft, #fff3d8);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.95),
        0 12px 28px rgba(245, 158, 11, 0.18);
}

.nk-menu-icon.nk-yellow {
    color: #ca8a04;
    background: #fff8d8;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.95),
        0 12px 28px rgba(234, 179, 8, 0.16);
}

.nk-menu-icon.nk-gray {
    color: #64748b;
    background: #f1f5f9;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.95),
        0 12px 28px rgba(100, 116, 139, 0.13);
}
