@import url("../vendor/fonts/inter/inter.css");

/* SmartFreight — shared dashboard styles */
:root {
  --sf-primary: #2563eb;
  --sf-primary-soft: #eff6ff;
  --sf-primary-border: #bfdbfe;
  --sf-green: #22c55e;
  --sf-green-soft: #dcfce7;
  --sf-orange: #f97316;
  --sf-orange-soft: #ffedd5;
  --sf-red: #ef4444;
  --sf-red-soft: #fee2e2;
  --sf-indigo: #4f46e5;
  --sf-indigo-soft: #eef2ff;
  --sf-body-bg: #f4f7f6;
  /* ~90% of previous fixed widths — matches “browser zoom 90%” feel at 100% zoom */
  --sf-sidebar-w: 241px;
  --sf-sidebar-collapsed-w: 65px;
  --sf-text: #1e293b;
  --sf-text-secondary: #334155;
  --sf-muted: #64748b;
  --sf-border: #e2e8f0;
  --sf-card-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  --sf-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sf-leading-tight: 1.25;
  --sf-leading-body: 1.55;
  --sf-gutter-x: clamp(1.25rem, 2.5vw, 1.875rem);
  --sf-space-section: 1.35rem;
  --sf-radius-input: 7px;
  --sf-radius-card: 11px;
  --sf-radius-modal: 13px;
}

/* Base rem size: 90% of former 14px → scales Bootstrap + our rem-based spacing (~90% browser zoom) */
html {
  font-size: 12.6px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--sf-font);
  color: var(--sf-text);
  background: var(--sf-body-bg);
  min-height: 100vh;
  line-height: var(--sf-leading-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}

.sf-sidebar {
  width: var(--sf-sidebar-w);
  max-width: min(var(--sf-sidebar-w), 100vw);
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--sf-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1040;
  transition: width 0.2s ease, transform 0.2s ease;
  overflow-x: hidden;
  /* Let footer dropdowns paint outside the sidebar box; nav scroll stays on .sf-sidebar .nav */
  overflow-y: visible;
  box-sizing: border-box;
}

.sf-sidebar.collapsed {
  width: var(--sf-sidebar-collapsed-w);
}

.sf-sidebar.collapsed .sf-brand-text,
.sf-sidebar.collapsed .sf-modules-label,
.sf-sidebar.collapsed .nav-link span,
.sf-sidebar.collapsed .sf-sidebar-user-text,
.sf-sidebar.collapsed .sf-sidebar-user-role,
.sf-sidebar.collapsed .sf-sidebar-footer .sf-btn-logout-text,
.sf-sidebar.collapsed .sf-sidebar-footer .sf-sidebar-role-label,
.sf-sidebar.collapsed .sf-sidebar-user-menu {
  display: none;
}

.sf-sidebar.collapsed .nav-link {
  justify-content: center;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.sf-main {
  flex: 1;
  margin-left: var(--sf-sidebar-w);
  min-width: 0;
  overflow-x: hidden;
  transition: margin-left 0.2s ease;
}

.sf-sidebar.collapsed ~ .sf-main {
  margin-left: var(--sf-sidebar-collapsed-w);
}

.sf-brand {
  padding: 1.35rem 1.15rem;
  border-bottom: 1px solid var(--sf-border);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
  min-width: 0;
}

.sf-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--sf-primary), #1d4ed8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  line-height: 0;
}

.sf-logo img {
  width: 22px;
  height: 22px;
  display: block;
  flex-shrink: 0;
}

.sf-logo--sm {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.sf-logo--sm img {
  width: 18px;
  height: 18px;
}

.sf-brand-text {
  min-width: 0;
  overflow-wrap: break-word;
}

.sf-brand-text strong {
  color: var(--sf-primary);
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.sf-brand-text .small {
  color: var(--sf-muted);
  font-size: 0.75rem;
  line-height: 1.4;
  margin-top: 0.125rem;
}

.sf-modules-label {
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  color: var(--sf-muted);
  padding: 0.875rem 1.15rem 0.4rem;
  font-weight: 600;
  text-transform: uppercase;
}

/* Bootstrap .nav sets flex-wrap: wrap — in a column nav that creates extra side-by-side columns and horizontal overflow. */
.sf-sidebar .nav {
  padding: 0 0.65rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex-wrap: nowrap;
  flex-direction: column;
}

.sf-sidebar .nav-link {
  color: var(--sf-muted);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 500;
  font-size: 0.9375rem;
  line-height: 1.35;
  border-left: 3px solid transparent;
  min-width: 0;
}

.sf-sidebar .nav-link span {
  min-width: 0;
  overflow-wrap: break-word;
}

.sf-sidebar .nav-link i {
  font-size: 1.125rem;
  opacity: 0.92;
  flex-shrink: 0;
}

.sf-sidebar .nav-link:hover {
  background: #f8fafc;
  color: var(--sf-text);
}

.sf-sidebar .nav-link.active {
  background: var(--sf-primary-soft);
  color: var(--sf-primary);
  border-left-color: var(--sf-primary);
}

.sf-sidebar-footer {
  padding: 0.85rem 0.75rem 1rem;
  border-top: 1px solid var(--sf-border);
  font-size: 0.8125rem;
  line-height: 1.45;
  flex-shrink: 0;
  min-width: 0;
  overflow-x: hidden;
  background: #fafafa;
}

.sf-sidebar-user-card {
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius-card);
  padding: 0.75rem 0.65rem;
  background: #fff;
  box-shadow: var(--sf-card-shadow);
}

.sf-sidebar-user-top {
  display: flex;
  align-items: flex-start;
  gap: 0.25rem;
  min-width: 0;
  position: relative;
  z-index: 2;
}

.sf-sidebar-user-main {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}

.sf-sidebar-user-text {
  flex: 1;
  min-width: 0;
}

.sf-sidebar-user-menu {
  flex-shrink: 0;
  margin: -0.2rem -0.15rem 0 0;
}

.sf-sidebar-user-menu-btn {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  line-height: 0;
}

.sf-sidebar-user-menu-btn:hover {
  background: #f1f5f9;
  color: var(--sf-text) !important;
}

.sf-sidebar-user-dropdown {
  min-width: 11rem;
  z-index: 1060;
  max-height: none;
  overflow: visible;
}

.sf-sidebar-user-avatar {
  width: 40px;
  height: 40px;
  font-size: 1.15rem;
}

.sf-sidebar-user-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--sf-text);
  line-height: 1.3;
}

.sf-sidebar-user-email {
  font-size: 0.75rem;
  color: var(--sf-muted);
  line-height: 1.35;
  margin-top: 0.15rem;
}

.sf-sidebar-user-role {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--sf-border);
}

