@charset "UTF-8";

:root[hidden],
[hidden] {
  display: none !important
}

:root {
  --olive: #084d3b;
  --olive-dark: #053627;
  --muted: #6b7280;
  --bg: #ffffff;
  --card: #ffffff;
  --text: #0f172a;
  --border: rgba(0, 0, 0, .06);
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -4px rgba(0, 0, 0, .1);
  --radius: 16px;
  --topbar-h: 64px;
  --input-bg: #fafafa;
  --input-border: #f3f4f6;
  --modal-bg: #eef5ff;
  --modal-border: #dbeafe;
}

[data-theme="dark"] {
  --olive: #10b981;
  /* Lighter green for dark mode */
  --olive-dark: #059669;
  --muted: #9ca3af;
  --bg: #0f172a;
  --card: #1e293b;
  --text: #f1f5f9;
  --border: rgba(255, 255, 255, .1);
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, .5), 0 4px 6px -4px rgba(0, 0, 0, .5);
  --input-bg: #334155;
  --input-border: #475569;
  --modal-bg: #1e293b;
  --modal-border: #334155;
}

body.no-scroll {
  overflow: hidden
}

* {
  box-sizing: border-box
}

html {
  scroll-behavior: smooth
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Noto Sans Arabic", Tahoma, Arial;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  transition: background-color 0.3s, color 0.3s;
}

img {
  max-width: 100%;
  display: block
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem
}

#form.container {
  padding: 0
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--card);
  box-shadow: 0 1px 0 var(--border)
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: .75rem;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  color: inherit
}

.brand-logo {
  width: 36px;
  height: 36px;
  object-fit: contain
}

.brand-text {
  font-weight: 600;
  color: var(--olive)
}

.menu-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(8, 77, 59, .12);
  display: grid;
  place-content: center;
  gap: 4px
}

[data-theme="dark"] .menu-btn {
  background: rgba(255, 255, 255, 0.1);
}

.menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px
}

/* Theme Toggle Button */
.theme-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  margin-left: 0.5rem;
}

.theme-toggle:hover {
  background: var(--input-border);
}

/* Hero */
.hero {
  position: relative;
  min-height: 70vh;
  display: grid;
  align-items: center;
  margin-top: 3rem
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(0, 0, 0, .52), rgba(0, 0, 0, .28)),
    linear-gradient(to right, rgba(20, 184, 166, .58), rgba(0, 0, 0, .36)),
    url('../images/image.png') center/cover no-repeat;
  filter: saturate(110%);
}

.hero-content {
  position: relative;
  color: #fff;
  padding-block: 4rem;
  text-align: center;
  animation: fade-in-up 0.8s ease-out;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(255, 255, 255, .2);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .3);
  padding: .35rem .75rem;
  border-radius: 9999px
}

.badge svg {
  color: #fff
}

.badge svg.heart-icon {
  color: #ef4444;
  stroke: #ef4444
}

.hero-title {
  font-size: 2rem;
  line-height: 1.2;
  margin: 1rem 0;
  font-weight: 700
}

.hero-sub {
  opacity: .95
}

.cards {
  display: grid;
  gap: 1.5rem;
  margin: 1.5rem 0 2rem
}

@media (min-width:768px) {
  .cards {
    grid-template-columns: repeat(3, 1fr)
  }
}

.card {
  border-radius: var(--radius);
  background: var(--card);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  transition: background 0.3s, transform 0.2s;
}

.card:hover {
  transform: translateY(-5px);
}

.card.glass {
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, .4)
}

[data-theme="dark"] .card.glass {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(255, 255, 255, 0.1);
}

.card .icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(8, 77, 59, .1);
  display: grid;
  place-content: center;
  color: #fff;
  margin-bottom: .5rem;
  color: var(--olive)
}

[data-theme="dark"] .card .icon {
  background: rgba(255, 255, 255, 0.1);
}

.card h3 {
  margin: .25rem 0 .25rem;
  font-size: 1.05rem;
  color: var(--text);
}

.card p {
  margin: 0;
  color: var(--muted)
}

/* Hero glass overrides */
.hero .card.glass {
  background: rgba(255, 255, 255, .08);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, .2);
  text-align: center
}

