/* =========================================
   HORIZON TRUST — COMPONENT LIBRARY
   ========================================= */

/* ---- NAVIGATION ---- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  height: 72px;
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255,255,255,0.4);
  transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.nav.scrolled {
  background: rgba(252,251,255,0.92);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  box-shadow: 0 1px 0 rgba(0,15,34,0.06), 0 4px 24px rgba(0,15,34,0.06);
  border-bottom-color: rgba(0,15,34,0.07);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-6);
  box-sizing: border-box;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}
/* TH Premium Metallic icon — no wrapper, just the logo */
.nav-logo-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  width: auto;
  height: auto;
}
.nav-logo-icon img {
  height: 38px;
  width: auto;
  object-fit: contain;
  display: block;
}
/* Wordmark */
.nav-logo-name {
  font-family: 'Manrope', sans-serif;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #07192F;
  line-height: 1;
  display: flex;
  align-items: center;
}
/* Legacy img fallback */
.nav-logo-img { height: 44px; width: auto; display: block; }
/* Wordmark colours */
.nav-logo-trust   { color: #D4AF37; }
.nav-logo-horizon { color: #0B7A5C; }
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}
.nav-link {
  font-family: var(--font-label);
  font-size: var(--text-label-lg);
  font-weight: 500;
  color: var(--on-surface-variant);
  transition: color var(--transition-fast);
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--secondary);
  border-radius: 1px;
  transform: scaleX(0);
  transition: transform var(--transition-fast);
}
.nav-link:hover { color: var(--primary); }
.nav-link:hover::after,
.nav-link.active::after { transform: scaleX(1); }
.nav-link.active { color: var(--primary); }
.nav-ctas {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* ---- SIDEBAR NAV (App) ---- */
.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  transition: grid-template-columns var(--transition-base);
}
.app-shell.sidebar-collapsed {
  grid-template-columns: 64px 1fr;
}

/* ── Sidebar shell ── */
.sidebar {
  background: var(--primary);
  padding: var(--space-5) 0 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  width: 240px;
  transition: width var(--transition-base);
  flex-shrink: 0;
}
.sidebar.collapsed { width: 64px; }

/* ── Logo ── */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-4) var(--space-5);
  font-family: var(--font-headline);
  font-weight: 800;
  font-size: 1.05rem;
  color: white;
  letter-spacing: -0.02em;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-logo-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity var(--transition-fast), width var(--transition-base);
}
.sidebar.collapsed .sidebar-logo-text { opacity: 0; width: 0; overflow: hidden; pointer-events: none; }
.sidebar-logo-icon {
  width: 34px;
  height: 34px;
  background: transparent;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.sidebar-logo-icon img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  display: block;
}
/* Collapsed: hide the icon so the toggle button (the only way back out) always
   has room and is never clipped by the sidebar's overflow:hidden. */
.sidebar.collapsed .sidebar-logo-icon { display: none; }
.sidebar.collapsed .sidebar-logo { justify-content: center; padding-left: 0; padding-right: 0; }

/* ── Collapse toggle — lives inside the logo row ── */
.sidebar-collapse-btn {
  width: 26px;
  height: 26px;
  background: rgba(255,255,255,0.12);
  border: none;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  color: rgba(255,255,255,0.7);
  transition: background var(--transition-fast), color var(--transition-fast);
  padding: 0;
}
.sidebar-collapse-btn:hover { background: rgba(255,255,255,0.2); color: white; }
.sidebar-collapse-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  transition: transform var(--transition-base);
}
.sidebar.collapsed .sidebar-collapse-btn svg { transform: rotate(180deg); }

/* ── Nav ── */
.sidebar-nav {
  padding: var(--space-3) var(--space-2);
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Section labels — clearly distinct from items */
.sidebar-section-label {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
  padding: var(--space-5) var(--space-3) var(--space-1);
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition-fast);
}
.sidebar.collapsed .sidebar-section-label {
  opacity: 0;
  padding-top: var(--space-3);
  padding-bottom: 0;
  height: 1px;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin: var(--space-2) var(--space-3);
}