.sf-sidebar-role-label {
  font-size: 0.75rem;
  color: var(--sf-muted);
}

.sf-sidebar-role-badge {
  font-weight: 600;
  max-width: 100%;
}

.sf-sidebar-logout--collapsed-only {
  display: none;
  margin-top: 0.5rem;
}

.sf-sidebar.collapsed .sf-sidebar-logout--collapsed-only {
  display: block;
}

.sf-sidebar-logout--collapsed-only .btn {
  font-weight: 600;
  border-radius: 10px;
}

.sf-sidebar.collapsed .sf-sidebar-footer {
  padding: 0.65rem 0.45rem;
  background: #fff;
}

.sf-sidebar.collapsed .sf-sidebar-user-card {
  padding: 0.5rem 0.35rem;
  border: none;
  box-shadow: none;
  background: transparent;
}

.sf-sidebar.collapsed .sf-sidebar-user-main {
  justify-content: center;
}

.sf-sidebar.collapsed .sf-sidebar-logout {
  margin-top: 0.5rem;
}

.sf-sidebar.collapsed .sf-sidebar-logout .btn {
  width: 2.25rem !important;
  height: 2.25rem;
  min-width: 2.25rem;
  padding: 0;
  border-radius: 8px;
}

/* Main header */
.sf-page-header {
  padding: 1.5rem var(--sf-gutter-x) 0;
}

.sf-page-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.25rem;
}

.sf-page-title {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  min-width: 0;
}

.sf-page-title .icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--sf-primary-soft);
  color: var(--sf-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.sf-page-header h1 {
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: var(--sf-leading-tight);
  margin: 0;
  color: #0f172a;
}

.sf-page-header .subtitle {
  color: var(--sf-muted);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.45;
  margin: 0.35rem 0 0;
  max-width: 40rem;
}

.sf-page-title-row .d-flex.flex-wrap.gap-2 {
  align-items: center;
}

.sf-content {
  padding: 1.35rem var(--sf-gutter-x) 2.5rem;
}

/* Cards */
.sf-card {
  background: #fff;
  border: 1px solid var(--sf-border);
  border-radius: var(--sf-radius-card);
  box-shadow: var(--sf-card-shadow);
  margin-bottom: var(--sf-space-section);
}

.sf-card-header {
  padding: 1.125rem 1.375rem;
  border-bottom: 1px solid var(--sf-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.875rem 1rem;
}

.sf-card-header h5,
.sf-card-header h6 {
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.sf-card-header .small,
.sf-card-header p.small {
  line-height: 1.45;
  margin-top: 0.2rem;
}

.sf-card-body {
  padding: 1.375rem 1.375rem;
}

.sf-card .table {
  margin-bottom: 0;
}

/* Stat cards */
.stat-card {
  border-radius: var(--sf-radius-card);
  border: 1px solid var(--sf-border);
  background: #fff;
  padding: 1.25rem 1.35rem;
  height: 100%;
  box-shadow: var(--sf-card-shadow);
}

.stat-card.highlight-orange {
  border-color: #fdba74;
  background: linear-gradient(180deg, #fff7ed 0%, #fff 100%);
}

.stat-card .stat-value {
  font-size: 1.8125rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.stat-card .stat-label {
  color: var(--sf-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.35;
}

.stat-card .small {
  font-size: 0.75rem;
  line-height: 1.4;
  margin-top: 0.15rem;
}

.stat-card .stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

/* Phase pills */
.badge-phase-l1 {
  background: var(--sf-green-soft);
  color: #166534;
  font-weight: 600;
}
.badge-phase-l2 {
  background: #fef9c3;
  color: #854d0e;
  font-weight: 600;
}
.badge-phase-l3 {
  background: #fce7f3;
  color: #9d174d;
  font-weight: 600;
}

/* VR / vehicle-request pill (My Requests) */
.badge-vr {
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 600;
  font-size: 0.6875rem;
  padding: 0.2em 0.55em;
}

/* Table row accent */
.table-row-accent-green td:first-child {
  box-shadow: inset 4px 0 0 0 var(--sf-green);
}
.table-row-accent-red td:first-child {
  box-shadow: inset 4px 0 0 0 var(--sf-red);
}

.sf-table {
  font-size: 0.9375rem;
}

.sf-table thead th {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sf-muted);
  font-weight: 600;
  border-bottom-width: 1px;
  background: #f8fafc;
  padding: 0.65rem 1rem;
  vertical-align: middle;
  white-space: nowrap;
}

.sf-table tbody td {
  padding: 0.8rem 1rem;
  vertical-align: middle;
  border-bottom-color: #f1f5f9;
}

.sf-table tfoot td,
.sf-table tfoot th {
  padding: 0.85rem 1rem;
  vertical-align: middle;
  font-size: 0.875rem;
}

.sf-table.table-sm thead th,
.sf-table.table-sm tbody td {
  padding: 0.55rem 0.85rem;
}

/* Settings tables: action column shrink-wraps so buttons stay normal btn-sm size in tall inline-edit rows */
.sf-settings-section .sf-table tbody td.sf-settings-actions-col {
  vertical-align: top;
}

/* Inline edit / add row: top-align every cell so #, fields, and actions line up on one row (not middle-floating #) */
.sf-settings-section .sf-table tbody tr.table-warning > td,
.sf-settings-section .sf-table tbody tr[class*="-create-row"] > td {
  vertical-align: top;
}

.sf-settings-section .sf-table tbody td .sf-settings-row-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
}

.sf-settings-section .sf-table tbody td .sf-settings-row-actions > .btn,
.sf-settings-section .sf-table tbody td .sf-settings-row-actions > a.btn {
  flex: 0 0 auto;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  box-sizing: border-box;
}

.sf-settings-section .sf-table tbody td .sf-settings-row-actions > form {
  flex: 0 0 auto;
  align-self: stretch;
}

.sf-settings-section .sf-table tbody td .sf-settings-row-actions > form.d-inline {
  display: inline-flex !important;
  align-items: stretch;
}

.sf-main .table a {
  font-weight: 500;
}

/* Remaining circle badge */
.badge-remaining {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.35rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
  border: 2px solid var(--sf-orange);
  color: var(--sf-orange);
  background: #fff;
}

.badge-confirmed {
  font-weight: 700;
  color: var(--sf-green);
}

/* Filter pills */
.sf-filter-pills.d-flex {
  flex-wrap: wrap;
  gap: 0.35rem;
}

.sf-filter-pills .btn {
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.45rem 1rem;
  line-height: 1.35;
}

.sf-filter-pills .btn.active-open {
  background: var(--sf-green);
  border-color: var(--sf-green);
  color: #fff;
}

.sf-filter-pills .btn.active-accepted {
  background: var(--sf-green);
  border-color: var(--sf-green);
  color: #fff;
}

.sf-filter-pills .btn.active-missed {
  background: var(--sf-orange);
  border-color: var(--sf-orange);
  color: #fff;
}

.sf-filter-pills .btn.active-rejected {
  background: var(--sf-red);
  border-color: var(--sf-red);
  color: #fff;
}

.sf-filter-pills .btn.active-closed {
  background: #64748b;
  border-color: #64748b;
  color: #fff;
}

/* Dispatch: keep Open / Completed / Cancelled on one baseline row (no orphan wrap) */
.sf-dispatch-status-tabs.sf-filter-pills.d-flex {
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 2px;
}
.sf-dispatch-status-tabs .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Dispatch Requests — toolbar + table alignment (reference layout) */
.sf-dispatch-toolbar-second {
  border-color: #e8eef2 !important;
}

#dispatchTable > tbody > tr:not(.detail-row) > td:nth-child(6),
#dispatchTable > tbody > tr:not(.detail-row) > td:nth-child(7),
#dispatchTable > tbody > tr:not(.detail-row) > td:nth-child(8),
#dispatchTable > tbody > tr:not(.detail-row) > td:nth-child(9),
#dispatchTable > tbody > tr:not(.detail-row) > td:nth-child(12),
#dispatchTable > tbody > tr:not(.detail-row) > td:nth-child(13) {
  text-align: center;
}

#dispatchTable > tbody > tr:not(.detail-row) > td:nth-child(2) {
  text-align: left;
}

#dispatchTable .dispatch-dt-cell {
  line-height: 1.35;
  vertical-align: middle;
}

#dispatchTable .sf-req-warning {
  font-size: 0.95rem;
  line-height: 1;
}