.hero .card.glass h3,
.hero .card.glass p {
  color: #ffffff
}

.hero .card.glass .icon {
  background: rgba(255, 255, 255, .15);
  color: #ffffff;
  margin-inline: auto;
  border-radius: 50%
}

.hero .card.glass .icon svg {
  stroke: #ffffff
}

.btn-primary {
  display: inline-block;
  background: #fff;
  color: #084d3b;
  padding: .85rem 1.25rem;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: .2s;
  font-weight: 600
}

.btn-primary:hover {
  background: #f9fafb;
  color: #053627
}

.btn-outline {
  display: inline-block;
  border: none;
  color: #fff;
  background: var(--olive);
  padding: .85rem 2rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600
}

.btn-outline:hover {
  background: var(--olive-dark)
}

.center {
  text-align: center
}

/* About */
.about {
  padding: 1.5rem 1rem 3rem;
  background: url('../images/ground.png') center/cover no-repeat;
  text-align: center;
  position: relative
}

.about::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg);
  opacity: 0.85;
  z-index: 0
}

.about>* {
  position: relative;
  z-index: 1
}

.section-title {
  font-size: 1.75rem;
  margin-bottom: .75rem;
  font-weight: 700;
  padding-bottom: .05rem;
  border-bottom: 3px solid var(--olive);
  display: inline-block
}

.sub-title {
  font-size: 1.4rem;
  margin: 1.5rem 0 .5rem;
  font-weight: 700;
  padding-bottom: .05rem;
  border-bottom: 3px solid var(--olive);
  display: inline-block
}

.mb {
  margin-bottom: 1.5rem;
  max-width: 800px;
  margin-inline: auto
}

/* Notice */
.notice {
  display: flex;
  flex-direction: row-reverse;
  gap: 0;
  background: #fef3c7;
  border-radius: 0;
  box-shadow: none;
  border: none;
  border-left: 5px solid #f59e0b;
  margin: 2rem 0;
  padding: 1.5rem 2rem
}

[data-theme="dark"] .notice {
  background: #451a03;
  border-left-color: #d97706;
}

.notice-bar {
  display: none
}

.notice-text {
  font-weight: 600;
  color: #92400e;
  text-align: center;
  line-height: 1.8;
  font-size: .95rem
}

[data-theme="dark"] .notice-text {
  color: #fcd34d;
}

/* Form */
#form {
  background: var(--input-bg);
  padding: 2rem 0
}

#form .container-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 3rem
}

@media (max-width: 768px) {
  #form .container-inner {
    padding: 0 1rem;
  }
}

.form {
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 2rem
}

.form-title {
  text-align: center;
  font-size: 1.35rem;
  margin: 1rem 0 2rem;
  font-weight: 700
}

.form-section {
  margin: 0 0 1rem;
  font-size: 1.1rem
}

.grid {
  display: grid;
  gap: 1rem
}

@media (min-width:768px) {
  .grid {
    grid-template-columns: repeat(2, 1fr)
  }
}

.field {
  display: grid;
  gap: .4rem
}

.field span {
  font-weight: 600
}

.field .required {
  color: #ef4444;
  margin-right: .2rem
}

.field input::placeholder {
  color: var(--muted)
}

.field input,
.field select {
  height: 44px;
  border: 1px solid var(--input-border);
  border-radius: 12px;
  padding: 0 .9rem;
  font-family: inherit;
  background: var(--input-bg);
  color: var(--text);
}

/* Date Input Fix: Use standard browser behavior but style consistent */
.field input[type="date"] {
  appearance: none;
  -webkit-appearance: none;
  color: var(--text);
  position: relative;
}

/* Ensure dark mode calendar icon is visible if possible, or use filter invert */
[data-theme="dark"] .field input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}

.field input[type="tel"] {
  direction: ltr;
  text-align: right
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--olive);
  box-shadow: 0 0 0 3px rgba(8, 77, 59, .15)
}