/* Nav items */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px var(--space-3);
  border-radius: var(--radius);
  color: rgba(255,255,255,0.6);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
  margin-bottom: 1px;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}
.sidebar-item:hover {
  background: rgba(255,255,255,0.09);
  color: rgba(255,255,255,0.92);
}
.sidebar-item.active {
  background: rgba(255,255,255,0.13);
  color: white;
  font-weight: 700;
}
.sidebar-item.active .sidebar-icon { color: var(--secondary); }
.sidebar-item-label {
  transition: opacity var(--transition-fast);
  flex: 1;
}
.sidebar.collapsed .sidebar-item-label,
.sidebar.collapsed .sidebar-badge { opacity: 0; width: 0; overflow: hidden; }
.sidebar.collapsed .sidebar-item { justify-content: center; padding: 9px; gap: 0; }
/* Tooltip on collapsed hover */
.sidebar.collapsed .sidebar-item:hover::after {
  content: attr(data-label);
  position: absolute;
  left: 68px;
  background: var(--surface-container-highest);
  color: var(--on-surface);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius);
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--shadow-card);
  z-index: 200;
}

/* Lucide icons in sidebar */
.sidebar-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.5);
  transition: color var(--transition-fast);
}
.sidebar-icon svg { width: 16px; height: 16px; stroke-width: 1.75; }
.sidebar-item:hover .sidebar-icon { color: rgba(255,255,255,0.85); }
.sidebar-item.active .sidebar-icon { color: var(--secondary); }

.sidebar-badge {
  margin-left: auto;
  background: var(--secondary);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

/* ── Footer ── */
.sidebar-footer {
  padding: var(--space-3) var(--space-2);
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px var(--space-3);
  margin-top: var(--space-2);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.06);
  color: #ffffff;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-logout .sidebar-icon { color: #ffffff; }
.sidebar-logout:hover { background: rgba(255,255,255,0.14); color: white; }
.sidebar-logout:hover .sidebar-icon { color: white; }
.sidebar.collapsed .sidebar-logout { justify-content: center; padding: 8px; }
.sidebar.collapsed .sidebar-logout span { opacity: 0; width: 0; overflow: hidden; }
.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-2);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition-fast);
  overflow: hidden;
  margin-bottom: var(--space-3);
}
.sidebar-user:hover { background: rgba(255,255,255,0.08); }
.sidebar-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: white;
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; transition: opacity var(--transition-fast); }
.sidebar.collapsed .sidebar-user-info { opacity: 0; width: 0; overflow: hidden; }
.sidebar-user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- APP MAIN ---- */
.app-main {
  background: var(--surface-container-low);
  overflow-x: hidden;
}
.app-topbar {
  background: var(--surface-container-lowest);
  padding: var(--space-4) var(--space-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: var(--z-raised);
  box-shadow: var(--shadow-card);
}
.app-topbar-title {
  font-family: var(--font-headline);
  font-size: var(--text-title-lg);
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.01em;
}
.app-topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.app-content {
  padding: var(--space-8);
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius);
  font-family: var(--font-label);
  font-size: var(--text-label-lg);
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}
.btn-primary:hover:not(:disabled) {
  background: var(--gradient-primary);
  box-shadow: 0 4px 16px rgba(0,15,34,0.25);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--secondary);
  color: var(--on-secondary);
}
.btn-secondary:hover:not(:disabled) {
  background: #00543a;
  box-shadow: 0 4px 16px rgba(0,108,74,0.25);
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid rgba(0,15,34,0.2);
}
.btn-outline:hover:not(:disabled) {
  background: var(--surface-container);
  border-color: var(--primary);
}
.btn-ghost {
  background: transparent;
  color: var(--on-surface-variant);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface-container);
  color: var(--on-surface);
}
.btn-danger {
  background: var(--error);
  color: var(--on-error);
}
.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-title-sm);
  font-weight: 600;
}
.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-label-md);
}
.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius);
}
.btn-icon-sm {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

/* ---- CARDS ---- */
.card {
  background: var(--surface-container-lowest);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(0,15,34,0.11);
}
.card-interactive:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-float);
}
.card-primary {
  background: var(--gradient-primary);
  color: var(--on-primary);
}
.card-secondary {
  background: var(--gradient-emerald);
  color: var(--on-secondary);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}
