/* Page scoped styles for drivers.html */

.drivers-skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 1200;
  transform: translateY(-180%);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: #173d68;
  font-weight: 700;
  box-shadow: var(--card-shadow);
}

.drivers-skip-link:focus {
  transform: translateY(0);
}

.drivers-content {
  max-width: 1500px;
}

.drivers-page-header {
  align-items: flex-end;
}

.drivers-page-header h1 {
  margin: 0.1rem 0 0.25rem;
  font-size: 2rem;
}

.drivers-eyebrow {
  margin: 0;
  color: #315f91;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.drivers-intro,
.section-heading p,
.detail-section-header p,
.drivers-modal-header p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-heading h2,
.detail-section-header h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.125rem;
}

.drivers-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #dedad3;
}

.drivers-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.drivers-stat-card {
  min-height: 112px;
  padding: 1.1rem 1.25rem;
  border: 1px solid #dfdcd6;
  border-left: 4px solid #4f8bd0;
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--card-shadow);
}

.drivers-stat-card.attention {
  border-left-color: #b8660f;
}

.drivers-stat-card.danger {
  border-left-color: #c43131;
}

.drivers-stat-label {
  display: block;
  min-height: 2.4em;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.drivers-stat-number {
  display: block;
  margin-top: 0.3rem;
  color: var(--ink);
  font-size: 1.9rem;
  line-height: 1;
}

.attention-list {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid #e8bd86;
  border-radius: var(--radius);
  background: #fff8ed;
}

.attention-list[hidden] {
  display: none;
}

.attention-list h3 {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
}

.attention-list ul {
  margin: 0;
  padding-left: 1.25rem;
}

.attention-list li {
  margin: 0.25rem 0;
  color: #67400e;
  font-size: 0.8125rem;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: #e7f0fa;
  color: #234f7d;
  font-size: 0.75rem;
  font-weight: 700;
}

.applicant-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.applicant-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
  padding: 1.1rem;
  border: 1px solid #dfdcd6;
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--card-shadow);
}

.applicant-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.applicant-card h3 {
  margin: 0;
  font-size: 1rem;
}

.applicant-card p {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}

.applicant-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 0;
}

.applicant-meta div {
  min-width: 0;
}

.applicant-meta dt {
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.applicant-meta dd {
  margin: 0.1rem 0 0;
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}

.applicant-card .btn {
  align-self: flex-start;
  justify-content: center;
  min-height: 44px;
}

.drivers-filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(5, minmax(118px, 1fr));
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid #dfdcd6;
  border-radius: var(--radius);
  background: #ffffff;
}

.drivers-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.drivers-field label {
  color: #4b4742;
  font-size: 0.75rem;
  font-weight: 700;
}

.drivers-field .input {
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  border: 1px solid #b9b5af;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
}

.drivers-field textarea.input {
  min-height: 88px;
  resize: vertical;
}

.drivers-field .input:focus,
.drivers-field .input:focus-visible,
.btn:focus-visible,
.drivers-modal-close:focus-visible,
.pagination-button:focus-visible,
.text-action:focus-visible,
.requirement-action:focus-visible,
.screening-action:focus-visible {
  outline: 3px solid rgba(79, 139, 208, 0.35);
  outline-offset: 2px;
  border-color: #315f91;
}

.drivers-field .input[aria-invalid="true"] {
  border-color: #b42323;
  box-shadow: 0 0 0 1px #b42323;
}

.field-hint {
  color: var(--muted);
  font-size: 0.6875rem;
}

.field-error {
  min-height: 1.15em;
  color: #9d2525;
  font-size: 0.6875rem;
  font-weight: 600;
}

.filter-actions {
  display: flex;
  grid-column: 1 / -1;
  gap: 0.5rem;
  justify-content: flex-end;
}

.filter-actions .btn,
#refresh-drivers,
.detail-action-buttons .btn,
.document-upload-form .btn,
.screening-form .btn {
  min-height: 44px;
  justify-content: center;
}

.drivers-table {
  min-width: 920px;
}

.drivers-table td {
  vertical-align: middle;
}

.driver-cell-name {
  display: block;
  color: var(--ink);
  font-weight: 700;
}

