/* ============================================================
   Marty — History page (F5)
   Search, filter chips, day-grouped transaction list, detail /
   edit modals. Uses core tokens + components from app.css.
   ============================================================ */

/* ------------------------------------------------ search ---- */

.hist-search {
  position: relative;
  margin-bottom: 12px;
}
.hist-search-ico {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  opacity: .55;
  pointer-events: none;
}
.hist-search input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  padding: 12px 16px 12px 42px;
  outline: none;
  transition: border-color .15s ease;
}
.hist-search input:focus { border-color: var(--green); }
.hist-search input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* ------------------------------------------------ chips ----- */

.hist-chips { margin-bottom: 4px; }

.hist-chip-count {
  background: var(--green);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ------------------------------------------- day groups ----- */

.hist-day { margin-top: 14px; }

.hist-day-head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 8px 6px 6px;
  background: var(--bg);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.hist-day-total { font-size: 13px; }

.hist-card { padding: 2px 12px; }

/* ---------------------------------------------- list rows --- */

button.hist-row {
  width: 100%;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button.hist-row:active { background: var(--green-softer); }

.hist-row .list-ico,
.hist-detail-head .list-ico { border-radius: 50%; }

.hist-ico-transfer {
  background: var(--bg);
  color: var(--muted);
}

/* ------------------------------------- sentinel / paging ---- */

.hist-sentinel {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 0 8px;
}
.hist-end { font-size: 13px; }

/* -------------------------------------------- modal bits ---- */

.hist-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.hist-modal-actions .btn-ghost { flex-shrink: 0; }

/* -------------------------------------------- detail modal -- */

.hist-detail-head {
  text-align: center;
  padding: 6px 0 14px;
}
.hist-detail-head .list-ico {
  margin: 0 auto 10px;
  width: 52px;
  height: 52px;
  font-size: 24px;
}
.hist-detail-amt {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.01em;
}
.hist-detail-title {
  font-size: 15px;
  color: var(--muted);
  margin-top: 2px;
  word-break: break-word;
}

.hist-detail-rows { border-top: 1px solid var(--line); }
.hist-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.hist-detail-label {
  color: var(--muted);
  font-weight: 600;
  flex-shrink: 0;
}
.hist-detail-val {
  text-align: right;
  word-break: break-word;
}

.hist-receipt {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-top: 14px;
  cursor: zoom-in;
}

/* ------------------------------------- segmented control ---- */

.hist-seg {
  display: flex;
  background: var(--bg);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 16px;
}
.hist-seg-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 0;
  border-radius: 999px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.hist-seg-btn.active {
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
}
