
/* ── App shell ───────────────────────────────────────────────────── */
.app-shell { min-height: 100vh; background: var(--bg-base); }

/* ── Topbar ──────────────────────────────────────────────────────── */
.topbar {
  position: fixed; top: 0; right: 0; left: 0;
  height: var(--topbar-h);
  z-index: var(--z-topbar);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 var(--space-md);
  gap: var(--space-md);
}
.topbar-logo {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: var(--weight-bold);
  font-size: var(--text-lg);
}
.topbar-logo-mark {
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  background: var(--brand-primary);
  color: var(--brand-on-primary);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: var(--weight-bold);
  font-size: var(--text-md);
}
.topbar-toggle {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  background: transparent; border: none;
  color: var(--text-secondary); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--duration-fast) var(--ease);
  font-size: 18px;
}
.topbar-toggle:hover { background: var(--bg-elevated); color: var(--text-primary); }
.topbar-spacer { flex: 1; }
.topbar-search { flex: 1; max-width: 480px; }
.topbar-actions { display: flex; align-items: center; gap: var(--space-1); flex-shrink: 0; }

.topbar-action {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  background: transparent; border: none;
  color: var(--text-secondary); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
  transition: all var(--duration-fast) var(--ease);
  font-size: 18px;
}
.topbar-action:hover { background: var(--bg-elevated); color: var(--text-primary); }
.topbar-action .badge-dot {
  position: absolute; top: 8px; right: 8px;
  width: 8px; height: 8px;
  border-radius: var(--radius-full);
  background: var(--danger);
  border: 2px solid var(--bg-surface);
}

.topbar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 8px 4px 4px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease);
}
.topbar-user:hover { background: var(--bg-elevated); }
.topbar-user-info { display: none; }
.topbar-user-name { font-size: var(--text-sm); font-weight: var(--weight-semibold); line-height: 1.2; }
.topbar-user-role { font-size: var(--text-xs); color: var(--text-muted); }

@media (min-width: 768px) {
  .topbar-user-info { display: flex; flex-direction: column; }
}

/* ── Sidebar ─────────────────────────────────────────────────────── */
.sidebar {
  position: fixed; top: var(--topbar-h); right: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-inline-start: 1px solid var(--border);
  z-index: var(--z-sidebar);
  overflow-y: auto;
  overflow-x: hidden;
  transition: width var(--duration-base) var(--ease),
              transform var(--duration-base) var(--ease);
  display: flex; flex-direction: column;
}
.sidebar.collapsed { width: var(--sidebar-collapsed-w); }

.sidebar-section {
  padding: var(--space-2) var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: var(--space-2) var(--space-2) 4px;
}
.sidebar.collapsed .sidebar-section { display: none; }

.nav-list { padding: var(--space-1); flex: 1; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  margin: 2px 4px;
  cursor: pointer;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: all var(--duration-fast) var(--ease);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  font-size: var(--text-sm);
}
.nav-item:hover { background: var(--bg-elevated); color: var(--text-primary); }
.nav-item.active { background: rgba(217,118,86,0.12); color: var(--brand-primary); }
.nav-item.active::before {
  content: ""; position: absolute; right: -4px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--brand-primary);
}
.nav-icon  {
  font-size: 18px; width: 24px; flex-shrink: 0; text-align: center;
}
.nav-label { font-size: var(--text-sm); font-weight: var(--weight-medium); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-arrow {
  font-size: 10px; color: var(--text-muted);
  transition: transform var(--duration-fast) var(--ease);
  margin-inline-start: auto;
}
.nav-arrow.open { transform: rotate(180deg); }

.nav-children {
  overflow: hidden;
  max-height: 0;
  transition: max-height var(--duration-base) var(--ease);
  margin: 0 4px;
}
.nav-sub-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px 8px 40px;
  margin: 1px 0;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast) var(--ease);
  white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.nav-sub-item:hover { background: var(--bg-elevated); color: var(--text-primary); }
.nav-sub-item.active { color: var(--brand-primary); background: rgba(217,118,86,0.08); }

/* Collapsed sidebar */
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-arrow,
.sidebar.collapsed .nav-children {
  display: none;
}
.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px 0;
  margin: 4px 8px;
}
.sidebar.collapsed .nav-item:hover {
  position: relative;
}
.sidebar.collapsed .nav-item:hover::after {
  content: attr(data-label);
  position: absolute;
  right: calc(100% + 8px);
  top: 50%; transform: translateY(-50%);
  background: var(--bg-overlay);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  white-space: nowrap;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  pointer-events: none;
  z-index: var(--z-tooltip);
}

