:root{
  --bg0:#07080c;
  --bg1:#0b0d14;
  --card:#0f1220;
  --text:#e9ecf6;
  --muted:#a3a9bf;
  --border:rgba(255,255,255,.08);
  --glow:rgba(120,130,255,.10);
  --accent:#8b5cf6;
  --accent2:#22d3ee;
  --shadow: 0 20px 70px rgba(0,0,0,.55);
  --radius: 18px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

html{ background: var(--bg0); }

html::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:-2;
  background:
    radial-gradient(900px 500px at 15% 15%, rgba(139,92,246,.18), transparent 60%),
    radial-gradient(900px 500px at 85% 35%, rgba(34,211,238,.14), transparent 60%),
    radial-gradient(900px 500px at 50% 95%, rgba(120,130,255,.10), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  background-repeat:no-repeat;
}

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color:var(--text);
  overflow-x:hidden;
  position: relative;
}

.noise{
  pointer-events:none;
  position:fixed;
  inset:0;
  z-index:-1;
  opacity:.07;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
  background-size:240px 240px;
  mix-blend-mode:overlay;
}

.wrap{
  max-width: 980px;
  margin: 0 auto;
  padding: 48px 18px;
  position: relative;
  z-index: 1;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 18px;
  padding: 18px 18px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border:1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.brand{ display:flex; flex-direction:column; gap:4px; }
.brand h1{ margin:0; font-size:18px; letter-spacing:.2px; }
.brand p{ margin:0; font-size:12px; color:var(--muted); }

.actions{ display:flex; align-items:center; gap:10px; }

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding: 9px 12px;
  border-radius: 12px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.05);
  color: var(--text);
  text-decoration:none;
  cursor:pointer;
}

.btn.primary{ background: linear-gradient(90deg, rgba(139,92,246,.22), rgba(34,211,238,.14)); }
.btn.ghost{ background: rgba(255,255,255,.03); }

.menu{ position:relative; }
.menu-panel{
  position:absolute;
  right:0;
  top:calc(100% + 10px);
  min-width: 220px;
  padding: 10px;
  border-radius: 14px;
  border:1px solid var(--border);
  background: rgba(15,18,32,.92);
  box-shadow: var(--shadow);
  display:none;
}
.menu.open .menu-panel{ display:block; }

.menu-item{ display:block; width:100%; text-align:left; padding: 10px 10px; border-radius: 10px; color:var(--text); text-decoration:none; border:0; background:transparent; cursor:pointer; }
.menu-item:hover{ background: rgba(255,255,255,.06); }
.menu-muted{ padding: 8px 10px; color: var(--muted); font-size: 12px; }

.flash{ margin-top: 14px; padding: 12px 14px; border-radius: 14px; border:1px solid var(--border); background: rgba(255,255,255,.04); color: var(--text); }
.flash.error{ border-color: rgba(239,68,68,.35); }

.grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
  margin-top: 16px;
}

.card{
  grid-column: span 6;
  border-radius: var(--radius);
  border:1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.03));
  box-shadow: var(--shadow);
  overflow:hidden;
  transition: transform .18s ease, border-color .18s ease;
  display:flex;
  flex-direction:column;
}

.card:hover{ transform: translateY(-2px); border-color: rgba(255,255,255,.14); }

.card a{ display:block; padding: 18px; color:inherit; text-decoration:none; }
.card a.btn{
  align-self:flex-start;
  margin: auto 14px 14px;
  padding: 7px 10px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1;
  width: fit-content;
  background: rgba(255,255,255,.04);
}
.card a.btn:hover{ background: rgba(255,255,255,.07); }
.card h2{ margin:0 0 8px; font-size: 16px; font-weight:700; }
.card p{ margin:0; color: var(--muted); font-size: 13px; line-height: 1.5; }

.editorbar{ margin-top: 14px; display:none; gap: 10px; align-items:center; }
.editorbar.show{ display:flex; }

.editorbar [hidden]{
  display: none !important;
}

.editor{
  margin-top: 14px;
  display:none;
  border-radius: var(--radius);
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
  padding: 14px;
  box-shadow: var(--shadow);
}
.editor.show{ display:block; }

.table{ width:100%; border-collapse: separate; border-spacing: 0 10px; }
.table th{ text-align:left; font-size: 12px; color: var(--muted); font-weight:600; padding: 0 8px; }
.table td{ padding: 0 8px; }

.input{
  width:100%;
  height: 36px;
  border-radius: 12px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--text);
  padding: 0 10px;
}

.check{ transform: translateY(1px); }

@media (max-width: 820px){
  .card{ grid-column: span 12; }
}
