:root {
  --bg: #f3f6fb;
  --bg-2: #ffffff;
  --card: #ffffff;
  --card-2: #f8fbff;
  --line: #e5edf6;
  --text: #1b2437;
  --muted: #64748b;
  --blue: #2f6bff;
  --blue-2: #1d4ed8;
  --gold: #d3922a;
  --green: #12a36a;
  --red: #e11d48;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  --sidebar: 272px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Manrope, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  background: #ffffff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  backdrop-filter: blur(16px);
}
.brand {
  padding: 22px 22px 8px;
}
.brand img { width: 168px; height: auto; display: block; }
#nav {
  overflow: auto;
  padding: 12px 12px 8px;
  flex: 1;
  min-height: 0;
}
.nav-group {
  margin: 16px 10px 6px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
}
.nav-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  color: #334155;
  font-weight: 600;
  font-size: 14px;
}
.nav-icon { width: 18px; height: 18px; display: grid; flex: none; }
.nav-icon svg { width: 18px; height: 18px; }
.nav-btn:hover { background: #f3f7ff; }
.nav-btn.active {
  background: #e8f0ff;
  color: var(--blue-2);
  box-shadow: inset 3px 0 0 var(--blue);
}
.sidebar-foot {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 14px 12px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.sidebar-foot > div { min-width: 0; flex: 1; }
.sidebar-foot strong, .sidebar-foot small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-foot strong { font-size: 13px; }
.sidebar-foot small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e8f0ff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.main { flex: 1; min-width: 0; padding: 22px 28px 40px; }
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.eyebrow {
  margin: 0 0 2px;
  color: var(--blue-2);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}
h1 { margin: 0; font-size: 28px; letter-spacing: -0.04em; }
.menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 11px 10px;
}
.menu-btn span {
  display: block;
  height: 2px;
  margin: 4px 0;
  background: #1b2437;
  border-radius: 2px;
}
.live {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px 8px 10px;
  box-shadow: var(--shadow);
}
.live strong, .live small { display: block; }
.live strong { font-size: 13px; }
.live small { color: var(--muted); font-size: 11px; }
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 0 rgba(228, 177, 93, 0.7);
}
.live.ok .dot {
  background: var(--green);
  animation: pulse 1.8s infinite;
}
.live.bad .dot { background: var(--red); box-shadow: none; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(61, 220, 151, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); }
}

.banner {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #9f1239;
}

.section-head { margin: 8px 0 12px; }
.section-head h2, .panel h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.03em;
  padding-left: 10px;
  border-left: 3px solid var(--blue);
}
.pending-grid, .totals-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.metric {
  text-align: left;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 16px 16px 18px;
  box-shadow: var(--shadow);
  min-height: 108px;
  position: relative;
}
.metric.pending { border-right: 4px solid var(--gold); }
.metric b {
  display: block;
  font-size: 30px;
  letter-spacing: -0.04em;
  margin: 8px 0 4px;
}
.metric span { color: var(--muted); font-size: 13px; font-weight: 600; }
.metric em {
  position: absolute;
  top: 16px;
  right: 16px;
  font-style: normal;
  color: var(--blue-2);
  font-size: 12px;
  font-weight: 700;
}

