/* =========================================================
   TEST PRO LLC - MAIN STYLESHEET
========================================================= */

:root {
  --tp-navy: #0b2545;
  --tp-navy-dark: #061a33;
  --tp-blue: #1668d1;
  --tp-blue-light: #eaf2fd;
  --tp-white: #ffffff;
  --tp-gray: #6c7a89;
  --tp-radius: 14px;
}


/* =========================================================
   GLOBAL
========================================================= */

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  color: #1c2b3a;
  background-color: #f7f9fc;
}

a {
  text-decoration: none;
}


/* =========================================================
   PUBLIC NAVBAR
========================================================= */

.tp-navbar {
  background: var(--tp-navy);
  padding: 0.75rem 0;
}

.tp-navbar .navbar-brand {
  color: #fff;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.5px;
}

.tp-navbar .nav-link {
  color: #cfe0f7 !important;
  font-weight: 500;
  margin: 0 0.35rem;
  transition: color .2s ease;
}

.tp-navbar .nav-link:hover,
.tp-navbar .nav-link.active {
  color: #fff !important;
}

.tp-navbar .btn-portal {
  border-radius: 50px;
  padding: 0.45rem 1.1rem;
  font-weight: 600;
}


/* =========================================================
   HERO
========================================================= */

.tp-hero {
  background: linear-gradient(
    135deg,
    var(--tp-navy) 0%,
    var(--tp-navy-dark) 100%
  );
  color: #fff;
  padding: 5.5rem 0 6rem;
}

.tp-hero h1 {
  font-weight: 800;
}

.tp-hero p.lead {
  color: #cfe0f7;
}

.tp-hero .btn-primary {
  background: var(--tp-blue);
  border: none;
  border-radius: 50px;
  padding: 0.75rem 1.8rem;
  font-weight: 600;
}

.tp-hero .btn-outline-light {
  border-radius: 50px;
  padding: 0.75rem 1.8rem;
  font-weight: 600;
}


/* =========================================================
   CARDS
========================================================= */

.tp-card {
  background: #fff;
  border-radius: var(--tp-radius);
  border: 1px solid #eef1f6;
  box-shadow: 0 4px 18px rgba(11, 37, 69, 0.06);
  transition: transform .2s ease, box-shadow .2s ease;
  padding: 1.75rem;
  height: 100%;
}

.tp-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(11, 37, 69, 0.12);
}

.tp-card .icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--tp-blue-light);
  color: var(--tp-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1rem;
}


/* =========================================================
   SECTION TITLES
========================================================= */

.tp-section-title {
  font-weight: 800;
  color: var(--tp-navy);
}

.tp-eyebrow {
  color: var(--tp-blue);
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-size: 0.8rem;
}


/* =========================================================
   BUTTONS
========================================================= */

.btn-tp-primary {
  background: var(--tp-blue);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 0.6rem 1.5rem;
  font-weight: 600;
}

.btn-tp-primary:hover {
  background: #0f52a8;
  color: #fff;
}

.btn-tp-outline {
  border: 2px solid var(--tp-blue);
  color: var(--tp-blue);
  border-radius: 50px;
  padding: 0.55rem 1.4rem;
  font-weight: 600;
  background: transparent;
}

.btn-tp-outline:hover {
  background: var(--tp-blue);
  color: #fff;
}


/* =========================================================
   FOOTER
========================================================= */

.tp-footer {
  background: var(--tp-navy-dark);
  color: #a9bcd6;
  padding: 3rem 0 1.5rem;
}

.tp-footer a {
  color: #cfe0f7;
}

.tp-footer a:hover {
  color: #fff;
}

.tp-footer h6 {
  color: #fff;
  font-weight: 700;
}


/* =========================================================
   PORTAL SIDEBAR
========================================================= */

.tp-sidebar {
  background: var(--tp-navy);
  min-height: 100vh;
  color: #cfe0f7;
  padding-top: 1.5rem;
}

.tp-sidebar a {
  color: #cfe0f7;
  display: block;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  margin: 0.15rem 0.75rem;
  font-weight: 500;
}

