/* ===============================================================
   Órbita — fundação: tokens, reset e componentes primitivos.
   Paleta neutra + um único acento. Claro e escuro no mesmo arquivo.
   =============================================================== */

:root {
  color-scheme: dark;

  --accent: #14b8a6;
  --accent-strong: #0d9488;
  --accent-soft: rgb(20 184 166 / 0.14);
  --danger: #f05252;
  --danger-soft: rgb(240 82 82 / 0.14);
  --live: #22c55e;

  --bg: #0c0d10;
  --bg-elev: #121419;
  --bg-panel: #16181e;
  --bg-hover: #1c1f26;
  --bg-active: #23262f;
  --line: #24272f;
  --line-soft: #1b1e24;

  --text: #e9ebef;
  --text-dim: #9aa1ad;
  --text-faint: #6b7280;

  --radius-xs: 6px;
  --radius-sm: 9px;
  --radius: 13px;
  --radius-lg: 18px;

  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.35);
  --shadow: 0 8px 28px -8px rgb(0 0 0 / 0.55);
  --shadow-lg: 0 28px 70px -20px rgb(0 0 0 / 0.65);

  --pad: 14px;
  --rail-w: 248px;
  --chat-w: 320px;
  --titlebar-h: 38px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI",
          Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Consolas, monospace;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --fast: 130ms var(--ease);
  --slow: 280ms var(--ease);
}

[data-theme="light"] {
  color-scheme: light;
  --accent: #0d9488;
  --accent-strong: #0f766e;
  --accent-soft: rgb(13 148 136 / 0.12);

  --bg: #f7f8fa;
  --bg-elev: #ffffff;
  --bg-panel: #ffffff;
  --bg-hover: #eef0f4;
  --bg-active: #e4e7ec;
  --line: #e2e5ea;
  --line-soft: #eceef2;

  --text: #14171c;
  --text-dim: #5b626d;
  --text-faint: #8b929d;

  --shadow-sm: 0 1px 2px rgb(16 24 40 / 0.06);
  --shadow: 0 10px 30px -12px rgb(16 24 40 / 0.18);
  --shadow-lg: 0 30px 70px -24px rgb(16 24 40 / 0.28);
}

[data-density="compact"] { --pad: 10px; --rail-w: 224px; }

* { box-sizing: border-box; }
*::selection { background: var(--accent-soft); color: var(--text); }

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.015em; }
h1 { font-size: 26px; }
h2 { font-size: 16px; }
h3 { font-size: 15px; }
p { margin: 0; }
svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-active); border: 3px solid transparent; background-clip: padding-box; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); background-clip: padding-box; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-xs); }

/* ---------------------------------------------------------- botões */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 13px;
  font: inherit; font-size: 13px; font-weight: 500;
  color: var(--text);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--fast), border-color var(--fast), transform var(--fast), color var(--fast);
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:hover { background: var(--bg-hover); border-color: var(--text-faint); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

.btn--primary { background: var(--accent); border-color: var(--accent); color: #04201d; font-weight: 600; }
.btn--primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn--danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn--danger:hover { background: var(--danger-soft); }
.btn--lg { height: 42px; font-size: 14px; justify-content: center; width: 100%; }
.btn.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.icon-btn {
  display: grid; place-items: center;
  width: 34px; height: 34px; padding: 0;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--fast), color var(--fast);
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn.is-on { background: var(--accent-soft); color: var(--accent); }
.icon-btn.is-off { background: var(--danger-soft); color: var(--danger); }
.icon-btn--sm { width: 30px; height: 30px; }
.icon-btn--sm svg { width: 15px; height: 15px; }
.icon-btn--xs { width: 24px; height: 24px; border-radius: var(--radius-xs); }
.icon-btn--xs svg { width: 12px; height: 12px; }

/* ---------------------------------------------------------- formulários */

.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 12px; font-weight: 550; color: var(--text-dim); letter-spacing: 0.01em; }
.field__hint { font-size: 11.5px; color: var(--text-faint); line-height: 1.45; }

.input {
  width: 100%; height: 38px; padding: 0 11px;
  font: inherit; font-size: 13.5px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color var(--fast), background var(--fast);
}
[data-theme="light"] .input { background: var(--bg-elev); }
.input:hover { border-color: var(--text-faint); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder { color: var(--text-faint); }
select.input { appearance: none; cursor: pointer; padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 16px) 17px, calc(100% - 11px) 17px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.input--flush { background: transparent; border-color: transparent; }
.input--flush:focus { box-shadow: none; border-color: transparent; }

.check { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; cursor: pointer; user-select: none; }
.check input { appearance: none; width: 17px; height: 17px; margin: 1px 0 0; flex: none;
  border: 1.5px solid var(--line); border-radius: 5px; background: var(--bg); cursor: pointer; transition: all var(--fast); }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { content: ""; display: block; width: 100%; height: 100%;
  background: no-repeat center/10px url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M2 6.5l2.6 2.6L10 3.5' fill='none' stroke='%23042'  stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>"); }
.check em { font-style: normal; color: var(--text-faint); }

/* ---------------------------------------------------------- diversos */

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 20px; padding: 0 8px;
  font-size: 11px; font-weight: 550; letter-spacing: 0.02em;
  color: var(--text-dim); background: var(--bg-hover);
  border-radius: 99px;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: var(--text-faint); }
.pill[data-status="online"] { color: var(--live); background: rgb(34 197 94 / 0.12); }
.pill[data-status="online"]::before { background: var(--live); }
.pill[data-status="connecting"] { color: #eab308; background: rgb(234 179 8 / 0.12); }
.pill[data-status="connecting"]::before { background: #eab308; animation: pulse 1s infinite; }

@keyframes pulse { 50% { opacity: 0.25; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.avatar {
  display: grid; place-items: center; flex: none;
  width: 34px; height: 34px;
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.02em;
  color: #fff;
  background: hsl(var(--hue, 180) 32% 44%);
  border-radius: 30%;
  overflow: hidden;
}
.avatar--sm { width: 30px; height: 30px; font-size: 11.5px; }
.avatar--lg { width: 76px; height: 76px; font-size: 26px; border-radius: 26%; }

.note {
  font-size: 12.5px; line-height: 1.55; color: var(--text-dim);
  padding: 11px 13px;
  background: var(--bg-hover);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}
.note b { color: var(--text); font-weight: 600; }
