/* ===================================
   StockTracker Stylesheet
   Dark Modern Theme
   Palette: Slate + Teal accent
   =================================== */

/* Design Tokens */
:root {
  --bg-base:      #0f172a;
  --bg-surface:   #1e293b;
  --bg-elevated:  #293548;
  --border:       #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:   #64748b;
  --accent:       #14b8a6;
  --accent-hover: #2dd4bf;
  --accent-dim:   rgba(20, 184, 166, 0.12);
  --positive:     #22c55e;
  --positive-bg:  rgba(34, 197, 94, 0.1);
  --negative:     #ef4444;
  --negative-bg:  rgba(239, 68, 68, 0.1);
  --warning:      #f59e0b;
  --warning-bg:   rgba(245, 158, 11, 0.1);
  --radius-sm:    6px;
  --radius-md:    8px;
  --radius-lg:    12px;
  --shadow-md:    0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Roboto', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  font-size: 14px;
}

/* ===================================
   Layout & Screens
   =================================== */

#app { min-height: 100vh; position: relative; }

.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; flex-direction: column; }

/* ===================================
   Login Screen
   =================================== */

#login-screen {
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: var(--bg-base);
}

.login-container {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.login-container h1 {
  font-size: 1.8em;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.tagline {
  color: var(--text-secondary);
  font-size: 0.9em;
  margin-bottom: 32px;
}

.features {
  margin: 24px 0;
  text-align: left;
}

.feature {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin: 6px 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875em;
  color: var(--text-secondary);
}

.feature .icon { font-size: 1.1em; }

.privacy-note {
  margin-top: 24px;
  font-size: 0.78em;
  color: var(--text-muted);
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
}

/* ===================================
   Buttons
   =================================== */

button {
  cursor: pointer;
  border: none;
  font-family: inherit;
  font-size: 0.875em;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 14px rgba(20, 184, 166, 0.35);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  font-weight: 500;
}

.btn-secondary:hover {
  background: var(--border);
  color: var(--text-primary);
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.8em;
  white-space: nowrap;
}

/* ===================================
   Navbar — Gmail pill style
   =================================== */

.navbar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 52px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand h2 {
  color: var(--accent);
  font-size: 1.05em;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.nav-menu {
  display: flex;
  gap: 2px;
}

.nav-btn {
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.875em;
  font-weight: 500;
}

.nav-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.nav-btn.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-email {
  color: var(--text-muted);
  font-size: 0.78em;
}

/* ===================================
   Main Content Area
   =================================== */

.content {
  flex: 1;
  padding: 24px 32px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.view { display: none; }

.view.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

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

.content h1 {
  color: var(--text-primary);
  font-size: 1.3em;
  font-weight: 700;
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}

.content h2 {
  color: var(--text-secondary);
  font-size: 0.75em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 0;
}

/* ===================================
   Stat Cards (Overview)
   =================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

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

.stat-card-highlight {
  border-left: 3px solid var(--accent);
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.72em;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
  font-weight: 500;
}

.stat-value {
  color: var(--text-primary);
  font-size: 1.55em;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.stat-subvalue {
  color: var(--text-secondary);
  font-size: 0.78em;
  margin-top: 4px;
}

.stat-value.positive { color: var(--positive); }
.stat-value.negative { color: var(--negative); }
.stat-value.neutral  { color: var(--text-primary); }

/* ===================================
   Controls Bar (price refresh row)
   =================================== */

.controls-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.controls-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.controls-bar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.price-status {
  color: var(--text-muted);
  font-size: 0.8em;
}

.cache-info {
  color: var(--text-muted);
  font-size: 0.75em;
}

/* Currency select in controls bar */
.controls-bar select {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 0.82em;
  cursor: pointer;
  font-family: inherit;
}

.controls-bar select:focus {
  outline: none;
  border-color: var(--accent);
}

.controls-bar select option {
  background: var(--bg-surface);
}

.controls-bar label {
  color: var(--text-muted);
  font-size: 0.78em;
}

/* ===================================
<<<<<<< Updated upstream
   Holdings Table — compact Yahoo Finance rows
=======
   Holdings Table â€” compact Yahoo Finance rows
>>>>>>> Stashed changes
   =================================== */

.holdings-table-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 8px;
}

.holdings-table-wrap h2 {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}

.holdings-col-header {
  display: grid;
  grid-template-columns: 1fr 80px 110px 130px 150px;
  gap: 12px;
  padding: 8px 18px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  font-size: 0.7em;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
  color: var(--text-muted);
}

.holdings-col-header .right { text-align: right; }

.holding-row {
  display: grid;
  grid-template-columns: 1fr 80px 110px 130px 150px;
  align-items: center;
  padding: 11px 18px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  transition: background 0.1s;
}

.holding-row:last-child { border-bottom: none; }
.holding-row:hover { background: var(--bg-elevated); }

.holding-identity .holding-symbol {
  font-weight: 700;
  font-size: 0.92em;
  color: var(--text-primary);
}

.holding-identity .holding-company {
  font-size: 0.77em;
  color: var(--text-muted);
  margin-top: 2px;
}

.holding-qty {
  color: var(--text-secondary);
  font-size: 0.82em;
}

.holding-price {
  font-weight: 600;
  font-size: 0.88em;
  color: var(--text-primary);
}

.holding-price-currency {
  font-size: 0.72em;
  color: var(--text-muted);
  margin-left: 3px;
}

.price-stale-label {
  display: block;
  font-size: 0.68em;
  color: var(--text-muted);
  margin-top: 1px;
}

.holding-value {
  font-weight: 600;
  font-size: 0.88em;
  color: var(--text-primary);
  text-align: right;
}

.holding-pl {
  font-size: 0.82em;
  text-align: right;
}

.holding-pl-amount {
  font-weight: 700;
  display: block;
}

.holding-pl-pct {
  font-size: 0.78em;
  opacity: 0.85;
  display: block;
}

.holding-arr {
  font-size: 0.75em;
  font-weight: 600;
  display: block;
  margin-top: 2px;
}

/* Holding alerts */
.holding-alert {
  padding: 5px 18px;
  font-size: 0.75em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.holding-alert-price {
  background: var(--negative-bg);
  color: var(--negative);
  border-bottom: 1px solid var(--border);
}

.holding-alert-fx {
  background: var(--warning-bg);
  color: var(--warning);
  border-bottom: 1px solid var(--border);
}

/* ===================================
   Full Holdings View
   =================================== */

#holdings-list {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* Detailed holding row for the holdings page (more columns) */
.holding-row-detail {
  display: grid;
  grid-template-columns: 1fr 80px 110px 120px 120px 150px;
  align-items: center;
  padding: 11px 18px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  transition: background 0.1s;
}

.holding-row-detail:last-child { border-bottom: none; }
.holding-row-detail:hover { background: var(--bg-elevated); }

.holdings-col-header-detail {
  display: grid;
  grid-template-columns: 1fr 80px 110px 120px 120px 150px;
  gap: 12px;
  padding: 8px 18px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  font-size: 0.7em;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
  color: var(--text-muted);
}

.holdings-col-header-detail .right { text-align: right; }

/* ===================================
   Transactions Table
   =================================== */

#transactions-list {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85em;
}

.data-table thead tr {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.data-table th {
  padding: 10px 14px;
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.72em;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
}

.data-table th.right,
.data-table td.right { text-align: right; }

.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-elevated); }

.data-table td {
  padding: 10px 14px;
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table td.muted  { color: var(--text-secondary); font-size: 0.88em; }
.data-table td.bold   { font-weight: 600; }

/* Buy / sell badges */
.badge-buy, .badge-sell {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75em;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.badge-buy  { background: var(--positive-bg); color: var(--positive); }
.badge-sell { background: var(--negative-bg); color: var(--negative); }

/* ===================================
   P/L color helpers (shared)
   =================================== */

.positive { color: var(--positive); }
.negative { color: var(--negative); }
.neutral  { color: var(--text-secondary); }

/* ===================================
   Recent Transactions (Overview holdings wrapper)
   =================================== */

.recent-transactions {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.recent-transactions h2 {
  padding: 12px 18px;
  margin: 0;
  border-bottom: 1px solid var(--border);
}

#recent-transactions-list {
<<<<<<< Updated upstream
  /* no extra padding — holding rows handle it */
=======
  /* no extra padding â€” holding rows handle it */
>>>>>>> Stashed changes
}

/* ===================================
   Sync View
   =================================== */

.sync-info {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.875em;
  color: var(--text-secondary);
}

.sync-info strong { color: var(--text-primary); }

.sync-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.sync-status {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  min-height: 60px;
  color: var(--text-secondary);
  font-size: 0.875em;
}

.files-list {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

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

.file-row:last-child { border-bottom: none; }
.file-row:hover { background: var(--bg-elevated); }

.file-name {
  font-weight: 600;
  font-size: 0.875em;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.file-meta {
  font-size: 0.78em;
  color: var(--text-muted);
}

/* ===================================
   Account Management
   =================================== */

.account-actions { margin-bottom: 18px; }

.accounts-list { display: grid; gap: 10px; }

.account-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 16px 18px;
  border-radius: var(--radius-md);
}

.account-card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 12px;
}

.account-card-title h3 {
  font-size: 0.92em;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.account-card-subtitle {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.account-card-actions {
  display: flex;
  gap: 6px;
}

.account-card-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.account-detail { display: flex; flex-direction: column; }

.account-detail-label {
  color: var(--text-muted);
  font-size: 0.7em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
  font-weight: 500;
}

.account-detail-value {
  color: var(--text-primary);
  font-size: 0.875em;
  font-weight: 500;
}

/* Account badges */
.account-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72em;
  font-weight: 600;
}

.badge-active   { background: var(--positive-bg);  color: var(--positive); }
.badge-inactive { background: var(--negative-bg);  color: var(--negative); }
.badge-currency { background: var(--accent-dim);   color: var(--accent); }

/* Icon buttons */
.btn-icon {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.78em;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon:hover {
  background: var(--border);
  color: var(--text-primary);
}

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

/* ===================================
   Modal Styles
   =================================== */

.modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.72);
}

.modal.active {
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
  animation: slideUp 0.2s ease;
}

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

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

.modal-header h2 {
  margin: 0;
  font-size: 0.95em;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: none;
  letter-spacing: normal;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.3em;
  color: var(--text-muted);
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.15s;
}

.modal-close:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.modal-body { padding: 22px; }

/* ===================================
   Form Styles
   =================================== */

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

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

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875em;
  font-family: inherit;
  color: var(--text-primary);
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.12);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group textarea { resize: vertical; }

.form-group small {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.78em;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.form-actions button { min-width: 100px; padding: 9px 20px; }

/* ===================================
   Filters Bar
   =================================== */

.filters-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.filter-section {
  display: flex;
  gap: 24px;
  flex: 1;
  flex-wrap: wrap;
}

.filter-group { min-width: 175px; }

.filter-group label {
  display: block;
  font-size: 0.72em;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.multi-select-dropdown {
  width: 100%;
  min-height: 88px;
  padding: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85em;
  font-family: inherit;
  cursor: pointer;
}

.multi-select-dropdown:focus {
  outline: none;
  border-color: var(--accent);
}

.multi-select-dropdown option {
  padding: 4px 6px;
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.multi-select-dropdown option:checked {
  background: var(--bg-elevated);
  color: var(--accent);
  font-weight: 600;
}

.filter-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ===================================
   Favorites Bar
   =================================== */

.favorites-bar {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 9px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  min-height: 42px;
}

.favorites-bar:empty { display: none; }

.favorites-label {
  font-size: 0.7em;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 4px;
}

.favorite-btn {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.favorite-btn:hover {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
}

.favorite-btn .delete-favorite {
  margin-left: 4px;
  color: var(--text-muted);
  font-weight: bold;
}

.favorite-btn:hover .delete-favorite { color: var(--negative); }

/* ===================================
   Filter summary in modal
   =================================== */

#favorite-summary {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin: 12px 0;
  font-size: 0.85em;
  color: var(--text-secondary);
}

#favorite-summary-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.filter-summary-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-summary-item strong {
  min-width: 80px;
  color: var(--text-secondary);
  font-size: 0.85em;
}

.filter-tag {
  display: inline-block;
  background: var(--accent-dim);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.78em;
  margin-right: 4px;
}

/* ===================================
   Loading Overlay
   =================================== */

.loading-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(15, 23, 42, 0.85);
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 9999;
}

.loading-overlay.active { display: flex; }

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(20, 184, 166, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

#loading-message {
  color: var(--text-secondary);
  margin-top: 14px;
  font-size: 0.875em;
}

/* ===================================
   Empty State
   =================================== */

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 48px 20px;
  font-size: 0.875em;
}

/* ===================================
   Currency Display Helpers
   =================================== */

.currency-dual { display: flex; flex-direction: column; gap: 2px; }
.currency-primary { font-weight: 600; color: var(--text-primary); }
.currency-secondary { font-size: 0.85em; color: var(--text-secondary); }

.fx-rate {
  display: inline-block;
  padding: 1px 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  font-size: 0.75em;
  color: var(--text-muted);
  margin-left: 6px;
}

/* ===================================
   Toast Notifications
   =================================== */

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 10001;
  font-size: 0.845em;
  font-weight: 500;
  animation: slideIn 0.25s ease;
  border-left: 3px solid transparent;
  max-width: 320px;
}

.toast-success {
  background: #0d2b1a;
  border-left-color: var(--positive);
  color: var(--positive);
}

.toast-error {
  background: #2b0d0d;
  border-left-color: var(--negative);
  color: var(--negative);
}

.toast-info {
  background: #0d2229;
  border-left-color: var(--accent);
  color: var(--accent);
}

@keyframes slideIn {
  from { transform: translateX(360px); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}

@keyframes slideOut {
  from { transform: translateX(0);     opacity: 1; }
  to   { transform: translateX(360px); opacity: 0; }
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 768px) {
  .navbar {
    height: auto;
    flex-wrap: wrap;
    padding: 10px 16px;
    gap: 8px;
  }

  .nav-menu {
    order: 3;
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    padding-bottom: 4px;
  }

  .nav-btn { padding: 5px 10px; font-size: 0.8em; }

  .nav-actions { gap: 10px; }

  .content { padding: 16px; }
  .content h1 { font-size: 1.1em; }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .stat-card { padding: 12px 14px; }
  .stat-value { font-size: 1.2em; }

  .controls-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  /* Mobile holding cards: show all data in a 2-row card layout */
  .holdings-col-header,
  .holdings-col-header-detail {
    display: none;
  }

  .holding-row,
  .holding-row-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    padding: 10px 12px;
    align-items: flex-start;
  }

  /* Forces a line-break between row 1 (identity + pl) and row 2 (stats) */
  .holding-row::after,
  .holding-row-detail::after {
    content: '';
    flex: 1 1 100%;
    order: 2;
    height: 0;
  }

  .holding-row .holding-identity,
  .holding-row-detail .holding-identity {
    order: 1;
    flex: 1 1 auto;
    min-width: 0;
  }

  .holding-row .holding-pl,
  .holding-row-detail .holding-pl {
    order: 1;
    flex: 0 0 auto;
    text-align: right;
  }

  /* Show all previously-hidden data in a secondary info row */
  .holding-row > *:not(.holding-identity):not(.holding-pl),
  .holding-row-detail > *:not(.holding-identity):not(.holding-pl) {
    order: 3;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    font-size: 0.78em;
    color: var(--text-secondary);
  }

  .filters-bar { flex-direction: column; }
  .filter-section { flex-direction: column; width: 100%; }
  .filter-group { width: 100%; }
  .filter-actions { flex-direction: row; }
  .filter-actions button { flex: 1; }

  .sync-actions { flex-direction: column; }
  .sync-info { flex-direction: column; align-items: flex-start; }

  .account-card-header { flex-direction: column; gap: 10px; }
  .account-card-actions { width: 100%; }
  .account-card-details { grid-template-columns: 1fr 1fr; }

  .modal-content { width: 95%; }
  .modal-header, .modal-body { padding: 16px; }

  .form-actions { flex-direction: column; }
  .form-actions button { width: 100%; }

  .data-table { font-size: 0.78em; }
  .data-table th, .data-table td { padding: 8px 10px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .account-card-details { grid-template-columns: 1fr; }
<<<<<<< Updated upstream
}
=======
}
>>>>>>> Stashed changes