.card-title {
  font-family: var(--font-headline);
  font-size: var(--text-title-md);
  font-weight: 600;
  color: var(--on-surface);
  letter-spacing: -0.01em;
}
.card-subtitle {
  font-size: var(--text-body-sm);
  color: var(--on-surface-variant);
  margin-top: var(--space-1);
}

/* ---- STAT CARDS ---- */
.stat-card {
  background: var(--surface-container-lowest);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.stat-card.green::before { background: var(--gradient-emerald); }
.stat-card.alert::before { background: var(--error); }
.stat-card.alert .stat-icon { background: var(--error-container); color: var(--error); }
.stat-card.alert .stat-value { color: var(--error); }
.stat-card.alert .stat-change { background: var(--error-container); color: var(--error); }
.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: var(--space-4);
  flex-shrink: 0;
}
.stat-icon-primary {
  background: var(--primary-fixed);
  color: var(--primary);
}
.stat-icon-secondary {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}
.stat-icon-warning {
  background: #fef3c7;
  color: #92400e;
}
.stat-value {
  font-family: var(--font-display);
  font-size: var(--text-display-sm);
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.03em;
  line-height: 1;
}
.stat-label {
  font-size: var(--text-label-md);
  color: var(--on-surface-variant);
  margin-top: var(--space-1);
  font-weight: 500;
}
.stat-change {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-label-sm);
  font-weight: 600;
  margin-top: var(--space-2);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.stat-change.positive {
  background: #d1fae5;
  color: #065f46;
}
.stat-change.negative {
  background: var(--error-container);
  color: var(--error);
}

/* ---- BADGES / CHIPS ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-family: var(--font-label);
  font-size: var(--text-label-sm);
  font-weight: 600;
  white-space: nowrap;
}
.badge-primary { background: var(--primary-fixed); color: var(--primary); }
.badge-success { background: var(--secondary-container); color: var(--on-secondary-container); }
.badge-pending { background: #dbeafe; color: #1e40af; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-error { background: var(--error-container); color: var(--error); }
.badge-neutral { background: var(--surface-container-high); color: var(--on-surface-variant); }
.badge-verified {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}
.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* ---- FILTER CHIPS / TABS ---- */
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  background: transparent;
  font-size: var(--text-label-lg);
  font-weight: 600;
  color: var(--on-surface-variant);
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
}
.filter-chip:hover { color: var(--on-surface); background: var(--surface-container); }
.filter-chip.active { background: var(--surface-container-lowest); color: var(--primary); box-shadow: 0 1px 3px rgba(0,15,34,0.12); }

/* ---- EMPTY STATE ---- */
.empty-state {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  color: var(--on-surface-variant);
}
.empty-state .empty-state-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto var(--space-3);
  border-radius: 50%;
  background: var(--surface-container-high);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--on-surface-variant);
}
.empty-state .empty-state-title { font-weight: 700; color: var(--on-surface); }
.empty-state .empty-state-sub { font-size: var(--text-label-md); margin-top: 2px; }

/* ---- OUTLINE DANGER BUTTON ---- */
.btn-outline-danger {
  background: transparent;
  color: var(--error);
  border: 1.5px solid rgba(179,38,30,0.35);
}
.btn-outline-danger:hover:not(:disabled) {
  background: var(--error-container);
  border-color: var(--error);
}
.badge-dot.pulse {
  animation: pulse-dot 1.5s ease-in-out infinite;
}

