* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #1B1830;
  --bg2: #141126;
  --card: #221E3D;
  --line: #2E2952;
  --line2: #3A3466;
  --text: #ECEAF6;
  --muted: #B9B2D9;
  --muted2: #8B84B0;
  --primary: #7B5CFF;
  --primary-h: #8E73FF;
  --accent: #FF8A00;
  --green: #4CB944;
  --red: #FF6B81;
  --blue: #6FB1FF;
  --ok: #2ECC71;
}
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}
a { color: inherit; text-decoration: none; }
code { font-family: Consolas, monospace; font-size: 12px; color: var(--muted); word-break: break-all; }

.topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 40;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg2);
  border-bottom: 1px solid var(--line);
}
.topbar-brand { font-weight: 700; font-size: 17px; }
.iconbtn {
  background: transparent;
  border: 1px solid var(--line2);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 15px;
}
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 300px;
  flex: 0 0 300px;
  background: var(--bg2);
  border-right: 1px solid var(--line);
  padding: 22px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand { font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 14px; }
.brand.center { margin-bottom: 6px; }
.nav { display: flex; flex-direction: column; gap: 6px; }
.shopbtn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  border-left: 4px solid transparent;
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
}
.shoplogo {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
}
.shopbtn:hover { background: #221E3D; border-left-color: #19C6A6; }
.shopbtn.active { background: #19C6A6; border-left-color: #fff; color: #fff; }
.stages { display: flex; flex-direction: column; gap: 4px; margin: 2px 0 6px; }
.navbtn {
  padding: 11px 14px;
  border-radius: 10px;
  border-left: 3px solid transparent;
  color: var(--muted);
  background: transparent;
}
.navbtn:hover { background: #221E3D; color: var(--text); border-left-color: #5A48C8; }
.navbtn.done { background: var(--green); border-left-color: #fff; color: #fff; font-weight: 600; }
.navbtn.active { background: var(--primary); border-left-color: #fff; color: #fff; font-weight: 600; }
.sidefoot { margin-top: auto; padding-top: 12px; }
.logout { color: var(--muted2); font-size: 14px; }
.logout:hover { color: var(--red); }

.content { flex: 1; padding: 30px 36px 24px; max-width: 980px; }
.pagehead { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.title { font-size: 26px; font-weight: 700; }
.crumb { color: var(--muted); }
.descr { margin-bottom: 14px; color: var(--muted); }
.descr summary {
  cursor: pointer;
  color: #8E73FF;
  font-weight: 600;
  font-size: 14px;
  list-style: none;
}
.descr summary::-webkit-details-marker { display: none; }
.descr[open] summary { margin-bottom: 6px; }
.descr p { margin: 6px 0; white-space: pre-line; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cardtitle { font-size: 17px; font-weight: 600; }
.hint { color: var(--muted); font-size: 14px; }
.hint.center, .center { text-align: center; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  background: var(--primary);
  transition: background 0.15s;
}
.btn:hover { background: var(--primary-h); }
.btn:disabled { background: #4A3F7A; color: var(--muted); cursor: default; }
.btn.big { padding: 14px 22px; font-size: 16px; font-weight: 700; }
.btn.full { width: 100%; }
.btn.secondary { background: #2A2547; color: var(--text); font-weight: 500; }
.btn.secondary:hover { background: #353059; }
.btn.secondary:disabled { background: #262243; color: #6E679A; }
.btn.accent { background: var(--accent); }
.btn.accent:hover { background: #FFA033; }
.btn.danger { background: #3A2430; color: var(--red); font-weight: 500; }
.btn.danger:hover { background: #4A2C3C; }
.btn.small { padding: 9px 14px; font-size: 14px; }

.input {
  background: #171430;
  border: 1px solid var(--line2);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  width: 100%;
  font-size: 15px;
}
.input:focus { outline: none; border-color: var(--primary); }
.input.big { padding: 13px 14px; font-size: 17px; }
.lbl { color: var(--muted); font-size: 14px; margin-top: 4px; }

.alert { border-radius: 10px; padding: 10px 14px; font-weight: 600; }
.alert.err { background: #3A2430; color: var(--red); }

.logbox {
  background: #141126;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #C9C4E8;
  font-family: Consolas, monospace;
  font-size: 13px;
  padding: 12px;
  min-height: 90px;
  max-height: 340px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.logbox:empty::before { content: attr(placeholder); color: #6E679A; }

.counters { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.counter { font-weight: 600; }
.counter.was { color: var(--red); }
.counter.now { color: var(--blue); }

.filelist { display: flex; flex-direction: column; gap: 6px; }
.filehead { color: var(--muted); font-size: 14px; font-weight: 600; }
.fileitem {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #1B1830;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
}
.fileitem:hover { border-color: var(--line2); background: #241F42; }
.fname { font-weight: 600; word-break: break-all; }
.fmeta { color: var(--muted2); font-size: 13px; }

.storecard {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #1B1830;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 18px;
}
.storelogo {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5A48C8, #19C6A6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
  color: #fff;
}
.storelogo.nfile { border-radius: 12px; font-size: 14px; }
.storelogoimg {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
}
.storeinfo { flex: 1; min-width: 0; }
.storename { font-weight: 600; }
.storemeta { color: var(--muted); font-size: 14px; word-break: break-all; }
.storestatus { color: var(--muted2); font-size: 14px; }
.storestatus.ok { color: var(--ok); font-weight: 600; }
.storestatus.bad { color: var(--red); font-weight: 600; }
.storebtns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.addstore summary { list-style: none; cursor: pointer; display: inline-flex; }
.addstore summary::-webkit-details-marker { display: none; }
.addstoreform { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; max-width: 460px; }

.backupday { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.backupdate { color: var(--muted); font-weight: 600; font-size: 14px; }
.backuprow {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: #1B1830;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
}
.backuprow .binfo { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 2px; }

.upload-label { position: relative; overflow: hidden; }
.upload-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.loginbody { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 20px; }
.logincard {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.logincard form { display: flex; flex-direction: column; gap: 12px; }

.scrim { display: none; }

@media (max-width: 900px) {
  .topbar { display: flex; }
  .layout { display: block; }
  .sidebar {
    position: fixed;
    z-index: 50;
    left: 0;
    top: 0;
    bottom: 0;
    width: 300px;
    max-width: 84vw;
    height: auto;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,0.5); }
  .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
  }
  .scrim.show { opacity: 1; pointer-events: auto; }
  .content { padding: 18px 14px 90px; }
  .title { font-size: 22px; }
  .card { padding: 16px 14px; }
  .storecard { flex-wrap: wrap; }
  .storeinfo { flex: 1 1 60%; }
  .storebtns { flex: 1 1 100%; justify-content: stretch; }
  .storebtns .btn, .storebtns a.btn { flex: 1; }
  .backuprow .btn { flex: 1 1 100%; }
  .counters { gap: 10px; }
  .counters .btn { flex: 1 1 100%; }
  .btn.big { padding: 14px 16px; font-size: 16px; }
}
