:root {
  --bg: #0b0f17;
  --panel: #0f1623;
  --panel2: #0b0f17;
  --line: #1b2333;
  --line2: #26314a;
  --text: #e6e9f2;
  --muted: rgba(230,233,242,.75);
  --muted2: rgba(230,233,242,.55);
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
.app { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }

.sidebar {
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #0f1623 0%, #0b0f17 70%);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.brand { padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(0,0,0,.12); }
.brand-title { font-weight: 800; letter-spacing: .2px; }
.brand-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

.nav { display: flex; flex-direction: column; gap: 8px; }
.nav-btn {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.12);
  color: var(--text);
  cursor: pointer;
}
.nav-btn:hover { border-color: var(--line2); filter: brightness(1.05); }
.nav-btn.active { background: #141e30; border-color: var(--line2); }
.nav-sep { height: 10px; border-bottom: 1px dashed rgba(230,233,242,.12); margin: 6px 0; }

.sidebar-footer { margin-top: auto; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(0,0,0,.10); }
.tiny { font-size: 12px; color: var(--muted2); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }

.main { display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 16px 18px;
  background: rgba(11,15,23,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}

.page-title { font-size: 18px; font-weight: 800; }
.page-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

.top-actions { display: flex; gap: 10px; align-items: center; }

.btn {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line2);
  background: #141e30;
  color: var(--text);
  cursor: pointer;
}
.btn.secondary { background: #101a2b; border-color: var(--line); }
.btn:hover { filter: brightness(1.07); }

.content { padding: 18px; display: grid; gap: 14px; }

.card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  padding: 14px;
  box-shadow: var(--shadow);
}

.card h2 { margin: 0 0 10px; font-size: 15px; }
.row { display: grid; grid-template-columns: repeat(12, 1fr); gap: 10px; }
.col-12 { grid-column: span 12; }
.col-8 { grid-column: span 8; }
.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }
.col-2 { grid-column: span 2; }

label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
input, select, textarea {
  width: 100%;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  outline: none;
}
textarea { min-height: 120px; resize: vertical; font-family: ui-monospace, Menlo, Consolas, monospace; }

.kbd { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--muted); }
.small { font-size: 12px; color: var(--muted); }
.pill {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0,0,0,.12);
  font-size: 12px;
  color: var(--muted);
}

.list { display: grid; gap: 8px; }
.list-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0,0,0,.12);
  padding: 10px 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}
.list-item code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--muted); white-space: pre-wrap; }

.icon-btn {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line2);
  background: #141e30;
  color: var(--text);
  cursor: pointer;
}
.icon-btn.secondary { background: #101a2b; border-color: var(--line); }
.icon-btn:hover { filter: brightness(1.07); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  padding: 10px 12px;
  border: 1px solid var(--line2);
  border-radius: 14px;
  background: #101a2b;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease;
}
.toast.show { opacity: 1; }

/* ===== Dino Editor (inline like sketch) ===== */
.stat-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.stat-chip {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0,0,0,.12);
}
.stat-chip input[type="number"] {
  width: 84px;
}
.stat-label {
  font-size: 12px;
  color: var(--muted);
  min-width: 54px;
}

.opt-bar {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-top: 10px;
}

.color-bar {
  margin-top: 10px;
  border-top: 1px solid rgba(230,233,242,.10);
  padding-top: 10px;
  display: grid;
  gap: 10px;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
.color-chip {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0,0,0,.12);
  padding: 8px 10px;
  display: grid;
  gap: 8px;
}
.color-chip input[type="number"] {
  width: 100%;
}
.color-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
}

.dino-list-big {
  max-height: 520px;
  overflow: auto;
  display: grid;
  gap: 8px;
  padding-right: 4px;
}

.dino-row2 {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0,0,0,.12);
  padding: 10px 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}
.dino-row2:hover { border-color: var(--line2); }
.dino-row2.selected { background:#141e30; border-color: var(--line2); }

.dino-row2 .name { font-weight: 800; }
.dino-row2 .bp { font-size: 11px; color: var(--muted2); word-break: break-all; margin-top: 4px; }

/* ==========================================================
   AUTH OVERLAY (Login / Accounts)
   ========================================================== */

body.auth-locked { overflow: hidden; }
body.auth-locked .app {
  filter: blur(2px);
  pointer-events: none;
  user-select: none;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 500px at 20% 10%, rgba(80,140,255,.18), transparent 60%),
    radial-gradient(700px 420px at 90% 30%, rgba(180,90,255,.12), transparent 55%),
    var(--bg);
}

.auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 10px;
  gap: 12px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.18);
  box-shadow: var(--shadow);
}

.auth-title {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: .2px;
  color: #fff;
}

.auth-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.auth-center {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 18px;
}

.auth-card {
  width: min(460px, calc(100vw - 36px));
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15,22,35,.75);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  padding: 16px;
}

.auth-card h2 {
  margin: 0 0 10px;
  font-size: 16px;
}

.auth-row {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.auth-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.auth-msg {
  margin-top: 10px;
  font-size: 12px;
  color: rgba(255,255,255,.75);
}

.auth-error {
  margin-top: 10px;
  font-size: 12px;
  color: #ffb4b4;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.12);
  font-size: 12px;
  color: var(--muted);
}


/* ==========================================================
   AUTH ADMIN PANEL
   ========================================================== */

.btn.danger {
  background: #2a1010;
  border-color: rgba(255,180,180,.35);
}
.btn.danger:hover { filter: brightness(1.08); }

.list-item.selected {
  border-color: var(--line2);
  background: #141e30;
}
