:root {
  --primary: #0d9488;
  --primary-dark: #0f766e;
  --primary-light: #ccfbf1;
  --accent: #14b8a6;
  --reunited: #4f46e5;
  --reunited-bg: #eef2ff;
  --bg: #f4f7f8;
  --card-bg: #ffffff;
  --text: #111827;
  --text-light: #6b7280;
  --border: #e8ebed;
  --alive: #059669;
  --alive-bg: #d1fae5;
  --deceased: #52525b;
  --deceased-bg: #f1f1f3;
  --danger: #dc2626;
  --warn: #d97706;
  --warn-bg: #fef3c7;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 3px 14px rgba(17,24,39,0.06);
  --shadow-md: 0 10px 28px rgba(17,24,39,0.12);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: 96px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
.header {
  background: linear-gradient(135deg, #000000 0%, #1c1c1e 100%);
  color: white;
  padding: 20px 18px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.header h1 { font-size: 1.2rem; margin: 0 0 3px; font-weight: 800; letter-spacing: -0.01em; }
.header p { margin: 0; font-size: 0.78rem; opacity: 0.75; }
.flag-stripe {
  height: 4px;
  background: linear-gradient(90deg, #FCD116 0% 33.33%, #003893 33.33% 66.66%, #CF142B 66.66% 100%);
}
.container { padding: 18px 16px; max-width: 640px; margin: 0 auto; animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.search-bar { display: flex; gap: 8px; margin-bottom: 18px; }
.search-bar input {
  flex: 1; padding: 14px 16px; border: 1.5px solid var(--border);
  border-radius: var(--radius); font-size: 0.95rem; background: white; box-shadow: var(--shadow);
}
.search-bar input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(20,184,166,0.15); }
button { font-family: inherit; cursor: pointer; }
.btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; border: none; padding: 14px 18px; border-radius: var(--radius-sm);
  font-size: 0.92rem; font-weight: 700; box-shadow: 0 4px 14px rgba(13,148,136,0.25);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:active { transform: scale(0.97); box-shadow: 0 2px 8px rgba(13,148,136,0.2); }
.btn-block { width: 100%; }
.btn-outline { background: white; color: var(--primary-dark); border: 1.5px solid var(--primary); box-shadow: none; }
.btn-outline:active { background: var(--primary-light); }
.btn-danger { background: linear-gradient(135deg, var(--danger), #b91c1c); box-shadow: 0 4px 14px rgba(220,38,38,0.25); }
.btn-secondary { background: #6b7280; box-shadow: none; }
.btn-indigo { background: linear-gradient(135deg, var(--reunited), #4338ca); box-shadow: 0 4px 14px rgba(79,70,229,0.25); }
.btn-sm { padding: 9px 13px; font-size: 0.8rem; border-radius: 10px; }
.card {
  background: var(--card-bg); border-radius: var(--radius); padding: 15px; margin-bottom: 12px;
  box-shadow: var(--shadow); border: 1px solid var(--border); border-left: 4px solid var(--border);
  transition: box-shadow 0.15s ease;
}
.card-alive { border-left-color: var(--alive); }
.card-deceased { border-left-color: var(--deceased); }
.card-reunited { border-left-color: var(--reunited); background: linear-gradient(135deg, #ffffff 0%, var(--reunited-bg) 140%); }
.person-row { display: flex; gap: 12px; align-items: flex-start; }
.person-photo { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--primary-light); flex-shrink: 0; }
.person-info { flex: 1; min-width: 0; }
.person-name { font-weight: 800; font-size: 1.02rem; margin: 0 0 3px; letter-spacing: -0.01em; }
.person-meta { font-size: 0.83rem; color: var(--text-light); margin: 2px 0; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 20px;
  font-size: 0.73rem; font-weight: 700; margin-top: 7px; margin-right: 5px;
}
.badge-alive { background: var(--alive-bg); color: var(--alive); }
.badge-deceased { background: var(--deceased-bg); color: var(--deceased); }
.badge-pending { background: var(--warn-bg); color: var(--warn); }
.badge-resolved { background: var(--alive-bg); color: var(--alive); }
.badge-reunited { background: var(--reunited-bg); color: var(--reunited); }
.reunited-banner {
  background: var(--reunited-bg); color: var(--reunited); padding: 10px 12px; border-radius: 12px;
  font-size: 0.82rem; font-weight: 700; margin-top: 10px; display: flex; gap: 7px; align-items: flex-start; line-height: 1.35;
}
.empty-state { text-align: center; padding: 36px 16px; color: var(--text-light); }
.empty-state .icon { font-size: 2.4rem; margin-bottom: 10px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 13px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.92rem; font-family: inherit; background: #fafbfc;
}
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--accent); background: white; }
.form-group textarea { resize: vertical; min-height: 70px; }
.photo-upload { border: 2px dashed var(--border); border-radius: var(--radius-sm); padding: 18px; text-align: center; cursor: pointer; background: var(--primary-light); }
.photo-preview { max-width: 100px; max-height: 100px; border-radius: 10px; margin-top: 10px; display: block; }
.tabbar {
  position: fixed; bottom: 14px; left: 14px; right: 14px; background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px); border-radius: 22px; border: 1px solid var(--border); display: flex;
  z-index: 20; box-shadow: var(--shadow-md); padding: 6px;
}
.tab {
  flex: 1; border: none; background: none; padding: 9px 4px 7px; display: flex; flex-direction: column;
  align-items: center; gap: 2px; color: var(--text-light); font-size: 0.68rem; font-weight: 700;
  border-radius: 16px; transition: background 0.15s, color 0.15s;
}
.tab.active { color: var(--primary-dark); background: var(--primary-light); }
.tab .tab-icon { font-size: 1.3rem; }
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,20,22,0.6); z-index: 50; display: flex;
  align-items: flex-end; justify-content: center; animation: fadeIn 0.15s ease;
}
.modal {
  background: white; border-radius: 24px 24px 0 0; padding: 22px 18px 30px; width: 100%;
  max-width: 640px; max-height: 88vh; overflow-y: auto; animation: slideUp 0.2s ease;
}
@keyframes slideUp { from { transform: translateY(30px); opacity: 0.6; } to { transform: translateY(0); opacity: 1; } }
.modal h2 { margin-top: 0; font-size: 1.15rem; font-weight: 800; }
.modal-close {
  background: #f1f1f3; border: none; font-size: 1.2rem; color: var(--text-light); position: absolute;
  right: 16px; top: 16px; width: 32px; height: 32px; border-radius: 50%; line-height: 1;
}
.section-title { font-size: 0.96rem; font-weight: 800; color: var(--primary-dark); margin: 4px 0 12px; letter-spacing: -0.01em; }
.login-box { margin-top: 40px; }
.alert { background: var(--warn-bg); border: 1px solid #fde68a; color: #92400e; padding: 11px 13px; border-radius: var(--radius-sm); font-size: 0.8rem; margin-bottom: 14px; }
.row-actions { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.status-toggle { display: flex; gap: 8px; margin-top: 6px; }
.status-toggle label {
  flex: 1; text-align: center; padding: 11px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 700; cursor: pointer; transition: all 0.15s;
}
.status-toggle input { display: none; }
.status-toggle .opt-alive.checked { background: var(--alive); border-color: var(--alive); color: white; }
.status-toggle .opt-deceased.checked { background: var(--deceased); border-color: var(--deceased); color: white; }
.loading { text-align: center; padding: 28px; color: var(--text-light); font-size: 0.85rem; }
.footer-note { text-align: center; font-size: 0.72rem; color: var(--text-light); padding: 20px 16px 8px; }
.toast {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%); background: var(--text);
  color: white; padding: 12px 20px; border-radius: 24px; font-size: 0.83rem; font-weight: 600;
  z-index: 60; box-shadow: var(--shadow-md);
}
.csv-box { background: var(--primary-light); border: 1.5px dashed var(--accent); }
.csv-row-card { border-left-color: var(--border); }
.csv-row-card.is-dup { border-left-color: var(--warn); }
.csv-checkbox-label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.confirm-overlay {
  position: fixed; inset: 0; background: rgba(15,20,22,0.62); z-index: 80; display: flex;
  align-items: center; justify-content: center; padding: 20px; animation: fadeIn 0.15s ease;
}
.confirm-box { background: white; border-radius: 20px; padding: 22px 20px; max-width: 380px; width: 100%; box-shadow: var(--shadow-md); animation: slideUp 0.18s ease; }
.confirm-box p { font-size: 0.95rem; font-weight: 700; margin: 0 0 18px; line-height: 1.4; }
