@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ═══════════════════════════════════════════════════════
   PURE FXWALLET — INVESTMENT PLATFORM
   Charcoal & Yellow — Current Product Palette
   ═══════════════════════════════════════════════════════ */

:root {
  --bg:  #0b0e11;
  --bg2: #101318;
  --bg3: #1e2329;

  --card:  #181a20;
  --card2: #1e2329;
  --card3: #252a31;

  --border:  #2b3139;
  --border2: #353b43;
  --border3: #474d57;

  --accent:        #f0b90b;
  --accent2:       #d9a600;
  --accent3:       #fcd535;
  --accent-bg:     rgba(240,185,11,.13);
  --accent-border: rgba(240,185,11,.32);
  --accent-glow:   rgba(240,185,11,.25);

  --green:         #0ecb81;
  --green-bg:      rgba(14,203,129,.12);
  --green-border:  rgba(14,203,129,.28);
  --red:           #f6465d;
  --red-bg:        rgba(246,70,93,.12);
  --red-border:    rgba(246,70,93,.28);
  --blue:          #4da2ff;
  --blue-bg:       rgba(77,162,255,.12);
  --blue-border:   rgba(77,162,255,.28);
  --purple:        #f0b90b;
  --purple-bg:     rgba(240,185,11,.12);
  --orange:        #f0b90b;
  --orange-bg:     rgba(242,184,75,.12);

  --txt:  #eaecef;
  --txt2: #b7bdc6;
  --txt3: #848e9c;

  --sidebar-bg:     #111318;
  --sidebar-bg2:    #181a20;
  --sidebar-border: rgba(255,255,255,.06);
  --sidebar-txt:    #eaecef;
  --sidebar-txt2:   #b7bdc6;
  --sidebar-txt3:   #848e9c;

  --shadow:      0 8px 40px rgba(0,0,0,.5);
  --shadow-sm:   0 2px 16px rgba(0,0,0,.35);
  --shadow-card: 0 2px 20px rgba(0,0,0,.3);
  --glow:        0 0 32px rgba(240,185,11,.22);
  --glow-sm:     0 0 16px rgba(240,185,11,.16);

  --r:  14px;
  --r2: 10px;
  --r3: 7px;
  --r4: 5px;

  --tr:      .18s ease;
  --tr-slow: .34s cubic-bezier(.4,0,.2,1);

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

/* ═══════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Tajawal', sans-serif;
  background: var(--bg);
  color: var(--txt);
  min-height: 100vh;
  direction: rtl;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border3); }

/* ═══════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════ */
.layout { display: flex; min-height: 100vh; }

.main-content {
  flex: 1;
  margin-right: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* ═══════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  position: fixed; top: 0; right: 0;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100svh;
  max-height: 100dvh;
  background: linear-gradient(180deg, var(--sidebar-bg2) 0%, var(--sidebar-bg) 58%, #0b0e11 100%);
  border-left: 1px solid rgba(255,255,255,.05);
  box-shadow: -4px 0 30px rgba(0,0,0,.35);
  display: flex; flex-direction: column;
  z-index: 100; transition: transform var(--tr-slow);
  overflow: hidden;
}

.desktop-sidebar-toggle-inside {
  position: absolute;
  top: 18px;
  left: 14px;
  z-index: 2;
}

.sidebar::before, .sidebar::after { display: none; }

.sidebar-logo {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; gap: 12px;
  position: relative; z-index: 1;
  background:
    radial-gradient(circle at top left, rgba(201,168,76,.14), transparent 45%),
    linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0));
}

.sidebar-logo-img {
  width: 54px; height: 54px;
  object-fit: contain;
  border-radius: 50%;
  flex-shrink: 0;
}

.logo-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff; font-weight: 900; flex-shrink: 0;
  box-shadow: 0 4px 16px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,.18);
}

.logo-text {
  font-size: 13px; font-weight: 700;
  color: var(--sidebar-txt); line-height: 1.2; letter-spacing: .2px;
}

.logo-sub {
  font-size: 10px; color: var(--sidebar-txt2); margin-top: 2px; font-weight: 400;
}

.app-shell-admin .sidebar-logo {
  padding: 11px 14px;
}

.app-shell-admin .sidebar-logo-img {
  width: 48px;
  height: 48px;
}

.app-shell-admin .logo-text {
  font-size: 12.5px;
}

.app-shell-admin .logo-sub {
  font-size: 9.5px;
}

.app-shell-admin .sidebar-nav {
  padding: 7px 8px;
}

.app-shell-admin .nav-label {
  padding: 7px 11px 3px;
}

.app-shell-admin .nav-item {
  padding: 7px 10px;
  font-size: 12.5px;
}

.app-shell-admin .nav-item .icon {
  font-size: 14px;
}

.app-shell-admin .sidebar-footer {
  padding: 9px 10px;
}

.sidebar-nav {
  flex: 1; padding: 8px 9px 14px; overflow-y: auto;
  position: relative; z-index: 1;
  scrollbar-gutter: stable;
  min-height: 0;
}

.nav-section { margin-bottom: 2px; }

.nav-label {
  font-size: 10.5px; color: var(--sidebar-txt3); text-transform: uppercase;
  letter-spacing: 1px; padding: 9px 12px 4px; font-weight: 700;
  opacity: 0.85;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 11px; border-radius: var(--r2);
  color: var(--sidebar-txt2); text-decoration: none;
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all var(--tr); margin-bottom: 1px;
  border: 1px solid transparent; background: none;
  width: 100%; text-align: right; letter-spacing: .1px;
}

.nav-item:hover {
  background: rgba(255,255,255,.07);
  color: var(--sidebar-txt); border-color: rgba(255,255,255,.08);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(240,185,11,.2), rgba(217,166,0,.1));
  color: var(--accent3);
  border-color: var(--accent-border);
  border-right: 2px solid var(--accent);
}

.nav-item.active .icon { color: var(--accent3); opacity: 1; }

.nav-item .icon {
  width: 22px; text-align: center; flex-shrink: 0;
  font-size: 15px; opacity: .55; transition: opacity var(--tr);
}

.nav-item:hover .icon { opacity: 1; }
.nav-text { flex: 1; }

.nav-badge {
  margin-right: auto; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 800;
  padding: 2px 6px; border-radius: 10px;
  min-width: 20px; text-align: center;
  animation: pulse-badge 2s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(239,68,68,.4);
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .7; transform: scale(.92); }
}

.sidebar-footer {
  padding: 10px 12px; border-top: 1px solid rgba(255,255,255,.07);
  position: relative; z-index: 1;
}

.sidebar-footer > .user-info {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--r2);
  background: rgba(255,255,255,.05); cursor: pointer;
  transition: all var(--tr); border: 1px solid rgba(255,255,255,.07);
}

.sidebar-footer > .user-info:hover {
  background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.12);
}

.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: #fff; flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(240,185,11,.28);
}

.user-name { font-size: 13px; font-weight: 600; color: var(--sidebar-txt); }
.user-role { font-size: 11px; color: var(--sidebar-txt3); margin-top: 1px; }

/* ═══════════════════════════════════════
   TOPBAR
   ═══════════════════════════════════════ */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  background: rgba(16,19,24,.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky; top: 0; z-index: 40;
  box-shadow: 0 1px 0 var(--border), var(--shadow-sm);
}

.topbar-title {
  font-size: 17px; font-weight: 700;
  color: var(--txt); letter-spacing: .2px;
}

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.notif-btn {
  position: relative;
  background: rgba(255,255,255,.05); border: 1px solid var(--border);
  color: var(--txt2); width: 42px; height: 42px;
  border-radius: var(--r2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 17px; transition: all var(--tr);
}

.notif-btn:hover {
  border-color: var(--accent-border); color: var(--accent);
  background: var(--accent-bg); box-shadow: var(--glow-sm);
}

.notif-badge {
  position: absolute; top: -5px; right: -5px;
  background: var(--red); color: #fff;
  font-size: 9px; font-weight: 800;
  padding: 0 4px; border-radius: 8px;
  min-width: 17px; text-align: center;
  height: 17px; line-height: 17px;
  border: 2px solid var(--bg);
  box-shadow: 0 0 6px rgba(239,68,68,.35);
}

.realtime-dot {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; color: var(--green);
  background: var(--green-bg); border: 1px solid var(--green-border);
  padding: 5px 13px; border-radius: 20px; font-weight: 600;
}

.realtime-dot::before {
  content: '';
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  animation: pulse-live 1.6s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse-live {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .4; transform: scale(.75); }
}

/* ═══════════════════════════════════════
   PAGE
   ═══════════════════════════════════════ */
.page { padding: 28px; display: none; animation: fadeInUp .22s ease; }
.page.active { display: block; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════
   STAT CARDS
   ═══════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px; margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 22px 20px 18px;
  position: relative; overflow: hidden;
  transition: all .2s ease; cursor: default;
  box-shadow: var(--shadow-card);
}

.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--border2), transparent);
  pointer-events: none;
}

.stat-card:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}

.stat-card.accent-card {
  border-top: 3px solid var(--accent);
  border-color: var(--accent-border);
}
.stat-card.accent-card::before { display: none; }
.stat-card.accent-card:hover { box-shadow: 0 8px 32px rgba(0,0,0,.4), var(--glow); }

.stat-card.green-card {
  border-top: 3px solid var(--green);
  border-color: var(--green-border);
}
.stat-card.green-card::before { display: none; }

.stat-card.red-card {
  border-top: 3px solid var(--red);
  border-color: var(--red-border);
}
.stat-card.red-card::before { display: none; }

.stat-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; margin-bottom: 14px;
}

.stat-icon {
  width: 44px; height: 44px; border-radius: var(--r2);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; flex-shrink: 0;
}

.stat-icon.gold   { background: var(--accent-bg); color: var(--accent3); }
.stat-icon.green  { background: rgba(34,197,94,.12);  color: var(--green); }
.stat-icon.red    { background: rgba(239,68,68,.12);  color: var(--red); }
.stat-icon.blue   { background: rgba(77,162,255,.12); color: var(--blue); }
.stat-icon.purple { background: var(--accent-bg); color: var(--accent3); }
.stat-icon.orange { background: rgba(245,158,11,.12); color: var(--orange); }

.stat-label { font-size: 12px; color: var(--txt2); font-weight: 500; line-height: 1.4; }

.stat-value {
  font-size: 26px; font-weight: 700; color: var(--txt);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: -.5px; line-height: 1.1;
}

.stat-sub { font-size: 11px; color: var(--txt3); margin-top: 6px; font-weight: 500; }

.stat-trend {
  font-size: 11px; margin-top: 8px;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px; font-weight: 600;
}

.stat-trend.up   { background: var(--green-bg); color: var(--green); }
.stat-trend.down { background: var(--red-bg);   color: var(--red); }

.stat-green  { color: var(--green)  !important; }
.stat-red    { color: var(--red)    !important; }
.stat-accent { color: var(--accent) !important; }
.stat-blue   { color: var(--blue)   !important; }

/* ═══════════════════════════════════════
   SECTION HEADER
   ═══════════════════════════════════════ */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; gap: 12px;
}

.section-title { font-size: 17px; font-weight: 700; color: var(--txt); }
.section-sub   { font-size: 13px; color: var(--txt2); margin-top: 3px; }

/* ═══════════════════════════════════════
   TABLE
   ═══════════════════════════════════════ */
.table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r); overflow: hidden;
  box-shadow: var(--shadow-card);
}

.table-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  background: var(--card2); flex-wrap: wrap; gap: 10px;
}

.table-title { font-size: 14px; font-weight: 600; color: var(--txt); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { width: 100%; border-collapse: collapse; }

.clients-table-scroll { overflow-x: visible; }
.clients-table {
  table-layout: fixed;
  min-width: 0;
}
.clients-table th,
.clients-table td {
  padding: 8px 5px;
  font-size: 11px;
  line-height: 1.35;
}
.clients-table th {
  white-space: normal;
  letter-spacing: 0;
}
.clients-table td {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.clients-table .font-mono {
  font-size: 10.5px;
}
.clients-table .badge {
  padding: 3px 7px;
  font-size: 10px;
}
.clients-table .action-btns {
  gap: 6px;
}
.client-row-actions {
  display: inline-grid;
  grid-template-columns: 1fr;
  width: 76px;
  max-width: 100%;
  justify-items: stretch;
  margin-inline: auto;
}
.client-action-btn {
  min-width: 0;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--r3);
  background: var(--bg2);
  color: var(--txt2);
  font-family: 'Tajawal', sans-serif;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  padding: 0 10px;
  cursor: pointer;
  transition: border-color var(--tr), background var(--tr), color var(--tr), transform var(--tr), box-shadow var(--tr);
}
.client-action-view {
  background: rgba(240,185,11,.10);
  border-color: rgba(77,162,255,.22);
  color: var(--blue);
}
.client-action-edit {
  background: rgba(212,175,55,.10);
  border-color: rgba(212,175,55,.24);
  color: var(--accent3);
}
.client-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0,0,0,.16);
}
.client-action-view:hover {
  border-color: rgba(77,162,255,.42);
  background: rgba(240,185,11,.16);
}
.client-action-edit:hover {
  border-color: rgba(212,175,55,.44);
  background: rgba(212,175,55,.16);
}
.clients-col-name { width: 11%; }
.clients-col-email { width: 18%; }
.clients-col-shares { width: 5%; }
.clients-col-money { width: 9%; }
.clients-col-group { width: 9%; }
.clients-col-roi { width: 7%; }
.clients-col-fee { width: 8%; }
.clients-col-status { width: 7%; }
.clients-col-actions { width: 10%; }

th {
  padding: 12px 16px; text-align: right;
  font-size: 11px; color: var(--txt3); font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.03); white-space: nowrap;
}

td {
  padding: 13px 16px; font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  vertical-align: middle; color: var(--txt);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.02); }

/* ═══════════════════════════════════════
   BADGES
   ═══════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 700;
  white-space: nowrap; letter-spacing: .2px;
}

.badge-green  { background: var(--green-bg);  color: var(--green);  border: 1px solid var(--green-border); }
.badge-red    { background: var(--red-bg);    color: var(--red);    border: 1px solid var(--red-border); }
.badge-yellow { background: var(--accent-bg); color: var(--accent3); border: 1px solid var(--accent-border); }
.badge-blue   { background: var(--blue-bg);   color: var(--blue);   border: 1px solid var(--blue-border); }
.badge-gray   { background: rgba(112,122,138,.1); color: var(--txt2); border: 1px solid rgba(112,122,138,.25); }
.badge-muted  { background: rgba(112,122,138,.07); color: var(--txt3); border: 1px solid rgba(112,122,138,.18); }

/* ═══════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--r2);
  font-size: 13px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent;
  font-family: 'Tajawal', sans-serif;
  transition: all var(--tr); text-decoration: none;
  white-space: nowrap; position: relative; overflow: hidden;
  letter-spacing: .1px;
}

.btn:active { transform: scale(.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #171a1f; border: none; font-weight: 800;
  box-shadow: 0 3px 14px rgba(240,185,11,.28);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #fcd535, #d9a600);
  box-shadow: 0 5px 22px rgba(240,185,11,.36);
}

.btn-secondary {
  background: rgba(255,255,255,.05); color: var(--txt); border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--border2); background: rgba(255,255,255,.08); color: var(--txt);
}

.btn-danger {
  background: var(--red-bg); color: var(--red); border-color: var(--red-border);
}

.btn-danger:hover {
  background: rgba(239,68,68,.2); border-color: rgba(239,68,68,.4);
}

.btn-success {
  background: var(--green-bg); color: var(--green); border-color: var(--green-border);
}

.btn-success:hover {
  background: rgba(34,197,94,.2); border-color: rgba(34,197,94,.4);
}

.btn-sm  { padding: 6px 13px; font-size: 12px; }
.btn-lg  { padding: 12px 26px; font-size: 14px; }
.btn-icon { padding: 9px; min-width: 40px; justify-content: center; }

.btn.loading { opacity: .65; pointer-events: none; }
.btn.loading::after {
  content: '';
  width: 13px; height: 13px;
  border: 2px solid rgba(255,255,255,.25); border-top-color: currentColor;
  border-radius: 50%; animation: spin .6s linear infinite; margin-right: 4px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════
   FORMS
   ═══════════════════════════════════════ */
.form-group { margin-bottom: 16px; }

.form-label {
  font-size: 13px; font-weight: 600;
  color: var(--txt2); margin-bottom: 7px; display: block;
}

.form-input {
  width: 100%; background: rgba(255,255,255,.04);
  border: 1.5px solid var(--border); border-radius: var(--r2);
  padding: 10px 14px; color: var(--txt);
  font-family: 'Tajawal', sans-serif;
  font-size: 14px; transition: all var(--tr);
  direction: rtl; line-height: 1.5;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255,255,255,.06);
  box-shadow: 0 0 0 3px rgba(240,185,11,.12);
}

.form-input::placeholder { color: var(--txt3); }
input.form-input:read-only,
textarea.form-input:read-only { opacity: .5; cursor: not-allowed; background: rgba(255,255,255,.02); }
select.form-input { cursor: pointer; }
/* Hide browser-native password reveal & autofill icons */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear { display: none; }
input::-webkit-credentials-auto-fill-button { visibility: hidden; pointer-events: none; }
input::-webkit-contacts-auto-fill-button   { visibility: hidden; pointer-events: none; }
/* Reserve real physical space for browser/extension helper icons so RTL/LTR text does not collide with them */
input.form-input:not(.date-part-input):not([type="password"]):not([type="number"]):not([type="date"]):not([type="time"]):not([type="datetime-local"]):not([type="month"]):not([type="week"]) {
  padding-right: 14px;
  padding-left: 56px;
}

input.form-input[dir="ltr"]:not(.date-part-input):not([type="password"]):not([type="number"]):not([type="date"]):not([type="time"]):not([type="datetime-local"]):not([type="month"]):not([type="week"]),
input.form-input[type="email"]:not([dir="rtl"]),
input.form-input[inputmode="email"]:not([dir="rtl"]),
input.form-input[type="tel"][dir="ltr"] {
  padding-right: 56px;
  padding-left: 14px;
}

.email-search-input {
  direction: ltr;
  text-align: left;
  padding-right: 56px !important;
  padding-left: 14px !important;
}

.email-search-input::placeholder {
  direction: ltr;
  text-align: left;
}
select.form-input option { background: var(--card2); color: var(--txt); }
textarea.form-input { resize: vertical; min-height: 100px; }

.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-note  { font-size: 12px; color: var(--txt3); margin-top: 6px; line-height: 1.5; }

/* Direct Call / Put picker on the portfolio trade form */
.trade-option-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.trade-option-choice {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.trade-option-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.trade-option-card {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg2);
  transition: border-color var(--tr), background var(--tr), box-shadow var(--tr), transform var(--tr);
}

.trade-option-choice:hover .trade-option-card {
  border-color: var(--border3);
  transform: translateY(-1px);
}

.trade-option-choice input:focus-visible + .trade-option-card {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.trade-option-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 19px;
  font-weight: 800;
}

.trade-option-call .trade-option-icon {
  color: var(--green);
  background: var(--green-bg);
}

.trade-option-put .trade-option-icon {
  color: var(--red);
  background: var(--red-bg);
}

.trade-option-copy {
  display: grid;
  gap: 1px;
  line-height: 1.2;
}

.trade-option-copy strong {
  color: var(--txt);
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
}

.trade-option-copy small {
  color: var(--txt3);
  font-size: 11px;
}

.trade-option-radio {
  width: 18px;
  height: 18px;
  margin-inline-start: auto;
  flex: 0 0 18px;
  border: 2px solid var(--border3);
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px var(--bg2);
  transition: border-color var(--tr), background var(--tr), box-shadow var(--tr);
}

.trade-option-call input:checked + .trade-option-card {
  border-color: var(--green-border);
  background: var(--green-bg);
  box-shadow: 0 0 0 3px rgba(14,203,129,.08);
}

.trade-option-call input:checked + .trade-option-card .trade-option-radio {
  border-color: var(--green);
  background: var(--green);
}

.trade-option-put input:checked + .trade-option-card {
  border-color: var(--red-border);
  background: var(--red-bg);
  box-shadow: 0 0 0 3px rgba(246,70,93,.08);
}

.trade-option-put input:checked + .trade-option-card .trade-option-radio {
  border-color: var(--red);
  background: var(--red);
}

/* Compact, searchable company-symbol dropdown */
.trade-symbol-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.trade-symbol-picker {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

button.trade-symbol-trigger.form-input {
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 13px;
  border-color: var(--border2);
  border-radius: 11px;
  background: linear-gradient(135deg, var(--bg3), var(--bg2));
  cursor: pointer;
  text-align: start;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}

.trade-symbol-trigger:disabled {
  cursor: not-allowed;
  opacity: .6;
}

.trade-symbol-current {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.trade-symbol-current-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent-border);
  border-radius: 9px;
  background: var(--accent-bg);
  color: var(--accent3);
}

.trade-symbol-current-icon svg {
  width: 17px;
  height: 17px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#trade-symbol-selected {
  min-width: 0;
  direction: ltr;
  unicode-bidi: isolate;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  color: var(--txt);
}

.trade-symbol-chevron {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  display: block;
  fill: none;
  stroke: var(--txt2);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--tr), stroke var(--tr);
}

button.trade-symbol-trigger.form-input[aria-expanded="true"] {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--card2), var(--bg2));
  box-shadow: 0 0 0 3px rgba(240,185,11,.1), inset 0 1px 0 rgba(255,255,255,.035);
}

.trade-symbol-trigger[aria-expanded="true"] .trade-symbol-chevron {
  stroke: var(--accent);
  transform: rotate(180deg);
}

.trade-symbol-menu {
  position: absolute;
  z-index: 120;
  top: calc(100% + 6px);
  inset-inline: 0;
  padding: 7px;
  border: 1px solid var(--border2);
  border-radius: 11px;
  background: linear-gradient(180deg, var(--card2), var(--card));
  box-shadow: 0 16px 38px rgba(0,0,0,.34), 0 0 0 1px rgba(255,255,255,.02);
}

.trade-symbol-menu[hidden] {
  display: none;
}

.trade-symbol-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 10px;
  margin-bottom: 7px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg2);
  color: var(--txt3);
}

.trade-symbol-search-wrap:focus-within {
  border-color: var(--accent-border);
}

.trade-symbol-search {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--txt);
  font: inherit;
  font-size: 13px;
}

.trade-symbol-search::placeholder {
  color: var(--txt3);
}

.trade-symbol-options {
  max-height: min(210px, 45vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  gap: 2px;
  padding-inline-end: 2px;
}

.trade-symbol-option {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--txt2);
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  text-align: start;
}

.trade-symbol-option:hover,
.trade-symbol-option:focus-visible {
  outline: none;
  border-color: transparent;
  background: rgba(255,255,255,.045);
  color: var(--txt);
}

.trade-symbol-option.is-selected {
  border-color: transparent;
  background: var(--accent-bg);
  color: var(--accent3);
}

.trade-symbol-option-check {
  width: 18px;
  color: var(--accent);
  font-family: inherit;
  text-align: center;
}

.trade-symbol-options::-webkit-scrollbar {
  width: 5px;
}

.trade-symbol-options::-webkit-scrollbar-track {
  background: transparent;
}

.trade-symbol-options::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--border3);
}

.trade-symbol-field > .btn {
  min-height: 50px;
  border-radius: 10px;
}

.trade-symbol-management-row {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.trade-symbol-management-row.is-featured {
  background: linear-gradient(90deg, transparent, rgba(240,185,11,.055), transparent);
}

.trade-symbol-management-name {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.trade-symbol-management-name strong {
  color: var(--txt);
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 800;
}

.trade-symbol-featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 7px;
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  background: var(--accent-bg);
  color: var(--accent3);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.trade-symbol-management-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.trade-symbol-feature-btn {
  border-color: var(--accent-border);
  background: transparent;
  color: var(--accent3);
}

.trade-symbol-feature-btn:hover,
.trade-symbol-feature-btn.is-featured {
  border-color: var(--accent-border);
  background: var(--accent-bg);
  color: var(--accent3);
}

.trade-entry-preview-btn {
  margin-top: 12px;
}

.trade-symbol-empty {
  padding: 18px 10px;
  color: var(--txt3);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 520px) {
  .trade-symbol-field {
    align-items: stretch;
    flex-direction: column;
  }

  .trade-symbol-field > .btn {
    width: auto;
    min-height: 40px;
    align-self: flex-start;
    padding-inline: 14px;
  }

  .trade-symbol-management-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .trade-symbol-management-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

/* ═══════════════════════════════════════
   CARD
   ═══════════════════════════════════════ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 22px; margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}

.card-title {
  font-size: 15px; font-weight: 700;
  margin-bottom: 20px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px; color: var(--txt);
}

/* ═══════════════════════════════════════
   MODAL
   ═══════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7); z-index: 1000;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: var(--r); width: 100%; max-width: 580px;
  max-height: 90vh; overflow-y: auto;
  animation: modalIn .22s ease;
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
  position: relative;
}

.modal::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent2), var(--accent), var(--accent3));
  border-radius: var(--r) var(--r) 0 0;
  pointer-events: none;
}

.modal-lg { max-width: 800px; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(.95) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-size: 16px; font-weight: 700; color: var(--txt); }

.modal-close {
  background: rgba(255,255,255,.05); border: 1px solid var(--border); color: var(--txt2); font-size: 18px;
  cursor: pointer; width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r3); transition: all var(--tr);
}

.modal-close:hover { background: rgba(255,255,255,.09); color: var(--txt); }

.modal-body   { padding: 24px; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
  flex-wrap: wrap; background: rgba(255,255,255,.02);
  border-radius: 0 0 var(--r) var(--r);
}

/* ═══════════════════════════════════════
   NOTIFICATION PANEL
   ═══════════════════════════════════════ */
.notif-panel {
  position: fixed; top: 0; left: 0; width: 380px; height: 100vh;
  background: var(--card); border-right: 1px solid var(--border);
  z-index: 200; transform: translateX(-100%);
  transition: transform var(--tr-slow);
  display: flex; flex-direction: column;
  box-shadow: 12px 0 40px rgba(0,0,0,.3);
}

.notif-panel.open { transform: translateX(0); }

.notif-panel-head {
  padding: 20px 18px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}

.notif-list { flex: 1; overflow-y: auto; padding: 10px; }

.notif-item {
  padding: 13px 14px; border-radius: var(--r2);
  border: 1px solid transparent; margin-bottom: 6px;
  cursor: pointer; transition: all var(--tr);
}

.notif-item:hover { background: var(--card2); border-color: var(--border); }

.notif-item.unread {
  background: var(--accent-bg); border-color: var(--accent-border);
}

.notif-item-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--txt); }
.notif-item-body  { font-size: 12px; color: var(--txt2); line-height: 1.55; }
.notif-item-time  { font-size: 11px; color: var(--txt3); margin-top: 7px; }

/* ═══════════════════════════════════════
   TOAST
   ═══════════════════════════════════════ */
.toast-container {
  position: fixed; top: 20px; left: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px; max-width: 340px;
}

.toast {
  background: var(--card2); border: 1px solid var(--border2);
  border-radius: var(--r2); padding: 13px 16px;
  font-size: 13px; min-width: 280px;
  display: flex; align-items: flex-start; gap: 10px;
  animation: toastIn .3s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,.4); line-height: 1.5;
}

.toast.success { border-right: 3px solid var(--green); }
.toast.error   { border-right: 3px solid var(--red); }
.toast.info    { border-right: 3px solid var(--accent); }

@keyframes toastIn {
  from { transform: translateX(-24px); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}

/* ═══════════════════════════════════════
   AUTH PAGE
   ═══════════════════════════════════════ */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; position: relative; overflow: hidden;
  background: var(--bg);
}

.auth-page::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 15% 50%, rgba(240,185,11,.12) 0%, transparent 50%),
    radial-gradient(ellipse at 88% 15%, rgba(77,162,255,.08) 0%, transparent 42%),
    radial-gradient(ellipse at 55% 90%, rgba(43,49,57,.16) 0%, transparent 40%);
  pointer-events: none;
}

.auth-page::after {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.auth-box {
  background: var(--card);
  border: 1px solid var(--border2); border-radius: var(--r);
  padding: 42px 38px; width: 100%; max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  position: relative; overflow: hidden; z-index: 1;
}

.auth-box::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent2), var(--accent), var(--accent3));
}

.auth-logo          { text-align: center; margin-bottom: 34px; }
.auth-logo h1       { font-size: 18px; font-weight: 800; color: var(--accent); margin-bottom: 4px; letter-spacing: .3px; }
.auth-logo p        { font-size: 12px; color: var(--txt2); margin-top: 4px; }

.auth-logo-img {
  width: 110px; height: 110px;
  object-fit: contain;
  border-radius: 50%;
  display: block;
  margin: 0 auto 14px;
}

.auth-divider {
  text-align: center; color: var(--txt3); font-size: 12px;
  position: relative; margin: 24px 0;
}

.auth-divider::before {
  content: '';
  position: absolute; top: 50%; left: 0; right: 0;
  height: 1px; background: var(--border);
}

.auth-divider span {
  background: var(--card); padding: 0 16px; position: relative;
}

/* ═══════════════════════════════════════
   SIGNATURE PAD
   ═══════════════════════════════════════ */
.sig-pad-wrap {
  border: 1.5px solid var(--border); border-radius: var(--r2);
  background: rgba(255,255,255,.03); overflow: hidden;
}

.sig-pad-wrap canvas { display: block; width: 100%; cursor: crosshair; }

.sig-pad-actions {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════
   PROGRESS STEPS
   ═══════════════════════════════════════ */
.steps { display: flex; gap: 0; margin-bottom: 30px; }
.step  { flex: 1; text-align: center; position: relative; }

.step::after {
  content: '';
  position: absolute; top: 16px; right: 50%;
  width: 100%; height: 2px; background: var(--border); z-index: 0;
}

.step:first-child::after { display: none; }

.step-circle {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--card2); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  margin: 0 auto 8px; position: relative; z-index: 1; transition: all var(--tr);
  color: var(--txt2);
}

