:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  background: #f5f7fb;
  color: #111827;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f5f7fb;
}

button, input, textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  min-height: 40px;
  padding: 10px 14px;
  cursor: pointer;
}

button.primary, .primary {
  background: #111827;
  color: #ffffff;
}

button.secondary, .secondary {
  background: #eef2f7;
  color: #1f2937;
}

.hidden {
  display: none !important;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) 460px;
}

.auth-visual {
  padding: 48px;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(90deg, rgba(11, 31, 45, .92), rgba(17, 24, 39, .72)),
    url("https://images.unsplash.com/photo-1558494949-ef010cbdcc31?auto=format&fit=crop&w=1800&q=80");
  background-size: cover;
  background-position: center;
}

.brand-lockup, .side-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #2dd4bf;
  color: #062821;
  font-weight: 900;
}

.brand-mark.small {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.brand-name {
  font-weight: 800;
  font-size: 24px;
}

.brand-subtitle {
  color: rgba(255,255,255,.72);
  margin-top: 3px;
}

.auth-copy h1 {
  max-width: 760px;
  margin: 0 0 16px;
  font-size: clamp(36px, 5vw, 68px);
  line-height: 1.02;
  letter-spacing: 0;
}

.auth-copy p {
  max-width: 620px;
  margin: 0;
  color: rgba(255,255,255,.76);
  font-size: 18px;
  line-height: 1.7;
}

.auth-points {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-points span, .tag {
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  padding: 7px 10px;
  color: rgba(255,255,255,.82);
  background: rgba(255,255,255,.09);
}

.auth-card {
  align-self: center;
  margin: 32px;
  padding: 28px;
  border: 1px solid #dbe3ed;
  border-radius: 10px;
  background: white;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .08);
}

.auth-card-head h2 {
  margin: 0;
  font-size: 26px;
}

.auth-card-head p {
  margin: 8px 0 20px;
  color: #64748b;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.tab {
  color: #475569;
  background: #eef2f7;
}

.tab.active {
  color: white;
  background: #111827;
}

.form {
  display: none;
}

.form.active {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: #334155;
  font-size: 14px;
}

input, textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 11px 12px;
  background: #ffffff;
  color: #111827;
  outline: none;
}

input:focus, textarea:focus {
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, .14);
}

.full {
  width: 100%;
}

.auth-foot {
  margin-top: 16px;
  color: #64748b;
  font-size: 13px;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  background: #0f172a;
  color: white;
}

.side-brand strong, .side-brand span {
  display: block;
}

.side-brand span {
  color: #94a3b8;
  font-size: 12px;
  margin-top: 3px;
}

.side-nav {
  margin-top: 30px;
  display: grid;
  gap: 6px;
}

.side-nav a {
  color: #cbd5e1;
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 8px;
}

.side-nav a.active, .side-nav a:hover {
  color: white;
  background: rgba(255,255,255,.1);
}

.side-status {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 22px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255,255,255,.08);
}

.side-status span, .side-status strong {
  display: block;
}

.side-status span {
  color: #94a3b8;
  font-size: 12px;
}

.dashboard-main {
  padding: 24px;
}

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

.dash-header h1 {
  margin: 0 0 6px;
  font-size: 30px;
}

.dash-header p {
  margin: 0;
  color: #64748b;
}

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

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.metric-card, .panel {
  border: 1px solid #dbe3ed;
  border-radius: 10px;
  background: white;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .04);
}

.metric-card {
  padding: 18px;
}

.metric-card span {
  color: #64748b;
  font-size: 13px;
}

.metric-card strong {
  display: block;
  margin: 8px 0;
  font-size: 28px;
  overflow-wrap: anywhere;
}

.metric-card p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}

.primary-card {
  background: #0f766e;
  color: white;
}

.primary-card span, .primary-card p {
  color: rgba(255,255,255,.75);
}

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

.panel {
  padding: 18px;
}

.panel.wide {
  grid-column: 1 / -1;
}

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

.panel-head h2 {
  margin: 0 0 5px;
  font-size: 18px;
}

.panel-head p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}

.tag {
  border-color: #dbe3ed;
  color: #0f766e;
  background: #ecfdf5;
  height: max-content;
}

.redeem-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 10px;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.copy-row span {
  display: block;
  color: #64748b;
  font-size: 12px;
  margin-bottom: 5px;
}

code {
  color: #0f766e;
  overflow-wrap: anywhere;
}

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

pre {
  white-space: pre-wrap;
  overflow: auto;
  padding: 14px;
  border-radius: 8px;
  background: #111827;
  color: #d1fae5;
}

.code-sample {
  margin-top: 12px;
  color: #bfdbfe;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: min(560px, calc(100vw - 28px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #111827;
  color: white;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 30;
}

#toast.show {
  opacity: 1;
}

@media (max-width: 980px) {
  .auth-screen, .dashboard-shell {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    min-height: 46vh;
  }

  .auth-card {
    margin: 18px;
  }

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

  .side-status {
    position: static;
    margin-top: 16px;
  }

  .metric-grid, .content-grid {
    grid-template-columns: 1fr;
  }

  .panel.wide {
    grid-column: auto;
  }

  .dash-header, .panel-head, .redeem-row {
    flex-direction: column;
    display: flex;
    align-items: stretch;
  }
}
