/* git-boss 管理后台 —— 浅色主题 */
:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --border: #e3e6ea;
  --text: #24292f;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --ok: #16a34a;
  --warn: #d97706;
  --sidebar-bg: #1e2530;
  --sidebar-text: #c7cdd6;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--danger); margin-top: 10px; }

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 40px 36px; width: 360px; box-shadow: var(--shadow); text-align: center;
}
.login-logo { font-size: 42px; }
.login-card h1 { font-size: 20px; margin: 12px 0 4px; }
.login-card input {
  width: 100%; margin-top: 20px; padding: 10px 12px; font-size: 14px;
  border: 1px solid var(--border); border-radius: 8px; outline: none;
}
.login-card input:focus { border-color: var(--primary); }
.login-card .btn-block { margin-top: 14px; }

/* ---------- 布局 ---------- */
#main-view { display: flex; min-height: 100vh; }
.sidebar {
  width: 208px; flex-shrink: 0; background: var(--sidebar-bg); color: var(--sidebar-text);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar-brand { font-size: 17px; font-weight: 600; color: #fff; padding: 20px 18px; }
#nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; flex: 1; }
#nav a {
  color: var(--sidebar-text); text-decoration: none; padding: 9px 12px;
  border-radius: 8px; transition: background .15s;
}
#nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
#nav a.active { background: var(--primary); color: #fff; }
.sidebar-foot { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 8px; }

.content { flex: 1; padding: 24px 28px; max-width: 1400px; }

/* ---------- 通用组件 ---------- */
.page-title { font-size: 19px; font-weight: 600; margin-bottom: 4px; }
.page-sub { color: var(--muted); margin-bottom: 18px; }
.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px;
}
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type="text"], .toolbar input[type="search"], .toolbar select {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; outline: none; background: #fff;
}
.toolbar input:focus { border-color: var(--primary); }

.btn {
  display: inline-block; padding: 8px 14px; font-size: 13px; border-radius: 8px;
  border: 1px solid transparent; cursor: pointer; background: #eef0f3; color: var(--text);
  transition: filter .15s; text-decoration: none;
}
.btn:hover { filter: brightness(.96); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); filter: none; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; }

table.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl th { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.tbl tr:hover td { background: #fafbfc; }
.tbl .num { text-align: right; }
.avatar { width: 26px; height: 26px; border-radius: 50%; vertical-align: middle; margin-right: 8px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 500; }
.tag-green { background: #dcfce7; color: #15803d; }
.tag-gray { background: #eef0f3; color: #6b7280; }
.tag-red { background: #fee2e2; color: #b91c1c; }
.tag-blue { background: #dbeafe; color: #1d4ed8; }
.tag-amber { background: #fef3c7; color: #b45309; }
.row-actions { white-space: nowrap; }
.row-actions .btn { margin-right: 4px; }

/* ---------- 大屏 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
}
.stat-card .label { color: var(--muted); font-size: 12px; }
.stat-card .value { font-size: 30px; font-weight: 700; margin-top: 6px; }
.stat-card .sub { font-size: 12px; margin-top: 4px; color: var(--muted); }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }
.chart-box { position: relative; height: 300px; }
.feed-item { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; display: flex; gap: 8px; align-items: baseline; }
.feed-item:last-child { border-bottom: none; }
.feed-item .who { font-weight: 600; white-space: nowrap; }
.feed-item .when { color: var(--muted); font-size: 11px; white-space: nowrap; margin-left: auto; }

/* ---------- 分页 ---------- */
.pager { display: flex; gap: 8px; align-items: center; margin-top: 14px; justify-content: flex-end; }
.pager .muted { font-size: 12px; }

/* ---------- 弹窗 / 提示 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal {
  background: #fff; border-radius: 14px; padding: 24px; width: 440px; max-width: 92vw;
  box-shadow: 0 10px 40px rgba(0,0,0,.2);
}
.modal h3 { margin-bottom: 10px; }
.modal-body { color: var(--muted); line-height: 1.7; word-break: break-all; }
.modal-body b { color: var(--text); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  background: #111827; color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 13px; z-index: 200; box-shadow: 0 4px 16px rgba(0,0,0,.25); max-width: 70vw;
}
.toast.err { background: var(--danger); }

/* ---------- 加载 ---------- */
.loading { color: var(--muted); padding: 40px; text-align: center; }
.spinner {
  display: inline-block; width: 22px; height: 22px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite;
  margin-bottom: 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }
