:root {
  color-scheme: dark;
  --bg: #090b10;
  --surface: #0f141d;
  --panel: #151b26;
  --panel-soft: #111822;
  --text: #f4f7fb;
  --muted: #9aa6b8;
  --line: #293242;
  --accent: #35d2a2;
  --accent-dark: #71e7c5;
  --danger: #ff6b62;
  --shadow: rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(53, 210, 162, 0.14), transparent 32rem),
    linear-gradient(180deg, #090b10 0%, #0b1017 48%, #090b10 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto minmax(120px, 1fr);
  align-items: center;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(9, 11, 16, 0.84);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0;
  color: var(--text);
  font-size: 1.05rem;
}

nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

nav a,
nav button {
  color: var(--muted);
  font: inherit;
  text-decoration: none;
}

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

.main-menu {
  justify-content: center;
}

.main-menu a {
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(53, 210, 162, 0.1);
  color: var(--accent-dark);
  font-weight: 800;
}

.main-menu a.active {
  background: rgba(53, 210, 162, 0.17);
  color: var(--text);
}

.account-menu {
  justify-content: flex-end;
}

button {
  border: 0;
  cursor: pointer;
}

.inline {
  margin: 0;
}

.inline button {
  padding: 0;
  background: transparent;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 56px;
}

.hero {
  padding: 26px 0 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.hero h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 1;
}

.hero p {
  max-width: 660px;
  color: var(--muted);
  font-size: 1.05rem;
}

.events,
.admin-list {
  display: grid;
  gap: 12px;
}

.event,
.panel,
.login-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 48px var(--shadow);
}

.event {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 18px;
  padding: 16px;
}

.datebox {
  display: grid;
  align-content: center;
  min-height: 82px;
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(53, 210, 162, 0.18), rgba(72, 110, 255, 0.12));
  color: var(--accent-dark);
  text-align: center;
  border: 1px solid rgba(53, 210, 162, 0.2);
}

.datebox span {
  font-weight: 900;
  font-size: 1.35rem;
}

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

.event-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.event h2,
.admin-item h2 {
  margin-bottom: 4px;
  font-size: 1.1rem;
}

.status {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: #222b39;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.status.live {
  background: rgba(53, 210, 162, 0.15);
  color: var(--accent-dark);
}

.status.done {
  background: #202838;
  color: #a7b1c2;
}

.status.paused,
.status.error {
  background: rgba(255, 107, 98, 0.13);
  color: var(--danger);
}

.status.sold {
  background: rgba(113, 231, 197, 0.14);
  color: var(--accent-dark);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.meta span:not(:last-child)::after {
  content: "·";
  margin-left: 8px;
}

.description {
  margin-bottom: 10px;
  color: #d6dde8;
  white-space: pre-line;
}

.event-link,
.button-link {
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
}

.empty {
  padding: 18px;
  color: var(--muted);
  background: var(--panel-soft);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 18px;
}

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

.trade-head h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1;
}

.trade-head p {
  max-width: 760px;
  color: var(--muted);
}

.mode-badge {
  min-width: 190px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.mode-badge span,
.mode-badge small {
  display: block;
}

.mode-badge span {
  font-weight: 900;
}

.mode-badge small {
  margin-top: 2px;
  color: var(--muted);
}

.mode-badge.live {
  border-color: rgba(53, 210, 162, 0.45);
}

.mode-badge.dry {
  border-color: rgba(255, 203, 107, 0.35);
}

.trade-alert {
  margin-bottom: 16px;
}

.trade-layout {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.trade-form {
  position: sticky;
  top: 82px;
  display: grid;
  gap: 14px;
}

.trade-form h2,
.bot-card h2 {
  margin-bottom: 0;
  font-size: 1.2rem;
}

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

.bot-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 48px var(--shadow);
}

.bot-top,
.bot-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.bot-top p,
.bot-note,
.bot-error,
.bot-hash {
  margin-bottom: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.bot-error {
  margin-top: 10px;
  color: var(--danger);
}

.bot-note,
.bot-hash {
  margin-top: 10px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.metrics div {
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.metrics small,
.metrics strong {
  display: block;
}

.metrics small {
  margin-bottom: 4px;
  color: var(--muted);
}

.metrics strong {
  overflow-wrap: anywhere;
}

.bot-actions {
  justify-content: flex-end;
  margin-top: 14px;
}

.bot-actions form {
  margin: 0;
}

.bot-actions button {
  padding: 8px 10px;
  border-radius: 8px;
  background: #222b39;
  color: var(--text);
  font-weight: 800;
}

.bot-actions .danger {
  background: rgba(255, 107, 98, 0.13);
  color: var(--danger);
}

.panel {
  padding: 18px;
}

.panel h1 {
  margin-bottom: 18px;
  font-size: 1.45rem;
}

.event-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: #dbe2ec;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--text);
  font: inherit;
  background: #0c1119;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(53, 210, 162, 0.35);
  border-color: rgba(53, 210, 162, 0.72);
}

input::placeholder {
  color: #647084;
}

textarea {
  resize: vertical;
}

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

.primary {
  width: fit-content;
  padding: 11px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: #04100c;
  font-weight: 800;
}

.danger {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 107, 98, 0.13);
  color: var(--danger);
  font-weight: 800;
}

.alert,
.login-error {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 107, 98, 0.13);
  color: var(--danger);
}

.alert p,
.login-error {
  margin: 0;
}

.admin-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.admin-item:last-child {
  border-bottom: 0;
}

.admin-item p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-box {
  width: min(420px, 100%);
  padding: 22px;
}

.login-box h1 {
  margin: 20px 0 16px;
  font-size: 1.55rem;
}

.login-box .primary {
  width: 100%;
  margin-top: 14px;
}

@media (max-width: 820px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .main-menu {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: center;
  }

  .account-menu {
    justify-content: flex-end;
  }

  .admin-grid,
  .event,
  .two,
  .trade-layout,
  .metrics {
    grid-template-columns: 1fr;
  }

  .trade-head,
  .bot-top,
  .bot-actions {
    display: grid;
  }

  .trade-form {
    position: static;
  }

  .datebox {
    min-height: auto;
    padding: 10px;
  }

  .event-head {
    display: grid;
  }
}
