:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --ink: #191816;
  --muted: #6f6a61;
  --line: #ded8cc;
  --accent: #0f4c3a;
  --accent-2: #a36b28;
  --danger: #a3372f;
  --shadow: 0 18px 45px rgba(25, 24, 22, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 14px;
}

a {
  color: inherit;
  text-decoration: none;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 76, 58, 0.12);
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

td small,
.side-foot small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 240px;
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  background: #191816;
  color: #fff;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 8px 28px;
}

.brand span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  color: #e8d6b0;
  font-weight: 800;
}

.brand strong {
  line-height: 1.25;
}

.sidebar nav {
  display: grid;
  gap: 6px;
}

.sidebar nav a,
.side-foot a {
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.72);
  padding: 11px 12px;
}

.sidebar nav a.active,
.sidebar nav a:hover,
.side-foot a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.side-foot {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 14px 8px 0;
}

.main {
  margin-left: 240px;
  min-height: 100vh;
  padding: 34px;
}

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

.page-head h1,
.login-box h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  padding: 9px 14px;
  white-space: nowrap;
}

.button:hover {
  border-color: #b9ad9b;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.button.danger {
  border-color: rgba(163, 55, 47, 0.25);
  color: var(--danger);
}

.button.small {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 13px;
}

.button.wide {
  width: 100%;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

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

.metric {
  padding: 18px;
}

.metric span {
  color: var(--muted);
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 30px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.panel {
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

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

.panel-head a {
  color: var(--accent);
  font-weight: 700;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 160px auto;
  gap: 10px;
  margin-bottom: 14px;
}

.thumb {
  width: 58px;
  height: 58px;
  border-radius: 6px;
  object-fit: cover;
  background: #eee9df;
}

.thumb.wide {
  width: 92px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  background: #eef4f1;
  color: var(--accent);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
}

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

.actions form,
.status-form {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin: 0;
}

.status-form select {
  min-width: 110px;
}

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

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 20px;
}

.form-grid.compact {
  margin-top: 18px;
}

.form-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

.span-2 {
  grid-column: 1 / -1;
}

.checks {
  display: flex;
  gap: 18px;
  align-items: center;
}

.checks label,
.switch-line {
  display: inline-flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
}

.checks input,
.switch-line input {
  width: auto;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

.inline-form {
  display: contents;
}

.banner-form input + input {
  margin-top: 8px;
}

.notice {
  margin-bottom: 16px;
  border: 1px solid rgba(163, 107, 40, 0.25);
  border-radius: 8px;
  background: #fff8ed;
  color: #6d4418;
  padding: 12px 14px;
}

.blank {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.login-shell {
  width: min(420px, calc(100vw - 32px));
}

.login-box {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 28px;
}

.login-box label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 980px) {
  .sidebar {
    position: static;
    width: auto;
  }

  .sidebar nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .side-foot {
    display: flex;
    justify-content: space-between;
  }

  .main {
    margin-left: 0;
    padding: 22px;
  }

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

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

  .panel {
    overflow-x: auto;
  }

  table {
    min-width: 760px;
  }
}
