/*
 * Star Group Courier Dashboard
 * Clean consolidated stylesheet
 * Covers Dashboard, Customers, Orders, New Order and Reports.
 */

:root {
  --primary: #173f73;
  --primary-dark: #102f57;
  --gold: #e9b949;
  --background: #f3f6fa;
  --white: #fff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #dbe3ec;
  --green: #198754;
  --orange: #d97706;
  --red: #dc3545;
  --purple: #7c3aed;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Arial,Helvetica,sans-serif;
  display: flex;
  flex-direction: column;
}

button,input,select,textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.site-header {
  background: linear-gradient(135deg,var(--primary-dark),var(--primary));
  color: #fff;
  box-shadow: 0 5px 18px rgba(15,47,87,.2);
}

.header-inner {
  width: min(1500px,calc(100% - 40px));
  min-height: 104px;
  margin: 0 auto;
  padding: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 15px;
}

.header-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--gold);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.header-title {
  margin: 0;
  font-size: 26px;
}

.header-subtitle {
  margin: 6px 0 0;
  color: #dce8f6;
  font-size: 14px;
}

.header-tagline {
  margin: 6px 0 0;
  color: #f4c957;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: .4px;
}

.header-logo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: 7px 12px;
  border-radius: 12px;
  text-decoration: none;
  box-shadow: 0 5px 16px rgba(0,0,0,.18);
  flex-shrink: 0;
}

.header-logo {
  display: block;
  width: auto;
  height: 90px;
  max-width: 290px;
  object-fit: contain;
}

.main-navigation {
  background: rgba(0,0,0,.14);
}

.navigation-inner {
  width: min(1500px,calc(100% - 40px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
}

.navigation-link {
  padding: 14px 19px;
  color: #e9f1fb;
  text-decoration: none;
  font-size: 14px;
  font-weight: bold;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
}

.navigation-link:hover,.navigation-link.active {
  background: rgba(255,255,255,.08);
}

.navigation-link.active {
  color: #fff;
  border-bottom-color: var(--gold);
}

.page-content {
  width: min(1500px,calc(100% - 40px));
  margin: 0 auto;
  padding: 25px 0;
  flex: 1;
}

.dashboard-heading {
  margin-bottom: 22px;
}

.dashboard-heading h2 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 25px;
}

.dashboard-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 5px 18px rgba(21,47,76,.06);
  overflow: hidden;
  margin-bottom: 22px;
}

.panel-header {
  padding: 18px 20px;
  background: #fbfcfe;
  border-bottom: 1px solid var(--border);
}

.panel-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.panel-title {
  margin: 0;
  color: var(--primary-dark);
  font-size: 20px;
}

.panel-subtitle {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.panel-body {
  padding: 20px;
}

.success-message,.error-message {
  padding: 15px;
  border-radius: 10px;
  font-weight: bold;
}

.success-message {
  border: 1px solid #a3d7b4;
  background: #eaf8ef;
  color: #166534;
}

.error-message {
  border: 1px solid #efb2b7;
  background: #fff0f1;
  color: #991b1b;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 16px;
  border: 0;
  border-radius: 9px;
  text-decoration: none;
  font-weight: bold;
  transition: .15s;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(21,47,76,.12);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-secondary {
  background: #e5e7eb;
  color: #374151;
}

.btn-success {
  background: var(--green);
  color: #fff;
}

.btn-danger {
  background: var(--red);
  color: #fff;
}

.btn-delete {
  background: #7f1d1d;
  color: #fff;
}

.btn-delete:hover {
  background: #651515;
}

.btn-gold {
  background: var(--gold);
  color: var(--primary-dark);
}

.btn-small {
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 12px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.actions form {
  margin: 0;
}

.form-grid,.new-order-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 15px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-group.full-width,.full-width {
  grid-column: 1/-1;
}

.form-group label {
  color: #374151;
  font-size: 13px;
  font-weight: bold;
}

.form-group input,.form-group select,.form-group textarea,.customer-search-row input,.customer-v2-search input,.search-select-input,.inline-create-form input,.inline-create-form textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #cfd9e4;
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.form-group input:focus,.form-group select:focus,.form-group textarea:focus,.customer-search-row input:focus,.customer-v2-search input:focus,.search-select-input:focus,.inline-create-form input:focus,.inline-create-form textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23,63,115,.1);
}

.form-group textarea,.inline-create-form textarea {
  resize: vertical;
}

.required {
  color: var(--red);
}

.checkbox-label,.via-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-weight: bold;
}

.checkbox-label input,.via-toggle-label input {
  width: auto;
  margin: 0;
}

.section-heading {
  grid-column: 1/-1;
  padding: 10px 12px;
  border-left: 4px solid var(--gold);
  border-radius: 0 8px 8px 0;
  background: #f7f9fc;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: bold;
}

.price-input-wrap {
  display: flex;
  align-items: stretch;
}

.price-input-wrap>span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  border: 1px solid #cfd9e4;
  border-right: 0;
  border-radius: 9px 0 0 9px;
  background: #f5f8fb;
  color: var(--primary-dark);
  font-weight: bold;
}

.price-input-wrap input {
  border-radius: 0 9px 9px 0;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(170px,1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.summary-card {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 19px;
  box-shadow: 0 5px 15px rgba(21,47,76,.06);
}

.summary-card:before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 5px;
  background: var(--primary);
}

.summary-card.green:before {
  background: var(--green);
}

.summary-card.orange:before {
  background: var(--orange);
}

.summary-card.purple:before {
  background: var(--purple);
}

.summary-card.gold:before {
  background: var(--gold);
}

.summary-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: bold;
  letter-spacing: .4px;
  text-transform: uppercase;
}

.summary-value {
  margin-top: 9px;
  color: var(--primary-dark);
  font-size: 28px;
  font-weight: bold;
}

.summary-note {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(600px,1.6fr) minmax(280px,.7fr);
  gap: 22px;
  align-items: start;
}

.quick-actions {
  display: grid;
  gap: 12px;
}

.quick-action {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 11px;
  text-decoration: none;
  background: #fbfcfe;
  transition: .2s;
}

.quick-action:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(21,47,76,.08);
}

.quick-action-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.quick-action strong {
  display: block;
  color: var(--primary-dark);
  margin-bottom: 4px;
}

.quick-action span {
  color: var(--muted);
  font-size: 12px;
}

.table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 850px;
}

.data-table th,.data-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #e7edf3;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

.data-table th {
  background: #f5f8fb;
  color: #374151;
  font-size: 12px;
  text-transform: uppercase;
}

.data-table tbody tr:hover {
  background: #f9fbfd;
}

