/* ==========================================================================
   App layer on top of the NEXEL theme.
   Tokens → components → pages. Dark mode via html.app-skin-dark (theme class).
   ========================================================================== */

:root {
    --app-primary: #3454d1;
    --app-primary-2: #6a4cff;
    --app-primary-soft: rgba(52, 84, 209, .1);
    --app-success: #17c666;
    --app-info: #3dc7be;
    --app-warning: #ffa21d;
    --app-danger: #ea4d4d;
    --app-surface: #ffffff;
    --app-surface-2: #f6f8fb;
    --app-border: #e5e7eb;
    --app-text: #283c50;
    --app-muted: #7c8a9a;
    --app-radius: 14px;
    --app-radius-sm: 10px;
    --app-shadow: 0 6px 24px rgba(40, 60, 80, .07);
    --app-shadow-lg: 0 18px 50px rgba(40, 60, 80, .14);
    /* Zenith Dapp brand (from the logo): deep navy, electric blue, gold */
    --app-navy: #08122a;
    --app-navy-2: #0d2457;
    --app-gold: #f2b52c;
    --app-gold-2: #ffd56a;
    --app-gradient: linear-gradient(135deg, #0d2457 0%, #1d5fd1 100%);
    --app-gradient-dark: linear-gradient(150deg, #08122a 0%, #0d2457 55%, #1a4fb3 100%);
    --app-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

html.app-skin-dark {
    --app-surface: #1d2333;
    --app-surface-2: #161b28;
    --app-border: #2a3246;
    --app-text: #e3e8f2;
    --app-muted: #8b95a8;
    --app-primary-soft: rgba(106, 128, 255, .16);
    --app-shadow: 0 6px 24px rgba(0, 0, 0, .25);
    --app-shadow-lg: 0 18px 50px rgba(0, 0, 0, .45);
}

/* ── Brand ─────────────────────────────────────────────────────────────── */
.app-brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; line-height: 1; }
.app-logo-full { display: block; height: auto; width: 100%; max-width: 190px; }
.app-logo-mark { display: block; width: 40px; height: 40px; flex-shrink: 0; }
.app-brand-logo .app-logo-mark { display: none; }
.app-wordmark { font-weight: 900; font-size: 1.12rem; letter-spacing: .06em; white-space: nowrap; }
.app-wordmark-a { color: var(--app-navy-2); }
.app-wordmark-b { color: var(--app-gold); }
html.app-skin-dark .app-wordmark-a { color: #e8edf7; }
.app-gold { color: var(--app-gold); }

/* Sidebar header: always navy so the silver/gold logo reads well in light mode too. */
.nxl-navigation .m-header { background: var(--app-gradient-dark) !important; border-bottom: 1px solid rgba(255, 255, 255, .06) !important; }
.nxl-navigation .m-header .app-brand { padding: 0 6px; width: 100%; justify-content: center; }
.nxl-navigation .m-header .app-logo-full { max-width: 176px; }
html.minimenu .nxl-navigation:not(:hover) .app-brand-logo .app-logo-full { display: none; }
html.minimenu .nxl-navigation:not(:hover) .app-brand-logo .app-logo-mark { display: block; width: 36px; height: 36px; }

/* ── Avatars ───────────────────────────────────────────────────────────── */
.app-avatar {
    --s: 38px;
    width: var(--s); height: var(--s); border-radius: 50%; flex-shrink: 0;
    display: inline-grid; place-items: center; font-weight: 700; font-size: calc(var(--s) * .36);
    background: var(--app-primary-soft); color: var(--app-primary); letter-spacing: .02em;
}
.app-avatar-sm { --s: 32px; }
.app-avatar-lg { --s: 46px; }
.app-avatar-xl { --s: 64px; font-size: 22px; }
.app-avatar-alt { background: rgba(61, 199, 190, .14); color: #1a9e96; }
.app-avatar-btn { display: inline-flex; }
.app-avatar-btn .app-avatar { background: var(--app-gradient); color: #fff; }

/* ── Header theme switch ───────────────────────────────────────────────── */
[data-theme-toggle] .app-theme-light-icon { display: none; }
html.app-skin-dark [data-theme-toggle] .app-theme-light-icon { display: inline-block; }
html.app-skin-dark [data-theme-toggle] .app-theme-dark-icon { display: none; }
.nxl-header [data-theme-toggle] { color: inherit; font-size: 18px; line-height: 1; text-decoration: none; }

/* ── Cards & stats ─────────────────────────────────────────────────────── */
.card { border-radius: var(--app-radius); }
.app-stat { text-decoration: none; transition: transform .18s ease, box-shadow .18s ease; border: 1px solid transparent; }
a.app-stat:hover { transform: translateY(-2px); box-shadow: var(--app-shadow-lg); }
.app-stat .card-body { display: flex; flex-direction: column; gap: .35rem; }
.app-stat-icon {
    width: 42px; height: 42px; border-radius: 12px; display: inline-grid; place-items: center; font-size: 19px; margin-bottom: .4rem;
}
.app-stat-value { font-size: 1.65rem; font-weight: 800; color: var(--app-text); line-height: 1.1; letter-spacing: -.02em; }
.app-stat-value-sm { font-size: 1.05rem; font-weight: 700; }
.app-stat-label { color: var(--app-muted); font-size: .8rem; font-weight: 600; }

/* Welcome card (customer dashboard) */
.app-hello-card { background: var(--app-gradient); border: 0; color: #fff; overflow: hidden; position: relative; }
.app-hello-card::after {
    content: ""; position: absolute; right: -80px; top: -80px; width: 260px; height: 260px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .18), transparent 70%); pointer-events: none;
}
.app-hello-card .app-avatar { background: rgba(255, 255, 255, .18); color: #fff; }
.app-hello-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: rgba(255, 255, 255, .7); margin-bottom: .25rem; }
.card:not(.app-hello-card) .app-hello-label { color: var(--app-muted); }
.app-hello-value { font-size: 1.15rem; font-weight: 800; color: #fff; }
.app-hello-sub { font-size: .75rem; font-weight: 600; opacity: .75; margin-left: .25rem; }
.app-btn-glass { background: rgba(255, 255, 255, .16); color: #fff; border: 0; }
.app-btn-glass:hover { background: rgba(255, 255, 255, .28); color: #fff; }
.app-reflink {
    display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between;
    padding: .75rem; border-radius: var(--app-radius-sm); background: rgba(0, 0, 0, .14); position: relative; z-index: 1;
}
.app-reflink-url { display: flex; align-items: center; min-width: 0; flex: 1 1 260px; font-family: var(--app-mono); font-size: .85rem; }
.app-reflink-url span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Tabs ──────────────────────────────────────────────────────────────── */
.app-tabs { border-bottom: 1px solid var(--app-border); padding: 0 1rem; gap: .25rem; }
.app-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; font-weight: 600; color: var(--app-muted); padding: 1rem .9rem; background: none; }
.app-tabs .nav-link.active { color: var(--app-primary); border-bottom-color: var(--app-primary); background: none; }
.app-side-tabs .list-group-item { border: 0; padding: .85rem 1.25rem; font-weight: 600; color: var(--app-muted); background: transparent; }
.app-side-tabs .list-group-item.active { background: var(--app-primary-soft); color: var(--app-primary); border-left: 3px solid var(--app-primary); }

/* ── Filters bar ───────────────────────────────────────────────────────── */
.app-filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.app-filters > .form-control, .app-filters > .form-select { width: auto; flex: 1 1 160px; max-width: 260px; }
.app-filters > input[type="search"] { flex: 2 1 240px; max-width: 360px; }
.app-dt-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: 1rem 1.25rem; border-top: 1px solid var(--app-border); }
.app-dt-footer .dataTables_length select { width: auto; display: inline-block; }
.app-dt-footer .dataTables_info { padding-top: 0 !important; color: var(--app-muted); font-size: .8rem; }
.app-dt-footer .pagination { margin: 0; }
table.dataTable { margin-top: 0 !important; margin-bottom: 0 !important; }
div.dataTables_processing { background: transparent; box-shadow: none; border: 0; }

/* ── Empty states ──────────────────────────────────────────────────────── */
.app-empty { text-align: center; padding: 2.75rem 1rem; }
.app-empty > i { font-size: 34px; color: var(--app-primary); background: var(--app-primary-soft); width: 72px; height: 72px; border-radius: 50%; display: inline-grid; place-items: center; margin-bottom: 1rem; }

/* ── Forms ─────────────────────────────────────────────────────────────── */
.app-readonly { cursor: default; }
.app-field-status { position: absolute; right: .85rem; top: 50%; transform: translateY(-50%); font-size: 16px; }
.app-form-section { padding: 1rem; margin-bottom: 1.25rem; border-radius: var(--app-radius-sm); background: var(--app-primary-soft); }
.app-strength { height: 4px; border-radius: 4px; background: var(--app-border); margin-top: .45rem; overflow: hidden; }
.app-strength span { display: block; height: 100%; width: 0; transition: width .25s ease, background .25s ease; }
.app-strength[data-level="1"] span { width: 25%; background: var(--app-danger); }
.app-strength[data-level="2"] span { width: 50%; background: var(--app-warning); }
.app-strength[data-level="3"] span { width: 75%; background: var(--app-info); }
.app-strength[data-level="4"] span { width: 100%; background: var(--app-success); }
.app-otp-input { text-align: center; font-family: var(--app-mono); font-size: 1.8rem; letter-spacing: .6em; font-weight: 700; padding: .65rem .5rem .65rem 1.1rem; }
.app-otp-inline { max-width: 220px; font-size: 1.3rem; }
.app-address { font-family: var(--app-mono); font-size: .9rem; padding: .45rem .7rem; border-radius: 8px; background: var(--app-surface-2); color: var(--app-text); word-break: break-all; }
.app-address-sm { font-family: var(--app-mono); font-size: .78rem; word-break: break-all; }
.app-rule-card { border: 1px solid var(--app-border); border-top-width: 3px; border-radius: var(--app-radius-sm); padding: 1.1rem; height: 100%; }
.app-pre { white-space: pre-wrap; word-break: break-word; }
.app-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 420px; }

/* ── Timeline / misc ───────────────────────────────────────────────────── */
.app-timeline li { position: relative; padding: 0 0 1rem 1.25rem; border-left: 2px solid var(--app-border); margin-left: .35rem; }
.app-timeline li::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--app-primary); }
.app-timeline li:last-child { padding-bottom: 0; }
.app-rank { width: 28px; height: 28px; border-radius: 8px; display: inline-grid; place-items: center; font-weight: 800; font-size: .8rem; background: var(--app-primary-soft); color: var(--app-primary); }
.app-chart { min-height: 300px; }
.app-diff { font-size: .75rem; max-width: 420px; }
.app-diff-old { color: var(--app-danger); text-decoration: line-through; word-break: break-all; }
.app-diff-new { color: var(--app-success); word-break: break-all; }
.app-contact { display: flex; align-items: center; gap: .9rem; padding: .85rem; border-radius: var(--app-radius-sm); border: 1px solid var(--app-border); margin-bottom: .75rem; text-decoration: none; }
.app-contact:hover { border-color: var(--app-primary); }
.app-contact .app-stat-icon { margin: 0; }
.app-contact small { display: block; color: var(--app-muted); font-weight: 600; }
.app-contact strong { color: var(--app-text); word-break: break-all; }

/* ── Two-level tree (customer + admin profile) ─────────────────────────── */
.app-tree-scroll { overflow-x: auto; padding: .5rem 0 1rem; }
.app-tree, .app-tree ul { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; }
.app-tree { min-width: max-content; margin: 0 auto; }
.app-tree li { position: relative; padding: 28px 8px 0; display: flex; flex-direction: column; align-items: center; }
.app-tree > li { padding-top: 0; }
.app-tree ul { padding-top: 0; position: relative; }
.app-tree li::before, .app-tree li::after { content: ""; position: absolute; top: 0; width: 50%; height: 28px; border-top: 2px solid var(--app-border); }
.app-tree li::before { right: 50%; }
.app-tree li::after { left: 50%; border-left: 2px solid var(--app-border); }
.app-tree li:only-child::before, .app-tree li:only-child::after { border-top: 0; }
.app-tree li:only-child::before { display: none; }
.app-tree li:first-child::before, .app-tree li:last-child::after { border-top: 0; }
.app-tree li:last-child::before { border-right: 2px solid var(--app-border); border-radius: 0 10px 0 0; }
.app-tree li:first-child::after { border-radius: 10px 0 0 0; }
.app-tree > li::before, .app-tree > li::after { display: none; }
.app-tree li > ul { margin-top: 0; padding-top: 28px; }
.app-tree li > ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 28px; border-left: 2px solid var(--app-border); }
.app-node {
    display: flex; align-items: center; gap: .6rem; padding: .6rem .85rem; min-width: 170px; max-width: 220px;
    background: var(--app-surface); border: 1px solid var(--app-border); border-radius: 12px; box-shadow: var(--app-shadow);
    text-decoration: none; text-align: left; position: relative; z-index: 1;
}
a.app-node:hover { border-color: var(--app-primary); }
.app-node strong { display: block; font-size: .82rem; color: var(--app-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.app-node small { display: block; font-size: .7rem; color: var(--app-muted); white-space: nowrap; }
.app-node-me { border-top: 3px solid var(--app-primary); }
.app-node-me .app-avatar { background: var(--app-gradient); color: #fff; }
.app-node-l1 { border-top: 3px solid var(--app-info); }
.app-node-l2 { border-top: 3px solid var(--app-warning); }
.app-node-l2 .app-avatar { background: rgba(255, 162, 29, .14); color: #d98200; }
.app-legend { display: inline-flex; align-items: center; gap: .4rem; color: var(--app-muted); font-weight: 600; }
.app-legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.app-legend-dot.app-node-me { background: var(--app-primary); }
.app-legend-dot.app-node-l1 { background: var(--app-info); }
.app-legend-dot.app-node-l2 { background: var(--app-warning); }

/* ── Whole-system lazy tree (admin) ────────────────────────────────────── */
.app-path { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-size: .85rem; }
.app-path i { color: var(--app-muted); font-size: 12px; }
.app-ltree-node { display: flex; align-items: center; gap: .6rem; padding: .55rem .75rem; border: 1px solid var(--app-border); border-radius: 12px; background: var(--app-surface); margin-bottom: .5rem; }
.app-ltree-node strong { display: block; font-size: .85rem; color: var(--app-text); }
.app-ltree-node small { display: block; font-size: .72rem; color: var(--app-muted); overflow: hidden; text-overflow: ellipsis; }
.app-ltree-root { border-top: 3px solid var(--app-primary); }
.app-ltree-children { list-style: none; margin: 0 0 0 1.1rem; padding: 0 0 0 1.1rem; border-left: 2px dashed var(--app-border); }
.app-ltree-toggle { width: 28px; height: 28px; border-radius: 8px; border: 0; background: var(--app-primary-soft); color: var(--app-primary); display: inline-grid; place-items: center; flex-shrink: 0; transition: transform .15s ease; }
.app-ltree-toggle[aria-expanded="true"] i { transform: rotate(90deg); display: inline-block; }
.app-ltree-toggle:disabled { background: transparent; color: var(--app-border); }
.app-search-box { position: relative; flex: 1 1 320px; max-width: 520px; }
.app-search-box > i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--app-muted); }
.app-search-box .form-control { padding-left: 2.3rem; }
.app-search-results { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); background: var(--app-surface); border: 1px solid var(--app-border); border-radius: var(--app-radius-sm); box-shadow: var(--app-shadow-lg); max-height: 320px; overflow-y: auto; }
.app-search-results a { display: block; padding: .6rem .9rem; color: var(--app-text); text-decoration: none; font-size: .85rem; }
.app-search-results a:hover { background: var(--app-primary-soft); }

/* ── Toasts ────────────────────────────────────────────────────────────── */
.app-toasts { position: fixed; z-index: 2000; right: 1rem; top: 1rem; display: flex; flex-direction: column; gap: .6rem; max-width: min(380px, calc(100vw - 2rem)); }
.app-toast {
    display: flex; align-items: flex-start; gap: .7rem; padding: .85rem 1rem; border-radius: 12px; background: var(--app-surface);
    box-shadow: var(--app-shadow-lg); border-left: 4px solid var(--app-primary); color: var(--app-text);
    opacity: 0; transform: translateX(20px); transition: opacity .22s ease, transform .22s ease; font-size: .875rem;
}
.app-toast.show { opacity: 1; transform: none; }
.app-toast > i { font-size: 18px; margin-top: 1px; }
.app-toast-msg { flex: 1; word-break: break-word; }
.app-toast-close { border: 0; background: none; color: var(--app-muted); font-size: 20px; line-height: 1; padding: 0; }
.app-toast-success { border-left-color: var(--app-success); } .app-toast-success > i { color: var(--app-success); }
.app-toast-error { border-left-color: var(--app-danger); } .app-toast-error > i { color: var(--app-danger); }
.app-toast-warning { border-left-color: var(--app-warning); } .app-toast-warning > i { color: var(--app-warning); }
.app-toast-info > i { color: var(--app-primary); }

/* ── Customer mobile tab bar ───────────────────────────────────────────── */
.app-tabbar {
    position: fixed; z-index: 1030; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around;
    background: var(--app-surface); border-top: 1px solid var(--app-border); box-shadow: 0 -6px 20px rgba(40, 60, 80, .06);
    padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom));
}
.app-tabbar-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .35rem 0; color: var(--app-muted); text-decoration: none; font-size: .65rem; font-weight: 700; border-radius: 10px; }
.app-tabbar-item i { font-size: 19px; }
.app-tabbar-item.active { color: var(--app-primary); background: var(--app-primary-soft); }
@media (max-width: 991.98px) {
    .app-customer .nxl-container { padding-bottom: 76px; }
}

