/* ==========================================================================
   MailHub FinTech Dashboard - Enterprise Design System (Dark & Light)
   ========================================================================== */

:root,
[data-theme="dark"] {
  /* Minimalist Dark Theme (Zinc / Slate - Unified across all 3 apps) */
  --bg-app: #09090b;
  --bg-sidebar: #111114;
  --bg-topbar: #111114;
  --bg-surface: #121216;
  --bg-surface-elevated: #18181c;
  --bg-surface-hover: #18181d;
  --bg-glass: #121216;
  --bg-glass-card: #121216;
  --bg-input: #0c0c0f;
  --bg-active-nav: rgba(59, 130, 246, 0.12);
  
  --border-subtle: #232329;
  --border-medium: #232329;
  --border-strong: #34343d;
  --border-glow: transparent;

  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-inverse: #09090b;

  /* Brand Accents - Unified Blue */
  --accent-primary: #3b82f6;
  --accent-primary-hover: #2563eb;
  --accent-gradient: #3b82f6;
  --accent-glow: none;

  /* FinTech Status Colors */
  --emerald: #10b981;
  --emerald-bg: rgba(16, 185, 129, 0.12);
  --emerald-border: rgba(16, 185, 129, 0.25);
  --emerald-glow: none;

  --cyan: #06b6d4;
  --cyan-bg: rgba(6, 182, 212, 0.12);
  --cyan-border: rgba(6, 182, 212, 0.25);
  --cyan-glow: none;

  --purple: #8b5cf6;
  --purple-bg: rgba(139, 92, 246, 0.12);
  --purple-border: rgba(139, 92, 246, 0.25);
  --purple-glow: none;

  --amber: #f59e0b;
  --amber-bg: rgba(245, 158, 11, 0.12);
  --amber-border: rgba(245, 158, 11, 0.25);

  --danger: #f43f5e;
  --danger-bg: rgba(244, 63, 94, 0.12);
  --danger-border: rgba(244, 63, 94, 0.25);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 32px -4px rgba(0, 0, 0, 0.5);
  --shadow-glass: none;

  /* Typography & Layout */
  --font-heading: 'Inter', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius-xs: 5px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-pill: 9999px;

  --sidebar-width: 216px;
  --header-height: 54px;

  --transition-fast: 0.12s ease;
  --transition-normal: 0.18s ease;
}

/* ================= Light Studio Mode (Clean Light) ================= */
[data-theme="light"] {
  --bg-app: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-topbar: #ffffff;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-surface-hover: #f8fafc;
  --bg-glass: #ffffff;
  --bg-glass-card: #ffffff;
  --bg-input: #ffffff;
  --bg-active-nav: rgba(37, 99, 235, 0.08);

  --border-subtle: #e4e4e7;
  --border-medium: #e4e4e7;
  --border-strong: #d4d4d8;
  --border-glow: transparent;

  --text-primary: #09090b;
  --text-secondary: #52525b;
  --text-muted: #71717a;
  --text-inverse: #ffffff;

  --accent-primary: #2563eb;
  --accent-primary-hover: #1d4ed8;
  --accent-gradient: #2563eb;
  --accent-glow: none;

  --shadow-sm: 0 1px 2px 0 rgba(9, 9, 11, 0.04);
  --shadow-md: 0 4px 12px -2px rgba(9, 9, 11, 0.07);
  --shadow-lg: 0 12px 32px -4px rgba(9, 9, 11, 0.12);
  --shadow-glass: none;
}

/* ================= Nordic Slate Mode ================= */
[data-theme="nordic"] {
  --bg-app: #0f141c;
  --bg-sidebar: #151c27;
  --bg-topbar: #151c27;
  --bg-surface: #171f2c;
  --bg-surface-elevated: #1e2837;
  --bg-surface-hover: #1d2736;
  --bg-glass: #171f2c;
  --bg-glass-card: #171f2c;
  --bg-input: #111722;
  --bg-active-nav: rgba(56, 189, 248, 0.12);

  --border-subtle: #253042;
  --border-medium: #253042;
  --border-strong: #334259;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-primary: #38bdf8;
  --accent-primary-hover: #0ea5e9;
  --accent-gradient: #38bdf8;
}

/* ================= Warm Paper Mode ================= */
[data-theme="warm"] {
  --bg-app: #f6f5f2;
  --bg-sidebar: #fcfbf9;
  --bg-topbar: #fcfbf9;
  --bg-surface: #fcfbf9;
  --bg-surface-elevated: #edeae3;
  --bg-surface-hover: #f3f1ec;
  --bg-glass: #fcfbf9;
  --bg-glass-card: #fcfbf9;
  --bg-input: #ffffff;
  --bg-active-nav: rgba(37, 99, 235, 0.08);

  --border-subtle: #e4e0d8;
  --border-medium: #e4e0d8;
  --border-strong: #d1cbc0;

  --text-primary: #1c1917;
  --text-secondary: #57534e;
  --text-muted: #78716c;

  --accent-primary: #2563eb;
  --accent-primary-hover: #1d4ed8;
  --accent-gradient: #2563eb;
}

/* ================= SayGM Mode (Amber Paper / Technical Editorial) ================= */
[data-theme="saygm"] {
  --bg-app: #faf2de;
  --bg-sidebar: #f3e9cf;
  --bg-topbar: #f5c518;
  --bg-surface: #fdf8eb;
  --bg-surface-elevated: #ebe0c3;
  --bg-surface-hover: #f4ebd2;
  --bg-glass: #fdf8eb;
  --bg-glass-card: #fdf8eb;
  --bg-input: #fffdf7;
  --bg-active-nav: #f5c518;

  --border-subtle: #dfd4b8;
  --border-medium: #dfd4b8;
  --border-strong: #c9bc9b;

  --text-primary: #111110;
  --text-secondary: #4a453a;
  --text-muted: #787060;
  --text-inverse: #f5c518;

  --accent-primary: #111110;
  --accent-primary-hover: #272725;
  --accent-gradient: #111110;

  --emerald: #047857;
  --emerald-bg: rgba(4, 120, 87, 0.12);
  --emerald-border: rgba(4, 120, 87, 0.28);

  --cyan: #0f766e;
  --cyan-bg: rgba(15, 118, 110, 0.12);
  --cyan-border: rgba(15, 118, 110, 0.28);

  --amber: #b45309;
  --danger: #be123c;

  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: 0 12px 32px -4px rgba(17, 17, 16, 0.18);
}

