/*
 * Portal theme layer.
 * No rules target data-theme="current", preserving the purple design.
 */

:root {
  --theme-focus: #ffd54a;
}

/* Persistent page scrollbar across every route and theme. */
html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
  scrollbar-width: auto;
  scrollbar-color: #65756d rgba(101, 117, 109, 0.16);
}

html::-webkit-scrollbar {
  width: 14px;
}

html::-webkit-scrollbar-track {
  background: rgba(101, 117, 109, 0.16);
}

html::-webkit-scrollbar-thumb {
  min-height: 56px;
  border: 3px solid transparent;
  border-radius: 999px;
  background: #65756d;
  background-clip: padding-box;
}

html::-webkit-scrollbar-thumb:hover {
  background: #405149;
  background-clip: padding-box;
}

html[data-theme="dark"] {
  scrollbar-color: #8ea49a rgba(255, 255, 255, 0.09);
}

html[data-theme="dark"]::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.09);
}

html[data-theme="dark"]::-webkit-scrollbar-thumb {
  background: #8ea49a;
  background-clip: padding-box;
}

/* Stable navigation hit areas: hover must never move the link under the pointer. */
.navbar nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 7px 5px;
  transform: none !important;
  translate: none !important;
  transition: color 160ms ease, background-color 160ms ease,
    text-decoration-color 160ms ease !important;
}

.navbar nav a:hover,
.navbar nav a:focus-visible {
  transform: none !important;
  translate: none !important;
  border-radius: 7px;
  background: rgba(20, 91, 67, 0.08);
}

/* Three-zone public navbar: brand | navigation | account actions. */
@media (min-width: 769px) {
  .navbar {
    display: grid !important;
    grid-template-columns: max-content minmax(0, 1fr) max-content;
    align-items: center !important;
    column-gap: clamp(24px, 3vw, 58px) !important;
    width: 100%;
  }

  .navbar .logo {
    margin: 0 !important;
    font-size: clamp(36px, 3.1vw, 60px);
    line-height: 1;
    white-space: nowrap;
  }

  .navbar nav {
    display: flex !important;
    align-items: center;
    justify-content: center !important;
    gap: clamp(12px, 1.25vw, 26px) !important;
    min-width: 0;
    width: 100%;
    margin: 0 !important;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .navbar nav::-webkit-scrollbar {
    display: none;
  }

  .navbar #authArea {
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    gap: 12px !important;
    min-width: max-content;
    margin: 0 !important;
  }

  .navbar #authArea > span {
    margin-right: 4px;
    white-space: nowrap;
  }
}

@media (min-width: 769px) and (max-width: 1180px) {
  .navbar {
    grid-template-columns: max-content minmax(0, 1fr) max-content;
    column-gap: 18px !important;
    padding-inline: 20px !important;
  }

  .navbar .logo {
    font-size: 34px;
  }

  .navbar nav {
    justify-content: flex-start !important;
    gap: 12px !important;
  }
}

/* Standard recovery dialog in Purple, Light, and Dark themes. */
body.recovery-modal-open {
  position: fixed !important;
  left: 0;
  width: 100%;
  overflow: hidden !important;
}

body.edit-modal-open {
  position: fixed !important;
  left: 0;
  width: 100%;
  overflow: hidden !important;
}

body.preview-modal-open {
  position: fixed !important;
  left: 0;
  width: 100%;
  overflow: hidden !important;
}

#previewModal.show {
  display: block !important;
  width: 100dvw !important;
  height: 100dvh !important;
  padding: 12px;
  box-sizing: border-box;
  overflow: hidden;
  overscroll-behavior: contain;
  z-index: 2147483000 !important;
  background: rgba(8, 12, 10, 0.96) !important;
  backdrop-filter: blur(12px);
}

#previewModal .preview-toolbar {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(24, 31, 28, 0.82);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

#previewModal .preview-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto !important;
  min-width: 46px;
  min-height: 44px;
  margin: 0 !important;
  padding: 9px 16px;
  border: none;
  border-radius: 999px;
  background: #145b43;
  color: #fff;
  font-size: 1rem;
  font-weight: 750;
  line-height: 1;
}

#previewModal .preview-toolbar button:focus-visible {
  outline: 3px solid #f4c84a;
  outline-offset: 2px;
}

#previewModal .preview-stage {
  position: absolute;
  top: 76px;
  right: 24px;
  bottom: 16px;
  left: 24px;
  z-index: 1;
  display: grid;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  place-items: center;
  overscroll-behavior: contain;
  cursor: zoom-in;
  scrollbar-width: none;
  -ms-overflow-style: none;
  touch-action: none;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.24);
}

#previewModal .preview-stage::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

#previewModal .preview-stage.is-zoomed {
  cursor: grab;
}

#previewModal .preview-stage.is-panning {
  cursor: grabbing;
  user-select: none;
}

#previewModal #previewImg {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 100% !important;
  max-height: 100% !important;
  margin: 0 !important;
  object-fit: contain !important;
  transform-origin: center center;
  pointer-events: none;
  user-select: none;
  image-rendering: auto;
  filter: none;
  backface-visibility: hidden;
}

#previewModal .thumb-container {
  position: absolute !important;
  bottom: 10px !important;
  left: 50% !important;
  z-index: 2;
  display: flex;
  width: min(100%, 720px) !important;
  min-height: 0;
  max-height: 72px;
  margin: 0 auto;
  padding: 5px 8px;
  overflow-x: auto;
  transform: translateX(-50%) !important;
  border-radius: 12px;
  background: rgba(5, 14, 10, 0.62);
  backdrop-filter: blur(6px);
  box-sizing: border-box;
  transition: opacity 160ms ease, visibility 160ms ease,
    transform 160ms ease;
}

#previewModal.preview-thumbs-hidden .thumb-container {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 18px) !important;
}

#previewModal .nav-btn {
  top: 50% !important;
  z-index: 4 !important;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 50%;
  background: rgba(20, 30, 26, 0.72);
  backdrop-filter: blur(8px);
}

@media (max-width: 480px) {
  #previewModal.show {
    padding: 8px;
  }

  #previewModal .preview-toolbar {
    width: 100%;
    top: 8px;
    border-radius: 18px;
    box-sizing: border-box;
  }

  #previewModal .preview-toolbar button {
    flex: 1 1 auto;
    min-height: 42px;
    padding-inline: 12px;
  }

  #previewModal .thumb-container {
    max-height: 60px;
  }

  #previewModal .preview-stage {
    top: 112px;
    right: 8px;
    bottom: 8px;
    left: 8px;
  }
}

#editModal {
  z-index: 2147483000 !important;
  overscroll-behavior: contain;
}

#editModal .confirm-box {
  overscroll-behavior: contain;
  overflow-y: scroll !important;
  scrollbar-gutter: stable;
  scrollbar-width: auto;
  scrollbar-color: #65756d rgba(101, 117, 109, 0.16);
}

#editModal .confirm-box::-webkit-scrollbar {
  width: 12px;
}

#editModal .confirm-box::-webkit-scrollbar-track {
  background: rgba(101, 117, 109, 0.16);
  border-radius: 999px;
}

#editModal .confirm-box::-webkit-scrollbar-thumb {
  min-height: 52px;
  border: 3px solid transparent;
  border-radius: 999px;
  background: #65756d;
  background-clip: padding-box;
}

#editModal .confirm-box::-webkit-scrollbar-thumb:hover {
  background: #405149;
  background-clip: padding-box;
}

#customModal {
  z-index: 2147483000 !important;
  padding: 16px !important;
  box-sizing: border-box !important;
  overscroll-behavior: contain;
}

#customModal .modal-box {
  width: min(480px, calc(100vw - 32px)) !important;
  max-height: calc(100dvh - 32px) !important;
  padding: clamp(20px, 3vw, 28px) !important;
  border-radius: 18px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  box-sizing: border-box !important;
}

#customModal #modalTitle {
  margin: 0 0 6px !important;
  font-size: clamp(1.65rem, 4vw, 2rem) !important;
  line-height: 1.15 !important;
}

#customModal #confirmText {
  margin: 0 auto 16px !important;
  font-size: clamp(0.95rem, 2.4vw, 1.05rem) !important;
  line-height: 1.4 !important;
}

#customModal #modalForm {
  width: min(100%, 400px) !important;
  margin: 0 auto !important;
}

#customModal #modalForm label {
  margin: 10px 0 5px !important;
  font-size: 0.9rem !important;
  line-height: 1.3 !important;
}

#customModal #modalInput1,
#customModal .password-box input {
  min-height: 48px !important;
  font-size: 1rem !important;
}

#customModal .confirm-actions {
  gap: 10px !important;
  margin-top: 18px !important;
}

#customModal .confirm-actions button {
  min-width: 120px !important;
  min-height: 44px !important;
  padding: 9px 20px !important;
  font-size: 0.95rem !important;
}

#customModal #modalMsg {
  min-height: 1.25em !important;
  margin: 10px 0 0 !important;
}