.driver-cell-secondary {
  display: block;
  max-width: 260px;
  margin-top: 0.1rem;
  color: var(--muted);
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drivers-loading-cell,
.drivers-error-cell {
  padding: 2.5rem 1rem !important;
  color: var(--muted);
  text-align: center;
}

.drivers-error-cell {
  color: #9d2525;
}

.status-chip,
.compliance-chip,
.document-chip,
.screening-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.025em;
  line-height: 1.2;
  text-transform: uppercase;
}

.status-chip {
  background: #e9edf1;
  color: #3f4850;
}

.compliance-chip {
  background: #e9edf1;
  color: #3f4850;
}

.status-chip.status-applied,
.status-chip.status-screening,
.document-chip.document-pending,
.screening-chip.screening-review {
  background: #fff0d7;
  color: #6f3e04;
}

.status-chip.status-approved,
.status-chip.status-active,
.compliance-chip.compliance-complete,
.document-chip.document-verified,
.screening-chip.screening-clear {
  background: #dcefe4;
  color: #18572e;
}

.status-chip.status-rejected,
.status-chip.status-inactive,
.compliance-chip.compliance-expired,
.document-chip.document-rejected,
.screening-chip.screening-fail {
  background: #f9dddd;
  color: #8a2222;
}

.compliance-chip.compliance-incomplete,
.compliance-chip.compliance-expiring-soon,
.compliance-chip.compliance-missing,
.compliance-chip.compliance-pending,
.compliance-chip.compliance-rejected,
.compliance-chip.compliance-missing-expiry {
  background: #fff0d7;
  color: #6f3e04;
}

.text-action,
.requirement-action,
.screening-action {
  min-height: 44px;
  padding: 0.45rem 0.65rem;
  border: 1px solid #a6bfd8;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: #234f7d;
  cursor: pointer;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
}

.text-action:hover,
.requirement-action:hover,
.screening-action:hover {
  background: #edf4fb;
}

.requirement-action.danger,
.screening-action.danger {
  border-color: #dfaaaa;
  color: #8a2222;
}

.text-action[disabled],
.requirement-action[disabled],
.screening-action[disabled],
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.drivers-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 1rem;
}

.pagination-button {
  min-width: 44px;
  min-height: 44px;
  padding: 0.45rem 0.7rem;
  border: 1px solid #c9c5be;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.8125rem;
}

.pagination-button[aria-current="page"] {
  border-color: #315f91;
  background: #315f91;
  color: #ffffff;
  font-weight: 700;
}

.pagination-button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.drivers-empty-state {
  grid-column: 1 / -1;
  padding: 2.5rem 1rem;
  border: 1px dashed #c9c5be;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.55);
  color: var(--muted);
  text-align: center;
}

.drivers-empty-state[hidden] {
  display: none;
}

.drivers-empty-state h3,
.drivers-empty-state h4 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
}

.drivers-empty-state p {
  margin: 0.3rem 0 1rem;
  font-size: 0.8125rem;
}

.drivers-empty-state.compact-empty {
  padding: 1.5rem 1rem;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.drivers-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem;
  overflow-y: auto;
  background: rgba(15, 17, 23, 0.68);
}

.drivers-modal-overlay[hidden] {
  display: none;
}

.drivers-modal {
  position: relative;
  width: min(1100px, 100%);
  margin: auto;
  padding: 1.5rem;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.drivers-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-right: 3rem;
}

.drivers-modal-header h2 {
  margin: 0.2rem 0 0;
  font-size: 1.5rem;
}

.drivers-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #4a4641;
  cursor: pointer;
  font-size: 1.75rem;
}

.drivers-modal-close:hover {
  background: #f0ede8;
}

.detail-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
  padding: 0.8rem 0;
  border-top: 1px solid #e5e1db;
  border-bottom: 1px solid #e5e1db;
}

.detail-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.action-help {
  min-height: 1.3em;
  margin: 0.6rem 0 0;
  color: #6f3e04;
  font-size: 0.8125rem;
}

.driver-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.profile-field {
  min-width: 0;
  padding: 0.7rem;
  border-radius: var(--radius-sm);
  background: #f8f6f2;
}

.profile-field dt {
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.profile-field dd {
  margin: 0.15rem 0 0;
  font-size: 0.8375rem;
  overflow-wrap: anywhere;
}

.detail-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e1db;
}

