:root{
  --bg:#0B0F14;
  --surface:#0F172A;
  --surface-2:#111827;
  --border:#1F2937;
  --text:#E5E7EB;
  --muted:#9CA3AF;
  --muted-2:#6B7280;
  --accent:#22C55E;
  --warning:#F59E0B;
  --danger:#EF4444;
  --shadow:0 10px 30px rgba(0,0,0,.35);
  --radius:12px;
  --ring:0 0 0 3px rgba(34,197,94,.25);
  --font:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Inter,Arial;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  color:var(--text);
  background: radial-gradient(1200px 600px at 20% -20%, rgb(34 48 197 / 18%), transparent 60%), radial-gradient(900px 500px at 110% 0%, rgb(210 186 146 / 12%), transparent 55%), var(--bg);
  font-family:var(--font);
  line-height:1.5;
}

a{color:inherit;text-decoration:none}
a:hover{opacity:.92}

.container{max-width:1200px;margin:0 auto;padding:24px}
.page{min-height:100vh}

.card{
  background:linear-gradient(180deg, rgba(15,23,42,.95), rgba(17,24,39,.92));
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}
.card.pad{padding:18px}

.row{display:flex;gap:16px;flex-wrap:wrap}
.row.between{justify-content:space-between;align-items:center}

.grid{display:grid;gap:16px}
.grid.cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.grid.cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.grid.cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}
@media (max-width: 900px){
  .grid.cols-4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .grid.cols-3{grid-template-columns:repeat(2,minmax(0,1fr))}
  .grid.cols-2{grid-template-columns:repeat(1,minmax(0,1fr))}
}

.muted{color:var(--muted)}
.muted-2{color:var(--muted-2)}
.h1{font-size:22px;font-weight:700;letter-spacing:.2px;margin:0}
.h2{font-size:16px;font-weight:650;margin:0}
.small{font-size:13px}

.btn{
  border:1px solid var(--border);
  background:rgba(255,255,255,.03);
  color:var(--text);
  padding:10px 12px;
  border-radius:10px;
  cursor:pointer;
  transition:transform .08s ease, filter .15s ease, background .15s ease, border-color .15s ease;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  user-select:none;
}
.btn:hover{filter:brightness(1.06)}
.btn:active{transform:translateY(1px)}
.btn:focus{outline:none;box-shadow:var(--ring)}
.btn.primary{
  background:linear-gradient(180deg, rgba(34,197,94,.95), rgba(34,197,94,.75));
  border-color:rgba(34,197,94,.6);
  color:#06210f;
  font-weight:700;
}
.btn.ghost{background:transparent}
.btn.danger{background:rgba(239,68,68,.12);border-color:rgba(239,68,68,.35);color:#fecaca}

.input, select, textarea{
  width:100%;
  background:rgba(255,255,255,.03);
  border:1px solid var(--border);
  color:var(--text);
  padding:10px 12px;
  border-radius:10px;
  outline:none;
}
.input:focus, select:focus, textarea:focus{box-shadow:var(--ring);border-color:rgba(34,197,94,.5)}
textarea{min-height:90px;resize:vertical}
label{display:block;font-size:13px;color:var(--muted);margin:0 0 6px}

.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 10px;
  border-radius:999px;
  font-size:12px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.02);
  color:var(--muted);
}
.badge.ok{border-color:rgba(34,197,94,.35);background:rgba(34,197,94,.10);color:#bbf7d0}
.badge.warn{border-color:rgba(245,158,11,.4);background:rgba(245,158,11,.10);color:#fde68a}
.badge.bad{border-color:rgba(239,68,68,.4);background:rgba(239,68,68,.10);color:#fecaca}

.shell{
  display:grid;
  grid-template-columns:260px 1fr;
  min-height:100vh;
}
.sidebar{
  border-right:1px solid var(--border);
  background:linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01));
  position:sticky;
  top:0;
  height:100vh;
  padding:18px;
}
.brand{display:flex;align-items:center;gap:10px;margin-bottom:16px}
.brand .logo{
  width:36px;height:36px;border-radius:10px;
  background:linear-gradient(135deg, rgba(34,197,94,.95), rgba(34,197,94,.25));
  border:1px solid rgba(34,197,94,.4);
}
.nav{display:flex;flex-direction:column;gap:6px;margin-top:14px}
.nav a{
  padding:10px 10px;border-radius:10px;border:1px solid transparent;color:var(--muted);
  display:flex;align-items:center;gap:10px;
}
.nav a .ico{width:18px;display:inline-flex;align-items:center;justify-content:center;opacity:.9}
.nav a.active, .nav a:hover{
  color:var(--text);
  background:rgba(255,255,255,.03);
  border-color:var(--border);
}
.topbar{
  position:sticky;top:0;z-index:10;
  background:rgba(11,15,20,.75);
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--border);
}
.topbar .inner{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 24px}
.content{padding:24px}

