/* =========================================================
   AETHER 卖家中心样式（admin.html）
   ========================================================= */

/* ---------- 登录页 ---------- */
.login-view {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(79, 70, 229, 0.12), transparent 60%),
    radial-gradient(700px 440px at 90% 110%, rgba(249, 115, 22, 0.10), transparent 60%),
    var(--brand-background);
}
.login-card {
  width: 100%; max-width: 400px; background: var(--brand-card);
  border: 1px solid var(--brand-border); border-radius: var(--brand-radius-xl);
  padding: 44px 40px 36px; text-align: center; box-shadow: var(--shadow-xl);
}
.login-logo {
  width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 16px;
  background: var(--brand-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.login-card h1 { font-size: 28px; margin: 0 0 6px; }
.login-sub { font-size: 13px; color: var(--brand-muted-foreground); margin: 0 0 28px; }
.login-form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.login-btn { width: 100%; justify-content: center; }
.login-error { color: var(--state-error); font-size: 13px; margin: 0; min-height: 18px; }
.login-back { display: inline-block; margin-top: 18px; font-size: 13px; color: var(--brand-muted-foreground); text-decoration: none; }
.login-back:hover { color: var(--brand-primary); }
.login-hint { margin-top: 10px; font-size: 12px; color: var(--brand-muted-foreground); }

/* ---------- 布局 ---------- */
.admin-wrap {
  display: grid; grid-template-areas: "side main";
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}
.admin-topbar {
  position: sticky; top: 0; z-index: 40;
  grid-area: main; grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--brand-border);
}
.admin-brand {
  width: 38px; height: 38px; border-radius: 12px; background: var(--brand-primary);
  color: #fff; display: flex; align-items: center; justify-content: center;
}
.topbar-link {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px;
  color: var(--brand-muted-foreground); background: none; border: none; cursor: pointer;
  text-decoration: none; padding: 6px 10px; border-radius: 8px;
}
.topbar-link:hover { color: var(--brand-primary); background: var(--brand-muted); }

.admin-side {
  grid-area: side; background: var(--brand-card); border-right: 1px solid var(--brand-border);
  padding: 18px 12px; display: flex; flex-direction: column; gap: 6px;
}
.side-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  border-radius: 12px; border: none; background: none; cursor: pointer;
  font-size: 14px; color: var(--brand-muted-foreground); text-align: left;
  transition: all 0.2s;
}
.side-item:hover { background: var(--brand-muted); color: var(--brand-foreground); }
.side-item.active { background: var(--brand-primary); color: #fff; }

.admin-main { grid-area: main; padding: 28px; max-width: 1100px; width: 100%; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- 看板 ---------- */
.stat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px;
}
.stat-card {
  background: var(--brand-card); border: 1px solid var(--brand-border);
  border-radius: var(--brand-radius-lg); padding: 20px;
}
.stat-label { font-size: 13px; color: var(--brand-muted-foreground); margin-bottom: 8px; }
.stat-value { font-family: 'Space Grotesk', sans-serif; font-size: 28px; font-weight: 700; }

.panel-card {
  background: var(--brand-card); border: 1px solid var(--brand-border);
  border-radius: var(--brand-radius-lg); padding: 22px;
}
.panel-title {
  font-family: 'Space Grotesk', sans-serif; font-size: 16px; font-weight: 600;
  display: flex; align-items: center; gap: 8px; margin: 0 0 18px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.panel-empty { text-align: center; color: var(--brand-muted-foreground); font-size: 13px; padding: 22px 0; margin: 0; }

.chart-list { display: flex; flex-direction: column; gap: 12px; }
.chart-row { display: grid; grid-template-columns: 120px 1fr 70px; align-items: center; gap: 12px; font-size: 13px; }
.chart-name { color: var(--brand-muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-bar { height: 10px; background: var(--brand-muted); border-radius: 999px; overflow: hidden; }
.chart-fill { height: 100%; background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent)); border-radius: 999px; }
.chart-num { font-weight: 600; text-align: right; }

/* ---------- 表格 ---------- */
.table-wrap { background: var(--brand-card); border: 1px solid var(--brand-border); border-radius: var(--brand-radius-lg); overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--brand-border); }
.data-table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--brand-muted-foreground); background: var(--brand-muted); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--brand-muted); }
.prow { display: flex; align-items: center; gap: 12px; }
.prow img { width: 42px; height: 42px; object-fit: cover; border-radius: 10px; }
.prow .pname { font-weight: 600; }
.prow .pdesc { font-size: 12px; color: var(--brand-muted-foreground); }