/* ---- INPUT FIELDS ---- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.form-label {
  font-family: var(--font-label);
  font-size: var(--text-label-lg);
  font-weight: 500;
  color: var(--on-surface);
}
.form-label .required { color: var(--error); margin-left: 2px; }
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--surface-container-highest);
  border: 1.5px solid rgba(116, 119, 126, 0.1);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: var(--text-body-md);
  color: var(--on-surface);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(0,108,74,0.1);
}
.form-input::placeholder, .form-textarea::placeholder {
  color: var(--outline);
}
.form-textarea { resize: vertical; min-height: 120px; }
.form-hint {
  font-size: var(--text-label-md);
  color: var(--on-surface-variant);
}
.form-error {
  font-size: var(--text-label-md);
  color: var(--error);
}

/* Input with icon */
.input-wrapper {
  position: relative;
}
.input-icon {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--outline);
  font-size: 1rem;
  pointer-events: none;
}
.input-wrapper .form-input { padding-left: 2.75rem; }

/* ---- PROGRESS BARS ---- */
.progress-bar {
  height: 6px;
  background: var(--surface-container-high);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--gradient-emerald);
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-fill.primary { background: var(--gradient-primary); }
.progress-fill.warning { background: linear-gradient(90deg, #f59e0b, #d97706); }

/* ---- MILESTONE STEPPER ---- */
.stepper {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.step-item {
  display: flex;
  gap: var(--space-4);
  position: relative;
}
.step-item + .step-item { padding-top: 0; }
.step-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}
.step-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: all var(--transition-base);
  z-index: 1;
}
.step-dot.completed {
  background: var(--secondary);
  color: white;
}
.step-dot.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 0 0 4px rgba(0,108,74,0.15);
}
.step-dot.pending {
  background: var(--surface-container-high);
  color: var(--on-surface-variant);
}
.step-line {
  width: 2px;
  flex: 1;
  min-height: 40px;
  background: var(--surface-container-high);
  margin: 4px 0;
}
.step-line.completed { background: var(--secondary); }
.step-content {
  padding-bottom: var(--space-6);
  flex: 1;
}
.step-title {
  font-weight: 600;
  font-size: var(--text-body-md);
  color: var(--on-surface);
  margin-bottom: var(--space-1);
}
.step-meta {
  font-size: var(--text-body-sm);
  color: var(--on-surface-variant);
}
.step-detail {
  margin-top: var(--space-3);
  padding: var(--space-4);
  background: var(--surface-container-low);
  border-radius: var(--radius);
}

/* ---- TRANSACTION LIST ---- */
.transaction-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) 0;
}
.transaction-item + .transaction-item {
  margin-top: var(--space-2);
  padding-top: var(--space-4);
}
.transaction-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.transaction-info { flex: 1; min-width: 0; }
.transaction-name {
  font-weight: 600;
  font-size: var(--text-body-md);
  color: var(--on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.transaction-sub {
  font-size: var(--text-body-sm);
  color: var(--on-surface-variant);
  margin-top: 2px;
}
.transaction-amount {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-title-md);
  color: var(--primary);
  white-space: nowrap;
}
.transaction-amount.credit { color: var(--secondary); }

/* ---- VERIFICATION STATUS ---- */
.verification-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--surface-container-low);
  border-radius: var(--radius);
  margin-bottom: var(--space-3);
  transition: background var(--transition-fast);
}
.verification-item:hover { background: var(--surface-container); }
.verification-status-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

/* ---- MARKETPLACE CARD ---- */
.listing-card {
  background: var(--surface-container-lowest);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-base);
  cursor: pointer;
}
.listing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-float);
}
.listing-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--surface-container);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--on-surface-variant);
  font-size: 2.5rem;
  position: relative;
  overflow: hidden;
}
.listing-img-bg {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--surface-container) 0%, var(--surface-container-high) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}
.listing-verified-badge {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  background: var(--secondary);
  color: white;
  font-size: var(--text-label-sm);
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 4px;
}
.listing-body { padding: var(--space-5); }
.listing-price {
  font-family: var(--font-display);
  font-size: var(--text-headline-sm);
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}
.listing-title {
  font-weight: 600;
  font-size: var(--text-body-md);
  color: var(--on-surface);
  margin-top: var(--space-1);
}
.listing-meta {
  font-size: var(--text-body-sm);
  color: var(--on-surface-variant);
  margin-top: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* ---- MODAL / DIALOG ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,15,34,0.5);
  backdrop-filter: blur(4px);
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: var(--surface-container-lowest);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  max-width: 560px;
  width: 100%;
  box-shadow: var(--shadow-elevated);
  transform: scale(0.96);
  transition: transform var(--transition-base);
}
.modal-overlay.open .modal {
  transform: scale(1);
}
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}
.modal-title {
  font-family: var(--font-headline);
  font-size: var(--text-headline-sm);
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.01em;
}
.modal-close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  border: none;
  background: var(--surface-container);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--on-surface-variant);
  transition: background var(--transition-fast);
}
.modal-close:hover { background: var(--surface-container-high); }

