:root{
  --bg: #0b1220;
  --panel: rgba(255,255,255,.06);
  --panel2: rgba(255,255,255,.08);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.70);
  --border: rgba(255,255,255,.12);
  --accent: #6ee7ff;
  --accent2: #a78bfa;
  --danger: #fb7185;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 16px;
  --radius-sm: 12px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(1200px 900px at 15% 10%, rgba(110,231,255,.12), transparent 55%),
    radial-gradient(900px 700px at 85% 0%, rgba(167,139,250,.12), transparent 55%),
    linear-gradient(180deg, #070b14, var(--bg));
}

a{color:inherit; text-decoration:none}
a:hover{text-decoration:underline}
.mono{font-family: var(--mono)}

.topbar{
  position:sticky; top:0; z-index:20;
  backdrop-filter: blur(12px);
  background: rgba(7,11,20,.72);
  border-bottom: 1px solid var(--border);
}
.topbar-inner{
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}
.brand{
  display:flex;
  align-items:center;
  gap:12px;
  font-weight: 700;
  letter-spacing:.2px;
}
.brand-badge{
  width:34px;height:34px;border-radius:11px;
  background: linear-gradient(135deg, rgba(110,231,255,.95), rgba(167,139,250,.95));
  box-shadow: var(--shadow);
}
.nav{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.nav a{
  padding: 8px 12px;
  border-radius: 12px;
  color: var(--muted);
  border: 1px solid transparent;
}
.nav a[aria-current="page"]{
  color: var(--text);
  background: var(--panel);
  border-color: var(--border);
}
.nav a:hover{
  background: var(--panel);
  border-color: var(--border);
  text-decoration:none;
  color: var(--text);
}

.topbar-meta{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.container{
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 18px 44px;
}

.card{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-header{
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--border);
}
.card-body{padding: 18px}

.title{
  margin: 0;
  font-size: 20px;
  letter-spacing: .2px;
}
.subtitle{
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.toolbar .left, .toolbar .right{display:flex; gap:10px; align-items:center; flex-wrap:wrap}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: var(--text);
  font-weight: 600;
  cursor:pointer;
  user-select:none;
}
.btn:hover{background: rgba(255,255,255,.10)}
.btn.primary{
  background: linear-gradient(135deg, rgba(110,231,255,.22), rgba(167,139,250,.22));
  border-color: rgba(110,231,255,.35);
}
.btn[aria-pressed="true"]{
  background: linear-gradient(135deg, rgba(110,231,255,.22), rgba(167,139,250,.22));
  border-color: rgba(110,231,255,.35);
}
.btn.danger{
  border-color: rgba(251,113,133,.45);
  background: rgba(251,113,133,.12);
}
.btn.danger:hover{background: rgba(251,113,133,.18)}
.btn .kbd{
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 10px;
}

.input, .textarea{
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(3,6,12,.55);
  color: var(--text);
  outline: none;
}
.input:focus, .textarea:focus{
  border-color: rgba(110,231,255,.55);
  box-shadow: 0 0 0 4px rgba(110,231,255,.08);
}
.input.invalid, .textarea.invalid{
  border-color: rgba(251,113,133,.55);
  box-shadow: 0 0 0 4px rgba(251,113,133,.10);
}
.textarea{min-height: 110px; resize: vertical}

.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 840px){
  .grid{grid-template-columns: 1fr}
}

label{display:block; margin: 0 0 6px; color: var(--muted); font-size: 13px}
.field{display:flex; flex-direction:column; gap:6px}
.field-actions{display:flex; gap:10px; align-items:center; justify-content:flex-start; flex-wrap:wrap}
.hint{font-size: 12px; color: var(--muted)}

.table-wrap{
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: stable both-edges;
  scrollbar-width: thin;
}
/* Visible horizontal scrollbar in WebKit (Chrome/Safari) */
.table-wrap::-webkit-scrollbar{
  height: 10px;
}
.table-wrap::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.22);
  border-radius: 999px;
}
.table-wrap::-webkit-scrollbar-track{
  background: rgba(255,255,255,.06);
  border-radius: 999px;
}
.table-scrollbar{
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  height: 12px;
  margin-top: 6px;
  scrollbar-gutter: stable both-edges;
  scrollbar-width: thin;
}
.table-scrollbar-inner{
  height: 1px;
}
.table-scrollbar::-webkit-scrollbar{
  height: 10px;
}
.table-scrollbar::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.22);
  border-radius: 999px;
}
.table-scrollbar::-webkit-scrollbar-track{
  background: rgba(255,255,255,.06);
  border-radius: 999px;
}
table{width: max-content; min-width:100%; border-collapse: collapse}
th,td{padding: 12px 12px; border-bottom: 1px solid var(--border); text-align:left; white-space:nowrap}
th{color: var(--muted); font-size: 12px; letter-spacing: .4px; text-transform: uppercase}
td.mono{font-family: var(--mono)}
tr:hover td{background: rgba(255,255,255,.03)}
.row-actions{display:flex; gap:8px; justify-content:flex-end}
.table-thumb{
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 1px solid var(--border);
  object-fit: cover;
  background: rgba(3,6,12,.55);
  display:block;
}