.dispatch-time-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}

.dispatch-time-left--ok {
  color: #ea580c;
}
.dispatch-time-left--ok .dispatch-time-inner i {
  opacity: 0.9;
}

.dispatch-time-left--warn {
  color: #ea580c;
}

.dispatch-time-left--critical {
  color: #dc2626;
}

.table-row-accent-green td:first-child,
.table-row-accent-red td:first-child {
  padding-left: calc(1rem + 2px);
}

body[data-page="dispatch"] > .sf-fab {
  bottom: max(5.25rem, calc(1.5rem + env(safe-area-inset-bottom, 0px)));
}

/* Transporters — reference layout (toolbar + list table) */
body[data-page="transporters"] .sf-transporters-page-title .icon-wrap {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid rgba(34, 197, 94, 0.22);
}

.sf-transporters-toolbar-card .input-group-text,
.sf-transporters-toolbar-card .form-control,
.sf-transporters-toolbar-card .form-select {
  border-radius: var(--sf-radius-input);
}

.sf-transporters-toolbar-card .sf-transporters-search .form-control {
  min-height: calc(1.5em + 0.75rem + 2px);
}

.sf-transporters-toolbar-card .sf-transporters-actions .btn-outline-success {
  border-width: 1.5px;
  font-weight: 500;
}

#transportersTable .sf-transporters-col-chevron {
  width: 2.5rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  vertical-align: middle;
}

#transportersTable .sf-transporters-th-email {
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 0.6875rem;
}

#transportersTable .sf-table-sort-btn {
  font-weight: 600;
  color: var(--sf-muted);
}

#transportersTable .sf-table-sort-btn:hover {
  color: var(--sf-text);
}

#transportersTable tbody tr {
  cursor: default;
}

#transportersTable tbody tr a {
  cursor: pointer;
}

#transportersTable .sf-transporters-chevron-cell {
  width: 2.25rem;
  color: #94a3b8;
}

#transportersTable .sf-transporters-chevron-cell i {
  font-size: 1.1rem;
}

#transportersTable .sf-transporter-expand-btn {
  cursor: pointer;
  line-height: 1;
}

#transportersTable tbody tr.detail-row {
  cursor: default;
}

/* Rate cards — route table + nested transporter rates (reference UI) */
body[data-page="rate-cards"] .sf-rate-cards-page-title .icon-wrap {
  background: var(--sf-indigo-soft);
  color: var(--sf-indigo);
  border: 1px solid rgba(79, 70, 229, 0.22);
}

.sf-rate-cards-toolbar-card .input-group-text,
.sf-rate-cards-toolbar-card .form-control,
.sf-rate-cards-toolbar-card .form-select {
  border-radius: var(--sf-radius-input);
}

.sf-rate-cards-toolbar-card .sf-rate-cards-search .form-control {
  min-height: calc(1.5em + 0.75rem + 2px);
}

.sf-rate-cards-toolbar-actions .btn-success {
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(34, 197, 94, 0.2);
}

.sf-btn-rate-upload {
  border-width: 1.5px !important;
  font-weight: 500;
  border-color: #fdba74 !important;
  color: #c2410c !important;
  background: #fff !important;
}

.sf-btn-rate-upload:hover {
  border-color: #f97316 !important;
  color: #9a3412 !important;
  background: #fff7ed !important;
}

.sf-btn-rate-upload i {
  color: #ea580c;
}

.sf-btn-rate-download {
  border-width: 1.5px !important;
  font-weight: 500;
  border-color: #c4b5fd !important;
  color: var(--sf-indigo) !important;
  background: #fff !important;
}

.sf-btn-rate-download:hover {
  border-color: #a78bfa !important;
  color: #4338ca !important;
  background: var(--sf-indigo-soft) !important;
}

.sf-btn-rate-download i {
  color: #6366f1;
}

#rateCardsTable .sf-rate-cards-th-check,
#rateCardsTable .sf-rate-cards-td-check {
  width: 2.5rem;
  padding-left: 1rem;
  padding-right: 0.35rem;
  vertical-align: middle;
}

#rateCardsTable .sf-rate-cards-actions-cell {
  width: 1%;
  white-space: nowrap;
}

#rateCardsTable .sf-rate-cards-th-expand,
#rateCardsTable .sf-rate-cards-td-expand {
  width: 2.35rem;
  padding-left: 0.35rem;
  padding-right: 0.65rem;
  vertical-align: middle;
  text-align: center;
}

#rateCardsTable .sf-rate-cards-td-expand .sf-rate-card-expand-btn {
  line-height: 1;
}

#rateCardsTable .sf-rate-cards-actions-cell .btn:hover {
  background: #f8fafc !important;
}

.sf-rate-card-company-pill {
  display: inline-block;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: var(--sf-primary-soft);
  color: #1d4ed8;
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  border: 1px solid rgba(37, 99, 235, 0.15);
}

