/* ══════════════════════════════════════════════════════════
   DARKO PAYMENT — STYLE.CSS
   Premium black + gold Telegram Mini App design
   ══════════════════════════════════════════════════════════ */

/* ── CSS RESET ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

/* ── CSS VARIABLES ── */
:root {
  /* Colors */
  --bg:              #000000;
  --bg-alt:          #0a0a0a;
  --surface:         #111111;
  --surface-2:       #161616;
  --surface-3:       #1c1c1c;
  --border:          rgba(255, 255, 255, 0.07);
  --border-hover:    rgba(245, 166, 35, 0.35);

  --gold:            #F5A623;
  --gold-light:      #FFD166;
  --gold-dim:        rgba(245, 166, 35, 0.12);
  --gold-glow:       rgba(245, 166, 35, 0.25);

  --success:         #22c55e;
  --success-dim:     rgba(34, 197, 94, 0.12);
  --error:           #ef4444;
  --error-dim:       rgba(239, 68, 68, 0.12);
  --warning:         #f59e0b;

  --text-primary:    #FFFFFF;
  --text-secondary:  #8A8A9A;
  --text-muted:      #4a4a5a;

  /* Typography */
  --font:            'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing */
  --header-h:        56px;
  --nav-h:           68px;
  --radius-sm:       8px;
  --radius:          14px;
  --radius-lg:       20px;
  --radius-xl:       28px;

  /* Transitions */
  --transition:      0.2s ease;
  --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);

  /* Safe areas */
  --safe-top:        env(safe-area-inset-top, 0px);
  --safe-bottom:     env(safe-area-inset-bottom, 0px);
  --safe-left:       env(safe-area-inset-left, 0px);
  --safe-right:      env(safe-area-inset-right, 0px);
}

/* ── BASE ── */
html {
  height: 100%;
  height: -webkit-fill-available;
  overscroll-behavior: none;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.5;
}