.step.active .step-circle { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.step.done .step-circle   {
  background: linear-gradient(135deg, var(--accent), var(--accent2)); border-color: var(--accent); color: #fff;
  box-shadow: 0 0 12px rgba(240,185,11,.32);
}
.step.done::after { background: var(--accent); }
.step-label       { font-size: 11px; color: var(--txt2); }
.step.active .step-label { color: var(--accent); }

/* ═══════════════════════════════════════
   TOGGLE
   ═══════════════════════════════════════ */
.toggle-wrap { display: flex; align-items: center; gap: 12px; }

.toggle {
  position: relative; width: 48px; height: 26px;
  background: var(--border2); border-radius: 13px;
  cursor: pointer; transition: background var(--tr);
  border: 1px solid var(--border2);
}

.toggle.on { background: var(--green); border-color: var(--green); box-shadow: 0 0 12px rgba(34,197,94,.25); }

.toggle::after {
  content: '';
  position: absolute; top: 3px; right: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: transform var(--tr);
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}

.toggle.on::after { transform: translateX(-22px); }
.toggle-label { font-size: 14px; font-weight: 500; color: var(--txt); }

/* ═══════════════════════════════════════
   FILE UPLOAD
   ═══════════════════════════════════════ */
.file-upload {
  border: 2px dashed var(--border2); border-radius: var(--r2);
  padding: 30px; text-align: center; cursor: pointer;
  transition: all var(--tr); position: relative; background: rgba(255,255,255,.02);
}

.file-upload:hover { border-color: var(--accent-border); background: var(--accent-bg); }

.file-upload input {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}

.file-upload-icon { font-size: 32px; margin-bottom: 10px; color: var(--txt3); }
.file-upload-text { font-size: 13px; color: var(--txt2); }

.file-name {
  font-size: 12px; color: var(--green); margin-top: 10px;
  display: none; font-family: 'JetBrains Mono', monospace;
}

/* ═══════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════ */
.empty { text-align: center; padding: 56px 20px; color: var(--txt2); }
.empty-icon { font-size: 44px; margin-bottom: 14px; opacity: .3; }
.empty-text { font-size: 14px; }

/* ═══════════════════════════════════════
   DIVIDER
   ═══════════════════════════════════════ */
.divider { height: 1px; background: var(--border); margin: 22px 0; }

/* ═══════════════════════════════════════
   INFO BOX
   ═══════════════════════════════════════ */
.info-box {
  padding: 14px 16px; border-radius: var(--r2);
  font-size: 13px; line-height: 1.65;
  display: flex; align-items: flex-start; gap: 10px;
}

.info-box.warning { background: var(--orange-bg); border: 1px solid rgba(245,158,11,.22); color: var(--orange); }
.info-box.success { background: var(--green-bg);  border: 1px solid var(--green-border); color: var(--green); }
.info-box.error   { background: var(--red-bg);    border: 1px solid var(--red-border);   color: var(--red); }
.info-box.info    { background: var(--blue-bg);   border: 1px solid var(--blue-border);  color: var(--blue); }
.info-box.gold    { background: var(--accent-bg); border: 1px solid var(--accent-border);color: var(--accent3); }

/* ═══════════════════════════════════════
   MOBILE TOGGLE (FAB)
   ═══════════════════════════════════════ */
.mob-toggle {
  display: none;
  position: fixed; bottom: 24px; right: 20px; z-index: 300;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; width: 52px; height: 52px; border-radius: 50%;
  font-size: 22px; border: none; cursor: pointer;
  box-shadow: 0 6px 24px rgba(240,185,11,.35);
  transition: all var(--tr); align-items: center; justify-content: center;
}

.mob-toggle:hover  { transform: scale(1.06); }
.mob-toggle:active { transform: scale(.94); }

/* ═══════════════════════════════════════
   SIDEBAR OVERLAY
   ═══════════════════════════════════════ */
.sidebar-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  z-index: 99; display: none;
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}

/* ═══════════════════════════════════════
   TABS
   ═══════════════════════════════════════ */
.tabs {
  display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 22px;
}

.tab-btn {
  padding: 11px 20px; font-size: 13px; font-weight: 600;
  color: var(--txt2); background: none; border: none; cursor: pointer;
  font-family: 'Tajawal', sans-serif;
  border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all var(--tr);
}

.tab-btn:hover        { color: var(--txt); }
.tab-btn.active       { color: var(--accent); border-bottom-color: var(--accent); }
.tab-pane             { display: none; }
.tab-pane.active      { display: block; }

/* ═══════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════ */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-top: 1px solid var(--border);
  background: rgba(255,255,255,.02); flex-wrap: wrap; gap: 10px;
}

.pagination-info { font-size: 13px; color: var(--txt2); }
.pagination-btns { display: flex; gap: 6px; align-items: center; }

.page-btn {
  width: 36px; height: 36px; border-radius: var(--r2);
  background: rgba(255,255,255,.04); border: 1.5px solid var(--border);
  color: var(--txt2); font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--tr); font-family: 'JetBrains Mono', monospace;
}

.page-btn:hover        { border-color: var(--accent-border); color: var(--accent); background: var(--accent-bg); }
.page-btn.active       {
  background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700;
  box-shadow: 0 2px 10px rgba(240,185,11,.28);
}
.page-btn:disabled     { opacity: .35; cursor: not-allowed; }

/* ═══════════════════════════════════════
   COPY BUTTON
   ═══════════════════════════════════════ */
.copy-btn {
  background: none; border: 1px solid var(--border);
  color: var(--txt3); padding: 3px 9px; border-radius: var(--r4);
  font-size: 11px; cursor: pointer; transition: all var(--tr);
  display: inline-flex; align-items: center; gap: 4px;
  margin-right: 6px; font-family: 'Tajawal', sans-serif;
}

.copy-btn:hover  { border-color: var(--accent-border); color: var(--accent); }
.copy-btn.copied { border-color: var(--green-border); color: var(--green); }

/* ═══════════════════════════════════════
   SESSION BAR
   ═══════════════════════════════════════ */
.session-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(245,158,11,.95);
  backdrop-filter: blur(10px); color: #fff;
  padding: 14px 22px; display: flex; align-items: center;
  justify-content: space-between; z-index: 9000;
  font-size: 14px; font-weight: 600;
  transform: translateY(100%); transition: transform .4s ease;
  gap: 12px; flex-wrap: wrap;
}

.session-bar.show { transform: translateY(0); }

/* ═══════════════════════════════════════
   NOTES AREA
   ═══════════════════════════════════════ */
.notes-area {
  background: rgba(255,255,255,.03); border: 1.5px solid var(--border);
  border-radius: var(--r2); padding: 12px 14px;
  font-size: 13px; color: var(--txt); font-family: 'Tajawal', sans-serif;
  resize: vertical; min-height: 90px; width: 100%; transition: border-color var(--tr);
}

.notes-area:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(240,185,11,.12); }

/* ═══════════════════════════════════════
   SKELETON LOADER
   ═══════════════════════════════════════ */
.skeleton {
  background: linear-gradient(90deg, var(--card2) 25%, var(--card3) 50%, var(--card2) 75%);
  background-size: 200% 100%; animation: shimmer 1.6s infinite; border-radius: var(--r2);
}

@keyframes shimmer { to { background-position: -200% 0; } }

.skeleton-cell {
  height: 16px; border-radius: var(--r3);
  background: linear-gradient(90deg, var(--card2) 25%, var(--card3) 50%, var(--card2) 75%);
  background-size: 200% 100%; animation: shimmer 1.6s infinite;
}

/* ═══════════════════════════════════════
   PNL STATES
   ═══════════════════════════════════════ */
.pnl-positive { color: var(--green); }
.pnl-negative { color: var(--red); }
.pnl-zero     { color: var(--txt2); }

/* ═══════════════════════════════════════
   PASSWORD TOGGLE
   ═══════════════════════════════════════ */
.input-wrap { position: relative; }
.input-wrap .form-input { padding-left: 44px; }

.pw-eye {
  position: absolute; left: 0; top: 0; bottom: 0; width: 42px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; color: var(--txt3);
  cursor: pointer; border-radius: var(--r2) 0 0 var(--r2);
  transition: color var(--tr);
}
.pw-eye svg { pointer-events: none; display: block; }
.pw-eye:hover { color: var(--txt); }

/* ═══════════════════════════════════════
   CHART
   ═══════════════════════════════════════ */
.chart-wrap { position: relative; height: 230px; margin-top: 10px; }
.chart-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.chart-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 18px; margin-bottom: 22px;
}

.chart-card-full { grid-column: 1 / -1; }
.dashboard-chart-card .card-header { padding-bottom: 10px; }
.dashboard-chart-body { padding: 10px 14px 14px !important; }
.dashboard-chart-body .chart-wrap { height: 340px; margin-top: 0; }
.dashboard-chart-body canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.dashboard-scope-card {
  padding: 10px 14px !important;
  margin-bottom: 12px !important;
}
.dashboard-scope-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.dashboard-scope-copy {
  display: grid;
  gap: 2px;
}
.dashboard-scope-title {
  color: var(--txt);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}
.dashboard-scope-desc {
  color: var(--txt3);
  font-size: 11px;
  line-height: 1.4;
}
.dashboard-scope-select {
  width: 220px !important;
  min-height: 34px;
  padding: 7px 10px;
}
@media (max-width: 640px) {
  .dashboard-scope-card {
    padding: 10px !important;
  }
  .dashboard-scope-row {
    align-items: stretch;
  }
  .dashboard-scope-select {
    width: 100% !important;
  }
}

.analytics-page {
  display: grid;
  gap: 18px;
}

.analytics-section {
  display: grid;
  gap: 14px;
}

.analytics-section-head {
  display: grid;
  gap: 4px;
}

.analytics-section-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--txt);
}

.analytics-section-desc {
  color: var(--txt2);
  font-size: 13px;
  line-height: 1.7;
}

.analytics-chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.analytics-donut-wrap {
  height: 300px;
}

/* ═══════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════ */
.mono           { font-family: 'JetBrains Mono', monospace; }
.text-sm        { font-size: 12px; }
.text-xs        { font-size: 11px; }
.text-muted     { color: var(--txt2); }
.text-accent    { color: var(--accent); }
.text-green     { color: var(--green); }
.text-red       { color: var(--red); }
.fw-600         { font-weight: 600; }
.fw-700         { font-weight: 700; }
.mt-8           { margin-top: 8px; }
.mt-12          { margin-top: 12px; }
.mt-16          { margin-top: 16px; }
.mb-16          { margin-bottom: 16px; }
.gap-8          { gap: 8px; }
.flex           { display: flex; }
.flex-col       { display: flex; flex-direction: column; }
.items-center   { align-items: center; }
.justify-between{ justify-content: space-between; }
.flex-wrap      { flex-wrap: wrap; }

/* ═══════════════════════════════════════
   PRINT
   ═══════════════════════════════════════ */
.print-header { display: none; }

@media print {
  .sidebar, .topbar, .mob-toggle, .sidebar-overlay,
  .notif-panel, .toast-container, .session-bar,
  .btn:not(.print-keep), .nav-item, .table-head > *:last-child { display: none !important; }
  body { background: #fff; color: #000; direction: rtl; font-size: 12px; }
  .main-content { margin-right: 0 !important; }
  .page { display: block !important; padding: 0 !important; }
  .print-header { display: block !important; }
  .stat-card { border: 1px solid #ccc; background: #f9f9f9; break-inside: avoid; }
  .stat-value { color: #000 !important; font-size: 18px; }
  .stat-label { color: #444 !important; }
  table { min-width: unset !important; }
  th { background: #f0f0f0 !important; color: #444 !important; }
  th, td { padding: 8px !important; border: 1px solid #ddd !important; color: #000 !important; }
  .pnl-positive { color: #16a34a !important; }
  .pnl-negative { color: #dc2626 !important; }
}

/* ═══════════════════════════════════════
   TABLE LOADING
   ═══════════════════════════════════════ */
.table-loading tbody tr td { padding: 0 !important; border: none !important; }
.skeleton-row td { padding: 10px 16px !important; }

/* ══════════════════════════════════════════════════════
   RESPONSIVE — TABLET (≤ 1100px)
   ══════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  :root { --sidebar-w: 244px; }
  .stats-grid { grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); }
  .chart-grid { grid-template-columns: 1fr 1fr; }
  .analytics-chart-grid { grid-template-columns: 1fr; }
  .page { padding: 22px; }
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE — MOBILE (≤ 768px)
   ══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .analytics-donut-wrap { height: 260px; }
  .tx-summary { padding: 10px 14px; gap: 8px; }
  .tx-sum-item { font-size: 11px; }
  .wd-stepper-wrap { display: none; } /* hide stepper on very small, show badge instead */
  :root { --sidebar-w: 0px; }
  body { font-size: 14px; }
  .main-content { margin-right: 0; }

  .sidebar {
    width: min(88vw, 300px); transform: translateX(100%);
    box-shadow: -10px 0 50px rgba(0,0,0,.4);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }

  .topbar { padding: 0 16px; }
  .topbar-title { font-size: 15px; max-width: 52vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-actions { gap: 8px; }
  .realtime-dot { display: none; }
  .notif-btn { width: 38px; height: 38px; font-size: 16px; }

  .page { padding: 14px; }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
  .stat-card { padding: 14px 12px; }
  .stat-value { font-size: 20px; }
  .stat-label { font-size: 11px; }
  .stat-icon { width: 34px; height: 34px; font-size: 15px; }
  .stat-sub { font-size: 11px; }

  .card { padding: 16px; margin-bottom: 14px; }
  .card-title { font-size: 14px; margin-bottom: 14px; }

  .form-row, .form-grid3 { grid-template-columns: 1fr; gap: 12px; }
  .form-input { font-size: 14px; padding: 9px 12px; }
  .form-label { font-size: 12px; }
  .form-group { margin-bottom: 12px; }

  .btn { padding: 9px 14px; font-size: 13px; }
  .btn-lg { padding: 11px 20px; font-size: 14px; }
  .btn-sm { padding: 6px 10px; font-size: 12px; }

  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab-btn { padding: 9px 14px; font-size: 12px; white-space: nowrap; flex-shrink: 0; }

  .table-head { flex-direction: column; align-items: stretch; padding: 12px 14px; gap: 8px; }
  .table-head .table-title { font-size: 13px; }
  .table-head input.form-input,
  .table-head input[type="text"],
  .table-head input[type="search"] { width: 100% !important; min-width: 0 !important; }
  .table-head > div { flex-wrap: wrap !important; width: 100%; }
  .table-head select.form-input { flex: 1; min-width: 120px; }

  /* ═══════════════════════════════════════════════
     TABLE → CARD TRANSFORMATION (Mobile)
     ═══════════════════════════════════════════════ */
  .table-scroll { overflow-x: visible !important; }
  .table-scroll table, .table-scroll tbody { display: block; width: 100%; }
  .table-scroll thead { display: none; }

  .table-scroll tr {
    display: block; background: var(--card);
    border: 1px solid var(--border); border-radius: var(--r);
    margin-bottom: 10px; padding: 12px 14px;
    transition: border-color var(--tr);
    box-shadow: var(--shadow-card);
  }

  .table-scroll tr:hover { border-color: var(--border2); }
  .table-scroll tr:last-child { border-bottom: 1px solid var(--border) !important; }

  .table-scroll td {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.05);
    font-size: 13px; min-height: 36px; gap: 8px;
    text-align: left; border-radius: 0; background: transparent !important;
  }

  .table-scroll td:last-child { border-bottom: none; }

  .table-scroll td::before {
    content: attr(data-label);
    color: var(--txt3); font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .5px;
    flex-shrink: 0; min-width: 72px; order: 1;
  }

  .table-scroll td > * { order: 0; }
  .table-scroll table { min-width: 0 !important; }
  table { min-width: 0 !important; }

  .clients-table .client-row-actions {
    width: min(100%, 190px);
    max-width: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .clients-table .client-action-btn {
    min-height: 36px;
    font-size: 11px;
  }

  .notif-panel { width: 100%; border-right: none; }

  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100%; max-height: 92vh;
    border-radius: var(--r) var(--r) 0 0; margin-top: auto;
  }
  .modal::before { border-radius: var(--r) var(--r) 0 0; }
  .modal-lg { max-width: 100%; }
  .modal-body   { padding: 16px; }
  .modal-header { padding: 16px 18px; }
  .modal-footer { padding: 14px 16px; flex-wrap: wrap; gap: 8px; }
  .modal-footer .btn { flex: 1; min-width: 120px; justify-content: center; }

  .auth-box { padding: 28px 20px; }
  .auth-logo-img { width: 120px; height: 120px; }
  .steps { margin-bottom: 20px; }
  .step-label { font-size: 10px; }
  .step-circle { width: 28px; height: 28px; font-size: 11px; }

  .toast-container { left: 10px; right: 10px; max-width: 100%; }
  .toast { min-width: unset; font-size: 12px; }

  .section-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .pagination { padding: 10px 14px; }
  .pagination-info { font-size: 12px; }
  .file-upload { padding: 22px 16px; }
  .session-bar { padding: 12px 16px; font-size: 13px; }
  .chart-grid { grid-template-columns: 1fr; }
  .chart-wrap { height: 200px; }
  .topbar { height: auto; min-height: var(--topbar-h); padding: 12px 16px; }
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE — SMALL MOBILE (≤ 480px)
   ══════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .page { padding: 10px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card  { padding: 12px 10px; }
  .stat-value { font-size: 19px; letter-spacing: -.3px; }
  .stat-label { font-size: 10px; }
  .stat-icon  { display: none; }
  .auth-box { padding: 22px 16px; }
  .auth-logo-img { width: 100px; height: 100px; }
  .sidebar-logo-img { width: 86px; height: 86px; }
  .step-circle { width: 26px; height: 26px; font-size: 10px; }
  .step-label  { font-size: 9px; }
  .steps       { margin-bottom: 16px; }
  .modal-footer { flex-direction: column; }
  .modal-footer .btn { width: 100%; justify-content: center; }
  .tab-btn { padding: 8px 12px; font-size: 11px; }
  .card { padding: 12px; }
  .card-title { font-size: 13px; }
  .form-input { font-size: 14px; }
  .toast { padding: 10px 12px; font-size: 12px; }
  .notif-panel-head { padding: 14px; }
  .notif-item { padding: 10px 12px; }
  .notif-item-title { font-size: 12px; }
  .notif-item-body  { font-size: 11px; }
  .chart-wrap { height: 170px; }
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE — EXTRA SMALL (≤ 360px)
   ══════════════════════════════════════════════════════ */
@media (max-width: 360px) {
  .page { padding: 8px; }
  .stats-grid { gap: 6px; }
  .stat-card { padding: 10px 8px; }
  .stat-value { font-size: 17px; }
  .btn { padding: 8px 10px; font-size: 12px; }
  .btn-sm { padding: 5px 8px; font-size: 11px; }
  .modal-body { padding: 12px; }
  .tab-btn { padding: 7px 10px; font-size: 11px; }
  .auth-box { padding: 18px 12px; }
}

/* ══════════════════════════════════════════════════════
   GLOBAL PROGRESS BAR (NProgress-style)
   ══════════════════════════════════════════════════════ */
#nprogress-bar {
  position: fixed; top: 0; left: 0; right: 0;
  height: 3px; z-index: 99999; pointer-events: none;
  background: linear-gradient(90deg, var(--accent2), var(--accent), var(--accent3));
  width: 0%; opacity: 0;
  box-shadow: 0 0 10px var(--accent-glow);
  border-radius: 0 2px 2px 0;
}


/* ══════════════════════════════════════════════════════
   WITHDRAWAL STATUS STEPPER (Client)
   ══════════════════════════════════════════════════════ */
.wd-stepper {
  display: flex; align-items: center; gap: 0;
  padding: 8px 0;
}
.wd-step {
  display: flex; align-items: center; gap: 0; flex: 1; position: relative;
}
.wd-step-dot {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; border: 2px solid var(--border);
  background: var(--card2); color: var(--txt3); z-index: 1;
  transition: all var(--tr);
}
.wd-step-line {
  flex: 1; height: 2px; background: var(--border); margin: 0 -1px;
}
.wd-step.done .wd-step-dot   { background: var(--green); border-color: var(--green); color: #fff; }
.wd-step.done .wd-step-line  { background: var(--green); }
.wd-step.active .wd-step-dot { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }
.wd-step-label {
  position: absolute; top: 28px; left: 50%; transform: translateX(-50%);
  font-size: 10px; color: var(--txt3); white-space: nowrap; font-weight: 600;
}
.wd-step.done   .wd-step-label  { color: var(--green); }
.wd-step.active .wd-step-label  { color: var(--accent); }
.wd-stepper-wrap { padding-bottom: 30px; }

/* ══════════════════════════════════════════════════════
   TRANSACTION SUMMARY BAR (Client)
   ══════════════════════════════════════════════════════ */
.tx-summary {
  display: flex; gap: 12px; flex-wrap: wrap;
  padding: 12px 20px; background: var(--card2);
  border-bottom: 1px solid var(--border);
}
.tx-sum-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--txt2);
}
.tx-sum-value { font-weight: 700; font-family: 'JetBrains Mono', monospace; font-size: 13px; }
.tx-sum-value.positive { color: var(--green); }
.tx-sum-value.negative { color: var(--red); }
.tx-sum-value.accent   { color: var(--accent); }

/* Sortable column header */
th.sortable {
  cursor: pointer; user-select: none;
}
th.sortable:hover { color: var(--accent); }
th.sort-asc::after  { content: ' ↑'; color: var(--accent); }
th.sort-desc::after { content: ' ↓'; color: var(--accent); }

/* ══════════════════════════════════════════════════════
   THEME TOGGLE BUTTON
   ══════════════════════════════════════════════════════ */
.theme-btn {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  color: var(--txt2);
  width: 42px; height: 42px;
  border-radius: var(--r2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 17px;
  transition: all var(--tr);
  flex-shrink: 0;
}

.theme-btn:hover {
  border-color: var(--accent-border);
  color: #f0b90b;
  background: var(--accent-bg);
  box-shadow: var(--glow-sm);
}

.theme-btn-float {
  position: fixed;
  top: 18px; left: 18px;
  z-index: 100;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border2);
  color: var(--txt2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px;
  transition: all var(--tr);
  box-shadow: var(--shadow-sm);
}

.theme-btn-float:hover {
  border-color: var(--accent-border);
  color: var(--accent);
  box-shadow: var(--glow-sm);
}

/* Professional SVG theme switcher. */
.theme-btn,
.theme-btn-float {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 12px;
  border-color: rgba(255,255,255,.12);
  background: linear-gradient(145deg, rgba(255,255,255,.075), rgba(255,255,255,.025));
  color: var(--txt2);
}

.theme-btn-float {
  position: fixed;
  top: 18px;
  right: auto;
  left: 18px;
}

.theme-btn::before,
.theme-btn-float::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .75;
  background: radial-gradient(circle at 30% 22%, rgba(240,185,11,.16), transparent 58%);
  transition: opacity .2s ease, transform .25s ease;
}

.theme-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .28s cubic-bezier(.2,.8,.2,1), color .2s ease;
}

.theme-btn:hover,
.theme-btn-float:hover {
  color: var(--accent3);
  border-color: var(--accent-border);
  background: linear-gradient(145deg, rgba(240,185,11,.18), rgba(240,185,11,.06));
  box-shadow: 0 0 0 3px rgba(240,185,11,.06), 0 8px 20px rgba(0,0,0,.22);
}

.theme-btn:hover::before,
.theme-btn-float:hover::before {
  opacity: 1;
  transform: scale(1.16);
}

.theme-btn:hover .theme-icon-sun,
.theme-btn-float:hover .theme-icon-sun {
  transform: rotate(30deg) scale(1.08);
}

.theme-btn:hover .theme-icon-moon,
.theme-btn-float:hover .theme-icon-moon {
  transform: rotate(-14deg) scale(1.08);
}

.theme-btn:active .theme-icon,
.theme-btn-float:active .theme-icon {
  transform: scale(.9);
}

.theme-btn:focus-visible,
.theme-btn-float:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

[data-theme="light"] .theme-btn,
[data-theme="light"] .theme-btn-float {
  background: linear-gradient(145deg, #ffffff, #f0f1f2);
  border-color: var(--border);
  color: #6b5200;
  box-shadow: 0 4px 14px rgba(24,26,32,.08);
}

@media (prefers-reduced-motion: reduce) {
  .theme-btn,
  .theme-btn-float,
  .theme-btn::before,
  .theme-btn-float::before,
  .theme-icon {
    transition: none;
  }
}

/* ══════════════════════════════════════════════════════
   LIGHT MODE — Variable Overrides
   ══════════════════════════════════════════════════════ */
[data-theme="light"] {
  --bg:    #f5f6f7;
  --bg2:   #f0f1f2;
  --bg3:   #eaecef;
  --card:  #ffffff;
  --card2: #f5f6f7;
  --card3: #f0f1f2;
  --border:  rgba(71,77,87, .20);
  --border2: rgba(71,77,87, .32);
  --border3: rgba(71,77,87, .44);
  --txt:  #111318;
  --txt2: #5e6673;
  --txt3: #707a8a;
  --accent: #e5ad00;
  --accent2: #c99400;
  --accent3: #8f6c00;
  --accent-bg: rgba(240,185,11,.10);
  --accent-border: rgba(240,185,11,.28);
  --accent-glow: rgba(240,185,11,.18);
  --green: #2d7a5f;
  --green-bg: rgba(45,122,95,.10);
  --green-border: rgba(45,122,95,.24);
  --red: #b54a4a;
  --red-bg: rgba(181,74,74,.10);
  --red-border: rgba(181,74,74,.24);
  --blue: #e5ad00;
  --blue-bg: rgba(229,173,0,.10);
  --blue-border: rgba(229,173,0,.24);
  --orange: #c99400;
  --orange-bg: rgba(201,148,0,.10);
  --orange-border: rgba(201,148,0,.24);
  --purple: #c99400;
  --purple-bg: rgba(240,185,11,.10);
  --sidebar-bg: #111318;
  --sidebar-bg2: #181a20;
  --sidebar-border: rgba(183,189,198,.10);
  --sidebar-txt: #eaecef;
  --sidebar-txt2: #b7bdc6;
  --sidebar-txt3: #848e9c;
  --shadow:      0 16px 40px rgba(24,26,32, .10);
  --shadow-sm:   0 6px 18px rgba(24,26,32, .08);
  --shadow-card: 0 4px 16px rgba(24,26,32, .07);
  --glow:        0 0 24px rgba(240,185,11,.18);
  --glow-sm:     0 0 12px rgba(240,185,11,.12);
}

[data-theme="light"] .topbar {
  background: rgba(255,255,255, .94);
  border-bottom-color: rgba(240,185,11,.24);
  box-shadow: 0 1px 0 rgba(240,185,11,.14), 0 8px 20px rgba(24,26,32,.06);
}

[data-theme="light"] .notif-btn { background: var(--card2); }
[data-theme="light"] .notif-badge { border-color: var(--bg2); }

[data-theme="light"] td { border-bottom-color: var(--border); }
[data-theme="light"] tr:hover td { background: var(--card2); }
[data-theme="light"] th { background: var(--bg); }
[data-theme="light"] .table-head { background: var(--bg); }

[data-theme="light"] .form-input { background: var(--bg); }
[data-theme="light"] .form-input:focus { background: var(--card); border-color: var(--accent); box-shadow: 0 0 0 3px rgba(240,185,11,.14); }
[data-theme="light"] select.form-input option { background: #fff; color: var(--txt); }
[data-theme="light"] .form-input:read-only { background: var(--bg3); }

[data-theme="light"] .btn-secondary { background: var(--card2); border-color: var(--border); }
[data-theme="light"] .btn-secondary:hover { background: var(--card3); border-color: var(--accent-border); color: var(--txt); }

[data-theme="light"] .page-btn { background: var(--card); }
[data-theme="light"] .pagination { background: var(--bg); }

[data-theme="light"] .auth-page {
  background: linear-gradient(135deg, #f5f6f7 0%, #f5f6f7 50%, #eaecef 100%);
}
[data-theme="light"] .auth-page::before {
  background:
    radial-gradient(ellipse at 10% 50%, rgba(240,185,11,.08) 0%, transparent 48%),
    radial-gradient(ellipse at 90% 15%, rgba(53,59,67,.06) 0%, transparent 42%),
    radial-gradient(ellipse at 55% 90%, rgba(71,77,87,.06) 0%, transparent 40%);
}
[data-theme="light"] .auth-page::after {
  background-image:
    linear-gradient(rgba(71,77,87,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(71,77,87,.045) 1px, transparent 1px);
  background-size: 40px 40px;
}
[data-theme="light"] .auth-box {
  background: var(--card);
  border-color: var(--border2);
  box-shadow: var(--shadow);
}
[data-theme="light"] .auth-divider span { background: var(--card); }

[data-theme="light"] .modal { background: var(--card); border-color: var(--border2); }
[data-theme="light"] .modal-close:hover { background: var(--bg3); }
[data-theme="light"] .modal-footer { background: var(--bg3); }

[data-theme="light"] .toast { background: var(--card); border-color: var(--border2); box-shadow: var(--shadow-sm); }

[data-theme="light"] .notif-panel { background: var(--card); }
[data-theme="light"] .notif-item.unread { background: var(--accent-bg); border-color: var(--accent-border); }

[data-theme="light"] .file-upload { background: var(--bg3); border-color: var(--border2); }
[data-theme="light"] .file-upload:hover { background: var(--accent-bg); border-color: var(--accent-border); }

[data-theme="light"] .skeleton,
[data-theme="light"] .skeleton-cell {
  background: linear-gradient(90deg, var(--bg2) 25%, var(--bg3) 50%, var(--bg2) 75%);
  background-size: 200% 100%;
}

[data-theme="light"] .sig-pad-wrap { background: var(--bg3); }
[data-theme="light"] .notes-area { background: var(--bg3); }
[data-theme="light"] .notes-area:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(240,185,11,.14); }

[data-theme="light"] ::-webkit-scrollbar-track { background: var(--bg3); }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: var(--border2); }

[data-theme="light"] .theme-btn { background: var(--bg3); }
[data-theme="light"] .theme-btn-float { background: var(--card); }

[data-theme="light"] .table-scroll td { border-bottom-color: var(--border); }
[data-theme="light"] .stat-card:hover { box-shadow: 0 10px 28px rgba(24,26,32,.10); }

[data-theme="light"] .alert-badge-item { background: var(--orange-bg); }
[data-theme="light"] .tx-summary { background: var(--bg3); }
[data-theme="light"] .wd-step-dot { background: var(--bg3); }
[data-theme="light"] .wd-step-line { background: var(--border2); }
[data-theme="light"] .wd-step.done .wd-step-line { background: var(--green); }

/* ══════════════════════════════════════════════════════
   REGISTRATION FORM — ENHANCED COMPONENTS
   ══════════════════════════════════════════════════════ */

/* Wide auth-box for registration */
.auth-box { transition: max-width var(--tr-slow); }
.auth-box.wide { max-width: 700px; }
.auth-register-prompt {
  margin: -2px 0 10px;
  color: var(--txt2);
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
}

/* Registration guidance and email verification */
.registration-step-intro {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  margin-bottom: 18px;
  border: 1px solid var(--accent-border);
  border-radius: var(--r2);
  background: linear-gradient(135deg, var(--accent-bg), transparent);
}
.registration-step-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: var(--bg2);
  border: 1px solid var(--accent-border);
  font-size: 17px;
  font-weight: 700;
}
.registration-step-intro > div {
  flex: 1;
  min-width: 0;
}
.registration-step-intro h4 { margin: 0 0 4px; font-size: 14px; color: var(--txt); }
.registration-step-intro p { margin: 0; color: var(--txt2); font-size: 12px; line-height: 1.7; }
.registration-step-intro-compact {
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
}
.registration-step-intro-compact .registration-step-icon {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  font-size: 15px;
}
.registration-step-intro-compact h4 {
  margin-bottom: 2px;
  font-size: 13.5px;
}
.registration-step-intro-compact p {
  font-size: 11.5px;
  line-height: 1.45;
}
body.registration-active .auth-page {
  min-height: 100dvh;
  height: 100dvh;
  padding: 10px;
  overflow: hidden;
}
body.registration-active .auth-box {
  box-sizing: border-box;
  max-height: calc(100dvh - 20px);
  padding: 20px 28px;
  overflow-y: auto;
  scrollbar-width: none;
}
body.registration-active .auth-box::-webkit-scrollbar { display: none; }
body.registration-active .auth-logo { display: none; }
/* Keep a compact company mark visible outside the registration dialog. */
.registration-brand { display: none; }
body.registration-active .registration-brand {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 110;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  padding: 6px;
  border: 1px solid var(--border2);
  border-radius: 16px;
  background: var(--card);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}
body.registration-active .registration-brand img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 11px;
}
body.registration-active #register-form .registration-form-head { margin-bottom: 14px !important; }
body.registration-active #register-form .registration-form-head h3 {
  flex: 1;
  min-width: 0;
  margin: 0;
  line-height: 1.35;
  text-align: right;
}
body.registration-active .registration-step-intro { margin-bottom: 12px; padding: 12px; }
.registration-restore-loader {
  display: none;
}
body.registration-active #register-form.registration-restoring > :not(.registration-restore-loader) {
  display: none !important;
}
body.registration-active #register-form.registration-restoring .registration-restore-loader {
  display: grid !important;
  place-items: center;
  gap: 12px;
  min-height: 260px;
  color: var(--txt2);
  font-size: 13px;
  font-weight: 700;
}

/* Investment Summary Card */
.invest-summary {
  background: linear-gradient(135deg, rgba(240,185,11,.15), rgba(217,166,0,.08));
  border: 1px solid var(--accent-border);
  border-radius: var(--r2); padding: 14px 20px;
  text-align: center; margin-top: 12px;
  animation: fadeInUp .2s ease;
}
.invest-summary-row {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; flex-wrap: wrap;
  font-family: 'JetBrains Mono', monospace; font-size: 16px; font-weight: 700;
}
.invest-summary-x  { color: var(--txt3); font-size: 13px; font-weight: 400; }
.invest-summary-total { color: var(--accent); font-size: 22px; }
.invest-summary-local {
  color: var(--txt2);
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  font-weight: 700;
  margin-top: 5px;
}
.invest-summary-label { font-size: 11px; color: var(--txt2); margin-top: 5px; }
.registration-step-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.registration-password-input {
  user-select: none;
  -webkit-user-select: none;
}

/* Inline Field Validation */
.field-error { font-size: 11px; color: var(--red); margin-top: 4px; display: none; }
.form-input.is-invalid { border-color: var(--red-border) !important; }
.form-input.is-valid   { border-color: var(--green-border) !important; }

/* File Upload — Improved */
.file-upload.drag-over { border-color: var(--accent); background: var(--accent-bg); transform: scale(1.01); }
.file-upload.has-file  { border-color: var(--green-border); border-style: solid; background: var(--green-bg); }
.file-upload-icon-svg  { display: flex; justify-content: center; margin-bottom: 8px; }
.file-upload-hint      { display: none !important; }

body.registration-active #drop-receipt.file-upload {
  min-height: 116px;
  padding: 16px 18px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
}

body.registration-active #drop-receipt .file-upload-icon-svg {
  margin-bottom: 2px;
}

body.registration-active #drop-receipt .file-upload-icon-svg svg {
  width: 26px;
  height: 26px;
}