[data-theme="saygm"] .app-topbar,
[data-theme="saygm"] .sidebar-brand {
  background-color: #f5c518 !important;
  border-bottom: 2px solid #111110 !important;
  color: #111110 !important;
}

[data-theme="saygm"] .sidebar-brand .brand-info *,
[data-theme="saygm"] .app-topbar .crumb-root,
[data-theme="saygm"] .app-topbar .crumb-sep,
[data-theme="saygm"] .app-topbar .crumb-active {
  color: #111110 !important;
}

[data-theme="saygm"] .sidebar-brand .brand-logo-icon {
  background: #111110 !important;
  color: #ffffff !important;
}

[data-theme="saygm"] .sidebar-brand .brand-logo-icon svg {
  color: #ffffff !important;
  stroke: #ffffff !important;
}

[data-theme="saygm"] .app-topbar .theme-toggle-btn,
[data-theme="saygm"] .app-topbar .btn-secondary,
[data-theme="saygm"] .app-topbar #themePresetSelect,
[data-theme="saygm"] .app-topbar .sync-status-pill,
[data-theme="saygm"] .app-topbar .user-chip-btn {
  background: rgba(255, 252, 242, 0.56) !important;
  color: #111110 !important;
  border-color: rgba(17, 17, 16, 0.28) !important;
}

[data-theme="saygm"] .app-topbar .theme-toggle-btn:hover,
[data-theme="saygm"] .app-topbar .btn-secondary:hover,
[data-theme="saygm"] .app-topbar .user-chip-btn:hover {
  background: rgba(255, 252, 242, 0.9) !important;
  border-color: #111110 !important;
}

[data-theme="saygm"] .app-topbar .user-role-badge,
[data-theme="saygm"] .app-topbar #badgeLogsCount {
  background: #111110 !important;
  color: #f5c518 !important;
  border-color: #111110 !important;
}

[data-theme="saygm"] .btn-primary {
  background: #111110 !important;
  color: #f5c518 !important;
  border-color: #111110 !important;
  font-weight: 700 !important;
}

[data-theme="saygm"] .btn-primary:hover {
  background: #272725 !important;
  border-color: #272725 !important;
}

[data-theme="saygm"] .segmented-control {
  background: rgba(17, 17, 16, 0.08) !important;
  border-color: rgba(17, 17, 16, 0.24) !important;
}

[data-theme="saygm"] .segmented-btn {
  color: #111110 !important;
}

[data-theme="saygm"] .segmented-btn:hover {
  background: rgba(17, 17, 16, 0.08) !important;
}

[data-theme="saygm"] .segmented-btn.active {
  background: #111110 !important;
  color: #f5c518 !important;
}

[data-theme="saygm"] .segmented-btn.active svg {
  stroke: #f5c518 !important;
}

[data-theme="saygm"] .nav-button.active {
  background: #f5c518 !important;
  color: #111110 !important;
  border: 1px solid #111110 !important;
  box-shadow: 0 2px 0 rgba(17, 17, 16, 0.14);
}

[data-theme="saygm"] .nav-button.active .nav-icon-wrap {
  color: #111110 !important;
}

[data-theme="saygm"] .nav-button.active .nav-counter {
  background: #111110 !important;
  color: #f5c518 !important;
  border-color: #111110 !important;
}

/* ================= Reset & Base ================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  font-family: var(--font-body);
  background-color: var(--bg-app);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ================= Main App Shell (Unified 216px Sidebar + 54px Header) ================= */
.app-wrapper {
  display: grid;
  grid-template-columns: 216px 1fr;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background-color: var(--bg-app);
}

/* ================= 1. SIDEBAR ================= */
.app-sidebar {
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 0;
  user-select: none;
  z-index: 20;
  transition: transform var(--transition-normal);
}

.sidebar-brand {
  height: 54px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  margin-bottom: 0;
}

.brand-logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: none;
  position: relative;
  flex-shrink: 0;
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
}

[data-theme="light"] .brand-name {
  color: var(--text-primary);
}

.brand-pro-pill {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--accent-primary);
  color: #fff;
  letter-spacing: 0.04em;
}

.brand-sub {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Sidebar Account Box */
.sidebar-account-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  margin: 12px 10px 4px;
  transition: border-color var(--transition-fast);
}

.sidebar-account-box:hover {
  border-color: var(--border-strong);
}

.box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.box-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.box-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  position: relative;
}

.box-status-dot.online {
  background-color: var(--emerald);
  box-shadow: none;
}

.select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.select-icon {
  position: absolute;
  left: 8px;
  color: var(--text-muted);
  pointer-events: none;
}

.select-arrow {
  position: absolute;
  right: 8px;
  color: var(--text-muted);
  pointer-events: none;
}

.account-select-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 26px;
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  appearance: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  transition: all var(--transition-fast);
}

.account-select-input:focus {
  border-color: var(--accent-primary);
  box-shadow: none;
}

/* Sidebar Navigation */
.sidebar-navigation {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px;
  overflow-y: auto;
}

.nav-group-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 10px 4px;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 100%;
  text-align: left;
}

.nav-button:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

[data-theme="light"] .nav-button:hover,
[data-theme="warm"] .nav-button:hover,
[data-theme="saygm"] .nav-button:hover {
  background: rgba(15, 23, 42, 0.04);
}

.nav-button.active {
  background: var(--bg-active-nav);
  color: var(--accent-primary);
  font-weight: 600;
  box-shadow: none;
}

.nav-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
}

.nav-button.active .nav-icon-wrap {
  color: var(--accent-primary);
}

.nav-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Counter Pills */
.nav-counter {
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  font-variant-numeric: tabular-nums;
}

.pill-green,
.pill-emerald {
  background: var(--emerald-bg);
  color: var(--emerald);
  border: 1px solid var(--emerald-border);
}

