/* Modern white reskin — layered on top of theme.css, no markup/JS changes required.
   --mt-accent is set per-warehouse at runtime (see partials/head.ejs); this fallback
   only applies if that inline override is missing. */
:root {
  --mt-accent: #4272d7;
  --mt-bg: #f6f7f9;
  --mt-surface: #ffffff;
  --mt-border: #e7e9ee;
  --mt-text: #1f2430;
  --mt-text-muted: #7c8598;
  --mt-radius: 12px;
  --mt-radius-sm: 8px;
  --mt-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --mt-sidebar-width: 220px;
}

/* Fallback for browsers without color-mix() support — solid, slightly less refined,
   but nothing breaks or goes unstyled. */
@supports not (color: color-mix(in srgb, red 10%, transparent)) {
  .navbar-sidebar .navbar__list li a:hover,
  .navbar-sidebar .navbar__list li.active > a {
    background: #eef2fb;
  }

  .overview-box .icon,
  .overview-item--c2 .overview-box .icon {
    background: #eef2fb;
  }

  .form-control:focus {
    box-shadow: 0 0 0 3px #d9e4f8;
  }

  .table-hover tbody tr:hover {
    background: #f7f9fd;
  }

  .au-input:focus,
  .au-input--xl:focus {
    box-shadow: 0 0 0 3px #d9e4f8;
  }

  .table-data2.table tbody tr.tr-shadow:hover {
    background: #f7f9fd;
  }

  .status--process {
    background: #d9f2e6;
  }

  .status--denied {
    background: #fbdada;
  }

  .table-data-feature .item:hover {
    background: #dce6f9;
  }

  .role.admin {
    background: #dce6f9;
  }

  .badge-assign-count {
    background: #dce6f9;
  }

  .filter-locked-badge {
    background: #dce6f9;
  }

  .status--warning {
    background: #fbe7cc;
  }

  .status--info {
    background: #dbe7fc;
  }
}

body,
.form-control,
.btn,
.au-btn {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  color: var(--mt-text);
}

/* ----- Layout ----- */
.page-wrapper,
.page-container,
.page-container2 {
  background: var(--mt-bg);
}

.page-container {
  padding-left: var(--mt-sidebar-width);
}

.header-desktop {
  left: var(--mt-sidebar-width);
}

@media (max-width: 991px) {
  .page-container {
    padding-left: 0;
  }

  .header-desktop {
    left: 0;
  }
}

.title-1,
.title-2,
.title-5 {
  color: var(--mt-text);
  font-weight: 600;
}

/* ----- Sidebar ----- */
.menu-sidebar {
  width: var(--mt-sidebar-width);
  background: var(--mt-surface);
  border-right: 1px solid var(--mt-border);
  box-shadow: none;
}

.menu-sidebar .logo {
  background: var(--mt-surface);
  border-bottom: 1px solid var(--mt-border);
  border-right: none;
  box-shadow: none;
  padding: 0 20px;
}

.navbar-sidebar {
  padding-left: 20px;
  padding-right: 20px;
}

.navbar-sidebar .navbar__list li a {
  color: var(--mt-text);
  border-radius: var(--mt-radius-sm);
  padding: 12px 14px;
  font-size: 15px;
  transition: background-color .15s ease, color .15s ease;
}

.navbar-sidebar .navbar__list li a i {
  width: 20px;
  text-align: center;
  color: var(--mt-text);
  margin-right: 14px;
  transition: color .15s ease;
}

.navbar-sidebar .navbar__list li a:hover,
.navbar-sidebar .navbar__list li.active > a {
  background: color-mix(in srgb, var(--mt-accent) 10%, transparent);
  color: var(--mt-accent);
}

.navbar-sidebar .navbar__list li a:hover i,
.navbar-sidebar .navbar__list li.active > a i {
  color: var(--mt-accent);
}

.menu-sidebar .navbar__list .navbar__sub-list li a {
  font-size: 14px;
  padding: 10px 14px;
}

/* ----- Header ----- */
.header-desktop {
  background: var(--mt-surface);
  border-bottom: 1px solid var(--mt-border);
  box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.1);
}

.header-mobile__bar {
  border-bottom: 1px solid var(--mt-border);
}

.account-item .content a {
  color: var(--mt-text);
  font-weight: 500;
}

/* ----- Cards ----- */
.au-card,
.card {
  background: var(--mt-surface);
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius);
  box-shadow: var(--mt-shadow);
}