.tp-sidebar a:hover,
.tp-sidebar a.active {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.tp-sidebar .brand {
  color: #fff;
  font-weight: 700;
  padding: 0 1.25rem 1.25rem;
  font-size: 1.15rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 0.75rem;
}


/* =========================================================
   PORTAL CONTENT
========================================================= */

.tp-content {
  padding: 2rem;
}


/* =========================================================
   DASHBOARD STAT CARDS
========================================================= */

.tp-stat-card {
  background: #fff;
  border-radius: var(--tp-radius);
  padding: 1.5rem;
  border: 1px solid #eef1f6;
  box-shadow: 0 4px 18px rgba(11,37,69,0.05);
  height: 100%;
}

.tp-stat-card .stat-value {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--tp-navy);
}

.tp-stat-card .stat-label {
  color: var(--tp-gray);
  font-weight: 500;
  font-size: 0.9rem;
}


/* =========================================================
   FORMS
========================================================= */

.tp-form-card {
  background: #fff;
  border-radius: var(--tp-radius);
  padding: 2rem;
  box-shadow: 0 4px 18px rgba(11,37,69,0.06);
}

.form-control,
.form-select {
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
}


/* =========================================================
   TABLES
========================================================= */

.table-responsive {
  max-width: 100%;
}

.table-tp thead {
  background: var(--tp-blue-light);
}

.table-tp thead th {
  color: var(--tp-navy);
  font-weight: 700;
  border-bottom: none;
}

.table-tp td,
.table-tp th {
  vertical-align: middle;
}


/* =========================================================
   STATUS BADGES
========================================================= */

.badge-status-active,
.badge-status-completed,
.badge-status-confirmed,
.badge-status-compliant {
  background: #1ba97e;
}

.badge-status-pending {
  background: #e0a316;
}

.badge-status-cancelled,
.badge-status-no_show,
.badge-status-non_compliant,
.badge-status-rejected {
  background: #d84343;
}

.badge-status-inactive {
  background: #6c757d;
}

.badge-status-pending_setup {
  background: #8a5fc9;
}

.badge-status-approved,
.badge-status-scheduled {
  background: #2f6fdb;
}

.badge-status-collected,
.badge-status-sent_to_lab,
.badge-status-specimen_collected {
  background: #0f9b8e;
}

.badge-status-result_received,
.badge-status-pending_mro {
  background: #c98a1a;
}


/* =========================================================
   COMPLIANCE / DOCUMENT VERIFICATION
========================================================= */

.badge-status-verified {
  background: #1ba97e;
}

.badge-status-superseded {
  background: #8a94a6;
}

.badge-status-submitted {
  background: #2f6fdb;
}

.badge-status-under_review {
  background: #c98a1a;
}

.badge-status-missing {
  background: #6c757d;
}

.badge-status-expired {
  background: #d84343;
}

.badge-status-not_applicable {
  background: #8a94a6;
}

.badge-status-expiring_soon {
  background: #e0a316;
}

.badge-status-valid {
  background: #1ba97e;
}


/* =========================================================
   DQF HEALTH
========================================================= */

.badge-dqf-green {
  background: #1ba97e;
}

.badge-dqf-yellow {
  background: #e0a316;
}

.badge-dqf-red {
  background: #d84343;
}


/* =========================================================
   IFTA / IRP / PERMITS
========================================================= */

.badge-status-not_started {
  background: #6c757d;
}

.badge-status-waiting_for_employer {
  background: #e0a316;
}

.badge-status-in_progress {
  background: #2f6fdb;
}

.badge-status-needs_correction {
  background: #d84343;
}

.badge-status-ready_to_file {
  background: #0f9b8e;
}

.badge-status-filed {
  background: #1ba97e;
}

.badge-status-late {
  background: #d84343;
}

.badge-status-renewal_due {
  background: #e0a316;
}

.badge-status-not_required {
  background: #8a94a6;
}

.badge-status-suspended {
  background: #d84343;
}

.badge-status-closed {
  background: #6c757d;
}