.sidebar-toggle{display:none}
@media (max-width: 980px){
  .shell{grid-template-columns:1fr}
  .sidebar{
    position:fixed;left:0;top:0;bottom:0;z-index:40;width:280px;
    transform:translateX(-110%);
    transition:transform .2s ease;
  }
  .sidebar.open{transform:translateX(0)}
  .sidebar-toggle{display:inline-flex}
  .overlay{
    position:fixed;inset:0;background:rgba(0,0,0,.55);z-index:30;display:none
  }
  .overlay.show{display:block}
}

.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
}
.table th, .table td{
  padding:12px 12px;
  border-bottom:1px solid var(--border);
  vertical-align:top;
}
.table th{font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.08em}
.table tr:hover td{background:rgba(255,255,255,.02)}
.table-wrap{border:1px solid var(--border);border-radius:12px;overflow:hidden}

.tabs{display:flex;gap:8px;flex-wrap:wrap}
.tab{
  padding:8px 10px;border-radius:999px;border:1px solid var(--border);color:var(--muted);
  background:rgba(255,255,255,.02);cursor:pointer;font-size:13px
}
.tab.active{color:var(--text);border-color:rgba(34,197,94,.5);box-shadow:var(--ring)}

.modal{position:fixed;inset:0;display:none;align-items:center;justify-content:center;z-index:60}
.modal.show{display:flex}
.modal .backdrop{position:absolute;inset:0;background:rgba(0,0,0,.62)}
.modal .panel{position:relative;max-width:720px;width:calc(100% - 24px);max-height:calc(100% - 24px);overflow:auto}
.modal .panel.fullscreen{max-width:none;width:calc(100% - 24px);height:calc(100% - 24px);max-height:none}

.item-gallery-main{
  width:100%;
  aspect-ratio:16/10;
  border-radius:14px;
  overflow:hidden;
  border:1px solid var(--border);
  background:rgba(255,255,255,.02);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
  position:relative;
}
.item-gallery-main img{width:100%;height:100%;object-fit:cover;display:block}
.item-gallery-empty{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:16px}
.item-gallery-strip{
  display:flex;
  gap:10px;
  overflow-x:auto;
  padding-bottom:4px;
  scrollbar-width:thin;
}
.item-gallery-thumb{
  width:86px;
  min-width:86px;
  height:64px;
  border-radius:12px;
  overflow:hidden;
  border:1px solid var(--border);
  background:rgba(255,255,255,.02);
  padding:0;
  flex:none;
  opacity:.82;
}
.item-gallery-thumb.active{
  opacity:1;
  border-color:rgba(34,197,94,.6);
  box-shadow:var(--ring);
}
.item-gallery-thumb img{width:100%;height:100%;object-fit:cover;display:block}

.dropzone{
  border:1px dashed rgba(156,163,175,.5);
  border-radius:12px;
  padding:14px;
  background:rgba(255,255,255,.02);
}
.thumbs{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px}
@media (max-width: 900px){.thumbs{grid-template-columns:repeat(3,minmax(0,1fr))}}
.thumb{border:1px solid var(--border);border-radius:12px;overflow:hidden;background:rgba(255,255,255,.02)}
.thumb img{display:block;width:100%;height:100px;object-fit:cover}

.notice{
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px 14px;
  background:rgba(255,255,255,.02);
}
.notice.ok{border-color:rgba(34,197,94,.35);background:rgba(34,197,94,.10)}
.notice.bad{border-color:rgba(239,68,68,.35);background:rgba(239,68,68,.10)}
