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;
  background: linear-gradient(180deg, #f8fbff 0%, #f3f6fb 100%);
  color: #13233c;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.metric-card {
  border: 0;
  border-left: 4px solid #2b66f6;
  border-radius: 12px;
}

.metric-label {
  color: #57606a;
  font-size: 0.9rem;
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
}

.app-nav {
  background: linear-gradient(90deg, #0b2e70 0%, #1243a8 100%);
}

.navbar-brand {
  font-weight: 700;
}

.app-nav .nav-link {
  color: rgba(255, 255, 255, 0.9) !important;
}

.app-nav .nav-link:hover {
  color: #ffffff !important;
}

.app-card {
  border: none;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(15, 43, 92, 0.08);
}

.app-card .card-header {
  background: #ffffff;
  font-weight: 600;
  border-bottom: 1px solid #e8edf5;
}

.btn-primary {
  background-color: #2b66f6;
  border-color: #2b66f6;
}

.table > :not(caption) > * > * {
  padding: 0.8rem;
}

.lane {
  min-height: 120px;
  background: #f8fbff;
  border: 1px dashed #c7d5ee;
  border-radius: 8px;
  padding: 8px;
}

.dispatch-card {
  background: #ffffff;
  border: 1px solid #dbe5f5;
  border-radius: 8px;
  padding: 0;
  margin-bottom: 8px;
  overflow: hidden;
}

.dispatch-card-drag {
  padding: 8px;
  cursor: grab;
}

.dispatch-card .dispatch-open-detail {
  cursor: pointer;
}

.dispatch-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 8px 8px;
}

.dispatch-card-meta {
  color: #1f2f4a;
  font-size: 0.95rem;
  line-height: 1.2;
  min-width: 0;
}

.dispatch-card-footer .dispatch-open-detail {
  flex-shrink: 0;
  --bs-btn-padding-y: 0.25rem;
  --bs-btn-padding-x: 0.85rem;
}

.calendar-pill {
  background: #e9f1ff;
  border-left: 3px solid #2b66f6;
  border-radius: 8px;
  font-size: 0.78rem;
  margin-bottom: 0.35rem;
  padding: 0.35rem 0.5rem;
}

a.calendar-pill {
  color: inherit;
}

a.calendar-pill:hover {
  background: #d9e8ff;
}

.portal-item {
  cursor: pointer;
}

.portal-item:hover {
  background-color: #f3f8ff;
}

.portal-side-panel {
  position: fixed;
  top: 84px;
  right: -360px;
  width: 340px;
  max-width: 90vw;
  background: #fff;
  border-left: 1px solid #d9e3f3;
  box-shadow: -8px 0 24px rgba(15, 43, 92, 0.12);
  border-radius: 12px 0 0 12px;
  padding: 14px;
  transition: right 0.2s ease-in-out;
  z-index: 1050;
}

.portal-side-panel.open {
  right: 0;
}

/* Scrollable data tables / lists (optional client pagination via app-tables.js) */
.app-table-scroll-inner {
  max-height: min(65vh, 28rem);
  overflow: auto;
  border-radius: 0 0 10px 10px;
}

.app-table-scroll-inner .table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background-color: var(--bs-body-bg, #fff);
  box-shadow: inset 0 -1px 0 #dee2e6;
}

.app-table-scroll-inner ul.list-group {
  margin-bottom: 0;
}

/* Client pagination (app-tables.js): stronger control labels */
.app-table-page-nav .btn-outline-dark {
  --bs-btn-color: var(--bs-body-color);
  --bs-btn-border-color: rgba(0, 0, 0, 0.35);
}

/* Customer search modal pager */
.customer-search-pager .page-link {
  color: var(--bs-body-color);
  font-weight: 600;
}

.customer-search-pager .page-item.disabled .page-link {
  color: var(--bs-secondary-color);
  font-weight: 600;
}

/* Submit controls styled as badges (if used) */
button.badge {
  cursor: pointer;
  font-weight: 500;
  line-height: 1;
}
a.badge {
  font-weight: 500;
}

/* Estimates list: compact equal-width actions (~25% smaller than previous step) */
.estimate-row-actions > form.estimate-actions-form {
  display: contents;
  margin: 0;
  padding: 0;
}

.estimate-row-actions .btn.btn-sm.btn-estimate-action {
  min-width: 5.65rem; /* ~75% of 7.53rem */
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  --bs-btn-padding-y: 0.125rem;
  --bs-btn-padding-x: 0.3rem;
  margin: 0;
  box-sizing: border-box;
}

/* Navbar logo (custom upload or demo vertical asset) */
.app-navbar-logo {
  height: 36px;
  width: auto;
  max-width: min(220px, 42vw);
  object-fit: contain;
  display: block;
}

.app-navbar-logo-preview {
  height: 40px;
  width: auto;
  max-width: 240px;
  object-fit: contain;
  display: block;
}