/* ---- NOTIFICATION / ALERT INLINE ---- */
.alert {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius);
  font-size: var(--text-body-sm);
}
.alert-success {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}
.alert-warning {
  background: #fef3c7;
  color: #92400e;
}
.alert-error {
  background: var(--error-container);
  color: var(--error);
}
.alert-info {
  background: var(--primary-fixed);
  color: var(--primary-container);
}

/* ---- TABLE ---- */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-label);
  font-size: var(--text-label-md);
  font-weight: 600;
  color: var(--on-surface-variant);
  background: var(--surface-container-low);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.data-table th:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.data-table th:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.data-table td {
  padding: var(--space-4);
  font-size: var(--text-body-sm);
  color: var(--on-surface);
}
.data-table tbody tr {
  transition: background var(--transition-fast);
}
.data-table tbody tr:hover {
  background: var(--surface-container-low);
}

/* ---- TABS ---- */
.tabs {
  display: flex;
  gap: var(--space-1);
  background: var(--surface-container);
  border-radius: var(--radius-md);
  padding: var(--space-1);
}
.tab {
  flex: 1;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius);
  font-family: var(--font-label);
  font-size: var(--text-label-lg);
  font-weight: 500;
  color: var(--on-surface-variant);
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all var(--transition-fast);
  text-align: center;
}
.tab:hover { color: var(--on-surface); }
.tab.active {
  background: var(--surface-container-lowest);
  color: var(--primary);
  font-weight: 600;
  box-shadow: var(--shadow-card);
}

/* ---- AVATAR ---- */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.avatar-initials {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}
.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar-md { width: 40px; height: 40px; font-size: 0.875rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.125rem; }
.avatar-xl { width: 72px; height: 72px; font-size: 1.5rem; }

/* ---- DIVIDER ---- */
.divider {
  height: 1px;
  background: var(--outline-subtle);
  margin: var(--space-6) 0;
}

/* ---- ESCROW WALLET WIDGET ---- */
.wallet-card {
  background: var(--gradient-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  color: white;
  position: relative;
  overflow: hidden;
}
.wallet-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}
.wallet-card::after {
  content: '';
  position: absolute;
  bottom: -60px;
  right: 60px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
}
.wallet-label {
  font-size: var(--text-label-lg);
  font-weight: 500;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.wallet-balance {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-top: var(--space-2);
}
.wallet-sub {
  font-size: var(--text-body-sm);
  color: rgba(255,255,255,0.55);
  margin-top: var(--space-1);
}
.wallet-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-6);
}
.wallet-btn {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  font-family: var(--font-label);
  font-size: var(--text-label-lg);
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}
.wallet-btn-primary {
  background: white;
  color: var(--primary);
}
.wallet-btn-primary:hover {
  background: rgba(255,255,255,0.9);
  transform: translateY(-1px);
}
.wallet-btn-secondary {
  background: rgba(255,255,255,0.12);
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
}
.wallet-btn-secondary:hover {
  background: rgba(255,255,255,0.18);
}

/* ---- TRUST SCORE ---- */
.trust-score {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.trust-score-ring {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}
.trust-score-ring svg {
  transform: rotate(-90deg);
}
.trust-score-ring .score-bg {
  fill: none;
  stroke: var(--surface-container-high);
  stroke-width: 6;
}
.trust-score-ring .score-fill {
  fill: none;
  stroke: var(--secondary);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 220;
  stroke-dashoffset: 44;
  transition: stroke-dashoffset 1s ease;
}
.trust-score-ring .score-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
}

