/* =========================================================
   Smallholding VAT Tracker — Design System
   Dark-first palette · Lime/neon accent
   ========================================================= */

:root {
  /* ---- Brand accent ---- */
  --accent:        #c4e614;      /* Lime / neon yellow-green */
  --accent-hover:  #aecf0f;
  --accent-text:   #0a0b0b;      /* Dark text on lime surfaces */

  /* ---- Dark surface palette ---- */
  --bg-app:        #111213;
  --bg-surface:    #1a1d1e;
  --bg-elevated:   #262a2b;
  --border-subtle: #2d3235;
  --border-dashed: #3d4347;

  /* ---- Text ---- */
  --text-primary:   #ffffff;
  --text-secondary: #9ca3af;
  --text-muted-val: #6b7280;

  /* ---- Legacy aliases (used throughout existing components) ---- */
  --primary:       #c4e614;
  --primary-dark:  #1a1d1e;
  --primary-light: #262a2b;
  --text:          #ffffff;
  --muted:         #9ca3af;
}

/* ---- Navbar ---- */
.bg-primary-custom {
  background-color: var(--bg-app) !important;
}

/* ---- Stat cards ---- */
.stat-card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  transition: transform .15s ease;
}
.stat-card:hover { transform: translateY(-2px); }

.stat-card .card-body {
  padding: 1rem;
  position: relative;
}
.stat-icon {
  font-size: 1.6rem;
  opacity: .25;
  position: absolute;
  top: .75rem;
  right: .9rem;
}
.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: .2rem;
}
.stat-label {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  font-weight: 600;
}

.stat-card--blue   { background: #e8f4ff; }
.stat-card--green  { background: #f0f9d0; }
.stat-card--orange { background: #fff3e0; }
.stat-card--teal   { background: #e0f7fa; }

/* ---- Category badge ---- */
.category-badge {
  background-color: var(--primary);
  color: var(--accent-text);
  font-weight: 500;
  font-size: .72rem;
  white-space: normal;
  text-align: left;
  max-width: 160px;
}

/* ---- Receipt image preview ---- */
.receipt-preview {
  max-height: 72vh;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform .2s;
  border: 1px solid #dee2e6;
  border-radius: 8px;
}
.receipt-preview.zoomed {
  cursor: zoom-out;
  transform: scale(1.6);
  transform-origin: top left;
}

/* ---- Table ---- */
#receipts-table tbody tr {
  cursor: pointer;
}
#receipts-table tbody tr:hover {
  background-color: rgba(196, 230, 20, .08);
}

/* ---- Card headers ---- */
.card-header {
  background-color: #f8f9fa;
  font-size: .9rem;
}

/* ---- Scrollable on small screens ---- */
@media (max-width: 576px) {
  .stat-value { font-size: 1.2rem; }
  .stat-label { font-size: .7rem; }
}

/* ---- Folder Sidebar ---- */
.folder-sidebar {
  min-height: calc(100vh - 56px);
  max-height: calc(100vh - 56px);
  position: sticky;
  top: 56px;
}

.folder-list {
  min-height: 0;
}

.folder-item {
  color: var(--text);
  font-size: .875rem;
  border-radius: 6px;
  transition: background .15s;
}
.folder-item:hover {
  background: var(--primary-light);
  color: var(--accent);
}
.folder-item--active {
  background: var(--primary-light);
  color: var(--accent);
  font-weight: 600;
}

/* ---- VAT extraction badges ---- */
.vat-badge {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.vat-badge--summary {
  background-color: #198754;
  color: #fff;
}
.vat-badge--lines {
  background-color: #fd7e14;
  color: #fff;
}
.vat-badge--review {
  background-color: #dc3545;
  color: #fff;
}

/* ---- PDF preview placeholder ---- */
.pdf-preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--muted);
}
.pdf-preview-placeholder .bi-file-earmark-pdf-fill {
  font-size: 5rem;
}

/* ---- Notification dropdown ---- */
.notif-dropdown {
  min-width: 320px;
  max-height: 420px;
  overflow-y: auto;
}

.notif-item {
  cursor: pointer;
  transition: background .1s;
}
.notif-item:hover {
  background: #f8f9fa;
}
.notif-item--unread {
  background: #eaf4ff;
  border-left: 3px solid var(--accent) !important;
}

.notif-badge {
  font-size: .6rem;
  padding: 2px 5px;
}

/* ---- Folder icon (browse page) ---- */
.folder-icon-lg {
  font-size: 2.5rem;
  line-height: 1;
  flex-shrink: 0;
}

/* =========================================================
   Add Receipt — Redesigned component
   ========================================================= */

.add-receipt-card {
  border: none;
  border-radius: 16px;
}

.add-receipt-brand {
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .3rem;
}

.add-receipt-heading {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 0;
}

.add-receipt-folder-badge {
  font-size: .8rem;
  color: var(--text-secondary);
  margin-top: .4rem;
}

/* Photo CTA button */
.add-receipt-photo-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--accent);
  border: none;
  border-radius: 16px;
  padding: 1rem 1.25rem;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, transform .1s;
  width: 100%;
  text-align: left;
}
.add-receipt-photo-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.add-receipt-photo-icon {
  width: 48px;
  height: 48px;
  background: rgba(0,0,0,.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--accent-text);
  flex-shrink: 0;
}

