/* ===================================================================
   MoneyBrain — PREMIUM FUTURISTIC FINTECH · Cosmic Dark
   Design: Deep Space + Glassmorphism + Indigo Glow
   =================================================================== */

/* =====================================================================
   DESIGN TOKENS
   ===================================================================== */
:root {
  /* ---- Backgrounds ---- */
  --bg-space:      #07090F;
  --bg-base:       #0B0E18;
  --bg-surface:    #10141F;
  --bg-elevated:   #151A28;
  --bg-overlay:    #1A2030;
  --bg-hover:      #1E2638;
  --bg-active:     #222C40;

  /* ---- Borders ---- */
  --border-subtle: rgba(255,255,255,.05);
  --border-dim:    rgba(255,255,255,.08);
  --border-base:   rgba(255,255,255,.11);
  --border-strong: rgba(255,255,255,.17);

  /* ---- Text ---- */
  --text-1: #E8EDF5;
  --text-2: #8B96A8;
  --text-3: #5A6478;
  --text-4: #38404F;

  /* ---- Accent · Indigo ---- */
  --indigo-50:  rgba(129,140,248,.06);
  --indigo-100: rgba(129,140,248,.12);
  --indigo-200: rgba(129,140,248,.22);
  --indigo-400: #818CF8;
  --indigo-500: #6366F1;
  --indigo-600: #4F46E5;
  --indigo-glow: 0 0 24px rgba(99,102,241,.28), 0 0 48px rgba(99,102,241,.12);

  /* ---- Status colors ---- */
  --green:      #34D399;
  --green-dim:  rgba(52,211,153,.10);
  --red:        #F87171;
  --red-dim:    rgba(248,113,113,.10);
  --amber:      #FBBF24;
  --amber-dim:  rgba(251,191,36,.10);
  --sky:        #38BDF8;
  --sky-dim:    rgba(56,189,248,.10);
  --purple:     #C084FC;
  --purple-dim: rgba(192,132,252,.10);

  /* ---- Sidebar ---- */
  --sidebar-w:       240px;
  --sidebar-bg:      rgba(8,11,20,.95);

  /* ---- Shadows & Glow ---- */
  --shadow-xs:  0 1px 4px rgba(0,0,0,.4);
  --shadow-sm:  0 2px 8px rgba(0,0,0,.45);
  --shadow-md:  0 4px 20px rgba(0,0,0,.5);
  --shadow-lg:  0 8px 40px rgba(0,0,0,.6);
  --shadow-xl:  0 16px 64px rgba(0,0,0,.7);
  --glow-sm:    0 0 16px rgba(99,102,241,.2);
  --glow-md:    0 0 32px rgba(99,102,241,.25);
  --glow-lg:    0 0 64px rgba(99,102,241,.2), 0 0 120px rgba(99,102,241,.1);

  /* ---- Radius ---- */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl:24px;

  /* ---- Transitions ---- */
  --ease:      cubic-bezier(.22,.1,.2,1);
  --ease-out:  cubic-bezier(0,0,.2,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
  --t1: 100ms;
  --t2: 200ms;
  --t3: 300ms;
  --t4: 400ms;

  /* ---- Type ---- */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Consolas, monospace;
}

/* =====================================================================
   RESET
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; font-size: 14px; }
body {
  font-family: var(--font);
  background: var(--bg-space);
  color: var(--text-1);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { text-decoration: none; color: inherit; }
img, canvas, svg { display: block; }

:focus-visible {
  outline: 2px solid var(--indigo-400);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* =====================================================================
   STARS CANVAS
   ===================================================================== */
.stars-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: .6;
}

/* =====================================================================
   TOAST SYSTEM
   ===================================================================== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 340px;
  width: calc(100% - 40px);
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-base);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,.03);
  backdrop-filter: blur(24px);
  animation: toastIn var(--t3) var(--ease-spring) both;
  transition: opacity var(--t2) var(--ease);
}
.toast.hiding { opacity: 0; transform: translateX(16px); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px) scale(.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

.toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.toast.success .toast-icon { background: var(--green-dim);  color: var(--green); }
.toast.error   .toast-icon { background: var(--red-dim);    color: var(--red); }
.toast.info    .toast-icon { background: var(--indigo-100); color: var(--indigo-400); }
.toast.warning .toast-icon { background: var(--amber-dim);  color: var(--amber); }

.toast-content { flex: 1; min-width: 0; }
.toast-title { font-size: 13.5px; font-weight: 600; color: var(--text-1); }
.toast-msg   { font-size: 12.5px; color: var(--text-2); margin-top: 2px; line-height: 1.45; }

.toast-close {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: var(--r-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  transition: all var(--t1);
  margin-top: 1px;
}
.toast-close:hover { background: var(--bg-hover); color: var(--text-1); }

/* =====================================================================
   LOGIN SCREEN — split premium layout
   ===================================================================== */
.login-screen {
  position: fixed;
  inset: 0;
  display: flex;
  z-index: 100;
}

/* Left hero panel */
.login-hero-panel {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 48px;
}

.login-hero-img {
  position: absolute;
  inset: 0;
  background: url('/assets/login-hero-cosmos.webp') center/cover no-repeat;
  z-index: 0;
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.login-hero-panel:hover .login-hero-img {
  transform: scale(1.03);
}
.login-hero-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    170deg,
    rgba(7, 9, 15, 0.15) 0%,
    rgba(7, 9, 15, 0.45) 50%,
    rgba(7, 9, 15, 0.92) 100%
  );
}

.login-hero-content {
  position: relative;
  z-index: 1;
}

.login-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  background: rgba(99,102,241,.15);
  border: 1px solid rgba(129,140,248,.25);
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--indigo-400);
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 20px;
  backdrop-filter: blur(8px);
}
.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2.5s ease infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--green); }
  50% { opacity: .7; box-shadow: 0 0 16px var(--green); }
}

.login-hero-title {
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.05em;
  color: #fff;
  margin-bottom: 14px;
  text-shadow: 0 2px 20px rgba(0,0,0,.4);
}

.login-hero-sub {
  font-size: 15px;
  color: rgba(255,255,255,.65);
  line-height: 1.55;
  margin-bottom: 36px;
  max-width: 400px;
}

.login-hero-stats {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 24px;
  background: rgba(255,255,255,.06);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--r-lg);
}
.hero-stat-value {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.04em;
  color: #fff;
}
.hero-stat-label {
  font-size: 11px;
  color: rgba(255,255,255,.55);
  font-weight: 500;
  margin-top: 2px;
}
.hero-stat-divider {
  width: 1px;
  height: 32px;
  background: rgba(255,255,255,.1);
}

/* Right form panel */
.login-form-panel {
  width: 420px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 40px;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-dim);
  position: relative;
  z-index: 1;
}

.login-form-inner {
  width: 100%;
  max-width: 340px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}

.brand-mark {
  position: relative;
  flex-shrink: 0;
}
.brand-mark-glow {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,.3) 0%, transparent 70%);
  pointer-events: none;
}

.brand-name-lg {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.04em;
  color: var(--text-1);
}
.brand-tag {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: .07em;
  text-transform: uppercase;
}

.login-form-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.04em;
  color: var(--text-1);
  margin-bottom: 6px;
}
.login-form-subtitle {
  font-size: 13.5px;
  color: var(--text-2);
  margin-bottom: 28px;
}
.login-form-header { margin-bottom: 28px; }

.login-footer-text {
  margin-top: 32px;
  font-size: 12px;
  color: var(--text-4);
  text-align: center;
}

/* =====================================================================
   FIELD SYSTEM
   ===================================================================== */
.field-group { margin-bottom: 18px; }
.field-group:last-of-type { margin-bottom: 22px; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field-label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 8px;
}
.field-opt {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  color: var(--text-3);
  font-size: 11px;
}

.field-wrap { position: relative; }

.field-prefix-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}

.field-suffix-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: var(--r-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  transition: all var(--t1);
}
.field-suffix-btn:hover { color: var(--text-2); background: var(--bg-hover); }

.field-input {
  display: block;
  width: 100%;
  height: 44px;
  padding: 0 14px;
  background: var(--bg-overlay);
  border: 1px solid var(--border-base);
  border-radius: var(--r-md);
  color: var(--text-1);
  font-size: 14px;
  transition: border-color var(--t2) var(--ease), box-shadow var(--t2) var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
.field-input:focus {
  outline: none;
  border-color: var(--indigo-500);
  box-shadow: 0 0 0 3px var(--indigo-100), var(--glow-sm);
}
.field-input::placeholder { color: var(--text-4); }

/* When field-wrap used (icon left) */
.field-wrap .field-input { padding-left: 38px; padding-right: 38px; }

.field-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 11 11' fill='none'%3E%3Cpath d='M2 4l3.5 3.5L9 4' stroke='%23464F61' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px !important;
}

.field-textarea {
  display: block;
  width: 100%;
  padding: 13px 14px;
  background: var(--bg-overlay);
  border: 1px solid var(--border-base);
  border-radius: var(--r-md);
  color: var(--text-1);
  font-size: 14px;
  resize: vertical;
  min-height: 100px;
  transition: border-color var(--t2) var(--ease), box-shadow var(--t2) var(--ease);
}
.field-textarea:focus {
  outline: none;
  border-color: var(--indigo-500);
  box-shadow: 0 0 0 3px var(--indigo-100), var(--glow-sm);
}
.field-textarea::placeholder { color: var(--text-4); }

.field-message {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 10px;
  min-height: 1.25em;
}
.field-message.error   { color: var(--red); }
.field-message.success { color: var(--green); }

/* =====================================================================
   BUTTON SYSTEM
   ===================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.01em;
  transition: all var(--t2) var(--ease);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

/* Cosmic primary */
.btn-cosmic {
  background: linear-gradient(135deg, var(--indigo-500), var(--indigo-600));
  color: #fff;
  box-shadow: 0 2px 12px rgba(99,102,241,.35), 0 0 0 1px rgba(99,102,241,.15);
}
.btn-cosmic::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.15), transparent 60%);
  opacity: 0;
  transition: opacity var(--t2);
}
.btn-cosmic:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 24px rgba(99,102,241,.45), 0 0 0 1px rgba(99,102,241,.2);
}
.btn-cosmic:hover::before { opacity: 1; }
.btn-cosmic:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border-base);
}
.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-1);
  border-color: var(--border-strong);
}

.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid rgba(248,113,113,.2);
}
.btn-danger:hover { background: var(--red-dim); border-color: rgba(248,113,113,.4); }

.btn-success-ghost {
  background: transparent;
  color: var(--green);
  border: 1px solid rgba(52,211,153,.2);
}
.btn-success-ghost:hover { background: var(--green-dim); border-color: rgba(52,211,153,.4); }

.btn-full { width: 100%; }
.btn-sm { height: 34px; padding: 0 13px; font-size: 12.5px; border-radius: var(--r-sm); }

/* Loading state */
.btn-loading { display: flex; align-items: center; gap: 8px; }
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Icon-only close btn */
.icon-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  color: var(--text-3);
  transition: all var(--t1);
  flex-shrink: 0;
}
.icon-close-btn:hover { background: var(--bg-hover); color: var(--text-1); }

/* =====================================================================
   APP LAYOUT
   ===================================================================== */
#app {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* =====================================================================
   SIDEBAR
   ===================================================================== */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-subtle);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  z-index: 300;
  transition: width var(--t3) var(--ease);
  overflow: hidden;
}

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

