:root {
  --bg: #f5f6f8; --surface: #fff; --sidebar: #fbfbfc;
  --ink: #1a1f36; --ink-2: #30313d; --muted: #6a7383; --faint: #8a94a6;
  --line: #e6e8eb; --line-soft: #eef0f3;
  --accent: #4d7c0f; --accent-2: #3f6b0a; --accent-soft: #eef6e1; --lime: #c5ff3c;
  --green: #227f54; --green-soft: #e4f4ec; --red: #b4231f; --red-soft: #fdecea;
  --amber: #8a6400; --amber-soft: #fbf1dc; --ink-900: #0a0a0e;
  --shadow: 0 1px 1px rgba(10,20,50,.03), 0 1px 3px rgba(10,20,50,.05);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; font-size: 15px; }
a { color: inherit; text-decoration: none; }
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

/* Sidebar */
.side { background: var(--sidebar); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 14px 12px; position: sticky; top: 0; height: 100vh; }
.acct { display: flex; align-items: center; gap: 10px; width: 100%; background: transparent; border: 0; padding: 9px 9px; border-radius: 8px; cursor: pointer; margin-bottom: 12px; }
.acct:hover { background: #f0f1f4; }
.acct-logo { width: 29px; height: 29px; border-radius: 8px; background: var(--ink-900); color: var(--lime); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex-shrink: 0; overflow: hidden; }
.acct-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.acct-name { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-chev { width: 16px; height: 16px; color: var(--faint); flex-shrink: 0; }
.acct-wrap { position: relative; }
.acct-menu { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 40px -10px rgba(10,20,50,.22); padding: 8px; z-index: 50; display: none; }
.acct-menu.open { display: block; }
.am-head { display: flex; align-items: center; gap: 11px; padding: 8px 8px 12px; }
.am-name { font-size: 14.5px; font-weight: 650; color: var(--ink); }
.am-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.am-items { display: flex; flex-direction: column; gap: 1px; }
.am-item { display: flex; align-items: center; gap: 10px; padding: 9px 9px; border-radius: 8px; font-size: 14px; color: var(--ink-2); font-weight: 500; }
.am-item svg { width: 17px; height: 17px; color: var(--muted); }
.am-item:hover { background: #f0f1f4; }
.am-div { height: 1px; background: var(--line-soft); margin: 6px 0; }
.am-user { display: flex; align-items: center; gap: 10px; padding: 8px 9px; font-size: 13px; color: var(--muted); }
.am-user svg { width: 17px; height: 17px; }
nav { display: flex; flex-direction: column; gap: 1px; overflow-y: auto; }
nav a { display: flex; align-items: center; gap: 12px; padding: 8px 9px; border-radius: 7px; color: var(--ink-2); font-weight: 500; font-size: 14.5px; }
nav a svg { width: 19px; height: 19px; color: var(--muted); flex-shrink: 0; }
nav a:hover { background: #f0f1f4; }
nav a.active { color: var(--accent); font-weight: 600; }
nav a.active svg { color: var(--accent); }
.nav-label { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); padding: 15px 9px 5px; }
.side-foot { margin-top: auto; padding-top: 8px; }
.side-foot a { display: flex; align-items: center; gap: 11px; padding: 8px 9px; border-radius: 7px; color: var(--muted); font-size: 14px; font-weight: 500; }
.side-foot a svg { width: 18px; height: 18px; }
.side-foot a:hover { background: #f0f1f4; color: var(--ink); }
.powered { font-size: 11.5px; color: var(--faint); padding: 9px; display: flex; align-items: center; gap: 6px; }

/* Main + topbar */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 58px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 24px; position: sticky; top: 0; z-index: 10; }
.search { flex: 1; max-width: 380px; display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; color: var(--faint); font-size: 14px; }
.search svg { width: 16px; height: 16px; }
.topbar .spacer { flex: 1; }
.ticon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); cursor: pointer; }
.ticon:hover { background: var(--bg); color: var(--ink); }
.ticon svg { width: 19px; height: 19px; }
.plus { background: var(--accent); color: #fff; } .plus:hover { background: var(--accent-2); color: #fff; }

.content { padding: 28px 32px 64px; max-width: 1180px; width: 100%; }
h1 { font-size: 28px; letter-spacing: -0.02em; margin: 0; font-weight: 650; }
h2 { font-size: 22px; letter-spacing: -0.02em; margin: 0; font-weight: 650; }
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.row-head .acts { display: flex; align-items: center; gap: 8px; }

.btn { border: 0; cursor: pointer; font-weight: 600; font-size: 14px; border-radius: 8px; padding: 8px 14px; display: inline-flex; align-items: center; gap: 7px; }
.btn svg { width: 16px; height: 16px; }
.btn-white { background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); box-shadow: var(--shadow); }
.btn-white:hover { background: #fafbfc; }
.btn-accent { background: var(--accent); color: #fff; } .btn-accent:hover { background: var(--accent-2); }
.iconbtn { width: 36px; height: 36px; border:1px solid var(--line); background:var(--surface); border-radius:8px; display:grid; place-items:center; color:var(--muted); cursor:pointer; box-shadow:var(--shadow); }
.iconbtn:hover { background:#fafbfc; color:var(--ink); } .iconbtn svg { width:17px; height:17px; }

/* Tabs */
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tabs a { padding: 10px 0; font-size: 14.5px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.tabs a:hover { color: var(--ink); }

/* Filter pills */
.pills { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.pill-f { font-size: 14px; font-weight: 500; color: var(--ink-2); padding: 7px 13px; border-radius: 8px; cursor: pointer; }
.pill-f:hover { background: #eef0f3; }
.pill-f.active { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-weight: 600; }
.pills .spacer { flex: 1; }

/* Tables */
.tablewrap { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 11px 16px; border-bottom: 1px solid var(--line); background: #fcfcfd; }
th.r, td.r { text-align: right; }
td { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); font-size: 14.5px; color: var(--ink-2); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfc; }
.amt { font-weight: 650; font-variant-numeric: tabular-nums; color: var(--ink); }
.cur { color: var(--faint); font-size: 13px; margin-left: 3px; }
.sub { color: var(--faint); }
.status { font-size: 12.5px; font-weight: 600; padding: 3px 9px; border-radius: 6px; display: inline-flex; align-items: center; gap: 5px; }
.status.ok { color: var(--green); background: var(--green-soft); }
.status.fail { color: var(--red); background: var(--red-soft); }
.status.pend { color: var(--amber); background: var(--amber-soft); }
.card-dots { color: var(--faint); font-variant-numeric: tabular-nums; }
.tfoot { display: flex; align-items: center; gap: 14px; padding: 12px 16px; color: var(--muted); font-size: 13.5px; }
.tfoot .pg { margin-left: auto; display: flex; gap: 4px; }
.pgbtn { width: 28px; height: 28px; border:1px solid var(--line); border-radius: 6px; background:#fff; display:grid; place-items:center; color:var(--muted); }

/* Empty states */
.empty-box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 56px 24px; text-align: center; }
.empty-box .ic { width: 46px; height: 46px; border-radius: 12px; background: var(--accent-soft); display: grid; place-items: center; margin: 0 auto 14px; }
.empty-box .ic svg { width: 22px; height: 22px; color: var(--accent); }
.empty-box h3 { margin: 0 0 6px; font-size: 16px; }
.empty-box p { margin: 0 auto; max-width: 360px; color: var(--muted); font-size: 14px; line-height: 1.55; }

@media (max-width: 1000px) { .app { grid-template-columns: 1fr; } .side { display: none; } }