body.registration-active #drop-receipt .file-upload-text {
  line-height: 1.35;
}

body.registration-active #drop-receipt .file-upload-hint {
  margin-top: 0;
}

.file-info {
  display: none; margin-top: 8px;
  background: var(--bg2); border: 1px solid var(--green-border);
  border-radius: var(--r3); padding: 8px 12px;
}
.file-info-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--green); font-family: 'JetBrains Mono', monospace;
}
.file-info-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-info-size { color: var(--txt3); flex-shrink: 0; }
.file-remove {
  background: none; border: none; color: var(--txt3); cursor: pointer;
  font-size: 14px; padding: 0 4px; flex-shrink: 0; line-height: 1;
  transition: color var(--tr);
}
.file-remove:hover { color: var(--red); }

/* Registration bank transfer details */
.registration-bank-transfer {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--accent-border);
  border-radius: var(--r2);
  background:
    linear-gradient(135deg, rgba(240,185,11,.12), transparent 58%),
    var(--bg2);
}
.registration-bank-transfer-head {
  display: grid;
  gap: 4px;
}
.registration-bank-transfer-head strong {
  color: var(--txt);
  font-size: 14px;
}
.registration-bank-transfer-head span {
  color: var(--txt2);
  font-size: 12px;
  line-height: 1.7;
}
.registration-bank-transfer .registration-shares-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 5px;
  width: 100%;
  margin-bottom: 0;
  direction: rtl;
}
.registration-shares-field .form-label {
  flex: 0 0 auto;
  margin: 0;
  color: var(--txt2);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  direction: rtl;
}
.registration-shares-field .form-input {
  flex: none;
  width: 220px;
  max-width: 100%;
  height: 34px;
  min-height: 34px;
  max-height: 34px;
  padding: 5px 14px;
  font-size: 13px;
  line-height: 1.2;
  text-align: center;
  border-radius: 9px;
}
.registration-shares-field .form-input::placeholder {
  font-size: 11.5px;
  text-align: center;
}
#r-shares::-webkit-outer-spin-button,
#r-shares::-webkit-inner-spin-button,
#new-shares::-webkit-outer-spin-button,
#new-shares::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
#r-shares,
#new-shares {
  appearance: textfield;
  -moz-appearance: textfield;
  direction: rtl;
  text-align: center !important;
  text-indent: 0;
  padding-inline: 14px !important;
}
#r-shares::placeholder {
  direction: rtl;
  text-align: center !important;
}
.registration-shares-field .field-error {
  display: none !important;
  margin: 0;
}
.registration-transfer-amounts {
  display: flex;
  align-items: center;
  gap: 7px 10px;
  min-width: 0;
  margin-top: 7px;
  padding: 7px 10px;
  border: 1px solid rgba(240,185,11,.24);
  border-radius: var(--r3);
  background: rgba(240,185,11,.06);
  color: var(--txt2);
  flex-wrap: wrap;
}
.registration-transfer-amounts > span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}
.registration-transfer-amounts > b {
  color: var(--txt);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.registration-transfer-amounts em {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--txt);
  font-size: 13px;
  font-style: normal;
  line-height: 1.35;
}
.registration-transfer-arrow {
  display: inline-grid;
  place-items: center;
  color: var(--accent);
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}
.registration-transfer-amounts em strong {
  color: var(--txt);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.registration-transfer-error {
  display: none;
  width: 100%;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
  text-align: center;
  white-space: normal;
}
.registration-transfer-amounts.is-error {
  justify-content: center;
  margin-top: 3px;
  border-color: rgba(239, 68, 68, .42);
  background: rgba(239, 68, 68, .075);
}
.registration-transfer-amounts.is-error > span:not(.registration-transfer-arrow),
.registration-transfer-amounts.is-error > b,
.registration-transfer-amounts.is-error > em {
  display: none !important;
}
.registration-transfer-amounts.is-error .registration-transfer-error {
  display: block;
}
.registration-bank-details {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-top: 3px;
}
.registration-bank-detail {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r3);
  background: rgba(255,255,255,.03);
}
.registration-bank-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.registration-bank-detail span {
  color: var(--txt3);
  font-size: 10.5px;
  font-weight: 700;
}
.registration-bank-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 3px 9px;
  border: 1px solid var(--accent-border);
  border-radius: 7px;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: border-color var(--tr), background var(--tr), color var(--tr);
}
.registration-bank-copy-btn:hover,
.registration-bank-copy-btn:focus-visible {
  border-color: var(--accent);
  background: rgba(240,185,11,.18);
}
.registration-bank-copy-btn:disabled {
  cursor: default;
  opacity: .75;
}
.registration-bank-detail b {
  color: var(--txt);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.registration-bank-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-top: 3px;
}
.registration-bank-actions .btn {
  min-height: 38px;
  padding-inline: 12px;
  font-size: 12px;
}
.registration-bank-qr-cta {
  border-color: rgba(240,185,11,.56) !important;
  background: linear-gradient(180deg, rgba(240,185,11,.95), rgba(217,166,0,.95)) !important;
  color: #101318 !important;
  box-shadow: 0 10px 22px rgba(240,185,11,.18);
  font-weight: 900;
}
.registration-bank-qr-cta:hover,
.registration-bank-qr-cta:focus-visible {
  border-color: rgba(240,214,138,.9) !important;
  background: linear-gradient(180deg, #fcd535, #f0b90b) !important;
  color: #111318 !important;
  transform: translateY(-1px);
}
.registration-bank-qr-dialog {
  max-width: 420px;
}
.registration-bank-qr-frame {
  display: grid;
  place-items: center;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--r2);
  background: var(--bg2);
}
.registration-bank-qr-frame img {
  display: block;
  width: min(100%, 280px);
  max-height: 320px;
  object-fit: contain;
  padding: 8px;
  border-radius: 8px;
  background: #fff;
}
.registration-bank-qr-note {
  margin: 12px 0 0;
  color: var(--txt2);
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}
.registration-bank-qr-download {
  width: 100%;
  justify-content: center;
  margin-top: 12px;
}

/* Agreement reader */
.agreement-step-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.agreement-step-note {
  margin: 0 0 8px;
  color: var(--txt2);
  font-size: 12px;
  line-height: 1.6;
}
.agreement-clause-note {
  width: fit-content;
  max-width: 100%;
  margin: 0 0 8px;
  padding: 4px 9px;
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-bg);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
}
.agreement-reader-shell {
  margin-bottom: 9px;
  border: 1px solid var(--border);
  border-radius: var(--r2);
  background: var(--bg2);
  overflow: hidden;
}
.agreement-reader {
  min-height: 220px;
  max-height: clamp(220px, 38vh, 340px);
  overflow: auto;
  padding: 12px 14px;
  color: var(--txt);
  background:
    linear-gradient(180deg, rgba(255,255,255,.025), transparent 90px),
    var(--card);
  font-size: 12.5px;
  line-height: 1.75;
  scrollbar-width: thin;
}
.agreement-reader h3,
.agreement-reader h4,
.agreement-reader p {
  margin: 0;
}
.agreement-reader h3 {
  margin: 8px 0 6px;
  color: var(--txt);
  font-size: 13px;
  line-height: 1.6;
  font-weight: 800;
}
.agreement-reader h4 {
  display: inline-flex;
  margin: 9px 0 5px;
  padding: 2px 8px;
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-bg);
  font-size: 11.5px;
  font-weight: 800;
}
.agreement-reader p {
  margin-bottom: 4px;
  color: var(--txt2);
}
.agreement-reader-brand-line {
  color: var(--txt);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 700;
  direction: ltr;
  text-align: center;
  line-height: 1.55;
}
.agreement-reader-space {
  height: 5px;
}
.agreement-reader-loading {
  min-height: 150px;
  display: grid;
  place-items: center;
  color: var(--txt3);
  font-size: 12px;
}
.agreement-accept-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0 0 10px;
  padding: 9px 10px;
  border: 1px solid var(--green-border);
  border-radius: var(--r2);
  background: var(--green-bg);
  color: var(--txt);
  cursor: pointer;
}
.agreement-accept-row input {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  flex: 0 0 17px;
  accent-color: var(--green);
  cursor: pointer;
}
.agreement-accept-row span {
  font-size: 12px;
  line-height: 1.6;
  color: var(--txt);
}
.agreement-step-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.agreement-accepted-document {
  border-color: var(--green-border);
  background: var(--green-bg);
}

/* Review Step */
.review-invest-card {
  background: linear-gradient(135deg, rgba(240,185,11,.2), rgba(217,166,0,.12));
  border: 1px solid var(--accent-border); border-radius: var(--r2);
  padding: 18px; text-align: center; margin-bottom: 20px;
}
.review-invest-amount { font-size: 32px; font-weight: 800; color: var(--accent); font-family: 'JetBrains Mono', monospace; line-height: 1; }
.review-invest-label  { font-size: 12px; color: var(--txt2); margin-top: 6px; }
.review-invest-shares { font-size: 13px; color: var(--txt3); margin-top: 3px; }

.review-section { margin-bottom: 18px; }
.review-section-title {
  font-size: 11px; font-weight: 700; color: var(--accent3);
  letter-spacing: .6px; text-transform: uppercase;
  margin-bottom: 10px; padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.review-item { background: var(--bg2); border-radius: var(--r3); padding: 10px 14px; border: 1px solid var(--border); }
.review-item-label { font-size: 10px; color: var(--txt3); margin-bottom: 3px; text-transform: uppercase; letter-spacing: .3px; }
.review-item-value { font-size: 13px; color: var(--txt); font-weight: 500; word-break: break-all; }
.review-item-value.mono { font-family: 'JetBrains Mono', monospace; }

.review-files { display: flex; flex-direction: column; gap: 6px; }
.review-file  { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--green); }
.review-file-name { color: var(--txt2); font-family: 'JetBrains Mono', monospace; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Status banner improved */
.status-banner-pending {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--accent-bg); border: 1px solid var(--accent-border);
  border-radius: var(--r2); padding: 16px 18px; margin-bottom: 20px;
}
.status-banner-rejected {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--red-bg); border: 1px solid var(--red-border);
  border-radius: var(--r2); padding: 16px 18px; margin-bottom: 20px;
}
.status-banner-icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.status-banner-text { flex: 1; font-size: 13px; line-height: 1.6; }
.status-banner-title { font-weight: 700; margin-bottom: 2px; }

/* Light mode overrides for new components */
[data-theme="light"] .invest-summary { background: linear-gradient(135deg, rgba(240,185,11,.10), rgba(240,185,11,.04)); }
[data-theme="light"] .review-item    { background: var(--card2); border-color: var(--border); }
[data-theme="light"] .review-invest-card { background: linear-gradient(135deg, rgba(240,185,11,.12), rgba(240,185,11,.05)); }
[data-theme="light"] .file-info { background: var(--card2); }
[data-theme="light"] .file-upload.has-file { background: var(--green-bg); }
[data-theme="light"] .status-banner-pending { background: var(--accent-bg); }
[data-theme="light"] .status-banner-rejected { background: var(--red-bg); }

@media (max-width: 640px) {
  .auth-box.wide { max-width: 100%; }
  .review-grid { grid-template-columns: 1fr; }
  body.registration-active {
    min-height: 100svh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  body.registration-active .theme-btn-float {
    top: max(12px, env(safe-area-inset-top));
    left: 12px;
    width: 38px;
    height: 38px;
  }
  body.registration-active .auth-page {
    min-height: 100svh;
    height: auto;
    align-items: flex-start;
    justify-content: center;
    padding: calc(env(safe-area-inset-top) + 64px) 10px 24px;
    overflow: visible;
  }
  body.registration-active .auth-box {
    max-height: none;
    padding: 16px;
    overflow: visible;
    scrollbar-width: auto;
    transform: none;
  }
  body.registration-active .auth-box::-webkit-scrollbar {
    display: initial;
  }
  body.registration-active .registration-brand {
    top: max(10px, env(safe-area-inset-top));
    right: 12px;
    width: 46px;
    height: 46px;
    padding: 4px;
    border-radius: 13px;
  }
  body.registration-active .registration-step-intro { padding: 10px; margin-bottom: 10px; }
  .agreement-reader {
    min-height: 195px;
    max-height: 36vh;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.7;
  }
  .agreement-accept-row {
    padding: 8px 9px;
  }
}

/* ═══════════════════════════════════════════════════════
   MPA PAGES — Multi-page application styles  v9
   ═══════════════════════════════════════════════════════ */

/* ── Layout shell ────────────────────────────────────────────────────────── */
.main-wrap {
  margin-inline-start: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-inline-start var(--tr-slow);
}

body.sidebar-collapsed .sidebar {
  transform: translateX(100%);
}

body.sidebar-collapsed .main-wrap {
  margin-inline-start: 0;
}

body.sidebar-collapsed .page-content {
  max-width: 1680px;
}

body.sidebar-collapsed .topbar {
  padding-inline-start: 72px;
}

.desktop-sidebar-show {
  position: fixed;
  top: 18px;
  right: 14px;
  z-index: 90;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  color: var(--txt2);
  width: 42px;
  height: 42px;
  border-radius: var(--r2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--tr);
  opacity: 0;
  pointer-events: none;
  transform: translateX(10px);
}

.desktop-sidebar-show:hover {
  border-color: var(--accent-border);
  color: var(--accent);
  background: var(--accent-bg);
  box-shadow: var(--glow-sm);
}

.desktop-sidebar-show svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
}

body.sidebar-collapsed .desktop-sidebar-show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.page-content {
  flex: 1;
  padding: 28px 32px;
  max-width: 1400px;
  width: 100%;
  transition: max-width var(--tr-slow), padding var(--tr);
}

body.public-faq-guest .sidebar,
body.public-faq-guest .desktop-sidebar-show,
body.public-faq-guest .sidebar-overlay,
body.public-faq-guest .mobile-bottom-nav,
body.public-faq-guest .sidebar-toggle,
body.public-faq-guest .realtime-dot,
body.public-faq-guest .notif-btn,
body.public-faq-guest .topbar-breadcrumbs {
  display: none !important;
}

body.public-faq-guest .main-wrap {
  margin-inline-start: 0;
}

body.public-faq-guest .topbar {
  padding-inline: 20px;
}

body.public-faq-guest .topbar-actions {
  margin-inline-start: auto;
}

body.public-faq-guest .page-content {
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

/* ── Sidebar brand (MPA names) ───────────────────────────────────────────── */
.sidebar-brand {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
.brand-logo {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(240,185,11,.32);
}
.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.brand-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--txt);
  letter-spacing: .2px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-role {
  font-size: 11px;
  color: var(--txt3);
  font-weight: 400;
}

/* ── Nav icon span (MPA names) ───────────────────────────────────────────── */
.nav-icon {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  font-size: 15px;
  opacity: .6;
  transition: opacity var(--tr);
}
.nav-item:hover .nav-icon,
.nav-item.active .nav-icon { opacity: 1; }

/* ── Sidebar overlay (mobile) ────────────────────────────────────────────── */

/* ── Nav badges (sidebar counters) ──────────────────────────────────────── */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 9px;
  margin-inline-start: auto;
}

/* ── Nav section labels ──────────────────────────────────────────────────── */
.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--txt3);
  padding: 14px 18px 4px;
}

/* ── Sidebar footer ──────────────────────────────────────────────────────── */
.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.sidebar-user .user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  background: none;
  border: none;
  padding: 0;
  border-radius: 0;
  cursor: default;
  align-items: flex-start;
  flex: 1;
}
.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--txt);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-role { font-size: 11px; color: var(--txt3); }
.sidebar-actions { display: flex; gap: 4px; }

/* ── Topbar ──────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--topbar-h);
  padding: 0 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.topbar-title { flex: 1; }
.page-title   { font-size: 18px; font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.sidebar-toggle { display: none; }
.desktop-sidebar-toggle {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  color: var(--txt2);
  width: 42px;
  height: 42px;
  border-radius: var(--r2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--tr);
  flex-shrink: 0;
}

.desktop-sidebar-toggle:hover {
  border-color: var(--accent-border);
  color: var(--accent);
  background: var(--accent-bg);
  box-shadow: var(--glow-sm);
}

.desktop-sidebar-toggle svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
}

/* ── Notification panel ──────────────────────────────────────────────────── */
.notif-btn-wrap { position: relative; }
.notif-badge {
  position: absolute;
  top: -2px;
  inset-inline-end: -2px;
  min-width: 16px;
  height: 16px;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 8px;
  padding: 0 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.notif-panel {
  display: none;
  position: fixed;
  top: var(--topbar-h);
  inset-inline-end: 16px;
  width: 340px;
  max-height: 480px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  z-index: 200;
  overflow: hidden;
  flex-direction: column;
}
.notif-panel.open { display: flex; }
.notif-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
}
.notif-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.notif-item {
  padding: 10px 12px;
  border-radius: var(--r3);
  cursor: pointer;
  transition: background var(--tr);
}
.notif-item:hover { background: var(--bg3); }
.notif-item.unread { background: var(--accent-bg); }
.notif-item-title { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.notif-item-time  { font-size: 11px; color: var(--txt3); }

/* ── Stats grid (MPA only — scoped to .main-wrap) ──────────────────────── */
.main-wrap .stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
  align-items: start;
}
.main-wrap .capital-stat-stack {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.main-wrap .stat-card {
  background:
    linear-gradient(135deg, rgba(77,162,255,.08), transparent 56%),
    var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  align-items: stretch;
  gap: 14px;
  min-height: 108px;
  overflow: hidden;
  transition: transform var(--tr), border-color var(--tr), box-shadow var(--tr), background var(--tr);
  position: relative;
}
.main-wrap .stat-card::before {
  content: '';
  position: absolute;
  inset-inline: 16px;
  top: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--blue), transparent);
  opacity: .65;
}
.main-wrap .stat-card:hover {
  border-color: var(--accent-border);
  box-shadow: 0 12px 28px rgba(0,0,0,.22), var(--glow-sm);
  transform: translateY(-2px);
}
.main-wrap .stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  flex-shrink: 0;
  align-self: flex-start;
}
.main-wrap .stat-icon svg {
  width: 21px;
  height: 21px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.main-wrap .stat-icon.stat-blue   { background: var(--blue-bg);   color: var(--blue); }
.main-wrap .stat-icon.stat-green  { background: var(--green-bg);  color: var(--green); }
.main-wrap .stat-icon.stat-red    { background: var(--red-bg);    color: var(--red); }
.main-wrap .stat-icon.stat-gold   { background: var(--orange-bg); color: var(--orange); }
.main-wrap .stat-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}
.main-wrap .stat-label {
  font-size: 12px;
  color: var(--txt3);
  margin-bottom: 5px;
  font-weight: 700;
  line-height: 1.35;
}
.main-wrap .stat-value {
  color: var(--txt);
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(19px, 1.55vw, 24px);
  font-weight: 800;
  line-height: 1.1;
  text-shadow: 0 10px 22px rgba(77,162,255,.18);
}
.main-wrap .stat-sub {
  color: var(--txt3);
  font-size: 11px;
  margin-top: 6px;
  display: block;
  line-height: 1.45;
}
.main-wrap .portfolio-distribution-card {
  grid-column: span 2;
  display: block;
  padding: 18px 20px;
}
.portfolio-distribution-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.portfolio-distribution-total {
  color: var(--txt);
  font-family: 'JetBrains Mono', monospace;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.2;
}
.portfolio-distribution-list {
  display: grid;
  gap: 10px;
}
.portfolio-distribution-row {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r3);
  background: rgba(255,255,255,.025);
}
.portfolio-distribution-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.portfolio-distribution-name {
  min-width: 0;
  color: var(--txt);
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.portfolio-distribution-amount {
  flex: 0 0 auto;
  color: var(--txt);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 800;
}
.portfolio-distribution-track {
  height: 6px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bg3);
}
.portfolio-distribution-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--blue));
}
.portfolio-distribution-percent,
.portfolio-distribution-empty {
  margin-top: 6px;
  color: var(--txt3);
  font-size: 11px;
}
.portfolio-distribution-empty {
  margin-top: 0;
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: var(--r3);
  text-align: center;
}
.capital-cta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--accent-border);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(240,185,11,.10), transparent 58%),
    var(--card);
  box-shadow: 0 10px 24px rgba(0,0,0,.16);
}
.capital-cta-main {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.capital-cta-title {
  color: var(--txt);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}
.capital-cta-sub {
  margin-top: 2px;
  color: var(--txt3);
  font-size: 11px;
}
.capital-cta-sub strong {
  color: var(--txt);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
}
.capital-cta-button {
  min-height: 32px;
  gap: 6px;
  padding-inline: 12px;
  border-radius: 9px;
  font-size: 12px;
  flex: 0 0 auto;
}
.capital-cta-button-icon,
.capital-cta-button svg {
  width: 15px;
  height: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.capital-cta-button svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.trend-up   { color: var(--green); }
.trend-down { color: var(--red); }

/* Skeleton loading */
.skeleton-card {
  background: linear-gradient(90deg, var(--card) 25%, var(--card2) 50%, var(--card) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  min-height: 90px;
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Card (MPA — scoped to .main-wrap) ──────────────────────────────────── */
.main-wrap .card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}
.main-wrap .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.main-wrap .card-title { font-size: 14px; font-weight: 600; }
.main-wrap .card-body  { padding: 20px; }
.main-wrap .card-body.p-0 { padding: 0; }
.main-wrap .card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 20px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 20px; }

/* ── Grid layouts ────────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 24px; }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th {
  padding: 10px 16px;
  text-align: start;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--txt3);
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  white-space: nowrap;
}
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  vertical-align: middle;
}
.table tbody tr:hover { background: rgba(255,255,255,.02); }
.table tbody tr:last-child td { border-bottom: 0; }
.row-muted td { opacity: .5; }

.portfolio-history-scroll {
  overflow-x: hidden;
}

.portfolio-history-table {
  table-layout: fixed;
  width: 100%;
  font-size: 13px;
}

.portfolio-history-table th,
.portfolio-history-table td {
  padding: 11px 8px;
  line-height: 1.45;
  text-align: center;
}

.portfolio-history-table th {
  white-space: normal;
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
  font-weight: 700;
}

.portfolio-history-table td {
  overflow-wrap: anywhere;
}

.portfolio-history-table .font-mono {
  font-size: 12px;
}

.portfolio-history-table .btn-sm {
  padding: 6px 11px;
  font-size: 12px;
}

/* ── Table loader ────────────────────────────────────────────────────────── */
.table-loader {
  display: flex;
  justify-content: center;
  padding: 48px;
}
.spinner-center {
  display: flex;
  justify-content: center;
  padding: 48px;
}
.spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  text-align: center;
}
.empty-icon  { font-size: 40px; margin-bottom: 12px; opacity: .5; }
.empty-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.empty-desc  { font-size: 13px; color: var(--txt3); }
.empty-state-sm {
  text-align: center;
  padding: 24px;
  font-size: 13px;
  color: var(--txt3);
}

/* ── Filter row ──────────────────────────────────────────────────────────── */
.filter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  padding: 0 12px;
  flex: 1;
  min-width: 200px;
}
.search-icon  { color: var(--txt3); font-size: 14px; }
.search-input {
  background: none;
  border: none;
  outline: none;
  color: var(--txt);
  font-family: inherit;
  font-size: 13px;
  padding: 9px 0;
  width: 100%;
}
.w-auto { width: auto !important; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--r3);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--tr);
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary   { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent3); }
.btn-secondary { background: var(--blue); color: #fff; }
.btn-success   { background: var(--green); color: #fff; }
.btn-danger    { background: var(--red); color: #fff; }
.btn-ghost     { background: transparent; color: var(--txt2); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg3); color: var(--txt); }
.btn-link      { background: none; border: none; color: var(--accent); font-size: 12px; cursor: pointer; padding: 0; }
.btn-icon      {
  background: none;
  border: 1px solid var(--border);
  color: var(--txt2);
  width: 34px;
  height: 34px;
  border-radius: var(--r3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all var(--tr);
}
.btn-icon:hover { background: var(--bg3); color: var(--txt); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.w-full { width: 100%; justify-content: center; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--r4);
  font-size: 11px;
  font-weight: 600;
}
.badge-success { background: var(--green-bg);  color: var(--green);  border: 1px solid var(--green-border); }
.badge-danger  { background: var(--red-bg);    color: var(--red);    border: 1px solid var(--red-border); }
.badge-warn    { background: var(--orange-bg); color: var(--orange); border: 1px solid rgba(245,158,11,.3); }
.badge-info    { background: var(--blue-bg);   color: var(--blue);   border: 1px solid var(--blue-border); }
.badge-neutral { background: var(--bg3); color: var(--txt3); border: 1px solid var(--border); }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-grid   { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-group  { display: flex; flex-direction: column; margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }
.form-label  { font-size: 12px; font-weight: 600; color: var(--txt2); margin-bottom: 6px; }
.form-label.mb-0 { margin-bottom: 0; }
.form-input,
.form-select,
.form-textarea {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  color: var(--txt);
  font-family: inherit;
  font-size: 13px;
  padding: 9px 12px;
  transition: border-color var(--tr);
  outline: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus { border-color: var(--accent); }
.form-hint   { font-size: 11px; color: var(--txt3); margin-top: 4px; }
.form-actions { padding-top: 16px; border-top: 1px solid var(--border); margin-top: 16px; }
.form-textarea { resize: vertical; min-height: 80px; }

/* Toggle switch */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
.toggle-input  { display: none; }
.toggle-slider {
  width: 40px;
  height: 22px;
  background: var(--border);
  border-radius: 11px;
  position: relative;
  transition: background var(--tr);
  flex-shrink: 0;
}
.toggle-slider::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  inset-inline-start: 3px;
  transition: transform var(--tr);
}
.toggle-input:checked + .toggle-slider { background: var(--green); }
.toggle-input:checked + .toggle-slider::after { transform: translateX(18px); }
[dir="rtl"] .toggle-input:checked + .toggle-slider::after { transform: translateX(-18px); }

/* Portfolio group settings */
.portfolio-settings-card {
  padding: 0;
  border-color: var(--accent-border);
}
.portfolio-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 26px 18px;
  background: linear-gradient(135deg, rgba(77,162,255, .08), transparent 62%);
}
.portfolio-settings-title {
  color: var(--txt);
  font-size: 17px;
  font-weight: 800;
}
.portfolio-settings-subtitle {
  max-width: 760px;
  margin-top: 8px;
  color: var(--txt3);
  font-size: 12px;
  line-height: 1.8;
}
.portfolio-settings-save-btn {
  flex: 0 0 auto;
  min-width: 138px;
}
.portfolio-settings-body {
  padding: 0 26px 24px;
}
.main-wrap .portfolio-settings-body {
  padding: 0 26px 24px;
}
.portfolio-group-settings-grid {
  display: grid;
  align-items: start;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.portfolio-setting-group {
  margin: 0;
}
.portfolio-setting-card {
  min-height: 118px;
  height: 100%;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--r3);
  background: var(--bg2);
  gap: 16px;
  transition: border-color var(--tr), background var(--tr), box-shadow var(--tr);
}
.portfolio-setting-card:hover {
  border-color: var(--accent-border);
  background: var(--bg3);
  box-shadow: var(--glow-sm);
}
.portfolio-setting-card > span {
  min-width: 0;
}
.portfolio-setting-card .form-label {
  color: var(--txt);
  font-size: 13px;
  font-weight: 800;
}
.portfolio-setting-card .form-hint {
  color: var(--txt3);
  line-height: 1.75;
}
.portfolio-default-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.portfolio-default-setting .form-input {
  flex: 0 0 min(240px, 46%);
  min-width: 190px;
  height: 42px;
}
.portfolio-setting-group .form-note {
  margin: 10px 2px 0;
  color: var(--txt3);
  line-height: 1.7;
}
.portfolio-amount-setting-group {
  grid-column: 1 / -1;
}
@media (max-width: 1100px) {
  .portfolio-group-settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .portfolio-settings-header {
    align-items: stretch;
    flex-direction: column;
    padding: 18px 18px 14px;
  }
  .portfolio-settings-save-btn {
    width: 100%;
  }
  .portfolio-settings-body {
    padding: 0 18px 18px;
  }
  .main-wrap .portfolio-settings-body {
    padding: 0 18px 18px;
  }
  .portfolio-group-settings-grid {
    grid-template-columns: 1fr;
  }
  .portfolio-default-setting {
    align-items: stretch;
    flex-direction: column;
  }
  .portfolio-default-setting .form-input {
    flex: 0 0 auto;
    min-width: 0;
    width: 100%;
  }
}

/* Admin settings */
.settings-page {
  --settings-border: rgba(183,189,198, .18);
  --settings-border-strong: rgba(240,185,11, .34);
  --settings-surface: rgba(24,26,32, .96);
  --settings-surface-soft: rgba(16,19,24, .74);
  --settings-shadow: 0 16px 38px rgba(9,12,15, .22);
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  display: grid;
  gap: 18px;
}

.settings-page #settings-content {
  display: grid;
  gap: 18px;
}

.settings-form {
  display: grid;
  gap: 18px;
}

.settings-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 2px 4px;
  margin-bottom: 2px;
}

.section-eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  margin-bottom: 6px;
}

