:root {
  --bg: #f5f1ea;
  --panel: #fffdf9;
  --panel-alt: #f0e6d8;
  --line: #dfd0bc;
  --text: #1f1a14;
  --muted: #756757;
  --accent: #9f4b22;
  --accent-deep: #6d2f14;
  --success: #2f6d52;
  --danger: #9c2f2f;
  --shadow: 0 20px 60px rgba(87, 54, 28, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(159, 75, 34, 0.14), transparent 30%),
    linear-gradient(180deg, #f8f4ed, #efe4d4 65%, #e9ddcd);
}

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

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

.sidebar {
  padding: 28px 22px;
  border-right: 1px solid rgba(109, 47, 20, 0.12);
  background: rgba(255, 250, 244, 0.7);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand { display: flex; gap: 14px; align-items: center; }
.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: linear-gradient(135deg, #9f4b22, #db8e5b);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand-title { font-size: 18px; font-weight: 700; }
.brand-subtitle, .muted { color: var(--muted); }

.nav, .stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav-link, .ghost-button, .primary-button {
  border-radius: 14px;
  padding: 12px 16px;
  border: 1px solid transparent;
  transition: 0.2s ease;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
}

.nav-link.active, .nav-link:hover {
  background: var(--panel);
  border-color: rgba(109, 47, 20, 0.12);
  box-shadow: var(--shadow);
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.user-card {
  border-radius: 18px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.user-name { font-weight: 700; }
.user-meta { margin-top: 4px; color: var(--muted); font-size: 13px; }
.content { padding: 32px; }

.page-header, .pagination, .page-actions, .header-actions, .form-actions, .toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
}

.page-header {
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.page-header h1 { margin: 0 0 8px; font-size: 30px; }

.panel, .metric-card, .login-card {
  background: rgba(255, 253, 249, 0.9);
  border: 1px solid rgba(109, 47, 20, 0.12);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.panel { padding: 24px; }

.panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-header h2 { margin: 0; font-size: 20px; }

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.metric-card { padding: 22px; }
.metric-card span { display: block; color: var(--muted); margin-bottom: 10px; }
.metric-card strong { font-size: 34px; font-weight: 700; }
.metric-card.warning { background: rgba(255, 244, 231, 0.95); }
.metric-card.success { background: rgba(238, 250, 242, 0.95); }

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

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

input, select, textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 12px 14px;
  background: #fff;
  color: var(--text);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(159, 75, 34, 0.7);
  box-shadow: 0 0 0 4px rgba(159, 75, 34, 0.1);
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), #c56d40);
  color: #fff;
  border: none;
}

.primary-button:hover { transform: translateY(-1px); }

.ghost-button {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.ghost-button:hover { background: var(--panel-alt); }
.ghost-button.danger { color: var(--danger); }
.full { width: 100%; }

.list-table, .timeline, .stage-list { display: flex; flex-direction: column; gap: 12px; }

.list-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(109, 47, 20, 0.08);
  transition: 0.2s ease;
}

.list-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(87, 54, 28, 0.08);
}

.list-row.static:hover { transform: none; box-shadow: none; }

.list-row strong, .detail-grid strong { display: block; margin-bottom: 4px; }
.list-row span, .detail-grid span, .note-box span, .timeline-meta span, .timeline-next { color: var(--muted); font-size: 13px; }

.row-meta { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(159, 75, 34, 0.1);
  color: var(--accent-deep);
  font-size: 12px;
}

.empty-state {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  text-align: center;
  color: var(--muted);
}

.pagination { margin-top: 18px; justify-content: space-between; }

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

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

.note-box {
  margin-top: 20px;
  padding: 18px;
  border-radius: 16px;
  background: var(--panel-alt);
}

.timeline-item { display: grid; grid-template-columns: 18px 1fr; gap: 14px; }
.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent);
  margin-top: 6px;
}

.timeline-content {
  padding-bottom: 18px;
  border-bottom: 1px dashed var(--line);
}

.timeline-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.timeline-content p { margin: 10px 0; line-height: 1.7; }
.timeline-next { color: var(--accent-deep); }

.alert {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 14px;
}

.alert.error { background: rgba(156, 47, 47, 0.08); color: var(--danger); }
.alert.success { background: rgba(47, 109, 82, 0.1); color: var(--success); }

.stage-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(109, 47, 20, 0.08);
  padding-bottom: 12px;
}

.text-link { color: var(--accent); font-size: 14px; }
.narrow { max-width: 520px; }

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

.login-card { width: min(460px, 100%); padding: 34px; }

.hero-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(159, 75, 34, 0.1);
  color: var(--accent-deep);
  font-size: 13px;
  margin-bottom: 14px;
}

@media (max-width: 1080px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid rgba(109, 47, 20, 0.12); }
  .metrics-grid, .panel-grid, .form-grid, .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .content { padding: 20px; }
  .page-header, .pagination, .toolbar { flex-direction: column; align-items: stretch; }
  .list-row, .timeline-meta { flex-direction: column; align-items: flex-start; }
  .row-meta { align-items: flex-start; }
}