/* Admin reset already knows the username; do not repeat that field in step 2. */
#customModal.recovery-admin-step #label1,
#customModal.recovery-admin-step #modalInput1 {
  display: none !important;
}

#customModal.recovery-admin-step .modal-box {
  width: min(460px, calc(100vw - 32px)) !important;
  padding: 20px 24px !important;
}

#customModal.recovery-admin-step #modalTitle {
  font-size: clamp(1.55rem, 4vw, 1.85rem) !important;
}

#customModal.recovery-admin-step #confirmText {
  margin-bottom: 12px !important;
  font-size: clamp(0.9rem, 2.3vw, 1rem) !important;
}

#customModal.recovery-admin-step #modalForm label {
  margin: 7px 0 4px !important;
}

#customModal.recovery-admin-step .password-box input {
  min-height: 44px !important;
}

#customModal.recovery-admin-step .confirm-actions {
  margin-top: 14px !important;
}

@media (max-width: 420px) {
  #customModal {
    padding: 10px !important;
  }

  #customModal .modal-box {
    width: 100% !important;
    max-height: calc(100dvh - 20px) !important;
    padding: 18px 14px !important;
    border-radius: 16px !important;
  }

  #customModal .confirm-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
  }

  #customModal .confirm-actions button {
    width: 100% !important;
    min-width: 0 !important;
  }
}

@media (max-width: 340px) {
  #customModal .confirm-actions {
    grid-template-columns: 1fr !important;
  }
}

html[data-theme="light"] {
  --theme-bg-start: #f8f5eb;
  --theme-bg-end: #eee9da;
  --theme-surface: rgba(255, 253, 246, 0.94);
  --theme-surface-strong: #fffdf6;
  --theme-text: #15231c;
  --theme-muted: #58675f;
  --theme-text-secondary: #58675f;
  --theme-border: rgba(24, 70, 54, 0.18);
  --theme-control-bg: #ffffff;
  --theme-control-border: #8ea89b;
  --theme-danger: #b42318;
  --theme-accent: #174936;
  --theme-accent-hover: #0f3829;
  --theme-on-accent: #ffffff;
  --theme-muted-surface: #e8eee9;
  --theme-gold: #d39b2a;
  --theme-gold-soft: #f5dfaa;
  --theme-shadow: 0 14px 36px rgba(30, 55, 44, 0.12);
}

html[data-theme="dark"] {
  --theme-bg-start: #09130f;
  --theme-bg-end: #111c17;
  --theme-surface: rgba(24, 38, 32, 0.94);
  --theme-surface-strong: #1d3028;
  --theme-text: #f5f1e5;
  --theme-muted: #bdc9c2;
  --theme-text-secondary: #bdc9c2;
  --theme-border: rgba(225, 235, 229, 0.18);
  --theme-control-bg: #13251d;
  --theme-control-border: #71887d;
  --theme-danger: #ff9a91;
  --theme-accent: #79c5a3;
  --theme-accent-hover: #9dd7bd;
  --theme-on-accent: #10231b;
  --theme-muted-surface: #30453c;
  --theme-gold: #e4b958;
  --theme-shadow: 0 16px 42px rgba(0, 0, 0, 0.42);
}

html[data-theme="light"] body,
html[data-theme="dark"] body {
  background:
    radial-gradient(
      circle at 85% 5%,
      color-mix(in srgb, var(--theme-accent) 15%, transparent),
      transparent 32%
    ),
    linear-gradient(135deg, var(--theme-bg-start), var(--theme-bg-end));
  color: var(--theme-text);
}

html[data-theme="light"] body {
  background:
    radial-gradient(circle at 88% 8%, rgba(203, 222, 211, 0.72), transparent 31%),
    linear-gradient(135deg, var(--theme-bg-start), var(--theme-bg-end));
}

html[data-theme="light"] .navbar,
html[data-theme="dark"] .navbar {
  background: color-mix(
    in srgb,
    var(--theme-surface-strong) 84%,
    transparent
  );
  border-bottom: 1px solid var(--theme-border);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .navbar {
  background: rgba(248, 245, 235, 0.97);
  border-bottom-color: rgba(23, 73, 54, 0.16);
  box-shadow: 0 7px 24px rgba(23, 73, 54, 0.08);
}

html[data-theme="light"] .navbar nav a,
html[data-theme="light"] .navbar .logo,
html[data-theme="light"] .navbar .auth-section,
html[data-theme="dark"] .navbar nav a,
html[data-theme="dark"] .navbar .logo,
html[data-theme="dark"] .navbar .auth-section {
  color: var(--theme-text);
}

html[data-theme="light"] .navbar .logo,
html[data-theme="light"] .navbar .logo *,
html[data-theme="light"] .navbar nav a,
html[data-theme="light"] .navbar .auth-section,
html[data-theme="light"] .navbar .auth-section * {
  color: #15231c !important;
  text-shadow: none !important;
  opacity: 1 !important;
}

html[data-theme="light"] .navbar .logo,
html[data-theme="dark"] .navbar .logo {
  background: none !important;
  background-image: none !important;
  background-clip: border-box !important;
  -webkit-background-clip: border-box !important;
  -webkit-text-fill-color: currentColor !important;
}

html[data-theme="dark"] .navbar .logo,
html[data-theme="dark"] .navbar .logo *,
html[data-theme="dark"] .navbar nav a,
html[data-theme="dark"] .navbar .auth-section,
html[data-theme="dark"] .navbar .auth-section * {
  color: #f5f1e5 !important;
  text-shadow: none !important;
  opacity: 1 !important;
}

html[data-theme="light"] .navbar button,
html[data-theme="dark"] .navbar button {
  min-height: 42px;
  padding: 9px 18px;
  border-radius: 999px;
}

html[data-theme="light"] .navbar .auth-section button {
  color: var(--theme-on-accent) !important;
}

html[data-theme="dark"] .navbar .auth-section button {
  color: var(--theme-text) !important;
}

html[data-theme="light"] .card,
html[data-theme="light"] table,
html[data-theme="light"] .login-card,
html[data-theme="light"] .material-empty-state,
html[data-theme="dark"] .card,
html[data-theme="dark"] table,
html[data-theme="dark"] .login-card,
html[data-theme="dark"] .material-empty-state {
  background: var(--theme-surface);
  color: var(--theme-text);
  border-color: var(--theme-border);
  box-shadow: var(--theme-shadow);
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea,
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: var(--theme-surface-strong);
  color: var(--theme-text);
  border: 1px solid var(--theme-border);
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  border-color: #9eb5a8 !important;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  border-color: #5d776b !important;
}

html[data-theme="light"] input:focus,
html[data-theme="light"] select:focus,
html[data-theme="light"] textarea:focus,
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus {
  border-color: var(--theme-accent) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-accent) 24%, transparent) !important;
}

html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
  color: #68776f;
  opacity: 1;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #aebbb4;
  opacity: 1;
}

html[data-theme="light"] button:not(.yes-btn):not(.delete-btn),
html[data-theme="light"] .btn,
html[data-theme="dark"] button:not(.yes-btn):not(.delete-btn),
html[data-theme="dark"] .btn {
  background: var(--theme-surface-strong);
  color: var(--theme-accent);
  border-color: var(--theme-border);
}

html[data-theme="light"] button:not(.yes-btn):not(.delete-btn):not(.secondary-btn):not(.no-btn):not(.edit-btn) {
  color: var(--theme-on-accent) !important;
}

html[data-theme="dark"] button:not(.yes-btn):not(.delete-btn):not(.secondary-btn):not(.no-btn):not(.edit-btn) {
  color: var(--theme-accent) !important;
}

html[data-theme="light"] button *,
html[data-theme="dark"] button * {
  color: inherit !important;
}

html[data-theme="light"] button:not(.yes-btn):not(.delete-btn),
html[data-theme="light"] .btn {
  background: var(--theme-accent);
  color: #fffdf6;
  border: 1px solid var(--theme-accent);
  box-shadow: 0 6px 16px rgba(23, 73, 54, 0.14);
  opacity: 1;
  min-height: 40px;
}

html[data-theme="light"] button:not(.yes-btn):not(.delete-btn):hover,
html[data-theme="light"] .btn:hover {
  background: var(--theme-accent-hover);
  color: #ffffff;
  border-color: var(--theme-accent-hover);
}

html[data-theme="dark"] button:not(.yes-btn):not(.delete-btn),
html[data-theme="dark"] .btn {
  background: #28483b;
  color: #f7f3e9;
  border: 1px solid #4d7563;
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.24);
  opacity: 1;
  min-height: 40px;
}

html[data-theme="light"] .edit-btn {
  background: var(--theme-accent) !important;
  color: #fff !important;
  border: 1px solid var(--theme-accent) !important;
  min-height: 40px;
  opacity: 1;
}

html[data-theme="dark"] .edit-btn {
  background: #315f4c !important;
  color: #fff !important;
  border: 1px solid #5a9279 !important;
  min-height: 40px;
  opacity: 1;
}

html[data-theme="light"] .delete-btn,
html[data-theme="dark"] .delete-btn {
  min-height: 40px;
}

