/* ── Binance-style Dark Theme Variables (Glass Pro) ─────────────────────── */
:root {
  --bg-app: #181A20;
  /* Global App Background */
  --bg-card: #20232A;
  /* Card Background (lighter than app bg) */
  --bg-nav: rgba(32, 35, 42, 0.85);
  /* Glassmorphism Nav */

  --text-primary: #EAECEF;
  --text-secondary: #848E9C;
  --text-tertiary: #5E6673;

  --accent: #F0B90B;
  --accent-dim: rgba(240, 185, 11, 0.15);

  --border: #2B3139;
  --input-bg: #2B3139;

  --success: #0ECB81;
  --error: #F6465D;

  --safe-area-bottom: 70px;
  /* Space for bottom nav */
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  padding: 0;
  width: 375px;
  /* Mobile width */
  height: 600px;
  /* Tall app-like height */
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-app);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── App Structure ───────────────────────────────────────────────────────── */

.app-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.app-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: var(--safe-area-bottom);
  /* Ensure content isn't hidden behind nav */
}

/* Hide scrollbar for cleaner look */
.app-content::-webkit-scrollbar {
  width: 0px;
  background: transparent;
}

/* ── Header ──────────────────────────────────────────────────────────────── */

.app-header {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(24, 26, 32, 0.9);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
}

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

.header-logo {
  width: 24px;
  height: 24px;
}

.header-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0;
  background: linear-gradient(90deg, #fff, #bbb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

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

/* Theme Icons Toggle Logic */
.theme-icon-light,
.theme-icon-dark {
  display: none;
}

[data-theme="light"] .theme-icon-light {
  display: block;
}

[data-theme="dark"] .theme-icon-dark {
  display: block;
}

/* ── Views ───────────────────────────────────────────────────────────── */

.view {
  display: none;
  padding: 16px;
  animation: fadeIn 0.2s ease-out;
}

.view.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Hero Card (Dashboard) ───────────────────────────────────────────── */

.hero-card {
  background: linear-gradient(135deg, #20232A 0%, #16181D 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.hero-text h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px 0;
}

.hero-text p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.status-indicator {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  position: absolute;
  top: 20px;
  right: 20px;
  box-shadow: 0 0 10px var(--success);
}

.status-indicator.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.5);
    opacity: 0.5;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.hero-icon-bg {
  position: absolute;
  bottom: -15px;
  right: -10px;
  transform: rotate(-15deg);
  color: var(--accent);
  opacity: 0.05;
}

/* ── Stats Row ───────────────────────────────────────────────────────── */

.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.stat-item {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  border: 1px solid var(--border);
}

.stat-value {
  display: block;
  font-size: 24px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Recent List (Mini) ──────────────────────────────────────────────── */

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

.section-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.text-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.empty-state-mini {
  text-align: center;
  padding: 20px;
  color: var(--text-tertiary);
  font-size: 13px;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px dashed var(--border);
}

/* ── History View ────────────────────────────────────────────────────── */

.search-bar {
  position: relative;
  margin-bottom: 16px;
}

.search-bar svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
}

.search-bar input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 10px 10px 10px 36px;
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}

.search-bar input:focus {
  border-color: var(--accent);
}

.history-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  /* Basic card styling, content will be injected */
}

/* ── Settings View ───────────────────────────────────────────────────── */

.settings-group {
  margin-bottom: 24px;
}

.group-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-tertiary);
  margin-bottom: 8px;
  padding-left: 4px;
  text-transform: uppercase;
}

