:root {
  color-scheme: light;
  --page: #0f1720;
  --surface: #ffffff;
  --surface-soft: #eef4f7;
  --ink: #111827;
  --muted: #667685;
  --line: #d7e0e7;
  --brand: #0e7490;
  --brand-dark: #155e75;
  --accent: #f59e0b;
  --accent-soft: #fff7e6;
  --danger: #b42318;
  --success: #087443;
  --shadow: 0 18px 45px rgba(3, 7, 18, 0.28);
  --radius: 8px;
  --radius-sm: 6px;
  --content: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page);
  font-family: "Avenir Next", Avenir, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: 0;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(14, 116, 144, 0.26), rgba(15, 23, 32, 0) 420px),
    var(--page);
}

body.login-page {
  display: grid;
  place-items: center;
  padding: 28px;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button,
input[type="submit"],
.button,
.nav-card,
.transaction {
  -webkit-tap-highlight-color: transparent;
}

#main {
  width: min(100% - 32px, var(--content));
  margin: 0 auto;
  padding: 24px 0 48px;
}

#main.login-shell {
  width: min(100%, 1040px);
  padding: 0;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  min-height: 640px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(226, 232, 240, 0.16);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.login-visual {
  position: relative;
  min-height: 100%;
  background: #08111c;
}

.login-visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-visual::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgba(8, 17, 28, 0.08), rgba(8, 17, 28, 0.78));
}

.visual-caption {
  position: absolute;
  right: 32px;
  bottom: 32px;
  left: 32px;
  z-index: 1;
  color: #fff;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.visual-caption .eyebrow {
  color: rgba(255, 255, 255, 0.76);
}

.visual-caption h1,
.auth-panel h1 {
  margin: 0;
  font-size: 5rem;
  font-weight: 700;
  line-height: 0.95;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 5vw, 56px);
}

.auth-panel h1 {
  font-size: 3.9rem;
}

.auth-form {
  display: grid;
  gap: 18px;
  margin-top: 34px;
}

.auth-panel .alert {
  margin-top: 24px;
}

.app-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 20px;
  padding: 20px 0 22px;
}

.app-header h1 {
  max-width: 860px;
  margin: 0;
  color: #f8fafc;
  font-size: 4.6rem;
  font-weight: 700;
  line-height: 0.98;
}

.app-header p {
  margin: 0;
}

