* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  background: #f4f6f9;
  color: #333;
}

/* ── LOGIN PAGE ── */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1B3A6B;
}

.login-box {
  background: white;
  border-radius: 12px;
  padding: 40px;
  width: 400px;
  max-width: 95vw;
  box-shadow: 0 8px 40px rgba(0,0,0,0.25);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo h1 {
  font-size: 20px;
  font-weight: 600;
  color: #1B3A6B;
  margin-bottom: 6px;
}

.login-logo p {
  font-size: 13px;
  color: #666;
  margin-bottom: 6px;
}

.login-logo span {
  display: inline-block;
  background: #E1F5EE;
  color: #0f6e56;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.login-error {
  background: #FCEBEB;
  color: #A32D2D;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 12px;
  margin-bottom: 16px;
  display: none;
  border: 1px solid #f5c2c2;
}

.field-group {
  margin-bottom: 16px;
}

.field-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #444;
  margin-bottom: 6px;
}

.field-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d0d7e2;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: #333;
  background: #f9fafb;
  transition: border-color 0.15s;
}

.field-group input:focus {
  outline: none;
  border-color: #1B3A6B;
  background: white;
}

.login-btn {
  width: 100%;
  padding: 11px;
  background: #1D9E75;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.15s;
}

.login-btn:hover {
  background: #0f6e56;
}

.login-btn:active {
  transform: scale(0.99);
}

.login-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #eee;
  font-size: 10px;
  color: #999;
  text-align: center;
  line-height: 1.6;
}
/* ── APP LAYOUT ── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  width: 230px;
  background: #1B3A6B;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
}

.sidebar-logo {
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo h1 {
  color: white;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}

.sidebar-logo p {
  color: rgba(255,255,255,0.5);
  font-size: 11px;
}

.sidebar-nav {
  padding: 12px 8px;
  flex: 1;
  overflow-y: auto;
}

.nav-section {
  font-size: 9.5px;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 10px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 6px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 13px;
  transition: background 0.15s;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: white;
}

.nav-item.active {
  background: #1D9E75;
  color: white;
}

.nav-icon {
  font-size: 15px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-user {
  margin-bottom: 10px;
}

.sidebar-user strong {
  display: block;
  color: white;
  font-size: 12px;
}

.sidebar-user span {
  color: rgba(255,255,255,0.45);
  font-size: 10px;
}

.signout-btn {
  display: block;
  text-align: center;
  padding: 7px;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  border-radius: 6px;
  text-decoration: none;
  font-size: 12px;
  transition: background 0.15s;
}

.signout-btn:hover {
  background: rgba(255,255,255,0.2);
  color: white;
}

/* ── MAIN AREA ── */
.main {
  flex: 1;
  margin-left: 230px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── TOPBAR ── */
.topbar {
  background: white;
  border-bottom: 1px solid #e0e4eb;
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar h2 {
  font-size: 16px;
  font-weight: 500;
  color: #1B3A6B;
}

.topbar-right {
  font-size: 12px;
  color: #888;
}

/* ── CONTENT ── */
.content {
  padding: 24px;
  flex: 1;
}

/* ── STAT CARDS ── */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  background: white;
  border: 1px solid #e0e4eb;
  border-radius: 10px;
  padding: 16px 20px;
}

.stat-label {
  font-size: 12px;
  color: #888;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 28px;
  font-weight: 500;
  color: #1B3A6B;
}

/* ── SECTION HEADER ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: #1B3A6B;
}

.section-link {
  font-size: 12px;
  color: #1D9E75;
  text-decoration: none;
}

.section-link:hover {
  text-decoration: underline;
}

/* ── QUICK ACTIONS ── */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 8px;
}

.action-card {
  background: white;
  border: 1px solid #e0e4eb;
  border-radius: 10px;
  padding: 16px 12px;
  text-align: center;
  text-decoration: none;
  color: #333;
  transition: box-shadow 0.15s, transform 0.15s;
  cursor: pointer;
}

.action-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.action-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin: 0 auto 10px;
}

.action-label {
  font-size: 12px;
  font-weight: 600;
  color: #1B3A6B;
  margin-bottom: 4px;
}

.action-sub {
  font-size: 10px;
  color: #999;
}

/* ── RESIDENTS OVERVIEW ── */
.residents-overview {
  background: white;
  border: 1px solid #e0e4eb;
  border-radius: 10px;
  overflow: hidden;
}

.resident-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid #f0f2f5;
}

.resident-row:last-child {
  border-bottom: none;
}

.resident-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #E1F5EE;
  color: #0f6e56;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}

.resident-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.resident-info strong {
  font-size: 13px;
  color: #1B3A6B;
}

.resident-info span {
  font-size: 11px;
  color: #888;
}