.pill-blue {
  background: rgba(59, 130, 246, 0.16);
  color: var(--accent-primary);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.pill-purple {
  background: var(--purple-bg);
  color: var(--purple);
  border: 1px solid var(--purple-border);
}

.pill-gray {
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

/* System Health Card */
.sidebar-system-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-top: 14px;
}

.sys-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.sys-pulse-icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.sys-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sys-metrics {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sys-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.sys-val {
  font-weight: 600;
  color: var(--text-secondary);
}

.sys-val.highlight {
  color: var(--emerald);
  font-family: var(--font-mono);
}

/* Sidebar Footer */
.sidebar-bottom-actions {
  margin-top: auto;
  padding: 10px 12px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-sub-btns {
  display: flex;
  gap: 6px;
}

/* ================= Buttons & Segmented Control ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-block { width: 100%; }

.btn-primary {
  background: var(--accent-primary);
  color: #ffffff;
  border: 1px solid var(--accent-primary);
  box-shadow: none;
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  border-color: var(--accent-primary-hover);
  transform: none;
  box-shadow: none;
}

.btn-glow {
  box-shadow: none !important;
}

.btn-glow:hover {
  box-shadow: none !important;
  transform: none;
}

.btn-secondary {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  color: var(--text-primary);
  box-shadow: none;
}

.btn-secondary:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-strong);
}

.btn-glass {
  background: var(--bg-surface);
  backdrop-filter: none;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  box-shadow: none;
}

.btn-glass:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: none;
  box-shadow: none;
}

.btn-subtle {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.btn-subtle:hover {
  color: var(--text-primary);
  background: var(--bg-surface-elevated);
  border-color: var(--border-strong);
}

.btn-danger {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 11.5px;
  border-radius: var(--radius-sm);
}

.btn-icon-only {
  padding: 0;
  width: 28px;
  height: 28px;
}

/* Segmented Control (Unified Ecosystem Switcher) */
.segmented-control {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.segmented-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.12s ease;
  white-space: nowrap;
  text-decoration: none;
}

.segmented-btn:hover {
  color: var(--text-primary);
}

.segmented-btn.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* Spinner */
.spin-icon.spinning {
  animation: spin 0.8s linear infinite;
}

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

/* ================= 2. TOPBAR (Unified 54px Height) ================= */
.app-main-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  background-color: var(--bg-app);
}

.app-topbar {
  min-height: 54px;
  background-color: var(--bg-topbar);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 18px;
  position: relative;
  z-index: 30;
  gap: 8px 12px;
  flex-wrap: wrap;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: nowrap;
}

.app-topbar .theme-toggle-btn {
  width: 30px;
  padding: 0;
}

@media (max-width: 1680px) {
  .hide-on-compact {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .app-topbar {
    padding: 8px 14px;
    gap: 8px;
  }
  .topbar-left,
  .topbar-right {
    flex-wrap: wrap;
  }
}

.sidebar-toggle-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
}

.breadcrumb-trail {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
}

.crumb-root {
  color: var(--text-muted);
  font-weight: 500;
}

.crumb-sep {
  color: var(--border-strong);
}

.crumb-active {
  color: var(--text-primary);
  font-weight: 600;
  font-family: var(--font-heading);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sync-status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.sync-status-pill .status-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--emerald);
}

.sync-status-pill.syncing .status-indicator {
  background-color: var(--accent-primary);
  animation: pulse-dot 1s infinite;
}

.theme-toggle-btn {
  height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 11.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.theme-toggle-btn:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-strong);
}

.sun-icon { display: inline-flex; align-items: center; gap: 5px; color: var(--amber); }
.moon-icon { display: none; align-items: center; gap: 5px; color: var(--accent-primary); }

[data-theme="light"] .sun-icon,
[data-theme="warm"] .sun-icon,
[data-theme="saygm"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon,
[data-theme="warm"] .moon-icon,
[data-theme="saygm"] .moon-icon { display: inline-flex; }

/* ================= LIVE TERMINAL BOTTOM BAR (Unified with :3002) ================= */
.live-terminal {
  position: fixed;
  bottom: 0;
  right: 0;
  left: var(--sidebar-width);
  z-index: 35;
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border-subtle);
  transition: height 0.22s cubic-bezier(0.16, 1, 0.3, 1), left 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  font-family: var(--font-mono);
}

.live-terminal-header {
  height: 38px;
  padding: 0 16px;
  background: var(--bg-sidebar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

.term-filter-btn {
  padding: 3px 8px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 500;
  font-family: var(--font-mono);
  cursor: pointer;
  font-size: 11px;
  transition: all 0.12s ease;
}

.term-filter-btn:hover {
  color: var(--text-primary);
}

.term-filter-btn.active {
  background: var(--border-subtle);
  color: var(--accent-primary);
  font-weight: 700;
}

@media (max-width: 992px) {
  .live-terminal {
    left: 0;
  }
}

/* ================= 3. MAIN VIEWS AREA ================= */
.app-views-area {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  padding-bottom: 38px;
}

.content-view {
  flex: 1;
  min-height: 0;
  overflow-y: auto !important;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 20px 24px 36px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.content-view > * {
  flex-shrink: 0 !important;
}

.view-header-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.title-with-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.view-header-banner h1 {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.live-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald);
  border: 1px solid var(--emerald-border);
  text-transform: uppercase;
}

.banner-desc {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.banner-actions {
  display: flex;
  gap: 10px;
}

/* ================= 4. METRIC CARDS GRID ================= */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.metric-glass-card {
  position: relative;
  background: var(--bg-surface);
  backdrop-filter: none;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  box-shadow: none;
  transition: border-color var(--transition-fast);
}

.metric-glass-card:hover {
  transform: none;
  border-color: var(--border-strong);
  box-shadow: none;
}

.metric-card-glow {
  display: none !important;
}

.card-emerald .metric-card-glow { background: var(--emerald); }
.card-emerald { border-top: 3px solid var(--emerald); }

.card-cyan .metric-card-glow { background: var(--cyan); }
.card-cyan { border-top: 3px solid var(--cyan); }

.card-purple .metric-card-glow { background: var(--purple); }
.card-purple { border-top: 3px solid var(--purple); }

.card-amber .metric-card-glow { background: var(--amber); }
.card-amber { border-top: 3px solid var(--amber); }

.metric-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.metric-icon-box {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-emerald { background: var(--emerald-bg); color: var(--emerald); }
.icon-cyan { background: var(--cyan-bg); color: var(--cyan); }
.icon-purple { background: var(--purple-bg); color: var(--purple); }
.icon-amber { background: var(--amber-bg); color: var(--amber); }

.metric-number-wrap {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
}

.metric-big-num {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-primary);
}

.card-emerald .metric-big-num { color: var(--emerald); }
.card-cyan .metric-big-num { color: var(--cyan); }
.card-purple .metric-big-num { color: var(--purple); }
.card-amber .metric-big-num { color: var(--amber); }

.metric-unit {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.metric-title-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-footer-note {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ================= 5. DISTRIBUTION RATIO CARD ================= */
.distribution-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 24px;
}

.dist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.dist-title-box h4 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.dist-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.dist-legend {
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-item .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-item .dot.emerald { background: var(--emerald); box-shadow: none; }
.legend-item .dot.cyan { background: var(--cyan); box-shadow: none; }

.ratio-bar-wrapper {
  width: 100%;
  height: 8px;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-pill);
  display: flex;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.ratio-segment {
  height: 100%;
  transition: width 0.4s ease;
}

.ratio-segment.emerald {
  background: var(--emerald);
}

.ratio-segment.cyan {
  background: var(--cyan);
}

/* ================= PAYONEER SPLIT STUDIO DASHBOARD LAYOUT ================= */
.payoneer-studio-view {
  overflow: hidden;
  padding: 18px 24px;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}

.payoneer-dashboard-layout {
  display: grid;
  grid-template-columns: 390px 1fr;
  gap: 16px;
  flex: 1;
  min-height: 0;
}

@media (max-width: 1200px) {
  .payoneer-dashboard-layout {
    grid-template-columns: 350px 1fr;
  }
}

@media (max-width: 1024px) {
  .payoneer-studio-view {
    overflow-y: auto;
  }
  .payoneer-dashboard-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
}

.payoneer-analytics-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.payoneer-analytics-sidebar .distribution-card {
  margin-bottom: 0;
  padding: 14px 16px;
}

.payoneer-analytics-sidebar .accounts-analytics-card {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  flex: none;
}

.payoneer-transactions-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.payoneer-transactions-main .panel-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  margin-bottom: 0;
}

.payoneer-transactions-main .table-scroll-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* ================= ACCOUNTS ANALYTICS BREAKDOWN CARD ================= */
#viewPayoneer {
  padding: 12px 18px 24px 18px;
  gap: 10px;
  overflow-y: auto !important;
  overflow-x: hidden;
  height: 100%;
  box-sizing: border-box;
}

#viewPayoneer > * {
  flex-shrink: 0 !important;
}

.accounts-analytics-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: none;
  margin-bottom: 0;
  width: 100%;
  flex-shrink: 0 !important;
}

.breakdown-analytics-card .table-scroll-area {
  max-height: 380px;
  overflow-y: auto !important;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

.accounts-analytics-card .fintech-table {
  width: 100% !important;
  display: table !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

.accounts-analytics-card .fintech-table thead {
  display: table-header-group !important;
  visibility: visible !important;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-surface-elevated);
}

.accounts-analytics-card .fintech-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-surface-elevated);
  padding: 7px 10px !important;
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.3px !important;
  text-transform: uppercase !important;
  color: var(--text-muted) !important;
  border-bottom: 1px solid var(--border-medium) !important;
  white-space: nowrap !important;
  box-shadow: none;
}