.sidebar-brand { display: flex; align-items: center; gap: 10px; overflow: hidden; }

.brand-mark-sm { position: relative; flex-shrink: 0; }
.brand-mark-sm::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,.2) 0%, transparent 70%);
}

.sidebar-brand-text { overflow: hidden; white-space: nowrap; }
.brand-name-sm { font-size: 14px; font-weight: 700; letter-spacing: -.03em; color: var(--text-1); }
.brand-edition { font-size: 10px; font-weight: 500; color: var(--text-3); letter-spacing: .07em; text-transform: uppercase; }

.sidebar-collapse-btn {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: var(--r-xs);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  transition: all var(--t1);
}
.sidebar-collapse-btn:hover { background: var(--bg-hover); color: var(--text-1); }

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-group { margin-bottom: 8px; }

.nav-group-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-4);
  padding: 8px 10px 4px;
  white-space: nowrap;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-md);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--t2) var(--ease);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
}
.nav-link:hover {
  background: var(--bg-hover);
  color: var(--text-1);
}
.nav-link.active {
  background: var(--indigo-50);
  color: var(--indigo-400);
  font-weight: 600;
}

.nav-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.nav-active-indicator {
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px;
  height: 60%;
  background: var(--indigo-500);
  border-radius: 0 3px 3px 0;
  box-shadow: var(--glow-sm);
  transition: transform var(--t2) var(--ease-spring);
}
.nav-link.active .nav-active-indicator { transform: translateY(-50%) scaleY(1); }

/* Sidebar footer */
.sidebar-foot {
  padding: 10px 8px;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: var(--r-md);
  transition: background var(--t1);
  overflow: hidden;
}

.user-ava {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--indigo-100);
  border: 1.5px solid var(--indigo-200);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  color: var(--indigo-400);
  text-transform: uppercase;
  box-shadow: 0 0 10px rgba(99,102,241,.15);
}

.user-meta { flex: 1; min-width: 0; overflow: hidden; }
.user-name-text {
  font-size: 13px; font-weight: 600;
  color: var(--text-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role-text {
  font-size: 11px; color: var(--text-3);
  white-space: nowrap;
}

.logout-btn {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: var(--r-xs);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  transition: all var(--t1);
}
.logout-btn:hover { background: var(--red-dim); color: var(--red); }

/* Collapsed */
.sidebar.collapsed { width: 62px; }
.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-group-label,
.sidebar.collapsed .user-meta,
.sidebar.collapsed .logout-btn { opacity: 0; pointer-events: none; width: 0; }
.sidebar.collapsed .nav-link { justify-content: center; padding: 10px; }
.sidebar.collapsed .sidebar-collapse-btn svg { transform: rotate(180deg); }
.sidebar.collapsed .sidebar-user { justify-content: center; padding: 9px 6px; }

/* =====================================================================
   MOBILE OVERLAY
   ===================================================================== */
.overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(6px);
  z-index: 250;
  opacity: 0;
  transition: opacity var(--t2);
}
.overlay.open { display: block; opacity: 1; }

/* =====================================================================
   MAIN WRAP
   ===================================================================== */
.main-wrap {
  flex: 1;
  min-width: 0;
  max-width: 100vw;
  overflow-x: clip;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--t3) var(--ease);
}

/* =====================================================================
   TOPBAR
   ===================================================================== */
.topbar {
  position: sticky; top: 0; z-index: 200;
  display: flex; align-items: center; gap: 16px;
  height: 60px; padding: 0 24px;
  background: rgba(11,14,24,.8);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.topbar-menu-btn {
  display: none;
  align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  transition: all var(--t1);
}
.topbar-menu-btn:hover { background: var(--bg-hover); color: var(--text-1); }

.topbar-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px;
}
.breadcrumb-item { color: var(--text-3); font-weight: 400; }
.breadcrumb-sep { color: var(--text-4); }
.breadcrumb-current { color: var(--text-1); font-weight: 600; }

.topbar-controls {
  display: flex; align-items: center; gap: 12px;
  margin-left: auto;
}

/* Period group */
.period-group {
  display: inline-flex;
  background: var(--bg-overlay);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-md);
  padding: 3px;
  gap: 2px;
}
.period-btn {
  height: 28px; padding: 0 11px;
  border-radius: var(--r-sm);
  font-size: 12px; font-weight: 500;
  color: var(--text-3);
  transition: all var(--t2) var(--ease);
  white-space: nowrap;
}
.period-btn:hover { color: var(--text-1); background: var(--bg-hover); }
.period-btn.active {
  background: var(--indigo-500);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 12px rgba(99,102,241,.3);
}

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

/* =====================================================================
   PAGE BASE
   ===================================================================== */
.page {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: 28px 24px 60px;
  animation: pageIn var(--t3) var(--ease) both;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.page-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .10em;
  text-transform: uppercase; color: var(--indigo-400);
  margin-bottom: 4px;
}
.page-h1 {
  font-size: clamp(22px, 2.5vw, 28px);
  font-weight: 800; letter-spacing: -.04em;
  color: var(--text-1); line-height: 1.1;
}
.page-head-actions {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}

/* =====================================================================
   GLASS PANELS
   ===================================================================== */
.glass-panel {
  background: rgba(21,26,40,.7);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-xl);
  backdrop-filter: blur(16px) saturate(140%);
  padding: 22px;
  margin-bottom: 16px;
  transition: border-color var(--t2), box-shadow var(--t2);
}
.glass-panel:hover {
  border-color: var(--border-base);
}
.glass-panel.p-0 { padding: 0; overflow: hidden; }

.panel-head {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 16px;
  margin-bottom: 18px;
}
.panel-eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: .10em;
  text-transform: uppercase; color: var(--text-3);
  margin-bottom: 3px;
}
.panel-title {
  font-size: 15px; font-weight: 600; letter-spacing: -.025em;
  color: var(--text-1);
}
.panel-more-link {
  font-size: 12px; font-weight: 600;
  color: var(--indigo-400);
  transition: color var(--t1);
  white-space: nowrap; padding-top: 2px;
}
.panel-more-link:hover { color: var(--indigo-500); }

.panel-status {
  font-size: 12.5px; color: var(--text-3);
  padding: 10px 22px 14px;
  min-height: 1.2em;
}
.panel-status.error   { color: var(--red); }
.panel-status.success { color: var(--green); }

/* =====================================================================
   BALANCE HERO
   ===================================================================== */
.balance-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  padding: 36px 36px 32px;
  margin-bottom: 22px;
  background: linear-gradient(135deg,
    rgba(67,56,202,.25) 0%,
    rgba(30,27,75,.45) 40%,
    rgba(16,20,31,.75) 100%
  );
  border: 1px solid rgba(99,102,241,.28);
  box-shadow: 0 8px 32px rgba(0,0,0,.45), 0 0 40px rgba(99,102,241,.12);
  backdrop-filter: blur(16px);
  transition: border-color var(--t3), box-shadow var(--t3);
}
.balance-hero:hover {
  border-color: rgba(99,102,241,.4);
  box-shadow: 0 12px 48px rgba(0,0,0,.5), 0 0 60px rgba(99,102,241,.18);
}

.balance-hero-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg,
      rgba(7, 9, 15, 0.96) 0%,
      rgba(7, 9, 15, 0.88) 32%,
      rgba(7, 9, 15, 0.45) 60%,
      rgba(7, 9, 15, 0.15) 85%,
      rgba(7, 9, 15, 0.05) 100%
    ),
    url('/assets/hero-cosmos.webp');
  background-size: cover;
  background-position: right center;
  opacity: 0.82;
  pointer-events: none;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
}

.balance-hero:hover .balance-hero-bg {
  transform: scale(1.02);
  opacity: 0.92;
}

.balance-hero-content { position: relative; z-index: 2; }

.balance-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.balance-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--indigo-400);
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  background: rgba(99,102,241,.12);
  border: 1px solid rgba(99,102,241,.25);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
  color: var(--indigo-400);
  backdrop-filter: blur(8px);
}
.chip-status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulseDot 2s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .4; transform: scale(.85); }
}

.balance-amount-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.balance-amount {
  font-size: clamp(38px, 5.5vw, 60px);
  font-weight: 900;
  letter-spacing: -.05em;
  color: var(--text-1);
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 20px rgba(0,0,0,.6);
  transition: all var(--t3) var(--ease);
}
.balance-amount.positive {
  color: #F1F5F9;
  text-shadow: 0 0 30px rgba(52,211,153,.25);
}
.balance-amount.negative {
  color: var(--red);
  text-shadow: 0 0 30px rgba(248,113,113,.25);
}

.balance-trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  letter-spacing: .02em;
  backdrop-filter: blur(8px);
  transition: all var(--t2);
}
.balance-trend-badge.positive {
  background: rgba(52,211,153,.12);
  color: var(--green);
  border: 1px solid rgba(52,211,153,.3);
  box-shadow: 0 0 14px rgba(52,211,153,.15);
}
.balance-trend-badge.negative {
  background: rgba(248,113,113,.12);
  color: var(--red);
  border: 1px solid rgba(248,113,113,.3);
  box-shadow: 0 0 14px rgba(248,113,113,.15);
}
.balance-trend-badge.neutral {
  background: var(--indigo-100);
  color: var(--indigo-400);
  border: 1px solid var(--border-base);
}

.balance-sub {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.balance-quick-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.balance-orb {
  position: absolute;
  right: -50px; top: -50px;
  width: 250px; height: 250px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(99,102,241,.22) 0%,
    rgba(129,140,248,.08) 50%,
    transparent 72%
  );
  pointer-events: none;
  filter: blur(12px);
  animation: orbFloat 9s ease-in-out infinite;
}
@keyframes orbFloat {
  0%, 100% { transform: translateY(0) scale(1) rotate(0deg); }
  50%      { transform: translateY(-16px) scale(1.06) rotate(45deg); }
}