.resident-actions {
  display: flex;
  gap: 6px;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #d0d7e2;
  background: white;
  color: #333;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}

.btn:hover {
  background: #f4f6f9;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 11px;
}

.btn-primary {
  background: #1D9E75;
  color: white;
  border-color: #1D9E75;
}

.btn-primary:hover {
  background: #0f6e56;
  border-color: #0f6e56;
  color: white;
}
/* ── RESIDENT CARDS ── */
.resident-card {
  background: white;
  border: 1px solid #e0e4eb;
  border-radius: 10px;
  margin-bottom: 16px;
  overflow: hidden;
}

.resident-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid #f0f2f5;
}

.resident-avatar.large {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #E1F5EE;
  color: #0f6e56;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 15px;
  flex-shrink: 0;
}

.resident-card-info {
  flex: 1;
}

.resident-card-name {
  font-size: 15px;
  font-weight: 600;
  color: #1B3A6B;
  margin-bottom: 5px;
}

.resident-card-meta {
  font-size: 12px;
  color: #666;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.resident-card-body {
  padding: 16px 20px;
  border-bottom: 1px solid #f0f2f5;
}

.resident-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-label {
  font-size: 10px;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-value {
  font-size: 13px;
  color: #333;
}

.detail-value.allergy {
  color: #A32D2D;
  font-weight: 500;
}

.resident-card-footer {
  padding: 12px 20px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  background: #fafbfc;
}

/* ── BADGES ── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

.badge-green {
  background: #EAF3DE;
  color: #3B6D11;
}

.badge-red {
  background: #FCEBEB;
  color: #A32D2D;
}

.badge-gray {
  background: #F1EFE8;
  color: #5F5E5A;
}

.badge-blue {
  background: #E6F1FB;
  color: #185FA5;
}

.badge-amber {
  background: #FAEEDA;
  color: #854F0B;
}

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-box {
  background: white;
  border-radius: 12px;
  width: 580px;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 40px rgba(0,0,0,0.2);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid #e0e4eb;
}

.modal-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: #1B3A6B;
}

.modal-close {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #999;
  padding: 4px;
}

.modal-close:hover {
  color: #333;
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e0e4eb;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── FORM HELPERS ── */
.field-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d0d7e2;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: #333;
  background: #f9fafb;
}

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 14px;
  margin-bottom: 16px;
}

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1B3A6B;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
/* ── SHIFT REPORT ── */
.sr-page {
  background: white;
  border: 1px solid #e0e4eb;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 20px;
}

.sr-header {
  background: #1B3A6B;
  color: white;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.sr-header h2 {
  font-size: 17px;
  font-weight: 500;
}

.sr-subtitle {
  font-size: 10px;
  opacity: .65;
  margin-top: 2px;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.sr-header-meta {
  display: flex;
  gap: 20px;
  flex-shrink: 0;
  align-items: flex-end;
}

.sr-meta-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sr-meta-label {
  font-size: 10px;
  opacity: .65;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.sr-meta-value {
  color: white;
  font-size: 13px;
  font-weight: 500;
  padding: 5px 0;
}

.sr-meta-input {
  background: rgba(255,255,255,0.13);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 5px 9px;
  font-size: 12px;
  font-family: inherit;
  border-radius: 4px;
  min-width: 160px;
}

.sr-meta-input option {
  background: #1B3A6B;
}

.sr-shift-banner {
  padding: 9px 24px;
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 2px solid rgba(255,255,255,0.1);
}

.shift-day  { background: #1B3A6B; }
.shift-eve  { background: #2D5F8A; }
.shift-noc  { background: #1A3550; }

.sr-shift-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.sr-shift-time {
  font-size: 11px;
  opacity: .7;
  margin-left: 4px;
}

.sr-banner-select {
  background: rgba(255,255,255,0.13);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 4px 8px;
  font-size: 11px;
  font-family: inherit;
  border-radius: 4px;
}

.sr-banner-select option {
  background: #1B3A6B;
}

.sr-section {
  border-bottom: 1px solid #D0D7E2;
}

.sr-section-title {
  background: #F4F6F9;
  padding: 5px 24px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #1B3A6B;
  border-bottom: 1px solid #D0D7E2;
  border-top: 1px solid #D0D7E2;
}

.sr-wac {
  font-weight: 400;
  opacity: .5;
  font-size: 9.5px;
  margin-left: 6px;
  letter-spacing: 0;
  text-transform: none;
}

.sr-section-body {
  padding: 10px 24px 12px;
}

.sr-adl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 5px;
  margin-bottom: 6px;
}

.sr-cb-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-bottom: 6px;
}

.sr-cb-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 5px;
  margin-bottom: 6px;
}

.sr-cb-grid-4 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 5px;
  margin-bottom: 6px;
}

.sr-cb-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  padding: 5px 10px;
  border-radius: 4px;
  background: #F4F6F9;
  border: 1px solid #D0D7E2;
}

.sr-cb-label {
  font-weight: 700;
  font-size: 11.5px;
  color: #1B3A6B;
  min-width: 110px;
  flex-shrink: 0;
}

.sr-cb-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 12px;
  align-items: center;
}

