@font-face {
  font-family: "Inter";
  src: url("/static/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
}

:root {
  color-scheme: dark;
  --bg: #0d1210;
  --panel: #151d18;
  --panel-2: #1b261f;
  --text: #eef8f1;
  --muted: #94a89b;
  --line: #2c3b32;
  --accent: #62d58c;
  --accent-2: #76a9ff;
  --warn: #f5c56a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

.manager-shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 42px;
}

.manager-header,
.manager-filters,
.profit-hero,
.metric-grid,
.manager-panel {
  border: 1px solid var(--line);
  background: var(--panel);
}

.manager-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px;
  border-radius: 10px;
}

.manager-eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 21px;
}

.ghost-button,
.manager-filters button,
.manager-auth-card button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  min-height: 42px;
  padding: 0 16px;
  cursor: pointer;
}

.manager-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr)) minmax(150px, 1fr) minmax(130px, 0.55fr) auto auto;
  gap: 12px;
  align-items: end;
  margin-top: 14px;
  padding: 16px;
  border-radius: 10px;
}

.manager-filters label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.manager-filters input,
.manager-filters select,
.manager-auth-card input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101713;
  color: var(--text);
  padding: 0 12px;
}

.rate-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 6px;
}

.rate-input-row input {
  min-width: 0;
}

.rate-submit-button {
  min-height: 42px;
  padding: 0;
  border-color: var(--line);
  background: #101713;
  color: var(--accent);
  font-size: 13px;
  font-weight: 850;
}

.manager-filter-actions {
  display: flex;
  gap: 8px;
}

.manager-filter-actions button {
  border-color: var(--line);
  background: #101713;
  color: var(--text);
  font-size: 14px;
  font-weight: 750;
}

.manager-filter-actions button:hover {
  border-color: rgba(98, 213, 140, 0.48);
  background: #14211a;
  color: var(--accent);
}

.rate-submit-button:hover {
  border-color: rgba(98, 213, 140, 0.48);
  background: #14211a;
}

.mode-tabs {
  display: flex;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  background: #101713;
}

.mode-tabs a {
  color: var(--muted);
  text-decoration: none;
  border-radius: 6px;
  padding: 9px 12px;
  font-weight: 720;
}

.mode-tabs a.active {
  background: var(--accent);
  color: #06110a;
}

.profit-hero {
  display: block;
  margin-top: 14px;
  padding: 24px;
  border-radius: 10px;
}

.profit-main {
  max-width: 720px;
}

.profit-hero h2 {
  font-size: clamp(44px, 7vw, 96px);
  line-height: 0.98;
  color: var(--accent);
}

.money-with-conversion {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.money-with-conversion > span {
  display: inline;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  text-transform: none;
}

.money-with-conversion small {
  color: rgba(148, 168, 155, 0.72);
  font-size: 0.32em;
  font-weight: 760;
  line-height: 1;
}

.profit-hero p {
  color: var(--muted);
  font-size: 18px;
  font-weight: 650;
}

.profit-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 18px;
}

.profit-split article,
.metric-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 18px;
}

.profit-split article > span,
.metric-grid article > span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 740;
  text-transform: uppercase;
}

.profit-split strong,
.metric-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.profit-split strong.money-with-conversion {
  display: flex;
  gap: 6px;
  color: var(--text);
  font-size: 28px;
}

.profit-split strong.money-with-conversion small {
  margin: 0;
  font-size: 0.62em;
}

.profit-split small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
  padding: 12px;
  border-radius: 10px;
}

.manager-panel {
  margin-top: 14px;
  padding: 18px;
  border-radius: 10px;
}

.panel-title-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.daily-chart-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-nav {
  display: none;
  gap: 6px;
}

.chart-nav button {
  width: 38px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101b15;
  color: var(--text);
  font-size: 25px;
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
}

.chart-nav button:disabled {
  color: rgba(148, 168, 155, 0.36);
  cursor: default;
}

#managerDailyChart {
  display: block;
  width: 100%;
  height: clamp(280px, 34vw, 460px);
  max-height: 460px;
}

.chart-data-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(104px, 1fr);
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.chart-data-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101a14;
  padding: 8px 9px;
  white-space: nowrap;
}

.chart-data-item[hidden] {
  display: none;
}

.chart-data-item span,
.chart-data-item strong,
.chart-data-item small {
  display: block;
}

.chart-data-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.chart-data-item strong {
  margin-top: 4px;
  color: rgba(98, 213, 140, 0.92);
  font-size: 12px;
  font-weight: 700;
}

.chart-data-item small {
  margin-top: 3px;
  color: rgba(118, 169, 255, 0.86);
  font-size: 12px;
  font-weight: 650;
}

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

.check-chart-layout {
  display: grid;
  grid-template-columns: minmax(390px, 440px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

#managerCheckChart {
  display: block;
  width: min(430px, 100%);
  aspect-ratio: 1;
}

.chart-toggle {
  display: inline-flex;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  background: #101713;
}

.chart-toggle button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font-weight: 760;
  cursor: pointer;
}

.chart-toggle button.active {
  background: var(--accent);
  color: #06110a;
}

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

.check-legend-column {
  display: grid;
  gap: 8px;
  align-content: start;
}

.check-legend-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 8px 9px;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  margin-top: 3px;
  border-radius: 3px;
}

