:root{
  --bg:#f4f6f8;
  --panel:#ffffff;
  --text:#1f2937;
  --muted:#6b7280;
  --border:#e5e7eb;
  --sidebar:#1f2d3d;
  --sidebarText:#cbd5e1;
  --sidebarActive:#20a53a;
  --shadow:0 10px 25px rgba(16,24,40,.06);
  --sidebarWidth:230px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  color:var(--text);
  background:var(--bg);
}
a{color:inherit;text-decoration:none}

.admin-app{
  min-height:100vh;
}

.admin-sidebar{
  width:var(--sidebarWidth);
  background:var(--sidebar);
  color:var(--sidebarText);
  display:flex;
  flex-direction:column;
  position:fixed;
  left:0;
  top:0;
  bottom:0;
  overflow:auto;
}

.admin-brand{
  display:flex;
  align-items:center;
  gap:12px;
  padding:16px 14px;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.admin-brand__logo{
  width:38px;
  height:38px;
  border-radius:8px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(255,255,255,.08);
  color:#fff;
  font-weight:700;
}
.admin-brand__title{color:#fff;font-weight:700;line-height:1}
.admin-brand__sub{font-size:12px;color:rgba(203,213,225,.8);margin-top:4px}

.admin-menu{padding:10px 8px 18px}
.admin-menu__item{
  display:flex;
  align-items:center;
  height:38px;
  padding:0 12px;
  border-radius:8px;
  color:rgba(203,213,225,.92);
}
.admin-menu__item:hover{background:rgba(255,255,255,.06)}
.admin-menu__item.is-active{
  background:rgba(32,165,58,.16);
  color:#eaffef;
  border:1px solid rgba(32,165,58,.25);
}

.admin-menu__group{margin-top:10px}

.admin-tree{
  padding:6px 4px 12px;
}
.admin-tree__group{
  margin-top:6px;
}
.admin-tree__toggle{
  width:100%;
  display:flex;
  align-items:center;
  height:36px;
  padding:0 6px;
  border-radius:10px;
  background:transparent;
  border:1px solid transparent;
  color:#fff;
  font-weight:600;
  font-size:13px;
  text-align:left;
  cursor:pointer;
}
.admin-tree__toggle:hover{
  background:rgba(255,255,255,.06);
}
.admin-tree__group.is-selected .admin-tree__toggle{
  background:rgba(255,255,255,.06);
}

.admin-tree__caret{
  width:22px;
  height:26px;
  border-radius:8px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0;
  color:rgba(203,213,225,.85);
}
.admin-tree__caret::before{
  content:"▸";
  display:inline-block;
  transform:rotate(90deg);
  transition:transform .12s ease;
}
.admin-tree__group.is-open .admin-tree__caret::before{
  transform:rotate(90deg);
}
.admin-tree__group:not(.is-open) .admin-tree__caret::before{
  transform:rotate(0deg);
}

.admin-tree__label{
  flex:1;
  height:26px;
  display:flex;
  align-items:center;
  padding:0 8px;
  border-radius:8px;
  color:rgba(255,255,255,.92);
}

.admin-tree__children{
  display:none;
  padding:4px 0 2px 30px;
}
.admin-tree__group.is-open .admin-tree__children{
  display:block;
}
.admin-tree__child{
  display:flex;
  align-items:center;
  height:34px;
  padding:0 10px;
  margin:4px 0;
  border-radius:8px;
  color:rgba(203,213,225,.92);
  font-size:13px;
}
.admin-tree__child:hover{background:rgba(255,255,255,.06)}
.admin-tree__child.is-active{
  background:rgba(32,165,58,.16);
  color:#eaffef;
  border:1px solid rgba(32,165,58,.25);
}

.admin-main{
  display:flex;
  flex-direction:column;
  min-width:0;
  margin-left:var(--sidebarWidth);
  min-height:100vh;
}

.admin-topbar{
  height:56px;
  background:var(--panel);
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 18px;
}
.admin-topbar__title{font-weight:700}
.admin-topbar__meta{font-size:12px;color:var(--muted)}

.admin-content{
  padding:18px;
}

.admin-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}

.admin-card{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:12px;
  box-shadow:var(--shadow);
}
.admin-card__title{
  padding:14px 14px 10px;
  border-bottom:1px solid var(--border);
  font-weight:700;
}
.admin-card__body{padding:14px}

.admin-muted{color:var(--muted);font-size:13px}

.admin-actions{display:flex;gap:10px;flex-wrap:wrap}
.admin-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:34px;
  padding:0 12px;
  border-radius:10px;
  border:1px solid rgba(32,165,58,.25);
  background:var(--sidebarActive);
  color:#fff;
  font-weight:600;
  font-size:13px;
}
.admin-btn:hover{filter:brightness(1.03)}
.admin-btn--ghost{
  background:transparent;
  color:var(--sidebarActive);
}
.admin-btn--ghost:hover{background:rgba(32,165,58,.08)}

.admin-kv__row{
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px 0;
  border-bottom:1px dashed var(--border);
}
.admin-kv__row:last-child{border-bottom:none}
.admin-kv__key{width:120px;color:var(--muted);font-size:13px}
.admin-kv__val{font-weight:600}

.admin-split{
  display:flex;
  gap:14px;
  align-items:flex-start;
}

.admin-subnav{
  width:190px;
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:12px;
  box-shadow:var(--shadow);
  padding:10px;
}
.admin-subnav__item{
  display:flex;
  align-items:center;
  height:38px;
  padding:0 12px;
  border-radius:10px;
  color:var(--text);
}
.admin-subnav__item:hover{background:rgba(31,45,61,.06)}
.admin-subnav__item.is-active{
  background:rgba(32,165,58,.12);
  color:#0f7f26;
  border:1px solid rgba(32,165,58,.25);
}

.admin-panels{flex:1;min-width:0}
.admin-panel{display:none}
.admin-panel.is-active{display:block}

.admin-empty{
  height:220px;
  border:1px dashed var(--border);
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#9ca3af;
  background:rgba(255,255,255,.6);
}
.admin-empty--page{
  height:calc(100vh - 160px);
}

@media (max-width: 980px){
  .admin-grid{grid-template-columns:1fr}
  .admin-split{flex-direction:column}
  .admin-subnav{width:100%}
}
