:root {
  color-scheme: light;
  --bear-red: #d7192f;
  --bear-red-dark: #9b1023;
  --graham-gold: #f7c548;
  --gold-deep: #b47a11;
  --bear-brown: #4b2a1b;
  --ink: #211915;
  --muted: #6e5d52;
  --line: #eadfce;
  --paper: #fffaf1;
  --white: #ffffff;
  --shadow: 0 24px 70px rgba(72, 36, 20, 0.16);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 12%, rgba(247, 197, 72, 0.28), transparent 28rem),
    linear-gradient(135deg, #fff9ec 0%, #f6ebd8 48%, #fff 100%);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  display: grid;
  grid-template-columns: minmax(320px, 0.86fr) minmax(0, 1.65fr);
  min-height: 100vh;
}

.brand-panel {
  position: sticky;
  top: 0;
  min-height: 100vh;
  padding: 42px;
  background:
    linear-gradient(160deg, rgba(75, 42, 27, 0.92), rgba(119, 50, 32, 0.9)),
    linear-gradient(45deg, var(--bear-red), var(--graham-gold));
  color: var(--white);
  overflow: hidden;
}

.brand-panel::after {
  content: "G";
  position: absolute;
  right: -16px;
  bottom: -92px;
  font-size: 22rem;
  font-weight: 900;
  line-height: 1;
  color: rgba(255, 255, 255, 0.06);
}

.school-mark {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 18px;
}

.school-mark img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  background: var(--white);
  border: 4px solid rgba(255, 255, 255, 0.35);
  border-radius: 20px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 8ch;
  font-size: clamp(2.6rem, 5vw, 5.4rem);
  line-height: 0.88;
  letter-spacing: 0;
}

.site-title {
  display: grid;
  gap: 0.03em;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
}

h3 {
  font-size: 1.45rem;
  line-height: 1.14;
}

.eyebrow {
  margin-bottom: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gold-card {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  margin-top: 72px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 44px rgba(28, 11, 4, 0.22);
}

.gold-card span,
.gold-card p {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.98rem;
  line-height: 1.55;
}

.values-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  margin-top: 24px;
  margin-bottom: 88px;
}

.values-list div {
  padding: 16px 20px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.94);
  font-size: 1.04rem;
  font-weight: 850;
  line-height: 1.2;
}

.creator-login-link {
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.88);
  font-weight: 750;
  text-decoration: none;
}

.creator-login-link {
  position: absolute;
  left: 42px;
  bottom: 34px;
  z-index: 2;
}

.creator-card {
  border-top: 5px solid var(--graham-gold);
}

.workspace {
  position: relative;
  padding: 34px;
}

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

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

.session-pill,
.admin-login-button {
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.admin-login-button {
  background: var(--bear-red);
  border-color: var(--bear-red);
  color: var(--white);
  text-decoration: none;
}

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

.single-auth {
  grid-template-columns: minmax(0, 620px);
}

.auth-card,
.tool-panel,
.roster-panel,
.activity-panel,
.balance-tile,
.market-strip,
.chart-card,
.listing-card,
.exchange-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.auth-card {
  padding: 24px;
}

.admin-card {
  border-top: 5px solid var(--bear-red);
}

.section-heading {
  margin-bottom: 18px;
}

.form-stack,
.admin-form,
.listing-form {
  display: grid;
  gap: 12px;
}

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

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #dbcbb5;
  border-radius: 7px;
  background: var(--white);
  color: var(--ink);
  padding: 0 13px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--bear-red);
  box-shadow: 0 0 0 4px rgba(215, 25, 47, 0.12);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 0.52fr;
  gap: 12px;
}

.page-link-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(215, 25, 47, 0.16);
  border-radius: 8px;
  background: rgba(215, 25, 47, 0.06);
  color: var(--muted);
  font-weight: 750;
}

.route-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 7px;
  padding: 0 16px;
  font-weight: 900;
  text-decoration: none;
}

.red-link {
  background: var(--bear-red);
  color: var(--white);
}

button {
  min-height: 46px;
  border: 0;
  border-radius: 7px;
  background: var(--bear-brown);
  color: var(--white);
  padding: 0 16px;
  font-weight: 850;
}

button:hover,
.route-link:hover,
.admin-login-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  background: linear-gradient(135deg, var(--bear-red), var(--bear-red-dark));
}

.ghost-button {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--bear-brown);
}

.dashboard {
  display: grid;
  gap: 20px;
}

.tabbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.tab-button {
  min-height: 40px;
  background: transparent;
  color: var(--bear-brown);
}

.tab-button.active {
  background: var(--bear-red);
  color: var(--white);
}

.student-dashboard,
.admin-dashboard,
.tab-panel {
  display: grid;
  gap: 20px;
}

.balance-grid,
.tool-grid,
.listing-grid,
.exchange-list,
.currency-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.balance-tile {
  padding: 24px;
}

.balance-tile span,
.listing-card span,
.exchange-card span,
.currency-card span {
  color: var(--muted);
  font-weight: 800;
}

.balance-tile strong {
  display: block;
  margin: 14px 0 4px;
  color: var(--gold-deep);
  font-size: 3.8rem;
  line-height: 0.95;
}

.balance-tile p,
.listing-card p,
.exchange-card p,
.currency-card p,
.muted-copy {
  color: var(--muted);
  line-height: 1.5;
}

.currency-card {
  display: grid;
  gap: 10px;
  min-height: 150px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.currency-card strong {
  display: block;
  margin-top: 6px;
  color: var(--bear-brown);
  font-size: 1.5rem;
  line-height: 1.05;
}

.currency-card b {
  color: var(--gold-deep);
}

.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin-top: 12px;
  border-radius: 7px;
  background: var(--bear-red);
  color: var(--white);
  padding: 0 12px;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 850;
}

.activity-panel,
.tool-panel,
.roster-panel,
.market-strip,
.chart-card {
  padding: 22px;
}

.market-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.activity-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.activity-list li {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.activity-list li:last-child {
  border-bottom: 0;
}

.admin-form {
  grid-template-columns: 1fr 1.35fr 0.55fr auto;
}

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

.listing-form {
  grid-template-columns: 1.1fr 1.3fr 0.6fr 0.6fr 0.9fr auto;
}

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

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

th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

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

.listing-card,
.exchange-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.listing-card img,
.listing-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(215, 25, 47, 0.14), rgba(247, 197, 72, 0.3)),
    var(--paper);
}

.listing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.listing-actions button {
  min-height: 38px;
}

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

.request-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.request-card p {
  margin-top: 4px;
  color: var(--muted);
}

.request-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.request-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.danger-button {
  background: var(--bear-red);
}

.backup-panel {
  display: grid;
  gap: 16px;
  margin-bottom: 22px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 18px 42px rgba(72, 36, 20, 0.09);
}

.backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid var(--bear-brown);
  border-radius: 8px;
  color: var(--bear-brown);
  font-weight: 900;
  cursor: pointer;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

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

.chart-summary div {
  padding: 14px;
  border-radius: 8px;
  background: var(--paper);
}

.chart-summary span {
  color: var(--muted);
  font-weight: 800;
}

.chart-summary strong {
  display: block;
  margin-top: 6px;
  font-size: 1.35rem;
}

.chart-bars {
  display: flex;
  align-items: end;
  gap: 10px;
  min-height: 260px;
  padding: 16px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(247, 197, 72, 0.18), rgba(255, 255, 255, 0.5));
}

.bar {
  display: grid;
  align-items: end;
  justify-items: center;
  flex: 1;
  min-width: 28px;
  height: var(--bar-height);
  border-radius: 7px 7px 0 0;
  background: var(--bear-red);
  color: var(--white);
  padding: 8px 4px;
  font-size: 0.75rem;
  font-weight: 850;
}

.toast {
  position: fixed;
  right: 26px;
  bottom: 26px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--white);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  transition: 180ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.hidden {
  display: none !important;
}

@media (max-width: 1120px) {
  .shell,
  .auth-grid,
  .balance-grid,
  .tool-grid,
  .listing-grid,
  .exchange-list,
  .currency-list,
  .chart-summary {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    position: relative;
    min-height: auto;
  }

  .admin-form,
  .exchange-form,
  .listing-form,
  .request-card {
    grid-template-columns: 1fr;
  }

  .request-card {
    align-items: flex-start;
    flex-direction: column;
  }

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

@media (max-width: 640px) {
  .brand-panel,
  .workspace {
    padding: 22px;
  }

  .creator-login-link {
    position: relative;
    left: auto;
    bottom: auto;
    display: inline-flex;
    margin-top: 0;
  }

  .values-list {
    margin-bottom: 24px;
  }

  .topbar,
  .dashboard-header,
  .school-mark,
  .market-strip {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .two-col {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 2.25rem;
  }
}