[data-theme="dark"] .field input:focus,
[data-theme="dark"] .field select:focus {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.field .error-msg {
  display: none;
  color: #ef4444;
  font-size: .85rem;
  margin-top: .2rem
}

.field.invalid .error-msg {
  display: block
}

.field.invalid input,
.field.invalid select {
  border-color: #ef4444
}

.field.invalid .inline {
  outline: 1px dashed #ef4444;
  outline-offset: 6px;
  border-radius: 8px
}

.inline {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding-top: .3rem
}

.radio {
  display: flex;
  align-items: center;
  gap: .35rem
}

.field.file input[type="file"] {
  display: none
}

.file-ui {
  display: inline-block;
  border: 1px dashed var(--input-border);
  border-radius: 12px;
  padding: .8rem 1rem;
  background: var(--input-bg);
  cursor: pointer;
  color: var(--muted);
}

.muted {
  color: var(--muted)
}

.recaptcha {
  display: flex;
  gap: .75rem;
  align-items: center
}

.recaptcha-box {
  display: flex;
  align-items: center;
  gap: .5rem;
  border: 1px solid var(--input-border);
  border-radius: 12px;
  padding: .6rem .8rem;
  background: var(--card)
}

.recaptcha-logo {
  width: 22px;
  height: 22px;
  opacity: .8
}

.recaptcha-note {
  font-size: .8rem;
  color: var(--muted)
}

/* Family */
.family-area {
  margin: 1.25rem 0
}

.family-add {
  margin: 1rem 0;
  color: var(--text);
  text-align: right
}

.text-link {
  background: none;
  border: none;
  color: var(--olive);
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer
}

.family-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg);
  padding: 1rem;
  margin: 1rem 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

.family-title {
  margin: 0 0 .75rem;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700
}

.remove-family {
  position: absolute;
  left: .5rem;
  top: .35rem;
  background: none;
  border: none;
  color: #ef4444;
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1
}

.family-card .grid {
  display: grid;
  gap: 1rem
}

.family-card .field {
  display: grid;
  gap: .4rem
}

.btn-submit {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 999px;
  background: var(--olive);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1rem
}

.btn-submit:hover {
  background: var(--olive-dark)
}

.btn-submit:disabled,
.btn-submit[disabled] {
  background: var(--muted);
  color: var(--bg);
  cursor: not-allowed;
  box-shadow: none
}

.btn-submit:disabled:hover {
  background: var(--muted)
}

/* Footer */
.footer {
  margin-top: 3rem;
  background: linear-gradient(to right, var(--olive), var(--olive-dark));
  color: #fff
}

.footer .container {
  padding: 1rem;
  text-align: center
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem
}

@media (max-width:640px) {
  .footer-inner {
    flex-direction: column;
    gap: .5rem
  }
}

.socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem
}

.soc {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  border-radius: 999px;
  padding: .5rem .8rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .15);
  transition: .15s
}

.soc svg {
  width: 22px;
  height: 22px
}

.soc span {
  font-size: .95rem
}

.soc.fb {
  background: #1877F2
}

.soc.tt {
  background: #000000
}

.soc.wa {
  background: #25D366
}

.soc:hover {
  transform: translateY(-1px);
  filter: brightness(1.05)
}

/* Modal */
.modal-overlay {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--topbar-h);
  bottom: 0;
  background: rgba(0, 0, 0, .6);
  display: grid;
  justify-items: center;
  align-content: start;
  z-index: 1000;
  padding: 12px;
  overflow: auto
}

.modal-card {
  width: min(680px, 100%);
  background: var(--card);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, .25);
  padding: 1.25rem 1.25rem 1rem;
  text-align: center;
  max-height: calc(100dvh - var(--topbar-h) - 24px);
  overflow: auto;
  -webkit-overflow-scrolling: touch
}

.modal-title {
  margin: .25rem 0 1rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: #1d4ed8
}

[data-theme="dark"] .modal-title {
  color: #60a5fa;
}

/* Search Input Standard */
.search-input {
  padding: 0.4rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  width: 250px;
  transition: all 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--olive);
  box-shadow: 0 0 0 3px rgba(8, 77, 59, 0.1);
}

@media (max-width: 768px) {
  .search-input {
    width: 100%;
  }
}

/* Responsive Table */
.table-responsive {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  border-radius: var(--radius);
  background: var(--card);
}

