:root {
  --bg: #0b1020;
  --bg-soft: #131a2f;
  --panel: #11192b;
  --line: #263556;
  --text: #ecf1ff;
  --muted: #91a2c6;
  --up: #2dd4a8;
  --down: #ff6c78;
  --accent: #59b7ff;
  --warn: #ffb020;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  background: radial-gradient(circle at 15% -5%, #1e345a 0%, transparent 35%),
    radial-gradient(circle at 105% 120%, #193a38 0%, transparent 40%),
    var(--bg);
  color: var(--text);
}

.app-bg {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.sidebar {
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: rgba(8, 12, 24, 0.72);
  backdrop-filter: blur(6px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(180deg, #88d8ff 0%, #3f9fff 100%);
  box-shadow: 0 0 18px rgba(89, 183, 255, 0.7);
}

.brand p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
  padding: 10px 12px;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.nav a:hover,
.nav a.active {
  color: var(--text);
  border-color: var(--line);
  background: rgba(89, 183, 255, 0.12);
}

.mode {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.mode span {
  color: var(--muted);
  display: block;
  font-size: 13px;
}

.content {
  padding: 22px;
}

.topbar {
  margin-bottom: 14px;
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
}

.topbar p {
  margin: 8px 0 0;
  color: var(--muted);
}

.grid.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.card,
.panel {
  border: 1px solid var(--line);
  background: rgba(12, 18, 32, 0.9);
  border-radius: 14px;
}

.card {
  padding: 14px;
}

.card p {
  margin: 0 0 8px;
  color: var(--muted);
}

.card h3 {
  margin: 0;
  font-size: 24px;
}

.up {
  color: var(--up);
}

.down {
  color: var(--down);
}

.warn {
  color: var(--warn);
}

.panel {
  padding: 16px;
  margin-top: 14px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

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

.panel-head span {
  color: var(--muted);
  font-size: 13px;
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-height: 150px;
}

.bar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.bar {
  width: 24px;
  min-height: 12px;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, #8ae8ff 0%, #2f95ff 95%);
}

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

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

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

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

th {
  color: var(--muted);
  font-weight: 500;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.settings-grid label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
}

.settings-grid label.checkbox-row {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-top: 30px;
}

.settings-grid input,
.settings-grid select {
  background: #0b1428;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: #031224;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.btn.danger {
  background: var(--down);
  color: #220205;
}

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

.log-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
  display: grid;
  grid-template-columns: 68px 70px 90px 1fr;
  gap: 10px;
  align-items: start;
}

.log-item .time,
.log-item .tag,
.log-item .symbol {
  color: var(--muted);
  font-size: 13px;
}

.log-item p {
  margin: 0;
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .log-item {
    grid-template-columns: 1fr;
  }
}
