/* ==========================================================================
   eShipRate admin - design layer (2026-11-26). Cosmetic only.
   Brand: navy #0a1f3d, blue #1667c4, orange #f7851b. Montserrat + Inter.
   ========================================================================== */

:root,
[data-bs-theme=light] {
  --esr-navy: #0a1f3d;
  --esr-navy-2: #12305a;
  --esr-blue: #1667c4;
  --esr-blue-dark: #0f55a6;
  --esr-blue-soft: #e8f1fc;
  --esr-orange: #f7851b;
  --esr-orange-dark: #db6f0a;
  --esr-orange-soft: #fff1e3;
  --esr-bg: #f3f5f9;
  --esr-card: #ffffff;
  --esr-line: #e3e8ef;
  --esr-line-2: #eef1f5;
  --esr-text: #1d2939;
  --esr-muted: #667085;
  --esr-green: #12a150;
  --esr-red: #d92d20;
  --esr-radius: 14px;
  --esr-radius-sm: 10px;
  --esr-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 18px rgba(16, 24, 40, .06);
  --esr-sidebar-w: 256px;
  --esr-topbar-h: 64px;
  --esr-head-font: "Montserrat", "Inter", system-ui, sans-serif;
  --esr-body-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Re-point Bootstrap's own tokens at the brand so stock components follow. */
  --bs-font-sans-serif: var(--esr-body-font);
  --bs-body-font-family: var(--esr-body-font);
  --bs-body-font-size: .9375rem;
  --bs-body-color: var(--esr-text);
  --bs-body-color-rgb: 29, 41, 57;
  --bs-secondary-color: var(--esr-muted);
  --bs-border-color: var(--esr-line);
  --bs-border-radius: var(--esr-radius-sm);
  --bs-link-color: var(--esr-blue);
  --bs-link-color-rgb: 22, 103, 196;
  --bs-link-hover-color: var(--esr-blue-dark);
  --bs-link-hover-color-rgb: 15, 85, 166;
  --bs-primary: #1667c4;
  --bs-primary-rgb: 22, 103, 196;
  --bs-success: #12a150;
  --bs-success-rgb: 18, 161, 80;
  --bs-warning: #f7851b;
  --bs-warning-rgb: 247, 133, 27;
  --bs-danger: #d92d20;
  --bs-danger-rgb: 217, 45, 32;
  --bs-info: #1e90c8;
  --bs-info-rgb: 30, 144, 200;
  --bs-dark: #0a1f3d;
  --bs-dark-rgb: 10, 31, 61;
  --bs-light: #f5f7fb;
  --bs-light-rgb: 245, 247, 251;
}

/* ---------- Base ---------- */
html { -webkit-text-size-adjust: 100%; }
body.esr-admin {
  font-family: var(--esr-body-font);
  font-size: .9375rem;
  color: var(--esr-text);
  background: var(--esr-bg);
  overflow-x: hidden;
}
body.esr-admin h1, body.esr-admin h2, body.esr-admin h3,
body.esr-admin h4, body.esr-admin h5, body.esr-admin h6,
body.esr-admin .h1, body.esr-admin .h2, body.esr-admin .h3,
body.esr-admin .h4, body.esr-admin .h5, body.esr-admin .h6 {
  font-family: var(--esr-head-font);
  font-weight: 700;
  color: var(--esr-navy);
  letter-spacing: -.01em;
}
body.esr-admin h4, body.esr-admin .h4 { font-size: 1.15rem; }
body.esr-admin h5, body.esr-admin .h5 { font-size: 1.05rem; }
body.esr-admin a { text-underline-offset: 2px; }
body.esr-admin .text-dark { color: var(--esr-navy) !important; }
body.esr-admin .text-muted { color: var(--esr-muted) !important; }
body.esr-admin .text-primary { color: var(--esr-blue) !important; }
body.esr-admin .bg-primary { background-color: var(--esr-blue) !important; }
body.esr-admin .bg-light { background-color: #f7f9fc !important; }
body.esr-admin hr { border-color: var(--esr-line); opacity: 1; }
body.esr-admin img, body.esr-admin iframe, body.esr-admin video { max-width: 100%; }

/* ---------- Layout shell ---------- */
#wrapper { display: block; min-height: 100vh; }

#sidebarContainer {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--esr-sidebar-w);
  height: 100vh;
  height: 100dvh;
  z-index: 1051;
  background: var(--esr-navy);
  background: linear-gradient(180deg, #0c2547 0%, var(--esr-navy) 55%, #081830 100%);
  box-shadow: 1px 0 0 rgba(255, 255, 255, .04);
  overflow-y: auto;
  overscroll-behavior: contain;
  transition: transform .28s cubic-bezier(.4, 0, .2, 1);
}
.esr-sidebar { display: flex; flex-direction: column; min-height: 100%; padding-bottom: 18px; }

.esr-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  margin-bottom: 10px;
}
.esr-brand-link { display: block; padding: 0 !important; line-height: 0; }
.esr-brand-link img { width: 178px; height: auto; max-width: 100%; }