/* =====================================================================
   KPI CARDS
   ===================================================================== */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.kpi-card {
  position: relative;
  overflow: hidden;
  padding: 22px 20px;
  background: linear-gradient(145deg, rgba(25,32,50,.72) 0%, rgba(14,18,30,.82) 100%);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-xl);
  backdrop-filter: blur(16px);
  transition: transform var(--t2) var(--ease), border-color var(--t2), box-shadow var(--t2);
  cursor: default;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2.5px;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  opacity: .8;
  transition: opacity var(--t2);
}
.kpi-card.income::before  { background: linear-gradient(90deg, var(--green), #6EE7B7); }
.kpi-card.expense::before { background: linear-gradient(90deg, var(--red), #FCA5A5); }
.kpi-card.balance::before { background: linear-gradient(90deg, var(--indigo-400), var(--purple)); }

.kpi-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-base);
}
.kpi-card.income:hover {
  box-shadow: 0 10px 36px rgba(0,0,0,.45), 0 0 28px rgba(52,211,153,.15);
  border-color: rgba(52,211,153,.35);
}
.kpi-card.expense:hover {
  box-shadow: 0 10px 36px rgba(0,0,0,.45), 0 0 28px rgba(248,113,113,.15);
  border-color: rgba(248,113,113,.35);
}
.kpi-card.balance:hover {
  box-shadow: 0 10px 36px rgba(0,0,0,.45), 0 0 28px rgba(99,102,241,.2);
  border-color: rgba(99,102,241,.4);
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.kpi-icon {
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  transition: transform var(--t2) var(--ease);
}
.kpi-card:hover .kpi-icon { transform: scale(1.08); }
.kpi-card.income  .kpi-icon {
  background: rgba(52,211,153,.12);
  color: var(--green);
  border: 1px solid rgba(52,211,153,.25);
  box-shadow: 0 0 14px rgba(52,211,153,.12);
}
.kpi-card.expense .kpi-icon {
  background: rgba(248,113,113,.12);
  color: var(--red);
  border: 1px solid rgba(248,113,113,.25);
  box-shadow: 0 0 14px rgba(248,113,113,.12);
}
.kpi-card.balance .kpi-icon {
  background: var(--indigo-100);
  color: var(--indigo-400);
  border: 1px solid rgba(129,140,248,.25);
  box-shadow: 0 0 14px rgba(99,102,241,.15);
}

.kpi-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: .02em;
}
.kpi-card.income  .kpi-badge { background: rgba(52,211,153,.10); color: var(--green); }
.kpi-card.expense .kpi-badge { background: rgba(248,113,113,.10); color: var(--red); }
.kpi-card.balance .kpi-badge { background: var(--indigo-50);    color: var(--indigo-400); }

.kpi-label {
  font-size: 12px; font-weight: 500; color: var(--text-2);
  margin-bottom: 6px; letter-spacing: .03em;
  text-transform: uppercase;
}
.kpi-value {
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 800; letter-spacing: -.04em;
  color: var(--text-1); line-height: 1.1;
  font-variant-numeric: tabular-nums;
  margin-bottom: 8px;
}
.kpi-card.income  .kpi-value { color: var(--green); }
.kpi-card.expense .kpi-value { color: var(--red); }

.kpi-note {
  font-size: 11.5px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 4px;
}

.kpi-bar {
  height: 4px;
  background: var(--bg-overlay);
  border-radius: 2px;
  margin-top: 12px;
  overflow: hidden;
}
.kpi-bar-fill {
  height: 100%;
  border-radius: inherit;
  transition: width .6s var(--ease-out);
}
.kpi-card.income  .kpi-bar-fill { background: var(--green); }
.kpi-card.expense .kpi-bar-fill { background: var(--red); }
.kpi-card.balance .kpi-bar-fill { background: linear-gradient(90deg, var(--indigo-500), var(--purple)); }

/* =====================================================================
   DASHBOARD GRID
   ===================================================================== */
.dash-grid {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: 18px;
}

/* Chart tabs */
.chart-tabs {
  display: flex;
  background: var(--bg-overlay);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-md);
  padding: 3px;
  gap: 3px;
}
.chart-tab {
  height: 28px; padding: 0 13px;
  border-radius: var(--r-sm);
  font-size: 12px; font-weight: 600;
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  transition: all var(--t2);
}
.chart-tab:hover { color: var(--text-1); background: var(--bg-hover); }
.chart-tab.active {
  background: var(--indigo-600);
  color: #fff;
  box-shadow: 0 0 12px rgba(79,70,229,.4);
}

.chart-wrap {
  position: relative;
  height: 260px;
  margin-bottom: 14px;
}
.main-chart { width: 100% !important; height: 100% !important; }

.chart-panel-main {
  padding: 24px;
  display: flex;
  flex-direction: column;
}

/* Category legend */
.category-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}
.category-legend::-webkit-scrollbar { width: 4px; }
.category-legend::-webkit-scrollbar-thumb { background: var(--border-base); border-radius: 4px; }

.legend-item {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  padding: 5px 8px;
  border-radius: var(--r-sm);
  transition: background var(--t1);
}
.legend-item:hover { background: var(--bg-hover); }

.legend-name {
  color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: flex; align-items: center;
  font-weight: 500;
}
.legend-dot {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
  display: inline-block; margin-right: 8px;
  box-shadow: 0 0 6px currentColor;
}
.legend-track {
  height: 5px;
  background: var(--bg-overlay);
  border-radius: 3px;
  overflow: hidden;
}
.legend-bar { height: 100%; border-radius: inherit; transition: width .6s var(--ease-out); }
.legend-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.legend-val {
  font-weight: 700;
  color: var(--text-1);
  white-space: nowrap;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.legend-pct {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  min-width: 34px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* =====================================================================
   RECENT FEED
   ===================================================================== */
.recent-panel {
  padding: 24px;
  display: flex;
  flex-direction: column;
}
.recent-feed {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.feed-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: rgba(255,255,255,.015);
  border: 1px solid transparent;
  transition: all var(--t2) var(--ease);
  cursor: default;
}
.feed-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-dim);
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}

.feed-icon-wrap {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.feed-icon-wrap.income {
  background: rgba(52,211,153,.12);
  color: var(--green);
  border: 1px solid rgba(52,211,153,.2);
}
.feed-icon-wrap.expense {
  background: rgba(248,113,113,.12);
  color: var(--red);
  border: 1px solid rgba(248,113,113,.2);
}

.feed-info { flex: 1; min-width: 0; }
.feed-cat-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.feed-cat {
  font-size: 13px; font-weight: 600; color: var(--text-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.feed-author-pill {
  font-size: 10px; font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--indigo-50);
  color: var(--indigo-400);
  border: 1px solid var(--border-subtle);
}
.feed-desc {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.feed-meta {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

.feed-amount {
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.feed-amount.income  { color: var(--green); }
.feed-amount.expense { color: var(--red); }

.feed-empty-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  text-align: center;
  color: var(--text-3);
}
.feed-empty-icon {
  margin-bottom: 12px;
  opacity: .5;
}

/* =====================================================================
   OPERATIONS SEARCH & FILTER
   ===================================================================== */
.search-wrap {
  position: relative;
}
.search-icon {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}
.search-input {
  height: 36px;
  width: 200px;
  padding: 0 12px 0 30px;
  background: var(--bg-overlay);
  border: 1px solid var(--border-base);
  border-radius: var(--r-md);
  color: var(--text-1);
  font-size: 13px;
  transition: all var(--t2);
}
.search-input::placeholder { color: var(--text-4); }
.search-input:focus { outline: none; border-color: var(--indigo-500); box-shadow: 0 0 0 3px var(--indigo-100); width: 240px; }

.filter-select-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-3);
}
.filter-select {
  height: 36px;
  padding: 0 28px 0 10px;
  background: var(--bg-overlay);
  border: 1px solid var(--border-base);
  border-radius: var(--r-md);
  color: var(--text-2);
  font-size: 12.5px;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 11 11' fill='none'%3E%3Cpath d='M2 4l3.5 3.5L9 4' stroke='%23464F61' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color var(--t2);
  cursor: pointer;
}
.filter-select:focus { outline: none; border-color: var(--indigo-500); }

/* =====================================================================
   TABLES
   ===================================================================== */
.table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
}

.data-table thead {
  background: var(--bg-overlay);
  border-bottom: 1px solid var(--border-dim);
  position: sticky; top: 0; z-index: 1;
}

.data-table th {
  padding: 11px 16px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-3);
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  padding: 13px 16px;
  color: var(--text-2);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background var(--t1); }
.data-table tbody tr:hover { background: rgba(255,255,255,.025); }

/* Type badge */
.type-chip {
  display: inline-flex;
  align-items: center; gap: 5px;
  padding: 4px 9px;
  border-radius: 20px;
  font-size: 11.5px; font-weight: 600;
  white-space: nowrap;
}
.type-chip.income  { background: var(--green-dim); color: var(--green); }
.type-chip.expense { background: var(--red-dim);   color: var(--red); }

/* Amount */
.td-amount { font-weight: 700; white-space: nowrap; font-size: 13.5px; }
.td-amount.income  { color: var(--green); }
.td-amount.expense { color: var(--red); }

/* Description */
.td-desc {
  max-width: 180px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12.5px; color: var(--text-3);
}

/* Author */
.td-author { white-space: nowrap; }
.author-main { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.author-legacy {
  display: inline-block; padding: 2px 7px;
  border-radius: 5px; background: var(--bg-overlay);
  color: var(--text-3); font-size: 11px;
}
.author-updated { font-size: 10.5px; color: var(--text-3); margin-top: 2px; }

/* Timestamp */
.td-time { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3); white-space: nowrap; }

/* Short ID */
.short-id { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }

/* Actions cell */
.td-actions {
  white-space: nowrap;
  display: flex; gap: 5px; align-items: center;
}

.tbl-btn {
  display: inline-flex; align-items: center;
  gap: 4px; height: 28px; padding: 0 9px;
  border-radius: var(--r-xs);
  font-size: 11.5px; font-weight: 500;
  color: var(--text-2);
  border: 1px solid var(--border-dim);
  transition: all var(--t1);
  white-space: nowrap;
}
.tbl-btn:hover { background: var(--bg-hover); color: var(--text-1); border-color: var(--border-base); }
.tbl-btn.d  { color: var(--red);   border-color: rgba(248,113,113,.18); }
.tbl-btn.d:hover { background: var(--red-dim); border-color: rgba(248,113,113,.4); }
.tbl-btn.ok { color: var(--green); border-color: rgba(52,211,153,.18); }
.tbl-btn.ok:hover { background: var(--green-dim); border-color: rgba(52,211,153,.4); }

/* Edit row */
.edit-row td { background: rgba(255,255,255,.02); }
.edit-row input, .edit-row select {
  width: 100%; min-width: 72px;
  height: 30px; padding: 0 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-base);
  border-radius: var(--r-xs);
  color: var(--text-1); font-size: 12.5px;
  transition: border-color var(--t1);
  -webkit-appearance: none; appearance: none;
}
.edit-row input:focus, .edit-row select:focus {
  outline: none; border-color: var(--indigo-500);
}

/* Audit badges */
.audit-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.ab-create  { background: var(--green-dim);  color: var(--green); }
.ab-update  { background: var(--sky-dim);    color: var(--sky); }
.ab-delete  { background: var(--red-dim);    color: var(--red); }
.ab-restore { background: var(--purple-dim); color: var(--purple); }

.audit-table-wrap { max-height: 680px; overflow-y: auto; }

.audit-details { font-size: 12px; line-height: 1.6; color: var(--text-2); }

/* Role pills */
.role-pill {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.role-admin  { background: var(--purple-dim); color: var(--purple); }
.role-member { background: var(--sky-dim);    color: var(--sky); }
.role-viewer { background: var(--amber-dim);  color: var(--amber); }

/* Status badge */
.status-pill {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.status-active   { background: var(--green-dim);    color: var(--green); }
.status-inactive { background: var(--bg-overlay);   color: var(--text-3); }

/* =====================================================================
   EMPTY STATE
   ===================================================================== */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px;
  padding: 60px 32px;
  text-align: center;
}
.empty-img {
  width: 144px; height: 144px;
  border-radius: 50%;
  object-fit: cover;
  opacity: .95;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 32px rgba(56, 189, 248, 0.22), 0 0 64px rgba(245, 158, 11, 0.14);
  animation: cosmic-float 6s ease-in-out infinite;
}
@keyframes cosmic-float {
  0%, 100% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(-7px) scale(1.02); }
}
.empty-title {
  font-size: 16px; font-weight: 600;
  color: var(--text-1);
  text-shadow: 0 0 12px rgba(255,255,255,0.15);
}
.empty-sub {
  font-size: 13px; color: var(--text-3);
  max-width: 320px; line-height: 1.5;
}

