:root {
  --font-body: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  --font-display: "Segoe UI", "Microsoft YaHei", sans-serif;
  --color-bg: #f4f6f8;
  --color-panel: #ffffff;
  --color-panel-strong: #101820;
  --color-text: #1e2933;
  --color-muted: #697586;
  --color-line: #d9e0e8;
  --color-primary: #0f6b5f;
  --color-primary-strong: #094b43;
  --color-accent: #c2872d;
  --color-danger: #b42318;
  --color-success: #087443;
  --color-warning: #b54708;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 10px 24px rgba(16, 24, 40, 0.1);
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--color-text);
  background:
    linear-gradient(90deg, rgba(16, 24, 32, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(16, 24, 32, 0.04) 1px, transparent 1px),
    var(--color-bg);
  background-size: 28px 28px;
  font-family: var(--font-body);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(320px, 430px) 1fr;
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 42px;
  background: var(--color-panel);
  border-right: 1px solid var(--color-line);
}

.login-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.15;
}

.login-subtitle,
.muted {
  color: var(--color-muted);
}

.login-board {
  display: grid;
  align-content: center;
  padding: 56px;
  color: #eef4f3;
  background:
    linear-gradient(135deg, rgba(15, 107, 95, 0.92), rgba(16, 24, 32, 0.96)),
    repeating-linear-gradient(90deg, transparent 0, transparent 38px, rgba(255, 255, 255, 0.08) 38px, rgba(255, 255, 255, 0.08) 39px);
}

.board-kpi {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-lg);
  max-width: 760px;
}

.board-kpi div {
  min-height: 110px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
}

.board-kpi strong {
  display: block;
  margin-bottom: 12px;
  font-size: 26px;
}

.form-stack {
  display: grid;
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

.field {
  display: grid;
  gap: 6px;
}

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

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--color-line);
  border-radius: 6px;
  background: #fff;
  color: var(--color-text);
}

.field textarea {
  min-height: 84px;
  resize: vertical;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 216px 1fr;
}

.sidebar {
  padding: 22px 16px;
  color: #f3f7f6;
  background: var(--color-panel-strong);
}

.brand {
  padding: 0 6px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.brand p {
  margin: 8px 0 0;
  color: #aebbc5;
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.nav button {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 6px;
  text-align: left;
  color: #cbd5df;
  background: transparent;
}

.nav button.active,
.nav button:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.11);
}

.main {
  min-width: 0;
  padding: 22px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.topbar h2 {
  margin: 0;
  font-size: 24px;
}

.user-box {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr 140px 120px auto auto;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.toolbar input,
.toolbar select {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--color-line);
  border-radius: 6px;
  background: #fff;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.stat-card,
.panel {
  background: var(--color-panel);
  border: 1px solid var(--color-line);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.stat-card {
  padding: 16px;
}

.stat-card span {
  display: block;
  color: var(--color-muted);
  font-size: 13px;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
}

.panel {
  overflow: hidden;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: #44515f;
  background: #eef2f5;
  font-weight: 600;
  white-space: nowrap;
}

tr:hover td {
  background: #fbfcfd;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 4px;
  color: var(--color-primary-strong);
  background: #dff4ef;
  font-size: 12px;
}

.tag.warn {
  color: var(--color-warning);
  background: #fff1d6;
}

.tag.dark {
  color: #344054;
  background: #eef2f5;
}

.actions {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 6px;
  color: #fff;
  background: var(--color-primary);
  transition: transform 140ms ease, background 140ms ease;
}

.btn:hover {
  background: var(--color-primary-strong);
}

.btn:active {
  transform: translateY(1px);
}

.btn.secondary {
  color: var(--color-text);
  background: #e8edf1;
}

.btn.secondary:hover {
  background: #dce4ea;
}

.btn.danger {
  background: var(--color-danger);
}

.btn.link {
  min-height: 30px;
  padding: 0 8px;
  color: var(--color-primary);
  background: transparent;
}

.pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--space-md);
  padding: 12px 14px;
  background: #fff;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(16, 24, 32, 0.48);
  z-index: 10;
}

.modal {
  width: min(780px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
}

.modal header,
.modal footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 16px 18px;
  border-bottom: 1px solid var(--color-line);
}

.modal footer {
  justify-content: flex-end;
  border-top: 1px solid var(--color-line);
  border-bottom: 0;
}

.modal header h3 {
  margin: 0;
  font-size: 18px;
}

.modal-body {
  padding: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md);
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.message {
  min-height: 22px;
  margin-top: 12px;
  color: var(--color-danger);
  font-size: 14px;
}

.empty {
  padding: 48px 16px;
  text-align: center;
  color: var(--color-muted);
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .login-shell,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .login-board,
  .sidebar {
    display: none;
  }

  .toolbar,
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .main,
  .login-panel {
    padding: 16px;
  }

  .toolbar,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}