.esr-sidebar-close {
  display: none;
  border: 0;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  width: 40px; height: 40px;
  border-radius: 10px;
  font-size: 1.15rem;
  flex: 0 0 auto;
}
.esr-sidebar-close:hover { background: rgba(255, 255, 255, .16); }

.esr-nav { list-style: none; margin: 0; padding: 0 10px; flex-direction: column; }
.esr-nav .nav-item { margin: 1px 0; }
.sidebar .esr-nav .nav-item .nav-link {
  display: flex;
  width: 100%;
  text-align: left;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  border-radius: 10px;
  color: rgba(255, 255, 255, .78);
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.25;
  text-decoration: none;
  position: relative;
  transition: background .15s, color .15s;
}
.sidebar .esr-nav .nav-item .nav-link i {
  margin: 0;
  width: 20px;
  flex: 0 0 20px;
  text-align: center;
  font-size: .95rem;
  color: rgba(255, 255, 255, .55);
  transition: color .15s;
}
.sidebar .esr-nav .nav-item .nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar .esr-nav .nav-item .nav-link:hover i { color: #fff; }
.sidebar .esr-nav .nav-item .nav-link.active {
  background: rgba(22, 103, 196, .28);
  color: #fff;
  font-weight: 600;
}
.sidebar .esr-nav .nav-item .nav-link.active i { color: var(--esr-orange); }
.sidebar .esr-nav .nav-item .nav-link.active::before {
  content: "";
  position: absolute;
  left: -10px; top: 8px; bottom: 8px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--esr-orange);
}
.esr-nav .esr-nav-sep { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .08); }

#sidebarOverlay {
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: rgba(6, 18, 36, .55);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s;
}

#wrapper #content-wrapper { margin-left: var(--esr-sidebar-w); width: auto !important; min-height: 100vh; background: var(--esr-bg); min-width: 0; overflow-x: visible; }
#content { flex: 1 0 auto; min-width: 0; padding-bottom: 32px; }

/* Top bar */
.esr-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--esr-topbar-h);
  padding: 0 28px;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--esr-line);
}
.esr-page-title {
  margin: 0;
  font-family: var(--esr-head-font);
  font-size: 1.25rem !important;
  font-weight: 700;
  color: var(--esr-navy) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}
.esr-hamburger {
  display: none;
  border: 1px solid var(--esr-line);
  background: #fff;
  color: var(--esr-navy);
  width: 42px; height: 42px;
  border-radius: 10px;
  font-size: 1.1rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
}
.esr-hamburger:hover { background: var(--esr-blue-soft); }
#mobilelogo { display: none; width: 32px; height: 32px; flex: 0 0 auto; }

.esr-staging-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--esr-orange-soft);
  color: #a64b00;
  border: 1px solid #fbd3ad;
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
}
.esr-staging-badge i { color: var(--esr-orange); }
.esr-badge-short { display: none; }

/* Page content gutters */
#content > .container,
#content > .container-fluid,
#content > div:not(.esr-topbar):not(.modal) {
  padding-left: 28px;
  padding-right: 28px;
}
#content > .container { max-width: 1240px; margin-left: 0; }
#content .container { max-width: 1240px; }
#content > .container.my-5, #content > .container-fluid.my-5 { margin-top: 0 !important; }
#content > .container.my-4 { margin-top: 0 !important; }

