:root {
  --bg: #080b10;
  --panel: #0e131b;
  --raised: #141b26;
  --line: #1c2531;
  --line-soft: #161d27;
  --text: #e8eef5;
  --dim: #7d8b9c;
  --faint: #4d5867;
  --accent: #4cc2ff;
  --ours: #3fb950;
  --gold: #e3b341;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.5 -apple-system, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 22px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.title { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }

h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.1px;
  display: flex;
  align-items: center;
  gap: 7px;
}
h1 span { color: var(--accent); }

#meta {
  margin: 0;
  color: var(--dim);
  font-size: 12px;
  font-family: var(--mono);
  letter-spacing: -0.2px;
}

.controls { display: flex; align-items: center; gap: 8px; }

.clock {
  display: inline-flex;
  gap: 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.clock .ck b {
  color: hsl(140 55% 60%);
  font-weight: 700;
  margin-right: 5px;
  letter-spacing: .5px;
}

.live {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #24d366;
  display: inline-block;
  animation: livePulse 1.4s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(36, 211, 102, .7), 0 0 6px 1px rgba(36, 211, 102, .8);
    opacity: 1;
  }
  50% {
    box-shadow: 0 0 0 6px rgba(36, 211, 102, 0), 0 0 10px 3px rgba(36, 211, 102, .5);
    opacity: .65;
  }
}
.live.bad {
  background: #6b7280;
  animation: none;
  box-shadow: none;
}


select, input[type="date"], button {
  background: var(--raised);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 11px;
  font-size: 12px;
  font-family: inherit;
  height: 30px;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
select { padding-right: 26px; }
input[type="date"] { font-family: var(--mono); font-size: 11px; }

select:hover, input[type="date"]:hover, button:hover {
  border-color: #2c3949;
  background: #18202c;
}
select:focus, input:focus, button:focus-visible {
  outline: none;
  border-color: var(--accent);
}
button:disabled { opacity: .45; cursor: default; }

#export {
  background: var(--accent);
  border-color: var(--accent);
  color: #06121b;
  font-weight: 600;
}
#export:hover { background: #6bcdff; border-color: #6bcdff; }

#range { display: inline-flex; gap: 6px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  padding: 10px 22px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 11px;
  position: relative;
  overflow: hidden;
  transition: border-color .12s, transform .12s;
}
.card:hover { border-color: #2c3949; transform: translateY(-1px); }
.card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: .6;
}

.card-name {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
  text-align: center;
  text-transform: capitalize;
  letter-spacing: -.2px;
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.card-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}
.card-row:first-of-type { margin-top: 0; }

.cell { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.cell.r { text-align: right; align-items: flex-end; }

.cnum {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -.3px;
  font-variant-numeric: tabular-nums;
}
.card-row:first-of-type .cell.l .cnum { color: hsl(205 80% 62%); }  /* sent  - biru */
.card-row:first-of-type .cell.r .cnum { color: hsl(275 70% 68%); }  /* recv  - ungu */
.cnum.usd  { color: hsl(140 55% 58%); font-size: 12px; }            /* traffic - hijau */
.cnum.rent { color: hsl(38 90% 60%); font-size: 12px; font-weight: 700; } /* rent - oranye */

.clbl {
  font-size: 8px;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-top: 1px;
}

main {
  flex: 1;
  overflow: auto;
  padding: 0 22px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
}

th {
  text-align: center;
  padding: 10px 12px;
  color: var(--faint);
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .7px;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
  vertical-align: middle;
}

tbody tr { transition: background .1s; }
tbody tr:hover { background: #10161f; }
tbody tr.fresh { animation: flash 2s cubic-bezier(.2,.8,.3,1); }
@keyframes flash {
  0%   { background: rgba(76,194,255,.22); }
  100% { background: transparent; }
}

.node {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.node::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--faint);
  flex-shrink: 0;
}
.node.ours { color: var(--ours); font-weight: 600; }
.node.ours::before { background: var(--ours); box-shadow: 0 0 0 2px rgba(63,185,80,.18); }

.when { text-align: right; white-space: nowrap; }
.tgl { color: var(--dim); font-family: var(--mono); font-size: 11.5px; }
.jam { font-family: var(--mono); font-weight: 600; font-size: 12.5px; letter-spacing: -.3px; margin-left: 8px; }

.asset {
  color: var(--gold);
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: .4px;
  background: rgba(227,179,65,.1);
  border: 1px solid rgba(227,179,65,.22);
  padding: 2px 7px;
  border-radius: 4px;
}

.party { font-family: var(--mono); font-size: 11.5px; color: var(--text); }

.num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.num .usd { color: var(--text); margin-left: 8px; font-weight: 600; }
.num .cc { color: var(--faint); margin-left: 6px; font-weight: 500; font-size: 10.5px; }

.tx a {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
  text-decoration: none;
  border-bottom: 1px dotted transparent;
}
.tx a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.empty { text-align: center; color: var(--dim); padding: 60px; font-size: 13px; }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #1f2833; border-radius: 6px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #2b3644; }

@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, 1fr); padding: 12px 14px; }
}

@media (max-width: 820px) {
  header { padding: 12px 14px; }
  main { padding-left: 14px; padding-right: 14px; }
  th, td { padding: 8px 8px; }
  .controls { width: 100%; flex-wrap: wrap; }
}

.utc { font-size: 9.5px; color: var(--faint); letter-spacing: .6px; }

.cards-head { padding: 10px 22px 0; font-size: 10.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .7px; }
.cards-head + .cards { padding-top: 6px; }

.warn { font-size: 10px; color: #e0774a; letter-spacing: .2px; }
#pdf:disabled { opacity: .4; cursor: not-allowed; }

.menu { position: relative; display: inline-block; }
.menu-list {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-width: 108px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
}
.menu-list[hidden] { display: none; }
.menu-list button {
  background: none;
  border: 0;
  border-radius: 0;
  text-align: left;
  padding: 7px 12px;
  font-size: 11.5px;
  color: var(--text);
  cursor: pointer;
}
.menu-list button:hover { background: #1b2836; }

.card-foot {
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  font-size: 9px;
  color: var(--faint);
  text-align: center;
  letter-spacing: .3px;
  font-variant-numeric: tabular-nums;
}
