:root {
  --bg: #0a0c10;
  --bg2: #0f1117;
  --bg3: #141720;
  --card: rgba(255, 255, 255, 0.04);
  --card-border: rgba(255, 255, 255, 0.08);
  --glass: rgba(20, 23, 32, 0.85);
  --accent: #6c63ff;
  --accent2: #00d4aa;
  --accent3: #ff6b6b;
  --amber: #ffb347;
  --text: #e8eaf0;
  --text2: #8890a4;
  --text3: #4a5068;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: Inter, sans-serif; }
body {
  background-image:
    linear-gradient(rgba(108, 99, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108, 99, 255, 0.08) 1px, transparent 1px);
  background-size: 40px 40px;
}

a { color: inherit; text-decoration: none; }
.vf-layout { display: flex; min-height: 100vh; }
.vf-sidebar {
  width: 240px;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  background: var(--glass);
  backdrop-filter: blur(14px);
  border-right: 1px solid var(--card-border);
  padding: 20px 16px;
}
.brand {
  font-family: Syne, sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  background: linear-gradient(90deg, #b8b4ff, #56ffd9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 20px;
}
.vf-nav a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 6px;
  color: var(--text2);
}
.vf-nav a.active,
.vf-nav a:hover { background: var(--card); color: var(--text); }
.sidebar-user {
  position: absolute;
  bottom: 20px;
  left: 16px;
  right: 16px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: var(--card);
}
.logout-btn { margin-top: 8px; width: 100%; }

.vf-main {
  margin-left: 240px;
  width: calc(100% - 240px);
  padding: 24px;
}
.vf-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
h1, h2, h3 { font-family: Syne, sans-serif; margin: 0; }
.actions { display: flex; gap: 10px; }

.card {
  border: 1px solid var(--card-border);
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
  backdrop-filter: blur(8px);
}
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric-value { font-family: Syne, sans-serif; font-size: 1.5rem; margin-top: 8px; }
.metric-sub { color: var(--text2); font-size: 0.85rem; }

.accent-top-purple { border-top: 3px solid var(--accent); }
.accent-top-teal { border-top: 3px solid var(--accent2); }
.accent-top-amber { border-top: 3px solid var(--amber); }
.accent-top-red { border-top: 3px solid var(--accent3); }

button, .btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  color: #fff;
  background: var(--accent);
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text);
}
.btn-danger { background: var(--accent3); }

input, select, textarea {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  color: var(--text);
  padding: 10px;
}
.filters { display: grid; grid-template-columns: 180px 180px 1fr; gap: 10px; margin-bottom: 14px; }

table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.92rem;
}
th { color: var(--text2); }
tr:hover { background: rgba(255, 255, 255, 0.03); }
.mono { font-family: "DM Mono", monospace; }
.row-settled { border-left: 3px solid var(--accent2); }
.row-pending { border-left: 3px solid var(--amber); }

.badge {
  display: inline-block;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.8rem;
}
.badge-success { background: rgba(0, 212, 170, 0.16); color: #77ffd8; }
.badge-warning { background: rgba(255, 179, 71, 0.16); color: #ffd089; }
.badge-danger { background: rgba(255, 107, 107, 0.16); color: #ff9e9e; }
.badge-info { background: rgba(108, 99, 255, 0.16); color: #b9b4ff; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20;
}
.modal {
  width: min(920px, 92vw);
  background: var(--bg2);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 16px;
}
.modal.open, .modal-overlay.open { display: flex; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

#toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 30;
}
.toast {
  min-width: 240px;
  background: var(--bg2);
  border: 1px solid var(--card-border);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 10px;
}
.toast.success { border-left-color: var(--accent2); }
.toast.error { border-left-color: var(--accent3); }
.toast.warning { border-left-color: var(--amber); }

.tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.tab-btn.active { background: var(--accent2); }
.hidden { display: none !important; }

@media (max-width: 1100px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
