/* Card Preview Styles */
.card-preview-container {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.card-preview-placeholder {
  background: var(--bg-tertiary);
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  color: var(--text-tertiary);
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.card-preview-wrapper {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  min-height: 280px;
  max-height: 720px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  box-sizing: border-box;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.card-preview-viewport {
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
  max-width: 100%;
}

/* Scale the whole email card as one unit. Do NOT override nested table widths. */
.card-preview-content {
  transform-origin: top left;
  pointer-events: none;
  display: block;
  width: 800px;
  overflow: hidden;
}

/* Strip only the outer email chrome so the 800px card isn't squeezed. */
.card-preview-content > table {
  width: 800px !important;
  max-width: 800px !important;
  padding: 0 !important;
  background: transparent !important;
}

.card-preview-content > table > tbody > tr > td,
.card-preview-content > table > tr > td {
  padding: 0 !important;
}

.form-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.3s ease;
  margin-bottom: 0;
  padding-bottom: 8px;
}

@media (max-width: 768px) {
  .card-preview-wrapper {
    padding: 14px 10px;
    min-height: 240px;
    max-height: 520px;
    border-radius: 8px;
  }
}

@media (max-width: 480px) {
  .card-preview-wrapper {
    padding: 10px 6px;
    min-height: 220px;
    max-height: 460px;
  }

  .card-preview-placeholder {
    padding: 24px 16px;
    font-size: 14px;
  }
}

/* Fit Test Form Styles */
.fit-test-form {
  display: flex;
  flex-direction: column;
  gap: 30px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  background-color: var(--bg-tertiary);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-blue);
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent-teal);
  font-family: var(--font-heading);
  transition: color 0.3s ease, border-color 0.3s ease;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.3s ease;
}

.required-mark,
.consent-required {
  color: #dc3545;
}