html[data-theme="dark"] button:not(.yes-btn):not(.delete-btn):hover,
html[data-theme="dark"] .btn:hover {
  background: #35614f;
  color: #ffffff;
  border-color: #79c5a3;
}

html[data-theme="light"] .section-title,
html[data-theme="light"] .page-title,
html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="dark"] .section-title,
html[data-theme="dark"] .page-title,
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3 {
  color: var(--theme-text);
  text-shadow: none;
}

html[data-theme="light"] p,
html[data-theme="light"] li,
html[data-theme="light"] label,
html[data-theme="light"] td,
html[data-theme="light"] th {
  color: var(--theme-text);
}

html[data-theme="dark"] p,
html[data-theme="dark"] li,
html[data-theme="dark"] label,
html[data-theme="dark"] td,
html[data-theme="dark"] th {
  color: var(--theme-text);
}

html[data-theme="light"] a:not(.homepage-contact-button):not(.footer-contact-btn),
html[data-theme="dark"] a:not(.homepage-contact-button):not(.footer-contact-btn) {
  text-underline-offset: 3px;
}

html[data-theme="light"] .homepage-contact-button--expert,
html[data-theme="light"] .homepage-contact-button--project {
  background: var(--theme-accent) !important;
  color: var(--theme-on-accent) !important;
  border-color: var(--theme-accent) !important;
}

html[data-theme="dark"] .homepage-contact-button--expert,
html[data-theme="dark"] .homepage-contact-button--project {
  background: var(--theme-gold) !important;
  color: #17221d !important;
  border-color: var(--theme-gold) !important;
}

html[data-theme="light"] footer,
html[data-theme="dark"] footer,
html[data-theme="light"] .footer,
html[data-theme="dark"] .footer {
  background: color-mix(
    in srgb,
    var(--theme-surface-strong) 92%,
    transparent
  );
  color: var(--theme-text);
  border-top: 1px solid var(--theme-border);
}

/* Light theme: complete Admin coverage for legacy inline purple styles. */
html[data-theme="light"] .page,
html[data-theme="light"] .container {
  color: var(--theme-text);
}

html[data-theme="light"] .page > .container > div:first-of-type > div:first-child > div:first-child {
  background: var(--theme-surface) !important;
  border: 1px solid var(--theme-border);
  box-shadow: var(--theme-shadow);
  color: var(--theme-text);
}

html[data-theme="light"] #mongoUsage,
html[data-theme="light"] #cloudUsage {
  color: var(--theme-accent) !important;
}

html[data-theme="light"] #mongoBar,
html[data-theme="light"] #cloudBar {
  background: var(--theme-gold) !important;
}

html[data-theme="light"] .card,
html[data-theme="light"] .mobile-card,
html[data-theme="light"] .user-row,
html[data-theme="light"] .admin-enquiry-card {
  background: var(--theme-surface) !important;
  color: var(--theme-text) !important;
  border: 1px solid var(--theme-border) !important;
  box-shadow: var(--theme-shadow);
  opacity: 1;
}

html[data-theme="light"] .user-row,
html[data-theme="light"] .admin-enquiry-card {
  box-shadow: none;
}

html[data-theme="light"] #usersList,
html[data-theme="light"] #contactList,
html[data-theme="light"] .admin-enquiry-date,
html[data-theme="light"] .admin-enquiry-field,
html[data-theme="light"] .admin-enquiry-description {
  color: var(--theme-text) !important;
}

html[data-theme="light"] .admin-enquiry-date {
  color: var(--theme-muted) !important;
  opacity: 1;
}

html[data-theme="light"] .status-approved {
  color: #08743f !important;
  font-weight: 800;
}

html[data-theme="light"] .status-pending {
  color: #9b5b00 !important;
  font-weight: 800;
}

html[data-theme="light"] .main-admin {
  background: var(--theme-gold-soft) !important;
  color: #3c2c0c !important;
  border: 1px solid #c99a32;
}

html[data-theme="light"] .btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 12px 0 16px;
}

html[data-theme="light"] .approve-btn {
  background: #137a45 !important;
  border-color: #137a45 !important;
  color: #fff !important;
}

html[data-theme="light"] .reject-btn,
html[data-theme="light"] .delete-btn,
html[data-theme="light"] .admin-enquiry-delete {
  background: #c62828 !important;
  border-color: #c62828 !important;
  color: #fff !important;
  opacity: 1;
}

html[data-theme="light"] .admin-btn {
  background: #174936 !important;
  border-color: #174936 !important;
  color: #fff !important;
}

html[data-theme="light"] .user-btn {
  background: #d39b2a !important;
  border-color: #b98219 !important;
  color: #241b08 !important;
}

html[data-theme="light"] #changePasswordBtn {
  background: var(--theme-gold) !important;
  color: #241b08 !important;
  border-color: #b98219 !important;
}

html[data-theme="light"] .theme-admin-card {
  border-top: 4px solid var(--theme-accent) !important;
}

html[data-theme="light"] .theme-admin-card p,
html[data-theme="light"] .theme-status {
  color: var(--theme-muted);
}

html[data-theme="light"] .theme-admin-controls button {
  background: var(--theme-accent) !important;
  border-color: var(--theme-accent) !important;
  color: #fff !important;
}

html[data-theme="light"] .confirm-box {
  background: var(--theme-surface-strong) !important;
  color: var(--theme-text) !important;
  border: 1px solid var(--theme-border);
}

/* Shared dialog, editor, viewer and popup surfaces in both new themes. */
html[data-theme="light"] .confirm-modal,
html[data-theme="light"] .about-modal,
html[data-theme="light"] .preview-modal,
html[data-theme="light"] .modal,
html[data-theme="light"] .import-modal,
html[data-theme="light"] #billImageModal,
html[data-theme="dark"] .confirm-modal,
html[data-theme="dark"] .about-modal,
html[data-theme="dark"] .preview-modal,
html[data-theme="dark"] .modal,
html[data-theme="dark"] .import-modal,
html[data-theme="dark"] #billImageModal {
  background: rgba(5, 14, 10, 0.76) !important;
  backdrop-filter: blur(7px);
}

html[data-theme="light"] .confirm-box,
html[data-theme="light"] .modal-box,
html[data-theme="light"] .modal-content,
html[data-theme="light"] .about-box,
html[data-theme="light"] .preview-content,
html[data-theme="light"] .import-box,
html[data-theme="dark"] .confirm-box,
html[data-theme="dark"] .modal-box,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .about-box,
html[data-theme="dark"] .preview-content,
html[data-theme="dark"] .import-box {
  background: var(--theme-surface-strong) !important;
  color: var(--theme-text) !important;
  border: 1px solid var(--theme-border) !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="light"] .confirm-box h2,
html[data-theme="light"] .confirm-box h3,
html[data-theme="light"] .modal-box h2,
html[data-theme="light"] .modal-box h3,
html[data-theme="light"] .modal-title,
html[data-theme="dark"] .confirm-box h2,
html[data-theme="dark"] .confirm-box h3,
html[data-theme="dark"] .modal-box h2,
html[data-theme="dark"] .modal-box h3,
html[data-theme="dark"] .modal-title {
  color: var(--theme-text) !important;
  text-shadow: none !important;
}

html[data-theme="light"] .yes-btn,
html[data-theme="dark"] .yes-btn {
  background: #c62828 !important;
  color: #fff !important;
  border: 1px solid #c62828 !important;
}

html[data-theme="light"] .modal .yes-btn,
html[data-theme="dark"] .modal .yes-btn {
  background: var(--theme-accent) !important;
  color: var(--theme-on-accent) !important;
  border-color: var(--theme-accent) !important;
}

html[data-theme="light"] .confirm-box:has(input) .yes-btn,
html[data-theme="dark"] .confirm-box:has(input) .yes-btn {
  background: var(--theme-accent) !important;
  color: var(--theme-on-accent) !important;
  border-color: var(--theme-accent) !important;
}

html[data-theme="light"] .no-btn,
html[data-theme="light"] .secondary-btn {
  background: #e8eee9 !important;
  color: #173426 !important;
  border: 1px solid #9eb5a8 !important;
}

html[data-theme="dark"] .no-btn,
html[data-theme="dark"] .secondary-btn {
  background: #30453c !important;
  color: #f5f1e5 !important;
  border: 1px solid #5d776b !important;
}

html[data-theme="light"] .confirm-box label,
html[data-theme="light"] .modal-box label,
html[data-theme="light"] .modal-content label,
html[data-theme="light"] .about-box label,
html[data-theme="dark"] .confirm-box label,
html[data-theme="dark"] .modal-box label,
html[data-theme="dark"] .modal-content label,
html[data-theme="dark"] .about-box label {
  color: var(--theme-text) !important;
  opacity: 1 !important;
}

html[data-theme="light"] .modal-actions,
html[data-theme="dark"] .modal-actions {
  background: var(--theme-surface) !important;
  border-top: 1px solid var(--theme-border);
}