/* ── Auth pages ────────────────────────────────────────────────────────── */
.app-auth { background: var(--app-surface-2); min-height: 100vh; }
.app-auth-wrapper { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 992px) { .app-auth-wrapper { grid-template-columns: minmax(380px, 5fr) 7fr; } }
.app-auth-aside {
    background: var(--app-gradient-dark); color: #fff; padding: 3rem; align-items: center; position: relative; overflow: hidden;
}
.app-auth-aside::before, .app-auth-aside::after { content: ""; position: absolute; border-radius: 50%; background: radial-gradient(circle, rgba(242, 181, 44, .16), transparent 70%); }
.app-auth-aside::before { width: 420px; height: 420px; right: -160px; top: -120px; }
.app-auth-aside::after { width: 300px; height: 300px; left: -120px; bottom: -100px; }
.app-auth-aside-inner { position: relative; z-index: 1; max-width: 440px; }
.app-auth-headline { color: #fff; font-size: 2.1rem; font-weight: 800; line-height: 1.2; letter-spacing: -.02em; margin-bottom: 1rem; }
.app-auth-lead { color: rgba(255, 255, 255, .82); font-size: 1rem; margin-bottom: 2rem; }
.app-auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: .85rem; }
.app-auth-points li { display: flex; align-items: center; gap: .7rem; font-weight: 600; color: rgba(255, 255, 255, .92); }
.app-auth-points i { width: 32px; height: 32px; border-radius: 9px; display: inline-grid; place-items: center; background: rgba(255, 255, 255, .16); }
.app-auth-main { display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.app-auth-card { width: 100%; max-width: 560px; background: var(--app-surface); border-radius: 18px; box-shadow: var(--app-shadow-lg); padding: 2.25rem; }
@media (max-width: 575.98px) { .app-auth-card { padding: 1.5rem 1.15rem; border-radius: 14px; } }
.app-auth-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: .35rem; color: var(--app-text); }
.app-auth-sub { color: var(--app-muted); margin-bottom: 1.5rem; }
.app-auth-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 24px; background: var(--app-primary-soft); color: var(--app-primary); margin-bottom: 1.1rem; }

