:root {
  --bg1: #071427;
  --bg2: #041126;
  --card: rgba(255, 255, 255, 0.06);
  --card2: rgba(255, 255, 255, 0.1);
  --line: rgba(255, 255, 255, 0.14);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.7);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --yellow: #facc15;
  --red: #ef4444;
  --blueBright: #1d4ed8;
  --accent: #2bb673;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 600px at 20% 0%, rgba(43, 182, 115, 0.18), transparent 60%),
    radial-gradient(900px 500px at 100% 20%, rgba(37, 99, 235, 0.18), transparent 55%),
    linear-gradient(135deg, var(--bg1), var(--bg2));
  padding: 28px 14px;
}

.wrap { width: min(1300px, 100%); margin: 0 auto; }
.wrap.narrow { width: min(520px, 100%); }

.card {
  background: linear-gradient(180deg, var(--card2), var(--card));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.top {
  padding: 22px 26px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.top .titleBlock { display: flex; align-items: center; gap: 14px; }
.top img { height: 56px; width: auto; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.25)); }
h1 { margin: 0; font-size: 26px; font-weight: 950; line-height: 1.1; }
.sub { margin-top: 4px; font-size: 14px; color: var(--muted); font-weight: 700; }

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

.content { padding: 20px 26px 26px; }

a.navlink {
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  padding: 9px 14px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 13px;
}
a.navlink:hover { background: rgba(255, 255, 255, 0.1); }

.field { display: flex; flex-direction: column; gap: 8px; }
label { font-size: 14px; color: rgba(255, 255, 255, 0.82); font-weight: 700; }

input, select {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(3, 10, 20, 0.55);
  color: var(--text);
  outline: none;
  font-size: 15px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus {
  border-color: rgba(43, 182, 115, 0.55);
  box-shadow: 0 0 0 4px rgba(43, 182, 115, 0.16);
}
input::placeholder { color: rgba(255, 255, 255, 0.42); }

.btn {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 900;
  font-size: 14px;
  transition: transform 0.05s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(180deg, rgba(43, 182, 115, 0.92), rgba(43, 182, 115, 0.78));
  border-color: rgba(43, 182, 115, 0.7);
  color: #071427;
}
.btn.small { padding: 8px 12px; font-size: 12.5px; min-width: unset; }
.btn.danger { border-color: rgba(239, 68, 68, 0.5); }

.statusMsg {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  display: none;
  font-weight: 750;
}
.statusMsg.show { display: block; }
.statusMsg.ok { border-color: rgba(43, 182, 115, 0.45); background: rgba(43, 182, 115, 0.1); color: var(--text); }
.statusMsg.err { border-color: rgba(255, 90, 106, 0.55); background: rgba(255, 90, 106, 0.12); color: var(--text); }

.tableWrap { border: 1px solid var(--line); border-radius: 14px; overflow: auto; background: rgba(255, 255, 255, 0.03); max-height: 70vh; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: left;
  padding: 10px 10px;
  background: rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid var(--line);
  color: rgba(255, 255, 255, 0.85);
  font-weight: 950;
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
}
tbody td { padding: 10px 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); vertical-align: top; }
tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
tbody tr.flash { animation: flashRow 2.5s ease-out; }
@keyframes flashRow {
  0% { background: rgba(250, 204, 21, 0.35); }
  100% { background: transparent; }
}

.pill {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  display: inline-block;
}
.pill.paid { border-color: rgba(43, 182, 115, 0.5); background: rgba(43, 182, 115, 0.15); color: #6ee7b0; }
.pill.paid.negative { border-color: rgba(239, 68, 68, 0.5); background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
.pill.transferred { border-color: rgba(250, 204, 21, 0.5); background: rgba(250, 204, 21, 0.15); color: var(--yellow); }

.statusTiles { display: flex; flex-wrap: wrap; gap: 6px; max-width: 220px; }
.statusTile {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 5px 8px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 11.5px;
  cursor: pointer;
}
.statusTile.selected { background: var(--blueBright); border-color: rgba(255, 255, 255, 0.22); color: #fff; }

.notesWrap { display: flex; gap: 6px; align-items: center; min-width: 220px; }
.notesInput { flex: 1 1 auto; padding: 8px 10px; font-size: 13px; }
.commitBtn { padding: 8px 10px; font-size: 12px; min-width: unset; }

.searchBar { display: flex; gap: 10px; margin-bottom: 16px; }
.searchBar input { flex: 1 1 auto; }

.banner {
  text-align: center;
  background: var(--yellow);
  color: var(--red);
  font-weight: 950;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.hidden { display: none !important; }

.authCard { padding: 34px 30px; }
.authCard h1 { text-align: center; margin-bottom: 4px; }
.authCard .sub { text-align: center; margin-bottom: 22px; }
.authForm { display: flex; flex-direction: column; gap: 14px; }

.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #071427;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.metaRow { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 14px; color: var(--muted); font-size: 13px; flex-wrap: wrap; gap: 8px; }