.sidebar-footer {
  padding: var(--space-md) var(--space-sm);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ── Main content ────────────────────────────────────────────────── */
.main-content {
  margin-top: var(--topbar-h);
  margin-inline-end: var(--sidebar-w);
  padding: var(--space-lg);
  min-height: calc(100vh - var(--topbar-h));
  background: var(--bg-base);
  transition: margin-inline-end var(--duration-base) var(--ease);
}
.app-shell.sidebar-collapsed .main-content {
  margin-inline-end: var(--sidebar-collapsed-w);
}

.page-content {
  /* Fill the screen — no max-width box (Binance-style full-width dashboards). */
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: var(--space-lg, 16px);
  box-sizing: border-box;
}

/* ── Auth pages ──────────────────────────────────────────────────── */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  background: var(--bg-base);
}
@media (min-width: 1024px) {
  .auth-shell { grid-template-columns: 1fr 1fr; }
}
.auth-side {
  display: none;
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-elevated) 100%);
  align-items: center; justify-content: center;
  padding: var(--space-2xl);
  position: relative;
  overflow: hidden;
}
.auth-side::before {
  content: ""; position: absolute; inset: -50%;
  background: radial-gradient(circle at 30% 30%, rgba(217,118,86,0.18) 0%, transparent 50%),
              radial-gradient(circle at 70% 70%, rgba(38,132,255,0.10) 0%, transparent 50%);
  pointer-events: none;
  animation: aurora 18s ease-in-out infinite alternate;
}
@keyframes aurora {
  0%   { transform: translate(0,0) rotate(0deg);   }
  50%  { transform: translate(2%, -2%) rotate(180deg); }
  100% { transform: translate(-2%,2%) rotate(360deg); }
}
.auth-side::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(transparent 0%, transparent 49.5%, rgba(217,118,86,0.04) 50%, transparent 50.5%),
    linear-gradient(90deg, transparent 0%, transparent 49.5%, rgba(217,118,86,0.04) 50%, transparent 50.5%);
  background-size: 36px 36px;
  pointer-events: none;
  opacity: 0.5;
}
@media (min-width: 1024px) {
  .auth-side { display: flex; }
}
.auth-side-content { position: relative; max-width: 440px; }
.auth-side-title { font-size: var(--text-3xl); font-weight: var(--weight-bold); margin-bottom: var(--space-3); }
.auth-side-text  { color: var(--text-secondary); line-height: var(--leading-loose); }

.auth-main {
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-2xl) var(--space-lg);
}
.auth-card {
  width: 100%; max-width: 400px;
}
.auth-logo { text-align: center; margin-bottom: var(--space-xl); }
.auth-logo-mark {
  width: 56px; height: 56px;
  border-radius: var(--radius-lg);
  background: var(--brand-primary);
  color: var(--brand-on-primary);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: var(--weight-bold);
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
}
.auth-title    { font-size: var(--text-2xl); font-weight: var(--weight-bold); }
.auth-subtitle { color: var(--text-secondary); font-size: var(--text-sm); margin-top: var(--space-1); }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .main-content { margin-inline-end: var(--sidebar-collapsed-w); }
  .sidebar { width: var(--sidebar-collapsed-w); }
  .sidebar .nav-label, .sidebar .nav-arrow, .sidebar .nav-children { display: none; }
  .sidebar .nav-item { justify-content: center; padding: 10px 0; }
  .sidebar.mobile-open { width: var(--sidebar-w); }
  .sidebar.mobile-open .nav-label, .sidebar.mobile-open .nav-arrow { display: block; }
  .sidebar.mobile-open .nav-children { display: block; max-height: 0; }
  .sidebar.mobile-open .nav-item { justify-content: flex-start; padding: 10px 12px; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(100%);
    width: var(--sidebar-w);
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-inline-end: 0; padding: var(--space-md); }
  .form-grid-2, .form-grid-3, .form-grid-4 { grid-template-columns: 1fr; }
  .topbar-search { display: none; }
}

/* ── Mobile overlay (when sidebar opens on small screens) ────────── */
.sidebar-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: calc(var(--z-sidebar) - 1);
  display: none;
}
@media (max-width: 768px) {
  .sidebar.mobile-open ~ .sidebar-backdrop { display: block; }
}

/* ── Loading / page transitions ──────────────────────────────────── */
.page-loading {
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-2xl);
  min-height: 200px;
}

.view {
  animation: fade-in var(--duration-base) var(--ease);
}

/* ── Print friendly ──────────────────────────────────────────────── */
@media print {
  .topbar, .sidebar, .topnav, .toolbar, .page-actions { display: none !important; }
  .main-content { margin: 0 !important; padding: 0 !important; }
}

/* ════════════════════════════════════════════════════════════════════
   TOPNAV (Filament/Binance-style horizontal navigation) — default mode
   ════════════════════════════════════════════════════════════════════ */
.app-shell.nav-topnav .main-content {
  margin-top: var(--topbar-h);
  margin-inline-end: 0;        /* no sidebar */
  margin-inline-start: 0;
  padding: var(--space-lg);
  min-height: calc(100vh - var(--topbar-h));
  background: var(--bg-base);
}

