:root {
  --bg: #070d18;
  --bg-soft: #0b1220;
  --panel: #151f34;
  --panel-2: #10192b;
  --panel-3: #1a2540;
  --line: #263552;
  --line-2: #334462;
  --text: #edf4ff;
  --muted: #8f9bb2;
  --muted-2: #65728b;
  --blue: #5b7cff;
  --cyan: #24c8dc;
  --teal: #17c7a5;
  --green: #2ee59d;
  --amber: #f3aa2c;
  --red: #ff5d6c;
  --purple: #765cff;
  --shadow: 0 20px 58px rgba(0, 0, 0, .28);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 14% -8%, rgba(91, 124, 255, .18), transparent 34%),
    radial-gradient(circle at 92% 0%, rgba(36, 200, 220, .12), transparent 30%),
    linear-gradient(135deg, #080f1b 0%, #0b1120 46%, #060b15 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

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

.eyebrow {
  margin: 0 0 7px;
  color: #91a7ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 22% 20%, rgba(23, 199, 165, .14), transparent 34%),
    radial-gradient(circle at 80% 6%, rgba(118, 92, 255, .18), transparent 32%),
    var(--bg);
}

.login-card {
  width: min(430px, 100%);
  display: grid;
  gap: 16px;
  padding: 34px;
  background: rgba(21, 31, 52, .94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.login-card h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.08;
}

.login-card small {
  color: var(--muted-2);
  line-height: 1.5;
}

.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  box-shadow: 0 14px 34px rgba(91, 124, 255, .24);
  font-weight: 900;
}

.brand-mark.small {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
}

label {
  display: grid;
  gap: 8px;
  color: #cbd7ea;
  font-size: 13px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: #0d1627;
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

input::placeholder {
  color: #5f6c84;
}

input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(91, 124, 255, .17);
}

select option {
  color: #101827;
  background: #fff;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 18px 14px;
  background: rgba(13, 20, 36, .98);
  border-right: 1px solid #1c2942;
  color: #d9e3f3;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
  padding: 4px 2px;
}

.brand strong {
  display: block;
  font-size: 16px;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.nav {
  display: grid;
  gap: 7px;
}

.nav button {
  min-height: 42px;
  text-align: left;
  border-radius: 8px;
  color: #aebbd0;
  background: transparent;
  padding: 0 12px;
  font-weight: 800;
}

.nav button.active {
  background: linear-gradient(135deg, rgba(118, 92, 255, .28), rgba(91, 124, 255, .16));
  color: #fff;
  box-shadow: inset 3px 0 0 var(--purple);
}

.nav button:hover {
  background: rgba(255, 255, 255, .07);
  color: #fff;
}

.sidebar-note {
  margin-top: auto;
  padding: 14px;
  border: 1px solid #263552;
  border-radius: 8px;
  background: #10192b;
}

.sidebar-note span {
  display: block;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.sidebar-note strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
}

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

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

.topbar h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
}

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

.small-select {
  width: auto;
  min-width: 180px;
}

.primary,
.secondary,
.ghost {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 900;
}

.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  box-shadow: 0 13px 28px rgba(91, 124, 255, .24);
}

.secondary {
  color: #dfe8ff;
  background: #151f34;
  border: 1px solid var(--line-2);
}

.ghost {
  background: transparent;
  color: var(--muted);
}

.primary:hover,
.secondary:hover {
  filter: brightness(1.08);
}

.full {
  width: 100%;
}

.as-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
}

.link {
  color: var(--cyan);
  background: transparent;
  font-weight: 900;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.dashboard-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.dashboard-toolbar .muted {
  margin: 0;
}

.period-tools {
  display: grid;
  justify-items: end;
  gap: 10px;
  min-width: min(560px, 100%);
}

.period-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.period-tab {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #aebbd0;
  background: #10192b;
  font-size: 12px;
  font-weight: 900;
}

.period-tab.active,
.period-tab:hover {
  color: #fff;
  border-color: rgba(145, 167, 255, .6);
  background: linear-gradient(135deg, rgba(91, 124, 255, .65), rgba(118, 92, 255, .5));
}

.custom-period {
  display: flex;
  gap: 8px;
}

.custom-period input {
  width: 150px;
  min-height: 36px;
  font-size: 12px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi-card,
.panel {
  background: linear-gradient(180deg, rgba(26, 37, 64, .98), rgba(18, 28, 49, .98));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.kpi-card {
  min-height: 112px;
  padding: 17px;
}

.kpi-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.kpi-card strong {
  display: block;
  margin-top: 9px;
  color: var(--green);
  font-size: 28px;
  line-height: 1.05;
}

.kpi-card:nth-child(2) strong {
  color: var(--cyan);
}

.kpi-card:nth-child(3) strong {
  color: #fff;
}

.kpi-card:nth-child(4) strong {
  color: var(--amber);
}

.kpi-card:nth-child(5) strong {
  color: var(--red);
}

.kpi-card:nth-child(6) strong {
  color: #c4d0ff;
}

.kpi-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted-2);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, .75fr);
  gap: 18px;
}

.site-revenue-panel {
  margin-bottom: 18px;
}

.period-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(145, 167, 255, .35);
  border-radius: 8px;
  color: #dbe6ff;
  background: rgba(91, 124, 255, .12);
  font-size: 12px;
  font-weight: 900;
}

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

.site-revenue-card {
  min-height: 182px;
  padding: 17px;
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 8px;
  background:
    radial-gradient(circle at 92% 12%, rgba(36, 200, 220, .12), transparent 32%),
    linear-gradient(145deg, rgba(31, 42, 69, .96), rgba(16, 24, 43, .96));
}

