/* style.css */
:root {
  --primary: #2C3E50;
  --secondary: #34495E;
  --accent: #8E44AD;
  --accent-light: #a569bd;
  --light: #ECF0F1;
  --dark: #2C3E50;
  --text-dark: #2C3E50;
  --text-light: #7F8C8D;
  --success: #27ae60;
  --warning: #f39c12;
  --danger: #e74c3c;
  --bg: #f5f6fa;
  --card-bg: rgba(255, 255, 255, 0.85);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  --border: rgba(255, 255, 255, 0.2);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --male-color: #3498db;
  --female-color: #e74c3c;
  --menu-bg: rgba(255, 255, 255, 0.95);
  --menu-text: #1a1a1a;
  --menu-hover: rgba(0, 0, 0, 0.05);
  --menu-border: rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] {
  --primary: #ecf0f1;
  --secondary: #bdc3c7;
  --text-dark: #ecf0f1;
  --text-light: #95a5a6;
  --bg: #1a1a2e;
  --card-bg: rgba(30, 30, 50, 0.9);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --border: rgba(255, 255, 255, 0.05);
  --menu-bg: rgba(30, 30, 50, 0.95);
  --menu-text: #ecf0f1;
  --menu-hover: rgba(255, 255, 255, 0.05);
  --menu-border: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] body::before {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

[data-theme="dark"] .person {
  background: rgba(30, 30, 50, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .person:hover {
  background: rgba(40, 40, 60, 0.9);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .person-name {
  background: linear-gradient(to right, rgba(142, 68, 173, 0.15), rgba(52, 73, 94, 0.15));
  color: #ecf0f1;
}

[data-theme="dark"] #searchBox {
  background: rgba(30, 30, 50, 0.9);
  color: #ecf0f1;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .modal-content {
  background: rgba(30, 30, 50, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: #ecf0f1;
}

[data-theme="dark"] .modal-content h2 {
  color: #ecf0f1;
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea {
  background: rgba(20, 20, 40, 0.8);
  color: #ecf0f1;
  border: 1.5px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .toast {
  background: rgba(30, 30, 50, 0.95);
  color: #ecf0f1;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
  width: 100%;
}

.toast {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 14px 20px;
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  animation: slideInRight 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 4px solid var(--success);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
  transform-origin: right;
  min-width: 200px;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.info { border-left-color: var(--accent); }

.toast .toast-icon { font-size: 20px; flex-shrink: 0; }
.toast .toast-close {
  margin-left: auto;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.2s;
  background: none;
  border: none;
  font-size: 18px;
  color: inherit;
}
.toast .toast-close:hover { opacity: 1; }

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(60px) scale(0.9); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes slideOutRight {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to { opacity: 0; transform: translateX(60px) scale(0.9); }
}
.toast.removing { animation: slideOutRight 0.3s ease forwards; }

* { box-sizing: border-box; transition: var(--transition); }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 40px;
  position: relative;
  background-image: url('Images/image.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-color: var(--bg);
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  z-index: -1;
}

header {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  width: 100%;
  padding: 12px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 8px;
  box-shadow: 0 4px 30px rgba(0,0,0,0.2);
  position: sticky;
  top: 0;
  min-height: 60px;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.header-left { display: flex; align-items: center; gap: 10px; flex-shrink: 0; flex-wrap: nowrap; min-width: 60px; }
.header-center { flex: 1; text-align: center; font-size: clamp(18px, 4vw, 28px); font-weight: 600; letter-spacing: 1px; color: white; text-shadow: 0 2px 10px rgba(0,0,0,0.3); min-width: 0; white-space: nowrap; overflow: visible; padding: 0 5px; }
.header-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; flex-wrap: nowrap; min-width: 50px; justify-content: flex-end; }

.hamburger-btn {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgb(239, 233, 233);
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 20px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}
.hamburger-btn:hover { background: rgba(255, 255, 255, 0.25); transform: scale(1.02); border-color: rgba(255, 255, 255, 0.3); }

.theme-toggle {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}
.theme-toggle:hover { background: rgba(255, 255, 255, 0.25); transform: scale(1.02); }

.auth-status {
  color: rgba(255,255,255,0.8);
  font-size: clamp(10px, 1.5vw, 12px);
  padding: 3px 8px;
  border-radius: 20px;
  background: rgba(0,0,0,0.2);
  display: none;
  flex-shrink: 0;
}
.auth-status.show { display: inline-block; }
.auth-status.proprietaire { background: rgba(46, 204, 113, 0.3); color: #2ecc71; display: inline-block; }
.auth-status.admin { background: rgba(52, 152, 219, 0.3); color: #3498db; display: inline-block; }

.breadcrumb {
  background: rgba(44, 62, 80, 0.85);
  backdrop-filter: blur(20px);
  width: 100%;
  padding: 8px 15px;
  font-size: clamp(12px, 2.5vw, 14px);
  color: white;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  margin-bottom: 8px;
  text-align: center;
  display: none;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.breadcrumb span { margin: 0 6px; color: #9b59b6; cursor: pointer; }
.breadcrumb span:hover { text-decoration: underline; color: #a569bd; }

.search-wrapper {
  width: 90%;
  max-width: 450px;
  margin: 12px 15px 8px;
  position: relative;
}

#searchBox {
  width: 100%;
  padding: 10px 18px 10px 40px;
  font-size: clamp(13px, 3vw, 15px);
  border: none;
  border-radius: 50px;
  outline: none;
  background: rgba(227, 222, 222, 0.20);
  backdrop-filter: blur(3px);
  color: var(--text-dark);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.3);
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%238E44AD" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>');
  background-repeat: no-repeat;
  background-size: 16px;
  background-position: 16px center;
  font-family: 'Inter', sans-serif;
}
#searchBox:focus { border-color: rgba(68, 173, 101, 0.3); box-shadow: 0 8px 32px rgba(68, 173, 117, 0.15); }
#searchBox:hover { background: rgba(255, 255, 255, 0.25); transform: scale(1.02); border-color: rgba(255, 255, 255, 0.3); }

.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  margin-top: 6px;
  max-height: 250px;
  overflow-y: auto;
  display: none;
  z-index: 50;
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.search-suggestions.active { display: block; }
.search-suggestion {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-dark);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  transition: background 0.15s;
  display: flex;
  align-items: center;
  gap: 10px;
}
.search-suggestion:hover { background: rgba(142, 68, 173, 0.06); }
.search-suggestion .highlight { background: rgba(142, 68, 173, 0.2); padding: 0 4px; border-radius: 4px; font-weight: 600; }
.search-suggestion .suggestion-path { font-size: 11px; color: var(--text-light); margin-left: auto; }

#tree {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  padding: 12px;
  max-width: 1400px;
  width: 100%;
}

.person {
  text-align: center;
  cursor: pointer;
  padding: 10px 10px 8px 10px;
  border-radius: 16px;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  transition: var(--transition);
  width: calc(50% - 15px);
  min-width: 120px;
  max-width: 180px;
  position: relative;
  border: 1px solid var(--border);
}
.person:hover { transform: translateY(-5px) scale(1.02); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15); background: rgba(255, 255, 255, 0.95); }
.person.dragging { opacity: 0.5; transform: scale(0.9); }

.person img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  max-width: 100px;
  border-radius: 50%;
  border: 4px solid var(--accent);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  transition: transform 0.3s;
  object-fit: cover;
  background: #ecf0f1;
}
.person:hover img { transform: scale(1.05); border-color: var(--secondary); }

.person-name {
  margin-top: 10px;
  font-size: clamp(13px, 3.5vw, 15px);
  font-weight: 600;
  color: var(--text-dark);
  padding: 4px 8px;
  border-radius: 8px;
  background: linear-gradient(to right, rgba(142, 68, 173, 0.1), rgba(52, 73, 94, 0.1));
  word-wrap: break-word;
  line-height: 1.3;
  transition: all 0.2s ease;
}

.person-name input {
  width: 100%;
  font-size: inherit;
  font-weight: inherit;
  text-align: center;
  border: 2px solid var(--accent);
  border-radius: 8px;
  padding: 4px 8px;
  background: var(--card-bg);
  color: var(--text-dark);
  font-family: 'Inter', sans-serif;
}

.detail-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  color: var(--accent);
  z-index: 5;
  opacity: 0;
  transform: scale(0.8);
}
.person:hover .detail-btn { opacity: 1; transform: scale(1); }
.detail-btn:hover { background: var(--accent); color: white; transform: scale(1.1) !important; box-shadow: 0 4px 20px rgba(142, 68, 173, 0.3); }

@media (max-width: 600px) {
  .detail-btn { opacity: 1; transform: scale(1); background: rgba(255, 255, 255, 0.85); width: 32px; height: 32px; font-size: 16px; top: 4px; right: 4px; }
}

#backBtn {
  margin: 8px 15px;
  padding: 8px 20px;
  font-size: clamp(13px, 3vw, 15px);
  width: auto;
  min-width: 100px;
  border: none;
  border-radius: 50px;
  outline: none;
  background: rgba(44, 62, 80, 0.85);
  backdrop-filter: blur(20px);
  color: white;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  letter-spacing: 0.3px;
  display: none;
  border: 1px solid rgba(255,255,255,0.1);
}
#backBtn:hover { background: rgba(44, 62, 80, 0.95); transform: translateY(-2px); }

.hamburger-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  transform: none;
  background: rgba(255, 255, 255, 0.60);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(30px);
  border-radius: 16px 16px 16px 16px;
  padding: 12px 18px 16px 18px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--menu-border);
  flex-direction: column;
  gap: 4px;
  z-index: 200;
  margin-top: 6px;
  animation: slideDown 0.25s ease;
  min-width: 240px;
  max-width: 320px;
}
.hamburger-menu.open { display: flex; }
.hamburge:hover { background: rgba(6, 6, 6, 0.25); transform: scale(1.02); border-color: rgba(255, 255, 255, 0.3); }


@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.hamburger-menu .history-btn,
.hamburger-menu .action-btn,
.hamburger-menu .auth-btn {
  background: transparent;
  border: none;
  color: var(--menu-text);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.15s ease;
  width: 100%;
  justify-content: center;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.2px;
  text-align: center;
}
.hamburger-menu .history-btn:hover,
.hamburger-menu .action-btn:hover,
.hamburger-menu .auth-btn:hover {
  background: rgba(6, 6, 6, 0.25); 
  transform: scale(1.1); 
  border-color: rgba(255, 255, 255, 0.3) ;
  border-radius: 10px;
}

.menu-divider { 
  border: none; 
  border-top: 1px solid var(--menu-border); 
  margin: 4px 0; 
}

.hamburger-menu .translate-container {
  width: 100%;
  padding: 4px 0;
  display: flex;
  justify-content: center;
}
.hamburger-menu .translate-container #google_translate_element {
  background: rgba(0, 0, 0, 0.03);
  backdrop-filter: blur(10px);
  border-radius: 30px;
  padding: 3px 8px;
  border: 1px solid var(--menu-border);
  display: inline-block;
  min-width: 160px;
  width: 100%;
  max-width: 220px;
  box-shadow: none;
}

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(5px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
  animation: overlayFade 0.3s ease;
}
.modal-overlay.active { display: flex; }
@keyframes overlayFade { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
  background: var(--card-bg);
  backdrop-filter: blur(40px);
  border-radius: 28px;
  max-width: 420px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 32px 28px 28px 28px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.12);
  position: relative;
  animation: modalSlide 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid var(--border);
}
.modal-content.historique-modal { max-width: 700px; }
.modal-content.person-detail-modal { max-width: 480px; padding: 0; overflow: hidden; }
.modal-content.stats-modal { max-width: 400px; }
.modal-content.history-modal { max-width: 500px; }