/* =========================================================
   LOADING SPINNER
========================================================= */

.tp-loading {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: tp-spin 0.7s linear infinite;
}

@keyframes tp-spin {
  to {
    transform: rotate(360deg);
  }
}


/* =========================================================
   ACCESSIBILITY
========================================================= */

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #ffb020;
  outline-offset: 2px;
}

.tp-sidebar a:focus-visible {
  outline: 3px solid #ffb020;
  outline-offset: -3px;
}

.tp-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 2000;
  background: var(--tp-navy);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 8px 0;
  font-weight: 600;
}

.tp-skip-link:focus {
  left: 0;
}


/* =========================================================
   DRIVER APPLICATION STEPPER
========================================================= */

.tp-app-stepper {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 0.35rem;
  padding: 0.25rem 0.1rem 0.6rem;
  margin: 0 0 1rem;
  list-style: none;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

.tp-app-step {
  flex: 0 0 auto;
}

.tp-app-step .tp-app-step-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid #e3e8f0;
  background: #fff;
  border-radius: 50px;
  padding: 0.4rem 0.9rem 0.4rem 0.4rem;
  color: #47576b;
  font-weight: 600;
  font-size: 0.82rem;
  white-space: nowrap;
  transition: all .15s ease;
}

.tp-app-step .tp-app-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #eef1f6;
  color: #6c7a89;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.tp-app-step.is-done .tp-app-step-num {
  background: #1ba97e;
  color: #fff;
}

.tp-app-step.is-active .tp-app-step-link {
  border-color: var(--tp-blue);
  background: var(--tp-blue-light);
  color: var(--tp-navy);
}

.tp-app-step.is-active .tp-app-step-num {
  background: var(--tp-blue);
  color: #fff;
}

.tp-app-step:not(.is-done) .tp-app-step-link {
  opacity: 0.72;
}

.tp-app-step.is-active .tp-app-step-link,
.tp-app-step.is-done .tp-app-step-link {
  opacity: 1;
}


/* =========================================================
   DRIVER APPLICATION PROGRESS
========================================================= */

.tp-app-progress-wrap {
  min-width: 220px;
}

.tp-app-progress-wrap .progress {
  height: 10px;
  border-radius: 50px;
  background: #eef1f6;
}

.tp-app-progress-wrap .progress-bar {
  border-radius: 50px;
}

.tp-app-progress-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
  font-size: 0.82rem;
  color: var(--tp-gray);
  font-weight: 600;
}

.tp-app-progress-summary strong {
  color: var(--tp-navy);
}


/* =========================================================
   DRIVER APPLICATION SECTION HEADER
========================================================= */

.tp-app-section-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.15rem;
}