/* ---- DEAL TYPE CARD ---- */
.deal-type-card {
  background: var(--surface-container-lowest);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: all var(--transition-base);
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}
.deal-type-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-ambient);
}
.deal-type-card.selected {
  border-color: var(--secondary);
  background: linear-gradient(135deg, rgba(0,108,74,0.03) 0%, rgba(0,108,74,0.07) 100%);
}
.deal-type-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: var(--space-4);
}

/* ---- FILE UPLOAD ---- */
.file-drop {
  border: 2px dashed var(--outline-variant);
  border-radius: var(--radius-lg);
  padding: var(--space-10);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--surface-container-low);
}
.file-drop:hover, .file-drop.drag-over {
  border-color: var(--secondary);
  background: rgba(0,108,74,0.04);
}
.file-drop-icon {
  font-size: 2.5rem;
  color: var(--outline);
  margin-bottom: var(--space-3);
}

/* ---- NOTIFICATION TOAST ---- */
.toast-container {
  position: fixed;
  top: 80px;
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 380px;
  width: 100%;
}
.toast {
  background: var(--primary);
  color: white;
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  box-shadow: var(--shadow-elevated);
  animation: slide-in-left 300ms cubic-bezier(0.4, 0, 0.2, 1);
}
.toast.success { background: var(--secondary); }
.toast.warning { background: #92400e; }
.toast.error { background: var(--error); }
.toast-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.toast-body { flex: 1; }
.toast-title { font-weight: 600; font-size: var(--text-body-sm); }
.toast-msg { font-size: var(--text-label-md); opacity: 0.8; margin-top: 2px; }

/* ---- SECTION HEADER ---- */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}
.section-eyebrow {
  font-family: var(--font-label);
  font-size: var(--text-label-sm);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: var(--space-2);
}

/* ---- HERO ---- */
.hero {
  padding: calc(72px + var(--space-16)) 0 var(--space-24);
  background: var(--surface);
  position: relative;
  overflow: hidden;
  /* Dot grid pattern */
  background-image:
    radial-gradient(circle at 20% 50%, rgba(130,245,193,0.13) 0%, transparent 55%),
    radial-gradient(circle at 80% 20%, rgba(59,111,212,0.09) 0%, transparent 50%),
    radial-gradient(circle at 60% 85%, rgba(0,15,34,0.05) 0%, transparent 45%),
    radial-gradient(rgba(0,15,34,0.035) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 28px 28px;
  animation: heroBgShift 14s ease-in-out infinite alternate;
}
@keyframes heroBgShift {
  0%   { background-position: 0% 0%, 0% 0%, 0% 0%, 0 0; }
  100% { background-position: 2% 3%, -2% 2%, 1% -2%, 0 0; }
}
.hero::before {
  content: '';
  position: absolute;
  top: -180px;
  right: -150px;
  width: 750px;
  height: 750px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(130,245,193,0.14) 0%, transparent 65%);
  pointer-events: none;
  animation: heroOrb1 10s ease-in-out infinite alternate;
}
@keyframes heroOrb1 {
  0%   { transform: translate(0,0) scale(1); }
  100% { transform: translate(-30px, 40px) scale(1.08); }
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -80px;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59,111,212,0.07) 0%, transparent 65%);
  pointer-events: none;
  animation: heroOrb2 13s ease-in-out infinite alternate;
}
@keyframes heroOrb2 {
  0%   { transform: translate(0,0) scale(1); }
  100% { transform: translate(25px,-30px) scale(1.06); }
}

/* ---- HOW IT WORKS ---- */
.step-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
}
.step-number {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
}

