/* ==========================================================================
   Bizmax UI — design system for the customer panel
   Structure: tokens → base → layout → components → pages → utilities
   External stylesheet only (no inline styles required; CSP-safe).
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --border: #e4e7ec;
  --border-strong: #cfd4dc;

  --text: #101828;
  --text-2: #475467;
  --text-3: #667085;

  --primary: #2457e6;
  --primary-hover: #1c46c2;
  --primary-soft: #eef3ff;
  --primary-ring: rgba(36, 87, 230, .16);

  --success: #067647;
  --success-soft: #ecfdf3;
  --success-border: #abefc6;
  --warning: #b54708;
  --warning-soft: #fffaeb;
  --warning-border: #fedf89;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --danger-border: #fecdca;
  --info: #175cd3;
  --info-soft: #eff8ff;
  --info-border: #b2ddff;

  --sidebar: #0c1424;
  --sidebar-text: #a9b4c8;
  --sidebar-active: #1a2948;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 8px 20px -6px rgba(16, 24, 40, .12), 0 2px 6px -2px rgba(16, 24, 40, .06);
  --shadow-lg: 0 24px 48px -12px rgba(16, 24, 40, .28);

  --sidebar-w: 268px;
  --topbar-h: 64px;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { letter-spacing: -.01em; line-height: 1.25; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--primary-ring); outline-offset: 2px; border-radius: 6px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 300;
  background: var(--primary); color: #fff; padding: 10px 16px; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 12px; text-decoration: none; }

/* ---------- 3. App shell ---------- */
.app__main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; min-width: 0; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
  background: var(--sidebar); color: var(--sidebar-text);
  display: flex; flex-direction: column; z-index: 60;
  transition: transform .25s ease;
}
.sidebar__brand {
  height: var(--topbar-h); flex: none; display: flex; align-items: center; gap: 12px;
  padding: 0 20px; border-bottom: 1px solid rgba(255, 255, 255, .07);
  color: #fff; font-size: 18px; font-weight: 700; letter-spacing: -.01em;
}
.sidebar__brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, #5d85ff, #2457e6); color: #fff; font-size: 15px;
  box-shadow: 0 4px 10px rgba(36, 87, 230, .45);
}
.sidebar__nav { flex: 1; overflow-y: auto; padding: 8px 12px 16px; }
.nav-label {
  padding: 18px 12px 6px; font-size: 11px; font-weight: 600;
  letter-spacing: .09em; text-transform: uppercase; color: #6b7a94;
}
.nav-link {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin: 2px 0; border-radius: 9px;
  color: var(--sidebar-text); font-size: 14px; font-weight: 500;
}
.nav-link i { width: 18px; text-align: center; font-size: 15px; opacity: .85; }
.nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav-link.is-active { background: var(--sidebar-active); color: #fff; }
.nav-link.is-active i { opacity: 1; color: #8fb0ff; }
.nav-link.is-active::before {
  content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 3px 3px 0; background: #6f95ff;
}
.sidebar__foot { flex: none; padding: 12px; border-top: 1px solid rgba(255, 255, 255, .07); }
.user-chip { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 10px; }
.user-chip__name { color: #fff; font-size: 14px; font-weight: 600; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip__meta { font-size: 12px; color: var(--sidebar-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip__text { min-width: 0; }
.nav-link--signout { color: #f4a3a8; }
.nav-link--signout:hover { background: rgba(244, 163, 168, .1); color: #ffc9cc; }

.avatar {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
  background: linear-gradient(135deg, #4f7bff, #2457e6); color: #fff; text-transform: uppercase;
}
.avatar--sm { width: 32px; height: 32px; font-size: 13px; }

.scrim {
  position: fixed; inset: 0; background: rgba(12, 20, 36, .55); z-index: 55;
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}

.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 32px; background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border);
}
.topbar__left, .topbar__right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar__title { font-size: 16px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn.menu-btn { display: none; }

.icon-btn {
  position: relative; width: 40px; height: 40px; display: inline-grid; place-items: center;
  border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--text-2);
  font-size: 16px; transition: background .15s, color .15s;
}
.icon-btn:hover { background: #f2f4f7; color: var(--text); text-decoration: none; }
.icon-btn__dot {
  position: absolute; top: 8px; right: 9px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--danger); border: 2px solid #fff;
}
.icon-btn__dot[hidden] { display: none; }

.dropdown { position: relative; }
.dropdown__toggle {
  display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px;
  border: 1px solid transparent; border-radius: 999px; background: transparent;
}
.dropdown__toggle:hover { background: #f2f4f7; }
.dropdown__toggle .fa-chevron-down { font-size: 11px; color: var(--text-3); }
.dropdown__name { font-size: 14px; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown__menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-md); opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .15s, transform .15s, visibility .15s; z-index: 70;
}
.dropdown.is-open .dropdown__menu { opacity: 1; visibility: visible; transform: none; }
.dropdown__head { padding: 10px 12px 8px; }
.dropdown__head strong { display: block; font-size: 14px; }
.dropdown__head span { font-size: 13px; color: var(--text-3); word-break: break-all; }
.dropdown__item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
  color: var(--text); font-size: 14px; font-weight: 500;
}
.dropdown__item i { width: 16px; text-align: center; color: var(--text-3); }
.dropdown__item:hover { background: #f2f4f7; text-decoration: none; }
.dropdown__item--danger, .dropdown__item--danger i { color: var(--danger); }
.dropdown__sep { height: 1px; background: var(--border); margin: 6px 0; }

.page { flex: 1; width: 100%; max-width: 1160px; margin: 0 auto; padding: 28px 32px 48px; }
.page--medium { max-width: 880px; }
.page--narrow { max-width: 680px; }

.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 13px; color: var(--text-3); }
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--primary); text-decoration: none; }
.breadcrumb i { font-size: 9px; opacity: .6; }
.breadcrumb [aria-current] { color: var(--text-2); font-weight: 500; }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.page-header h1 { font-size: clamp(22px, 2.6vw, 28px); font-weight: 700; }
.page-header p { margin-top: 4px; color: var(--text-3); }
.page-header__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.site-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  padding: 20px 32px; border-top: 1px solid var(--border); background: var(--surface);
  font-size: 13px; color: var(--text-3);
}
.site-footer nav { display: flex; gap: 20px; }
.site-footer a { color: var(--text-3); }
.site-footer a:hover { color: var(--primary); }