.settings-page-head h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.25;
}

.settings-page-head p {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--txt2);
  font-size: 13px;
  line-height: 1.8;
}

.settings-autosave {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 13px;
  border: 1px solid var(--settings-border);
  border-radius: 8px;
  background: rgba(16,19,24, .72);
  color: var(--txt2);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.settings-autosave.is-saving {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-bg);
}

.settings-autosave.is-saved {
  color: var(--green);
  border-color: var(--green-border);
  background: var(--green-bg);
}

.settings-autosave.is-error {
  color: var(--red);
  border-color: var(--red-border);
  background: var(--red-bg);
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 18px;
}

.settings-page .settings-panel.card {
  position: relative;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--settings-border);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .008)),
    var(--settings-surface);
  box-shadow: var(--settings-shadow);
}

.settings-page .settings-panel.card::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(240,185,11, .62), rgba(20, 184, 166, .32), transparent);
  pointer-events: none;
}

.settings-page .settings-panel .card-header {
  align-items: center;
  gap: 16px;
  min-height: 0;
  padding: 20px 24px 18px;
  border-bottom: 1px solid var(--settings-border);
  background:
    linear-gradient(90deg, rgba(240,185,11, .085), rgba(20, 184, 166, .035) 48%, transparent),
    rgba(10, 17, 29, .18);
}

.settings-page .settings-panel .card-header > div {
  min-width: 0;
}

.settings-page .settings-panel .card-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--txt);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.35;
}

.settings-page .settings-panel .card-title::before {
  content: "";
  width: 4px;
  height: 21px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--accent3), var(--accent2));
  box-shadow: 0 0 14px rgba(240,185,11, .16);
}

.settings-minimum-panel .card-title::before {
  background: linear-gradient(180deg, var(--blue), #14b8a6);
  box-shadow: 0 0 14px rgba(20, 184, 166, .14);
}

.settings-admin-account .card-title::before {
  background: linear-gradient(180deg, var(--green), var(--accent));
  box-shadow: 0 0 14px rgba(14,203,129, .14);
}

.settings-page .settings-panel .card-header .text-muted {
  margin-top: 8px;
  color: var(--txt3);
  line-height: 1.75;
}

.settings-page .settings-panel .card-body {
  padding: 24px;
}

.settings-page .settings-panel .card-body.p-0 {
  padding: 0;
}

.settings-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.settings-page .settings-field {
  min-width: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.settings-page .settings-field .form-label {
  margin: 0;
  color: var(--txt2);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.settings-page .settings-field:focus-within .form-label {
  color: var(--accent3);
}

.settings-page .form-input {
  min-height: 46px;
  border-radius: 8px;
  border-color: rgba(183,189,198, .2);
  background: rgba(9,12,15, .54);
}

.settings-page .form-input:focus {
  border-color: var(--settings-border-strong);
  background: rgba(9,12,15, .72);
  box-shadow: 0 0 0 4px rgba(240,185,11, .1);
}

.settings-wide,
.settings-admin-account,
.settings-investment-panel,
.settings-admin-shortcuts {
  grid-column: 1 / -1;
}

.settings-admin-shortcuts {
  background:
    linear-gradient(180deg, rgba(77,162,255,.045), rgba(255,255,255,0)),
    var(--card);
}

.settings-admin-shortcuts .card-header {
  border-bottom: 1px solid var(--settings-border);
}

.settings-admin-shortcuts .card-body {
  padding: 20px 24px 24px;
}

.settings-shortcut-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.settings-shortcut-row {
  min-height: 68px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--settings-border);
  border-radius: 8px;
  background: rgba(16,19,24,.36);
  color: var(--txt);
  text-decoration: none;
  transition: border-color var(--tr), background var(--tr), transform var(--tr), box-shadow var(--tr);
}

.settings-shortcut-row::before {
  content: "";
  width: 42px;
  height: 42px;
  border: 1px solid rgba(212,175,55,.28);
  border-radius: var(--r3);
  background:
    linear-gradient(135deg, rgba(212,175,55,.24), rgba(212,175,55,.06)),
    var(--bg2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.settings-shortcut-row[href*="academy-bank"]::before {
  background:
    linear-gradient(135deg, rgba(77,162,255,.22), rgba(77,162,255,.05)),
    var(--bg2);
  border-color: rgba(77,162,255,.26);
}

.settings-shortcut-row:hover {
  border-color: var(--accent-border);
  background: rgba(212,175,55,.08);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(0,0,0,.16);
}

.settings-shortcut-row[href*="academy-bank"]:hover {
  border-color: rgba(77,162,255,.42);
  background: rgba(240,185,11,.11);
}

.settings-shortcut-row strong {
  display: block;
  margin-bottom: 3px;
  color: var(--txt);
  font-size: 13.5px;
  font-weight: 900;
  line-height: 1.35;
}

.settings-shortcut-row small {
  display: block;
  color: var(--txt3);
  font-size: 11px;
  line-height: 1.6;
}

.settings-shortcut-row .btn {
  min-width: 70px;
  min-height: 34px;
  justify-content: center;
  border-radius: var(--r3);
  pointer-events: none;
}

.settings-page .settings-toolbar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(240px, 360px) auto;
  align-items: center;
  justify-content: end;
  gap: 12px;
}

.settings-page .settings-toolbar .form-input {
  width: 100%;
  min-width: 0;
}

.settings-page .settings-toolbar .btn {
  min-height: 46px;
  min-width: 154px;
  justify-content: center;
}

.settings-page .settings-panel .table {
  table-layout: fixed;
}

.settings-page .settings-panel .table th {
  padding: 13px 20px;
  background: rgba(9,12,15, .48);
  color: var(--txt2);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: none;
}

.settings-page .settings-panel .table td {
  padding: 14px 20px;
  overflow-wrap: anywhere;
}

.settings-page .settings-panel .table .font-mono {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#exceptions-table th:nth-child(3),
#exceptions-table td:nth-child(3),
#supervisors-table th:nth-child(4),
#supervisors-table td:nth-child(4) {
  width: 170px;
}

.settings-table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-page .empty-state {
  min-height: 205px;
  padding: 48px 24px;
}

.settings-page .empty-title {
  font-size: 17px;
  font-weight: 900;
}

.settings-page .empty-desc {
  margin-top: 5px;
  color: var(--txt3);
  line-height: 1.7;
}

.settings-account-form {
  display: grid;
  gap: 18px;
}

.settings-account-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.settings-form-actions {
  display: flex;
  justify-content: flex-start;
}

.settings-form-actions .btn {
  min-height: 46px;
  min-width: 184px;
  justify-content: center;
}

[data-theme="light"] .settings-page {
  --settings-border: rgba(71,77,87, .2);
  --settings-border-strong: rgba(240,185,11, .34);
  --settings-surface: rgba(255, 255, 255, .98);
  --settings-surface-soft: rgba(255,255,255, .92);
  --settings-shadow: 0 14px 34px rgba(24,26,32, .08);
}

[data-theme="light"] .settings-page .settings-panel.card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.98));
  border-color: var(--settings-border);
  box-shadow: var(--settings-shadow);
}

[data-theme="light"] .settings-page .settings-panel .card-header {
  background:
    linear-gradient(90deg, rgba(240,185,11,.06), rgba(240,185,11,.045) 50%, transparent),
    rgba(255,255,255, .8);
  border-bottom-color: var(--settings-border);
}

[data-theme="light"] .settings-page .settings-autosave {
  background: #ffffff;
  border-color: var(--settings-border);
}

[data-theme="light"] .settings-page .form-input {
  background: #ffffff;
  border-color: var(--settings-border);
}

[data-theme="light"] .settings-page .form-input:focus {
  background: #ffffff;
  border-color: var(--settings-border-strong);
  box-shadow: 0 0 0 4px rgba(240,185,11, .1);
}

[data-theme="light"] .settings-page .settings-panel .table th {
  background: #f5f8fc;
}

@media (max-width: 980px) {
  .settings-page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-page-head .settings-autosave {
    width: 100%;
    justify-content: center;
  }

  .settings-field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-page .settings-panel .card-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .settings-page .settings-toolbar {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto;
    justify-content: stretch;
  }

  .settings-shortcut-list,
  .settings-account-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .settings-page {
    gap: 14px;
  }

  .settings-page-head h2 {
    font-size: 22px;
  }

  .settings-page .settings-panel .card-header {
    padding: 18px;
  }

  .settings-page .settings-panel .card-body,
  .settings-admin-shortcuts .card-body {
    padding: 18px;
  }

  .settings-field-grid,
  .settings-page .settings-toolbar {
    grid-template-columns: 1fr;
  }

  .settings-shortcut-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .settings-shortcut-row::before {
    width: 38px;
    height: 38px;
  }

  .settings-shortcut-row .btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .settings-page .settings-toolbar,
  .settings-page .settings-toolbar .form-input,
  .settings-page .settings-toolbar .btn,
  .settings-form-actions .btn {
    width: 100%;
  }

  #exceptions-table th:nth-child(3),
  #exceptions-table td:nth-child(3),
  #supervisors-table th:nth-child(4),
  #supervisors-table td:nth-child(4) {
    width: auto;
  }
}

/* Agreement admin editor */
.agreement-admin-page {
  display: grid;
  gap: 16px;
}
.agreement-admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.agreement-admin-head h2 {
  margin: 4px 0 6px;
  color: var(--txt);
  font-size: 22px;
}
.agreement-admin-head p {
  margin: 0;
  color: var(--txt2);
  font-size: 13px;
  line-height: 1.7;
}
.agreement-admin-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.agreement-admin-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, .8fr);
  gap: 16px;
  align-items: start;
}
.agreement-editor-stack {
  display: grid;
  gap: 14px;
}
.agreement-editor-panel {
  margin: 0;
}
.agreement-field-textarea {
  resize: vertical;
  line-height: 1.85;
  font-size: 13px;
  white-space: pre-wrap;
}
.agreement-clauses-header {
  align-items: center;
}
.agreement-clauses-list {
  display: grid;
  gap: 12px;
}
.agreement-clause-card {
  border: 1px solid var(--border);
  border-radius: var(--r2);
  background: var(--bg2);
  overflow: hidden;
}
.agreement-clause-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
}
.agreement-clause-card-head strong {
  color: var(--accent);
  font-size: 13px;
}
.agreement-clause-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.agreement-clause-fields {
  display: grid;
  gap: 12px;
  padding: 12px;
}
.agreement-clause-heading-input {
  max-width: 240px;
}
.agreement-ending-grid {
  display: grid;
  gap: 12px;
}
.agreement-preview-panel {
  position: sticky;
  top: 86px;
  border: 1px solid var(--border);
  border-radius: var(--r2);
  background: var(--card);
  overflow: hidden;
}
.agreement-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
}
.agreement-preview-box {
  max-height: calc(100vh - 180px);
  overflow: auto;
  padding: 16px;
  font-size: 12.5px;
  line-height: 1.8;
}
.agreement-preview-box h3 {
  margin: 12px 0 10px;
  color: var(--txt);
  font-size: 14px;
  line-height: 1.7;
}
.agreement-preview-header {
  text-align: center;
  color: var(--txt);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.7;
  direction: ltr;
}
.agreement-preview-clause {
  margin-top: 12px;
}
.agreement-preview-clause h4 {
  display: inline-flex;
  margin: 0 0 6px;
  padding: 2px 8px;
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-bg);
  font-size: 12px;
}
.agreement-preview-clause p {
  margin: 0 0 5px;
  color: var(--txt2);
}
.agreement-clauses-empty {
  border: 1px dashed var(--border2);
  border-radius: var(--r2);
}

@media (max-width: 1100px) {
  .agreement-admin-grid {
    grid-template-columns: 1fr;
  }
  .agreement-preview-panel {
    position: static;
  }
  .agreement-preview-box {
    max-height: 420px;
  }
}
@media (max-width: 640px) {
  .agreement-admin-head {
    flex-direction: column;
  }
  .agreement-admin-actions,
  .agreement-admin-actions .btn,
  .agreement-clauses-header,
  .agreement-clause-card-head,
  .agreement-clause-tools {
    width: 100%;
  }
  .agreement-admin-actions .btn,
  .agreement-clause-tools .btn {
    justify-content: center;
  }
  .agreement-clauses-header,
  .agreement-clause-card-head {
    align-items: stretch;
    flex-direction: column;
  }
  .agreement-clause-heading-input {
    max-width: none;
  }
}

/* Academy bank account admin editor */
.academy-bank-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.academy-bank-form-card {
  margin: 0;
  width: 100%;
}
.academy-bank-form-card .card-header {
  align-items: flex-start;
  gap: 14px;
}
.academy-bank-form-card .card-title {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}
.academy-bank-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.academy-bank-form-body {
  display: grid;
  gap: 18px;
}
.academy-bank-drop {
  position: relative;
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 210px;
  padding: 24px;
  border: 2px dashed var(--border2);
  border-radius: var(--r2);
  background: var(--bg2);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--tr), background var(--tr), transform var(--tr);
}
.academy-bank-drop:hover,
.academy-bank-drop.drag-over {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.academy-bank-drop.drag-over {
  transform: scale(1.01);
}
.academy-bank-drop.has-file {
  border-color: var(--green-border);
  background: var(--green-bg);
}
.academy-bank-drop input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.academy-bank-drop strong {
  color: var(--txt);
  font-size: 14px;
}
.academy-bank-drop span {
  color: var(--txt2);
  font-size: 12px;
  line-height: 1.6;
}
.academy-bank-file-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--green-border);
  border-radius: var(--r3);
  background: var(--green-bg);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}
.academy-bank-file-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.academy-bank-file-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.academy-bank-qr-modal-card {
  max-width: 460px;
}
.academy-bank-qr-preview-frame {
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--r2);
  background: var(--bg2);
}
.academy-bank-qr-preview-frame img {
  display: block;
  width: min(100%, 320px);
  max-height: 360px;
  object-fit: contain;
  padding: 8px;
  border-radius: 8px;
  background: #fff;
}
.academy-bank-preview-panel {
  position: sticky;
  top: 86px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r2);
  background: var(--card);
}
.academy-bank-preview-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}
.academy-bank-preview-card p {
  margin: 0;
  color: var(--txt2);
  font-size: 13px;
  line-height: 1.8;
}
.academy-bank-preview-row {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r3);
  background: var(--bg2);
}
.academy-bank-preview-row span {
  color: var(--txt3);
  font-size: 11px;
  font-weight: 700;
}
.academy-bank-preview-row strong {
  color: var(--txt);
  font-size: 14px;
  overflow-wrap: anywhere;
}
.academy-bank-preview-qr {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--r3);
  background:
    linear-gradient(135deg, rgba(255,255,255,.03), transparent),
    var(--bg2);
}
.academy-bank-preview-qr img {
  display: block;
  width: min(100%, 240px);
  max-height: 260px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}
.academy-bank-preview-empty {
  display: grid;
  place-items: center;
  min-height: 160px;
  padding: 18px;
  border: 1px dashed var(--border2);
  border-radius: var(--r3);
  background: var(--bg2);
  color: var(--txt3);
  font-size: 13px;
}

@media (max-width: 1100px) {
  .academy-bank-grid {
    grid-template-columns: 1fr;
  }
  .academy-bank-preview-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .academy-bank-grid {
    gap: 12px;
  }
  .academy-bank-form-card .card-header {
    align-items: stretch;
    flex-direction: column;
  }
  .academy-bank-card-actions,
  .academy-bank-card-actions .btn {
    width: 100%;
  }
  .academy-bank-card-actions .btn {
    justify-content: center;
  }
  .academy-bank-drop {
    min-height: 160px;
    padding: 18px;
  }
  .academy-bank-file-meta {
    align-items: stretch;
    flex-direction: column;
  }
  .academy-bank-file-actions,
  .academy-bank-file-actions .btn,
  .academy-bank-file-meta .btn {
    justify-content: center;
    width: 100%;
  }
}

/* Input with button */
.input-with-btn { display: flex; gap: 8px; }
.input-with-btn .form-input { flex: 1; }

