:root {
  --bg: #11131d;
  --panel: #191c2a;
  --panel-2: #202437;
  --panel-3: #151824;
  --line: rgba(255,255,255,.08);
  --line-2: rgba(255,255,255,.12);
  --text: #f5f6fb;
  --muted: #9ca3b8;
  --soft: #727a98;
  --blue: #5966ff;
  --green: #47d18c;
  --red: #ff7575;
  --yellow: #f4c76b;
  --shadow: 0 24px 70px rgba(0,0,0,.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% -10%, rgba(91,102,255,.24), transparent 32%),
    linear-gradient(135deg, #11131d, #10121b 55%, #151621);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  display: grid;
  grid-template-columns: 252px 1fr;
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: rgba(14, 16, 25, .78);
  backdrop-filter: blur(18px);
  padding: 20px 14px;
}

.workspace {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 24px;
}

.cube {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background:
    linear-gradient(145deg, #b997ff, #745cf8 48%, #362d73),
    radial-gradient(circle at 35% 25%, #fff, transparent 28%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.2);
}

.workspace strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.workspace span {
  color: var(--soft);
  font-size: 11px;
}

.side-section {
  margin-top: 14px;
}

.side-title {
  margin: 22px 11px 7px;
  color: #737b95;
  font-size: 11px;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #c8cede;
  padding: 0 11px;
  text-align: left;
}

.nav-item.active {
  background: rgba(91, 102, 255, .16);
  color: #fff;
}

.nav-item svg {
  width: 16px;
  height: 16px;
  color: #8d95b3;
}

.nav-item .badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(255,255,255,.08);
  color: #dce1f4;
  font-size: 11px;
}

.main {
  min-width: 0;
  padding: 20px 28px 28px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.search {
  width: min(560px, 100%);
  height: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  color: var(--soft);
  padding: 0 13px;
}

.search svg {
  width: 15px;
  height: 15px;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
}

.search input::placeholder {
  color: #737b95;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.button {
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: rgba(255,255,255,.05);
  color: #eef1fb;
  padding: 0 14px;
  font-weight: 600;
}

.button.primary {
  border-color: transparent;
  background: var(--blue);
  box-shadow: 0 10px 24px rgba(91,102,255,.22);
}

.button.icon {
  width: 36px;
  padding: 0;
}

.button svg,
.chip svg {
  width: 15px;
  height: 15px;
}

.content-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 22px;
}

h1 {
  margin: 0 0 7px;
  font-size: 31px;
  line-height: 1;
  font-weight: 650;
}

.subtitle {
  color: var(--muted);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  padding: 17px 18px;
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset;
}

.metric span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  font-size: 24px;
  font-weight: 620;
}

.table-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(20, 23, 35, .78);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 60px;
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
}

.chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  color: #dfe4f4;
  padding: 0 12px;
  font-size: 13px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  color: #818aa6;
  font-size: 12px;
}

th {
  height: 42px;
  padding: 0 16px;
  text-align: left;
  font-weight: 500;
  border-bottom: 1px solid var(--line);
}

td {
  height: 64px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255,255,255,.055);
  color: #dfe3f1;
}

tbody tr {
  transition: background .15s ease;
}

tbody tr:hover,
tbody tr.selected {
  background: rgba(91,102,255,.08);
}

.merchant {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(255,255,255,.13), rgba(255,255,255,.04));
  color: #fff;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.1);
}

.merchant strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

.merchant span,
.small {
  color: var(--soft);
  font-size: 12px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  border-radius: 999px;
  background: rgba(71,209,140,.1);
  color: #9ce9c2;
  padding: 0 9px;
  font-size: 12px;
}

.status.pending {
  background: rgba(244,199,107,.12);
  color: #f4d38a;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.amount {
  text-align: right;
  font-weight: 650;
  color: #f4f6ff;
}

.amount.positive {
  color: var(--green);
}

.section-stack {
  display: grid;
  gap: 18px;
}

.table-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
}

.table-title h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
}

.empty-state {
  padding: 38px 16px;
  color: var(--muted);
  text-align: center;
}

.positive {
  color: var(--green);
}

.negative {
  color: #f0b0b0;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 18px;
  align-items: start;
}

.admin-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(20, 23, 35, .78);
  box-shadow: var(--shadow);
  padding: 18px;
}

body:not(.is-admin) .admin-only {
  display: none;
}

.admin-panel h2 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 650;
}

.admin-form {
  display: grid;
  gap: 12px;
}

.admin-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  outline: none;
  background: rgba(255,255,255,.05);
  color: #fff;
  padding: 0 11px;
}

.admin-form textarea {
  min-height: 72px;
  padding-top: 9px;
  resize: vertical;
}

.admin-form option {
  color: #11131d;
}

.admin-note {
  margin: 0 0 14px;
  color: #f4d38a;
  font-size: 12px;
  line-height: 1.45;
}

.admin-list {
  display: grid;
  gap: 10px;
}

.admin-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.035);
  padding: 12px;
}

.admin-item strong {
  display: block;
  margin-bottom: 4px;
}

.admin-item span {
  color: var(--soft);
  font-size: 12px;
}

.admin-pill {
  align-self: start;
  border-radius: 999px;
  background: rgba(91,102,255,.14);
  color: #dce0ff;
  padding: 5px 9px;
  font-size: 12px;
}

.admin-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.button.danger {
  border-color: rgba(255,117,117,.35);
  color: #ffc4c4;
}

.button.small {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.admin-edit {
  grid-column: 1 / -1;
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.admin-item.editing .admin-edit {
  display: grid;
}

.admin-edit input,
.admin-edit select,
.admin-edit textarea {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: rgba(255,255,255,.05);
  color: #fff;
  padding: 0 9px;
}

.admin-edit textarea {
  min-height: 70px;
  padding-top: 8px;
  grid-column: span 2;
  resize: vertical;
}

.admin-edit option {
  color: #11131d;
}

.drawer {
  position: fixed;
  top: 20px;
  right: 20px;
  bottom: 20px;
  width: 360px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(24, 27, 41, .94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  transform: translateX(calc(100% + 40px));
  transition: transform .24s ease;
  padding: 20px;
  z-index: 30;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.drawer h2 {
  margin: 0;
  font-size: 23px;
  font-weight: 630;
}

.close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255,255,255,.04);
  color: #fff;
}

.detail-amount {
  margin: 0 0 25px;
  font-size: 36px;
  font-weight: 650;
}

.detail-list {
  display: grid;
  gap: 13px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.detail-row span:first-child {
  color: var(--soft);
}

.detail-row span:last-child {
  color: #eef1fb;
  text-align: right;
}

@media (max-width: 980px) {
  .app {
    grid-template-columns: 78px 1fr;
  }

  .workspace strong,
  .workspace span,
  .nav-item span:not(.badge),
  .side-title {
    display: none;
  }

  .sidebar {
    padding-left: 12px;
    padding-right: 12px;
  }

  .nav-item {
    justify-content: center;
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .hide-mobile {
    display: none;
  }
}

@media (max-width: 720px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .main {
    padding: 16px;
  }

  .topbar,
  .content-head {
    grid-template-columns: 1fr;
    display: grid;
    align-items: start;
  }

  .drawer {
    left: 12px;
    right: 12px;
    width: auto;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-panel[style] {
    grid-column: auto !important;
  }
}
