/* ===== Design System - Apple Health + WeChat Native Style ===== */
:root {
  --primary: #1677FF;
  --primary-dark: #1158BF;
  --primary-light: rgba(22, 119, 255, 0.1);
  --primary-gradient: linear-gradient(135deg, #1677FF, #36A3FF);
  --bg: #F2F2F7;
  --card: #FFFFFF;
  --text-primary: #1C1C1E;
  --text-secondary: #3C3C43;
  --text-tertiary: #8E8E93;
  --text-quaternary: #C7C7CC;
  --danger: #FF3B30;
  --danger-light: rgba(255, 59, 48, 0.1);
  --warning: #FF9500;
  --warning-light: rgba(255, 149, 0, 0.1);
  --info: #007AFF;
  --info-light: rgba(0, 122, 255, 0.1);
  --success: #34C759;
  --success-light: rgba(52, 199, 89, 0.1);
  --tag-hypertension: linear-gradient(135deg, #FF6B6B, #FF3B30);
  --tag-diabetes: linear-gradient(135deg, #FFA726, #FF9500);
  --tag-elderly: linear-gradient(135deg, #42A5F5, #007AFF);
  --tag-pregnant: linear-gradient(135deg, #CE93D8, #AF52DE);
  --tag-child: linear-gradient(135deg, #4DD0E1, #5AC8FA);
  --tag-mental: linear-gradient(135deg, #BDBDBD, #8E8E93);
  --border: rgba(0, 0, 0, 0.06);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  --nav-height: 44px;
  --tab-height: 50px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font-family: -apple-system, 'SF Pro Display', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
}

/* ===== Reset ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* 移动端触控优化 */
button, [role="button"], .card, .tab-item, .filter-tab {
  touch-action: manipulation;
  -webkit-touch-callout: none;
  min-height: 36px;
}
@media (hover: none) and (pointer: coarse) {
  button:active, .card:active { opacity: 0.85; transform: scale(0.98); transition: all 0.1s; }
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
input, button, textarea, select {
  font: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: none;
  -webkit-appearance: none;
}
button { cursor: pointer; }
ul, ol { list-style: none; }

/* ===== App Shell ===== */
#app {
  max-width: 100vw;
  min-height: 100vh;
}

.page {
  min-height: 100vh;
  padding-top: calc(var(--nav-height) + var(--safe-top));
  padding-bottom: calc(var(--tab-height) + var(--safe-bottom) + 16px);
  background: var(--bg);
}

.page--no-tab {
  padding-bottom: calc(var(--safe-bottom) + 16px);
}

.page-content {
  padding: 12px 16px;
}

/* ===== Navigation Bar - Frosted Glass ===== */
.nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--nav-height) + var(--safe-top));
  padding-top: var(--safe-top);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 16px;
  padding-right: 16px;
  z-index: 100;
}

.nav-bar__title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  letter-spacing: -0.2px;
}

.nav-bar__left,
.nav-bar__right {
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1;
}

.nav-bar__back {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--primary);
  transition: background 0.2s;
}

.nav-bar__back:active {
  background: rgba(0, 0, 0, 0.05);
}

.nav-bar__back svg {
  width: 20px;
  height: 20px;
}

.nav-bar__icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.nav-bar__icon svg {
  width: 22px;
  height: 22px;
}

.nav-bar__greeting {
  font-size: 13px;
  color: var(--text-tertiary);
  font-weight: 400;
}

/* ===== Tab Bar ===== */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--tab-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
  z-index: 100;
}

.tab-bar__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: var(--tab-height);
  color: var(--text-tertiary);
  font-size: 10px;
  transition: color 0.25s;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.tab-bar__item--active .tab-bar__icon svg {
  fill: url(#tabGradient);
}

.tab-bar__item--active .tab-bar__label {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 600;
}

.tab-bar__icon {
  width: 24px;
  height: 24px;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab-bar__icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
  transition: fill 0.25s;
}

.tab-bar__label {
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.2px;
}

.tab-bar__badge {
  position: absolute;
  top: 2px;
  right: calc(50% - 20px);
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== Cards ===== */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
}

.card--no-padding {
  padding: 0;
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.card__extra {
  font-size: 13px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 2px;
}

/* ===== Hero Card (Gradient) ===== */
.hero-card {
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.88), transparent 34%),
    linear-gradient(135deg, #fff8ef 0%, #f6f8ff 46%, #f3fbf8 100%);
  border-radius: 24px;
  padding: 20px;
  color: var(--text-primary);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.hero-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.58), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(15, 23, 42, 0.02));
}

.hero-card::after {
  content: '';
  position: absolute;
  top: -44%;
  right: -14%;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.48);
}

.hero-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.hero-card__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.hero-card__date {
  font-size: 13px;
  color: var(--text-secondary);
}

.hero-card__eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8b5a2b;
}

.hero-card__headline {
  margin-top: 6px;
  font-size: 28px;
  line-height: 1.05;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.04em;
}

.hero-card__subtitle {
  margin-top: 8px;
  max-width: 380px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.hero-card__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  position: relative;
  z-index: 1;
}

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

.hero-card__item {
  text-align: center;
}

.hero-card__panel {
  min-height: 88px;
  border-radius: 18px;
  padding: 14px 12px;
  border: 1px solid rgba(15, 23, 42, 0.05);
  background: rgba(255, 255, 255, 0.72);
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.hero-card__panel:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.hero-card__panel--clickable,
.hero-card__summary-pill {
  cursor: pointer;
}

.hero-card__num {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -1px;
  color: var(--text-primary);
}

.hero-card__label {
  font-size: 12px;
  color: var(--text-primary);
  margin-top: 8px;
  font-weight: 600;
}

.hero-card__hint {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-secondary);
}

.hero-card__focus {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  position: relative;
  z-index: 1;
}

.hero-card__focus-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
}

.hero-card__focus-text {
  min-width: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-primary);
  font-weight: 600;
}

.hero-card__team-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.4;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.hero-card__panel--blue {
  background: linear-gradient(180deg, rgba(0, 122, 255, 0.08), rgba(255, 255, 255, 0.88));
}

.hero-card__panel--blue .hero-card__num {
  color: #0a63d8;
}

