/* ═══════════════════════════════════════════════════════════════
   PayPilot Neo — premium fintech dashboard
   Dark-first glassmorphism · gradient accents · Bengali-aware type
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Dark theme (default) */
  --bg: #07080f;
  --bg-2: #0b0d18;
  --bg-3: #101324;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-solid: #121527;
  --card: rgba(255, 255, 255, 0.045);
  --card-hover: rgba(255, 255, 255, 0.075);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --line: rgba(255, 255, 255, 0.08);
  --line-soft: rgba(255, 255, 255, 0.05);
  --fg: #e9ebf8;
  --fg-strong: #ffffff;
  --muted: #9aa0b8;
  --muted-2: #6b7190;
  --primary: #7c7ff3;
  --primary-2: #a78bfa;
  --primary-hover: #8f93ff;
  --primary-soft: rgba(124, 127, 243, 0.14);
  --primary-border: rgba(124, 127, 243, 0.38);
  --accent: #818cf8;
  --accent-2: #c084fc;
  --accent-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #d946ef 120%);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.13);
  --success-border: rgba(52, 211, 153, 0.35);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.13);
  --warning-border: rgba(251, 191, 36, 0.35);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.13);
  --danger-border: rgba(248, 113, 113, 0.38);
  --info: #38bdf8;
  --info-soft: rgba(56, 189, 248, 0.13);
  --radius: 16px;
  --radius-sm: 11px;
  --radius-xs: 8px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px -12px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 8px 30px -8px rgba(99, 102, 241, 0.45);
  --shadow: var(--shadow-md);
  --bottom-nav-h: 66px;
  --top-bar-h: 60px;
  --side-w: 232px;
  --font: "Inter", "Hind Siliguri", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 0.8, 0.3, 1);
  --glass-blur: blur(18px) saturate(150%);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f3f4fb;
  --bg-2: #eef0fa;
  --bg-3: #e9ebf7;
  --surface: #ffffff;
  --surface-2: #f8f9ff;
  --surface-solid: #ffffff;
  --card: #ffffff;
  --card-hover: #fdfdff;
  --border: #e2e5f2;
  --border-strong: #c9cde4;
  --line: #e6e8f4;
  --line-soft: #eef0f8;
  --fg: #171a2e;
  --fg-strong: #0b0d1c;
  --muted: #62688a;
  --muted-2: #9298b5;
  --primary: #5558e8;
  --primary-2: #7c5cf0;
  --primary-hover: #4548d8;
  --primary-soft: #eef0ff;
  --primary-border: #c9ccfa;
  --accent: #5558e8;
  --accent-2: #9333ea;
  --success: #059669;
  --success-soft: #e7faf2;
  --success-border: #a7e8cd;
  --warning: #b45309;
  --warning-soft: #fef5e2;
  --warning-border: #f2ddab;
  --danger: #dc2626;
  --danger-soft: #fdeeee;
  --danger-border: #f5c2c2;
  --info: #0369a1;
  --info-soft: #e3f4fd;
  --shadow-sm: 0 1px 2px rgba(23, 26, 46, 0.06);
  --shadow-md: 0 8px 24px -10px rgba(23, 26, 46, 0.14);
  --shadow-lg: 0 20px 50px -18px rgba(23, 26, 46, 0.25);
  --shadow-glow: 0 8px 26px -10px rgba(85, 88, 232, 0.5);
  color-scheme: light;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overflow-x: hidden;
}
/* Ambient background glows */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(52rem 30rem at 8% -10%, rgba(99, 102, 241, 0.16), transparent 60%),
    radial-gradient(44rem 28rem at 108% 12%, rgba(168, 85, 247, 0.12), transparent 60%),
    radial-gradient(40rem 30rem at 50% 120%, rgba(56, 189, 248, 0.08), transparent 60%),
    var(--bg);
}
[data-theme="light"] body::before {
  background:
    radial-gradient(52rem 30rem at 8% -10%, rgba(99, 102, 241, 0.10), transparent 60%),
    radial-gradient(44rem 28rem at 108% 12%, rgba(168, 85, 247, 0.08), transparent 60%),
    var(--bg);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; filter: brightness(1.1); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; height: auto; }
.mono { font-family: var(--mono); font-size: 12px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.sm { font-size: 12px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); background-clip: padding-box; }

