/* ═══════════════════════════════════════════════════════════════
   LEDGER PAGES — Products Purchased & Impulse Buys Avoided
   ═══════════════════════════════════════════════════════════════ */

.ledger-page {
  max-width: 880px;
  gap: 14px !important;
}

/* ── Hero ── */
.ld-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow);
}
.ld-hero-saved {
  border-left: 3px solid var(--pos);
}
.ld-hero-text h2 {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin: 0 0 2px 0;
  line-height: 1.3;
}
.ld-hero-text h2 svg {
  display: none;
}
.ld-hero-text p {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.4;
  margin: 0;
}
.ld-hero .btn {
  flex: none;
  padding: 8px 16px;
  font-size: 13px;
  min-height: auto;
}

/* ── Empty state ── */
.ld-empty {
  text-align: center;
  padding: 48px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.ld-empty svg {
  display: none;
}
.ld-empty-title {
  font-weight: 650;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
}
.ld-empty-body {
  font-size: 12.5px;
  color: var(--text-3);
  max-width: 360px;
  margin: 0 auto;
  line-height: 1.45;
}

/* ── Month section ── */
.ld-month {
  margin-bottom: 8px;
}
.ld-month-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}
.ld-month-title {
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
}
.ld-month-meta {
  font-size: 12px;
  color: var(--text-3);
}
.ld-month-total {
  margin-left: auto;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ld-month-total.pos {
  color: var(--pos-text);
}

/* ── Item list ── */
.ld-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Item card ── */
.ld-item {
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ld-item:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  box-shadow: var(--shadow);
}

/* Left accent strip */
.ld-item-strip {
  width: 3px;
  flex: none;
}

/* Body */
.ld-item-body {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}
.ld-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ld-item-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.ld-item-meta {
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ld-item-note {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
  line-height: 1.4;
}

/* Side — price + actions */
.ld-item-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  padding: 8px 12px;
  border-left: 1px solid var(--border);
  flex: none;
}
.ld-item-price {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  white-space: nowrap;
}
.ld-item-price.pos {
  color: var(--pos-text);
}
.ld-item-actions {
  display: flex;
  gap: 2px;
}
.ld-item-actions .btn {
  padding: 4px 6px;
  font-size: 11px;
  border-radius: 5px;
  min-height: auto;
}
.ld-item-actions .btn svg {
  width: 13px;
  height: 13px;
}

/* ── Chips ── */
.ld-chip {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex: none;
}
.ld-chip-list {
  background: var(--accent-soft);
  color: var(--accent);
}
.ld-chip-cat {
  background: var(--surface-3);
  color: var(--text-3);
}

/* ── Footer ── */
.ld-footer {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
}
.ld-footer .btn {
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12.5px;
}

/* ── Modal ── */
.ld-modal {
  max-width: 440px;
}
.ld-modal-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.ld-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.ld-modal-title svg {
  display: none;
}
.ld-modal-sub {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 3px;
}
.ld-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
}
.ld-modal-actions .btn {
  min-height: 36px;
  padding: 8px 18px;
  font-size: 13px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .ld-hero {
    flex-direction: column;
    align-items: stretch;
    padding: 16px 18px;
    gap: 12px;
  }
  .ld-hero .btn {
    width: 100%;
  }
}

@media (max-width: 620px) {
  .ld-item {
    flex-wrap: wrap;
  }
  .ld-item-strip {
    width: 100%;
    height: 3px;
  }
  .ld-item-side {
    width: 100%;
    flex-direction: row;
    border-left: none;
    border-top: 1px solid var(--border);
    justify-content: space-between;
    padding: 8px 14px;
  }
  .ld-item-actions {
    flex-direction: row;
  }
  .ld-modal-actions {
    flex-direction: column-reverse;
  }
  .ld-modal-actions .btn {
    width: 100%;
  }
}
