/* ============================================================
   خاطرات یک تحلیلگر | Trader's Diary
   استایل‌های مدرن مالی، سیستم ۴ تم اختصاصی و طراحی واکنش‌گرا Mobile-First
============================================================ */

:root {
  /* تم پیش‌فرض: Cyber Dark */
  --bg-primary: #080d1a;
  --bg-secondary: #0f172a;
  --bg-card: #131d33;
  --bg-card-hover: #182542;
  --bg-input: #0a1122;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-active: #0d9488;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-primary: #0d9488;
  --accent-glow: rgba(13, 148, 136, 0.25);
  --accent-gold: #f59e0b;
  --accent-blue: #3b82f6;

  /* استاندارد رنگ‌های بازار ایران: قرمز = صعود، سبز = نزول */
  --color-up: #ef4444;
  --color-down: #10b981;
  --color-up-bg: rgba(239, 68, 68, 0.12);
  --color-down-bg: rgba(16, 185, 129, 0.12);

  --font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Tahoma, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 15px var(--accent-glow);
}

/* سوئیچ جهت رنگ بین‌المللی */
[data-color-scheme="intl"] {
  --color-up: #10b981;
  --color-down: #ef4444;
  --color-up-bg: rgba(16, 185, 129, 0.12);
  --color-down-bg: rgba(239, 68, 68, 0.12);
}

/* تم روشن مینیمال (Light Clean) */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #f8fafc;
  --border-color: rgba(0, 0, 0, 0.08);
  --border-active: #0d9488;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent-primary: #0d9488;
  --accent-glow: rgba(13, 148, 136, 0.15);
  --shadow-card: 0 4px 16px -2px rgba(0, 0, 0, 0.06);
}

/* تم ۱ جدید: آبی سنگی (Slate Blue) — آرام، حرفه‌ای و مناسب مطالعه طولانی */
[data-theme="slate"] {
  --bg-primary: #F4F6F8;
  --bg-secondary: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8FAFC;
  --bg-input: #F1F5F9;
  --border-color: rgba(51, 65, 85, 0.12);
  --border-active: #3B82F6;
  --text-primary: #1E293B;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --accent-primary: #3B82F6;
  --accent-glow: rgba(59, 130, 246, 0.16);
  --shadow-card: 0 4px 16px -2px rgba(51, 65, 85, 0.08);
}

/* تم ۲ جدید: سدر و گرافیت (Sage Graphite) — سبز ملایم، آرام، مدرن و ضد خستگی */
[data-theme="sage"] {
  --bg-primary: #F3F6F3;
  --bg-secondary: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8FAF8;
  --bg-input: #EBF1EC;
  --border-color: rgba(52, 66, 58, 0.12);
  --border-active: #5F8D72;
  --text-primary: #26332C;
  --text-secondary: #68756D;
  --text-muted: #8FA095;
  --accent-primary: #5F8D72;
  --accent-glow: rgba(95, 141, 114, 0.16);
  --shadow-card: 0 4px 16px -2px rgba(52, 66, 58, 0.08);
}

/* تم اختصاصی و پرچمدار: TraderDiaries Luxe — سرمه‌ای عمیق، کارت‌های مات و طلایی لوکس */
[data-theme="traderdiaries"] {
  --bg-primary: #0D1B2A;
  --bg-secondary: #111F33;
  --bg-card: #16253D;
  --bg-card-hover: #1B2A44;
  --bg-input: #16253D;
  --border-color: #26364D;
  --border-active: #D4AF37;
  
  --text-primary: #F8F9FA;
  --text-secondary: #AAB4C3;
  --text-muted: #64748B;
  
  --accent-primary: #D4AF37;
  --accent-glow: rgba(212, 175, 55, 0.24);
  --accent-gold: #E9C46A;
  --accent-blue: #3B82F6;

  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
}

/* تم طلایی لوکس (Gold Luxury) */
[data-theme="gold"] {
  --bg-primary: #0b0904;
  --bg-secondary: #141107;
  --bg-card: #1c170b;
  --bg-card-hover: #262010;
  --bg-input: #0f0d06;
  --border-color: rgba(217, 163, 43, 0.18);
  --border-active: #f59e0b;
  --text-primary: #fffbeb;
  --text-secondary: #d4af37;
  --text-muted: #927734;
  --accent-primary: #d97706;
  --accent-glow: rgba(217, 119, 6, 0.25);
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
}