.tp-app-section-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--tp-blue-light);
  color: var(--tp-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.tp-app-section-title {
  display: flex;
  flex-direction: column;
}

.tp-app-section-title h6 {
  margin: 0;
}

.tp-app-section-num {
  color: var(--tp-blue);
  font-weight: 800;
  font-size: 0.85rem;
}

.tp-app-section-sub {
  color: var(--tp-gray);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}


/* =========================================================
   YES / NO CONTROL
========================================================= */

.tp-yesno {
  display: inline-flex;
  border: 1px solid #d7dee8;
  border-radius: 50px;
  overflow: hidden;
}

.tp-yesno .btn-check:checked + .btn {
  background: var(--tp-blue);
  color: #fff;
  border-color: var(--tp-blue);
}

.tp-yesno .btn {
  border: none;
  border-radius: 0;
  padding: 0.4rem 1.3rem;
  font-weight: 600;
  font-size: 0.85rem;
  background: #fff;
  color: #47576b;
}

.tp-yesno .btn:not(:last-child) {
  border-right: 1px solid #d7dee8;
}


/* =========================================================
   DRIVER APPLICATION ROWS
========================================================= */

.tp-app-row-card {
  border: 1px solid #eef1f6;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.6rem;
  background: #fbfcfe;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.tp-app-row-card .tp-app-row-main {
  font-weight: 600;
  color: var(--tp-navy);
}

.tp-app-row-card .tp-app-row-sub {
  color: var(--tp-gray);
  font-size: 0.85rem;
}

.tp-app-empty {
  text-align: center;
  padding: 1.75rem 1rem;
  color: var(--tp-gray);
  border: 1px dashed #dbe2ec;
  border-radius: 10px;
  background: #fbfcfe;
  margin-bottom: 0.75rem;
}

.tp-app-empty i {
  font-size: 1.4rem;
  color: #c3cddb;
  display: block;
  margin-bottom: 0.4rem;
}

.tp-app-required {
  color: #d84343;
  font-weight: 700;
}


/* =========================================================
   DRIVER APPLICATION REVIEW
========================================================= */

.tp-app-review-item {
  border-bottom: 1px solid #f1f3f8;
  padding: 0.55rem 0;
}

.tp-app-review-item:last-child {
  border-bottom: none;
}

.tp-app-review-label {
  color: var(--tp-gray);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.tp-app-review-value {
  font-weight: 600;
  color: #1c2b3a;
}


/* =========================================================
   CORRECTION CHIPS
========================================================= */

.tp-app-correction-sections {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.6rem 0 0;
}

.tp-app-correction-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #fff;
  border: 1px solid #f1b3b3;
  color: #b23a3a;
  border-radius: 50px;
  padding: 0.25rem 0.75rem 0.25rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.tp-app-correction-chip:hover {
  background: #fdecec;
  color: #8f2b2b;
}


/* =========================================================
   SIGNATURE
========================================================= */

.tp-signature-card {
  border: 2px solid var(--tp-blue-light);
  border-radius: var(--tp-radius);
  padding: 1.5rem;
  background: linear-gradient(
    180deg,
    #fbfdff 0%,
    #ffffff 100%
  );
}

.tp-signature-card input[name="typed_name"] {
  font-family: 'Segoe Script', 'Brush Script MT', cursive;
  font-size: 1.4rem;
  border: none;
  border-bottom: 2px solid var(--tp-blue);
  border-radius: 0;
  padding-left: 0.25rem;
}

.tp-signature-card input[name="typed_name"]:focus {
  box-shadow: none;
  border-bottom-color: var(--tp-navy);
}

.tp-signature-pad-wrap {
  margin-bottom: 1rem;
}

.tp-signature-pad-canvas {
  display: block;
  width: 100%;
  max-width: 480px;
  height: 160px;
  border: 2px dashed #c3cddb;
  border-radius: 10px;
  background: #fff;
  touch-action: none;
  cursor: crosshair;
}

.tp-signature-pad-canvas.has-ink {
  border-style: solid;
  border-color: var(--tp-blue);
}

.tp-signature-pad-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.tp-signature-pad-hint {
  color: var(--tp-gray);
  font-size: 0.78rem;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 991.98px) {

  .tp-sidebar {
    min-height: auto;
  }

  .tp-content {
    padding: 1.25rem;
  }

}


/* =========================================================
   MOBILE PORTAL
========================================================= */

@media (max-width: 767.98px) {

  body {
    overflow-x: hidden;
  }


  /* -------------------------------------------------------
     CONTENT
  ------------------------------------------------------- */

  .tp-content {
    width: 100%;
    max-width: 100%;
    padding: 14px !important;
  }

  .tp-content > h1,
  .tp-content > h2,
  .tp-content > h3 {
    font-size: 1.5rem !important;
    line-height: 1.2;
    margin-top: 6px;
    margin-bottom: 18px;
  }

  .tp-content h4,
  .tp-content h5 {
    margin-bottom: 12px;
  }


  /* -------------------------------------------------------
     SEARCH
  ------------------------------------------------------- */

  .tp-admin-search-wrap {
    width: 100% !important;
  }

  #globalSearch {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 48px;
    padding: 10px 14px;
    font-size: 16px;
    border-radius: 12px;
  }


  /* -------------------------------------------------------
     DASHBOARD STATS

     IMPORTANT:
     dashboard.php must use:

     <div class="row g-3 mb-4 tp-dashboard-stats">
  ------------------------------------------------------- */

  .tp-dashboard-stats {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .tp-dashboard-stats > div {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .tp-dashboard-stats .tp-stat-card {
    width: 100% !important;
    min-height: 115px !important;
    height: 100% !important;
    padding: 16px !important;
    margin: 0 !important;
    border-radius: 16px !important;

    display: flex !important;
    flex-direction: column;
    justify-content: center;
  }

  .tp-dashboard-stats .stat-value {
    font-size: 1.8rem !important;
    line-height: 1 !important;
    margin-bottom: 8px !important;
  }

  .tp-dashboard-stats .stat-label {
    font-size: 0.86rem !important;
    line-height: 1.25 !important;
  }


  /* -------------------------------------------------------
     CARDS
  ------------------------------------------------------- */

  .tp-card {
    width: 100%;
    max-width: 100%;
    height: auto;
    padding: 15px !important;
    border-radius: 16px !important;
  }

  .tp-card:hover {
    transform: none;
  }

  .tp-form-card {
    width: 100%;
    max-width: 100%;
    padding: 16px !important;
    border-radius: 16px !important;
  }


  /* -------------------------------------------------------
     TABLES
  ------------------------------------------------------- */

  .table-responsive {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .table-tp {
    min-width: 650px;
    font-size: 0.87rem;
    margin-bottom: 0;
  }

  .table-tp th,
  .table-tp td {
    padding: 10px 11px !important;
    white-space: nowrap;
    vertical-align: middle;
  }

  .badge {
    white-space: nowrap;
  }


  /* -------------------------------------------------------
     PROFILE TABS
  ------------------------------------------------------- */

  .nav-tabs {
    display: flex;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 5px;
  }

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

  .nav-tabs .nav-item {
    flex: 0 0 auto;
  }

  .nav-tabs .nav-link {
    white-space: nowrap;
    padding: 9px 12px;
  }


  /* -------------------------------------------------------
     FORMS
  ------------------------------------------------------- */

  .form-control,
  .form-select {
    width: 100%;
    max-width: 100%;
    font-size: 16px;
    min-height: 44px;
  }

  textarea.form-control {
    min-height: 90px;
  }


  /* -------------------------------------------------------
     BUTTONS
  ------------------------------------------------------- */

  .btn {
    min-height: 42px;
  }

  .btn-sm {
    min-height: 36px;
  }

  .d-flex.justify-content-between.align-items-center {
    gap: 10px;
  }


  /* -------------------------------------------------------
     MODALS
  ------------------------------------------------------- */

  .modal-dialog,
  .modal-dialog.modal-lg,
  .modal-dialog.modal-xl {
    margin: 8px !important;
    max-width: calc(100% - 16px) !important;
  }

  .modal-content {
    border-radius: 18px !important;
    max-height: calc(100vh - 16px);
  }

  .modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-footer {
    gap: 8px;
    flex-wrap: wrap;
  }

  .modal-footer .btn {
    flex: 1 1 auto;
  }


  /* -------------------------------------------------------
     DRIVER APPLICATION
  ------------------------------------------------------- */

  .tp-app-stepper {
    padding-bottom: 0.75rem;
  }

  .tp-app-step .tp-app-step-link {
    padding: 0.35rem 0.7rem 0.35rem 0.35rem;
    font-size: 0.78rem;
  }

  .tp-app-progress-wrap {
    min-width: 0;
    width: 100%;
  }

  .tp-app-progress-summary {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
  }

  .tp-app-section-icon {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }

  .tp-signature-pad-canvas {
    max-width: 100%;
    height: 140px;
  }


  /* -------------------------------------------------------
     PUBLIC HERO
  ------------------------------------------------------- */

  .tp-hero {
    padding: 3rem 0 3.5rem;
  }

  .tp-hero h1 {
    font-size: 2rem;
  }

}


/* =========================================================
   VERY SMALL PHONES
========================================================= */

@media (max-width: 350px) {

  .tp-dashboard-stats {
    grid-template-columns: 1fr !important;
  }

  .tp-content {
    padding: 10px !important;
  }

}


/* =========================================================
   PRINT
========================================================= */

@media print {

  .tp-sidebar,
  .tp-skip-link,
  .btn,
  .modal,
  .no-print,
  nav.pagination,
  form:not(.print-form) {
    display: none !important;
  }

  .tp-content {
    padding: 0 !important;
  }

  .col-lg-10,
  .col-md-9 {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }

  body {
    background: #fff !important;
  }

  .tp-card,
  .tp-form-card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }

}
/* =========================================================
   SHARED PORTAL MOBILE SHELL
   Admin + Employer + Driver
========================================================= */

:root {
  --tp-mobile-header-height: 64px;
}

.tp-mobile-header,
.tp-sidebar-overlay {
  display: none;
}

@media (max-width: 991.98px) {
  .tp-portal {
    overflow-x: hidden;
  }

  .tp-portal > .container-fluid {
    padding-left: 0;
    padding-right: 0;
  }

  .tp-portal > .container-fluid > .row {
    margin-left: 0;
    margin-right: 0;
  }

  .tp-mobile-header {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 1040;
    min-height: var(--tp-mobile-header-height);
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    background: #12345f;
    color: #fff;
    box-shadow: 0 2px 12px rgba(6, 26, 51, .18);
  }

  .tp-mobile-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-width: 0;
    flex: 1 1 auto;
    font-size: 1.05rem;
    font-weight: 700;
  }

  .tp-mobile-brand span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tp-mobile-menu-btn {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 1.25rem;
  }

  .tp-mobile-user {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .13);
    color: #fff;
    font-weight: 800;
  }

  .tp-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1060;
    width: 286px !important;
    max-width: 86vw;
    min-height: 100vh !important;
    padding-top: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    transform: translateX(-105%);
    transition: transform .24s ease;
    box-shadow: 10px 0 32px rgba(0, 0, 0, .22);
  }

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

  .tp-sidebar .brand {
    min-height: var(--tp-mobile-header-height);
    display: flex;
    align-items: center;
    margin-bottom: .55rem;
    padding: 0 1.25rem;
  }

  .tp-sidebar a {
    min-height: 48px;
    display: flex;
    align-items: center;
    margin: .12rem .75rem;
    padding: .72rem 1rem;
    font-size: .98rem;
  }

  .tp-sidebar a .badge {
    margin-left: auto;
  }

  .tp-sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(5, 18, 38, .48);
    backdrop-filter: blur(2px);
  }

  .tp-sidebar-overlay.show {
    display: block;
  }

  .tp-portal main {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .tp-portal-page-header {
    width: 100%;
    margin-bottom: 16px !important;
  }

  .tp-portal-page-header > h5 {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tp-desktop-user {
    display: none;
  }

  .tp-portal-search-wrap,
  .tp-admin-search-wrap {
    width: 100%;
  }
}

/* =========================================================
   PORTAL MOBILE CONTENT + CARD TABLES
========================================================= */

@media (max-width: 767.98px) {
  .tp-portal .tp-content {
    padding: 14px !important;
  }

  .tp-portal .tp-card,
  .tp-portal .tp-form-card {
    padding: 15px !important;
    border-radius: 16px !important;
  }

  .tp-portal .tp-card:hover {
    transform: none;
  }

  .tp-portal .tp-dashboard-stats {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .tp-portal .tp-dashboard-stats > [class*="col"] {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .tp-portal .tp-dashboard-stats .tp-stat-card {
    min-height: 114px !important;
    height: 100% !important;
    padding: 15px !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .tp-portal .tp-dashboard-stats .stat-value {
    font-size: 1.75rem !important;
    line-height: 1;
    margin-bottom: 8px;
  }

  .tp-portal .tp-dashboard-stats .stat-label {
    font-size: .84rem !important;
    line-height: 1.25;
  }

  .tp-portal .nav-tabs {
    display: flex;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    gap: 4px;
    padding-bottom: 5px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .tp-portal .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .tp-portal .nav-tabs .nav-item {
    flex: 0 0 auto;
  }

  .tp-portal .nav-tabs .nav-link {
    white-space: nowrap;
    padding: 9px 12px;
  }

  .tp-portal .form-control,
  .tp-portal .form-select {
    min-height: 44px;
    font-size: 16px;
  }

  .tp-portal textarea.form-control {
    min-height: 96px;
  }

  .tp-portal .btn {
    min-height: 42px;
  }

  .tp-portal .btn-sm {
    min-height: 36px;
  }

  .tp-portal .modal-dialog,
  .tp-portal .modal-dialog.modal-lg,
  .tp-portal .modal-dialog.modal-xl {
    margin: 8px !important;
    max-width: calc(100% - 16px) !important;
  }

  .tp-portal .modal-content {
    max-height: calc(100dvh - 16px);
    border-radius: 18px !important;
  }

  .tp-portal .modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tp-portal .modal-footer {
    gap: 8px;
    flex-wrap: wrap;
  }

  .tp-portal .modal-footer .btn {
    flex: 1 1 auto;
  }

  /* Tables are transformed into labeled cards by assets/js/script.js. */
  .tp-portal .table-responsive {
    max-width: 100%;
  }

  .tp-portal .tp-mobile-card-table {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0;
  }

  .tp-portal .tp-mobile-card-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .tp-portal .tp-mobile-card-table tbody {
    display: block;
  }

  .tp-portal .tp-mobile-card-table tbody tr {
    display: block;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e8edf4;
    border-radius: 14px;
    box-shadow: 0 3px 12px rgba(11, 37, 69, .05);
  }

  .tp-portal .tp-mobile-card-table tbody tr:last-child {
    margin-bottom: 0;
  }

  .tp-portal .tp-mobile-card-table tbody td {
    display: grid;
    grid-template-columns: minmax(105px, 36%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    width: 100% !important;
    padding: 9px 0 !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
    border: 0;
    border-bottom: 1px solid #eef1f6;
    text-align: left !important;
  }

  .tp-portal .tp-mobile-card-table tbody td:last-child {
    border-bottom: 0;
  }

  .tp-portal .tp-mobile-card-table tbody td::before {
    content: attr(data-label);
    color: #6c7a89;
    font-size: .76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .02em;
  }

  .tp-portal .tp-mobile-card-table tbody td[colspan] {
    display: block;
    color: #6c7a89;
  }

  .tp-portal .tp-mobile-card-table tbody td[colspan]::before {
    display: none;
  }

  .tp-portal .tp-mobile-card-table td .btn,
  .tp-portal .tp-mobile-card-table td form,
  .tp-portal .tp-mobile-card-table td .d-flex {
    max-width: 100%;
  }

  .tp-portal .tp-mobile-card-table td .d-flex {
    flex-wrap: wrap;
  }

  .tp-portal .tp-mobile-card-table td .form-select,
  .tp-portal .tp-mobile-card-table td .form-control {
    width: 100%;
  }
}

@media (max-width: 350px) {
  .tp-portal .tp-dashboard-stats {
    grid-template-columns: 1fr !important;
  }
}

/* Portal detail helpers */
.tp-employer-summary-side {
  min-width: 220px;
}

.tp-activity-time {
  width: 150px;
}

@media (max-width: 767.98px) {
  .tp-employer-summary-side {
    width: 100%;
    min-width: 0;
    text-align: left !important;
  }

  .tp-activity-row {
    flex-direction: column;
    gap: 2px !important;
  }

  .tp-activity-time {
    width: auto;
  }
  /* Mobile hamburger menu - make lines clearly visible */
.tp-navbar .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.45);
}

.tp-navbar .navbar-toggler-icon {
    filter: brightness(0) invert(1);
}

.tp-navbar .navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.20);
}
}
/* Mobile navigation visibility enhancement */
@media (max-width: 991.98px) {
  .tp-navbar .navbar-toggler { border: 2px solid rgba(255,255,255,.85) !important; background: rgba(255,255,255,.08); }
  .tp-navbar .navbar-toggler-icon { filter: brightness(0) invert(1) !important; opacity: 1 !important; }
}
