:root {
  --bg: #08110d;
  --panel: #10241b;
  --panel-2: #142d22;
  --line: rgba(255,255,255,.14);
  --ink: #f3fff8;
  --muted: #a9b9ae;
  --brand: #ffbf2f;
  --danger: #ff6b6b;
  --ok: #43f19a;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Arial, Helvetica, sans-serif;
}

.shell {
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
  padding: 24px 0 44px;
}

.section-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 10px;
  background: rgba(8, 17, 13, .94);
  border: 1px solid var(--line);
  border-radius: 8px;
  backdrop-filter: blur(8px);
}

.section-nav a {
  padding: 7px 10px;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: .86rem;
  font-weight: 800;
  text-decoration: none;
}

.section-nav a.active {
  color: #241400;
  background: var(--brand);
  border-color: rgba(255, 191, 47, .9);
  box-shadow: 0 0 0 2px rgba(255, 191, 47, .16);
}

.page-head,
.report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

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

.agent-topline span,
.chip-box span {
  display: block;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.agent-topline strong {
  display: block;
}

.chip-box {
  min-width: 120px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #ffe28a, #ffbf2f);
  border-radius: 8px;
  color: #241400;
  text-align: right;
}

.chip-box span {
  color: rgba(36, 20, 0, .72);
}

h1, h2, p { margin: 0; }
h1 { font-size: 2rem; }
h2 { margin-bottom: 16px; font-size: 1.25rem; }

.eyebrow {
  color: var(--brand);
  font-size: .8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.grid.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.panel,
.login-panel {
  margin-bottom: 16px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.accordion-panel {
  padding: 0;
  overflow: hidden;
}

.accordion-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 14px 18px;
  color: var(--ink);
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  font-size: 1.05rem;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.accordion-panel summary::-webkit-details-marker {
  display: none;
}

.accordion-panel summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: #241400;
  background: var(--brand);
  border-radius: 999px;
  font-size: 1.1rem;
  line-height: 1;
}

.accordion-panel summary span {
  margin-left: auto;
  padding: 4px 8px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .8rem;
}

.accordion-panel[open] summary::after {
  content: "-";
}

.panel-body,
.accordion-panel > .table-wrap,
.accordion-panel > .summary,
.accordion-panel > .report-head {
  padding: 18px;
}

.accordion-panel > .summary {
  padding-bottom: 0;
}

.login-panel {
  width: min(100%, 420px);
  margin: 14vh auto 0;
}

form {
  display: grid;
  gap: 10px;
}

label {
  color: var(--muted);
  font-size: .86rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: .94rem;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 50px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 34px;
  min-height: 34px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  transform: translateY(-50%);
}

.password-eye {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-eye-closed,
.password-toggle.is-visible .password-eye-open {
  display: none;
}

.password-toggle.is-visible .password-eye-closed {
  display: inline;
}

button,
.link-button {
  min-height: 38px;
  padding: 7px 14px;
  color: #241400;
  background: var(--brand);
  border: 0;
  border-radius: 6px;
  font-size: .92rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

button.small {
  min-height: 30px;
  padding: 6px 10px;
  font-size: .82rem;
}

.alert {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 6px;
}

.success { background: rgba(67, 241, 154, .14); border: 1px solid rgba(67, 241, 154, .35); }
.danger, .text-danger { color: #ffd2d2; background: rgba(255, 107, 107, .12); }

.field-error {
  min-height: 14px;
  color: #ffd2d2;
  font-size: .78rem;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.table-scroll {
  max-height: 420px;
  overflow: auto;
}

.table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel);
}

.pager {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 18px 18px;
  color: var(--muted);
  font-size: .88rem;
}

.pager a,
.pager strong {
  padding: 6px 10px;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  text-decoration: none;
}

.pager a.disabled {
  opacity: .45;
  pointer-events: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

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

th {
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
}

.filters {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 150px 150px auto;
  gap: 10px;
}

.summary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.summary strong {
  padding: 8px 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.profit { color: var(--ok); }
.loss { color: var(--danger); }

@media (max-width: 800px) {
  .grid.two,
  .filters {
    grid-template-columns: 1fr;
  }

  .page-head,
  .report-head {
    align-items: stretch;
    flex-direction: column;
  }

  .agent-topline {
    align-items: stretch;
    flex-direction: column;
  }

  .chip-box {
    text-align: left;
  }
}