.sf-rate-card-transporter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.85rem;
  height: 1.85rem;
  padding: 0 0.4rem;
  border-radius: 50%;
  background: var(--sf-green-soft);
  color: #166534;
  font-weight: 600;
  font-size: 0.8125rem;
}

.sf-rate-card-expand-btn .sf-rate-card-chevron {
  display: inline-block;
  transition: transform 0.2s ease;
  font-size: 1.1rem;
}

.sf-rate-card-expand-btn[aria-expanded="true"] .sf-rate-card-chevron {
  transform: rotate(90deg);
}

.sf-rate-card-nested-wrap {
  margin: 0 0.75rem 1rem;
  padding: 1.1rem 1.15rem 1.2rem;
  background: #eef2f6;
  border-radius: var(--sf-radius-card);
  border: 1px solid #e2e8f0;
}

.sf-rate-card-nested-heading {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--sf-muted);
}

.sf-rate-card-nested-table thead th {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  border-bottom-color: #e2e8f0;
  background: #f8fafc;
}

.sf-rate-card-nested-table tbody td {
  font-size: 0.875rem;
  border-bottom-color: #f1f5f9;
}

.sf-rate-nested-row--l1 td:first-child {
  box-shadow: inset 4px 0 0 0 var(--sf-green);
}

.sf-rate-nested-row--l1 td:first-child,
.sf-rate-nested-row--l2 td:first-child {
  padding-left: calc(0.75rem + 4px);
}

.sf-rate-rank-badge {
  font-weight: 600;
  font-size: 0.7rem;
  padding: 0.35em 0.55em;
  border-radius: 6px;
}

.sf-rate-rank-badge--l1 {
  background: var(--sf-green-soft);
  color: #166534;
}

.sf-rate-rank-badge--l2 {
  background: var(--sf-primary-soft);
  color: #1d4ed8;
}

.sf-rate-rank-badge--l3 {
  background: #f1f5f9;
  color: #475569;
}

.sf-rate-cards-tfoot td {
  background: #f1f5f9 !important;
  border-top: 1px solid var(--sf-border) !important;
  border-bottom: none !important;
  color: var(--sf-text-secondary);
  font-size: 0.875rem;
}

.sf-rate-cards-tfoot td.fw-semibold {
  color: var(--sf-text);
}

.sf-modal-rate-card .modal-content {
  border-radius: var(--sf-radius-modal);
}

.sf-modal-rate-card .modal-header .btn-close {
  margin-top: 0.15rem;
}

.sf-btn-rate-card-primary {
  background: #34d399;
  border: none;
  color: #fff;
  border-radius: var(--sf-radius-input);
}

.sf-btn-rate-card-primary:hover {
  background: #10b981;
  color: #fff;
}

/* Transporters — expanded CONTACTS panel + nested table (reference UI) */
.sf-transporter-detail-panel {
  margin: 0 0.75rem 0.75rem;
  padding: 1rem 1.1rem 1.15rem;
  background: #f1f5f9;
  border-radius: var(--sf-radius-card);
  border: 1px solid #e2e8f0;
}

.sf-transporter-contacts-heading {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sf-muted);
}

.sf-transporter-primary-star {
  color: #eab308;
  font-size: 1rem;
}

.sf-transporter-primary-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #c2410c;
}

.sf-transporter-nested-table-wrap {
  border-color: #e2e8f0 !important;
}

.sf-transporter-nested-table thead th {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sf-muted);
  font-weight: 600;
  white-space: nowrap;
}

.sf-btn-transporter-gold {
  border-width: 1.5px;
  font-weight: 500;
  color: #b45309;
  border-color: #f59e0b;
}

.sf-btn-transporter-gold:hover {
  color: #92400e;
  border-color: #d97706;
  background: #fffbeb;
}

.sf-btn-download-gold {
  border: 1.5px solid #f59e0b;
  color: #b45309;
  background: #fff;
  font-weight: 500;
}

.sf-btn-download-gold:hover {
  color: #92400e;
  border-color: #d97706;
  background: #fffbeb;
}

.modal-edit-transporter .modal-footer {
  padding: 1rem 1.25rem 1.25rem;
}

/* Request cards (My Requests) — reference layout */
.request-card {
  border: 1px solid var(--sf-border);
  border-radius: 10px;
  background: #fff;
  padding: 0;
  height: 100%;
  position: relative;
  overflow: hidden;
  box-shadow: var(--sf-card-shadow);
}

.request-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent, var(--sf-green));
  z-index: 1;
}

.request-card.status-open {
  --accent: var(--sf-green);
}

.request-card.request-card--expired {
  --accent: var(--sf-red);
}

.request-card.status-accepted {
  --accent: var(--sf-green);
}
.request-card.status-rejected {
  --accent: var(--sf-red);
}
.request-card.status-missed {
  --accent: var(--sf-orange);
}
.request-card.status-closed {
  --accent: #94a3b8;
}

.request-card__banner {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  margin: 0;
  padding: 0.4rem 1rem 0.4rem 1.15rem;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.35;
  border-bottom: 1px solid #fecaca;
}

.request-card__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 1rem 0.95rem 1.15rem;
}

.request-card__main {
  flex: 1;
  min-width: 0;
}

.request-card__route-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.45rem;
}

.request-card__pin {
  color: var(--sf-primary);
  font-size: 1.05rem;
  line-height: 1;
  flex-shrink: 0;
}

.request-card .route {
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.request-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.35rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--sf-muted);
}

.request-card__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.request-card__meta-item i {
  opacity: 0.85;
  font-size: 0.8125rem;
}

.request-card__meta-dot {
  color: #cbd5e1;
  user-select: none;
  font-weight: 500;
}

.request-card__rem-chip {
  display: inline-block;
  background: #fef9c3;
  color: #854d0e;
  font-weight: 700;
  font-size: 0.6875rem;
  padding: 0.08rem 0.4rem;
  border-radius: 4px;
  line-height: 1.3;
}

.request-card__actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.btn-request-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  border-radius: 999px;
  padding: 0.48rem 1.15rem;
  font-weight: 600;
  font-size: 0.8125rem;
  line-height: 1.2;
  color: #fff;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  font-family: inherit;
}

