:root {
  --bg: #eef2f6;
  --panel: #ffffff;
  --border: #d5dde7;
  --text: #162332;
  --muted: #5c6b79;
  --primary: #18354c;
  --primary-soft: #dfe8ef;
  --accent: #caa25f;
  --success: #2e6b42;
  --pending: #a4adb7;
  --danger: #a73b34;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  background: linear-gradient(180deg, #f7fafc 0%, var(--bg) 100%);
  color: var(--text);
}

a {
  color: var(--primary);
}

.shell {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.shell-wide {
  width: min(1100px, calc(100% - 32px));
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 0 10px 30px rgba(23, 41, 58, 0.05);
}

.hero-wrap {
  display: grid;
  gap: 18px;
}

.hero-panel,
.admin-header,
.timeline-header,
.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hero-panel {
  align-items: center;
  background:
    radial-gradient(circle at top right, rgba(202, 162, 95, 0.18), transparent 30%),
    linear-gradient(135deg, #163247 0%, #244763 100%);
  color: #fff;
  border-color: transparent;
}

.simple-hero {
  justify-content: center;
  text-align: center;
}

.hero-panel p {
  color: rgba(255, 255, 255, 0.78);
}

.brand-avatar {
  width: 64px;
  height: 64px;
  border-radius: 14px;
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 12px;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

h1 {
  font-size: 30px;
  margin-bottom: 8px;
}

h2 {
  font-size: 22px;
}

h3 {
  font-size: 18px;
}

.panel p,
.muted {
  color: var(--muted);
  line-height: 1.7;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.field input,
.field select,
.timeline-card textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
}

.timeline-card textarea {
  min-height: 86px;
  resize: vertical;
}

.button-primary,
.button-secondary {
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 15px;
  cursor: pointer;
}

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

.button-secondary {
  background: var(--primary-soft);
  color: var(--primary);
}

.small-button {
  padding: 10px 14px;
}

.message {
  margin-top: 14px;
  min-height: 22px;
}

.hidden {
  display: none !important;
}

.results {
  display: grid;
  gap: 16px;
}

.case-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
}

.case-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.tag {
  padding: 8px 12px;
  border-radius: 999px;
  background: #e6efe7;
  color: var(--success);
  font-size: 13px;
  white-space: nowrap;
}

.meta-row {
  margin-top: 12px;
  color: var(--muted);
}

.timeline {
  margin-top: 16px;
}

.timeline-item {
  position: relative;
  display: flex;
  gap: 14px;
  padding-bottom: 16px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 16px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  margin-top: 4px;
  background: var(--pending);
  flex: 0 0 18px;
}

.timeline-item.done .timeline-dot {
  background: var(--success);
}

.timeline-item.current .timeline-dot {
  background: var(--primary);
  box-shadow: 0 0 0 6px rgba(24, 53, 76, 0.12);
}

.timeline-item.pending .timeline-content {
  color: var(--pending);
}

.timeline-item.current .timeline-title,
.timeline-item.current .timeline-date {
  font-weight: 700;
  color: var(--primary);
}

.timeline-title {
  font-weight: 600;
}

.timeline-date,
.timeline-note {
  margin-top: 6px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.admin-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.admin-item {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.admin-item strong {
  display: block;
  margin-bottom: 6px;
}

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

.timeline-editor {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

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

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

.timeline-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.danger-link,
.text-link {
  background: none;
  border: 0;
  color: var(--primary);
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  text-decoration: none;
}

.danger-link {
  color: var(--danger);
}

.prose-panel p {
  margin-top: 14px;
}

.footer-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-hero {
  background:
    radial-gradient(circle at top right, rgba(202, 162, 95, 0.18), transparent 35%),
    linear-gradient(180deg, #fbfdff, #f5f8fb);
}

@media (max-width: 720px) {
  .shell,
  .shell-wide {
    width: calc(100% - 24px);
  }

  .hero-panel,
  .admin-header,
  .footer-panel,
  .action-row,
  .timeline-header,
  .case-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-grid,
  .timeline-card-grid,
  .stat-panel {
    grid-template-columns: 1fr;
  }
}
