/* ============================================================
   خاطرات یک تحلیلگر | 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);
}

/* تم طلایی لوکس (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);
  background: linear-gradient(135deg, var(--accent-primary), #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.25rem;
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}

.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-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;
}

.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;
}

.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-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

.lock-box {
  width: 100%;
  max-width: 340px;
  text-align: center;
}

.lock-logo {
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--accent-primary), #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 900;
  color: #fff;
}

.lock-title {
  font-size: 1.25rem;
  margin-bottom: 4px;
}

.lock-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

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

.pin-dots span {
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  border: 2px solid var(--accent-primary);
  background: transparent;
  transition: all 0.2s ease;
}

.pin-dots span.filled {
  background: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

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

.key-btn {
  height: 58px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 1.35rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.key-btn:active {
  background: var(--accent-primary);
  color: #fff;
  transform: scale(0.92);
}

.key-del {
  font-size: 1.1rem;
}

/* ============================================================
   Modals
============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

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

.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); }
}