.btn-request-primary--accept {
  background: linear-gradient(180deg, #4ade80 0%, #22c55e 100%);
}

.btn-request-primary--accept:hover {
  color: #fff;
  filter: brightness(1.04);
}

.btn-request-primary--reopen {
  background: linear-gradient(180deg, #fb923c 0%, #ea580c 100%);
}

.btn-request-primary--reopen:hover {
  color: #fff;
  filter: brightness(1.04);
}

.btn-request-dismiss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border-radius: 8px;
  border: 1px solid #fecaca;
  background: #fff;
  color: #dc2626;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}

.btn-request-dismiss:hover {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fca5a5;
}

.btn-request-primary:focus-visible,
.btn-request-dismiss:focus-visible {
  outline: 2px solid var(--sf-primary);
  outline-offset: 2px;
}

@media (max-width: 520px) {
  .request-card__inner {
    flex-direction: column;
    align-items: stretch;
  }

  .request-card__actions {
    justify-content: flex-end;
  }
}

.request-card__status-badge {
  flex-shrink: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Legacy .meta if used outside request-card__meta */
.request-card .meta {
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--sf-muted);
}

/* Reject Request modal (My Requests) */
.modal-reject-request {
  border-radius: 14px;
  overflow: hidden;
}

.modal-reject-request__icon-wrap {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 8px;
  background: #fef2f2;
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.reject-reason-pill {
  border: 1px solid var(--sf-border);
  background: #f8fafc;
  color: var(--sf-text-secondary);
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.reject-reason-pill:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.reject-reason-pill.active {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.reject-reason-pill:focus-visible {
  outline: 2px solid var(--sf-primary);
  outline-offset: 2px;
}

.modal-reject-request__textarea {
  border-radius: 10px;
  border-color: #e2e8f0;
  font-size: 0.875rem;
  resize: vertical;
  min-height: 6.5rem;
}

.modal-reject-request__textarea:focus {
  border-color: var(--sf-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn-reject-submit {
  background: linear-gradient(180deg, #fca5a5 0%, #f87171 100%);
  border: none;
  color: #fff !important;
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(248, 113, 113, 0.35);
  cursor: pointer;
  font-family: inherit;
}

.btn-reject-submit:hover {
  color: #fff !important;
  filter: brightness(1.04);
}

.btn-reject-submit:focus-visible {
  outline: 2px solid #b91c1c;
  outline-offset: 2px;
}

/* Role legend */
.role-legend .legend-item {
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  font-size: 0.8125rem;
  line-height: 1.45;
}
.role-legend .legend-admin {
  background: var(--sf-red-soft);
  color: #991b1b;
}
.role-legend .legend-logistics {
  background: var(--sf-indigo-soft);
  color: #3730a3;
}
.role-legend .legend-ekl {
  background: #fef3c7;
  color: #92400e;
}

.badge-role-transporter {
  background: var(--sf-green-soft);
  color: #166534;
}
.badge-role-logistics {
  background: var(--sf-indigo-soft);
  color: #3730a3;
}
.badge-role-admin {
  background: var(--sf-red-soft);
  color: #991b1b;
}

.badge-role-ekl {
  background: #fef3c7;
  color: #92400e;
}

/* Input with suffix */
.input-with-suffix {
  display: flex;
  align-items: stretch;
}
.input-with-suffix .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.input-with-suffix .suffix {
  border: 1px solid var(--sf-border);
  border-left: 0;
  border-radius: 0 0.375rem 0.375rem 0;
  padding: 0 0.75rem;
  display: flex;
  align-items: center;
  background: #f8fafc;
  color: var(--sf-muted);
  font-size: 0.85rem;
}

/* Optional trailing icon (text/search fields). Never stack on native date/time — browser draws its own control. */
.input-icon-wrap {
  position: relative;
}
.input-icon-wrap .form-control {
  padding-right: 2.25rem;
}
.input-icon-wrap .input-icon {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--sf-muted);
  pointer-events: none;
}
.input-icon-wrap:has(input[type="date"]) .input-icon,
.input-icon-wrap:has(input[type="time"]) .input-icon {
  display: none;
}
.input-icon-wrap:has(input[type="date"]) .form-control,
.input-icon-wrap:has(input[type="time"]) .form-control {
  padding-right: 2.75rem;
}

/* Sidebar menu / collapse toggles — equal footprint, aligned with title */
.sf-sidebar-toggle-group {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
.sf-sidebar-toggle-group .btn {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Chat page: primary UI is already chat — hide redundant FAB */
body[data-page="chat"] > .sf-fab {
  display: none;
}

.surrogate-block-qty {
  -moz-appearance: textfield;
  appearance: textfield;
}
.surrogate-block-qty::-webkit-outer-spin-button,
.surrogate-block-qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Toggle row */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-top: 1px solid var(--sf-border);
  margin-top: 0.5rem;
}

/* FAB */
.sf-fab {
  position: fixed;
  right: max(1.5rem, env(safe-area-inset-right, 0px));
  bottom: max(1.5rem, env(safe-area-inset-bottom, 0px));
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9, var(--sf-primary));
  color: #fff;
  border: none;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  z-index: 1030;
}

.sf-fab:hover {
  color: #fff;
  transform: scale(1.05);
}

/* Nested / expandable row */
.detail-expand {
  background: #f8fafc;
  border-top: 1px dashed var(--sf-border);
  font-size: 0.875rem;
  line-height: 1.5;
}
.detail-expand .toolbar .btn {
  font-size: 0.75rem;
}
.detail-expand .small,
.detail-expand small {
  font-size: 0.8125rem;
}

/* Upload dropzone */
.upload-dropzone {
  border: 2px dashed var(--sf-border);
  border-radius: 12px;
  padding: 2.5rem 1rem;
  text-align: center;
  background: #fafafa;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: var(--sf-green);
  background: #f0fdf4;
}

.sf-upload-dropzone--excel {
  padding: 2.75rem 1.5rem;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.sf-upload-dropzone__icon {
  font-size: 3.25rem;
  line-height: 1;
  opacity: 0.88;
}

/* Dispatch / report modals — reference layout */
.sf-modal-title-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.sf-modal-title-icon--primary {
  background: var(--sf-primary-soft);
  color: var(--sf-primary);
  border: 1px solid var(--sf-primary-border);
}

.sf-modal-title-icon--success {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.sf-date-input-end-icon .form-control {
  border-end-end-radius: 0;
  border-start-end-radius: 0;
}

.sf-date-input-end-icon .input-group-text {
  border-top-right-radius: var(--sf-radius-input);
  border-bottom-right-radius: var(--sf-radius-input);
  pointer-events: none;
}

.sf-date-input-end-icon .form-control:focus {
  z-index: 3;
}

.sf-modal-download-report .modal-footer .btn-outline-secondary {
  font-weight: 500;
}

body[data-page="transporters"] .sf-transporters-actions .btn-success {
  font-weight: 600;
}

/* Chat console */
.chat-console-layout {
  min-height: min(560px, calc(100dvh - 200px));
}

@media (max-width: 991.98px) {
  .chat-console-layout.chat-mobile-thread .chat-console-list-col {
    display: none !important;
  }
  .chat-console-layout:not(.chat-mobile-thread) .chat-console-thread-col {
    display: none !important;
  }
  .chat-console-layout.chat-mobile-thread .chat-thread-panel .chat-thread {
    max-height: calc(100dvh - 240px);
  }
}

.chat-inbox-table td {
  vertical-align: middle;
  font-size: 0.875rem;
}
.chat-inbox-table .chat-vendor-name {
  font-weight: 600;
  color: var(--sf-text);
  line-height: 1.3;
}
.chat-inbox-table .chat-vendor-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--sf-primary-soft);
  color: var(--sf-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.chat-inbox-table tbody tr {
  cursor: pointer;
}
.chat-inbox-table tbody tr.chat-row-active {
  background: #eff6ff !important;
  box-shadow: inset 3px 0 0 var(--sf-primary);
}
.chat-inbox-table .chat-req-link {
  font-weight: 600;
  color: var(--sf-primary);
  text-decoration: none;
}
.chat-inbox-table .chat-req-link:hover {
  text-decoration: underline;
}
.chat-inbox-table .chat-req-route {
  font-size: 0.8125rem;
  color: var(--sf-muted);
  margin-top: 0.15rem;
  line-height: 1.35;
}
.chat-inbox-table .chat-time-cell {
  color: var(--sf-muted);
  font-size: 0.8125rem;
  white-space: nowrap;
}
.chat-inbox-table .chat-time-cell i {
  opacity: 0.7;
}
.badge-chat-open {
  background: #dcfce7;
  color: #166534;
  font-weight: 600;
  padding: 0.35em 0.75em;
}
.badge-chat-await {
  background: #ffedd5;
  color: #9a3412;
  font-weight: 600;
  padding: 0.35em 0.75em;
}

.chat-thread-panel {
  min-height: 420px;
}
.chat-thread-header {
  border-bottom: 1px solid var(--sf-border);
  padding: 1rem 1.25rem;
  background: #fff;
}
.chat-thread-header .chat-back-btn {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}
.chat-thread-header .chat-header-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #ccfbf1;
  color: #0d9488;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.badge-chat-vr {
  background: #ede9fe;
  color: #5b21b6;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.25em 0.55em;
  vertical-align: middle;
}
.chat-thread-header .badge-status-open {
  background: #22c55e;
  color: #fff;
  font-weight: 600;
  padding: 0.4em 0.9em;
  border-radius: 999px;
}

.chat-thread-panel .chat-thread {
  flex: 1 1 auto;
  min-height: 0;
  max-height: calc(100vh - 280px);
  overflow-y: auto;
  padding: 1rem 1.25rem;
  background: #fafafa;
}
.chat-bubble {
  max-width: 85%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  margin-bottom: 0.65rem;
  font-size: 0.9375rem;
  line-height: 1.45;
}
.chat-bubble.them {
  background: #e2e8f0;
  color: var(--sf-text);
}
.chat-bubble.me,
.chat-bubble.chat-bubble-admin {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #fff;
  margin-left: auto;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}
.chat-bubble.chat-bubble-admin .chat-bubble-meta,
.chat-bubble.me .chat-bubble-meta {
  color: rgba(255, 255, 255, 0.85);
}
.chat-bubble-meta {
  font-size: 0.75rem;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.chat-bubble-admin .chat-bubble-meta i {
  font-size: 0.9rem;
}
.chat-bubble-time {
  font-size: 0.7rem;
  opacity: 0.85;
  margin-top: 0.4rem;
}

.chat-reply-bar {
  border-top: 1px solid var(--sf-border);
  padding: 0.85rem 1.25rem;
  background: #fff;
}
.chat-reply-bar .form-control {
  border-radius: 10px;
}
.chat-send-btn {
  background: linear-gradient(135deg, #14b8a6, #0d9488) !important;
  border: none !important;
  color: #fff !important;
  font-weight: 600;
  border-radius: 10px;
  padding: 0.5rem 1.15rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.chat-send-btn:hover {
  color: #fff !important;
  filter: brightness(1.05);
}

/* Mobile sidebar */
@media (max-width: 991.98px) {
  .sf-sidebar {
    transform: translateX(-100%);
  }
  .sf-sidebar.show {
    transform: translateX(0);
  }
  .sf-sidebar .nav {
    overscroll-behavior-y: contain;
  }
  .sf-main {
    margin-left: 0 !important;
  }
  .sf-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 1035;
  }
  .sf-sidebar-overlay.show {
    display: block;
  }
}

/* Code pill orange */
.badge-code {
  background: #fff7ed;
  color: #c2410c;
  font-weight: 600;
}

.badge-capacity {
  background: var(--sf-primary-soft);
  color: var(--sf-primary);
  font-weight: 600;
  border-radius: 999px;
  padding: 0.25em 0.65em;
}

/* Reports cost badge */
.badge-cost {
  background: var(--sf-orange-soft);
  color: #c2410c;
  font-weight: 600;
}
.badge-business {
  background: var(--sf-green-soft);
  color: #166534;
  font-weight: 600;
}

/* Progress bar section */
.phase-progress-bar .progress {
  height: 8px;
  border-radius: 999px;
}

/* —— Auth (login, forgot password) —— */
.sf-auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: max(1.75rem, env(safe-area-inset-top, 0px)) max(1.5rem, env(safe-area-inset-right, 0px))
    max(1.25rem, env(safe-area-inset-bottom, 0px)) max(1.5rem, env(safe-area-inset-left, 0px));
  background: #f4f4f5;
  line-height: var(--sf-leading-body);
}

.sf-auth-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
}

.sf-auth-client-badge {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sf-muted);
  background: #fff;
  border: 1px solid var(--sf-border);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  margin-bottom: 1.25rem;
  text-align: center;
}

.sf-auth-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.75rem;
  text-decoration: none;
  color: inherit;
}

.sf-auth-brand:hover {
  color: inherit;
}

.sf-auth-brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
  color: #0f172a;
}

.sf-auth-brand-sub {
  font-size: 0.8125rem;
  color: var(--sf-muted);
  margin-top: 0.15rem;
}

.sf-auth-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border: 1px solid var(--sf-border);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
  padding: 2.25rem 2rem 2rem;
  box-sizing: border-box;
}

.sf-auth-card h1 {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.3;
  margin-bottom: 0.4rem;
  color: #0f172a;
}

.sf-auth-card-lead {
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--sf-muted) !important;
}

.sf-auth-card > h1 + .sf-auth-card-lead {
  margin-top: 0;
  margin-bottom: 1.25rem !important;
}

.sf-auth-card .form-label.sf-label-caps,
.sf-auth-card label.sf-label-caps {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sf-muted);
  margin-bottom: 0.45rem;
}

.sf-auth-card .form-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--sf-text-secondary);
}

