:root {
  color-scheme: light;
  --bg: #f6f8f5;
  --panel: #ffffff;
  --text: #132018;
  --muted: #637064;
  --line: #dfe7dc;
  --brand: #f26a00;
  --brand-2: #00c80f;
  --green: #00a83a;
  --amber: #d86a00;
  --red: #c83232;
  --soft-red: #fff0f0;
  --soft-blue: #edf8ef;
  --ink: #0b1c18;
  --ink-2: #102820;
  --shadow: 0 16px 36px rgba(15, 34, 24, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 8%, rgba(0, 200, 15, 0.09), transparent 28%),
    radial-gradient(circle at 88% 0%, rgba(242, 106, 0, 0.11), transparent 26%),
    linear-gradient(180deg, #fbfcf8 0%, var(--bg) 48%, #f3f6ef 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

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

button {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #ff7a00, #ef5f00);
  color: white;
  cursor: pointer;
  transition: 0.16s ease;
  box-shadow: 0 8px 18px rgba(242, 106, 0, 0.18);
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(242, 106, 0, 0.24);
}

button.secondary {
  background: #eef5ec;
  color: var(--text);
  box-shadow: none;
}

button.danger {
  background: var(--red);
}

button.ghost {
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--line);
  box-shadow: none;
}

textarea {
  width: 100%;
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  resize: vertical;
  background: white;
}

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

.sidebar {
  background:
    radial-gradient(circle at 80% 12%, rgba(242, 106, 0, 0.2), transparent 28%),
    radial-gradient(circle at 20% 36%, rgba(0, 200, 15, 0.14), transparent 26%),
    linear-gradient(180deg, var(--ink) 0%, var(--ink-2) 100%);
  color: white;
  padding: 24px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: grid;
  gap: 12px;
  justify-items: start;
  margin-bottom: 28px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.logo {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: contain;
  background: white;
  padding: 5px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
}

.brand strong {
  display: block;
  font-size: 22px;
  letter-spacing: 0;
}

.brand span {
  display: block;
  color: #b8cfc0;
  font-size: 12px;
  margin-top: 2px;
  line-height: 1.45;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav a {
  color: #d7e6dc;
  text-decoration: none;
  padding: 12px 13px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.nav a.active,
.nav a:hover {
  background: rgba(242, 106, 0, 0.16);
  border-color: rgba(242, 106, 0, 0.28);
  color: white;
}

.sidebar-note {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 20px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: #b8cfc0;
  font-size: 12px;
  line-height: 1.5;
}

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

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.eyebrow {
  color: var(--brand);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
}

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

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

h2 {
  font-size: 18px;
  margin-bottom: 14px;
}

h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

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

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

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

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

.grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-top-color: rgba(242, 106, 0, 0.18);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.stat {
  display: grid;
  gap: 6px;
}

.stat .value {
  font-size: 28px;
  font-weight: 800;
  color: #15241a;
}

.status-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 16px;
  align-items: stretch;
}

.elder-hero {
  background:
    linear-gradient(135deg, rgba(11, 28, 24, 0.72), rgba(242, 106, 0, 0.24)),
    url("https://images.unsplash.com/photo-1581579186913-45ac3e6efe93?auto=format&fit=crop&w=1400&q=80");
  background-size: cover;
  background-position: center;
  color: white;
  min-height: 340px;
  display: flex;
  align-items: flex-end;
}

.elder-hero h2 {
  font-size: 34px;
  margin-bottom: 8px;
}

.hero-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 13px;
  background: #eef7ec;
  color: var(--text);
  border: 1px solid rgba(0, 168, 58, 0.1);
}

.elder-hero .pill {
  background: rgba(255, 255, 255, 0.18);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.pill.red {
  background: var(--soft-red);
  color: var(--red);
}

.pill.green {
  background: #e8faeb;
  color: var(--green);
}

.pill.amber {
  background: #fff7e8;
  color: var(--amber);
}

.alert {
  border-left: 5px solid var(--red);
  background: var(--soft-red);
}

.level-1 {
  border-left: 5px solid var(--amber);
}

.level-2 {
  border-left: 5px solid #db8c00;
}

.level-3 {
  border-left: 5px solid var(--red);
}

.list {
  display: grid;
  gap: 10px;
}

.item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.86);
}

.item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.timeline {
  display: grid;
  gap: 0;
}

.timeline-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  border-left: 2px solid var(--line);
  margin-left: 8px;
  padding: 0 0 16px 18px;
  position: relative;
}

.timeline-row:before {
  content: "";
  position: absolute;
  left: -6px;
  top: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
}

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

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

.table th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.work-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  max-width: 440px;
  z-index: 5;
  animation: slide 0.2s ease-out;
}

@keyframes slide {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.footer-space {
  height: 24px;
}

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

  .sidebar {
    height: auto;
    position: static;
  }

  .sidebar-note {
    position: static;
    margin-top: 16px;
  }

  .status-card,
  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4 {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .actions {
    justify-content: flex-start;
  }
}