@keyframes modalSlide {
  from { opacity: 0; transform: translateY(30px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  font-size: 22px;
  cursor: pointer;
  color: rgba(0, 0, 0, 0.3);
  background: rgba(0, 0, 0, 0.04);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  z-index: 10;
}
.modal-close:hover { color: rgba(0, 0, 0, 0.7); background: rgba(0, 0, 0, 0.08); transform: rotate(90deg); }

.modal-content h2 { color: var(--primary); margin-top: 0; margin-bottom: 8px; font-size: 22px; font-weight: 600; letter-spacing: -0.3px; }
.modal-content .subtitle { color: var(--text-light); font-size: 14px; margin-bottom: 20px; line-height: 1.5; font-weight: 400; }

.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--primary);
  font-size: 13px;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  opacity: 0.7;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  font-size: 15px;
  transition: all 0.25s ease;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
  font-family: 'Inter', sans-serif;
  color: var(--text-dark);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--accent);
  outline: none;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 4px rgba(142, 68, 173, 0.08);
}
.form-group select option { color: #000; }

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}
.form-actions button {
  padding: 10px 24px;
  border: none;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.2px;
}
.form-actions .btn-submit {
  background: rgb(158, 158, 158);
  color: white;
  box-shadow: 0 4px 16px rgba(68, 173, 108, 0.25);
}
.form-actions .btn-submit:hover { background: #898d86; transform: translateY(-2px); }
.form-actions .btn-cancel { background: rgba(0, 0, 0, 0.04); color: var(--text-dark); }
.form-actions .btn-cancel:hover { background: rgba(0, 0, 0, 0.08); transform: translateY(-2px); }
.form-actions .btn-delete-confirm {
  background: #e74c3c;
  color: white;
  box-shadow: 0 4px 16px rgba(231, 76, 60, 0.25);
}
.form-actions .btn-delete-confirm:hover { background: #c0392b; transform: translateY(-2px); }

#historyEditBtn .btn-submit {
  background: rgb(145, 22, 22);
  color: rgb(97, 31, 31);
  box-shadow: 0 4px 16px rgba(68, 173, 108, 0.25);
}
#historyEditBtn .btn-submit :hover { background: #898d86; transform: translateY(-2px); }


.historique-list { margin: 16px 0; max-height: 400px; overflow-y: auto; }
.historique-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 12px;
  margin-bottom: 8px;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}