button {
  font-family: var(--font);
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  font-size: inherit;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

input {
  font-family: var(--font);
  color: var(--text-primary);
  outline: none;
  border: none;
  background: none;
}

a {
  color: var(--gold);
  text-decoration: none;
}

/* ═══════════════════════════════════════════════
   LOADING SCREEN
═══════════════════════════════════════════════ */
.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  z-index: 9999;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

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

.loading-logo-icon {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: logoPulse 2s ease-in-out infinite;
}

.loading-logo-text {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner-ring {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(245, 166, 35, 0.15);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-text {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

@keyframes logoPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.85; }
}

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

/* ═══════════════════════════════════════════════
   APP CONTAINER
═══════════════════════════════════════════════ */
.app-container {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

/* ═══════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════ */
.header {
  position: relative;
  z-index: 100;
  height: var(--header-h);
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 20px;
}

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

.header-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.header-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #000;
  flex-shrink: 0;
  cursor: default;
}

/* ═══════════════════════════════════════════════
   SECTIONS WRAPPER
═══════════════════════════════════════════════ */
.sections-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.section {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.section.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.section-scroll {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0 calc(var(--nav-h) + 16px) 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.section-scroll::-webkit-scrollbar { display: none; }

/* ═══════════════════════════════════════════════
   SECTION HEADER
═══════════════════════════════════════════════ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 20px 16px;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════
   BOTTOM NAVIGATION
═══════════════════════════════════════════════ */
.bottom-nav {
  position: relative;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
  padding-top: 10px;
  flex-shrink: 0;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
  color: var(--text-muted);
  position: relative;
  min-height: 48px;
}

.nav-item.active {
  color: var(--gold);
}

.nav-item.active .nav-icon {
  background: var(--gold-dim);
  border-radius: 10px;
}

.nav-item--dim {
  opacity: 0.4;
  cursor: not-allowed;
}

.nav-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-radius var(--transition);
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1;
}

.nav-badge {
  position: absolute;
  top: 2px;
  right: calc(50% - 18px);
  min-width: 16px;
  height: 16px;
  background: var(--gold);
  color: #000;
  font-size: 9px;
  font-weight: 800;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

.nav-soon {
  font-size: 8px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1;
  opacity: 0.6;
}

/* ═══════════════════════════════════════════════
   HOME SECTION
═══════════════════════════════════════════════ */
.greeting-block {
  padding: 28px 20px 8px;
}

.greeting-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 4px;
}

.greeting-sub {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

/* ── Stats Grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 20px 20px 8px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245,166,35,0.3), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.stat-card:not(.stat-card--dim):hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.stat-card:not(.stat-card--dim):hover::before {
  opacity: 1;
}

.stat-card--dim {
  opacity: 0.6;
}

.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.stat-icon--gold {
  background: var(--gold-dim);
  color: var(--gold);
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-value--dim {
  background: none;
  -webkit-background-clip: initial;
  -webkit-text-fill-color: var(--text-muted);
  background-clip: initial;
  font-size: 22px;
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.2px;
  line-height: 1.3;
}

.stat-soon {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  padding: 2px 5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ── Quick Actions ── */
.quick-actions {
  padding: 16px 20px;
}

/* ── Section Block ── */
.section-block {
  padding: 8px 20px 20px;
}

.section-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-block-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════
   PROFILE CARDS
═══════════════════════════════════════════════ */
.profiles-list {
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Single Profile Luxury Card */
.profile-single-card {
  background: var(--surface);
  border: 1px solid rgba(245, 166, 35, 0.25);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.profile-single-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #F5A623, #FFD074);
}

.profile-single-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.profile-single-info {
  flex: 1;
  min-width: 0;
}

.profile-single-name {
  font-size: 17px;
  font-weight: 700;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-single-phone {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.profile-status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
  background: var(--surface-2);
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.status-grid-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.status-grid-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.status-grid-value {
  font-size: 13px;
  font-weight: 600;
  color: #FFFFFF;
}

.profile-feature-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  padding: 12px;
  background: rgba(46, 204, 113, 0.05);
  border: 1px solid rgba(46, 204, 113, 0.2);
  border-radius: var(--radius);
}

.profile-feature-item {
  font-size: 12px;
  color: #E0E0E8;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}

.btn-profile-disconnect {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(235, 87, 87, 0.1);
  border: 1px solid rgba(235, 87, 87, 0.3);
  color: #EB5757;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-profile-disconnect:hover, .btn-profile-disconnect:active {
  background: rgba(235, 87, 87, 0.18);
  border-color: #EB5757;
}

.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  /* Glassmorphism */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.profile-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(245,166,35,0.03) 0%, transparent 60%);
  pointer-events: none;
}

.profile-card:active {
  transform: scale(0.985);
}

.profile-card:hover {
  border-color: rgba(245, 166, 35, 0.3);
  box-shadow: 0 4px 24px rgba(245, 166, 35, 0.07);
}

.profile-card-body {
  flex: 1;
  min-width: 0;
}

.profile-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.profile-card-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-card-phone {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 10px;
  font-variant-numeric: tabular-nums;
}

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

.profile-card-date {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.profile-card-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.btn-delete {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), transform var(--transition);
  flex-shrink: 0;
}

.btn-delete:active {
  background: rgba(239, 68, 68, 0.2);
  transform: scale(0.9);
}

/* ── Skeleton ── */
.profiles-skeleton {
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-card-skeleton {
  height: 110px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}

.profile-card-skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.03) 50%, transparent 100%);
  animation: shimmer 1.5s infinite;
  transform: translateX(-100%);
}

@keyframes shimmer {
  to { transform: translateX(100%); }
}

/* ═══════════════════════════════════════════════
   AVATAR
═══════════════════════════════════════════════ */
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  color: #000;
  flex-shrink: 0;
  letter-spacing: -0.5px;
  box-shadow: 0 2px 12px rgba(245, 166, 35, 0.3);
}

.avatar--large {
  width: 60px;
  height: 60px;
  font-size: 20px;
  box-shadow: 0 4px 20px rgba(245, 166, 35, 0.35);
}

/* ═══════════════════════════════════════════════
   BADGES
═══════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1;
}

.badge--success {
  background: var(--success-dim);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge--warning {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge--dc {
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: 10px;
}

/* ═══════════════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  text-align: center;
  gap: 12px;
}

.empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.empty-icon--large {
  width: 96px;
  height: 96px;
  border-radius: 32px;
}

.empty-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.empty-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 260px;
}

/* ═══════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════ */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 52px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #000;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.2px;
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 20px rgba(245, 166, 35, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.btn-primary:hover::before { opacity: 1; }

.btn-primary:active {
  opacity: 0.9;
  transform: scale(0.98);
  box-shadow: 0 2px 10px rgba(245, 166, 35, 0.2);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary--small {
  height: 42px;
  font-size: 14px;
  width: auto;
  padding: 0 24px;
}

.btn-ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 44px;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 14px;
  transition: color var(--transition), background var(--transition);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
}

.btn-ghost:active {
  background: rgba(255,255,255,0.07);
}

.btn-danger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  background: var(--error-dim);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.2);
  font-weight: 700;
  font-size: 15px;
  transition: background var(--transition), transform var(--transition);
  flex: 1;
}

.btn-danger:active {
  background: rgba(239, 68, 68, 0.2);
  transform: scale(0.97);
}

.btn-icon-gold {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--gold-dim);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(245, 166, 35, 0.2);
  transition: background var(--transition), transform var(--transition);
}