.sf-auth-card .form-control,
.sf-auth-card .form-control-lg {
  border-radius: 10px;
  border-color: #e2e8f0;
}

.sf-auth-card .form-control:focus {
  border-color: var(--sf-primary-border);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.sf-auth-card .form-control[readonly],
.sf-auth-card .form-control-lg[readonly] {
  background-color: #f1f5f9;
  color: #475569;
  cursor: default;
}

.sf-auth-card .form-control[readonly]:focus,
.sf-auth-card .form-control-lg[readonly]:focus {
  border-color: #e2e8f0;
  box-shadow: none;
}

/* Placeholders must read as “hint”, not the same as typed text (Chrome/Safari/Firefox). */
.sf-auth-page .form-control::placeholder,
.sf-auth-page .form-control-lg::placeholder {
  color: #94a3b8;
  opacity: 1;
}

/* Consistent vertical spacing between form fields + submit (login, forgot, reset) */
.sf-auth-card > form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.25rem;
}

.sf-auth-card > form > * {
  margin-bottom: 0 !important;
}

.sf-auth-inner .sf-auth-card .form-control-lg {
  font-size: 0.9375rem;
  line-height: 1.45;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

.sf-auth-inner .sf-auth-card .sf-input-icon-group .sf-input-icon {
  font-size: 0.9375rem;
}

.sf-auth-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}

