/* Shared dropdown menu styles (single source of truth) */
.dropdown-menu {
  background: #323943;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  min-width: 150px;
  z-index: 1000;
}
.dropdown-menu .dropdown-option {
  padding: 12px 16px;
  cursor: pointer;
  color: #fff;
  background: transparent;
  transition: background-color 0.2s ease;
}
.dropdown-menu .dropdown-option + .dropdown-option {
  border-top: 1px solid #4a5568;
}
.dropdown-menu .dropdown-option:hover {
  background: rgba(255, 255, 255, 0.06);
}
.dropdown-menu .dropdown-option.danger {
  color: #f87171;
}
.dropdown-menu .dropdown-option.admin-item {
  border-left: 3px solid #4285f4;
  padding-left: 13px;
}
#helpdeskProfileMenu {
  display: none;
  z-index: 2147483647;
}
.header-actions > #helpdeskProfileMenu.profile-menu--header-anchored {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  max-height: min(70vh, calc(100dvh - env(safe-area-inset-top, 0px) - 72px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
#profileMenuShell,
#helpdeskProfileMenuShell {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  pointer-events: auto;
}
#profileMenuShell .profile-menu-backdrop,
#helpdeskProfileMenuShell .helpdesk-profile-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}
#profileMenuShell .profile-menu-panel,
#helpdeskProfileMenuShell .helpdesk-profile-menu-panel {
  position: fixed;
  top: auto;
  right: auto;
  left: auto;
  max-width: 280px;
  z-index: 1;
  pointer-events: auto;
}
#profileMenuShell #helpdeskProfileMenu,
#helpdeskProfileMenuShell #helpdeskProfileMenu {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 24px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal {
  position: fixed;
  z-index: 2147483646;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(5px);
}
.modal .modal-content {
  background: #1b1622;
  margin: 8vh auto 0;
  border-radius: 12px;
  width: min(520px, calc(100% - 32px));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}
.modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.modal .modal-header h2 {
  margin: 0;
  font-size: 1.15rem;
}
.modal .close {
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  color: #aaa;
}
.modal .modal-body {
  padding: 20px;
  color: #ddd;
  line-height: 1.6;
}
.forget-me-lead {
  color: #fff;
  font-weight: 600;
  margin-bottom: 12px;
}
.forget-me-scary-warning {
  background: rgba(185, 28, 28, 0.18);
  border: 1px solid rgba(248, 113, 113, 0.55);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
  color: #fecaca;
  text-align: left;
}
.forget-me-scary-warning strong {
  display: block;
  color: #fca5a5;
  font-size: 1.05rem;
  margin-bottom: 8px;
}
.forget-me-scary-warning p {
  margin: 0 0 8px;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #fecaca;
}
.forget-me-scary-warning p:last-child {
  margin-bottom: 0;
}
.forget-me-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
  flex-wrap: wrap;
}
.forget-me-cancel,
.forget-me-danger {
  border: none;
  border-radius: 9999px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
}
.forget-me-cancel {
  background: #374151;
  color: #fff;
}
.forget-me-danger {
  background: #b91c1c;
  color: #fff;
}
.forget-me-error {
  color: #f87171;
  margin-top: 12px;
}
.forget-me-pin-wrap {
  margin: 16px 0 4px;
}
.forget-me-pin-wrap label {
  display: block;
  margin-bottom: 8px;
  color: #fff;
  font-weight: 600;
}
.forget-me-pin-wrap input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 1rem;
}
/* Forget Me modal — override page-specific .modal-content min-width (e.g. helpdesk 1050px) */
.forget-me-modal {
  align-items: flex-start;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.forget-me-modal .modal-content,
.forget-me-modal .forget-me-dialog {
  width: min(520px, calc(100vw - 32px)) !important;
  min-width: 0 !important;
  max-width: min(520px, calc(100vw - 32px)) !important;
  max-height: calc(100vh - 32px);
  margin: 0 auto !important;
  overflow-y: auto;
}
.forget-me-body {
  overflow-wrap: anywhere;
  word-break: break-word;
}
@media (max-width: 768px) {
  .forget-me-modal .modal-content,
  .forget-me-modal .forget-me-dialog {
    width: calc(100vw - 32px) !important;
    max-width: calc(100vw - 32px) !important;
  }
  .forget-me-actions {
    flex-direction: column-reverse;
  }
  .forget-me-cancel,
  .forget-me-danger {
    width: 100%;
    text-align: center;
  }
}
/* xchk-app shared theme using fonts/colors from xchk-site */

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Base */
html, body {
  height: 100%;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  color: #ffffff;
  line-height: 1.6;
  overflow-x: hidden;
  background-color: #000000 !important;
  background-image:
    radial-gradient(60% 80% at 20% 10%, rgba(118, 75, 162, 0.25), rgba(0,0,0,0) 60%),
    radial-gradient(50% 70% at 80% 0%, rgba(102, 126, 234, 0.25), rgba(0,0,0,0) 60%),
    radial-gradient(60% 80% at 80% 90%, rgba(16, 185, 129, 0.18), rgba(0,0,0,0) 60%),
    radial-gradient(60% 80% at 15% 85%, rgba(236, 72, 153, 0.20), rgba(0,0,0,0) 60%),
    linear-gradient(180deg, #0a0a0a 0%, #000000 100%) !important;
  background-blend-mode: screen, screen, screen, screen, normal !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
  background-size: cover !important;
  background-position: center !important;
}

a {
  color: #cccccc;
  text-decoration: none;
}

a:hover {
  color: #ffffff;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Buttons (keep existing gradient but refine hover/shadow) */
.button, button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  transition: all 0.3s ease;
}

.button:hover, button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* Tables on dark background */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  color: rgba(255, 255, 255, 0.9);
}

/* Utility tints consistent with site */
.glass-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  backdrop-filter: blur(20px);
}