/* Ensure tables inside responsive wrapper don't force width */
.table-responsive table {
  width: 100%;
  white-space: nowrap;
  /* Prevent wrapping in cells for better scrolling experience */
}

/* Responsive Layout Classes */
.actions-wrapper {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.search-form {
  display: flex;
  gap: 0.5rem;
}

.section-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

@media (max-width: 768px) {

  /* Stack Actions Wrapper */
  .actions-wrapper {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.75rem;
  }

  .section-header-flex {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .section-header-flex .search-form {
    width: 100%;
  }

  /* Search Form: Row layout on mobile */
  .search-form {
    flex-direction: row;
    width: 100%;
    align-items: center;
    gap: 0.5rem;
  }

  .search-form .search-input {
    width: auto !important;
    flex: 1;
    min-width: 0;
  }

  .search-form button,
  .search-form .action-btn {
    width: auto;
    padding-inline: 1rem;
    white-space: nowrap;
    text-align: center;
  }

  /* Back Button */
  .back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    background: var(--input-bg);
    color: var(--text);
    transition: background 0.2s;
    align-self: center;
    margin-top: 0;
  }

  .back-btn:hover {
    background: var(--border);
    color: var(--olive);
  }

  /* Reduce heading sizes */
  h1,
  h2,
  .page-title,
  .section-title {
    font-size: 1.35rem !important;
  }
}


/* Custom Select with Flags */
.custom-select {
  position: relative;
  width: 100%;
}

/* Fix Table Layout Shift */
td.actions {
  width: 40px;
  white-space: nowrap;
  text-align: center;
}

/* Back Button Standard (Desktop) */
.back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  transition: all 0.2s;
}

.back-btn:hover {
  background: var(--input-bg);
  color: var(--olive);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* Filter Form Styles */
.filter-form {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  background: var(--card);
  padding: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.filter-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-form label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.filter-form .form-control {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
  min-width: 150px;
  transition: all 0.2s;
}

.filter-form .form-control:focus {
  border-color: var(--olive);
  outline: none;
  box-shadow: 0 0 0 3px rgba(8, 77, 59, 0.1);
}

.btn-secondary {
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.5rem 1.25rem;
  border-radius: 99px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  /* Match primary button height if possible */
}

.btn-secondary:hover {
  background: var(--border);
  color: var(--olive);
}

/* Status Badges */
.status-badge {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  /* Slightly smaller for better fit */
  font-weight: 600;
  white-space: nowrap;
  /* Prevent wrapping */
  display: inline-block;
}

.status-replied {
  background: #10b981;
  color: white;
}

.status-pending {
  background: #f59e0b;
  color: white;
}

/* Custom Checkbox */
.checkbox-custom {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--olive);
  opacity: 0.8;
  vertical-align: middle;
}

.checkbox-custom:checked {
  opacity: 1;
}

/* Selection Actions Bar */
.selection-actions {
  position: sticky;
  bottom: 20px;
  background: var(--card);
  padding: 0.75rem 1rem;
  /* Compact padding */
  border-radius: var(--radius);
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.05);
  /* Softer shadow */
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border);
  z-index: 90;
  margin-top: 1rem;
  gap: 1rem;
}

.select-count {
  font-weight: 700;
  color: var(--olive);
  font-size: 0.9rem;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .selection-actions {
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
    text-align: center;
    bottom: 10px;
  }

  .status-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
  }
}

.select-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 44px;
  padding: 0 0.9rem;
  font-family: inherit;
  font-size: 1rem;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.select-trigger:focus,
.custom-select.open .select-trigger {
  border-color: var(--olive);
  box-shadow: 0 0 0 3px rgba(8, 77, 59, .15);
  outline: none;
}

[data-theme="dark"] .select-trigger:focus,
[data-theme="dark"] .custom-select.open .select-trigger {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.arrow {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--muted);
  transition: transform 0.2s;
}

.custom-select.open .arrow {
  transform: rotate(180deg);
}

.select-options {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  max-height: 250px;
  overflow-y: auto;
  z-index: 100;
  padding: 0.5rem 0;
  margin: 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s;
}