html[data-theme="light"] #aboutModal .primary-btn,
html[data-theme="dark"] #aboutModal .primary-btn {
  background: var(--theme-accent) !important;
  color: var(--theme-on-accent) !important;
  border: 1px solid var(--theme-accent) !important;
}

html[data-theme="light"] #aboutModal .secondary-btn,
html[data-theme="dark"] #aboutModal .secondary-btn {
  background: var(--theme-muted-surface) !important;
  color: var(--theme-text) !important;
  border: 1px solid var(--theme-border) !important;
}

html[data-theme="light"] table thead,
html[data-theme="dark"] table thead {
  background: color-mix(in srgb, var(--theme-accent) 18%, var(--theme-surface-strong));
}

html[data-theme="light"] table tbody tr,
html[data-theme="dark"] table tbody tr {
  border-bottom-color: var(--theme-border);
}

html[data-theme="light"] table tbody tr:hover,
html[data-theme="dark"] table tbody tr:hover {
  background: color-mix(in srgb, var(--theme-accent) 9%, transparent);
}

html[data-theme="dark"] .page,
html[data-theme="dark"] .container,
html[data-theme="dark"] #usersList,
html[data-theme="dark"] #contactList {
  color: var(--theme-text);
}

html[data-theme="dark"] .mobile-card,
html[data-theme="dark"] .user-row,
html[data-theme="dark"] .admin-enquiry-card {
  background: var(--theme-surface) !important;
  color: var(--theme-text) !important;
  border: 1px solid var(--theme-border) !important;
}

html[data-theme="dark"] .admin-enquiry-date,
html[data-theme="dark"] .theme-admin-card p,
html[data-theme="dark"] .theme-status {
  color: var(--theme-muted) !important;
  opacity: 1;
}

html[data-theme="dark"] .status-approved {
  color: #7ce3a8 !important;
}

html[data-theme="dark"] .status-pending {
  color: #ffd074 !important;
}

html[data-theme="dark"] .delete-btn,
html[data-theme="dark"] .reject-btn,
html[data-theme="dark"] .admin-enquiry-delete {
  background: #b92a31 !important;
  color: #fff !important;
  border-color: #d84d53 !important;
}

html[data-theme="dark"] .approve-btn {
  background: #176a42 !important;
  color: #fff !important;
  border-color: #369567 !important;
}

html[data-theme="dark"] .admin-btn {
  background: #315f4c !important;
  color: #fff !important;
}

html[data-theme="dark"] .user-btn,
html[data-theme="dark"] #changePasswordBtn {
  background: #d6a83f !important;
  color: #211807 !important;
  border-color: #e4b958 !important;
}

/* Light theme: footer contrast, spacing and reference palette. */
html[data-theme="light"] .footer {
  margin-top: 56px;
  padding: 42px 30px 18px;
  background: #174936;
  color: #fffdf6;
  border-top: 5px solid var(--theme-gold);
  box-shadow: 0 -10px 30px rgba(23, 73, 54, 0.14);
}

html[data-theme="light"] .footer::before {
  background: #d39b2a;
  opacity: 0.12;
}

html[data-theme="light"] .footer::after {
  background: #d8e5dd;
  opacity: 0.1;
}

html[data-theme="light"] .footer-container {
  gap: 28px;
}

html[data-theme="light"] .footer-column {
  min-height: 0;
  padding: 22px;
  background: rgba(255, 253, 246, 0.075);
  border-color: rgba(255, 253, 246, 0.2);
  color: #fffdf6;
}

html[data-theme="light"] .footer-column:hover {
  background: rgba(255, 253, 246, 0.12);
}

html[data-theme="light"] .footer-logo,
html[data-theme="light"] .footer-desc,
html[data-theme="light"] .footer-links a,
html[data-theme="light"] .footer-contact,
html[data-theme="light"] .footer-contact p,
html[data-theme="light"] .footer-contact a,
html[data-theme="light"] .footer-bottom {
  color: #fffdf6 !important;
  opacity: 1;
}

html[data-theme="dark"] .footer {
  background: #07110d;
  color: #f5f1e5;
  border-top: 4px solid #5a967b;
}

html[data-theme="dark"] .footer-column {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.13);
}

html[data-theme="dark"] .footer-logo,
html[data-theme="dark"] .footer-desc,
html[data-theme="dark"] .footer-links a,
html[data-theme="dark"] .footer-contact,
html[data-theme="dark"] .footer-contact p,
html[data-theme="dark"] .footer-contact a,
html[data-theme="dark"] .footer-bottom {
  color: #f5f1e5 !important;
  opacity: 1;
}

html[data-theme="dark"] .footer-title,
html[data-theme="dark"] .footer-links a:hover,
html[data-theme="dark"] .footer-contact a:hover {
  color: #e4b958 !important;
  text-shadow: none;
}

html[data-theme="light"] .footer-title {
  color: #f4cb68 !important;
  text-shadow: none;
}

html[data-theme="light"] .footer-links a:hover,
html[data-theme="light"] .footer-contact a:hover {
  color: #f4cb68 !important;
}

html[data-theme="light"] .footer-contact-btn {
  background: #f4cb68 !important;
  color: #173426 !important;
  border: 1px solid #f4cb68 !important;
}

html[data-theme="light"] .footer-bottom {
  border-top-color: rgba(255, 253, 246, 0.22);
}

html[data-theme="light"] :focus-visible,
html[data-theme="dark"] :focus-visible {
  outline: 3px solid var(--theme-focus);
  outline-offset: 3px;
}

/* Homepage secondary CTA: remove inherited purple while preserving the
   separate orange contractorship action and the original Purple theme. */