.legend-title,
.legend-value {
  display: block;
}

.legend-title {
  font-size: 14px;
  font-weight: 800;
}

.legend-value {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

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

.bank-table-panel .table-wrap {
  overflow-x: visible;
}

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

.bank-table-panel table {
  min-width: 0;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  text-transform: uppercase;
}

td {
  font-size: 14px;
  font-weight: 600;
}

.manager-auth-body {
  display: grid;
  place-items: center;
  padding: 24px;
}

.manager-auth-card {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  padding: 26px;
}

.manager-auth-card form {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.manager-auth-card label {
  color: var(--muted);
  font-weight: 700;
}

.manager-auth-error {
  color: var(--warn);
  font-weight: 700;
}

@media (max-width: 900px) {
  .manager-shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 10px 10px 28px;
  }

  .manager-header {
    order: 1;
  }

  .profit-hero {
    order: 2;
  }

  .metric-grid {
    order: 3;
  }

  .manager-filters {
    order: 4;
  }

  .daily-chart-panel {
    order: 5;
  }

  .check-chart-panel {
    order: 6;
  }

  .manager-columns {
    order: 7;
  }

  .manager-header,
  .profit-hero,
  .metric-grid,
  .manager-columns,
  .manager-filters {
    grid-template-columns: 1fr;
  }

  .manager-header {
    align-items: flex-start;
    padding: 14px;
  }

  .mode-tabs {
    width: 100%;
  }

  .mode-tabs a {
    flex: 1;
    text-align: center;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 19px;
  }

  .manager-filters,
  .profit-hero,
  .metric-grid,
  .manager-panel {
    margin-top: 10px;
    padding: 12px;
    border-radius: 8px;
  }

  .manager-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .manager-filter-actions,
  .manager-filters .mode-tabs {
    grid-column: 1 / -1;
  }

  .manager-filter-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .manager-filter-actions button {
    min-width: 0;
    padding: 0 8px;
  }

  .manager-filters label {
    gap: 5px;
    font-size: 12px;
  }

  .manager-filters input,
  .manager-filters select {
    min-height: 40px;
    padding: 0 10px;
    font-size: 14px;
  }

  .profit-main {
    max-width: none;
  }

  .profit-hero h2 {
    font-size: clamp(38px, 14vw, 58px);
    overflow-wrap: anywhere;
  }

  .profit-hero h2.money-with-conversion {
    gap: 8px;
  }

  .profit-hero h2.money-with-conversion small {
    flex-basis: 100%;
    font-size: 0.34em;
  }

  .profit-hero p {
    font-size: 15px;
  }

  .profit-split {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 16px;
  }

  .profit-split article,
  .metric-grid article {
    padding: 12px;
  }

  .profit-split strong,
  .metric-grid strong {
    font-size: 22px;
  }

  #managerDailyChart {
    height: 280px;
    max-height: 280px;
  }

  .daily-chart-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
  }

  .chart-nav {
    display: flex;
  }

  .daily-chart-panel .chart-toggle {
    width: 100%;
  }

  .chart-data-strip {
    grid-auto-columns: minmax(96px, 1fr);
    overflow-x: hidden;
  }

  .panel-title-row {
    display: grid;
    gap: 10px;
  }

  .check-chart-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  #managerCheckChart {
    margin: 0 auto;
    width: min(220px, 100%);
  }

  .check-legend {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .check-legend-column {
    gap: 6px;
  }

  .check-legend-item {
    padding: 8px;
  }

  .legend-title {
    font-size: 13px;
  }

  .legend-value {
    font-size: 11px;
  }

  .chart-toggle {
    width: 100%;
  }

  .chart-toggle button {
    flex: 1;
  }

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

  table {
    min-width: 0;
    table-layout: fixed;
  }

  th,
  td {
    padding: 10px 5px;
    white-space: normal;
    font-size: 12px;
    line-height: 1.25;
  }

  th {
    font-size: 10px;
  }

  .checks-table-panel th:nth-child(5),
  .checks-table-panel td:nth-child(5) {
    display: none;
  }

  .checks-table-panel th:nth-child(1),
  .checks-table-panel td:nth-child(1) {
    width: 26%;
  }

  .checks-table-panel th:nth-child(2),
  .checks-table-panel td:nth-child(2) {
    width: 17%;
  }

  .checks-table-panel th:nth-child(3),
  .checks-table-panel td:nth-child(3) {
    width: 31%;
  }

  .checks-table-panel th:nth-child(4),
  .checks-table-panel td:nth-child(4) {
    width: 26%;
  }

  .bank-table-panel th,
  .bank-table-panel td {
    font-size: 10px;
  }

  .bank-table-panel th:nth-child(1),
  .bank-table-panel td:nth-child(1) {
    width: 16%;
  }

  .bank-table-panel th:nth-child(2),
  .bank-table-panel td:nth-child(2) {
    width: 26%;
  }

  .bank-table-panel th:nth-child(3),
  .bank-table-panel td:nth-child(3) {
    width: 17%;
  }

  .bank-table-panel th:nth-child(4),
  .bank-table-panel td:nth-child(4) {
    width: 19%;
  }

  .bank-table-panel th:nth-child(5),
  .bank-table-panel td:nth-child(5) {
    width: 22%;
  }
}