.btn-icon-gold:active {
  background: rgba(245, 166, 35, 0.2);
  transform: scale(0.93);
}

/* Button spinner */
.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0,0,0,0.3);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════
   MODAL OVERLAY
═══════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: flex-end;
  padding-bottom: var(--safe-bottom);
  animation: fadeIn 0.25s ease;
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ═══════════════════════════════════════════════
   MODAL SHEET (bottom sheet)
═══════════════════════════════════════════════ */
.modal-sheet {
  width: 100%;
  background: var(--surface-2);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 12px 24px 32px;
  border-top: 1px solid var(--border);
  animation: slideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 auto 20px;
}

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

.modal-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}

.modal-close:active {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
}

.modal-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 24px;
}

.modal-step {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ═══════════════════════════════════════════════
   FORM ELEMENTS
═══════════════════════════════════════════════ */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.form-hint {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}

/* ── Phone Input ── */
.phone-input-wrapper {
  display: flex;
  align-items: center;
  background: var(--surface-3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.phone-input-wrapper:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.12);
}

.phone-prefix {
  padding: 0 14px;
  font-weight: 700;
  font-size: 16px;
  color: var(--gold);
  border-right: 1.5px solid var(--border);
  height: 52px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  background: rgba(245, 166, 35, 0.04);
  letter-spacing: 0.3px;
}

.phone-input {
  flex: 1;
  height: 52px;
  padding: 0 16px;
  font-size: 17px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.5px;
  caret-color: var(--gold);
}

.phone-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

/* ── OTP Container ── */
.otp-container {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 4px 0 20px;
}

.otp-box {
  width: 52px;
  height: 60px;
  border-radius: var(--radius);
  background: var(--surface-3);
  border: 1.5px solid var(--border);
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 800;
  text-align: center;
  caret-color: transparent;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition), background var(--transition);
  letter-spacing: 0;
}

.otp-box:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.15);
  background: rgba(245, 166, 35, 0.04);
  outline: none;
  transform: scale(1.03);
}

.otp-box.filled {
  border-color: rgba(245, 166, 35, 0.4);
  background: rgba(245, 166, 35, 0.06);
  color: var(--gold-light);
}