.card-header {
  background: var(--mt-surface);
  border-bottom: 1px solid var(--mt-border);
  color: var(--mt-text);
  font-weight: 600;
}

/* ----- Dashboard stat cards ----- */
.overview-item {
  background: var(--mt-surface);
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius);
  box-shadow: var(--mt-shadow);
  background-image: none !important;
}

.overview-box .icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--mt-radius-sm);
  background: color-mix(in srgb, var(--mt-accent) 12%, transparent);
  margin-right: 20px;
}

.overview-box .icon i {
  font-size: 26px;
  color: var(--mt-accent);
}

.overview-item--c1 .overview-box .icon,
.overview-item--c3 .overview-box .icon {
  background: color-mix(in srgb, #ee6c4d 14%, transparent);
}

.overview-item--c1 .overview-box .icon i,
.overview-item--c3 .overview-box .icon i {
  color: #ee6c4d;
}

.overview-item--c2 .overview-box .icon {
  background: color-mix(in srgb, #2a9d8f 14%, transparent);
}

.overview-item--c2 .overview-box .icon i {
  color: #2a9d8f;
}

.overview-box .text h2 {
  color: var(--mt-text);
  font-weight: 700;
}

.overview-box .text span {
  color: var(--mt-text-muted);
}

/* ----- Forms ----- */
.form-control,
select.form-control {
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius-sm);
  background: var(--mt-surface);
  color: var(--mt-text);
}

.form-control:focus {
  border-color: var(--mt-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mt-accent) 15%, transparent);
}

.form-control-label {
  color: var(--mt-text-muted);
  font-weight: 500;
}

/* ----- Buttons ----- */
.au-btn,
.btn {
  border-radius: var(--mt-radius-sm);
  font-weight: 500;
}

/* ----- Tables ----- */
.table thead th {
  background: var(--mt-bg);
  color: var(--mt-text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--mt-border);
}

.table td,
.table th {
  border-color: var(--mt-border);
  vertical-align: middle;
}

.table-hover tbody tr:hover {
  background: color-mix(in srgb, var(--mt-accent) 5%, transparent);
}

/* ----- List pages (package/view, courier/view, etc.) ----- */
.au-input,
.au-input--xl {
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius-sm);
  color: var(--mt-text);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.au-input:focus,
.au-input--xl:focus {
  outline: none;
  border-color: var(--mt-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mt-accent) 15%, transparent);
}

.table-responsive-data2 {
  background: var(--mt-surface);
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius);
  padding: 8px 24px;
}

.table-data2 {
  max-width: none !important;
  width: 100%;
}

.table-data2.table thead th {
  color: var(--mt-text-muted);
  border-bottom: 1px solid var(--mt-border);
  letter-spacing: .03em;
  padding: 12px 10px;
}

.table-data2.table tbody td {
  color: var(--mt-text);
  padding: 12px 10px;
}

.table-data2.table tbody td.desc {
  color: var(--mt-text-muted);
}

.table-data2.table tbody tr.tr-shadow {
  box-shadow: none;
  border-bottom: 1px solid var(--mt-border);
}

.table-data2.table tbody tr.tr-shadow:hover {
  background: color-mix(in srgb, var(--mt-accent) 4%, transparent);
}