.topnav {
  position: fixed; top: 0; right: 0; left: 0;
  height: var(--topbar-h);
  z-index: var(--z-topbar);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 var(--space-md);
  gap: var(--space-2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.topnav-brand {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: var(--weight-bold);
  font-size: var(--text-lg);
  padding: 0 var(--space-2);
}
.topnav-brand-mark {
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  background: var(--brand-primary);
  color: var(--brand-on-primary);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: var(--weight-bold);
}
.topnav-brand-text { letter-spacing: 0.2px; }

/* Primary nav row — NEVER clip; dropdowns must escape this container. */
.topnav-menu {
  display: flex; align-items: center; gap: 2px;
  flex: 0 1 auto; min-width: 0;
  overflow: visible;            /* CRITICAL: dropdowns positioned absolute must not be clipped */
  flex-wrap: nowrap;
}
.topnav-item {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: transparent; border: none;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
  position: relative;
}
.topnav-item:hover { background: var(--bg-elevated); color: var(--text-primary); }
.topnav-item.active,
.topnav-item.active-trigger {
  color: var(--brand-primary);
  background: rgba(217,118,86,0.10);
}
.topnav-item.active::after,
.topnav-item.active-trigger::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px;
  height: 2px; border-radius: 1px; background: var(--brand-primary);
}
.topnav-icon { font-size: 16px; line-height: 1; }
.topnav-label { line-height: 1; }
.topnav-caret { font-size: 10px; opacity: 0.7; }

.topnav-spacer { flex: 1 1 auto; min-width: var(--space-2); }

/* Search trigger (compact) */
.topnav-search-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text-secondary); cursor: pointer;
  font-size: var(--text-sm);
  min-width: 200px;
  transition: all var(--duration-fast) var(--ease);
}
.topnav-search-trigger:hover { border-color: var(--brand-primary); color: var(--text-primary); }
.topnav-search-icon { font-size: 14px; }
.topnav-search-placeholder { flex: 1; text-align: start; }
.topnav-kbd {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  padding: 2px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-base);
  color: var(--text-muted);
}

.topnav-actions { display: inline-flex; align-items: center; gap: 4px; }
.topnav-action {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  background: transparent; border: none;
  color: var(--text-secondary); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: all var(--duration-fast) var(--ease);
}
.topnav-action:hover { background: var(--bg-elevated); color: var(--text-primary); }

/* User menu */
.topnav-user-wrap { position: relative; }
.topnav-user {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 8px 4px 4px;
  border-radius: var(--radius-full);
  background: transparent; border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
}
.topnav-user:hover { background: var(--bg-elevated); border-color: var(--border); }
.topnav-avatar {
  width: 30px; height: 30px;
  background: var(--brand-primary);
  color: var(--brand-on-primary);
  font-weight: var(--weight-bold);
  font-size: 12px;
}
.topnav-user-meta { display: none; flex-direction: column; line-height: 1.1; text-align: start; }
.topnav-user-name { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text-primary); }
.topnav-user-role { font-size: var(--text-xs); color: var(--text-muted); margin-top: 2px; }
@media (min-width: 768px) { .topnav-user-meta { display: flex; } }

/* Dropdown menus (shared by group + user) */
.topnav-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-start: 0;
  min-width: 240px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  /* Higher than the topbar (1000) so it overlays the page even when the parent
     has its own stacking context. Below modals (2000) and toasts (3000). */
  z-index: 1500;
  opacity: 0; pointer-events: none; transform: translateY(-4px);
  transition: opacity var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease);
}
.topnav-dropdown.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.topnav-dropdown-end { inset-inline-start: auto; inset-inline-end: 0; }
.topnav-dropdown-title {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 10px;
}
.topnav-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
}
.topnav-dropdown-item:hover { background: var(--bg-elevated); color: var(--text-primary); }
.topnav-dropdown-item.active { color: var(--brand-primary); background: rgba(217,118,86,0.08); }
.topnav-dropdown-item.topnav-dropdown-danger { color: var(--danger); }
.topnav-dropdown-item.topnav-dropdown-danger:hover { background: rgba(220,38,38,0.08); }
.topnav-dropdown-icon { font-size: 16px; width: 20px; text-align: center; }
.topnav-dropdown-divider {
  height: 1px; background: var(--border); margin: 4px 6px;
}

/* Group container (for hover dropdown anchoring) */
.topnav-group { position: relative; }
/* CSS-only hover fallback (Binance-style): the dropdown opens on hover OR
   when any element inside has focus (keyboard nav / click leaves focus).
   Click still works through the JS handler in topnav.js (toggles open/close). */
.topnav-group:hover > .topnav-dropdown,
.topnav-group:focus-within > .topnav-dropdown,
.topnav-user-wrap:hover > .topnav-dropdown,
.topnav-user-wrap:focus-within > .topnav-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
/* Generous hit-area: extend the hover catch-zone slightly above the dropdown
   so the cursor doesn't lose focus while moving from trigger to menu. */
.topnav-group:hover > .topnav-dropdown::before,
.topnav-user-wrap:hover > .topnav-dropdown::before {
  content: '';
  position: absolute;
  inset-inline-start: 0; inset-inline-end: 0;
  top: -8px; height: 8px;
}
.topnav-trigger {
  background: transparent; border: none; cursor: pointer; font-family: inherit;
  color: var(--text-secondary);
}

