:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #172033;
  --muted: #667085;
  --line: #dde3ec;
  --nav: #182130;
  --nav-active: #263449;
  --blue: #2563eb;
  --cyan: #0891b2;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --violet: #7c3aed;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--bg);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

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

.admin-shell {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 276px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 16px;
  background: var(--nav);
  color: #f8fafc;
}

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

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #0ea5e9;
  font-weight: 800;
}

.brand-title {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
}

.brand-subtitle {
  margin-top: 4px;
  color: #b6c2d1;
  font-size: 13px;
}

.side-nav {
  display: grid;
  gap: 4px;
}

.nav-item {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  color: #d8e0ea;
  text-decoration: none;
  font-size: 14px;
}

.nav-item:hover,
.nav-item.active {
  color: #ffffff;
  background: var(--nav-active);
}

.sidebar-note {
  margin-top: auto;
  padding: 14px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #101827;
}

.note-label {
  color: #9fb0c4;
  font-size: 12px;
}

.note-value {
  margin-top: 5px;
  font-weight: 700;
}

.admin-main {
  flex: 1;
  min-width: 0;
  margin-left: 276px;
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 30px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.header-kicker {
  color: var(--muted);
  font-size: 12px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  margin-top: 2px;
  font-size: 26px;
  line-height: 1.2;
}

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

.primary-button,
.secondary-button,
.icon-button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.primary-button {
  padding: 0 16px;
  background: var(--blue);
  color: #ffffff;
  font-weight: 700;
}

.secondary-button {
  padding: 0 14px;
  background: #ffffff;
  border-color: var(--line);
  color: var(--ink);
  font-weight: 700;
}

.icon-button {
  width: 38px;
  background: var(--surface-soft);
  border-color: var(--line);
  color: var(--ink);
  font-weight: 800;
}

.admin-view {
  padding: 28px 30px 44px;
}

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

.metric-card,
.panel,
.item-card,
.page-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(20, 32, 51, 0.05);
}

.metric-card {
  min-height: 128px;
  padding: 18px;
  border-left: 4px solid var(--blue);
}

.metric-card.green {
  border-left-color: var(--green);
}

.metric-card.amber {
  border-left-color: var(--amber);
}

.metric-card.cyan {
  border-left-color: var(--cyan);
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
}

.metric-value {
  margin-top: 10px;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
}

.metric-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

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

.panel,
.page-section {
  padding: 20px;
}

.panel-head,
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel h2,
.section-head h2 {
  font-size: 18px;
  line-height: 1.3;
}

.section-head p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.6;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge.done {
  color: #166534;
  background: #dcfce7;
}

.status-badge.progress {
  color: #1d4ed8;
  background: #dbeafe;
}

.status-badge.warning {
  color: #92400e;
  background: #fef3c7;
}

.status-badge.late {
  color: #991b1b;
  background: #fee2e2;
}

.timeline,
.risk-list {
  display: grid;
  gap: 12px;
}

.timeline-item,
.risk-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.step-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 800;
}

.item-title {
  font-weight: 800;
}

.item-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

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

.item-card {
  padding: 16px;
}

.item-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.progress-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

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

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

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

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  background: var(--surface-soft);
}

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

.kanban-column {
  min-height: 360px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.kanban-column h3 {
  margin-bottom: 12px;
  font-size: 15px;
}

.check-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.check-card + .check-card {
  margin-top: 10px;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.review-card {
  min-height: 170px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.review-day {
  color: var(--violet);
  font-weight: 800;
}

.empty-state {
  padding: 26px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #ffffff;
}

.error-text {
  margin-top: 12px;
  color: var(--red);
  line-height: 1.7;
}

@media (max-width: 1120px) {
  .metrics-grid,
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split-layout,
  .kanban {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .admin-shell {
    display: block;
  }

  .admin-sidebar {
    position: static;
    width: auto;
    border-bottom: 1px solid #334155;
  }

  .admin-main {
    margin-left: 0;
  }

  .admin-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px;
  }

  .admin-view {
    padding: 18px;
  }

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

  .section-head {
    display: grid;
  }
}