.table-subtext {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.price-cell {
  color: var(--primary-dark);
  font-weight: bold;
  white-space: nowrap;
}

.empty-state {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.status-badge,.directory-status,.default-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 20px;
  font-weight: bold;
  white-space: nowrap;
}

.status-badge {
  padding: 6px 10px;
  font-size: 11px;
}

.status-pending {
  background: #fff3cd;
  color: #795800;
}

.status-collected {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-on-hold {
  background: #ede9fe;
  color: #6d28d9;
}

.status-delivered {
  background: #dcfce7;
  color: #166534;
}

.status-cancelled {
  background: #fee2e2;
  color: #991b1b;
}

.directory-status {
  padding: 5px 9px;
  font-size: 11px;
}

.directory-status.active {
  background: #dcfce7;
  color: #166534;
}

.directory-status.inactive {
  background: #fee2e2;
  color: #991b1b;
}

.default-badge {
  padding: 4px 8px;
  background: #fff3cd;
  color: #795800;
  font-size: 10px;
}

.customer-flash {
  margin-bottom: 20px;
}

.customer-v2-layout {
  display: grid;
  grid-template-columns: minmax(0,2fr) minmax(300px,1fr);
  gap: 22px;
  align-items: start;
}

.customer-v2-main,.customer-v2-side {
  min-width: 0;
}

.customer-v2-form-grid {
  grid-template-columns: repeat(2,minmax(0,1fr));
}

.customer-v2-search {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.customer-v2-search input {
  width: min(300px,100%);
}

.customer-table-panel {
  padding: 0;
}

.customer-v2-table {
  min-width: 980px;
}

.customer-v2-table th:first-child,.customer-v2-table td:first-child {
  padding-left: 18px;
}

.customer-v2-table th:last-child,.customer-v2-table td:last-child {
  padding-right: 18px;
}

.customer-v2-table .directory-status {
  margin-left: 7px;
  vertical-align: middle;
}

.customer-address-cell {
  min-width: 240px;
  max-width: 360px;
  line-height: 1.45;
}

.inactive-row {
  opacity: .65;
  background: #fafafa;
}

.account-customer-list {
  display: grid;
  gap: 10px;
}

.account-customer-row {
    padding:10px 12px;
    margin-bottom:10px;
    border:1px solid #d8e0ea;
    border-radius:10px;
    background:#fff;
}

.account-customer-row strong {
    display:block;
    font-size:17px;
    font-weight:700;
    margin-bottom:4px;
}

.account-customer-row .status-badge{
    padding:3px 10px;
    font-size:11px;
}

.account-customer-row .btn{
    padding:5px 10px;
    font-size:12px;
    margin-top:4px;
}

.account-customer-row>div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.account-customer-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.account-customer-actions form {
  margin: 0;
}

.customer-page-grid {
  display: grid;
  grid-template-columns: minmax(350px,.8fr) minmax(620px,1.45fr);
  gap: 22px;
  align-items: start;
}

.customer-search-form {
  margin-bottom: 18px;
}

.customer-search-row {
  display: grid;
  grid-template-columns: minmax(220px,1fr) auto auto;
  gap: 10px;
}

.customer-directory-list {
  display: grid;
  gap: 16px;
}

.customer-directory-card {
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #fff;
  overflow: hidden;
}

.customer-directory-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  background: #fbfcfe;
  border-bottom: 1px solid var(--border);
}

.customer-title-row {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.customer-title-row h3 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 18px;
}

.customer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 16px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.customer-stat-row {
  display: flex;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid #edf1f5;
}

.customer-stat-row>div {
  min-width: 120px;
  padding: 9px 12px;
  border-radius: 9px;
  background: #f5f8fb;
}

.customer-stat-row strong {
  display: block;
  color: var(--primary-dark);
  font-size: 18px;
}

.customer-stat-row span {
  color: var(--muted);
  font-size: 11px;
}

.customer-notes {
  padding: 13px 16px;
  border-bottom: 1px solid #edf1f5;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.5;
}

.customer-branch-list {
  display: grid;
  gap: 10px;
  padding: 14px 16px 16px;
}

.customer-no-address {
  padding: 12px;
  border-radius: 9px;
  background: #f7f9fc;
  color: var(--muted);
  font-size: 13px;
}

.customer-no-address a {
  margin-left: 5px;
  color: var(--primary);
  font-weight: bold;
}

.customer-branch-card {
  padding: 13px;
  border: 1px solid #e1e8f0;
  border-radius: 10px;
  background: #f9fbfd;
}

.customer-branch-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.branch-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.branch-title-row strong {
  color: var(--primary-dark);
}

.branch-address {
  margin-top: 7px;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.45;
}

.branch-order-stats {
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
}

.order-flash,.new-order-message {
  margin-bottom: 20px;
}

.orders-page-grid {
  display: grid;
  grid-template-columns: minmax(380px,.82fr) minmax(720px,1.6fr);
  gap: 22px;
  align-items: start;
}

.order-filter-form {
  margin-bottom: 15px;
}

.order-filter-grid {
  display: grid;
  grid-template-columns: minmax(220px,1.4fr) repeat(4,minmax(135px,.8fr));
  gap: 11px;
}

.order-history-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0;
  padding: 11px 12px;
  border-radius: 9px;
  background: #f5f8fb;
  color: var(--muted);
  font-size: 12px;
}

.order-history-summary strong {
  color: var(--primary-dark);
}

.orders-table {
  min-width: 1180px;
}

.route-cell {
  min-width: 260px;
  max-width: 340px;
  line-height: 1.4;
}

.route-cell>div+div {
  margin-top: 7px;
}

.second-pickup-row,.via-route {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px dashed var(--border);
  color: #4b5563;
  font-size: 12px;
}

.order-success-panel {
  max-width: 700px;
  margin: 0 auto 22px;
  text-align: center;
}

.order-success-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #dcfce7;
  color: #166534;
  font-size: 30px;
  font-weight: bold;
}

.order-success-panel h2 {
  margin: 0;
  color: var(--primary-dark);
}

.order-success-number {
  margin-top: 12px;
  color: var(--primary);
  font-size: 26px;
  font-weight: bold;
}

.order-success-actions {
  justify-content: center;
}

.search-select {
  position: relative;
}

.search-select-input {
  padding: 13px 14px;
  border-radius: 10px;
}

.search-select.selected .search-select-input {
  border-color: var(--green);
  background: #f3fbf6;
}

.search-select-results {
  position: absolute;
  z-index: 100;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  display: none;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15,47,87,.18);
}

.search-select-results.show {
  display: block;
}

.search-select-results.empty:after {
  content: "No matching records found";
  display: block;
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
}

.search-select-option {
  width: 100%;
  display: block;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid #edf1f5;
  background: #fff;
  text-align: left;
}

.search-select-option:last-child {
  border-bottom: 0;
}

.search-select-option:hover,.search-select-option.active {
  background: #f5f8fb;
}

.search-select-option strong,.search-select-option span,.search-select-option small {
  display: block;
}

.search-select-option strong {
  color: var(--primary-dark);
}

.search-select-option span {
  margin-top: 4px;
  color: #4b5563;
  font-size: 12px;
  line-height: 1.4;
}

.search-select-option small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: bold;
}

.search-select-option.not-listed,.search-select-option.add-new-option {
  color: var(--primary);
  font-weight: bold;
  background: #f8fbff;
}

.via-toggle-wrap {
  grid-column: 1/-1;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfcfe;
}

.via-section {
  grid-column: 1/-1;
  padding: 16px;
  border: 1px solid #d9e4ef;
  border-radius: 12px;
  background: #f8fbff;
}

.via-section-title {
  margin: 0 0 14px;
  color: var(--primary-dark);
  font-size: 16px;
}

.inline-create-panel,.inline-add-panel {
  grid-column: 1/-1;
  padding: 15px;
  border: 1px solid #cfddeb;
  border-radius: 11px;
  background: #f8fbff;
}

.inline-create-panel h3,.inline-add-panel h3 {
  margin: 0 0 12px;
  color: var(--primary-dark);
  font-size: 16px;
}

.inline-create-form {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 12px;
}

.inline-create-form .full-width {
  grid-column: 1/-1;
}

.inline-create-actions {
  grid-column: 1/-1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-form-message {
  grid-column: 1/-1;
  font-size: 12px;
  font-weight: bold;
}

.inline-form-message.success {
  color: #166534;
}

.inline-form-message.error {
  color: #991b1b;
}

.price-history-box,.route-price-history {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid #f2d892;
  border-radius: 10px;
  background: #fff9e9;
  font-size: 12px;
}

.price-history-items,.route-price-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 6px;
  color: #6b5a24;
}

.price-history-items span,.route-price-items span {
  white-space: nowrap;
}

.price-history-button,.route-price-button {
  border: 1px solid #e1c86d;
  border-radius: 8px;
  background: #fff;
  color: var(--primary-dark);
  padding: 7px 10px;
  font-weight: bold;
}

.price-history-button:hover,.route-price-button:hover {
  background: #fffdf5;
}

.report-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.report-tab-button {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--primary-dark);
  padding: 10px 15px;
  border-radius: 9px;
  font-weight: bold;
}

.report-tab-button.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.report-section {
  display: none;
}

.report-section.active {
  display: block;
}

.site-footer {
  margin-top: auto;
  background: var(--primary-dark);
  color: #fff;
}

