/* base.css — slice of the former style.css (see also: sibling css/ files) */
:root {
  --bg: #0e1116;
  --panel: #161b22;
  --panel-2: #1f2630;
  --border: #2a313c;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #79c0ff;
  --accent-2: #d2a8ff;
  --pos: #3fb950;
  --neg: #f85149;
  --danger: #f85149;
  --radius: 10px;
  --shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 8px 24px rgba(0,0,0,0.25);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

/* The HTML `hidden` attribute applies `display: none` via the UA stylesheet,
   but any explicit `display` rule (like `.row { display: flex }`) overrides it.
   Force `hidden` to always win. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: radial-gradient(circle at 20% 0%, #1a2233 0%, var(--bg) 60%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.45;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(13,17,23,0.7);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 1.1rem;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
/* Gradient applies to the text span only, leaves the SVG mark untouched. */
.brand > span {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-mark {
  width: 24px;
  height: 24px;
  display: block;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

/* --- shared primitives (hoisted from components.css so foundations load first) --- */
.container { max-width: 1100px; margin: 28px auto; padding: 0 24px; }

h1 { margin-top: 0; }
h1, h2, h3 { letter-spacing: -0.01em; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.card.narrow { max-width: 460px; margin: 40px auto; }

.card-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-header h2 { margin: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.stat-label { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.stat-value { font-size: 1.9rem; font-weight: 700; margin: 6px 0 2px; }
.stat-sub { font-size: 0.85rem; color: var(--muted); }

.pos { color: var(--pos); }
.neg { color: var(--neg); }
.bold { font-weight: 700; }
.muted { color: var(--muted); }
.center { text-align: center; }

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

label {
  display: block;
  margin: 10px 0;
  font-size: 0.9rem;
  color: var(--muted);
}

input, select, textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(121,192,255,0.18);
}

button, .btn {
  display: inline-block;
  padding: 9px 16px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}
button:hover, .btn:hover { border-color: var(--accent); color: var(--accent); }

button.primary, .btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b0f15;
  border-color: transparent;
  font-weight: 600;
}
button.primary:hover, .btn.primary:hover { filter: brightness(1.1); color: #0b0f15; }

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  cursor: pointer;
  font-size: inherit;
}
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--danger); }

.inline { display: inline; }
.row { display: flex; gap: 12px; align-items: flex-end; }
.row .grow { flex: 1; }
.row-between { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.oauth-row { display: flex; gap: 10px; justify-content: center; }

.error {
  background: rgba(248,81,73,0.1);
  border: 1px solid rgba(248,81,73,0.4);
  color: #ffb4b0;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.warn {
  background: rgba(210,168,255,0.08);
  border: 1px solid rgba(210,168,255,0.35);
  color: #e0c8ff;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

table { width: 100%; border-collapse: collapse; margin-top: 8px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
th { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.06em; }
tbody tr:hover { background: rgba(255,255,255,0.02); }

.side-buy { color: var(--pos); font-weight: 600; }
.side-sell { color: var(--neg); font-weight: 600; }

.pill {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(121,192,255,0.15);
  color: var(--accent);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.warn-pill { background: rgba(248,81,73,0.15); color: var(--neg); }