/* ── App shell layout ─────────────────────────────────────────── */
.layout { min-height: 100dvh; display: flex; flex-direction: column; }
.main {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: calc(var(--top-bar-h) + 18px) 16px calc(var(--bottom-nav-h) + 26px);
  position: relative;
  z-index: 1;
}

/* ── Sidebar (desktop) ────────────────────────────────────────── */
.side-nav {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--side-w);
  display: none;
  flex-direction: column;
  padding: 18px 14px;
  background: color-mix(in srgb, var(--surface-solid) 72%, transparent);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--line);
  z-index: 120;
  overflow-y: auto;
}
.side-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 18px;
}
.side-brand svg { width: 34px; height: 34px; flex-shrink: 0; filter: drop-shadow(0 4px 14px rgba(99,102,241,.45)); }
.side-brand-name { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; color: var(--fg-strong); }
.side-brand-name span {
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.side-links { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.side-links a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all 0.18s var(--ease);
}
.side-links a svg { width: 19px; height: 19px; flex-shrink: 0; opacity: 0.85; }
.side-links a span { white-space: nowrap; }
.side-links a:hover { background: var(--surface-2); color: var(--fg); }
.side-links a.active {
  background: var(--primary-soft);
  border-color: var(--primary-border);
  color: var(--fg-strong);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02), 0 4px 18px -6px rgba(99,102,241,0.4);
}
.side-links a.active svg { color: var(--primary); opacity: 1; }
.side-foot { padding: 10px 8px 4px; font-size: 11px; color: var(--muted-2); }

@media (min-width: 992px) {
  .side-nav { display: flex; }
  .bottom-nav { display: none !important; }
  .main {
    padding-left: calc(var(--side-w) + 26px);
    padding-right: 26px;
    max-width: 1320px;
    margin-top: 0;
    padding-top: calc(var(--top-bar-h) + 22px);
  }
  .top-bar { left: var(--side-w); }
}