html[data-theme="light"] .hero-actions .cta {
  background: linear-gradient(135deg, #174936, #21664d) !important;
  color: #ffffff !important;
  border: 2px solid #174936 !important;
  box-shadow: 0 14px 30px rgba(23, 73, 54, 0.24) !important;
}

html[data-theme="light"] .hero-actions .cta:hover {
  background: linear-gradient(135deg, #103629, #174936) !important;
  color: #ffffff !important;
  transform: translateY(-2px);
}

html[data-theme="dark"] .hero-actions .cta {
  background: #1d3028 !important;
  color: #f5f1e5 !important;
  border: 2px solid #79c5a3 !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="dark"] .hero-actions .cta:hover {
  background: #30453c !important;
  color: #ffffff !important;
  transform: translateY(-2px);
}

html[data-theme="light"] .hero,
html[data-theme="dark"] .hero {
  box-sizing: border-box;
  overflow-x: clip;
  padding-inline: clamp(16px, 4vw, 56px) !important;
}

html[data-theme="light"] .hero h1,
html[data-theme="dark"] .hero h1 {
  width: min(100%, 1100px);
  margin-inline: auto;
  font-size: clamp(2rem, 7vw, 5rem) !important;
  line-height: 1.04 !important;
  overflow-wrap: normal;
  word-break: normal;
  text-wrap: balance;
}

html[data-theme="light"] .hero-actions,
html[data-theme="dark"] .hero-actions {
  width: min(100%, 900px);
  margin-inline: auto;
  box-sizing: border-box;
}

html[data-theme="light"] .hero-actions a,
html[data-theme="dark"] .hero-actions a {
  max-width: 100%;
  box-sizing: border-box;
}

.theme-admin-card {
  width: auto;
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.theme-admin-card p {
  margin: 8px 0 14px;
  line-height: 1.45;
}

.theme-admin-controls {
  display: grid;
  gap: 10px;
}

.theme-admin-controls label {
  font-weight: 700;
}

.theme-admin-controls select,
.theme-admin-controls button {
  width: 100%;
  min-height: 44px;
}

.theme-admin-controls button {
  background: #ffb000 !important;
  color: #25142f !important;
  font-weight: 800;
}

.theme-admin-controls button:disabled,
.theme-admin-controls select:disabled {
  cursor: wait;
  opacity: 0.65;
}

.theme-status {
  min-height: 22px;
  margin-top: 10px;
  font-size: 14px;
  font-weight: 700;
}

.theme-status--error {
  color: #ffb4b4 !important;
}

.admin-page .navbar #authArea {
  align-items: center;
}

.admin-page .navbar #authArea button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  margin: 0 !important;
}

html[data-theme="light"] .theme-status--error {
  color: #9f1d1d !important;
}

@media (max-width: 768px) {
  html[data-theme="light"] .hero,
  html[data-theme="dark"] .hero {
    padding-inline: clamp(14px, 5vw, 24px) !important;
  }

  html[data-theme="light"] .hero h1,
  html[data-theme="dark"] .hero h1 {
    font-size: clamp(1.9rem, 10.5vw, 3.25rem) !important;
    line-height: 1.08 !important;
  }

  html[data-theme="light"] .hero-actions,
  html[data-theme="dark"] .hero-actions {
    gap: 14px !important;
  }

  html[data-theme="light"] .hero-actions a,
  html[data-theme="dark"] .hero-actions a {
    width: 100% !important;
    min-height: 50px !important;
    padding: 13px 18px !important;
  }

  html[data-theme="light"] button,
  html[data-theme="light"] .btn,
  html[data-theme="dark"] button,
  html[data-theme="dark"] .btn {
    min-height: 44px !important;
  }

  .theme-admin-card {
    width: 100%;
    box-sizing: border-box;
  }

  html[data-theme="light"] .page {
    padding: 18px 14px !important;
  }

  html[data-theme="light"] .card,
  html[data-theme="light"] .page > .container > div:first-of-type > div:first-child > div:first-child {
    border-radius: 16px;
  }

  html[data-theme="light"] .btn-group {
    display: grid;
    grid-template-columns: 1fr;
  }

  html[data-theme="light"] .btn-group .btn {
    width: 100% !important;
    min-height: 46px;
  }

  html[data-theme="light"] .footer {
    margin-top: 42px;
    padding: 28px 14px 16px;
  }

  html[data-theme="light"] .footer-container {
    gap: 16px;
  }

  html[data-theme="light"] .footer-column {
    padding: 18px;
    border-radius: 16px;
  }

  html[data-theme="light"] .footer-logo {
    font-size: 32px;
  }

  html[data-theme="light"] .footer-desc,
  html[data-theme="light"] .footer-contact {
    line-height: 1.65;
  }

  html[data-theme="light"] .navbar,
  html[data-theme="dark"] .navbar {
    padding: 20px 18px !important;
  }

  html[data-theme="light"] .navbar nav,
  html[data-theme="dark"] .navbar nav {
    gap: 10px 20px !important;
  }

  html[data-theme="light"] .navbar .logo,
  html[data-theme="dark"] .navbar .logo {
    font-size: clamp(34px, 11vw, 50px) !important;
    line-height: 1.05;
  }

  .admin-page .navbar #authArea {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(90px, auto)) !important;
    justify-content: start !important;
    align-items: center !important;
    gap: 8px !important;
  }

  .admin-page .navbar #authArea > *:first-child {
    grid-column: 1 / -1;
    width: 100% !important;
  }

  .admin-page .navbar #authArea button {
    width: auto !important;
    min-width: 90px !important;
  }

  html[data-theme="light"] .confirm-box,
  html[data-theme="light"] .modal-box,
  html[data-theme="light"] .modal-content,
  html[data-theme="light"] .about-box,
  html[data-theme="dark"] .confirm-box,
  html[data-theme="dark"] .modal-box,
  html[data-theme="dark"] .modal-content,
  html[data-theme="dark"] .about-box {
    width: calc(100vw - 28px) !important;
    max-width: 540px !important;
    max-height: calc(100vh - 28px) !important;
    padding: 20px !important;
    overflow-y: auto !important;
    box-sizing: border-box;
  }

  html[data-theme="light"] .modal-actions,
  html[data-theme="light"] .confirm-actions,
  html[data-theme="dark"] .modal-actions,
  html[data-theme="dark"] .confirm-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  html[data-theme="light"] .modal-actions button,
  html[data-theme="light"] .confirm-actions button,
  html[data-theme="dark"] .modal-actions button,
  html[data-theme="dark"] .confirm-actions button {
    width: 100% !important;
    min-height: 46px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme="light"] *,
  html[data-theme="dark"] * {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* Final contrast safeguards for authentication links and the bill viewer. */
html[data-theme="light"] .login-card p a {
  color: #174936 !important;
  font-weight: 750;
  text-decoration-color: #174936 !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 4px;
}

html[data-theme="dark"] .login-card p a {
  color: #b9f0d6 !important;
  font-weight: 750;
  text-decoration-color: #b9f0d6 !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 4px;
}

/* Login recovery flows: visible, accessible controls in Light and Dark only. */
html[data-theme="light"] #customModal .modal-box,
html[data-theme="dark"] #customModal .modal-box {
  width: min(480px, calc(100vw - 32px)) !important;
  max-height: calc(100dvh - 32px) !important;
  padding: clamp(20px, 3vw, 28px) !important;
  border-radius: 18px !important;
  overflow-y: auto !important;
  box-sizing: border-box;
}

html[data-theme="light"] #customModal #modalTitle,
html[data-theme="dark"] #customModal #modalTitle {
  margin: 0 0 10px !important;
  font-size: clamp(26px, 4vw, 32px) !important;
  line-height: 1.15 !important;
}

html[data-theme="light"] #customModal #confirmText,
html[data-theme="dark"] #customModal #confirmText {
  margin: 0 auto 16px !important;
  color: var(--theme-text-secondary) !important;
  font-size: clamp(16px, 2.4vw, 19px) !important;
  line-height: 1.5 !important;
}

html[data-theme="light"] #customModal #modalForm,
html[data-theme="dark"] #customModal #modalForm {
  width: min(100%, 400px) !important;
  margin: 0 auto !important;
}

html[data-theme="light"] #customModal #modalForm label,
html[data-theme="dark"] #customModal #modalForm label {
  margin: 10px 0 5px !important;
  color: var(--theme-text) !important;
  font-size: 16px !important;
  font-weight: 750 !important;
  line-height: 1.3 !important;
  text-align: left !important;
}

html[data-theme="light"] #customModal #modalInput1,
html[data-theme="light"] #customModal .password-box input,
html[data-theme="dark"] #customModal #modalInput1,
html[data-theme="dark"] #customModal .password-box input {
  width: 100% !important;
  min-height: 48px !important;
  margin: 0 !important;
  padding: 10px 50px 10px 15px !important;
  border: 2px solid var(--theme-control-border) !important;
  border-radius: 12px !important;
  background: var(--theme-control-bg) !important;
  color: var(--theme-text) !important;
  caret-color: var(--theme-accent) !important;
  font: inherit !important;
  font-size: 17px !important;
  line-height: 1.35 !important;
  opacity: 1 !important;
  outline: none !important;
  box-shadow: 0 2px 8px rgba(10, 33, 23, 0.08) !important;
  box-sizing: border-box !important;
}

html[data-theme="light"] #customModal #modalInput1::placeholder,
html[data-theme="light"] #customModal .password-box input::placeholder {
  color: #62746b !important;
  opacity: 1 !important;
}

html[data-theme="dark"] #customModal #modalInput1::placeholder,
html[data-theme="dark"] #customModal .password-box input::placeholder {
  color: #b8c7c0 !important;
  opacity: 1 !important;
}

html[data-theme="light"] #customModal #modalInput1:hover,
html[data-theme="light"] #customModal .password-box input:hover,
html[data-theme="dark"] #customModal #modalInput1:hover,
html[data-theme="dark"] #customModal .password-box input:hover {
  border-color: color-mix(in srgb, var(--theme-accent) 65%, var(--theme-control-border)) !important;
}

html[data-theme="light"] #customModal #modalInput1:focus,
html[data-theme="light"] #customModal .password-box input:focus,
html[data-theme="dark"] #customModal #modalInput1:focus,
html[data-theme="dark"] #customModal .password-box input:focus {
  border-color: var(--theme-accent) !important;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--theme-accent) 20%, transparent) !important;
}

html[data-theme="light"] #customModal .password-box,
html[data-theme="dark"] #customModal .password-box {
  position: relative !important;
  width: 100% !important;
  margin: 0 !important;
}

html[data-theme="light"] #customModal .password-box span,
html[data-theme="dark"] #customModal .password-box span {
  position: absolute !important;
  top: 50% !important;
  right: 8px !important;
  display: grid !important;
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  place-items: center !important;
  transform: translateY(-50%) !important;
  border-radius: 9px !important;
  color: var(--theme-text-secondary) !important;
  font-size: 18px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  user-select: none !important;
}

html[data-theme="light"] #customModal .password-box span:hover,
html[data-theme="dark"] #customModal .password-box span:hover {
  background: var(--theme-muted-surface) !important;
  color: var(--theme-text) !important;
}

html[data-theme="light"] #customModal .confirm-actions,
html[data-theme="dark"] #customModal .confirm-actions {
  display: flex !important;
  justify-content: center !important;
  gap: 12px !important;
  margin-top: 18px !important;
}

html[data-theme="light"] #customModal .confirm-actions button,
html[data-theme="dark"] #customModal .confirm-actions button {
  min-width: 120px !important;
  min-height: 44px !important;
  padding: 9px 20px !important;
  border-radius: 999px !important;
  font-size: 16px !important;
  font-weight: 800 !important;
}

html[data-theme="light"] #customModal #modalMsg,
html[data-theme="dark"] #customModal #modalMsg {
  min-height: 1.4em;
  margin: 10px 0 0 !important;
  color: var(--theme-danger) !important;
  font-weight: 750 !important;
  line-height: 1.4 !important;
}

html[data-theme="light"] #customModal.recovery-admin-step #label1,
html[data-theme="light"] #customModal.recovery-admin-step #modalInput1,
html[data-theme="dark"] #customModal.recovery-admin-step #label1,
html[data-theme="dark"] #customModal.recovery-admin-step #modalInput1 {
  display: none !important;
}

html[data-theme="light"] #customModal.recovery-admin-step .modal-box,
html[data-theme="dark"] #customModal.recovery-admin-step .modal-box {
  width: min(460px, calc(100vw - 32px)) !important;
  padding: 20px 24px !important;
}