.accounts-analytics-card .fintech-table tbody {
  display: table-row-group !important;
  visibility: visible !important;
}

.accounts-analytics-card .fintech-table tbody tr {
  display: table-row !important;
  visibility: visible !important;
  transition: background 0.15s ease;
}

.accounts-analytics-card .fintech-table tbody tr:hover {
  background: var(--bg-surface-hover) !important;
}

.accounts-analytics-card .fintech-table tbody tr td,
.accounts-analytics-card .fintech-table tbody tr th {
  visibility: visible !important;
  display: table-cell !important;
  padding: 5px 10px !important;
  vertical-align: middle !important;
  font-size: 0.78rem !important;
  border-bottom: 1px solid var(--border-subtle) !important;
}

.accounts-analytics-card .fintech-table tbody tr:last-child td {
  border-bottom: none !important;
}

/* ================= MONTHLY CHART STYLES ================= */
.chart-canvas-wrap {
  padding: 4px 14px 6px 14px;
  position: relative;
  width: 100%;
  height: 155px;
  min-height: 155px;
  box-sizing: border-box;
}

#monthlyChart {
  width: 100% !important;
  height: 100% !important;
  display: block;
  cursor: crosshair;
}

.chart-tooltip {
  position: absolute;
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.85rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 1000;
  box-shadow: var(--shadow-md);
  min-width: 180px;
}

.chart-tooltip.visible {
  opacity: 1;
}

.chart-tooltip .tooltip-title {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.chart-tooltip .tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
}

.chart-tooltip .tooltip-label {
  color: var(--text-secondary);
}

.chart-tooltip .tooltip-value {
  font-weight: 700;
  color: var(--text-primary);
}

.chart-tooltip .tooltip-row.received .tooltip-value {
  color: var(--emerald);
}

.chart-tooltip .tooltip-row.expense .tooltip-value {
  color: var(--cyan);
}

.chart-tooltip .tooltip-row.net .tooltip-value {
  color: var(--accent-primary);
}

.analytics-card-header {
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-surface-elevated);
}

.ach-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ach-icon-box {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.12);
  color: var(--emerald);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ach-title {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.ach-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin: 0;
}

.ach-badge {
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.mini-ratio-track {
  width: 100px;
  height: 6px;
  background: var(--cyan);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
}

.mini-ratio-fill {
  height: 100%;
  background: var(--emerald);
  border-radius: 4px 0 0 4px;
}

/* ================= 6. PANEL & DATA TABLE ================= */
.panel-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: none;
}

.panel-card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.panel-title-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.panel-heading {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.panel-caption {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.panel-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.table-search-input-wrap svg {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
}

.table-search-input-wrap input {
  padding: 7px 12px 7px 32px;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.8rem;
  outline: none;
  width: 220px;
  transition: all var(--transition-fast);
}

.table-search-input-wrap input:focus {
  border-color: var(--accent-primary);
  width: 260px;
}

.custom-select-control {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  outline: none;
  cursor: pointer;
}

.table-scroll-area {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

.fintech-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.fintech-table th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 1px 0 var(--border-subtle);
}

.fintech-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: middle;
}

.fintech-table tbody tr {
  transition: background-color var(--transition-fast);
}

.fintech-table tbody tr:hover {
  background-color: var(--bg-surface-hover);
}

.interactive-row {
  cursor: pointer;
  transition: all 0.15s ease;
}

.interactive-row:hover {
  background-color: rgba(59, 130, 246, 0.08) !important;
}

.table-empty-row {
  text-align: center;
  padding: 48px !important;
  color: var(--text-muted);
}

.loading-spinner-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(59, 130, 246, 0.2);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Payoneer Transactions Full Height Layout */
#viewTransactions {
  height: 100%;
  min-height: 0;
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
  padding: 12px 18px 12px 18px;
  gap: 10px;
}

#viewTransactions .panel-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
}

#viewTransactions .panel-card-header {
  padding: 6px 12px;
  gap: 6px;
  flex-shrink: 0;
}

#viewTransactions .panel-icon-wrap {
  width: 26px;
  height: 26px;
}