.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 22px;
}
.panel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 8px;
}
.panel-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.list-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.list-total {
  min-width: 168px;
  background: #f5f8fc;
  border-radius: 12px;
  padding: 8px 12px;
}
.list-total span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.list-total strong { font-size: 16px; letter-spacing: -0.03em; }
.excluded-total { background: #fff6e8; }
.net-total { background: #eaf1ff; }
.excluded-total ul {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}
.excluded-total li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  font-weight: 700;
}
tr.excluded { background: #fff6e8; }
.excluded-pill {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #b45309;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.period select, #listSearch, #listMonth, #listStatus, #listMethod, #listCsv, #hideDepositId, #hideById button {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
#listCsv {
  background: #fff;
  color: var(--blue-2);
  font-weight: 700;
  cursor: pointer;
}
#listCsv:hover, #hideById button:hover { background: #f3f7ff; }
#hideById { display: flex; gap: 8px; align-items: center; }
#hideById[hidden] { display: none; }
#hideById button { background: #fff; color: var(--blue-2); font-weight: 700; cursor: pointer; }
.chart-wrap { height: 280px; }
.chart-wrap.short { height: 240px; }
.chart-wrap canvas { width: 100%; height: 100%; display: block; }
.legend {
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  margin-top: 4px;
}
.swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
}
.swatch.deposit { background: #4c8dff; }
.swatch.withdraw { background: #8eb6ff; }
.overall {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}
.overall div {
  background: #f5f8fc;
  border-radius: 14px;
  padding: 12px;
}
.overall strong { display: block; font-size: 16px; letter-spacing: -0.03em; }
.overall span { color: var(--muted); font-size: 12px; font-weight: 600; }

.table-panel { min-height: 420px; }
.table-scroll { overflow: auto; margin-top: 8px; }
.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.pager p { margin: 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.pages { display: flex; gap: 6px; flex-wrap: wrap; }
.pages button {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #ffffff;
  font-weight: 700;
  font-size: 13px;
}
.pages button.active { background: var(--blue); border-color: var(--blue); color: white; }
.pages button:disabled { opacity: 0.35; }
.pages .ellipsis {
  min-width: 24px;
  display: grid;
  place-items: center;
  color: var(--muted);
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td {
  text-align: left;
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th {
  color: #3b5ccc;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #eaf1ff;
}
tr:hover td { background: #f5f8ff; }
.pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 8px;
  font-weight: 700;
  font-size: 12px;
}
.pill.ok { background: #e7f8ef; color: #067647; }
.pill.bad { background: #ffe4e8; color: #be123c; }
.pill.wait { background: #fff6e5; color: #b45309; }
.empty { color: var(--muted); padding: 28px 8px; }
.action-cell { white-space: nowrap; }
.action-btn {
  border: 0;
  border-radius: 8px;
  margin: 0 4px 4px 0;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: #2f6bff;
}
.action-btn.approve { background: #067647; }
.action-btn.reject, .action-btn.delete { background: #be123c; }
.action-btn.edit { background: #b45309; }
dialog {
  border: 0;
  border-radius: 16px;
  padding: 22px;
  width: min(420px, calc(100% - 32px));
  box-shadow: 0 20px 60px rgba(15, 35, 70, 0.2);
}
dialog h2 { margin: 0 0 6px; }
dialog p { margin: 0 0 12px; color: var(--muted); }
dialog label { display: grid; gap: 6px; margin-bottom: 12px; font-size: 13px; font-weight: 700; }
dialog textarea, dialog input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 500;
}
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
dialog button[type="submit"] {
  border: 0;
  border-radius: 10px;
  background: #2f6bff;
  color: #fff;
  font-weight: 700;
  padding: 8px 14px;
}

.hide-btn, .logout {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--blue-2);
}
.hide-btn:hover, .logout:hover { background: #f3f7ff; }
.logout { flex: none; white-space: nowrap; }

.login[hidden],
.app[hidden] { display: none !important; }
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 28px;
  display: grid;
  gap: 12px;
}
.login-card img { width: 180px; }
.login-card h1 { font-size: 32px; }
.login-card label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.login-card input {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font: inherit;
  color: var(--text);
  font-weight: 600;
}
.login-card button[type="submit"] {
  margin-top: 6px;
  border: 0;
  border-radius: 12px;
  background: var(--blue);
  color: white;
  padding: 12px;
  font-weight: 800;
}
.login-error { margin: 0; color: var(--red); font-weight: 700; }

@media (max-width: 1100px) {
  .pending-grid, .totals-grid, .split, .overall { grid-template-columns: 1fr; }
  .chart-wrap, .chart-wrap.short { height: 220px; }
}
@media (max-width: 860px) {
  .menu-btn { display: inline-block; }
  .sidebar {
    position: fixed;
    z-index: 20;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }
  .sidebar.open { transform: none; }
  .main { padding: 16px; }
  h1 { font-size: 22px; }
  .live small { display: none; }
}