/* AI Neural Banner in page-add */
.ai-neural-banner {
  position: relative;
  width: 100%;
  height: 140px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 16px;
  background: #080b13;
  border: 1px solid rgba(99, 102, 241, 0.30);
  box-shadow: 0 10px 32px -6px rgba(0, 0, 0, 0.65), 0 0 35px rgba(56, 189, 248, 0.12);
}
.ai-neural-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right 45%;
  image-rendering: -webkit-optimize-contrast;
  filter: brightness(1.02) contrast(1.08);
  transition: transform 0.6s var(--ease-spring);
}
.ai-neural-banner:hover .ai-neural-img {
  transform: scale(1.025);
}
.ai-neural-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px 20px;
  background:
    linear-gradient(90deg, rgba(7, 10, 19, 0.88) 0%, rgba(7, 10, 19, 0.52) 42%, rgba(7, 10, 19, 0.05) 72%, transparent 100%),
    linear-gradient(0deg, rgba(7, 10, 19, 0.65) 0%, transparent 60%);
  pointer-events: none;
}
.ai-neural-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #38bdf8;
  margin-bottom: 4px;
}
.ai-neural-subtitle {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.4;
  max-width: 460px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
}

.topbar-landing-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--indigo-400);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--r-sm);
  text-decoration: none;
  transition: background var(--t1), border-color var(--t1), color var(--t1);
}
.topbar-landing-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
  color: #ffffff;
}

/* =====================================================================
   ADD OPERATION PAGE
   ===================================================================== */
.add-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

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

.ai-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px;
  background: var(--indigo-100);
  border: 1px solid var(--indigo-200);
  font-size: 11px; font-weight: 700;
  color: var(--indigo-400);
  letter-spacing: .04em;
  flex-shrink: 0;
}

.form-desc {
  font-size: 13px; color: var(--text-3);
  line-height: 1.55; margin-bottom: 20px;
}

/* Type toggle */
.type-toggle {
  display: flex; gap: 4px;
  background: var(--bg-overlay);
  border: 1px solid var(--border-base);
  border-radius: var(--r-md);
  padding: 3px;
}
.type-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  height: 34px; padding: 0 10px;
  border-radius: var(--r-sm);
  font-size: 12.5px; font-weight: 500;
  color: var(--text-3);
  transition: all var(--t2) var(--ease);
}
.type-btn:hover { color: var(--text-1); background: var(--bg-hover); }
.type-btn.active[data-type="income"]  {
  background: var(--green-dim);
  color: var(--green); font-weight: 600;
  box-shadow: 0 0 10px rgba(52,211,153,.12);
}
.type-btn.active[data-type="expense"] {
  background: var(--red-dim);
  color: var(--red); font-weight: 600;
  box-shadow: 0 0 10px rgba(248,113,113,.1);
}

/* =====================================================================
   TEAM PAGE
   ===================================================================== */
.team-cols {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 16px; align-items: start;
}

/* Token card */
.token-card {
  margin-top: 20px;
  padding: 16px;
  background: rgba(99,102,241,.06);
  border: 1px solid rgba(99,102,241,.18);
  border-radius: var(--r-lg);
}
.token-card-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.token-badge {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--green);
}
.token-warn {
  display: flex; align-items: flex-start; gap: 7px;
  font-size: 12.5px; color: var(--amber);
  margin-bottom: 12px; line-height: 1.5;
}
.token-warn svg { flex-shrink: 0; margin-top: 1px; }
.token-copy-row { display: flex; gap: 8px; }
.token-input {
  flex: 1; min-width: 0;
  height: 36px; padding: 0 11px;
  background: var(--bg-overlay);
  border: 1px solid var(--border-base);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 11.5px; color: var(--text-1);
  letter-spacing: .03em;
}

/* =====================================================================
   MODAL
   ===================================================================== */
.modal-wrap {
  position: fixed; inset: 0; z-index: 800;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-scrim {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(8px);
}
.modal-box {
  position: relative; z-index: 1;
  width: 100%; max-width: 740px; max-height: 88vh;
  display: flex; flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border-base);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,.03);
  overflow: hidden;
  animation: modalIn var(--t3) var(--ease-spring);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.93) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-head {
  display: flex; align-items: flex-start;
  justify-content: space-between;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--border-dim);
  flex-shrink: 0;
}
.modal-title {
  font-size: 17px; font-weight: 700;
  letter-spacing: -.03em; color: var(--text-1);
  margin-top: 4px;
}
.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
}

/* =====================================================================
   SCROLLBAR
   ===================================================================== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-active); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* =====================================================================
   SKELETON LOADING
   ===================================================================== */
.skeleton {
  background: linear-gradient(90deg,
    var(--bg-hover) 25%, var(--bg-active) 50%, var(--bg-hover) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { to { background-position: -200% center; } }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1400px) {
  .page { padding: 22px 18px 50px; }
}
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: 1fr; }
  .team-cols { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .add-cols { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
  .login-hero-panel { display: none; }
  .login-form-panel { width: 100%; }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 240px; }
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }
  .main-wrap { margin-left: 0 !important; }
  .topbar-menu-btn { display: flex; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar-controls { gap: 6px; }
  .period-group { display: none; }
  .topbar-avatar-wrap { display: none; }
  .topbar-landing-btn { display: none; }
  .topbar-spotlight-btn span { display: none; }
  .topbar-spotlight-btn { padding: 5px 8px; font-size: 11px; }
  .page { padding: 18px 14px 50px; }
  .glass-panel { padding: 16px; }
  .balance-hero { padding: 28px 22px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .page-head-actions { flex-wrap: wrap; gap: 6px; }
  .search-input, .search-input:focus { width: 100%; }
}
@media (max-width: 480px) {
  .balance-hero { padding: 18px 14px; }
  .balance-hero-top { flex-direction: column; align-items: flex-start; gap: 8px; }
  .kpi-row { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .token-copy-row { flex-direction: column; }
  .data-table th:nth-child(6),
  .data-table td:nth-child(6) { display: none; }
  .ai-neural-banner { height: 128px; }
  .ai-neural-img { object-position: right 40%; }
  .ai-neural-overlay {
    padding: 10px 14px;
    background:
      linear-gradient(90deg, rgba(7, 10, 19, 0.94) 0%, rgba(7, 10, 19, 0.72) 55%, rgba(7, 10, 19, 0.15) 100%),
      linear-gradient(0deg, rgba(7, 10, 19, 0.70) 0%, transparent 60%);
  }
  .ai-neural-subtitle { font-size: 11px; line-height: 1.35; max-width: 100%; }
  .balance-hero-bg {
    background-image:
      linear-gradient(180deg,
        rgba(7, 9, 15, 0.94) 0%,
        rgba(7, 9, 15, 0.80) 50%,
        rgba(7, 9, 15, 0.35) 100%
      ),
      url('/assets/hero-cosmos.webp');
    background-position: center right;
  }
}

/* =====================================================================
   UTILITIES
   ===================================================================== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* =====================================================================
   MULTICURRENCY & BRAND MARK ENHANCEMENTS
   ===================================================================== */

/* Brand mark image */
.brand-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  border: 1.5px solid rgba(129, 140, 248, 0.45);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.4);
  transition: transform var(--t2), box-shadow var(--t2);
}
.brand-mark:hover .brand-img,
.brand-mark-sm:hover .brand-img {
  transform: scale(1.05);
  box-shadow: 0 0 22px rgba(129, 140, 248, 0.65);
}
.brand-mark { width: 36px; height: 36px; }
.brand-mark-sm { width: 28px; height: 28px; }

/* Hero currency switcher */
.hero-curr-tabs {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: var(--r-full);
  padding: 3px;
  gap: 3px;
  backdrop-filter: blur(12px);
}
.hero-curr-tab {
  height: 26px;
  padding: 0 12px;
  border-radius: var(--r-full);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-3);
  transition: all var(--t2) var(--ease);
  letter-spacing: 0.02em;
}
.hero-curr-tab:hover {
  color: var(--text-1);
  background: rgba(255, 255, 255, 0.06);
}
.hero-curr-tab.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.85), rgba(79, 70, 229, 0.95));
  color: #fff;
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.45);
}
.hero-curr-tab.active[data-currency="TRY"] {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.85), rgba(185, 28, 28, 0.95));
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.45);
}

/* Multicurrency KPI Cards */
.kpi-card.currency-kpi {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  padding: 20px 22px;
  transition: all var(--t2) var(--ease);
}
.kpi-card.currency-kpi:hover {
  transform: translateY(-3px);
  border-color: var(--border-base);
  box-shadow: var(--shadow-md);
}
.kpi-card.currency-kpi.primary-try {
  border-color: rgba(239, 68, 68, 0.35);
  background: linear-gradient(145deg, rgba(30, 27, 46, 0.85), rgba(20, 15, 30, 0.92));
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.15), var(--shadow-md);
}
.kpi-card.currency-kpi.primary-try:hover {
  border-color: rgba(239, 68, 68, 0.55);
  box-shadow: 0 0 32px rgba(239, 68, 68, 0.25), var(--shadow-lg);
}
.kpi-card.currency-kpi.active {
  border-color: var(--cyan);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.25), var(--shadow-md);
}
.kpi-card.currency-kpi.primary-try.active {
  border-color: rgba(239, 68, 68, 0.85);
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.3), var(--shadow-md);
}
.currency-flag-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: var(--r-full);
}
.currency-flag-badge.try-badge {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.currency-flag-badge.rub-badge {
  background: rgba(99, 102, 241, 0.15);
  color: #818CF8;
  border: 1px solid rgba(99, 102, 241, 0.3);
}
.currency-flag-badge.usd-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.currency-kpi-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}
.currency-kpi-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 2px;
}
.currency-kpi-sub-val {
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--font-mono);
}
.currency-kpi-sub-val.inc { color: var(--green); }
.currency-kpi-sub-val.exp { color: var(--red); }

/* Chart currency filter */
.chart-controls-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.chart-curr-filter {
  display: inline-flex;
  background: var(--bg-overlay);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-md);
  padding: 3px;
  gap: 2px;
}
.chart-curr-pill {
  height: 26px;
  padding: 0 9px;
  border-radius: var(--r-sm);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  transition: all var(--t1);
}
.chart-curr-pill:hover {
  color: var(--text-1);
  background: var(--bg-hover);
}
.chart-curr-pill.active {
  background: var(--indigo-500);
  color: #fff;
  font-weight: 600;
}

/* Currency toggle in manual form */
.currency-toggle {
  display: flex;
  gap: 4px;
  background: var(--bg-overlay);
  border: 1px solid var(--border-base);
  border-radius: var(--r-md);
  padding: 3px;
}
.curr-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 8px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  transition: all var(--t2) var(--ease);
}
.curr-btn:hover {
  color: var(--text-1);
  background: var(--bg-hover);
}
.curr-btn.active {
  background: var(--indigo-500);
  color: #fff;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.35);
}
.curr-btn.active[data-currency="TRY"] {
  background: rgba(239, 68, 68, 0.85);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.35);
}

/* Currency tags */
.currency-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--r-xs);
  letter-spacing: 0.03em;
}
.currency-tag.tag-try {
  background: rgba(239, 68, 68, 0.12);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}