/* تم زمردی مالی (Emerald Financial) */
[data-theme="emerald"] {
  --bg-primary: #03140e;
  --bg-secondary: #062118;
  --bg-card: #0b2d22;
  --bg-card-hover: #103c2e;
  --bg-input: #041a13;
  --border-color: rgba(16, 185, 129, 0.15);
  --border-active: #10b981;
  --text-primary: #ecfdf5;
  --text-secondary: #a7f3d0;
  --text-muted: #34d399;
  --accent-primary: #059669;
  --accent-glow: rgba(5, 150, 105, 0.25);
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.45);
}

/* ============================================================
   پنهان‌سازی قطعی المان‌های hidden و مودال‌ها
============================================================ */
[hidden],
.modal-overlay[hidden],
.lock-overlay[hidden],
.app-section[hidden] {
  display: none !important;
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  direction: rtl;
  text-align: right;
  line-height: 1.6;
  min-height: 100vh;
  padding-bottom: 85px; /* فضای نوار ناوبری پایین */
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

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

button, input, select, textarea {
  font-family: inherit;
  font-size: 0.95rem;
}

/* Container */
.app-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 16px;
}

/* ============================================================
   Header Component
============================================================ */
.app-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  max-width: 960px;
  margin: 0 auto;
}

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

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  display: block;
}

.brand-details h1 {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 6px;
}

.app-ver-tag {
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--accent-glow);
  color: var(--accent-primary);
  border: 1px solid var(--accent-primary);
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

.header-clock-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.clock-live {
  font-weight: 700;
  color: var(--text-primary);
  background: var(--bg-input);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

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

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
}

.btn-icon.spinning svg {
  animation: spin 1s linear infinite;
}

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

.user-avatar-small {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 2px solid var(--accent-primary);
  object-fit: cover;
  cursor: pointer;
}

/* Status Bar below header */
.header-status-bar {
  background: var(--bg-input);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.78rem;
  padding: 4px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 960px;
  margin: 0 auto;
}

