:root{
  --bg:#0b1220;
  --card:#111827;
  --muted:#9ca3af;
  --text:#e5e7eb;
  --line:#243043;
  --accent:#60a5fa;
  --danger:#ef4444;
  --shadow: 0 8px 22px rgba(0,0,0,.35);
  --r:18px;
}
*{box-sizing:border-box}
body{
  margin:0;
  background:linear-gradient(180deg,#070b14, #0b1220);
  color:var(--text);
  font-family:system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}
.header{
  display:flex; align-items:center; justify-content:space-between;
  padding:18px 18px 6px;
}
h1{margin:0;font-size:26px}
.sub{margin:6px 0 0;color:var(--muted)}
.header-actions{display:flex; gap:10px; align-items:center}
.grid{
  padding:12px 18px 24px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
}
.card{
  background:rgba(17,24,39,.92);
  border:1px solid var(--line);
  border-radius:var(--r);
  box-shadow:var(--shadow);
  padding:14px;
}
.card.span2{grid-column: span 2;}
.cardhead{display:flex; align-items:center; justify-content:space-between}
h2{margin:0 0 10px; font-size:18px}
.form .field{margin-top:10px}
label{display:block; font-size:13px; color:var(--muted); margin-bottom:6px}
label.inlinecheck{margin-top:8px; color:var(--text); font-size:13px}
input, select, textarea{
  width:100%;
  padding:10px 10px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#0b1220;
  color:var(--text);
  outline:none;
}
textarea{resize:vertical}
input:focus, select:focus, textarea:focus{border-color:rgba(96,165,250,.85); box-shadow:0 0 0 3px rgba(96,165,250,.15)}
.row{display:flex; gap:10px}
.row > .field{flex:1}
.actions{margin-top:12px}
button{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(96,165,250,.35);
  background:rgba(96,165,250,.18);
  color:var(--text);
  cursor:pointer;
}
button:hover{border-color:rgba(96,165,250,.65)}
button:disabled{opacity:.45; cursor:not-allowed}
button.ghost{
  background:transparent;
  border-color:var(--line);
}
button.danger{border-color:rgba(239,68,68,.6); background:rgba(239,68,68,.15)}
button.small{padding:6px 10px; border-radius:10px; font-size:12px}
.filelike{display:inline-flex; align-items:center; gap:8px; user-select:none}
.toolbar{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  margin:10px 0 8px;
}
.toolbar input{flex:1; min-width:220px}
.list{display:flex; flex-direction:column; gap:10px}
.item{
  border:1px solid var(--line);
  border-radius:14px;
  padding:10px;
  background:rgba(11,18,32,.65);
}
.itemtop{display:flex; justify-content:space-between; gap:10px}
.itemtitle{font-weight:650}
.itemmeta{color:var(--muted); font-size:13px; margin-top:4px; line-height:1.3}
.itemactions{display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end}
.badge{
  display:inline-flex; align-items:center; gap:6px;
  padding:3px 8px;
  border-radius:999px;
  border:1px solid var(--line);
  color:var(--muted);
  font-size:12px;
}
.preview{
  margin-top:12px;
  padding:10px;
  border:1px dashed rgba(156,163,175,.35);
  border-radius:14px;
  color:var(--text);
}
.preview .muted{color:var(--muted)}
.colors{
  display:grid;
  grid-template-columns: repeat(4, minmax(120px,1fr));
  gap:6px;
}
.colors label{display:flex; align-items:center; gap:8px; margin:0; color:var(--text); font-size:13px}
.skurow{display:flex; gap:8px; align-items:center}
.skurow input{flex:1}
.imgPreview{margin-top:10px; display:flex; gap:10px; align-items:center}
.imgPreview img{max-height:70px; border-radius:12px; border:1px solid var(--line)}
.footer{
  padding:10px 18px 18px;
  color:var(--muted);
  font-size:12px;
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.ver{opacity:.85}
#splash{
  position:fixed; inset:0;
  background: radial-gradient(circle at 50% 40%, #0f1a30, #070b14 60%);
  display:flex; align-items:center; justify-content:center;
  z-index:9999; overflow:hidden;
  opacity:1;
  transition: opacity .6s ease, transform .6s ease;
}
#splash.fade-out{
  opacity:0;
  transform: scale(1.05);
  pointer-events:none;
}
#sparkleCanvas{
  position:absolute; inset:0;
  width:100%; height:100%;
}
.splash-content{
  position:relative;
  text-align:center;
  color:#e5e7eb;
  animation: floatIn .8s ease;
}
.splash-content img{ width:96px; margin-bottom:20px; }
.splash-content h1{ margin:0; font-size:22px; }
.splash-content p{ margin-top:8px; color:#9ca3af; }
@keyframes floatIn{
  from{ transform: translateY(20px); opacity:0; }
  to{ transform: translateY(0); opacity:1; }
}
@media (max-width: 980px){
  .grid{grid-template-columns:1fr}
  .card.span2{grid-column:span 1}
  .colors{grid-template-columns: repeat(2, minmax(120px,1fr));}
}


/* Auth overlay */
.overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:9998;
  padding:16px;
}
.authcard{
  width:min(520px, 100%);
}