.currency-tag.tag-rub {
  background: rgba(99, 102, 241, 0.12);
  color: #818CF8;
  border: 1px solid rgba(99, 102, 241, 0.25);
}
.currency-tag.tag-usd {
  background: rgba(16, 185, 129, 0.12);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

/* Preview cards */
.phrase-preview-wrap {
  margin-top: 18px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--r-lg);
  backdrop-filter: blur(12px);
  animation: fadeIn var(--t2) var(--ease);
}
.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.preview-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-1);
}
.preview-count {
  font-size: 11px;
  color: var(--indigo-400);
  background: rgba(99, 102, 241, 0.15);
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-weight: 600;
}
.preview-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.preview-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-base);
  border-radius: var(--r-md);
  padding: 12px 14px;
  transition: border-color var(--t1);
}
.preview-card:hover {
  border-color: var(--border-strong);
}
.preview-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.preview-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.preview-card-body {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.preview-amt {
  font-size: 17px;
  font-weight: 800;
  font-family: var(--font-mono);
}
.preview-amt.income { color: var(--green); }
.preview-amt.expense { color: var(--red); }
.preview-desc {
  font-size: 12.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.preview-edit-link {
  font-size: 11.5px;
  color: var(--indigo-400);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--r-xs);
  transition: background var(--t1);
}
.preview-edit-link:hover {
  background: rgba(99, 102, 241, 0.15);
  color: #fff;
}
.preview-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* =====================================================================
   AI MONEY ASSISTANT (COMMAND CENTER)
   ===================================================================== */
.ai-quick-prompts {
  margin: 12px 0 16px;
}
.quick-prompts-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  margin-bottom: 8px;
}
.ai-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ai-prompt-chip {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--indigo-300, #a5b4fc);
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--r-full);
  cursor: pointer;
  transition: all var(--t2) var(--ease);
  font-family: inherit;
  white-space: nowrap;
}
.ai-prompt-chip:hover {
  background: rgba(99, 102, 241, 0.22);
  border-color: rgba(129, 140, 248, 0.5);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.25);
}

/* AI Loading Box */
.ai-loading-box {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--r-lg);
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(99, 102, 241, 0.3);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fadeIn var(--t2) var(--ease);
}
.ai-loading-spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(99, 102, 241, 0.2);
  border-top-color: var(--indigo-400);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
.ai-loading-text {
  font-size: 13px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* AI Financial Answer Box */
.ai-answer-box {
  margin-top: 18px;
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85), rgba(30, 27, 75, 0.7));
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--r-lg);
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 0 24px rgba(99, 102, 241, 0.15);
  animation: fadeIn var(--t2) var(--ease);
}
.ai-answer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 10px;
}
.ai-answer-badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--cyan);
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 2px 7px;
  border-radius: var(--r-full);
  display: inline-block;
  margin-bottom: 4px;
}
.ai-answer-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
  margin: 0;
}
.ai-close-btn {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--r-xs);
  transition: color var(--t1);
}
.ai-close-btn:hover {
  color: var(--text-1);
}
.ai-answer-hero {
  margin: 12px 0 14px;
}
.ai-answer-metric {
  font-size: 32px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #fff;
  letter-spacing: -0.02em;
  text-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}
.ai-answer-subtitle {
  font-size: 12.5px;
  color: var(--text-2);
  margin-top: 4px;
}
.ai-answer-text {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-2);
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--r-md);
  padding: 10px 14px;
  margin-bottom: 14px;
  border-left: 3px solid var(--indigo-500);
}
.ai-answer-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.ai-answer-detail-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--r-md);
  padding: 8px 10px;
}
.ai-answer-detail-label {
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 3px;
}
.ai-answer-detail-value {
  font-size: 13.5px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-1);
}
.ai-answer-ops-wrap {
  margin-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 10px;
}
.ai-answer-ops-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-3);
  margin-bottom: 8px;
}
.ai-answer-ops-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ai-mini-op-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--r-sm);
  font-size: 12px;
}
.ai-mini-op-cat {
  color: var(--text-1);
  font-weight: 500;
}
.ai-mini-op-amt {
  font-weight: 700;
  font-family: var(--font-mono);
}
.ai-mini-op-amt.income { color: var(--green); }
.ai-mini-op-amt.expense { color: var(--red); }

/* AI Clarification Box */
.ai-clarify-box {
  margin-top: 16px;
  padding: 16px 18px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--r-lg);
  backdrop-filter: blur(12px);
  animation: fadeIn var(--t2) var(--ease);
}
.ai-clarify-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.ai-clarify-title {
  font-size: 13px;
  font-weight: 700;
  color: #FCD34D;
  flex: 1;
}
.ai-clarify-body {
  font-size: 13px;
  color: var(--text-1);
  line-height: 1.5;
}


/* =====================================================================
   ACCESSIBILITY & REDUCED MOTION
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .stars-canvas {
    display: none !important;
  }
  .ai-neural-video,
  .landing-hero-video {
    display: none !important;
  }
  .landing-hero-video-wrap {
    background: url('/assets/hero-cosmos.webp') center/cover no-repeat !important;
  }
  .ai-neural-img {
    display: block !important;
    transform: none !important;
  }
  .balance-orb {
    animation: none !important;
  }
  .chip-status-dot,
  .badge-dot {
    animation: none !important;
  }
}

/* Mobile Data-Saver Video Strategy (<= 768px) */
@media (max-width: 768px) {
  .landing-hero-video {
    display: none !important;
  }
  .landing-hero-video-wrap {
    background: url('/assets/hero-cosmos.webp') center/cover no-repeat;
  }
}

@media (max-width: 480px) {
  .ai-neural-video {
    display: none !important;
  }
  .ai-neural-img {
    display: block !important;
  }
}

/* =====================================================================
   FINTECH 3.0 SUPER-UPGRADE: SPOTLIGHT, VOICE, BUDGETS & EXPORT
   ===================================================================== */

/* Topbar Spotlight Button */
.topbar-spotlight-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.12));
  border: 1px solid rgba(129, 140, 248, 0.3);
  color: var(--indigo-300);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t2);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.15);
}
.topbar-spotlight-btn:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.28), rgba(168, 85, 247, 0.22));
  border-color: rgba(129, 140, 248, 0.6);
  color: #fff;
  box-shadow: 0 0 20px rgba(129, 140, 248, 0.35);
  transform: translateY(-1px);
}
.shortcut-key {
  display: inline-block;
  padding: 1px 6px;
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: #c7d2fe;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

/* Dashboard Cosmic AI Command Bar */
.dashboard-ai-bar {
  margin-bottom: 20px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(22, 27, 46, 0.85) 0%, rgba(13, 17, 32, 0.9) 100%);
  border: 1px solid rgba(129, 140, 248, 0.25);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.dash-ai-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(10, 13, 26, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--r-md);
  padding: 6px 10px 6px 14px;
  transition: all var(--t2);
}
.dash-ai-inner:focus-within {
  border-color: rgba(129, 140, 248, 0.6);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.25);
}
.dash-ai-icon-wrap {
  display: flex;
  align-items: center;
  color: var(--indigo-400);
}
.dash-ai-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
.dash-ai-input::placeholder {
  color: var(--text-3);
}
.dash-ai-submit-btn {
  white-space: nowrap;
}
.dash-ai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.ai-chip {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-full);
  padding: 4px 12px;
  font-size: 11px;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--t2);
}
.ai-chip:hover {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(129, 140, 248, 0.4);
  color: #fff;
  transform: translateY(-1px);
}
.dash-ai-result {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Smart Financial Budgets Panel */
.budgets-panel {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(20, 24, 40, 0.8), rgba(12, 15, 28, 0.88));
}
.budgets-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.budgets-curr-tabs {
  display: flex;
  background: var(--bg-overlay);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-sm);
  padding: 2px;
  gap: 2px;
}
.budget-curr-tab {
  height: 24px;
  padding: 0 8px;
  border-radius: var(--r-xs);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  cursor: pointer;
  transition: all var(--t2);
}
.budget-curr-tab:hover { color: var(--text-1); }
.budget-curr-tab.active {
  background: var(--indigo-600);
  color: #fff;
}
.budgets-overview {
  margin: 14px 0 20px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: rgba(10, 13, 26, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.budget-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 8px;
}
.budget-overall-stat {
  font-family: var(--font-mono);
  color: var(--indigo-300);
}
.budget-progress-bar-bg {
  width: 100%;
  height: 8px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.budget-progress-bar-fill {
  height: 100%;
  border-radius: var(--r-full);
  background: linear-gradient(90deg, #10b981, #6366f1);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.budget-progress-bar-fill.warning {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}
.budget-progress-bar-fill.danger {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}
.budget-items-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.budget-item-card {
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: rgba(15, 19, 36, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all var(--t2);
}
.budget-item-card:hover {
  border-color: rgba(129, 140, 248, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}
.budget-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.budget-cat-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-1);
}
.budget-item-badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: var(--r-full);
  font-weight: 700;
  text-transform: uppercase;
}
.budget-item-badge.safe {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.budget-item-badge.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.budget-item-badge.danger {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.budget-item-amounts {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 6px;
}
.budget-item-spent {
  color: var(--text-1);
  font-weight: 600;
}
.budget-item-bar {
  height: 5px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.budget-item-bar-fill {
  height: 100%;
  border-radius: var(--r-full);
  transition: width 0.5s ease;
}
.budget-item-bar-fill.safe { background: #10b981; }
.budget-item-bar-fill.warning { background: #f59e0b; }
.budget-item-bar-fill.danger { background: #ef4444; }

/* Export dropdown */
.export-dropdown-wrap {
  position: relative;
}
.export-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 190px;
  background: rgba(15, 19, 36, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(129, 140, 248, 0.3);
  border-radius: var(--r-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  padding: 6px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.export-menu[hidden] {
  display: none;
}
.export-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  background: transparent;
  border: none;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t2);
  text-align: left;
}
.export-menu-item:hover {
  background: rgba(99, 102, 241, 0.2);
  color: #fff;
}

/* Global AI Spotlight Modal */
.ai-spotlight-wrap {
  align-items: flex-start;
  padding-top: 10vh;
}
.ai-spotlight-box {
  width: 95%;
  max-width: 680px;
  background: rgba(12, 15, 29, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(129, 140, 248, 0.4);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(99, 102, 241, 0.25);
  border-radius: var(--r-lg);
  overflow: hidden;
  padding: 0;
}
.spotlight-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.spotlight-icon {
  display: flex;
  align-items: center;
}
.spotlight-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 16px;
  outline: none;
  font-family: inherit;
}
.spotlight-input::placeholder {
  color: var(--text-3);
}
.spotlight-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.spotlight-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-full);
  padding: 4px 10px;
  font-size: 11px;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--t2);
}
.spotlight-chip:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(129, 140, 248, 0.4);
  color: #fff;
}
.spotlight-body {
  max-height: 55vh;
  overflow-y: auto;
  padding: 16px 20px;
}
.spotlight-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: rgba(8, 10, 20, 0.8);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.spotlight-hint {
  display: flex;
  gap: 14px;
  font-size: 11px;
  color: var(--text-3);
}
.spotlight-brand-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--indigo-400);
}
.budget-modal-box {
  max-width: 520px;
}

/* =====================================================================
   AI MONEY ASSISTANT COMPOSER & IMAGE ATTACHMENT
   ===================================================================== */

.ai-composer-card {
  position: relative;
  background: var(--bg-overlay, rgba(17, 24, 39, 0.7));
  border: 1px solid var(--border-base, rgba(255, 255, 255, 0.08));
  border-radius: var(--r-lg, 14px);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: border-color var(--t2) var(--ease), box-shadow var(--t2) var(--ease), background var(--t2) var(--ease);
  overflow: hidden;
}

.ai-composer-card:focus-within {
  border-color: rgba(129, 140, 248, 0.55);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15), 0 8px 24px rgba(0, 0, 0, 0.35), var(--glow-sm);
}

.ai-composer-card.drag-over {
  border-color: var(--indigo-400);
  background: rgba(99, 102, 241, 0.12);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3), 0 0 20px rgba(99, 102, 241, 0.25);
}

/* Attachment preview card */
.ai-attachment-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 12px 12px 4px 12px;
  padding: 6px 10px 6px 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(129, 140, 248, 0.25);
  border-radius: 10px;
  max-width: calc(100% - 24px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  animation: attach-slide-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes attach-slide-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ai-attachment-thumb-box {
  width: 44px;
  height: 44px;
  border-radius: 7px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-attachment-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ai-attachment-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ai-attachment-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.ai-attachment-size {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--font-mono);
}

.ai-attachment-remove-btn {
  width: 24px;
  height: 24px;
  margin-left: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--t2);
}

.ai-attachment-remove-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  transform: scale(1.05);
}