/* Footer + scroll-to-top */
.esr-footer {
  background: transparent !important;
  padding: 22px 0 26px;
  color: var(--esr-muted);
  font-size: .8rem;
}
body.esr-admin > #wrapper > .esr-footer,
body.esr-admin > .esr-footer { margin-left: var(--esr-sidebar-w); }
#content-wrapper .esr-footer { margin-left: 0 !important; }
.esr-footer .copyright { font-size: .8rem; }
.scroll-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 42px; height: 42px;
  display: none !important;
  align-items: center;
  justify-content: center;
  border-radius: 12px !important;
  background: var(--esr-navy) !important;
  color: #fff !important;
  border: 0 !important;
  box-shadow: var(--esr-shadow);
  z-index: 1020;
  opacity: .85;
}
.scroll-to-top[style*="block"] { display: flex !important; }
.scroll-to-top:hover { opacity: 1; }

/* ---------- Desktop / phone switch (sidebar slides in below 992px) ---------- */
@media (min-width: 992px) {
  #sidebarContainer { transform: none !important; }
  #sidebarOverlay { display: none !important; }
}
@media (max-width: 991.98px) {
  #sidebarContainer {
    width: min(300px, 86vw);
    transform: translateX(-105%);
    box-shadow: 8px 0 30px rgba(0, 0, 0, .25);
  }
  #sidebarContainer.active { transform: translateX(0); }
  #sidebarOverlay.active { opacity: 1; pointer-events: auto; }
  .esr-sidebar-close { display: inline-flex; align-items: center; justify-content: center; }
  .sidebar .esr-nav .nav-item .nav-link { padding: 13px 12px; font-size: .95rem; }
  #wrapper #content-wrapper { margin-left: 0; }
  body.esr-admin > #wrapper > .esr-footer, body.esr-admin > .esr-footer { margin-left: 0; }
  .esr-hamburger { display: inline-flex; }
  #hamburgerBtn.hide-when-menu { display: inline-flex !important; visibility: hidden; }
  #mobilelogo { display: block; }
  .esr-topbar { padding: 0 14px; gap: 10px; height: 60px; margin-bottom: 16px; }
  .esr-page-title { font-size: 1.05rem !important; }
  #content > .container,
  #content > .container-fluid,
  #content > div:not(.esr-topbar):not(.modal) { padding-left: 14px; padding-right: 14px; }
}
@media (max-width: 575.98px) {
  .esr-badge-long { display: none; }
  .esr-badge-short { display: inline; }
  .esr-staging-badge { padding: 5px 9px; font-size: .72rem; }
  #mobilelogo { display: none; }
}

