/* ── CSS Custom Properties ───────────────────────────────────────────────── */
:root {
  /* Brand */
  --color-primary:        #1a9e5c;
  --color-primary-dark:   #157a47;
  --color-primary-light:  #e6f7ef;

  /* Feedback */
  --color-income:         #1a9e5c;
  --color-expense:        #e53935;
  --color-expense-light:  #fdecea;

  /* Overflader */
  --color-bg:             #f4f6f8;
  --color-surface:        #ffffff;
  --color-border:         #e8eaed;

  /* Tekst */
  --color-text:           #111827;
  --color-text-muted:     #6b7280;
  --color-text-on-primary:#ffffff;

  /* Spacing */
  --radius-card:  14px;
  --radius-pill:  9999px;
  --shadow-card:  0 2px 12px rgba(0,0,0,.07);
  --shadow-fab:   0 4px 20px rgba(26,158,92,.35);
  --sidebar-w:    240px;
}

/* ── Dark Mode ─────────────────────────────────────────────────────────── */
[data-theme="dark"] {
  /* Brand */
  --color-primary:        #2ecc71;
  --color-primary-dark:   #27ae60;
  --color-primary-light:  #0d3a1f;

  /* Feedback */
  --color-income:         #2ecc71;
  --color-expense:        #e74c3c;
  --color-expense-light:  #5a1a15;

  /* Overflader */
  --color-bg:             #0f1118;
  --color-surface:        #1a1f2e;
  --color-border:         #2d3544;

  /* Tekst */
  --color-text:           #f0f2f5;
  --color-text-muted:     #a0a8b8;
  --color-text-on-primary:#ffffff;

  /* Shadow adjustments for dark mode */
  --shadow-card:  0 2px 12px rgba(0,0,0,.4);
  --shadow-fab:   0 4px 20px rgba(46,204,113,.25);
}

/* ── Bootstrap Overrides ─────────────────────────────────────────────────── */
.btn-primary,
.bg-primary { background-color: var(--color-primary) !important; border-color: var(--color-primary) !important; }
.btn-primary:hover { background-color: var(--color-primary-dark) !important; }
.text-primary { color: var(--color-primary) !important; }
.border-primary { border-color: var(--color-primary) !important; }

/* Dark mode text fixes */
[data-theme="dark"] .text-dark {
  color: var(--color-text) !important;
}

[data-theme="dark"] .bg-warning {
  background-color: #f59e0b !important;
}

[data-theme="dark"] .bg-warning.text-dark {
  color: #111827 !important; /* visibel på gul baggrund */
}

/* ── Base ────────────────────────────────────────────────────────────────── */
body {
  background-color: var(--color-bg);
  color: var(--color-text);
  padding-bottom: 80px; /* plads til bottom-nav på mobil */
}

/* ── Sidebar (desktop ≥992px) ────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  padding: 1.5rem 0;
  z-index: 100;
  flex-direction: column;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0 1.25rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary);
}

.sidebar__brand i { font-size: 1.4rem; }

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 0.75rem;
}

.sidebar__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: 10px;
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
}

.sidebar__item:hover { background: var(--color-primary-light); color: var(--color-primary); }
.sidebar__item.active { background: var(--color-primary-light); color: var(--color-primary); font-weight: 600; }
.sidebar__item i { font-size: 1.1rem; width: 20px; text-align: center; }

.sidebar__footer {
  padding: 0.75rem;
  border-top: 1px solid var(--color-border);
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar__user-card {
  background: var(--color-primary-light);
  border-radius: var(--radius-card);
  padding: 0.875rem;
  margin-bottom: 0.25rem;
}

.sidebar__user-name {
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.9rem;
  margin-bottom: 0.375rem;
}

.sidebar__user-role {
  display: flex;
  gap: 0.375rem;
}

.sidebar__user-role .badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
}

/* User tier styling */
.user-tier {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.375rem 0.625rem;
  border-radius: 6px;
}

.user-tier--premium {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #78350f;
}

.user-tier--premium i {
  font-size: 0.7rem;
}

.user-tier--free {
  background: var(--color-border);
  color: var(--color-text-muted);
}

/* ── Hovedindhold ────────────────────────────────────────────────────────── */
.main-content {
  min-height: 100vh;
}

/* ── App Header (mobil) ──────────────────────────────────────────────────── */
.app-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 90;
}

/* ── Week Card ───────────────────────────────────────────────────────────── */
.week-card {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  border-radius: var(--radius-card);
  padding: 1.25rem;
  color: white;
  box-shadow: var(--shadow-fab);
  margin-bottom: 1.25rem;
}

