:root {
  --bg: #050b16;
  --bg-panel: #0a1426;
  --bg-card: #0e1c36;
  --line: rgba(56, 189, 248, 0.18);
  --text: #eff6ff;
  --muted: #94a3b8;
  --cyan: #38bdf8;
  --blue: #2563eb;
  --green: #34d399;
  --orange: #fbbf24;
  --red: #f87171;
  --shadow: 0 18px 45px rgba(2, 6, 23, 0.55);
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at 85% 0%, rgba(56, 189, 248, 0.14), transparent 36%),
              radial-gradient(circle at 10% 90%, rgba(37, 99, 235, 0.12), transparent 32%),
              var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.login-card {
  width: min(420px, 100%);
  padding: 32px;
  border-radius: 20px;
  background: linear-gradient(155deg, rgba(14, 28, 54, 0.92), rgba(7, 15, 31, 0.96));
  border: 1px solid rgba(56, 189, 248, 0.32);
  box-shadow: var(--shadow);
}
.brand-row { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.brand-orb {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  display: grid; place-items: center; font-weight: 800; color: #041224;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.45);
}
.shell { display: grid; grid-template-columns: 255px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: rgba(7, 14, 28, 0.94);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.nav-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 0; background: transparent; color: #9fb4cc;
  text-align: left; font-size: 13.5px; font-weight: 600; transition: .15s;
}
.nav-btn:hover { background: rgba(56, 189, 248, 0.08); color: #fff; }
.nav-btn.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.22), rgba(37, 99, 235, 0.08));
  box-shadow: inset 3px 0 0 var(--cyan);
}
.main { padding: 20px 28px 110px; min-width: 0; }
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding-bottom: 16px; margin-bottom: 20px; border-bottom: 1px solid var(--line);
}
.card {
  background: linear-gradient(145deg, rgba(14, 28, 54, 0.88), rgba(9, 19, 38, 0.95));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-val { font-size: 26px; font-weight: 800; margin-top: 6px; color: #f8fafc; }
.metric-lbl { font-size: 12px; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 11.5px; font-weight: 700; color: #bae6fd; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  background: #060f1e; border: 1px solid rgba(56, 189, 248, 0.25);
  color: #f1f5f9; outline: 0;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16);
}
.btn {
  border: 0; border-radius: 10px; padding: 10px 15px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #031120; font-weight: 800; font-size: 13px;
}
.btn:hover { filter: brightness(1.08); }
.btn.secondary { background: #102443; color: #e0f2fe; border: 1px solid rgba(56, 189, 248, 0.3); }
.btn.danger { background: #7f1d1d; color: #fecaca; border: 1px solid rgba(248, 113, 113, 0.4); }
.btn.small { padding: 7px 11px; font-size: 12px; border-radius: 8px; }
.tag {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
  background: rgba(56, 189, 248, 0.14); color: #7dd3fc;
}
.tag.green { background: rgba(52, 211, 153, 0.15); color: #6ee7b7; }
.tag.orange { background: rgba(251, 191, 36, 0.15); color: #fde68a; }
.tag.red { background: rgba(248, 113, 113, 0.15); color: #fca5a5; }
.row-item {
  padding: 12px; border-radius: 10px; background: #071224;
  border: 1px solid rgba(56, 189, 248, 0.14);
}
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #0c4a6e; color: #e0f2fe; border: 1px solid var(--cyan);
  padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 700; z-index: 90;
}
.toast.error { background: #7f1d1d; border-color: var(--red); color: #fee2e2; }

/* Esfera Orion Live (inspirada no Jarvis MIT, reservada no canto inferior direito) */
.orion-live-widget {
  position: fixed; right: 24px; bottom: 20px; z-index: 80;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 999px;
  background: rgba(7, 17, 34, 0.9); backdrop-filter: blur(12px);
  border: 1px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 12px 35px rgba(14, 165, 233, 0.25);
}
.orion-live-orb {
  width: 44px; height: 44px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #7dd3fc, #0284c7 60%, #082f49);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.65);
  display: grid; place-items: center; cursor: pointer;
  transition: transform .2s ease;
}
.orion-live-orb.listening { animation: pulseOrb 1s infinite; background: radial-gradient(circle at 35% 35%, #6ee7b7, #059669); }
.orion-live-orb.processing { animation: pulseOrb .6s infinite; background: radial-gradient(circle at 35% 35%, #fde68a, #d97706); }
.orion-live-orb.speaking { animation: pulseOrb .8s infinite; background: radial-gradient(circle at 35% 35%, #93c5fd, #2563eb); }
@keyframes pulseOrb { 0%,100% { transform: scale(1); } 50% { transform: scale(1.1); } }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .form-grid { grid-template-columns: 1fr; }
}