.settings-card {
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.setting-row:last-child {
  border-bottom: none;
}

.setting-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.setting-label span {
  font-size: 14px;
  font-weight: 500;
}

.setting-label .sub-label {
  font-size: 12px;
  color: var(--text-tertiary);
}

.setting-details {
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border);
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked+.slider {
  background-color: var(--accent);
}

input:checked+.slider:before {
  transform: translateX(20px);
}

/* Inputs */
.input-group {
  margin-bottom: 12px;
}

.input-group:last-child {
  margin-bottom: 0;
}

.input-group label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.input-group input,
.input-group select {
  width: 100%;
  padding: 10px;
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
}

.input-group input:focus,
.input-group select:focus {
  border-color: var(--accent);
}

/* Input with button (for API key toggle) */
.input-with-button {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-button input {
  flex: 1;
  padding-right: 45px;
}

.input-icon-btn {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.input-icon-btn:hover {
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
}

.input-icon-btn .eye-icon {
  width: 18px;
  height: 18px;
}

/* Optional label and hints */
.optional-label {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: normal;
}

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

.folder-picker-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
}

.folder-picker-trigger:hover {
  border-color: var(--text-secondary);
}

.version-info {
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 30px;
  padding-bottom: 20px;
}

.version-info a {
  color: var(--text-secondary);
  text-decoration: none;
}

/* ── Bottom Navigation ───────────────────────────────────────────────── */

.bottom-nav {
  height: 70px;
  /* Taller for mobile feel */
  background: rgba(32, 35, 42, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  /* Even spacing */
  align-items: center;
  position: absolute;
  bottom: 0;
  width: 100%;
  padding-bottom: 10px;
  /* Safe area */
  z-index: 200;
}

.nav-item {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
  width: 60px;
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.nav-label {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.8;
}

.nav-item:hover {
  color: var(--text-primary);
}

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

.nav-item.active .nav-icon {
  transform: translateY(-2px);
}

/* Debug Info */
.debug-section {
  margin: 16px 0;
  padding: 0;
  border-radius: 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.debug-section summary {
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
  /* Hide default triangle */
}

.debug-section summary::-webkit-details-marker {
  display: none;
}

.debug-section pre {
  margin: 0;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border);
  font-family: monospace;
  font-size: 11px;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 200px;
  overflow-y: auto;
  color: var(--text-secondary);
}

.micro-btn {
  padding: 2px 8px;
  font-size: 11px;
  height: auto;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-primary);
  cursor: pointer;
}

.micro-btn:hover {
  background: var(--card-bg-hover);
}

/* Status Toast */
.status {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.85);
  color: white;
  font-size: 13px;
  font-weight: 500;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  display: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.status.success {
  background: rgba(16, 185, 129, 0.95);
  opacity: 1;
}

.status.error {
  background: rgba(239, 68, 68, 0.95);
  opacity: 1;
}

/* History TLDR Toggle */
.history-tldr {
  margin-top: 8px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.history-tldr.collapsed {
  max-height: 0;
}

.history-tldr.collapsed .history-tldr-text {
  display: none;
}

.history-tldr-text {
  padding: 12px;
  background: rgba(var(--accent-rgb), 0.1);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

.history-toggle {
  padding: 7px 14px;
  font-size: 12px;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.08) 0%, rgba(var(--accent-rgb), 0.03) 100%);
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  border-radius: 8px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.history-toggle::before {
  content: '▼';
  font-size: 8px;
  transition: transform 0.2s;
}

.history-tldr:not(.collapsed)+.history-actions .history-toggle::before {
  transform: rotate(180deg);
}

.history-toggle:hover {
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.15) 0%, rgba(var(--accent-rgb), 0.08) 100%);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.2);
}

/* Search highlighting */
.search-highlight {
  background: rgba(var(--accent-rgb), 0.3);
  color: var(--accent);
  font-weight: 600;
  padding: 2px 0;
  border-radius: 2px;
}

.search-result-count {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--text-tertiary);
  background: var(--card-bg);
  padding: 4px 8px;
  border-radius: 12px;
  font-weight: 600;
}

/* Export Dialog Styles */
.export-dialog {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease;
}

.export-dialog-content {
  background: var(--bg);
  border-radius: 16px;
  padding: 24px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.export-dialog-content h3 {
  margin: 0 0 20px 0;
  font-size: 18px;
  color: var(--text-primary);
}

.export-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.export-option-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  width: 100%;
}

.export-option-btn:hover {
  background: var(--card-bg-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.export-option-btn span {
  font-size: 32px;
}

.export-option-btn strong {
  display: block;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.export-option-btn small {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
}

.btn-secondary {
  padding: 12px 20px;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.1) 0%, rgba(var(--accent-rgb), 0.05) 100%);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.btn-secondary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.2), transparent);
  transition: left 0.5s;
}