.sf-auth-label-row .sf-label-caps {
  margin-bottom: 0;
}

.sf-auth-label-row a {
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.sf-auth-label-row a:hover {
  text-decoration: underline;
}

.sf-input-icon-group {
  position: relative;
}

.sf-input-icon-group .sf-input-icon {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 1rem;
  pointer-events: none;
  z-index: 2;
  line-height: 1;
}

.sf-input-icon-group .form-control-lg.sf-input-icon-field {
  padding-left: 2.65rem;
}

/* Password show / hide (eye) — used with .sf-password-wrap */
.sf-password-wrap {
  position: relative;
}

.sf-password-wrap .sf-password-toggle {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  line-height: 1;
  padding: 0.35rem 0.45rem;
  color: #64748b;
  text-decoration: none;
  border: 0;
  border-radius: 6px;
}

.sf-password-wrap .sf-password-toggle:hover,
.sf-password-wrap .sf-password-toggle:focus-visible {
  color: #334155;
  background-color: rgba(148, 163, 184, 0.18);
}

.sf-password-wrap .sf-password-toggle .bi {
  font-size: 1.125rem;
  vertical-align: middle;
}

.sf-input-icon-group.sf-password-wrap .sf-input-icon-field {
  padding-right: 2.85rem;
}

.sf-password-wrap:not(.sf-input-icon-group) .sf-toggle-password-target {
  padding-right: 2.75rem;
}

.sf-btn-auth-cta {
  --sf-cta-from: #6366f1;
  --sf-cta-to: #2563eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.8rem 1.15rem;
  font-size: 1rem;
  font-weight: 600;
  color: #fff !important;
  border: none;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--sf-cta-from) 0%, var(--sf-cta-to) 100%);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  transition: filter 0.15s ease, transform 0.15s ease;
}

.sf-btn-auth-cta:hover {
  filter: brightness(1.06);
  color: #fff !important;
}

.sf-btn-auth-cta:active {
  transform: translateY(1px);
}

.sf-btn-auth-cta .bi {
  font-size: 1.1rem;
  opacity: 0.95;
}

.sf-auth-below-form {
  margin-top: 1.25rem;
  text-align: center;
}

.sf-auth-below-form > .sf-auth-admin-note {
  margin-top: 0;
}

.sf-auth-below-form .sf-auth-back-link {
  margin-top: 0;
}

.sf-auth-admin-note {
  font-size: 0.8125rem;
  color: var(--sf-muted);
  text-align: center;
  margin-top: 0;
  margin-bottom: 0;
  line-height: 1.5;
}

.sf-auth-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--sf-primary);
  text-decoration: none;
}

.sf-auth-back-link:hover {
  text-decoration: underline;
  color: var(--sf-primary);
}

.sf-auth-back-link .bi {
  font-size: 1rem;
}

.sf-auth-powered {
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 400;
  font-family: var(--sf-font);
  color: #5c6b82;
  padding: 0.5rem 0 0;
}

