/* ==========================================================================
   rAIku — elegant, mobile-first design system (on top of Bootstrap 5.3).
   Dark by default; [data-bs-theme="light"] (set by theme.js / the theme toggle) swaps the palette below.
   ========================================================================== */
:root,
[data-bs-theme="dark"] {
  --rk-bg: #050a17;
  --rk-bg-soft: #08101f;
  --rk-surface: #0d1526;
  --rk-surface-2: #121c31;
  --rk-surface-3: #19253d;
  --rk-border: rgba(var(--rk-ink-rgb), 0.07);
  --rk-border-strong: rgba(var(--rk-ink-rgb), 0.12);
  --rk-text: #e8eaf0;
  --rk-muted: #8b97b0;
  --rk-faint: #5b6782;
  --rk-primary: #2f7bff;
  --rk-primary-rgb: 47, 123, 255;
  --rk-accent: #00d9ff;
  --rk-gradient: linear-gradient(135deg, #1f5fff 0%, #1a9bff 55%, #00e5ff 100%);
  --rk-accent-rgb: 0, 217, 255;
  --rk-success: #34d399;
  --rk-warning: #fbbf24;
  --rk-danger: #f87171;
  --rk-info: #60a5fa;
  --rk-radius: 16px;
  --rk-radius-sm: 10px;
  --rk-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  --rk-bottom-nav: 68px;
  /* Theme-dependent helpers: RGB triplets for translucent layers, and text tints. */
  --rk-bg-rgb: 5, 10, 23;
  --rk-surface-rgb: 13, 21, 38;
  --rk-surface-2-rgb: 18, 28, 49;
  --rk-ink-rgb: 255, 255, 255;
  --rk-strong: #fff;
  --rk-text-soft: #cfd3de;
  --rk-primary-soft: #8cc4ff;
  --rk-accent-soft: #7fd8ff;
  --rk-amber-soft: #ffd98a;
  --rk-orange-soft: #ffb36b;
  --rk-code-text: #d6ecff;

  --bs-body-bg: var(--rk-bg);
  --bs-body-color: var(--rk-text);
  --bs-body-font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-border-color: var(--rk-border);
  --bs-secondary-color: var(--rk-muted);
  --bs-tertiary-bg: var(--rk-surface-2);
  --bs-primary: var(--rk-primary);
  --bs-primary-rgb: var(--rk-primary-rgb);
  --bs-link-color: #6fb1ff;
  --bs-link-hover-color: #a8d2ff;
  --bs-link-color-rgb: 111, 177, 255;
  --bs-emphasis-color: #fff;
  --bs-heading-color: #f4f5f8;
}

html { -webkit-tap-highlight-color: transparent; }
body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(47, 123, 255, 0.08), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(0, 217, 255, 0.05), transparent 60%),
    var(--rk-bg);
  background-attachment: fixed;
  letter-spacing: -0.005em;
}
::selection { background: rgba(var(--rk-primary-rgb), 0.35); }
a { text-decoration: none; }
.text-muted, .text-secondary { color: var(--rk-muted) !important; }
.text-faint { color: var(--rk-faint) !important; }
.fw-800 { font-weight: 800; }
.mono { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; }
.tabular { font-variant-numeric: tabular-nums; }
.text-gradient { background: var(--rk-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.small-caps { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; color: var(--rk-muted); }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; line-height: 0; flex-shrink: 0; }
.brand-logo { height: 28px; width: auto; display: block; filter: drop-shadow(0 4px 14px rgba(var(--rk-primary-rgb), .35)); transition: filter .2s; }
.brand:hover .brand-logo { filter: drop-shadow(0 4px 18px rgba(var(--rk-accent-rgb), .55)); }
.brand.lg .brand-logo { height: 40px; }

/* ---------- Surfaces ---------- */
.card, .rk-card {
  --bs-card-bg: var(--rk-surface);
  --bs-card-border-color: var(--rk-border);
  --bs-card-border-radius: var(--rk-radius);
  --bs-card-cap-bg: transparent;
  background: var(--rk-surface);
  border: 1px solid var(--rk-border);
  border-radius: var(--rk-radius);
}
.rk-card { padding: 1.25rem; }
.card-header { border-bottom-color: var(--rk-border); padding: 1rem 1.25rem; }
.rk-card-title { font-weight: 700; font-size: 1rem; margin: 0; }
.surface-2 { background: var(--rk-surface-2) !important; }
.border-soft { border-color: var(--rk-border) !important; }
.hover-lift { transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.hover-lift:hover { transform: translateY(-2px); border-color: var(--rk-border-strong); box-shadow: var(--rk-shadow); }

/* ---------- Buttons ---------- */
.btn { --bs-btn-border-radius: 12px; --bs-btn-font-weight: 600; --bs-btn-padding-y: .6rem; --bs-btn-padding-x: 1.1rem; }
.btn-sm { --bs-btn-border-radius: 9px; --bs-btn-padding-y: .35rem; --bs-btn-padding-x: .75rem; }
.btn-lg { --bs-btn-border-radius: 14px; --bs-btn-padding-y: .85rem; --bs-btn-padding-x: 1.5rem; }
.btn-primary {
  --bs-btn-bg: var(--rk-primary); --bs-btn-border-color: var(--rk-primary);
  --bs-btn-hover-bg: #1f6af0; --bs-btn-hover-border-color: #1f6af0;
  --bs-btn-active-bg: #1659d6; --bs-btn-active-border-color: #1659d6;
  --bs-btn-disabled-bg: var(--rk-primary); --bs-btn-disabled-border-color: var(--rk-primary);
}
.btn-gradient {
  background: var(--rk-gradient); color: #fff; border: 0; font-weight: 700;
  box-shadow: 0 10px 28px -12px rgba(47, 123, 255, .8);
}
.btn-gradient:hover, .btn-gradient:focus { color: #fff; filter: brightness(1.08); }
.btn-soft { background: var(--rk-surface-2); border: 1px solid var(--rk-border); color: var(--rk-text); }
.btn-soft:hover, .btn-soft:focus { background: var(--rk-surface-3); color: var(--rk-strong); border-color: var(--rk-border-strong); }
.btn-ghost { background: transparent; border: 1px solid transparent; color: var(--rk-muted); }
.btn-ghost:hover { color: var(--rk-strong); background: var(--rk-surface-2); }
.btn-icon { width: 40px; height: 40px; padding: 0; display: inline-grid; place-items: center; border-radius: 12px; }
.btn-danger-soft { background: rgba(248, 113, 113, .1); color: var(--rk-danger); border: 1px solid rgba(248, 113, 113, .2); }
.btn-danger-soft:hover { background: rgba(248, 113, 113, .18); color: #fca5a5; }

/* ---------- Forms ---------- */
.form-control, .form-select {
  background-color: var(--rk-bg-soft); border-color: var(--rk-border-strong); color: var(--rk-text);
  border-radius: 12px; padding: .7rem .9rem;
}
.form-control:focus, .form-select:focus {
  background-color: var(--rk-bg-soft); color: var(--rk-strong); border-color: rgba(var(--rk-primary-rgb), .6);
  box-shadow: 0 0 0 .2rem rgba(var(--rk-primary-rgb), .18);
}
.form-control::placeholder { color: var(--rk-faint); }
.form-label { font-size: .85rem; font-weight: 600; color: var(--rk-text-soft); margin-bottom: .4rem; }
.form-text { color: var(--rk-faint); }
.form-check-input { background-color: var(--rk-bg-soft); border-color: var(--rk-border-strong); }
.form-check-input:checked { background-color: var(--rk-primary); border-color: var(--rk-primary); }
.input-group-text { background: var(--rk-surface-2); border-color: var(--rk-border-strong); color: var(--rk-muted); border-radius: 12px; }
.password-toggle { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); }

/* ---------- Badges ---------- */
.badge-soft { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; border: 1px solid transparent; }
.badge-soft.success { background: rgba(52, 211, 153, .1); color: var(--rk-success); border-color: rgba(52, 211, 153, .2); }
.badge-soft.warning { background: rgba(251, 191, 36, .1); color: var(--rk-warning); border-color: rgba(251, 191, 36, .2); }
.badge-soft.danger { background: rgba(248, 113, 113, .1); color: var(--rk-danger); border-color: rgba(248, 113, 113, .2); }
.badge-soft.info { background: rgba(96, 165, 250, .1); color: var(--rk-info); border-color: rgba(96, 165, 250, .2); }
.badge-soft.primary { background: rgba(var(--rk-primary-rgb), .12); color: var(--rk-primary-soft); border-color: rgba(var(--rk-primary-rgb), .25); }
.badge-soft.muted { background: var(--rk-surface-2); color: var(--rk-muted); border-color: var(--rk-border); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: currentColor; }
.dot.pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 currentColor; } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; --bs-table-border-color: var(--rk-border); --bs-table-hover-bg: rgba(var(--rk-ink-rgb), .025); color: var(--rk-text); margin: 0; }
.table > :not(caption) > * > * { padding: .85rem 1rem; }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--rk-muted); font-weight: 600; border-bottom-color: var(--rk-border-strong); white-space: nowrap; }
.table td { vertical-align: middle; }
.table-responsive { border-radius: var(--rk-radius); }