html[data-theme="light"] #customModal.recovery-admin-step #modalTitle,
html[data-theme="dark"] #customModal.recovery-admin-step #modalTitle {
  font-size: clamp(1.55rem, 4vw, 1.85rem) !important;
}

html[data-theme="light"] #customModal.recovery-admin-step #confirmText,
html[data-theme="dark"] #customModal.recovery-admin-step #confirmText {
  margin-bottom: 12px !important;
  font-size: clamp(0.9rem, 2.3vw, 1rem) !important;
}

html[data-theme="light"] #customModal.recovery-admin-step #modalForm label,
html[data-theme="dark"] #customModal.recovery-admin-step #modalForm label {
  margin: 7px 0 4px !important;
}

html[data-theme="light"] #customModal.recovery-admin-step .password-box input,
html[data-theme="dark"] #customModal.recovery-admin-step .password-box input {
  min-height: 44px !important;
}

html[data-theme="light"] #customModal.recovery-admin-step .confirm-actions,
html[data-theme="dark"] #customModal.recovery-admin-step .confirm-actions {
  margin-top: 14px !important;
}

html[data-theme="light"] .login-recovery-links,
html[data-theme="dark"] .login-recovery-links {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 18px;
  margin: 14px 0 0 !important;
  line-height: 1.3;
}

html[data-theme="light"] .login-recovery-links a,
html[data-theme="dark"] .login-recovery-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 4px 2px;
  white-space: nowrap;
}

html[data-theme="light"] #customModal #modalInput1,
html[data-theme="dark"] #customModal #modalInput1 {
  padding-right: 15px !important;
}

@media (max-width: 520px) {
  html[data-theme="light"] .login-recovery-links,
  html[data-theme="dark"] .login-recovery-links {
    flex-direction: column;
    gap: 2px;
    width: 100%;
  }

  html[data-theme="light"] .login-recovery-links a,
  html[data-theme="dark"] .login-recovery-links a {
    width: 100%;
    min-height: 42px;
  }

  html[data-theme="light"] #customModal,
  html[data-theme="dark"] #customModal {
    padding: 12px !important;
    align-items: center !important;
  }

  html[data-theme="light"] #customModal .modal-box,
  html[data-theme="dark"] #customModal .modal-box {
    width: 100% !important;
    max-height: calc(100dvh - 24px) !important;
    padding: 24px 18px !important;
    border-radius: 20px !important;
  }

  html[data-theme="light"] #customModal .confirm-actions,
  html[data-theme="dark"] #customModal .confirm-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  html[data-theme="light"] #customModal .confirm-actions button,
  html[data-theme="dark"] #customModal .confirm-actions button {
    width: 100% !important;
    min-width: 0 !important;
  }
}

/* Login links remain a compact single row at every supported viewport width. */
html[data-theme="light"] .login-page .login-recovery-links,
html[data-theme="dark"] .login-page .login-recovery-links {
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 0 !important;
  margin-top: 12px !important;
  white-space: nowrap;
}

html[data-theme="light"] .login-page .login-recovery-links a,
html[data-theme="dark"] .login-page .login-recovery-links a {
  width: auto !important;
  min-height: 32px;
  padding: 2px clamp(7px, 1.2vw, 11px);
  font-size: clamp(0.67rem, 2.2vw, 0.94rem);
}

@media (max-width: 420px) {
  html[data-theme="light"] .login-page .login-recovery-links a,
  html[data-theme="dark"] .login-page .login-recovery-links a {
    padding-inline: clamp(5px, 1.7vw, 7px);
  }
}

html[data-theme="light"] .login-card p a:hover,
html[data-theme="light"] .login-card p a:focus-visible {
  color: #0b3525 !important;
}

html[data-theme="dark"] .login-card p a:hover,
html[data-theme="dark"] .login-card p a:focus-visible {
  color: #ffffff !important;
}

html[data-theme="dark"] #billImageModal button {
  color: #10231b !important;
  background: #9bdbbd !important;
  border: 1px solid #c8f4df !important;
  font-weight: 750;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] #billImageModal button:hover,
html[data-theme="dark"] #billImageModal button:focus-visible {
  color: #07140f !important;
  background: #c8f4df !important;
}

/* Keep form controls comfortably touchable across compact phones in Light/Dark. */
@media (max-width: 768px) {
  html[data-theme="light"] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  html[data-theme="light"] select,
  html[data-theme="light"] textarea,
  html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  html[data-theme="dark"] select,
  html[data-theme="dark"] textarea {
    min-height: 44px !important;
    box-sizing: border-box;
  }
}
/* Pagination contrast for the optional Light and Dark themes.
   Scoped by data-theme so the original Current Purple design stays untouched. */
html[data-theme="light"] #materialPagination button:not(.active-page):not([aria-current="page"]),
html[data-theme="light"] .data-pagination button:not(.active-page):not([aria-current="page"]) {
  background: #ffffff !important;
  color: #164f3d !important;
  border-color: #b8c9c1 !important;
  box-shadow: 0 8px 18px rgba(18, 58, 46, 0.1) !important;
}

html[data-theme="light"] #materialPagination button:not(.active-page):not([aria-current="page"]):hover,
html[data-theme="light"] .data-pagination button:not(.active-page):not([aria-current="page"]):hover {
  background: #e9f3ee !important;
  color: #0b392c !important;
  border-color: #175b46 !important;
}

html[data-theme="light"] #materialPagination button.active-page,
html[data-theme="light"] #materialPagination button[aria-current="page"],
html[data-theme="light"] .data-pagination button.active-page,
html[data-theme="light"] .data-pagination button[aria-current="page"] {
  background: #123f31 !important;
  color: #ffffff !important;
  border-color: #123f31 !important;
  box-shadow: 0 8px 20px rgba(18, 63, 49, 0.22) !important;
}

html[data-theme="dark"] #materialPagination button:not(.active-page):not([aria-current="page"]),
html[data-theme="dark"] .data-pagination button:not(.active-page):not([aria-current="page"]) {
  background: #173c31 !important;
  color: #f7fff9 !important;
  border-color: #5f8e7d !important;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28) !important;
}

html[data-theme="dark"] #materialPagination button:not(.active-page):not([aria-current="page"]):hover,
html[data-theme="dark"] .data-pagination button:not(.active-page):not([aria-current="page"]):hover {
  background: #245746 !important;
  color: #ffffff !important;
  border-color: #8cc2ae !important;
}

html[data-theme="dark"] #materialPagination button.active-page,
html[data-theme="dark"] #materialPagination button[aria-current="page"],
html[data-theme="dark"] .data-pagination button.active-page,
html[data-theme="dark"] .data-pagination button[aria-current="page"] {
  background: #f2c14e !important;
  color: #10261f !important;
  border-color: #f2c14e !important;
  box-shadow: 0 8px 20px rgba(242, 193, 78, 0.2) !important;
}

/* Admin materials danger zone: keep destructive intent readable without
   changing the original Current Purple presentation. */
html[data-theme="light"] .materials-danger-zone {
  background: #fff7f7 !important;
  border: 2px solid #c62828 !important;
  box-shadow: 0 12px 28px rgba(151, 31, 31, 0.12) !important;
}

html[data-theme="light"] .materials-danger-zone .materials-danger-zone-title {
  color: #9f1d24 !important;
  text-shadow: none !important;
}

html[data-theme="dark"] .materials-danger-zone {
  background: #2b1819 !important;
  border: 2px solid #ff7378 !important;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.34) !important;
}

html[data-theme="dark"] .materials-danger-zone .materials-danger-zone-title {
  color: #ffb4b8 !important;
  text-shadow: none !important;
}

/* Standard Dark: strong semantic action colors and fully opaque labels. */
html[data-theme="dark"] #savePortalThemeBtn,
html[data-theme="dark"] .user-btn,
html[data-theme="dark"] #changePasswordBtn {
  background: #f5b51b !important;
  background-image: none !important;
  border-color: #ffd15c !important;
  color: #171006 !important;
}

