html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

/* ---- Caldriver Reports branding ---- */
:root {
  --cd-blue: #1F5C99;
  --cd-blue-2: #2E75B6;
  --cd-panel: #EBF3FB;
}

.app-navbar {
  background-color: var(--cd-blue);
}

.brand-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--cd-blue);
}

/* Top bar: back button (left) + welcome greeting (right) */
.topbar {
  padding: .4rem 0 .5rem;
  border-bottom: 1px solid #eef2f6;
  margin-bottom: 1rem;
  min-height: 2.25rem;
}
.topbar .welcome-text {
  color: #6c7a89;
  font-size: .95rem;
}
.topbar .welcome-text strong {
  color: var(--cd-blue);
}

/* Login screen */
.auth-body {
  background: linear-gradient(135deg, #f3f7fb 0%, #e6eef7 100%);
}
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* Dashboard panels & pivot tables */
.panel-card {
  border: 1px solid #d9e2ec;
  border-radius: .5rem;
  overflow: hidden;
}
.panel-card .panel-head {
  background: var(--cd-blue-2);
  color: #fff;
  padding: .6rem 1rem;
  font-weight: 600;
}
.pivot-table {
  margin-bottom: 0;
  font-size: .9rem;
}
.pivot-table thead th {
  background: var(--cd-panel);
  white-space: nowrap;
  position: sticky;
  top: 0;
}
.pivot-table th.row-head {
  text-align: left;
  font-weight: 500;
}
.pivot-table td.num, .pivot-table th.num {
  text-align: center;
}
/* Zebra striping for readability */
.pivot-table tbody tr:nth-of-type(even) {
  background-color: rgba(31, 92, 153, 0.045);
}
.pivot-table tbody tr:hover {
  background-color: rgba(31, 92, 153, 0.10);
}
/* Translucent gray, visually separated Total column */
.pivot-table .total-col {
  font-weight: 700;
  background-color: rgba(108, 122, 137, 0.14);
  border-left: 2px solid #b9c4d0;
}
.pivot-table tfoot td {
  font-weight: 700;
  background: #eef4fb;
  border-top: 2px solid #b9c4d0;
}
.pivot-table td.zero {
  color: #ccd4dd;
}

/* Detail grid: color-band rows by pickup location.
   Set Bootstrap's --bs-table-bg so the band colors the (otherwise white) cells. */
.pivot-table.banded tbody tr.pb0 { --bs-table-bg: #cfe2f7; }
.pivot-table.banded tbody tr.pb1 { --bs-table-bg: #fbd9c9; }
.pivot-table.banded tbody tr.pb2 { --bs-table-bg: #cdeed9; }
.pivot-table.banded tbody tr.pb3 { --bs-table-bg: #e6cff2; }
.pivot-table.banded tbody tr.pb4 { --bs-table-bg: #f5ebbf; }
.pivot-table.banded tbody tr.pb5 { --bs-table-bg: #c7eeea; }
.pivot-table.banded tbody tr.pb6 { --bs-table-bg: #f6cfdc; }
.pivot-table.banded tbody tr.pb7 { --bs-table-bg: #d8dde3; }
.pivot-table.banded tbody tr:hover { --bs-table-bg: #fff3cd; }

/* Distinct delivery-location text colors */
.dl-visalia { color: #1F5C99; font-weight: 600; }
.dl-tipton  { color: #C0561E; font-weight: 600; }
.kpi {
  font-size: 2rem;
  font-weight: 700;
  color: var(--cd-blue);
}

/* Grouped (Power BI-style) load-count table */
.grouped-table {
  font-size: .9rem;
}
.grouped-table thead th {
  background: var(--cd-panel);
  white-space: nowrap;
}
.grouped-table .commodity-cell {
  vertical-align: middle;
  font-weight: 600;
  background: #f7fafd;
}
.grouped-table td.num, .grouped-table th.num {
  text-align: right;
  white-space: nowrap;
}
.grouped-table .total-col {
  vertical-align: middle;
  font-weight: 700;
  background: #f7fafd;
}
.grouped-table tfoot td {
  background: #eef4fb;
}

/* ---- Customer landing summary cards ---- */
.summary-card {
  border: 1px solid #d9e2ec;
  border-radius: .75rem;
  overflow: hidden;
  height: 100%;
}
.summary-card .summary-head {
  background: var(--cd-blue);
  color: #fff;
  padding: .75rem 1.25rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.summary-card .summary-head .summary-date {
  font-size: .8rem;
  font-weight: 400;
  opacity: .85;
}
.summary-card .summary-body {
  padding: 1.25rem;
}
.summary-total {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  color: var(--cd-blue);
}
.split-box {
  border: 1px solid #e3e9f0;
  border-radius: .5rem;
  padding: .6rem 1rem;
  text-align: center;
  background: #f7fafd;
}
.split-box .split-label {
  font-size: .8rem;
  color: #6c7a89;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.split-box .split-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #2E75B6;
}
.view-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .25rem;
  height: 100%;
  text-align: left;
  padding: 1rem 1.25rem;
}
.view-btn .view-btn-title { font-size: 1.1rem; font-weight: 600; }
.view-btn .view-btn-sub { font-size: .8rem; opacity: .8; }

/* ---- Mobile-friendly grouped view ---- */
.mobile-panel {
  border: 1px solid #d9e2ec;
  border-radius: .75rem;
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.mobile-panel-head {
  background: var(--cd-blue-2);
  color: #fff;
  padding: .65rem 1rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
}
.commodity-block {
  border-top: 1px solid #e3e9f0;
}
.commodity-block:first-child { border-top: 0; }
.commodity-block .commodity-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #eef4fb;
  padding: .5rem 1rem;
  font-weight: 700;
}
.commodity-block .commodity-row .badge {
  font-size: .9rem;
}
.commodity-block .pickup-row {
  display: flex;
  justify-content: space-between;
  padding: .4rem 1rem .4rem 1.75rem;
  border-top: 1px solid #f0f4f8;
  font-size: .95rem;
}
.commodity-block .pickup-row .pickup-count {
  font-weight: 600;
  color: var(--cd-blue);
}