/* Password input */
.input-pw-wrap { position: relative; display: flex; }
.input-pw-wrap .form-input { flex: 1; padding-inline-end: 40px; }
.pw-toggle {
  position: absolute;
  inset-inline-end: 4px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  color: var(--txt3);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
}

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}
.modal.modal-lg { max-width: 760px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-title  { font-size: 15px; font-weight: 600; }
.modal-body   { padding: 20px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

.modal-footer .btn.modal-close {
  width: auto !important;
  min-width: 86px;
  height: auto !important;
  min-height: 40px;
  padding: 0 16px !important;
  border-radius: 8px;
  font-size: 13px !important;
  font-weight: 800;
  line-height: 1.2 !important;
  white-space: nowrap;
  overflow: visible;
}

/* ── Lightbox ────────────────────────────────────────────────────────────── */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  z-index: 400;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.lightbox-overlay.show { display: flex; }
.lightbox-box {
  background: var(--card);
  border-radius: var(--r);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.lightbox-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.lightbox-body { flex: 1; overflow: auto; padding: 16px; display: flex; align-items: center; justify-content: center; }
.lightbox-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.lightbox-actions .btn-icon {
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
}
.lightbox-actions .lightbox-fit-btn {
  width: auto;
  min-width: 50px;
  padding: 0 8px;
  font-size: 11px;
}
.receipt-preview-image-stage {
  width: 100%;
  max-height: 72vh;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8px;
}
.receipt-preview-image {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  border-radius: var(--r2);
  transform-origin: top center;
  transition: transform .18s ease, box-shadow .18s ease;
  cursor: zoom-in;
}
.receipt-preview-image.is-zoomed {
  max-width: none;
  max-height: none;
  cursor: zoom-out;
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
}

/* ── Detail grid (key-value pairs) ──────────────────────────────────────── */
.detail-grid { display: flex; flex-direction: column; gap: 10px; }
.detail-row  { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.detail-label { color: var(--txt3); font-size: 12px; font-weight: 500; }

#modal-client .modal.modal-lg {
  max-width: 960px;
}

.client-view {
  display: grid;
  gap: 18px;
}

.client-view-note {
  margin-bottom: 0;
}

.client-view-metrics,
.client-view-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  align-items: start;
  gap: 12px;
}

.client-view-metric,
.client-view-item,
.client-view-section,
.client-view-document,
.client-view-notes,
.client-view-allocation {
  border: 1px solid var(--border);
  background: rgba(255,255,255,.025);
  border-radius: var(--r3);
}

.client-view-metric {
  min-height: 88px;
  padding: 16px 18px;
  display: grid;
  align-content: center;
  gap: 8px;
}

.client-view-metric > span,
.client-view-item-head > span,
.client-view-allocation > span,
.client-view-document > div > span {
  color: var(--txt3);
  font-size: 12px;
  font-weight: 700;
}

.client-view-metric strong {
  color: var(--txt);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
}

.client-view-metric.is-positive strong { color: var(--green); }
.client-view-metric.is-negative strong { color: var(--red); }

.client-view-section {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.client-view-section-title {
  color: var(--txt);
  font-size: 14px;
  font-weight: 800;
}

.client-view-item {
  min-height: 72px;
  padding: 13px 15px;
  display: grid;
  align-content: start;
  gap: 8px;
  position: relative;
}

.client-view-item.has-copy {
  min-height: 104px;
  padding-bottom: 38px;
}

.client-view-item-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.client-copy-btn {
  position: absolute;
  left: 14px;
  bottom: 11px;
  border: 1px solid var(--border);
  border-radius: var(--r4);
  background: rgba(255,255,255,.035);
  color: #fff;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
  cursor: pointer;
  transition: all var(--tr);
}

.client-copy-btn:hover {
  border-color: rgba(132,142,156,.28);
  background: rgba(255,255,255,.07);
  color: #fff;
}

.client-copy-btn:disabled {
  cursor: default;
  opacity: .75;
}

.client-view-item strong {
  min-width: 0;
  color: var(--txt);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.client-view-notes {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.client-view-notes .form-input {
  min-height: 96px;
  resize: vertical;
}

.client-view-allocation {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.client-view-allocation .client-allocation-mini {
  gap: 8px;
}

.client-view-allocation .client-allocation-mini span {
  padding: 8px 10px;
  border-radius: var(--r3);
}

.client-view-allocation .client-allocation-mini b {
  font-size: 13px;
}

.client-view-allocation .client-allocation-mini em {
  font-size: 12px;
}

.client-view-documents {
  display: grid;
  gap: 10px;
}

.client-view-document {
  min-height: 74px;
  padding: 15px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.client-view-document > div {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.client-view-document strong {
  color: var(--txt);
  font-size: 14px;
  font-weight: 800;
}

.client-view-document-primary {
  border-color: rgba(77,162,255,.26);
  background: linear-gradient(135deg, rgba(77,162,255,.08), rgba(16,185,129,.06));
}

.client-view-empty {
  color: var(--txt3);
  font-size: 13px;
}

.client-view-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

#client-financial-ledger .table {
  min-width: 1160px;
}

#client-financial-ledger th:last-child,
#client-financial-ledger td.ledger-receipt-cell {
  width: 150px;
  min-width: 150px;
  text-align: center;
}

.ledger-receipt-cell {
  white-space: nowrap;
}

.ledger-receipt-action {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid rgba(14,203,129,.34);
  border-radius: var(--r3);
  background: linear-gradient(135deg, rgba(16,185,129,.15), rgba(77,162,255,.10));
  color: #a7f3d0;
  font-family: 'Tajawal', sans-serif;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: transform var(--tr), border-color var(--tr), background var(--tr), color var(--tr), box-shadow var(--tr);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.025);
}

.ledger-receipt-action svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ledger-receipt-action:hover {
  transform: translateY(-1px);
  border-color: rgba(14,203,129,.58);
  background: linear-gradient(135deg, rgba(16,185,129,.23), rgba(77,162,255,.16));
  color: #d1fae5;
  box-shadow: 0 10px 22px rgba(16,19,24,.24), inset 0 0 0 1px rgba(255,255,255,.04);
}

.ledger-receipt-action:focus-visible {
  outline: 2px solid rgba(14,203,129,.65);
  outline-offset: 2px;
}

.ledger-receipt-empty {
  color: var(--txt3);
  font-weight: 700;
}

.ledger-receipt-missing {
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  gap: 2px;
  padding: 5px 10px;
  border: 1px solid rgba(245,158,11,.28);
  border-radius: var(--r3);
  background: rgba(245,158,11,.08);
  color: var(--orange);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
}

.ledger-receipt-missing small {
  max-width: 120px;
  display: block;
  overflow: hidden;
  color: var(--txt3);
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[data-theme="light"] .ledger-receipt-action {
  border-color: rgba(22,163,74,.28);
  background: linear-gradient(135deg, rgba(22,163,74,.10), rgba(77,162,255,.07));
  color: #15803d;
  box-shadow: none;
}

[data-theme="light"] .ledger-receipt-action:hover {
  border-color: rgba(22,163,74,.44);
  background: linear-gradient(135deg, rgba(22,163,74,.15), rgba(77,162,255,.10));
  color: #166534;
  box-shadow: 0 8px 18px rgba(16,19,24,.10);
}

@media (max-width: 640px) {
  .client-view-metrics,
  .client-view-grid {
    grid-template-columns: 1fr;
  }

  .client-view-document {
    align-items: flex-start;
    flex-direction: column;
  }

  #client-financial-ledger td.ledger-receipt-cell {
    width: auto;
    min-width: 0;
    text-align: left;
  }

  .ledger-receipt-action {
    width: min(180px, 100%);
  }
}

.client-receipts-page {
  display: grid;
  gap: 16px;
}

.client-receipts-hero {
  border: 1px solid var(--border);
  border-radius: var(--r2);
  background:
    linear-gradient(135deg, rgba(77,162,255,.12), rgba(16,185,129,.08)),
    var(--card);
  padding: 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  box-shadow: var(--shadow-card);
}

.client-receipts-heading {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.client-receipts-kicker {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.client-receipts-heading h2 {
  margin: 0;
  color: var(--txt);
  font-size: 24px;
  line-height: 1.35;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.client-receipts-heading p {
  margin: 0;
  color: var(--txt3);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.client-receipts-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.client-receipts-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.client-receipts-summary > div {
  min-height: 86px;
  border: 1px solid var(--border);
  border-radius: var(--r3);
  background: rgba(255,255,255,.025);
  padding: 15px 16px;
  display: grid;
  align-content: center;
  gap: 7px;
}

.client-receipts-summary span,
.client-receipt-type span,
.client-receipt-card-head span,
.client-receipt-card-body span {
  color: var(--txt3);
  font-size: 12px;
  font-weight: 700;
}

.client-receipts-summary strong {
  color: var(--txt);
  font-size: 24px;
  font-weight: 900;
  line-height: 1.2;
}

.client-receipts-list-card .card-header {
  gap: 12px;
}

.client-receipts-table {
  min-width: 760px;
}

.client-receipts-table th,
.client-receipts-table td {
  vertical-align: middle;
}

.client-receipt-type {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.client-receipt-type strong {
  color: var(--txt);
  font-weight: 800;
}

.client-receipts-mobile-list {
  display: none;
  padding: 14px;
}

.client-receipt-card {
  border: 1px solid var(--border);
  border-radius: var(--r3);
  background: rgba(255,255,255,.025);
  padding: 14px;
  display: grid;
  gap: 12px;
  box-shadow: var(--shadow-card);
}

.client-receipt-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.client-receipt-card-head > div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.client-receipt-card-head strong {
  color: var(--txt);
  font-size: 15px;
  font-weight: 900;
}

.client-receipt-card-body {
  display: grid;
  gap: 8px;
}

.client-receipt-card-body > div {
  min-height: 42px;
  border: 1px solid rgba(132,142,156,.14);
  border-radius: var(--r4);
  padding: 9px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.client-receipt-card-body strong {
  color: var(--txt);
  font-size: 13px;
  line-height: 1.5;
  text-align: left;
}

.client-receipt-card-actions {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 768px) {
  .client-receipts-hero {
    padding: 18px;
    flex-direction: column;
  }

  .client-receipts-heading h2 {
    font-size: 20px;
  }

  .client-receipts-actions {
    width: 100%;
    justify-content: stretch;
  }

  .client-receipts-actions .btn {
    flex: 1;
    justify-content: center;
    min-width: 130px;
  }

  .client-receipts-summary {
    grid-template-columns: 1fr;
  }

  .client-receipts-summary > div {
    min-height: 72px;
  }

  .client-receipts-table-wrap {
    display: none;
  }

  .client-receipts-mobile-list {
    display: grid;
    gap: 12px;
  }

  .lightbox-box {
    max-height: 94vh;
  }

  .lightbox-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .lightbox-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .receipt-preview-image-stage {
    max-height: 68vh;
  }
}

/* ── Inline preview ──────────────────────────────────────────────────────── */
.inline-preview { margin-top: 12px; border: 1px solid var(--border); border-radius: var(--r3); overflow: hidden; }
.inline-preview-header { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: var(--bg3); font-size: 12px; }
.inline-preview-body { padding: 12px; }

/* ── Action buttons ──────────────────────────────────────────────────────── */
.action-btns { display: flex; gap: 4px; flex-wrap: wrap; }

/* ── Cell helpers ────────────────────────────────────────────────────────── */
.cell-user    { display: flex; align-items: center; gap: 10px; }
.cell-name    { font-size: 13px; font-weight: 500; }
.cell-sub     { font-size: 11px; color: var(--txt3); }
.mini-avatar  {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Text helpers ────────────────────────────────────────────────────────── */
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-muted  { color: var(--txt3); }
.text-center { text-align: center; }
.text-sm     { font-size: 12px; }
.font-mono   { font-family: 'JetBrains Mono', monospace; }

/* ── Alert boxes ─────────────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--r3); font-size: 13px; }
.alert-title { font-weight: 600; margin-bottom: 4px; }
.alert-info  { background: var(--blue-bg); border: 1px solid var(--blue-border); color: var(--txt); }
.alert-error { background: var(--red-bg);  border: 1px solid var(--red-border);  color: var(--red); }

/* ── SSE status indicator ────────────────────────────────────────────────── */
.sse-status { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.sse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--txt3);
}
.sse-dot.connected    { background: var(--green); box-shadow: 0 0 6px var(--green); }
.sse-dot.disconnected { background: var(--red); }

/* ── Pagination ──────────────────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: 4px; }
.page-btn {
  padding: 5px 10px;
  border-radius: var(--r4);
  border: 1px solid var(--border);
  background: none;
  color: var(--txt2);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--tr);
}
.page-btn:hover   { background: var(--bg3); color: var(--txt); }
.page-btn.active  { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }
.page-info { font-size: 12px; color: var(--txt3); padding: 0 8px; }

/* ── FAQ accordion ───────────────────────────────────────────────────────── */
.faqs-accordion  { display: flex; flex-direction: column; gap: 8px; }
.accordion-item  { border: 1px solid var(--border); border-radius: var(--r3); overflow: hidden; }
.accordion-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: none;
  border: none;
  color: var(--txt);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: start;
  transition: background var(--tr);
}
.accordion-btn:hover { background: var(--bg3); }
.accordion-icon { font-size: 18px; color: var(--txt3); flex-shrink: 0; }
.accordion-body    { border-top: 1px solid var(--border); }
.accordion-content {
  padding: 16px 18px;
  font-size: 13px;
  color: var(--txt2);
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* FAQ management list */
.faqs-list { display: flex; flex-direction: column; gap: 0; }
.faq-item  { margin-bottom: 12px; }
.faq-item .card-body { padding: 14px 18px; }
.faq-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 0;
}
.faq-q { font-size: 14px; font-weight: 500; }
.faq-a {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.faq-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ── Bank cards ──────────────────────────────────────────────────────────── */
.banks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.bank-card  { transition: box-shadow var(--tr), border-color var(--tr); }
.bank-card:hover     { border-color: var(--accent-border); }
.bank-card.bank-default { border-color: var(--green-border); }
.bank-card-header    { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.bank-icon  { font-size: 24px; }
.bank-name  { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.bank-iban  { font-size: 13px; color: var(--txt3); }
.bank-holder { margin-top: 4px; }
.bank-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
}
.bank-actions .btn {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  justify-content: center;
  text-align: center;
  white-space: normal;
  overflow: visible;
  line-height: 1.25;
}

/* ── Document cards ──────────────────────────────────────────────────────── */
.docs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.doc-card  { transition: border-color var(--tr); }
.doc-card:hover { border-color: var(--accent-border); }
.doc-icon  { font-size: 32px; margin-bottom: 10px; }
.doc-name  { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.doc-meta  { font-size: 11px; }
.doc-actions { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; }
.doc-status-badge {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}
.doc-status-approved {
  color: var(--green);
  border-color: var(--green-border);
  background: var(--green-bg);
}

.client-agreement-preview-modal {
  max-width: min(920px, calc(100vw - 32px));
}
.client-agreement-preview-subtitle {
  color: var(--txt3);
  font-size: 12px;
  line-height: 1.5;
}
.client-agreement-status-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  margin-bottom: 14px;
  border: 1px solid var(--green-border);
  border-radius: var(--r2);
  background: var(--green-bg);
}
.client-agreement-status-strip strong {
  display: block;
  color: var(--txt);
  font-size: 14px;
  margin-bottom: 2px;
}
.client-agreement-status-strip span {
  color: var(--txt2);
  font-size: 12px;
  line-height: 1.5;
}
.client-agreement-status-dot {
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(34,197,94,.12);
  flex: 0 0 13px;
}
.client-agreement-paper {
  max-height: min(62vh, 680px);
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--r2);
  background:
    linear-gradient(180deg, rgba(255,255,255,.035), transparent 120px),
    var(--card);
  scrollbar-width: thin;
}
.client-agreement-paper-header {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.client-agreement-paper-header p {
  margin: 0 0 4px;
  color: var(--txt2);
  font-size: 12px;
  line-height: 1.7;
}
.client-agreement-paper h2 {
  margin: 0 0 18px;
  color: var(--txt);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.7;
  text-align: center;
}
.client-agreement-clause {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  padding: 15px 0;
  border-top: 1px solid var(--border);
}
.client-agreement-clause:first-of-type {
  border-top: 0;
}
.client-agreement-clause-number {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--accent-border);
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 900;
  font-size: 12px;
}
.client-agreement-clause h4 {
  margin: 0 0 7px;
  color: var(--txt);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.6;
}
.client-agreement-clause p {
  margin: 0 0 6px;
  color: var(--txt2);
  font-size: 13px;
  line-height: 1.9;
}
.client-agreement-clause-closing .client-agreement-clause-number {
  border-color: var(--green-border);
  background: var(--green-bg);
  color: var(--green);
}
@media (max-width: 640px) {
  .client-agreement-preview-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .client-agreement-preview-modal {
    max-width: 100%;
    border-radius: var(--r) var(--r) 0 0;
  }
  .client-agreement-paper {
    max-height: 58vh;
    padding: 16px;
  }
  .client-agreement-clause {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 10px;
  }
  .client-agreement-clause-number {
    width: 28px;
    height: 28px;
  }
}

/* ── Report cards ────────────────────────────────────────────────────────── */
.report-card   { transition: border-color var(--tr), box-shadow var(--tr); cursor: default; }
.report-card:hover { border-color: var(--accent-border); box-shadow: var(--glow-sm); }
.report-icon   { font-size: 36px; margin-bottom: 10px; }
.report-title  { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.report-desc   { font-size: 12px; color: var(--txt3); }
.table-note    { padding: 8px 16px; font-size: 12px; color: var(--txt3); border-top: 1px solid var(--border); }

/* ── Audit log ───────────────────────────────────────────────────────────── */
.audit-action { display: flex; align-items: center; gap: 8px; }
.audit-icon   { font-size: 14px; }

/* ── Subscription ────────────────────────────────────────────────────────── */
.sub-status-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.sub-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.sub-desc  { font-size: 13px; color: var(--txt3); }
.sub-actions { display: flex; align-items: center; gap: 10px; }
.features-list { display: flex; flex-direction: column; gap: 12px; }
.feature-item  { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.feature-icon  { color: var(--green); font-size: 16px; }

/* ── Portfolio preview box ───────────────────────────────────────────────── */
.preview-box   { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r3); padding: 16px; margin-top: 12px; }
.preview-title { font-size: 12px; font-weight: 600; color: var(--txt3); margin-bottom: 10px; }
.preview-grid  { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.preview-item  { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.preview-item span  { color: var(--txt3); font-size: 11px; }
.preview-item strong { font-family: 'JetBrains Mono', monospace; }

/* ── Withdrawal stepper ──────────────────────────────────────────────────── */
.stepper { display: flex; align-items: center; margin-bottom: 20px; }
.step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--txt3);
}
.step.active { color: var(--accent); }
.step.completed { color: var(--green); }
.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}
.step.active .step-num    { background: var(--accent); color: #fff; border-color: var(--accent); }
.step.completed .step-num { background: var(--green);  color: #fff; border-color: var(--green); }
.step-line { flex: 1; height: 1px; background: var(--border); margin: 0 8px; }
.step-label { white-space: nowrap; }

/* Radio cards */
.radio-cards     { display: flex; flex-direction: column; gap: 10px; }
.radio-card      { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: var(--r3); cursor: pointer; transition: border-color var(--tr); }
.radio-card:hover,
.radio-card.active { border-color: var(--accent); }
.radio-card input    { margin-top: 3px; accent-color: var(--accent); }
.radio-card-title    { font-size: 14px; font-weight: 500; }
.radio-card-desc     { font-size: 12px; }

/* Confirm box */
.confirm-box       { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r3); padding: 16px; }
.confirm-title     { font-size: 14px; font-weight: 600; margin-bottom: 12px; }

/* Amount display */
.amount-display {
  font-size: 24px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  padding: 14px 0;
}

/* ── File upload ─────────────────────────────────────────────────────────── */
.file-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--r3);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--tr), background var(--tr);
  position: relative;
}
.file-upload-zone:hover { border-color: var(--accent); background: var(--accent-bg); }
.file-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-upload-label { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; color: var(--txt3); pointer-events: none; }
.file-upload-icon  { font-size: 24px; }
.file-selected     { font-size: 12px; color: var(--green); font-family: 'JetBrains Mono', monospace; }
.file-preview-wrap { display: flex; align-items: center; gap: 10px; }
.file-thumb        { width: 80px; height: 80px; object-fit: cover; border-radius: var(--r3); cursor: pointer; border: 1px solid var(--border); }

/* ── Capital info box ────────────────────────────────────────────────────── */
.info-box { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r3); padding: 14px; }

.capital-request-card > .card-header {
  border-bottom: 0;
  padding: 16px 18px 0;
}

.capital-request-card > .card-header .card-title {
  margin: 0;
  padding: 0;
  border-bottom: 0;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.35;
}

.capital-request-card > .card-body {
  padding: 14px 18px 18px;
}

.capital-transfer-panel {
  grid-template-columns: minmax(240px, .72fr) minmax(0, 1fr);
  align-items: start;
  gap: 10px 12px;
  margin-bottom: 0;
  padding: 14px;
  border-color: rgba(132,142,156,.18);
  border-radius: var(--r3);
  background: var(--bg2);
}

.capital-transfer-panel .registration-bank-transfer-head,
.capital-transfer-panel .registration-bank-details,
.capital-transfer-panel .registration-bank-actions,
.capital-transfer-panel .capital-payment-note,
.capital-transfer-panel .capital-receipt-row {
  grid-column: 1 / -1;
}

.capital-transfer-panel .registration-bank-transfer-head {
  gap: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(132,142,156,.16);
}

.capital-transfer-panel .registration-bank-transfer-head span {
  max-width: none;
  color: var(--txt2);
  font-size: 12.5px;
  line-height: 1.6;
}

.capital-shares-field.registration-shares-field,
.capital-transfer-amounts {
  min-height: 74px;
  border: 1px solid rgba(132,142,156,.18);
  border-radius: var(--r3);
  background: rgba(16,19,24,.22);
  padding: 10px 12px;
}

.capital-shares-field.registration-shares-field {
  align-items: stretch;
  gap: 6px;
}

.capital-shares-field.registration-shares-field .form-label {
  color: var(--txt);
  font-size: 12.5px;
  font-weight: 900;
}

.capital-shares-field.registration-shares-field .form-input {
  width: 100%;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  border-radius: 10px;
  font-size: 13px;
  text-align: right;
}

.capital-shares-field .form-note {
  margin-top: 0;
  color: var(--txt3);
  font-size: 11.5px;
  line-height: 1.35;
}

.capital-transfer-amounts {
  align-self: center;
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px 14px;
  flex-wrap: wrap;
  border-color: rgba(240,185,11,.28);
  background: rgba(240,185,11,.07);
  min-height: 54px;
  padding: 9px 14px;
}

.capital-transfer-amounts > span {
  color: var(--accent3);
  font-size: 11.5px;
  font-weight: 900;
  flex: 0 0 auto;
}

.capital-transfer-amounts > b,
.capital-transfer-amounts em,
.capital-transfer-amounts em strong {
  font-size: 14px;
  line-height: 1.3;
}

.capital-transfer-amounts > b {
  flex: 0 0 auto;
}

.capital-transfer-amounts em {
  gap: 5px;
  flex: 0 1 auto;
}

.capital-transfer-amounts #capital-local-amount {
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 900;
}

.capital-transfer-panel .registration-bank-details {
  gap: 10px;
  margin-top: 0;
}

.capital-transfer-panel .registration-bank-detail {
  gap: 5px;
  min-height: 68px;
  padding: 10px 12px;
  border-color: rgba(77,162,255,.18);
  background: rgba(16,19,24,.24);
}

.capital-transfer-panel .registration-bank-detail-head {
  align-items: center;
}

.capital-transfer-panel .registration-bank-detail-head span {
  color: var(--txt3);
  font-size: 10.5px;
  font-weight: 900;
}

.capital-transfer-panel .registration-bank-copy-btn {
  min-height: 26px;
  min-width: 46px;
  padding: 4px 9px;
}

.capital-transfer-panel .registration-bank-detail b {
  color: var(--txt);
  font-size: 13px;
  line-height: 1.45;
}

.capital-transfer-panel .registration-bank-actions {
  justify-content: flex-start;
  margin-top: 0;
}

.capital-transfer-panel .registration-bank-actions .btn {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 11.5px;
  border-radius: 10px;
}

.capital-payment-note {
  margin-top: 0;
  padding: 9px 11px;
  border: 1px solid rgba(77,162,255, .22);
  border-radius: var(--r3);
  background: rgba(77,162,255, .07);
  color: var(--txt2);
}

.capital-payment-note pre {
  margin: 0;
  white-space: pre-wrap;
  color: inherit;
  font-family: inherit;
  line-height: 1.7;
}

.capital-receipt-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  align-items: end;
  gap: 10px;
  padding-top: 2px;
}

.capital-receipt-field {
  margin-bottom: 0;
}

.capital-receipt-field .form-label {
  margin-bottom: 6px;
  color: var(--txt);
  font-size: 12.5px;
  font-weight: 900;
}

.capital-receipt-field .file-upload-zone {
  min-height: 44px;
  padding: 8px 12px;
  border-width: 1px;
  border-radius: 10px;
  background: rgba(16,19,24,.18);
}

.capital-receipt-field .file-upload-label {
  flex-direction: row;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  line-height: 1.3;
}

.capital-receipt-field .file-upload-hint {
  margin-top: 0;
}

.capital-receipt-field .file-selected {
  display: inline-flex;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#submit-capital-btn {
  min-height: 40px;
  min-width: 0;
  width: 100%;
  padding: 7px 14px;
  border-radius: var(--r3);
  font-size: 12.5px;
  font-weight: 900;
  justify-content: center;
}

@media (max-width: 860px) {
  .capital-transfer-panel {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }

  .capital-transfer-panel .registration-bank-details {
    grid-template-columns: 1fr;
  }

  .capital-transfer-panel .registration-bank-actions .btn,
  #submit-capital-btn {
    width: 100%;
    justify-content: center;
  }

  .capital-receipt-row {
    grid-template-columns: 1fr;
  }

  .capital-receipt-field .file-upload-label {
    flex-wrap: wrap;
  }
}

/* ── Profile avatar ──────────────────────────────────────────────────────── */
.profile-avatar-row { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-bg);
  border: 2px solid var(--accent-border);
  color: var(--accent);
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-name  { font-size: 16px; font-weight: 600; }
.profile-email { font-size: 13px; }
.profile-content {
  max-width: 620px;
}
.profile-form-panel {
  width: min(100%, 520px);
}
.profile-form-panel .form-input,
.profile-form-panel .pw-field {
  width: 100%;
}

.portfolio-groups-simple-header {
  padding: 14px 20px 0;
  color: var(--txt);
  font-size: 14px;
  font-weight: 700;
}

#profile-group-card .card-body {
  padding-top: 14px;
}

.profile-group-current {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--r3);
  background: linear-gradient(135deg, var(--bg2), rgba(240,185,11,.07));
}

.profile-group-kicker {
  color: var(--txt3);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}

.profile-group-name {
  color: var(--txt);
  font-size: 18px;
  font-weight: 800;
}

.profile-group-desc {
  color: var(--txt2);
  font-size: 13px;
  margin-top: 6px;
  line-height: 1.7;
}

.portfolio-allocation-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--r3);
  background: linear-gradient(135deg, var(--bg2), rgba(77,162,255,.07));
}

.portfolio-allocation-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.portfolio-allocation-summary > div {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r3);
  background: var(--bg2);
}

.portfolio-allocation-summary span {
  display: block;
  color: var(--txt3);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}

.portfolio-allocation-summary strong {
  display: block;
  color: var(--txt);
  font-family: "JetBrains Mono", monospace;
  font-size: 18px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.portfolio-allocation-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.portfolio-allocation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 190px);
  gap: 16px;
  align-items: center;
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--r3);
  background: var(--bg2);
}

.portfolio-allocation-title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.portfolio-allocation-title {
  color: var(--txt);
  font-size: 15px;
  font-weight: 800;
}

.portfolio-allocation-desc {
  color: var(--txt2);
  font-size: 12px;
  line-height: 1.6;
}

.portfolio-allocation-bar {
  width: 100%;
  height: 7px;
  margin-top: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.06);
}

.portfolio-allocation-bar span {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--accent));
  transition: width var(--tr);
}

.portfolio-allocation-control {
  display: grid;
  gap: 6px;
}

.portfolio-allocation-input {
  width: 100%;
  text-align: left;
  font-family: "JetBrains Mono", monospace;
}

.portfolio-allocation-percent {
  color: var(--txt3);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  text-align: left;
}

.portfolio-allocation-error {
  margin-top: 10px;
}

.portfolio-allocation-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.portfolio-allocation-summary.compact strong {
  font-size: 15px;
}

.client-allocation-mini {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.client-allocation-mini span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: var(--r4);
  background: var(--bg2);
}

.client-allocation-mini b {
  min-width: 0;
  color: var(--txt);
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-allocation-mini em {
  color: var(--txt2);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.profile-group-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.profile-group-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 118px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--r3);
  background: var(--bg2);
  cursor: pointer;
  transition: border-color var(--tr), background var(--tr), box-shadow var(--tr);
}

.profile-group-option:hover,
.profile-group-option.active {
  border-color: var(--accent-border);
  background: rgba(240,185,11,.08);
  box-shadow: var(--glow-sm);
}

.profile-group-option.disabled {
  cursor: not-allowed;
  opacity: .72;
  box-shadow: none;
}

.profile-group-option.disabled:hover {
  border-color: var(--border);
  background: var(--bg2);
  box-shadow: none;
}

.profile-group-option input {
  display: none;
}

.profile-group-radio {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 50%;
  border: 2px solid var(--border3);
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 4px var(--bg2);
}

.profile-group-option.active .profile-group-radio {
  border-color: var(--accent);
  background: var(--accent);
}

.profile-group-option-body {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.profile-group-option-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--txt);
}

.profile-group-option-desc {
  font-size: 12px;
  color: var(--txt2);
  line-height: 1.6;
}

.profile-group-option-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.registration-allocation-summary {
  margin: 0 0 14px;
}

.registration-default-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  border-color: var(--accent-border);
  border: 1px solid var(--accent-border);
  border-radius: var(--r2);
  background: rgba(240,185,11,.08);
}

.registration-default-balance > div {
  display: grid;
  gap: 4px;
}

.registration-default-balance span {
  color: var(--txt2);
  font-size: 11px;
  line-height: 1.5;
}

.registration-default-balance strong {
  color: var(--txt);
  font-size: 17px;
}

.registration-default-balance small {
  color: var(--accent2);
  font-size: 12px;
  line-height: 1.6;
}

.registration-default-balance b {
  color: var(--txt);
  font-family: "JetBrains Mono", monospace;
  font-size: 24px;
  white-space: nowrap;
}

.registration-allocation-list {
  display: grid;
  gap: 10px;
  width: 100%;
}

.registration-allocation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 210px);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--r2);
  background: var(--bg2);
}

.registration-allocation-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.registration-allocation-copy strong {
  color: var(--txt);
  font-size: 14px;
}

.registration-allocation-copy span {
  color: var(--txt2);
  font-size: 12px;
  line-height: 1.7;
}

.registration-allocation-amount {
  display: grid;
  gap: 6px;
}

.registration-allocation-amount > span {
  color: var(--txt3);
  font-size: 11px;
}

.registration-amount-input {
  position: relative;
}

.registration-allocation-input {
  min-height: 42px;
  font-family: "JetBrains Mono", monospace;
  text-align: left;
  direction: ltr;
  padding-left: 28px;
}

.registration-amount-input em {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--txt3);
  font-family: "JetBrains Mono", monospace;
  font-style: normal;
  pointer-events: none;
}

.registration-no-extra-groups {
  padding: 14px;
  border: 1px dashed var(--border3);
  border-radius: var(--r2);
  color: var(--txt2);
  background: rgba(255,255,255,.025);
  text-align: center;
  line-height: 1.7;
}

@media (max-width: 720px) {
  .registration-default-balance,
  .registration-allocation-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .registration-default-balance {
    flex-direction: column;
  }

  .registration-default-balance b {
    font-size: 22px;
  }
}

@media (max-width: 720px) {
  .portfolio-allocation-head,
  .portfolio-allocation-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .portfolio-allocation-summary {
    grid-template-columns: 1fr;
  }

  .portfolio-allocation-row {
    grid-template-columns: 1fr;
  }
}

/* ── Quick action cards ──────────────────────────────────────────────────── */
.quick-icon  { font-size: 32px; margin-bottom: 8px; }

/* ── Suggestions ─────────────────────────────────────────────────────────── */
.suggestions-page { display: grid; gap: 16px; }
.suggestions-hero {
  position: relative;
  overflow: hidden;
  border-color: rgba(77,162,255,.22);
  background:
    radial-gradient(circle at top right, rgba(77,162,255,.14), transparent 34%),
    linear-gradient(135deg, rgba(16,19,24,.98), rgba(24,26,32,.94));
}
.suggestions-hero::after {
  content: "";
  position: absolute;
  inset-inline-end: -70px;
  top: -70px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,168,76,.18), transparent 70%);
  pointer-events: none;
}
.suggestions-hero-copy { position: relative; z-index: 1; display: grid; gap: 12px; max-width: 720px; }
.suggestions-hero-title { font-size: clamp(24px, 3vw, 34px); line-height: 1.35; font-weight: 800; }
.suggestions-hero-text { color: var(--txt2); font-size: 14px; line-height: 1.9; }
.suggestions-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .9fr); gap: 16px; align-items: start; }
.suggestion-form { display: grid; gap: 14px; }
.suggestion-form-actions { display: flex; justify-content: flex-start; }
.suggestion-summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.suggestion-summary-card {
  padding: 14px;
  border-radius: var(--r2);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg2), rgba(255,255,255,.01));
}
.suggestion-summary-value { font-size: 24px; font-weight: 800; }
.suggestion-summary-label { margin-top: 4px; color: var(--txt3); font-size: 12px; }
.suggestion-tips { display: grid; gap: 10px; margin-top: 14px; }
.suggestion-tip {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: var(--r2);
  border: 1px solid var(--border);
  background: var(--bg2);
}
.suggestion-tip strong { font-size: 13px; }
.suggestion-tip span { font-size: 12px; color: var(--txt3); line-height: 1.7; }
.suggestions-list { display: grid; gap: 14px; }
.suggestion-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: var(--r2);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.01), rgba(255,255,255,.02));
}
.suggestion-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.suggestion-title { font-size: 16px; font-weight: 700; line-height: 1.5; }
.suggestion-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.suggestion-body { white-space: pre-wrap; line-height: 1.9; color: var(--txt2); font-size: 14px; }
.suggestion-reply {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: var(--r2);
  border: 1px solid var(--blue-border);
  background: var(--blue-bg);
}
.suggestion-reply-title { font-size: 12px; font-weight: 700; color: var(--blue); }
.suggestion-reply-body { white-space: pre-wrap; line-height: 1.8; color: var(--txt); font-size: 13px; }
.suggestion-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.suggestion-detail-box {
  padding: 14px;
  border-radius: var(--r2);
  border: 1px solid var(--border);
  background: var(--bg2);
}
.suggestion-detail-value { margin-top: 4px; font-size: 15px; font-weight: 700; }
.suggestion-admin-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.suggestion-action-stack { display: grid; gap: 8px; justify-items: flex-start; min-width: 170px; }
.suggestion-read-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}
.suggestion-read-state::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}
.suggestion-read-state.is-read { color: var(--green); }
.suggestion-read-state.is-unread { color: var(--orange); }

@media (max-width: 980px) {
  .suggestions-layout { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .suggestion-admin-form-grid { grid-template-columns: 1fr; }
  .suggestion-card-head { flex-direction: column; }
}
.quick-title { font-size: 14px; font-weight: 600; }

/* ── Misc ────────────────────────────────────────────────────────────────── */
.link { color: var(--accent); text-decoration: none; }
.link:hover { text-decoration: underline; }
.text-center { text-align: center; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .main-wrap .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .main-wrap .portfolio-distribution-card { grid-column: 1 / -1; }
  .grid-3     { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    transform: translateX(100%);
    transition: transform var(--tr-slow);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }
  [dir="ltr"] .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0) !important; }
  .sidebar-overlay.open { display: block; }
  .sidebar-nav { padding-bottom: 10px; }
  .sidebar-footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: linear-gradient(180deg, rgba(30,35,41,.94), rgba(24,26,32,.98));
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .main-wrap     { margin-inline-start: 0; }
  .desktop-sidebar-toggle { display: none !important; }
  .sidebar-toggle { display: inline-flex !important; }
  .page-content  { padding: 16px; }

  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .main-wrap .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid       { grid-template-columns: 1fr; }

  .modal { margin: 8px; }

}

@media (max-width: 480px) {
  .main-wrap .stats-grid { grid-template-columns: 1fr; }
  .main-wrap .portfolio-distribution-card { grid-column: auto; }
  .capital-cta-card {
    width: 100%;
  }
  .capital-cta-button {
    justify-content: center;
  }
  .portfolio-distribution-row-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
  .portfolio-distribution-name {
    white-space: normal;
  }
  .filter-row    { flex-direction: column; align-items: stretch; }
  .search-box    { min-width: unset; }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
  .topbar-actions .btn { display: inline-flex; }
}

/* ── Light theme overrides ───────────────────────────────────────────────── */
[data-theme="light"] {
  --bg:   #f5f6f7;
  --bg2:  #f0f1f2;
  --bg3:  #eaecef;
  --card: #ffffff;
  --card2: #f5f6f7;
  --border:  rgba(71,77,87, .20);
  --border2: rgba(71,77,87, .32);
  --txt:  #111318;
  --txt2: #5e6673;
  --txt3: #707a8a;
  --sidebar-bg:  #111318;
  --sidebar-bg2: #181a20;
  --sidebar-txt: #eaecef;
  --sidebar-border: rgba(183,189,198,.10);
}
[data-theme="light"] .topbar       { background: rgba(255,255,255,.94); }
[data-theme="light"] .table tbody tr:hover { background: rgba(240,185,11,.04); }
[data-theme="light"] .table td     { border-bottom-color: var(--border); }

/* ═══════════════════════════════════════
   NAV SVG ICONS
   ═══════════════════════════════════════ */
.nav-item .icon {
  display: flex; align-items: center; justify-content: center;
}
.nav-item .icon svg {
  width: 17px; height: 17px;
  stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
  fill: none; flex-shrink: 0;
  transition: opacity var(--tr);
}

/* ═══════════════════════════════════════
   SIDEBAR TOGGLE (mobile topbar button)
   ═══════════════════════════════════════ */
.sidebar-toggle {
  display: none;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  color: var(--txt2);
  width: 42px; height: 42px;
  border-radius: var(--r2);
  align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--tr); flex-shrink: 0;
}
.sidebar-toggle svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.sidebar-toggle:hover { border-color: var(--accent-border); color: var(--accent); background: var(--accent-bg); }

/* ═══════════════════════════════════════
   QUICK ACTION CARDS
   ═══════════════════════════════════════ */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
  gap: 12px; margin-top: 4px; margin-bottom: 20px;
}