.sr-cb-opt {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: 12px;
  user-select: none;
  white-space: nowrap;
}

.sr-cb-opt input[type=radio] {
  width: 14px;
  height: 14px;
  accent-color: #1B3A6B;
  cursor: pointer;
}

.sr-vitals-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.sr-vital-box {
  background: #F4F6F9;
  border: 1px solid #D0D7E2;
  border-radius: 4px;
  padding: 6px 10px;
}

.sr-vital-box label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: #1B3A6B;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 3px;
}

.sr-vital-box input {
  width: 100%;
  border: none;
  border-bottom: 1.5px solid #D0D7E2;
  font-size: 12px;
  font-family: inherit;
  padding: 2px 0;
  background: transparent;
  color: #333;
  outline: none;
}

.sr-vital-box input:focus {
  border-bottom-color: #1B3A6B;
}

.sr-notes-area {
  margin-top: 6px;
}

.sr-notes-area label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: #1B3A6B;
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.sr-notes-area textarea {
  width: 100%;
  border: 1px solid #D0D7E2;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12px;
  font-family: inherit;
  color: #333;
  resize: vertical;
  background: #F4F6F9;
  outline: none;
  line-height: 1.6;
}

.sr-notes-area textarea:focus {
  border-color: #4A7FB5;
  background: white;
}

.sr-field-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.sr-field-row label {
  font-weight: 700;
  font-size: 11.5px;
  color: #1B3A6B;
  white-space: nowrap;
}

.sr-inline-input {
  border: none;
  border-bottom: 1.5px solid #D0D7E2;
  font-size: 12px;
  font-family: inherit;
  padding: 2px 4px;
  background: transparent;
  color: #333;
  outline: none;
}

.sr-wac-foot {
  font-size: 10px;
  color: #888;
  font-style: italic;
  padding: 4px 24px 6px;
  border-top: 1px solid #D0D7E2;
}

.sr-sig-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 8px;
  padding: 10px 24px 14px;
  background: #D6E4F0;
  border-top: 2px solid #1B3A6B;
}

.sr-sig-box label,
.sr-sig-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: #1B3A6B;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 4px;
}

.sr-sig-box input {
  width: 100%;
  border: none;
  border-bottom: 1.5px solid #1B3A6B;
  font-size: 12px;
  font-family: inherit;
  padding: 3px 0;
  background: transparent;
  color: #333;
  outline: none;
}

.sr-sig-value {
  font-size: 13px;
  color: #333;
  padding: 3px 0;
  border-bottom: 1.5px solid #1B3A6B;
}

.sr-form-footer {
  padding: 16px 24px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid #e0e4eb;
}

.sr-view-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-bottom: 6px;
}

.sr-view-item {
  background: #F4F6F9;
  border: 1px solid #D0D7E2;
  border-radius: 3px;
  padding: 4px 8px;
  font-size: 11px;
}

.sr-view-item strong {
  display: block;
  font-size: 10px;
  color: #1B3A6B;
  margin-bottom: 1px;
}

.note-log-row {
  border: 1px solid #e0e4eb;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background .15s;
  background: white;
}

.note-log-row:hover {
  background: #f9fafb;
}

.note-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
/* ── MAR ── */
.mar-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.mar-tab {
  padding: 7px 16px;
  border-radius: 6px;
  border: 1px solid #d0d7e2;
  background: white;
  color: #333;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.mar-tab:hover {
  background: #f4f6f9;
}

.mar-tab-active {
  background: #1B3A6B;
  color: white;
  border-color: #1B3A6B;
}

.mar-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.mar-month-label {
  font-size: 14px;
  font-weight: 500;
  color: #1B3A6B;
  min-width: 140px;
  text-align: center;
}

.mar-legend {
  display: flex;
  gap: 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.mar-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #555;
}

.mar-legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

.mar-wrap {
  overflow-x: auto;
  border: 1px solid #e0e4eb;
  border-radius: 8px;
}

.mar-table {
  border-collapse: collapse;
  font-size: 11px;
  min-width: 900px;
  width: 100%;
}

.mar-table th,
.mar-table td {
  border: 0.5px solid #e0e4eb;
  padding: 0;
  height: 36px;
}

.mar-med-head {
  min-width: 180px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 500;
  color: #666;
  background: #f9fafb;
  text-align: left;
}

.mar-day-head {
  width: 32px;
  text-align: center;
  font-size: 10px;
  font-weight: 500;
  color: #666;
  background: #f9fafb;
}

.mar-med-cell {
  padding: 6px 10px;
  background: white;
  min-width: 180px;
}

.mar-med-name {
  font-weight: 600;
  font-size: 11px;
  color: #1B3A6B;
  margin-bottom: 2px;
}

.mar-med-detail {
  font-size: 10px;
  color: #888;
}

.mar-cell {
  width: 32px;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  line-height: 36px;
  transition: filter 0.1s;
  user-select: none;
}

.mar-cell:hover {
  filter: brightness(0.92);
}