:root {
  --blue-900: #1e3a8a;
  --blue-800: #1e40af;
  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-100: #dbeafe;
  --blue-050: #eff6ff;
  --text-900: #0f172a;
  --text-700: #334155;
  --border-200: #e2e8f0;
  --white: #ffffff;
  --danger-600: #dc2626;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
}

body {
  font-family: "Inter", Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, var(--blue-050) 0%, #eef6ff 100%);
  color: var(--text-900);
  display: flex;
  flex-direction: column;
  line-height: 1.5;
}

h1,
h2 {
  margin-bottom: 12px;
  color: var(--blue-900);
}

p {
  margin-bottom: 15px;
}

a {
  color: var(--blue-700);
}

.container {
  max-width: 1200px;
  margin: auto;
  padding: 20px;
}

.container-fluid {
  width: 100%;
  padding: 20px;
}

main.container,
main.container-fluid {
  flex: 1;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(30, 58, 138, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--white);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.nav-container {
  max-width: 1200px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  gap: 16px;
}

.logo {
  color: var(--white);
  text-decoration: none;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  width: 40px;
  height: 34px;
  padding: 6px;
}

.menu-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: #e6f2ff;
  border-radius: 2px;
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-menu a {
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  padding: 9px 12px;
  border-radius: 10px;
  white-space: nowrap;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.nav-menu a:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--blue-900);
  list-style: none;
  min-width: 150px;
  border-radius: 8px;
  padding: 8px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 100;
}

.nav-dropdown-menu li {
  margin: 0;
  padding: 0;
}

.nav-dropdown-menu li a {
  display: block;
  padding: 10px 16px;
  border-radius: 0;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  display: block;
}

footer {
  text-align: center;
  padding: 16px;
  color: var(--text-700);
  background: var(--white);
  border-top: 1px solid var(--border-200);
}

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.card {
  background: var(--white);
  padding: 18px;
  border-radius: 12px;
  border: 1px solid var(--border-200);
  box-shadow: 0 4px 15px rgba(30, 58, 138, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(30, 58, 138, 0.1);
}

.card h3 {
  margin-bottom: 8px;
}

.panel {
  background: var(--white);
  border: 1px solid var(--border-200);
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(30, 58, 138, 0.06);
  padding: 16px;
}

input,
select,
textarea,
button {
  font-family: inherit;
  font-size: 14px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #b6d4f2;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fbfdff;
  color: var(--text-900);
}

button, .btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  background: var(--blue-600);
  color: var(--white);
  font-weight: 600;
  transition: background-color 0.2s ease;
  display: inline-block;
  text-decoration: none;
  text-align: center;
}

button:hover, .btn:hover {
  background: var(--blue-700);
  color: var(--white);
}

.btn-danger {
  background: var(--danger-600);
}

.btn-danger:hover {
  background: #bc3636;
}

.approval-panel {
  margin-top: 6px;
}

.approval-list {
  display: grid;
  gap: 14px;
}

.approval-item {
  border: 1px solid #cde2f8;
  border-radius: 12px;
  padding: 14px;
  background: #f9fcff;
}

.approval-item-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.approval-item-head h3 {
  margin: 0;
  color: var(--blue-900);
  font-size: 18px;
}

.approval-pill {
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  padding: 4px 10px;
}

.approval-pill-normal {
  background: #e5f1ff;
  color: #1f5ea8;
}

.approval-pill-historical {
  background: #ffe9e9;
  color: #a12626;
}

.approval-meta {
  margin-bottom: 12px;
  color: var(--text-700);
}

.approval-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.approval-form label {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
}

.approval-form textarea {
  min-height: 78px;
  margin-bottom: 8px;
  resize: vertical;
}

.approval-message {
  color: #1f5ea8;
  font-weight: 600;
  margin-top: 8px;
}

.approval-waiting,
.approval-empty {
  color: var(--text-700);
}

.view-changes-btn {
  margin-bottom: 8px;
}

.changes-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 14px;
}

.changes-modal-box {
  background: var(--white);
  border-radius: 10px;
  width: 100%;
  max-width: 620px;
  padding: 16px;
}

.changes-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.changes-modal-head h3 {
  margin: 0;
}

.changes-modal-close {
  border: none;
  background: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-700);
  padding: 2px 6px;
}