.market-gate-badge {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.gate-open {
  background: var(--color-down-bg);
  color: var(--color-down);
}

.gate-closed {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
}

.gate-preopen {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

/* ============================================================
   Hadith Banner
============================================================ */
.hadith-banner {
  background: linear-gradient(90deg, rgba(13, 148, 136, 0.1), rgba(59, 130, 246, 0.08));
  border: 1px solid rgba(13, 148, 136, 0.2);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.hadith-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.hadith-text-box {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.hadith-src {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: block;
  margin-top: 2px;
}

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

/* ============================================================
   Market Sub-Tabs (داشبورد / داخلی / جهانی / کریپتو / هوش بازار)
============================================================ */
.market-sub-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 14px;
  scrollbar-width: none;
}

.market-sub-nav::-webkit-scrollbar {
  display: none;
}

.sub-nav-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sub-nav-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}

/* Dual Currency Segmented Control */
.dual-currency-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 6px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.currency-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.segmented-control {
  display: flex;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  padding: 2px;
}

.seg-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.seg-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
}

/* ============================================================
   Market Cards Grid & Cards
============================================================ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.dashboard-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.market-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.market-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-active);
  background: var(--bg-card-hover);
}

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

.asset-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.asset-emoji {
  font-size: 1.3rem;
}

.asset-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
}

.asset-short {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* Status Badges */
.status-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.status-live { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.status-manual { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.status-estimated { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.status-cached { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }
.status-stale { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.status-unavailable { background: rgba(100, 116, 139, 0.2); color: #64748b; }
.status-derived-live { background: rgba(13, 148, 136, 0.18); color: #0d9488; }
.status-derived-stale { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }

.price-box {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 10px;
}

.price-value {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

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

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
  font-size: 0.76rem;
}

.pct-pill {
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.pct-up {
  background: var(--color-up-bg);
  color: var(--color-up);
}

.pct-down {
  background: var(--color-down-bg);
  color: var(--color-down);
}

.pct-neutral {
  background: var(--bg-input);
  color: var(--text-muted);
}

.update-time {
  color: var(--text-muted);
}

/* Category Sections */
.category-section {
  margin-bottom: 20px;
}

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

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

/* Section Intro Banner */
.section-intro {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 14px;
}

.intro-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 4px;
}

.intro-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
}

/* ============================================================
   Intelligence Cards
============================================================ */
.intelligence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}

.intel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}

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

.intel-tag {
  background: var(--bg-input);
  font-size: 0.74rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
}

.intel-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-gold);
}

.intel-title {
  font-size: 1rem;
  margin-bottom: 6px;
}

.intel-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.intel-analysis {
  background: var(--bg-input);
  border-right: 3px solid var(--accent-primary);
  padding: 8px 10px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.82rem;
  color: var(--text-primary);
}

/* ============================================================
   Data Bank View & Table
============================================================ */
.databank-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  background: var(--bg-secondary);
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.toolbar-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

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

.table-responsive {
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.financial-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  text-align: right;
}

.financial-table th,
.financial-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.financial-table th {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 700;
}

.financial-table tbody tr {
  cursor: pointer;
  transition: background 0.15s ease;
}

.financial-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.date-cell {
  display: flex;
  flex-direction: column;
}

.date-jalali {
  font-weight: 700;
  color: var(--text-primary);
}

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

.badge {
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.badge-auto { background: rgba(13, 148, 136, 0.15); color: #0d9488; }
.badge-manual { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* ============================================================
   Smart Reports View
============================================================ */
.reports-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.report-type-btn {
  flex: 1;
  padding: 9px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.report-type-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
}

.report-output-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
}

.report-pre {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-primary);
}

.report-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ============================================================
   Charts View
============================================================ */
.chart-controls-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  background: var(--bg-secondary);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.chart-ranges {
  display: flex;
  gap: 4px;
}

.chart-range-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.chart-range-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
}

.chart-indicators-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  background: var(--bg-secondary);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 12px;
}

.indicator-pill {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.indicator-pill:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.indicator-pill.active {
  background: rgba(13, 148, 136, 0.2);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.indicator-pill[data-ind="sma10"].active { border-color: #3b82f6; color: #3b82f6; background: rgba(59, 130, 246, 0.15); }
.indicator-pill[data-ind="sma21"].active { border-color: #8b5cf6; color: #8b5cf6; background: rgba(139, 92, 246, 0.15); }
.indicator-pill[data-ind="sma60"].active { border-color: #ec4899; color: #ec4899; background: rgba(236, 72, 153, 0.15); }
.indicator-pill[data-ind="ema10"].active { border-color: #06b6d4; color: #06b6d4; background: rgba(6, 182, 212, 0.15); }
.indicator-pill[data-ind="ema21"].active { border-color: #10b981; color: #10b981; background: rgba(16, 185, 129, 0.15); }
.indicator-pill[data-ind="ema60"].active { border-color: #f59e0b; color: #f59e0b; background: rgba(245, 158, 11, 0.15); }

.chart-metrics-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  margin-bottom: 12px;
}

.metrics-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.75rem;
}

.metric-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  color: var(--text-primary);
}

.chart-canvas-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 20px;
  min-height: 260px;
}

.returns-matrix-section h3 {
  font-size: 1.05rem;
  margin-bottom: 10px;
}

/* ============================================================
   Diary View
============================================================ */
.diary-input-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.diary-input-card h3 {
  font-size: 1rem;
  margin-bottom: 12px;
}

.form-group {
  margin-bottom: 12px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control, .input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 9px 12px;
  border-radius: var(--radius-md);
  transition: border-color 0.2s ease;
}

.form-control:focus, .input:focus {
  outline: none;
  border-color: var(--border-active);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.diary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
}

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

.diary-date-jalali {
  font-weight: 700;
  font-size: 0.9rem;
}

.diary-time {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-right: 6px;
}

.mood-badge {
  font-size: 0.74rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.mood-bullish { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.mood-bearish { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.mood-neutral { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }
.mood-volatile { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.mood-cautious { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }

.diary-text {
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 8px;
}

.diary-snap-ref {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-input);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}

.diary-actions {
  display: flex;
  justify-content: flex-end;
}

/* ============================================================
   Profile & Settings View
============================================================ */
.settings-section-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.settings-section-card h3 {
  font-size: 1.05rem;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.avatar-preview-box {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.big-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  border: 3px solid var(--accent-primary);
}

.avatars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

/* ============================================================
   چرخ‌وفلک سه‌بعدی آواتارها (3D Cylindrical Carousel - Phase 3)
============================================================ */
.avatar-carousel-3d-wrapper {
  position: relative;
  width: 100%;
  margin-top: 10px;
  margin-bottom: 16px;
  padding: 16px 8px 14px 8px;
  background: radial-gradient(circle at 50% 35%, rgba(13, 148, 136, 0.08) 0%, rgba(15, 23, 42, 0.45) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.carousel-3d-stage {
  position: relative;
  width: 100%;
  max-width: 380px;
  height: 185px;
  perspective: 900px;
  perspective-origin: 50% 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.carousel-3d-ring {
  position: absolute;
  width: 105px;
  height: 125px;
  transform-style: preserve-3d;
  transition: transform 0.48s cubic-bezier(0.18, 0.89, 0.32, 1.12);
  will-change: transform;
}

.carousel-3d-ring.is-dragging {
  transition: none;
}

.carousel-3d-item {
  position: absolute;
  left: 0;
  top: 0;
  width: 105px;
  height: 125px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  cursor: pointer;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease, filter 0.3s ease;
  backface-visibility: visible;
  opacity: 0.45;
  filter: brightness(0.75) blur(0.5px);
}

.carousel-3d-item.is-active {
  opacity: 1;
  filter: brightness(1.05) blur(0);
  border-color: var(--accent-primary);
  box-shadow: 0 0 25px var(--accent-glow), 0 10px 30px rgba(0, 0, 0, 0.6);
  background: linear-gradient(180deg, var(--bg-card-hover) 0%, var(--bg-card) 100%);
}

.carousel-3d-item-img {
  width: 58px;
  height: 58px;
  border-radius: var(--radius-full);
  border: 2px solid rgba(255, 255, 255, 0.12);
  object-fit: cover;
  margin-bottom: 6px;
  pointer-events: none;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.carousel-3d-item.is-active .carousel-3d-item-img {
  border-color: var(--accent-primary);
  transform: scale(1.06);
}

.carousel-3d-item-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 95%;
  pointer-events: none;
}

.carousel-3d-item.is-active .carousel-3d-item-title {
  color: var(--text-primary);
  font-weight: 700;
}

.carousel-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
}

.carousel-nav-btn:hover {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 0 14px var(--accent-glow);
  transform: translateY(-50%) scale(1.08);
}

.carousel-nav-btn:active {
  transform: translateY(-50%) scale(0.94);
}

.carousel-nav-btn.prev-btn {
  right: 6px;
}

.carousel-nav-btn.next-btn {
  left: 6px;
}

.carousel-active-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 360px;
  padding: 10px 14px;
  margin-top: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  gap: 10px;
}

.carousel-active-badge {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.carousel-avatar-idx {
  font-size: 0.68rem;
  color: var(--accent-primary);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.carousel-avatar-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.carousel-select-btn {
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.carousel-hint-tag {
  margin-top: 8px;
  font-size: 0.74rem;
  color: var(--text-muted);
  text-align: center;
}

/* ============================================================
   کارت‌های بصری سیستم تم (Theme Engine 2.0 Cards)
============================================================ */
.theme-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 8px;
  margin-bottom: 8px;
}

.theme-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  cursor: pointer;
  transition: all 0.22s ease;
  position: relative;
  overflow: hidden;
}

.theme-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.theme-card.is-active {
  border-color: var(--accent-primary);
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--accent-glow) 100%);
  box-shadow: 0 0 16px var(--accent-glow);
}

.theme-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 8px;
}

.theme-card-icon {
  font-size: 1.25rem;
}

.theme-card-check {
  font-size: 0.85rem;
  color: var(--accent-primary);
  font-weight: bold;
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.2s ease;
}

.theme-card.is-active .theme-card-check {
  opacity: 1;
  transform: scale(1);
}

.theme-card-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.25;
}

.theme-swatches {
  display: flex;
  align-items: center;
  gap: 5px;
}

.theme-swatch {
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: inline-block;
}

.avatar-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.avatar-option img {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  margin-bottom: 4px;
}

.avatar-option span {
  font-size: 0.68rem;
  color: var(--text-secondary);
  text-align: center;
}

.avatar-option.selected {
  border-color: var(--accent-primary);
  background: var(--accent-glow);
}

.eitaa-banner-box {
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.15), rgba(245, 158, 11, 0.1));
  border: 1px solid rgba(234, 88, 12, 0.3);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.eitaa-info h4 {
  color: #f97316;
  font-size: 1rem;
  margin-bottom: 4px;
}

.eitaa-info p {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* ============================================================
   Buttons & Badges
============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--accent-primary);
  color: #ffffff;
}

.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: var(--shadow-glow);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-outline:hover {
  border-color: var(--border-active);
  background: var(--bg-card-hover);
}

.btn-danger-outline {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.1);
}

.btn-sm { padding: 5px 10px; font-size: 0.8rem; }
.btn-xs { padding: 3px 8px; font-size: 0.74rem; }
.btn-block { width: 100%; }

/* ============================================================
   Bottom Navigation Bar
============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 90;
  padding-bottom: max(6px, env(safe-area-inset-bottom, 0px));
}

.bottom-nav-inner {
  display: flex;
  justify-content: space-around;
  max-width: 600px;
  margin: 0 auto;
  padding: 6px 0;
}

.nav-tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.nav-tab-item svg {
  width: 22px;
  height: 22px;
}

.nav-tab-item span {
  font-size: 0.72rem;
  font-weight: 600;
}

.nav-tab-item.active {
  color: var(--accent-primary);
}

/* ============================================================
   Lock Screen Overlay & Keypad
/* ============================================================
   Lock Screen Overlay, Ambient Canvas & Tactile Keypad (Phase 1)
============================================================ */
.lock-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, #0f172a 0%, #020617 100%);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
}

.lock-overlay[hidden],
.lock-overlay.hidden {
  display: none !important;
}

.lock-wave-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.85;
}

.lock-box {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 360px;
  text-align: center;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 10px 16px;
  box-shadow: none;
  animation: lockBoxFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes lockBoxFadeIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ============================================================
   Logo Ambient Glowing Border & Rotating Shimmer
============================================================ */
.lock-logo-wrap {
  position: relative;
  width: 78px;
  height: 78px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lock-logo-wrap::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 24px;
  background: conic-gradient(from 0deg, rgba(16, 185, 129, 0.7), rgba(6, 182, 212, 0.7), rgba(59, 130, 246, 0.5), rgba(16, 185, 129, 0.7));
  animation: logoShimmerRotate 7s linear infinite;
  opacity: 0.75;
  filter: blur(5px);
  z-index: 1;
}

.lock-logo-wrap::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 21px;
  background: conic-gradient(from 0deg, #10b981, #06b6d4, #3b82f6, #10b981);
  animation: logoShimmerRotate 7s linear infinite;
  z-index: 2;
  opacity: 0.85;
}

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

.lock-logo {
  position: relative;
  z-index: 3;
  width: 70px;
  height: 70px;
  border-radius: 19px;
  object-fit: cover;
  display: block;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: logoBreath 3.5s ease-in-out infinite alternate;
}

@keyframes logoBreath {
  0% {
    box-shadow: 0 0 14px rgba(13, 148, 136, 0.35), 0 4px 20px rgba(0, 0, 0, 0.6);
  }
  100% {
    box-shadow: 0 0 28px rgba(6, 182, 212, 0.75), 0 0 12px rgba(16, 185, 129, 0.6), 0 6px 25px rgba(0, 0, 0, 0.7);
  }
}

.lock-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.lock-sub {
  font-size: 0.88rem;
  color: #94a3b8;
  margin-bottom: 24px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 24px;
}

.pin-dots span {
  width: 15px;
  height: 15px;
  border-radius: var(--radius-full);
  border: 2px solid rgba(13, 148, 136, 0.7);
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pin-dots span.filled {
  background: linear-gradient(135deg, #10b981, #06b6d4);
  border-color: #34d399;
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.9), 0 0 8px rgba(6, 182, 212, 0.6);
  transform: scale(1.18);
}

.pin-dots span.animate-pop {
  animation: dotPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes dotPop {
  0% { transform: scale(0.7); }
  60% { transform: scale(1.35); }
  100% { transform: scale(1.18); }
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 270px;
  margin: 0 auto 20px;
}

.key-btn {
  height: 60px;
  border-radius: 20px;
  background: rgba(30, 41, 59, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  font-size: 1.45rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  user-select: none;
  -webkit-user-select: none;
}

.key-btn:hover:not(:disabled) {
  border-color: rgba(13, 148, 136, 0.7);
  background: rgba(30, 41, 59, 0.75);
  box-shadow: 0 0 18px rgba(13, 148, 136, 0.4);
}

.key-btn:active:not(:disabled),
.key-btn.key-pressed {
  background: linear-gradient(135deg, #0d9488 0%, #10b981 100%) !important;
  color: #ffffff !important;
  transform: scale(0.91);
  border-color: #34d399 !important;
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.85), inset 0 0 12px rgba(255, 255, 255, 0.5) !important;
}

.key-del {
  font-size: 1.15rem;
  color: #f43f5e;
}

.key-empty {
  opacity: 0;
  pointer-events: none;
}

/* ============================================================
   Modals
============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: modalFadeIn 0.25s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-overlay[hidden],
.modal-overlay.hidden {
  display: none !important;
}

/* ============================================================
   Smart Entry Splash Loader (Phase 2)
============================================================ */
.entry-splash-loader {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, #0f172a 0%, #020617 100%);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 1;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.entry-splash-loader.splash-fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.entry-splash-loader[hidden] {
  display: none !important;
}

.splash-box {
  width: 100%;
  max-width: 340px;
  text-align: center;
  animation: splashPop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.splash-pulse-icon {
  width: 110px;
  height: 55px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.ecg-path {
  fill: none;
  stroke: #10b981;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.9));
  animation: ecgStroke 1.8s ease-in-out infinite;
}

@keyframes ecgStroke {
  0% { stroke-dashoffset: 220; opacity: 0.3; }
  50% { stroke-dashoffset: 0; opacity: 1; stroke: #06b6d4; filter: drop-shadow(0 0 14px rgba(6, 182, 212, 0.95)); }
  100% { stroke-dashoffset: -220; opacity: 0.3; }
}

.splash-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.splash-status-text {
  font-size: 0.88rem;
  color: #94a3b8;
  margin-bottom: 22px;
  min-height: 24px;
  transition: all 0.3s ease;
}

.splash-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(30, 41, 59, 0.8);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
  margin-bottom: 16px;
}

.splash-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #06b6d4 0%, #10b981 100%);
  border-radius: 999px;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.85);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.splash-steps {
  display: flex;
  justify-content: center;
}

.splash-step-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

.modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

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

.modal-header h3 {
  font-size: 1.05rem;
}

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

.modal-body {
  padding: 16px 18px;
}

.modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.snapshot-detail-list .snap-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
}

.snap-unit {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-right: 4px;
}

.snap-price {
  font-weight: 700;
  color: var(--text-primary);
  margin-left: 8px;
}

.snap-method-badge {
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-secondary);
}

/* Asset Detail Modal */
.asset-modal-header {
  text-align: center;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}

.big-price {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.meta-row {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  justify-content: center;
  gap: 16px;
}

.sub-heading {
  font-size: 0.95rem;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.returns-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.return-box {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px;
  text-align: center;
}

.r-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.r-val {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* ============================================================
   Toast Notifications
============================================================ */
.toast-container {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: 90%;
  max-width: 400px;
}

.toast-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--text-primary);
  pointer-events: auto;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast-success { border-right: 4px solid #10b981; }
.toast-error { border-right: 4px solid #ef4444; }
.toast-warning { border-right: 4px solid #f59e0b; }
.toast-info { border-right: 4px solid #3b82f6; }

.toast-fade-out {
  opacity: 0;
  transform: translateY(-10px);
}

/* Animations */
.animate-fade-in {
  animation: fadeIn 0.25s ease forwards;
}

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

.animate-shake {
  animation: shake 0.4s ease;
}

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