.ai-attachment-remove-btn:focus-visible {
  outline: 2px solid var(--indigo-400);
  outline-offset: 2px;
}

/* Composer textarea */
.ai-composer-textarea {
  display: block;
  width: 100%;
  padding: 12px 14px 6px 14px;
  background: transparent;
  border: none;
  outline: none;
  box-shadow: none;
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.55;
  font-family: inherit;
  resize: vertical;
  min-height: 76px;
}

.ai-composer-textarea::placeholder {
  color: var(--text-4);
}

/* Composer action bar */
.ai-composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px 10px 12px;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.ai-composer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ai-composer-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Paperclip attach button */
.ai-attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t2);
}

.ai-attach-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(129, 140, 248, 0.35);
  color: #fff;
}

.ai-attach-btn:focus-visible {
  outline: 2px solid var(--indigo-400);
  outline-offset: 2px;
}

.ai-attach-label {
  font-size: 12px;
}

/* Composer submit button */
.ai-composer-submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--r-full);
  white-space: nowrap;
}

.ai-composer-submit-btn:focus-visible {
  outline: 2px solid var(--indigo-400);
  outline-offset: 2px;
}

/* Attachment error / message */
.ai-attachment-msg {
  font-size: 12px;
  line-height: 1.4;
  margin-top: 6px;
  padding: 6px 12px;
  border-radius: 8px;
}

.ai-attachment-msg.error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.ai-composer-date-group {
  margin-top: 10px;
}

/* Responsive constraints */
@media (max-width: 480px) {
  .ai-attachment-name {
    max-width: 140px;
  }
  .ai-attachment-card {
    margin: 8px 8px 4px 8px;
    padding: 5px 8px 5px 5px;
  }
  .ai-composer-bar {
    padding: 6px 8px 8px 8px;
  }
}

@media (max-width: 390px) {
  .ai-attachment-name {
    max-width: 110px;
  }
  .ai-attachment-thumb-box {
    width: 38px;
    height: 38px;
  }
  .ai-attach-btn {
    padding: 0 8px;
  }
  .ai-composer-submit-btn {
    padding: 0 10px;
  }
}

@media (max-width: 360px) {
  .ai-attachment-name {
    max-width: 90px;
  }
  .ai-attach-label {
    display: none;
  }
}

/* ===================================================================
   CLAN RATES BOARD & TRANSFERS
   =================================================================== */

.clan-rates-section {
  margin-top: 18px;
  margin-bottom: 20px;
  padding: 16px 18px;
  background: rgba(16, 20, 31, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--r-lg, 16px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.clan-rates-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

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

.clan-header-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(99, 102, 241, 0.28);
  color: #818cf8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.clan-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.clan-rates-title {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.clan-rates-subtitle {
  font-size: 12px;
  font-weight: 400;
  color: #64748b;
  line-height: 1.3;
}

.clan-rates-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.clan-rates-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 1024px) {
  .clan-rates-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

@media (max-width: 640px) {
  .clan-rates-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}




/* Platform Badges */
.plat-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 800;
  padding: 2.5px 7px;
  border-radius: var(--r-xs);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.plat-badge.plat-nex,
.plat-badge.plat-nex-1 {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.plat-badge.plat-nex-2,
.plat-badge.plat-nex-ml {
  background: rgba(192, 132, 252, 0.2);
  color: #e9d5ff;
  border: 1px solid rgba(192, 132, 252, 0.4);
}

.plat-badge.plat-rocket,
.plat-badge.plat-rocket-3964 {
  background: rgba(6, 182, 212, 0.2);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.4);
}

.plat-badge.plat-rocket-4215 {
  background: rgba(56, 189, 248, 0.2);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.plat-badge.plat-fp {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.plat-badge.plat-royal {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.plat-badge.plat-auris {
  background: rgba(249, 115, 22, 0.2);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.4);
}

.plat-badge.plat-bybit {
  background: rgba(234, 179, 8, 0.2);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.4);
}

/* Spread Badges */
.spread-badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--r-full);
}

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

.spread-badge.spread-neg {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.spread-badge.spread-zero {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

/* Clan Quick Box */
.clan-quick-box {
  margin-bottom: 24px;
}

.clan-quick-input-wrap {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

@media (max-width: 680px) {
  .clan-quick-input-wrap {
    flex-direction: column;
  }
}

.clan-input-lg {
  font-size: 14px;
  padding: 12px 16px;
  flex: 1;
}

.clan-submit-btn {
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
}

.clan-quick-hints {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  font-size: 11px;
}

.hint-label {
  color: var(--text-3);
}

.hint-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: var(--r-full);
  color: var(--text-2);
}

.table-filter-tabs {
  display: flex;
  gap: 6px;
}

.filter-tab {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-2);
  padding: 4px 12px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t1);
}

.filter-tab.active,
.filter-tab:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: var(--indigo-400);
  color: #fff;
}

/* ===================================================================
   CLAN RATES & TABS
   =================================================================== */

.clan-tabs {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(15, 23, 42, 0.7);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
}

.clan-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t2, 200ms) var(--ease, ease);
  line-height: 1.2;
  white-space: nowrap;
}

.clan-tab-btn:hover:not(.active) {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.04);
}

.clan-tab-btn.active {
  background: #4f46e5;
  color: #ffffff;
  font-weight: 600;
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 0 12px rgba(99, 102, 241, 0.25);
}

.clan-tab-btn:focus-visible {
  outline: 2px solid var(--indigo-400, #818cf8);
  outline-offset: 1px;
}

#refresh-rates-btn.loading #refresh-rates-icon {
  animation: spinRate 0.8s linear infinite;
}

@keyframes spinRate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.clan-rate-card {
  display: flex;
  flex-direction: column;
  padding: 13px 15px;
  border-radius: var(--r-md);
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all var(--t2) var(--ease);
  position: relative;
  min-height: auto;
  gap: 6px;
  cursor: pointer;
}

.clan-rate-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.clan-rate-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 22px;
  gap: 8px;
}

.clan-rate-plat-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 20px;
}

.clan-rate-trend {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  padding: 1.5px 6px;
  border-radius: var(--r-xs);
  line-height: 1.2;
  white-space: nowrap;
}

.clan-rate-trend.up {
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.clan-rate-trend.down {
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.clan-rate-val-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 1px 0 0 0;
  line-height: 1.1;
}

.clan-rate-val {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.clan-rate-unit {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
}

.clan-rate-meta {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 5px;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-3);
  line-height: 1.3;
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clan-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 3.5px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clan-meta-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clan-meta-ico {
  font-size: 10px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  flex-shrink: 0;
}

.clan-meta-icon {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  opacity: 0.65;
  vertical-align: -1px;
}

.clan-meta-dot {
  color: rgba(255, 255, 255, 0.18);
  font-weight: 700;
  font-size: 10px;
  user-select: none;
  flex-shrink: 0;
}

.clan-meta-empty {
  color: var(--text-3);
  opacity: 0.5;
  font-size: 11px;
}

.clan-rate-edit-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-3);
  padding: 3px 8px;
  border-radius: var(--r-xs);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t1);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.clan-rate-edit-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
  color: #fff;
}

/* History Tab in Section */
.clan-history-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.clan-history-filters,
.clan-history-sort {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ctrl-label {
  font-size: 11px;
  color: var(--text-3);
  margin-right: 4px;
}

/* ===================================================================
   CLAN ASSET BALANCES (Unified Assets Model)
   =================================================================== */

/* ===================================================================
   CLAN TREASURY & ASSET BALANCES (КАЗНА КЛАНА)
   =================================================================== */

.clan-vault-panel,
.clan-assets-panel {
  margin-bottom: 24px;
  padding: 20px 22px;
  background: rgba(16, 20, 31, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--r-lg, 16px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.clan-vault-head,
.clan-assets-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.clan-vault-title-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.clan-vault-main-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
  line-height: 1.2;
}

.clan-vault-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.clan-primary-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  background: #4f46e5;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 0 12px rgba(99, 102, 241, 0.2);
  cursor: pointer;
  transition: all var(--t2, 200ms) var(--ease, ease);
  white-space: nowrap;
}

.clan-primary-action:hover {
  background: #4338ca;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35), 0 0 16px rgba(99, 102, 241, 0.3);
  transform: translateY(-1px);
}

.clan-primary-action:active {
  transform: translateY(0);
}

.clan-primary-action:focus-visible {
  outline: 2px solid var(--indigo-400, #818cf8);
  outline-offset: 2px;
}

.clan-secondary-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all var(--t2, 200ms) var(--ease, ease);
  white-space: nowrap;
}

.clan-secondary-action:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.clan-secondary-action:focus-visible {
  outline: 2px solid var(--indigo-400, #818cf8);
  outline-offset: 2px;
}

.clan-vault-totals {
  display: flex;
  align-items: baseline;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 6px 14px;
  border-radius: var(--r-sm, 8px);
}

.vault-total-lbl {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-3, #5a6478);
}

.vault-total-usd {
  font-size: 18px;
  font-weight: 700;
  color: #34d399;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);
  letter-spacing: -0.01em;
}

.vault-total-try {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2, #8b96a8);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);
}

/* ===================================================================
   SUMMARY CARDS (Всего активов 8 / В работе 8 / Не в работе 0)
   =================================================================== */

.clan-summary-cards {
  display: inline-flex;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.clan-summary-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 9px 18px;
  min-width: 125px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.summary-card-lbl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: #94a3b8;
  line-height: 1.2;
}

.summary-card-val {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.card-total .summary-card-val {
  color: #f8fafc;
}

.card-active .summary-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
  display: inline-block;
  flex-shrink: 0;
}

.card-active .summary-card-val {
  color: #34d399;
}

.card-inactive .summary-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: #64748b;
  display: inline-block;
  flex-shrink: 0;
}

.card-inactive .summary-card-val {
  color: #94a3b8;
}

/* ===================================================================
   ASSET CARDS GRID (4x2 on Desktop)
   =================================================================== */

.clan-vault-grid,
.clan-assets-grid,
.clan-rates-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 1024px) {
  .clan-vault-grid,
  .clan-assets-grid,
  .clan-rates-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

@media (max-width: 640px) {
  .clan-vault-grid,
  .clan-assets-grid,
  .clan-rates-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* Asset Cards */
.clan-asset-card {
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.82) 0%, rgba(15, 23, 42, 0.88) 100%);
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 12px;
  padding: 11px 11px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: all 0.2s ease;
  position: relative;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  min-width: 0;
  box-sizing: border-box;
}