.detail-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.profile-assignment-form {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto;
  gap: 0.3rem 0.5rem;
  min-width: min(100%, 360px);
}

.profile-assignment-form label {
  grid-column: 1 / -1;
  color: #4b4742;
  font-size: 0.75rem;
  font-weight: 700;
}

.profile-assignment-form .input {
  min-height: 44px;
  padding: 0.5rem 0.7rem;
  border: 1px solid #b9b5af;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 0.8125rem;
}

.profile-assignment-form .btn {
  min-height: 44px;
  justify-content: center;
}

.requirement-list,
.screening-list {
  display: grid;
  gap: 0.75rem;
}

.requirement-card,
.screening-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
  padding: 1rem;
  border: 1px solid #dfdcd6;
  border-left: 4px solid #8b959f;
  border-radius: var(--radius);
  background: #ffffff;
}

.requirement-card.state-complete {
  border-left-color: #328252;
}

.requirement-card.state-expiring-soon,
.requirement-card.state-missing {
  border-left-color: #c47a21;
}

.requirement-card.state-expired {
  border-left-color: #c43131;
}

.requirement-main h4,
.screening-main h4 {
  margin: 0;
  font-size: 0.9375rem;
}

.requirement-description,
.screening-meta {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.775rem;
}

.requirement-document {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid #eeeae4;
  font-size: 0.8125rem;
}

.requirement-document strong {
  overflow-wrap: anywhere;
}

.requirement-actions,
.screening-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
  max-width: 360px;
}

.document-upload-form,
.screening-form {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid #d9d5cf;
  border-radius: var(--radius);
  background: #f8f6f2;
}

.document-upload-form h4,
.screening-form h4 {
  margin: 0 0 0.8rem;
  font-size: 0.9375rem;
}

.document-form-grid,
.screening-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.screening-notes-field {
  grid-column: 1 / -1;
}

.file-input {
  padding: 0.35rem !important;
}

.form-feedback {
  min-height: 1.25em;
  margin: 0.65rem 0;
  color: #9d2525;
  font-size: 0.8125rem;
  font-weight: 600;
}

.form-feedback.success {
  color: #18572e;
}

.screening-sequence {
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid #d2deea;
  border-radius: var(--radius);
  background: #f0f6fc;
  color: #244462;
  font-size: 0.8125rem;
}

.screening-sequence ol {
  margin: 0.35rem 0 0;
  padding-left: 1.25rem;
}

.screening-provider-note {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.screening-step-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.65rem;
}

.screening-step {
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: #ece9e4;
  color: #5a554f;
  font-size: 0.6875rem;
  font-weight: 700;
}

.screening-step.complete {
  background: #dcefe4;
  color: #18572e;
}

.compact-table {
  min-width: 680px;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 1250px) {
  .drivers-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .search-field {
    grid-column: span 2;
  }

  .applicant-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .drivers-stats-grid,
  .driver-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .requirement-card,
  .screening-card {
    grid-template-columns: 1fr;
  }

  .detail-section-header {
    flex-direction: column;
  }

  .requirement-actions,
  .screening-actions {
    justify-content: flex-start;
    max-width: none;
  }
}

@media (max-width: 768px) {
  .drivers-content {
    padding: 0;
  }

  .drivers-page-header {
    align-items: stretch;
  }

  .drivers-filter-grid {
    grid-template-columns: 1fr 1fr;
  }

  .search-field {
    grid-column: 1 / -1;
  }

  .applicant-grid {
    grid-template-columns: 1fr;
  }

  .drivers-modal-overlay {
    padding: 0;
  }

  .drivers-modal {
    min-height: 100vh;
    border-radius: 0;
  }
}

@media (max-width: 540px) {
  .drivers-stats-grid,
  .drivers-filter-grid,
  .driver-detail-grid,
  .document-form-grid,
  .screening-form-grid {
    grid-template-columns: 1fr;
  }

  .search-field,
  .screening-notes-field {
    grid-column: auto;
  }

  .filter-actions,
  .detail-action-bar,
  .detail-action-buttons {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-actions .btn,
  .detail-action-buttons .btn {
    width: 100%;
  }

  .drivers-modal {
    padding: 1rem;
  }

  .profile-assignment-form {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .profile-assignment-form .btn {
    width: 100%;
  }

  .drivers-modal-header {
    padding-right: 2.5rem;
  }
}