.footer-inner {
  width: min(1500px,calc(100% - 40px));
  margin: 0 auto;
  min-height: 76px;
  padding: 17px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-business {
  font-weight: bold;
}

.footer-copy {
  margin-top: 5px;
  color: #c9d7e8;
  font-size: 13px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-links a {
  color: #e4edf7;
  text-decoration: none;
  font-size: 13px;
}

.footer-links a:hover {
  text-decoration: underline;
}

@media (max-width:1200px) {
  .orders-page-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width:1100px) {
  .customer-v2-layout {
    grid-template-columns: 1fr;
  }

  .customer-v2-side {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 22px;
  }
}

@media (max-width:1050px) {
  .customer-page-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width:1000px) {
  .summary-grid {
    grid-template-columns: repeat(2,1fr);
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width:900px) {
  .order-filter-grid,.report-filter-grid {
    grid-template-columns: repeat(2,1fr);
  }
}

@media (max-width:760px) {
  .customer-v2-form-grid,.customer-v2-side {
    grid-template-columns: 1fr;
  }

  .customer-v2-search {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .customer-v2-search input,.customer-v2-search .btn {
    width: 100%;
  }
}

@media (max-width:700px) {
  .header-inner {
    width: min(100% - 24px,1500px);
    align-items: flex-start;
    gap: 12px;
  }

  .header-icon {
    display: none;
  }

  .header-title {
    font-size: 20px;
  }

  .header-subtitle {
    font-size: 12px;
  }

  .header-logo {
    height: 55px;
    max-width: 165px;
  }

  .header-logo-link {
    padding: 5px 8px;
  }

  .navigation-inner,.page-content,.footer-inner {
    width: min(100% - 24px,1500px);
  }

  .summary-grid {
    grid-template-columns: repeat(2,minmax(130px,1fr));
    gap: 10px;
  }

  .summary-value {
    font-size: 22px;
  }

  .panel-header-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-grid,.new-order-grid,.customer-search-row,.order-filter-grid,.report-filter-grid,.inline-create-form {
    grid-template-columns: 1fr;
  }

  .customer-directory-header,.customer-branch-main {
    flex-direction: column;
  }

  .customer-directory-header .actions,.customer-branch-main .actions {
    width: 100%;
  }

  .customer-directory-header .actions .btn,.customer-directory-header .actions form,.customer-directory-header .actions button,.customer-branch-main .actions .btn,.customer-branch-main .actions form,.customer-branch-main .actions button {
    flex: 1;
    width: 100%;
  }

  .price-history-box,.route-price-history {
    align-items: flex-start;
    flex-direction: column;
  }

  .price-history-box .btn,.route-price-history .btn {
    width: 100%;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media print {
  .site-header,.site-footer,.button-row,.actions,.filters-area,.no-print {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .page-content {
    width: 100%;
    padding: 0;
  }

  .panel {
    border: 0;
    box-shadow: none;
  }

  .panel-header,.panel-body {
    padding-left: 0;
    padding-right: 0;
  }

  .data-table {
    min-width: 0;
  }

  .data-table th,.data-table td {
    padding: 6px 4px;
    font-size: 9px;
  }
}

.favourite-cell {
  width: 64px;
  text-align: center;
}

.favourite-cell form {
  margin: 0;
}

.favourite-toggle {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: white;
  color: #9ca3af;
  font-size: 19px;
  line-height: 1;
}

.favourite-toggle:hover, .favourite-toggle.selected {
  border-color: #e1b12c;
  background: #fff8df;
  color: #d69e00;
}

.quick-customer-group {
  display: grid;
  gap: 8px;
}

.quick-customer-group > strong {
  color: var(--primary-dark);
  font-size: 13px;
}

.quick-customer-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-customer-chip {
  padding: 8px 11px;
  border: 1px solid #cfd9e4;
  border-radius: 20px;
  background: white;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: bold;
}

.quick-customer-chip:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.quick-customer-chip.favourite {
  border-color: #efd37a;
  background: #fff8df;
  color: #795800;
}

@media (max-width: 700px) {
  .quick-customer-buttons {
    display: grid;
    grid-template-columns: 1fr;
  }

  .quick-customer-chip {
    width: 100%;
    text-align: left;
  }
}

.customer-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr)
        minmax(320px, 1fr);
  gap: 22px;
  align-items: start;
}

.customer-form-column, .account-customer-column {
  min-width: 0;
}

.account-customer-column {
  display: flex;
  flex-direction: column;
}

.saved-customers-full {
  width: 100%;
  margin-top: 0;
}

.saved-customers-full .customer-v2-table {
  width: 100%;
  min-width: 1100px;
}

.saved-customers-full .panel-body {
  width: 100%;
}

.account-customer-extra {
  display: none;
}

.account-customer-extra.show {
  display: block;
}

.account-show-more {
  width: 100%;
  margin-top: 14px;
}

@media (max-width: 1050px) {
  .customer-top-grid {
    grid-template-columns: 1fr;
  }

  .account-customer-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
  }
}

@media (max-width: 700px) {
  .account-customer-column {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .order-entry-section {
    padding: 16px;
  }

  .order-entry-heading h3 {
    font-size: 17px;
  }

  .order-submit-bar {
    position: static;
    align-items: stretch;
    flex-direction: column;
  }

  .order-submit-help {
    margin-right: 0;
  }

  .order-submit-bar .btn {
    width: 100%;
  }
}

.new-order-panel {
  margin-left: auto;
  margin-right: auto;
  max-width: 1180px;
}

.order-form-grid {
  gap: 20px;
}

.order-entry-section {
  padding: 22px;
  border: 1px solid #cfdae7;
  border-radius: 15px;
  background: #ffffff;
  box-shadow: 0 5px 16px rgba(21, 47, 76, 0.06);
}

.order-entry-section--basic {
  border-top: 5px solid var(--primary);
}

.order-entry-section--job {
  border-top: 5px solid var(--green);
}

.order-entry-heading {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e4eaf1;
}

.order-entry-heading--compact {
  margin-bottom: 16px;
}

.order-step-number {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(23, 63, 115, 0.22);
}

.order-entry-heading h3 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 20px;
}

.order-entry-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.order-section-grid {
  gap: 16px;
}

.order-entry-section .form-group label {
  font-size: 14px;
  color: #21344d;
}

.order-entry-section .form-group input, .order-entry-section .form-group select, .order-entry-section .form-group textarea {
  min-height: 46px;
  border-width: 1.5px;
  background: #fbfdff;
}

.order-entry-section .form-group textarea {
  min-height: 105px;
}

.order-entry-section .form-group input:focus, .order-entry-section .form-group select:focus, .order-entry-section .form-group textarea:focus {
  background: white;
}

.field-help {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.quick-customer-panel {
  display: grid;
  gap: 13px;
  padding: 16px;
  border: 1px dashed #b8c9dc;
  border-radius: 12px;
  background: #f8fbff;
}

.via-option-card .checkbox-label {
  align-items: flex-start;
  font-size: 15px;
}

.via-option-card .checkbox-label > span {
  display: grid;
  gap: 5px;
}

.via-option-card .checkbox-label small {
  color: #765c1d;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}

.via-option-card input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

.order-submit-bar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  align-items: center;
  padding: 16px 18px;
  margin-top: 20px;
  border: 1px solid #cbd7e4;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -4px 16px rgba(21, 47, 76, 0.10);
  backdrop-filter: blur(5px);
}

.order-submit-help {
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.order-submit-bar .btn-primary {
  min-width: 190px;
  padding: 13px 20px;
  font-size: 15px;
}

@media (max-width: 760px) {
  .order-entry-section {
    padding: 16px;
  }

  .order-entry-heading h3 {
    font-size: 17px;
  }

  .order-submit-bar {
    position: static;
    align-items: stretch;
    flex-direction: column;
  }

  .order-submit-help {
    margin-right: 0;
  }

  .order-submit-bar .btn {
    width: 100%;
  }
}

.order-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 22px;
  padding: 14px 18px;
  border: 1px solid #d9e2ec;
  border-radius: 14px;
  background: white;
  box-shadow: 0 4px 14px rgba(21, 47, 76, 0.06);
}

.order-progress-step {
  min-width: 92px;
  display: grid;
  justify-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.order-progress-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #d5dde7;
  border-radius: 50%;
  background: #f7f9fc;
  font-size: 18px;
  transition: 0.2s ease;
}

.order-progress-line {
  width: 52px;
  height: 3px;
  border-radius: 10px;
  background: #dce3eb;
}

.order-progress-step.complete {
  color: #166534;
}

.order-progress-step.complete .order-progress-icon {
  border-color: #22c55e;
  background: #dcfce7;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.10);
}

.order-entry-section--booking {
  border-top: 5px solid #173f73;
  background: #f7faff;
}

.order-entry-section--booking .order-step-number {
  background: #173f73;
}

.order-entry-section--booking .order-entry-heading h3 {
  color: #173f73;
}

.order-entry-section--pickup {
  border-top: 5px solid #198754;
  background: #f5fcf7;
}

.order-entry-section--pickup .order-step-number {
  background: #198754;
}

.order-entry-section--pickup .order-entry-heading h3 {
  color: #166534;
}

.via-option-card {
  padding: 18px 20px;
  border: 2px dashed #d69e2e;
  border-radius: 13px;
  border-color: #d97706;
  background: #fff9ed;
}

.second-pickup-fields {
  padding: 20px;
  border-radius: 14px;
  border: 2px solid #efb34b;
  background: #fffaf0;
}

.second-pickup-fields .order-step-number {
  background: #d97706;
}

.second-pickup-fields .order-entry-heading h3 {
  color: #9a5704;
}

.order-entry-section--destination {
  border-top: 5px solid #7c3aed;
  background: #faf7ff;
}

.order-entry-section--destination .order-step-number {
  background: #7c3aed;
}

.order-entry-section--destination .order-entry-heading h3 {
  color: #6d28d9;
}

.order-entry-section--finish {
  border-top: 5px solid #0f766e;
  background: #f2fbfa;
}

.order-entry-section--finish .order-step-number {
  background: #0f766e;
}

.order-entry-section--finish .order-entry-heading h3 {
  color: #0f766e;
}

.order-entry-section .form-group input, .order-entry-section .form-group select, .order-entry-section .form-group textarea, .second-pickup-fields .form-group input, .second-pickup-fields .form-group select, .second-pickup-fields .form-group textarea {
  background: #ffffff;
}

@media (max-width: 850px) {
  .order-progress {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .order-progress-step {
    min-width: 82px;
  }

  .order-progress-line {
    min-width: 34px;
  }
}

@media (max-width: 700px) {
  .order-progress {
    padding: 12px;
  }

  .order-progress-step {
    min-width: 76px;
    font-size: 11px;
  }

  .order-progress-icon {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }
}

.inline-status-form {
  display: grid;
  gap: 5px;
  min-width: 135px;
}

.order-status-select {
  width: 100%;
  min-width: 135px;
  padding: 8px 30px 8px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  outline: none;
  font-weight: 700;
  cursor: pointer;
}

.order-status-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 63, 115, 0.12);
}

.order-status-select.status-pending {
  background: #fff3cd;
  color: #795800;
}

.order-status-select.status-collected {
  background: #dbeafe;
  color: #1d4ed8;
}

.order-status-select.status-on-hold {
  background: #ede9fe;
  color: #6d28d9;
}

.order-status-select.status-delivered {
  background: #dcfce7;
  color: #166534;
}

.order-status-select.status-cancelled {
  background: #fee2e2;
  color: #991b1b;
}

.status-saving-text {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.order-detail-row > td {
  padding: 0 !important;
  background: #f5f8fb;
}

.order-detail-panel {
  padding: 20px;
  border-top: 3px solid var(--primary);
  border-bottom: 1px solid var(--border);
  background: #f8fbff;
}

.order-detail-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.order-detail-summary > div {
  padding: 12px;
  border: 1px solid #dce5ef;
  border-radius: 10px;
  background: white;
}

.order-detail-summary span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.order-detail-summary strong {
  color: var(--primary-dark);
  font-size: 14px;
}

.status-history-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 15px;
}

.status-history-heading h3 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 18px;
}

.status-history-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.history-count {
  padding: 6px 10px;
  border-radius: 20px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.empty-status-history {
  padding: 16px;
  border: 1px dashed #cbd7e4;
  border-radius: 10px;
  background: white;
  color: var(--muted);
  text-align: center;
}

.status-history-timeline {
  position: relative;
  display: grid;
  gap: 0;
}

.status-history-item {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 12px;
  min-height: 76px;
}

.status-history-item:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 19px;
  bottom: -2px;
  left: 8px;
  width: 2px;
  background: #cbd7e4;
}

.status-history-marker {
  position: relative;
  z-index: 1;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border: 4px solid #dbeafe;
  border-radius: 50%;
  background: var(--primary);
}

.status-history-content {
  padding: 0 0 18px;
}

.status-history-change {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.status-history-old {
  color: #4b5563;
  font-size: 12px;
  font-weight: 700;
}

.status-history-arrow {
  color: var(--muted);
}

.status-history-date {
  margin-top: 7px;
  color: #4b5563;
  font-size: 12px;
  font-weight: 700;
}

.status-history-note {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .order-detail-summary {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}

@media (max-width: 600px) {
  .order-detail-summary {
    grid-template-columns: 1fr;
  }

  .status-history-heading {
    flex-direction: column;
  }
}

.order-actions-row > td {
  padding: 10px 12px 16px;
  border-bottom: 1px solid #dce4ed;
  background: #ffffff;
}

.order-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}

.order-row-actions form {
  display: inline-flex;
  margin: 0;
}

.order-action-button {
  width: 100px;
  min-width: 100px;
  height: 38px;
  padding: 8px 10px;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
}

.view-details-button {
  width: 100px;
  min-width: 100px;
}

.orders-full-table tbody tr:not(.order-actions-row):not(.order-detail-row) td {
  border-bottom: 0;
}

@media (max-width: 700px) {
  .order-row-actions {
    justify-content: flex-start;
  }

  .order-action-button {
    width: auto;
    min-width: 95px;
    flex: 1;
  }

  .order-row-actions form {
    flex: 1;
  }

  .order-row-actions form .order-action-button {
    width: 100%;
  }
}

.report-type-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.report-type-tab {
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: none;
}

.report-type-tab.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.report-export-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.report-filter-grid {
  display: grid;
  grid-template-columns: repeat(5,minmax(150px,1fr));
  gap: 14px;
}

.report-summary-grid {
  display: grid;
  grid-template-columns: repeat(7,minmax(140px,1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.report-summary-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-left: 5px solid var(--primary);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.report-summary-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.report-summary-card strong {
  display: block;
  margin-top: 8px;
  color: var(--primary-dark);
  font-size: 23px;
}

.report-summary-value {
  border-left-color: #0f766e;
}

.report-results-table {
  min-width: 1150px;
}

.report-results-table tfoot td {
  border-top: 2px solid var(--primary);
  background: #f5f8fb;
  font-weight: 700;
}

.report-total-label {
  text-align: right !important;
  color: var(--primary-dark);
}

.report-total-value {
  color: var(--primary-dark);
  font-size: 15px !important;
}

@media (max-width:1200px) {
  .report-summary-grid {
    grid-template-columns: repeat(4,minmax(140px,1fr));
  }

  .report-filter-grid {
    grid-template-columns: repeat(3,minmax(150px,1fr));
  }
}

@media (max-width:800px) {
  .report-summary-grid, .report-filter-grid {
    grid-template-columns: repeat(2,minmax(140px,1fr));
  }

  .report-export-actions {
    width: 100%;
  }

  .report-export-actions .btn {
    flex: 1;
  }
}

@media (max-width:550px) {
  .report-summary-grid, .report-filter-grid {
    grid-template-columns: 1fr;
  }

  .report-type-tabs {
    display: grid;
  }
}

.report-selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.report-selection-bar span {
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;
}

.report-select-column {
  width: 72px;
  text-align: center !important;
}

.report-select-column input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.report-export-actions button {
  border: 0;
}

@media (max-width: 700px) {
  .report-selection-bar {
    align-items: flex-start;
    flex-direction: column;
  }
}

#pickup_customer_search, #second_pickup_customer_search, #destination_customer_search, #account_customer_search, #pickup_address_search, #second_pickup_address_search, #destination_address_search {
  background-image: linear-gradient(to right, #f8fafc, #ffffff);
}

.order-section-grid select {
  min-height: 46px;
}

@media (max-width: 700px) {
  #pickup_customer_search, #second_pickup_customer_search, #destination_customer_search {
    font-size: 16px;
  }
}

.directory-autocomplete-input {
  width: 100%;
}

.directory-autocomplete-option {
  width: 100%;
  display: block;
  padding: 11px 13px;
  border: 0;
  border-bottom: 1px solid #edf1f5;
  background: #ffffff;
  color: #1f2937;
  text-align: left;
  cursor: pointer;
}

.directory-autocomplete-option:last-child {
  border-bottom: 0;
}

.directory-autocomplete-option:hover, .directory-autocomplete-option.is-active {
  background: #eef5fc;
}

.directory-autocomplete-option.is-selected {
  border-left: 4px solid var(--green);
  background: #f2fbf5;
}

.directory-autocomplete-option.is-other {
  color: var(--primary);
  font-weight: 700;
  background: #f8fbff;
}

.directory-autocomplete-option.is-blank {
  color: var(--muted);
}

.directory-autocomplete-option strong, .directory-autocomplete-option span, .directory-autocomplete-option small {
  display: block;
}

.directory-autocomplete-option strong {
  color: var(--primary-dark);
  font-size: 13px;
}

.directory-autocomplete-option span {
  margin-top: 4px;
  color: #4b5563;
  font-size: 12px;
  line-height: 1.35;
}

.directory-autocomplete-option small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.directory-autocomplete-empty {
  padding: 13px;
  color: var(--muted);
  font-size: 12px;
}

.directory-autocomplete-source {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
}

.autocomplete-selected-field {
  display: none;
}

@media (max-width: 700px) {
  .directory-autocomplete-suggestions {
    max-height: 260px;
  }

  .directory-autocomplete-input {
    font-size: 16px;
  }
}

.order-entry-section--booking .order-section-grid {
  grid-template-columns: repeat(2,minmax(0,1fr));
  align-items: start;
}

.booking-date-field {
  grid-column: 1;
  grid-row: 1;
}

.booking-account-search {
  grid-column: 2;
  grid-row: 1/span 2;
}

.booking-account-search .directory-autocomplete {
  margin-bottom: 12px;
}

.booking-recent-panel {
  grid-column: 1;
  grid-row: 2;
  margin: 0;
  min-height: 100%;
}

.selected-account-label {
  margin-top: 2px;
}

.selected-directory-select {
  width: 100%;
  min-height: 46px;
  padding: 11px 38px 11px 12px;
  border: 1.5px solid #cfd9e4;
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.selected-directory-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23,63,115,.10);
}

.order-entry-section--pickup .order-section-grid, .order-entry-section--destination .order-section-grid, .second-pickup-fields>.form-grid {
  grid-template-columns: repeat(2,minmax(0,1fr));
  align-items: start;
}

.order-entry-section--finish .order-section-grid {
  grid-template-columns: repeat(3,minmax(0,1fr));
  align-items: start;
}

.finish-price-field {
  grid-column: 1;
}

.finish-reference-field {
  grid-column: 2;
}

.finish-status-field {
  grid-column: 3;
}

.order-entry-section--finish .price-history-box, .order-entry-section--finish .form-group.full-width {
  grid-column: 1/-1;
}

.directory-autocomplete {
  position: relative;
  z-index: 20;
}

.directory-autocomplete-suggestions {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  max-height: 330px;
  overflow-y: auto;
  border: 1px solid #cbd7e4;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(15, 47, 87, 0.18);
  z-index: 500;
}

@media (max-width:900px) {
  .order-entry-section--finish .order-section-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  .finish-status-field {
    grid-column: 1/-1;
  }
}

@media (max-width:700px) {
  .order-entry-section--booking .order-section-grid, .order-entry-section--pickup .order-section-grid, .order-entry-section--destination .order-section-grid, .second-pickup-fields>.form-grid, .order-entry-section--finish .order-section-grid {
    grid-template-columns: 1fr;
  }

  .booking-date-field, .booking-account-search, .booking-recent-panel, .location-search-field, .location-selected-field, .address-textarea-field, .saved-address-field, .finish-price-field, .finish-reference-field, .finish-status-field {
    grid-column: 1;
    grid-row: auto;
  }
}

.order-entry-section--pickup .order-section-grid, .order-entry-section--destination .order-section-grid, .second-pickup-fields > .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-flow: row;
  align-items: start;
  column-gap: 16px;
  row-gap: 10px;
}

.location-search-field {
  grid-column: 1;
  grid-row: 1;
}

.location-selected-field {
  grid-column: 2;
  grid-row: 1;
}

.address-textarea-field {
  grid-column: 1;
  grid-row: 2;
}

.saved-address-field {
  grid-column: 2;
  grid-row: 2;
}

.address-textarea-field, .saved-address-field {
  align-self: start;
  margin-top: 0;
}

.address-textarea-field textarea {
  min-height: 72px !important;
  height: 72px;
  max-height: 72px;
  resize: vertical;
}

.saved-address-field select {
  min-height: 44px;
}

.is-secondary-search {
  display: none !important;
}

.second-pickup-fields .order-entry-heading {
  grid-column: 1 / -1;
  grid-row: auto;
}

.second-pickup-fields .form-group:has(#second_pickup_contact), .second-pickup-fields .form-group:has(#second_pickup_notes) {
  grid-row: auto;
}

.price-history-box {
  border-width: 2px;
  margin-top: 2px;
}

.price-history-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.route-price-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #e1c86d;
  border-radius: 8px;
  background: #ffffff;
  color: var(--primary-dark);
  cursor: pointer;
}

.route-price-chip:hover {
  background: #fff8df;
}

.route-price-chip span {
  color: var(--muted);
  font-size: 11px;
}

.route-price-chip strong {
  font-size: 13px;
}

@media (max-width: 700px) {
  .order-entry-section--pickup .order-section-grid, .order-entry-section--destination .order-section-grid, .second-pickup-fields > .form-grid {
    grid-template-columns: 1fr;
  }

  .location-search-field, .location-selected-field, .address-textarea-field, .saved-address-field {
    grid-column: 1;
    grid-row: auto;
  }

  .address-textarea-field textarea {
    height: 82px;
    max-height: none;
  }
}

.report-pickup-via-cell {
  min-width: 280px;
}

.report-route-block {
  line-height: 1.4;
}

.report-via-block {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.report-route-label {
  display: inline-block;
  margin-bottom: 5px;
  padding: 3px 7px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.report-via-block .report-route-label {
  background: #fff3cd;
  color: #795800;
}

.postcode-lookup-group {
  position: relative;
}

.postcode-autocomplete {
  position: relative;
}

.postcode-suggestions {
  position: absolute;
  z-index: 300;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid #cbd7e4;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(15, 47, 87, 0.18);
}

.postcode-suggestion-option {
  width: 100%;
  display: block;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #edf1f5;
  background: #ffffff;
  color: var(--primary-dark);
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.postcode-suggestion-option:last-child {
  border-bottom: 0;
}

.postcode-suggestion-option:hover, .postcode-suggestion-option:focus {
  background: #eef5fc;
}

.postcode-suggestion-message {
  padding: 12px;
  color: var(--muted);
  font-size: 12px;
}

.postcode-lookup-message {
  min-height: 18px;
  margin-top: 7px;
  font-size: 12px;
  font-weight: 700;
}

.postcode-lookup-message.is-success {
  color: #166534;
}

.postcode-lookup-message.is-warning {
  color: #92400e;
}

.postcode-lookup-message.is-info {
  color: var(--primary);
}

.postcode-area-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 9px;
  flex-wrap: wrap;
}

.postcode-area-actions[hidden] {
  display: none !important;
}

.btn-link {
  border: 0;
  background: transparent;
  color: var(--primary);
  text-decoration: underline;
}

@media (max-width: 650px) {
  .postcode-lookup-control {
    grid-template-columns: 1fr;
  }

  .postcode-lookup-control .btn {
    width: 100%;
  }
}

.postcode-email-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 1fr);
  gap: 18px;
  align-items: start;
}

.postcode-column, .email-column {
  min-width: 0;
}

.postcode-lookup-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.postcode-lookup-control .btn {
  min-height: 46px;
  white-space: nowrap;
}

.email-column input {
  width: 100%;
}

@media (max-width: 900px) {
  .postcode-email-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 650px) {
  .postcode-lookup-control {
    grid-template-columns: 1fr;
  }

  .postcode-lookup-control .btn {
    width: 100%;
  }
}

/* =========================================================
   Login page
   ========================================================= */

body.login-page {
    min-height: 100vh;
    margin: 0;
    display: block;
    background:
        linear-gradient(
            135deg,
            rgba(12, 40, 76, 0.98),
            rgba(25, 69, 119, 0.96)
        );
    font-family: Arial, Helvetica, sans-serif;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
}

.login-card {
    width: min(430px, 100%);
    padding: 34px;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 25px 65px rgba(0, 0, 0, 0.28);
}

.login-logo-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 22px;
}

.login-logo {
    display: block;
    width: auto;
    height: 95px;
    max-width: 260px;
    object-fit: contain;
}

.login-heading {
    margin-bottom: 24px;
    text-align: center;
}

.login-heading h1 {
    margin: 0;
    color: #102f57;
    font-size: 28px;
    line-height: 1.2;
}

.login-heading p {
    margin: 10px 0 0;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.55;
}

.login-form {
    display: grid;
    gap: 18px;
}

.login-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.login-form label {
    color: #374151;
    font-size: 13px;
    font-weight: 700;
}

.login-form input {
    width: 100%;
    min-height: 46px;
    padding: 11px 12px;
    border: 1px solid #cfd9e4;
    border-radius: 9px;
    background: #ffffff;
    color: #1f2937;
    font-size: 15px;
    outline: none;
}

.login-form input:focus {
    border-color: #173f73;
    box-shadow: 0 0 0 3px rgba(23, 63, 115, 0.12);
}

.login-password-wrapper {
    position: relative;
}

.login-password-wrapper input {
    padding-right: 76px;
}

.login-password-toggle {
    position: absolute;
    top: 50%;
    right: 7px;
    min-width: 58px;
    padding: 7px 9px;
    border: 0;
    border-radius: 7px;
    background: #e8eef5;
    color: #102f57;
    font-size: 12px;
    font-weight: 700;
    transform: translateY(-50%);
    cursor: pointer;
}

.login-password-toggle:hover {
    background: #dce5ef;
}

.login-submit {
    width: 100%;
    min-height: 47px;
    margin-top: 2px;
    border: 0;
    border-radius: 9px;
    background: #173f73;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.login-submit:hover {
    background: #102f57;
}

.login-message {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
}

.login-success {
    border: 1px solid #a3d7b4;
    background: #eaf8ef;
    color: #166534;
}

.login-error {
    border: 1px solid #efb2b7;
    background: #fff0f1;
    color: #991b1b;
}

.login-warning {
    border: 1px solid #f1d186;
    background: #fff8df;
    color: #795800;
}

.login-footer {
    margin-top: 25px;
    padding-top: 18px;
    border-top: 1px solid #dbe3ec;
    color: #6b7280;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

@media (max-width: 520px) {
    .login-container {
        padding: 20px 14px;
    }

    .login-card {
        padding: 26px 20px;
        border-radius: 15px;
    }

    .login-logo {
        height: 78px;
        max-width: 220px;
    }

    .login-heading h1 {
        font-size: 24px;
    }
}

.navigation-inner {
    width: min(1500px, calc(100% - 40px));
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
}

.header-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 20px;
    white-space: nowrap;
}

.header-user-name {
    color: #e9f1fb;
    font-size: 12px;
}

.header-user-name strong {
    color: #ffffff;
}

@media (max-width: 800px) {
    .header-user-name {
        display: none;
    }

    .header-user {
        padding-left: 10px;
    }
}

@media (max-width: 600px) {
    .header-inner {
        width: min(100% - 24px, 1500px);
        min-height: auto;
        padding: 12px 0;
    }

    .header-title {
        font-size: 19px;
    }

    .header-subtitle {
        font-size: 12px;
    }

    .header-tagline {
        font-size: 11px;
    }

    .header-icon {
        display: none;
    }

    .header-logo {
        height: 65px;
        max-width: 180px;
    }

    .navigation-inner {
        width: calc(100% - 20px);
    }

    .navigation-link {
        padding: 12px 13px;
        font-size: 12px;
    }
}

/* =========================================================
   Settings
   ========================================================= */

.settings-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.settings-sidebar {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 5px 18px rgba(21, 47, 76, 0.06);
}

.settings-user-card {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 20px;
    border-bottom: 1px solid var(--border);
    background: #fbfcfe;
}

.settings-user-avatar {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
}

.settings-user-card strong {
    display: block;
    color: var(--primary-dark);
    font-size: 14px;
}

.settings-user-card span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.settings-menu {
    display: grid;
    gap: 4px;
    padding: 12px;
}

.settings-menu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 13px;
    border-radius: 9px;
    color: #445268;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.settings-menu-link:hover {
    background: #f1f5f9;
    color: var(--primary-dark);
}

.settings-menu-link.active {
    background: var(--primary);
    color: #ffffff;
}

.settings-account-meta {
    display: grid;
    gap: 13px;
    padding: 17px 20px;
    border-top: 1px solid var(--border);
    background: #fbfcfe;
}

.settings-account-meta div {
    display: grid;
    gap: 4px;
}

.settings-account-meta span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.settings-account-meta strong {
    color: #374151;
    font-size: 12px;
}

.settings-content {
    min-width: 0;
}

.settings-password-field {
    position: relative;
}

.settings-password-field input {
    padding-right: 72px;
}

.password-visibility-button {
    position: absolute;
    top: 50%;
    right: 7px;
    padding: 7px 10px;
    border: 0;
    border-radius: 6px;
    background: #e9eef5;
    color: var(--primary-dark);
    font-size: 11px;
    font-weight: 700;
    transform: translateY(-50%);
}

.password-visibility-button:hover {
    background: #dce5ef;
}

.form-help {
    display: block;
    margin-top: 1px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.settings-security-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 18px;
    padding: 13px 14px;
    border: 1px solid #f1d186;
    border-radius: 9px;
    background: #fff8df;
    color: #795800;
    font-size: 12px;
    line-height: 1.45;
}

.settings-security-notice strong {
    white-space: nowrap;
}

.settings-layout + .panel {
    margin-top: 22px;
}

@media (max-width: 850px) {
    .settings-layout {
        grid-template-columns: 1fr;
    }

    .settings-menu {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .settings-account-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .settings-menu {
        grid-template-columns: 1fr;
    }

    .settings-account-meta {
        grid-template-columns: 1fr;
    }

    .settings-security-notice {
        display: grid;
    }
}

/* VAT settings */

.vat-rate-input {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.vat-rate-input input {
    flex: 1;
    min-width: 0;
    border-radius: 9px 0 0 9px;
}

.vat-rate-input > span {
    min-width: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cfd9e4;
    border-left: 0;
    border-radius: 0 9px 9px 0;
    background: #f5f8fb;
    color: var(--primary-dark);
    font-weight: 700;
}

/* Report VAT totals */

.report-results-table tfoot tr {
    background: #f8fafc;
}

.report-results-table tfoot td {
    border-top: 1px solid #d8e0e9;
}

.report-results-table .report-total-label {
    color: #445268;
    text-align: right;
    font-weight: 700;
}

.report-results-table .report-total-value {
    color: var(--primary-dark);
    font-weight: 700;
    white-space: nowrap;
}

.report-results-table .report-grand-total-row {
    background: #edf4fb;
}

.report-results-table .report-grand-total-row td {
    border-top: 2px solid var(--primary);
}

.report-results-table .report-grand-total-row .report-total-label,
.report-results-table .report-grand-total-row .report-total-value {
    color: var(--primary-dark);
    font-size: 14px;
}

textarea[name="account_address"]{
    min-height:70px;
    resize:vertical;
}

.customer-sidebar{
    display:flex;
    flex-direction:column;
    gap:18px;
}

.selected-account-address {
    margin-top: 10px;
    padding: 11px 13px;
    border: 1px solid #cbd8e7;
    border-left: 4px solid #1d4f91;
    border-radius: 8px;
    background: #f7fbff;
}

.selected-account-address[hidden] {
    display: none !important;
}

.selected-account-address-label {
    display: block;
    margin-bottom: 4px;
    color: #5d6d80;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

#selectedAccountCustomerAddressText {
    color: #12335e;
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-line;
}

.booking-account-address {
    grid-column: 1;
    grid-row: 2;
    align-self: stretch;
}

.booking-account-address .selected-account-address {
    height: 100%;
    min-height: 88px;
    margin-top: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.booking-account-search {
    grid-column: 2;
    grid-row: 1 / span 2;
}

.selected-account-address[hidden] {
    display: none !important;
}

@media (max-width: 850px) {
    .booking-account-address,
    .booking-account-search {
        grid-column: auto;
        grid-row: auto;
    }
}

.booking-account-address {
    grid-column: 1;
    grid-row: 2;
    align-self: stretch;
}

.booking-account-address .selected-account-address {
    min-height: 88px;
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.selected-account-address.is-empty {
    border-left-color: #98a7b8;
    background: #f7f9fc;
}

.selected-account-address.is-empty
#selectedAccountCustomerAddressText {
    color: #718096;
    font-style: italic;
}

.booking-account-search {
    grid-column: 2;
    grid-row: 1 / span 2;
}

@media (max-width: 850px) {
    .booking-account-address,
    .booking-account-search {
        grid-column: auto;
        grid-row: auto;
    }
}

.booking-account-address {
    grid-column: 1;
    grid-row: 2;
    align-self: stretch;
}

.booking-account-search {
    grid-column: 2;
    grid-row: 1 / span 2;
}

.booking-account-address .selected-account-address {
    width: 100%;
    min-height: 88px;
    height: 100%;
    margin: 0;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid #cbd8e7;
    border-left: 4px solid #1d4f91;
    border-radius: 8px;
    background: #f7fbff;
}

.selected-account-address.is-empty {
    border-left-color: #98a7b8;
    background: #f7f9fc;
}

.selected-account-address.is-empty
#selectedAccountCustomerAddressText {
    color: #718096;
    font-style: italic;
}

@media (max-width: 850px) {
    .booking-account-address,
    .booking-account-search {
        grid-column: 1;
        grid-row: auto;
    }
}

.report-export-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.report-pdf-dropdown {
    position: relative;
}

.report-pdf-dropdown-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.report-pdf-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 50;
    min-width: 160px;
    padding: 6px;
    border: 1px solid #d6dee8;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 10px 25px rgba(21, 47, 76, 0.18);
}

.report-pdf-dropdown-option {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #1f2937;
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.report-pdf-dropdown-option:hover,
.report-pdf-dropdown-option:focus {
    background: #f3f6fa;
    color: #173f73;
}

@media (max-width: 700px) {
    .report-export-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .report-pdf-dropdown-menu {
        right: auto;
        left: 0;
    }
}

.customer-bulk-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid #d8e1eb;
    border-radius: 9px;
    background: #f7f9fc;
}

.customer-select-all-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #27384c;
    font-weight: 600;
    cursor: pointer;
}

.customer-select-column {
    width: 62px;
    text-align: center;
    vertical-align: middle;
}

.customer-select-column input,
.customer-select-all-label input {
    width: 17px;
    height: 17px;
    cursor: pointer;
}

#selectedCustomerCount {
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
}