/* ── Top bar ──────────────────────────────────────────────────── */
.top-bar {
  position: fixed; top: 0; right: 0; left: 0;
  height: var(--top-bar-h);
  display: flex; align-items: center;
  padding: 0 16px;
  z-index: 110;
  background: color-mix(in srgb, var(--bg) 62%, transparent);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--line);
}
.top-shell-card {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; gap: 12px; max-width: 1120px; margin: 0 auto;
}
@media (min-width: 992px) { .top-shell-card { max-width: none; margin: 0; } }
.top-bar-title {
  font-size: 15px; font-weight: 800; letter-spacing: -0.01em;
  color: var(--fg-strong);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.profile-cluster { display: flex; align-items: center; gap: 8px; }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.18s var(--ease);
}
.theme-toggle:hover { color: var(--fg); border-color: var(--border-strong); transform: translateY(-1px); }
.theme-toggle svg { width: 17px; height: 17px; }
.profile-card {
  display: flex; align-items: center; gap: 9px;
  padding: 4px 10px 4px 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.18s var(--ease);
}
.profile-card:hover { border-color: var(--border-strong); }
.profile-avatar {
  width: 32px; height: 32px; border-radius: 9px; object-fit: cover;
  border: 1px solid var(--border);
  background: var(--primary-soft);
}
.profile-meta { line-height: 1.25; min-width: 0; }
.profile-name {
  font-size: 12.5px; font-weight: 700; color: var(--fg-strong);
  max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.profile-role {
  font-size: 10.5px; color: var(--muted); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
}

/* ── Bottom nav (mobile) ──────────────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex; align-items: stretch; justify-content: space-around;
  background: color-mix(in srgb, var(--bg-2) 82%, transparent);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--line);
  z-index: 110;
  overflow-x: auto;
}
.bottom-nav a {
  flex: 1 0 64px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 600;
  padding: 8px 4px 10px;
  position: relative;
  transition: color 0.18s var(--ease);
  min-width: 60px;
}
.bottom-nav a svg { width: 21px; height: 21px; transition: transform 0.18s var(--ease); }
.bottom-nav a span { white-space: nowrap; }
.bottom-nav a.active { color: var(--primary); }
.bottom-nav a.active svg { transform: translateY(-1px) scale(1.06); filter: drop-shadow(0 4px 10px rgba(99,102,241,.5)); }
.bottom-nav a.active::before {
  content: "";
  position: absolute; top: 0;
  width: 26px; height: 3px; border-radius: 0 0 4px 4px;
  background: var(--accent-grad);
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  cursor: pointer;
  transition: all 0.18s var(--ease);
  white-space: nowrap;
  user-select: none;
}
.btn:hover { border-color: var(--border-strong); background: var(--surface-2); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-cta, .btn-primary {
  background: var(--accent-grad);
  border: none;
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.btn-cta:hover, .btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 12px 34px -10px rgba(99, 102, 241, 0.6);
  background: var(--accent-grad);
}
.btn-ghost { background: transparent; border-color: var(--border); color: var(--muted); }
.btn-ghost:hover { color: var(--fg); background: var(--surface-2); }
.btn-danger {
  background: var(--danger-soft);
  border-color: var(--danger-border);
  color: var(--danger);
}
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-success {
  background: var(--success-soft);
  border-color: var(--success-border);
  color: var(--success);
}
.btn-success:hover { background: var(--success); border-color: var(--success); color: #04120c; }
[data-theme="light"] .btn-success:hover { color: #fff; }
.btn-sm { font-size: 12px; padding: 6px 12px; border-radius: 9px; }
.btn-block { width: 100%; }

/* ── Forms ────────────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
input, select, textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg-strong);
  padding: 10px 13px;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:focus, select:focus, textarea:focus {
  border-color: var(--primary-border);
  box-shadow: 0 0 0 3px rgba(124, 127, 243, 0.18);
  background: var(--surface-2);
}
input:disabled { opacity: 0.6; cursor: not-allowed; }
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa0b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
  cursor: pointer;
}
select option { background: var(--surface-solid); color: var(--fg); }
[data-theme="light"] select option { background: #fff; color: #171a2e; }
.form-stack { display: flex; flex-direction: column; }
.create-grid { display: grid; gap: 4px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 42px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
}
.pw-toggle:hover { color: var(--fg); background: var(--surface-2); }

/* ── Badges / chips ───────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.9; }
.badge-active, .badge-allowed, .badge-available, .badge-online, .badge-success, .badge-business {
  background: var(--success-soft); color: var(--success); border-color: var(--success-border);
}
.badge-used, .badge-claimed {
  background: var(--primary-soft); color: var(--primary); border-color: var(--primary-border);
}
.badge-warn, .badge-pending, .badge-offline {
  background: var(--warning-soft); color: var(--warning); border-color: var(--warning-border);
}
.badge-personal { background: var(--info-soft); color: var(--info); border-color: rgba(56,189,248,.35); }
.badge-attack, .badge-rejected, .badge-error {
  background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border);
}
.badge-disabled, .badge-unwanted { background: var(--surface-2); color: var(--muted-2); border-color: var(--border); }
.badge-otp { background: var(--warning-soft); color: var(--warning); border-color: var(--warning-border); }
.badge-expired { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }

.meta-chip {
  display: inline-flex; align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden; text-overflow: ellipsis;
}

/* ── Generic cards ────────────────────────────────────────────── */
.section-card, .user-card, .device-card, .wallet-type-card, .lt-card, .account-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.user-card, .device-card, .wallet-type-card { padding: 13px 14px; margin-bottom: 10px; }
.user-card:hover, .device-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.user-card { overflow: hidden; }
.section-card { padding: 16px; margin-bottom: 14px; }
.sh { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.sh h2 { font-size: 14px; font-weight: 800; color: var(--fg-strong); letter-spacing: -0.01em; }
.sb { color: var(--muted); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-title { font-size: 13.5px; font-weight: 800; color: var(--fg-strong); word-break: break-word; }
.card-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; word-break: break-word; }
.card-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.code-inline, .card-sub code { font-family: var(--mono); font-size: 11px; color: var(--muted); word-break: break-all; }

/* ── Login page ───────────────────────────────────────────────── */
.login-body { min-height: 100dvh; }
.login-page {
  position: relative;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  overflow: hidden;
}
.login-bg { position: absolute; inset: 0; pointer-events: none; }
.login-bg::before, .login-bg::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  animation: orbFloat 14s ease-in-out infinite alternate;
}
.login-bg::before {
  width: 480px; height: 480px;
  left: -140px; top: -120px;
  background: radial-gradient(circle, rgba(99,102,241,.55), transparent 65%);
}
.login-bg::after {
  width: 520px; height: 520px;
  right: -180px; bottom: -160px;
  background: radial-gradient(circle, rgba(217,70,239,.4), transparent 65%);
  animation-delay: -6s;
}
[data-theme="light"] .login-bg::before { opacity: 0.35; }
[data-theme="light"] .login-bg::after { opacity: 0.25; }
@keyframes orbFloat {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(40px, 30px, 0) scale(1.12); }
}
.login-shell { position: relative; z-index: 1; width: 100%; max-width: 400px; }
.login-card {
  background: color-mix(in srgb, var(--surface-solid) 78%, transparent);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  padding: 30px 26px 24px;
  box-shadow: var(--shadow-lg);
  animation: cardIn 0.5s var(--ease) both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}