/* ── Stat Cards ──────────────────────────────────────────────────────────── */
.stat-card {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1.25rem 1.5rem;
  height: 100%;
}

/* Desktop variant */
.stat-card__label { color: var(--color-text-muted); font-size: 0.85rem; margin-bottom: 0.5rem; }
.stat-card__value { font-size: 1.5rem; font-weight: 700; color: var(--color-text); }
.stat-card__sub   { margin-top: 0.25rem; }
.stat-card--total .stat-card__value { color: var(--color-primary); }
.stat-card--sm { padding: 1rem; }
.stat-card__total--primary { color: var(--color-primary); }

/* Mobil variant (kompakt) */
.stat-card__total {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.35rem;
}

.stat-card__breakdown {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ── Receipt Item ────────────────────────────────────────────────────────── */
.receipt-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  background: var(--color-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  margin-bottom: 0.625rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.receipt-item:active { transform: scale(0.98); }

.receipt-icon {
  width: 42px;
  height: 42px;
  background: var(--color-primary-light);
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ── Beløb ───────────────────────────────────────────────────────────────── */
.amount-expense { color: var(--color-expense); font-weight: 600; }
.amount-income  { color: var(--color-income);  font-weight: 600; }

/* ── Stjerne-knap i kvitteringsliste ─────────────────────────────────────── */
.star-btn { font-size: 1rem; color: var(--color-text-muted); }
.star-btn:hover { color: #f59e0b; }
.star-icon-sm { font-size: 0.75rem; }

/* ── Filter-inputs i receipts.php ────────────────────────────────────────── */
.filter-month   { max-width: 160px; }
.filter-category { max-width: 180px; }

/* ── Søgefelt ────────────────────────────────────────────────────────────── */
.search-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-bar > i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  z-index: 1;
  pointer-events: none;
}

.search-bar input {
  flex: 1;
  padding-left: 2.25rem;
  border-radius: var(--radius-pill);
  border-color: var(--color-border);
}

.search-bar input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 0.2rem rgba(26,158,92,.15);
}

/* ── Scan-resultat kort i upload.php ─────────────────────────────────────── */
.scan-result--ok {
  background: var(--color-primary-light);
  border-radius: var(--radius-card);
  padding: 0.75rem 1rem;
}
.scan-result--ok .scan-result__icon {
  background: rgba(26,158,92,.15);
  color: var(--color-primary);
}
.scan-result--ok .scan-result__title { color: var(--color-primary); }

.scan-result--warn {
  background: #fff8e1;
  border-radius: var(--radius-card);
  padding: 0.75rem 1rem;
}
.scan-result--warn .scan-result__icon {
  background: #fff3cd;
  color: #856404;
}
.scan-result--warn .scan-result__title { color: #856404; }

.scan-result__icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-pill);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ── Kvittering preview-wrap (upload.php) ───────────────────────────────── */
.receipt-preview-wrap {
  position: relative;
  cursor: zoom-in;
  border-radius: var(--radius-card);
  overflow: hidden;
  display: block;
}
.receipt-preview-wrap:hover .receipt-preview-thumb {
  filter: brightness(0.88);
  transition: filter 0.15s;
}
.receipt-preview-zoom {
  position: absolute;
  bottom: 10px; right: 10px;
  background: rgba(0,0,0,.55);
  color: #fff;
  border-radius: var(--radius-pill);
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}
.receipt-preview-wrap:hover .receipt-preview-zoom {
  opacity: 1;
}

/* ── Fil-preview bar i upload.php ────────────────────────────────────────── */
.file-preview-bar {
  background: var(--color-primary-light);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
}

/* ── Varelinjer i upload-formular ────────────────────────────────────────── */
.item-row {
  background: var(--color-bg);
  border-radius: 10px;
  padding: 0.4rem 0.625rem;
  margin-bottom: 0.5rem;
}

.item-price { max-width: 90px; }
.item-cat   { max-width: 130px; }

.item-remove {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--color-text-muted);
  padding: 4px 6px;
  border-radius: 6px;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.item-remove:hover { background: var(--color-expense-light); color: var(--color-expense); }

/* Totals summary */
.items-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.items-summary__pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}
.items-summary__pill--dag   { background: var(--color-primary-light); color: var(--color-primary); }
.items-summary__pill--div   { background: #f3f4f6; color: var(--color-text-muted); }
.items-summary__pill--total { background: var(--color-text); color: #fff; }

/* ── Upload-side wrapper (begrænset bredde) ──────────────────────────────── */
.upload-page-wrap {
  max-width: 560px;
}
@media (min-width: 992px) {
  .upload-page-wrap--wide {
    max-width: none;
  }
}

/* ── Upload Zone ─────────────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-card);
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: var(--color-surface);
  transition: border-color 0.2s, background 0.2s;
}

.upload-zone.drag-over {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

/* ── Profil Header (account.php) ────────────────────────────────────────────── */
.profile-header {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.profile-header__banner {
  background: linear-gradient(135deg, #1a9e5c 0%, #0d7a45 100%);
  height: 80px;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 1.5rem;
}

.profile-header__avatar {
  width: 72px;
  height: 72px;
  background: var(--color-surface);
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  font-size: 2.2rem;
  box-shadow: var(--shadow-card);
  position: relative;
  z-index: 10;
  margin-bottom: -36px;
}

.profile-header__content {
  padding: 2.5rem 1.5rem 1.5rem;
  text-align: center;
}

.profile-header__content h2 {
  margin-top: 0.5rem;
}

/* ── App Card (generic) ────────────────────────────────────────────────────── */
.app-card {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1.25rem;
}

.danger-zone {
  border-left: 4px solid var(--color-expense);
}

.danger-zone__icon {
  width: 40px;
  height: 40px;
  background: var(--color-expense-light);
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-expense);
  font-size: 1.1rem;
}

/* ── Account page layout ────────────────────────────────────────────────────── */
.account-main {
  max-width: none;
}

/* ── Highlight Cards (milepæle, top stats) ─────────────────────────────────── */
.highlight-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--color-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1rem;
  overflow: hidden;
  position: relative;
  height: 100%;
}

.highlight-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.highlight-card--primary::before { background: var(--color-primary); }
.highlight-card--success::before { background: #10b981; }
.highlight-card--accent::before { background: #f59e0b; }
.highlight-card--info::before { background: #3b82f6; }

.highlight-card__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.highlight-card--primary .highlight-card__icon { background: var(--color-primary-light); color: var(--color-primary); }
.highlight-card--success .highlight-card__icon { background: #d1fae5; color: #10b981; }
.highlight-card--accent .highlight-card__icon { background: #fef3c7; color: #f59e0b; }
.highlight-card--info .highlight-card__icon { background: #dbeafe; color: #3b82f6; }

.highlight-card__content {
  flex: 1;
}

.highlight-card__label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
}

.highlight-card__value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.25rem;
  word-break: break-word;
}

.highlight-card__sub {
  font-size: 0.75rem;
}

/* ── Mini-stat (sammenligning måned) ────────────────────────────────────────── */
.mini-stat {
  background: var(--color-bg);
  border-radius: var(--radius-card);
  padding: 1rem;
  text-align: center;
}

.mini-stat__label {
  color: var(--color-text-muted);
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.mini-stat__value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

.mini-stat__sub {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* ── Top Stores List ────────────────────────────────────────────────────────── */
.top-stores-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.top-store-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  background: var(--color-bg);
  border-radius: var(--radius-card);
}

.top-store-rank {
  width: 32px;
  height: 32px;
  background: var(--color-primary);
  color: white;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.top-store-info {
  flex: 1;
}

.top-store-info .fw-semibold {
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

.top-store-amount {
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
}

/* ── Bottom Navigation (mobil) ───────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  z-index: 1000;
  box-shadow: 0 -2px 12px rgba(0,0,0,.06);
}

.bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.7rem;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
}

.bottom-nav__item.active { color: var(--color-primary); }
.bottom-nav__item i { font-size: 1.3rem; }

.bottom-nav__fab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: var(--color-primary);
  border-radius: var(--radius-pill);
  color: white;
  font-size: 1.5rem;
  text-decoration: none;
  margin-top: -20px;
  box-shadow: var(--shadow-fab);
}

/* ── App Card (generelt kort) ────────────────────────────────────────────── */
.app-card {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  border: none;
  padding: 1rem;
  margin-bottom: 1rem;
}

/* ── Login ───────────────────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  padding-bottom: 0;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--color-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 2rem;
}

.login-logo {
  width: 56px;
  height: 56px;
  background: var(--color-primary);
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  margin: 0 auto 1.25rem;
}

/* ── Form Controls ───────────────────────────────────────────────────────── */
.form-control:focus,
.form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 0.2rem rgba(26,158,92,.15);
}

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge-dagligvarer {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 600;
}

.badge-diverse {
  background-color: #f3f4f6;
  color: var(--color-text-muted);
  font-weight: 600;
}

/* ── Edit page header ────────────────────────────────────────────────────── */
.edit-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 90;
  padding: 0.75rem 1rem;
}

/* ── Danger zone (slet-sektion i receipt_edit) ───────────────────────────── */
.danger-zone {
  border: 1px solid var(--color-expense-light);
  background: var(--color-expense-light);
}

/* Inline noter-edit */
.notes-display {
  cursor: pointer;
  border-radius: 6px;
  padding: 2px 4px;
  margin: -2px -4px;
  display: inline-block;
  transition: background 0.15s;
}
.notes-display:hover {
  background: #fff8e1;
  color: var(--color-text);
}

.danger-zone__icon {
  width: 36px;
  height: 36px;
  background: rgba(229,57,53,.12);
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-expense);
  font-size: 1rem;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--color-text-muted);
  max-width: 280px;
  margin: 3rem auto;
}

.empty-state i {
  font-size: 3rem;
  color: white;
  background: var(--color-primary);
  border-radius: var(--radius-pill);
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.empty-state p {
  color: var(--color-text);
  margin-bottom: 0.5rem !important;
}

/* ── Upgrade Gate (sløret preview + låst panel) ─────────────────────────── */
.upgrade-gate {
  position: relative;
}

.upgrade-gate__blur {
  pointer-events: none;
  user-select: none;
}

.upgrade-gate__panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--color-surface);
  border-radius: var(--radius-card);
  box-shadow: 0 8px 32px rgba(0,0,0,.14);
  padding: 1.75rem 1.5rem;
  text-align: center;
  width: min(340px, 90vw);
  z-index: 10;
}

.upgrade-gate__icon {
  width: 52px;
  height: 52px;
  background: var(--color-primary-light);
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  font-size: 1.4rem;
  margin: 0 auto 1rem;
}

/* ── Desktop (≥992px) ────────────────────────────────────────────────────── */
@media (min-width: 992px) {
  body { padding-bottom: 0; }

  .main-content {
    margin-left: var(--sidebar-w);
    padding: 2rem;
  }
}

/* ── Upgrade-banner (free-brugere) ──────────────────────────────────────── */
.upgrade-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, var(--color-primary-light) 0%, rgba(46, 204, 113, 0.15) 100%);
  border: 1px solid var(--color-primary-light);
  border-radius: var(--radius-card);
  padding: 0.75rem 1rem;
  color: var(--color-text);
}

[data-theme="dark"] .upgrade-banner {
  background: linear-gradient(135deg, var(--color-primary-light) 0%, rgba(46, 204, 113, 0.2) 100%);
  color: var(--color-text);
}

.upgrade-banner .text-muted {
  color: var(--color-text-muted) !important;
}

.upgrade-banner__icon {
  width: 36px; height: 36px;
  background: var(--color-primary);
  border-radius: var(--radius-pill);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 1rem;
  flex-shrink: 0;
}

/* ── Toast notifications (øverste højre hjørne) ──────────────────────────── */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1050;
  max-width: 360px;
}

.toast {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  padding: 1rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideIn 0.3s ease-out;
}

.toast.hide {
  animation: slideOut 0.3s ease-in forwards;
}

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

@keyframes slideOut {
  to {
    opacity: 0;
    transform: translateX(400px);
  }
}

.toast--success {
  border-left: 4px solid var(--color-primary);
}

.toast--success .toast-icon {
  color: var(--color-primary);
}

.toast--error {
  border-left: 4px solid var(--color-expense);
}

.toast--error .toast-icon {
  color: var(--color-expense);
}

.toast-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
  font-size: 0.95rem;
}

.toast-close {
  background: none;
  border: none;
  color: var(--color-text-muted);
  padding: 2px;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s;
}

.toast-close:hover {
  color: var(--color-text);
}

.toast-timer {
  height: 2px;
  background: var(--color-primary);
  border-radius: 9999px;
  margin-top: 0.5rem;
}

/* ── Typeahead (varenavn-forslag) ────────────────────────────────────────── */
.typeahead-wrap {
  position: relative;
  flex-grow: 1;
}

.typeahead-wrap input {
  width: 100%;
}

.typeahead-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  z-index: 500;
  max-height: 220px;
  overflow-y: auto;
}

.typeahead-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.1s;
}

.typeahead-item:first-child { border-radius: 10px 10px 0 0; }
.typeahead-item:last-child  { border-radius: 0 0 10px 10px; }
.typeahead-item:only-child  { border-radius: 10px; }

.typeahead-item:hover,
.typeahead-item.active {
  background: var(--color-primary-light);
}

.typeahead-item__name {
  font-weight: 500;
  color: var(--color-text);
}

.typeahead-item__cat {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  flex-shrink: 0;
}