.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.tag-wearable { background: rgba(79,70,229,0.12); color: var(--brand-primary); }
.tag-home { background: rgba(16,185,129,0.12); color: #059669; }
.tag-travel { background: rgba(249,115,22,0.14); color: #ea580c; }
.status { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.status-pending { background: rgba(245,158,11,0.15); color: #b45309; }
.status-shipped { background: rgba(79,70,229,0.12); color: var(--brand-primary); }
.status-done { background: rgba(16,185,129,0.14); color: #059669; }
.status-cancel { background: rgba(239,68,68,0.12); color: #dc2626; }

.row-actions { display: flex; gap: 8px; }
.icon-btn { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--brand-border); background: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--brand-muted-foreground); transition: all 0.2s; }
.icon-btn:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.icon-btn.danger:hover { border-color: var(--state-error); color: var(--state-error); }
.estatus { border: 1px solid var(--brand-border); background: var(--brand-card); border-radius: 8px; padding: 6px 10px; font-size: 13px; cursor: pointer; }

/* ---------- 弹窗 ---------- */
.amodal { position: fixed; inset: 0; z-index: 300; background: rgba(10,10,10,0.45); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; padding: 20px; }
.amodal.open { display: flex; }
.amodal-card { background: var(--brand-card); border-radius: var(--brand-radius-lg); width: 100%; max-width: 520px; padding: 26px; box-shadow: var(--shadow-xl); }
.amodal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.amodal-head .panel-title { margin: 0; }
.modal-x { width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--brand-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--brand-muted-foreground); }
.modal-x:hover { color: var(--brand-foreground); }
.amodal-form { display: flex; flex-direction: column; gap: 14px; }
.amodal-form label { font-size: 13px; color: var(--brand-muted-foreground); display: flex; flex-direction: column; gap: 6px; }
.amodal-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.amodal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 6px; }
.form-error { color: var(--state-error); font-size: 13px; margin: 0; min-height: 18px; }

/* ---------- 表单输入（对齐商城） ---------- */
.form-input {
  width: 100%; padding: 12px 14px; border-radius: var(--brand-radius-md);
  border: 1px solid var(--brand-input); background: var(--brand-card); color: var(--brand-foreground);
  font-size: 14px; outline: none; font-family: inherit;
}
.form-input:focus { border-color: var(--brand-ring); box-shadow: 0 0 0 3px rgba(79,70,229,0.12); }

/* ---------- Toast ---------- */
#toastContainer { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast { display: flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 999px; background: var(--surface-dark); color: var(--surface-dark-foreground); font-size: 13px; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(-12px); transition: all 0.3s cubic-bezier(0.2,0.8,0.2,1); pointer-events: none; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success i { color: var(--state-success); }

/* ---------- 响应式 ---------- */
@media (max-width: 820px) {
  .admin-wrap { grid-template-areas: "main" "side"; grid-template-columns: 1fr; }
  .admin-side { flex-direction: row; border-right: none; border-bottom: 1px solid var(--brand-border); overflow-x: auto; }
  .side-item { white-space: nowrap; }
  .admin-main { padding: 18px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .amodal-cols { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .panel-head { flex-direction: column; align-items: flex-start; gap: 12px; }
}