.login-brand { text-align: center; margin-bottom: 22px; }
.login-logo {
  display: inline-flex;
  margin-bottom: 14px;
  filter: drop-shadow(0 10px 26px rgba(99, 102, 241, 0.5));
}
.login-brand h1 {
  font-size: 24px; font-weight: 800; letter-spacing: -0.03em; color: var(--fg-strong);
}
.login-brand p { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.login-submit { margin-top: 4px; height: 44px; font-size: 14px; }
.login-foot {
  text-align: center;
  font-size: 11px;
  color: var(--muted-2);
  margin-top: 16px;
}

/* ── Alerts / toasts ──────────────────────────────────────────── */
.alert {
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
}
.alert-error {
  background: var(--danger-soft);
  border-color: var(--danger-border);
  color: var(--danger);
}
.toast-wrap {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 16px);
  left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px;
  z-index: 300;
  width: min(92vw, 380px);
  pointer-events: none;
}
@media (min-width: 992px) { .toast-wrap { bottom: 24px; } }
.toast {
  padding: 11px 15px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-strong);
  background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--success);
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s var(--ease) both;
}
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--info); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ── Modals ───────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(4, 5, 12, 0.66);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 200;
  padding: 0;
  animation: fadeIn 0.2s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%;
  max-width: 460px;
  max-height: 88dvh;
  overflow-y: auto;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: 22px 22px 0 0;
  padding: 22px 20px 20px;
  box-shadow: var(--shadow-lg);
  animation: sheetIn 0.32s var(--ease) both;
}
@media (min-width: 640px) {
  .modal-backdrop { align-items: center; padding: 20px; }
  .modal { border-radius: 20px; }
}
@keyframes sheetIn {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}
.modal h3 { font-size: 16.5px; font-weight: 800; color: var(--fg-strong); margin-bottom: 6px; }
.modal-lead { font-size: 12.5px; color: var(--muted); margin-bottom: 16px; }
.modal-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.modal-scroll { max-height: 46dvh; overflow-y: auto; margin-bottom: 6px; }
.mono-box {
  font-family: var(--mono);
  font-size: 12px;
  word-break: break-all;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--fg);
  max-height: 130px;
  overflow-y: auto;
}

/* ── Empty / loading states ───────────────────────────────────── */
.empty {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 34px 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 10px;
}

/* ── Page toolbar & filters ───────────────────────────────────── */
.page-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.page-toolbar-title { font-size: 16px; font-weight: 800; color: var(--fg-strong); letter-spacing: -0.02em; }
.page-toolbar-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 14px;
}
.filter-bar select, .filter-bar input {
  width: auto;
  min-width: 130px;
  flex: 0 1 auto;
  font-size: 12.5px;
  padding: 8px 30px 8px 12px;
}
.filter-bar select { padding-right: 30px; }
.pay-toolbar { margin-bottom: 12px; }
.pay-search { margin-bottom: 10px; }
.pay-filters { margin-bottom: 0; }