/* === UX polish additions === */
.spinner{
  width:14px;height:14px;border:2px solid rgba(255,255,255,0.35);
  border-top-color:rgba(255,255,255,0.95);
  border-radius:50%;
  display:inline-block;
  margin-left:8px;
  vertical-align:middle;
  animation:spin .8s linear infinite;
}
@keyframes spin{ to{ transform:rotate(360deg); } }
.hidden{ display:none !important; }

.status-success{ color:#4caf50; }
.status-error{ color:#ff7070; }

.toolbar.views{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin: 10px 0;
}

.list{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top: 12px;
}
.rowcard{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  border-radius:12px;
  background: rgba(255,255,255,0.06);
}
.rowcard-title{ font-weight:700; }
.rowcard-sub{ opacity:.85; font-size:.9rem; }
.rowcard-price{ font-weight:700; text-align:right; }

.preview{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}
.kpi{
  background: rgba(255,255,255,0.06);
  border-radius:12px;
  padding:10px 12px;
  min-width:140px;
}
.kpi-title{ opacity:.8; font-size:.85rem; }
.kpi-val{ font-size:1.1rem; font-weight:800; }

.gallery{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.galleryCard{
  background: rgba(255,255,255,0.06);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0,0,0,0.25);
  transition: transform .15s ease;
  cursor: pointer;
}
.galleryCard:hover{ transform: translateY(-4px); }
.galleryImage{
  width:100%;
  height:160px;
  object-fit:cover;
  background:#222;
}
.galleryInfo{ padding:10px; }
.galleryTitle{ font-weight:800; }
.galleryMeta{ opacity:.8; font-size:.85rem; }

.collectionsGrid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.collectionCard{
  background: rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 12px;
  cursor: pointer;
}
.collectionMeta{ opacity:.8; margin-top:4px; }
.collectionPreview{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 10px;
}
.collectionPreview img{
  width: 100%;
  height: 50px;
  object-fit: cover;
  border-radius: 8px;
  background:#222;
}

.modal{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,0.6);
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 16px;
  z-index: 9999;
}
.modalContent{
  width:min(720px, 96vw);
  max-height: 90vh;
  overflow:auto;
  background: rgba(20, 18, 28, 0.96);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 16px;
}
.modalHead{ display:flex; justify-content:space-between; align-items:center; gap: 12px; }

.collectionRow{
  display:flex;
  justify-content:space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.collectionRowTitle{ font-weight:800; }
.collectionRowSub{ opacity:.8; font-size:.85rem; }

.timelineBoard{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 16px;
}
.timelineColumn{
  background: rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 10px;
  min-height: 260px;
}
.timelineList{
  display:flex;
  flex-direction:column;
  gap: 8px;
  margin-top: 8px;
}
.timelineCard{
  background: rgba(255,255,255,0.09);
  border-radius: 12px;
  padding: 10px;
  cursor: grab;
  transition: transform .12s ease, opacity .12s ease;
}
.timelineCard:hover{ transform: translateY(-2px); }
.timelineCard.dragging{ opacity: .6; }
.timelineColumn.dragTarget{
  outline: 2px dashed rgba(212,175,55,0.85);
  outline-offset: 4px;
}

.colorChip{
  display:flex;
  align-items:center;
  gap:6px;
  padding:4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  cursor:pointer;
  user-select:none;
}
#colorContainer{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
  margin-top: 6px;
}
.colorChip input{ display:none; }
.colorChip:hover{ background: rgba(255,255,255,0.12); }
.colorChip input:checked + .swatch{ outline:2px solid rgba(212,175,55,0.9); outline-offset:2px; }
.swatch{ width:14px; height:14px; border-radius:50%; border:1px solid rgba(0,0,0,0.35); }

/* swatch colors */
.swatch-red{ background:#d22; }
.swatch-orange{ background:#f68000; }
.swatch-yellow{ background:#ffd000; }
.swatch-blue{ background:#2a6cff; }
.swatch-indigo{ background:#4b0082; }
.swatch-purpleviolet{ background:#7c2cff; }
.swatch-black{ background:#000; }
.swatch-white{ background:#fff; border:1px solid #aaa; }
.swatch-gray{ background:#888; }
.swatch-copper{ background:#b87333; }
.swatch-silver{ background:#c0c0c0; }
.swatch-gold{ background:#d4af37; }
.swatch-brown{ background:#5a3b1c; }
.swatch-teal{ background:#008080; }
.swatch-pink{ background:#ff5fa2; }

.skuWarning{
  font-size: .85rem;
  color: #ff7070;
  margin-top: 6px;
}
.charts{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.card.mini{
  padding: 12px;
}