.clan-asset-card:hover {
  background: linear-gradient(180deg, rgba(23, 33, 53, 0.88) 0%, rgba(18, 28, 50, 0.92) 100%);
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.32);
  transform: translateY(-1px);
}

.clan-asset-card:focus-visible {
  outline: 2px solid var(--indigo-400, #818cf8);
  outline-offset: 2px;
}

.clan-asset-card.active-from {
  border-color: var(--indigo-400);
  background: rgba(99, 102, 241, 0.12);
  box-shadow: 0 0 0 1px var(--indigo-400), 0 4px 14px rgba(99, 102, 241, 0.15);
}

.clan-asset-card.active-to {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  box-shadow: 0 0 0 1px #38bdf8, 0 4px 14px rgba(56, 189, 248, 0.15);
}

.clan-asset-card.is-inactive {
  opacity: 0.9;
  border-color: rgba(255, 255, 255, 0.05);
  background: linear-gradient(180deg, rgba(15, 20, 32, 0.8) 0%, rgba(13, 17, 27, 0.85) 100%);
}

.clan-asset-card.is-inactive:hover {
  opacity: 0.98;
  border-color: rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(20, 27, 43, 0.85) 0%, rgba(16, 22, 36, 0.9) 100%);
}

.clan-asset-card.is-inactive .clan-asset-usd {
  color: #cbd5e1;
}

.clan-asset-card.is-inactive .plat-badge {
  opacity: 0.82;
  filter: saturate(0.85);
}

/* Card Top Row: Badge Left | Status Center | Edit Right */
.clan-asset-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  white-space: nowrap;
  min-width: 0;
}

.clan-asset-card-top .plat-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

/* Status Toggle Button in Center */
.clan-status-pill,
.clan-status-toggle {
  display: inline-flex;
  align-items: center;
  gap: 3.5px;
  padding: 2px 5px;
  border-radius: 9999px;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  border: 1px solid transparent;
  flex-shrink: 0;
  line-height: 1;
}

/* ON State */
.clan-status-pill.status-on,
.clan-status-toggle.status-on {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.45);
  color: #34d399;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.28);
}

.clan-status-pill.status-on:hover:not(.is-readonly),
.clan-status-toggle.status-on:hover:not(.is-readonly) {
  background: rgba(16, 185, 129, 0.24);
  border-color: rgba(16, 185, 129, 0.6);
  color: #6ee7b7;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

/* Toggle Switch track & knob */
.clan-toggle-track {
  width: 15px;
  height: 9px;
  border-radius: 9999px;
  background: #10b981;
  box-shadow: 0 0 7px rgba(16, 185, 129, 0.7);
  display: inline-flex;
  align-items: center;
  padding: 1px;
  box-sizing: border-box;
  transition: all 0.2s ease;
  position: relative;
  flex-shrink: 0;
}

.clan-toggle-knob {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  transform: translateX(6px);
  transition: transform 0.2s ease, background 0.2s ease;
  display: block;
}

/* OFF State */
.clan-status-pill.status-off,
.clan-status-toggle.status-off {
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
  box-shadow: none;
}

.clan-status-pill.status-off:hover:not(.is-readonly),
.clan-status-toggle.status-off:hover:not(.is-readonly) {
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.35);
  color: #cbd5e1;
}

.clan-status-pill.status-off .clan-toggle-track,
.clan-status-toggle.status-off .clan-toggle-track {
  background: #475569;
  box-shadow: none;
}

.clan-status-pill.status-off .clan-toggle-knob,
.clan-status-toggle.status-off .clan-toggle-knob {
  background: #cbd5e1;
  transform: translateX(0px);
}

.clan-status-pill.is-readonly,
.clan-status-toggle.is-readonly {
  cursor: default;
  opacity: 0.85;
}

.clan-status-pill:focus-visible,
.clan-status-toggle:focus-visible {
  outline: 2px solid var(--indigo-400, #818cf8);
  outline-offset: 2px;
}

.clan-status-pill.is-loading,
.clan-status-toggle.is-loading {
  opacity: 0.6;
  pointer-events: none;
  cursor: wait;
}

.clan-status-pill.is-loading .clan-toggle-knob,
.clan-status-toggle.is-loading .clan-toggle-knob {
  background: #facc15;
  animation: clanKnobPulse 0.6s infinite alternate ease-in-out;
}

@keyframes clanKnobPulse {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

/* Edit button in top right */
.clan-asset-edit-btn {
  padding: 2px 5px;
  font-size: 9px;
  font-weight: 500;
  height: 18px;
  border-radius: 4px;
  color: #8b96a8;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
  display: inline-flex;
  align-items: center;
  gap: 2.5px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
  flex-shrink: 0;
  white-space: nowrap;
}

.clan-asset-edit-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.clan-asset-edit-btn:focus-visible {
  outline: 2px solid var(--indigo-400, #818cf8);
  outline-offset: 1px;
}

/* Balance block */
.clan-asset-bal-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 0;
}

.clan-asset-bal-lbl {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
  line-height: 1.2;
}

.clan-asset-usd {
  font-size: 19px;
  font-weight: 800;
  color: #ffffff;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.clan-asset-try {
  font-size: 12px;
  font-weight: 500;
  color: #8b96a8;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);
  line-height: 1.2;
}

/* Bottom row */
.clan-asset-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
  min-width: 0;
}

.clan-asset-rate-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.clan-asset-rate-lbl {
  font-size: 9.5px;
  font-weight: 500;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.clan-asset-rate-val {
  font-size: 12px;
  font-weight: 700;
  color: #38bdf8;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);
}

.clan-asset-meta {
  font-size: 9.5px;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
  flex-shrink: 1;
}


/* ===================================================================
   CLAN TRANSFER BUILDER
   =================================================================== */

.clan-builder-panel {
  margin-bottom: 24px;
  padding: 22px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.75), rgba(30, 27, 75, 0.5));
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--r-lg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.builder-step-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 18px;
}

.builder-step-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.builder-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.builder-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0;
}

.builder-asset-bal {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--indigo-300, #a5b4fc);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  padding: 3px 9px;
  border-radius: var(--r-full);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.builder-asset-bal .bal-usd {
  color: #34d399;
  font-weight: 700;
}

.builder-asset-bal .bal-try {
  color: var(--text-3);
}

.builder-btn-group {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
}

.btn-plat-choice {
  padding: 10px 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-2);
  border-radius: var(--r-sm);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: all var(--t1);
  text-align: center;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  user-select: none;
}

.btn-plat-choice:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(99, 102, 241, 0.4);
}

.btn-plat-choice.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.55), rgba(168, 85, 247, 0.55));
  border-color: var(--indigo-400);
  color: #fff;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.4);
}

.builder-warning-box {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fde68a;
  padding: 8px 12px;
  border-radius: var(--r-md);
  font-size: 12px;
  font-weight: 600;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.builder-error-box {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 16px;
}

.builder-amount-row {
  display: flex;
  margin-bottom: 12px;
}

.field-amount-main {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.builder-input-hint {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
}

.transfer-extra-details {
  margin-bottom: 16px;
}

.transfer-extra-summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--text-3);
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color var(--t1);
}

.transfer-extra-summary:hover {
  color: var(--text-2);
}

.transfer-extra-content {
  margin-top: 8px;
  max-width: 280px;
}

.builder-inputs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 16px;
}

.builder-rates-card {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-bottom: 18px;
}

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

.rates-card-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--indigo-300);
  display: flex;
  align-items: center;
  gap: 6px;
}

.rates-card-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 14px;
}

.rate-field-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rate-field-label {
  font-size: 11px;
  color: var(--text-3);
}

/* Builder input focus states */
.clan-builder-form .field-input:focus,
.clan-builder-form .field-input-sm:focus {
  border-color: var(--indigo-400);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
  outline: none;
}

.builder-live-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--r-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.live-sum-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.live-sum-lbl {
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.live-sum-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
}

.live-sum-val.text-green::after {
  content: ' Профит';
  font-size: 10px;
  font-weight: 600;
  opacity: 0.75;
}

.live-sum-val.text-red::after {
  content: ' Убыток';
  font-size: 10px;
  font-weight: 600;
  opacity: 0.75;
}

.live-route-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-1);
}

.live-route-arrow {
  color: var(--indigo-400);
  font-size: 12px;
}

.builder-save-global-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(139, 92, 246, 0.08);
  border: 1px dashed rgba(139, 92, 246, 0.25);
  border-radius: var(--r-sm);
  font-size: 11px;
  color: var(--text-3);
}

.builder-save-global-wrap .btn {
  font-size: 11px;
  padding: 3px 10px;
}

.builder-actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quick-paste-panel {
  margin-top: 14px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--r-md);
}

.quick-paste-inner {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Modals details */
.transfer-preview-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prev-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--r-sm);
  font-size: 13px;
}

.prev-label {
  color: var(--text-3);
}

.prev-val {
  color: var(--text-1);
}

.prev-highlight {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.prev-highlight .prev-val {
  font-size: 15px;
  color: #34d399;
}

/* AI Rate Preview Card */
.ai-rate-preview-card {
  padding: 14px 18px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--r-md);
  margin-bottom: 12px;
}

.ai-rate-preview-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 10px;
}

.ai-rate-preview-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.ai-rate-preview-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.ai-rate-preview-vals {
  font-weight: 600;
  color: var(--text-1);
}

.ai-preview-actions {
  display: flex;
  gap: 8px;
}

/* Responsive Rules for Mobile and Tablet */
@media (max-width: 768px) {
  .builder-step-row,
  .builder-inputs-row,
  .rates-card-inputs {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .builder-live-summary {
    grid-template-columns: repeat(2, 1fr);
  }
  .clan-rates-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .clan-rates-actions {
    width: 100%;
    display: flex;
    justify-content: flex-end;
  }
  .clan-rates-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

@media (max-width: 640px) {
  .builder-live-summary {
    grid-template-columns: 1fr;
  }
  .builder-btn-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }
  .btn-plat-choice {
    padding: 8px 6px !important;
    font-size: 11.5px !important;
    min-height: 38px !important;
  }
  .quick-paste-inner {
    flex-direction: column;
    align-items: stretch;
  }
  .clan-history-controls {
    flex-direction: column;
    align-items: flex-start;
  }
  .builder-actions-row {
    flex-direction: column;
    align-items: stretch;
  }
  .builder-actions-row .btn {
    justify-content: center;
  }
  .rates-card-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .prev-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 12px;
  }
}

@media (max-width: 360px) {
  .clan-builder-panel {
    padding: 14px;
  }
  .builder-rates-card {
    padding: 10px 12px;
  }
  .kpi-row {
    grid-template-columns: 1fr;
  }
}

.spinning {
  animation: spin 0.8s linear infinite;
}

.badge-ai {
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.35);
  color: #c4b5fd;
}

.badge-manual {
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: var(--text-2);
}

/* ===================================================================
   GLOBAL NUMBER SPINNER ARROW REMOVAL
   =================================================================== */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
}

/* ===================================================================
   RATE EDIT MODAL — Compact, Premium, Dark Fintech
   =================================================================== */