.quick-action-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px 18px;
  display: flex; align-items: center; gap: 14px;
  cursor: pointer; transition: all var(--tr);
  box-shadow: var(--shadow-card);
  text-align: right;
  text-decoration: none;
  color: inherit;
}
.quick-action-card:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}
.qa-icon  {
  width: 42px;
  height: 42px;
  border: 1px solid var(--accent-border);
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
  background: var(--accent-bg);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.qa-icon svg {
  width: 21px;
  height: 21px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.qa-icon.qa-withdrawals { color: var(--blue); background: var(--blue-bg); border-color: rgba(77,162,255,.22); }
.qa-icon.qa-transactions { color: var(--orange); background: var(--orange-bg); border-color: rgba(245,158,11,.22); }
.qa-goto  { font-size: 12px; color: var(--txt2); }
.qa-title { font-weight: 600; font-size: 14px; margin-top: 2px; }
.qa-meta  { font-size: 11px; margin-top: 3px; color: var(--txt3); }
.qa-meta.accent { color: var(--accent); }

/* ═══════════════════════════════════════
   FILTER BAR (replaces inline styles on table filters)
   ═══════════════════════════════════════ */
.filter-bar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.filter-bar .form-input {
  padding: 7px 12px; font-size: 13px;
}
.filter-bar .form-input.w-sm  { width: 160px; }
.filter-bar .form-input.w-md  { width: 210px; }
.filter-bar .form-input[type="text"]::placeholder { opacity: .7; }
.filter-bar select.form-input { width: auto; min-width: 130px; }

/* ═══════════════════════════════════════
   EMPTY STATE (enhanced)
   ═══════════════════════════════════════ */
.empty-subtitle {
  font-size: 12px; color: var(--txt3);
  margin-top: 6px; line-height: 1.6;
}
.empty .btn { margin-top: 16px; }

/* ═══════════════════════════════════════
   TOAST SVG ICON
   ═══════════════════════════════════════ */
.toast-icon {
  width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px;
}
.toast-icon svg {
  width: 18px; height: 18px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.toast.success .toast-icon { color: var(--green); }
.toast.error   .toast-icon { color: var(--red); }
.toast.info    .toast-icon { color: var(--accent); }
.toast.warning .toast-icon { color: var(--orange); }

/* ═══════════════════════════════════════
   STAT CARD — skeleton variant
   ═══════════════════════════════════════ */
.stat-card.skel .stat-label,
.stat-card.skel .stat-sub   { visibility: hidden; }
.stat-card.skel .stat-value {
  color: transparent !important;
  background: linear-gradient(90deg, var(--card2) 25%, var(--card3) 50%, var(--card2) 75%);
  background-size: 200% 100%; animation: shimmer 1.6s infinite;
  border-radius: 6px; min-width: 90px; display: inline-block;
  height: 28px; vertical-align: middle;
}
.stat-card.skel .stat-icon  {
  background: linear-gradient(90deg, var(--card2) 25%, var(--card3) 50%, var(--card2) 75%);
  background-size: 200% 100%; animation: shimmer 1.6s infinite;
  border-radius: var(--r2); color: transparent;
}

/* ═══════════════════════════════════════
   STAT CARD — error state
   ═══════════════════════════════════════ */
.stat-card.has-error .stat-value {
  font-size: 13px; color: var(--red) !important; font-family: 'Tajawal', sans-serif;
  font-weight: 500;
}

/* LIGHT MODE - warm private banking polish */
[data-theme="light"] {
  --bg: #f5f6f7;
  --bg2: #f0f1f2;
  --bg3: #eaecef;
  --card: #ffffff;
  --card2: #f5f6f7;
  --card3: #f0f1f2;
  --border: rgba(71,77,87, .20);
  --border2: rgba(71,77,87, .32);
  --border3: rgba(71,77,87, .44);
  --txt: #111318;
  --txt2: #5e6673;
  --txt3: #707a8a;
  --accent: #e5ad00;
  --accent2: #c99400;
  --accent3: #8f6c00;
  --accent-bg: rgba(240,185,11,.10);
  --accent-border: rgba(240,185,11,.28);
  --accent-glow: rgba(240,185,11,.18);
  --green: #2d7a5f;
  --green-bg: rgba(45,122,95,.10);
  --green-border: rgba(45,122,95,.24);
  --red: #b54a4a;
  --red-bg: rgba(181,74,74,.10);
  --red-border: rgba(181,74,74,.24);
  --blue: #e5ad00;
  --blue-bg: rgba(229,173,0,.10);
  --blue-border: rgba(229,173,0,.24);
  --orange: #c99400;
  --orange-bg: rgba(201,148,0,.10);
  --orange-border: rgba(201,148,0,.24);
  --sidebar-bg: #111318;
  --sidebar-bg2: #181a20;
  --sidebar-border: rgba(183,189,198,.10);
  --sidebar-txt: #eaecef;
  --sidebar-txt2: #b7bdc6;
  --sidebar-txt3: #848e9c;
  --shadow: 0 16px 40px rgba(24,26,32, .10);
  --shadow-sm: 0 6px 18px rgba(24,26,32, .08);
  --shadow-card: 0 4px 16px rgba(24,26,32, .07);
  --glow: 0 0 24px rgba(240,185,11,.18);
  --glow-sm: 0 0 12px rgba(240,185,11,.12);
}

[data-theme="light"] body {
  background:
    radial-gradient(circle at top right, rgba(240,185,11,.05), transparent 26%),
    radial-gradient(circle at left 24%, rgba(71,77,87,.075), transparent 22%),
    linear-gradient(180deg, #fafafa 0%, #f5f6f7 48%, #f0f1f2 100%);
}

[data-theme="light"] .main-content,
[data-theme="light"] .main-wrap {
  background: transparent;
}

[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, var(--sidebar-bg2) 0%, var(--sidebar-bg) 58%, #111318 100%);
  border-left: 1px solid var(--sidebar-border);
  box-shadow: -8px 0 24px rgba(16,19,24,.16);
}

[data-theme="light"] .sidebar-logo,
[data-theme="light"] .sidebar-brand,
[data-theme="light"] .sidebar-footer {
  border-color: var(--sidebar-border);
}

[data-theme="light"] .logo-text,
[data-theme="light"] .brand-name,
[data-theme="light"] .user-name {
  color: var(--sidebar-txt);
}

[data-theme="light"] .logo-sub,
[data-theme="light"] .brand-role,
[data-theme="light"] .user-role,
[data-theme="light"] .nav-label,
[data-theme="light"] .nav-section-label {
  color: var(--sidebar-txt2);
}

[data-theme="light"] .nav-item {
  color: var(--sidebar-txt2);
}

[data-theme="light"] .nav-item:hover {
  color: var(--sidebar-txt);
  background: rgba(183,189,198,.08);
  border-color: var(--sidebar-border);
  box-shadow: 0 5px 12px rgba(0,0,0,.10);
}

[data-theme="light"] .nav-item.active {
  color: #fcd535;
  background: rgba(240,185,11,.24);
  border-color: var(--accent-border);
  border-right-color: var(--accent);
  box-shadow: 0 6px 14px rgba(0,0,0,.14);
}

[data-theme="light"] .nav-item.active .icon,
[data-theme="light"] .nav-item.active .nav-icon {
  color: #fcd535;
}

[data-theme="light"] .sidebar-footer > .user-info {
  background: rgba(183,189,198,.06);
  border-color: var(--sidebar-border);
}

[data-theme="light"] .sidebar-footer > .user-info:hover {
  background: rgba(183,189,198,.09);
  border-color: rgba(183,189,198,.14);
  box-shadow: 0 6px 14px rgba(0,0,0,.12);
}

[data-theme="light"] .topbar {
  background: rgba(255,255,255, .94);
  border-bottom-color: rgba(240,185,11,.24);
  box-shadow: 0 1px 0 rgba(240,185,11,.14), 0 8px 20px rgba(24,26,32,.06);
}

[data-theme="light"] .notif-btn,
[data-theme="light"] .theme-btn,
[data-theme="light"] .theme-btn-float,
[data-theme="light"] .sidebar-toggle,
[data-theme="light"] .desktop-sidebar-toggle,
[data-theme="light"] .desktop-sidebar-show,
[data-theme="light"] .btn-icon,
[data-theme="light"] .copy-btn,
[data-theme="light"] .page-btn {
  background: var(--card2);
  border-color: var(--border);
  color: var(--txt2);
  box-shadow: none;
}

[data-theme="light"] .notif-btn:hover,
[data-theme="light"] .theme-btn:hover,
[data-theme="light"] .theme-btn-float:hover,
[data-theme="light"] .sidebar-toggle:hover,
[data-theme="light"] .desktop-sidebar-toggle:hover,
[data-theme="light"] .desktop-sidebar-show:hover,
[data-theme="light"] .btn-icon:hover,
[data-theme="light"] .copy-btn:hover,
[data-theme="light"] .page-btn:hover {
  background: var(--card);
  border-color: var(--accent-border);
  color: var(--accent2);
  box-shadow: var(--glow-sm);
}

[data-theme="light"] .btn-primary {
  background: linear-gradient(135deg, #e5ad00 0%, #c99400 48%, #8f6c00 100%);
  color: #f7fbff;
  box-shadow: 0 8px 18px rgba(240,185,11,.18);
}

[data-theme="light"] .btn-primary:hover {
  background: linear-gradient(135deg, #f0b90b 0%, #e5ad00 48%, #c99400 100%);
  box-shadow: 0 10px 22px rgba(240,185,11,.24);
}

[data-theme="light"] .stat-card,
[data-theme="light"] .card,
[data-theme="light"] .table-wrap,
[data-theme="light"] .quick-action-card,
[data-theme="light"] .accordion-item,
[data-theme="light"] .radio-card,
[data-theme="light"] .bank-card,
[data-theme="light"] .doc-card,
[data-theme="light"] .report-card,
[data-theme="light"] .review-invest-card,
[data-theme="light"] .modal,
[data-theme="light"] .toast {
  background: #ffffff;
  border-color: var(--border);
  box-shadow: var(--shadow-card);
}

[data-theme="light"] .stat-card::before {
  background: linear-gradient(90deg, transparent, rgba(240,185,11,.28), transparent);
}

[data-theme="light"] .stat-card:hover,
[data-theme="light"] .quick-action-card:hover,
[data-theme="light"] .report-card:hover {
  border-color: var(--accent-border);
  box-shadow: 0 10px 28px rgba(24,26,32,.10);
}

[data-theme="light"] .table-head,
[data-theme="light"] .pagination,
[data-theme="light"] .modal-footer,
[data-theme="light"] .card-footer {
  background: var(--bg);
}

[data-theme="light"] th,
[data-theme="light"] .table th {
  background: #f5f6f7;
  border-bottom-color: var(--border);
  color: var(--txt2);
}

[data-theme="light"] td,
[data-theme="light"] .table td {
  border-bottom-color: var(--border);
}

[data-theme="light"] tr:hover td,
[data-theme="light"] .table tbody tr:hover {
  background: rgba(240,185,11,.04);
}

[data-theme="light"] .search-box,
[data-theme="light"] .form-input,
[data-theme="light"] .form-select,
[data-theme="light"] .form-textarea,
[data-theme="light"] .notes-area,
[data-theme="light"] .file-upload,
[data-theme="light"] .file-upload-zone {
  background: #f5f6f7;
  border-color: var(--border);
  color: var(--txt);
}

[data-theme="light"] .search-input {
  color: var(--txt);
}

[data-theme="light"] .search-box:focus-within,
[data-theme="light"] .form-input:focus,
[data-theme="light"] .form-select:focus,
[data-theme="light"] .form-textarea:focus,
[data-theme="light"] .notes-area:focus {
  background: #ffffff;
  border-color: var(--accent-border);
  box-shadow: 0 0 0 4px rgba(240,185,11,.12);
}

[data-theme="light"] .btn-secondary {
  background: var(--card2);
  color: var(--txt2);
  border-color: var(--border);
  box-shadow: none;
}

[data-theme="light"] .btn-secondary:hover {
  background: var(--card);
  color: #fcd535;
  border-color: var(--accent-border);
  box-shadow: var(--glow-sm);
}

[data-theme="light"] .btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--txt2);
}

[data-theme="light"] .btn-ghost:hover {
  background: var(--accent-bg);
  color: var(--txt);
}

[data-theme="light"] .accordion-btn:hover,
[data-theme="light"] .file-upload:hover,
[data-theme="light"] .file-upload-zone:hover {
  background: var(--accent-bg);
}

[data-theme="light"] .tabs {
  border-bottom-color: var(--border);
}

[data-theme="light"] .empty,
[data-theme="light"] .empty-state,
[data-theme="light"] .empty-state-sm {
  color: var(--txt2);
}

[data-theme="light"] .empty-icon {
  opacity: .45;
}

/* Shared UX polish */
.filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.filter-toolbar .form-input,
.filter-toolbar .form-select {
  min-width: 170px;
}

.filter-toolbar .form-group {
  margin: 0;
  flex: 1 1 180px;
}

.date-parts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.date-parts input.form-input.date-part-input {
  text-align: center;
  direction: rtl;
  padding: 8px 10px;
}

.date-parts input.form-input.date-part-input:focus,
.date-parts input.form-input.date-part-input:not(:placeholder-shown) {
  direction: ltr;
}

.date-parts input.form-input.date-part-input::placeholder {
  text-align: center;
  direction: rtl;
  font-size: 12px;
}

.portfolio-date-row {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

.portfolio-date-parts {
  flex: 0 1 auto;
}

.portfolio-calendar-btn {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
}

.portfolio-native-date {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.filter-toolbar .btn {
  white-space: nowrap;
}

.withdrawals-card {
  padding: 0;
}

.client-withdrawal-days-strip {
  min-height: 42px;
  margin-bottom: 12px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r2);
  background: rgba(255,255,255,.018);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.client-withdrawal-days-strip.is-join-locked {
  align-items: flex-start;
  border-color: rgba(255, 93, 93, .34);
  background: rgba(255, 93, 93, .08);
}

.withdrawal-join-lock-alert {
  width: 100%;
  color: #ff8a8a;
  line-height: 1.65;
}

.withdrawal-join-lock-title {
  font-size: 13px;
  font-weight: 900;
}

.withdrawal-join-lock-text {
  margin-top: 2px;
  color: #ffc1c1;
  font-size: 12px;
  font-weight: 700;
}

.withdrawal-days-label {
  color: var(--txt3);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.withdrawal-days-mini-list {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1 1 auto;
  min-width: 0;
}

.withdrawal-day-mini {
  min-height: 26px;
  padding: 5px 10px;
  border: 1px solid rgba(53,211,154,.28);
  border-radius: 999px;
  background: rgba(53,211,154,.08);
  color: var(--txt);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.withdrawal-day-mini.is-today {
  border-color: var(--accent-border);
  background: rgba(201,168,76,.12);
  color: var(--accent3);
}

.withdrawal-days-status {
  min-height: 26px;
  margin-inline-start: auto;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.withdrawal-days-status span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.withdrawal-days-status.is-open {
  color: #35d39a;
  border-color: rgba(53,211,154,.28);
  background: rgba(53,211,154,.08);
}

.withdrawal-days-status.is-closed {
  color: #f0b90b;
  border-color: rgba(201,168,76,.32);
  background: rgba(201,168,76,.1);
}

.client-withdrawals-card {
  overflow: hidden;
}

.client-withdrawals-card > .card-header {
  padding: 14px 22px;
  min-height: 64px;
}

.client-withdrawals-card > .card-body {
  border-top: 1px solid var(--border);
}

.client-withdrawals-empty {
  min-height: 160px;
  width: 100%;
  padding: 30px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
}

.client-withdrawals-empty .empty-title {
  margin: 0;
  color: var(--txt2);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.5;
}

.client-withdrawals-empty-btn {
  min-width: 130px;
  min-height: 44px;
  margin: 0 auto;
  justify-content: center;
  white-space: nowrap;
}

.withdrawals-card > .card-header {
  padding: 12px 20px;
  min-height: 58px;
}

.withdrawals-card > .card-header .card-title {
  margin: 0;
  padding: 0;
  border-bottom: 0;
  line-height: 1.25;
}

.withdrawals-card > .card-header .btn {
  min-height: 38px;
  padding-block: 8px;
}

.withdrawals-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.withdrawals-summary-pill {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 2px 8px;
  width: fit-content;
  max-width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--accent-border);
  border-radius: var(--r2);
  background: rgba(201,168,76,.08);
  color: var(--txt);
}

.withdrawals-summary-pill span {
  color: var(--txt3);
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.withdrawals-summary-pill strong {
  color: #f0b90b;
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  line-height: 1;
  white-space: nowrap;
}

.withdrawals-summary-pill small {
  grid-column: 1 / -1;
  color: var(--txt3);
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
}

.withdrawals-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.015);
}

.withdrawals-search-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

.withdrawals-search-group .form-input {
  width: min(420px, 100%);
  min-width: 240px;
}

.withdrawals-toolbar > .form-input {
  flex: 0 0 200px;
}

.wd-report-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.wd-report-note {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r2);
  background: rgba(255,255,255,.025);
  color: var(--txt2);
  font-size: 12px;
  line-height: 1.7;
}

.withdrawal-management-panel {
  display: grid;
  gap: 14px;
}

.withdrawal-management-section {
  border: 1px solid var(--border);
  border-radius: var(--r3);
  background: rgba(255,255,255,.025);
  padding: 18px 20px 20px;
  display: grid;
  gap: 18px;
}

.withdrawal-management-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 18px;
}

.withdrawal-management-title {
  color: var(--txt);
  font-size: 15px;
  font-weight: 900;
  margin-bottom: 6px;
  line-height: 1.4;
}

.withdrawal-management-desc {
  color: var(--txt3);
  font-size: 12px;
  line-height: 1.8;
}

.withdrawal-management-toggle {
  min-height: 38px;
  width: max-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: var(--r3);
  background: var(--bg2);
  padding: 8px 11px;
  color: var(--txt2);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
  cursor: pointer;
}

.withdrawal-management-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.withdrawal-weekday-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(82px, 1fr));
  gap: 8px;
}

.wd-weekday-option {
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: var(--r3);
  background: var(--bg2);
  color: var(--txt2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 8px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: border-color var(--tr), background var(--tr), color var(--tr), transform var(--tr);
}

.wd-weekday-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.wd-weekday-option.selected {
  border-color: var(--accent-border);
  background: var(--accent-bg);
  color: var(--accent3);
}

.wd-weekday-option:not(.disabled):hover {
  border-color: var(--border2);
  transform: translateY(-1px);
}

.wd-weekday-option.disabled {
  opacity: .55;
  cursor: not-allowed;
}

.withdrawal-join-lock-grid {
  grid-template-columns: minmax(0, 1fr) minmax(180px, .82fr);
  align-items: start;
  gap: 20px;
}

.withdrawal-join-lock-grid .form-group {
  margin-bottom: 0;
}

.withdrawal-join-lock-grid .form-label {
  min-height: 18px;
  margin-bottom: 8px;
  text-align: right;
}

.withdrawal-join-lock-grid .form-input {
  min-height: 52px;
  width: 100%;
  text-align: right;
}

@media (max-width: 760px) {
  .withdrawal-management-section {
    padding: 16px;
    gap: 16px;
  }

  .withdrawal-management-head,
  .withdrawal-join-lock-grid {
    grid-template-columns: 1fr;
  }

  .withdrawal-management-toggle {
    width: 100%;
    justify-content: space-between;
  }
}

.wd-report-print-host {
  position: fixed;
  top: 0;
  left: -12000px;
  z-index: -1;
  width: 1120px;
  pointer-events: none;
  background: #fff;
}

.wd-report-paper {
  width: 1120px;
  height: 772px;
  padding: 34px;
  direction: rtl;
  background: #fff;
  color: #1e2329;
  font-family: Arial, Tahoma, sans-serif;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.wd-report-paper * {
  box-sizing: border-box;
}

.wd-report-paper-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 2px solid #d7b55d;
}

.wd-report-paper-eyebrow {
  margin-bottom: 6px;
  color: #7a621f;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.wd-report-paper h1 {
  margin: 0;
  color: #171a1f;
  font-size: 30px;
  line-height: 1.2;
}

.wd-report-paper-meta {
  display: grid;
  gap: 7px;
  min-width: 280px;
  color: #5e6673;
  font-size: 13px;
  line-height: 1.5;
  text-align: right;
  direction: rtl;
}

.wd-report-paper-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0;
}

.wd-report-paper-summary > div {
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.wd-report-paper-summary span {
  display: block;
  margin-bottom: 6px;
  color: #707a8a;
  font-size: 12px;
  font-weight: 700;
}

.wd-report-paper-summary strong {
  color: #111318;
  font-family: 'JetBrains Mono', Arial, sans-serif;
  font-size: 24px;
  line-height: 1.2;
}

.wd-report-paper-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
}

.wd-report-paper-table-head {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  direction: rtl;
  background: #181a20;
}

.wd-report-paper-table-head-cell {
  padding: 10px 8px;
  border-left: 1px solid rgba(255,255,255,.12);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.5;
  text-align: right;
  white-space: nowrap;
}

.wd-report-paper-table-head-cell:last-child {
  border-left: 0;
}

.wd-report-paper-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  direction: rtl;
}

.wd-report-paper-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #e5edf6;
  color: #252a31;
  font-size: 11px;
  line-height: 1.5;
  text-align: right;
  vertical-align: middle;
  word-break: break-word;
}

.wd-report-paper-table tr {
  break-inside: avoid;
  page-break-inside: avoid;
}

.wd-report-paper-table tbody tr:nth-child(even) td {
  background: #f8fafc;
}

.wd-report-paper-table tbody tr:last-child td {
  border-bottom: 0;
}

.wd-report-money,
.wd-report-iban {
  font-family: 'JetBrains Mono', Consolas, monospace;
  direction: ltr;
  unicode-bidi: isolate;
}

.wd-report-iban {
  text-align: left !important;
}

.wd-report-status-cell {
  text-align: center !important;
}

.wd-report-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 3px 10px;
  border: 1px solid #d7b55d;
  border-radius: 999px;
  background: #fff8e1;
  color: #6b530f;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.wd-report-ar-text {
  direction: rtl;
  unicode-bidi: isolate;
  font-family: Tahoma, Arial, sans-serif;
}

.wd-report-paper-footer {
  flex: 0 0 auto;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
  color: #707a8a;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.filters-stack {
  display: grid;
  gap: 12px;
}

.date-filter-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r2);
  background: rgba(255,255,255,.02);
}

.single-date-row {
  justify-content: flex-start;
}

.date-filter-block {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.date-filter-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 96px;
  color: var(--txt3);
  align-self: center;
  padding-inline: 4px;
}

.date-filter-divider-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.date-filter-divider-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--txt2);
}

.statements-page,
.notifications-page {
  display: grid;
  gap: 16px;
}
























































































.topbar-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.topbar-heading {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.topbar-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--txt3);
  font-size: 12px;
}

.breadcrumb-link {
  color: var(--txt2);
  text-decoration: none;
}

.breadcrumb-link:hover {
  color: var(--accent);
}

.breadcrumb-current {
  color: var(--txt3);
}

.breadcrumb-sep {
  color: var(--txt3);
  opacity: .7;
}

.statements-hero {
  overflow: hidden;
}

.statements-hero .card-body {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  flex-wrap: wrap;
}

.statements-hero .card-body > div:first-child {
  display: grid;
  gap: 10px;
  max-width: 620px;
}

.statements-title {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -.02em;
}

.statements-hero .text-muted {
  max-width: 680px;
  line-height: 1.8;
}

.data-summary-grid,
.reports-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.data-summary-card {
  position: relative;
  overflow: hidden;
  padding: 16px 18px;
  border-radius: var(--r2);
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.01)),
    linear-gradient(135deg, rgba(240,185,11,.08), rgba(217,166,0,.02));
  box-shadow: var(--shadow-sm);
  animation: fade-up .35s ease;
}

.data-summary-card::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  opacity: .85;
}

.data-summary-value {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 6px;
}

.data-summary-label {
  color: var(--txt2);
  font-size: 13px;
}

.date-parts-compact {
  grid-template-columns: repeat(3, auto);
  align-items: center;
}

.date-parts-compact input.form-input.date-part-input {
  width: 88px;
  min-width: 88px;
  font-size: 13px;
}

.date-parts-compact input.form-input.date-part-input[id$="-year"] {
  width: 104px;
  min-width: 104px;
}

.date-filter-note {
  color: var(--txt3);
  font-size: 12px;
  line-height: 1.7;
  padding-inline: 2px;
}

.date-filter-actions {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  min-width: 120px;
}














.admin-thread {
  margin-top: 16px;
}




.activity-list {
  display: grid;
  gap: 12px;
}

.activity-item {
  padding: 14px 16px;
  border-radius: var(--r2);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  display: grid;
  gap: 4px;
}

.activity-title {
  font-weight: 700;
  color: var(--txt);
}

.activity-meta {
  color: var(--txt2);
  font-size: 12px;
}

.activity-desc {
  color: var(--txt2);
  line-height: 1.7;
}

.statements-toolbar {
  justify-content: flex-end;
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: var(--txt2);
}

.checkbox-inline input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.table-note {
  padding: 12px 14px;
  color: var(--txt2);
  font-size: 13px;
}

.notifications-list {
  display: grid;
  gap: 12px;
}

.notification-card {
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
  display: grid;
  gap: 12px;
}

.notification-card.is-unread {
  border-color: var(--accent-border);
  box-shadow: var(--glow-sm);
}

.notification-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.notification-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--txt);
}

.notification-card-time {
  color: var(--txt3);
  font-size: 12px;
  margin-top: 4px;
}

.notification-card-body {
  color: var(--txt2);
  line-height: 1.9;
  white-space: pre-wrap;
}

.pw-field {
  position: relative;
}

.pw-field .form-input {
  padding-left: 50px;
}

.pw-field .pw-eye {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
}

.mobile-bottom-nav {
  display: none;
}

.mobile-nav-item {
  flex: 1;
  min-width: 0;
  color: var(--txt3);
  text-decoration: none;
  display: grid;
  justify-items: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  padding: 7px 4px 6px;
}

.mobile-nav-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mobile-nav-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mobile-nav-label {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-nav-item.active {
  color: var(--accent3);
}

.doc-card.is-disabled {
  opacity: .68;
}

.doc-card.is-disabled .doc-actions .btn {
  cursor: not-allowed;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1024px) {
}

@media (max-width: 768px) {
  .filter-toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .filter-toolbar .form-input,
  .filter-toolbar .form-select,
  .filter-toolbar .form-group,
  .filter-toolbar .btn {
    width: 100%;
    min-width: 0;
  }

  .withdrawals-toolbar,
  .withdrawals-search-group {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .withdrawals-search-group .form-input,
  .withdrawals-toolbar > .form-input,
  .withdrawals-search-group .btn {
    width: 100%;
    min-width: 0;
  }

  .client-withdrawal-days-strip {
    align-items: flex-start;
    gap: 7px;
    padding: 8px;
  }

  .withdrawal-days-status {
    margin-inline-start: 0;
  }

  .client-withdrawals-card > .card-header {
    min-height: 58px;
    padding: 12px 14px;
  }

  .client-withdrawals-empty {
    min-height: 136px;
    padding: 24px 14px;
  }

  .client-withdrawals-empty .empty-title {
    font-size: 15px;
  }

  .client-withdrawals-empty-btn {
    width: min(160px, 100%);
    min-height: 42px;
    padding: 10px 14px;
  }

  .wd-report-config-grid {
    grid-template-columns: 1fr;
  }

  .withdrawal-weekday-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .date-parts {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .date-filter-row {
    display: grid;
    gap: 12px;
    align-items: stretch;
  }

  .date-filter-block {
    width: 100%;
  }

  .date-filter-divider {
    min-width: 0;
    width: 100%;
  }

  .date-filter-actions {
    min-width: 0;
    width: 100%;
  }

  .date-filter-actions .btn {
    width: 100%;
  }

  .date-parts-compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .date-parts-compact input.form-input.date-part-input,
  .date-parts-compact input.form-input.date-part-input[id$="-year"] {
    width: 100%;
    min-width: 0;
  }

  .portfolio-date-row {
    width: 100%;
  }

  .portfolio-date-parts {
    flex: 1 1 auto;
  }

  .data-summary-grid,
  .reports-summary {
    grid-template-columns: 1fr;
  }








  .topbar-main {
    align-items: flex-start;
  }

  .topbar-breadcrumbs {
    font-size: 11px;
  }

.statements-hero .card-body {
    gap: 14px;
  }















.statements-title {
    font-size: 24px;
  }











  .notification-card {
    padding: 14px;
  }

  .notification-card-head {
    display: grid;
  }

  .app-shell-client .mobile-bottom-nav {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 45;
    display: flex;
    border-top: 1px solid var(--border);
    background: rgba(16,19,24,.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    min-height: 54px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .app-shell-client .page-content {
    padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px));
  }
}

[data-theme="light"] .data-summary-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.98)),
    linear-gradient(135deg, rgba(240,185,11,.07), rgba(71,77,87,.03));
  border-color: var(--border);
}





[data-theme="light"] .activity-item {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.98));
  border-color: var(--border);
}





[data-theme="light"] .date-filter-row {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.98));
  border-color: var(--border);
}

[data-theme="light"] .notification-card,
[data-theme="light"] .app-shell-client .mobile-bottom-nav,
[data-theme="light"] #exceptions-table .btn {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(239,244,251,.98));
  border-color: var(--border);
}

/* Theme refresh final overrides */
body {
  background:
    radial-gradient(circle at top right, rgba(240,185,11,.055), transparent 26%),
    linear-gradient(180deg, #0b0e11 0%, #090c0f 100%);
}

.main-content,
.main-wrap {
  background: transparent;
}

.sidebar {
  background: linear-gradient(180deg, #181a20 0%, #101318 58%, #0b0e11 100%);
  border-left-color: rgba(183,189,198,.1);
}

.topbar {
  background: rgba(16,19,24,.96);
  border-bottom-color: var(--border);
}

.stat-card,
.card,
.table-wrap,
.quick-action-card,
.accordion-item,
.radio-card,
.bank-card,
.doc-card,
.report-card,
.review-invest-card,
.modal,
.toast,
.notification-card {
  background: linear-gradient(180deg, rgba(24,26,32,.98), rgba(30,35,41,.98));
  border-color: var(--border);
}

.table-head,
.pagination,
.modal-footer,
.card-footer {
  background: linear-gradient(180deg, rgba(30,35,41,.98), rgba(30,35,41,.98));
}

.form-input,
.form-select,
.form-textarea,
.notes-area,
.search-box {
  background: rgba(16,19,24,.78);
  border-color: var(--border);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2)) !important;
  border-color: transparent !important;
  color: #171a1f !important;
  font-weight: 800;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #fcd535, #d9a600) !important;
}

.btn-secondary {
  background: rgba(183,189,198,.08) !important;
  border-color: var(--border) !important;
  color: var(--txt) !important;
}

.btn-secondary:hover {
  background: rgba(183,189,198,.12) !important;
  border-color: var(--border2) !important;
}

.auth-box {
  background: linear-gradient(180deg, rgba(24,26,32,.98), rgba(16,19,24,.98));
  border-color: var(--border2);
}

.auth-divider span {
  background: var(--card);
}

.app-shell-client .mobile-bottom-nav {
  background: rgba(11,14,17,.96);
}





[data-theme="light"] body {
  background:
    radial-gradient(circle at top right, rgba(240,185,11,.05), transparent 26%),
    linear-gradient(180deg, #fafafa 0%, #f5f6f7 54%, #f0f1f2 100%) !important;
}

[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, #181a20 0%, #111318 58%, #111318 100%);
  border-left-color: rgba(183,189,198,.10);
}

[data-theme="light"] .topbar {
  background: rgba(255,255,255,.94);
  border-bottom-color: rgba(240,185,11,.24);
}

[data-theme="light"] .stat-card,
[data-theme="light"] .card,
[data-theme="light"] .table-wrap,
[data-theme="light"] .quick-action-card,
[data-theme="light"] .accordion-item,
[data-theme="light"] .radio-card,
[data-theme="light"] .bank-card,
[data-theme="light"] .doc-card,
[data-theme="light"] .report-card,
[data-theme="light"] .review-invest-card,
[data-theme="light"] .modal,
[data-theme="light"] .toast,
[data-theme="light"] .notification-card {
  background: #ffffff;
  border-color: var(--border);
  box-shadow: var(--shadow-card);
}

[data-theme="light"] .table-head,
[data-theme="light"] .pagination,
[data-theme="light"] .modal-footer,
[data-theme="light"] .card-footer {
  background: var(--bg);
}

[data-theme="light"] .form-input,
[data-theme="light"] .form-select,
[data-theme="light"] .form-textarea,
[data-theme="light"] .notes-area,
[data-theme="light"] .search-box {
  background: #f5f6f7;
  border-color: var(--border);
}

[data-theme="light"] .btn-primary {
  color: #f7fbff !important;
}

[data-theme="light"] .btn-secondary {
  background: var(--card2) !important;
  border-color: var(--accent-border) !important;
  color: var(--accent3) !important;
}

[data-theme="light"] .btn-secondary:hover {
  background: var(--accent-bg) !important;
  border-color: var(--accent-border) !important;
}

[data-theme="light"] .auth-page {
  background: linear-gradient(135deg, #f5f6f7 0%, #f5f6f7 50%, #eaecef 100%) !important;
}

[data-theme="light"] .auth-box,
[data-theme="light"] .auth-divider span {
  background: var(--card);
}

[data-theme="light"] .app-shell-client .mobile-bottom-nav {
  background: rgba(255,255,255,.97);
}









/* ═══════════════════════════════════════
   Public Home Page
   ═══════════════════════════════════════ */
.public-home-page {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(11,14,17, .96), rgba(16,19,24, .96)),
    var(--bg);
  color: var(--txt);
}

.home-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: auto auto;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  min-height: 76px;
  padding: 14px clamp(16px, 4vw, 44px);
  background: rgba(11,14,17, .88);
  border-bottom: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(16px);
}

.home-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--txt);
  text-decoration: none;
  min-width: 0;
}

.home-brand img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.home-brand span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.home-brand strong {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
}

.home-brand small {
  color: var(--txt2);
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
}

.home-actions,
.home-inline-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.home-actions {
  justify-content: flex-end;
}

.home-main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 64px;
}

.client-home-page {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 12px;
}

.client-home-toolbar {
  display: flex;
  justify-content: flex-start;
}

.home-join-summary {
  display: grid;
  grid-template-columns: auto repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--r2);
  background: rgba(24,26,32, .78);
  box-shadow: var(--shadow-card);
}