.changes-table {
  width: 100%;
  border-collapse: collapse;
}

.changes-table th,
.changes-table td {
  text-align: left;
  border-bottom: 1px solid #ddd;
  padding: 6px;
}

@media (max-width: 768px) {
  body {
    min-width: fit-content;
  }

  .container,
  .container-fluid {
    padding: 14px;
  }

  .nav-container {
    flex-wrap: wrap;
    gap: 12px;
  }

  .nav-search-container {
    max-width: 100%;
    margin: 0;
    order: 3;
    width: 100%;
    flex: 1 1 100%;
  }

  .menu-toggle {
    display: block;
    order: 2;
  }

  .logo {
    order: 1;
  }

  .nav-menu {
    position: absolute;
    top: 100%;
    left: 12px;
    right: 12px;
    flex-direction: column;
    align-items: stretch;
    background: rgba(30, 64, 175, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    padding: 10px;
    display: none;
    margin-top: 8px;
  }

  .nav-menu.nav-menu-open {
    display: flex;
  }

  .nav-menu a {
    padding: 11px 12px;
  }

  .nav-dropdown-menu {
    position: static;
    display: none;
    box-shadow: none;
    background: rgba(0, 0, 0, 0.1);
    margin-top: 4px;
    padding-left: 12px;
    border-radius: 8px;
  }

  .nav-dropdown-menu li a {
    border-radius: 6px;
    margin-bottom: 2px;
  }

  .approval-item {
    padding: 12px;
  }

  .approval-item-head h3 {
    font-size: 17px;
  }

  /* Make tables horizontally scrollable on mobile */
  .table-responsive {
    display: block;
    width: 100%;
    overflow: visible;
  }

  .changes-table {
    white-space: nowrap;
  }
}

/* =========================================================
   Auth Forms (login, forgot password, reset password)
   ========================================================= */

.auth-form {
  max-width: 420px;
  margin: 40px auto 0;
  background: var(--white);
  border: 1px solid var(--border-200);
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 8px 30px rgba(30, 58, 138, 0.08);
}

.auth-title {
  color: var(--blue-900);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  text-align: center;
}

.auth-subtitle {
  color: var(--text-700);
  margin-bottom: 24px;
  font-size: 14px;
  text-align: center;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-700);
}

.form-group input {
  width: 100%;
}

.form-error {
  color: var(--danger-600);
  font-size: 13px;
  margin-bottom: 12px;
}

.btn-primary {
  background: var(--blue-700);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--blue-800);
}

.btn-full {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  margin-top: 4px;
}

.auth-link {
  text-align: center;
  margin-top: 16px;
  margin-bottom: 0;
  font-size: 13px;
}

/* =========================================================
   Nav Badge (notification count)
   ========================================================= */

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #ef4444;
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  margin-left: 4px;
  vertical-align: middle;
  line-height: 1;
}

/* =========================================================
   Dashboard — Clickable Cards
   ========================================================= */

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.card-link .card {
  cursor: pointer;
}

.card-link:hover .card {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(30, 58, 138, 0.13);
  border-color: var(--blue-500);
}

/* =========================================================
   Profile Page
   ========================================================= */

.profile-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.profile-section {
  background: var(--white);
  border: 1px solid var(--border-200);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(30, 58, 138, 0.05);
}

.profile-section h3 {
  font-size: 15px;
  color: var(--blue-800);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-200);
}

.profile-field {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 14px;
}

.profile-field-label {
  font-weight: 600;
  color: var(--text-700);
  min-width: 130px;
  flex-shrink: 0;
}

.profile-field-value {
  color: var(--text-900);
  word-break: break-word;
}

.profile-private-badge {
  font-size: 11px;
  background: #fef3c7;
  color: #92400e;
  padding: 2px 6px;
  border-radius: 999px;
  font-weight: 600;
  margin-left: 6px;
}

.profile-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .profile-panel {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   Notifications Page (moved from inline styles)
   ========================================================= */

.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-200);
  padding-bottom: 10px;
}

.tab-btn {
  background: #f4f9ff;
  border: 1px solid #cde2f8;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  color: #34516f;
  transition: all 0.2s;
}

.tab-btn:hover {
  background: #e8f3ff;
}

.tab-btn.active {
  background: #1f5ea8;
  color: var(--white);
  border-color: #1f5ea8;
}