html[data-theme="dark"] .download-enquiries-btn,
html[data-theme="dark"] .approve-btn,
html[data-theme="dark"] .admin-btn,
html[data-theme="dark"] .paid-btn,
html[data-theme="dark"] .success-btn {
  background: #168a4a !important;
  background-image: none !important;
  border-color: #35c878 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .delete-btn,
html[data-theme="dark"] .reject-btn,
html[data-theme="dark"] .admin-enquiry-delete,
html[data-theme="dark"] .danger-btn,
html[data-theme="dark"] .yes-btn {
  background: #d9363e !important;
  background-image: none !important;
  border-color: #ff6b72 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] #savePortalThemeBtn,
html[data-theme="dark"] .user-btn,
html[data-theme="dark"] #changePasswordBtn,
html[data-theme="dark"] .download-enquiries-btn,
html[data-theme="dark"] .approve-btn,
html[data-theme="dark"] .admin-btn,
html[data-theme="dark"] .paid-btn,
html[data-theme="dark"] .success-btn,
html[data-theme="dark"] .delete-btn,
html[data-theme="dark"] .reject-btn,
html[data-theme="dark"] .admin-enquiry-delete,
html[data-theme="dark"] .danger-btn,
html[data-theme="dark"] .yes-btn {
  opacity: 1 !important;
  filter: none !important;
  font-weight: 800 !important;
  text-shadow: none !important;
  -webkit-text-fill-color: currentColor !important;
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.28) !important;
}

html[data-theme="dark"] .status-approved,
html[data-theme="dark"] .success-text {
  color: #64f0a2 !important;
  opacity: 1 !important;
  font-weight: 800 !important;
}

html[data-theme="dark"] .status-pending,
html[data-theme="dark"] .warning-text {
  color: #ffd166 !important;
  opacity: 1 !important;
  font-weight: 800 !important;
}

html[data-theme="dark"] .error-text,
html[data-theme="dark"] .danger-text {
  color: #ff858b !important;
  opacity: 1 !important;
  font-weight: 800 !important;
}

html[data-theme="dark"] #authArea button[onclick="logout()"] {
  background: #c9343c !important;
  background-image: none !important;
  border-color: #f2666d !important;
  color: #ffffff !important;
}

html[data-theme="dark"] #authArea button[onclick="openAdmin()"],
html[data-theme="dark"] #authArea button[onclick="goLogin()"] {
  background: #18784a !important;
  background-image: none !important;
  border-color: #45b87c !important;
  color: #ffffff !important;
}

html[data-theme="dark"] #authArea button[onclick="logout()"],
html[data-theme="dark"] #authArea button[onclick="openAdmin()"],
html[data-theme="dark"] #authArea button[onclick="goLogin()"] {
  opacity: 1 !important;
  filter: none !important;
  font-weight: 800 !important;
  text-shadow: none !important;
  -webkit-text-fill-color: currentColor !important;
}

/* Property and delivered-project editors.
   Light/Dark only: the original Current Purple design remains unchanged. */
html[data-theme="light"] #editModal,
html[data-theme="dark"] #editModal {
  padding: 18px !important;
  align-items: center !important;
  justify-content: center !important;
}

html[data-theme="light"] #editModal .confirm-box,
html[data-theme="dark"] #editModal .confirm-box {
  display: grid !important;
  gap: 16px !important;
  width: min(590px, calc(100vw - 36px)) !important;
  max-width: 590px !important;
  max-height: calc(100dvh - 36px) !important;
  margin: 0 !important;
  padding: 30px !important;
  overflow-x: hidden !important;
  overflow-y: scroll !important;
  border-radius: 24px !important;
  box-sizing: border-box !important;
}

html[data-theme="light"] #editModal .confirm-box h3,
html[data-theme="dark"] #editModal .confirm-box h3 {
  margin: 0 0 4px !important;
  font-size: clamp(1.55rem, 4vw, 2rem) !important;
  line-height: 1.2 !important;
  text-align: left !important;
}

html[data-theme="light"] #editModal .edit-form-field,
html[data-theme="dark"] #editModal .edit-form-field {
  display: grid !important;
  gap: 7px !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
}

html[data-theme="light"] #editModal .edit-form-field > span,
html[data-theme="dark"] #editModal .edit-form-field > span {
  color: var(--theme-text) !important;
  font-size: 0.9rem !important;
  font-weight: 750 !important;
  line-height: 1.25 !important;
  letter-spacing: 0.01em;
}

html[data-theme="light"] #editModal input:not([type="file"]),
html[data-theme="light"] #editModal select,
html[data-theme="dark"] #editModal input:not([type="file"]),
html[data-theme="dark"] #editModal select {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 52px !important;
  margin: 0 !important;
  padding: 0 14px !important;
  box-sizing: border-box !important;
  border: 2px solid var(--theme-control-border) !important;
  border-radius: 12px !important;
  outline: none !important;
  background: var(--theme-control-bg) !important;
  color: var(--theme-text) !important;
  font: inherit !important;
  opacity: 1 !important;
  box-shadow: 0 5px 14px rgba(11, 42, 32, 0.06) !important;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

html[data-theme="light"] #editModal input:not([type="file"]):hover,
html[data-theme="light"] #editModal select:hover,
html[data-theme="dark"] #editModal input:not([type="file"]):hover,
html[data-theme="dark"] #editModal select:hover {
  border-color: var(--theme-accent) !important;
}

html[data-theme="light"] #editModal input:not([type="file"]):focus,
html[data-theme="light"] #editModal select:focus,
html[data-theme="dark"] #editModal input:not([type="file"]):focus,
html[data-theme="dark"] #editModal select:focus {
  border-color: var(--theme-accent) !important;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--theme-accent) 22%, transparent) !important;
}

html[data-theme="light"] #editModal input[type="file"],
html[data-theme="dark"] #editModal input[type="file"] {
  display: block !important;
  width: 100% !important;
  min-height: 56px !important;
  margin: 0 !important;
  padding: 8px !important;
  box-sizing: border-box !important;
  border: 2px dashed var(--theme-control-border) !important;
  border-radius: 12px !important;
  background: var(--theme-muted-surface) !important;
  color: var(--theme-text) !important;
  font: inherit !important;
  opacity: 1 !important;
}

html[data-theme="light"] #editModal input[type="file"]::file-selector-button,
html[data-theme="dark"] #editModal input[type="file"]::file-selector-button {
  min-height: 38px;
  margin-right: 12px;
  padding: 8px 14px;
  border: 1px solid var(--theme-accent);
  border-radius: 9px;
  background: var(--theme-accent);
  color: var(--theme-on-accent);
  font-weight: 750;
  cursor: pointer;
}

html[data-theme="light"] #editModal .edit-property-meta-row,
html[data-theme="dark"] #editModal .edit-property-meta-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(105px, 0.72fr) minmax(145px, 1fr) !important;
  gap: 12px !important;
  width: 100% !important;
}

html[data-theme="light"] #editModal #editPreview,
html[data-theme="dark"] #editModal #editPreview {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  width: 100% !important;
  margin: 0 !important;
}

html[data-theme="light"] #editModal .confirm-actions,
html[data-theme="dark"] #editModal .confirm-actions {
  display: flex !important;
  justify-content: flex-end !important;
  gap: 12px !important;
  margin: 4px 0 0 !important;
}

html[data-theme="light"] #editModal .confirm-actions button,
html[data-theme="dark"] #editModal .confirm-actions button {
  min-width: 118px !important;
  min-height: 48px !important;
  margin: 0 !important;
}

@media (max-width: 600px) {
  html[data-theme="light"] #editModal,
  html[data-theme="dark"] #editModal {
    padding: 10px !important;
  }

  html[data-theme="light"] #editModal .confirm-box,
  html[data-theme="dark"] #editModal .confirm-box {
    width: 100% !important;
    max-height: calc(100dvh - 20px) !important;
    padding: 22px 16px !important;
    border-radius: 20px !important;
  }

  html[data-theme="light"] #editModal .edit-property-meta-row,
  html[data-theme="dark"] #editModal .edit-property-meta-row {
    grid-template-columns: 1fr !important;
  }

  html[data-theme="light"] #editModal .confirm-actions,
  html[data-theme="dark"] #editModal .confirm-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  html[data-theme="light"] #editModal .confirm-actions button,
  html[data-theme="dark"] #editModal .confirm-actions button {
    width: 100% !important;
    min-width: 0 !important;
  }
}
/* Final Standard Dark button contrast
   Keep every action readable even when older page-specific rules are present. */
html[data-theme="dark"] button,
html[data-theme="dark"] .btn,
html[data-theme="dark"] input[type="button"],
html[data-theme="dark"] input[type="submit"] {
  background-image: none !important;
  background-color: #176b47 !important;
  border-color: #43a97a !important;
  color: #ffffff !important;
  -webkit-text-fill-color: currentColor !important;
  opacity: 1 !important;
  filter: none !important;
  text-shadow: none !important;
}

html[data-theme="dark"] button *,
html[data-theme="dark"] .btn *,
html[data-theme="dark"] input[type="button"] *,
html[data-theme="dark"] input[type="submit"] * {
  color: inherit !important;
  -webkit-text-fill-color: currentColor !important;
  opacity: 1 !important;
}

html[data-theme="dark"] button:hover:not(:disabled),
html[data-theme="dark"] .btn:hover:not(:disabled),
html[data-theme="dark"] input[type="button"]:hover:not(:disabled),
html[data-theme="dark"] input[type="submit"]:hover:not(:disabled) {
  background-color: #20845a !important;
  border-color: #65c99a !important;
  color: #ffffff !important;
}

html[data-theme="dark"] button:disabled,
html[data-theme="dark"] .btn:disabled,
html[data-theme="dark"] input[type="button"]:disabled,
html[data-theme="dark"] input[type="submit"]:disabled {
  background-color: #315548 !important;
  border-color: #587568 !important;
  color: #eef5f1 !important;
  -webkit-text-fill-color: currentColor !important;
  opacity: 0.7 !important;
  cursor: not-allowed;
}