.site-revenue-card.featured {
  border-color: rgba(36, 200, 220, .45);
  background:
    radial-gradient(circle at 85% 10%, rgba(46, 229, 157, .18), transparent 34%),
    linear-gradient(145deg, rgba(27, 44, 72, .98), rgba(16, 26, 47, .98));
}

.site-revenue-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.site-revenue-title small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.site-revenue-title h3 {
  margin: 6px 0 0;
  color: #fff;
  font-size: 18px;
}

.site-revenue-title strong {
  color: var(--green);
  font-size: 25px;
  white-space: nowrap;
}

.site-revenue-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 0;
}

.site-revenue-card div,
.site-revenue-card dl,
.site-revenue-card dt,
.site-revenue-card dd {
  min-width: 0;
}

.site-revenue-card dt {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.site-revenue-card dd {
  margin: 5px 0 0;
  color: #eaf1ff;
  font-size: 18px;
  font-weight: 900;
}

.panel {
  padding: 20px;
}

.panel h2 {
  margin: 0;
  font-size: 20px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-head.wrap {
  flex-wrap: wrap;
}

.panel-head p {
  margin: 7px 0 0;
}

.bar-list {
  display: grid;
  gap: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: 130px 1fr 92px;
  align-items: center;
  gap: 12px;
  color: #d9e3f3;
}

.bar-row strong {
  text-align: right;
  color: #fff;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #0c1525;
  border: 1px solid #22314d;
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  box-shadow: 0 0 18px rgba(36, 200, 220, .28);
}

.mini-table {
  display: grid;
  gap: 9px;
}

.mini-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px;
  border: 1px solid #22314d;
  border-radius: 8px;
  background: rgba(13, 22, 39, .7);
}

.mini-row small,
td small,
.report-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.site-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: rgba(23, 199, 165, .14);
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid #22314d;
  border-radius: 8px;
}

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

th {
  padding: 12px 10px;
  color: #c7d4ea;
  background: #10192b;
  border-bottom: 1px solid #273957;
  font-size: 11px;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: .08em;
}

td {
  padding: 12px 10px;
  border-bottom: 1px solid #22314d;
  color: #dde7f8;
  vertical-align: middle;
}

tbody tr:hover {
  background: rgba(91, 124, 255, .07);
}

.money-pos {
  color: var(--green);
  font-weight: 900;
}

.money-neg {
  color: var(--red);
  font-weight: 900;
}

.table-input {
  min-height: 34px;
  max-width: 110px;
  padding: 0 8px;
}

.empty {
  margin: 0;
  color: var(--muted);
}

.status {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
  background: rgba(143, 155, 178, .16);
  color: #c6d2e6;
}

.status.paid,
.status.completed {
  background: rgba(46, 229, 157, .14);
  color: var(--green);
}

.status.processing {
  background: rgba(243, 170, 44, .14);
  color: var(--amber);
}

.status.refunded {
  background: rgba(255, 93, 108, .14);
  color: var(--red);
}

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

dialog {
  width: min(680px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  color: var(--text);
  background: var(--panel);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .42);
}

dialog::backdrop {
  background: rgba(4, 8, 15, .68);
}

.dialog-card {
  padding: 22px;
  background: linear-gradient(180deg, #17233a, #10192b);
}

.report-list {
  display: grid;
  gap: 12px;
}

.report-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid #22314d;
  border-radius: 8px;
  background: rgba(13, 22, 39, .72);
}

.settings-panel {
  max-width: 820px;
  display: grid;
  gap: 16px;
}

.notice,
.access-card {
  border: 1px solid #2b4163;
  border-radius: 8px;
  background: rgba(13, 22, 39, .72);
  color: #d9e3f3;
  padding: 14px;
}

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

.access-card h3 {
  margin: 0 0 6px;
  font-size: 17px;
}

.access-card p {
  margin: 0;
}

.notice {
  border-color: rgba(46, 229, 157, .28);
}

.notice strong {
  color: var(--green);
}

.chart-panel {
  margin-bottom: 18px;
}

.chart-toggles {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 12px;
}

.chart-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.chart-toggle input {
  width: 14px;
  min-height: 14px;
  accent-color: var(--cyan);
}

.legend-dot {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 50%;
}

.chart-wrap {
  width: 100%;
  min-height: 310px;
  overflow-x: auto;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .04);
  border-radius: 8px;
  background: #10192b;
}

.chart-wrap svg {
  min-width: 760px;
  width: 100%;
  height: auto;
  display: block;
}

.chart-grid {
  stroke: #25334f;
  stroke-width: 1;
}

.chart-axis {
  stroke: #40506e;
  stroke-width: 1.2;
}

.chart-label {
  fill: #74829a;
  font-size: 11px;
  font-weight: 700;
}

.chart-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-area {
  opacity: .2;
}

@media (max-width: 1250px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

  .sidebar {
    position: static;
    height: auto;
  }

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

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

  .dashboard-toolbar {
    display: grid;
  }

  .period-tools {
    justify-items: start;
  }

  .period-tabs {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .main {
    padding: 18px 14px;
  }

  .topbar,
  .top-actions,
  .filters,
  .inline-form,
  .access-card {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar h1 {
    font-size: 28px;
  }

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

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

  .site-revenue-grid {
    grid-template-columns: 1fr;
  }

  .site-revenue-title {
    flex-direction: column;
  }

  .site-revenue-title strong {
    font-size: 24px;
  }

  .custom-period {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .custom-period input {
    width: 100%;
  }

  .period-tab {
    flex: 1 1 auto;
  }

  .panel {
    padding: 16px;
  }

  .bar-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .bar-row strong {
    text-align: left;
  }

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