.empty-state {
  color: #666;
  font-style: italic;
  padding: 20px 0;
}

.notifications-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.notification-card {
  border: 1px solid var(--border-200);
  border-radius: 8px;
  padding: 1.5rem;
  background-color: var(--white);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.notification-card.type-death {
  border-left: 4px solid #dc3545;
}

.notification-card.type-marriage {
  border-left: 4px solid #198754;
}

.notification-card.type-birth {
  border-left: 4px solid #0d6efd;
}

.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.notif-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-900);
}

.notif-date {
  font-size: 0.85rem;
  color: var(--text-700);
}

.notif-body p {
  margin: 0 0 0.5rem 0;
  color: var(--text-900);
}

.notif-details {
  font-size: 0.9rem;
  color: var(--text-700);
  margin-top: 0.25rem;
}

/* =========================================================
   Search Dropdown Styling
   ========================================================= */

.nav-search-container {
  position: relative;
}

.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--border-200);
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  margin-top: 5px;
}

.search-dropdown.active {
  display: block;
}

.search-result-item {
  padding: 10px 15px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-100);
  transition: background-color 0.2s;
  color: var(--text-900);
}

.search-result-item:hover {
  background-color: var(--blue-50);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-name {
  font-weight: 600;
  font-size: 14px;
}

.search-result-father {
  font-size: 12px;
  color: var(--text-700);
}

.search-empty {
  padding: 15px;
  color: var(--text-700);
  text-align: center;
  font-style: italic;
}

/* =========================================================
   Toast Notifications
   ========================================================= */
.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--white);
  border: 1px solid var(--border-200);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(30, 58, 138, 0.12);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 99999;
  max-width: 400px;
  animation: toast-slide-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

@keyframes toast-slide-in {
  from {
    transform: translateY(20px) scale(0.95);
    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.toast-content {
  font-size: 14px;
  color: var(--text-900);
  font-weight: 500;
  flex: 1;
}

.toast-close {
  background: transparent;
  color: var(--text-700);
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  margin: 0;
  line-height: 1;
  border-radius: 6px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.toast-close:hover {
  background: var(--blue-050);
  color: var(--blue-900);
}

.toast-success {
  border-left: 4px solid #10b981;
}

.toast-error {
  border-left: 4px solid var(--danger-600);
}

.toast-info {
  border-left: 4px solid var(--blue-500);
}




/* Notification hover creator */
.notification-card .notif-creator-hover {
  display: none;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #e2e8f0;
  font-size: 0.85em;
  color: #64748b;
}

.notification-card:hover .notif-creator-hover {
  display: block;
}

.btn-secondary {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.notification-card .notif-creator-info {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #e2e8f0;
  font-size: 0.85em;
  color: #64748b;
}

/* =========================================================
   Glassmorphic Popup Notifications
   ========================================================= */
.glass-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 420px;
  width: calc(100% - 48px);
  pointer-events: none;
}

.glass-toast {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(209, 213, 219, 0.3);
  border-radius: 16px;
  box-shadow: 0 10px 40px -10px rgba(31, 38, 135, 0.15), 
              0 1px 1px 0 rgba(255, 255, 255, 0.5) inset;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translateX(120%);
  opacity: 0;
}

.glass-toast.show {
  transform: translateX(0);
  opacity: 1;
}

.glass-toast.fade-out {
  transform: translateX(120%) scale(0.9);
  opacity: 0;
  margin-top: -80px; /* Collapse space smoothly */
}

.glass-toast-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.glass-toast-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--blue-900);
  margin: 0;
}

.glass-toast-close {
  background: transparent;
  color: var(--text-700);
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  transition: all 0.2s;
}

.glass-toast-close:hover {
  background: rgba(30, 58, 138, 0.1);
  color: var(--blue-900);
}

.glass-toast-body {
  font-size: 13px;
  color: var(--text-900);
  line-height: 1.4;
}

.glass-toast-meta {
  font-size: 11px;
  color: #64748b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.glass-toast-type {
  text-transform: uppercase;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 999px;
}

.glass-toast-type-death {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.glass-toast-type-marriage {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.glass-toast-type-birth {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.glass-toast-type-general {
  background: rgba(100, 116, 139, 0.15);
  color: #64748b;
}