/* ==========================================================================
   BillTrack — Minimalist layer
   Presentation only. Loaded after style.css and mobile.css on every page.
   Keeps the existing dark green palette and every class name used by the
   scripts; it only tightens type, spacing, borders and form controls.
   Remove this file (and its <link> tags) to return to the previous look.
   ========================================================================== */

:root,
:root[data-theme="dark"] {
  /* Surfaces: flatter, one step apart */
  --background: #07140f;
  --surface: #0c1f18;
  --surface-alt: #10281f;
  --border: #1c3a2d;
  --border-strong: #2a4d3d;
  --text: #eef3ee;
  --text-muted: #94ab9e;
  --brand-accent: #5fd1a0;
  --primary: #2a8a63;
  --primary-light: #123428;

  /* One radius scale */
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: none;
  --shadow-md: 0 8px 24px rgba(0, 0, 0, .28);
  --ring: 0 0 0 3px rgba(95, 209, 160, .18);

  /* One type scale */
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 20px;
  --fs-2xl: 24px;
  --fs-num: 26px;
}

/* Base -------------------------------------------------------------------- */
body {
  font-size: var(--fs-md);
  line-height: 1.5;
  background: var(--background);
  letter-spacing: 0;
}
:root[data-theme="dark"] body { background: var(--background); }

/* Falling-peso background (.money-bg) and the dashboard peso hero (.finance-hero) stay visible. */

/* Typography -------------------------------------------------------------- */
.page-heading {
  font-size: var(--fs-2xl);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.25;
  margin-bottom: 1.1rem;
}
.page-subtext { font-size: var(--fs-xs); color: var(--text-muted); margin: 0 0 .75rem; line-height: 1.45; }
.card-surface .page-subtext { margin-top: 0; }
.card-heading { font-size: var(--fs-lg); font-weight: 650; letter-spacing: -.005em; }
.card-subheading { font-size: var(--fs-md); font-weight: 600; }
.bill-meta, .text-muted, .small { font-size: var(--fs-xs); }
.bill-provider { font-weight: 600; }
strong, b { font-weight: 650; }

/* Layout ------------------------------------------------------------------ */
.main-content { padding: 1.5rem 1.75rem 3rem; max-width: 1400px; }

/* Sidebar & topbar -------------------------------------------------------- */
:root[data-theme="dark"] .sidebar {
  background: #081a13;
  border-right: 1px solid var(--border);
}
:root[data-theme="dark"] .topbar { background: rgba(7, 20, 15, .96); }
.sidebar-brand { font-size: var(--fs-lg); font-weight: 700; margin-bottom: 1.25rem; }
.nav-item-link {
  font-size: var(--fs-md);
  font-weight: 500;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text-muted);
}
.nav-item-link:hover { background: rgba(255, 255, 255, .04); color: var(--text); }
.nav-item-link.active {
  background: var(--primary-light);
  color: var(--text);
  border-color: transparent;
  font-weight: 600;
}
.nav-image-icon { width: 20px; height: 20px; opacity: .85; }
.nav-item-link.active .nav-image-icon { opacity: 1; }
.sidebar-footer { display: none; }
.sidebar-user { border-top: 1px solid var(--border); }
.sidebar-user-name { font-size: var(--fs-sm); font-weight: 600; }

/* Cards ------------------------------------------------------------------- */
.card-surface,
:root[data-theme="dark"] .card-surface {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: none;
  padding: 1.1rem 1.25rem;
  transition: none;
}
.card-surface:hover { box-shadow: none; border-color: var(--border); transform: none; }
.card-surface.mb-3 { margin-bottom: 1rem !important; }

/* Metric cards: label small and quiet, figure large and plain */
.metric-card { padding: 1rem 1.15rem; }
.metric-card .metric-label {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.metric-card .metric-value {
  font-size: var(--fs-num);
  font-weight: 650;
  letter-spacing: -.02em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.metric-card .metric-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--surface-alt);
  opacity: .9;
}
.metric-card-featured {
  background: var(--surface);
  border-color: var(--primary);
}
.metric-card-featured::after { display: none; }
.metric-card-featured .metric-label { color: var(--text-muted); }
.metric-card-featured .metric-value { color: var(--brand-accent); }
.dashboard-image-icon { width: 20px; height: 20px; }