.hero-card__panel--amber {
  background: linear-gradient(180deg, rgba(255, 149, 0, 0.1), rgba(255, 255, 255, 0.9));
}

.hero-card__panel--amber .hero-card__num {
  color: #c26c00;
}

.hero-card__panel--rose {
  background: linear-gradient(180deg, rgba(255, 59, 48, 0.1), rgba(255, 255, 255, 0.9));
}

.hero-card__panel--rose .hero-card__num {
  color: #cc3f36;
}

.hero-card__panel--teal {
  background: linear-gradient(180deg, rgba(0, 200, 83, 0.08), rgba(255, 255, 255, 0.92));
}

.hero-card__panel--teal .hero-card__num {
  color: #14804e;
}

.hero-card__summary-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  position: relative;
  z-index: 1;
}

.hero-card__summary-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 700;
}

.hero-card__summary-pill--danger {
  background: rgba(255, 59, 48, 0.1);
  color: #cc3f36;
}

.hero-card__summary-pill--amber {
  background: rgba(255, 149, 0, 0.12);
  color: #c26c00;
}

.hero-card__summary-pill--blue {
  background: rgba(0, 122, 255, 0.1);
  color: #0a63d8;
}

.home-priority-card {
  padding: 14px 16px;
}

.home-priority-list {
  display: grid;
  gap: 10px;
}

.home-priority-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.home-priority-item:last-child {
  border-bottom: none;
}

.home-priority-item__main {
  flex: 1;
  min-width: 0;
}

.home-priority-item__title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.home-priority-item__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.home-priority-item__dot--info {
  background: #0a63d8;
}

.home-priority-item__dot--warning {
  background: #c26c00;
}

.home-priority-item__dot--danger {
  background: #cc3f36;
}

.home-priority-item__dot--success {
  background: #14804e;
}