.home-join-summary-title {
  padding: 0 8px;
  color: var(--txt);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.5;
  white-space: nowrap;
}

.home-join-summary-item {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r3);
  background: rgba(16,19,24, .76);
}

.home-join-summary-item > span {
  color: var(--txt3);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.home-join-summary-item strong {
  color: var(--txt);
  direction: ltr;
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.home-percent-value {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.home-percent-value span {
  color: inherit;
  font: inherit;
  line-height: inherit;
}

.home-accordion {
  display: grid;
  gap: 10px;
  scroll-margin-top: 92px;
}

.home-accordion-item {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r2);
  background: rgba(24,26,32, .86);
  box-shadow: var(--shadow-card);
  scroll-margin-top: 94px;
}

.home-accordion-btn {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  border: 0;
  background: transparent;
  color: var(--txt);
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  text-align: start;
  cursor: pointer;
  transition: background var(--tr), color var(--tr);
}

.home-accordion-btn > span:first-child {
  min-width: 0;
}

.home-accordion-btn:hover,
.home-accordion-btn[aria-expanded="true"] {
  background: rgba(240,185,11,.08);
}

.home-accordion-icon {
  width: auto;
  min-width: 28px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 0 10px;
  border: 1px solid var(--border2);
  border-radius: 999px;
  color: var(--accent3);
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}

.home-accordion-icon::after {
  content: "اضغط لعرض الشرح";
  color: var(--txt2);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.home-accordion-btn[aria-expanded="true"] .home-accordion-icon::after {
  content: "اضغط لاخفاء الشرح";
}

.home-accordion-body {
  border-top: 1px solid var(--border);
}

.home-section-content {
  padding: 20px;
  color: var(--txt2);
  font-size: 14px;
  line-height: 1.9;
}

.home-section-content p {
  margin: 0 0 14px;
}

.home-section-content p:last-child {
  margin-bottom: 0;
}

.home-section-content ul {
  margin: 0;
  padding-inline-start: 22px;
}

.home-section-content li {
  margin: 7px 0;
}

.home-section-content strong {
  color: var(--txt);
}

.home-step-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-inline-start: 24px;
}

.home-step-list li {
  padding-inline-start: 4px;
}

.home-guide-note {
  margin-top: 16px;
  padding: 13px 14px;
  border: 1px solid var(--accent-border);
  border-radius: var(--r3);
  background: var(--accent-bg);
  color: var(--txt2);
  line-height: 1.8;
}

.home-guide-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.home-page-guide-grid > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.home-page-guide-grid > div p {
  flex: 1 1 auto;
}

.home-page-guide-grid a:not(.btn) {
  color: var(--accent3);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.home-page-guide-grid a:not(.btn):hover {
  text-decoration: underline;
}

.home-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.home-info-grid > div {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--r3);
  background: rgba(16,19,24, .72);
}

.home-info-grid h3 {
  margin: 0 0 8px;
  color: var(--accent3);
  font-size: 14px;
}

.home-examples-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0 12px;
  scroll-snap-type: x proximity;
}

.home-example-card {
  flex: 0 0 min(290px, 82vw);
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--r3);
  background: rgba(16,19,24, .82);
  scroll-snap-align: start;
}

.home-example-head,
.home-example-profit {
  display: grid;
  gap: 5px;
}

.home-example-profit-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.home-example-head span,
.home-example-profit span,
.home-example-list dt {
  color: var(--txt3);
  font-size: 11px;
  font-weight: 800;
}

.home-example-head strong {
  min-height: 42px;
  color: var(--txt);
  font-size: 14px;
  line-height: 1.5;
}

.home-example-profit strong {
  color: var(--green);
  font-size: 22px;
  line-height: 1.2;
}

.home-example-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.home-example-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 30px;
}

.home-example-list dd {
  margin: 0;
  color: var(--txt);
  direction: ltr;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}

.home-example-empty {
  width: 100%;
  padding: 20px;
  border: 1px dashed var(--border2);
  border-radius: var(--r3);
  color: var(--txt2);
  text-align: center;
}

.home-trades-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0 12px;
  scroll-snap-type: x proximity;
}

.home-trade-card {
  flex: 0 0 min(190px, 62vw);
  display: grid;
  place-items: center;
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--r3);
  background: rgba(16,19,24, .82);
  scroll-snap-align: start;
}

.home-trade-card strong {
  color: var(--green);
  direction: ltr;
  font-family: 'JetBrains Mono', monospace;
  font-size: 24px;
  line-height: 1.2;
  text-align: center;
}

.home-trade-card.loss {
  border-color: var(--red-border);
}

.home-trade-card.loss strong {
  color: var(--red);
}

.home-inline-actions {
  margin-top: 16px;
}

.home-modal .modal-body {
  color: var(--txt2);
  line-height: 1.9;
}

.home-modal .modal-body p {
  margin: 0;
}

[data-theme="light"] .public-home-page {
  background: var(--bg);
}

[data-theme="light"] .home-topbar {
  background: rgba(255,255,255,.9);
  border-bottom-color: var(--border);
}

[data-theme="light"] .home-accordion-item {
  background: var(--card);
}

[data-theme="light"] .home-join-summary {
  background: var(--card);
}

[data-theme="light"] .home-join-summary-item {
  background: var(--card2);
}

[data-theme="light"] .home-info-grid > div,
[data-theme="light"] .home-example-card,
[data-theme="light"] .home-trade-card {
  background: var(--card2);
}

[data-theme="light"] .home-guide-note {
  color: var(--txt2);
}

@media (max-width: 980px) {
  .home-topbar {
    grid-template-columns: 1fr;
  }

  .home-actions {
    justify-content: flex-start;
  }

  .home-join-summary {
    grid-template-columns: 1fr;
  }

  .home-join-summary-title {
    padding: 2px 4px;
  }

  .home-info-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .home-topbar {
    padding: 12px 14px;
    gap: 12px;
  }

  .home-brand small {
    display: none;
  }

  .home-actions .btn {
    min-height: 36px;
    padding-inline: 10px;
    font-size: 12px;
  }

  .home-main {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .home-join-summary {
    gap: 8px;
    padding: 8px;
  }

  .home-join-summary-item {
    min-height: 42px;
    padding: 8px 10px;
  }

  .home-section-content {
    padding: 16px;
  }

  .home-guide-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

html input.form-input[type="email"]:focus,
html input.form-input[inputmode="email"]:focus,
html input.form-input[id*="email" i]:focus,
html input.email-search-input:focus {
  background-image: none !important;
  background-repeat: no-repeat !important;
  background-size: 0 0 !important;
  background-position: center !important;
}

/* Light-mode readability: preserve subtle tokens,
route normal copy to AA-safe tones. */
[data-theme="light"] .stat-sub,
[data-theme="light"] .stat-label,
[data-theme="light"] .main-wrap .stat-label,
[data-theme="light"] .main-wrap .stat-sub,
[data-theme="light"] .form-note,
[data-theme="light"] .form-hint,
[data-theme="light"] .notif-item-time,
[data-theme="light"] .invest-summary-x,
[data-theme="light"] .file-upload-hint,
[data-theme="light"] .file-info-size,
[data-theme="light"] .review-invest-shares,
[data-theme="light"] .review-item-label,
[data-theme="light"] .empty-desc,
[data-theme="light"] .empty-subtitle,
[data-theme="light"] .detail-label,
[data-theme="light"] .cell-sub,
[data-theme="light"] .text-muted,
[data-theme="light"] .page-info,
[data-theme="light"] .bank-iban,
[data-theme="light"] .report-desc,
[data-theme="light"] .table-note,
[data-theme="light"] .sub-desc,
[data-theme="light"] .preview-title,
[data-theme="light"] .preview-item span,
[data-theme="light"] .file-upload-label,
[data-theme="light"] .suggestion-summary-label,
[data-theme="light"] .suggestion-tip span,
[data-theme="light"] .qa-meta,
[data-theme="light"] .badge-muted,
[data-theme="light"] .badge-neutral {
  color: var(--txt2) !important;
}

[data-theme="light"] .auth-logo h1,
[data-theme="light"] .stat-accent,
[data-theme="light"] .text-accent,
[data-theme="light"] .tx-sum-value.accent,
[data-theme="light"] .invest-summary-total,
[data-theme="light"] .review-invest-amount,
[data-theme="light"] .btn-link,
[data-theme="light"] .link,
[data-theme="light"] .tab-btn.active,
[data-theme="light"] .page-btn:hover,
[data-theme="light"] .copy-btn:hover,
[data-theme="light"] th.sortable:hover,
[data-theme="light"] th.sort-asc::after,
[data-theme="light"] th.sort-desc::after,
[data-theme="light"] .step.active,
[data-theme="light"] .step.active .step-circle,
[data-theme="light"] .step.active .step-label,
[data-theme="light"] .wd-step.active .wd-step-dot,
[data-theme="light"] .wd-step.active .wd-step-label,
[data-theme="light"] .qa-meta.accent {
  color: var(--accent2) !important;
}

[data-theme="light"] .info-box.warning,
[data-theme="light"] .badge-warn,
[data-theme="light"] .suggestion-read-state.is-unread {
  color: var(--accent2) !important;
}

[data-theme="light"] .stat-icon.green { background: var(--green-bg) !important; color: var(--green) !important; }
[data-theme="light"] .stat-icon.red { background: var(--red-bg) !important; color: var(--red) !important; }
[data-theme="light"] .stat-icon.blue { background: var(--blue-bg) !important; color: var(--blue) !important; }
[data-theme="light"] .stat-icon.orange { background: var(--orange-bg) !important; color: var(--accent2) !important; }

[data-theme="light"] .info-box.warning,
[data-theme="light"] .badge-warn {
  background: var(--orange-bg) !important;
  border-color: var(--orange-border) !important;
}

[data-theme="light"] .msg-reply-box {
  background: var(--green-bg) !important;
  border-color: var(--green-border) !important;
}



/* ═══════════════════════════════════════
   GLOBAL FIELD POLISH
   ═══════════════════════════════════════ */
input.form-input,
textarea.form-input,
.form-select,
.search-input,
.email-search-input,
.auth-page input.form-input {
  min-height: 42px;
  line-height: 1.45;
}

input.form-input:not(.date-part-input):not([type="password"]):not([type="number"]):not([type="date"]):not([type="time"]):not([type="datetime-local"]):not([type="month"]):not([type="week"]),
input.form-input[type="email"]:not(.date-part-input),
input.form-input[inputmode="email"]:not(.date-part-input),
input.form-input[type="search"]:not(.date-part-input),
input.form-input[type="text"]:not(.date-part-input),
.search-input,
.email-search-input {
  padding-inline-start: 14px !important;
  padding-inline-end: 44px !important;
}

input.form-input[dir="ltr"]:not(.date-part-input),
input.form-input[type="email"]:not(.date-part-input),
input.form-input[inputmode="email"]:not(.date-part-input),
.email-search-input,
.auth-page input.form-input[dir="ltr"] {
  direction: ltr;
  text-align: left;
}

.auth-page input.form-input::placeholder,
.email-search-input::placeholder {
  direction: ltr;
  text-align: left;
}

input.form-input[type="email"],
input.form-input[inputmode="email"],
input.form-input[id*="email" i],
input.email-search-input {
  background-image: none !important;
  background-repeat: no-repeat !important;
  background-size: 0 0 !important;
  background-position: center !important;
}

[data-theme="light"] input.form-input[type="email"],
[data-theme="light"] input.form-input[inputmode="email"],
[data-theme="light"] input.form-input[id*="email" i],
[data-theme="light"] input.email-search-input {
  background-color: #ffffff !important;
  background-image: none !important;
  background-repeat: no-repeat !important;
  background-size: 0 0 !important;
}

.input-wrap .form-input,
.pw-field .form-input {
  padding-inline-start: 14px !important;
  padding-inline-end: 46px !important;
}

.input-wrap .pw-eye,
.pw-field .pw-eye {
  inset-inline-start: auto;
  inset-inline-end: 0;
  left: auto;
  right: auto;
}

.pw-field .pw-eye {
  inset-inline-end: 8px;
}

input::-ms-clear,
input::-ms-reveal,
input::-webkit-search-cancel-button,
input::-webkit-search-decoration,
input::-webkit-search-results-button,
input::-webkit-search-results-decoration,
input::-webkit-credentials-auto-fill-button,
input::-webkit-contacts-auto-fill-button {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: var(--txt) !important;
  caret-color: var(--txt);
  transition: background-color 9999s ease-out;
}

select.form-input,
select.form-select,
.form-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  min-height: 42px;
  line-height: 1.45;
  padding-inline-start: 14px !important;
  padding-inline-end: 42px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23848e9c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-size: 16px 16px !important;
  background-position: left 14px center !important;
}

select.form-input[dir="ltr"],
select.form-select[dir="ltr"],
.form-select[dir="ltr"],
[dir="ltr"] select.form-input,
[dir="ltr"] select.form-select,
[dir="ltr"] .form-select {
  background-position: right 14px center !important;
}

/* Registration country selector: do not fall back to the browser's white native control. */
select.registration-country-select.form-input {
  background-color: var(--bg2) !important;
  color: var(--txt);
  color-scheme: dark;
}

select.registration-country-select.form-input:focus {
  background-color: rgba(255, 255, 255, .06) !important;
}

select.registration-country-select.form-input:invalid {
  color: var(--txt3);
}

[data-theme="light"] select.registration-country-select.form-input {
  background-color: #f5f6f7 !important;
  color-scheme: light;
}

[data-theme="light"] select.registration-country-select.form-input:focus {
  background-color: #ffffff !important;
}

/* ═══════════════════════════════════════
   WARM PRIVATE BANKING LIGHT MODE
   ═══════════════════════════════════════ */
[data-theme="light"] {
  --bg:  #f5f6f7;
  --bg2: #f0f1f2;
  --bg3: #eaecef;

  --card:  #ffffff;
  --card2: #f5f6f7;
  --card3: #f0f1f2;

  --border:  rgba(71,77,87, .20);
  --border2: rgba(71,77,87, .32);
  --border3: rgba(71,77,87, .44);

  --txt:  #111318;
  --txt2: #5e6673;
  --txt3: #707a8a;

  --accent:        #e5ad00;
  --accent2:       #c99400;
  --accent3:       #8f6c00;
  --accent-bg:     rgba(240,185,11,.10);
  --accent-border: rgba(240,185,11,.28);
  --accent-glow:   rgba(240,185,11,.18);

  --green:         #2d7a5f;
  --green-bg:      rgba(45,122,95,.10);
  --green-border:  rgba(45,122,95,.24);
  --red:           #b54a4a;
  --red-bg:        rgba(181,74,74,.10);
  --red-border:    rgba(181,74,74,.24);
  --blue:          #e5ad00;
  --blue-bg:       rgba(229,173,0,.10);
  --blue-border:   rgba(229,173,0,.24);
  --orange:        #c99400;
  --orange-bg:     rgba(201,148,0,.10);
  --orange-border: rgba(201,148,0,.24);
  --purple:        #c99400;
  --purple-bg:     rgba(240,185,11,.10);

  --sidebar-bg:     #111318;
  --sidebar-bg2:    #181a20;
  --sidebar-border: rgba(183,189,198,.10);
  --sidebar-txt:    #eaecef;
  --sidebar-txt2:   #b7bdc6;
  --sidebar-txt3:   #848e9c;

  --shadow:      0 16px 40px rgba(24,26,32, .10);
  --shadow-sm:   0 6px 18px rgba(24,26,32, .08);
  --shadow-card: 0 4px 16px rgba(24,26,32, .07);
  --glow:        0 0 24px rgba(240,185,11,.18);
  --glow-sm:     0 0 12px rgba(240,185,11,.12);
}

[data-theme="light"] body {
  background:
    radial-gradient(circle at top right, rgba(240,185,11,.05), transparent 28%),
    radial-gradient(circle at left 24%, rgba(71,77,87,.075), transparent 24%),
    linear-gradient(180deg, #fafafa 0%, #f5f6f7 56%, #f0f1f2 100%) !important;
  color: var(--txt);
}

[data-theme="light"] .main-content,
[data-theme="light"] .main-wrap {
  background: transparent !important;
}

[data-theme="light"] .auth-page {
  background:
    radial-gradient(circle at 18% 20%, rgba(240,185,11,.08), transparent 28%),
    linear-gradient(135deg, #f5f6f7 0%, #f5f6f7 52%, #eaecef 100%) !important;
}

[data-theme="light"] .auth-page::before {
  background:
    radial-gradient(ellipse at 10% 50%, rgba(240,185,11,.08) 0%, transparent 48%),
    radial-gradient(ellipse at 90% 15%, rgba(53,59,67,.06) 0%, transparent 42%),
    radial-gradient(ellipse at 55% 90%, rgba(71,77,87,.06) 0%, transparent 40%) !important;
}

[data-theme="light"] .auth-page::after {
  background-image:
    linear-gradient(rgba(71,77,87,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(71,77,87,.045) 1px, transparent 1px) !important;
}

[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, var(--sidebar-bg2) 0%, var(--sidebar-bg) 58%, #111318 100%) !important;
  border-left-color: var(--sidebar-border) !important;
  box-shadow: -8px 0 24px rgba(16,19,24,.16) !important;
}

[data-theme="light"] .sidebar-logo,
[data-theme="light"] .sidebar-brand,
[data-theme="light"] .sidebar-footer {
  border-color: var(--sidebar-border) !important;
}

[data-theme="light"] .logo-text,
[data-theme="light"] .brand-name,
[data-theme="light"] .user-name {
  color: var(--sidebar-txt) !important;
}

[data-theme="light"] .logo-sub,
[data-theme="light"] .brand-role,
[data-theme="light"] .user-role,
[data-theme="light"] .nav-label,
[data-theme="light"] .nav-section-label {
  color: var(--sidebar-txt2) !important;
}

[data-theme="light"] .topbar {
  background: rgba(255,255,255,.94) !important;
  border-bottom-color: rgba(240,185,11,.24) !important;
  box-shadow: 0 1px 0 rgba(240,185,11,.14), 0 10px 24px rgba(24,26,32,.08) !important;
}

[data-theme="light"] .stat-card,
[data-theme="light"] .card,
[data-theme="light"] .table-wrap,
[data-theme="light"] .quick-action-card,
[data-theme="light"] .accordion-item,
[data-theme="light"] .radio-card,
[data-theme="light"] .bank-card,
[data-theme="light"] .doc-card,
[data-theme="light"] .report-card,
[data-theme="light"] .review-invest-card,
[data-theme="light"] .modal,
[data-theme="light"] .toast,
[data-theme="light"] .notification-card,
[data-theme="light"] .auth-box {
  background: #ffffff !important;
  border-color: var(--border) !important;
  box-shadow: var(--shadow-card) !important;
}

[data-theme="light"] .table-head,
[data-theme="light"] .pagination,
[data-theme="light"] .modal-footer,
[data-theme="light"] .card-footer,
[data-theme="light"] th,
[data-theme="light"] .table th,
[data-theme="light"] .tx-summary,
[data-theme="light"] .tabs,
[data-theme="light"] .wd-step-dot {
  background: var(--bg) !important;
  border-color: var(--border) !important;
  color: var(--txt2) !important;
}

[data-theme="light"] td,
[data-theme="light"] .table td {
  border-bottom-color: var(--border) !important;
}

[data-theme="light"] tr:hover td,
[data-theme="light"] .table tbody tr:hover,
[data-theme="light"] .notif-item:hover,
[data-theme="light"] .accordion-btn:hover,
[data-theme="light"] .empty,
[data-theme="light"] .empty-state,
[data-theme="light"] .empty-state-sm {
  background: rgba(240,185,11,.04) !important;
}

[data-theme="light"] .search-box,
[data-theme="light"] .form-input,
[data-theme="light"] .form-select,
[data-theme="light"] .form-textarea,
[data-theme="light"] .notes-area,
[data-theme="light"] .file-upload,
[data-theme="light"] .file-upload-zone {
  background: #f5f6f7 !important;
  border-color: var(--border) !important;
  color: var(--txt) !important;
}

[data-theme="light"] .search-input,
[data-theme="light"] .form-input::placeholder,
[data-theme="light"] .form-textarea::placeholder,
[data-theme="light"] .notes-area::placeholder {
  color: var(--txt2) !important;
}

[data-theme="light"] .form-input:focus,
[data-theme="light"] .form-select:focus,
[data-theme="light"] .form-textarea:focus,
[data-theme="light"] .notes-area:focus,
[data-theme="light"] .search-box:focus-within {
  background: #ffffff !important;
  border-color: var(--accent-border) !important;
  box-shadow: 0 0 0 3px rgba(240,185,11,.14) !important;
}

[data-theme="light"] input.form-input[type="email"]:focus,
[data-theme="light"] input.form-input[inputmode="email"]:focus,
[data-theme="light"] input.form-input[id*="email" i]:focus,
[data-theme="light"] input.email-search-input:focus {
  background-color: #ffffff !important;
  background-image: none !important;
  background-repeat: no-repeat !important;
  background-size: 0 0 !important;
  background-position: center !important;
}

[data-theme="light"] select.form-input option,
[data-theme="light"] select.form-select option,
[data-theme="light"] .form-select option {
  background: var(--card) !important;
  color: var(--txt) !important;
}

[data-theme="light"] .btn-primary {
  background: linear-gradient(135deg, #e5ad00 0%, #c99400 48%, #8f6c00 100%) !important;
  border-color: var(--accent-border) !important;
  color: #f7fbff !important;
  box-shadow: 0 8px 18px rgba(240,185,11,.18) !important;
}

[data-theme="light"] .btn-primary:hover {
  background: linear-gradient(135deg, #f0b90b 0%, #e5ad00 48%, #c99400 100%) !important;
}

[data-theme="light"] .btn-secondary,
[data-theme="light"] .btn-ghost,
[data-theme="light"] .btn-icon,
[data-theme="light"] .copy-btn,
[data-theme="light"] .page-btn,
[data-theme="light"] .notif-btn,
[data-theme="light"] .theme-btn,
[data-theme="light"] .theme-btn-float,
[data-theme="light"] .sidebar-toggle,
[data-theme="light"] .desktop-sidebar-toggle,
[data-theme="light"] .desktop-sidebar-show {
  background: var(--card2) !important;
  border-color: var(--border) !important;
  color: var(--txt2) !important;
  box-shadow: none !important;
}

[data-theme="light"] .btn-secondary:hover,
[data-theme="light"] .btn-ghost:hover,
[data-theme="light"] .btn-icon:hover,
[data-theme="light"] .copy-btn:hover,
[data-theme="light"] .page-btn:hover,
[data-theme="light"] .notif-btn:hover,
[data-theme="light"] .theme-btn:hover,
[data-theme="light"] .theme-btn-float:hover,
[data-theme="light"] .sidebar-toggle:hover,
[data-theme="light"] .desktop-sidebar-toggle:hover,
[data-theme="light"] .desktop-sidebar-show:hover {
  background: var(--card) !important;
  border-color: var(--accent-border) !important;
  color: var(--accent3) !important;
}

[data-theme="light"] .page-btn.active,
[data-theme="light"] .step.active .step-num {
  background: linear-gradient(135deg, #e5ad00 0%, #c99400 48%, #8f6c00 100%) !important;
  border-color: var(--accent-border) !important;
  color: #f7fbff !important;
}

[data-theme="light"] .nav-item {
  color: var(--sidebar-txt2) !important;
}

[data-theme="light"] .nav-item:hover {
  background: rgba(183,189,198,.08) !important;
  border-color: var(--sidebar-border) !important;
  color: var(--sidebar-txt) !important;
}

[data-theme="light"] .nav-item.active {
  background: rgba(240,185,11,.24) !important;
  border-color: var(--accent-border) !important;
  border-right-color: var(--accent) !important;
  color: #fcd535 !important;
}

[data-theme="light"] .nav-item.active .icon,
[data-theme="light"] .nav-item.active .nav-icon {
  color: #fcd535 !important;
}

[data-theme="light"] .sidebar-footer > .user-info {
  background: rgba(183,189,198,.06) !important;
  border-color: var(--sidebar-border) !important;
}

[data-theme="light"] .auth-divider span,
[data-theme="light"] .app-shell-client .mobile-bottom-nav,
[data-theme="light"] .notif-panel,
[data-theme="light"] .inline-preview-header,
[data-theme="light"] .preview-box,
[data-theme="light"] .msg-body-box,
[data-theme="light"] .info-box,
[data-theme="light"] .review-item,
[data-theme="light"] .file-info {
  background: rgba(255,255,255,.94) !important;
  border-color: var(--border) !important;
}

[data-theme="light"] .badge-neutral {
  background: var(--card2) !important;
  border-color: var(--border) !important;
  color: var(--txt2) !important;
}





/* EOF registration email dark-mode guard. */
:root:not([data-theme="light"]) body.registration-active #r-email.form-input {
  background-color: rgba(255,255,255,.04) !important;
  background-image: none !important;
  color: var(--txt) !important;
  -webkit-text-fill-color: var(--txt) !important;
  caret-color: var(--txt) !important;
  color-scheme: dark;
}

:root:not([data-theme="light"]) body.registration-active #r-email.form-input:focus {
  background-color: rgba(255,255,255,.06) !important;
}

:root:not([data-theme="light"]) body.registration-active #r-email.form-input:-webkit-autofill,
:root:not([data-theme="light"]) body.registration-active #r-email.form-input:-webkit-autofill:hover,
:root:not([data-theme="light"]) body.registration-active #r-email.form-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--txt) !important;
  caret-color: var(--txt) !important;
  -webkit-box-shadow: 0 0 0 1000px #101318 inset !important;
  box-shadow: 0 0 0 1000px #101318 inset !important;
}
/* Client activity timeline */
.client-activity-page {
  width: min(1120px, 100%);
  margin-inline: auto;
}

.activity-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding: 26px 28px;
  border: 1px solid color-mix(in srgb, var(--primary) 26%, var(--border));
  border-radius: 20px;
  background:
    radial-gradient(circle at 8% 18%, color-mix(in srgb, var(--primary) 18%, transparent), transparent 35%),
    linear-gradient(135deg, color-mix(in srgb, var(--bg2) 96%, var(--primary)), var(--bg2));
}

.activity-hero::after {
  content: '';
  position: absolute;
  inset-inline-end: -70px;
  top: -85px;
  width: 220px;
  height: 220px;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent);
  border-radius: 50%;
  box-shadow: 0 0 0 28px color-mix(in srgb, var(--primary) 4%, transparent), 0 0 0 56px color-mix(in srgb, var(--primary) 3%, transparent);
  pointer-events: none;
}

.activity-hero-copy {
  position: relative;
  z-index: 1;
}

.activity-kicker {
  margin-bottom: 7px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
}

.activity-hero h2 {
  margin: 0 0 7px;
  font-size: clamp(22px, 3vw, 31px);
  line-height: 1.25;
}

.activity-hero p {
  max-width: 680px;
  margin: 0;
  color: var(--txt2);
  line-height: 1.8;
}

.activity-hero > .btn {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
}

.activity-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.activity-summary-card {
  position: relative;
  overflow: hidden;
  min-height: 105px;
  padding: 17px 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg2);
}

.activity-summary-card::after {
  content: '';
  position: absolute;
  inset-inline-end: -22px;
  bottom: -30px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: currentColor;
  opacity: .07;
}

.activity-summary-card span {
  display: block;
  margin-bottom: 10px;
  color: var(--txt2);
  font-size: 12px;
  font-weight: 700;
}

.activity-summary-card strong {
  font-size: 28px;
  line-height: 1;
}

.activity-summary-card.is-blue { color: #4da2ff; }
.activity-summary-card.is-purple { color: #c994ff; }
.activity-summary-card.is-cyan { color: #4da2ff; }
.activity-summary-card.is-green { color: #0ecb81; }

.activity-summary-card.is-loading {
  background: linear-gradient(90deg, var(--bg2), color-mix(in srgb, var(--bg2) 70%, var(--border)), var(--bg2));
  background-size: 200% 100%;
  animation: activityShimmer 1.3s infinite linear;
}

@keyframes activityShimmer {
  to { background-position: -200% 0; }
}

.activity-feed-card {
  overflow: hidden;
}

.activity-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.activity-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 2px;
}

.activity-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--txt2);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: .18s ease;
}

.activity-filter b {
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border) 72%, transparent);
  color: var(--txt);
  text-align: center;
  font-size: 10px;
}

.activity-filter:hover,
.activity-filter.is-active {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
}

.activity-filter.is-active b {
  background: var(--primary);
  color: #fff;
}

.activity-feed {
  padding: 8px 20px 12px;
}

.activity-item-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 13px;
}

.activity-timeline-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.activity-timeline-rail > span {
  width: 1px;
  min-height: 24px;
  flex: 1;
  background: var(--border);
}

.activity-item-card:last-child .activity-timeline-rail > span {
  background: linear-gradient(var(--border), transparent);
}

.activity-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-top: 22px;
  border: 1px solid currentColor;
  border-radius: 13px;
  background: color-mix(in srgb, currentColor 11%, var(--bg2));
  box-shadow: 0 0 0 5px var(--bg2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px;
  font-weight: 900;
}

