/* Shared navigation, compact content actions and comfortable touch targets. */
.local-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 22px;
  line-height: 1.2;
}
.local-brand .icon {
  width: 30px;
  height: 30px;
  flex: none;
}
.brand .local-brand {
  margin: 8px 0 14px;
}
.login-brand {
  margin-bottom: 28px;
  font-size: 25px;
}
.login-brand .icon {
  width: 34px;
  height: 34px;
}
.account-nav {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
}
.nav-link:hover,
.more-menu a:hover,
.more-menu button:hover {
  background: var(--surface2);
}
.nav-link.active,
.nav-link.active:hover {
  background: var(--active-bg);
  color: var(--active-text);
}
.more-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.more-menu a,
.more-menu button {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
}
.more-menu :is(a, button) > span {
  flex: 1;
}
.more-menu :is(a, button) > .icon:last-child {
  width: 16px;
  color: var(--muted);
}
:is(.tabs, .tab-bar, .personal-tabs, .personal-notification-filters, .inventory-group-tabs) .btn.btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}
:is(.tabs, .tab-bar, .personal-tabs, .personal-notification-filters, .inventory-group-tabs)
  .btn.btn:hover {
  background: var(--surface2);
  color: var(--text);
}
:is(.tabs, .tab-bar, .personal-tabs, .personal-notification-filters, .inventory-group-tabs)
  .btn.btn.active,
:is(.tabs, .tab-bar, .personal-tabs, .personal-notification-filters, .inventory-group-tabs)
  .btn.btn.active:hover {
  background: var(--active-bg);
  color: var(--active-text);
  box-shadow: none;
}
:is(button, a, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
.admin-workspace .review-line {
  border-bottom: 0;
}
.admin-workspace .review-line:has(+ .review-line) {
  border-bottom: 1px solid var(--line);
}
.mission-configure,
.fleet-tile .icon-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
}
.mission-configure .icon,
.fleet-tile .icon-btn .icon {
  width: 18px;
  height: 18px;
  position: relative;
  z-index: 1;
}
.model-card-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 24px;
}
.model-card-actions .text-btn {
  min-height: 44px;
  white-space: normal;
}
.model-card-actions .text-btn:disabled {
  opacity: 1;
  color: var(--muted);
  cursor: default;
  background: transparent;
}
.model-action-help {
  display: block;
  min-height: 16px;
  text-align: center;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
}
.inventory-save-state {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.inventory-save-state[data-state="local"],
.inventory-save-state[data-state="error"] {
  color: var(--amber);
}
.inventory-draft-recovery {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px;
  background: var(--blue-soft);
  border-radius: 12px;
  margin-bottom: 20px;
}
.inventory-draft-recovery p {
  flex: 1;
  min-width: 160px;
  margin: 0;
}
@media (max-width: 900px) {
  .topbar .view-switch {
    display: flex;
    flex-shrink: 0;
    padding: 2px;
    gap: 1px;
  }
  .view-switch button {
    min-height: 44px;
    padding: 6px 8px;
    font-size: 11px;
  }
  .top-actions {
    gap: 6px;
  }
  .top-actions .icon-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }
  .topbar {
    gap: 6px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .mobile-brand {
    font-size: 13px;
    gap: 5px;
    flex-shrink: 0;
  }
  .mobile-brand .icon {
    width: 23px;
    height: 23px;
  }
  .profile-btn {
    padding: 0;
    min-height: 44px;
    min-width: 44px;
    justify-content: center;
  }
  .profile-btn .avatar {
    width: 36px;
    height: 36px;
  }
  .mobile-nav > a,
  .mobile-nav > button {
    min-height: 56px;
    min-width: 0;
    flex: 1;
  }
  .mobile-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
@media (max-width: 360px) {
  .topbar .profile-btn {
    display: none;
  }
  .top-actions {
    gap: 4px;
  }
  .topbar {
    padding-left: 10px;
    padding-right: 10px;
  }
}
@media (pointer: coarse) {
  button,
  .btn,
  .icon-btn,
  .checkbox-label,
  .nav-link,
  summary {
    min-height: 44px;
  }
  .checkbox-label {
    display: flex;
    align-items: center;
  }
  .icon-btn {
    min-width: 44px;
  }
  .inventory-line .check-quantity button {
    min-width: 44px;
    min-height: 44px;
  }
}

@media (pointer: coarse) {
  .inventory-tick {
    min-width: 44px;
    min-height: 44px;
  }
}
@media (pointer: coarse) and (max-width: 700px) {
  #check-form .inventory-line {
    grid-template-columns: 44px minmax(0, 1fr);
  }
}

/* A single visible frame; keep the full touch target. */
.mission-configure, .fleet-tile .icon-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 10px;
}
.mission-date-pending {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border-radius: 8px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 12px;
}
.mission-date-pending .icon {
  flex: none;
  width: 18px;
  height: 18px;
}
.fleet-ledger-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}
.fleet-ledger {
  min-width: 1100px;
}
.fleet-ledger td:nth-child(3) {
  min-width: 0;
  max-width: none;
  white-space: nowrap;
}
.fleet-ledger .trip-purpose {
  min-width: 240px;
  max-width: 320px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.fleet-ledger .trip-purpose small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}
/* Keep the close action visible while a long dialog scrolls. */
.modal {
  --dialog-pad-x: 27px;
  --dialog-pad-y: 27px;
}
.modal > .modal-header {
  max-width: none;
  position: sticky;
  top: calc(-1 * var(--dialog-pad-y));
  z-index: 5;
  padding: var(--dialog-pad-y) var(--dialog-pad-x) 16px;
  margin: calc(-1 * var(--dialog-pad-y)) calc(-1 * var(--dialog-pad-x)) 20px;
  background: var(--surface);
}
@media (max-width: 700px) {
  .modal {
    --dialog-pad-x: 18px;
    --dialog-pad-y: 22px;
  }
}

.fleet-tile .row.between > .fleet-actions {
  gap: 0;
}
.fleet-actions > .badge {
  margin-right: 8px;
}
.mission-vehicle .vehicle-details {
  margin-top: 12px;
}
@media (max-width: 900px) {
  .mission-aside > .mission-team {
    order: -2;
  }
}
.audit-views {
  margin: 16px 0;
}

/* Interactive colors and hover feedback are defined by role in theme.css. */
:is(.btn, .icon-btn):is(:disabled, [aria-disabled="true"]) {
  transform: none;
  box-shadow: none;
}
@media (prefers-reduced-motion: reduce) {
  :is(.btn, .icon-btn) {
    transition: none;
  }
}