.historique-item:hover { background: rgba(0, 0, 0, 0.04); }
.historique-item.add { border-left-color: var(--success); }
.historique-item.edit { border-left-color: var(--warning); }
.historique-item.delete { border-left-color: var(--danger); }

.historique-item .info { flex: 1; }
.historique-item .info .action-type { font-weight: 600; font-size: 14px; color: var(--text-dark); }
.historique-item .info .action-type .type-add { color: var(--success); }
.historique-item .info .action-type .type-edit { color: var(--warning); }
.historique-item .info .action-type .type-delete { color: var(--danger); }
.historique-item .info .details { font-size: 13px; color: var(--text-light); margin-top: 2px; }
.historique-item .info .date { font-size: 11px; color: rgba(0,0,0,0.3); margin-top: 2px; }

.historique-item .actions-historique .btn-delete-entry {
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.2);
  color: var(--danger);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
}
.historique-item .actions-historique .btn-delete-entry:hover {
  background: var(--danger);
  color: white;
  transform: scale(1.02);
}

.historique-empty { text-align: center; color: var(--text-light); padding: 30px 0; font-size: 15px; }
.historique-empty .icon { font-size: 40px; margin-bottom: 10px; opacity: 0.5; }

.status-badge {
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: 600;
  display: inline-block;
}
.status-badge.accepted { background: rgba(46, 204, 113, 0.15); color: var(--success); }
.status-badge.rejected { background: rgba(231, 76, 60, 0.15); color: var(--danger); }
.status-badge.pending { background: rgba(243, 156, 18, 0.15); color: var(--warning); }

