* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; background: #EEF2F7; color: #1A2332; font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }

.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(135deg, #0F2A4A 0%, #1B4F8A 100%); }
.auth-card { background: #fff; border-radius: 20px; padding: 44px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.auth-card-lg { max-width: 480px; }
.auth-logo { display: block; height: 64px; margin: 0 auto 20px; }
.auth-heading { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 24px; font-weight: 700; text-align: center; color: #0F2A4A; margin-bottom: 4px; }
.auth-sub { text-align: center; color: #6B7A8D; font-size: 14px; margin-bottom: 28px; font-weight: 400; }
.alert-error { background: #FEE2E2; color: #DC2626; padding: 10px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; border: 1px solid #FECACA; font-weight: 500; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 500; color: #374151; margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; padding: 10px 14px; border: 1.5px solid #E1E8F0; border-radius: 10px; font-size: 14px; font-family: inherit; outline: none; transition: border-color 0.2s, box-shadow 0.2s; background: #FAFBFC; color: #1A2332; font-weight: 400; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #1B4F8A; box-shadow: 0 0 0 3px rgba(27,79,138,0.1); background: #fff; }
.field textarea { resize: vertical; line-height: 1.5; }
.btn-primary { width: 100%; padding: 12px; background: #1B4F8A; color: #fff; border: none; border-radius: 10px; font-size: 14px; font-weight: 600; font-family: 'Plus Jakarta Sans', sans-serif; cursor: pointer; margin-top: 8px; transition: all 0.2s; }
.btn-primary:hover { background: #163E6E; }
.btn-primary:disabled { background: #93B4D4; cursor: not-allowed; }
.auth-footer { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 20px; }
.link-btn { background: none; border: none; color: #1B4F8A; font-size: 13px; cursor: pointer; padding: 0; font-weight: 500; }
.link-btn:hover { text-decoration: underline; }
.divider-dot { color: #D1D5DB; }
.success-badge { width: 56px; height: 56px; background: #10B981; color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; margin: 0 auto 16px; }

.shell { display: flex; height: 100vh; overflow: hidden; }
.sidebar { width: 240px; min-width: 240px; background: linear-gradient(180deg, #0D2540 0%, #0F2A4A 100%); display: flex; flex-direction: column; height: 100vh; border-right: 1px solid rgba(255,255,255,0.05); }
.sidebar-header { padding: 20px 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.sidebar-logo { height: 36px; }
.sidebar-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 15px; font-weight: 700; color: #fff; }
.sidebar-nav { flex: 1; padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-btn { width: 100%; text-align: left; padding: 10px 12px; background: none; border: none; color: rgba(255,255,255,0.5); font-size: 13px; font-family: 'Inter', sans-serif; font-weight: 500; border-radius: 8px; cursor: pointer; transition: all 0.15s; position: relative; }
.nav-btn:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.85); }
.nav-btn.active { background: rgba(27,79,138,0.65); color: #fff; }
.nav-btn.active::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 18px; background: #60A5FA; border-radius: 0 3px 3px 0; }
.sidebar-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,0.06); }
.user-chip { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; padding: 8px; border-radius: 8px; background: rgba(255,255,255,0.05); }
.user-ava { width: 32px; height: 32px; background: linear-gradient(135deg, #E8923A, #D97706); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: #fff; flex-shrink: 0; }
.user-name { font-size: 13px; font-weight: 600; color: #fff; }
.user-role { font-size: 11px; color: rgba(255,255,255,0.4); text-transform: capitalize; margin-top: 1px; }
.signout-btn { width: 100%; padding: 8px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); border-radius: 7px; color: rgba(255,255,255,0.55); font-size: 13px; font-family: inherit; cursor: pointer; transition: all 0.15s; font-weight: 500; }
.signout-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }

.main { flex: 1; overflow-y: auto; background: #EEF2F7; }
.shell-body { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.mobile-topbar { display: none; }
.sidebar-overlay { display: none; }

@media (max-width: 768px) {
  .sidebar { position: fixed; left: 0; top: 0; height: 100vh; height: 100svh; z-index: 1000; transform: translateX(-100%); transition: transform 0.25s ease; width: 260px; overflow-y: auto; }
  .sidebar-foot { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .sidebar-open { transform: translateX(0); }
  .sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 999; }
  .mobile-topbar { display: flex; align-items: center; gap: 10px; padding: 11px 16px; background: #0F2A4A; border-bottom: 1px solid rgba(255,255,255,0.07); }
  .hamburger { background: none; border: none; cursor: pointer; display: flex; flex-direction: column; gap: 5px; padding: 4px; flex-shrink: 0; }
  .hamburger span { display: block; width: 20px; height: 2px; background: #fff; border-radius: 2px; }
  .topbar-logo { height: 28px; }
  .topbar-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 14px; font-weight: 700; color: #fff; }
  .shell-body { width: 100%; }
  .auth-card { padding: 28px 20px; }
  .auth-card-lg { padding: 28px 20px; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 550px; }
  .filter-bar { flex-wrap: wrap; }
  .filter-select { flex: 1 1 calc(50% - 4px); }
  .filter-input { flex: 1 1 calc(50% - 4px); }
  .timeline-notes { white-space: normal; }
}

.placeholder-page { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 10px; }
.placeholder-icon { font-size: 40px; opacity: 0.2; }
.placeholder-page h2 { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 18px; color: #374151; font-weight: 600; }
.placeholder-page p { font-size: 13px; color: #9CA3AF; }

.page-wrap { padding: 28px 32px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; }
.page-title-wrap { display: flex; flex-direction: column; gap: 3px; }
.page-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 22px; font-weight: 700; color: #0F2A4A; letter-spacing: -0.01em; }
.page-desc { font-size: 13px; color: #9CA3AF; margin-top: 2px; font-weight: 400; line-height: 1.5; }

.tabs { display: flex; margin-bottom: 20px; border-bottom: 1px solid #E1E8F0; }
.tab-btn { padding: 9px 16px; background: none; border: none; font-size: 13px; font-weight: 500; color: #9CA3AF; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; align-items: center; gap: 6px; font-family: inherit; transition: all 0.15s; }
.tab-btn:hover { color: #374151; }
.tab-btn.active { color: #1B4F8A; border-bottom-color: #1B4F8A; font-weight: 600; }
.tab-badge { background: #EF4444; color: #fff; font-size: 10px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 3px; display: inline-flex; align-items: center; justify-content: center; }

.table-wrap { width: 100%; background: #fff; border-radius: 12px; box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03); overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; border: 1px solid #E8EFF5; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { background: #F8FAFC; padding: 10px 20px; text-align: left; font-size: 11px; font-weight: 600; color: #9CA3AF; text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1px solid #E8EFF5; }
.data-table td { padding: 11px 20px; font-size: 12px; color: #374151; border-bottom: 1px solid #F3F7FB; vertical-align: middle; font-weight: 400; white-space: nowrap; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #FAFBFD; }
.data-table td strong { font-weight: 500; color: #111827; }

.badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 5px; font-size: 12px; font-weight: 500; }
.badge-active { background: #ECFDF5; color: #059669; }
.badge-inactive { background: #F3F4F6; color: #9CA3AF; }
.badge-pending { background: #FFFBEB; color: #D97706; }
.badge-rejected { background: #FEF2F2; color: #EF4444; }
.badge-super-admin { background: #F5F3FF; color: #7C3AED; }
.badge-admin { background: #EFF6FF; color: #3B82F6; }
.badge-user { background: #F9FAFB; color: #6B7A8D; border: 1px solid #E5E7EB; }

.action-btns { display: flex; gap: 6px; }
.icon-btn { width: 30px; height: 30px; border-radius: 6px; border: 1px solid; cursor: pointer; transition: all 0.15s; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon-btn:disabled { opacity: 0.25; cursor: not-allowed; pointer-events: none; }
.icon-btn-success { border-color: #A7F3D0; color: #059669; background: #ECFDF5; }
.icon-btn-success:hover { background: #D1FAE5; }
.icon-btn-danger { border-color: #FECACA; color: #EF4444; background: #FEF2F2; }
.icon-btn-danger:hover { background: #FEE2E2; }
.icon-btn-warn { border-color: #FDE68A; color: #D97706; background: #FFFBEB; }
.icon-btn-warn:hover { background: #FEF3C7; }
.icon-btn-edit { border-color: #BFDBFE; color: #1E40AF; background: #EFF6FF; }
.icon-btn-edit:hover { background: #DBEAFE; }
.icon-btn-ghost { border-color: #E5E7EB; color: #6B7A8D; background: #F9FAFB; }
.icon-btn-ghost:hover { background: #F3F4F6; color: #374151; }

.action-menu { position: relative; display: inline-flex; }
.menu-trigger { width: 28px; height: 28px; border-radius: 6px; border: 1px solid #E5E7EB; background: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: #9CA3AF; transition: all 0.15s; }
.menu-trigger:hover { background: #F3F4F6; border-color: #D1D5DB; color: #374151; }
.menu-dropdown { position: fixed; background: #fff; border: 1px solid #E5E7EB; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.06); min-width: 160px; z-index: 500; overflow: hidden; }
.menu-item { width: 100%; padding: 9px 14px; background: none; border: none; text-align: left; font-size: 13px; font-weight: 400; font-family: inherit; cursor: pointer; display: flex; align-items: center; gap: 8px; color: #374151; transition: background 0.1s; }
.menu-item:hover { background: #F8FAFC; }
.menu-item-danger { color: #EF4444; }
.menu-item-danger:hover { background: #FEF2F2; }
.menu-item-success { color: #059669; }
.menu-item-success:hover { background: #ECFDF5; }
.menu-item-disabled { opacity: 0.3; cursor: not-allowed; pointer-events: none; }

.modal-overlay { position: fixed; inset: 0; background: rgba(15,42,74,0.4); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 24px; backdrop-filter: blur(3px); }
.modal-card { background: #fff; border-radius: 16px; padding: 28px; width: 100%; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,0.12); border: 1px solid #E8EFF5; }
.modal-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 18px; font-weight: 700; color: #0F2A4A; margin-bottom: 6px; }
.modal-body { font-size: 13px; color: #6B7A8D; margin-bottom: 4px; line-height: 1.6; font-weight: 400; }
.modal-actions { display: flex; gap: 8px; margin-top: 20px; justify-content: flex-end; }
.btn-secondary { padding: 9px 18px; background: #F3F4F6; border: 1px solid #E5E7EB; border-radius: 8px; font-size: 13px; font-weight: 500; color: #374151; cursor: pointer; font-family: inherit; transition: all 0.15s; }
.btn-secondary:hover { background: #E5E7EB; }
.btn-confirm { padding: 9px 18px; background: #1B4F8A; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; color: #fff; cursor: pointer; font-family: inherit; transition: background 0.15s; }
.btn-confirm:hover { background: #163E6E; }
.btn-confirm:disabled { background: #93B4D4; cursor: not-allowed; }
.btn-confirm-danger { padding: 9px 18px; background: #EF4444; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; color: #fff; cursor: pointer; font-family: inherit; transition: background 0.15s; }
.btn-confirm-danger:hover { background: #DC2626; }

.toast { position: fixed; top: 24px; bottom: auto; left: 50%; transform: translateX(-50%); background: #111827; color: #fff; padding: 11px 20px; border-radius: 8px; font-size: 13px; font-weight: 500; z-index: 3000; white-space: nowrap; box-shadow: 0 4px 16px rgba(0,0,0,0.15); }

.empty-state { text-align: center; padding: 48px 24px; }
.empty-icon { font-size: 32px; margin-bottom: 8px; opacity: 0.3; }
.empty-state p { font-size: 13px; font-weight: 500; color: #9CA3AF; }
.loading-cell { text-align: center; color: #9CA3AF; padding: 40px; font-size: 13px; }

.filter-bar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.filter-input { padding: 8px 12px; border: 1px solid #E1E8F0; border-radius: 8px; font-size: 13px; font-family: inherit; outline: none; background: #fff; color: #1A2332; min-width: 200px; transition: border-color 0.2s; font-weight: 400; }
.filter-input:focus { border-color: #1B4F8A; box-shadow: 0 0 0 3px rgba(27,79,138,0.08); }
.filter-select { padding: 8px 12px; border: 1px solid #E1E8F0; border-radius: 8px; font-size: 13px; font-family: inherit; outline: none; background: #fff; color: #374151; cursor: pointer; font-weight: 400; }
.filter-select:focus { border-color: #1B4F8A; }

.pagination { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-top: 1px solid #F3F7FB; }
.pagination-info { font-size: 13px; color: #9CA3AF; font-weight: 400; }
.pagination-btns { display: flex; gap: 3px; }
.page-btn { padding: 5px 10px; border: 1px solid #E1E8F0; border-radius: 6px; background: #fff; font-size: 13px; font-weight: 500; color: #374151; cursor: pointer; transition: all 0.15s; font-family: inherit; }
.page-btn:hover:not(:disabled) { background: #F0F4F8; }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.page-btn.active { background: #1B4F8A; border-color: #1B4F8A; color: #fff; }

.num-cell { color: #C4CDD6; font-size: 13px; font-weight: 400; width: 48px; }
.you-tag { font-size: 11px; color: #3B82F6; font-weight: 500; margin-left: 6px; background: #EFF6FF; padding: 1px 6px; border-radius: 4px; border: 1px solid #BFDBFE; }

.back-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; color: #6B7A8D; font-size: 13px; font-weight: 500; cursor: pointer; padding: 0; font-family: inherit; margin-bottom: 20px; transition: color 0.15s; }
.back-btn:hover { color: #1B4F8A; }

.btn-add { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; background: #1B4F8A; color: #fff; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; transition: background 0.15s; white-space: nowrap; }
.btn-add:hover { background: #163E6E; }

.resident-panel { background: #fff; border-radius: 12px; padding: 20px 24px; margin-bottom: 20px; border: 1px solid #E8EFF5; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.resident-panel-name { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 18px; font-weight: 700; color: #0F2A4A; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.resident-panel-info { display: flex; flex-wrap: wrap; gap: 20px 32px; }
.resident-panel-field { display: flex; flex-direction: column; gap: 3px; min-width: 130px; }
.resident-panel-label { font-size: 11px; font-weight: 600; color: #9CA3AF; text-transform: uppercase; letter-spacing: 0.05em; }
.resident-panel-value { font-size: 13px; color: #374151; font-weight: 400; }
.archive-badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 5px; font-size: 11px; font-weight: 600; background: #FEF2F2; color: #EF4444; border: 1px solid #FECACA; }

.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 15px; font-weight: 700; color: #0F2A4A; }

.stage-badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 5px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.stage-1 { background: #F3F4F6; color: #6B7280; }
.stage-2 { background: #F5F3FF; color: #7C3AED; }
.stage-3 { background: #EFF6FF; color: #2563EB; }
.stage-4 { background: #FFF7ED; color: #EA580C; }
.stage-5 { background: #ECFEFF; color: #0891B2; }
.stage-6 { background: #F0FDF4; color: #16A34A; }
.stage-7 { background: #FEFCE8; color: #CA8A04; }
.stage-8 { background: #DCFCE7; color: #15803D; }

.priority-high { background: #FEF2F2; color: #EF4444; border-radius: 5px; padding: 3px 8px; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; }
.priority-medium { background: #FFFBEB; color: #D97706; border-radius: 5px; padding: 3px 8px; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; }
.priority-low { background: #F0FDF4; color: #16A34A; border-radius: 5px; padding: 3px 8px; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; }

.care-card { background: #fff; border: 1px solid #E8EFF5; border-radius: 10px; padding: 16px 20px; margin-bottom: 10px; transition: box-shadow 0.15s; border-left-width: 4px; }
.care-card-high { border-left-color: #EF4444; }
.care-card-medium { border-left-color: #F59E0B; }
.care-card-low { border-left-color: #10B981; }
.care-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.care-card-resolved { opacity: 0.55; }
.care-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.care-card-specialty { font-size: 14px; font-weight: 600; color: #111827; flex: 1; min-width: 120px; }
.care-card-meta { display: flex; flex-wrap: wrap; gap: 14px 28px; margin-bottom: 12px; }
.care-card-meta-item { display: flex; flex-direction: column; gap: 2px; }
.care-card-meta-label { font-size: 11px; color: #9CA3AF; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.care-card-meta-value { font-size: 13px; color: #374151; }
.care-card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 1px solid #F3F7FB; flex-wrap: wrap; gap: 8px; }
.care-card-updated { font-size: 12px; color: #9CA3AF; }
.care-card-actions { display: flex; gap: 6px; }
.roadblock-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: #EF4444; font-weight: 600; background: #FEF2F2; padding: 2px 7px; border-radius: 4px; }

.icon-btn-advance { border-color: #A5B4FC; color: #4F46E5; background: #EEF2FF; }
.icon-btn-advance:hover { background: #E0E7FF; }

.stage-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 12px 0 16px; }
.stage-option { padding: 10px 12px; border: 1.5px solid #E5E7EB; border-radius: 8px; background: #fff; cursor: pointer; font-size: 12px; font-weight: 500; color: #374151; font-family: inherit; text-align: left; transition: all 0.15s; line-height: 1.4; }
.stage-option:hover:not(:disabled) { border-color: #1B4F8A; background: #EFF6FF; color: #1B4F8A; }
.stage-option.current { border-color: #1B4F8A; background: #1B4F8A; color: #fff; cursor: default; pointer-events: none; }
.stage-option.selected { border-color: #059669; background: #ECFDF5; color: #059669; }

.history-list { display: flex; flex-direction: column; }
.history-item { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid #F3F7FB; }
.history-item:last-child { border-bottom: none; }
.history-dot { width: 8px; height: 8px; border-radius: 50%; background: #1B4F8A; flex-shrink: 0; margin-top: 4px; }
.history-content { flex: 1; }
.history-stages { font-size: 13px; font-weight: 500; color: #111827; margin-bottom: 3px; }
.history-notes { font-size: 12px; color: #6B7A8D; margin-bottom: 4px; font-style: italic; }
.history-meta { font-size: 11px; color: #9CA3AF; }

.toggle-wrap { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #6B7A8D; font-weight: 500; cursor: pointer; user-select: none; }
.toggle-track { width: 36px; height: 20px; background: #E5E7EB; border-radius: 20px; position: relative; transition: background 0.2s; cursor: pointer; flex-shrink: 0; }
.toggle-track.on { background: #1B4F8A; }
.toggle-thumb { width: 14px; height: 14px; background: #fff; border-radius: 50%; position: absolute; top: 3px; left: 3px; transition: left 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.toggle-track.on .toggle-thumb { left: 19px; }

.empty-care { text-align: center; padding: 40px 24px; background: #fff; border-radius: 12px; border: 1px solid #E8EFF5; }

.dash-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 12px; padding: 20px 22px; border: 1px solid #E8EFF5; box-shadow: 0 1px 2px rgba(0,0,0,0.04); display: flex; flex-direction: column; gap: 6px; }
.stat-card-label { font-size: 11px; font-weight: 600; color: #9CA3AF; text-transform: uppercase; letter-spacing: 0.06em; }
.stat-card-value { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 32px; font-weight: 800; color: #0F2A4A; line-height: 1; }
.stat-card-value.stat-red { color: #EF4444; }
.stat-card-value.stat-amber { color: #D97706; }
.stat-card-value.stat-green { color: #059669; }
.stat-card-desc { font-size: 12px; color: #9CA3AF; font-weight: 400; }
.dash-lower { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.dash-panel { background: #fff; border-radius: 12px; border: 1px solid #E8EFF5; box-shadow: 0 1px 2px rgba(0,0,0,0.04); overflow: hidden; }
.dash-panel-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 14px; font-weight: 700; color: #0F2A4A; padding: 16px 20px; border-bottom: 1px solid #F3F7FB; }
.stage-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 20px; border-bottom: 1px solid #F3F7FB; font-size: 13px; }
.stage-row:last-child { border-bottom: none; }
.stage-row-label { display: flex; align-items: center; gap: 8px; color: #374151; font-weight: 400; }
.stage-row-count { font-weight: 700; font-family: 'Plus Jakarta Sans', sans-serif; color: #0F2A4A; font-size: 15px; }
.stage-row-count.zero { color: #D1D5DB; font-weight: 500; font-size: 13px; }
.priority-row { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid #F3F7FB; }
.priority-row:last-child { border-bottom: none; }
.priority-bar-wrap { flex: 1; background: #F3F7FB; border-radius: 4px; height: 8px; overflow: hidden; }
.priority-bar { height: 100%; border-radius: 4px; transition: width 0.6s ease; }
.priority-bar-high { background: #EF4444; }
.priority-bar-medium { background: #F59E0B; }
.priority-bar-low { background: #10B981; }
.priority-row-label { font-size: 13px; font-weight: 500; color: #374151; width: 60px; }
.priority-row-count { font-size: 13px; font-weight: 700; color: #0F2A4A; width: 24px; text-align: right; font-family: 'Plus Jakarta Sans', sans-serif; }
.activity-feed { background: #fff; border-radius: 12px; border: 1px solid #E8EFF5; box-shadow: 0 1px 2px rgba(0,0,0,0.04); overflow: hidden; }
.activity-item { display: flex; gap: 14px; padding: 13px 20px; border-bottom: 1px solid #F3F7FB; align-items: flex-start; }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: #1B4F8A; flex-shrink: 0; margin-top: 5px; }
.activity-body { flex: 1; min-width: 0; }
.activity-resident { font-size: 13px; font-weight: 600; color: #111827; }
.activity-specialty { font-size: 12px; color: #6B7A8D; margin-bottom: 3px; }
.activity-stages { font-size: 12px; color: #374151; margin-bottom: 2px; }
.activity-notes { font-size: 12px; color: #9CA3AF; font-style: italic; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-meta { font-size: 11px; color: #C4CDD6; }
.dash-loading { display: flex; align-items: center; justify-content: center; padding: 80px 24px; color: #9CA3AF; font-size: 13px; }
@media (max-width: 768px) {
  .dash-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-lower { grid-template-columns: 1fr; }
  .page-wrap { padding: 20px 16px; }
  .table-wrap { border-radius: 0; border-left: none; border-right: none; box-shadow: none; }
  .filter-input { min-width: 0; }
  .toast { top: 68px; }
}

.activity-feed-head { padding: 16px 20px; border-bottom: 1px solid #F3F7FB; }
.activity-feed-sub { font-size: 12px; color: #9CA3AF; font-weight: 400; margin-top: 2px; }
.timeline { padding: 8px 20px 4px; }
.timeline-row { display: flex; gap: 14px; position: relative; padding-bottom: 18px; }
.timeline-row::before { content: ''; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: #EEF2F7; }
.timeline-row:last-child { padding-bottom: 8px; }
.timeline-row:last-child::before { display: none; }
.timeline-badge { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; z-index: 1; }
.timeline-badge-start { background: #EFF6FF; color: #1B4F8A; }
.timeline-badge-move { background: #F8FAFC; color: #6B7A8D; border: 1px solid #E8EFF5; }
.timeline-badge-resolved { background: #ECFDF5; color: #059669; }
.timeline-main { flex: 1; min-width: 0; display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.timeline-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.timeline-resident { font-size: 13px; font-weight: 600; color: #111827; }
.timeline-stages { font-size: 12px; color: #374151; }
.timeline-notes { font-size: 12px; color: #9CA3AF; font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline-sub { font-size: 11px; color: #C4CDD6; }
.timeline-time { font-size: 11px; color: #9CA3AF; white-space: nowrap; flex-shrink: 0; text-align: right; padding-top: 2px; }

@media (max-width: 768px) {
  .timeline-main { flex-direction: column; gap: 2px; }
  .timeline-time { text-align: left; }
  .timeline-notes { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
}

.checklist-wrap { margin: 4px 0 12px; }
.checklist-toggle { background: none; border: none; color: #1B4F8A; font-size: 12px; font-weight: 600; cursor: pointer; padding: 4px 0; font-family: inherit; }
.checklist-toggle:hover { text-decoration: underline; }
.checklist-loading { font-size: 12px; color: #9CA3AF; padding: 8px 0; }
.checklist { margin-top: 8px; border: 1px solid #F0F4F8; border-radius: 8px; overflow: hidden; }
.checklist-head { display: flex; align-items: center; gap: 12px; padding: 7px 12px; background: #F8FAFC; border-bottom: 1px solid #EEF2F7; }
.checklist-head span { font-size: 10px !important; font-weight: 600 !important; color: #9CA3AF !important; text-transform: uppercase; letter-spacing: 0.05em; font-style: normal !important; }
.checklist-row { border-bottom: 1px solid #F3F7FB; }
.checklist-row:last-child { border-bottom: none; }
.checklist-line { width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: none; border: none; font-family: inherit; text-align: left; }
.checklist-row-current .checklist-line { background: #F5F9FF; }
.checklist-mark { width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.checklist-mark-done { background: #ECFDF5; color: #059669; }
.checklist-mark-current { background: #1B4F8A; color: #fff; }
.checklist-mark-todo { background: #fff; border: 1.5px solid #E1E8F0; }
.checklist-name { width: 220px; flex-shrink: 0; font-size: 12px; color: #6B7A8D; display: flex; align-items: center; gap: 8px; }
.checklist-row-done .checklist-name { color: #374151; }
.checklist-row-current .checklist-name { color: #0F2A4A; font-weight: 600; }
.checklist-current-tag { font-size: 10px; font-weight: 600; color: #1B4F8A; background: #EFF6FF; border: 1px solid #BFDBFE; padding: 1px 6px; border-radius: 4px; white-space: nowrap; }
.checklist-note-col { flex: 1; min-width: 100px; font-size: 12px; color: #6B7A8D; font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.checklist-by-col { width: 130px; flex-shrink: 0; font-size: 11px; color: #9CA3AF; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.checklist-date { width: 150px; flex-shrink: 0; font-size: 11px; color: #9CA3AF; white-space: nowrap; text-align: right; margin-left: auto; }

@media (max-width: 768px) {
  .checklist-head { display: none; }
  .checklist-line { flex-wrap: wrap; align-items: flex-start; }
  .checklist-name { width: auto; flex: 1; }
  .checklist-note-col { width: 100%; flex-basis: 100%; padding-left: 30px; white-space: normal; }
  .checklist-by-col { width: auto; padding-left: 30px; }
  .checklist-date { width: auto; text-align: left; margin-left: 0; }
}

.checklist-move-hint { font-size: 10px; font-weight: 600; color: #1B4F8A; background: #EFF6FF; border: 1px solid #BFDBFE; padding: 1px 6px; border-radius: 4px; opacity: 0; transition: opacity 0.12s; white-space: nowrap; }
.checklist-row:hover .checklist-move-hint { opacity: 1; }
.checklist-row:hover .checklist-line { background: #FAFBFD; }