.app-header .eyebrow {
  color: #67e8f9;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.button,
input[type="submit"],
button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  color: var(--brand-dark);
  font-weight: 700;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.button:hover,
input[type="submit"]:hover,
button:hover {
  border-color: rgba(14, 116, 144, 0.48);
  transform: translateY(-1px);
}

.button.primary,
input[type="submit"],
button.primary {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.button.ghost {
  background: rgba(255, 255, 255, 0.66);
}

.app-header .button.ghost {
  color: #ecfeff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(226, 232, 240, 0.22);
}

.app-header .button.ghost:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(103, 232, 249, 0.5);
}

.hero-photo {
  position: relative;
  overflow: hidden;
  height: clamp(180px, 28vw, 320px);
  margin-bottom: 26px;
  background: #08111c;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-photo::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, rgba(8, 17, 28, 0.18), rgba(8, 17, 28, 0));
  pointer-events: none;
}

.alert {
  margin: 0 0 20px;
  padding: 13px 16px;
  color: var(--danger);
  background: #fff6f4;
  border: 1px solid #fac7c1;
  border-radius: var(--radius-sm);
}

.alert.success {
  color: var(--success);
  background: #effaf3;
  border-color: #b7e5c7;
}

.alert p {
  margin: 0;
  font-weight: 600;
}

.menu-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-card {
  position: relative;
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  color: var(--ink);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(3, 7, 18, 0.08);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.nav-card:hover {
  border-color: rgba(14, 116, 144, 0.42);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.nav-card strong {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(3, 7, 18, 0.08);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.home-button:hover {
  border-color: rgba(14, 116, 144, 0.42);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

@media (min-width: 861px) {
  .home-actions {
    gap: 18px;
  }

  .home-button {
    min-width: 220px;
    min-height: 72px;
    padding: 20px 34px;
    font-size: 1.35rem;
  }
}

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

.metrics .metric:only-child {
  justify-self: center;
  max-width: 560px;
  width: 100%;
  text-align: center;
}

.summary-metrics {
  grid-template-columns: minmax(0, 640px);
  justify-content: center;
}

.summary-metrics .metric {
  text-align: center;
}

.metric {
  padding: clamp(22px, 4vw, 34px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(3, 7, 18, 0.08);
}

.metric h2,
.chart-card h2,
.section-title {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.metric p {
  margin: 0;
  font-size: 4.35rem;
  font-weight: 700;
  line-height: 0.95;
}

.form-panel,
.list-panel,
.chart-card,
.content-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(3, 7, 18, 0.08);
}

.form-panel {
  padding: clamp(18px, 4vw, 32px);
}

.form-section {
  padding: 0;
  margin: 0 0 26px;
  border: 0;
}

.form-section + .form-section {
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.net-panel + .form-section {
  padding-top: 26px;
  margin-top: 26px;
  border-top: 1px solid var(--line);
}

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

.field {
  display: grid;
  gap: 8px;
}

.field.full {
  grid-column: 1 / -1;
}

label,
.strong {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 700;
}

.inputText,
input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  color: var(--ink);
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

textarea {
  min-height: 124px;
  resize: vertical;
}

.inputText:focus,
input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
  background: #fff;
  border-color: rgba(14, 116, 144, 0.72);
  box-shadow: 0 0 0 4px rgba(14, 116, 144, 0.13);
}

.net-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  border-radius: var(--radius);
}

.net-panel h2 {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

#net {
  margin: 0;
  font-size: 3.45rem;
  font-weight: 700;
  line-height: 0.95;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
}

.transaction-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 18px;
}

.transaction {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 54px;
  padding: 14px 16px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  background: var(--surface-soft);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
}

.transaction:hover {
  border-color: rgba(14, 116, 144, 0.4);
  background: #fff;
}

.transaction strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.transaction span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.chart-grid {
  display: grid;
  gap: 18px;
}

.chart-card {
  padding: clamp(16px, 3vw, 24px);
}

.chart-frame {
  position: relative;
  height: clamp(260px, 45vw, 440px);
}

.chart-frame.compact {
  height: clamp(260px, 40vw, 380px);
}

.chart-frame canvas {
  width: 100% !important;
  height: 100% !important;
}

.marker-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 18px;
  list-style: none;
}

.marker-list a {
  display: block;
  min-height: 52px;
  padding: 14px 16px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  background: var(--surface-soft);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
}

.marker-list a:hover {
  border-color: rgba(14, 116, 144, 0.4);
  background: #fff;
}

.content-panel {
  padding: clamp(18px, 4vw, 32px);
}

.content-panel h2,
.content-panel h3,
.content-panel p {
  max-width: 78ch;
}

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

.content-panel h3 {
  margin: 24px 0 8px;
  font-size: 0.9rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.content-panel p {
  color: var(--muted);
  line-height: 1.7;
}

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

figure {
  margin: 0;
  overflow: hidden;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

figure img {
  width: 100%;
}

figcaption {
  padding: 12px 14px;
  color: var(--muted);
  font-weight: 600;
}

@media (max-width: 860px) {
  body.login-page {
    display: block;
    padding: 0;
  }

  #main {
    width: min(100% - 24px, var(--content));
    padding: 14px 0 30px;
  }

  .login-shell {
    grid-template-columns: 1fr;
    width: 100%;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .login-visual {
    min-height: 240px;
  }

  .visual-caption {
    right: 20px;
    bottom: 20px;
    left: 20px;
  }

  .auth-panel {
    justify-content: start;
    padding: 28px 22px 36px;
  }

  .app-header {
    grid-template-columns: 1fr;
    align-items: start;
    padding-top: 12px;
  }

  .visual-caption h1,
  .auth-panel h1 {
    font-size: 3.2rem;
  }

  .app-header h1 {
    font-size: 2.75rem;
  }

  .nav-card strong {
    font-size: 1.12rem;
  }

  .metric p,
  #net {
    font-size: 2.9rem;
  }

  .content-panel h2 {
    font-size: 2rem;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .hero-photo {
    height: 190px;
    margin-bottom: 16px;
  }

  .metrics,
  .form-grid,
  .marker-list,
  .screenshot-grid {
    grid-template-columns: 1fr;
  }

  .menu-grid {
    justify-content: stretch;
  }

  .menu-grid li {
    flex: 1 1 calc(50% - 12px);
  }

  .home-actions {
    justify-content: stretch;
  }

  .home-actions li {
    flex: 1 1 calc(50% - 12px);
  }

  .home-button {
    width: 100%;
    min-height: 46px;
  }

  .nav-card {
    min-height: 48px;
    width: 100%;
  }

  .form-actions {
    justify-content: stretch;
  }

  .form-actions input,
  .form-actions button {
    width: 100%;
  }

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

@media (max-width: 460px) {
  body {
    background: var(--page);
  }

  #main {
    width: min(100% - 16px, var(--content));
  }

  .hero-photo {
    border-radius: var(--radius-sm);
  }

  .button,
  input[type="submit"],
  button {
    width: 100%;
  }

  .top-actions {
    width: 100%;
  }

  .top-actions .button {
    flex: 1 1 130px;
  }

  .menu-grid li {
    flex-basis: 100%;
  }

  .home-actions li {
    flex-basis: 100%;
  }

  .visual-caption h1,
  .auth-panel h1,
  .app-header h1 {
    font-size: 2.3rem;
  }

  .metric p,
  #net {
    font-size: 2.35rem;
  }
}