.otp-box.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* ── OTP Timer ── */
.otp-timer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.otp-timer {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.otp-resend {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.otp-resend:not(:disabled) {
  color: var(--gold);
}

.otp-resend:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* ═══════════════════════════════════════════════
   SUCCESS STATE
═══════════════════════════════════════════════ */
.success-animation {
  display: flex;
  justify-content: center;
  margin: 20px 0 24px;
}

.success-circle {
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-circle-bg {
  stroke-dasharray: 157;
  stroke-dashoffset: 157;
  animation: drawCircle 0.6s ease forwards;
}

.success-checkmark {
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  animation: drawCheck 0.4s ease 0.5s forwards;
}

@keyframes drawCircle {
  to { stroke-dashoffset: 0; }
}

@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}

.success-title {
  font-size: 20px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 10px;
  letter-spacing: -0.4px;
}

.success-profile-name {
  text-align: center;
  color: var(--gold);
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 28px;
  padding: 10px 20px;
  background: var(--gold-dim);
  border-radius: var(--radius);
  border: 1px solid rgba(245, 166, 35, 0.2);
}

/* ═══════════════════════════════════════════════
   CONFIRM MODAL
═══════════════════════════════════════════════ */
.confirm-overlay {
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.confirm-sheet {
  background: var(--surface-2);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  width: 100%;
  max-width: 340px;
  border: 1px solid var(--border);
  animation: popIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

@keyframes popIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.confirm-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: var(--error-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.confirm-title {
  font-size: 18px;
  font-weight: 800;
}

.confirm-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}

.confirm-actions .btn-ghost {
  flex: 1;
  height: 48px;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius);
}

.confirm-actions .btn-danger {
  height: 48px;
}

/* ═══════════════════════════════════════════════
   SETTINGS SECTION
═══════════════════════════════════════════════ */
.settings-user-card {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 20px 24px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.settings-user-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245,166,35,0.4), transparent);
}

.settings-user-info {
  flex: 1;
  min-width: 0;
}

.settings-user-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-user-id {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.settings-group {
  margin: 0 20px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.settings-group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 16px 2px;
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.settings-item:last-child { border-bottom: none; }

.settings-item--block {
  flex-direction: column;
  align-items: flex-start;
}

.settings-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

.settings-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.settings-item-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.settings-item-value--success {
  color: var(--success);
}

.settings-note {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 8px;
}

.settings-group.settings-group {
  background: none;
  border: none;
}

.settings-danger-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 15px;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.settings-danger-btn:not(:disabled):hover {
  background: var(--error-dim);
  color: var(--error);
  border-color: rgba(239, 68, 68, 0.2);
}

.settings-danger-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════════
   TOAST NOTIFICATIONS
═══════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  top: calc(var(--header-h) + var(--safe-top) + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: calc(100% - 40px);
  max-width: 340px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: toastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.toast.hiding {
  animation: toastOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.toast--success {
  background: rgba(22, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: var(--success);
}

.toast--error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--error);
}

.toast--info {
  background: rgba(245, 166, 35, 0.12);
  border: 1px solid rgba(245, 166, 35, 0.25);
  color: var(--gold);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-10px) scale(0.95); }
}

/* ═══════════════════════════════════════════════
   SCROLLBAR
═══════════════════════════════════════════════ */
::-webkit-scrollbar { width: 0; height: 0; }

/* ═══════════════════════════════════════════════
   SELECTION
═══════════════════════════════════════════════ */
::selection {
  background: rgba(245, 166, 35, 0.3);
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════ */
@media (prefers-color-scheme: light) {
  /* Telegram handles theming — keep dark by default */
}

@media (max-width: 360px) {
  .stats-grid { gap: 8px; }
  .otp-box { width: 46px; height: 56px; font-size: 22px; }
  .otp-container { gap: 8px; }
}

/* ── Modal Method Tabs ── */
.modal-tabs {
  display: flex;
  gap: 8px;
  background: var(--surface-2);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.modal-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.modal-tab.active {
  background: var(--surface-3);
  color: var(--gold);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.modal-tab-content {
  display: flex;
  flex-direction: column;
}

/* ── QR Box ── */
.qr-box-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 10px 0 14px;
}

.qr-code-container {
  background: #FFFFFF;
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(245, 166, 35, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 220px;
  min-height: 220px;
}

.qr-code-container svg {
  display: block;
  width: 196px;
  height: 196px;
}

.qr-status {
  text-align: center;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--gold);
  margin-bottom: 14px;
}

.qr-instructions {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.qr-instructions b {
  color: var(--text-primary);
}

.phone-desktop-alert {
  background: rgba(245, 166, 35, 0.08);
  border: 1px solid rgba(245, 166, 35, 0.25);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 12.5px;
  color: #FFD166;
  text-align: left;
  line-height: 1.45;
}

/* ── Luxury Card UI (Apple Wallet Dark / Gold) ── */
.total-balance-card {
  background: linear-gradient(135deg, rgba(245, 166, 35, 0.16) 0%, rgba(20, 20, 20, 0.95) 100%);
  border: 1px solid rgba(245, 166, 35, 0.35);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.total-balance-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 4px;
}

.total-balance-value {
  font-size: 24px;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -0.5px;
}

.total-balance-currency {
  font-size: 15px;
  color: var(--gold);
  font-weight: 600;
  margin-left: 4px;
}

/* ── Bot Status Warnings / Guidance ── */
.cards-warnings {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.card-warning-box {
  background: rgba(26, 26, 30, 0.95);
  border: 1px solid rgba(245, 166, 35, 0.3);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.card-warning-box--error {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.08);
}

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

.card-warning-bot-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.card-warning-bot-badge--humo {
  background: rgba(245, 166, 35, 0.2);
  color: var(--gold);
}

.card-warning-bot-badge--uzcard {
  background: rgba(0, 168, 150, 0.2);
  color: #00A896;
}

.card-warning-msg {
  font-size: 13px;
  color: #D1D1D6;
  line-height: 1.45;
}

.card-warning-action-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 166, 35, 0.15);
  border: 1px solid rgba(245, 166, 35, 0.4);
  color: var(--gold);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.card-warning-action-btn:active {
  transform: scale(0.97);
  background: rgba(245, 166, 35, 0.25);
}

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

.bank-card {
  position: relative;
  background: linear-gradient(135deg, #1C1C1E 0%, #121214 45%, #1A160E 100%);
  border: 1.5px solid rgba(245, 166, 35, 0.28);
  border-radius: 20px;
  padding: 20px;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bank-card::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(245, 166, 35, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.bank-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 2;
}

.bank-card-bank {
  font-size: 13.5px;
  font-weight: 700;
  color: #FFFFFF;
  text-transform: uppercase;
  letter-spacing: 1.1px;
}

.bank-card-badge {
  padding: 3px 9px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.badge-uzcard {
  background: rgba(0, 168, 150, 0.2);
  color: #00E5C9;
  border: 1px solid rgba(0, 229, 201, 0.35);
}

.badge-humo {
  background: rgba(245, 166, 35, 0.2);
  color: #FFD166;
  border: 1px solid rgba(245, 166, 35, 0.4);
}

.bank-card-chip-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 6px;
}

.emv-chip {
  width: 38px;
  height: 28px;
  background: linear-gradient(135deg, #ECC440 0%, #FFDF73 50%, #C99B22 100%);
  border-radius: 6px;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.4), 0 2px 5px rgba(0, 0, 0, 0.4);
  position: relative;
  border: 1px solid #A87E12;
}

.emv-chip::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(0, 0, 0, 0.25);
}

.contactless-icon {
  color: rgba(255, 255, 255, 0.4);
}

.bank-card-number {
  font-family: 'Courier New', Courier, monospace;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #FFFFFF;
  margin: 8px 0 10px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.bank-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  position: relative;
  z-index: 2;
}

.bank-card-holder-name {
  font-size: 12px;
  font-weight: 600;
  color: #FFFFFF;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  max-width: 170px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bank-card-expiry {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.bank-card-balance-block {
  text-align: right;
}

.bank-card-balance-label {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.bank-card-balance {
  font-size: 16px;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.2px;
}

.bank-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.btn-card-action {
  flex: 1;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-card-action:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.btn-card-action--gold {
  background: rgba(245, 166, 35, 0.12);
  border-color: rgba(245, 166, 35, 0.35);
  color: var(--gold);
}

/* ── Card Skeletons & Sync ── */
.cards-skeleton {
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-skeleton {
  height: 190px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.card-skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.03) 50%, transparent 100%);
  animation: shimmer 1.5s infinite;
}

.spinning {
  animation: spin 0.75s linear infinite;
  transform-origin: center center;
}

.card-modal-preview {
  margin: 10px 0 16px;
}

.balance-sync-time {
  font-size: 11px;
  color: var(--text-muted);
}


/* ═══════════════════════════════════════════════
   BANK QUICK SELECT CHIPS
═══════════════════════════════════════════════ */
.bank-chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.bank-chip:hover, .bank-chip:active {
  background: rgba(245, 166, 35, 0.15);
  border-color: var(--gold);
  color: var(--gold);
}

/* ═══════════════════════════════════════════════
   TRANSACTIONS & MONITORING SECTION
═══════════════════════════════════════════════ */
.history-card-filter-row {
  margin: 0 20px 14px;
}

.history-card-select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 13.5px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}

.history-card-select:focus {
  border-color: var(--gold);
}

.history-period-pills {
  display: flex;
  gap: 8px;
  margin: 0 20px 18px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.history-period-pills::-webkit-scrollbar {
  display: none;
}

.period-pill {
  flex: 1;
  min-width: 60px;
  text-align: center;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.period-pill.active {
  background: linear-gradient(135deg, rgba(245, 166, 35, 0.22) 0%, rgba(245, 166, 35, 0.08) 100%);
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 2px 10px rgba(245, 166, 35, 0.15);
}

.history-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0 20px 14px;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
}

.metric-card--income::before {
  background: linear-gradient(90deg, #10B981, #34D399);
}

.metric-card--expense::before {
  background: linear-gradient(90deg, #EF4444, #F87171);
}

.metric-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

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

.metric-dot--green {
  background: #10B981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.metric-dot--red {
  background: #EF4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.metric-value {
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-value--income {
  color: #10B981;
}

.metric-value--expense {
  color: #EF4444;
}

.metric-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.history-net-card {
  margin: 0 20px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.net-card-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.net-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.net-value {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.net-badge {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.history-chart-card {
  margin: 0 20px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 14px;
}

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

.chart-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.chart-legend {
  display: flex;
  gap: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

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

.legend-dot--green { background: #10B981; }
.legend-dot--red { background: #EF4444; }

.chart-svg-container {
  width: 100%;
  height: 150px;
  position: relative;
}

.chart-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* ── Transactions List Stream ── */
.transactions-list {
  margin: 0 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tx-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all var(--transition);
}

.tx-item:hover {
  border-color: rgba(245, 166, 35, 0.3);
  transform: translateY(-1px);
}

.tx-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tx-icon--income {
  background: rgba(16, 185, 129, 0.12);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.tx-icon--expense {
  background: rgba(239, 68, 68, 0.12);
  color: #EF4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.tx-item--invoice {
  background: linear-gradient(90deg, rgba(245, 166, 35, 0.08) 0%, var(--surface) 100%);
  border-left: 3.5px solid var(--gold);
  border-color: rgba(245, 166, 35, 0.35);
  box-shadow: 0 2px 10px rgba(245, 166, 35, 0.06);
}

.tx-item--invoice:hover {
  border-color: var(--gold);
  box-shadow: 0 4px 16px rgba(245, 166, 35, 0.14);
}

.tx-icon--invoice {
  background: rgba(245, 166, 35, 0.16) !important;
  color: var(--gold) !important;
  border: 1px solid rgba(245, 166, 35, 0.45) !important;
}

.tx-invoice-badge {
  display: inline-flex;
  align-items: center;
  gap: 3.5px;
  background: rgba(245, 166, 35, 0.18);
  color: var(--gold);
  border: 1px solid rgba(245, 166, 35, 0.4);
  font-size: 10px;
  font-weight: 700;
  padding: 1.5px 7px;
  border-radius: 5px;
  letter-spacing: 0.2px;
  line-height: 1.3;
}

.tx-info {
  flex: 1;
  min-width: 0;
}

.tx-merchant {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.tx-card-tag {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 10.5px;
  color: var(--text-secondary);
}

.tx-amount-col {
  text-align: right;
  flex-shrink: 0;
}

.tx-amount {
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  margin-bottom: 2px;
}

.tx-amount--income {
  color: #10B981;
}

.tx-amount--expense {
  color: #EF4444;
}

.tx-bal-after {
  font-size: 10.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}


/* ═══════════════════════════════════════════════
   UNIFIED PROFILE & API KEYS & DOCS STYLES
   ═══════════════════════════════════════════════ */
.profile-hero-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(245, 166, 35, 0.08) 0%, rgba(20, 20, 25, 0.8) 100%);
  border: 1px solid rgba(245, 166, 35, 0.22);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.profile-hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.profile-user-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.profile-user-name {
  font-size: 16.5px;
  font-weight: 800;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-user-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.bullet-dot {
  color: #5A5A66;
  font-size: 11px;
}

.profile-merchant-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-radius: 20px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  color: #10B981;
  width: fit-content;
  margin-top: 4px;
}

.status-indicator-green {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 6px #10B981;
  display: inline-block;
}

.btn-icon-gold {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(245, 166, 35, 0.12);
  border: 1px solid rgba(245, 166, 35, 0.3);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon-gold:hover, .btn-icon-gold:active {
  background: rgba(245, 166, 35, 0.25);
  transform: scale(1.05);
}

/* API Keys in Profile */
.api-keys-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.api-key-item-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: var(--transition);
}

.api-key-item-card:hover {
  border-color: rgba(245, 166, 35, 0.25);
}

.api-key-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.api-key-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #FFFFFF;
}

.api-key-prefix {
  font-family: 'Courier New', monospace;
  font-size: 11.5px;
  color: var(--gold);
  background: rgba(245, 166, 35, 0.1);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(245, 166, 35, 0.2);
}

.api-key-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-secondary);
}

.btn-revoke-key {
  background: transparent;
  border: none;
  color: var(--error);
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 4px;
  transition: var(--transition);
}

.btn-revoke-key:hover {
  background: var(--error-dim);
}

/* API Docs Link Banner */
.api-docs-link-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  margin-top: 12px;
  background: linear-gradient(135deg, rgba(245, 166, 35, 0.12), rgba(245, 166, 35, 0.03));
  border: 1px solid rgba(245, 166, 35, 0.28);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.api-docs-link-banner:hover {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(245, 166, 35, 0.18), rgba(245, 166, 35, 0.06));
}

.docs-banner-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(245, 166, 35, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  flex-shrink: 0;
}

/* API Key Modal Secret Box */
.api-key-secret-box {
  background: #0B0E14;
  border: 1px dashed rgba(245, 166, 35, 0.4);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.api-key-secret-val {
  font-family: 'Courier New', monospace;
  font-size: 13px;
  font-weight: 700;
  color: #34D399;
  word-break: break-all;
  user-select: all;
}

/* ═══════════════════════════════════════════════
   API DOCUMENTATION SECTION STYLES
   ═══════════════════════════════════════════════ */
.docs-hero-card {
  background: linear-gradient(135deg, rgba(245, 166, 35, 0.08) 0%, rgba(20, 20, 25, 0.9) 100%);
  border: 1px solid rgba(245, 166, 35, 0.25);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.docs-hero-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gold);
  background: rgba(245, 166, 35, 0.15);
  border: 1px solid rgba(245, 166, 35, 0.3);
  padding: 2px 7px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.docs-hero-title {
  font-size: 17px;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 6px;
}

.docs-hero-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.docs-auth-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  margin-top: 12px;
}

.auth-pill-method {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(245, 166, 35, 0.2);
  color: var(--gold);
}

.docs-auth-badge code {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #FFD166;
}

.docs-endpoint-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.http-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 5px;
  text-transform: uppercase;
}

.http-badge.get {
  background: rgba(16, 185, 129, 0.18);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.http-badge.post {
  background: rgba(59, 130, 246, 0.18);
  color: #3B82F6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.endpoint-path {
  font-family: 'Courier New', monospace;
  font-size: 13.5px;
  font-weight: 700;
  color: #FFFFFF;
}

.endpoint-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 12px;
}

.docs-sub-title {
  font-size: 12px;
  font-weight: 700;
  color: #E2E8F0;
  margin: 12px 0 6px;
}

.docs-table-wrapper {
  overflow-x: auto;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  text-align: left;
}

.docs-table th {
  background: rgba(255, 255, 255, 0.03);
  padding: 7px 10px;
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.docs-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #D1D5DB;
}

.docs-table td code {
  font-family: 'Courier New', monospace;
  color: var(--gold);
  background: rgba(245, 166, 35, 0.1);
  padding: 1px 4px;
  border-radius: 3px;
}

.tag-required {
  font-size: 9.5px;
  font-weight: 800;
  color: var(--error);
  background: var(--error-dim);
  padding: 1px 5px;
  border-radius: 3px;
}

/* Code switch card */
.docs-code-card {
  background: #0B0E14;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-top: 10px;
}

.code-tabs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.code-tabs {
  display: flex;
  gap: 4px;
}

.code-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 5px;
  cursor: pointer;
  transition: var(--transition);
}

.code-tab:hover {
  color: #FFFFFF;
}

.code-tab.active {
  background: rgba(245, 166, 35, 0.18);
  color: var(--gold);
  border: 1px solid rgba(245, 166, 35, 0.3);
}

.btn-copy-code {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #E2E8F0;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
}

.btn-copy-code:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
}

.code-block {
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  line-height: 1.5;
  padding: 12px;
  color: #93C5FD;
  overflow-x: auto;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
}

.json-preview {
  color: #34D399;
  background: #0B0E14;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 11px;
  margin: 6px 0 0;
}

.docs-security-notice {
  background: rgba(245, 166, 35, 0.08);
  border: 1px solid rgba(245, 166, 35, 0.22);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 14px;
  display: flex;
  gap: 10px;
  font-size: 11.5px;
  color: #D1D5DB;
  line-height: 1.5;
}