#deleteSelectedCustomersButton {
    margin-left: auto;
}

#deleteSelectedCustomersButton:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

@media (max-width: 700px) {
    #deleteSelectedCustomersButton {
        width: 100%;
        margin-left: 0;
    }
}

/* =========================================================
   Drivers Directory - Compact Driver Form
   ========================================================= */

.driver-compact-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.driver-compact-form .form-group {
    margin-bottom: 0;
}

.driver-compact-form input,
.driver-compact-form select {
    width: 100%;
}

.driver-form-row {
    display: grid;
    gap: 14px;
    align-items: end;
}

/* Mobile / Email / Age Group */
.driver-form-row-three {
    grid-template-columns:
        minmax(160px, 0.8fr)
        minmax(220px, 1.3fr)
        minmax(140px, 0.6fr);
}

/* Postcode / Driving Licence */
.driver-form-row-two {
    grid-template-columns:
        minmax(160px, 0.6fr)
        minmax(280px, 1.4fr);
}

/* Keep the whole form reasonably compact */
.driver-compact-form .driver-full-name {
    max-width: 100%;
}

/* Driver form button */
.driver-compact-form + .button-row {
    margin-top: 16px;
}

/* Responsive layout */
@media (max-width: 800px) {

    .driver-form-row-three,
    .driver-form-row-two {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   Drivers Directory - Tablet & Mobile
   ========================================================= */

/* Tablets */
@media (max-width: 1024px) {

    .driver-form-row-three {
        grid-template-columns:
            minmax(140px, 0.8fr)
            minmax(180px, 1.2fr)
            minmax(120px, 0.6fr);
    }

    .driver-form-row-two {
        grid-template-columns:
            minmax(140px, 0.7fr)
            minmax(220px, 1.3fr);
    }
}


/* Smaller tablets / large phones */
@media (max-width: 768px) {

    .driver-form-row-three {
        grid-template-columns: 1fr 1fr;
    }

    .driver-form-row-three .form-group:last-child {
        grid-column: 1 / -1;
    }

    .driver-form-row-two {
        grid-template-columns: 1fr 1fr;
    }
}


/* Mobile phones */
@media (max-width: 520px) {

    .driver-compact-form {
        gap: 10px;
    }

    .driver-form-row-three,
    .driver-form-row-two {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .driver-form-row-three .form-group:last-child {
        grid-column: auto;
    }

    .driver-compact-form + .button-row {
        margin-top: 14px;
    }

    .driver-compact-form + .button-row .btn {
        width: 100%;
    }
}

/* =========================================================
   Drivers Directory - Compact List
   ========================================================= */

.driver-directory-panel {
    margin-top: 18px;
}

.driver-directory-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.driver-directory-row {
    border: 1px solid #e3e6ea;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.driver-directory-summary {
    display: grid;
    grid-template-columns:
        minmax(170px, 1.2fr)
        minmax(130px, 0.9fr)
        minmax(190px, 1.3fr)
        minmax(80px, 0.5fr)
        auto;
    gap: 14px;
    align-items: center;
    padding: 13px 15px;
}

.driver-summary-name {
    font-size: 15px;
}

.driver-summary-item {
    min-width: 0;
    overflow-wrap: anywhere;
}

.driver-summary-label {
    display: block;
    margin-bottom: 2px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    opacity: 0.6;
}

.driver-directory-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

.driver-more-button {
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 6px 8px;
}

.driver-more-button:hover {
    text-decoration: underline;
}

.driver-more-details {
    padding: 12px 15px 14px;
    border-top: 1px solid #e3e6ea;
}

.driver-more-details > div {
    margin-bottom: 6px;
}

.driver-more-details > div:last-child {
    margin-bottom: 0;
}


/* Tablet */
@media (max-width: 1024px) {

    .driver-directory-summary {
        grid-template-columns:
            minmax(150px, 1fr)
            minmax(120px, 0.8fr)
            minmax(170px, 1.2fr)
            minmax(70px, 0.5fr);
    }

    .driver-directory-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}


/* Small tablet / large phone */
@media (max-width: 768px) {

    .driver-directory-summary {
        grid-template-columns: 1fr 1fr;
    }

    .driver-summary-name {
        grid-column: 1 / -1;
    }

    .driver-directory-actions {
        grid-column: 1 / -1;
    }
}


/* Mobile */
@media (max-width: 520px) {

    .driver-directory-summary {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 9px;
        padding: 12px;
    }

    .driver-directory-actions {
        justify-content: flex-start;
        padding-top: 4px;
    }

    .driver-more-details {
        padding: 12px;
    }
}

/* =========================================================
   Customers Page - Directory Tabs
   ========================================================= */

.customer-directory-tabs {
    display: flex;
    align-items: center;
    gap: 8px;

    margin-bottom: 20px;
    padding: 6px;

    background: #f3f4f6;
    border: 1px solid #e1e4e8;
    border-radius: 10px;

    overflow-x: auto;
}

.customer-directory-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    min-height: 42px;
    padding: 10px 18px;

    border: 1px solid transparent;
    border-radius: 7px;

    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;

    color: #4b5563;
    background: transparent;

    text-decoration: none;
    white-space: nowrap;

    transition:
        background 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}


/* Hover */

.customer-directory-tab:hover {
    background: #ffffff;
    border-color: #d9dde2;
    color: #1f2937;
    text-decoration: none;
}


/* Selected Tab */

.customer-directory-tab.active {
    background: #ffffff;
    border-color: #d1d5db;

    color: #111827;
    font-weight: 700;

    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.05),
        0 2px 6px rgba(0, 0, 0, 0.06);
}


/* =========================================================
   Tablet
   ========================================================= */

@media (max-width: 900px) {

    .customer-directory-tabs {
        gap: 5px;
        padding: 5px;
    }

    .customer-directory-tab {
        flex: 1 1 0;
        padding: 10px 8px;
        font-size: 13px;
    }
}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 600px) {

    .customer-directory-tabs {
        display: grid;
        grid-template-columns: 1fr;

        gap: 5px;
        padding: 5px;

        margin-bottom: 16px;

        overflow: visible;
    }

    .customer-directory-tab {
        width: 100%;
        min-height: 42px;

        justify-content: flex-start;

        padding: 10px 12px;
    }

    .customer-directory-tab.active {
        box-shadow: none;
    }
}

