:root { font: 16px/1.55 system-ui, "PingFang SC", "Microsoft YaHei", sans-serif; color: #172e26; background: #f3f6f3; }
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
:focus-visible { outline: 3px solid #4e8b67; outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.65rem, 4vw, 2.3rem); letter-spacing: -.025em; line-height: 1.25; }
h2 { font-size: 1.2rem; }
.subtle { color: #586b61; }
.error { color: #983e2d; }
.error:empty { display: none; }
.primary, .secondary { padding: .55rem 1rem; border-radius: .5rem; font-weight: 600; white-space: nowrap; }
.primary { border: 1px solid #256143; background: #256143; color: white; }
.primary:hover { background: #174e34; }
.secondary { background: white; color: #234637; border: 1px solid #d7e1da; }
.secondary:hover:not(:disabled) { background: #eef5ef; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 14.5rem minmax(0, 1fr); }
.rail { display: flex; flex-direction: column; gap: 2.2rem; background: #153b30; color: #f0f8f3; padding: 1.65rem 1rem; }
.brand { display: flex; align-items: center; gap: .7rem; font-weight: 700; }
.brand-mark { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: .75rem; background: #d5eadb; color: #153b30; font-weight: 750; flex: 0 0 auto; }
.brand small { display: block; color: #c8ded3; font-weight: 400; }
nav { display: flex; flex-direction: column; gap: .45rem; }
.rail button { display: block; color: inherit; background: transparent; border: 0; border-radius: .6rem; text-align: left; padding: .72rem .85rem; }
.rail button:hover, .rail button[aria-current] { background: #28574a; }
#logout { margin-top: auto; }
.content { margin: 0 auto; width: min(100%, 76rem); padding: 2.35rem clamp(1rem, 4vw, 3rem); }
.heading { display: flex; gap: 1rem; align-items: center; justify-content: space-between; margin-bottom: 1.45rem; }
.heading p { margin-top: .45rem; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 0 0 1rem; }
.metrics > div, .panel, .login-card { border: 1px solid #dce5dd; border-radius: .85rem; background: #fff; }
.metrics > div { padding: 1rem 1.2rem; }
.metrics dt { color: #52675b; }
.metrics dd { margin: .35rem 0 0; font-size: 2rem; line-height: 1.2; font-weight: 720; font-variant-numeric: tabular-nums; }
.panel { padding: 1.25rem; }
.panel header { display: flex; gap: .8rem; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
#chart { display: block; margin-top: 1.3rem; width: 100%; height: 15rem; }
.search, .pager { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; }
.search label { font-weight: 650; }
input { min-width: 0; border: 1px solid #becfc3; border-radius: .5rem; padding: .55rem .75rem; background: #fff; color: #152f24; }
.table-wrap { overflow: auto; margin-top: 1.15rem; }
table { border-collapse: collapse; width: 100%; text-align: left; }
th, td { padding: .7rem .65rem; border-bottom: 1px solid #e5ece6; white-space: nowrap; }
th { background: #edf4ee; color: #3e5849; font-size: .875rem; }
td { max-width: 17rem; overflow: hidden; text-overflow: ellipsis; }
.pager { justify-content: flex-end; margin-top: .9rem; }
.empty { padding: 1rem; text-align: center; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 1.2rem; }
.login-card { width: min(100%, 24rem); padding: 1.9rem; }
.login-card h1 { margin-top: .75rem; }
.login-card label { display: grid; gap: .35rem; margin: 1rem 0; }
.login-card button { width: 100%; }
.login-card .error { margin-top: .65rem; }
@media (max-width: 750px) {
  .shell { grid-template-columns: 1fr; }
  .rail { gap: .8rem; padding: .8rem 1rem; }
  nav { flex-direction: row; }
  .rail button { padding: .45rem .6rem; }
  #logout { align-self: flex-start; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .heading { align-items: flex-start; }
}
