/* ==========================================================================
   DSMNR INVEST — design system
   Brand colors are injected as CSS variables from Admin > Settings > Branding.
   Logical properties (inline-start/end) keep the layout correct in RTL.
   ========================================================================== */

:root {
  --zen-primary: #4f46e5;
  --zen-primary-rgb: 79, 70, 229;
  --zen-secondary: #0ea5e9;
  --zen-accent: #10b981;
  --zen-bg: #f4f6fb;
  --zen-surface: #ffffff;
  --zen-surface-2: #f8fafc;
  --zen-border: rgba(15, 23, 42, .08);
  --zen-text: #0f172a;
  --zen-muted: #64748b;
  --zen-radius: 16px;
  --zen-radius-sm: 10px;
  --zen-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -12px rgba(15, 23, 42, .12);
  --zen-shadow-lg: 0 24px 60px -24px rgba(15, 23, 42, .28);
  --zen-sidebar-w: 264px;
  --zen-topbar-h: 64px;
  --zen-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Noto Sans Arabic", Tahoma, sans-serif;
  --bs-body-font-family: var(--zen-font);
  --bs-border-radius: .65rem;
  --bs-border-radius-lg: 1rem;
}

[data-bs-theme="dark"] {
  --zen-bg: #0a0f1d;
  --zen-surface: #111827;
  --zen-surface-2: #0f172a;
  --zen-border: rgba(148, 163, 184, .14);
  --zen-text: #e5e7eb;
  --zen-muted: #94a3b8;
  --zen-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .6);
  --bs-body-bg: var(--zen-bg);
  --bs-body-color: var(--zen-text);
  --bs-secondary-bg: #1f2937;
  --bs-tertiary-bg: #0f172a;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--zen-font);
  background: var(--zen-bg);
  color: var(--zen-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[dir="rtl"] body { letter-spacing: 0; }
a { text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
.btn:hover, .nav-link:hover, .dropdown-item:hover, .sidebar-link:hover, .card-link:hover { text-decoration: none; }
::selection { background: rgba(var(--zen-primary-rgb), .18); }
:focus-visible { outline: 3px solid rgba(var(--zen-primary-rgb), .45); outline-offset: 2px; }

.text-muted, .text-secondary { color: var(--zen-muted) !important; }
.fw-semibold { font-weight: 600 !important; }
.small-caps { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; color: var(--zen-muted); }
.tabular { font-variant-numeric: tabular-nums; }
.text-gradient {
  background: linear-gradient(120deg, var(--zen-primary), var(--zen-secondary) 60%, var(--zen-accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.bg-surface { background: var(--zen-surface) !important; }

/* Buttons ----------------------------------------------------------------- */
.btn { font-weight: 600; border-radius: .7rem; padding: .55rem 1.1rem; white-space: nowrap; }
.btn-sm { padding: .35rem .75rem; border-radius: .55rem; }
.btn-lg { padding: .8rem 1.5rem; border-radius: .9rem; }
.btn-primary {
  --bs-btn-bg: var(--zen-primary); --bs-btn-border-color: var(--zen-primary);
  --bs-btn-hover-bg: color-mix(in srgb, var(--zen-primary) 88%, #000); --bs-btn-hover-border-color: color-mix(in srgb, var(--zen-primary) 88%, #000);
  --bs-btn-active-bg: color-mix(in srgb, var(--zen-primary) 80%, #000);
  --bs-btn-disabled-bg: var(--zen-primary); --bs-btn-disabled-border-color: var(--zen-primary);
  box-shadow: 0 8px 20px -8px rgba(var(--zen-primary-rgb), .6);
}
.btn-outline-primary {
  --bs-btn-color: var(--zen-primary); --bs-btn-border-color: rgba(var(--zen-primary-rgb), .45);
  --bs-btn-hover-bg: var(--zen-primary); --bs-btn-hover-border-color: var(--zen-primary);
  --bs-btn-active-bg: var(--zen-primary);
}
.btn-soft { background: rgba(var(--zen-primary-rgb), .1); color: var(--zen-primary); border: 0; }
.btn-soft:hover { background: rgba(var(--zen-primary-rgb), .18); color: var(--zen-primary); }
.btn-icon { width: 40px; height: 40px; padding: 0; display: inline-grid; place-items: center; border-radius: 12px; }
.btn[disabled].is-loading { position: relative; color: transparent !important; }
.btn.is-loading::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 1.1rem; height: 1.1rem;
  border: 2px solid currentColor; border-color: #fff transparent #fff transparent; border-radius: 50%;
  animation: zen-spin .8s linear infinite;
}
@keyframes zen-spin { to { transform: rotate(360deg); } }

/* Forms ------------------------------------------------------------------- */
.form-control, .form-select { border-radius: .7rem; padding: .62rem .9rem; border-color: var(--zen-border); background-color: var(--zen-surface); }
.form-control:focus, .form-select:focus { border-color: rgba(var(--zen-primary-rgb), .6); box-shadow: 0 0 0 .22rem rgba(var(--zen-primary-rgb), .15); }
.form-label { font-weight: 600; font-size: .875rem; margin-bottom: .35rem; }
.form-text { color: var(--zen-muted); }
.input-group-text { background: var(--zen-surface-2); border-color: var(--zen-border); }
.form-check-input:checked { background-color: var(--zen-primary); border-color: var(--zen-primary); }
.otp-input { letter-spacing: .6em; font-size: 1.6rem; text-align: center; font-variant-numeric: tabular-nums; }
.hp-field { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip-path: inset(50%) !important; white-space: nowrap; opacity: 0; pointer-events: none; }

/* Cards ------------------------------------------------------------------- */
.card { border: 1px solid var(--zen-border); border-radius: var(--zen-radius); background: var(--zen-surface); box-shadow: var(--zen-shadow); }
.card-header { background: transparent; border-bottom: 1px solid var(--zen-border); padding: 1rem 1.25rem; font-weight: 600; }
.card-body { padding: 1.25rem; }
.card-footer { background: transparent; border-top: 1px solid var(--zen-border); }
.card-title-sm { font-size: .95rem; font-weight: 600; margin: 0; }
.card-glass {
  background: rgba(255, 255, 255, .72); backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, .6);
}
[data-bs-theme="dark"] .card-glass { background: rgba(17, 24, 39, .66); border-color: rgba(148, 163, 184, .16); }
.card-hover { transition: transform .2s ease, box-shadow .2s ease; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--zen-shadow-lg); }

/* Stat cards -------------------------------------------------------------- */
.stat-card { position: relative; overflow: hidden; }
.stat-card .stat-icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem;
  background: rgba(var(--zen-primary-rgb), .1); color: var(--zen-primary);
}
.stat-card .stat-icon.is-success { background: rgba(16, 185, 129, .12); color: #059669; }
.stat-card .stat-icon.is-warning { background: rgba(245, 158, 11, .14); color: #d97706; }
.stat-card .stat-icon.is-danger { background: rgba(239, 68, 68, .12); color: #dc2626; }
.stat-card .stat-icon.is-info { background: rgba(14, 165, 233, .12); color: #0284c7; }
.stat-card .stat-label { color: var(--zen-muted); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat-card .stat-value { font-size: 1.55rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-card .stat-sub { font-size: .8rem; color: var(--zen-muted); }
.balance-hero {
  color: #fff; border: 0;
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--zen-primary) 92%, #fff) 0%, var(--zen-primary) 40%, color-mix(in srgb, var(--zen-primary) 55%, #020617) 100%);
}
.balance-hero .text-muted, .balance-hero .stat-label { color: rgba(255, 255, 255, .72) !important; }
.balance-hero::after {
  content: ""; position: absolute; inset-inline-end: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 70%);
}

/* Tables ------------------------------------------------------------------ */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .8rem 1rem; border-bottom-color: var(--zen-border); }
.table thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--zen-muted); font-weight: 600; background: var(--zen-surface-2); white-space: nowrap; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: rgba(var(--zen-primary-rgb), .035); }
.table td.amount, .table th.amount { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amount-positive { color: #059669; }
.amount-negative { color: #dc2626; }
[data-bs-theme="dark"] .amount-positive { color: #34d399; }
[data-bs-theme="dark"] .amount-negative { color: #f87171; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; }
.badge-status { font-weight: 600; padding: .38em .7em; font-size: .72rem; }
.text-bg-warning.badge-status { color: #78350f !important; }

/* Filters bar ------------------------------------------------------------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.filter-bar .form-control, .filter-bar .form-select { width: auto; min-width: 140px; }
@media (max-width: 575.98px) { .filter-bar .form-control, .filter-bar .form-select { width: 100%; } }

/* Public site ------------------------------------------------------------- */
.navbar-glass {
  background: rgba(255, 255, 255, .72); backdrop-filter: blur(16px) saturate(180%); -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--zen-border);
}
[data-bs-theme="dark"] .navbar-glass { background: rgba(10, 15, 29, .7); }
.navbar-brand { font-weight: 800; letter-spacing: -.02em; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center; color: #fff; font-weight: 800;
  background: linear-gradient(135deg, var(--zen-primary), var(--zen-secondary));
  box-shadow: 0 8px 18px -8px rgba(var(--zen-primary-rgb), .8);
}
.brand-logo { max-height: 36px; width: auto; }
.brand-mark-img { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; box-shadow: 0 8px 18px -8px rgba(var(--zen-primary-rgb), .7); }
.brand-name { white-space: nowrap; }
.brand-logo-dark { display: none; }
[data-bs-theme="dark"] .brand-logo-light { display: none; }
[data-bs-theme="dark"] .brand-logo-dark { display: inline-block; }
.hero {
  position: relative; padding: 7rem 0 5rem; overflow: hidden;
  background:
    radial-gradient(60% 60% at 85% 10%, rgba(var(--zen-primary-rgb), .16), transparent 60%),
    radial-gradient(50% 50% at 10% 30%, color-mix(in srgb, var(--zen-secondary) 18%, transparent), transparent 60%),
    radial-gradient(40% 40% at 60% 90%, color-mix(in srgb, var(--zen-accent) 14%, transparent), transparent 60%);
}
.hero h1 { font-size: clamp(2.2rem, 4.5vw + .5rem, 3.9rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.05; }
.hero .lead { font-size: 1.15rem; color: var(--zen-muted); max-width: 38rem; }
.hero-pill { display: inline-flex; gap: .5rem; align-items: center; padding: .35rem .85rem; border-radius: 999px; font-size: .82rem; font-weight: 600; background: rgba(var(--zen-primary-rgb), .1); color: var(--zen-primary); }
.hero-visual { position: relative; }
.hero-visual .card { border-radius: 22px; }
.hero-visual .floating { position: absolute; animation: zen-float 6s ease-in-out infinite; }
@keyframes zen-float { 50% { transform: translateY(-10px); } }
.section { padding: 5.5rem 0; }
.section-alt { background: var(--zen-surface); border-top: 1px solid var(--zen-border); border-bottom: 1px solid var(--zen-border); }
.section-title { font-weight: 800; letter-spacing: -.025em; font-size: clamp(1.7rem, 2vw + 1rem, 2.4rem); }
.section-kicker { color: var(--zen-primary); font-weight: 700; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; }
.feature-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem; background: rgba(var(--zen-primary-rgb), .1); color: var(--zen-primary); }
.step-number { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--zen-primary), var(--zen-secondary)); }
.plan-card .plan-param { display: flex; justify-content: space-between; padding: .55rem 0; border-bottom: 1px dashed var(--zen-border); font-size: .92rem; }
.plan-card .plan-param:last-child { border-bottom: 0; }
.plan-card { --plan-color: var(--zen-primary); }
.plan-card-accent { border-top: 4px solid var(--plan-color); }
.plan-icon { width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; flex-shrink: 0; color: var(--plan-color); background: color-mix(in srgb, var(--plan-color) 14%, transparent); font-size: 1.2rem; }
.plan-badge { background: color-mix(in srgb, var(--plan-color) 16%, transparent); color: var(--plan-color); border: 1px solid color-mix(in srgb, var(--plan-color) 35%, transparent); font-weight: 600; }
.risk-banner { border-inline-start: 4px solid #f59e0b; background: rgba(245, 158, 11, .08); border-radius: var(--zen-radius-sm); padding: .9rem 1.1rem; font-size: .9rem; }
.trust-strip { display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem; justify-content: center; color: var(--zen-muted); font-weight: 600; }
.cta-band { border-radius: 24px; color: #fff; background: linear-gradient(120deg, var(--zen-primary), color-mix(in srgb, var(--zen-secondary) 85%, #000)); }
.footer { background: var(--zen-surface); border-top: 1px solid var(--zen-border); font-size: .92rem; }
.footer a { color: var(--zen-muted); }
.footer a:hover { color: var(--zen-primary); }
.accordion { --bs-accordion-border-color: var(--zen-border); --bs-accordion-bg: var(--zen-surface); --bs-accordion-active-bg: rgba(var(--zen-primary-rgb), .06); --bs-accordion-active-color: var(--zen-text); --bs-accordion-btn-focus-box-shadow: none; }
.accordion-button { font-weight: 600; }
.prose { line-height: 1.75; max-width: 46rem; }
.prose h2 { font-size: 1.3rem; font-weight: 700; margin-top: 2rem; }
.prose ul { padding-inline-start: 1.25rem; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* Auth -------------------------------------------------------------------- */
.auth-wrapper { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 992px) { .auth-wrapper { grid-template-columns: 1.05fr 1fr; } }
.auth-aside {
  display: none; position: relative; color: #fff; padding: 3rem; overflow: hidden;
  background: radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--zen-primary) 85%, #fff), var(--zen-primary) 45%, #0b1024 110%);
}
@media (min-width: 992px) { .auth-aside { display: flex; flex-direction: column; justify-content: space-between; } }
.auth-aside::before { content: ""; position: absolute; inset: auto -120px -120px auto; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .18), transparent 65%); }
.auth-aside .check-list li { display: flex; gap: .75rem; margin-bottom: 1rem; opacity: .92; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card h1 { font-size: 1.65rem; font-weight: 800; letter-spacing: -.02em; }
.password-toggle { cursor: pointer; }
.strength-meter { height: 6px; border-radius: 6px; background: var(--zen-border); overflow: hidden; }
.strength-meter > span { display: block; height: 100%; width: 0; transition: width .25s, background .25s; }

/* App shell (user & admin) ----------------------------------------------- */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--zen-sidebar-w); z-index: 1040;
  background: var(--zen-surface); border-inline-end: 1px solid var(--zen-border);
  display: flex; flex-direction: column;
}
.sidebar-brand { height: var(--zen-topbar-h); display: flex; align-items: center; gap: .6rem; padding: 0 1.25rem; font-weight: 800; border-bottom: 1px solid var(--zen-border); color: var(--zen-text); }
.sidebar-nav { overflow-y: auto; padding: .75rem .75rem 1.5rem; flex: 1; scrollbar-width: thin; }
.sidebar-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--zen-muted); font-weight: 700; padding: 1rem .75rem .4rem; }
.sidebar-link {
  display: flex; align-items: center; gap: .75rem; padding: .55rem .75rem; border-radius: .65rem; color: var(--zen-text);
  font-weight: 500; font-size: .92rem; transition: background .15s, color .15s;
}
.sidebar-link i { font-size: 1.05rem; color: var(--zen-muted); width: 1.25rem; text-align: center; }
.sidebar-link:hover { background: rgba(var(--zen-primary-rgb), .06); color: var(--zen-primary); }
.sidebar-link.active { background: rgba(var(--zen-primary-rgb), .1); color: var(--zen-primary); font-weight: 600; }
.sidebar-link.active i, .sidebar-link:hover i { color: var(--zen-primary); }
.sidebar-link .badge { margin-inline-start: auto; }
/* Collapsible groups (admin) */
button.sidebar-link { width: 100%; border: 0; background: transparent; text-align: start; }
.sidebar-toggle .sidebar-caret { margin-inline-start: auto; font-size: .75rem; transition: transform .2s ease; }
.sidebar-toggle .badge + .sidebar-caret { margin-inline-start: .4rem; }
.sidebar-toggle:not(.collapsed) .sidebar-caret { transform: rotate(180deg); }
.sidebar-sub { display: grid; gap: .1rem; padding: .15rem 0 .35rem; margin-inline-start: 1.6rem; border-inline-start: 1px solid var(--zen-border); }
.sidebar-sublink { display: flex; align-items: center; gap: .5rem; padding: .38rem .75rem; border-radius: .5rem; color: var(--zen-muted); font-size: .86rem; text-decoration: none; }
.sidebar-sublink:hover { color: var(--zen-primary); background: rgba(var(--zen-primary-rgb), .06); text-decoration: none; }
.sidebar-sublink.active { color: var(--zen-primary); font-weight: 600; background: rgba(var(--zen-primary-rgb), .08); }
.sidebar-sublink .badge { margin-inline-start: auto; }
@media (prefers-reduced-motion: reduce) { .sidebar-toggle .sidebar-caret { transition: none; } }
.sidebar-footer { padding: 1rem; border-top: 1px solid var(--zen-border); }
.app-main { margin-inline-start: var(--zen-sidebar-w); min-width: 0; }
.impersonation-bar { background: #b45309; color: #fff; }
.impersonation-bar .btn-light { color: #7c2d12; font-weight: 600; }
.topbar {
  position: sticky; top: 0; z-index: 1030; height: var(--zen-topbar-h); display: flex; align-items: center; gap: .75rem; padding: 0 1.5rem;
  background: rgba(244, 246, 251, .8); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--zen-border);
}
[data-bs-theme="dark"] .topbar { background: rgba(10, 15, 29, .8); }
.app-content { padding: 1.75rem 1.5rem 6rem; max-width: 1480px; }
.page-header { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; justify-content: space-between; margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.page-header .breadcrumb { margin: 0 0 .25rem; font-size: .8rem; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--zen-shadow-lg); }
  [dir="rtl"] .sidebar { transform: translateX(100%); }
  .sidebar.show { transform: none; }
  .app-main { margin-inline-start: 0; }
  .app-content { padding: 1.25rem 1rem 6.5rem; }
  .topbar { padding: 0 1rem; }
}
.sidebar-backdrop { position: fixed; inset: 0; background: rgba(2, 6, 23, .45); z-index: 1035; display: none; }
.sidebar-backdrop.show { display: block; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: .85rem; color: #fff; background: linear-gradient(135deg, var(--zen-primary), var(--zen-secondary)); flex-shrink: 0; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.3rem; }
.avatar-sm { width: 28px; height: 28px; font-size: .7rem; }
.dropdown-menu { border: 1px solid var(--zen-border); border-radius: 14px; box-shadow: var(--zen-shadow-lg); padding: .5rem; }
.dropdown-item { border-radius: .5rem; padding: .5rem .75rem; }
.notif-dropdown { width: min(380px, 92vw); }
.notif-item { display: flex; gap: .75rem; padding: .65rem .5rem; border-radius: .6rem; color: inherit; }
.notif-item:hover { background: rgba(var(--zen-primary-rgb), .05); }
.notif-item.unread { background: rgba(var(--zen-primary-rgb), .06); }
.notif-dot { position: absolute; top: 8px; inset-inline-end: 8px; width: 9px; height: 9px; border-radius: 50%; background: #ef4444; border: 2px solid var(--zen-surface); }

/* Mobile bottom navigation */
.bottom-nav {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 1030; display: none; height: 64px;
  background: var(--zen-surface); border-top: 1px solid var(--zen-border); padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .68rem; color: var(--zen-muted); font-weight: 600; }
.bottom-nav a i { font-size: 1.25rem; }
.bottom-nav a.active { color: var(--zen-primary); }
@media (max-width: 991.98px) { .bottom-nav { display: flex; } }

/* Misc components --------------------------------------------------------- */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--zen-muted); }
.empty-state i { font-size: 2.4rem; display: block; margin-bottom: .75rem; opacity: .55; }
.list-kv { display: grid; grid-template-columns: minmax(120px, 40%) 1fr; gap: .55rem 1rem; font-size: .92rem; margin: 0; }
.list-kv dt { color: var(--zen-muted); font-weight: 500; }
.list-kv dd { margin: 0; word-break: break-word; }
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline li { position: relative; padding-inline-start: 1.75rem; padding-bottom: 1.1rem; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: 6px; top: 8px; bottom: -4px; width: 2px; background: var(--zen-border); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; inset-inline-start: 0; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--zen-surface); border: 3px solid var(--zen-primary); }
.copy-field { display: flex; gap: .5rem; align-items: center; background: var(--zen-surface-2); border: 1px dashed var(--zen-border); padding: .6rem .8rem; border-radius: .7rem; }
.copy-field code { flex: 1; overflow-wrap: anywhere; color: var(--zen-text); }
.qr-box { background: #fff; padding: 12px; border-radius: 14px; display: inline-block; border: 1px solid var(--zen-border); }
.qr-box canvas, .qr-box img, .qr-box svg { display: block; }
.progress { height: .55rem; border-radius: 99px; background: var(--zen-border); }
.progress-bar { background: linear-gradient(90deg, var(--zen-primary), var(--zen-secondary)); }
.risk-meter { height: 8px; border-radius: 8px; background: linear-gradient(90deg, #10b981, #f59e0b 50%, #ef4444); position: relative; }
.risk-meter span { position: absolute; top: -4px; width: 4px; height: 16px; background: var(--zen-text); border-radius: 2px; }
.demo-banner { background: repeating-linear-gradient(45deg, #f59e0b, #f59e0b 12px, #fbbf24 12px, #fbbf24 24px); color: #1f2937; font-weight: 700; text-align: center; padding: .35rem; font-size: .8rem; }
.nav-tabs-zen { border-bottom: 1px solid var(--zen-border); gap: .25rem; flex-wrap: nowrap; overflow-x: auto; }
.nav-tabs-zen .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--zen-muted); font-weight: 600; border-radius: 0; white-space: nowrap; }
.nav-tabs-zen .nav-link.active { color: var(--zen-primary); border-bottom-color: var(--zen-primary); background: transparent; }
.chart-wrap { position: relative; height: 280px; }
.chart-wrap.sm { height: 200px; }
.cookie-consent { position: fixed; inset-inline: 1rem; bottom: 1rem; z-index: 1080; max-width: 560px; }
@media (max-width: 991.98px) { .app-shell ~ .cookie-consent, .has-bottom-nav .cookie-consent { bottom: 76px; } }
.toast-container { z-index: 1090; }
.pagination { --bs-pagination-border-radius: .6rem; --bs-pagination-active-bg: var(--zen-primary); --bs-pagination-active-border-color: var(--zen-primary); margin: 0; }

/* Affiliate tree ---------------------------------------------------------- */
.tree-canvas { position: relative; height: 640px; border-radius: var(--zen-radius); overflow: hidden; cursor: grab; touch-action: none;
  background: radial-gradient(circle at 1px 1px, var(--zen-border) 1px, transparent 0) 0 0 / 22px 22px, var(--zen-surface-2); }
.tree-canvas.is-panning { cursor: grabbing; }
.tree-canvas svg { width: 100%; height: 100%; user-select: none; }
.tree-node rect.node-bg { fill: var(--zen-surface); stroke: var(--zen-border); stroke-width: 1.2; }
.tree-node.is-root rect.node-bg { stroke: var(--zen-primary); stroke-width: 2; }
.tree-node.is-selected rect.node-bg { stroke: var(--zen-accent); stroke-width: 2.5; }
.tree-node.is-highlight rect.node-bg { stroke: #f59e0b; stroke-width: 3; }
.tree-node text { fill: var(--zen-text); font-family: var(--zen-font); }
.tree-node text.muted { fill: var(--zen-muted); }
.tree-node .toggle { cursor: pointer; }
.tree-node .toggle circle { fill: var(--zen-primary); }
.tree-node .toggle text { fill: #fff; font-weight: 700; }
.tree-link { fill: none; stroke: color-mix(in srgb, var(--zen-primary) 40%, var(--zen-border)); stroke-width: 1.6; }
.tree-toolbar { position: absolute; top: 12px; inset-inline-end: 12px; display: flex; gap: .4rem; z-index: 2; }
.tree-empty-slot rect { fill: transparent; stroke: var(--zen-border); stroke-dasharray: 4 4; }

/* Errors ------------------------------------------------------------------ */
.error-page { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 2rem; }
.error-code { font-size: clamp(5rem, 14vw, 9rem); font-weight: 900; letter-spacing: -.05em; line-height: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
@media print {
  .sidebar, .topbar, .bottom-nav, .btn, .cookie-consent { display: none !important; }
  .app-main { margin: 0 !important; }
}

/* Admin global search */
.topbar-search { flex: 1 1 auto; max-width: 420px; margin-inline: .75rem; }
.topbar-search .form-control { padding-inline-start: 2rem; border-radius: 999px; background: var(--zen-surface-2, var(--bs-tertiary-bg)); }
.topbar-search-icon { position: absolute; inset-inline-start: .75rem; top: 50%; transform: translateY(-50%); color: var(--zen-muted); font-size: .85rem; pointer-events: none; }
.topbar-search .dropdown-menu { max-height: 70vh; overflow-y: auto; inset-inline-start: 0; top: 100%; margin-top: .35rem; }
.topbar-title { max-width: 220px; }
.min-w-0 { min-width: 0; }