.swatch{
  display:inline-block;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid var(--border);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.15);
}

.spinner{
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.18);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

@keyframes spin{
  to { transform: rotate(360deg); }
}

.tree-cell{
  display:flex;
  align-items:center;
  gap:8px;
}
.tree-toggle{
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: var(--text);
  font-size: 12px;
  line-height: 1;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.tree-toggle:disabled{
  opacity: .45;
  cursor: default;
}

.kv{display:grid; gap: 8px}
.kv-row{
  display:grid;
  grid-template-columns: 140px 1fr;
  gap: 10px;
  align-items: start;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.kv-row:last-child{border-bottom:0}
.kv-k{color: var(--muted); font-size: 12px}
.kv-v{min-width: 0}

.toast{
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 1000;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(3,6,12,.88);
  box-shadow: var(--shadow);
  color: var(--text);
}
.toast.error{
  border-color: rgba(251,113,133,.55);
  background: rgba(251,113,133,.14);
}
.toast.success{
  border-color: rgba(110,231,255,.35);
  background: rgba(110,231,255,.12);
}

.tile-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.tile{
  display:flex;
  flex-direction:column;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  overflow:hidden;
  box-shadow: var(--shadow);
  text-decoration:none;
}
.tile:hover{background: rgba(255,255,255,.08); text-decoration:none}
.tile-thumb{
  aspect-ratio: 4 / 3;
  background: rgba(3,6,12,.55);
  border-bottom: 1px solid var(--border);
}
.tile-thumb img{width:100%; height:100%; object-fit:cover; display:block; image-rendering:crisp-edges}
.tile-body{
  padding: 12px;
  display:flex;
  flex-direction:column;
  gap: 6px;
  min-height: 96px;
}
.tile-title{
  font-weight: 750;
  letter-spacing: .2px;
  line-height: 1.2;
}
.tile-sub{color: var(--muted); font-size: 12px}
.tile-meta{display:flex; gap:8px; flex-wrap:wrap; margin-top:auto}

.panel-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.profile{
  display:grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  align-items: start;
}
.profile-thumb{
  width: 92px;
  height: 92px;
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow:hidden;
  background: rgba(3,6,12,.55);
}
.profile-thumb img{width:100%; height:100%; object-fit:cover; display:block}
.profile-title{
  font-weight: 750;
  letter-spacing: .2px;
  line-height: 1.2;
}
.profile-sub{color: var(--muted); font-size: 12px; margin-top: 4px}
.profile-actions{display:flex; gap:10px; flex-wrap:wrap; margin-top: 10px}

.pill{
  display:inline-flex;
  align-items:center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.05);
  color: var(--muted);
  font-size: 12px;
}

.state{font-weight:700; color: rgba(255,255,255,.92)}
.state-approval{
  border-color: rgba(251,191,36,.55);
  background: rgba(251,191,36,.14);
}
.state-review{
  border-color: rgba(110,231,255,.45);
  background: rgba(110,231,255,.12);
}
.state-released{
  border-color: rgba(74,222,128,.50);
  background: rgba(74,222,128,.12);
}

.stepper{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin: 0 0 14px;
}
.step{
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  display:flex;
  align-items:center;
  gap: 10px;
}
.step .dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.35);
  background: transparent;
  flex: 0 0 auto;
}
.step .label{color: var(--muted); font-size: 13px; font-weight: 650}
.step.current{
  border-color: rgba(110,231,255,.40);
  background: rgba(110,231,255,.10);
}
.step.current .dot{border-color: rgba(110,231,255,.75); background: rgba(110,231,255,.25)}
.step.current .label{color: rgba(255,255,255,.92)}
.step.done{
  border-color: rgba(74,222,128,.38);
  background: rgba(74,222,128,.09);
}
.step.done .dot{border-color: rgba(74,222,128,.65); background: rgba(74,222,128,.22)}
.step.done .label{color: rgba(255,255,255,.86)}

.errors{
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(251,113,133,.42);
  background: rgba(251,113,133,.12);
}
.errors ul{margin: 8px 0 0; padding-left: 18px}

.footer{
  margin-top: 26px;
  color: rgba(255,255,255,.55);
  font-size: 12px;
  text-align:center;
}
