* {
  box-sizing: border-box;
}

:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --dark: #111827;
  --green: #15803d;
  --green-soft: #dcfce7;
  --blue: #1d4ed8;
  --blue-soft: #dbeafe;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

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

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

.sidebar {
  background: var(--dark);
  color: white;
  padding: 24px 18px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 32px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: white;
  color: var(--dark);
}

.brand small {
  display: block;
  color: #9ca3af;
  margin-top: 3px;
}

nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  border: 0;
  background: transparent;
  color: #d1d5db;
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  color: white;
  background: #1f2937;
}

.main-content {
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

h1,
h2,
p {
  margin-top: 0;
}

.primary-btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  background: var(--dark);
  color: white;
  font-weight: 700;
  cursor: pointer;
}

.primary-btn.full {
  width: 100%;
}

.summary-grid,
.agent-grid {
  display: grid;
  gap: 18px;
}

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

.agent-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card,
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(17, 24, 39, .04);
}

.card span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.card strong {
  font-size: 26px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.badge {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}

.badge.green {
  background: var(--green-soft);
  color: var(--green);
}

.badge.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 12px;
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 13px;
}

dialog {
  width: min(680px, calc(100% - 24px));
  border: 0;
  border-radius: 20px;
  padding: 0;
}

dialog::backdrop {
  background: rgba(17, 24, 39, .55);
}

#transaction-form {
  padding: 22px;
}

.modal-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.icon-btn {
  border: 0;
  background: #eef0f3;
  border-radius: 10px;
  width: 36px;
  height: 36px;
  cursor: pointer;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  background: white;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 14px;
  }

  .brand {
    margin-bottom: 12px;
  }

  nav {
    display: flex;
    overflow-x: auto;
  }

  .nav-item {
    white-space: nowrap;
  }

  .main-content {
    padding: 18px;
  }

  .summary-grid,
  .agent-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

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