/* Mobile menu trigger (hidden on desktop) */
.topnav-mobile-toggle {
  display: none;
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  background: transparent; border: none;
  color: var(--text-secondary); cursor: pointer;
  font-size: 18px;
}
.topnav-mobile-toggle:hover { background: var(--bg-elevated); color: var(--text-primary); }

/* Mobile drawer */
.topnav-mobile-drawer {
  position: fixed; top: var(--topbar-h); right: 0; left: 0; bottom: 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  z-index: var(--z-sidebar);
  overflow-y: auto;
  padding: var(--space-md);
  transform: translateY(-100%);
  transition: transform var(--duration-base) var(--ease);
  display: none;
}
.topnav-mobile-drawer.open { transform: translateY(0); display: block; }
.topnav-mobile-list { display: flex; flex-direction: column; gap: 4px; }
.topnav-mobile-item, .topnav-mobile-sub {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  font-size: var(--text-md);
}
.topnav-mobile-item:hover, .topnav-mobile-sub:hover { background: var(--bg-elevated); color: var(--text-primary); }
.topnav-mobile-group summary {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; cursor: pointer; list-style: none;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}
.topnav-mobile-group summary::-webkit-details-marker { display: none; }
.topnav-mobile-group[open] summary { background: var(--bg-elevated); }
.topnav-mobile-group .topnav-mobile-sub { padding-inline-start: 36px; font-size: var(--text-sm); }

/* Responsive: hide menu on small screens, show hamburger */
@media (max-width: 1023px) {
  .topnav-menu, .topnav-search-trigger { display: none; }
  .topnav-mobile-toggle { display: inline-flex; align-items: center; justify-content: center; }
}
@media (max-width: 600px) {
  .topnav { padding: 0 var(--space-1); gap: 4px; }
  .topnav-brand-text { display: none; }
  .topnav-user-meta { display: none; }
}

/* ════════════════════════════════════════════════════════════════════
   PAGE PROGRESS BAR
   ════════════════════════════════════════════════════════════════════ */
.page-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms ease;
}
.page-progress.active { opacity: 1; }
.page-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand-primary), #ffce4d);
  box-shadow: 0 0 8px rgba(217,118,86,0.6);
  transition: width 200ms ease-out;
}

/* ════════════════════════════════════════════════════════════════════
   AUTH PAGES — login + change-password polish
   ════════════════════════════════════════════════════════════════════ */
.auth-close-btn {
  position: absolute;
  top: 18px; inset-inline-start: 18px;
  width: 42px; height: 42px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 22px;
  font-weight: var(--weight-bold);
  line-height: 1;
  cursor: pointer;
  z-index: 50;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
  transition: all var(--duration-fast) var(--ease);
}
.auth-close-btn::before {
  content: ""; position: absolute; inset: -3px;
  border-radius: inherit;
  border: 1px solid transparent;
  transition: border-color var(--duration-base) var(--ease);
}
.auth-close-btn:hover {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger);
  transform: rotate(90deg) scale(1.05);
}
.auth-close-btn:hover::before { border-color: var(--danger-border); }
.auth-close-btn:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* Password input with eye toggle */
.input-with-icon { position: relative; }
.input-with-icon .input { padding-inline-end: 44px; }
.input-icon-toggle {
  position: absolute;
  inset-inline-end: 8px;
  top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: all var(--duration-fast) var(--ease);
}
.input-icon-toggle:hover { background: var(--bg-elevated); color: var(--text-primary); }

/* Remember-me row */
.auth-remember-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: var(--space-2); margin-bottom: var(--space-3);
}
.auth-remember {
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: var(--text-sm); color: var(--text-secondary);
}
.auth-remember input { accent-color: var(--brand-primary); width: 16px; height: 16px; cursor: pointer; }
.auth-link-muted {
  color: var(--text-muted); font-size: var(--text-sm); text-decoration: none;
}
.auth-link-muted:hover { color: var(--brand-primary); }

/* Submit button loading bar */
.btn.btn-loading { position: relative; pointer-events: none; opacity: 0.85; }
.btn.btn-loading::after {
  content: ""; position: absolute; left: 0; bottom: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.6) 50%, transparent 100%);
  animation: btn-loading-stripe 1.2s linear infinite;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}
