:root {
  --bg: #f6faf8; --ink: #16241d; --muted: #63776f; --line: #e4ede8;
  --brand: #2f9e74; --brand-ink: #1c7a56; --brand-soft: #e8f6ef;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.top {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1180px; margin: 0 auto; padding: 20px 22px 8px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 15px; }
.dot { width: 11px; height: 11px; border-radius: 50%;
  background: linear-gradient(135deg, #43b98b, #2f9e74); box-shadow: 0 0 0 4px rgba(47,158,116,.12); }
.top-actions { display: flex; gap: 8px; }
main { max-width: 1180px; margin: 0 auto; padding: 8px 22px 60px; }

.card { background: #fff; border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 18px 40px rgba(19,55,41,.06); }

.login { max-width: 420px; margin: 8vh auto 0; padding: 34px 32px 28px; }
.login h1 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.01em; }
.sub { margin: 0 0 22px; color: var(--muted); font-size: 13.5px; }
#login-form { display: grid; gap: 12px; }
input[type=password] {
  font-family: inherit; font-size: 15px; padding: 13px 14px;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fbfdfc; color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
input[type=password]:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(47,158,116,.12); }
.err { color: #c0392b; font-size: 13px; margin: 12px 0 0; }

.btn { appearance: none; cursor: pointer; font-family: inherit; font-size: 14.5px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 16px; border-radius: 12px; border: 1px solid transparent; text-decoration: none;
  transition: transform .18s var(--ease), box-shadow .22s, background .2s, border-color .2s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: linear-gradient(135deg, #43b98b, #2f9e74); color: #fff;
  box-shadow: 0 10px 22px rgba(47,158,116,.22); }
.btn.ghost { background: #fff; border-color: var(--line); color: #2c4038; }
.btn.ghost:hover { border-color: #bfe0cf; background: #fafdfb; }
.btn.sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin: 6px 0 20px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.kpi b { display: block; font-size: 26px; letter-spacing: -.02em; }
.kpi span { font-size: 12.5px; color: var(--muted); }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; margin-bottom: 22px; }
.tool-t { font-size: 13px; color: var(--muted); margin-right: 2px; }
.spacer { flex: 1; }
.hint { font-size: 12.5px; color: #93a8a0; }

.sec { font-size: 15px; margin: 26px 0 10px; letter-spacing: .01em; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { padding: 10px 12px; text-align: center; white-space: nowrap; border-bottom: 1px solid #f0f5f2; }
thead th { background: #f8fcfa; font-weight: 650; color: #35544a; position: sticky; top: 0; }
tbody th { text-align: left; font-weight: 600; color: #2c4038; background: #fbfdfc; }
tbody tr:hover td { background: #fafdfb; }
td .n { display: block; font-size: 11px; color: #9ab0a6; font-weight: 400; }
td.empty { color: #c3d2cb; }

.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.chart { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.chart h3 { margin: 0 0 10px; font-size: 13.5px; font-weight: 650; }
.bar-row { display: grid; grid-template-columns: 58px 1fr 42px; align-items: center; gap: 8px; margin-bottom: 7px; }
.bar-name { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 12px; background: #f1f6f3; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #6ecfa6, #2f9e74);
  width: 0; transition: width .7s var(--ease); }
.bar-val { font-size: 11.5px; color: #35544a; text-align: right; font-variant-numeric: tabular-nums; }

.foot { color: #93a8a0; font-size: 12.5px; margin-top: 18px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px);
  background: #16241d; color: #fff; font-size: 13px; padding: 10px 16px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 720px) {
  .kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
  main, .top { padding-left: 14px; padding-right: 14px; }
}

.back-link { display: inline-block; margin-top: 14px; font-size: 13px; color: var(--brand-ink); text-decoration: none; border-bottom: 1px dashed transparent; }
.back-link:hover { border-bottom-color: #cfe4d9; }
