:root {
  --bg: #eef2f4;
  --panel: #ffffff;
  --sidebar: #111827;
  --sidebar-2: #1f2937;
  --line: #d7dde3;
  --text: #16202a;
  --muted: #667180;
  --accent: #2f855a;
  --accent-strong: #166534;
  --accent-soft: #dff3e8;
  --warn: #7a4f00;
  --warn-soft: #fff4d6;
  --success: #166534;
  --success-soft: #e6f4ea;
  --danger: #b42318;
  --danger-soft: #fde7e9;
  --info: #2563eb;
  --info-soft: #e8f0ff;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: linear-gradient(180deg, #f3f6f8 0%, #eef2f4 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

.layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  color: #f3f4f6;
  padding: 20px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand-copy strong,
.brand-copy span {
  display: block;
}

.brand-copy strong {
  font-size: 15px;
}

.brand-copy span {
  color: #c9d2dc;
  font-size: 12px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-link {
  display: block;
  padding: 9px 11px;
  border-radius: 6px;
  color: #d5dde6;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover,
.nav-link.is-active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

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

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.page-head-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.subtitle {
  margin: 6px 0 0;
  color: var(--muted);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metric,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 14px 16px;
  min-width: 0;
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.metric strong {
  display: block;
  font-size: 24px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.panel {
  padding: 14px 14px 8px;
  margin-bottom: 14px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.panel-copy {
  min-width: 0;
}

.panel-head h2 {
  margin: 0;
  font-size: 16px;
}

.panel-head p,
.panel-note {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.panel-link {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.workbench-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.workbench-grid.is-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.workbench-item {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
}

.workbench-item h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.workbench-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.meta-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.meta-list div {
  min-width: 0;
}

.meta-list dt {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.meta-list dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 960px;
  background: #fff;
}

th,
td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: #44505d;
  font-size: 12px;
  font-weight: 600;
}

td.num {
  text-align: right;
  white-space: nowrap;
}

td.wrap {
  white-space: normal;
}

tbody tr:hover {
  background: #f8fbfd;
}

.empty {
  color: var(--muted);
  text-align: center;
}

.empty-state {
  margin: 0;
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
  text-align: center;
  background: #fbfcfd;
}

.status-line {
  color: var(--muted);
  font-size: 13px;
}

.muted-text {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.pill-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 260px;
}

.status-pill,
.score-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: #344054;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  white-space: normal;
}

.status-pill.is-success {
  border-color: #8fc7a1;
  background: var(--success-soft);
  color: var(--success);
}

.status-pill.is-warning {
  border-color: #d89d2b;
  background: var(--warn-soft);
  color: var(--warn);
}

.status-pill.is-danger {
  border-color: #f6b7bd;
  background: var(--danger-soft);
  color: var(--danger);
}

.status-pill.is-info {
  border-color: #bed0ff;
  background: var(--info-soft);
  color: var(--info);
}

.score-pill {
  border-color: #8fc7a1;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
}

.score-stack {
  display: grid;
  min-width: 220px;
  gap: 7px;
}

.score-row {
  display: grid;
  grid-template-columns: 42px minmax(80px, 1fr) 54px;
  align-items: center;
  gap: 8px;
  color: #40505f;
  font-size: 12px;
}

.score-name,
.score-value {
  overflow-wrap: anywhere;
}

.score-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.score-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf2;
}

.score-fill {
  display: block;
  height: 100%;
  max-width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #4aa36f);
}

.action-forms {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inline-form {
  margin: 0;
}

.operation-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.operation-form label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

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

.operation-form textarea {
  resize: vertical;
}

.operation-form .checkbox-label {
  grid-template-columns: auto 1fr;
  align-items: center;
  color: var(--muted);
  font-weight: 600;
}

.operation-form .checkbox-label input {
  width: auto;
  min-height: auto;
  padding: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.compact-form {
  min-width: 220px;
  margin-top: 0;
}

button,
.text-button {
  max-width: 100%;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: normal;
  cursor: pointer;
}

button:hover,
.text-button:hover {
  border-color: #b7c4cf;
  background: #f8fafc;
}

.text-button.is-primary {
  border-color: #8fc7a1;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.text-button.is-muted {
  color: var(--muted);
}

.auth-page {
  min-height: 100vh;
  background: linear-gradient(180deg, #f3f6f8 0%, #e6edf0 100%);
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  width: min(100%, 390px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-panel h1 {
  margin: 0 0 18px;
  font-size: 24px;
  line-height: 1.25;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 13px;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 600;
}

.auth-form input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.auth-form input:focus {
  border-color: #8fc7a1;
  outline: 3px solid rgba(47, 133, 90, 0.14);
}

.auth-form .remember-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.auth-form .remember-row input {
  width: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
}

.primary-button {
  width: 100%;
  min-height: 40px;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.primary-button:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.notice {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
}

.notice.is-danger {
  border-color: #f6b7bd;
  background: var(--danger-soft);
  color: var(--danger);
}

.notice.is-success {
  border-color: #8fc7a1;
  background: var(--success-soft);
  color: var(--success);
}

.notice-link {
  display: inline-flex;
  margin-left: 10px;
  color: inherit;
  font-weight: 800;
}

.logout-form {
  margin: 8px 0 0;
}

.logout-button {
  min-height: 28px;
  padding: 4px 9px;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #f3f4f6;
  font-size: 12px;
}

.logout-button:hover {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.14);
}

.cell-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

@media (max-width: 1080px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding: 14px 16px;
  }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .main {
    padding: 16px;
  }

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

  .workbench-grid,
  .workbench-grid.is-two,
  .meta-list,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .panel-head {
    flex-direction: column;
  }

  table {
    min-width: 760px;
  }
}