/* ── Dashboard overview ───────────────────────────────────────── */
.dash-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
  background: var(--accent-grad);
  border-radius: var(--r-lg);
  padding: 22px 20px;
  color: #fff;
  box-shadow: var(--shadow-glow);
  margin-bottom: 16px;
}
.dash-hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(26rem 12rem at 85% -30%, rgba(255,255,255,.28), transparent 60%),
    radial-gradient(20rem 14rem at -10% 130%, rgba(0,0,0,.22), transparent 60%);
  pointer-events: none;
}
@media (min-width: 720px) {
  .dash-hero { grid-template-columns: 1.4fr 1fr; align-items: center; padding: 26px 26px; }
}
.dash-hero-main { position: relative; min-width: 0; }
.dash-hero-label {
  font-size: 11px; font-weight: 800; letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.85;
}
.dash-hero-value {
  font-size: clamp(30px, 7vw, 42px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-top: 6px;
  text-shadow: 0 4px 24px rgba(0,0,0,0.25);
}
.dash-hero-sub { font-size: 12.5px; font-weight: 600; opacity: 0.9; margin-top: 6px; }
.dash-hero-side {
  position: relative;
  display: grid; gap: 8px;
}
.dash-mini {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  padding: 9px 13px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.dash-mini span { font-size: 11.5px; font-weight: 700; opacity: 0.9; }
.dash-mini b { font-size: 13px; font-weight: 800; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
@media (min-width: 720px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 16px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.stat-card:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.stat-card .label {
  font-size: 10.5px; font-weight: 800;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
}
.stat-card .value {
  font-size: 24px; font-weight: 800; letter-spacing: -0.02em;
  color: var(--fg-strong);
  margin-top: 5px;
  font-variant-numeric: tabular-nums;
}
.stat-card.accent {
  background: var(--primary-soft);
  border-color: var(--primary-border);
}
.stat-card.accent .value { color: var(--primary); }

.dash-panels { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .dash-panels { grid-template-columns: 1.25fr 1fr; } }
.dash-panel { margin-bottom: 0; }

/* 7-day bar chart */
.chart-bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  align-items: end;
}
.chart-col { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.chart-bar-wrap {
  width: 100%;
  height: 130px;
  display: flex; align-items: flex-end;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  overflow: hidden;
}
.chart-bar {
  width: 100%;
  min-height: 3px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.4);
  transition: height 0.6s var(--ease);
}
.chart-label { font-size: 10px; font-weight: 700; color: var(--muted-2); }
.chart-val {
  font-size: 9.5px; font-weight: 700; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}

/* Wallet breakdown bars */
.wallet-bars { display: flex; flex-direction: column; gap: 11px; }
.wallet-bar-row { min-width: 0; }
.wallet-bar-top {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  margin-bottom: 5px;
}
.wallet-bar-name { font-size: 12.5px; font-weight: 700; color: var(--fg-strong); }
.wallet-bar-meta { font-size: 11px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.wallet-bar-track {
  height: 9px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  overflow: hidden;
}
.wallet-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent-grad);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.45);
  transition: width 0.6s var(--ease);
}

/* ── Transaction cards ────────────────────────────────────────── */
.tx-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 15px;
  margin-bottom: 10px;
  cursor: pointer;
  outline: none;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
.tx-card:hover {
  border-color: var(--primary-border);
  box-shadow: 0 10px 30px -14px rgba(99, 102, 241, 0.4);
  background: var(--card-hover);
}
.tx-card.is-open, .tx-card:focus-within {
  border-color: var(--primary-border);
  box-shadow: 0 14px 38px -16px rgba(99, 102, 241, 0.5), 0 0 0 1px var(--primary-border);
}
.tx-card.needs-review { border-left: 3px solid var(--warning); }
.tx-card.used { border-left: 3px solid var(--primary); }
.tx-card.available { border-left: 3px solid var(--success); }
.tx-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tx-main-left { min-width: 0; }
.tx-amt {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--fg-strong);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.tx-wallet-line {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
  margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tx-main-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }
.tx-age { font-size: 10.5px; color: var(--muted-2); font-weight: 700; }
.tx-id-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.tx-trx {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px dashed var(--primary-border);
  border-radius: 8px;
  padding: 6px 10px;
  word-break: break-all;
  flex: 1;
  min-width: 0;
}
.btn-copy {
  flex-shrink: 0;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  padding: 6px 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.16s var(--ease);
}
.btn-copy:hover { color: var(--primary); border-color: var(--primary-border); background: var(--primary-soft); }
.tx-expand {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  animation: expandIn 0.22s var(--ease);
}
@keyframes expandIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.tx-card.is-open .tx-expand, .tx-card:focus-within .tx-expand { display: block; }
.tx-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.tx-d span {
  display: block;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 2px;
}
.tx-d b { font-size: 12.5px; font-weight: 700; color: var(--fg); word-break: break-word; }
.tx-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }

/* ── SMS feed cards ───────────────────────────────────────────── */
.sms-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 9px;
  transition: border-color 0.2s var(--ease);
}
.sms-card:hover { border-color: var(--border-strong); }
.sms-card.attack { border-left-color: var(--danger); }
.sms-card.otp { border-left-color: var(--warning); }
.sms-card.claimed, .sms-card.pending { border-left-color: var(--success); }
.sms-card.unwanted { border-left-color: var(--muted-2); }
.sms-body {
  margin-top: 9px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xs);
  padding: 9px 11px;
  word-break: break-word;
  white-space: pre-wrap;
}

/* ── Wallet type cards ────────────────────────────────────────── */
.wallet-type-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.wallet-type-card.is-off { opacity: 0.62; }
.wtc-body { display: flex; gap: 13px; align-items: center; }
.wtc-logo {
  width: 52px; height: 52px;
  border-radius: 13px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.wtc-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wtc-fallback { display: flex; color: var(--primary); }
.wtc-fallback svg { width: 24px; height: 24px; }
.wtc-info { flex: 1; min-width: 0; }
.wtc-title { font-size: 14px; font-weight: 800; color: var(--fg-strong); }
.wtc-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.wtc-meta { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.wtc-actions { display: flex; gap: 6px; padding: 0; margin-top: 12px; flex-wrap: wrap; }
.wallet-device-select { width: 100%; margin-top: 6px; font-size: 12.5px; }

/* ── License / token card ─────────────────────────────────────── */
.lt-card { padding: 18px 17px; }
.lt-card-title { font-size: 15px; font-weight: 800; color: var(--fg-strong); margin-bottom: 4px; }
.lt-card-desc { font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.lt-item { margin-bottom: 4px; }
.lt-item-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  margin-bottom: 7px;
}
.lt-name { font-size: 13.5px; font-weight: 800; color: var(--fg-strong); }
.lt-use { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.lt-ver {
  font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 7px;
  background: var(--primary-soft); color: var(--primary); border: 1px solid var(--primary-border);
}
.lt-mask {
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px dashed var(--primary-border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  word-break: break-all;
  margin-bottom: 9px;
}
.lt-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.lt-divider { height: 1px; background: var(--line); margin: 15px 0; }

/* ── Account / profile ────────────────────────────────────────── */
.account-card {
  display: flex; align-items: center; gap: 14px;
  padding: 17px 16px;
  margin-bottom: 14px;
}
.account-avatar {
  width: 56px; height: 56px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid var(--border-strong);
  background: var(--primary-soft);
  flex-shrink: 0;
}
.account-info { min-width: 0; }
.account-name { font-size: 16px; font-weight: 800; color: var(--fg-strong); }
.account-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.settings-actions { display: flex; flex-direction: column; gap: 8px; }
.profile-preview-row { display: flex; align-items: center; gap: 10px; margin: 4px 0 8px; }
.profile-preview-row img {
  width: 44px; height: 44px; border-radius: 12px; object-fit: cover;
  border: 1px solid var(--border);
}

/* ── Telegram card ────────────────────────────────────────────── */
.tg-connected-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
}
.tg-connected-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tg-avatar {
  width: 46px; height: 46px; border-radius: 13px; object-fit: cover;
  border: 1px solid var(--border);
  background: var(--info-soft);
  flex-shrink: 0;
}
.tg-meta { min-width: 0; }
.tg-name { font-size: 13.5px; font-weight: 800; color: var(--fg-strong); }
.tg-user { font-size: 12px; color: var(--primary); font-weight: 700; }
.tg-id { font-size: 11px; color: var(--muted-2); font-family: var(--mono); }

/* ── Misc helpers ─────────────────────────────────────────────── */
.list-stack { display: flex; flex-direction: column; gap: 8px; }
.chip-btn {
  flex: 0 0 auto; cursor: pointer; border-radius: 8px;
  font: inherit; font-size: 12px; font-weight: 700; color: var(--muted);
  padding: 6px 12px;
  background: var(--surface); border: 1px solid var(--border);
  transition: all 0.16s var(--ease);
}
.chip-btn.on { color: #fff; background: var(--accent-grad); border-color: transparent; }
.search-bar {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 10px;
  outline: none;
}
.search-bar:focus { border-color: var(--primary-border); box-shadow: 0 0 0 3px rgba(124,127,243,.16); }
.me-card, .profile-edit-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
}
.tg-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}

/* ── Skeleton shimmer while data loads ────────────────────────── */
.empty.loading {
  border-style: solid;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 0.65; } 50% { opacity: 1; } }

/* ── Reduced motion ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