@keyframes btn-loading-stripe {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Error banner inside auth card */
.auth-error {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(220,38,38,0.10);
  border: 1px solid rgba(220,38,38,0.25);
  color: var(--danger);
  font-size: var(--text-sm);
  margin-bottom: var(--space-3);
}
.auth-error-icon { font-size: 18px; line-height: 1; }

/* Auth shell positioning */
.auth-shell { position: relative; }

/* ════════════════════════════════════════════════════════════════════
   BRAND ORB — animated logo for auth pages (Binance-style)
   ════════════════════════════════════════════════════════════════════ */
.brand-orb {
  position: relative;
  width: 72px; height: 72px;
  margin: 0 auto var(--space-4);
  display: inline-flex; align-items: center; justify-content: center;
}
.brand-orb.brand-orb-lg {
  width: 120px; height: 120px;
  margin-bottom: 28px;
}
.brand-orb-mark {
  position: relative; z-index: 4;
  width: 100%; height: 100%;
  border-radius: 24%;
  background: linear-gradient(135deg, var(--brand-primary) 0%, #e8956e 60%, var(--brand-primary) 100%);
  background-size: 200% 200%;
  color: var(--brand-on-primary);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-num);
  font-weight: var(--weight-bold);
  font-size: clamp(22px, 3vw, 36px);
  letter-spacing: -0.5px;
  box-shadow: 0 8px 24px rgba(217,118,86,0.35), inset 0 1px 0 rgba(255,255,255,0.3);
  animation: orb-shine 6s ease-in-out infinite;
}
.brand-orb-lg .brand-orb-mark { font-size: clamp(36px, 4vw, 56px); border-radius: 28%; }
.brand-orb-ring {
  position: absolute; inset: -6px;
  border-radius: inherit;
  border: 1.5px solid var(--brand-primary);
  opacity: 0.0;
  pointer-events: none;
}
.brand-orb-ring-1 { animation: orb-pulse 2.4s ease-out infinite;             }
.brand-orb-ring-2 { animation: orb-pulse 2.4s ease-out 0.6s infinite;        }
.brand-orb-ring-3 { animation: orb-pulse 2.4s ease-out 1.2s infinite;        }

/* Orbiting accent dot for the LG variant */
.brand-orb-lg::before {
  content: ""; position: absolute; inset: 0;
  border-radius: inherit;
  background: conic-gradient(from 0deg, rgba(217,118,86,0.0) 0%, rgba(217,118,86,0.5) 60%, rgba(217,118,86,0.0) 100%);
  filter: blur(14px);
  animation: orb-orbit 5.5s linear infinite;
  z-index: 1;
}
.brand-orb-lg::after {
  content: ""; position: absolute; left: 50%; top: -8px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--brand-primary);
  box-shadow: 0 0 12px var(--brand-primary), 0 0 24px rgba(217,118,86,0.6);
  transform-origin: 0 calc(50% + 60px);
  animation: orb-spin 5.5s linear infinite;
  z-index: 2;
}
@keyframes orb-shine {
  0%, 100% { background-position: 0% 50%;  transform: rotate(0deg); }
  50%      { background-position: 100% 50%; transform: rotate(2deg); }
}
@keyframes orb-pulse {
  0%   { transform: scale(0.95); opacity: 0.55; border-width: 1.5px; }
  70%  { transform: scale(1.4);  opacity: 0;    border-width: 0.5px; }
  100% { transform: scale(1.45); opacity: 0;    border-width: 0;     }
}
@keyframes orb-orbit { from { transform: rotate(0deg);   } to { transform: rotate(360deg); } }
@keyframes orb-spin  { from { transform: rotate(0deg);   } to { transform: rotate(360deg); } }

/* Auth feature chips (under side-text) */
.auth-features {
  margin-top: 28px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px;
}
.auth-feature {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--text-xs); color: var(--text-secondary);
  padding: 6px 10px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.auth-feature .chip-icon { font-size: 14px; }

/* ════════════════════════════════════════════════════════════════════
   DASHBOARD — Binance Pro full-bleed grid
   ═════════════════════════════════════════════════════════════════════ */
.app-shell.nav-topnav .main-content.dashboard-bleed {
  padding: var(--space-md) clamp(12px, 2vw, 28px);
  max-width: none;
}
.dash-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-md);
  width: 100%;
}
.dash-grid > .col-12 { grid-column: span 12; }
.dash-grid > .col-8  { grid-column: span 12; }
.dash-grid > .col-6  { grid-column: span 12; }
.dash-grid > .col-4  { grid-column: span 12; }
.dash-grid > .col-3  { grid-column: span 6;  }
@media (min-width: 768px) {
  .dash-grid > .col-3 { grid-column: span 6; }
  .dash-grid > .col-4 { grid-column: span 6; }
  .dash-grid > .col-6 { grid-column: span 6; }
  .dash-grid > .col-8 { grid-column: span 12; }
}
@media (min-width: 1200px) {
  .dash-grid > .col-3 { grid-column: span 3; }
  .dash-grid > .col-4 { grid-column: span 4; }
  .dash-grid > .col-6 { grid-column: span 6; }
  .dash-grid > .col-8 { grid-column: span 8; }
}