.form-row-full {
  grid-template-columns: 1fr;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.yes-no-question {
  gap: 10px;
}

.yes-no-label {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.yes-no-options {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.yes-no-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.form-checkbox,
.consent-checkbox {
  width: 18px;
  height: 18px;
  margin-top: 0;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--accent-teal);
}

.consent-checkbox {
  margin-top: 2px;
}

.form-checkbox:disabled,
.consent-checkbox:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.nested-checkbox {
  margin-top: -6px;
}

.subsection-block {
  margin-top: 8px;
  padding-top: 20px;
  border-top: 2px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.daily-cleaning {
  padding: 16px;
  background-color: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.daily-cleaning .form-group {
  margin: 0;
}

.respirator-mfg-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  transition: all 0.3s ease;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.form-input:focus,
.form-textarea:focus,
.form-input select:focus {
  outline: none;
  border-color: var(--accent-teal);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

.form-input-error {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

.form-input-error:focus {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2) !important;
}

.form-error-message {
  color: #dc3545;
  font-size: 13px;
  font-weight: 500;
  margin-top: 6px;
  display: block;
  padding-left: 4px;
}

.form-input select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2712%27 height=%2712%27 viewBox=%270 0 12 12%27%3E%3Cpath fill=%27%23333%27 d=%27M6 9L1 4h10z%27/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

.form-input:disabled,
.form-textarea:disabled {
  background-color: var(--bg-tertiary);
  cursor: not-allowed;
  opacity: 0.7;
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.submit-button {
  background: var(--teal);
  color: white;
  border: 2px solid var(--teal);
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.02em;
  margin-top: 8px;
  font-family: inherit;
  box-shadow: 0 8px 20px rgba(20, 184, 166, 0.25);
}

.submit-button:hover:not(:disabled) {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

.submit-button:active:not(:disabled) {
  transform: translateY(0);
}

.submit-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.download-pdf-button {
  background: var(--navy);
  color: white;
  border: 2px solid var(--navy);
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.02em;
  margin-top: 8px;
  font-family: inherit;
}

.download-pdf-button:hover:not(:disabled) {
  background: #0a243c;
  border-color: #0a243c;
}

.download-pdf-button:active:not(:disabled) {
  transform: translateY(0);
}

.download-pdf-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.preview-pdf-button {
  background: #fff;
  color: var(--teal-dark);
  border: 2px solid var(--teal);
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.02em;
  margin-top: 8px;
  font-family: inherit;
}

.preview-pdf-button:hover:not(:disabled) {
  background: rgba(20, 184, 166, 0.1);
}

.preview-pdf-button:active:not(:disabled) {
  transform: translateY(0);
}

.preview-pdf-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.status-message {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
  animation: slideIn 0.3s ease-out;
}

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

.status-message.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-message.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.validation-errors-summary {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  font-size: 14px;
  animation: slideIn 0.3s ease-out;
}

.validation-errors-summary ul {
  list-style-type: disc;
  margin: 0;
  padding-left: 20px;
}

.validation-errors-summary-title {
  font-weight: 600;
  margin-bottom: 8px;
}

.validation-errors-summary li {
  margin-bottom: 6px;
  font-weight: 500;
}

.status-message.warning {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.submit-button-container {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 8px;
}

/* Signature Pad Styles */
.signature-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.signature-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.3s ease;
}

.signature-pad-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 600px;
}

.signature-canvas {
  width: 100%;
  max-width: 600px;
  height: 200px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  cursor: crosshair;
  background-color: white;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  transition: border-color 0.3s ease;
  display: block;
}

.signature-canvas:focus {
  outline: none;
  border-color: var(--accent-teal);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

.signature-canvas:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.signature-clear-button {
  align-self: flex-start;
  padding: 8px 16px;
  background-color: #fff;
  color: var(--teal-dark);
  border: 2px solid var(--teal);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.signature-clear-button:hover:not(:disabled) {
  background-color: var(--bg-tertiary);
  border-color: var(--accent-teal);
}

.signature-clear-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Consent */
.consent-statement {
  margin: 0 0 12px;
  padding: 12px 14px;
  background-color: var(--bg-secondary);
  border-left: 4px solid var(--accent-teal);
  border-radius: 8px;
}

.consent-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-primary);
}

.consent-intro,
.consent-optional-note {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.consent-policy-box {
  padding: 12px 14px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

.consent-policy-heading {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-blue);
}

.consent-policy-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.consent-policy-list a,
.consent-choice-body a,
.consent-text a {
  font-size: 13px;
  font-weight: 600;
  color: var(--teal-dark);
}

.consent-subsection-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-blue);
  margin: 8px 0 0;
}

.consent-choice {
  margin: 0;
}

.consent-choice-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.consent-choice-title {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
}

.consent-choice-body {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.consent-optional-tag {
  margin-left: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal-dark);
}

.consent-choice--optional {
  padding: 12px;
  border: 1px dashed var(--border-color);
  border-radius: 10px;
  background: var(--bg-secondary);
}

.consent-choice--compact .consent-choice-title {
  margin-bottom: 0;
}

.consent-disclaimer {
  margin: 0;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  background: rgba(11, 45, 74, 0.04);
  border-radius: 8px;
}

.tester-attestation {
  margin-top: 8px;
  padding-top: 20px;
  border-top: 2px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 12px;
}


/* Responsive design for Fit Test Form */
@media (max-width: 768px) {
  .fit-test-form {
    gap: 20px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .form-section {
    padding: 15px;
    gap: 12px;
  }

  .section-title {
    font-size: 16px;
  }

  .form-input,
  .form-textarea {
    padding: 14px 16px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .submit-button {
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    min-height: 48px; /* Better touch target */
  }

  .signature-canvas {
    max-width: 100%;
    height: 180px;
  }
}

@media (max-width: 480px) {
  .fit-test-form {
    gap: 16px;
  }

  .form-section {
    padding: 12px;
    gap: 10px;
  }

  .section-title {
    font-size: 15px;
    margin-bottom: 6px;
    padding-bottom: 6px;
  }

  .form-group {
    gap: 6px;
  }

  .form-group label {
    font-size: 13px;
  }

  .form-input,
  .form-textarea {
    padding: 12px 14px;
    font-size: 16px;
    border-radius: 6px;
  }

  .submit-button {
    padding: 14px 20px;
    font-size: 15px;
  }

  .status-message {
    padding: 10px 12px;
    font-size: 13px;
  }

  .signature-canvas {
    height: 150px;
  }
}

.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.auth-card {
  background: #fff;
  color: var(--navy);
  border-radius: 20px;
  box-shadow: 0 10px 28px rgba(11, 45, 74, 0.08);
  border: 1px solid rgba(20, 184, 166, 0.3);
  padding: 40px;
  width: 100%;
  max-width: 450px;
  animation: fadeIn 0.5s ease-in;
}

.auth-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.auth-kicker {
  margin: 0 0 8px;
  color: var(--teal-dark);
  font-family: var(--font-heading);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
}

.auth-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--navy);
  text-align: center;
  margin-bottom: 8px;
  font-family: var(--font-heading);
  letter-spacing: -0.6px;
}

.auth-title span {
  color: var(--teal);
}

.auth-subtitle {
  margin: 4px auto 28px;
  max-width: 34em;
  color: #4d6273;
  font-size: 15px;
  line-height: 1.55;
  text-align: center;
}

.auth-subtitle-compact {
  margin-top: 8px;
  margin-bottom: 0;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-form .form-group label {
  font-size: 14px;
  font-weight: 600;
  color: #4d6273;
}

.auth-form .form-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid rgba(11, 45, 74, 0.1);
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  background-color: #F7FAFC;
  color: #0B2D4A;
  color-scheme: light;
}

.auth-form .form-input:focus {
  outline: none;
  border-color: var(--accent-teal);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

.auth-error {
  background-color: rgba(194, 58, 75, 0.1);
  color: #9b2433;
  border: 1px solid rgba(194, 58, 75, 0.28);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  text-align: center;
  margin-bottom: 10px;
}

.auth-success {
  background-color: rgba(20, 184, 166, 0.12);
  color: var(--teal-dark);
  border: 1px solid rgba(20, 184, 166, 0.35);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  text-align: center;
  margin-bottom: 10px;
}

.auth-button {
  background: var(--teal);
  color: white;
  border: 2px solid var(--teal);
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.02em;
  margin-top: 8px;
  font-family: inherit;
  box-shadow: 0 8px 20px rgba(20, 184, 166, 0.25);
}

.auth-button:hover:not(:disabled) {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

.auth-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.home-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.home-action-button {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  text-align: center;
  box-sizing: border-box;
  margin-top: 0;
}

a.auth-button.home-action-button {
  color: white;
  text-transform: none;
}

a.google-button.home-action-button {
  background: #fff;
  color: var(--teal-dark);
  border: 2px solid var(--teal);
  text-transform: none;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 0;
}

a.google-button.home-action-button:hover {
  background: rgba(20, 184, 166, 0.1);
  border-color: var(--teal);
}

.home-action-hint {
  font-size: 13px;
  color: #4d6273;
  text-align: center;
  margin: 8px 0 24px;
  line-height: 1.5;
}

.auth-switch {
  margin-top: 24px;
  text-align: center;
  font-size: 14px;
  color: #4d6273;
}

.auth-link {
  background: none;
  border: none;
  color: var(--teal-dark);
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  padding: 0;
  margin-left: 4px;
  font-family: inherit;
}

.auth-link:visited {
  color: var(--teal-dark);
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 24px 0;
  color: #7a8a99;
  font-size: 14px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.auth-divider span {
  padding: 0 16px;
}

.google-button {
  width: 100%;
  background: #fff;
  color: #0B2D4A;
  border: 2px solid rgba(11, 45, 74, 0.1);
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
  font-family: inherit;
}

.google-button:hover:not(:disabled) {
  background: rgba(20, 184, 166, 0.08);
  border-color: var(--teal);
}

.google-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.google-icon {
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .auth-container {
    padding: 15px;
  }

  .auth-card {
    padding: 30px 20px;
    max-width: 100%;
  }

  .auth-title {
    font-size: 26px;
  }

  .auth-subtitle {
    font-size: 13px;
  }

  .auth-form {
    gap: 16px;
  }

  .auth-button,
  .google-button {
    padding: 14px 24px;
    font-size: 15px;
    min-height: 48px;
  }
}

@media (max-width: 480px) {
  .auth-container {
    padding: 10px;
  }

  .auth-card {
    padding: 24px 16px;
    border-radius: 16px;
  }

  .auth-title {
    font-size: 22px;
    margin-bottom: 6px;
  }

  .auth-subtitle {
    font-size: 12px;
    margin-bottom: 24px;
  }

  .auth-form {
    gap: 14px;
  }

  .form-group {
    gap: 6px;
  }

  .form-input {
    padding: 12px 14px;
    font-size: 16px;
  }

  .auth-button,
  .google-button {
    padding: 12px 20px;
    font-size: 14px;
  }

  .auth-divider {
    margin: 20px 0;
  }

  .auth-switch {
    margin-top: 20px;
    font-size: 13px;
  }
}

.app-header {
  background: rgba(247, 250, 252, 0.97);
  color: var(--text-primary);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(11, 45, 74, 0.08);
  padding: 10px 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 200;
  margin-bottom: 0;
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.dark-mode .app-header {
  background: rgba(14, 42, 61, 0.97);
  border-bottom-color: rgba(167, 227, 224, 0.18);
}

.header-content {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-width: 0;
  gap: 12px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.mobile-menu-button {
  display: none;
  background: #fff;
  border: 1.5px solid var(--navy);
  color: var(--navy);
  padding: 0;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mobile-menu-button:hover,
.mobile-menu-button:focus-visible {
  color: var(--teal-dark);
  border-color: var(--teal);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.theme-toggle-button {
  background: #fff;
  color: var(--navy);
  border: 1.5px solid var(--border-color);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 36px;
}

.theme-toggle-button:hover {
  border-color: var(--teal);
  background: rgba(20, 184, 166, 0.1);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.user-name-mobile {
  display: none;
  font-size: 18px;
}

.button-icon {
  display: none;
}

.button-text {
  display: inline;
}

.edit-account-button {
  background: var(--teal);
  color: white;
  border: 2px solid var(--teal);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
}

.edit-account-button:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

.user-name {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  transition: color 0.3s ease;
}

.logout-button {
  background: #fff;
  color: var(--navy);
  border: 2px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
}

.logout-button:hover {
  border-color: #c23a4b;
  color: #c23a4b;
  background: rgba(194, 58, 75, 0.08);
}

@media (max-width: 768px) {
  .app-header {
    padding: 8px 0;
  }

  .header-content {
    padding: 0 12px;
    gap: 10px;
    align-items: center;
  }

  .mobile-menu-button {
    display: flex;
  }

  .header-left {
    gap: 10px;
    flex: 1;
    min-width: 0;
  }

  .header-left .brand-mark-tagline {
    display: none;
  }

  .header-right {
    gap: 6px;
    flex-shrink: 0;
  }

  .theme-toggle-button {
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 18px;
  }

  .user-info {
    gap: 6px;
  }

  .user-name {
    display: none;
  }

  .user-name-mobile {
    display: block;
  }

  .edit-account-button,
  .logout-button {
    padding: 8px 12px;
    font-size: 13px;
    min-width: 44px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .button-text {
    display: inline;
  }

  .button-icon {
    display: none;
  }
}

@media (max-width: 480px) {
  .app-header {
    padding: 8px 0;
  }

  .header-content {
    padding: 0 10px;
    gap: 8px;
  }

  .header-left {
    gap: 8px;
  }

  .mobile-menu-button {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .header-right {
    gap: 4px;
  }

  .theme-toggle-button {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }

  .user-info {
    gap: 4px;
  }

  .edit-account-button,
  .logout-button {
    padding: 8px 10px;
    font-size: 12px;
    min-width: 40px;
    min-height: 38px;
  }

  .button-text {
    display: none;
  }

  .button-icon {
    display: inline;
    font-size: 16px;
  }
}

@media (max-width: 360px) {
  .edit-account-button,
  .logout-button {
    min-width: 36px;
    padding: 6px 8px;
  }

  .button-icon {
    font-size: 14px;
  }
}

.edit-account-container {
  padding: 20px;
  display: flex;
  justify-content: center;
}

.edit-account-card {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 28px var(--shadow);
  padding: 40px;
  width: 100%;
  max-width: 600px;
  animation: fadeIn 0.5s ease-in;
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.edit-account-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 16px;
}

.edit-account-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent-blue);
  margin: 0;
  font-family: var(--font-heading);
  letter-spacing: -0.6px;
  transition: color 0.3s ease;
}

.back-button {
  background: #fff;
  color: var(--teal-dark);
  border: 2px solid var(--teal);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.back-button:hover {
  background: rgba(20, 184, 166, 0.1);
}

.edit-account-form {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.section-description {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: -8px;
  margin-bottom: 16px;
  font-style: italic;
  transition: color 0.3s ease;
}

.auth-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
  margin-bottom: 20px;
}

.solution-profile-add-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.school-profile-add-grid {
  grid-template-columns: 1fr;
}

.solution-default-toggle {
  margin-top: 8px;
}

.solution-default-toggle label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.solution-add-button {
  background: var(--teal);
  color: #fff;
  border: 2px solid var(--teal);
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 14px;
  font-family: inherit;
}

.solution-add-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.solution-profile-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.solution-profile-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--bg-tertiary);
}

.solution-profile-details {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  font-size: 13px;
}

.solution-default-badge {
  background: rgba(20, 184, 166, 0.12);
  color: var(--teal-dark);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
}

.solution-profile-actions {
  display: flex;
  gap: 6px;
}

.solution-profile-actions button {
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
  min-width: 34px;
}

.solution-profile-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.solution-empty {
  color: var(--text-secondary);
  font-size: 13px;
  padding: 8px 0;
}

/* Responsive */
@media (max-width: 768px) {
  .edit-account-container {
    padding: 15px;
  }

  .edit-account-card {
    padding: 24px 16px;
  }

  .edit-account-title {
    font-size: 24px;
  }

  .edit-account-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .back-button {
    width: 100%;
    padding: 12px 20px;
    min-height: 44px;
    font-size: 15px;
  }

  .edit-account-form {
    gap: 24px;
  }

  .solution-profile-add-grid {
    grid-template-columns: 1fr;
  }

  .solution-profile-item {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .edit-account-container {
    padding: 10px;
  }

  .edit-account-card {
    padding: 20px 12px;
  }

  .edit-account-title {
    font-size: 20px;
  }

  .edit-account-form {
    gap: 20px;
  }

  .back-button {
    padding: 10px 16px;
    font-size: 14px;
  }
}


.sidebar {
  width: 250px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-right: 1px solid var(--border-color);
  min-height: 100vh;
  position: fixed;
  left: 0;
  top: 80px;
  padding-top: 20px;
  box-shadow: 2px 0 16px var(--shadow);
  z-index: 100;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.sidebar-content {
  padding: 20px;
}

.sidebar-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--teal-dark);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-teal);
  font-family: var(--font-heading);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-button {
  width: 100%;
  padding: 14px 20px;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: inherit;
}

.sidebar-button-label {
  display: inline-block;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-button:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-teal);
  color: var(--teal-dark);
}

.sidebar-button.active {
  background: var(--teal);
  color: white;
  border-color: var(--teal);
  box-shadow: 0 8px 20px rgba(20, 184, 166, 0.25);
}

@media (max-width: 768px) {
  .sidebar {
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 200;
  }

  .sidebar.sidebar-open {
    transform: translateX(0);
  }

  .sidebar-button {
    font-size: 16px;
    padding: 14px 20px;
    min-height: 48px;
  }
}

@media (max-width: 480px) {
  .sidebar {
    width: 260px;
  }

  .sidebar-title {
    font-size: 0.72rem;
  }

  .sidebar-button {
    font-size: 15px;
    padding: 12px 16px;
  }
}

.test-results-container {
  padding: 0;
  min-height: 100%;
  background-color: transparent;
}

.test-results-content {
  max-width: 1200px;
  margin: 0 auto;
}

.results-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 30px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 24px var(--shadow);
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.results-header-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}

.results-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent-blue);
  margin: 0;
  font-family: var(--font-heading);
  letter-spacing: -0.5px;
  transition: color 0.3s ease;
}

.results-header-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.results-retention-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-secondary);
}

.results-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.results-filters {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}

.results-filter {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.results-filter select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
}

.results-filter-count {
  margin-left: auto;
  font-size: 13px;
  color: var(--text-secondary);
  padding-bottom: 10px;
  white-space: nowrap;
}

.export-csv-button,
.refresh-button {
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.export-csv-button {
  background: var(--navy);
}

.refresh-button {
  background: var(--teal);
}

.export-csv-button:hover,
.refresh-button:hover {
  transform: translateY(-2px);
}

.export-csv-button:hover {
  box-shadow: 0 4px 12px rgba(11, 45, 74, 0.28);
}

.refresh-button:hover {
  box-shadow: 0 8px 20px rgba(20, 184, 166, 0.25);
}

.export-csv-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.loading-message,
.error-message {
  text-align: center;
  padding: 40px;
  font-size: 18px;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 24px var(--shadow);
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.error-message {
  color: #dc3545;
}

.index-error-message {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 2px 8px var(--shadow);
  max-width: 700px;
  margin: 0 auto;
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.index-error-message h3 {
  color: #ff9800;
  font-size: 24px;
  margin-top: 0;
  margin-bottom: 16px;
}

.index-error-message p {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.6;
  transition: color 0.3s ease;
}

.index-instructions {
  background: var(--bg-tertiary);
  border-left: 4px solid var(--accent-teal);
  padding: 20px;
  border-radius: 8px;
  margin: 20px 0;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.index-instructions h4 {
  color: var(--accent-blue);
  font-size: 18px;
  margin-top: 0;
  margin-bottom: 12px;
  transition: color 0.3s ease;
}

.index-instructions ol {
  margin: 0;
  padding-left: 20px;
}

.index-instructions li {
  margin-bottom: 12px;
  line-height: 1.6;
  color: var(--text-primary);
  transition: color 0.3s ease;
}

.index-instructions ul {
  margin-top: 8px;
  margin-bottom: 8px;
  padding-left: 20px;
}

.index-instructions ul li {
  margin-bottom: 4px;
}

.index-link {
  color: var(--accent-blue);
  text-decoration: underline;
  font-weight: 600;
  word-break: break-all;
  transition: color 0.3s ease;
}

.index-link:hover {
  color: var(--accent-blue-light);
}

.retry-button {
  display: block;
  margin: 20px auto 0;
  background: var(--teal);
  color: white;
  border: 2px solid var(--teal);
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}

.retry-button:hover {
  background: var(--accent-blue-light);
  transform: translateY(-2px);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 24px var(--shadow);
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.empty-state p {
  font-size: 16px;
  margin: 8px 0;
}

/* Calendar View Layout */
.calendar-view {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.month-section {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 24px var(--shadow);
  border: 1px solid var(--border-color);
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.month-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 3px solid var(--accent-blue);
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
  padding: 16px 20px;
  border-radius: 8px;
  margin: -8px -8px 20px -8px;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.month-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--accent-blue);
  margin: 0;
  font-family: var(--font-heading);
  text-transform: capitalize;
  transition: color 0.3s ease;
}

.month-count {
  background: var(--teal);
  color: white;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
}

.result-card {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 24px var(--shadow);
  transition: all 0.3s ease;
}

.result-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px var(--shadow-hover);
}

.result-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border-color);
  transition: border-color 0.3s ease;
}

.result-client-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--accent-blue);
  margin: 0;
  transition: color 0.3s ease;
}

.result-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.result-badge.pass {
  background-color: rgba(20, 184, 166, 0.14);
  color: var(--teal-dark);
}

.result-badge.fail {
  background-color: #f8d7da;
  color: #721c24;
}

.result-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
  transition: border-color 0.3s ease;
}

.result-row:last-child {
  border-bottom: none;
}

.result-label {
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 14px;
  transition: color 0.3s ease;
}

.result-value {
  color: var(--text-primary);
  font-size: 14px;
  text-align: right;
  font-family: 'Courier New', monospace;
  transition: color 0.3s ease;
}

.result-value--wrap {
  font-family: inherit;
  text-align: left;
  max-width: 60%;
  white-space: pre-wrap;
}

.result-consent-item {
  padding-bottom: 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}

.result-consent-item .result-row {
  border-bottom: none;
  padding-bottom: 4px;
}

.result-consent-text,
.result-consent-disclaimer {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.result-consent-disclaimer {
  padding: 10px 12px;
  background: rgba(11, 45, 74, 0.04);
  border-radius: 8px;
}

.result-section .result-subsection-title {
  margin-top: 12px;
}

.result-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
  transition: border-color 0.3s ease;
}

.result-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.result-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--accent-blue);
  margin: 0 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  transition: color 0.3s ease, border-color 0.3s ease;
}

.result-subsection {
  margin-top: 12px;
  margin-left: 16px;
  padding-left: 16px;
  border-left: 2px solid var(--border-color);
  transition: border-color 0.3s ease;
}

.result-subsection-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px 0;
  transition: color 0.3s ease;
}

.show-all-wrap {
  margin-top: 16px;
  text-align: center;
}

.show-all-button {
  background: transparent;
  border: 1px solid var(--accent-blue);
  color: var(--accent-blue);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.show-all-button:hover {
  background: var(--accent-blue);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(11, 45, 74, 0.25);
}

.result-card-footer {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  transition: border-color 0.3s ease;
}

.result-card.editing {
  border: 2px solid var(--accent-teal);
  box-shadow: 0 4px 16px rgba(20, 184, 166, 0.2);
}

.edit-mode {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.edit-form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.edit-form-row label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.3s ease;
}

.edit-input,
.edit-select {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.3s ease;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.edit-input:focus,
.edit-select:focus {
  outline: none;
  border-color: var(--accent-teal);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

.edit-client-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--accent-blue);
  padding: 8px 12px;
  transition: color 0.3s ease;
}

.edit-result-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  width: auto;
  min-width: 80px;
}

.edit-button {
  background: var(--teal);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.edit-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(20, 184, 166, 0.3);
}

.edit-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.save-button {
  background: var(--teal-dark);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.save-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.save-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.cancel-button {
  background: #fff;
  color: var(--navy);
  border: 2px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}

.cancel-button:hover:not(:disabled) {
  border-color: var(--teal);
  color: var(--teal-dark);
  background: rgba(20, 184, 166, 0.08);
}

.cancel-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.resend-button {
  background: var(--navy);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.resend-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(11, 45, 74, 0.28);
}

.resend-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.result-pdf-preview-button {
  background: var(--teal);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.result-pdf-preview-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(13, 148, 136, 0.35);
}

.result-pdf-preview-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.result-pdf-download-button {
  background: var(--navy);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.result-pdf-download-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(15, 118, 110, 0.35);
}

.result-pdf-download-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.delete-button {
  background: #dc3545;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.delete-button:hover:not(:disabled) {
  background: #c82333;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.delete-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.success-message {
  background: #d4edda;
  color: #155724;
  padding: 12px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid #c3e6cb;
  font-size: 14px;
}

.error-message-banner {
  background: #f8d7da;
  color: #721c24;
  padding: 12px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid #f5c6cb;
  font-size: 14px;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease-in;
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease-out;
}

.modal-content h3 {
  margin-top: 0;
  margin-bottom: 16px;
  color: var(--navy);
  font-family: var(--font-heading);
  font-size: 24px;
}

.modal-content p {
  margin-bottom: 12px;
  color: #333;
  line-height: 1.6;
}

.modal-warning {
  color: #dc3545;
  font-weight: 500;
  font-size: 14px;
}

.modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

.modal-button {
  padding: 10px 24px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.cancel-button {
  background: #fff;
  color: var(--navy);
  border: 2px solid var(--border-color);
}

.cancel-button:hover:not(:disabled) {
  background: rgba(20, 184, 166, 0.08);
  border-color: var(--teal);
  color: var(--teal-dark);
}

.confirm-delete-button {
  background: #dc3545;
  color: white;
}

.confirm-delete-button:hover:not(:disabled) {
  background: #c82333;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.modal-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Signature Display Styles */
.signature-display-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.signature-display {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.signature-image-container {
  display: flex;
  justify-content: flex-start;
  padding: 8px 0;
}

.signature-image {
  max-width: 100%;
  max-height: 150px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  background-color: white;
  padding: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments for signature */
@media (max-width: 768px) {
  .signature-image {
    max-height: 120px;
  }
}

@media (max-width: 480px) {
  .signature-image {
    max-height: 100px;
  }
  
  .signature-display-section {
    margin-top: 12px;
    padding-top: 12px;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .test-results-container {
    padding: 0;
  }

  .test-results-content {
    padding: 0 10px;
  }

  .results-header {
    gap: 12px;
    padding: 16px;
    margin-bottom: 20px;
  }

  .results-header-main {
    width: 100%;
  }

  .results-title {
    font-size: 22px;
  }

  .results-header-actions {
    width: 100%;
  }

  .export-csv-button,
  .refresh-button {
    width: 100%;
    padding: 12px 20px;
    font-size: 15px;
    min-height: 44px;
  }

  .results-filter {
    min-width: 100%;
  }

  .results-filter-count {
    margin-left: 0;
    padding-bottom: 0;
  }

  .results-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .month-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .month-title {
    font-size: 18px;
  }

  .month-section {
    padding: 12px;
  }

  .result-card {
    padding: 16px;
  }

  .result-card-header {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  .result-card-title {
    font-size: 18px;
  }

  .result-card-actions {
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .edit-button,
  .delete-button {
    width: 100%;
    padding: 10px 16px;
    min-height: 44px;
  }
}

@media (max-width: 480px) {
  .test-results-content {
    padding: 0 5px;
  }

  .results-header {
    padding: 12px;
    margin-bottom: 16px;
  }

  .results-title {
    font-size: 20px;
  }

  .month-section {
    padding: 10px;
  }

  .result-card {
    padding: 12px;
  }

  .result-card-title {
    font-size: 16px;
  }

  .result-card-body {
    font-size: 14px;
  }

  .result-card-footer {
    flex-direction: column;
    gap: 8px;
  }

  .save-button,
  .cancel-button {
    width: 100%;
    min-height: 44px;
  }
}


.users-management-container {
  padding: 0;
}

.users-management-card {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 24px var(--shadow);
  padding: 24px;
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.users-management-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.users-management-title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: var(--accent-blue);
  font-family: var(--font-heading);
  letter-spacing: -0.5px;
}

.users-management-subtitle {
  margin: 8px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.users-management-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.users-primary-button,
.users-secondary-button,
.users-danger-button {
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.users-primary-button {
  background: var(--teal);
  color: #fff;
}

.users-secondary-button {
  background: #fff;
  color: var(--teal-dark);
  border: 2px solid var(--teal);
}

.users-danger-button {
  background: #dc3545;
  color: #fff;
}

.users-primary-button:hover,
.users-secondary-button:hover,
.users-danger-button:hover {
  transform: translateY(-1px);
}

.users-primary-button:disabled,
.users-secondary-button:disabled,
.users-danger-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.users-error,
.users-success {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

.users-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.users-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.users-create-form {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 20px;
}

.users-create-form h3 {
  margin: 0 0 8px;
  color: var(--accent-blue);
}

.users-hint {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--text-secondary);
}

.users-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.users-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.users-form-grid input,
.users-form-grid select,
.users-filters select,
.users-search {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  box-sizing: border-box;
}

.users-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.users-search {
  flex: 1;
  min-width: 220px;
}

.users-filters select {
  min-width: 150px;
}

.users-empty {
  text-align: center;
  padding: 36px 16px;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border-radius: 10px;
}

.users-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.user-card {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  background: var(--bg-tertiary);
}

.user-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.user-card-top h3 {
  margin: 0;
  font-size: 18px;
  color: var(--text-primary);
}

.user-tester-line,
.user-test-count {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.user-tester-line strong,
.user-test-count strong {
  color: var(--text-primary);
  font-weight: 700;
}

.user-id {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
  word-break: break-all;
}

.user-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.user-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
  background: #e9ecef;
  color: #333;
}

.user-badge.role-admin {
  background: rgba(11, 45, 74, 0.08);
  color: var(--navy);
}

.user-badge.role-tester {
  background: rgba(20, 184, 166, 0.14);
  color: var(--teal-dark);
}

.user-badge.status-approved {
  background: #d4edda;
  color: #155724;
}

.user-badge.status-pending {
  background: #fff3cd;
  color: #856404;
}

.user-badge.status-rejected {
  background: #f8d7da;
  color: #721c24;
}

.user-badge.you {
  background: rgba(20, 184, 166, 0.14);
  color: var(--navy);
}

.user-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-secondary);
}

.user-card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .users-management-card {
    padding: 16px;
  }

  .users-management-title {
    font-size: 24px;
  }

  .users-management-header-actions {
    width: 100%;
  }

  .users-management-header-actions button {
    flex: 1;
  }
}

.verify-card {
  max-width: 560px;
}

.verify-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 24px;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
}

.verify-status-badge--valid {
  background: rgba(20, 184, 166, 0.14);
  color: #0F9A8A;
}

.verify-status-badge--expired {
  background: rgba(196, 123, 23, 0.14);
  color: #9a5c0c;
}

.verify-status-badge--failed {
  background: rgba(220, 53, 69, 0.12);
  color: #b42333;
}

.verify-status-badge--invalid,
.verify-status-badge--error {
  background: rgba(11, 45, 74, 0.08);
  color: #0B2D4A;
}

.verify-animation {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto 8px;
}

.verify-animation-lottie {
  width: 160px;
  height: 160px;
}

.verify-card .loading-animation {
  margin: 8px 0 16px;
}

.verify-card .loading-animation-lottie {
  width: 148px;
  height: 148px;
}

.verify-details {
  margin: 0 0 28px;
  padding: 8px 20px;
  border: 1px solid rgba(11, 45, 74, 0.1);
  border-radius: 12px;
  background: #F7FAFC;
}

.verify-details-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(11, 45, 74, 0.08);
}

.verify-details-row:last-child {
  border-bottom: none;
}

.verify-details dt {
  font-size: 13px;
  font-weight: 600;
  color: #0B2D4A;
}

.verify-details dd {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: #4d6273;
  text-align: right;
  word-break: break-word;
}

.verify-result--pass {
  color: #0F9A8A;
  font-weight: 700;
}

.verify-result--fail {
  color: #dc3545;
  font-weight: 700;
}

.verify-token-input {
  font-family: 'Courier New', monospace;
  letter-spacing: 0.04em;
}

@media (max-width: 480px) {
  .verify-details-row {
    flex-direction: column;
    gap: 4px;
  }

  .verify-details dd {
    text-align: left;
  }
}

/* CSS Variables for Easy Theme Customization */
:root {
  --navy: #0B2D4A;
  --teal: #14B8A6;
  --teal-dark: #0F9A8A;
  --aqua: #A7E3E0;
  --bg-primary: #F7FAFC;
  --bg-secondary: #ffffff;
  --bg-tertiary: #eef5f7;
  --text-primary: #0B2D4A;
  --text-secondary: #4d6273;
  --text-tertiary: #7a8a99;
  --border-color: rgba(11, 45, 74, 0.1);
  --shadow: rgba(11, 45, 74, 0.08);
  --shadow-hover: rgba(20, 184, 166, 0.18);
  --accent-blue: #0B2D4A;
  --accent-teal: #14B8A6;
  --accent-blue-light: #0F9A8A;
  --font-heading: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
  --font-body: 'IBM Plex Sans', 'Segoe UI', sans-serif;
}

.dark-mode {
  --bg-primary: #071824;
  --bg-secondary: #0e2a3d;
  --bg-tertiary: #123348;
  --text-primary: #F7FAFC;
  --text-secondary: #A7E3E0;
  --text-tertiary: #8aa3b5;
  --border-color: rgba(167, 227, 224, 0.18);
  --shadow: rgba(0, 0, 0, 0.4);
  --shadow-hover: rgba(20, 184, 166, 0.25);
  --accent-blue: #A7E3E0;
  --accent-teal: #14B8A6;
  --accent-blue-light: #14B8A6;
}

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

body {
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

html:has(.auth-page),
html:has(.auth-page) body {
  color-scheme: light;
  background-color: #F7FAFC;
  color: #0B2D4A;
}

.app {
  min-height: 100vh;
  overflow-x: hidden;
}

.app.auth-page {
  --navy: #0B2D4A;
  --teal: #14B8A6;
  --teal-dark: #0F9A8A;
  --aqua: #A7E3E0;
  --bg-primary: #F7FAFC;
  --bg-secondary: #ffffff;
  --bg-tertiary: #eef5f7;
  --text-primary: #0B2D4A;
  --text-secondary: #4d6273;
  --text-tertiary: #7a8a99;
  --border-color: rgba(11, 45, 74, 0.1);
  --shadow: rgba(11, 45, 74, 0.08);
  --shadow-hover: rgba(20, 184, 166, 0.18);
  --accent-blue: #0B2D4A;
  --accent-teal: #14B8A6;
  --accent-blue-light: #0F9A8A;
  color-scheme: light;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background:
    radial-gradient(ellipse at top, rgba(20, 184, 166, 0.16), transparent 55%),
    #F7FAFC;
  color: #0B2D4A;
}

.app.auth-page .brand-mark-title,
.app.auth-page .brand-mark-tagline {
  color: #0B2D4A;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.brand-mark-logo {
  width: 52px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-mark-logo-dark {
  display: none;
}

.dark-mode .brand-mark-logo-light {
  display: none;
}

.dark-mode .brand-mark-logo-dark {
  display: block;
}

.app.auth-page .brand-mark-logo-light {
  display: block;
}

.app.auth-page .brand-mark-logo-dark {
  display: none;
}

.brand-mark-title {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.3px;
  line-height: 1.15;
}

.brand-mark-title span {
  color: var(--teal);
  font-weight: 700;
}

.brand-mark-tagline {
  display: block;
  margin-top: 0.18rem;
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.3;
}

.dark-mode .brand-mark-title,
.dark-mode .brand-mark-tagline {
  color: var(--text-primary);
}

.app-layout {
  display: flex;
  min-height: calc(100vh - 80px);
  margin-top: 80px;
}

@media (max-width: 768px) {
  .app-layout {
    margin-top: 64px;
    min-height: calc(100vh - 64px);
  }
}

@media (max-width: 480px) {
  .app-layout {
    margin-top: 60px;
    min-height: calc(100vh - 60px);
  }
}

.main-content {
  flex: 1;
  margin-left: 250px;
  padding: 20px;
  background-color: var(--bg-primary);
  min-height: calc(100vh - 80px);
  min-width: 0;
  transition: background-color 0.3s ease;
}

.main-content .container {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 28px var(--shadow);
  padding: 40px;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  min-width: 0;
  box-sizing: border-box;
  animation: fadeIn 0.5s ease-in;
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.sidebar-overlay {
  display: none;
}

@media (max-width: 768px) {
  .app-layout {
    position: relative;
  }

  .main-content {
    margin-left: 0;
    padding: 15px;
    width: 100%;
  }

  .main-content .container {
    padding: 20px 15px;
    margin: 0;
  }

  .sidebar-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(11, 45, 74, 0.45);
    z-index: 150;
    transition: opacity 0.3s ease;
  }

  .brand-mark-logo {
    width: 44px;
    height: 48px;
  }

  .brand-mark-title {
    font-size: 1rem;
  }

  .brand-mark-tagline {
    font-size: 0.7rem;
    letter-spacing: 0.02em;
  }
}

.container {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 28px var(--shadow);
  padding: 40px;
  width: 100%;
  max-width: 1000px;
  animation: fadeIn 0.5s ease-in;
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.title {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent-blue);
  text-align: center;
  margin-bottom: 30px;
  font-family: var(--font-heading);
  letter-spacing: -0.6px;
  transition: color 0.3s ease;
}

@media (max-width: 768px) {
  .container {
    padding: 20px 15px;
    max-width: 100%;
    border-radius: 12px;
  }

  .title {
    font-size: 24px;
    margin-bottom: 20px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 15px 10px;
  }

  .title {
    font-size: 20px;
    margin-bottom: 16px;
  }
}

.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.loading-animation {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.loading-animation-lottie {
  width: 160px;
  height: 160px;
}

.loading-animation-label {
  margin: 8px 0 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--teal-dark);
  font-family: var(--font-heading);
}

.loading-spinner {
  font-size: 18px;
  color: var(--accent-teal);
  font-weight: 600;
  font-family: var(--font-heading);
  transition: color 0.3s ease;
}