.rate-modal-box {
  max-width: 380px !important;
  width: 100%;
  min-width: 0 !important;
  box-sizing: border-box;
  border-radius: var(--r-xl);
  background: var(--bg-elevated, #111520);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.rate-modal-box .modal-head {
  padding: 16px 20px 14px;
  min-width: 0;
}

.rate-modal-box .modal-head > div {
  min-width: 0;
  flex: 1;
}

.rate-modal-box .panel-eyebrow {
  white-space: normal;
  line-height: 1.3;
}

.rate-modal-box .modal-title {
  white-space: normal;
  word-break: break-word;
}

.rate-modal-body {
  padding: 16px 20px 20px;
  box-sizing: border-box;
  min-width: 0;
}

@media (max-width: 640px) {
  .modal-wrap {
    padding: 12px !important;
    justify-content: flex-start !important;
  }
  .rate-modal-box {
    max-width: 360px !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0;
  }
  .rate-modal-box .modal-head {
    padding: 14px 14px 10px !important;
  }
  .rate-modal-body {
    padding: 12px 14px 16px !important;
  }
  .rate-modal-actions {
    display: flex;
    gap: 8px;
    width: 100%;
  }
  .rate-modal-actions .rate-btn-secondary,
  .rate-modal-actions .rate-btn-primary {
    flex: 1;
    text-align: center;
  }
}

.rate-modal-plat-select {
  margin-bottom: 14px;
}

.rate-modal-plat-select .builder-btn-group {
  margin-top: 6px;
}

.rate-modal-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 7px;
  margin-bottom: 14px;
}

.rate-modal-meta-label {
  color: var(--text-3);
  font-size: 12.5px;
  font-weight: 500;
}

.rate-modal-meta-val {
  font-family: var(--font-mono, monospace);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
}

.rate-modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rate-modal-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}

.rate-modal-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.rate-clean-input {
  display: block;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  height: 40px;
  padding: 0 68px 0 12px !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 7px !important;
  color: #ffffff !important;
  font-family: var(--font-mono, monospace);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  outline: none;
  transition: border-color var(--t1), background var(--t1), box-shadow var(--t1);
  -webkit-appearance: none;
  -moz-appearance: textfield;
  appearance: textfield;
}

.rate-clean-input::-webkit-outer-spin-button,
.rate-clean-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.rate-clean-input:focus {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--indigo-400, #818cf8) !important;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25) !important;
}

.rate-clean-input:focus-visible {
  outline: none;
}

.rate-modal-input-suffix {
  position: absolute;
  right: 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  pointer-events: none;
  user-select: none;
}

.rate-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.rate-btn-secondary {
  height: 38px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  cursor: pointer;
  transition: all var(--t1);
}

.rate-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-1);
}

.rate-btn-secondary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.rate-btn-primary {
  height: 38px;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  background: var(--indigo-500, #6366f1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 7px;
  cursor: pointer;
  transition: all var(--t1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.rate-btn-primary:hover {
  background: var(--indigo-400, #818cf8);
}

.rate-btn-primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--indigo-400);
}

/* ===================================================================
   TRANSFERS PANEL HEADER & FILTER TABS
   =================================================================== */
.panel-head.p-header {
  padding: 16px 20px 14px;
  margin-bottom: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

#transfers-platform-filter.table-filter-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 7px;
  padding: 2px;
}

#transfers-platform-filter .filter-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 5px;
  background: transparent;
  border: none;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t1);
  white-space: nowrap;
}

#transfers-platform-filter .filter-tab:hover {
  color: var(--text-1);
  background: rgba(255, 255, 255, 0.05);
}

#transfers-platform-filter .filter-tab.active {
  background: var(--indigo-500, #6366f1);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

#transfers-platform-filter .filter-tab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--indigo-400);
}

/* ===================================================================
   CLAN TRANSFERS JOURNAL & STATS STRIP
   =================================================================== */

.transfers-stats-strip {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 14px;
}

.tstat-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.tstat-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tstat-val {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);
}

.tstat-divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 640px) {
  .transfers-stats-strip {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .tstat-divider {
    display: none;
  }
}

/* ===================================================================
   CLAN TRANSFERS TABLE — Dense, Compact, Professional
   =================================================================== */
#transfers-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

#transfers-table thead,
#transfers-table tbody {
  display: block;
  width: 100%;
}

#transfers-table thead tr,
#transfers-table tbody tr {
  display: grid;
  grid-template-columns: 100px 130px minmax(210px, 1.4fr) minmax(100px, 1fr) minmax(135px, 1.2fr) minmax(105px, 1fr) 52px;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  padding: 0 12px;
}

#transfers-table thead tr {
  height: 38px;
  min-height: 38px;
  background: rgba(15, 23, 42, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#transfers-table tbody tr {
  height: 44px;
  min-height: 44px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background var(--t1);
}

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

/* Common cell alignment */
#transfers-table th,
#transfers-table td {
  padding: 0 6px;
  display: flex;
  align-items: center;
  height: 100%;
  box-sizing: border-box;
}

#transfers-table th {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
  user-select: none;
}

/* Col 1: Date */
#transfers-table .col-transfer-date {
  justify-content: flex-start;
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Col 2: Author */
#transfers-table .col-transfer-author {
  justify-content: flex-start;
}

.transfer-author {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 120px;
  line-height: 1.2;
}

.transfer-author .author-ico {
  font-size: 11px;
  opacity: 0.7;
  flex-shrink: 0;
}

.transfer-author .author-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Col 3: Route (Откуда-Куда) */
#transfers-table .col-transfer-route {
  justify-content: flex-start;
}

.transfer-route-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.transfer-route-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-4);
  font-size: 11px;
  user-select: none;
}

.transfer-acc-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--cyan, #38bdf8);
  margin-left: 2px;
  padding: 1.5px 6px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  white-space: nowrap;
  font-family: var(--font-mono, monospace);
  letter-spacing: -0.01em;
}

/* Col 4: Amount (Center aligned) */
#transfers-table .col-transfer-amount {
  justify-content: center;
  text-align: center;
}

.transfer-amount-val {
  font-family: var(--font-mono, monospace);
  font-weight: 600;
  font-size: 12.5px;
  color: var(--text-1);
  letter-spacing: -0.01em;
}

/* Col 5: Rate (Center aligned) */
#transfers-table .col-transfer-rate {
  justify-content: center;
  text-align: center;
}

.transfer-rate-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-family: var(--font-mono, monospace);
  font-size: 11.5px;
  line-height: 1.2;
  white-space: nowrap;
}

.transfer-rate-inline .rate-src {
  color: var(--text-3);
  font-weight: 500;
}

.transfer-rate-inline .rate-arr {
  color: var(--text-4);
  font-size: 10px;
  font-family: var(--font-sans);
}

.transfer-rate-inline .rate-dst {
  color: var(--text-1);
  font-weight: 600;
}

/* Col 6: Spread (Center aligned) */
#transfers-table .col-transfer-spread {
  justify-content: center;
  text-align: center;
}

.transfer-spread-val {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono, monospace);
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  min-width: 66px;
  text-align: center;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.transfer-spread-val.spread-pos {
  color: #34d399;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.22);
}

.transfer-spread-val.spread-neg {
  color: #f87171;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.22);
}

.transfer-spread-val.spread-zero {
  color: var(--text-3);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Col 7: Actions (Right aligned) */
#transfers-table .col-transfer-actions {
  justify-content: flex-end;
  text-align: right;
  padding-right: 4px;
}

.btn-table-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 5px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: all var(--t1);
}

.btn-table-del:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.25);
  color: #f87171;
}

.btn-table-del:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--red);
}

@media (max-width: 640px) {
  .panel-head.p-header {
    padding: 12px 14px;
    gap: 8px;
  }
  #transfers-table th {
    font-size: 10px;
  }
  .transfer-author .author-text {
    font-size: 11.5px;
  }
  #transfers-table .plat-badge {
    padding: 1.5px 5px;
    font-size: 9.5px;
  }
  .transfer-amount-val {
    font-size: 12px;
  }
  .transfer-rate-inline {
    font-size: 11px;
  }
  .transfer-spread-val {
    font-size: 11px;
    padding: 1.5px 5px;
  }

  /* 1-column clan asset cards for mobile (<= 640px) */
  .page {
    overflow-x: hidden !important;
    max-width: 100% !important;
    padding: 14px 10px 50px !important;
  }
  .clan-vault-grid,
  .clan-assets-grid,
  .clan-rates-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .clan-rates-section,
  .clan-vault-panel {
    padding: 12px 10px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  .clan-rates-header,
  .clan-vault-head {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  .clan-vault-totals {
    flex-wrap: wrap !important;
    gap: 4px 8px !important;
    padding: 6px 10px !important;
  }
  .clan-header-left {
    width: 100% !important;
    justify-content: flex-start !important;
  }
  .clan-tabs {
    width: 100% !important;
    justify-content: center !important;
    display: flex !important;
  }
  .clan-tab-btn {
    flex: 1 !important;
    text-align: center !important;
  }
  .clan-rates-actions,
  .clan-vault-head-actions {
    width: 100% !important;
    justify-content: flex-start !important;
    gap: 8px !important;
  }
  .clan-summary-cards {
    display: flex !important;
    width: 100% !important;
    gap: 5px !important;
    margin-bottom: 14px !important;
  }
  .clan-summary-card {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    padding: 6px 4px !important;
    text-align: center !important;
    align-items: center !important;
  }
  .summary-card-lbl {
    font-size: 9px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    justify-content: center !important;
  }
  .summary-card-val {
    font-size: 16px !important;
  }
  .clan-asset-card {
    padding: 10px 10px !important;
    gap: 8px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .clan-asset-card-top {
    gap: 4px !important;
    align-items: center !important;
    justify-content: space-between !important;
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .clan-asset-card-top .plat-badge {
    font-size: 9.5px !important;
    padding: 2px 5.5px !important;
  }
  .clan-status-pill,
  .clan-status-toggle {
    padding: 2px 5.5px !important;
    font-size: 8.5px !important;
    gap: 3.5px !important;
  }
  .clan-asset-edit-btn {
    padding: 2px 5.5px !important;
    font-size: 9px !important;
    height: 18px !important;
    gap: 2.5px !important;
  }
  .clan-toggle-track {
    width: 16px !important;
    height: 9px !important;
  }
  .clan-toggle-knob {
    width: 7px !important;
    height: 7px !important;
  }
  .clan-status-pill.status-on .clan-toggle-knob,
  .clan-status-toggle.status-on .clan-toggle-knob {
    transform: translateX(7px) !important;
  }
  .clan-asset-usd {
    font-size: 18px !important;
  }
  .clan-asset-try {
    font-size: 11.5px !important;
  }
  .clan-asset-footer {
    padding-top: 8px !important;
    gap: 8px !important;
    justify-content: space-between !important;
  }
  .clan-asset-rate-lbl {
    font-size: 9.5px !important;
  }
  .clan-asset-meta {
    font-size: 9px !important;
    max-width: 110px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .clan-status-pill,
  .clan-status-toggle,
  .clan-toggle-knob,
  .clan-toggle-track,
  .clan-asset-card,
  .clan-tab-btn,
  .clan-primary-action,
  .clan-secondary-action,
  .clan-asset-edit-btn {
    transition: none !important;
    transform: none !important;
    animation: none !important;
  }
  .clan-status-pill.is-loading .clan-toggle-knob,
  .clan-status-toggle.is-loading .clan-toggle-knob,
  #refresh-rates-btn.loading #refresh-rates-icon {
    animation: none !important;
  }
}


