:root {
  --bg: #0a0a0f;
  --fg: #f5f5f5;
  --accent: #ff6b35;
  --accent2: #ff4d7d;
  --muted: rgba(255, 255, 255, 0.5);
  --dim: rgba(255, 255, 255, 0.08);
  --card: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.1);
  --grad: linear-gradient(90deg, #ff6b35, #ff4d7d 50%, #9b4dca);
  --side: 16rem;
  --side-bg: #08080c;
  --on: rgba(255, 107, 53, 0.12);
  --font: Inter, ui-sans-serif, system-ui, sans-serif;
}

.space-admin {
  --bg: #0a0e1a;
  --accent: #0ea5e9;
  --accent2: #38bdf8;
  --border: rgba(14, 165, 233, 0.2);
  --card: rgba(14, 165, 233, 0.06);
  --grad: linear-gradient(90deg, #0ea5e9, #38bdf8);
  --side-bg: #0a0e1a;
  --on: rgba(14, 165, 233, 0.18);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  font-size: 0.9375rem;
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent2); }

.shell { display: flex; min-height: 100vh; align-items: flex-start; }
.side {
  width: var(--side);
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--side-bg);
  padding: 1.2rem 0.85rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand {
  display: block;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 1.35rem;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0 0.4rem 0.15rem;
}
.side-tag {
  color: var(--accent);
  opacity: 0.7;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0.4rem 1rem;
  font-weight: 600;
}
.side a.nav,
.side button.nav {
  display: block;
  width: 100%;
  text-align: left;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  font: inherit;
  cursor: pointer;
}
.side a.nav:hover,
.side button.nav:hover { color: var(--fg); background: var(--card); }
.side a.nav.on {
  color: var(--fg);
  background: var(--on);
  box-shadow: inset 2px 0 0 var(--accent);
}
.side-back { margin-top: 0.8rem; }
.side-foot {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.chip {
  display: inline-block;
  margin-left: 0.45rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 650;
  vertical-align: middle;
  background: var(--on);
  color: var(--fg);
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin: 0 0 1.25rem;
}
.page-head h1 { margin: 0 0 0.35rem; }
.page-head .sub { margin: 0; }
.quota-aside {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}
.quota-aside .chip { margin: 0; }
.empty-cta {
  min-height: 14rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.85rem;
  padding: 2rem 1.6rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  margin: 0 0 1rem;
}
.empty-cta p { margin: 0; color: var(--muted); }
.empty-cta .btn { font-size: 1.05rem; padding: 0.75rem 1.4rem; }
.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 0 0 1rem;
}
.rent-slots { align-items: stretch; }
.tile {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem 1rem 1.2rem;
  background: var(--card);
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
}
.tile strong { display: block; font-size: 1.05rem; }
.tile small { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 0.35rem; }
.tile:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(255, 107, 53, 0.16);
}
.tile.accent strong {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.tile.accent { transform: none; border-color: var(--border); box-shadow: none; }
.tile.accent:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(255, 107, 53, 0.16);
}
.tile.optimal { border-color: rgba(255, 107, 53, 0.45); }
.tile.coming {
  cursor: default;
  opacity: 0.45;
  filter: grayscale(0.7);
}
.tile.coming:hover { transform: none; box-shadow: none; border-color: var(--border); }
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin: 0 0 1rem;
  align-items: flex-end;
}
.filters label { margin: 0; }
.filters select { max-width: 12rem; }
.tile input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.tile:has(input:checked),
.tile.on { border-color: var(--accent); background: var(--on); }
.tile.locked { cursor: default; opacity: 0.9; }
.tile.locked:hover { transform: none; box-shadow: none; }
.badge {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.08rem 0.4rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 650;
  background: var(--on);
  color: var(--accent2);
}
.tile-sub { font-size: 0.95rem; margin: 1rem 0 0.5rem; color: var(--muted); font-weight: 600; }
@media (max-width: 720px) {
  .tiles { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; }
}
.btn-link {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
}
.inline { display: inline; margin: 0; }
.steps {
  display: flex;
  gap: 0.6rem;
  margin: 0 0 1rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.steps span.on { color: var(--fg); font-weight: 650; }
.pick {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  margin: 0.2rem 0;
}
.pick.must { background: var(--on); }
.pick.locked { opacity: 0.85; }
.pick small, .hint { display: block; color: var(--muted); font-size: 0.78rem; }
.pad h3 { font-size: 0.95rem; margin: 0.7rem 0 0.25rem; }
.who-card {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.35rem 0 0;
  padding: 0.45rem 0.5rem 0.45rem 0.55rem;
  border-radius: 10px;
  background: var(--on);
}
.who-card a.who-av,
.who-card a.who-meta { color: inherit; text-decoration: none; }
.who-card a.who-meta:hover strong { color: var(--accent2); }
.who-av {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: var(--grad);
  flex-shrink: 0;
}
.who-meta { min-width: 0; flex: 1; }
.who-out {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 8px;
  background: none;
  color: #f87171;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}
.who-out:hover { background: rgba(239, 68, 68, 0.12); }
.who-meta { min-width: 0; }
.who-meta strong {
  display: block;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.who-meta small {
  display: block;
  color: var(--accent);
  opacity: 0.7;
  font-size: 0.7rem;
}

.canvas {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
}
.pad {
  width: 100%;
  max-width: 56rem;
  padding: 1.8rem 1.6rem 3rem;
}
.pad h1 { font-size: 1.35rem; margin: 0 0 0.35rem; }
.sub { color: var(--muted); margin: 0 0 1.25rem; }
.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth { max-width: 26rem; margin: 12vh auto; padding: 0 1.2rem 4rem; }

.glass {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.15rem 1.2rem;
  margin: 0 0 1rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--grad);
  color: #fff;
  font-weight: 650;
  border: 0;
  border-radius: 8px;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}
.btn.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg);
}
.btn.danger { background: transparent; border: 1px solid rgba(239, 68, 68, 0.5); color: #fca5a5; }
.btn:disabled { opacity: 0.5; cursor: wait; }
.err { color: #fca5a5; }
.ok { color: #86efac; }
.muted { color: var(--muted); font-size: 0.85rem; }
pre {
  background: #050508;
  color: #eee;
  padding: 1rem;
  overflow: auto;
  border-radius: 10px;
  font-size: 0.8rem;
}
label { display: block; margin: 0.45rem 0; font-size: 0.85rem; color: var(--muted); }
.row { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.card {
  flex: 1 1 12rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  background: var(--card);
}
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
td, th { text-align: left; padding: 0.45rem 0.35rem; border-bottom: 1px solid var(--dim); }
th { color: var(--muted); font-weight: 500; }
.dots span {
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  margin: 0 0.12rem;
  border-radius: 50%;
  background: var(--accent);
  animation: bounce 1s infinite;
}
.dots span:nth-child(2) { animation-delay: 0.15s; }
.dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-5px); }
}
.handbook { color: rgba(255,255,255,0.82); }
.handbook h1 { font-size: 1.15rem; margin: 0 0 0.6rem; }
.handbook h2 { font-size: 1.02rem; margin: 1.1rem 0 0.4rem; }
.handbook h3 { font-size: 0.95rem; margin: 0.9rem 0 0.35rem; }
.handbook p { margin: 0.4rem 0; }
.handbook ul { margin: 0.35rem 0 0.6rem 1.1rem; padding: 0; }
.handbook li { margin: 0.2rem 0; }
.handbook pre, .handbook code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.handbook a { color: var(--accent); }
textarea {
  width: 100%;
  max-width: 22rem;
  min-height: 5rem;
  background: #050508;
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  font: inherit;
  resize: vertical;
}
input[type="text"], input[type="number"], input[type="password"], select, textarea {
  width: 100%;
  max-width: 22rem;
  background: #050508;
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  font: inherit;
}
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0.6rem 1rem; }
.grid2 label { margin: 0; }
.tool-drop {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.55rem 0.85rem 0.25rem;
  background: var(--card);
  margin: 0 0 1rem;
}
.tool-drop summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--fg);
  font-weight: 650;
  padding: 0.4rem 0 0.65rem;
}
.tool-drop summary::-webkit-details-marker { display: none; }
.tool-drop summary::after {
  content: "▾";
  margin-left: auto;
  color: var(--muted);
  font-weight: 500;
}
.tool-drop:not([open]) summary::after { content: "▸"; }
.tool-drop .tiles { margin-bottom: 0.55rem; }
.row-actions { display: flex; gap: 0.4rem; align-items: center; }
.row-actions form { margin: 0; }
.kpi { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.kpi .card { min-width: 9rem; }
.kpi strong { display: block; font-size: 1.15rem; color: var(--fg); }
.cta { margin-top: 0.8rem; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  color: #f87171;
  border: 1px solid transparent;
}
.icon-btn:hover { background: rgba(239, 68, 68, 0.12); color: #fca5a5; }
.warn-box {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.06);
}

@media (max-width: 720px) {
  .shell { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand, .side-tag { display: none; }
  .side-foot { margin: 0; padding: 0; border: 0; }
  .pad { padding: 1rem; }
}
