/* Adivina — NubePilot's flagship. Dark navy cockpit, violet/cyan instruments.
   Family palette: cyan #41BFE7 → blue #656CFA → violet #6F58FA on #22203F. */

:root {
  --bg: #16142b;
  --panel: #201d3d;
  --panel-2: #282450;
  --line: #373362;
  --text: #f0effa;
  --text-soft: #b9b6d8;
  --muted: #817daa;
  --cyan: #41bfe7;
  --blue: #656cfa;
  --violet: #6f58fa;
  --grad: linear-gradient(115deg, #41bfe7, #656cfa 55%, #6f58fa);
  --green: #3ecf8e;
  --red: #ef7070;
  --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Outfit", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15.5px;
  line-height: 1.55;
  min-height: 100vh;
}

h1, h2, h3 { font-family: "Bricolage Grotesque", "Outfit", sans-serif; letter-spacing: -0.01em; }

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

/* ---- top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 14px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  z-index: 10;
}

.wordmark {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: 20px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.wordmark small { -webkit-text-fill-color: var(--muted); font-family: "Outfit"; font-weight: 500; font-size: 12px; margin-left: 8px; letter-spacing: 0.08em; }

.topbar nav { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.topbar nav a { color: var(--text-soft); }
.topbar nav a:hover { color: #fff; text-decoration: none; }

/* ---- layout ---- */
.wrap { max-width: 960px; margin: 0 auto; padding: clamp(20px, 4vw, 40px) clamp(16px, 4vw, 40px) 80px; }

.page-title { font-size: clamp(22px, 3.5vw, 30px); margin-bottom: 6px; }
.page-sub { color: var(--text-soft); margin-bottom: 28px; max-width: 60ch; }

/* ---- panels ---- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 22px;
}

.panel h2 { font-size: 17px; margin-bottom: 14px; }

/* ---- forms ---- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--text-soft); margin: 14px 0 6px; }
input, select, textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 12px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--violet); border-color: transparent; }
textarea { font-family: ui-monospace, monospace; font-size: 12.5px; min-height: 130px; }

.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  border: none; border-radius: 999px;
  padding: 10px 22px; color: #fff;
  background: var(--grad);
}
.btn[disabled] { opacity: 0.55; cursor: wait; }
.btn.ghost { background: transparent; color: var(--text-soft); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:hover { color: #fff; box-shadow: inset 0 0 0 1.5px var(--muted); }
.btn.small { padding: 6px 14px; font-size: 13.5px; }
.btn.danger { background: none; color: var(--red); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--red) 45%, transparent); }

.hint { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.error-text { color: var(--red); font-size: 13.5px; min-height: 18px; margin-top: 10px; }
.ok-text { color: var(--green); font-size: 13.5px; }

/* ---- connection cards ---- */
.conn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 10px;
  background: var(--panel-2);
  flex-wrap: wrap;
}
.conn-meta { min-width: 200px; }
.conn-label { font-weight: 600; }
.conn-sub { color: var(--muted); font-size: 12.5px; }
.conn-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.tag {
  display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; border-radius: 999px; padding: 2px 9px; margin-left: 8px;
}
.tag.live { color: #9fe8c8; background: color-mix(in srgb, var(--green) 18%, transparent); }
.tag.demo { color: #f8d791; background: rgba(240, 190, 90, 0.16); }
.tag.soon { color: var(--muted); background: var(--panel); }

/* ---- stat tiles ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 22px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.tile .k { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.tile .v { font-size: 24px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tile .v.pos { color: var(--green); }
.tile .v.neg { color: var(--red); }

/* ---- table ---- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.num.pos { color: var(--green); }
td.num.neg { color: var(--red); }

/* ---- chart ---- */
.chart-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 22px; }
canvas { width: 100%; height: 220px; display: block; }

/* ---- auth card (login) ---- */
.auth-body { display: grid; place-items: center; min-height: 100vh; }
.auth-card {
  width: min(400px, 92vw);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 34px 32px 30px;
}
.auth-card .wordmark { font-size: 24px; }
.auth-sub { color: var(--text-soft); font-size: 14px; margin: 4px 0 10px; }

@media (max-width: 600px) {
  .conn { flex-direction: column; align-items: flex-start; }
}