.custom-select.open .select-options {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.select-options li {
  padding: 0.75rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: background 0.1s;
}

.select-options li:hover {
  background: var(--input-bg);
}

.select-options li.selected {
  background: rgba(8, 77, 59, 0.1);
  color: var(--olive);
  font-weight: 600;
}

[data-theme="dark"] .select-options li.selected {
  background: rgba(16, 185, 129, 0.1);
}

/* Flag Icon tweaks */
.fi {
  width: 1.3em !important;
  height: 1em;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.selected-icon {
  margin-left: 0.5rem;
}

.modal-hello {
  margin: .25rem 0 .25rem;
  font-weight: 700;
  text-align: right
}

.modal-lead {
  margin: 0 0 1rem;
  color: var(--text);
  text-align: right
}

.modal-box {
  background: var(--modal-bg);
  border: 1px solid var(--modal-border);
  border-radius: 16px;
  padding: 1rem;
  margin: 0 0 1rem;
  text-align: right
}

.modal-box p {
  margin: .25rem 0;
  color: var(--text)
}

.modal-box .tel a {
  color: #60a5fa;
  font-weight: 800;
  text-decoration: none
}

.modal-box .tel a:hover {
  text-decoration: underline
}

.modal-warn {
  color: #dc2626;
  font-weight: 700;
  margin: .75rem 0;
  line-height: 1.9
}

[data-theme="dark"] .modal-warn {
  color: #f87171;
}

.modal-sep {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1rem 0
}

.modal-thanks {
  margin: .5rem 0 1rem;
  color: var(--text);
  font-weight: 600
}

.btn-modal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  height: 44px;
  padding: 0 .9rem;
  border: none;
  border-radius: 12px;
  background: var(--olive);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  margin: .75rem auto 0
}

.btn-modal:hover {
  background: var(--olive-dark)
}

/* Upload overlay */
.upload-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  display: none;
  place-items: center;
  z-index: 2000
}

.uploading .upload-overlay {
  display: grid
}

.upload-card {
  width: min(420px, 92%);
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, .25);
  padding: 1.25rem 1.5rem;
  text-align: center
}

.upload-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--input-border);
  border-top-color: var(--olive);
  border-radius: 50%;
  margin: 0 auto 10px;
  animation: spin 1s linear infinite
}

.upload-title {
  margin: .25rem 0 .25rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text)
}

.upload-note {
  margin: 0;
  color: var(--muted)
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

/* Toast */
.toast {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  z-index: 9999;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .9rem 1.1rem;
  box-shadow: 0 10px 20px rgba(0, 0, 0, .08);
  opacity: 0;
  animation: toast-in .25s ease forwards, toast-out .3s ease 3.5s forwards
}

.toast-success {
  background: #ecfdf5;
  border-color: #86efac;
  color: #065f46
}

.toast-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b
}

[data-theme="dark"] .toast-success {
  background: #064e3b;
  border-color: #059669;
  color: #a7f3d0;
}

[data-theme="dark"] .toast-error {
  background: #7f1d1d;
  border-color: #b91c1c;
  color: #fca5a5;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px)
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0)
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px)
  }
}

/* ----------------------------------------------------------------- */
/* NEW STYLES FROM ADMIN & ENHANCEMENTS */
/* ----------------------------------------------------------------- */

/* Animations */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Page Loader (Circular) */
#loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 99999;
  display: grid;
  place-items: center;
  transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

#loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid var(--input-border);
  border-top-color: var(--olive);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Admin Dashboard & Layout */
.dashboard-container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
  animation: fade-in-up 0.5s ease-out;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  position: relative;
  width: 90%;
  max-width: 380px;
  /* Compact width */
  background: var(--card);
  padding: 1.5rem;
  /* Reduced padding */
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 90vh;
  /* Prevent overflow on small screens */
  overflow-y: auto;
  text-align: center;
  justify-content: center;
  align-items: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

@media (max-width: 480px) {
  .modal-card {
    padding: 1rem;
    gap: 0.75rem;
    width: 95%;
  }

  .modal-title {
    font-size: 1.1rem;
  }
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 20px -3px rgba(0, 0, 0, .15);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--olive);
  margin-bottom: 0.5rem;
  line-height: 1;
}

.stat-label {
  font-size: 1rem;
  color: var(--muted);
  font-weight: 600;
}