#viewTransactions .panel-heading {
  font-size: 0.86rem;
  font-weight: 700;
}

#viewTransactions .panel-caption {
  font-size: 0.68rem;
}

#viewTransactions .panel-controls {
  gap: 4px;
  flex-wrap: wrap;
}

#viewTransactions .table-search-input-wrap input {
  width: 115px;
  padding: 3px 6px 3px 24px;
  font-size: 0.74rem;
}

#viewTransactions .table-search-input-wrap input:focus {
  width: 145px;
}

#viewTransactions .table-search-input-wrap svg {
  left: 7px;
  width: 12px;
  height: 12px;
}

#viewTransactions .custom-select-control {
  padding: 3px 5px;
  font-size: 0.74rem;
}

#viewTransactions .table-scroll-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
  position: relative;
  width: 100%;
}

#viewTransactions #payoneerTable {
  table-layout: fixed;
  width: 100%;
}

#viewTransactions .fintech-table th {
  padding: 6px 8px;
  font-size: 0.7rem;
  letter-spacing: 0.3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#viewTransactions .fintech-table td {
  padding: 5px 8px;
  font-size: 0.8rem;
  vertical-align: middle;
  overflow: hidden;
}

#viewTransactions .table-pagination-footer {
  padding: 6px 14px;
  flex-shrink: 0;
}

/* Accounts Management View Compact Layout */
#viewAccounts {
  padding: 14px 20px 24px 20px;
  gap: 12px;
}

#viewAccounts .panel-card {
  border-radius: var(--radius-md);
  overflow: hidden;
}

#viewAccounts .panel-card-header {
  padding: 8px 16px;
  gap: 8px;
}

#viewAccounts .fintech-table th {
  padding: 8px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-medium);
  white-space: nowrap;
}

#viewAccounts .fintech-table td {
  padding: 8px 12px;
  font-size: 0.82rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-subtle);
}

#viewAccounts .fintech-table tbody tr {
  transition: background 0.15s ease;
}

#viewAccounts .fintech-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

#viewAccounts .fintech-table tbody tr:last-child td {
  border-bottom: none;
}

/* Logs View Layout */
#viewLogs {
  padding: 14px 20px 20px 20px;
  gap: 10px;
}

/* Settings View Accordion Layout */
#viewSettings {
  padding: 14px 20px 30px 20px;
}

.settings-accordion-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 820px;
  margin: 0 auto;
  width: 100%;
}

.setting-accordion-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  scroll-margin-top: 14px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.setting-accordion-item:hover {
  border-color: var(--border-medium);
}

