@font-face {
  font-family: "Urbanist";
  src: url("Urbanist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #141416;
  --surface: #1b1b1e;
  --surface-2: #232327;
  --line: rgba(255, 255, 255, .09);
  --text: #fff;
  --muted: rgba(255, 255, 255, .58);
  --accent: #ee7c53;
  --accent-hover: #f38f6a;
  --accent-deep: #a3492f;
  --plum: #533f4d;
  --bad: #ff8a80;
  color-scheme: dark;
  font-family: "Urbanist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  color: var(--text);
}

* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh;
  background: radial-gradient(70% 45% at 85% 0%, rgba(83, 63, 77, .5), transparent 70%), var(--bg);
  background-attachment: fixed;
}
a { color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(20, 20, 22, .82); backdrop-filter: blur(14px);
}
.topbar-inner { max-width: 1120px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 17px; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand em { font-style: normal; color: var(--accent); }
.brand small { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 3px 8px; border: 1px solid var(--line); border-radius: 99px; }
.who { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 28px 20px 60px; }
.eyebrow { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
h1 { margin: 6px 0 0; font-size: 30px; font-weight: 600; letter-spacing: -.02em; }
h2 { margin: 0 0 14px; font-size: 18px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .22);
  background: transparent; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: rgba(255, 255, 255, .5); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--bg); box-shadow: 0 10px 26px -14px rgba(238, 124, 83, .9); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }

.input, select.input {
  width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03); color: var(--text); font: inherit;
}
.input::placeholder { color: rgba(255, 255, 255, .35); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(238, 124, 83, .18); }
select.input option { background: var(--surface); }
label { display: block; font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, .75); margin-bottom: 6px; }

/* ---------- cards & stats ---------- */
.card {
  border: 1px solid var(--line); border-radius: 18px; padding: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .01)), var(--surface);
}
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 22px 0; }
.stat .v { font-size: 30px; font-weight: 600; }
.stat .l { font-size: 13px; color: var(--muted); }
.stat.hi { border-color: rgba(238, 124, 83, .45); background: linear-gradient(135deg, rgba(83, 63, 77, .75), var(--surface) 70%); }

/* ---------- toolbar ---------- */
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .search { flex: 1 1 260px; position: relative; }
.toolbar .search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.toolbar .search .input { padding-left: 40px; }
.toolbar select.input { width: auto; }

/* ---------- table ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 0 14px 12px; }
.table td { padding: 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: rgba(255, 255, 255, .025); }
.user-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--plum), var(--accent-deep)); font-weight: 700; text-transform: uppercase;
}
.email { font-weight: 600; word-break: break-all; }
.id { font-size: 12px; color: var(--muted); font-family: ui-monospace, Consolas, monospace; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 99px; font-weight: 700; font-size: 14px;
  color: var(--accent); background: rgba(238, 124, 83, .12); box-shadow: inset 0 0 0 1px rgba(238, 124, 83, .35);
}
.pill.zero { color: var(--bad); background: rgba(255, 138, 128, .1); box-shadow: inset 0 0 0 1px rgba(255, 138, 128, .35); }
.pos { color: #8fe3b0; font-weight: 700; }
.neg { color: var(--bad); font-weight: 700; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: rgba(255, 255, 255, .06); color: rgba(255, 255, 255, .75); white-space: nowrap; }
.empty { text-align: center; padding: 40px 10px; color: var(--muted); }

.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 18px; color: var(--muted); font-size: 14px; }

/* ---------- alerts ---------- */
.alert { padding: 12px 14px; border-radius: 12px; margin-bottom: 16px; font-size: 14px; }
.alert.success { background: rgba(143, 227, 176, .08); border: 1px solid rgba(143, 227, 176, .35); color: #c4f2d5; }
.alert.error { background: rgba(255, 138, 128, .08); border: 1px solid rgba(255, 138, 128, .35); color: #ffc2bc; }
.errorlist { list-style: none; margin: 6px 0 0; padding: 0; color: #ffc2bc; font-size: 13px; }

/* ---------- user detail ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 14px; }
.back:hover { color: var(--text); }
.profile-head { display: flex; align-items: center; gap: 16px; margin: 14px 0 22px; flex-wrap: wrap; }
.profile-head .avatar { width: 56px; height: 56px; font-size: 22px; }
.detail-grid { display: grid; grid-template-columns: 340px 1fr; gap: 18px; align-items: start; }
.balance { font-size: 56px; font-weight: 600; line-height: 1; margin: 6px 0 4px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.seg input { display: none; }
.seg label { margin: 0; text-align: center; padding: 9px; border-radius: 9px; cursor: pointer; color: var(--muted); font-size: 14px; }
.seg input:checked + label { background: var(--accent); color: var(--bg); }
.seg input[value="remove"]:checked + label { background: var(--bad); }
.field { margin-top: 14px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.quick button { padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.quick button:hover { border-color: var(--accent); color: var(--accent); }
.stack { display: grid; gap: 18px; }
.thumbs { display: flex; gap: 6px; }
.thumbs span { font-size: 12px; padding: 2px 7px; border-radius: 6px; background: rgba(255, 255, 255, .06); }
.thumbs span:first-child { background: rgba(238, 124, 83, .15); color: var(--accent); }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 400px; }
.login-card .brand { justify-content: center; margin-bottom: 22px; font-size: 20px; }
.login-card .brand img { width: 40px; height: 40px; border-radius: 11px; }
.login-card h1 { font-size: 24px; text-align: center; }
.login-card p.sub { text-align: center; margin: 6px 0 22px; }

/* ---------- phone ---------- */
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  html { font-size: 14px; }
  .wrap { padding: 20px 14px 48px; }
  h1 { font-size: 24px; }
  .who .who-name { display: none; }
  .brand small { display: none; }
  .stat .v { font-size: 24px; }
  .card { padding: 16px; border-radius: 16px; }
  .balance { font-size: 46px; }

  /* tables turn into stacked cards */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border-top: 1px solid var(--line); padding: 12px 0; }
  .table tbody tr:first-child { border-top: 0; }
  .table td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .table td[data-label]::before { content: attr(data-label); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  .table td.cell-main { display: block; padding-bottom: 6px; }
  .table td.cell-action .btn { width: 100%; margin-top: 6px; }
}