/* ── Error page ────────────────────────────────────────────────────────── */
.app-error { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.app-error-card { text-align: center; max-width: 520px; }
.app-error-card .app-auth-icon { margin: 0 auto 1rem; }
.app-error-code { font-size: 4.5rem; font-weight: 900; line-height: 1; background: var(--app-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.app-error-text { color: var(--app-muted); font-size: 1.05rem; margin: .75rem 0 1.5rem; }
.app-error-debug { text-align: left; margin-top: 2rem; padding: 1rem; font-size: .75rem; background: #111827; color: #fca5a5; border-radius: 10px; max-height: 50vh; overflow: auto; }

/* ── Public site ───────────────────────────────────────────────────────── */
.app-site { background: var(--app-surface-2); }
.app-site-nav { position: sticky; top: 0; z-index: 10; padding: 1rem 0; background: color-mix(in srgb, var(--app-surface-2) 85%, transparent); backdrop-filter: blur(10px); }
.app-hero { padding: 4.5rem 0 3rem; }
.app-hero-title { font-size: clamp(2rem, 4vw, 3.1rem); font-weight: 900; letter-spacing: -.03em; line-height: 1.1; color: var(--app-text); margin-bottom: 1.1rem; }
.app-hero-lead { font-size: 1.1rem; color: var(--app-muted); margin-bottom: 2rem; max-width: 540px; }
.app-hero-card { background: var(--app-surface); border-radius: 20px; box-shadow: var(--app-shadow-lg); padding: 1.75rem; display: grid; gap: 1.1rem; }
.app-hero-row { display: flex; gap: 1rem; align-items: flex-start; padding: .9rem; border-radius: 14px; background: var(--app-surface-2); }
.app-hero-row strong { display: block; color: var(--app-text); }
.app-hero-row small { color: var(--app-muted); }
.app-hero-dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.app-features { padding: 2rem 0 4rem; }
.app-feature { background: var(--app-surface); border-radius: var(--app-radius); padding: 1.75rem; height: 100%; box-shadow: var(--app-shadow); }
.app-feature i { font-size: 22px; width: 48px; height: 48px; border-radius: 14px; display: inline-grid; place-items: center; background: var(--app-primary-soft); color: var(--app-primary); margin-bottom: 1rem; }
.app-feature h3 { font-size: 1.05rem; font-weight: 800; color: var(--app-text); }
.app-feature p { color: var(--app-muted); margin: 0; }
.app-site-footer { padding: 1.5rem 0; border-top: 1px solid var(--app-border); color: var(--app-muted); font-size: .85rem; }
.app-prose { max-width: 760px; background: var(--app-surface); padding: 2.5rem; border-radius: var(--app-radius); box-shadow: var(--app-shadow); }
.app-terms { line-height: 1.75; color: var(--app-text); }

/* ── Subscription & payments ───────────────────────────────────────────── */
.app-plan-active { background: linear-gradient(135deg, #0e9f6e 0%, #16a34a 45%, #3454d1 140%); border: 0; color: #fff; }
.app-plan-days { font-size: 2.6rem; font-weight: 900; line-height: 1; color: #fff; }
.app-plan-progress { height: 8px; border-radius: 8px; background: rgba(255, 255, 255, .22); overflow: hidden; }
.app-plan-progress span { display: block; height: 100%; background: #fff; border-radius: 8px; }
.app-status-card { border-left: 4px solid var(--app-warning); }
.app-plan { border: 1px solid var(--app-border); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.app-plan:hover { transform: translateY(-3px); box-shadow: var(--app-shadow-lg); border-color: var(--app-primary); }
.app-plan-featured { border: 2px solid var(--app-primary); position: relative; }
.app-plan-featured::before { content: "Popular"; position: absolute; top: -11px; right: 18px; background: var(--app-gradient); color: #fff; font-size: .68rem; font-weight: 800; padding: .2rem .6rem; border-radius: 20px; letter-spacing: .04em; text-transform: uppercase; }
.app-plan-name { font-weight: 800; font-size: 1.05rem; color: var(--app-text); margin-bottom: .35rem; }
.app-plan-price { font-size: 2.1rem; font-weight: 900; letter-spacing: -.03em; color: var(--app-primary); margin-bottom: .75rem; }
.app-plan-price small { font-size: .95rem; font-weight: 700; color: var(--app-muted); }
.app-plan-features { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.app-plan-features li { display: flex; align-items: center; gap: .55rem; color: var(--app-text); }
.app-plan-features i { color: var(--app-success); font-size: 15px; }
.app-step { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--app-gradient); color: #fff; font-weight: 800; font-size: .85rem; }
.app-pay-amount { padding: 1rem 1.1rem; border-radius: var(--app-radius-sm); background: var(--app-primary-soft); }
.app-pay-value { font-size: 1.8rem; font-weight: 900; color: var(--app-primary); letter-spacing: -.02em; }
.app-wallet-box { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; padding: .6rem; border: 1px dashed var(--app-field-border, var(--app-border)); border-radius: var(--app-radius-sm); background: var(--app-surface-2); }
.app-wallet-box .app-address { background: transparent; padding: .25rem; font-size: .95rem; }
.app-pay-rules { padding-left: 1.1rem; color: var(--app-muted); display: grid; gap: .4rem; font-size: .85rem; }
.app-plan-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; padding: .9rem; border-radius: var(--app-radius-sm); background: var(--app-surface-2); }
.app-plan-summary span { display: block; font-size: .72rem; text-transform: uppercase; font-weight: 700; letter-spacing: .04em; }
.app-plan-summary strong { color: var(--app-text); font-size: .9rem; }
.app-dropzone { display: block; position: relative; border: 2px dashed var(--app-field-border, var(--app-border)); border-radius: var(--app-radius-sm); padding: 1.4rem 1rem; text-align: center; cursor: pointer; background: var(--app-surface-2); transition: border-color .15s ease, background .15s ease; margin: 0; }
.app-dropzone:hover, .app-dropzone.is-drag { border-color: var(--app-primary); background: var(--app-primary-soft); }
.app-dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.app-dropzone-empty { display: flex; flex-direction: column; align-items: center; gap: .3rem; color: var(--app-text); }
.app-dropzone-empty i { font-size: 28px; color: var(--app-primary); }
.app-dropzone-empty small { color: var(--app-muted); }
.app-dropzone-file { display: flex; flex-direction: column; align-items: center; gap: .5rem; color: var(--app-text); font-weight: 600; word-break: break-all; }
.app-dropzone-file img { max-height: 160px; max-width: 100%; border-radius: 8px; box-shadow: var(--app-shadow); }
.app-proof-img { max-width: 100%; max-height: 70vh; border-radius: 10px; box-shadow: var(--app-shadow); border: 1px solid var(--app-border); }
.app-dl { display: grid; grid-template-columns: max-content 1fr; gap: .55rem 1rem; margin: 0 0 1rem; }
.app-dl dt { color: var(--app-muted); font-weight: 600; font-size: .8rem; }
.app-dl dd { margin: 0; color: var(--app-text); word-break: break-word; }
.app-menu-badge { font-size: .65rem; padding: .25em .5em; border-radius: 10px; }
button.app-stat { cursor: pointer; }

/* ── Form fields: always clearly visible (light + dark) ────────────────── */
:root {
    --app-field-bg: #ffffff;
    --app-field-border: #cfd6e3;
    --app-field-border-hover: #aab4c6;
    --app-field-text: #1f2d3d;
    --app-field-placeholder: #8c97a8;
    --app-field-addon-bg: #f1f4f9;
    --app-field-readonly-bg: #f4f6fa;
    --app-label: #3a4a5c;
    --app-help: #6b7889;
}
html.app-skin-dark {
    --app-field-bg: #121726;
    --app-field-border: #3a4560;
    --app-field-border-hover: #56648a;
    --app-field-text: #eef2f8;
    --app-field-placeholder: #7d889e;
    --app-field-addon-bg: #232b40;
    --app-field-readonly-bg: #1a2032;
    --app-label: #d5dceb;
    --app-help: #9aa5ba;
}

.form-control,
.form-select,
html.app-skin-dark .form-control,
html.app-skin-dark .form-select {
    background-color: var(--app-field-bg) !important;
    border: 1px solid var(--app-field-border) !important;
    color: var(--app-field-text) !important;
    border-radius: 10px;
    min-height: 46px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
textarea.form-control { min-height: 110px; }
.form-control:hover, .form-select:hover { border-color: var(--app-field-border-hover) !important; }
.form-control::placeholder { color: var(--app-field-placeholder) !important; opacity: 1; }
.form-control:focus,
.form-select:focus,
html.app-skin-dark .form-control:focus,
html.app-skin-dark .form-select:focus {
    border-color: var(--app-primary) !important;
    box-shadow: 0 0 0 .22rem rgba(52, 84, 209, .22) !important;
    outline: 0;
}
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--app-danger) !important; }
.form-control.is-invalid:focus { box-shadow: 0 0 0 .22rem rgba(234, 77, 77, .2) !important; }
html.app-skin-dark .form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23aab4c6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right .9rem center !important;
    background-size: 14px 10px !important;
}
.form-select option { background: var(--app-field-bg); color: var(--app-field-text); }

.input-group-text,
html.app-skin-dark .input-group-text {
    background-color: var(--app-field-addon-bg) !important;
    border: 1px solid var(--app-field-border) !important;
    color: var(--app-field-text) !important;
    font-weight: 600;
    min-height: 46px;
}
.input-group > .input-group-text:first-child { border-radius: 10px 0 0 10px; }
.input-group > .input-group-text:last-child,
.input-group > button.input-group-text:last-child { border-radius: 0 10px 10px 0; }
.input-group > .form-control:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group > .form-control:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group:focus-within .input-group-text { border-color: var(--app-primary) !important; }

.app-readonly,
.app-readonly:focus,
html.app-skin-dark .app-readonly {
    background-color: var(--app-field-readonly-bg) !important;
    border-style: dashed !important;
    color: var(--app-help) !important;
    box-shadow: none !important;
}

.form-label { color: var(--app-label) !important; font-weight: 600; font-size: .82rem; margin-bottom: .4rem; }
.form-text { color: var(--app-help) !important; }

.form-check-input,
html.app-skin-dark .form-check-input {
    width: 1.15em; height: 1.15em; margin-top: .2em;
    background-color: var(--app-field-bg) !important;
    border: 1.5px solid var(--app-field-border-hover) !important;
    cursor: pointer;
}
.form-check-input:checked,
html.app-skin-dark .form-check-input:checked {
    background-color: var(--app-primary) !important;
    border-color: var(--app-primary) !important;
}
.form-check-input:focus { box-shadow: 0 0 0 .22rem rgba(52, 84, 209, .22) !important; border-color: var(--app-primary) !important; }
.form-switch .form-check-input { width: 2.4em; }
.form-check-label { color: var(--app-text); cursor: pointer; }

.app-form-section { border: 1px solid var(--app-field-border); }
html.app-skin-dark .app-form-section { background: rgba(106, 128, 255, .08); }

/* ── Dark-mode touch-ups the theme doesn't cover ───────────────────────── */
html.app-skin-dark .app-auth-card,
html.app-skin-dark .app-node,
html.app-skin-dark .app-ltree-node,
html.app-skin-dark .app-toast,
html.app-skin-dark .app-tabbar,
html.app-skin-dark .app-hero-card,
html.app-skin-dark .app-feature,
html.app-skin-dark .app-prose,
html.app-skin-dark .app-search-results { background: var(--app-surface); border-color: var(--app-border); }
html.app-skin-dark .app-site, html.app-skin-dark .app-auth { background: var(--app-surface-2); }
html.app-skin-dark .app-error-debug { background: #0b0f19; }

/* ── Brand touches ─────────────────────────────────────────────────────── */
.app-auth-aside .app-logo-full { max-width: 300px; }
.app-auth-points i { color: var(--app-gold); }
.app-hello-card { background: var(--app-gradient-dark); }
.app-hello-card::after { background: radial-gradient(circle, rgba(242, 181, 44, .22), transparent 70%); }
.app-plan-featured::before { background: linear-gradient(135deg, var(--app-gold), var(--app-gold-2)); color: var(--app-navy); }
.app-plan-featured { border-color: var(--app-gold); }
.app-error-code { background: linear-gradient(135deg, #1d5fd1, var(--app-gold)); -webkit-background-clip: text; background-clip: text; }
.app-site-nav .app-logo-mark, .app-auth-card .app-logo-mark { width: 44px; height: 44px; }
.app-avatar-btn .app-avatar, .app-node-me .app-avatar { background: var(--app-gradient); }
.form-control, .form-select, .input-group-text { font-size: .9rem; }
.card-header.app-filters { justify-content: flex-start !important; }
.app-actions { display: inline-flex; gap: .35rem; align-items: center; justify-content: flex-end; white-space: nowrap; }
.apexcharts-canvas, .apexcharts-svg, html.app-skin-dark .apexcharts-canvas, html.app-skin-dark .apexcharts-svg { background: transparent !important; }
.app-topbar-brand { display: inline-flex; align-items: center; gap: .45rem; text-decoration: none; }
.app-topbar-brand img { width: 34px; height: 34px; }
.app-topbar-brand .app-wordmark { font-size: .95rem; }
@media (max-width: 380px) { .app-topbar-brand .app-wordmark { display: none; } }

/* ── Coins & airdrops ─────────────────────────────────────────────────── */
.app-coin-logo { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--app-surface-2); border: 1px solid var(--app-border); }
.app-coin-logo-sm { width: 24px; height: 24px; font-size: 9px; }
.app-coin-logo-lg { width: 52px; height: 52px; font-size: 14px; }
.app-coin-fallback { display: inline-grid; place-items: center; font-size: 10px; font-weight: 800; letter-spacing: .02em; color: var(--app-navy); background: linear-gradient(135deg, var(--app-gold), var(--app-gold-2)); border: 0; }

.app-steps { display: flex; gap: .5rem; list-style: none; padding: 0; margin: 0 0 1.25rem; counter-reset: none; flex-wrap: wrap; }
.app-steps li { display: flex; align-items: center; gap: .5rem; padding: .5rem .9rem; border-radius: 999px; background: var(--app-surface); border: 1px solid var(--app-border); color: var(--app-muted); font-weight: 600; font-size: .85rem; }
.app-steps li span { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--app-surface-2); font-size: .75rem; }
.app-steps li.active { border-color: var(--app-primary); color: var(--app-text); }
.app-steps li.active span { background: var(--app-primary); color: #fff; }
.app-steps li.done span { background: var(--app-success); color: #fff; }

.app-choice { display: block; cursor: pointer; height: 100%; margin: 0; }
.app-choice input { position: absolute; opacity: 0; pointer-events: none; }
.app-choice > span { display: flex; flex-direction: column; gap: .2rem; height: 100%; padding: 1rem; border-radius: var(--app-radius-sm); border: 1.5px solid var(--app-field-border); background: var(--app-field-bg); transition: border-color .15s ease, box-shadow .15s ease; }
.app-choice > span i { font-size: 20px; color: var(--app-primary); margin-bottom: .35rem; }
.app-choice > span strong { color: var(--app-text); }
.app-choice > span small { color: var(--app-muted); }
.app-choice input:checked + span { border-color: var(--app-primary); box-shadow: 0 0 0 3px var(--app-primary-soft); }
.app-choice input:focus-visible + span { outline: 2px solid var(--app-primary); outline-offset: 2px; }

.app-kpi { padding: .9rem 1rem; border-radius: var(--app-radius-sm); background: var(--app-surface-2); border: 1px solid var(--app-border); height: 100%; }
.app-kpi-label { font-size: .75rem; font-weight: 600; color: var(--app-muted); text-transform: uppercase; letter-spacing: .04em; }
.app-kpi-value { font-size: 1.45rem; font-weight: 800; color: var(--app-text); line-height: 1.25; word-break: break-word; }
.app-kpi-value small { font-size: .8rem; font-weight: 700; color: var(--app-muted); }
.app-preview-table { max-height: 420px; overflow-y: auto; border: 1px solid var(--app-border); border-radius: var(--app-radius-sm); }
.app-preview-table thead th { position: sticky; top: 0; background: var(--app-surface); z-index: 1; }
.app-progress-sm { height: 5px; min-width: 90px; }

/* Customer airdrop list (cards on phones) */
.app-tx-list { list-style: none; margin: 0; padding: 0; }
.app-tx-list li { display: flex; align-items: center; gap: .85rem; padding: .9rem 1.25rem; border-top: 1px solid var(--app-border); }
.app-tx-list li:first-child { border-top: 0; }
.app-tx-amount { font-weight: 800; color: var(--app-text); white-space: nowrap; text-align: right; }
.app-coin-chip { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; border-radius: var(--app-radius-sm); background: var(--app-surface-2); border: 1px solid var(--app-border); height: 100%; }

/* Reports */
.app-report-table td, .app-report-table th { white-space: nowrap; }

/* Wallet / tx addresses are case-sensitive data: never let the theme's uppercase buttons change them. */
.app-address, .app-address-sm, .btn.app-address-sm, .btn-link.app-address-sm { text-transform: none !important; letter-spacing: normal; }

/* ── Offers ───────────────────────────────────────────────────────────── */
.app-offer-card { overflow: hidden; transition: transform .18s ease, box-shadow .18s ease; }
a.app-offer-card:hover { transform: translateY(-2px); box-shadow: var(--app-shadow-lg); }
.app-offer-banner { display: block; width: 100%; aspect-ratio: 3 / 1; object-fit: cover; background: var(--app-surface-2); }
.app-offer-banner-fallback { display: grid; place-items: center; background: var(--app-gradient); color: var(--app-gold); font-size: 38px; }
.app-offer-reward { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; border-radius: var(--app-radius-sm); background: var(--app-surface-2); border: 1px solid var(--app-border); }
.app-offer-reward > i { font-size: 22px; color: var(--app-gold); }
.app-offer-mini { padding: 1rem 1.125rem; border-radius: var(--app-radius-sm); background: var(--app-surface-2); border: 1px solid var(--app-border); border-top: 3px solid var(--app-gold); }
.app-offer-mini .progress { height: 8px; }

/* ── Sign-up: join under the company ─────────────────────────────────── */
.app-company-ref { display: flex; align-items: center; gap: .625rem; flex-wrap: wrap; font-size: 13px; color: var(--app-muted); padding-top: .25rem; }
.app-company-ref > i { color: var(--app-primary); }
.app-company-ref.is-used .btn { pointer-events: none; opacity: .6; }
.app-auth-contact { margin: 1.5rem 0 0; text-align: center; font-size: 12px; color: var(--app-muted); }

/* ── Referral wallet ─────────────────────────────────────────────────── */
.app-wallet-hero { border-radius: var(--app-radius); background: var(--app-gradient); color: #fff; padding: 1.5rem; }
.app-wallet-hero .app-wallet-label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; opacity: .75; font-weight: 600; }
.app-wallet-hero .app-wallet-amount { font-size: 2rem; font-weight: 800; line-height: 1.2; color: #fff; }
.app-wallet-hero .app-wallet-amount small { font-size: 1rem; font-weight: 600; opacity: .8; }
.app-wallet-hero .app-wallet-sub { font-size: 12px; opacity: .8; }
.app-ledger-amount { font-weight: 700; white-space: nowrap; }
.app-ledger-amount.is-credit { color: var(--bs-success, #17c666); }
.app-ledger-amount.is-debit { color: var(--bs-danger, #ea4d4d); }
.app-ledger-amount.is-muted { color: var(--app-muted); text-decoration: line-through; }
.app-change-list { list-style: none; padding: 0; margin: 0; }
.app-change-list > li { padding: .875rem 0; border-bottom: 1px solid var(--app-border); }
.app-change-list > li:last-child { border-bottom: 0; }
.app-change-old { color: var(--app-muted); text-decoration: line-through; word-break: break-all; }
.app-change-new { color: var(--app-text, inherit); font-weight: 600; word-break: break-all; }

/* ── Boosting ────────────────────────────────────────────────────────── */
.app-boost-card { border: 1px solid var(--app-border); border-left: 4px solid var(--app-gold); overflow: hidden; }
.app-boost-card.is-active { border-left-color: var(--bs-success, #17c666); }
.app-boost-icon { width: 46px; height: 46px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; color: #fff; background: var(--app-gradient); flex-shrink: 0; }
.app-boost-card.is-active .app-boost-icon { background: linear-gradient(135deg, #0f9d58 0%, #17c666 100%); }
.app-boost-kicker { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--app-gold); }
.app-boost-timer { text-align: right; min-width: 150px; }
.app-boost-clock { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--app-text); line-height: 1.2; }
.app-boost-time { height: 6px; }
.app-boost-time .progress-bar { background: var(--app-gold); transition: width 1s linear; }
@media (max-width: 575.98px) { .app-boost-timer { text-align: left; width: 100%; } }

/* ── Team: active / not active ───────────────────────────────────────── */
.app-node-state { display: inline-flex; align-items: center; gap: .3rem; margin-top: .2rem; font-style: normal; font-size: .68rem; font-weight: 600; }
.app-node-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.app-node-state.is-on { color: var(--bs-success, #17c666); }
.app-node-state.is-off { color: var(--app-muted); }
.app-node.is-inactive { opacity: .72; border-style: dashed; }
.app-active-pill { font-weight: 600; }
.app-bar-note { font-size: 11px; color: var(--app-muted); margin-top: .25rem; }
.app-offer-deadline { display: flex; align-items: center; gap: .75rem; padding: .625rem .875rem; border-radius: var(--app-radius-sm); background: rgba(242, 181, 44, .1); border: 1px dashed rgba(242, 181, 44, .55); }
.app-offer-deadline > i { font-size: 20px; color: var(--app-gold); }