.setting-accordion-item.open {
  border-color: var(--border-medium);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.setting-accordion-header {
  padding: 11px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  background: transparent;
  transition: background var(--transition-fast);
  gap: 12px;
}

.setting-accordion-header:hover {
  background: rgba(255, 255, 255, 0.025);
}

.sah-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.sah-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.sah-title-wrap {
  min-width: 0;
}

.sah-title {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.sah-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: 2px 0 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sah-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.sah-chevron {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.setting-accordion-item.open .sah-chevron {
  transform: rotate(180deg);
  color: var(--accent-primary);
}

.setting-accordion-body {
  display: none;
  padding: 14px 18px 16px 18px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-app);
  animation: settingSlideDown 0.22s ease-out forwards;
}

.setting-accordion-item.open .setting-accordion-body {
  display: block;
}

@keyframes settingSlideDown {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Payoneer Table Pagination Controls */
.table-pagination-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  flex-wrap: wrap;
  gap: 12px;
}

.pagination-info {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.pagination-info b {
  color: var(--text-primary);
}

.pagination-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.pagination-size-select {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pagination-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-numbers {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-page-number {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-page-number:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.btn-page-number.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

.page-ellipsis {
  color: var(--text-muted);
  padding: 0 4px;
  font-size: 0.82rem;
  font-weight: 700;
}

/* Payoneer Transaction Badges */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.status-chip.received {
  background: var(--emerald-bg);
  color: var(--emerald);
  border: 1px solid var(--emerald-border);
}

.status-chip.successful {
  background: var(--cyan-bg);
  color: var(--cyan);
  border: 1px solid var(--cyan-border);
}

.status-chip.charged {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.status-chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.payment-id-pill {
  font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.28);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.3px;
}

/* ================= 7. MAIL STUDIO LAYOUT (3 COLUMNS) ================= */
.mail-studio-layout {
  display: grid;
  grid-template-columns: 390px 1fr;
  padding: 0;
  gap: 0;
  height: 100%;
  overflow: hidden;
}

.mail-list-column {
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.column-header-box {
  padding: 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mail-search-bar {
  position: relative;
  display: flex;
  align-items: center;
}

.mail-search-bar .search-ico {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.mail-search-bar input {
  width: 100%;
  padding: 9px 40px 9px 36px;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  transition: all var(--transition-fast);
}

.mail-search-bar input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.search-clear-btn {
  position: absolute;
  right: 28px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}

.search-shortcut-hint {
  position: absolute;
  right: 10px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--text-muted);
  pointer-events: none;
}

.mail-filter-pills {
  display: flex;
  gap: 6px;
  background: var(--bg-app);
  padding: 3px;
  border-radius: var(--radius-sm);
}

.filter-pill {
  flex: 1;
  padding: 6px 8px;
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.filter-pill:hover {
  color: var(--text-primary);
}

.filter-pill.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.email-cards-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Email Card Item */
.email-card-item {
  background: var(--bg-surface-elevated);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.email-card-item:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-medium);
}

.email-card-item.active {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--accent-primary);
  box-shadow: inset 0 0 10px rgba(59, 130, 246, 0.1);
}

.email-card-item.unread {
  border-left: 3px solid var(--accent-primary);
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.sender-badge-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
}

.sender-name-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.email-card-item.unread .sender-name-text {
  font-weight: 700;
  color: var(--text-primary);
}

.card-time-text {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.card-subject-text {
  font-size: 0.83rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-card-item.unread .card-subject-text {
  color: var(--text-primary);
  font-weight: 600;
}

.card-snippet-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-payoneer-pill {
  margin-top: 6px;
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.card-payoneer-pill.rec {
  background: var(--emerald-bg);
  color: var(--emerald);
  border: 1px solid var(--emerald-border);
}

.card-payoneer-pill.pay {
  background: var(--cyan-bg);
  color: var(--cyan);
  border: 1px solid var(--cyan-border);
}

.mail-load-more-bar {
  padding: 8px 12px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
}

.mail-list-footer {
  padding: 8px 16px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-app);
}

.db-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--emerald);
}

/* ================= 8. READING COLUMN ================= */
.mail-reading-column {
  background: var(--bg-app);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.reading-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
}

.empty-graphic-box {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.empty-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.empty-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 380px;
  line-height: 1.5;
  margin-bottom: 20px;
}

.empty-shortcuts-tip {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
}

.empty-shortcuts-tip kbd {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

/* Email Viewer */
.email-viewer-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.viewer-top-toolbar {
  padding: 10px 24px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toolbar-left-actions {
  display: flex;
  gap: 8px;
}

.btn-tool {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-tool:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.format-switcher-tabs {
  display: flex;
  background: var(--bg-app);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.mode-tab {
  padding: 5px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mode-tab:hover {
  color: var(--text-primary);
}

.mode-tab.active {
  background: var(--bg-surface);
  color: var(--accent-primary);
  box-shadow: none;
}

.viewer-meta-header {
  padding: 20px 28px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.payoneer-meta-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--emerald-bg);
  border: 1px solid var(--emerald-border);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}

.banner-badge {
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--emerald);
}

.banner-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.viewer-subject {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 16px;
}

.viewer-sender-card {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sender-avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  box-shadow: none;
}

.sender-details {
  flex: 1;
}

.sender-primary-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.sender-display-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.sender-email-address {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sender-recipient-line {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.rec-label { margin-right: 4px; }
.rec-value { color: var(--text-secondary); font-weight: 500; }

.mail-timestamp-box .time-main {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Content Render Containers */
.viewer-body-container {
  flex: 1;
  overflow: hidden;
  background: #ffffff;
}

.email-render-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #ffffff;
}

.email-render-text {
  padding: 24px;
  background: var(--bg-app);
  color: var(--text-primary);
  font-size: 0.92rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-y: auto;
  height: 100%;
  font-family: var(--font-body);
}

.email-render-json {
  background: var(--bg-app);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.json-header-bar {
  padding: 10px 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.json-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-primary);
  font-weight: 700;
}

.json-code-view {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: #060911;
  color: #38bdf8;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.5;
}

/* ================= 9. ACCOUNTS MANAGER VIEW ================= */
.accounts-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.account-profile-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all var(--transition-normal);
  position: relative;
}

.account-profile-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
}

.acc-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.acc-avatar-large {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.3rem;
  color: #fff;
}

.acc-meta h4 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.acc-meta p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.acc-stats-pill-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  gap: 8px;
  text-align: center;
}

.acc-stat-box .num {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  display: block;
}

.acc-stat-box .lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.acc-sync-info {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.acc-actions-row {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

/* ================= 10. API & DEV HUB ================= */
.api-grid-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.endpoints-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
}

.endpoint-card-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.endpoint-card-item:hover {
  border-color: var(--border-medium);
}

.ep-method {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.ep-method.get { background: var(--emerald-bg); color: var(--emerald); }
.ep-method.post { background: rgba(59, 130, 246, 0.15); color: var(--accent-primary); }

.ep-path {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-primary);
}

.ep-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: auto;
}

.ep-test-link {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-primary);
  text-decoration: none;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.1);
}

.ep-test-link:hover {
  background: var(--accent-primary);
  color: #fff;
}

.ep-badge-info {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-left: auto;
}

.code-lang-selector {
  display: flex;
  gap: 6px;
}

.lang-pill {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lang-pill:hover {
  color: var(--text-primary);
}

.lang-pill.active {
  background: var(--accent-gradient);
  color: #fff;
  border-color: transparent;
}

.code-container-box {
  display: flex;
  flex-direction: column;
  height: 400px;
}

.code-box-top {
  padding: 10px 16px;
  background: var(--bg-surface-elevated);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.code-filename {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.syntax-code-block {
  flex: 1;
  padding: 18px;
  background: #060911;
  color: #38bdf8;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.55;
  overflow: auto;
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

/* ================= 11. TOAST NOTIFICATION ENGINE ================= */
.toast-container {
  position: fixed;
  bottom: 50px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  background: var(--bg-surface-elevated);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  min-width: 300px;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: toast-in 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  transition: opacity 0.2s, transform 0.2s;
}

.toast-item.toast-success { border-left: 4px solid var(--emerald); }
.toast-item.toast-error { border-left: 4px solid var(--danger); }
.toast-item.toast-info { border-left: 4px solid var(--accent-primary); }

.toast-icon { font-size: 1.2rem; }
.toast-body { flex: 1; font-size: 0.85rem; color: var(--text-primary); font-weight: 500; }
.toast-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.1rem; }

@keyframes toast-in {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ================= 12. CUSTOM MODAL DIALOG ================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  animation: fade-in 0.15s ease;
}

.custom-modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  width: 90%;
  max-width: 460px;
  box-shadow: none;
  overflow: hidden;
  animation: zoom-in 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
}

.modal-body {
  padding: 24px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.modal-footer {
  padding: 16px 24px;
  background: var(--bg-surface-elevated);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.shortcuts-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
}

.sc-key {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  padding: 3px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-primary);
  font-weight: 700;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes zoom-in { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ================= 13. RESPONSIVE BREAKPOINTS ================= */
@media (max-width: 1280px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .api-grid-layout { grid-template-columns: 1fr; }
}

@media (max-width: 992px) {
  .app-wrapper { grid-template-columns: 1fr; }
  .app-topbar {
    flex-wrap: wrap;
    padding: 8px 14px;
    gap: 8px;
  }
  .topbar-left,
  .topbar-right {
    flex-wrap: wrap;
  }
  .app-sidebar {
    position: fixed;
    left: -280px;
    width: 280px;
    box-shadow: var(--shadow-lg);
  }
  .app-sidebar.sidebar-open {
    transform: translateX(280px);
  }
  .sidebar-toggle-btn {
    display: block;
  }
  .mail-studio-layout {
    grid-template-columns: 1fr;
  }
  .mail-reading-column {
    display: none;
  }
  .mail-studio-layout.showing-detail .mail-list-column {
    display: none;
  }
  .mail-studio-layout.showing-detail .mail-reading-column {
    display: flex;
  }
}

/* ================= 14. USER PROFILE & AUTH CONTROLS ================= */
.user-profile-menu {
  position: relative;
}

.user-chip-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-pill);
  padding: 4px 14px 4px 5px;
  cursor: pointer;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.user-chip-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-strong);
}

.user-avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--accent-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: none;
}

.user-meta-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.user-role-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: var(--accent-primary);
  color: #fff;
  letter-spacing: 0.05em;
}

.user-caret {
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.user-dropdown-card {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: none;
  padding: 8px;
  z-index: 1000;
  animation: zoom-in 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown-header {
  padding: 8px 10px;
}

.dh-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.dh-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 6px 0;
}

.dropdown-item-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  text-align: left;
}

.dropdown-item-btn:hover {
  background: var(--bg-surface-elevated);
  color: var(--accent-primary);
}

.dropdown-item-btn.item-danger:hover {
  background: var(--danger-bg);
  color: #f87171;
}

/* ==================== MULTI-PROVIDER MODAL & BADGES ==================== */
.provider-tab-switcher {
  display: flex;
  gap: 8px;
  padding: 6px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  margin: 16px 20px 0;
  border: 1px solid var(--border-subtle);
}

.provider-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.provider-tab-btn:hover {
  color: var(--text-primary);
}

.provider-tab-btn.active {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-medium);
}

.gmail-guide-box {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.guide-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #f87171;
  margin-bottom: 6px;
}

.guide-steps {
  margin: 0;
  padding-left: 18px;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.guide-link {
  color: #60a5fa;
  text-decoration: underline;
  font-weight: 600;
}

/* Provider Badges */
.provider-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.provider-badge.gmail {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.provider-badge.outlook {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.provider-badge.tag {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.store-tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
  white-space: nowrap;
}

/* Inbox Store Tag Filter */
.inbox-store-filter-wrap {
  width: 100%;
  margin-top: 6px;
}

.inbox-store-select-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface-2, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  border-radius: var(--radius-sm, 6px);
  padding: 4px 8px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.inbox-store-select-box:hover,
.inbox-store-select-box:focus-within {
  border-color: var(--accent-primary, #6366f1);
  background: var(--bg-surface, rgba(255, 255, 255, 0.07));
}

.inbox-store-select {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary, #f8fafc);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.inbox-store-select option,
.inbox-store-select optgroup {
  background: var(--bg-card, #0f172a);
  color: var(--text-primary, #f8fafc);
}

/* ==================== FORM CONTROLS & INPUTS ==================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-control,
.form-control-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  height: 38px;
  background-color: var(--bg-app, #0a0e19) !important;
  border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.12)) !important;
  border-radius: var(--radius-sm, 6px) !important;
  padding: 0 12px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-primary, #f8fafc) !important;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.form-control:focus,
.form-control-input:focus {
  border-color: var(--accent-primary) !important;
  box-shadow: none !important;
  background-color: var(--bg-surface) !important;
}

.form-control::placeholder,
.form-control-input::placeholder {
  color: var(--text-muted, #64748b) !important;
  opacity: 0.75;
}

[data-theme="light"] .form-control,
[data-theme="light"] .form-control-input,
[data-theme="warm"] .form-control,
[data-theme="warm"] .form-control-input,
[data-theme="saygm"] .form-control,
[data-theme="saygm"] .form-control-input {
  background-color: var(--bg-input, #ffffff) !important;
  border-color: var(--border-medium) !important;
  color: var(--text-primary, #0f172a) !important;
}

[data-theme="light"] .form-control:focus,
[data-theme="light"] .form-control-input:focus,
[data-theme="warm"] .form-control:focus,
[data-theme="warm"] .form-control-input:focus,
[data-theme="saygm"] .form-control:focus,
[data-theme="saygm"] .form-control-input:focus {
  background-color: var(--bg-surface, #ffffff) !important;
  border-color: var(--accent-primary) !important;
  box-shadow: none !important;
}

/* Settings Grid 2-Column Responsive Layout */
.settings-grid-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
}

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

.settings-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.btn-toggle-eye {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.btn-toggle-eye:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.modal-alert-error {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: #fca5a5;
  font-size: 0.85rem;
  line-height: 1.4;
}

/* ==================== MODERN TOGGLE SWITCH ==================== */
.custom-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  user-select: none;
}

.custom-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background-color: var(--border-medium, #334155);
  border-radius: 24px;
  transition: all 0.2s ease;
  display: inline-block;
  cursor: pointer;
  box-shadow: none;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: all 0.2s ease;
  box-shadow: none;
}

.custom-toggle input:checked + .toggle-slider {
  background-color: var(--emerald, #10b981);
  box-shadow: none;
}

.custom-toggle input:checked + .toggle-slider:before {
  transform: translateX(20px);
  background-color: #ffffff;
}

/* Checkbox Row Item */
.checkbox-row-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: all 0.15s ease;
}

.checkbox-row-item:hover {
  border-color: var(--border-medium);
  background: var(--bg-surface-hover);
}

.checkbox-row-item input[type="checkbox"] {
  accent-color: var(--accent-primary, #3b82f6);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* ==================== MODERN FINTECH TABLE DESIGN SYSTEM ==================== */

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

.data-table thead th {
  padding: 11px 16px !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  color: var(--text-muted) !important;
  background: var(--bg-surface-elevated) !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  border-top: none !important;
  position: sticky;
  top: 0;
  z-index: 10;
}

.data-table td {
  padding: 12px 16px !important;
  vertical-align: middle !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  color: var(--text-primary);
  font-size: 0.84rem;
}

.data-table tbody tr {
  transition: background-color 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.data-table tbody tr:hover {
  background-color: var(--bg-surface-hover) !important;
}

/* Category Modern Badges */
.modern-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.badge-auth {
  background: rgba(99, 102, 241, 0.14);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-sync {
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-account {
  background: rgba(168, 85, 247, 0.14);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge-export {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-system {
  background: rgba(59, 130, 246, 0.14);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Micro Action Tag */
.log-action-tag {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.7rem;
  color: var(--text-muted, #94a3b8);
  background: rgba(0, 0, 0, 0.25);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Modern Status Pill with Glowing Dot */
.modern-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.modern-status-badge .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.modern-status-badge.success {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.modern-status-badge.success .status-dot {
  background: #10b981;
  box-shadow: none;
}

.modern-status-badge.warning {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.modern-status-badge.warning .status-dot {
  background: #f59e0b;
  box-shadow: none;
}

.modern-status-badge.error {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.modern-status-badge.error .status-dot {
  background: #ef4444;
  box-shadow: none;
}

/* Target Cell Formatting */
.log-target-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 500;
}

.log-target-cell .target-icon {
  font-size: 0.95rem;
  opacity: 0.85;
}

.log-target-cell .target-text.email {
  color: var(--text-primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
}

.log-target-cell .target-text.user {
  color: #60a5fa;
  font-weight: 600;
}

.log-target-cell .target-text.system {
  color: var(--text-secondary);
}

/* Inline Message Elements */
.log-email-tag {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.8rem;
}

.log-duration-tag {
  color: #34d399;
  font-weight: 600;
  font-size: 0.8rem;
}

.log-number-highlight {
  color: #38bdf8;
  font-weight: 700;
}

.log-user-highlight {
  color: #818cf8;
  font-weight: 600;
}

.log-accname-tag {
  color: #c084fc;
  font-weight: 700;
  font-size: 0.84rem;
  margin-right: 4px;
}

.config-tag-item {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  background: rgba(59, 130, 246, 0.1);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.22);
  padding: 2px 7px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* IP Chip */
.ip-chip {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.76rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-block;
}

.ip-chip.local {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.08);
}

/* Time Cluster */
.log-time-cluster {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.log-time-cluster .time-main {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.log-time-cluster .time-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ================= REAL-TIME TRANSACTION FINANCIAL SUMMARY STRIP (ULTRA-COMPACT) ================= */
.tx-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 0;
  flex-shrink: 0;
}

@media (max-width: 1024px) {
  .tx-summary-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .tx-summary-strip {
    grid-template-columns: 1fr;
  }
}

.tx-sum-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 14px 8px 16px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition-fast);
  box-shadow: none;
}

.tx-sum-card:hover {
  transform: none;
  border-color: var(--border-strong);
  box-shadow: none;
}

.tx-sum-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent-primary);
}

.tx-sum-card.net::before {
  background: var(--accent-primary);
}

.tx-sum-card.received::before {
  background: var(--emerald);
}

.tx-sum-card.paid::before {
  background: var(--cyan);
}

.tx-sum-card.charged::before {
  background: var(--amber);
}

.tx-sum-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tx-sum-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tx-sum-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  white-space: nowrap;
}

.tx-sum-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-sum-badge.green {
  background: var(--emerald-bg);
  color: var(--emerald);
  border-color: var(--emerald-border);
}

.tx-sum-badge.cyan {
  background: var(--cyan-bg);
  color: var(--cyan);
  border-color: var(--cyan-border);
}

.tx-sum-badge.amber {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.3);
}

.tx-sum-main {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.tx-sum-val {
  font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, monospace;
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.1;
  white-space: nowrap;
}

.tx-sum-val.net-val {
  color: var(--text-primary);
}

.text-emerald {
  color: var(--emerald) !important;
}

.text-cyan {
  color: var(--cyan) !important;
}

.text-amber {
  color: #f59e0b !important;
}

.tx-sum-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==================== TABLE SYNC & REFRESH ANIMATIONS ==================== */
@keyframes tableUpdateFlash {
  0% {
    background-color: rgba(16, 185, 129, 0.2);
  }
  100% {
    background-color: transparent;
  }
}

.table-row-updated {
  animation: tableUpdateFlash 1.6s ease-out;
}

.table-syncing-overlay {
  opacity: 0.65;
  pointer-events: none;
  transition: opacity 0.25s ease;
  position: relative;
}

.table-syncing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  color: var(--cyan);
  font-weight: 600;
}

/* ==================== CUSTOM DROPDOWN MENU ==================== */
.custom-dd {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.custom-dd.custom-dd-block {
  display: flex;
  width: 100%;
}

.custom-dd-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  outline: none;
  user-select: none;
  transition: border-color 0.14s ease, background-color 0.14s ease, box-shadow 0.14s ease;
  white-space: nowrap;
}

.custom-dd-block .custom-dd-trigger {
  width: 100%;
}

.custom-dd-trigger.custom-dd-md {
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-md, 8px);
  font-size: 12px;
}

.custom-dd-trigger.custom-dd-sm {
  height: 28px;
  padding: 0 9px;
  border-radius: var(--radius-sm, 6px);
  font-size: 11.5px;
  font-weight: 500;
}

.custom-dd-trigger-main {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.custom-dd-trigger:hover,
.custom-dd.is-open .custom-dd-trigger {
  border-color: var(--border-strong);
  background: var(--bg-surface-hover);
}

.custom-dd.is-open .custom-dd-trigger {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.custom-dd-icon {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.custom-dd-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 155px;
}

.custom-dd-block .custom-dd-value {
  max-width: none;
}

.custom-dd-chevron {
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 2px;
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-dd.is-open .custom-dd-chevron {
  transform: rotate(180deg);
  color: var(--text-primary);
}

.custom-dd-swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(128, 128, 128, 0.38);
}

.custom-dd-menu {
  position: absolute;
  top: calc(100% + 6px);
  z-index: 120;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 5px;
  box-shadow: var(--shadow-lg, 0 14px 32px -6px rgba(0, 0, 0, 0.35));
  animation: customDdReveal 0.13s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-dd-block .custom-dd-menu {
  width: 100%;
  min-width: 100%;
}

.custom-dd-align-left {
  left: 0;
}

.custom-dd-align-right {
  right: 0;
}

@keyframes customDdReveal {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.custom-dd-header {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 4px 9px 6px 9px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 4px;
}

.custom-dd-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 280px;
  overflow-y: auto;
}

.custom-dd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 7px 9px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 7px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.1s ease, color 0.1s ease;
}

.custom-dd-item:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.custom-dd-item.is-selected {
  background: var(--bg-active-nav);
  color: var(--accent-primary);
  font-weight: 600;
}

.custom-dd-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.custom-dd-item-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[data-theme="saygm"] .app-topbar .custom-dd-trigger {
  background: rgba(255, 252, 242, 0.78) !important;
  color: #111110 !important;
  border-color: rgba(17, 17, 16, 0.28) !important;
}

[data-theme="saygm"] .app-topbar .custom-dd-trigger:hover,
[data-theme="saygm"] .app-topbar .custom-dd.is-open .custom-dd-trigger {
  background: #fffcf2 !important;
  border-color: #111110 !important;
  box-shadow: 0 0 0 2px rgba(17, 17, 16, 0.14) !important;
}

[data-theme="saygm"] .custom-dd-menu {
  background: #fdf8eb;
  border: 1.5px solid #111110;
  box-shadow: 0 12px 28px rgba(17, 17, 16, 0.18);
}

[data-theme="saygm"] .custom-dd-item {
  color: #292524;
}

[data-theme="saygm"] .custom-dd-item:hover {
  background: #f3e9cf;
  color: #111110;
}

[data-theme="saygm"] .custom-dd-item.is-selected {
  background: #f5c518;
  color: #111110;
  font-weight: 700;
}