.btn-secondary:hover::before {
  left: 100%;
}

.btn-secondary:hover {
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.2) 0%, rgba(var(--accent-rgb), 0.1) 100%);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.2);
}

.btn-secondary:active {
  transform: translateY(0);
}

/* ===== Keyboard Shortcuts Modal ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.modal.hidden {
  display: none;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  background: linear-gradient(135deg,
      rgba(var(--card-bg-rgb), 0.95) 0%,
      rgba(var(--card-bg-rgb), 0.9) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  overflow: hidden;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.2);
  background: linear-gradient(135deg,
      rgba(var(--accent-rgb), 0.1) 0%,
      rgba(var(--accent-rgb), 0.05) 100%);
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(var(--accent-rgb), 0.1);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: rgba(var(--accent-rgb), 0.2);
  transform: rotate(90deg);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(80vh - 80px);
}

.shortcuts-section h3 {
  margin: 0 0 16px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.shortcut-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  margin-bottom: 8px;
  background: rgba(var(--accent-rgb), 0.05);
  border: 1px solid rgba(var(--accent-rgb), 0.1);
  border-radius: 10px;
  transition: all 0.2s;
}

.shortcut-item:hover {
  background: rgba(var(--accent-rgb), 0.1);
  border-color: rgba(var(--accent-rgb), 0.2);
  transform: translateX(4px);
}

.shortcut-keys {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.shortcut-keys kbd {
  display: inline-block;
  padding: 4px 8px;
  background: linear-gradient(135deg,
      rgba(var(--accent-rgb), 0.2) 0%,
      rgba(var(--accent-rgb), 0.1) 100%);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 6px;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.shortcut-desc {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

.btn-secondary span {
  font-size: 16px;
  filter: drop-shadow(0 0 4px rgba(var(--accent-rgb), 0.5));
}

.history-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.history-item:hover {
  background: var(--card-bg-hover);
  border-color: rgba(var(--accent-rgb), 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.history-author {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 14px;
  letter-spacing: -0.01em;
}

.history-time {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 500;
  background: rgba(var(--accent-rgb), 0.1);
  padding: 4px 8px;
  border-radius: 6px;
}

.history-preview {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.history-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid rgba(var(--accent-rgb), 0.1);
}

.history-link {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.15) 0%, rgba(var(--accent-rgb), 0.08) 100%);
  transition: all 0.2s;
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.history-link::before {
  content: '🔗';
  font-size: 10px;
  opacity: 0.8;
}

.history-link:hover {
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.25) 0%, rgba(var(--accent-rgb), 0.15) 100%);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.3);
}

.history-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-tertiary);
}

.export-cancel-btn {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.export-cancel-btn:hover {
  background: var(--card-bg);
  color: var(--text-primary);
}

.button-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 8px;
}

.button-group button {
  flex: 1;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Tag Styles */
.history-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.15) 0%, rgba(var(--accent-rgb), 0.08) 100%);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  transition: all 0.2s;
}

.tag-chip:hover {
  background: rgba(var(--accent-rgb), 0.25);
  border-color: var(--accent);
}

.tag-remove {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.tag-remove:hover {
  background: rgba(var(--accent-rgb), 0.3);
}

.tag-add-btn {
  padding: 4px 10px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.2s;
}

.tag-add-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.05);
}

.tag-input {
  padding: 4px 10px;
  background: var(--card-bg);
  border: 1px solid var(--accent);
  border-radius: 12px;
  font-size: 11px;
  color: var(--text-primary);
  outline: none;
  min-width: 100px;
}

.tag-input::placeholder {
  color: var(--text-tertiary);
}

/* Dashboard Trend Indicator */
.stat-trend {
  font-size: 20px;
  font-weight: 700;
}

.stat-trend.positive {
  color: var(--success);
}

.stat-trend.negative {
  color: var(--error);
}

.stat-trend.neutral {
  color: var(--text-tertiary);
}