/* KPI counter card with hover-glow */
.kpi-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 8px;
  padding: 18px 20px;
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: transform var(--duration-base) var(--ease), border-color var(--duration-base) var(--ease), box-shadow var(--duration-base) var(--ease);
  cursor: pointer;
}
.kpi-card::before {
  content: ""; position: absolute; inset: -2px -2px auto -2px; height: 3px;
  background: linear-gradient(90deg, transparent, var(--kpi-accent, var(--brand-primary)), transparent);
  opacity: 0; transition: opacity var(--duration-base) var(--ease);
}
.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--kpi-accent, var(--brand-primary));
  box-shadow: 0 8px 24px rgba(0,0,0,0.35), 0 0 0 1px rgba(217,118,86,0.18);
}
.kpi-card:hover::before { opacity: 1; }
.kpi-card .kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kpi-card .kpi-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  background: var(--kpi-accent-bg, rgba(217,118,86,0.12));
  color: var(--kpi-accent, var(--brand-primary));
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.kpi-card .kpi-label { color: var(--text-muted); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.6px; font-weight: var(--weight-semibold); }
.kpi-card .kpi-value { font: var(--weight-bold) clamp(22px, 2vw, 30px) var(--font-num); color: var(--text-primary); font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi-card .kpi-sub   { color: var(--text-muted); font-size: var(--text-xs); }
.kpi-card .kpi-cta   {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 4px;
  color: var(--brand-primary); font-size: var(--text-xs); font-weight: var(--weight-semibold);
  opacity: 0; transform: translateX(-4px);
  transition: opacity var(--duration-base) var(--ease), transform var(--duration-base) var(--ease);
}
[dir="rtl"] .kpi-card .kpi-cta { transform: translateX(4px); }
.kpi-card:hover .kpi-cta { opacity: 1; transform: translateX(0); }
.kpi-card.kpi-info     { --kpi-accent: var(--info);    --kpi-accent-bg: var(--info-bg); }
.kpi-card.kpi-success  { --kpi-accent: var(--success); --kpi-accent-bg: var(--success-bg); }
.kpi-card.kpi-warning  { --kpi-accent: var(--warning); --kpi-accent-bg: var(--warning-bg); }
.kpi-card.kpi-danger   { --kpi-accent: var(--danger);  --kpi-accent-bg: var(--danger-bg); }
.kpi-card.kpi-accent   { --kpi-accent: var(--brand-primary); --kpi-accent-bg: rgba(217,118,86,0.12); }

/* Wallets summary panel */
.dash-wallets-card {
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  display: flex; flex-direction: column; gap: var(--space-3);
  height: 100%;
}
.dash-wallets-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dash-wallets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.dash-wallet-tile {
  position: relative;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color var(--duration-base) var(--ease), transform var(--duration-base) var(--ease);
  overflow: hidden;
}
.dash-wallet-tile:hover { border-color: var(--brand-primary); transform: translateY(-1px); }
.dash-wallet-currency  { font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; display: flex; align-items: center; gap: 6px; }
.dash-wallet-amount    { font: var(--weight-bold) clamp(20px, 1.6vw, 26px) var(--font-num); color: var(--text-primary); font-variant-numeric: tabular-nums; line-height: 1.1; }
.dash-wallet-sub       { font-size: var(--text-xs); color: var(--text-muted); }

/* Movement arrow indicator inside wallet tile */
.move-arrow {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--text-xs); font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
  padding: 2px 8px; border-radius: var(--radius-full);
}
.move-arrow.up   { color: var(--success); background: var(--success-bg); }
.move-arrow.down { color: var(--danger);  background: var(--danger-bg); }
.move-arrow.flat { color: var(--text-muted); background: var(--neutral-bg); }
.move-arrow .arrow {
  display: inline-block; width: 10px; height: 10px;
  background: currentColor;
  -webkit-mask: var(--arrow-up-mask); mask: var(--arrow-up-mask);
  --arrow-up-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10"><path d="M5 0 L10 6 H7 V10 H3 V6 H0 Z" fill="black"/></svg>') center/contain no-repeat;
}
.move-arrow.down .arrow { transform: rotate(180deg); }
.move-arrow.flat .arrow { -webkit-mask: none; mask: none; background: transparent; border-top: 2px solid currentColor; width: 12px; height: 0; }

/* Live activity row inside wallet tile (pulsing dot when fresh) */
.dash-wallet-activity {
  display: flex; align-items: center; gap: 8px;
  margin-top: 4px;
  font-size: var(--text-xs); color: var(--text-muted);
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 var(--success);
  animation: live-pulse 1.6s ease-out infinite;
}
@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0    rgba(14,203,129,0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(14,203,129,0);    }
  100% { box-shadow: 0 0 0 0    rgba(14,203,129,0);    }
}