.auth-error {
  color: #e74c3c;
  font-size: 13px;
  margin-top: 12px;
  text-align: center;
  display: none;
  padding: 10px;
  background: rgba(231, 76, 60, 0.06);
  border-radius: 12px;
  border: 1px solid rgba(231, 76, 60, 0.1);
}
.auth-error.show { display: block; }

.stats-simple { text-align: center; padding: 20px 0; }
.stats-simple .stat-number-big { font-size: 64px; font-weight: 700; color: var(--accent); line-height: 1; }
.stats-simple .stat-label-big { font-size: 18px; color: var(--text-light); margin-top: 8px; }
.stats-simple .stat-icon { font-size: 48px; margin-bottom: 10px; display: block; }

.detail-cover {
  position: relative;
  height: 120px;
  background: linear-gradient(135deg, var(--accent), var(--secondary));
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-bottom: 50px;
}
.detail-cover.male { background: linear-gradient(135deg, var(--male-color), #33ec3d); }
.detail-cover.female { background: linear-gradient(135deg, var(--female-color), #de2bac); }
.detail-cover.unknown { background: linear-gradient(135deg, var(--text-light), var(--secondary)); }

.detail-avatar-wrapper {
  position: absolute;
  bottom: -45px;
  left: 50%;
  transform: translateX(-50%);
}
.detail-avatar-wrapper img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--card-bg);
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  background: #ecf0f1;
}
.detail-body { 
  padding: 55px 28px 28px 28px; }

.detail-body .detail-name-wrapper {
  text-align: center;
  margin-bottom: 4px;
}
.detail-body .detail-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
}
.detail-body .detail-name-input {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  border: 2px solid var(--accent);
  border-radius: 8px;
  padding: 4px 12px;
  background: white;
  width: 100%;
  max-width: 300px;
  font-family: 'Inter', sans-serif;
  outline: none;
}
.detail-body .detail-name-input:focus {
  box-shadow: 0 0 0 3px rgba(142, 68, 173, 0.15);
}

.detail-body .detail-role { text-align: center; font-size: 14px; color: var(--text-light); margin-bottom: 20px; }
.detail-body .detail-role .role-badge {
  display: inline-block;
  padding: 2px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(142, 68, 173, 0.1);
  color: var(--accent);
}
.detail-body .detail-role .role-badge.male { background: rgba(28, 237, 167, 0.15); color: var(--male-color); }
.detail-body .detail-role .role-badge.female { background: rgba(242, 55, 161, 0.15); color: var(--female-color); }

.detail-path {
  background: rgba(0, 0, 0, 0.03);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-light);
  border: 1px solid rgba(0, 0, 0, 0.04);
  word-wrap: break-word;
}
.detail-path .path-arrow { color: var(--accent); font-weight: 600; margin: 0 4px; }
.detail-path .path-name { color: var(--text-dark); font-weight: 500; }
.detail-path .path-root { color: var(--accent); font-weight: 600; }