/* ---------- 4. Components ---------- */

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card__header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.card__title { font-size: 16px; font-weight: 650; }
.card__desc { margin-top: 2px; font-size: 14px; color: var(--text-3); }
.card__body { padding: 24px; }
.card__footer { padding: 16px 24px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.stack { display: grid; gap: 20px; }
.stack--sm { gap: 12px; }

/* Buttons */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border: 1px solid transparent; border-radius: 10px;
  font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap; cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s, color .15s;
}
.btn:hover { text-decoration: none; }
.btn[disabled], .btn.is-disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn--primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--primary-hover); color: #fff; }
.btn--secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn--secondary:hover { background: var(--surface-2); }
.btn--ghost { background: transparent; color: var(--text-2); }
.btn--ghost:hover { background: #f2f4f7; color: var(--text); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: #912018; color: #fff; }
.btn--light { background: #fff; color: var(--primary); }
.btn--light:hover { background: #f0f4ff; color: var(--primary-hover); }
.btn--outline-light { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .35); }
.btn--outline-light:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.btn--sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn--lg { height: 48px; padding: 0 24px; font-size: 15px; }
.btn--block { width: 100%; }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: spin .7s linear infinite;
}
.btn--secondary.is-loading::after, .btn--ghost.is-loading::after { border-color: rgba(16, 24, 40, .2); border-top-color: var(--primary); }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* Forms */
.field { margin-bottom: 20px; }
.field__label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--text); }
.field__label .req { color: var(--danger); margin-left: 2px; }
.field__hint { margin-top: 6px; font-size: 13px; color: var(--text-3); }
.field__error { margin-top: 6px; font-size: 13px; color: var(--danger); display: flex; gap: 6px; align-items: flex-start; }
.field__error[hidden] { display: none; }
.input, .select, .textarea {
  width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: 10px;
  background: #fff; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 96px; padding: 11px 14px; resize: vertical; }
.select {
  appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.input::placeholder, .textarea::placeholder { color: #98a2b3; }
.input:hover, .select:hover, .textarea:hover { border-color: #b8bfca; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid, .input.error { border-color: var(--danger); }
.input.is-invalid:focus, .input.error:focus { box-shadow: 0 0 0 4px rgba(180, 35, 24, .14); }
.input:disabled { background: var(--surface-2); color: var(--text-3); }
.input-group { display: flex; align-items: stretch; border: 1px solid var(--border-strong); border-radius: 10px; background: #fff; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.input-group:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.input-group.is-invalid { border-color: var(--danger); }
.input-group .input { border: 0; border-radius: 0; box-shadow: none; flex: 1; min-width: 0; }
.input-group__addon { display: flex; align-items: center; padding: 0 14px; background: var(--surface-2); color: var(--text-3); font-weight: 600; border-right: 1px solid var(--border); }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 46px; }
.input-wrap__btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; display: grid; place-items: center; border: 0; background: transparent; border-radius: 8px; color: var(--text-3); }
.input-wrap__btn:hover { background: #f2f4f7; color: var(--text); }
.readonly { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 10px 14px; border: 1px dashed var(--border-strong); border-radius: 10px; background: var(--surface-2); color: var(--text-2); }
.range { width: 100%; accent-color: var(--primary); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }

/* Alerts */
.alert { display: flex; gap: 12px; padding: 14px 16px; margin-bottom: 20px; border: 1px solid; border-radius: 10px; font-size: 14px; }
.alert__icon { flex: none; margin-top: 2px; }
.alert__body { min-width: 0; flex: 1; }
.alert__title { font-weight: 650; margin-bottom: 2px; }
.alert--success { background: var(--success-soft); border-color: var(--success-border); color: #085d3a; }
.alert--danger { background: var(--danger-soft); border-color: var(--danger-border); color: #7a271a; }
.alert--warning { background: var(--warning-soft); border-color: var(--warning-border); color: #93370d; }
.alert--info { background: var(--info-soft); border-color: var(--info-border); color: #194185; }
.alert .btn { margin-top: 10px; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border: 1px solid; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 20px; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--plain::before { display: none; }
.badge--success { color: var(--success); background: var(--success-soft); border-color: var(--success-border); }
.badge--warning { color: var(--warning); background: var(--warning-soft); border-color: var(--warning-border); }
.badge--danger { color: var(--danger); background: var(--danger-soft); border-color: var(--danger-border); }
.badge--info { color: var(--info); background: var(--info-soft); border-color: var(--info-border); }
.badge--neutral { color: var(--text-2); background: #f2f4f7; border-color: var(--border); }
.badge--primary { color: var(--primary); background: var(--primary-soft); border-color: #c7d7fe; }
.sidebar .badge--primary { color: #b9ccff; background: rgba(111, 149, 255, .16); border-color: rgba(111, 149, 255, .3); }

/* Tables */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  padding: 12px 16px; text-align: left; white-space: nowrap; background: var(--surface-2);
  border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; color: var(--text-3);
}
.table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafbfc; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table th.is-sortable { cursor: pointer; user-select: none; }
.table th.is-sortable:hover { color: var(--text); }
.table th.is-sortable::after { content: "↕"; margin-left: 6px; opacity: .35; }
.table th[aria-sort="ascending"]::after { content: "↑"; opacity: 1; color: var(--primary); }
.table th[aria-sort="descending"]::after { content: "↓"; opacity: 1; color: var(--primary); }
.table .no-results td { text-align: center; color: var(--text-3); padding: 32px 16px; white-space: normal; }
.cell-id { font-family: var(--mono); font-size: 13px; color: var(--text-2); }
.cell-addr { display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; font-family: var(--mono); font-size: 13px; color: var(--text-2); }
.cell-strong { font-weight: 650; font-variant-numeric: tabular-nums; }
.cell-pos { color: var(--success); font-weight: 650; }
.cell-muted { color: var(--text-3); }
.tx { display: inline-flex; align-items: center; gap: 10px; }
.tx__icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; font-size: 12px; }
.tx__icon--in { background: var(--success-soft); color: var(--success); }
.tx__icon--out { background: var(--warning-soft); color: var(--warning); }
.tx__icon--star { background: var(--primary-soft); color: var(--primary); }
.tx__icon--swap { background: var(--info-soft); color: var(--info); }
.copyable { cursor: pointer; border-bottom: 1px dotted var(--border-strong); }
.copyable:hover { color: var(--primary); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.stat { padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.stat__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stat__label { font-size: 14px; font-weight: 500; color: var(--text-3); }
.stat__icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--primary-soft); color: var(--primary); }
.stat__icon--success { background: var(--success-soft); color: var(--success); }
.stat__icon--warning { background: var(--warning-soft); color: var(--warning); }
.stat__icon--info { background: var(--info-soft); color: var(--info); }
.stat__value { margin-top: 10px; font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat__meta { margin-top: 4px; font-size: 13px; color: var(--text-3); }

.hero {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px;
  padding: 28px; border-radius: 16px; color: #fff; box-shadow: var(--shadow-md);
  background: radial-gradient(120% 140% at 100% 0%, #3d6bff 0%, rgba(61, 107, 255, 0) 55%), linear-gradient(135deg, #14275c 0%, #1c3a99 100%);
}
.hero__label { font-size: 14px; opacity: .8; display: flex; align-items: center; gap: 8px; }
.hero__value { margin-top: 6px; font-size: clamp(32px, 5vw, 46px); font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.hero__meta { margin-top: 10px; font-size: 14px; opacity: .8; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.hero-grid .plan-card { display: flex; flex-direction: column; justify-content: center; }

/* Tabs */
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: -1px; padding: 12px 16px;
  border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text-3);
  font-size: 14px; font-weight: 600; white-space: nowrap; transition: color .15s;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }
.tab__count { padding: 0 8px; border-radius: 999px; background: #eef0f4; color: var(--text-2); font-size: 12px; line-height: 20px; }
.tab[aria-selected="true"] .tab__count { background: var(--primary-soft); color: var(--primary); }

/* Toolbar, search, chips */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.search { position: relative; flex: 1 1 220px; max-width: 340px; }
.search i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 13px; pointer-events: none; }
.search .input { height: 38px; padding-left: 36px; border-radius: 9px; }
.chips { display: inline-flex; padding: 3px; gap: 2px; background: #f2f4f7; border-radius: 10px; }
.chip { height: 32px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); font-size: 13px; font-weight: 600; }
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }

.progress { height: 8px; min-width: 120px; border-radius: 999px; background: #eaecf0; overflow: hidden; }
.progress__bar { height: 100%; width: 0; border-radius: inherit; background: var(--primary); transition: width .7s ease; }
.progress-label { margin-top: 6px; font-size: 12px; color: var(--text-3); }

.empty { padding: 56px 24px; text-align: center; color: var(--text-3); }
.empty__icon { width: 56px; height: 56px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 50%; background: #f2f4f7; color: var(--text-3); font-size: 22px; }
.empty__title { font-size: 16px; font-weight: 650; color: var(--text); }
.empty__text { max-width: 360px; margin: 4px auto 0; }
.empty .btn { margin-top: 18px; }

/* Flow stepper */
.stepper { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.step { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 13px; font-weight: 600; white-space: nowrap; }
.step__num { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--border-strong); background: #fff; font-size: 12px; }
.step.is-active { color: var(--text); }
.step.is-active .step__num { background: var(--primary); border-color: var(--primary); color: #fff; }
.step.is-done .step__num { background: var(--success-soft); border-color: var(--success-border); color: var(--success); }
.step__line { flex: 1; height: 2px; min-width: 16px; background: var(--border); }
.step__line.is-done { background: var(--success-border); }

/* Summary / copy */
.summary { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 24px; }
.summary__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.summary__row:last-child { border-bottom: 0; }
.summary__label { color: var(--text-3); font-size: 14px; }
.summary__value { font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; word-break: break-word; }
.summary__value--lg { font-size: 22px; letter-spacing: -.02em; }
.copy-field { display: flex; gap: 8px; align-items: stretch; }
.copy-field__value { flex: 1; min-width: 0; display: flex; align-items: center; padding: 11px 14px; border: 1px dashed var(--border-strong); border-radius: 10px; background: var(--surface-2); font-family: var(--mono); font-size: 13px; word-break: break-all; }
.balance-note { display: flex; align-items: center; gap: 16px; padding: 16px 18px; margin-bottom: 24px; border: 1px solid #c7d7fe; border-radius: 12px; background: var(--primary-soft); }
.balance-note__icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: #fff; color: var(--primary); }
.balance-note__label { font-size: 13px; color: var(--text-2); }
.balance-note__value { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* Password rules */
.rules { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; padding: 14px 16px; margin-bottom: 4px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); list-style: none; }
.rules li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); }
.rules li::before { content: "\f111"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 6px; color: #b8bfca; }
.rules li.is-valid { color: var(--success); }
.rules li.is-valid::before { content: "\f00c"; font-size: 11px; color: var(--success); }

/* Toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 250; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 12px; min-width: 240px; max-width: 360px; padding: 13px 16px; border-radius: 12px; background: #101828; color: #fff; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); animation: toast-in .25s ease; pointer-events: auto; }
.toast i { font-size: 16px; color: #5ee0a0; }
.toast--error i { color: #ff9a92; }
.toast.is-leaving { opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; }

/* Modal (native <dialog>) */
dialog.modal { width: calc(100% - 32px); max-width: 440px; padding: 0; border: 0; border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
dialog.modal::backdrop { background: rgba(12, 20, 36, .6); backdrop-filter: blur(2px); }
.modal__body { padding: 28px 24px 8px; text-align: center; }
.modal__icon { width: 52px; height: 52px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 50%; background: var(--warning-soft); color: var(--warning); font-size: 22px; }
.modal__title { font-size: 18px; font-weight: 700; }
.modal__text { margin-top: 8px; color: var(--text-2); white-space: pre-line; }
.modal__actions { display: flex; gap: 10px; padding: 20px 24px 24px; }
.modal__actions .btn { flex: 1; }

/* ---------- 5. Page-specific ---------- */

/* Support chat */
.chat { display: flex; flex-direction: column; height: calc(100vh - var(--topbar-h) - 190px); min-height: 460px; }
.chat__messages { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 14px; background: var(--surface-2); scroll-behavior: smooth; }
.message { display: flex; align-items: flex-end; gap: 10px; max-width: min(78%, 560px); animation: fade-up .3s ease both; }
.message.sent { margin-left: auto; flex-direction: row-reverse; }
.message-avatar { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: #e4e7ec; color: var(--text-2); font-size: 13px; }
.message.sent .message-avatar { background: var(--primary-soft); color: var(--primary); }
.message-bubble { padding: 10px 14px; border-radius: 16px 16px 16px 4px; background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-sm); min-width: 0; }
.message.sent .message-bubble { background: var(--primary); border-color: var(--primary); color: #fff; border-radius: 16px 16px 4px 16px; }
.message-text { word-break: break-word; }
.message-time { margin-top: 4px; font-size: 11px; opacity: .65; }
.empty-chat { margin: auto; text-align: center; color: var(--text-3); }
.empty-chat i { display: block; margin-bottom: 12px; font-size: 32px; opacity: .5; }
.chat__form { display: flex; align-items: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--border); background: var(--surface); border-radius: 0 0 var(--radius) var(--radius); }
.chat__input { flex: 1; min-height: 44px; max-height: 140px; padding: 11px 14px; border: 1px solid var(--border-strong); border-radius: 12px; resize: none; line-height: 1.4; }
.chat__input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.chat__send { width: 44px; height: 44px; padding: 0; border-radius: 12px; }

/* Success / timeline */
.success-mark { width: 72px; height: 72px; margin: 0 auto 20px; display: grid; place-items: center; border-radius: 50%; background: var(--success-soft); color: var(--success); font-size: 30px; box-shadow: 0 0 0 10px rgba(6, 118, 71, .07); animation: pop .5s cubic-bezier(.34, 1.56, .64, 1) both; }
.timeline { display: grid; gap: 0; text-align: left; margin: 28px 0; }
.timeline__item { position: relative; display: flex; gap: 14px; padding-bottom: 20px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 2px; background: var(--border); }
.timeline__num { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 700; }
.timeline__item strong { display: block; font-size: 14px; }
.timeline__item span { font-size: 14px; color: var(--text-3); }
.center { text-align: center; }

/* Auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--surface); }
.auth__aside {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: 48px 56px; color: #fff;
  background: radial-gradient(90% 70% at 100% 0%, rgba(93, 133, 255, .45) 0%, rgba(93, 133, 255, 0) 60%), linear-gradient(160deg, #0c1424 0%, #14275c 100%);
}
.auth__brand { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 700; color: inherit; }
.auth__brand:hover { text-decoration: none; }
.auth__headline { max-width: 460px; font-size: clamp(28px, 3.2vw, 40px); font-weight: 700; letter-spacing: -.03em; line-height: 1.15; }
.auth__lead { max-width: 440px; margin-top: 14px; color: #b9c4dc; font-size: 16px; }
.auth__features { display: grid; gap: 16px; margin-top: 36px; list-style: none; padding: 0; }
.auth__features li { display: flex; align-items: center; gap: 14px; color: #dbe3f3; font-weight: 500; }
.auth__features i { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: rgba(255, 255, 255, .09); color: #9db8ff; }
.auth__copy { font-size: 13px; color: #8d9bb8; }
.auth__main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth__card { width: 100%; max-width: 400px; }
.auth__card h1 { font-size: 26px; font-weight: 700; }
.auth__card > p { margin: 6px 0 28px; color: var(--text-3); }
.auth__mobile-brand { display: none; margin-bottom: 28px; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; color: var(--text); }
.auth__alt { margin-top: 24px; text-align: center; color: var(--text-3); font-size: 14px; }
.auth__alt a { font-weight: 600; }
.auth__solo { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(80% 60% at 50% 0%, #e6edff 0%, rgba(230, 237, 255, 0) 70%), var(--bg); }
.auth__solo .card { width: 100%; max-width: 520px; padding: 40px 32px; }
.errcode { font-size: clamp(64px, 14vw, 104px); font-weight: 800; letter-spacing: -.05em; line-height: 1; color: var(--primary); }

/* ---------- 6. Utilities & motion ---------- */
.text-muted { color: var(--text-3); }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }

/* ---------- 7. Responsive ---------- */
@media (max-width: 1024px) {
  .app__main { margin-left: 0; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.is-open { transform: none; box-shadow: var(--shadow-lg); }
  .scrim.is-visible { opacity: 1; pointer-events: auto; }
  .icon-btn.menu-btn { display: inline-grid; }
  .topbar { padding: 0 16px; }
  .page { padding: 20px 16px 40px; }
  .site-footer { padding: 18px 16px; }
  .hero-grid { grid-template-columns: 1fr; }
  body.nav-locked { overflow: hidden; }
}
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth__aside { display: none; }
  .auth__mobile-brand { display: flex; }
  .auth__main { align-items: flex-start; padding-top: 36px; }
}
@media (max-width: 640px) {
  .dropdown__name, .dropdown__toggle .fa-chevron-down { display: none; }
  .card__header, .card__body { padding: 18px; }
  .hero { padding: 22px; }
  .hero__actions { width: 100%; }
  .hero__actions .btn { flex: 1; }
  .grid-2, .rules { grid-template-columns: 1fr; }
  .page-header__actions { width: 100%; }
  .page-header__actions .btn { flex: 1; }
  .form-actions .btn { flex: 1; }
  .step__label { display: none; }
  .step.is-active .step__label { display: inline; }
  .message { max-width: 90%; }
  .chat { height: calc(100vh - var(--topbar-h) - 160px); }
  .chat__messages { padding: 16px; }
  .copy-field { flex-direction: column; }
  .toasts { left: 16px; right: 16px; bottom: 16px; }
  .toast { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .sidebar, .topbar, .site-footer, .toasts, .scrim { display: none !important; }
  .app__main { margin: 0; }
  body { background: #fff; }
}

/* ---------- 8. Additions ---------- */
.tabs--card { padding: 0 16px; margin-bottom: 0; }
.panel-toolbar { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); gap: 16px; align-items: start; }
.mini-list { display: grid; gap: 12px; margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--border); }
.mini-list > div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.mini-list dt { color: var(--text-3); }
.mini-list dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.center .form-actions { justify-content: center; }
.auth__solo h1 { font-size: 24px; font-weight: 700; }
