:root {
  --bg: #050505;
  --fg: #e0e0e0;
  --muted: #a0a0a0;
  --card: #141414;
  --card2: #1a1a1a;
  --line: #333;
  --accent: #ffd700;
  /* Gold for highlights */
  --highlight-bg: rgba(255, 215, 0, 0.15);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
  /* Align numbers in tables */
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  /* Allow wrapping on mobile */
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(5, 5, 5, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.brand {
  font-weight: 800;
  letter-spacing: -0.5px;
  font-size: 1.1em;
  color: var(--accent);
  white-space: nowrap;
  /* Prevent breaking brand name */
}

.date-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-grow: 1;
  justify-content: flex-end;
  /* Align to right on desktop */
}

/* Visibility Toggles */
/* Visibility Toggles */
.mobile-only {
  display: none !important;
}

.desktop-only {
  display: block !important;
}

/* Mobile optimization */
@media (max-width: 600px) {
  .mobile-only {
    display: block !important;
  }

  .desktop-only {
    display: none !important;
  }

  .topbar {
    justify-content: center;
    padding: 10px;
  }

  .brand {
    width: 100%;
    text-align: center;
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
    margin-bottom: 4px;
  }

  .date-form {
    width: 100%;
    justify-content: space-between;
  }

  .date-form label {
    display: none;
  }

  /* Hide label to save space */
  .date-form input[type='date'] {
    flex-grow: 1;
  }

  .container {
    padding: 0 10px;
    margin: 20px auto;
  }
}

/* ... existing styles ... */

.payment-list {
  display: flex;
  flex-direction: column;
}

.payment-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.payment-row:last-child {
  border-bottom: 0;
}

.payment-label {
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.payment-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.payment-row.total-row {
  border-top: 2px solid var(--line);
  /* This will be the single thick line */
  margin-top: 8px;
  padding-top: 16px;
  padding-bottom: 4px;
}

/* Remove border from the last data row to avoid double lines */
.payment-row:nth-last-child(2) {
  border-bottom: 0;
}

.payment-row.total-row .payment-label,
.payment-row.total-row .payment-value {
  color: var(--accent);
  font-size: 1.1em;
  font-weight: 800;
}

.date-form label {
  color: var(--muted);
  font-size: 14px;
}

.date-form input[type='date'] {
  background: var(--card2);
  color: var(--fg);
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
}

.date-form input[type='date']:focus {
  outline: 2px solid var(--accent);
  border-color: transparent;
}

/* Fix calendar icon color */
.date-form input[type='date'] {
  color-scheme: dark;
  /* Restore dark scheme for proper locale/UI */
}

.date-form input[type='date']::-webkit-calendar-picker-indicator {
  /* Default icon in dark scheme is already white. No invert needed. */
  opacity: 1;
  cursor: pointer;
}

.date-form button {
  background: var(--accent);
  color: #000;
  border: 0;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s, filter 0.2s;
}

.date-form button:hover {
  filter: brightness(1.1);
}

.date-form button:active {
  transform: scale(0.96);
}

.container {
  max-width: 1100px;
  margin: 32px auto;
  padding: 0 20px;
}

.hint,
.empty,
.error,
.loading {
  color: var(--muted);
  text-align: center;
  padding: 60px 0;
  font-size: 1.1em;
}

.error {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
  border-radius: 12px;
}

.store {
  margin-bottom: 32px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.store-title {
  margin: 0;
  padding: 20px 24px;
  background: var(--card2);
  border-bottom: 1px solid var(--line);
  font-size: 1.25em;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.subsec {
  padding: 24px;
}

.subsec+.subsec {
  border-top: 1px solid var(--line);
}

.subsec-title {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85em;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 16px;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.tbl th,
.tbl td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.tbl th {
  text-align: left;
  background: var(--card2);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9em;
}

.tbl tr:last-child td {
  border-bottom: 0;
}

.tbl td.right,
.tbl th.right {
  text-align: right;
}

.tbl td.total,
.tbl th.total {
  text-align: right;
  font-weight: 700;
  color: var(--accent);
  background: rgba(255, 215, 0, 0.05);
}

.tbl tfoot td {
  border-top: 2px solid var(--line);
  background: var(--card2);
  font-weight: 700;
}

.note {
  color: var(--muted);
  font-size: 0.85em;
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 12px;
  border-radius: 6px;
  display: inline-block;
}

.card {
  border: 1px solid var(--accent);
  /* Highlight the total card */
  border-radius: 12px;
  padding: 24px;
  background: linear-gradient(135deg, var(--card2), #222);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.05);
  /* Subtle glow */
}

.highlight {
  /* Class kept for JS compatibility, handling done in .card */
  display: block;
}

.big {
  font-size: 2.2em;
  /* Reduced from 3em */
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.mini {
  color: var(--muted);
  font-size: 0.9em;
  font-family: monospace;
}

.foot {
  color: var(--muted);
  font-size: 0.85em;
  text-align: center;
  padding: 40px 0;
  border-top: 1px solid var(--line);
  margin-top: 60px;
  opacity: 0.6;
}