/* ---------- Flash / toasts ---------- */
.flash-stack { position: fixed; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 1090; width: min(560px, calc(100% - 2rem)); display: grid; gap: .5rem; }
.flash { display: flex; gap: .75rem; align-items: flex-start; padding: .85rem 1rem; border-radius: 14px; background: rgba(var(--rk-surface-2-rgb), .96); border: 1px solid var(--rk-border-strong); box-shadow: var(--rk-shadow); backdrop-filter: blur(12px); animation: slideDown .3s ease; font-size: .92rem; }
.flash .bi { font-size: 1.1rem; line-height: 1.3; }
.flash.success .bi { color: var(--rk-success); } .flash.danger .bi { color: var(--rk-danger); }
.flash.warning .bi { color: var(--rk-warning); } .flash.info .bi { color: var(--rk-info); }
.flash .btn-close { margin-left: auto; filter: invert(1) grayscale(1); opacity: .5; font-size: .7rem; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- Public navbar & footer ---------- */
.public-nav { position: sticky; top: 0; z-index: 1030; backdrop-filter: blur(16px); background: rgba(var(--rk-bg-rgb), .72); border-bottom: 1px solid var(--rk-border); }
.public-nav .nav-link { color: var(--rk-muted); font-weight: 500; font-size: .93rem; }
.public-nav .nav-link:hover, .public-nav .nav-link.active { color: var(--rk-strong); }
.site-footer { border-top: 1px solid var(--rk-border); color: var(--rk-muted); font-size: .9rem; }
.site-footer a { color: var(--rk-muted); } .site-footer a:hover { color: var(--rk-strong); }

/* ---------- Landing ---------- */
.hero { padding: 4.5rem 0 3rem; position: relative; }
.hero h1 { font-size: clamp(2.1rem, 6vw, 3.9rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; }
.hero .lead { color: var(--rk-muted); font-size: clamp(1rem, 2.4vw, 1.2rem); max-width: 560px; }
.hero-pill { display: inline-flex; gap: .5rem; align-items: center; padding: .35rem .8rem .35rem .4rem; border-radius: 999px; background: var(--rk-surface); border: 1px solid var(--rk-border-strong); font-size: .82rem; color: var(--rk-text-soft); }
.hero-pill .tag { background: var(--rk-gradient); color: #fff; padding: .1rem .5rem; border-radius: 999px; font-weight: 700; font-size: .72rem; }
.hero-visual { position: relative; }
.hero-visual::before { content: ""; position: absolute; inset: 10% 5%; background: var(--rk-gradient); filter: blur(80px); opacity: .25; border-radius: 50%; }
.mock-window { position: relative; background: var(--rk-surface); border: 1px solid var(--rk-border-strong); border-radius: 20px; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8); overflow: hidden; }
.mock-bar { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1rem; border-bottom: 1px solid var(--rk-border); background: var(--rk-surface-2); }
.mock-dots span { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 5px; background: var(--rk-surface-3); }
.mock-timer { font-weight: 700; font-size: .85rem; padding: .25rem .6rem; border-radius: 999px; background: rgba(52, 211, 153, .1); color: var(--rk-success); }
.mock-body { padding: 1.1rem; display: grid; gap: .75rem; }
.bubble { padding: .7rem .95rem; border-radius: 16px; max-width: 85%; font-size: .9rem; line-height: 1.5; }
.bubble.user { background: rgba(var(--rk-primary-rgb), .18); border: 1px solid rgba(var(--rk-primary-rgb), .25); margin-left: auto; border-bottom-right-radius: 6px; }
.bubble.ai { background: var(--rk-surface-2); border: 1px solid var(--rk-border); border-bottom-left-radius: 6px; }
.section { padding: 4rem 0; }
.section-title { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; letter-spacing: -0.03em; }
.section-sub { color: var(--rk-muted); max-width: 620px; margin-inline: auto; }
.feature-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.25rem; background: rgba(var(--rk-primary-rgb), .12); color: var(--rk-primary-soft); border: 1px solid rgba(var(--rk-primary-rgb), .2); }
.step-num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--rk-gradient); color: #fff; font-size: .9rem; flex-shrink: 0; }
.stat-strip { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (min-width: 768px) { .stat-strip { grid-template-columns: repeat(4, 1fr); } }
.cta-panel { background: linear-gradient(135deg, rgba(47, 123, 255, .16), rgba(0, 217, 255, .08)); border: 1px solid rgba(var(--rk-primary-rgb), .25); border-radius: 24px; }
.faq .accordion-item { background: var(--rk-surface); border: 1px solid var(--rk-border); border-radius: 14px !important; margin-bottom: .6rem; overflow: hidden; }
.faq .accordion-button { background: transparent; color: var(--rk-text); font-weight: 600; box-shadow: none; }
.faq .accordion-button:not(.collapsed) { color: var(--rk-strong); }
.faq .accordion-button::after { filter: invert(1) grayscale(1); }
.faq .accordion-body { color: var(--rk-muted); padding-top: 0; }

/* ---------- Packages ---------- */
.package-card { position: relative; height: 100%; padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.package-card.featured { border-color: rgba(var(--rk-primary-rgb), .5); background: linear-gradient(180deg, rgba(47, 123, 255, .1), var(--rk-surface) 55%); box-shadow: 0 20px 50px -25px rgba(47, 123, 255, .6); }
.package-card .ribbon { position: absolute; top: -11px; right: 1.25rem; background: var(--rk-gradient); color: #fff; padding: .2rem .7rem; border-radius: 999px; font-size: .72rem; font-weight: 800; }
.package-icon { font-size: 1.6rem; }
.package-price { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; }
.package-meta li { color: var(--rk-muted); font-size: .9rem; display: flex; gap: .5rem; align-items: center; padding: .2rem 0; }
.package-meta .bi { color: var(--rk-accent); }

/* ---------- App shell (user) ---------- */
.app-topbar { position: sticky; top: 0; z-index: 1030; backdrop-filter: blur(16px); background: rgba(var(--rk-bg-rgb), .8); border-bottom: 1px solid var(--rk-border); }
.app-topbar .nav-link { color: var(--rk-muted); font-weight: 600; font-size: .92rem; padding: .5rem .85rem !important; border-radius: 10px; }
.app-topbar .nav-link:hover { color: var(--rk-strong); }
.app-topbar .nav-link.active { color: var(--rk-strong); background: var(--rk-surface-2); }
.app-main { padding: 1.25rem 0 calc(var(--rk-bottom-nav) + 1.5rem); }
@media (min-width: 992px) { .app-main { padding: 2rem 0 3rem; } }
.notif-btn { position: relative; }
.notif-btn .count { position: absolute; top: 4px; right: 4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--rk-danger); color: #fff; font-size: .65rem; font-weight: 700; display: grid; place-items: center; }
.avatar { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; background: var(--rk-surface-3); color: var(--rk-text-soft); border: 1px solid var(--rk-border-strong); font-size: .9rem; }

.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 1040; height: calc(var(--rk-bottom-nav) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(4, 1fr); background: rgba(var(--rk-bg-rgb), .92); backdrop-filter: blur(18px); border-top: 1px solid var(--rk-border); }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; color: var(--rk-faint); font-size: .7rem; font-weight: 600; }
.bottom-nav a .bi { font-size: 1.3rem; }
.bottom-nav a.active { color: var(--rk-strong); }
.bottom-nav a.active .bi { background: var(--rk-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bottom-nav .nav-ai { position: relative; }

/* ---------- Dashboard ---------- */
.balance-card { position: relative; overflow: hidden; padding: 1.5rem; border-radius: 22px; background: linear-gradient(140deg, #0d2150 0%, #0b1a3a 50%, #04263a 100%); border: 1px solid rgba(var(--rk-primary-rgb), .3); }
.balance-card::after { content: ""; position: absolute; width: 260px; height: 260px; right: -80px; top: -100px; background: var(--rk-gradient); filter: blur(70px); opacity: .28; }
.balance-time { font-size: clamp(2.6rem, 11vw, 3.6rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.balance-card > * { position: relative; z-index: 1; }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.mini-stat { padding: 1rem; border-radius: 14px; background: var(--rk-surface); border: 1px solid var(--rk-border); }
.mini-stat .value { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; }
.activity-item { display: flex; align-items: center; gap: .85rem; padding: .85rem 0; border-bottom: 1px solid var(--rk-border); }
.activity-item:last-child { border-bottom: 0; }
.activity-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; font-size: 1rem; }
.activity-icon.plus { background: rgba(52, 211, 153, .1); color: var(--rk-success); }
.activity-icon.minus { background: rgba(var(--rk-primary-rgb), .12); color: var(--rk-primary-soft); }
.activity-icon.neutral { background: var(--rk-surface-2); color: var(--rk-muted); }
.amount-plus { color: var(--rk-success); } .amount-minus { color: var(--rk-primary-soft); }
.session-banner { display: flex; align-items: center; gap: .85rem; padding: .9rem 1rem; border-radius: 14px; background: rgba(52, 211, 153, .07); border: 1px solid rgba(52, 211, 153, .2); }

/* ---------- Page header ---------- */
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-header h1 { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.025em; margin: 0; }
.page-header p { margin: .2rem 0 0; color: var(--rk-muted); font-size: .9rem; }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--rk-muted); }
.empty-state .bi { font-size: 2.2rem; color: var(--rk-faint); display: block; margin-bottom: .75rem; }
.filter-pills { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.filter-pills::-webkit-scrollbar { display: none; }
.filter-pills a { white-space: nowrap; padding: .4rem .85rem; border-radius: 999px; font-size: .82rem; font-weight: 600; color: var(--rk-muted); background: var(--rk-surface); border: 1px solid var(--rk-border); }
.filter-pills a.active, .filter-pills a:hover { color: var(--rk-strong); border-color: rgba(var(--rk-primary-rgb), .45); background: rgba(var(--rk-primary-rgb), .12); }
.list-row { display: flex; align-items: center; gap: .85rem; padding: .95rem 1.1rem; border-bottom: 1px solid var(--rk-border); }
.list-row:last-child { border-bottom: 0; }
.pagination { --bs-pagination-bg: var(--rk-surface); --bs-pagination-border-color: var(--rk-border); --bs-pagination-color: var(--rk-muted); --bs-pagination-hover-bg: var(--rk-surface-2); --bs-pagination-hover-color: var(--rk-strong); --bs-pagination-hover-border-color: var(--rk-border); --bs-pagination-active-bg: var(--rk-primary); --bs-pagination-active-border-color: var(--rk-primary); --bs-pagination-disabled-bg: var(--rk-surface); --bs-pagination-disabled-color: var(--rk-faint); --bs-pagination-disabled-border-color: var(--rk-border); --bs-pagination-border-radius: 10px; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 440px; padding: 2rem 1.5rem; }
@media (min-width: 576px) { .auth-card { padding: 2.5rem 2.25rem; } }
.auth-card h1 { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.025em; }
.divider-text { display: flex; align-items: center; gap: .75rem; color: var(--rk-faint); font-size: .8rem; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--rk-border); }

/* ---------- Checkout / payment ---------- */
.qr-frame { background: #fff; padding: 14px; border-radius: 18px; width: min(260px, 100%); margin-inline: auto; box-shadow: 0 20px 60px -25px rgba(47, 123, 255, .7); }
.qr-frame img { width: 100%; height: auto; display: block; }
.qris-label { font-weight: 800; letter-spacing: .12em; color: #0a0b10; text-align: center; font-size: .8rem; margin-top: 6px; }
.countdown-chip { display: inline-flex; gap: .4rem; align-items: center; padding: .35rem .8rem; border-radius: 999px; background: rgba(251, 191, 36, .1); color: var(--rk-warning); font-weight: 700; font-size: .85rem; }
.summary-row { display: flex; justify-content: space-between; padding: .55rem 0; color: var(--rk-muted); font-size: .92rem; }
.summary-row strong { color: var(--rk-text); }
.summary-total { border-top: 1px dashed var(--rk-border-strong); margin-top: .5rem; padding-top: .85rem; font-size: 1.05rem; }
.success-check { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto; font-size: 2.2rem; background: rgba(52, 211, 153, .12); color: var(--rk-success); border: 1px solid rgba(52, 211, 153, .3); animation: pop .4s ease; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- Admin shell ---------- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: 252px; flex-shrink: 0; background: var(--rk-bg-soft); border-right: 1px solid var(--rk-border); position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 1.25rem .85rem; }
.admin-sidebar .nav-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--rk-faint); font-weight: 700; padding: 1rem .75rem .4rem; }
.admin-sidebar .nav-link { display: flex; align-items: center; gap: .7rem; color: var(--rk-muted); font-weight: 500; font-size: .9rem; padding: .55rem .75rem; border-radius: 10px; }
.admin-sidebar .nav-link .bi { font-size: 1.05rem; }
.admin-sidebar .nav-link:hover { color: var(--rk-strong); background: var(--rk-surface); }
.admin-sidebar .nav-link.active { color: var(--rk-strong); background: rgba(var(--rk-primary-rgb), .14); }
.admin-sidebar .nav-link.active .bi { color: var(--rk-primary-soft); }
.admin-content { flex: 1; min-width: 0; }
.admin-topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; background: rgba(var(--rk-bg-rgb), .85); backdrop-filter: blur(14px); border-bottom: 1px solid var(--rk-border); }
.admin-main { padding: 1.25rem 1rem 3rem; }
@media (min-width: 992px) { .admin-main { padding: 1.75rem 2rem 3rem; } }
.offcanvas { --bs-offcanvas-bg: var(--rk-bg-soft); --bs-offcanvas-border-color: var(--rk-border); }
.kpi { padding: 1.1rem 1.2rem; height: 100%; }
.kpi .label { font-size: .78rem; color: var(--rk-muted); font-weight: 600; display: flex; align-items: center; gap: .4rem; }
.kpi .value { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.03em; margin-top: .3rem; }
.kpi .hint { font-size: .78rem; color: var(--rk-faint); }
.bar-chart { display: flex; align-items: flex-end; gap: 4px; height: 160px; padding-top: 10px; }
.bar-chart .bar { flex: 1; min-width: 4px; background: var(--rk-gradient); border-radius: 5px 5px 2px 2px; opacity: .9; position: relative; min-height: 2px; transition: opacity .2s; }
.bar-chart .bar:hover { opacity: 1; }
.bar-chart .bar.zero { background: var(--rk-surface-3); }
.bar-labels { display: flex; gap: 4px; margin-top: 6px; }
.bar-labels span { flex: 1; text-align: center; font-size: .62rem; color: var(--rk-faint); }
.pnl-row { display: flex; justify-content: space-between; padding: .55rem 0; font-size: .92rem; }
.pnl-row.total { border-top: 1px solid var(--rk-border-strong); margin-top: .35rem; padding-top: .8rem; font-weight: 800; font-size: 1.05rem; }
.progress { --bs-progress-bg: var(--rk-surface-3); --bs-progress-bar-bg: var(--rk-primary); height: 8px; border-radius: 99px; }
.progress-bar { background: var(--rk-gradient); }
.key-value dt { font-size: .78rem; color: var(--rk-muted); font-weight: 600; }
.key-value dd { margin-bottom: .85rem; }
.code-block { background: var(--rk-bg-soft); border: 1px solid var(--rk-border); border-radius: 10px; padding: .75rem; font-size: .78rem; white-space: pre-wrap; word-break: break-all; color: var(--rk-text-soft); max-height: 240px; overflow: auto; }
.modal-content { background: var(--rk-surface); border: 1px solid var(--rk-border-strong); border-radius: 20px; }
.modal-header, .modal-footer { border-color: var(--rk-border); }
.dropdown-menu { --bs-dropdown-bg: var(--rk-surface-2); --bs-dropdown-border-color: var(--rk-border-strong); --bs-dropdown-link-color: var(--rk-text); --bs-dropdown-link-hover-bg: var(--rk-surface-3); --bs-dropdown-link-hover-color: var(--rk-strong); --bs-dropdown-link-active-bg: var(--rk-primary); border-radius: 14px; padding: .4rem; box-shadow: var(--rk-shadow); }
.dropdown-item { border-radius: 9px; padding: .5rem .75rem; font-size: .9rem; }

/* ---------- Utilities ---------- */
.w-fit { width: fit-content; }
.min-w-0 { min-width: 0; }
.text-truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cursor-pointer { cursor: pointer; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Grid children must be allowed to shrink, otherwise truncated text widens the column. */
.d-grid { grid-template-columns: minmax(0, 1fr); }
.quick-actions .btn { white-space: nowrap; }
@media (max-width: 400px) { .quick-actions .btn-lg { --bs-btn-padding-x: .75rem; font-size: 1rem; } }
.admin-thumb { display: block; aspect-ratio: 4 / 3; background: var(--rk-surface-2); border-bottom: 1px solid var(--rk-border); }
.admin-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.place-items-center { place-items: center; }

/* ---------- Decorative page background (public & auth pages) ---------- */
.page-aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: var(--rk-bg); }
.page-aurora .blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; will-change: transform; }
.page-aurora .b1 { width: 620px; height: 620px; left: -160px; top: -180px; background: radial-gradient(circle, #1f5fff 0%, transparent 65%); animation: drift1 26s ease-in-out infinite alternate; }
.page-aurora .b2 { width: 560px; height: 560px; right: -180px; top: 12%; background: radial-gradient(circle, #00c8ff 0%, transparent 65%); opacity: .38; animation: drift2 30s ease-in-out infinite alternate; }
.page-aurora .b3 { width: 700px; height: 700px; left: 30%; bottom: -380px; background: radial-gradient(circle, #3b2bff 0%, transparent 62%); opacity: .3; animation: drift3 34s ease-in-out infinite alternate; }
.page-aurora .grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(120, 170, 255, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(120, 170, 255, .06) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}
.page-aurora .stars {
  position: absolute; inset: 0; opacity: .55;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 78% 12%, #cfe6ff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 34% 72%, #9fd8ff 50%, transparent 51%), radial-gradient(1px 1px at 62% 44%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 66%, #cfe6ff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 22% 48%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 50% 88%, #9fd8ff 50%, transparent 51%), radial-gradient(1px 1px at 92% 34%, #fff 50%, transparent 51%);
  background-size: 640px 640px; animation: twinkle 6s ease-in-out infinite alternate;
}
.page-aurora .noise { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 120%, rgba(0, 0, 0, .65), transparent 60%); }
@keyframes drift1 { to { transform: translate(140px, 90px) scale(1.1); } }
@keyframes drift2 { to { transform: translate(-120px, 120px) scale(.92); } }
@keyframes drift3 { to { transform: translate(-160px, -80px) scale(1.08); } }
@keyframes twinkle { from { opacity: .35; } to { opacity: .7; } }
.auth-wrap { position: relative; }
.auth-card { background: rgba(var(--rk-surface-rgb), .78); backdrop-filter: blur(18px); border-color: rgba(120, 170, 255, .14); box-shadow: 0 30px 80px -40px rgba(var(--rk-primary-rgb), .55); }

/* ---------- Voucher access ---------- */
.voucher-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.5rem; color: #fff; background: var(--rk-gradient); box-shadow: 0 12px 30px -12px rgba(var(--rk-primary-rgb), .8); }
.voucher-code-input { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 1.15rem; letter-spacing: .12em; text-transform: uppercase; text-align: center; }
.voucher-banner { display: flex; align-items: center; gap: .85rem; padding: .8rem 1rem; margin-bottom: 1.25rem; border-radius: var(--rk-radius); border: 1px solid rgba(0, 217, 255, .22); background: linear-gradient(120deg, rgba(31, 95, 255, .16), rgba(0, 229, 255, .07)); }
.voucher-banner.ended { border-color: rgba(251, 191, 36, .28); background: linear-gradient(120deg, rgba(251, 191, 36, .12), rgba(251, 191, 36, .03)); }
.voucher-banner .vb-icon { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 1.15rem; background: rgba(var(--rk-ink-rgb), .06); color: var(--rk-accent); }
.voucher-banner.ended .vb-icon { color: var(--rk-warning); }
.voucher-banner .vb-text { min-width: 0; flex: 1 1 auto; font-size: .88rem; }
.voucher-banner .btn { flex: 0 0 auto; }
@media (max-width: 575.98px) { .voucher-banner { flex-wrap: wrap; } .voucher-banner .btn { width: 100%; } }
.voucher-code { font-family: "JetBrains Mono", ui-monospace, monospace; font-weight: 700; letter-spacing: .06em; white-space: nowrap; }
.model-check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: .6rem; }
.model-check { display: flex; align-items: flex-start; gap: .6rem; padding: .7rem .85rem; border-radius: var(--rk-radius-sm); border: 1px solid var(--rk-border-strong); background: var(--rk-surface-2); cursor: pointer; }
.model-check:has(input:checked) { border-color: rgba(var(--rk-primary-rgb), .7); background: rgba(var(--rk-primary-rgb), .1); }
.model-check input { margin-top: .2rem; }

/* ---------- AI vendor marks (text badges, not official logos) ---------- */
.vendor-mark { display: inline-grid; place-items: center; flex: 0 0 auto; width: 1.45em; height: 1.45em; border-radius: .42em; font-size: .78em; font-weight: 800; line-height: 1; color: #fff; letter-spacing: -.02em; background: var(--rk-gradient); }
.vendor-mark.lg { width: 44px; height: 44px; border-radius: 13px; font-size: 1.05rem; box-shadow: 0 10px 26px -12px currentColor; }
.vendor-openai { background: linear-gradient(135deg, #10a37f, #0b7a5f); }
.vendor-google { background: linear-gradient(135deg, #4285f4, #9b72cb 60%, #d96570); }
.vendor-anthropic { background: linear-gradient(135deg, #d97757, #b4563a); }
.vendor-xai { background: linear-gradient(135deg, #3a3f4b, #111318); border: 1px solid rgba(255, 255, 255, .18); }
.vendor-deepseek { background: linear-gradient(135deg, #4d6bfe, #2f47c9); }
.vendor-meta { background: linear-gradient(135deg, #0866ff, #0a4fc4); }
.vendor-mistral { background: linear-gradient(135deg, #fa520f, #d93a00); }
.vendor-other { background: var(--rk-gradient); }
.tier-badge { display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .55rem; border-radius: 999px; font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--rk-amber-soft); background: linear-gradient(135deg, rgba(251, 191, 36, .2), rgba(245, 158, 11, .08)); border: 1px solid rgba(251, 191, 36, .35); }
.model-row { display: flex; align-items: center; gap: .75rem; }

/* ---------- Viral prompt gallery ---------- */
.prompt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 1rem; }
.prompt-card { display: flex; flex-direction: column; border-radius: var(--rk-radius); overflow: hidden; background: var(--rk-surface); border: 1px solid var(--rk-border); transition: transform .2s, border-color .2s; }
.prompt-card:hover { transform: translateY(-3px); border-color: rgba(var(--rk-primary-rgb), .45); }
.prompt-thumb { position: relative; aspect-ratio: 4 / 3; background: var(--rk-surface-2); overflow: hidden; }
.prompt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prompt-thumb-empty { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.2rem; color: rgba(255, 255, 255, .55); background: radial-gradient(circle at 30% 20%, rgba(0, 229, 255, .35), transparent 55%), radial-gradient(circle at 80% 90%, rgba(59, 43, 255, .5), transparent 60%), var(--rk-surface-2); }
.prompt-badges { position: absolute; top: .6rem; left: .6rem; right: .6rem; display: flex; justify-content: space-between; gap: .4rem; }
.prompt-badges .badge-soft { background: rgba(var(--rk-bg-rgb), .7); backdrop-filter: blur(6px); }
.viral-badge { display: inline-flex; align-items: center; gap: .3rem; padding: .28rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 800; color: #fff; background: linear-gradient(135deg, #ff7a18, #ff2e63); box-shadow: 0 6px 18px -6px rgba(255, 60, 60, .7); }
.prompt-body { display: flex; flex-direction: column; flex: 1; padding: 1rem; }
.prompt-title { font-size: 1.02rem; font-weight: 800; margin: 0 0 .35rem; letter-spacing: -.01em; }
.prompt-text { font-size: .84rem; color: var(--rk-muted); margin: 0 0 .6rem; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.prompt-tip { font-size: .78rem; color: var(--rk-amber-soft); background: rgba(251, 191, 36, .08); border: 1px solid rgba(251, 191, 36, .18); border-radius: 10px; padding: .4rem .6rem; margin-bottom: .7rem; }
.prompt-actions { display: flex; gap: .5rem; margin-top: auto; }
.rk-icon { width: 1em; height: 1em; display: inline-block; flex-shrink: 0; vertical-align: -.125em; }
.prompt-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.prompt-admin-thumb { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; display: grid; place-items: center; background: var(--rk-surface-2); color: var(--rk-faint); }
.prompt-admin-thumb.lg { width: 96px; height: 96px; }
.prompt-mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
@media (min-width: 576px) { .prompt-mini-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.prompt-mini { position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 1px solid var(--rk-border); border-radius: 12px; overflow: hidden; background: var(--rk-surface-2); color: #fff; text-align: left; }
.prompt-mini img { width: 100%; height: 100%; object-fit: cover; }
.prompt-mini-empty { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.6rem; color: rgba(255, 255, 255, .5); background: radial-gradient(circle at 30% 20%, rgba(0, 229, 255, .3), transparent 60%), var(--rk-surface-2); }
.prompt-mini-label { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.4rem .5rem .45rem; font-size: .72rem; font-weight: 700; line-height: 1.25; background: linear-gradient(transparent, rgba(0, 0, 0, .85)); }
.prompt-mini:hover { border-color: rgba(var(--rk-primary-rgb), .6); }

/* ==========================================================================
   Light theme
   ========================================================================== */
[data-bs-theme="light"] {
  color-scheme: light;
  --rk-bg: #f5f7fb;
  --rk-bg-soft: #eef2f8;
  --rk-surface: #ffffff;
  --rk-surface-2: #f1f4fa;
  --rk-surface-3: #e4e9f2;
  --rk-border: rgba(15, 23, 42, 0.09);
  --rk-border-strong: rgba(15, 23, 42, 0.16);
  --rk-text: #1b2333;
  --rk-muted: #5a6680;
  --rk-faint: #8a94a8;
  --rk-accent: #0891b2;
  --rk-success: #059669;
  --rk-warning: #b45309;
  --rk-danger: #dc2626;
  --rk-info: #2563eb;
  --rk-shadow: 0 12px 32px -16px rgba(15, 23, 42, 0.22);

  --rk-bg-rgb: 245, 247, 251;
  --rk-surface-rgb: 255, 255, 255;
  --rk-surface-2-rgb: 241, 244, 250;
  --rk-ink-rgb: 15, 23, 42;
  --rk-strong: #0b1220;
  --rk-text-soft: #334155;
  --rk-primary-soft: #1d5fd6;
  --rk-accent-soft: #0b7fa6;
  --rk-amber-soft: #92400e;
  --rk-orange-soft: #c2410c;
  --rk-code-text: #1e3a8a;

  --bs-body-bg: var(--rk-bg);
  --bs-body-color: var(--rk-text);
  --bs-border-color: var(--rk-border);
  --bs-secondary-color: var(--rk-muted);
  --bs-tertiary-bg: var(--rk-surface-2);
  --bs-link-color: #1d5fd6;
  --bs-link-hover-color: #1747a6;
  --bs-link-color-rgb: 29, 95, 214;
  --bs-emphasis-color: #0b1220;
  --bs-heading-color: #0b1220;
}
[data-bs-theme="light"] body {
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(47, 123, 255, 0.07), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(0, 217, 255, 0.06), transparent 60%),
    var(--rk-bg);
}
[data-bs-theme="light"] ::selection { background: rgba(var(--rk-primary-rgb), 0.2); }
[data-bs-theme="light"] .card, [data-bs-theme="light"] .rk-card, [data-bs-theme="light"] .mini-stat { box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -18px rgba(15, 23, 42, .25); }
[data-bs-theme="light"] .flash .btn-close, [data-bs-theme="light"] .faq .accordion-button::after { filter: none; }
[data-bs-theme="light"] .btn-danger-soft:hover { color: var(--rk-danger); }
[data-bs-theme="light"] .balance-card { background: linear-gradient(140deg, #dfe9ff 0%, #edf3ff 50%, #ddf6fb 100%); border-color: rgba(var(--rk-primary-rgb), .22); }
[data-bs-theme="light"] .balance-card::after { opacity: .18; }
[data-bs-theme="light"] .auth-card { background: rgba(255, 255, 255, .86); border-color: rgba(30, 64, 175, .12); box-shadow: 0 30px 80px -40px rgba(30, 64, 175, .35); }
[data-bs-theme="light"] .mock-window, [data-bs-theme="light"] .msg-generated img { box-shadow: 0 30px 70px -35px rgba(15, 23, 42, .35); }
[data-bs-theme="light"] .page-aurora .blob { opacity: .2; }
[data-bs-theme="light"] .page-aurora .b2 { opacity: .16; }
[data-bs-theme="light"] .page-aurora .b3 { opacity: .1; }
[data-bs-theme="light"] .page-aurora .grid { background-image: linear-gradient(rgba(30, 64, 175, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(30, 64, 175, .06) 1px, transparent 1px); }
[data-bs-theme="light"] .page-aurora .stars, [data-bs-theme="light"] .page-aurora .noise { display: none; }

/* ---------- Theme switch & logo variants ---------- */
.brand-logo.on-light, [data-bs-theme="light"] .brand-logo.on-dark { display: none; }
[data-bs-theme="light"] .brand-logo.on-light { display: block; filter: drop-shadow(0 4px 12px rgba(var(--rk-primary-rgb), .18)); }
.theme-toggle .theme-icon-light, [data-bs-theme="light"] .theme-toggle .theme-icon-dark { display: none; }
[data-bs-theme="light"] .theme-toggle .theme-icon-light { display: inline; }
.theme-toggle .bi { font-size: 1.1rem; }
.theme-corner { position: fixed; top: 1rem; right: 1rem; z-index: 1035; }
.text-primary-soft { color: var(--rk-primary-soft) !important; }
.text-accent-soft { color: var(--rk-accent-soft) !important; }
.custom-model-icon { overflow: hidden; background: var(--rk-surface-2) !important; padding: 3px; }
.custom-model-icon img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