/* Inputs on dark */
input, select, textarea {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

input::placeholder, textarea::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

/* Headers common look */
.header h1, h1, h2, h3, h4 {
  color: #ffffff;
}

/* Compact page title on mobile — hide TVP prefix to free space for nav icons */
.title-compact { display: none; }

/* Subtle panel hover used across app */
.panel:hover, .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

/* Error/success text harmonized */
.error, .error-message { color: #f44336; }
.success { color: #4CAF50; }

/* Small devices */
@media (max-width: 768px) {
  body {
    padding-top: 0;
    background-attachment: scroll !important;
  }
  body.profile-menu-open,
  body.helpdesk-profile-menu-open {
    overflow: hidden;
  }
  .header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding-left: 16px;
    padding-right: 16px;
    padding-bottom: 12px;
    padding-top: max(12px, env(safe-area-inset-top, 0px));
    overflow: visible;
  }
  .header-title {
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    flex-wrap: nowrap;
    flex: 1;
    min-width: 0;
  }
  /* Pages without .header-title: keep logo + title adjacent on the left */
  .header > a:first-child {
    flex-shrink: 0;
  }
  .header > h1 {
    flex: 0 1 auto;
    min-width: 0;
    margin-left: 0;
  }
  .header .header-actions,
  .header-actions,
  .header-actions.header-actions-candidates {
    position: static !important;
    top: auto !important;
    right: auto !important;
    transform: none !important;
    flex-shrink: 0;
    margin-left: auto;
    gap: 8px;
    overflow: visible;
  }
  .header > .timestamp {
    flex-shrink: 0;
    margin-left: auto;
  }
  .title-full { display: none; }
  .title-compact { display: inline; }
  .brand-prefix { display: none; }
}

/* Help drawer — desktop side panel; mobile uses full-screen modal rules per page */
#helpModal.sidepanel.is-open {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  background-color: transparent !important;
  backdrop-filter: none !important;
  filter: none !important;
  pointer-events: none;
}
#helpModal.sidepanel.is-open .modal-content {
  position: fixed !important;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(420px, 92vw) !important;
  max-width: none !important;
  min-width: 320px !important;
  height: 100vh !important;
  max-height: 100vh !important;
  margin: 0 !important;
  border-radius: 0 !important;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 2147483647;
  pointer-events: auto;
  overflow-y: auto;
}
#helpModal.sidepanel.is-open .modal-body {
  height: auto;
  overflow-y: auto;
}


