:root {
  --page-bg: #ecf6ff;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: #ffffff;
  --ink: #18314a;
  --muted: #648099;
  --line: rgba(50, 112, 169, 0.16);
  --primary: #176cb8;
  --primary-strong: #0f416f;
  --secondary: #14abc3;
  --danger: #d76557;
  --warning: #e39a2d;
  --ok: #2f9b70;
  --shadow: 0 22px 48px rgba(18, 63, 109, 0.14);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --font-display: "Noto Sans JP", "Segoe UI", sans-serif;
  --font-body: "Noto Sans JP", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(20, 171, 195, 0.18), transparent 24%),
    radial-gradient(circle at bottom right, rgba(23, 108, 184, 0.16), transparent 28%),
    linear-gradient(180deg, #f8fbff 0%, var(--page-bg) 100%);
}

button,
a,
input {
  font: inherit;
}

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

.overview-shell {
  width: min(1480px, calc(100% - 32px));
  margin: 18px auto 28px;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.overview-sidebar,
.overview-main {
  display: grid;
  gap: 18px;
  align-content: start;
}

.brand-panel,
.sidebar-panel,
.hero-panel,
.panel-surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.brand-panel {
  padding: 24px;
  color: #f4fbff;
  background:
    radial-gradient(circle at right top, rgba(255, 255, 255, 0.24), transparent 38%),
    linear-gradient(140deg, rgba(23, 108, 184, 0.96), rgba(12, 55, 98, 0.95));
}

.brand-kicker,
.panel-kicker,
.card-label,
.board-chip {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-panel h1,
.hero-panel h2,
.section-title {
  margin: 0;
  font-family: var(--font-display);
}

.brand-panel h1 {
  font-size: clamp(32px, 3vw, 42px);
  line-height: 1.04;
  margin-bottom: 12px;
}

.brand-panel p,
.hero-panel p,
.sidebar-panel p,
.panel-copy,
.metric-note,
.resident-meta,
.status-note,
.list-meta {
  margin: 0;
  color: inherit;
  line-height: 1.6;
}

.brand-panel .brand-sub {
  color: rgba(244, 251, 255, 0.86);
}

.sidebar-panel,
.hero-panel,
.panel-surface {
  padding: 20px;
}

.hero-panel {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.hero-panel h2 {
  font-size: clamp(28px, 3vw, 38px);
  margin-bottom: 10px;
}

.hero-badges,
.metric-grid,
.quick-filter-row,
.status-row,
.card-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-badges span,
.filter-chip,
.metric-chip,
.unit-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(23, 108, 184, 0.08);
  color: var(--primary);
}

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

.metric-card {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.metric-card strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
  font-family: var(--font-display);
}

.alert-list {
  display: grid;
  gap: 12px;
}

.alert-item {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(215, 101, 87, 0.16);
  background: linear-gradient(180deg, #fffaf8 0%, #fff 100%);
}

.alert-item.warning {
  border-color: rgba(227, 154, 45, 0.18);
  background: linear-gradient(180deg, #fffaf0 0%, #fff 100%);
}

.alert-item strong {
  display: block;
  margin-bottom: 4px;
}

.filter-chip {
  border: 0;
  cursor: pointer;
  transition: 140ms ease;
}

.filter-chip.active,
.filter-chip:hover {
  background: var(--primary);
  color: #f6fbff;
  box-shadow: 0 10px 20px rgba(23, 108, 184, 0.18);
}

.board-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.section-stack {
  display: grid;
  gap: 18px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.section-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

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

.resident-card {
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #f4faff 100%);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: 160ms ease;
}

.resident-card:hover,
.resident-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(23, 108, 184, 0.28);
  box-shadow: 0 16px 28px rgba(23, 108, 184, 0.12);
}

.resident-card:focus-visible {
  outline: 3px solid rgba(23, 108, 184, 0.14);
  outline-offset: 2px;
}

.resident-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
  margin-bottom: 14px;
}

.resident-name {
  font-size: 22px;
  margin-bottom: 4px;
}

.resident-meta {
  color: var(--muted);
  font-size: 14px;
}

.priority-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.priority-badge.high {
  background: rgba(215, 101, 87, 0.12);
  color: var(--danger);
}

.priority-badge.medium {
  background: rgba(227, 154, 45, 0.14);
  color: var(--warning);
}

.priority-badge.low {
  background: rgba(47, 155, 112, 0.12);
  color: var(--ok);
}

.status-row {
  margin-bottom: 14px;
}

.status-pill {
  flex: 1 1 132px;
  min-width: 0;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
}

.status-pill span,
.status-pill strong,
.list-row span,
.list-row strong {
  display: block;
}

.status-pill span,
.list-row span,
.table-label,
.muted {
  color: var(--muted);
  font-size: 12px;
}

.status-pill strong,
.list-row strong {
  margin-top: 6px;
  font-size: 18px;
}

.status-pill.alert {
  border-color: rgba(215, 101, 87, 0.18);
  background: rgba(255, 245, 243, 0.92);
}

.status-pill.warn {
  border-color: rgba(227, 154, 45, 0.22);
  background: rgba(255, 250, 241, 0.94);
}

.status-pill.info {
  border-color: rgba(23, 108, 184, 0.18);
  background: rgba(243, 249, 255, 0.94);
}

.status-pill.good {
  border-color: rgba(47, 155, 112, 0.18);
}

.status-note {
  color: var(--ink);
  margin-bottom: 14px;
}

.resident-link-hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.empty-state {
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
}

.resident-list-table {
  display: grid;
  gap: 10px;
}

.list-row {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(230px, 1.5fr) 92px 92px 96px 96px 96px;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff 0%, #f7fbff 100%);
  border: 1px solid var(--line);
  align-items: center;
}

.list-row.header {
  background: transparent;
  border: 0;
  padding: 0 2px 4px;
}

.list-row.header strong {
  margin-top: 0;
  font-size: 13px;
  color: var(--muted);
}

.resident-list-row {
  cursor: pointer;
  transition: 140ms ease;
}

.resident-list-row:hover,
.resident-list-row:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(23, 108, 184, 0.26);
  box-shadow: 0 12px 24px rgba(23, 108, 184, 0.08);
}

.resident-list-row:focus-visible {
  outline: 3px solid rgba(23, 108, 184, 0.14);
  outline-offset: 2px;
}

.list-name {
  display: grid;
  gap: 2px;
}

.meal-badge-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.state-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.state-badge.alert {
  background: rgba(215, 101, 87, 0.12);
  color: var(--danger);
}

.state-badge.warn {
  background: rgba(227, 154, 45, 0.14);
  color: var(--warning);
}

.state-badge.good {
  background: rgba(47, 155, 112, 0.12);
  color: var(--ok);
}

.state-badge.info {
  background: rgba(23, 108, 184, 0.1);
  color: var(--primary);
}

.overview-note {
  margin-top: 14px;
  color: var(--muted);
}

@media (max-width: 1280px) {
  .overview-shell,
  .board-layout {
    grid-template-columns: 1fr;
  }

  .alert-resident-grid {
    grid-template-columns: 1fr;
  }

  .list-row {
    grid-template-columns: minmax(0, 1.2fr) minmax(220px, 1.35fr) repeat(5, 88px);
  }
}

@media (max-width: 860px) {
  .overview-shell {
    width: min(100% - 20px, 100%);
    margin: 10px auto 18px;
  }

  .brand-panel,
  .sidebar-panel,
  .hero-panel,
  .panel-surface {
    padding: 16px;
    border-radius: 22px;
  }

  .hero-panel,
  .section-header,
  .list-row,
  .metric-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .list-row.header {
    display: none;
  }
}