/* =========================================================
   Customers - Add Customer Layout
   ========================================================= */

.customer-add-section {
    width: 100%;
    margin-bottom: 22px;
}

.customer-add-panel {
    width: 100%;
    max-width: none;
}

/* =========================================================
   Customers - Compact Add Customer Form
   ========================================================= */

.customer-add-section {
    width: 100%;
    margin-bottom: 22px;
}

.customer-add-panel {
    width: 100%;
    max-width: none;
}


/* Main compact form */

.customer-compact-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}


/* Shared rows */

.customer-form-row {
    display: grid;
    gap: 16px;
    width: 100%;
}


/* Line 1:
   Company Name | Contact Name | Telephone / Mobile
*/

.customer-form-row-three {
    grid-template-columns:
        minmax(0, 1.3fr)
        minmax(0, 1fr)
        minmax(0, 1fr);
}


/* Line 4:
   Postcode | Email
*/

.customer-form-row-two {
    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr);
}


/* Remove old form spacing */

.customer-compact-form .form-group {
    margin-bottom: 0;
    min-width: 0;
}


/* Inputs */

.customer-compact-form input,
.customer-compact-form textarea {
    width: 100%;
    box-sizing: border-box;
}


/* Address + Notes */

.customer-compact-form textarea {
    min-height: 72px;
    resize: vertical;
}