.is-purple { color: #c994ff; }
.is-blue { color: #4da2ff; }
.is-green { color: #0ecb81; }
.is-gold { color: #fbbf24; }
.is-cyan { color: #4da2ff; }
.is-gray { color: #848e9c; }

.activity-item-content {
  min-width: 0;
  margin: 12px 0;
  padding: 17px 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg2) 96%, var(--border));
  transition: border-color .18s ease, transform .18s ease;
}

.activity-item-content:hover {
  border-color: color-mix(in srgb, var(--primary) 32%, var(--border));
  transform: translateY(-1px);
}

.activity-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.activity-item-head h3 {
  margin: 7px 0 0;
  font-size: 15px;
  line-height: 1.5;
}

.activity-item-head time {
  flex: 0 0 auto;
  color: var(--txt2);
  font-size: 11px;
  direction: ltr;
}

.activity-item-labels {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.activity-category-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, currentColor 34%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 10%, transparent);
  font-size: 10px;
  font-weight: 800;
}

.activity-actor {
  color: var(--txt2);
  font-size: 10.5px;
}

.activity-description {
  margin: 10px 0 0;
  color: var(--txt2);
  font-size: 13px;
  line-height: 1.8;
}

.activity-main-amount {
  display: inline-flex;
  margin-top: 11px;
  padding: 6px 10px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--border) 55%, transparent);
  font-size: 14px;
  font-weight: 800;
  direction: ltr;
}

.activity-main-amount.is-positive { color: #0ecb81; }
.activity-main-amount.is-negative { color: #fb7185; }

.activity-transfer-list,
.activity-change-grid {
  display: grid;
  gap: 8px;
  margin-top: 13px;
}

.activity-transfer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  border: 1px solid color-mix(in srgb, #c994ff 28%, var(--border));
  border-radius: 13px;
  background: color-mix(in srgb, #c994ff 6%, transparent);
}

.activity-transfer-side span,
.activity-balance-after span {
  display: block;
  margin-bottom: 3px;
  color: var(--txt2);
  font-size: 10px;
}

.activity-transfer-side strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  white-space: nowrap;
}

.activity-transfer-amount {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #c994ff;
  direction: ltr;
}

.activity-transfer-amount b {
  font-size: 12px;
}

.activity-change-row,
.activity-balance-after {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg) 42%, transparent);
  font-size: 11.5px;
}

.activity-change-row > span { color: var(--txt2); }
.activity-change-row > div {
  display: flex;
  align-items: center;
  gap: 7px;
}
.activity-change-row del { color: #fb7185; }
.activity-change-row strong { color: #0ecb81; }

.activity-balance-after {
  margin-top: 11px;
}

.activity-balance-after span { margin: 0; }
.activity-balance-after strong { direction: ltr; }

.activity-technical-meta {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  color: var(--txt2);
  font: 10px ui-monospace, SFMono-Regular, Menlo, monospace;
  direction: ltr;
}

.activity-load-more {
  padding: 8px 18px 20px;
  text-align: center;
}

.activity-empty {
  min-height: 250px;
}

[data-theme="light"] .activity-hero {
  background:
    radial-gradient(circle at 8% 18%, rgba(77,162,255, .1), transparent 35%),
    linear-gradient(135deg, #fff, #f8fafc);
}

[data-theme="light"] .activity-icon {
  background: color-mix(in srgb, currentColor 8%, #fff);
  box-shadow: 0 0 0 5px #fff;
}

@media (max-width: 900px) {
  .activity-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .activity-hero {
    flex-direction: column;
    padding: 21px 18px;
    border-radius: 16px;
  }
  .activity-hero > .btn { width: 100%; }
  .activity-summary-grid { gap: 8px; }
  .activity-summary-card {
    min-height: 88px;
    padding: 14px;
  }
  .activity-summary-card strong { font-size: 23px; }
  .activity-toolbar {
    align-items: flex-start;
    padding: 13px;
  }
  .activity-feed { padding: 5px 9px 10px; }
  .activity-item-card {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 8px;
  }
  .activity-icon {
    width: 31px;
    height: 31px;
    margin-top: 20px;
    border-radius: 10px;
    box-shadow: 0 0 0 3px var(--bg2);
    font-size: 12px;
  }
  .activity-item-content {
    margin: 9px 0;
    padding: 14px;
    border-radius: 13px;
  }
  .activity-item-head {
    flex-direction: column-reverse;
    gap: 7px;
  }
  .activity-transfer-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .activity-transfer-amount { justify-content: flex-start; }
  .activity-transfer-side strong { white-space: normal; }
  .activity-change-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Final mobile registration stability pass. */
@media (max-width: 640px) {
  body.registration-active {
    min-height: 100svh;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }

  body.registration-active .theme-btn-float {
    top: calc(env(safe-area-inset-top) + 8px);
    left: 12px;
    width: 34px;
    height: 34px;
    font-size: 15px;
    border-radius: 12px;
    z-index: 120;
  }

  body.registration-active .registration-brand {
    top: calc(env(safe-area-inset-top) + 8px);
    right: 12px;
    width: 40px;
    height: 40px;
    padding: 3px;
    border-radius: 12px;
    z-index: 120;
  }

  body.registration-active .auth-page {
    display: grid;
    justify-items: center;
    align-items: center;
    align-items: safe center;
    min-height: 100svh;
    min-height: 100dvh;
    height: auto;
    padding: calc(env(safe-area-inset-top) + 56px) 18px max(84px, calc(env(safe-area-inset-bottom) + 36px));
    overflow: visible;
  }

  body.registration-active .auth-box {
    width: min(100%, 700px);
    max-height: none;
    margin: auto;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 12px 34px rgba(0,0,0,.36);
    overflow: visible;
    scrollbar-width: auto;
    transform: none;
  }

  body.registration-active .auth-box::before {
    top: -1px;
    right: -1px;
    left: -1px;
    height: 3px;
    border-start-start-radius: 12px;
    border-start-end-radius: 12px;
  }

  body.registration-active .auth-box::-webkit-scrollbar {
    display: initial;
  }

  body.registration-active #register-form {
    scroll-margin-top: calc(env(safe-area-inset-top) + 56px);
  }

  body.registration-active #register-form .registration-form-head {
    align-items: center !important;
    gap: 8px !important;
    margin-bottom: 10px !important;
  }

  body.registration-active #register-form .registration-form-head h3 {
    margin: 0;
    font-size: 14px;
    line-height: 1.3;
  }

  body.registration-active #register-form .registration-form-head .btn {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 6px 10px !important;
    font-size: 12px;
  }

  body.registration-active .registration-step-intro {
    margin-bottom: 8px;
    padding: 8px;
    gap: 7px;
    border-radius: 10px;
  }

  body.registration-active .registration-step-icon {
    flex-basis: 28px;
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  body.registration-active .registration-step-intro h4 {
    margin-bottom: 1px;
    font-size: 12.5px;
    line-height: 1.3;
  }

  body.registration-active .registration-step-intro p {
    font-size: 11px;
    line-height: 1.38;
  }

  body.registration-active .registration-step-intro-compact {
    gap: 8px;
    padding: 7px 8px;
    margin-bottom: 8px;
  }

  body.registration-active .registration-step-intro-compact .registration-step-icon {
    width: 26px;
    height: 26px;
    flex-basis: 26px;
    font-size: 13px;
  }

  body.registration-active .registration-step-intro-compact h4 {
    font-size: 12.5px;
  }

  body.registration-active .registration-step-intro-compact p {
    font-size: 10.5px;
    line-height: 1.3;
  }

  body.registration-active .form-group {
    margin-bottom: 10px;
  }

  body.registration-active .form-row {
    gap: 8px;
  }

  body.registration-active .form-input,
  body.registration-active .form-select,
  body.registration-active .form-textarea {
    min-height: 40px;
    padding-top: 8px;
    padding-bottom: 8px;
    font-size: 14.5px;
    line-height: 1.35;
    border-radius: 10px;
  }

  body.registration-active .form-label,
  body.registration-active .field-error {
    font-size: 11.5px;
  }

  body.registration-active .form-label {
    margin-bottom: 4px;
  }

  body.registration-active .btn {
    min-height: 40px;
    padding: 8px 10px !important;
    font-size: 12.5px;
    line-height: 1.25;
    white-space: normal;
    text-align: center;
  }

  body.registration-active .file-upload {
    padding: 10px 9px;
    border-width: 1.5px;
    border-radius: 10px;
  }

  body.registration-active #drop-receipt.file-upload {
    min-height: 96px;
    padding: 10px 12px;
    gap: 3px;
  }

  body.registration-active .file-upload-icon-svg {
    margin-bottom: 3px;
  }

  body.registration-active .file-upload-icon-svg svg {
    width: 22px;
    height: 22px;
  }

  body.registration-active .file-upload-text {
    font-size: 12px;
  }

  body.registration-active .file-upload-hint,
  body.registration-active .file-info-row {
    font-size: 10.5px;
  }

  body.registration-active .file-upload-hint {
    margin-top: 3px;
  }

  body.registration-active .registration-bank-transfer {
    gap: 5px;
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 10px;
  }

  body.registration-active .registration-bank-transfer-head {
    gap: 2px;
  }

  body.registration-active .registration-bank-transfer-head strong {
    font-size: 12.5px;
  }

  body.registration-active .registration-bank-transfer-head span {
    font-size: 10.5px;
    line-height: 1.45;
  }

  body.registration-active .registration-bank-transfer .registration-shares-field {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 4px;
    width: 100%;
    direction: rtl;
  }

  body.registration-active .registration-shares-field .form-label {
    font-size: 10.5px;
  }

  body.registration-active .registration-shares-field .form-input {
    flex: none;
    width: 205px;
    max-width: 100%;
    height: 32px;
    min-height: 32px;
    max-height: 32px;
    padding: 5px 13px;
    font-size: 13px;
  }

  body.registration-active .registration-shares-field .form-input::placeholder {
    font-size: 11px;
    text-align: center;
  }

  body.registration-active .registration-transfer-amounts {
    gap: 4px 8px;
    margin-top: 6px;
    padding: 6px 8px;
    border-radius: 9px;
  }

  body.registration-active .registration-transfer-amounts.is-error {
    margin-top: 2px;
  }

  body.registration-active .registration-transfer-amounts > span {
    font-size: 10px;
  }

  body.registration-active .registration-transfer-amounts > b {
    font-size: 12px;
  }

  body.registration-active .registration-transfer-amounts em {
    gap: 5px;
    font-size: 12px;
  }

  body.registration-active .registration-transfer-arrow {
    font-size: 13px;
  }

  body.registration-active .registration-transfer-amounts em strong {
    font-size: 12px;
  }

  body.registration-active .registration-transfer-error {
    font-size: 11px;
  }

  body.registration-active .registration-bank-details {
    grid-template-columns: 1fr;
    gap: 7px;
    margin-top: 2px;
  }

  body.registration-active .registration-bank-actions {
    margin-top: 2px;
  }

  body.registration-active .registration-bank-detail {
    gap: 3px;
    padding: 7px 9px;
    border-radius: 9px;
  }

  body.registration-active .registration-bank-copy-btn {
    min-height: 24px;
    padding: 2px 8px;
    font-size: 10px;
  }

  body.registration-active .registration-bank-detail span {
    font-size: 9.5px;
  }

  body.registration-active .registration-bank-detail b {
    font-size: 11.5px;
    line-height: 1.35;
  }

  body.registration-active .registration-bank-actions .btn {
    width: 100%;
    min-height: 36px;
    font-size: 11.5px;
  }

  body.registration-active .registration-bank-qr-cta {
    box-shadow: 0 8px 16px rgba(240,185,11,.15);
  }

  body.registration-active .invest-summary {
    margin-top: 7px;
    padding: 8px;
  }

  body.registration-active .invest-summary-row {
    gap: 5px;
    font-size: 13px;
  }

  body.registration-active .invest-summary-x,
  body.registration-active .invest-summary-label {
    font-size: 10.5px;
  }

  body.registration-active .invest-summary-total {
    font-size: 17px;
  }

  body.registration-active .invest-summary-local {
    font-size: 12px;
  }

  body.registration-active .invest-summary-local,
  body.registration-active .invest-summary-label {
    margin-top: 3px;
  }

  body.registration-active .registration-step-actions {
    gap: 9px;
    margin-top: 12px;
  }

  body.registration-active .agreement-step-note,
  body.registration-active .agreement-accept-row span {
    font-size: 11px;
    line-height: 1.45;
  }

  body.registration-active .agreement-step-note {
    margin-bottom: 6px;
  }

  body.registration-active .agreement-clause-note {
    margin-bottom: 5px;
    padding: 3px 7px;
    font-size: 10.5px;
  }

  body.registration-active .agreement-reader-shell {
    margin-bottom: 7px;
  }

  body.registration-active .agreement-accept-row {
    gap: 6px;
    margin-bottom: 7px;
    padding: 7px 8px;
    border-radius: 10px;
  }

  body.registration-active .agreement-accept-row input {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
  }

  body.registration-active .agreement-reader {
    min-height: 175px;
    max-height: min(34dvh, 280px);
    padding: 8px 10px;
    font-size: 11.5px;
    line-height: 1.5;
  }

  body.registration-active .agreement-reader h3 {
    margin: 5px 0 4px;
    font-size: 12px;
    line-height: 1.45;
  }

  body.registration-active .agreement-reader h4 {
    margin: 6px 0 4px;
    font-size: 10.5px;
  }

  body.registration-active .agreement-reader p {
    margin-bottom: 3px;
  }

  body.registration-active .agreement-reader-space {
    height: 3px;
  }

  body.registration-active .review-invest-card {
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 10px;
  }

  body.registration-active .review-invest-amount {
    font-size: 24px;
  }

  body.registration-active .review-invest-label,
  body.registration-active .review-invest-shares {
    font-size: 11px;
  }

  body.registration-active .review-section {
    margin-bottom: 10px;
  }

  body.registration-active .review-section-title {
    margin-bottom: 6px;
    padding-bottom: 4px;
    font-size: 10.5px;
  }

  body.registration-active .review-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  body.registration-active .review-item {
    padding: 7px 9px;
  }

  body.registration-active .review-item-label {
    font-size: 9.5px;
  }

  body.registration-active .review-item-value {
    font-size: 12px;
  }

  body.registration-active .review-file {
    gap: 5px;
    font-size: 11px;
  }

  body.registration-active .review-file-name {
    font-size: 10.5px;
  }

  body.registration-active .registration-allocation-summary {
    margin-bottom: 8px;
  }

  body.registration-active .registration-default-balance,
  body.registration-active .registration-allocation-row {
    gap: 7px;
    padding: 9px;
    border-radius: 10px;
  }

  body.registration-active .registration-default-balance > div,
  body.registration-active .registration-allocation-copy,
  body.registration-active .registration-allocation-amount {
    gap: 4px;
  }

  body.registration-active .registration-allocation-list {
    gap: 8px;
  }

  body.registration-active .registration-default-balance strong {
    font-size: 14px;
  }

  body.registration-active .registration-default-balance small,
  body.registration-active .registration-allocation-copy span {
    font-size: 11px;
    line-height: 1.45;
  }

  body.registration-active .registration-default-balance b {
    font-size: 18px;
  }

  body.registration-active .registration-allocation-copy strong {
    font-size: 12.5px;
  }

  body.registration-active .registration-allocation-input {
    min-height: 38px;
  }

  body.registration-active .registration-no-extra-groups {
    padding: 9px;
    font-size: 11px;
    line-height: 1.45;
  }
}

@media (max-width: 380px) {
  body.registration-active .auth-page {
    padding-top: calc(env(safe-area-inset-top) + 52px);
    padding-inline: 14px;
  }

  body.registration-active .auth-box {
    padding: 10px;
  }

  body.registration-active .registration-step-intro {
    padding: 8px;
  }

  body.registration-active .registration-step-icon {
    flex-basis: 26px;
    width: 26px;
    height: 26px;
    font-size: 13px;
  }

  body.registration-active .registration-step-intro p {
    font-size: 10.5px;
  }
}

@media (max-width: 640px) {
  body.auth-body:not(.registration-active) {
    width: 100%;
    height: 100svh;
    height: 100dvh;
    min-height: 100svh;
    min-height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
  }

  body.auth-body:not(.registration-active) .auth-page {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100svh;
    height: 100dvh;
    min-height: 100svh;
    min-height: 100dvh;
    padding: max(16px, env(safe-area-inset-top)) 18px max(16px, env(safe-area-inset-bottom));
    overflow: hidden;
  }

  body.auth-body:not(.registration-active) .auth-box {
    width: min(100%, 480px);
    max-height: calc(100dvh - 32px);
    margin: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

body.auth-body .auth-page input.form-input::placeholder {
  color: rgba(183,189,198, .56) !important;
  -webkit-text-fill-color: rgba(183,189,198, .56) !important;
  font-weight: 400;
  opacity: 1;
}

body.auth-body .auth-page input.form-input:focus::placeholder {
  color: rgba(183,189,198, .42) !important;
  -webkit-text-fill-color: rgba(183,189,198, .42) !important;
}

[data-theme="light"] body.auth-body .auth-page input.form-input::placeholder {
  color: rgba(72,77,87, .58) !important;
  -webkit-text-fill-color: rgba(72,77,87, .58) !important;
}

[data-theme="light"] body.auth-body .auth-page input.form-input:focus::placeholder {
  color: rgba(72,77,87, .42) !important;
  -webkit-text-fill-color: rgba(72,77,87, .42) !important;
}

@media (min-width: 641px) and (pointer: fine) {
  body.registration-active,
  body.registration-active .auth-page,
  body.registration-active .auth-box {
    scrollbar-width: thin !important;
    scrollbar-color: rgba(240,185,11, .52) rgba(9,12,15, .42) !important;
  }

  body.registration-active .auth-box {
    scrollbar-gutter: stable both-edges;
  }

  body.registration-active::-webkit-scrollbar,
  body.registration-active .auth-page::-webkit-scrollbar,
  body.registration-active .auth-box::-webkit-scrollbar {
    display: block !important;
    width: 10px;
    height: 10px;
  }

  body.registration-active::-webkit-scrollbar-track,
  body.registration-active .auth-page::-webkit-scrollbar-track,
  body.registration-active .auth-box::-webkit-scrollbar-track {
    margin-block: 10px;
    border-radius: 999px;
    background: rgba(9,12,15, .42);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .045);
  }

  body.registration-active::-webkit-scrollbar-thumb,
  body.registration-active .auth-page::-webkit-scrollbar-thumb,
  body.registration-active .auth-box::-webkit-scrollbar-thumb {
    min-height: 44px;
    border: 2px solid rgba(9,12,15, .72);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(240,185,11, .84), rgba(77,162,255, .58));
  }

  body.registration-active::-webkit-scrollbar-thumb:hover,
  body.registration-active .auth-page::-webkit-scrollbar-thumb:hover,
  body.registration-active .auth-box::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(240, 214, 138, .96), rgba(77,162,255, .78));
  }

  body.registration-active::-webkit-scrollbar-corner,
  body.registration-active .auth-page::-webkit-scrollbar-corner,
  body.registration-active .auth-box::-webkit-scrollbar-corner {
    background: transparent;
  }
}

@media (min-width: 641px) and (pointer: fine) {
  [data-theme="light"] body.registration-active,
  [data-theme="light"] body.registration-active .auth-page,
  [data-theme="light"] body.registration-active .auth-box {
    scrollbar-color: rgba(240,185,11, .58) rgba(226, 232, 240, .76) !important;
  }

  [data-theme="light"] body.registration-active::-webkit-scrollbar-track,
  [data-theme="light"] body.registration-active .auth-page::-webkit-scrollbar-track,
  [data-theme="light"] body.registration-active .auth-box::-webkit-scrollbar-track {
    background: rgba(226, 232, 240, .76);
    box-shadow: inset 0 0 0 1px rgba(240,185,11, .12);
  }

  [data-theme="light"] body.registration-active::-webkit-scrollbar-thumb,
  [data-theme="light"] body.registration-active .auth-page::-webkit-scrollbar-thumb,
  [data-theme="light"] body.registration-active .auth-box::-webkit-scrollbar-thumb {
    border-color: rgba(226, 232, 240, .92);
    background: linear-gradient(180deg, rgba(240,185,11, .72), rgba(240,185,11, .58));
  }
}

:root:not([data-theme="light"]) body.registration-active .auth-page input.form-input,
:root:not([data-theme="light"]) body.registration-active .auth-page textarea.form-input,
:root:not([data-theme="light"]) body.registration-active .auth-page select.form-input {
  background-color: rgba(255, 255, 255, .04) !important;
  background-image: none !important;
  color: var(--txt) !important;
  -webkit-text-fill-color: var(--txt) !important;
  caret-color: var(--txt) !important;
  color-scheme: dark;
  transition: border-color var(--tr), box-shadow var(--tr), color var(--tr) !important;
}

:root:not([data-theme="light"]) body.registration-active .auth-page input.form-input:focus,
:root:not([data-theme="light"]) body.registration-active .auth-page textarea.form-input:focus,
:root:not([data-theme="light"]) body.registration-active .auth-page select.form-input:focus {
  background-color: rgba(255, 255, 255, .06) !important;
  color: var(--txt) !important;
  -webkit-text-fill-color: var(--txt) !important;
}

:root:not([data-theme="light"]) body.registration-active .auth-page input.form-input:-webkit-autofill,
:root:not([data-theme="light"]) body.registration-active .auth-page input.form-input:-webkit-autofill:hover,
:root:not([data-theme="light"]) body.registration-active .auth-page input.form-input:-webkit-autofill:focus,
:root:not([data-theme="light"]) body.registration-active .auth-page textarea.form-input:-webkit-autofill,
:root:not([data-theme="light"]) body.registration-active .auth-page select.form-input:-webkit-autofill {
  background-color: #101318 !important;
  background-image: none !important;
  color: var(--txt) !important;
  -webkit-text-fill-color: var(--txt) !important;
  caret-color: var(--txt) !important;
  -webkit-box-shadow: 0 0 0 1000px #101318 inset !important;
  box-shadow: 0 0 0 1000px #101318 inset !important;
  transition: background-color 9999s ease-out, color 0s !important;
}

/* Portfolio trade entry — compact, self-contained layout */
.main-wrap .trade-entry-card.card {
  position: relative;
  z-index: 20;
  overflow: visible;
  padding: 0;
  border-color: rgba(71,77,87,.72);
  border-radius: 14px;
  background:
    radial-gradient(circle at top right, rgba(240,185,11,.055), transparent 34%),
    linear-gradient(180deg, rgba(24,26,32,.98), rgba(30,35,41,.98));
  box-shadow: 0 14px 34px rgba(0,0,0,.16);
}

.trade-entry-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px 6px;
}

.trade-entry-header-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent-border);
  border-radius: 10px;
  background: var(--accent-bg);
  color: var(--accent3);
}

.trade-entry-header-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trade-entry-kicker {
  margin-bottom: 1px;
  color: var(--txt3);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
}

.trade-entry-title {
  color: var(--txt);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.35;
}

.main-wrap .trade-entry-card .trade-entry-body {
  padding: 6px 18px 18px;
}

.trade-entry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 14px 16px;
}

.trade-entry-card .trade-entry-field.form-group {
  min-width: 0;
  margin: 0;
}

.trade-entry-card .trade-entry-field > .form-label,
.trade-entry-label-row {
  margin: 0 0 7px;
}

.trade-entry-card .trade-entry-field > .form-label {
  min-height: 28px;
  display: flex;
  align-items: center;
}

.trade-entry-card .trade-entry-field > .form-label,
.trade-entry-card .trade-entry-label-row .form-label {
  color: var(--txt2);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.trade-entry-label-row {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.trade-entry-label-row .form-label {
  margin: 0;
}

.trade-symbol-manage-btn {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(183,189,198,.06);
  color: var(--txt2);
  cursor: pointer;
  font-family: inherit;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  transition: border-color var(--tr), background var(--tr), color var(--tr);
}

.trade-symbol-manage-btn:hover {
  border-color: var(--accent-border);
  background: var(--accent-bg);
  color: var(--accent3);
}

.trade-symbol-manage-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trade-entry-card .trade-symbol-field {
  display: block;
}

.trade-entry-card #trade-strike.form-input,
.trade-entry-card #trade-scope.form-input,
.trade-entry-card button.trade-symbol-trigger.form-input {
  min-height: 48px;
  border-color: var(--border2);
  border-radius: 10px;
  background: rgba(11,14,17,.42);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}

.trade-entry-card #trade-strike.form-input:focus,
.trade-entry-card #trade-scope.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(240,185,11,.09);
}

.trade-entry-card button.trade-symbol-trigger.form-input {
  gap: 12px;
  padding: 7px 9px 7px 13px;
}

.trade-entry-card button.trade-symbol-trigger.form-input:hover {
  border-color: var(--border3);
}

.trade-entry-card button.trade-symbol-trigger.form-input[aria-expanded="true"] {
  border-color: var(--accent);
  background: rgba(11,14,17,.54);
  box-shadow: 0 0 0 3px rgba(240,185,11,.09);
}

.trade-entry-card .trade-symbol-current {
  gap: 0;
}

.trade-entry-card #trade-symbol-selected {
  font-size: 14px;
  line-height: 1.25;
}

.trade-entry-card .trade-symbol-chevron {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(183,189,198,.055);
  stroke: var(--txt2);
  stroke-width: 1.8;
  transform-origin: center;
}

.trade-entry-card .trade-symbol-trigger[aria-expanded="true"] .trade-symbol-chevron {
  border-color: var(--accent-border);
  background: var(--accent-bg);
  stroke: var(--accent3);
  transform: rotate(180deg);
}

.trade-entry-card .trade-symbol-menu {
  top: calc(100% + 5px);
  padding: 6px;
  border-color: var(--border2);
  border-radius: 10px;
  background: rgba(30,35,41,.99);
  box-shadow: 0 18px 42px rgba(0,0,0,.42), 0 0 0 1px rgba(255,255,255,.025);
}

.trade-entry-card .trade-symbol-search-wrap {
  min-height: 38px;
  margin-bottom: 5px;
  border-radius: 8px;
  background: rgba(11,14,17,.58);
}

.trade-entry-card .trade-symbol-search-wrap > svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: var(--txt3);
  stroke-width: 1.7;
  stroke-linecap: round;
}

.trade-entry-card .trade-symbol-options {
  max-height: min(188px, 40vh);
  gap: 1px;
}

.trade-entry-card button.trade-symbol-option {
  min-height: 34px;
  padding: 5px 9px;
  border-radius: 7px;
}

.trade-entry-card button.trade-symbol-option:hover,
.trade-entry-card button.trade-symbol-option:focus-visible {
  background: rgba(183,189,198,.075);
}

.trade-entry-card button.trade-symbol-option.is-selected {
  background: rgba(240,185,11,.14);
  color: var(--accent3);
}

.trade-entry-card .trade-option-picker {
  gap: 8px;
}

.trade-entry-card .trade-option-card {
  min-height: 48px;
  padding: 7px 10px;
  border-color: var(--border2);
  border-radius: 10px;
  background: rgba(11,14,17,.42);
}

.trade-entry-card .trade-option-icon {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  border-radius: 8px;
}

.trade-entry-card .trade-option-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trade-entry-card .trade-option-radio {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
}

.trade-entry-card .trade-option-call input:checked + .trade-option-card,
.trade-entry-card .trade-option-put input:checked + .trade-option-card {
  transform: none;
}

.trade-entry-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(71,77,87,.42);
}

.trade-entry-card .trade-entry-preview-btn {
  min-height: 44px;
  margin: 0;
  padding-inline: 18px;
  border-radius: 10px;
}

.trade-entry-card .trade-entry-preview-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[data-theme="light"] .main-wrap .trade-entry-card.card {
  background:
    radial-gradient(circle at top right, rgba(240,185,11,.055), transparent 34%),
    #ffffff;
}

[data-theme="light"] .trade-entry-card #trade-strike.form-input,
[data-theme="light"] .trade-entry-card #trade-scope.form-input,
[data-theme="light"] .trade-entry-card button.trade-symbol-trigger.form-input,
[data-theme="light"] .trade-entry-card .trade-option-card,
[data-theme="light"] .trade-entry-card .trade-symbol-search-wrap {
  background: #f5f6f7;
}

[data-theme="light"] .trade-entry-card .trade-symbol-menu {
  background: #ffffff;
}

@media (max-width: 720px) {
  .trade-entry-header {
    padding: 12px 14px 5px;
  }

  .main-wrap .trade-entry-card .trade-entry-body {
    padding: 5px 14px 14px;
  }

  .trade-entry-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .trade-entry-actions {
    margin-top: 16px;
    padding-top: 14px;
  }

  .trade-entry-card .trade-entry-preview-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 420px) {
  .trade-entry-header-icon {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .trade-entry-title {
    font-size: 14px;
  }

  .trade-symbol-manage-btn {
    padding-inline: 8px;
  }

  .trade-entry-card .trade-option-copy small {
    font-size: 10px;
  }
}

/* Trading-symbol manager — phone layout only; desktop remains unchanged */
.trade-symbol-add-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 16px;
}

.trade-symbol-add-row #new-trade-symbol {
  min-width: 0;
  flex: 1 1 auto;
}

@media (max-width: 720px) {
  #trade-symbol-modal.modal-overlay {
    align-items: center;
    padding: 8px;
  }

  #trade-symbol-modal .trade-symbol-management-modal {
    width: 100%;
    max-width: 100%;
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    margin: 0;
    overflow: hidden;
    border-radius: 15px;
  }

  #trade-symbol-modal .modal-header {
    min-height: 60px;
    padding: 11px 14px;
    background: rgba(16,19,24,.64);
  }

  #trade-symbol-modal .modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 900;
  }

  #trade-symbol-modal .modal-close {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 10px;
  }

  #trade-symbol-modal .modal-body {
    min-height: 0;
    padding: 13px 14px 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  #trade-symbol-modal .trade-symbol-add-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin-bottom: 13px;
    padding-bottom: 13px;
    border-bottom: 1px solid var(--border);
  }

  #trade-symbol-modal #new-trade-symbol,
  #trade-symbol-modal .trade-symbol-add-btn {
    min-height: 44px;
    border-radius: 10px;
  }

  #trade-symbol-modal .trade-symbol-add-btn {
    min-width: 76px;
    justify-content: center;
    padding-inline: 14px;
  }

  #trade-symbol-modal #trade-symbol-list {
    display: grid;
    gap: 9px;
  }

  #trade-symbol-modal .trade-symbol-management-row {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: rgba(11,14,17,.26);
  }

  #trade-symbol-modal .trade-symbol-management-row.is-featured {
    border-color: var(--accent-border);
    background: rgba(240,185,11,.055);
  }

  #trade-symbol-modal .trade-symbol-management-name {
    width: 100%;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  #trade-symbol-modal .trade-symbol-management-name strong {
    font-size: 15px;
  }

  #trade-symbol-modal .trade-symbol-featured-badge {
    padding: 3px 8px;
    font-size: 10px;
  }

  #trade-symbol-modal .trade-symbol-management-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  #trade-symbol-modal .trade-symbol-management-actions .btn {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    justify-content: center;
    padding: 7px 8px;
    border-radius: 9px;
    font-size: 11px;
    line-height: 1.25;
  }

  #trade-symbol-modal .trade-symbol-feature-btn {
    border-color: var(--accent-border);
    background: rgba(240,185,11,.07);
    color: var(--accent3);
  }

  #trade-symbol-modal .modal-body::-webkit-scrollbar {
    width: 5px;
  }

  #trade-symbol-modal .modal-body::-webkit-scrollbar-track {
    background: transparent;
  }

  #trade-symbol-modal .modal-body::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: var(--border3);
  }

  [data-theme="light"] #trade-symbol-modal .modal-header {
    background: #f5f6f7;
  }

  [data-theme="light"] #trade-symbol-modal .trade-symbol-management-row {
    background: #f5f6f7;
  }

  [data-theme="light"] #trade-symbol-modal .trade-symbol-management-row.is-featured {
    background: var(--accent-bg);
  }
}

@media (max-width: 360px) {
  #trade-symbol-modal .modal-header {
    min-height: 56px;
    padding: 9px 11px;
  }

  #trade-symbol-modal .modal-body {
    padding-inline: 11px;
  }

  #trade-symbol-modal .trade-symbol-management-actions .btn {
    font-size: 10px;
  }
}
