:root {
  --bg: #0b0f19;
  --card: #121829;
  --muted: #8b93a7;
  --text: #e6eaf2;
  --accent: #4f8cff;
  --border: #1b2236;
  --row-alt: #0f1424;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

.app-header {
  border-bottom: 1px solid var(--border);
  padding: 28px 0 20px;
}

.app-header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.2px;
  background: linear-gradient(135deg, #8b5cf6, #ec4899, #3b82f6);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% 200%;
  animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.subtitle {
  margin: 8px 0 0;
  color: var(--muted);
}

main.container { padding: 24px 16px 40px; }

.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.button {
  display: inline-block;
  background: linear-gradient(180deg, #5a91ff 0%, #3a6fff 100%);
  color: white;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  border: 1px solid #2f56c0;
  box-shadow: 0 8px 20px rgba(79, 140, 255, 0.25);
}

#file-input { display: none; }

.hint { color: var(--muted); font-size: 14px; }
.hint a { 
  color: #22c55e; 
  text-decoration: none; 
  font-weight: 600;
  transition: color 0.2s ease;
}
.hint a:hover { 
  color: #16a34a; 
  text-decoration: underline;
}

.table-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.styled-table {
  width: 100%;
  border-collapse: collapse;
}

.styled-table thead th {
  position: sticky;
  top: 0;
  background: var(--card);
  text-align: left;
  padding: 14px 16px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.styled-table thead th.sortable {
  cursor: pointer;
  user-select: none;
}

.styled-table thead th.sortable .sort-indicator {
  margin-left: 6px;
  color: var(--muted);
}

.styled-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.styled-table tbody tr:nth-child(even) { background: var(--row-alt); }

.styled-table tbody tr:hover { background: rgba(79, 140, 255, 0.08); }

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 14px;
}

.page-size {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.pager {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pager-btn {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.pager-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-info { color: var(--muted); }

.app-footer {
  border-top: 1px solid var(--border);
  padding: 18px 0;
  color: var(--muted);
}

.app-footer a {
  color: #22c55e;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.app-footer a:hover {
  color: #16a34a;
  text-decoration: underline;
}

/* Accordion styling */
.accordion {
  background: transparent;
  border: none;
  margin-top: 24px;
}

.accordion > summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 0;
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--text);
}

.accordion > summary::-webkit-details-marker { display: none; }

.accordion > summary::after {
  content: '▾';
  display: inline-block;
  margin-left: 8px;
  color: var(--muted);
  transition: transform 0.15s ease;
}

.accordion[open] > summary::after { transform: rotate(0deg); }
.accordion:not([open]) > summary::after { transform: rotate(-90deg); }

/* Overview card */
.overview-card {
  background: linear-gradient(180deg, rgba(79,140,255,0.10) 0%, rgba(79,140,255,0.06) 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}

.overview-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.overview-header h2 {
  margin: 0;
  font-size: 18px;
}

.overview-emoji { font-size: 20px; }

.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  background: rgba(0,0,0,0.15);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.metric .label { color: var(--muted); font-size: 13px; }
.metric .value { font-size: 18px; font-weight: 600; margin-top: 6px; }

.value-positive { color: #22c55e; font-weight: 700; }

/* Special gold gradient for total received (all time) */
#ov-total {
  background: linear-gradient(135deg, #fbbf24, #f59e0b, #d97706) !important;
  background-clip: text !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-size: 200% 200% !important;
  animation: goldShimmer 3s ease-in-out infinite !important;
  font-weight: 700 !important;
  font-size: 28px !important;
}

@keyframes goldShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.value-multiline {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.value-multiline .sub { font-size: 13px; color: var(--muted); font-weight: 500; }

/* Centered big-number cards */
.metric.center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.metric.center .value {
  font-size: 26px;
}

@media (max-width: 720px) {
  .overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 460px) {
  .overview-grid { grid-template-columns: 1fr; }
}

/* Chart card */
.chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin: 16px 0;
  padding: 16px;
}
.chart-wrapper { padding: 0; }

@media (max-width: 640px) {
  .app-header h1 { font-size: 22px; }
  .styled-table thead th, .styled-table tbody td { padding: 12px; }
}