.status--process,
.status--denied {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: color-mix(in srgb, #00ad5f 12%, transparent);
}

.status--denied {
  background: color-mix(in srgb, #e5383b 12%, transparent);
}

.status--warning {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #b45309;
  background: color-mix(in srgb, #d97706 14%, transparent);
}

.status--info {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #1d4ed8;
  background: color-mix(in srgb, #2563eb 12%, transparent);
}

.table-data-feature .item {
  background: var(--mt-bg);
  transition: background-color .15s ease;
}

.flagged-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e5383b;
  margin-right: 6px;
}

tr.flagged-row {
  background: color-mix(in srgb, #e5383b 6%, transparent);
}

@supports not (color: color-mix(in srgb, red 10%, transparent)) {
  tr.flagged-row {
    background: #fdf1f1;
  }
}

.table-data-feature .item:hover {
  background: color-mix(in srgb, var(--mt-accent) 15%, transparent);
}

.table-data-feature .item i {
  color: var(--mt-text-muted);
}

.table-data-feature .item:hover i {
  color: var(--mt-accent);
}

.pagination a {
  margin: 0 3px;
  display: inline-block;
}

/* ----- Pagination ----- */
.pagination a {
  border-radius: var(--mt-radius-sm);
}

.pagination a:hover,
.pagination a.active {
  background: var(--mt-accent);
  color: #fff;
  border-color: var(--mt-accent);
}

/* ----- Detail pages (courier details, etc.) ----- */
.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--mt-border);
  box-shadow: var(--mt-shadow);
  display: block;
  margin: 0 auto;
}

.detail-item {
  margin-bottom: 20px;
}

.detail-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--mt-text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.detail-value {
  color: var(--mt-text);
  font-size: 15px;
}

.role.admin {
  background: color-mix(in srgb, var(--mt-accent) 12%, transparent);
  color: var(--mt-accent);
  font-weight: 600;
}

/* ----- Freight mode icons (package list) ----- */
.freight-icon {
  font-size: 18px;
}

.freight-icon--air {
  color: #2f80ed;
}

.freight-icon--sea {
  color: #0f9b8e;
}

.freight-icon--land {
  color: #d97706;
}

/* ----- Details pages (package, collection, shipment) ----- */
.package-details-header,
.details-header-accent {
  border-left: 4px solid var(--mt-accent);
}

.detail-icon {
  color: var(--mt-text-muted);
  margin-right: 8px;
  width: 14px;
  text-align: center;
}

.detail-value .freight-icon,
.detail-value .fa-cube,
.detail-value .fa-box,
.detail-value .fa-shopping-bag,
.detail-value .fa-boxes,
.detail-value .fa-warehouse {
  margin-right: 8px;
}

/* ----- Assign packages to collection (scan page) ----- */
.scan-card {
  position: sticky;
  top: 12px;
  z-index: 2;
  border-color: var(--mt-accent);
}

.scan-input-wrap {
  position: relative;
}

.scan-input-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  color: var(--mt-text-muted);
}

.scan-input {
  padding-left: 42px;
  font-size: 18px;
  height: 52px;
}

.package-list-card .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.badge-assign-count {
  background: color-mix(in srgb, var(--mt-accent) 14%, transparent);
  color: var(--mt-accent);
  font-size: 13px;
  padding: 5px 10px;
  border-radius: 999px;
}

.package-list-body {
  max-height: 65vh;
  overflow-y: auto;
}

.package-list-empty {
  margin: 0;
  padding: 12px 0;
}

.package-group {
  margin-bottom: 20px;
}

.package-group:last-child {
  margin-bottom: 0;
}

.package-group__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--mt-text);
}

.package-group__header--collapsible {
  cursor: pointer;
  padding: 6px 8px;
  margin-left: -8px;
  margin-right: -8px;
  border-radius: var(--mt-radius-sm);
  user-select: none;
}

.package-group__header--collapsible:hover {
  background: var(--mt-bg);
}

.collapse-caret {
  color: var(--mt-text-muted);
  margin-right: 4px;
  transition: transform .15s ease;
}

.package-group__header--collapsible[aria-expanded="true"] .collapse-caret {
  transform: rotate(90deg);
}

.package-group-header-row {
  cursor: pointer;
  background: color-mix(in srgb, var(--mt-accent) 5%, transparent);
}

.package-group-header-row:hover {
  background: color-mix(in srgb, var(--mt-accent) 10%, transparent);
}

@supports not (color: color-mix(in srgb, red 10%, transparent)) {
  .package-group-header-row {
    background: #f6f6f6;
  }
  .package-group-header-row:hover {
    background: #eee;
  }
}

.package-group .list-group-item {
  border-color: var(--mt-border);
}

.package-group .list-group-item:first-child {
  border-top-left-radius: var(--mt-radius-sm);
  border-top-right-radius: var(--mt-radius-sm);
}

.package-group .list-group-item:last-child {
  border-bottom-left-radius: var(--mt-radius-sm);
  border-bottom-right-radius: var(--mt-radius-sm);
}

.package-list-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--mt-border);
  background: var(--mt-bg);
}

.select-all-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--mt-text-muted);
  font-size: 14px;
  cursor: pointer;
}

.package-select-checkbox {
  cursor: pointer;
}

.package-list-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--mt-border);
}

.package-list-filters select,
.package-list-filters input[type="date"] {
  width: auto;
  flex: 1;
}

.filter-locked-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--mt-radius-sm);
  background: color-mix(in srgb, var(--mt-accent) 10%, transparent);
  color: var(--mt-accent);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.collection-summary-bar {
  gap: 8px 28px;
}

.collection-summary-item {
  color: var(--mt-text-muted);
  font-size: 14px;
  white-space: nowrap;
}

.collection-summary-item strong {
  color: var(--mt-text);
  font-weight: 600;
}