/* Login / forgot / reset: no sidebar */
body.esr-loginpage #sidebarContainer,
body.esr-loginpage #sidebarOverlay,
body.esr-loginpage .esr-hamburger { display: none !important; }
body.esr-loginpage #content-wrapper,
body.esr-loginpage .esr-footer { margin-left: 0 !important; }
body.esr-loginpage #mobilelogo { display: block; }
body.esr-loginpage #content > .container { margin-left: auto !important; margin-right: auto !important; } /* login box centered (no sidebar on this page) */
/* login page: full logo in the card; no small icon / "Login" title in the top bar (2026-11-26) */
body.esr-loginpage #mobilelogo, body.esr-loginpage .esr-page-title { display: none !important; }
body.esr-loginpage .esr-topbar { justify-content: flex-end; }
.esr-login-logo { width: 100%; max-width: 280px; height: auto; display: inline-block; }
.esr-login-title { font-size: 1.15rem; font-weight: 600; color: #4a5568; }

/* ---------- Cards & panels ---------- */
body.esr-admin .card {
  border: 1px solid var(--esr-line);
  border-radius: var(--esr-radius);
  box-shadow: var(--esr-shadow);
  background: var(--esr-card);
  overflow: visible;
}
body.esr-admin .card-header {
  background: #fff !important;
  border-bottom: 1px solid var(--esr-line-2);
  padding: 16px 20px;
  border-radius: var(--esr-radius) var(--esr-radius) 0 0 !important;
}
body.esr-admin .card-header h4, body.esr-admin .card-header h5 { font-size: 1.05rem; margin: 0; }
body.esr-admin .card-body { padding: 20px; }
body.esr-admin .card-footer { background: #fafbfd; border-top: 1px solid var(--esr-line-2); border-radius: 0 0 var(--esr-radius) var(--esr-radius); }
body.esr-admin .card .card { box-shadow: none; }
body.esr-admin .border:not(.btn):not(.form-control):not(.form-select) { border-color: var(--esr-line) !important; }
body.esr-admin .rounded { border-radius: var(--esr-radius-sm) !important; }
body.esr-admin .shadow { box-shadow: var(--esr-shadow) !important; }

/* Legacy "truckswrap" panels (used by notices + video block) */
body.esr-admin .truckswrap {
  background: #fff;
  border: 1px solid var(--esr-line);
  border-radius: var(--esr-radius);
  box-shadow: var(--esr-shadow);
  padding: 20px 22px;
  color: var(--esr-text);
}
body.esr-admin .twhb { font-size: 1.1rem; margin: 0 0 6px; }
body.esr-admin .twhbm { display: none; }

/* Video tutorial block at the bottom of pages */
body.esr-admin .esr-video {
  margin: 28px 28px 0;
  text-align: center;
  background: #fff;
}
body.esr-admin .esr-video .twhb i { color: #e62117; margin-right: 6px; }
body.esr-admin .esr-video-note { color: var(--esr-muted); font-size: .85rem; max-width: 720px; margin: 0 auto 14px; }
.esr-video-frame {
  max-width: 720px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #0b1424;
}
.esr-video-frame iframe { width: 100%; height: 100%; display: block; border: 0; }
@media (max-width: 991.98px) {
  body.esr-admin .esr-video { margin: 20px 14px 0; padding: 16px; }
}

/* ---------- Buttons ---------- */
body.esr-admin .btn {
  --bs-btn-border-radius: 10px;
  --bs-btn-font-weight: 600;
  --bs-btn-padding-x: 1rem;
  --bs-btn-padding-y: .5rem;
  --bs-btn-font-size: .875rem;
  font-family: var(--esr-body-font);
  letter-spacing: .005em;
  transition: background-color .15s, border-color .15s, box-shadow .15s, transform .05s;
}
body.esr-admin .btn:active { transform: translateY(1px); }
body.esr-admin .btn-sm {
  --bs-btn-padding-x: .8rem;
  --bs-btn-padding-y: .38rem;
  --bs-btn-font-size: .8125rem;
  --bs-btn-border-radius: 9px;
}
body.esr-admin .btn-lg { --bs-btn-padding-y: .7rem; --bs-btn-padding-x: 1.4rem; --bs-btn-font-size: 1rem; }
body.esr-admin .btn-primary {
  --bs-btn-color: #fff;
  --bs-btn-hover-color: #fff;
  --bs-btn-active-color: #fff;
  --bs-btn-bg: var(--esr-blue);
  --bs-btn-border-color: var(--esr-blue);
  --bs-btn-hover-bg: var(--esr-blue-dark);
  --bs-btn-hover-border-color: var(--esr-blue-dark);
  --bs-btn-active-bg: #0c4a91;
  --bs-btn-active-border-color: #0c4a91;
  --bs-btn-disabled-bg: var(--esr-blue);
  --bs-btn-disabled-border-color: var(--esr-blue);
}
body.esr-admin .btn-success {
  --bs-btn-color: #fff;
  --bs-btn-hover-color: #fff;
  --bs-btn-active-color: #fff;
  --bs-btn-bg: var(--esr-green);
  --bs-btn-border-color: var(--esr-green);
  --bs-btn-hover-bg: #0e8743;
  --bs-btn-hover-border-color: #0e8743;
  --bs-btn-active-bg: #0b7339;
  --bs-btn-active-border-color: #0b7339;
}
body.esr-admin .btn-warning {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--esr-orange);
  --bs-btn-border-color: var(--esr-orange);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--esr-orange-dark);
  --bs-btn-hover-border-color: var(--esr-orange-dark);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #c26208;
}
body.esr-admin .btn-danger {
  --bs-btn-color: #fff;
  --bs-btn-hover-color: #fff;
  --bs-btn-active-color: #fff;
  --bs-btn-bg: var(--esr-red);
  --bs-btn-border-color: var(--esr-red);
  --bs-btn-hover-bg: #b42318;
  --bs-btn-hover-border-color: #b42318;
}
body.esr-admin .btn-secondary {
  --bs-btn-color: var(--esr-text);
  --bs-btn-bg: #fff;
  --bs-btn-border-color: #d0d5dd;
  --bs-btn-hover-color: var(--esr-navy);
  --bs-btn-hover-bg: #f2f4f7;
  --bs-btn-hover-border-color: #c2c8d2;
  --bs-btn-active-color: var(--esr-navy);
  --bs-btn-active-bg: #eaecf0;
}
body.esr-admin .btn-outline-primary {
  --bs-btn-color: var(--esr-blue);
  --bs-btn-border-color: #b9d3f2;
  --bs-btn-hover-bg: var(--esr-blue);
  --bs-btn-hover-border-color: var(--esr-blue);
  --bs-btn-active-bg: var(--esr-blue-dark);
}
body.esr-admin .btn-outline-secondary {
  --bs-btn-color: #344054;
  --bs-btn-border-color: #d0d5dd;
  --bs-btn-bg: #fff;
  --bs-btn-hover-color: var(--esr-navy);
  --bs-btn-hover-bg: #f2f4f7;
  --bs-btn-hover-border-color: #c2c8d2;
  --bs-btn-active-color: var(--esr-navy);
  --bs-btn-active-bg: #eaecf0;
}
body.esr-admin .btn-outline-danger { --bs-btn-color: var(--esr-red); --bs-btn-border-color: #f4b8b2; --bs-btn-hover-bg: var(--esr-red); --bs-btn-hover-border-color: var(--esr-red); }
body.esr-admin .btn-link { --bs-btn-color: var(--esr-blue); font-weight: 600; }

/* Legacy pages color "btn-primary" buttons with inline background-color:var(--bs-xxx);
   make those match the solid variants (the inline color itself now comes from the brand tokens). */
body.esr-admin .btn[style*="--bs-success"],
body.esr-admin .btn[style*="--bs-warning"],
body.esr-admin .btn[style*="--bs-danger"] { color: #fff !important; }
body.esr-admin .btn[style*="--bs-success"] { border-color: var(--esr-green) !important; }
body.esr-admin .btn[style*="--bs-warning"] { border-color: var(--esr-orange) !important; }
body.esr-admin .btn[style*="--bs-danger"] { border-color: var(--esr-red) !important; }
body.esr-admin .btn[style*="--bs-success"]:hover { background-color: #0e8743 !important; border-color: #0e8743 !important; }
body.esr-admin .btn[style*="--bs-warning"]:hover { background-color: var(--esr-orange-dark) !important; border-color: var(--esr-orange-dark) !important; }
body.esr-admin .btn[style*="--bs-danger"]:hover { background-color: #b42318 !important; border-color: #b42318 !important; }

/* ---------- Forms ---------- */
body.esr-admin .form-control,
body.esr-admin .form-select {
  border-color: #d0d5dd;
  border-radius: 10px;
  color: var(--esr-text);
  font-size: .9rem;
  padding-top: .5rem;
  padding-bottom: .5rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
body.esr-admin .form-control-sm,
body.esr-admin .form-select-sm { border-radius: 8px; font-size: .8125rem; padding-top: .3rem; padding-bottom: .3rem; }
body.esr-admin .form-control:focus,
body.esr-admin .form-select:focus,
body.esr-admin .form-check-input:focus {
  border-color: #7fb0ea;
  box-shadow: 0 0 0 4px rgba(22, 103, 196, .14);
}
body.esr-admin .form-control::placeholder { color: #98a2b3; }
body.esr-admin .form-control:disabled, body.esr-admin .form-control[readonly] { background-color: #f5f7fa; }
body.esr-admin .form-label,
body.esr-admin label.fw-bold,
body.esr-admin .col-form-label { font-weight: 600; color: #344054; font-size: .875rem; }
body.esr-admin .form-text { color: var(--esr-muted); }
body.esr-admin .form-check-input { border-color: #b4bcc8; }
body.esr-admin .form-check-input:checked { background-color: var(--esr-blue); border-color: var(--esr-blue); }
body.esr-admin .input-group-text { background: #f5f7fa; border-color: #d0d5dd; color: #475467; border-radius: 10px; }
body.esr-admin .form-switch .form-check-input { border-radius: 2em; }
body.esr-admin select[multiple] { border-radius: 10px; }
body.esr-admin option:checked { background-color: #d6e6fa; }

/* ---------- Tables ---------- */
body.esr-admin .table {
  --bs-table-border-color: var(--esr-line-2);
  --bs-table-striped-bg: #f9fafc;
  --bs-table-hover-bg: #f1f6fd;
  font-size: .875rem;
  color: var(--esr-text);
  margin-bottom: 0;
}
body.esr-admin .table > thead > tr > th,
body.esr-admin .table > thead > tr > td {
  background: #f5f7fa;
  color: #475467;
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: .02em;
  text-transform: none;
  border-bottom: 1px solid var(--esr-line);
  white-space: nowrap;
  vertical-align: middle;
}
body.esr-admin .table > tbody > tr:nth-child(even) > * { --bs-table-bg-type: #fafbfd; }
body.esr-admin .table > :not(caption) > * > * { padding: .6rem .75rem; }
body.esr-admin .table-sm > :not(caption) > * > * { padding: .4rem .55rem; }
body.esr-admin .table-bordered > :not(caption) > * > * { border-color: var(--esr-line-2); }
body.esr-admin .table-dark { --bs-table-bg: var(--esr-navy); }

/* Tables live in a rounded "frame" that scrolls sideways when too wide */
body.esr-admin .table-responsive {
  border: 1px solid var(--esr-line);
  border-radius: 12px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}
body.esr-admin .table-responsive > .table { margin-bottom: 0 !important; border: 0 !important; }
body.esr-admin .table-responsive > .table > :not(caption) > tr > :first-child,
body.esr-admin .table-responsive > .table > :not(caption) > * > :first-child { border-left: 0; }
body.esr-admin .table-responsive > .table > :not(caption) > * > :last-child { border-right: 0; }
body.esr-admin .table-responsive > .table > thead > tr:first-child > * { border-top: 0; }
body.esr-admin .table-responsive > .table > tbody > tr:last-child > * { border-bottom: 0; }

/* ---------- Alerts, badges, modals, misc ---------- */
body.esr-admin .alert { border-radius: 12px; border-width: 1px; }
body.esr-admin .alert-warning { background: #fff8ec; border-color: #fde2b8; color: #7a4300; }
body.esr-admin .alert-info { background: #eef6fd; border-color: #cfe3f8; color: #0b3f75; }
body.esr-admin .alert-success { background: #ecfbf2; border-color: #bfe9d0; color: #0b5d30; }
body.esr-admin .alert-danger { background: #fef1f0; border-color: #f8cdc8; color: #8a1c13; }
body.esr-admin .badge { font-weight: 600; border-radius: 7px; }
body.esr-admin .modal-content { border: 0; border-radius: 16px; box-shadow: 0 24px 60px rgba(10, 31, 61, .25); }
body.esr-admin .modal-header { border-bottom-color: var(--esr-line-2); padding: 16px 20px; }
body.esr-admin .modal-footer { border-top-color: var(--esr-line-2); }
body.esr-admin .modal-title { font-family: var(--esr-head-font); font-weight: 700; color: var(--esr-navy); font-size: 1.05rem; }
body.esr-admin .tooltip-inner { border-radius: 8px; background: var(--esr-navy); }
body.esr-admin .nav-tabs .nav-link.active { color: var(--esr-navy); font-weight: 600; }
body.esr-admin .pagination { --bs-pagination-color: var(--esr-blue); --bs-pagination-active-bg: var(--esr-blue); --bs-pagination-active-border-color: var(--esr-blue); --bs-pagination-border-radius: 9px; }

/* ==========================================================================
   Page-specific polish (selectors only; no logic touched)
   ========================================================================== */

/* --- Shipping Methods / Rules --- */
body.esr-admin .methodHolder {
  background: #fff;
  border: 1px solid var(--esr-line) !important;
  border-radius: var(--esr-radius) !important;
  box-shadow: var(--esr-shadow);
  padding-left: 20px;
  padding-right: 20px;
  padding-top: 10px !important;
  max-width: 1240px;
  margin-left: 0;
  transition: height .2s;
}
body.esr-admin .methodHolder > .row { margin-left: -10px; margin-right: -10px; }
body.esr-admin .methodTitles {
  background: var(--esr-navy) !important;
  color: #fff;
  border-radius: 10px;
  padding: 10px 16px !important;
  font-family: var(--esr-head-font);
  font-size: .98rem;
}
body.esr-admin .methodToggle {
  right: 14px !important;
  top: 50% !important;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, .12);
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--esr-body-font);
}
/* rule boxes inside a method */
body.esr-admin .methodHolder .row[style*="#ddd"] {
  background: #f7f9fc !important;
  border: 1px solid var(--esr-line);
  border-radius: 12px !important;
  margin-left: 0;
  margin-right: 0;
}
body.esr-admin .methodHolder .row[style*="#ddd"] h4 { font-size: 1.05rem; }
body.esr-admin .methodHolder .row[style*="#ddd"] .table-responsive { margin: 6px 0 4px; }
#noMethodWarning { line-height: 1.6; }

/* --- Edit Product Data (big spreadsheet table) --- */
body.esr-admin .pd-table-wrap {
  border: 1px solid var(--esr-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--esr-shadow);
  -webkit-overflow-scrolling: touch;
}
body.esr-admin #pdTable { border: 0; }
body.esr-admin #pdTable thead th {
  background: var(--esr-navy);
  color: #fff;
  font-size: .76rem;
  border-color: rgba(255, 255, 255, .08);
}
body.esr-admin #pdTable thead th.sortable:hover { background: var(--esr-navy-2); }
body.esr-admin #pdTable thead tr.filter-row th { background: #f3f5f9; color: var(--esr-text); border-color: var(--esr-line); }
body.esr-admin #pdTable thead th .text-info { color: #8cc4ff !important; }
body.esr-admin #pdTable tbody td { border-color: var(--esr-line-2); }
body.esr-admin #pdTable tbody tr:nth-child(even) > td { background: #fafbfd; }
body.esr-admin #pdTable tbody tr:hover > td { background: #f1f6fd; }
body.esr-admin #pdTable tbody tr.selected-row > td { background-color: #d6e6fa !important; }
body.esr-admin #pdTable tbody td.editable-cell:hover { border-left-color: var(--esr-blue); }
/* first column (checkbox) + Variant ID stay put while scrolling sideways */
body.esr-admin #pdTable > thead > tr > th:first-child,
body.esr-admin #pdTable > tbody > tr > td:first-child {
  position: sticky;
  left: 0;
  z-index: 5;
  background: #fff;
}
body.esr-admin #pdTable > thead > tr > th:nth-child(2),
body.esr-admin #pdTable > tbody > tr > td:nth-child(2) {
  position: sticky;
  left: 31px;
  z-index: 5;
  background: #fff;
  box-shadow: 1px 0 0 var(--esr-line), 4px 0 8px -4px rgba(16, 24, 40, .12);
}
body.esr-admin #pdTable > thead > tr > th:first-child,
body.esr-admin #pdTable > thead > tr > th:nth-child(2) { z-index: 12; background: var(--esr-navy); }
body.esr-admin #pdTable > thead > tr.filter-row > th:first-child,
body.esr-admin #pdTable > thead > tr.filter-row > th:nth-child(2) { z-index: 11; background: #f3f5f9; }
body.esr-admin #pdTable > tbody > tr:nth-child(even) > td:first-child,
body.esr-admin #pdTable > tbody > tr:nth-child(even) > td:nth-child(2) { background: #fafbfd; }
body.esr-admin #pdTable > tbody > tr:hover > td:first-child,
body.esr-admin #pdTable > tbody > tr:hover > td:nth-child(2) { background: #f1f6fd; }
body.esr-admin #pdTable .chk-cell { width: 31px; min-width: 31px; max-width: 31px; }
body.esr-admin .filter-input { border-color: #d0d5dd; border-radius: 6px; padding: 3px 6px; }
body.esr-admin #bulkToolbar {
  left: var(--esr-sidebar-w);
  background: var(--esr-navy);
  flex-wrap: wrap;
  padding: 12px 20px;
  box-shadow: 0 -6px 24px rgba(10, 31, 61, .25);
}
@media (max-width: 991.98px) {
  body.esr-admin #bulkToolbar { left: 0; padding: 10px 14px; gap: 8px; }
  body.esr-admin #bulkToolbar select,
  body.esr-admin #bulkToolbar input[type=text] { max-width: 46vw; }
  body.esr-admin #smartSearch { width: 100% !important; }
  body.esr-admin .search-wrap { flex: 1 1 100%; }
  body.esr-admin .pd-table-wrap { max-height: calc(100vh - 230px); max-height: calc(100dvh - 230px); }
}

/* --- Boxes --- */
body.esr-admin .container-boxes { max-width: 1240px; margin-left: 0; }
body.esr-admin #boxtable td, body.esr-admin #boxtable th { vertical-align: middle; }
body.esr-admin #boxtable td .btn { margin: 2px; }

/* --- Settings / Simulator cards: label rows breathe a little --- */
body.esr-admin .card-body > .mb-3:last-child { margin-bottom: 0 !important; }

/* --- Rate Lookup --- */
body.esr-admin #rlWrap .table-responsive > .table.border { border: 0 !important; }
body.esr-admin #rlWrap .rl-meth.card { border-radius: var(--esr-radius); }

/* ---------- Phone tweaks ---------- */
@media (max-width: 767.98px) {
  body.esr-admin { font-size: .9375rem; }
  /* tap targets */
  body.esr-admin .btn { --bs-btn-padding-y: .6rem; min-height: 42px; }
  body.esr-admin .btn-sm { --bs-btn-padding-y: .5rem; min-height: 38px; }
  body.esr-admin .btn-close { width: 1.25em; height: 1.25em; }
  body.esr-admin .form-control,
  body.esr-admin .form-select { min-height: 44px; font-size: 16px; }
  body.esr-admin .form-control-sm,
  body.esr-admin .form-select-sm { min-height: 38px; font-size: 15px; }
  body.esr-admin .filter-input { min-height: 0; font-size: 13px; }
  body.esr-admin textarea.form-control { min-height: 88px; }
  body.esr-admin .form-check-input { width: 1.25em; height: 1.25em; }
  body.esr-admin .form-check { padding-left: 1.9em; margin-bottom: 6px; }
  body.esr-admin .form-check .form-check-input { margin-left: -1.9em; }
  body.esr-admin .card-body { padding: 16px; }
  body.esr-admin .card-header { padding: 14px 16px; }
  body.esr-admin .truckswrap { padding: 16px; }
  /* method/rule blocks */
  body.esr-admin .methodHolder { padding-left: 12px; padding-right: 12px; margin-left: 0 !important; margin-right: 0 !important; width: 100%; }
  body.esr-admin .methodHolder .btn { margin-bottom: 6px; }
  body.esr-admin .methodHolder .row[style*="#ddd"] { padding-left: 4px; padding-right: 4px; }
  body.esr-admin .methodToggle { right: 10px !important; }
  /* inline fixed widths should never push the page wider than the screen */
  body.esr-admin #content [style*="width:"] { max-width: 100%; }
  body.esr-admin #content [style*="min-width:340px"] { min-width: 0 !important; }
  body.esr-admin .modal-dialog { margin: 12px; }
  body.esr-admin #content > .container,
  body.esr-admin #content > .container-fluid { max-width: 100%; }
  body.esr-admin .d-flex.gap-2 > .btn { flex: 0 0 auto; }
}

/* method cards are direct .container children of #content: give them outer gutters instead of inner */
#content > .container.methodHolder {
  margin-left: 28px;
  margin-right: 28px;
  width: auto;
  padding: 10px 20px 20px;
}
@media (max-width: 991.98px) {
  #content > .container.methodHolder { margin-left: 14px !important; margin-right: 14px !important; width: auto; padding: 10px 12px 14px; }
}

.sidebar .esr-nav .nav-item .nav-link span { display: inline; margin: 0; font-size: inherit; }
.sidebar.esr-sidebar { width: 100% !important; }
.sidebar .esr-nav { width: 100%; }
.sidebar .esr-nav .nav-item { width: 100%; }
.sidebar .esr-nav .nav-item .nav-link { width: 100% !important; }

/* row lines: soft grey everywhere (legacy theme drew near-black lines) */
body.esr-admin .table > :not(caption) > * > * { border-bottom-color: var(--esr-line-2); }
body.esr-admin .table > tbody { border-top-color: var(--esr-line); }
body.esr-admin .table > :not(:first-child) { border-top: 0; }
body.esr-admin .table { --bs-table-bg: #fff; }
body.esr-admin .form-control, body.esr-admin .form-select { background-color: #fff; }
body.esr-admin .form-control:disabled, body.esr-admin .form-select:disabled { background-color: #f2f4f7; }

/* Boxes page */
body.esr-admin #boxtable td:last-child { white-space: nowrap; }
body.esr-admin #boxtable td:last-child .btn { margin: 2px !important; }
body.esr-admin .form-card {
  background: #fff;
  border: 1px solid var(--esr-line);
  border-radius: var(--esr-radius);
  box-shadow: var(--esr-shadow);
}
body.esr-admin .table > :not(caption) > *,
body.esr-admin .table > :not(caption) > * > * { border-color: var(--esr-line-2); }
body.esr-admin .table > thead > tr,
body.esr-admin .table > thead > tr > * { border-color: var(--esr-line); }

/* keep the floating AI button out of the way while the phone menu is open */
body:has(#sidebarContainer.active) #esrfBtn { display: none !important; }