.sf-auth-powered .sf-powered-name,
.sf-auth-powered strong.sf-powered-name {
  font-weight: 600;
  background: linear-gradient(to right, #3b82f6, #8b5cf6, #f97316);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.sf-auth-footer {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--sf-muted);
}

.sf-auth-footer a {
  color: var(--sf-primary);
  font-weight: 500;
}

/* Login + forgot: small font-only nudge to shorten scroll (layout unchanged) */
.sf-auth-inner .sf-auth-client-badge {
  font-size: 0.6rem;
}

.sf-auth-inner .sf-auth-brand-title {
  font-size: 1.125rem;
}

.sf-auth-inner .sf-auth-brand-sub {
  font-size: 0.75rem;
}

.sf-auth-inner .sf-auth-card h1 {
  font-size: 1.25rem;
}

.sf-auth-inner .sf-auth-card-lead {
  font-size: 0.8125rem;
}

.sf-auth-inner .sf-auth-card .form-label.sf-label-caps,
.sf-auth-inner .sf-auth-card label.sf-label-caps {
  font-size: 0.625rem;
}

.sf-auth-inner .sf-auth-card .form-label {
  font-size: 0.75rem;
}

.sf-auth-inner .sf-auth-card .form-control-lg {
  font-size: 0.875rem;
}

.sf-auth-inner .sf-auth-card .sf-input-icon-group .sf-input-icon {
  font-size: 0.875rem;
}

.sf-auth-inner .sf-auth-label-row a {
  font-size: 0.75rem;
}

.sf-auth-inner .sf-btn-auth-cta {
  font-size: 0.9375rem;
}

.sf-auth-inner .sf-btn-auth-cta .bi {
  font-size: 1.05rem;
}

.sf-auth-inner .sf-auth-admin-note {
  font-size: 0.75rem;
}

.sf-auth-inner .sf-auth-back-link {
  font-size: 0.875rem;
}

.sf-auth-inner .sf-auth-back-link .bi {
  font-size: 0.9375rem;
}

.sf-auth-page > .sf-auth-powered {
  font-size: 0.75rem;
}

/* —— Add Transporter modal —— */
.sf-contact-card {
  border-radius: 10px;
  padding: 1rem 1.1rem;
  background: #fff;
  border: 1px solid var(--sf-border);
}

.sf-contact-card--primary {
  border: 2px solid #fb923c;
  background: #fffbeb;
}

.sf-contact-card--secondary {
  border-color: #e2e8f0;
  background: #fafafa;
}

.sf-contact-role {
  font-size: 0.65rem;
  letter-spacing: 0.07em;
  font-weight: 700;
}

.sf-contact-card--primary .sf-contact-role {
  color: #ea580c;
}

.sf-contact-card--secondary .sf-contact-role {
  color: var(--sf-muted);
}

.sf-contact-card .btn-star-primary {
  line-height: 1;
  padding: 0.15rem;
}

.sf-contact-card .btn-star-primary .bi-star-fill {
  color: #eab308;
}

.sf-contact-card .btn-star-primary .bi-star {
  color: var(--sf-muted);
}

.modal-add-transporter .modal-footer {
  padding: 1rem 1.25rem 1.25rem;
}

/* —— Forms & buttons (dashboard) —— */
.sf-main .form-control {
  border-radius: var(--sf-radius-input);
  padding: 0.5rem 0.875rem;
  font-size: 0.9375rem;
  line-height: 1.45;
  border-color: #e2e8f0;
}

/* Do not set symmetric padding on .form-select — Bootstrap reserves extra padding-right for the chevron */
.sf-main .form-select {
  border-radius: var(--sf-radius-input);
  font-size: 0.9375rem;
  line-height: 1.45;
  border-color: #e2e8f0;
}

.sf-main .form-control:focus,
.sf-main .form-select:focus {
  border-color: var(--sf-primary-border);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.sf-main .form-control-lg {
  padding: 0.65rem 1rem;
  font-size: 1rem;
  border-radius: 9px;
}

.sf-main .form-select-lg {
  font-size: 1rem;
  border-radius: 9px;
}

.sf-main .form-label,
.sf-main label.form-label {
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--sf-text-secondary);
  margin-bottom: 0.4rem;
}

.sf-main .form-text {
  font-size: 0.75rem;
  line-height: 1.4;
  margin-top: 0.35rem;
}

.sf-main .input-group-text {
  border-color: #e2e8f0;
  font-size: 0.9375rem;
}

.sf-main .btn {
  font-weight: 500;
  letter-spacing: -0.01em;
  border-radius: 8px;
  padding: 0.45rem 0.95rem;
}

.sf-main .btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
  border-radius: 7px;
}

.sf-main .btn-lg {
  padding: 0.6rem 1.15rem;
  font-size: 1rem;
  border-radius: 9px;
}

/* Modals (global) */
.modal-content {
  border-radius: var(--sf-radius-modal);
  border: none;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15);
}

.modal-header {
  padding: 1.25rem 1.5rem 0.85rem;
  align-items: flex-start;
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.modal-body {
  padding: 1.25rem 1.5rem;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.modal-body .form-label {
  color: var(--sf-text-secondary);
}

.modal .form-control {
  border-radius: var(--sf-radius-input);
  padding: 0.5rem 0.875rem;
  font-size: 0.9375rem;
  line-height: 1.45;
  border-color: #e2e8f0;
}

.modal .form-select {
  border-radius: var(--sf-radius-input);
  font-size: 0.9375rem;
  line-height: 1.45;
  border-color: #e2e8f0;
}

.modal .form-control-lg {
  padding: 0.65rem 1rem;
  font-size: 1rem;
}

.modal .form-label {
  font-weight: 500;
  font-size: 0.8125rem;
  margin-bottom: 0.4rem;
}

.modal-footer {
  padding: 1rem 1.5rem 1.35rem;
  gap: 0.5rem;
}

/* Public dispatch accept: <form> wraps body+footer only; keep flex chain for scrollable modal */
#acceptModal .modal-content > form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

#acceptModal .modal-dialog-scrollable .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.list-group-item {
  line-height: 1.4;
}

/* Badges in tables */
.sf-table .badge {
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* —— Responsive refinements —— */
@media (max-width: 767.98px) {
  .sf-page-title-row {
    flex-direction: column;
    align-items: stretch;
  }

  .sf-page-title-row > .sf-header-actions {
    justify-content: flex-start;
  }

  .sf-page-header h1 {
    font-size: 1.4rem;
  }

  .sf-content {
    padding-bottom: max(2.5rem, calc(2.5rem + env(safe-area-inset-bottom, 0px)));
  }

  .chat-thread {
    max-height: min(360px, 55dvh);
  }

  .detail-expand td {
    padding: 1rem !important;
  }

  .modal-body {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .modal-header,
  .modal-footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (max-width: 575.98px) {
  .sf-page-title-row .sf-header-actions > .btn,
  .sf-page-title-row .sf-header-actions > a.btn {
    width: 100%;
    justify-content: center;
  }

  .sf-card-header {
    flex-direction: column;
    align-items: stretch !important;
  }

  .sf-card-header > .btn {
    width: 100%;
    justify-content: center;
  }

  .sf-card-header > .d-flex.flex-wrap {
    width: 100%;
    justify-content: center;
  }

  .sf-table thead th {
    white-space: normal;
    vertical-align: bottom;
    font-size: 0.75rem;
  }

  .phase-progress-bar .d-flex.justify-content-between {
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: center !important;
    text-align: center;
  }
}

/* --- Utility classes (avoid inline styles in Blade) --- */
.sf-avatar-48 {
  width: 48px;
  height: 48px;
}

.sf-role-badge-soft {
  background: #fee2e2;
  color: #991b1b;
}

.sf-td-min-w-7 {
  min-width: 7rem;
}

.sf-td-min-w-8 {
  min-width: 8rem;
}

.sf-td-min-w-9 {
  min-width: 9rem;
}

.sf-td-min-w-10 {
  min-width: 10rem;
}

.sf-td-min-w-11 {
  min-width: 11rem;
}

.sf-dest-icon-violet {
  color: #7c3aed !important;
}

.sf-progress-w-0 {
  width: 0%;
}

.sf-progress-w-20 {
  width: 20%;
}

.sf-progress-w-72 {
  width: 72%;
}

.sf-select-max-160 {
  max-width: 160px;
}

.sf-btn-chat-gradient {
  background: linear-gradient(90deg, #2563eb, #22c55e);
  border-radius: 999px;
}

.sf-input-w-3rem {
  width: 3rem;
}

.sf-surrogate-avatar {
  width: 44px;
  height: 44px;
}

.sf-badge-amber-soft {
  background: #fed7aa;
}

.sf-stat-orange {
  color: var(--sf-orange);
}

.sf-stat-violet-600 {
  color: #7c3aed;
}

.sf-avatar-44 {
  width: 44px;
  height: 44px;
  font-weight: 700;
}