/* Lists & tables ---------------------------------------------------------- */
.bill-row { padding: 11px 4px; font-size: var(--fs-md); border-radius: 6px; }
.bill-row:hover { background: rgba(255, 255, 255, .03); }
.bill-list-header {
  font-size: var(--fs-xs);
  font-weight: 600;
  padding-bottom: 8px;
}
.table-wrap { border-radius: var(--radius); border: 1px solid var(--border); }
.table thead th,
.table > thead > tr > th {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  background: var(--surface-alt);
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding: .6rem .85rem;
}
.table > tbody > tr > td { padding: .65rem .85rem; font-size: var(--fs-md); }
.table > tbody > tr:hover > td { background: rgba(255, 255, 255, .025); }

.status-pill {
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
}
.empty-state { padding: 1.5rem 1rem; font-size: var(--fs-sm); color: var(--text-muted); }

/* Buttons ----------------------------------------------------------------- */
.btn {
  font-size: var(--fs-md);
  font-weight: 600;
  letter-spacing: 0;
  border-radius: var(--radius-sm);
  padding: .5rem 1rem;
  min-height: 38px;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.btn:not(:disabled):hover { filter: none; }
.btn-navy {
  background: var(--primary);
  border: 1px solid var(--primary);
  color: #fff;
}
.btn-navy:hover, .btn-navy:focus, .btn-navy:active {
  background: #33a177;
  border-color: #33a177;
  color: #fff;
}
.btn-outline-navy, .btn-outline-secondary,
:root[data-theme="dark"] .btn-outline-navy,
:root[data-theme="dark"] .btn-outline-secondary {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.btn-outline-navy:hover, .btn-outline-secondary:hover,
:root[data-theme="dark"] .btn-outline-navy:hover,
:root[data-theme="dark"] .btn-outline-secondary:hover {
  background: var(--surface-alt);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { min-height: 32px; padding: .3rem .7rem; font-size: var(--fs-sm); }
.btn-ghost-icon { border-radius: var(--radius-sm); }

/* Segmented toggles / tabs ------------------------------------------------ */
.range-toggle,
:root[data-theme="dark"] .range-toggle {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
}
.range-toggle button {
  font-size: var(--fs-sm);
  font-weight: 500;
  border-radius: 6px;
  padding: 5px 12px;
  color: var(--text-muted);
}
.range-toggle button.active,
:root[data-theme="dark"] .range-toggle button.active {
  background: var(--primary-light);
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--border-strong);
}
.nav-tabs { border-bottom: 1px solid var(--border); }
.nav-tabs .nav-link {
  font-size: var(--fs-md);
  font-weight: 500;
  color: var(--text-muted);
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  padding: .55rem 1rem;
}
.nav-tabs .nav-link.active {
  color: var(--text);
  font-weight: 600;
  background: transparent;
  border-bottom-color: var(--brand-accent);
}

/* Form controls: one look for input, select, date, textarea, search ------- */
.form-label {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.form-control, .form-select,
:root[data-theme="dark"] .form-control,
:root[data-theme="dark"] .form-select,
:root[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea {
  background-color: var(--surface-alt);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: var(--fs-md);
  line-height: 1.4;
  min-height: 40px;
  padding: .5rem .75rem;
  box-shadow: none;
  transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}
textarea.form-control { min-height: 84px; resize: vertical; }
.form-control::placeholder,
:root[data-theme="dark"] .form-control::placeholder,
:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder { color: #6f8a7c; opacity: 1; }
.form-control:hover:not(:disabled):not([readonly]),
.form-select:hover:not(:disabled) { border-color: #3a6652; }
.form-control:focus, .form-select:focus,
:root[data-theme="dark"] .form-control:focus,
:root[data-theme="dark"] .form-select:focus,
:root[data-theme="dark"] input:focus,
:root[data-theme="dark"] select:focus,
:root[data-theme="dark"] textarea:focus {
  background-color: var(--surface-alt);
  border-color: var(--brand-accent);
  box-shadow: var(--ring);
  outline: none;
}
.form-control:disabled, .form-select:disabled,
.form-control[readonly] {
  background-color: transparent;
  color: var(--text-muted);
  border-style: dashed;
  cursor: not-allowed;
}
.form-control[readonly]:not(:disabled) { cursor: default; }
.form-control.is-invalid, .form-select.is-invalid {
  border-color: var(--danger);
  background-image: none;
  padding-right: .75rem;
}
.form-control.is-invalid:focus, .form-select.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(255, 154, 139, .2);
}
.form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394ab9e' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6' d='m3 6 5 5 5-5'/%3e%3c/svg%3e");
  background-size: 14px;
  padding-right: 2.25rem;
}
input[type="date"], input[type="month"] { color-scheme: dark; }
.input-group-text {
  background: var(--surface-alt);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: var(--fs-md);
}
.input-group > .form-control:not(:first-child),
.input-group > .form-select:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group > :not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.form-check-input { background-color: var(--surface-alt); border-color: var(--border-strong); }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-check-label { font-size: var(--fs-md); }
.form-text, .form-hint, .field-hint { font-size: var(--fs-xs); color: var(--text-muted); }
.invalid-feedback, .field-error { font-size: var(--fs-xs); color: var(--danger); }

/* Dashboard filter bar ---------------------------------------------------- */
.dash-filters { padding: .75rem 1rem; }
.dash-active-label { font-size: var(--fs-xs); color: var(--text-muted); }
.dash-nav-btn {
  background: var(--surface-alt);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
}
.dash-note { display: none; }

/* Modals, dropdowns, toasts ---------------------------------------------- */
.modal-content { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); }
.modal-title { font-size: var(--fs-lg); font-weight: 650; }
.modal-header, .modal-footer { border-color: var(--border); }
.dropdown-menu { border-radius: var(--radius-sm); border: 1px solid var(--border); box-shadow: var(--shadow-md); }

/* Auth screens ------------------------------------------------------------ */
.auth-visual { background: #081a13; border-right: 1px solid var(--border); }
.auth-visual::before, .auth-visual::after { display: none; }
.auth-visual-subtitle { font-size: var(--fs-lg); }
.auth-visual-feature { margin-bottom: 1rem; }
.auth-visual-feature div div:first-child { font-size: var(--fs-md); font-weight: 600; }
.auth-card { border-radius: var(--radius); box-shadow: none; border: 1px solid var(--border); }
.auth-title { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -.02em; }
.auth-subtitle { font-size: var(--fs-md); margin-bottom: 1.25rem; }
.auth-footer-link { font-size: var(--fs-md); }

/* Collapsed helper copy: long explanations stay out of the way ------------- */
.hint-long { display: none; }

/* Responsive -------------------------------------------------------------- */
@media (max-width: 991.98px) {
  .main-content { padding: 1rem 1rem 2.5rem; }
  .page-heading { font-size: var(--fs-xl); }
  .metric-card .metric-value { font-size: 22px; }
}
@media (max-width: 575.98px) {
  .card-surface { padding: .9rem 1rem; }
  .metric-card { padding: .85rem .95rem; }
  .metric-card .metric-value { font-size: 20px; }
  .btn { min-height: 42px; }
  .form-control, .form-select { min-height: 44px; }
}

/* Small refinements ------------------------------------------------------- */
.sidebar-brand { justify-content: flex-start; padding: 0 10px; margin-bottom: 1.25rem; }
.sidebar-brand .brand-mark { width: 44px; height: 44px; box-shadow: none; }
.dash-active-label { background: transparent; color: var(--text-muted); font-weight: 500; padding: 0; }
.dash-active-label:empty { display: none; }
.dash-cat-btn { min-height: 38px; }

/* Data only: no helper notes under figures or charts ------------------------ */
.metric-card .bill-meta,
#billsChartSummary,
#forecastChartNote,
#dailyStats .bill-meta + div ~ .bill-meta,
#dailyStats .col .bill-meta:last-child,
.payment-compare-grid + .bill-meta { display: none !important; }

/* Metric cards: icon pinned top-right, figure gets the full width */
.metric-card .metric-icon {
  position: absolute; top: 12px; right: 12px;
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.metric-card .metric-icon .dashboard-image-icon,
.metric-card .metric-icon .ti { width: 16px; height: 16px; font-size: 16px; }
.metric-card .metric-label { padding-right: 34px; }
.metric-card .metric-value { font-size: clamp(20px, 1.8vw, 24px); white-space: nowrap; }

/* Payment history: "this month" breakdown ---------------------------------- */
.payment-compare { padding: 1rem 1.25rem; }
.pc-head { display: flex; align-items: center; gap: 8px; font-size: var(--fs-md); font-weight: 600; margin-bottom: .75rem; }
.pc-info {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid var(--border-strong); color: var(--text-muted);
  font-size: 11px; font-weight: 600; line-height: 16px; text-align: center; cursor: help;
}
.pc-info:hover, .pc-info:focus-visible { color: var(--text); border-color: var(--brand-accent); }
.payment-compare .payment-compare-grid {
  display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 10px 16px; margin: 0;
}
.pc-label { font-size: var(--fs-sm); color: var(--text-muted); font-weight: 500; }
.pc-amount { font-size: var(--fs-xl); font-weight: 650; letter-spacing: -.02em; line-height: 1.25; font-variant-numeric: tabular-nums; }
.pc-count { font-size: var(--fs-xs); color: var(--text-muted); }
.pc-live .pc-amount { color: var(--brand-accent); }
.pc-gone .pc-amount { color: var(--text-muted); }
.pc-op { color: var(--border-strong); font-size: var(--fs-lg); font-weight: 500; }
@media (max-width: 575.98px) {
  .payment-compare .payment-compare-grid { gap: 8px; }
  .pc-amount { font-size: var(--fs-md); }
  .pc-label { font-size: var(--fs-xs); }
}

/* Chart legend ------------------------------------------------------------- */
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 .75rem; font-size: var(--fs-sm); color: var(--text-muted); }
.chart-legend:empty { display: none; }
.lg-item { display: inline-flex; align-items: center; gap: 6px; }
.lg-item b { color: var(--text); font-weight: 600; }
.lg-dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }

/* Info button (?) with hover / tap popover ---------------------------------- */
.info-wrap { position: relative; display: inline-flex; align-items: center; }
.info-btn {
  width: 22px; height: 22px; padding: 0; border-radius: 50%;
  border: 1px solid var(--border-strong); background: transparent; color: var(--text-muted);
  font-size: 12px; font-weight: 600; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color 120ms ease, border-color 120ms ease, background-color 120ms ease;
}
.info-btn:hover, .info-btn[aria-expanded="true"] { color: var(--text); border-color: var(--brand-accent); background: var(--surface-alt); }
.info-pop {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 1060;
  width: max-content; max-width: min(300px, calc(100vw - 40px));
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--surface-alt); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md);
  font-size: var(--fs-sm); font-weight: 400; letter-spacing: 0; line-height: 1.4; text-align: left;
}
.info-pop[hidden] { display: none; }
.info-row { display: flex; flex-direction: column; gap: 1px; padding: 5px 0; }
.info-row + .info-row { border-top: 1px solid var(--border); }
.info-row b { color: var(--text); font-weight: 600; }
.info-row span { color: var(--text-muted); }

/* Keep an open popover above neighbouring cards */
.info-raised { position: relative; z-index: 60; }

/* ==========================================================================
   Logo + icon sizing (login / sign-up card, sidebar, dashboard) and the
   supplied sync icon. Presentation only. Medium sizes.
   ========================================================================== */

/* Login / create account: right-hand card ----------------------------------- */
.auth-card { max-width: 480px; padding: 2.3rem 2.3rem 2rem; }
.auth-card.auth-card-wide { max-width: 560px; }
.auth-card-brand .brand-mark { width: 96px; height: 96px; }
.auth-title { font-size: 28px; }
.auth-subtitle { font-size: 15px; margin-bottom: 1.35rem; }
.auth-card .form-control, .auth-card .form-select { min-height: 48px; font-size: 16px; }
.auth-card .btn { min-height: 50px; font-size: 16px; }
.auth-card .btn i, .auth-card .btn .ti { font-size: 22px; }
.auth-card .password-toggle-btn, .auth-card .password-toggle-btn i { font-size: 22px; }
.auth-card .auth-method-tab { min-height: 54px; font-size: 15px; gap: 8px; }
.auth-card .auth-method-tab i { font-size: 24px; }
.auth-card .auth-camera-note i, .auth-card .form-alert i { font-size: 22px; }
@media (max-width: 575.98px) {
  .auth-card, .auth-card.auth-card-wide { padding: 1.7rem 1.2rem 1.5rem; }
  .auth-card-brand .brand-mark { width: 88px; height: 88px; }
  .auth-title { font-size: 26px; }
  .auth-card .auth-method-tab { min-height: 58px; font-size: 13.5px; }
  .auth-card .auth-method-tab i { font-size: 22px; }
}

/* Sidebar: logo + nav icons --------------------------------------------------- */
.sidebar-brand { justify-content: center; padding: 0; margin-bottom: 1rem; }
.sidebar-brand .brand-mark { width: 84px; height: 84px; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }
.nav-item-link { gap: 11px; padding: 10px 12px; }
.nav-item-link .nav-image-icon { width: 26px; height: 26px; min-width: 26px; flex: 0 0 26px; opacity: .95; }
.nav-item-link i.ti { font-size: 24px; }
.topbar-brand .brand-mark { width: 50px; height: 50px; }

/* Dashboard metric cards: icon back at the top-right, medium size ------------- */
.metric-card .metric-icon {
  position: absolute; top: 12px; right: 12px; margin: 0;
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center; opacity: 1;
}
.metric-card .metric-icon .dashboard-image-icon { width: 24px; height: 24px; }
.metric-card .metric-icon .ti { width: auto; height: auto; font-size: 22px; }
.metric-card .metric-label { padding-right: 46px; }
@media (max-width: 575.98px) {
  .metric-card .metric-icon { width: 34px; height: 34px; flex-basis: 34px; }
  .metric-card .metric-icon .dashboard-image-icon { width: 22px; height: 22px; }
  .metric-card .metric-icon .ti { font-size: 20px; }
  .metric-card .metric-label { padding-right: 40px; }
}

/* Sync button in the top bar uses the supplied picture ------------------------- */
.sync-status { height: 40px; gap: 7px; padding: 0 12px; }
.sync-status .sync-icon { width: 24px; height: 24px; object-fit: contain; flex: 0 0 auto; display: block; }
.sync-syncing .sync-icon { animation: syncSpin 1s linear infinite; }
.sync-offline .sync-icon { filter: grayscale(1); opacity: .6; }
.sync-failed .sync-icon { filter: hue-rotate(-100deg) saturate(1.6); }
.sync-pending .sync-icon { filter: hue-rotate(-60deg) saturate(1.3); }
@media (prefers-reduced-motion: reduce) { .sync-syncing .sync-icon { animation: none; } }

/* ==========================================================================
   All Items row alignment + centered "See more" buttons
   ========================================================================== */
/* ==========================================================================
   Bills / Items / Payment History lists: one aligned grid, three layouts that
   follow the width of the list itself (container queries), so nothing overlaps.
   wide    : name | amount | (due date) | status | actions   on one line
   medium  : name + actions on top, amount / due date / status underneath
   narrow  : stacked, two columns, with small labels
   ========================================================================== */
#billsTableBody, #itemsTableBody, #paymentsList { container-type: inline-size; container-name: rows; }

.card-surface .bill-row.list-row {
  display: grid; align-items: center; column-gap: 10px; row-gap: 10px;
  padding: 14px 8px; min-height: 78px; border-radius: 0; width: 100%;
  border-bottom: 1px solid var(--border);
}
.card-surface .bill-row.list-row:last-child { border-bottom: 0; }
.list-row > * { min-width: 0; }

/* Visual hierarchy: name first, category second, added date / source last (quiet) */
.list-row .cell-info { display: flex; flex-direction: column; gap: 3px; justify-content: center; }
.list-row .bill-provider { font-size: 15px; font-weight: 650; line-height: 1.3; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .bill-category { font-size: 13px; color: var(--text-muted); max-width: 100%; }
.list-row .bill-category { display: flex; align-items: center; gap: 6px; min-width: 0; }
.list-row .category-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.list-row .category-icon .ui-icon { width: 14px; height: 14px; }
.list-row .bill-category .category-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .bill-subline { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 12px; }
.list-row .bill-meta-sub { font-size: 12px; line-height: 1.35; color: var(--text-muted); opacity: .72; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .bill-meta-sub .ti { font-size: 13px; vertical-align: -1px; }
.list-row .source-badge { margin-left: 0; }

/* Value cells share one look; the small label only shows on narrower layouts */
.list-row .cell { font-size: 13px; line-height: 1.35; text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.list-row .cell::before {
  content: attr(data-label); display: none; margin-bottom: 3px;
  font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); opacity: .8;
}
.list-row .cell-amount { font-size: 15px; font-weight: 650; }
.list-row .cell-due, .list-row .cell-paid { color: var(--text-muted); }
.list-row .cell-status { display: flex; justify-content: center; }

/* Status badges: same size, padding and weight for Paid / Upcoming / Due soon / Overdue / No due date */
.list-row .status-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  width: 104px; max-width: 100%; height: 26px; padding: 0 8px; box-sizing: border-box;
  font-size: 12px; font-weight: 600; line-height: 1; letter-spacing: 0; white-space: nowrap;
}
.list-row .status-pill .ui-icon { width: 13px; height: 13px; flex: 0 0 13px; }

/* Action buttons: same size, even spacing, clear hover / pressed / keyboard states */
.list-row .bill-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; justify-self: end; min-width: 0; }
.list-row .btn-ghost-icon {
  width: 36px; height: 36px; min-width: 36px; min-height: 36px; padding: 0; flex: 0 0 36px;
  border-radius: 10px; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .1s ease;
}
.list-row .btn-ghost-icon .ui-icon { width: 18px; height: 18px; }
.list-row .btn-ghost-icon:hover { transform: translateY(-1px); }
.list-row .btn-ghost-icon:active { transform: scale(.93); }
.list-row .btn-ghost-icon:focus-visible { outline: 2px solid var(--primary, #2f9e6f); outline-offset: 2px; }
.list-row .btn-ghost-icon[data-paid]:hover { background: var(--success-bg, rgba(105, 213, 161, .14)); border-color: var(--success, #3fb67f); color: var(--success, #3fb67f); }
.list-row .btn-ghost-icon[data-delete]:hover { background: var(--danger-bg, rgba(231, 111, 81, .12)); border-color: var(--danger, #e76f51); color: var(--danger, #e76f51); }
.list-row .btn-ghost-icon.is-placeholder { visibility: hidden; pointer-events: none; border: 0; }

/* WIDE: one line per record */
.list-row--bill { grid-template-columns: minmax(0, 1fr) 96px 100px 112px 124px; }
.list-row--item { grid-template-columns: minmax(0, 1fr) 96px 112px 124px; }
.payment-history-row.list-row { grid-template-columns: minmax(0, 1fr) 104px 112px 112px; }
.list-row--bill .cell-info, .list-row--item .cell-info, .payment-history-row .cell-info { grid-column: auto; }

/* MEDIUM: name + actions on the first line, amount / due date / status on the second */
@container rows (max-width: 619px) {
  .card-surface .bill-row.list-row { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 14px 4px; }
  .list-row .cell { text-align: left; }
  .list-row .cell::before { display: block; }
  .list-row .cell-status { display: block; }
  .list-row .cell-info { grid-column: 1 / 3; grid-row: 1; padding-right: 6px; }
  .list-row .bill-actions { grid-column: 3; grid-row: 1; }
  .list-row .cell-amount { grid-column: 1; grid-row: 2; }
  .list-row--bill .cell-due { grid-column: 2; grid-row: 2; }
  .list-row--bill .cell-status { grid-column: 3; grid-row: 2; }
  .list-row--item .cell-status { grid-column: 2; grid-row: 2; }
  .payment-history-row .cell-paid { grid-column: 2; grid-row: 2; }
  .payment-history-row .cell-due { grid-column: 3; grid-row: 2; }
  .payment-history-row .cell-info { grid-column: 1 / -1; padding-right: 0; }
  .list-row .btn-ghost-icon { width: 40px; height: 40px; min-width: 40px; min-height: 40px; flex-basis: 40px; }
}

/* NARROW (phones): stacked, two columns */
@container rows (max-width: 419px) {
  .card-surface .bill-row.list-row:not(.payment-history-row) { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; row-gap: 12px; }
  .list-row .cell-info { grid-column: 1 / -1; grid-row: 1; padding-right: 0; }
  .list-row .cell-amount { grid-column: 1; grid-row: 2; }
  .list-row--bill .cell-due { grid-column: 2; grid-row: 2; }
  .list-row--bill .cell-status { grid-column: 1; grid-row: 3; align-self: center; }
  .list-row--bill .bill-actions { grid-column: 2; grid-row: 3; }
  .list-row--item .cell-status { grid-column: 2; grid-row: 2; }
  .list-row--item .bill-actions { grid-column: 1 / -1; grid-row: 3; }
  .list-row .status-pill { width: 104px; max-width: 100%; }
}
@container rows (max-width: 299px) {
  .card-surface .payment-history-row.list-row { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 12px; }
  .payment-history-row .cell-amount { grid-column: 1; grid-row: 2; }
  .payment-history-row .cell-paid { grid-column: 2; grid-row: 2; }
  .payment-history-row .cell-due { grid-column: 1; grid-row: 3; }
}

/* Payment History: filters + card spacing */
.payment-deleted-actions {
  display: flex; align-items: center; justify-content: flex-start; gap: 8px;
  flex: 0 0 auto; flex-wrap: wrap; width: auto; max-width: none; min-height: 0;
  margin: 0; padding: 0; border: 0; background: transparent;
}
.payment-deleted-actions-buttons { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.payment-deleted-actions-buttons .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }
.payment-history-name-line { display: flex; align-items: center; gap: 9px; min-width: 0; }
.payment-delete-checkbox { width: 18px; height: 18px; flex: 0 0 18px; margin: 0; cursor: pointer; }
.payment-history-name-line .bill-provider { min-width: 0; }
.payment-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; }
.payment-toolbar { align-items: flex-start; }
.payment-toolbar > .card-heading { flex: 0 0 auto; padding-top: 10px; }
.payment-filters { flex: 1 1 620px; min-width: 0; }
.payment-filters > * { flex: 1 1 150px; min-width: 0; max-width: 200px; width: auto; min-height: 44px; margin: 0; }
.payment-filters input[type="search"] { -webkit-appearance: none; appearance: none; }
@media (max-width: 991.98px) {
  .payment-toolbar { flex-wrap: wrap; }
  .payment-toolbar > .card-heading { width: 100%; padding-top: 0; }
  .payment-filters { flex: 1 1 100%; justify-content: stretch; }
  .payment-filters > * { max-width: none; }
}
@media (max-width: 767.98px) {
  .payment-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; }
  .payment-filters > * { width: 100%; max-width: none; }
  .payment-filters #paymentSearch { grid-column: 1 / -1; }
  .payment-filters > .payment-deleted-actions { grid-column: 1 / -1; }
}
@media (max-width: 479.98px) {
  .payment-filters { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 575.98px) {
  .main-content .card-surface { padding: 1rem; }
  #paymentsList .bill-row.list-row { padding-left: 2px; padding-right: 2px; }
}

/* Top menu on phones: swipeable strip that snaps to the tabs */
@media (max-width: 991.98px) {
  .sidebar { scroll-snap-type: none; scrollbar-width: none; }
  .sidebar::-webkit-scrollbar { display: none; }
}

/* Every "See more / See less" sits at the center-bottom of its list */
.see-more-row {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; width: 100%; text-align: center;
}
.see-more-row .bill-meta { text-align: center; }
.see-more-row button { width: auto; min-width: 150px; }
@media (max-width: 576px) {
  .see-more-row { flex-direction: column; align-items: center; }
  .see-more-row button { width: auto; min-width: 150px; }
}
.card-surface .bill-row.list-row:hover { box-shadow: inset 0 0 0 9999px rgba(255, 255, 255, .02); }

/* Password show/hide eye: always visible, sits on top of the input */
.input-with-toggle .password-toggle-btn { z-index: 5; color: #b7c9c3; opacity: 1; }
.input-with-toggle .password-toggle-btn:hover,
.input-with-toggle .password-toggle-btn:focus-visible { color: var(--brand-accent, #34d399); }
.password-toggle-btn .pw-eye-icon { width: 22px; height: 22px; display: block; pointer-events: none; }

/* Budget warning notice: the lines of its text (budget, expenses, remaining) stay on separate lines in the bell. */
.notif-desc { white-space: pre-line; }