.detail-grid { display: grid; gap: 10px; }
.detail-card {
  background: rgba(0, 0, 0, 0.02);
  border-radius: 12px;
  padding: 12px 16px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  cursor: default;
  transition: all 0.2s ease;
}
.detail-card.editable {
  cursor: pointer;
  border-color: var(--accent);
  background: rgba(142, 68, 173, 0.05);
}
.detail-card.editable:hover {
  background: rgba(142, 68, 173, 0.1);
  box-shadow: 0 0 0 2px rgba(142, 68, 173, 0.15);
}
.detail-card .detail-label { 
  font-size: 11px; 
  text-transform: uppercase; 
  letter-spacing: 0.5px; 
  color: var(--text-light); 
  font-weight: 600; 
  margin-bottom: 4px; 
}
.detail-card .detail-value { 
  font-size: 15px; 
  color: var(--text-dark); 
  font-weight: 500; 
}
.detail-card .detail-value.empty { 
  color: var(--text-light); 
  font-weight: 400; 
  font-style: italic; 
}
.detail-card .detail-value-input {
  width: 100%;
  font-size: 15px;
  font-weight: 500;
  border: 2px solid var(--accent);
  border-radius: 8px;
  padding: 6px 10px;
  background: white;
  color: var(--text-dark);
  font-family: 'Inter', sans-serif;
  outline: none;
}
.detail-card .detail-value-input:focus {
  box-shadow: 0 0 0 3px rgba(142, 68, 173, 0.15);
}
.detail-card .detail-value-select {
  width: 100%;
  font-size: 15px;
  font-weight: 500;
  border: 2px solid var(--accent);
  border-radius: 8px;
  padding: 6px 10px;
  background: white;
  color: var(--text-dark);
  font-family: 'Inter', sans-serif;
  outline: none;
}
.detail-card .detail-value-select:focus {
  box-shadow: 0 0 0 3px rgba(142, 68, 173, 0.15);
}
.detail-card .detail-value-textarea {
  width: 100%;
  font-size: 15px;
  font-weight: 500;
  border: 2px solid var(--accent);
  border-radius: 8px;
  padding: 6px 10px;
  background: white;
  color: var(--text-dark);
  font-family: 'Inter', sans-serif;
  outline: none;
  resize: vertical;
  min-height: 50px;
}
.detail-card .detail-value-textarea:focus {
  box-shadow: 0 0 0 3px rgba(142, 68, 173, 0.15);
}

@media (max-width: 480px) {
  .person { width: calc(50% - 10px); padding: 8px; }
  .person img { max-width: 80px; }
  .search-wrapper { width: 95%; margin: 10px 8px 6px; }
  #searchBox { padding: 8px 12px 8px 35px; background-size: 14px; background-position: 14px center; }
  header { padding: 8px 10px; min-height: 50px; }
  .header-center { font-size: clamp(16px, 4vw, 20px); }
  #tree { gap: 10px; padding: 8px; }
  .modal-content { padding: 24px 18px 20px 18px; max-height: 85vh; border-radius: 24px; }
  .modal-content h2 { font-size: 19px; }
  .hamburger-menu { padding: 10px 14px 14px 14px; min-width: 200px; max-width: 85%; border-radius: 0 14px 14px 0; }
  .toast-container { right: 10px; left: 10px; max-width: none; top: 70px; }
  .detail-cover { height: 90px; }
  .detail-avatar-wrapper img { width: 70px; height: 70px; bottom: -35px; }
  .detail-body { padding: 45px 18px 20px 18px; }
  .detail-body .detail-name { font-size: 19px; }
  .detail-path { font-size: 12px; padding: 8px 12px; }
  .person .click-hint { display: none; }
}