/* Neutral secondary actions. */
html[data-theme="dark"] .secondary-btn,
html[data-theme="dark"] .no-btn,
html[data-theme="dark"] .edit-btn,
html[data-theme="dark"] .cancel-btn {
  background-color: #30483e !important;
  border-color: #718c80 !important;
  color: #ffffff !important;
}

/* Yellow actions need dark text for accessible contrast. */
html[data-theme="dark"] #savePortalThemeBtn,
html[data-theme="dark"] .user-btn,
html[data-theme="dark"] #changePasswordBtn {
  background-color: #f5b51b !important;
  border-color: #ffd15b !important;
  color: #171006 !important;
}

html[data-theme="dark"] #savePortalThemeBtn:hover:not(:disabled),
html[data-theme="dark"] .user-btn:hover:not(:disabled),
html[data-theme="dark"] #changePasswordBtn:hover:not(:disabled) {
  background-color: #ffc43d !important;
  color: #171006 !important;
}

/* Destructive actions always use a strong red with white text. */
html[data-theme="dark"] .delete-btn,
html[data-theme="dark"] .reject-btn,
html[data-theme="dark"] .admin-enquiry-delete,
html[data-theme="dark"] .danger-btn,
html[data-theme="dark"] .yes-btn,
html[data-theme="dark"] #authArea #logoutBtn {
  background-color: #d9363e !important;
  border-color: #ff6870 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .delete-btn:hover:not(:disabled),
html[data-theme="dark"] .reject-btn:hover:not(:disabled),
html[data-theme="dark"] .admin-enquiry-delete:hover:not(:disabled),
html[data-theme="dark"] .danger-btn:hover:not(:disabled),
html[data-theme="dark"] .yes-btn:hover:not(:disabled),
html[data-theme="dark"] #authArea #logoutBtn:hover:not(:disabled) {
  background-color: #ef4b53 !important;
  color: #ffffff !important;
}

/* Positive actions retain a distinct brighter green. */
html[data-theme="dark"] .download-enquiries-btn,
html[data-theme="dark"] .approve-btn,
html[data-theme="dark"] .admin-btn,
html[data-theme="dark"] .paid-btn,
html[data-theme="dark"] .success-btn,
html[data-theme="dark"] #authArea #openAdminBtn,
html[data-theme="dark"] #authArea #goLoginBtn {
  background-color: #168a4a !important;
  border-color: #55c982 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .download-enquiries-btn:hover:not(:disabled),
html[data-theme="dark"] .approve-btn:hover:not(:disabled),
html[data-theme="dark"] .admin-btn:hover:not(:disabled),
html[data-theme="dark"] .paid-btn:hover:not(:disabled),
html[data-theme="dark"] .success-btn:hover:not(:disabled),
html[data-theme="dark"] #authArea #openAdminBtn:hover:not(:disabled),
html[data-theme="dark"] #authArea #goLoginBtn:hover:not(:disabled) {
  background-color: #20a45c !important;
  color: #ffffff !important;
}

/* Reported admin actions: retain full label contrast in every state. */
html[data-theme="dark"] .download-enquiries-btn,
html[data-theme="dark"] .download-enquiries-btn:disabled {
  background-color: #168a4a !important;
  border-color: #55c982 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
}

html[data-theme="dark"] #deleteAllMaterialsBtn,
html[data-theme="dark"] #deleteAllMaterialsBtn:disabled {
  background-color: #d9363e !important;
  border-color: #ff6870 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
}

/* Standard desktop navbar alignment shared by Purple, Light, and Dark. */
@media (min-width: 769px) {
  .navbar {
    grid-template-columns: max-content minmax(0, 1fr) max-content !important;
    column-gap: clamp(30px, 2.5vw, 48px) !important;
  }

  .navbar nav {
    align-items: center !important;
    justify-content: center !important;
    gap: clamp(18px, 1.45vw, 28px) !important;
    overflow: visible;
  }

  .navbar nav a {
    box-sizing: border-box;
    min-height: 44px;
    margin: 0 !important;
    padding: 8px 2px;
    line-height: 1.2 !important;
    position: static !important;
    white-space: nowrap;
    vertical-align: middle;
  }

  .navbar #authArea {
    gap: 10px !important;
  }
}

/* Generated admin actions must remain legible even when temporarily disabled. */
html[data-theme="dark"] .approve-btn,
html[data-theme="dark"] .approve-btn:disabled,
html[data-theme="dark"] .admin-btn,
html[data-theme="dark"] .admin-btn:disabled {
  background-color: #168a4a !important;
  border-color: #55c982 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
  filter: none !important;
}

html[data-theme="dark"] .reject-btn,
html[data-theme="dark"] .reject-btn:disabled {
  background-color: #d9363e !important;
  border-color: #ff6870 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
  filter: none !important;
}

/* Reported admin and Properties actions: explicit high-contrast states. */
html[data-theme="dark"] .user-btn,
html[data-theme="dark"] .user-btn:disabled {
  background-color: #f5b51b !important;
  border-color: #ffd15b !important;
  color: #171006 !important;
  -webkit-text-fill-color: #171006 !important;
  opacity: 1 !important;
  filter: none !important;
}

html[data-theme="dark"] .delete-btn,
html[data-theme="dark"] .delete-btn:disabled {
  background-color: #d9363e !important;
  border-color: #ff6870 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
  filter: none !important;
}

html[data-theme="dark"] .property-search-btn,
html[data-theme="dark"] .property-save-btn {
  background-color: #168a4a !important;
  border-color: #55c982 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
}

html[data-theme="dark"] .property-search-clear-btn,
html[data-theme="dark"] .property-form-clear-btn {
  background-color: #30483e !important;
  border-color: #81998e !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
}

/* Enquiry delete requires higher specificity than the generic dark button rule. */
html[data-theme="dark"] body.admin-page button.admin-enquiry-delete,
html[data-theme="dark"] body.admin-page button.admin-enquiry-delete:disabled {
  background-color: #d9363e !important;
  border-color: #ff6870 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
  filter: none !important;
}

/* Optical baseline correction for the shared Materials navigation item. */
@media (min-width: 769px) {
  .navbar nav > a[href="materials.html"] {
    position: relative !important;
    top: 5px;
  }
}

/* About and Ongoing admin Add New actions. */
html[data-theme="dark"] body button#editBtn,
html[data-theme="dark"] body button#editBtn:disabled,
html[data-theme="dark"] body button#ongoingEditBtn,
html[data-theme="dark"] body button#ongoingEditBtn:disabled {
  background-color: #168a4a !important;
  border-color: #55c982 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
  filter: none !important;
}

/* About/Ongoing editor controls and page scroll isolation. */
html.content-editor-modal-open,
body.content-editor-modal-open {
  overflow: hidden !important;
  overscroll-behavior: none;
}

body.content-editor-modal-open {
  position: fixed !important;
  left: 0;
  right: 0;
  width: 100%;
}

html[data-theme="dark"] body button.edit-btn,
html[data-theme="dark"] body button.edit-btn:disabled,
html[data-theme="dark"] #aboutModal button.primary-btn,
html[data-theme="dark"] #ongoingModal button.primary-btn {
  background-color: #168a4a !important;
  border-color: #55c982 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
  filter: none !important;
}

html[data-theme="dark"] #aboutModal button.secondary-btn,
html[data-theme="dark"] #ongoingModal button.secondary-btn {
  background-color: #30483e !important;
  border-color: #81998e !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
  filter: none !important;
}

/* Restore the About card action after the legacy ID-specific white button rule. */
html[data-theme="dark"] body #aboutCards button.edit-btn,
html[data-theme="dark"] body #aboutCards button.edit-btn:disabled,
html[data-theme="dark"] body #ongoingCards button.edit-btn,
html[data-theme="dark"] body #ongoingCards button.edit-btn:disabled {
  background-color: #168a4a !important;
  border-color: #55c982 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
  filter: none !important;
}

/* Clear, high-contrast controls in the rich-text editors and image viewer. */
html[data-theme="dark"] #aboutModal .editor-toolbar button,
html[data-theme="dark"] #ongoingModal .editor-toolbar button,
html[data-theme="dark"] #previewModal .preview-toolbar button,
html[data-theme="dark"] #previewModal .preview-close-icon {
  background-color: #176b47 !important;
  border-color: #55c982 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
  filter: none !important;
}

#previewModal .preview-close-icon {
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 50%;
  background: rgba(18, 86, 59, 0.96);
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
  font-size: 32px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

#previewModal .preview-close-icon:focus-visible {
  outline: 3px solid #f4c84a;
  outline-offset: 3px;
}

@media (max-width: 480px) {
  #previewModal .preview-close-icon {
    top: 66px;
    right: 10px;
    width: 42px;
    height: 42px;
    font-size: 28px;
  }
}

/* Keep About and Ongoing cards stationary at their hover boundary. */
#aboutCards .about-card,
#ongoingCards .about-card,
#aboutCards .about-card:hover,
#ongoingCards .about-card:hover {
  transform: none !important;
}