/* Save button spacing */

.customer-add-panel .button-row {
    margin-top: 16px;
}


/* =========================================================
   Tablet
   ========================================================= */

@media (max-width: 900px) {

    .customer-form-row-three {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .customer-form-row-three .form-group:first-child {
        grid-column: 1 / -1;
    }

}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 600px) {

    .customer-form-row-three,
    .customer-form-row-two {
        grid-template-columns: 1fr;
    }

    .customer-form-row-three .form-group:first-child {
        grid-column: auto;
    }

    .customer-compact-form {
        gap: 12px;
    }

}

/* =========================================================
   Account Customers - Dedicated Tab
   ========================================================= */

.account-customers-page {
    width: 100%;
}

.account-customers-page > .panel {
    width: 100%;
    max-width: none;
    margin-bottom: 20px;
}


/* =========================================================
   Add / Edit Account Customer - Compact Form
   ========================================================= */

.account-customer-form-row {
    display: grid;
    grid-template-columns:
        minmax(260px, 0.8fr)
        minmax(400px, 1.7fr);
    gap: 18px;
    align-items: start;
}

.account-customer-form-row .form-group {
    margin-bottom: 0;
    min-width: 0;
}

.account-customer-form-row input,
.account-customer-form-row textarea {
    width: 100%;
    box-sizing: border-box;
}

