:root {
  --ink: #101a31;
  --muted: #5c6474;
  --line: #dde1e8;
  --surface: #ffffff;
  --soft: #f4f6f9;
  --gold: #b9914f;
  --gold-dark: #8f6b31;
  --danger: #9d2c3b;
  --success: #1d6b4f;
  --shadow: 0 20px 55px rgba(16, 26, 49, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(180deg, #fff 0%, var(--soft) 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0;
}

.brand-link {
  display: inline-flex;
  align-items: center;
}

.brand-logo {
  width: clamp(190px, 26vw, 320px);
  height: auto;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.main-nav a,
.text-button {
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 8px 0;
  text-decoration: none;
}

.main-nav a:hover,
.text-button:hover {
  color: var(--ink);
}

.home-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 420px);
  align-items: center;
  gap: clamp(32px, 7vw, 90px);
  width: min(1180px, calc(100% - 32px));
  margin: 48px auto 80px;
}

.brand-stage {
  min-width: 0;
}

.hero-logo {
  width: min(100%, 780px);
  height: auto;
  filter: drop-shadow(0 18px 32px rgba(16, 26, 49, 0.08));
}

.intro-copy {
  max-width: 580px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.login-panel,
.admin-form,
.metric-card,
.workspace-band,
.document-view,
.error-box,
.user-table-wrap {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-panel,
.admin-form {
  display: grid;
  gap: 18px;
  padding: 30px;
}

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

h1 {
  margin-bottom: 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.6rem);
  font-weight: 500;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.3rem;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  padding: 13px 14px;
}

input:focus,
select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(185, 145, 79, 0.18);
  outline: 0;
}

.primary-button,
.secondary-button,
.primary-link {
  align-items: center;
  border-radius: 6px;
  display: inline-flex;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  text-decoration: none;
  font-weight: 700;
}

.primary-button {
  background: var(--ink);
  border: 1px solid var(--ink);
  color: #fff;
  cursor: pointer;
}

.primary-button:hover {
  background: #1d2842;
}

.secondary-button {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
}

.primary-link {
  background: var(--ink);
  color: #fff;
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.notice {
  width: min(1180px, calc(100% - 32px));
  margin: 12px auto;
  border-radius: 6px;
  padding: 13px 16px;
}

.notice-error {
  background: #fff0f2;
  color: var(--danger);
  border: 1px solid #f2c2cb;
}

.notice-success {
  background: #eef8f3;
  color: var(--success);
  border: 1px solid #bfe2d2;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 38px auto 80px;
}

.narrow-shell {
  width: min(520px, calc(100% - 32px));
}

.page-heading {
  margin-bottom: 24px;
}

.kicker {
  margin-bottom: 8px;
  color: var(--gold-dark);
  font-weight: 800;
  text-transform: uppercase;
}

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

.metric-card {
  display: grid;
  gap: 12px;
  padding: 22px;
}

.metric-card span {
  color: var(--muted);
}

.metric-card strong {
  font-size: clamp(1.5rem, 3vw, 2.4rem);
}

.workspace-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
}

.workspace-band p {
  max-width: 680px;
  color: var(--muted);
  line-height: 1.6;
}

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

.watchlist span {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font-weight: 800;
}

.admin-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.profile-layout,
.trade-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
  margin-bottom: 20px;
}

.trade-panel,
.portfolio-section {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.trade-panel {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.portfolio-section {
  margin-top: 20px;
  overflow: hidden;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.section-heading h2 {
  margin-bottom: 0;
}

.section-heading span,
.muted-text {
  color: var(--muted);
  font-size: 0.92rem;
}

.market-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}

.market-card {
  display: grid;
  gap: 6px;
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.market-card strong {
  font-size: 1.25rem;
}

.market-card span {
  color: var(--muted);
  line-height: 1.35;
}

.market-card b {
  align-self: end;
}

.market-card small {
  color: var(--muted);
}

.gain {
  color: var(--success);
  font-weight: 700;
}

.loss {
  color: var(--danger);
  font-weight: 700;
}

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

.user-table {
  width: 100%;
  border-collapse: collapse;
}

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

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

.inline-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-form select {
  min-width: 110px;
  padding: 10px 12px;
}

.document-view,
.error-box {
  padding: clamp(24px, 5vw, 48px);
  line-height: 1.7;
}

.document-view h1,
.document-view h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

@media (max-width: 820px) {
  .site-header,
  .workspace-band {
    align-items: flex-start;
    flex-direction: column;
  }

  .main-nav {
    flex-wrap: wrap;
  }

  .home-shell,
  .admin-layout,
  .profile-layout,
  .trade-layout,
  .metrics-grid {
    grid-template-columns: 1fr;
  }

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

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

  .home-shell {
    margin-top: 22px;
  }

  .login-panel,
  .admin-form {
    padding: 22px;
  }
}