.home-priority-item__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.home-priority-item__detail {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.home-digest-card {
  padding: 12px 14px;
}

.home-digest-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.home-digest-item:last-of-type {
  border-bottom: none;
}

.home-digest-item__main {
  flex: 1;
  min-width: 0;
}

.home-digest-item__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.home-digest-item__meta {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.home-digest-card__more {
  margin-top: 8px;
  padding: 10px 12px 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--info);
  cursor: pointer;
}

/* ===== Progress Bar ===== */
.progress {
  margin-bottom: 12px;
}

.progress:last-child {
  margin-bottom: 0;
}

.progress__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress__title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.progress__value {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}

.progress__bar {
  height: 8px;
  background: #E5E5EA;
  border-radius: 4px;
  overflow: hidden;
}

.progress__fill {
  height: 100%;
  border-radius: 4px;
  background: var(--primary-gradient);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress__fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

.progress__desc {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 6px;
}

/* ===== Section Header ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 10px;
}

.section-header__title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.section-header__more {
  font-size: 13px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 2px;
}

/* ===== Tags / Badges ===== */
.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: var(--radius-xl);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.tag--hypertension { background: var(--tag-hypertension); color: #fff; }
.tag--diabetes { background: var(--tag-diabetes); color: #fff; }
.tag--elderly { background: var(--tag-elderly); color: #fff; }
.tag--pregnant { background: var(--tag-pregnant); color: #fff; }
.tag--child { background: var(--tag-child); color: #fff; }
.tag--mental { background: var(--tag-mental); color: #fff; }
.tag--tuberculosis { background: linear-gradient(135deg, #FF6482, #E91E63); color: #fff; }

.tag--risk-high { background: linear-gradient(135deg, #FF6B6B, #FF3B30); color: #fff; }
.tag--risk-medium { background: linear-gradient(135deg, #FFA726, #FF9500); color: #fff; }
.tag--risk-low { background: linear-gradient(135deg, #66BB6A, #34C759); color: #fff; }

.tag--status-pending { background: var(--warning-light); color: var(--warning); }
.tag--status-done { background: var(--success-light); color: var(--success); }
.tag--status-overdue { background: var(--danger-light); color: var(--danger); }
.tag--status-sending { background: var(--info-light); color: var(--info); }

/* ===== Stat Cards Grid ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.stat-card__value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -1px;
}

.stat-card__label {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.stat-card--warning .stat-card__value { color: var(--warning); }
.stat-card--danger .stat-card__value { color: var(--danger); }
.stat-card--success .stat-card__value { color: var(--success); }
.stat-card--info .stat-card__value { color: var(--info); }

.stat-card__icon {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 10px;
  opacity: 0.6;
}

/* ===== Warning Banner ===== */
.warning-banner {
  background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.warning-banner__icon {
  font-size: 20px;
  flex-shrink: 0;
}

.warning-banner__text {
  flex: 1;
  font-size: 13px;
  color: #E65100;
  font-weight: 500;
}

.warning-banner__action {
  flex-shrink: 0;
}

/* ===== Filter Tabs ===== */
.filter-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-tabs::-webkit-scrollbar { display: none; }

.filter-tab {
  flex-shrink: 0;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--card);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.25s;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.filter-tab--active {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 200, 83, 0.3);
}

.filter-tab__badge {
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 600;
  background: var(--danger);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.resident-board-card {
  padding: 16px;
  margin-bottom: 12px;
  background: linear-gradient(180deg, #FFFFFF 0%, #F7FBF8 100%);
}

.resident-board-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.resident-board-card__title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}

.resident-board-card__desc {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.resident-board-card__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.resident-board-card__teamline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.resident-board-card__tile {
  padding: 12px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.resident-board-card__tile--action,
.resident-board-card__subtile.resident-board-card__tile--action {
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.resident-board-card__tile--action:active,
.resident-board-card__subtile.resident-board-card__tile--action:active {
  transform: scale(0.98);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.resident-board-card__tile--warning {
  background: #FFF8EF;
}

.resident-board-card__tile--info {
  background: #F2FBFF;
}

.resident-board-card__label {
  font-size: 11px;
  color: var(--text-tertiary);
}

.resident-board-card__value {
  margin-top: 6px;
  font-size: 24px;
  line-height: 1;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.04em;
}

.resident-board-card__subgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.resident-board-card__subtile {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.03);
}

.resident-board-card__subtile--warning {
  background: rgba(255, 149, 0, 0.1);
}

.resident-board-card__alert {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 149, 0, 0.1);
}

.resident-board-card__alert--quiet {
  background: rgba(13, 186, 97, 0.08);
}

.resident-board-card__alert-text {
  flex: 1;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.resident-compact-card {
  padding: 14px 14px 12px;
}

.resident-compact-card__header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.resident-compact-card__main {
  flex: 1;
  min-width: 0;
}

.resident-compact-card__doctor {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.4;
}

.resident-compact-card__badges {
  margin-top: 8px;
  gap: 6px;
}

.resident-compact-card__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.resident-meta-tile {
  padding: 10px 12px;
  border-radius: 14px;
  background: #F7F8FA;
}

.resident-meta-tile__label {
  font-size: 11px;
  color: var(--text-tertiary);
}

.resident-meta-tile__value {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.resident-compact-card__summary {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.03);
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.resident-compact-card__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.resident-inline-note {
  padding: 12px 14px;
  margin-bottom: 12px;
  background: rgba(255, 149, 0, 0.08);
}

.resident-inline-note__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.resident-inline-note__desc {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.detail-hero {
  padding: 18px 16px 16px;
  background: linear-gradient(180deg, #FFFFFF 0%, #F7FBF8 100%);
}

.detail-hero__header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.detail-hero__main {
  flex: 1;
  min-width: 0;
}

.detail-hero__name {
  font-size: 22px;
  line-height: 1.05;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.04em;
}

.detail-hero__meta {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.detail-hero__tags {
  margin-top: 10px;
  margin-bottom: 0;
  gap: 6px;
}

.detail-hero__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.detail-summary-tile {
  padding: 12px;
  border-radius: 14px;
  background: #F7F8FA;
}

.detail-summary-tile__label {
  font-size: 11px;
  color: var(--text-tertiary);
}

.detail-summary-tile__value {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
}

.detail-hero__summary {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.03);
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.detail-hero__summary-title {
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
}

.detail-team-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.detail-team-strip__item {
  padding: 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.03);
}

.detail-team-strip__label {
  font-size: 11px;
  color: var(--text-tertiary);
}

.detail-team-strip__value {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 700;
  color: var(--text-primary);
  word-break: break-word;
}

.detail-management-panel {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.03), rgba(255, 255, 255, 0.95));
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.detail-management-panel--danger {
  background: linear-gradient(135deg, rgba(255, 59, 48, 0.1), rgba(255, 255, 255, 0.98));
}

.detail-management-panel--warning {
  background: linear-gradient(135deg, rgba(255, 149, 0, 0.12), rgba(255, 255, 255, 0.98));
}

.detail-management-panel--success {
  background: linear-gradient(135deg, rgba(0, 200, 83, 0.12), rgba(255, 255, 255, 0.98));
}

.detail-management-panel__score {
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 104px;
}

.detail-management-panel__score-num {
  font-size: 34px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.05em;
  color: var(--text-primary);
}

.detail-management-panel__score-label {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-tertiary);
}

.detail-management-panel__main {
  min-width: 0;
}

.detail-management-panel__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.detail-management-panel__title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.detail-management-panel__desc {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.detail-management-panel__insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.detail-management-panel__insight {
  padding: 10px 10px 9px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.detail-management-panel__insight-label {
  font-size: 11px;
  color: var(--text-tertiary);
}

.detail-management-panel__insight-value {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 700;
  color: var(--text-primary);
  word-break: break-word;
}

.detail-care-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.detail-care-strip__item {
  padding: 12px;
  border-radius: 14px;
  background: #F7F8FA;
}

.detail-care-strip__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.detail-care-strip__label {
  font-size: 11px;
  color: var(--text-tertiary);
}

.detail-care-strip__value {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: right;
}

.detail-care-strip__track {
  margin-top: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.detail-care-strip__fill {
  height: 100%;
  border-radius: inherit;
}

.detail-care-strip__fill--success {
  background: linear-gradient(90deg, #5cdb93, #159255);
}

.detail-care-strip__fill--warning {
  background: linear-gradient(90deg, #ffd36f, #d17a00);
}

.detail-care-strip__fill--danger {
  background: linear-gradient(90deg, #ff9e97, #d92d20);
}

.detail-care-strip__fill--info {
  background: linear-gradient(90deg, #7fc3ff, #0a63d8);
}

.tag-editor-section {
  margin-top: 12px;
}

.tag-editor-section:first-of-type {
  margin-top: 0;
}

.tag-editor-section__label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.tag-editor-section__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.tag-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.tag-editor-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tag-editor-chip {
  border: none;
  border-radius: 999px;
  padding: 9px 12px;
  background: rgba(0, 122, 255, 0.08);
  color: #0a63d8;
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.tag-editor-chip--soft {
  background: rgba(15, 23, 42, 0.05);
  color: var(--text-secondary);
}

.tag-editor-chip--neutral {
  background: rgba(255, 149, 0, 0.09);
  color: #a75b00;
}

.tag-editor-chip--ghost {
  background: rgba(0, 200, 83, 0.08);
  color: #0b7f45;
}

.tag-editor-chip--active {
  transform: translateY(-1px);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 16px rgba(0, 200, 83, 0.22);
}

.detail-visual-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.detail-visual-board__item {
  padding: 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.03);
}

.detail-visual-board__item--danger {
  background: rgba(255, 59, 48, 0.08);
}

.detail-visual-board__item--warning {
  background: rgba(255, 149, 0, 0.1);
}

.detail-visual-board__item--success {
  background: rgba(0, 200, 83, 0.08);
}

.detail-visual-board__item--info {
  background: rgba(0, 122, 255, 0.08);
}

.detail-visual-board__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.detail-visual-board__label {
  font-size: 11px;
  color: var(--text-tertiary);
}

.detail-visual-board__value {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.detail-visual-board__track {
  margin-top: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.detail-visual-board__fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(0, 122, 255, 0.7), rgba(0, 122, 255, 1));
}

.workflow-step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.03);
}

.workflow-step__index {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  flex-shrink: 0;
}

.workflow-step__text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.team-settings-list {
  display: grid;
  gap: 10px;
}

.team-settings-member {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.team-settings-member:last-child {
  border-bottom: none;
}

.team-settings-member__name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.team-settings-member__meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}

.team-settings-member__stat {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-tertiary);
  text-align: right;
  white-space: nowrap;
}

.task-overview-card {
  padding: 16px;
  background: linear-gradient(180deg, #FFFFFF 0%, #F7FBF8 100%);
}

.task-overview-card__eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-dark);
}

.task-overview-card__title {
  margin-top: 6px;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.04em;
}

.task-overview-card__desc {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.task-overview-card__metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.task-overview-card__metric {
  padding: 12px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.task-overview-card__metric-label {
  font-size: 11px;
  color: var(--text-tertiary);
}

.task-overview-card__metric-value {
  margin-top: 6px;
  font-size: 24px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-primary);
}

.task-overview-card__focus {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 149, 0, 0.1);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.task-overview-card__focus--success {
  background: rgba(0, 200, 83, 0.12);
  color: #0b6b3a;
}

.task-progress-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.task-progress-item__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.task-progress-item__label {
  color: var(--text-secondary);
  font-weight: 600;
}

.task-progress-item__value {
  color: var(--text-tertiary);
}

.task-progress-item__track {
  margin-top: 6px;
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.task-progress-item__fill {
  height: 100%;
  border-radius: inherit;
}

.task-progress-item__fill--info {
  background: linear-gradient(90deg, #72b6ff, #0a63d8);
}

.task-progress-item__fill--warning {
  background: linear-gradient(90deg, #ffcf7a, #c26c00);
}

.task-progress-item__fill--success {
  background: linear-gradient(90deg, #61d995, #14804e);
}

.task-progress-item__fill--danger {
  background: linear-gradient(90deg, #ff9c9a, #d9363e);
}

.task-progress-item__fill--purple {
  background: linear-gradient(90deg, #bea8ff, #6a50f2);
}

.task-batch-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.task-batch-chip {
  border: none;
  border-radius: 14px;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fff;
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.task-batch-chip strong {
  font-size: 16px;
  line-height: 1;
  font-weight: 800;
}

.task-batch-chip--active {
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px transparent, 0 10px 20px rgba(15, 23, 42, 0.08);
}

.task-batch-chip--primary {
  background: linear-gradient(135deg, rgba(0, 200, 83, 0.14), rgba(0, 122, 255, 0.08));
}

.task-batch-chip--info {
  background: rgba(0, 122, 255, 0.08);
}

.task-batch-chip--warning {
  background: rgba(255, 149, 0, 0.1);
}

.task-batch-chip--success {
  background: rgba(0, 200, 83, 0.1);
}

.task-batch-chip--danger {
  background: rgba(255, 77, 79, 0.12);
}

.task-batch-chip--disabled {
  opacity: 0.45;
}

.task-compact-card {
  padding: 14px 14px 12px;
  cursor: pointer;
  transition: transform 0.24s ease, opacity 0.24s ease, filter 0.24s ease, max-height 0.24s ease, margin 0.24s ease, padding 0.24s ease;
  overflow: hidden;
  max-height: 320px;
}

.task-compact-card--flowing {
  animation: taskFlowOut 0.34s ease forwards;
}

.task-compact-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.task-compact-card__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.task-compact-card__subtitle {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.task-compact-card__counter {
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border-radius: 14px;
  background: #F7F8FA;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-dark);
}

.task-compact-card__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.task-compact-card__meta-block {
  padding: 10px 12px;
  border-radius: 14px;
  background: #F7F8FA;
}

.task-compact-card__meta-label {
  font-size: 11px;
  color: var(--text-tertiary);
}

.task-compact-card__meta-value {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
}

.task-compact-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.task-compact-card__resident {
  font-size: 12px;
  color: var(--text-tertiary);
}

@keyframes taskFlowOut {
  0% {
    opacity: 1;
    transform: scale(1);
    filter: saturate(1);
    max-height: 320px;
  }
  100% {
    opacity: 0;
    transform: scale(0.98);
    filter: saturate(0.9);
    max-height: 0;
  }
}

@media (max-width: 768px) {
  .hero-card__grid--four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-brief-card__grid,
  .detail-hero__grid,
  .task-compact-card__meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-management-panel {
    grid-template-columns: 1fr;
  }

  .detail-management-panel__score {
    min-height: 88px;
  }

  .detail-management-panel__insights,
  .detail-care-strip,
  .task-batch-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 28px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  transition: all 0.2s;
  gap: 6px;
  letter-spacing: -0.2px;
}

.btn:active { transform: scale(0.96); opacity: 0.9; }

.btn--primary {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 200, 83, 0.3);
}

.btn--outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn--danger {
  background: linear-gradient(135deg, #FF6B6B, #FF3B30);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 59, 48, 0.3);
}

.btn--ghost {
  background: var(--primary-light);
  color: var(--primary);
}

.btn--sm {
  height: 32px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
}

.btn--block {
  display: flex;
  width: 100%;
}

.btn--disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ===== Search Bar ===== */
.search-bar {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  background: rgba(118, 118, 128, 0.12);
  border-radius: var(--radius-full);
  margin-bottom: 12px;
  gap: 8px;
}

.search-bar__icon {
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.search-bar__icon svg {
  width: 16px;
  height: 16px;
}

.search-bar__input {
  flex: 1;
  height: 100%;
  font-size: 15px;
  background: none;
  border: none;
}

.search-bar__input::placeholder {
  color: var(--text-quaternary);
}

/* ===== Resident Card ===== */
.resident-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: transform 0.2s;
}

.resident-card:active {
  transform: scale(0.98);
  background: #f0f0f5;
}

.resident-card__risk {
  width: 4px;
  min-height: 56px;
  border-radius: 2px;
  flex-shrink: 0;
  align-self: stretch;
}

.resident-card__risk--high { background: linear-gradient(180deg, #FF6B6B, #FF3B30); }
.resident-card__risk--medium { background: linear-gradient(180deg, #FFA726, #FF9500); }
.resident-card__risk--low { background: linear-gradient(180deg, #66BB6A, #34C759); }

.resident-card__body {
  flex: 1;
  min-width: 0;
}

.resident-card__top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.resident-card__name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.resident-card__info {
  font-size: 13px;
  color: var(--text-tertiary);
}

.resident-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.resident-card__meta {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.6;
}

.resident-card__group {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  margin-top: 6px;
}

.resident-card__group--active {
  color: var(--success);
}

.resident-card__group--inactive {
  color: var(--danger);
}

.resident-card__action {
  flex-shrink: 0;
  align-self: center;
}

/* ===== Followup Card ===== */
.followup-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 10px;
  border-left: 4px solid var(--primary);
  transition: transform 0.2s;
}

.followup-card:active {
  transform: scale(0.98);
}

.followup-card--overdue {
  border-left-color: var(--danger);
}

.followup-card--done {
  border-left-color: var(--success);
  opacity: 0.7;
}

.followup-card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.followup-card__name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.followup-card__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.followup-card__date {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ===== Form Elements ===== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  background: rgba(118, 118, 128, 0.08);
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  font-size: 16px;
  color: var(--text-primary);
  transition: all 0.25s;
}

.form-input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 200, 83, 0.1);
}

.form-input::placeholder {
  color: var(--text-quaternary);
}

.form-textarea {
  width: 100%;
  min-height: 88px;
  padding: 12px 14px;
  background: rgba(118, 118, 128, 0.08);
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  font-size: 16px;
  color: var(--text-primary);
  resize: vertical;
  transition: all 0.25s;
}

.form-textarea:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 200, 83, 0.1);
}

/* ===== Check Tags ===== */
.check-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check-tag {
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  color: var(--text-secondary);
  background: rgba(118, 118, 128, 0.08);
  display: flex;
  align-items: center;
  transition: all 0.25s;
}

.check-tag--active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 500;
}

/* ===== Avatar ===== */
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar--lg {
  width: 56px;
  height: 56px;
  font-size: 22px;
}

.avatar--xl {
  width: 72px;
  height: 72px;
  font-size: 28px;
}

/* ===== Followup Detail Page ===== */
.followup-timeline {
  padding-left: 28px;
  position: relative;
}

.followup-timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: #E5E5EA;
}

.followup-stage {
  position: relative;
  padding: 8px 0 16px;
}

.followup-stage__dot {
  position: absolute;
  left: -23px;
  top: 10px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #E5E5EA;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  z-index: 1;
}

.followup-stage--done .followup-stage__dot {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.followup-stage--current .followup-stage__dot {
  background: var(--info);
  border-color: var(--info);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.15);
}

.followup-stage--future .followup-stage__dot {
  background: #F2F2F7;
  border-color: #E5E5EA;
}

.followup-stage__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.followup-stage__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.followup-stage--future .followup-stage__name {
  color: var(--text-tertiary);
}

.followup-stage__badge {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: var(--radius-full);
  background: var(--info-light);
  color: var(--info);
  font-weight: 500;
}

.followup-stage__date {
  font-size: 12px;
  color: var(--text-tertiary);
}

.followup-stage__content {
  margin-top: 8px;
  padding: 10px 12px;
  background: rgba(0, 122, 255, 0.04);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 122, 255, 0.1);
}

.followup-stage__msg-preview {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 80px;
  overflow: hidden;
}

.followup-data-section {
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.followup-data-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.followup-data-toggle__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.followup-data-toggle__arrow {
  font-size: 12px;
  color: var(--text-tertiary);
  transition: transform 0.3s;
}

.followup-data-toggle__arrow--open {
  transform: rotate(180deg);
}

.history-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 0.5px solid rgba(0,0,0,0.06);
}

.history-item:last-child {
  border-bottom: none;
}

.history-item__indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.history-item__indicator--normal {
  background: var(--success);
}

.history-item__indicator--warning {
  background: var(--warning);
}

.history-item__indicator--danger {
  background: var(--danger);
}

/* ===== Timeline ===== */
.timeline {
  padding-left: 24px;
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #E5E5EA;
}

.timeline__item {
  position: relative;
  padding-bottom: 20px;
}

.timeline__dot {
  position: absolute;
  left: -21px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary-gradient);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--primary-light);
}

.timeline__date {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.timeline__content {
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
}

/* ===== Tabs ===== */
.tabs {
  display: flex;
  background: var(--card);
  border-bottom: 0.5px solid rgba(0,0,0,0.06);
  position: sticky;
  top: calc(var(--nav-height) + var(--safe-top));
  z-index: 50;
}

.tab-item {
  flex: 1;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-secondary);
  position: relative;
  transition: color 0.25s;
  font-weight: 500;
}

.tab-item--active {
  color: var(--primary);
  font-weight: 600;
}

.tab-item--active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  border-radius: 1.5px;
  background: var(--primary-gradient);
}

/* ===== Broadcast ===== */
.broadcast-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.broadcast-stat {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 14px;
  text-align: center;
  box-shadow: var(--shadow);
}

.broadcast-stat__num {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.broadcast-stat__label {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.broadcast-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: transform 0.2s;
}

.broadcast-card:active {
  transform: scale(0.98);
}

.broadcast-card__title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}

.broadcast-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}

/* ===== Template Card ===== */
.template-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 10px;
}

.template-card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.template-card__name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.template-card__meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.template-card__preview {
  font-size: 13px;
  color: var(--text-secondary);
  background: rgba(118, 118, 128, 0.06);
  border-radius: var(--radius-sm);
  padding: 10px;
  line-height: 1.6;
  max-height: 60px;
  overflow: hidden;
}

/* ===== Education Card ===== */
.edu-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 12px;
}

.edu-card__cover {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
}

.edu-card__cover--hypertension { background: linear-gradient(135deg, #FFE0E0, #FFCDD2); }
.edu-card__cover--diabetes { background: linear-gradient(135deg, #FFF3E0, #FFE0B2); }
.edu-card__cover--elderly { background: linear-gradient(135deg, #E3F2FD, #BBDEFB); }
.edu-card__cover--seasonal { background: linear-gradient(135deg, #E8F5E9, #C8E6C9); }

.edu-card__body {
  padding: 12px 14px;
}

.edu-card__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}

.edu-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.edu-card__views {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ===== Info Card ===== */
.info-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
}

.info-row {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 0.5px solid rgba(0,0,0,0.06);
}

.info-row:last-child { border-bottom: none; }

.info-row__label {
  font-size: 14px;
  color: var(--text-tertiary);
  width: 80px;
  flex-shrink: 0;
}

.info-row__value {
  font-size: 14px;
  color: var(--text-primary);
  flex: 1;
}

/* ===== Action Bar ===== */
.action-bar {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.action-bar__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
  border-radius: var(--radius);
  transition: background 0.2s;
}

.action-bar__item:active { background: var(--bg); }

.action-bar__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.action-bar__icon--green { background: var(--primary-light); }
.action-bar__icon--blue { background: var(--info-light); }
.action-bar__icon--orange { background: var(--warning-light); }

.action-bar__label {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ===== Me Page ===== */
.me-header {
  background:
    radial-gradient(circle at top right, rgba(0, 200, 83, 0.14), transparent 34%),
    linear-gradient(135deg, #F9FBFD 0%, #F4FBF7 48%, #EEF7FF 100%);
  padding: 30px 20px 24px;
  text-align: center;
  color: var(--text-primary);
  position: relative;
  margin: -12px -16px 16px;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.me-header::after {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(0, 122, 255, 0.06);
}

.me-header__name {
  font-size: 22px;
  font-weight: 700;
  margin-top: 12px;
  letter-spacing: -0.3px;
}

.me-header__role {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.me-profile-card {
  padding: 16px;
  background: linear-gradient(180deg, #FFFFFF 0%, #F6FAF7 100%);
}

.me-profile-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.me-profile-card__title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}

.me-profile-card__desc {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.me-profile-card__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.me-kv {
  padding: 12px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.me-kv__label {
  font-size: 11px;
  color: var(--text-tertiary);
}

.me-kv__value {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 700;
  color: var(--text-primary);
  word-break: break-word;
}

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

.me-quick-item {
  padding: 14px 12px;
  border-radius: 16px;
  background: #F7F8FA;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}

.me-quick-item:active {
  transform: scale(0.98);
  background: #F0F3F4;
}

.me-quick-item__icon {
  font-size: 24px;
}

.me-quick-item__title {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.me-quick-item__desc {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.me-menu {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 12px;
}

.me-menu__item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 0.5px solid rgba(0,0,0,0.06);
  transition: background 0.2s;
}

.me-menu__item:last-child { border-bottom: none; }
.me-menu__item:active { background: rgba(0,0,0,0.02); }

.me-menu__icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-right: 12px;
}

.me-menu__label {
  flex: 1;
  font-size: 15px;
  color: var(--text-primary);
}

.me-menu__arrow {
  color: var(--text-quaternary);
  font-size: 16px;
}

/* ===== Empty State ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  color: var(--text-tertiary);
}

.empty-state__icon {
  width: 80px;
  height: 80px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state__icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.me-menu__desc {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.dashboard-hero {
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(145deg, #ffffff 0%, #f4f8ff 68%, #eef6ff 100%);
  border: 1px solid rgba(22, 119, 255, 0.1);
  box-shadow: 0 16px 38px rgba(15, 55, 120, 0.08);
}

.dashboard-hero__header,
.task-overview-card__topline,
.dashboard-section__header,
.resident-filter-card__header,
.group-builder-board__top,
.group-builder-board__footer,
.group-builder-doctor-card__top,
.group-builder-doctor-card__actions,
.group-executor-board__progress,
.resident-compact-card__headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-hero__eyebrow,
.group-builder-board__eyebrow {
  font-size: 12px;
  font-weight: 600;
  color: #6f88af;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-hero__title,
.group-builder-board__title {
  margin-top: 4px;
  font-size: 24px;
  font-weight: 800;
  color: #10223e;
}

.dashboard-hero__date {
  font-size: 13px;
  color: #6b7d98;
}

.dashboard-hero__grid,
.dashboard-mini-grid,
.dashboard-assessment-grid,
.group-builder-board__grid,
.dashboard-todo-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-hero__metric,
.dashboard-mini-tile,
.dashboard-assessment-card,
.group-builder-board__tile,
.dashboard-todo-card {
  border: none;
  border-radius: 18px;
  padding: 12px;
  text-align: left;
}

.dashboard-hero__metric { background: #f8fbff; }
.dashboard-hero__metric--blue { background: rgba(22, 119, 255, 0.09); }
.dashboard-hero__metric--slate { background: rgba(80, 94, 118, 0.11); }
.dashboard-hero__metric--teal { background: rgba(12, 167, 160, 0.11); }
.dashboard-hero__metric--amber { background: rgba(255, 149, 0, 0.12); }
.dashboard-hero__metric--rose { background: rgba(255, 82, 128, 0.1); }

.dashboard-hero__metric-value,
.dashboard-mini-tile__value,
.dashboard-assessment-card__value,
.group-builder-board__tile-value,
.dashboard-todo-card__value {
  font-size: 22px;
  font-weight: 800;
  color: #132744;
}

.dashboard-hero__metric-unit {
  margin-left: 2px;
  font-size: 14px;
  font-weight: 700;
}

.dashboard-hero__metric-label,
.dashboard-mini-tile__label,
.dashboard-progress__hint,
.dashboard-assessment-card__label,
.resident-filter-group__label,
.group-builder-board__tile-label {
  font-size: 12px;
  color: #6f7d91;
}

.dashboard-section {
  margin-top: 12px;
  padding: 16px;
  border-radius: 22px;
}

.dashboard-section__title {
  font-size: 16px;
  font-weight: 800;
  color: #10223e;
}

.dashboard-section__meta {
  font-size: 12px;
  color: #7587a3;
}

.dashboard-mini-tile,
.dashboard-assessment-card,
.group-builder-board__tile,
.dashboard-todo-card {
  background: #f7f9fc;
}

.dashboard-mini-tile__hint {
  margin-top: 4px;
  font-size: 12px;
  color: #8b99ad;
}

.dashboard-population-list,
.resident-filter-group__chips,
.group-executor-board__current-meta,
.group-executor-board__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dashboard-population-list { margin-top: 12px; }

.dashboard-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: #eef3fb;
  color: #173052;
}

.dashboard-badge strong { font-size: 14px; }
.dashboard-badge--danger { background: rgba(255, 77, 79, 0.12); color: #b42327; }
.dashboard-badge--warning { background: rgba(255, 149, 0, 0.14); color: #ad6400; }
.dashboard-badge--info { background: rgba(22, 119, 255, 0.12); color: #1858b4; }
.dashboard-badge--success { background: rgba(10, 191, 112, 0.14); color: #0b7a49; }
.dashboard-badge--purple { background: rgba(123, 97, 255, 0.12); color: #5d48bf; }
.dashboard-badge--slate { background: rgba(80, 94, 118, 0.12); color: #42516a; }
.dashboard-badge--pink { background: rgba(255, 82, 128, 0.12); color: #b83873; }

.dashboard-empty-inline {
  font-size: 13px;
  color: #8a95a5;
}

.dashboard-todo-card__top,
.dashboard-progress__top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.dashboard-todo-card__label,
.dashboard-task-row__subtitle,
.group-builder-doctor-card__meta,
.group-executor-card__meta {
  font-size: 12px;
  color: #7b879a;
}

.dashboard-todo-card__hint {
  margin-top: 8px;
  font-size: 12px;
  color: #8b99ad;
}

.dashboard-task-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dashboard-task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: none;
  border-radius: 16px;
  background: #f7f9fc;
  padding: 12px;
  text-align: left;
}

.dashboard-task-row__title,
.resident-compact-card__name,
.group-builder-doctor-card__name,
.group-executor-card__name {
  font-size: 15px;
  font-weight: 700;
  color: #132744;
}

.dashboard-progress-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dashboard-progress__track,
.group-executor-board__track {
  margin-top: 8px;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e8edf5;
  overflow: hidden;
}

.dashboard-progress__fill,
.group-executor-board__fill {
  height: 100%;
  border-radius: 999px;
}

.dashboard-progress__fill--info { background: linear-gradient(90deg, #1677ff, #5aa8ff); }
.dashboard-progress__fill--success { background: linear-gradient(90deg, #08b26a, #3ed89a); }
.dashboard-progress__fill--warning { background: linear-gradient(90deg, #ff9800, #ffc04d); }
.dashboard-progress__fill--purple { background: linear-gradient(90deg, #7b61ff, #b19dff); }
.dashboard-progress__fill--amber { background: linear-gradient(90deg, #ff9b1a, #ffd166); }
.dashboard-progress__fill--slate { background: linear-gradient(90deg, #61738f, #a2aec2); }

.resident-filter-card {
  margin-top: 12px;
  padding: 14px 16px;
}

.resident-filter-card__title {
  font-size: 15px;
  font-weight: 800;
  color: #10223e;
}

.resident-filter-group {
  padding-top: 12px;
  border-top: 1px solid rgba(15, 35, 62, 0.06);
  margin-top: 12px;
}

.resident-filter-group:first-of-type {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.resident-filter-chip {
  border: none;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(22, 119, 255, 0.08);
  color: #20508e;
}

.resident-filter-chip--soft { background: rgba(255, 149, 0, 0.12); color: #965b00; }
.resident-filter-chip--neutral { background: rgba(80, 94, 118, 0.12); color: #506070; }
.resident-filter-chip--ghost { background: rgba(123, 97, 255, 0.1); color: #5d48bf; }
.resident-filter-chip--risk { background: rgba(255, 77, 79, 0.08); color: #b42327; }
.resident-filter-chip--active {
  background: #1677ff;
  color: #fff;
  box-shadow: 0 8px 18px rgba(22, 119, 255, 0.2);
}

.resident-compact-card--visual {
  margin-top: 12px;
  padding: 14px;
  border-radius: 22px;
}

.resident-compact-card__headline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.resident-compact-card__doctor,
.resident-compact-card__summary {
  margin-top: 4px;
  font-size: 12px;
  color: #7f8b9d;
}

.task-compact-card--polished {
  margin-top: 12px;
  border-radius: 22px;
}

.group-builder-board,
.group-executor-board {
  border-radius: 24px;
  padding: 16px;
}

.group-builder-board__tile--warning { background: rgba(255, 149, 0, 0.12); }
.group-builder-board__tile--danger { background: rgba(255, 77, 79, 0.1); }
.group-builder-board__tile--success { background: rgba(8, 178, 106, 0.1); }
.group-builder-board__tile--info { background: rgba(22, 119, 255, 0.1); }

.group-builder-board__footer {
  margin-top: 12px;
  font-size: 13px;
  color: #64748b;
}

.group-builder-list,
.group-executor-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.group-builder-doctor-card,
.group-executor-card {
  padding: 14px;
  border-radius: 20px;
}

.group-builder-doctor-card__samples {
  margin-top: 10px;
  font-size: 13px;
  color: #5f6f84;
}

.group-builder-doctor-card__actions {
  margin-top: 12px;
  justify-content: flex-end;
}

.group-executor-board__title {
  font-size: 16px;
  font-weight: 800;
  color: #10223e;
}

.group-executor-board__meta {
  font-size: 13px;
  color: #667892;
}

.group-executor-board__current {
  margin-top: 14px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(22, 119, 255, 0.06);
}

.group-executor-board__current-name {
  font-size: 18px;
  font-weight: 800;
  color: #10223e;
}

.group-executor-card--active {
  border: 1px solid rgba(22, 119, 255, 0.18);
  box-shadow: 0 12px 32px rgba(22, 119, 255, 0.08);
}

.group-executor-card--done {
  opacity: 0.68;
}

.empty-state__text {
  font-size: 14px;
  text-align: center;
}

/* ===== Loading ===== */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-tertiary);
  font-size: 13px;
  gap: 12px;
}

.loading-screen {
  position: fixed;
  inset: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  gap: 16px;
}

.loading-screen__spinner,
.loading__spinner {
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-screen__spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #E5E5EA;
  border-top-color: var(--primary);
}

.loading__spinner {
  width: 24px;
  height: 24px;
  border: 2px solid #E5E5EA;
  border-top-color: var(--primary);
}

.loading-screen__text {
  font-size: 15px;
  color: var(--text-secondary);
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  z-index: 9999;
  animation: toastIn 0.3s ease;
}

/* ===== Ring Grid (Dashboard) ===== */
.ring-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.ring-item {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ring-item__chart {
  width: 80px;
  height: 80px;
}

.ring-item__label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
  text-align: center;
}

.ring-item__value {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* ===== Alert Item ===== */
.alert-item {
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 3px solid var(--danger);
}

.alert-item__icon {
  font-size: 20px;
  flex-shrink: 0;
}

.alert-item__text {
  font-size: 13px;
  color: var(--text-secondary);
  flex: 1;
}

.alert-item__time {
  font-size: 11px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes countUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fadeInUp {
  animation: fadeInUp 0.4s ease-out both;
}

.animate-delay-1 { animation-delay: 0.05s; }
.animate-delay-2 { animation-delay: 0.1s; }
.animate-delay-3 { animation-delay: 0.15s; }
.animate-delay-4 { animation-delay: 0.2s; }
.animate-delay-5 { animation-delay: 0.25s; }

/* Page transitions */
.slide-left-enter-active,
.slide-left-leave-active,
.slide-right-enter-active,
.slide-right-leave-active {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
  will-change: transform, opacity;
}

.slide-left-enter-from { transform: translateX(80%); opacity: 0; }
.slide-left-leave-to { transform: translateX(-20%); opacity: 0; }
.slide-right-enter-from { transform: translateX(-80%); opacity: 0; }
.slide-right-leave-to { transform: translateX(20%); opacity: 0; }

/* ===== Utility ===== */
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mb-12 { margin-bottom: 12px; }
.px-16 { padding-left: 16px; padding-right: 16px; }
.text-center { text-align: center; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-tertiary { color: var(--text-tertiary); }
.font-bold { font-weight: 700; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* ===== Slide Down Transition ===== */
.slide-down-enter-active {
  transition: all 0.3s ease-out;
}
.slide-down-leave-active {
  transition: all 0.2s ease-in;
}
.slide-down-enter-from {
  opacity: 0;
  max-height: 0;
  transform: translateY(-10px);
}
.slide-down-leave-to {
  opacity: 0;
  max-height: 0;
  transform: translateY(-10px);
}

/* ===== Responsive - PC Adaptation ===== */
@media (min-width: 768px) {
  body {
    max-width: 1200px;
    margin: 0 auto;
    background: #E5E5EA;
  }

  .page {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg);
    min-height: 100vh;
  }

  .page-content {
    padding: 16px 24px;
  }

  /* Stats grid - 4 columns on PC */
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }

  /* Resident cards - 2 columns on PC */
  .resident-card {
    display: inline-flex;
    width: calc(50% - 8px);
    vertical-align: top;
    margin-right: 16px;
  }
  .resident-card:nth-child(2n) {
    margin-right: 0;
  }

  /* Nav bar */
  .nav-bar {
    max-width: 1200px;
    margin: 0 auto;
    left: 50%;
    transform: translateX(-50%);
  }

  /* Tab bar */
  .tab-bar {
    max-width: 1200px;
    margin: 0 auto;
    left: 50%;
    transform: translateX(-50%);
  }

  /* Hero card */
  .hero-card {
    padding: 24px 32px;
  }
  .hero-card__stats {
    gap: 32px;
  }

  /* Search bar */
  .search-bar {
    max-width: 600px;
  }

  /* Filter tabs */
  .filter-tabs {
    justify-content: flex-start;
    gap: 12px;
  }
}

/* Large screen - 3 columns for resident cards */
@media (min-width: 1024px) {
  .resident-card {
    width: calc(33.33% - 11px);
    margin-right: 16px;
  }
  .resident-card:nth-child(2n) {
    margin-right: 16px;
  }
  .resident-card:nth-child(3n) {
    margin-right: 0;
  }
}

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

.detail-account-grid__item {
  background: #f6f8fc;
  border: 1px solid rgba(22, 119, 255, 0.08);
  border-radius: 14px;
  padding: 12px;
}

.detail-account-grid__label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.detail-account-grid__value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.detail-account-meta {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--text-secondary);
}

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

.managed-profile-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 16px;
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.managed-profile-card--active {
  border-color: rgba(22, 119, 255, 0.38);
  box-shadow: 0 12px 28px rgba(22, 119, 255, 0.12);
  transform: translateY(-1px);
}

.managed-profile-card__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.managed-profile-card__name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.managed-profile-card__meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}

.managed-profile-card__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.managed-profile-card__kv {
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  padding: 10px 12px;
}

.managed-profile-card__kv-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.managed-profile-card__kv-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.managed-profile-card__records {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px dashed rgba(15, 23, 42, 0.08);
}

.managed-profile-card__records-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.managed-profile-card__record {
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.5;
}

/* ===== Mobile Touch Optimization ===== */
@media (max-width: 768px) {
  /* 增大所有可点击元素的触控区域 */
  button, .btn, [role="button"], .filter-tab, .tab-item {
    min-height: 36px;
    -webkit-tap-highlight-color: rgba(0,0,0,0.05);
  }
  /* 防止双击缩放 */
  * { touch-action: manipulation; }
  /* 平滑滚动 */
  .page-content { -webkit-overflow-scrolling: touch; }
  /* 横向滚动容器优化 */
  .filter-tabs, [style*="overflow-x:auto"] {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .filter-tabs::-webkit-scrollbar, [style*="overflow-x:auto"]::-webkit-scrollbar {
    display: none;
  }
  /* 列表项之间增加间距(防止误触) */
  .timeline__item { padding: 10px 0; }
  /* 安全区域适配(iPhone X等) */
  .tab-bar { padding-bottom: env(safe-area-inset-bottom, 0); }
  .page { padding-bottom: calc(60px + env(safe-area-inset-bottom, 0)); }
}

/* ===== 管理路径脉动动画 ===== */
@keyframes pathPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(21,101,192,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(21,101,192,0); }
}
.path-node--current {
  animation: pathPulse 2s ease-in-out infinite;
}

/* ===== 操作结果浮层 ===== */
.result-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}
.result-card {
  background: #FFF;
  border-radius: 16px;
  padding: 24px;
  width: 85%;
  max-width: 320px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* 任务卡片消失动画 */
@keyframes taskDismiss {
  to { transform: translateX(100%); opacity: 0; height: 0; padding: 0; margin: 0; }
}
.task-dismissing {
  animation: taskDismiss 0.4s ease forwards;
}

/* 下拉刷新提示 */
.pull-refresh-hint {
  text-align: center;
  padding: 8px;
  font-size: 12px;
  color: #9E9E9E;
  transition: all 0.2s;
}