/* Trial-balance compact card */
.trial-mini {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding-top: 6px;
}
.trial-mini .label { font-size: var(--text-xs); color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.trial-mini .num   { font: var(--weight-bold) 18px var(--font-num); color: var(--text-primary); font-variant-numeric: tabular-nums; }
.trial-mini-banner {
  margin-top: 12px; padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  display: flex; align-items: center; gap: 8px;
}
.trial-mini-banner.ok    { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.trial-mini-banner.bad   { background: var(--danger-bg);  color: var(--danger);  border: 1px solid var(--danger-border); }

/* Per-currency trial balance list (dashboard) */
/* Trial balance card — slightly bigger numbers (12→14px) and gentle padding bump
   so the rows breathe, but small enough to fit the col-4 width on desktop. */
.trial-multi-list { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; max-height: 340px; overflow-y: auto; scrollbar-width: thin; }
.trial-multi-row {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 13px;
  transition: border-color var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease);
}
.trial-multi-row:hover { transform: translateY(-1px); }
.trial-multi-row.ok  { border-color: var(--success-border); border-inline-start: 3px solid var(--success); }
.trial-multi-row.bad { border-color: var(--danger-border); background: var(--danger-bg); border-inline-start: 3px solid var(--danger); }
.trial-multi-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.trial-multi-head .ccy { font: var(--weight-bold) 15px var(--font-num); letter-spacing: 0.5px; color: var(--text-primary); }
.trial-multi-cells { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.trial-multi-cells > div { display: flex; flex-direction: column; gap: 3px; text-align: center; }
.trial-multi-cells .label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.trial-multi-cells .num   { font: var(--weight-bold) 14px var(--font-num); color: var(--text-primary); font-variant-numeric: tabular-nums; line-height: 1.2; }
@media (max-width: 640px) {
  .trial-multi-cells { grid-template-columns: 1fr; gap: 4px; }
  .trial-multi-cells > div { flex-direction: row; justify-content: space-between; text-align: start; }
}

/* Disaster panel */
.disaster-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-elevated) 100%);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.disaster-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}
.disaster-panel-head .title { font-weight: var(--weight-semibold); display: flex; align-items: center; gap: 8px; }
.disaster-panel-body { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.alert-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-base);
  transition: transform var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease);
}
.alert-row:hover { transform: translateX(2px); }
[dir="rtl"] .alert-row:hover { transform: translateX(-2px); }
.alert-row .icon { width: 28px; height: 28px; border-radius: var(--radius-md); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.alert-row.severity-critical { border-color: var(--danger-border); background: rgba(246,70,93,0.06); animation: pulse-critical 2.4s ease-in-out infinite; }
.alert-row.severity-critical .icon { background: var(--danger-bg); color: var(--danger); }
.alert-row.severity-high     { border-color: rgba(255,140,0,0.3); background: rgba(255,140,0,0.05); }
.alert-row.severity-high     .icon { background: rgba(255,140,0,0.1); color: #ff8c00; }
.alert-row.severity-warn     { border-color: var(--warning-border); background: var(--warning-bg); }
.alert-row.severity-warn     .icon { background: rgba(217,118,86,0.18); color: var(--warning); }
.alert-row.severity-info     { border-color: var(--info-border); background: var(--info-bg); }
.alert-row.severity-info     .icon { background: rgba(38,132,255,0.18); color: var(--info); }
.alert-row .body { flex: 1; min-width: 0; }
.alert-row .body .title  { font-weight: var(--weight-semibold); color: var(--text-primary); font-size: var(--text-sm); }
.alert-row .body .detail { font-size: var(--text-xs); color: var(--text-muted); margin-top: 2px; }
.alert-row .badge-cnt { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-full); background: var(--danger); color: #fff; }
.alert-empty { padding: 24px; text-align: center; color: var(--text-muted); }
.alert-empty .ok-icon {
  width: 48px; height: 48px; border-radius: 50%;
  margin: 0 auto 12px;
  background: var(--success-bg); color: var(--success);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  animation: pop-in 360ms cubic-bezier(.34,1.56,.64,1);
}
@keyframes pop-in { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes pulse-critical {
  0%, 100% { box-shadow: 0 0 0 0 rgba(246,70,93,0.0); }
  50%      { box-shadow: 0 0 0 4px rgba(246,70,93,0.10); }
}

/* Movement strip on dashboard */
.movement-strip {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 8px 4px 12px;
  scrollbar-width: thin;
}
.movement-strip .move-tile {
  flex: 0 0 auto;
  min-width: 220px;
  padding: 10px 14px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex; flex-direction: column; gap: 4px;
  transition: border-color var(--duration-fast) var(--ease);
}
.movement-strip .move-tile:hover { border-color: var(--brand-primary); }
.movement-strip .move-amount { font: var(--weight-bold) 16px var(--font-num); }
.movement-strip .move-amount.up   { color: var(--success); }
.movement-strip .move-amount.down { color: var(--danger);  }
.movement-strip .move-meta { font-size: var(--text-xs); color: var(--text-muted); display: flex; gap: 8px; align-items: center; }

/* ── Form layout polish ───────────────────────────────────────────── */
.cust-form-card {
  max-width: 920px;
  margin: 0;
  width: 100%;
}
.cust-form-card .form-grid {
  gap: var(--space-md) var(--space-lg);
}
.form-actions {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-subtle, var(--border));
}
.form-actions .btn { min-width: 120px; }

/* ── Phone composite input (country-code + number) ─────────────────── */
.phone-input {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
  align-items: stretch;
}
.phone-input .phone-cc {
  width: 100%;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.phone-input .phone-num {
  width: 100%;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.4px;
}
[dir="rtl"] .phone-input { direction: ltr; }
[dir="rtl"] .phone-input .phone-num { text-align: left; }

/* ── Tree view (generic, used by CoA + Roles permissions) ─────────── */
.tv-root {
  --tv-indent: 22px;
  font-size: var(--text-sm);
}
.tv-row {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: background 120ms ease;
}
.tv-row:hover { background: var(--bg-hover, rgba(255,255,255,0.04)); }
.tv-row.selected { background: var(--brand-primary-subtle, rgba(217,118,86,0.12)); }
.tv-row.tv-row-disabled { opacity: 0.55; cursor: not-allowed; }
.tv-toggle {
  width: 16px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: transform 160ms ease;
  user-select: none;
}
.tv-toggle.tv-empty { visibility: hidden; }
.tv-toggle.tv-open { transform: rotate(90deg); }
[dir="rtl"] .tv-toggle { transform: rotate(180deg); }
[dir="rtl"] .tv-toggle.tv-open { transform: rotate(90deg); }
.tv-icon { font-size: 14px; opacity: 0.85; }
.tv-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-label code {
  font-size: 11px; color: var(--text-muted);
  margin-inline-end: 6px; font-variant-numeric: tabular-nums;
}
.tv-meta { color: var(--text-muted); font-size: var(--text-xs); margin-inline-start: auto; }
.tv-children { margin-inline-start: var(--tv-indent); padding-inline-start: 6px;
  border-inline-start: 1px dashed var(--border-subtle, var(--border));
}
.tv-children.collapsed { display: none; }
.tv-checkbox { accent-color: var(--brand-primary, #f0b90b); }
.tv-toolbar {
  display: flex; gap: 8px; align-items: center;
  padding: 8px var(--space-md);
  border-bottom: 1px solid var(--border-subtle, var(--border));
  background: var(--bg-elevated);
  position: sticky; top: 0; z-index: 1;
}
.tv-toolbar .input-sm { max-width: 320px; }
.tv-empty-msg {
  padding: 24px; text-align: center; color: var(--text-muted);
}

/* ── DataGrid extras ──────────────────────────────────────────────── */
.dg-toolbar {
  display: flex; gap: 8px; align-items: center;
  flex-wrap: wrap;
  padding: 10px var(--space-md);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle, var(--border));
}
.dg-toolbar .dg-search { min-width: 240px; flex: 1; max-width: 420px; }
.dg-pagesize {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--text-xs); color: var(--text-muted);
}
.dg-pagesize select { width: 70px; }
.dg-density {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); border-radius: var(--radius-sm, 6px);
  overflow: hidden;
}
.dg-density button {
  background: transparent; border: 0; padding: 4px 10px;
  color: var(--text-muted); cursor: pointer; font-size: var(--text-xs);
}
.dg-density button.active { background: var(--brand-primary, #f0b90b); color: #000; }
.data-table.dg-density-compact td,
.data-table.dg-density-compact th { padding: 6px 8px; }
.data-table.dg-density-comfortable td,
.data-table.dg-density-comfortable th { padding: 14px 12px; }
.dg-col-toggle {
  position: relative; display: inline-block;
}
.dg-col-toggle-menu {
  position: absolute; top: calc(100% + 4px); inset-inline-end: 0;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 8px; min-width: 200px;
  display: none; z-index: 10;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
.dg-col-toggle.open .dg-col-toggle-menu { display: block; }
.dg-col-toggle-menu label {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; cursor: pointer; border-radius: 4px;
}
.dg-col-toggle-menu label:hover { background: var(--bg-hover, rgba(255,255,255,0.04)); }

@media (max-width: 720px) {
  .phone-input { grid-template-columns: 90px 1fr; }
  .form-actions { justify-content: stretch; }
  .form-actions .btn { flex: 1; }
  .cust-form-card .form-grid.form-grid-2 { grid-template-columns: 1fr; }
}

/* ── Login entrance animation + reverse layout helper ─────────────── */
.auth-shell { animation: auth-fade-in 380ms ease-out; }
.auth-shell .auth-side { animation: auth-slide-side 520ms cubic-bezier(.25,.46,.45,.94); }
.auth-shell .auth-card { animation: auth-slide-card 460ms cubic-bezier(.25,.46,.45,.94) 80ms backwards; }
@keyframes auth-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes auth-slide-side {
  from { opacity: 0; transform: translateX(-24px); }
  to   { opacity: 1; transform: translateX(0); }
}
[dir="rtl"] .auth-shell .auth-side { animation-name: auth-slide-side-rtl; }
@keyframes auth-slide-side-rtl {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes auth-slide-card {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* Reversed login layout: form on left (visual), branding on right */
.auth-shell.auth-reverse { direction: ltr; }
.auth-shell.auth-reverse .auth-main { order: 1; }
.auth-shell.auth-reverse .auth-side { order: 2; }
[dir="rtl"] .auth-shell.auth-reverse {
  /* In RTL, "reverse" means visual main on the right, side on the left; flip orders. */
  direction: rtl;
}
[dir="rtl"] .auth-shell.auth-reverse .auth-main { order: 2; }
[dir="rtl"] .auth-shell.auth-reverse .auth-side { order: 1; }