.account-customer-form-row textarea {
    min-height: 70px;
    resize: vertical;
}

.account-customers-page .button-row {
    margin-top: 14px;
}


/* =========================================================
   Saved Account Customers - Compact Directory
   ========================================================= */

.account-customer-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.account-customer-row {
    display: flex;
    align-items: center;
    gap: 18px;

    width: 100%;
    padding: 11px 14px;

    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;

    box-sizing: border-box;
}


/* Name | Address | Status */

.account-customer-info {
    display: grid;
    grid-template-columns:
        minmax(220px, 1.1fr)
        minmax(320px, 2fr)
        auto;

    align-items: center;
    gap: 18px;

    flex: 1 1 auto;
    min-width: 0;
}

.account-customer-name {
    min-width: 0;
    font-size: 14px;
}

.account-customer-address {
    min-width: 0;

    font-size: 13px;
    line-height: 1.35;
    color: #6b7280;
}


/* Edit | Deactivate | Delete */

.account-customer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 6px;

    flex: 0 0 auto;
    flex-wrap: nowrap;
}

.account-customer-actions form {
    display: inline-flex;
    margin: 0;
}

.account-customer-actions .btn {
    white-space: nowrap;
}

/* =========================================================
   Account Customers - Bulk Toolbar
   ========================================================= */

.account-bulk-toolbar {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 12px;
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid #d8e1eb;
    border-radius: 9px;
    background: #f7f9fc;
    box-sizing: border-box;
}

.account-bulk-toolbar #deleteSelectedAccountCustomersButton {
    margin-left: auto !important;
    flex: 0 0 auto;
}

/* =========================================================
   Tablet
   ========================================================= */

@media (max-width: 1000px) {

    .account-customer-info {
        grid-template-columns:
            minmax(170px, 1fr)
            minmax(200px, 1.5fr)
            auto;

        gap: 12px;
    }

    .account-customer-row {
        gap: 12px;
    }
}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 700px) {

    .account-customer-form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .account-customer-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .account-customer-info {
        width: 100%;
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .account-customer-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

/* =========================================================
   Drivers Directory - Bulk Selection
   ========================================================= */

.driver-bulk-toolbar {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 12px;

    margin-bottom: 14px;
    padding: 12px 14px;

    background: #f7f9fc;
    border: 1px solid #d8e1eb;
    border-radius: 9px;

    box-sizing: border-box;
}

.driver-select-all-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    margin: 0;

    font-size: 13px;
    font-weight: 600;

    cursor: pointer;
}

.driver-selected-count {
    font-size: 13px;
    color: #6b7280;
}

.driver-directory-select {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 22px;
}

.driver-directory-select input,
.driver-select-all-label input {
    width: 16px;
    height: 16px;
    margin: 0;

    cursor: pointer;
}

/* =========================================================
   Drivers Directory - Checkbox Position Fix
   ========================================================= */

.driver-directory-row {
    display: flex;
    align-items: center;
    width: 100%;
}

.driver-directory-select {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 44px;
    width: 44px;

    margin: 0;
    padding: 0;
}

.driver-directory-select input {
    width: 17px;
    height: 17px;
    margin: 0;
    cursor: pointer;
}

.driver-directory-summary {
    flex: 1 1 auto;
    min-width: 0;
}


/* Tablet */

@media (max-width: 900px) {

    .driver-bulk-toolbar {
        gap: 10px;
        padding: 10px 12px;
    }

}


/* Mobile */

@media (max-width: 600px) {

    .driver-bulk-toolbar {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px;
    }

    .driver-select-all-label,
    .driver-selected-count {
        font-size: 12px;
    }

    .driver-directory-select {
        flex: 0 0 20px;
    }

    .driver-directory-select input,
    .driver-select-all-label input {
        width: 17px;
        height: 17px;
    }

}

@media (max-width: 600px) {

    .driver-directory-row {
        align-items: flex-start;
    }

    .driver-directory-select {
        flex: 0 0 30px;
        width: 30px;
        padding-top: 3px;
    }

    .driver-directory-summary {
        flex: 1 1 auto;
        min-width: 0;
    }
}

/* Drivers - Bulk Delete Button Alignment */

.driver-bulk-toolbar #deleteSelectedDriversButton {
    margin-left: auto !important;
    flex: 0 0 auto;
}

@media (max-width: 600px) {

    .driver-bulk-toolbar
    #deleteSelectedDriversButton {
        width: 100%;
        margin-left: 0 !important;
        margin-top: 4px;
    }
}

/* =========================================================
   New Order - Finish Section Layout
   ========================================================= */

/* Price | Reference | Status */
.order-entry-section--finish .order-section-grid {
    grid-template-columns: 1fr 1fr 1fr;
    align-items: start;
}