/* ---- TESTIMONIAL ---- */
.testimonial-card {
  background: var(--surface-container-lowest);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-card);
  position: relative;
  border-top: 3px solid transparent;
  background-clip: padding-box;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
}
.testimonial-card::before {
  content: '\201C';
  position: absolute;
  top: 12px;
  right: 20px;
  font-size: 6rem;
  line-height: 1;
  color: var(--primary);
  opacity: 0.06;
  font-family: Georgia, serif;
  pointer-events: none;
}
.testimonial-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--secondary) 0%, var(--primary) 100%);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,15,34,0.12);
}
.testimonial-stars {
  display: flex;
  gap: 2px;
  margin-bottom: var(--space-4);
}
.testimonial-stars span {
  color: #f59e0b;
  font-size: 1.1rem;
  line-height: 1;
}
.testimonial-text {
  font-size: var(--text-body-md);
  color: var(--on-surface);
  line-height: 1.7;
  position: relative;
  z-index: 1;
}
.testimonial-author {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-6);
}
.testimonial-name {
  font-weight: 700;
  font-size: var(--text-body-sm);
  color: var(--on-surface);
}
.testimonial-location {
  font-size: var(--text-label-md);
  color: var(--on-surface-variant);
}

/* ---- FOOTER ---- */
.footer {
  background:
    radial-gradient(ellipse at 15% 0%, rgba(130,245,193,0.07) 0%, transparent 45%),
    radial-gradient(ellipse at 85% 100%, rgba(59,111,212,0.08) 0%, transparent 45%),
    var(--primary);
  color: rgba(255,255,255,0.75);
  padding: var(--space-16) 0 var(--space-8);
  border-top: 3px solid transparent;
  background-clip: padding-box;
  position: relative;
}
.footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--secondary) 0%, #3b6fd4 50%, var(--secondary) 100%);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-12);
  padding-bottom: var(--space-12);
}
.footer-brand p {
  font-size: var(--text-body-sm);
  line-height: 1.7;
  margin-top: var(--space-4);
  color: rgba(255,255,255,0.55);
}
.footer-title {
  font-family: var(--font-headline);
  font-size: var(--text-label-lg);
  font-weight: 700;
  color: white;
  margin-bottom: var(--space-4);
}
.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.footer-link {
  font-size: var(--text-body-sm);
  color: rgba(255,255,255,0.55);
  transition: color var(--transition-fast);
}
.footer-link:hover { color: white; }
.footer-bottom a.footer-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.footer-bottom a.footer-link:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.25);
  transform: translateY(-2px);
  color: white;
}
.footer-bottom {
  padding-top: var(--space-8);
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-label-md);
  color: rgba(255,255,255,0.35);
}

/* ---- RESPONSIVE NAV MOBILE ---- */
.nav-mobile-menu {
  display: none;
}
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: var(--space-2);
}
.hamburger span {
  width: 22px;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
  transition: all var(--transition-fast);
}

/* ---- TOPBAR HAMBURGER ---- */
.topbar-hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: var(--space-2);
  background: transparent;
  border: none;
  outline: none;
  flex-shrink: 0;
}
.topbar-hamburger span {
  width: 20px;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
  transition: all var(--transition-fast);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 15, 34, 0.4);
  backdrop-filter: blur(2px);
  z-index: calc(var(--z-overlay) - 1);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}
.sidebar-overlay.open {
  opacity: 1;
  pointer-events: all;
}

@media (max-width: 1024px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .topbar-hamburger {
    display: flex;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 260px;
    height: 100vh;
    z-index: var(--z-overlay);
    transition: transform var(--transition-base);
    box-shadow: var(--shadow-elevated);
    display: flex;
  }
  .sidebar.open {
    transform: translateX(280px);
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }
  .nav-links { display: none; }
  .hamburger { display: flex; }
}
@media (max-width: 768px) {
  .wallet-card { padding: var(--space-6); }
  .wallet-balance { font-size: 2rem; }
  .footer-grid { grid-template-columns: 1fr; gap: var(--space-6); }
  .footer-bottom { flex-direction: column; gap: var(--space-3); text-align: center; }
  .app-content { padding: var(--space-4); }
  .app-topbar { padding: var(--space-3) var(--space-4); }
}
@media (max-width: 480px) {
  .nav-ctas { display: none; }
  .nav-logo { font-size: 1.05rem; }
}
