:root {
  color-scheme: light;
  --ink: #101828;
  --muted: #667085;
  --line: #d9e2ef;
  --panel: #ffffff;
  --bg: #f4f7fb;
  --brand: #112c63;
  --brand-2: #1f7a8c;
  --green: #087443;
  --red: #b42318;
  --amber: #b54708;
  --soft-green: #e8f7ef;
  --soft-red: #fff0ee;
  --soft-blue: #eaf2ff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Tahoma, Arial, sans-serif;
}

a { color: inherit; text-decoration: none; }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 12%, #d9f1f6 0, transparent 32%),
    radial-gradient(circle at 82% 78%, #e4ecff 0, transparent 34%),
    var(--bg);
}

.login-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 30px;
  box-shadow: 0 24px 80px rgba(16, 24, 40, .12);
}

.mark {
  color: var(--brand-2);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

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

.login-card h1 {
  margin: 12px 0 8px;
  font-size: 28px;
}

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

label {
  display: block;
  margin: 16px 0 7px;
  font-weight: 700;
}

input, select {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.button.secondary, button.secondary {
  color: var(--brand);
  background: var(--soft-blue);
}

.button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.error, .notice {
  border-radius: 8px;
  padding: 11px 12px;
  margin: 14px 0;
}

.error { background: var(--soft-red); color: var(--red); }
.notice { background: var(--soft-blue); color: var(--brand); }

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

.sidebar {
  background: #0f2148;
  color: #fff;
  padding: 24px 18px;
}

.brand {
  display: grid;
  gap: 4px;
  margin-bottom: 28px;
}

.brand strong { font-size: 20px; }
.brand span { color: #bed3ec; font-size: 13px; }

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

.nav a {
  display: flex;
  padding: 12px 13px;
  border-radius: 8px;
  color: #dbe8f7;
}

.nav a.active, .nav a:hover {
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

.content {
  padding: 28px;
}

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

.topbar h1 { margin-bottom: 6px; }

.grid {
  display: grid;
  gap: 16px;
}

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

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.stat small {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat strong {
  font-size: 26px;
}

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

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

.signal-card {
  display: grid;
  gap: 14px;
}

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

.pair {
  font-size: 20px;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.buy, .win { background: var(--soft-green); color: var(--green); }
.sell, .loss { background: var(--soft-red); color: var(--red); }
.open { background: var(--soft-blue); color: var(--brand); }
.wait { background: #fff7e6; color: var(--amber); }

.levels {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.level {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.level small {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
}

.level strong {
  word-break: break-word;
}

.reason {
  color: var(--muted);
  line-height: 1.7;
}

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

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

th {
  color: var(--muted);
  font-size: 13px;
}

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

.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .stats, .signal-grid, .form-row { grid-template-columns: 1fr; }
  .topbar, .toolbar { flex-direction: column; align-items: stretch; }
}

@media (max-width: 620px) {
  .content { padding: 18px; }
  .levels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