.add-receipt-photo-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-text);
  line-height: 1.2;
  display: block;
}
.add-receipt-photo-sub {
  font-size: .78rem;
  color: rgba(0,0,0,.5);
  display: block;
}
.add-receipt-chevron {
  font-size: 1rem;
  color: rgba(0,0,0,.4);
  flex-shrink: 0;
  margin-left: auto;
}

/* Section label */
.add-receipt-section-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: .75rem;
}

/* Import grid — 2 × 2 */
.add-receipt-import-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin-bottom: .75rem;
}

#amazon-btn-area {
  display: contents; /* transparent to grid; child becomes direct grid item */
}

.add-receipt-import-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .45rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1rem;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-primary);
  transition: background .15s, border-color .15s;
  text-align: left;
  font-family: inherit;
  font-size: inherit;
}
.add-receipt-import-tile:hover,
.add-receipt-import-tile:focus {
  background: #2d3235;
  border-color: var(--accent);
  color: var(--text-primary);
  outline: none;
}

.add-receipt-import-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  background: var(--bg-surface);
  flex-shrink: 0;
}
.add-receipt-icon--files   { color: #6b8cff; }
.add-receipt-icon--amazon  { color: #f5a623; }
.add-receipt-icon--email   { color: #a78bfa; }
.add-receipt-icon--gallery { color: #fb923c; }

.add-receipt-import-name {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}
.add-receipt-import-sub {
  font-size: .73rem;
  color: var(--text-secondary);
}

/* Drop zone */
.add-receipt-drop-zone {
  display: flex;
  align-items: center;
  gap: .75rem;
  border: 1.5px dashed var(--border-dashed);
  border-radius: 12px;
  padding: .9rem 1.1rem;
  background: transparent;
  cursor: pointer;
  color: var(--text-secondary);
  transition: border-color .2s, background .2s;
}
.add-receipt-drop-zone:hover,
.add-receipt-drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(196, 230, 20, .05);
}
.add-receipt-drop-types {
  font-size: .7rem;
  color: var(--text-muted-val);
}

/* Stats row */
.add-receipt-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}
.add-receipt-mini-stat {
  background: var(--bg-elevated);
  border-radius: 12px;
  padding: .875rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .1rem;
}
.add-receipt-mini-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.add-receipt-mini-value--accent { color: var(--accent); }
.add-receipt-mini-label {
  font-size: .73rem;
  color: var(--text-secondary);
}

/* =========================================================
   Dark mode overrides
   ========================================================= */

[data-bs-theme="dark"] {
  --primary-light: #262a2b;
  --text: #ffffff;
}

[data-bs-theme="dark"] .stat-card--blue   { background: #1a2a3d; }
[data-bs-theme="dark"] .stat-card--green  { background: #222e14; }
[data-bs-theme="dark"] .stat-card--orange { background: #3d2a10; }
[data-bs-theme="dark"] .stat-card--teal   { background: #0f2d33; }

[data-bs-theme="dark"] .stat-card {
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}

[data-bs-theme="dark"] .card-header {
  background-color: var(--bg-elevated);
}

[data-bs-theme="dark"] #receipts-table tbody tr:hover {
  background-color: rgba(196, 230, 20, .06);
}

[data-bs-theme="dark"] .folder-item:hover,
[data-bs-theme="dark"] .folder-item--active {
  background: var(--bg-elevated);
  color: var(--accent);
}

[data-bs-theme="dark"] .notif-item:hover {
  background: var(--bg-elevated);
}
[data-bs-theme="dark"] .notif-item--unread {
  background: #0f2233;
  border-left-color: var(--accent) !important;
}

/* Ensure add-receipt-card uses surface bg in dark mode */
[data-bs-theme="dark"] .add-receipt-card {
  background: var(--bg-surface);
}