/* Driver row occupies the whole next line */
.driver-order-row {
    grid-column: 1 / -1;

    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;

    align-items: end;
    width: 100%;
}

/* Driver search takes available space */
.driver-order-row > .field:first-child {
    min-width: 0;
}

.driver-order-picker {
    position: relative;
    width: 100%;
}

.driver-order-picker > input[type="text"] {
    width: 100%;
    min-height: 46px;
    box-sizing: border-box;
}

/* Driver price stays compact */
.driver-order-row > .field:last-child {
    width: 300px;
}

.driver-order-row .money-input {
    display: flex;
    align-items: center;
    width: 100%;
}

.driver-order-row .money-input > span {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 46px;
    min-height: 46px;

    border: 1px solid #ccd8e5;
    border-right: 0;
    border-radius: 8px 0 0 8px;

    background: #f8fafc;
    font-weight: 700;
}

.driver-order-row .money-input input {
    width: 100%;
    min-height: 46px;

    border-radius: 0 8px 8px 0;
}

/* Optional text */
.field-optional {
    margin-left: 6px;
    color: #6b7280;
    font-size: 12px;
    font-weight: 400;
}

/* Notes always full width */
.order-entry-section--finish .full-width {
    grid-column: 1 / -1;
}


/* =========================================================
   Tablet
   ========================================================= */

@media (max-width: 900px) {

    .order-entry-section--finish .order-section-grid {
        grid-template-columns: 1fr 1fr;
    }

    .finish-status-field {
        grid-column: 1 / -1;
    }

    .driver-order-row {
        grid-template-columns: minmax(0, 1fr) 240px;
    }

    .driver-order-row > .field:last-child {
        width: auto;
    }
}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 600px) {

    .order-entry-section--finish .order-section-grid {
        grid-template-columns: 1fr;
    }

    .driver-order-row {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .driver-order-row > .field:last-child {
        width: 100%;
    }
}

/* =========================================================
   New Order - Driver Row Final Polish
   ========================================================= */

.driver-order-row {
    margin-top: 2px;
    gap: 30px;
    align-items: end;
}

/* Labels */
.driver-order-row > .field > label {
    display: block;
    margin-bottom: 7px;

    font-size: 14px;
    font-weight: 600;
    color: #102a4c;
}

/* Searchable driver control */
.driver-order-picker {
    position: relative;
    width: 100%;
}

.driver-order-picker > input[type="text"] {
    width: 100%;
    height: 46px;

    padding: 10px 46px 10px 14px;

    border: 1px solid #ccd8e5;
    border-radius: 9px;

    background: #fff;
    color: #1f2937;

    font-size: 16px;
    font-family: inherit;

    outline: none;
    box-sizing: border-box;
}

.driver-order-picker > input[type="text"]:focus {
    border-color: #17477e;
    box-shadow: 0 0 0 3px rgba(23, 71, 126, 0.10);
}

/* Dropdown arrow */
.driver-order-picker::after {
    content: "▼";

    position: absolute;
    right: 15px;
    top: 50%;

    transform: translateY(-50%);

    font-size: 11px;
    color: #334155;

    pointer-events: none;
}

/* Driver Price column */
.driver-order-row > .field:last-child {
    width: 375px;
}

/* Driver Price label */
.field-optional {
    margin-left: 6px;

    font-size: 12px;
    font-weight: 400;
    color: #64748b;
}

/* £ + price field */
.driver-order-row .money-input {
    display: flex;
    width: 100%;
    height: 46px;
}

.driver-order-row .money-input > span {
    flex: 0 0 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid #ccd8e5;
    border-right: 0;
    border-radius: 9px 0 0 9px;

    background: #f8fafc;

    color: #102a4c;
    font-weight: 700;
}

.driver-order-row .money-input input {
    flex: 1;
    min-width: 0;
    height: 46px;

    padding: 10px 14px;

    border: 1px solid #ccd8e5;
    border-radius: 0 9px 9px 0;

    background: #fff;

    font-size: 16px;
    font-family: inherit;

    box-sizing: border-box;
}


/* Tablet */
@media (max-width: 900px) {

    .driver-order-row {
        gap: 18px;
    }

    .driver-order-row > .field:last-child {
        width: 250px;
    }
}


/* Mobile */
@media (max-width: 600px) {

    .driver-order-row {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .driver-order-row > .field:last-child {
        width: 100%;
    }
}

/* =========================================================
   New Order - Driver Search Dropdown
   ========================================================= */

.driver-order-results {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;

    z-index: 1000;

    max-height: 260px;
    overflow-y: auto;

    background: #ffffff;
    border: 1px solid #ccd8e5;
    border-radius: 9px;

    box-shadow: 0 8px 22px rgba(15, 42, 76, 0.14);
}


/* Driver result */
.driver-order-option {
    display: block;
    width: 100%;

    padding: 11px 14px;

    border: 0;
    border-bottom: 1px solid #edf1f5;
    border-radius: 0;

    background: #ffffff;

    color: #102a4c;
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;

    text-align: left;

    cursor: pointer;
}

.driver-order-option:hover {
    background: #f4f8fc;
}


/* Add New Driver */
.driver-order-add {
    display: block;
    width: 100%;

    padding: 11px 14px;

    border: 0;
    border-radius: 0 0 8px 8px;

    background: #f7fafc;

    color: #17477e;
    font-size: 14px;
    font-family: inherit;
    font-weight: 700;

    text-align: left;

    cursor: pointer;
}

.driver-order-add:hover {
    background: #edf5fc;
}


/* Last normal driver */
.driver-order-option:last-of-type {
    border-bottom: 0;
}

/* Order History - Driver */

.orders-full-table .driver-cell {
    min-width: 135px;
    white-space: nowrap;
}

.orders-full-table .driver-cell strong {
    display: block;
    color: #102a4c;
    font-weight: 600;
}

.orders-full-table .driver-price {
    margin-top: 3px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

/* =========================================================
   Order History - compact desktop column layout
   ========================================================= */

@media (min-width: 1200px) {

    .orders-history-panel .table-wrapper {
        width: 100%;
        overflow-x: auto;
    }

    .orders-history-panel .orders-full-table {
        width: 100%;
        min-width: 0;
        table-layout: fixed;
    }

    /* Date */
    .orders-full-table th:nth-child(1),
    .orders-full-table td:nth-child(1) {
        width: 4%;
    }

    /* Order No. */
    .orders-full-table th:nth-child(2),
    .orders-full-table td:nth-child(2) {
        width: 5%;
    }

    /* Account Customer */
    .orders-full-table th:nth-child(3),
    .orders-full-table td:nth-child(3) {
        width: 7%;
    }

    /* Collection / Pickup */
    .orders-full-table th:nth-child(4),
    .orders-full-table td:nth-child(4) {
        width: 18%;
    }

    /* VIA / Second Pickup - intentionally compact */
    .orders-full-table th:nth-child(5),
    .orders-full-table td:nth-child(5) {
        width: 8%;
    }

    /* Destination / Drop-Off */
    .orders-full-table th:nth-child(6),
    .orders-full-table td:nth-child(6) {
        width: 18%;
    }

    /* Reference */
    .orders-full-table th:nth-child(7),
    .orders-full-table td:nth-child(7) {
        width: 11%;
    }

    /* Driver */
    .orders-full-table th:nth-child(8),
    .orders-full-table td:nth-child(8) {
        width: 10%;
    }

    /* Price */
    .orders-full-table th:nth-child(9),
    .orders-full-table td:nth-child(9) {
        width: 8%;
    }

    /* Status */
    .orders-full-table th:nth-child(10),
    .orders-full-table td:nth-child(10) {
        width: 11%;
    }

    .orders-full-table th,
    .orders-full-table td {
        overflow-wrap: anywhere;
    }
}

/* =========================================================
   Orders - pagination / per-page controls
   ========================================================= */

.orders-per-page-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    color: #475569;
    font-size: 14px;
}

.orders-per-page-row label {
    margin: 0;
    font-weight: 600;
}

.orders-per-page-select {
    width: auto;
    min-width: 76px;
    padding: 8px 30px 8px 10px;
}


.orders-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.pagination-summary {
    color: #64748b;
    font-size: 13px;
    white-space: nowrap;
}

.pagination-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
}

.pagination-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    padding: 7px 11px;
    border: 1px solid #d8e0ea;
    border-radius: 8px;
    background: #ffffff;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.pagination-button:hover {
    background: #f8fafc;
    border-color: #b8c4d3;
}

.pagination-button.is-active {
    background: #102a4c;
    border-color: #102a4c;
    color: #ffffff;
}

.pagination-ellipsis {
    padding: 0 4px;
    color: #94a3b8;
}


@media (max-width: 768px) {

    .orders-pagination {
        align-items: flex-start;
        flex-direction: column;
    }

    .pagination-links {
        justify-content: flex-start;
        width: 100%;
    }

    .pagination-summary {
        white-space: normal;
    }

}

.customers-per-page-row {
    display: flex;
    align-items: center;
    gap: 7px;
}

.customers-per-page-row label {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

/* =========================================================
   Dashboard - Latest Orders scroll
   ========================================================= */

.latest-orders-scroll {
    max-height: 520px;
    overflow-y: auto;
    overflow-x: auto;
    scrollbar-gutter: stable;
}

/* Keep headings visible while scrolling */
.latest-orders-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #ffffff;
}