.content-section {
  border-radius: var(--radius);
  background: var(--card);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

/* Tables */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 1rem;
}

th,
td {
  padding: 1rem;
  text-align: right;
  border-bottom: 1px solid var(--border);
}

th {
  background-color: var(--input-bg);
  font-weight: 700;
  color: var(--text);
}

th:first-child {
  border-top-right-radius: 8px;
}

th:last-child {
  border-top-left-radius: 8px;
}

tr:last-child td {
  border-bottom: none;
}

[data-theme="dark"] th {
  background-color: var(--input-bg);
}

.view-all-btn {
  display: inline-block;
  background-color: var(--olive);
  color: white;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  border-radius: 999px;
  margin-top: 1.5rem;
  font-weight: 700;
  transition: background 0.2s;
}

.view-all-btn:hover {
  background-color: var(--olive-dark);
}

.action-btn {
  padding: 0.4rem 1rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-block;
}

.view-btn {
  background-color: #10b981;
  color: white;
}

.view-btn:hover {
  background-color: #059669;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logout-btn {
  background: #ef4444;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.2s;
}

.logout-btn:hover {
  background: #dc2626;
}

@media (max-width: 768px) {
  .table-responsive {
    overflow-x: auto;
  }
}

/* Contact Links in Dark Mode (High Contrast) */
.contact-link {
  color: var(--olive);
  text-decoration: none;
  transition: color 0.2s;
}

.contact-link:hover {
  color: var(--olive-dark);
  text-decoration: underline;
}

[data-theme="dark"] .contact-link {
  color: #34d399;
  /* Bright green/teal for better visibility on dark */
  font-weight: 500;
}

/* Detail View Layout */
.page-container {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 1rem;
  animation: fade-in-up 0.5s ease-out;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-size: 1.75rem;
  color: var(--olive);
  font-weight: 700;
  margin: 0;
  border-bottom: 3px solid var(--olive);
  padding-bottom: 0.5rem;
}

.back-btn {
  display: inline-block;
  background-color: var(--olive);
  color: white;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  border-radius: 999px;
  font-weight: 600;
  transition: background 0.2s;
}

.back-btn:hover {
  background-color: var(--olive-dark);
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.detail-item {
  margin-bottom: 1rem;
}

.detail-label {
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
}

.detail-value {
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 500;
  padding: .25rem 0;
}

.file-link {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--olive);
  color: #fff !important;
  text-decoration: none;
  padding: .5rem 1.25rem;
  border-radius: 99px;
  font-weight: 600;
  height: 36px;
}

.file-link:hover {
  background: var(--olive-dark);
}

.attachment-preview {
  margin-top: 1rem;
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Login Page Styles */
.login-wrapper {
  min-height: 80vh;
  display: grid;
  place-items: center;
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 2rem;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  margin: 1rem;
  animation: fade-in-up 0.5s ease-out;
}

.login-header {
  text-align: center;
  margin-bottom: 20px;
}

.logo {
  text-align: center;
  margin-bottom: 2rem;
}

.logo h1 {
  color: var(--olive);
  margin: 0;
  font-size: 1.5rem;
}

.logo img {
  width: 64px;
  height: 64px;
  margin: 0 auto 0.5rem;
  object-fit: contain;
}

.login-form button {
  margin-top: 1.5rem;
}

.error-message {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: .75rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  text-align: center;
  font-size: .9rem;
}

/* User Dropdown */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.dropdown-toggle:hover {
  background: var(--input-bg);
}

.dropdown-menu {
  position: absolute;
  left: 0;
  top: 120%;
  min-width: 200px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  padding: 0.5rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
  border: 1px solid var(--border);
}

.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-header {
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.dropdown-item {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  transition: background 0.2s;
}

.dropdown-item:hover {
  background: var(--input-bg);
}

.dropdown-item.text-danger {
  color: #ef4444;
}

.dropdown-item.text-danger:hover {
  background: #fef2f2;
}

/* Mobile specific for dropdown */
@media (max-width: 768px) {
  .dropdown-menu {
    left: -10px;
    /* Adjust slightly if needed */
    min-width: 240px;
  }
}