/* ===== Design System - WeChat/Apple Style ===== */
:root {
  --primary: #07C160;
  --primary-dark: #06AD56;
  --primary-light: #E7F7EE;
  --danger: #FF3B30;
  --danger-light: #FFE5E3;
  --warning: #FF9500;
  --warning-light: #FFF3E0;
  --success: #34C759;
  --success-light: #E8F8ED;
  --info: #007AFF;
  --info-light: #E5F1FF;
  --text-primary: #1D2129;
  --text-secondary: #4E5969;
  --text-tertiary: #86909C;
  --text-quaternary: #C9CDD4;
  --bg: #F5F5F5;
  --card-bg: #FFFFFF;
  --border: #E5E6EB;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --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;
}

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;
}

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) + 12px);
  background: var(--bg);
}

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

.page-content {
  padding: 12px;
}

/* ===== Navigation Bar ===== */
.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.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid rgba(0,0,0,0.08);
  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;
}

.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;
  font-size: 20px;
  color: var(--text-primary);
  border-radius: 50%;
}

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

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

/* ===== 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.95);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid rgba(0,0,0,0.08);
  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.2s;
  position: relative;
}

.tab-bar__item--active {
  color: var(--primary);
}

.tab-bar__icon {
  font-size: 22px;
  line-height: 1;
  margin-bottom: 2px;
}

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

.tab-bar__badge {
  position: absolute;
  top: 2px;
  right: calc(50% - 18px);
  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-bg);
  border-radius: var(--radius);
  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: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

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

.card__extra::after {
  content: '>';
  font-size: 12px;
}

/* ===== Hero Card (Gradient) ===== */
.hero-card {
  background: linear-gradient(135deg, #07C160 0%, #06AD56 50%, #059B4B 100%);
  border-radius: var(--radius-lg);
  padding: 20px;
  color: #fff;
  box-shadow: 0 4px 16px rgba(7,193,96,0.3);
  margin-bottom: 16px;
}

.hero-card__title {
  font-size: 15px;
  font-weight: 500;
  opacity: 0.9;
  margin-bottom: 16px;
}

.hero-card__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hero-card__item {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.hero-card__num {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.hero-card__label {
  font-size: 13px;
  opacity: 0.85;
}

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

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

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

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

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

.progress__fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #07C160, #34C759);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ===== Quick Actions Grid ===== */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 16px;
}

.quick-grid__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 4px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.quick-grid__item:active {
  background: rgba(0,0,0,0.03);
}

.quick-grid__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.quick-grid__icon--green { background: var(--primary-light); }
.quick-grid__icon--blue { background: var(--info-light); }
.quick-grid__icon--orange { background: var(--warning-light); }
.quick-grid__icon--red { background: var(--danger-light); }

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

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

.tag--hypertension { background: #FF3B30; color: #fff; }
.tag--diabetes { background: #FF9500; color: #fff; }
.tag--elderly { background: #007AFF; color: #fff; }
.tag--pregnant { background: #AF52DE; color: #fff; }
.tag--child { background: #5AC8FA; color: #fff; }
.tag--mental { background: #8E8E93; color: #fff; }
.tag--tuberculosis { background: #FF6482; color: #fff; }

.tag--risk-high { background: var(--danger); color: #fff; }
.tag--risk-medium { background: var(--warning); color: #fff; }
.tag--risk-low { background: var(--success); 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); }

/* ===== Filter Tabs ===== */
.filter-tabs {
  display: flex;
  gap: 8px;
  padding: 12px;
  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-bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
  white-space: nowrap;
}

.filter-tab--active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.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;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 24px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s;
  gap: 6px;
}

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

.btn--primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(7,193,96,0.3);
}

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

.btn--danger {
  background: var(--danger);
  color: #fff;
}

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

.btn--sm {
  height: 32px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: 6px;
}

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

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

/* ===== 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: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text-primary);
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: var(--primary);
  background: #fff;
}

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

.form-textarea {
  width: 100%;
  min-height: 88px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text-primary);
  resize: vertical;
  transition: border-color 0.2s;
}

.form-textarea:focus {
  border-color: var(--primary);
  background: #fff;
}

/* ===== Checkbox Tags (for symptoms etc.) ===== */
.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: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  transition: all 0.2s;
}

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

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

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

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

/* ===== Resident Card ===== */
.resident-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  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);
}

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

.resident-card__risk--high { background: var(--danger); }
.resident-card__risk--medium { background: var(--warning); }
.resident-card__risk--low { background: var(--success); }

.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);
}

.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__action {
  flex-shrink: 0;
  align-self: center;
}

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

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

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

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

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

.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);
}

/* ===== Stat Card ===== */
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  text-align: center;
}

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

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

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

.section-header__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

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

.section-header__more::after {
  content: '>';
  font-size: 12px;
}

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

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.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);
  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-bg);
  border-radius: var(--radius-sm);
  padding: 12px;
  box-shadow: var(--shadow);
}

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

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

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

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

/* ===== 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 {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

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

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

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

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

.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;
}

/* ===== Action Bar ===== */
.action-bar {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--card-bg);
  border-radius: var(--radius);
  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-sm);
  transition: background 0.2s;
}

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

.action-bar__icon {
  font-size: 22px;
}

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

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

.info-row {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 0.5px solid var(--border);
}

.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;
}

/* ===== Avatar ===== */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
}

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

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

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

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes slideInLeft {
  from { transform: translateX(-100%); }
  to { transform: translateX(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: all 0.3s ease;
}

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

/* ===== 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__spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

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

/* ===== Utility ===== */
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-12 { margin-top: 12px; }
.mb-12 { margin-bottom: 12px; }
.px-12 { padding-left: 12px; padding-right: 12px; }
.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; }

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

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

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

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

/* ===== Checkin ===== */
.checkin-card {
  background: linear-gradient(135deg, #07C160 0%, #34C759 100%);
  border-radius: var(--radius-lg);
  padding: 24px;
  color: #fff;
  text-align: center;
  margin-bottom: 16px;
}

.checkin-input-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.checkin-input {
  width: 120px;
  height: 48px;
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  text-align: center;
}

.checkin-input::placeholder {
  color: rgba(255,255,255,0.6);
}

.checkin-unit {
  font-size: 16px;
  font-weight: 500;
}

.meal-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}

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

.meal-card__title {
  font-size: 15px;
  font-weight: 500;
}

.meal-card__cal {
  font-size: 14px;
  color: var(--primary);
  font-weight: 600;
}

.streak-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  justify-content: space-around;
  text-align: center;
}

.streak-item__num {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}

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

/* ===== Template Card ===== */
.template-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  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;
}

.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: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px;
  line-height: 1.6;
  max-height: 60px;
  overflow: hidden;
}

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

.edu-card__cover {
  height: 140px;
  background: linear-gradient(135deg, #E7F7EE 0%, #d4f0e0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

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

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

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

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

/* ===== Dashboard Alert ===== */
.alert-list {
  padding: 0 12px;
}

.alert-item {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  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;
}

/* ===== Responsive ===== */
@media (min-width: 768px) {
  .page {
    max-width: 480px;
    margin: 0 auto;
  }
  .tab-bar {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
  }
  .nav-bar {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* Dashboard page - wider on desktop */
.page--dashboard {
  max-width: none !important;
}

@media (min-width: 768px) {
  .page--dashboard {
    max-width: 960px !important;
    margin: 0 auto;
  }
  .ring-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}
