/* Shared layout rules for authenticated dashboard shells. Keep page-specific
   card and form styles in the page so this file only controls the chrome. */
.dashboard-shell {
  --shell-control-height: 34px;
}

.dashboard-shell .topnav-left {
  min-width: 0;
  flex: 1 1 auto;
}

.dashboard-shell .logo,
.dashboard-shell .brand {
  flex: 0 0 auto;
  min-width: 0;
}

.dashboard-shell .logo svg {
  width: 26px !important;
  height: 26px !important;
  flex: 0 0 26px;
}

.dashboard-shell .logo-mark,
.dashboard-shell .brand-mark {
  width: 26px;
  height: 26px;
  min-width: 26px;
  flex: 0 0 26px;
}

.dashboard-shell .logo > span,
.dashboard-shell .brand-name {
  white-space: nowrap;
  flex: 0 0 auto;
}

.dashboard-shell .nav-tabs {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 0.25rem;
}

.dashboard-shell--operator .nav-tabs {
  flex: 1 1 auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.dashboard-shell--operator .nav-tabs::-webkit-scrollbar {
  display: none;
}

.dashboard-shell .nav-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.5rem;
  min-height: var(--shell-control-height);
  padding: 0.4rem 0.65rem;
  line-height: 1.2;
  white-space: nowrap;
  flex: 0 0 auto;
}

.dashboard-shell .topnav-right {
  min-width: 0;
  flex: 0 1 auto;
  gap: 0.5rem;
  white-space: nowrap;
}

.dashboard-shell .lang-switch,
.dashboard-shell .lang-toggle {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: var(--shell-control-height);
}

.dashboard-shell .lang-switch button,
.dashboard-shell .lang-toggle .lang-btn,
.dashboard-shell > .topnav-right > .lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 28px;
  white-space: nowrap;
}

.dashboard-shell .btn-logout,
.dashboard-shell #logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--shell-control-height);
  padding: 0 0.7rem;
  white-space: nowrap;
  flex: 0 0 auto;
}

.dashboard-shell .page-label {
  min-width: 0;
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 0 1 11rem;
}

.dashboard-shell--agency .agency-pill {
  min-width: 0;
  max-width: 12rem;
  white-space: nowrap;
}

.dashboard-shell--agency .agency-pill span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Owner-side driver fleet header. */
.driver-fleet-header {
  align-items: center;
  gap: 1rem;
}

.driver-fleet-header .page-title {
  min-width: 0;
  flex: 1 1 14rem;
}

.driver-fleet-header .header-actions,
.driver-portal-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  min-width: 0;
  flex: 0 1 auto;
  flex-wrap: wrap;
}

.driver-fleet-header .header-actions > *,
.driver-portal-header-actions > * {
  min-height: 34px;
  flex: 0 0 auto;
}

/* Driver portal headers no longer rely on absolute positioning for actions. */
.setup-header > div:first-child,
.trip-header > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}

.setup-header .lang-toggle,
.trip-header .lang-toggle {
  position: static;
  inset: auto;
}

.setup-header .setup-badge,
.trip-header .trip-logout {
  white-space: nowrap;
}

/* Keep status controls equal and let translated labels wrap inside them. */
.status-grid {
  align-items: stretch;
}

.status-grid .btn-status {
  min-width: 0;
  width: 100%;
  min-height: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  align-content: center;
  flex-wrap: wrap;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

.screen > .lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 34px;
  white-space: nowrap;
}

.app-header .header-left {
  min-width: 0;
  flex: 1 1 auto;
}

.app-header .header-logout {
  min-height: 34px;
  white-space: nowrap;
  flex: 0 0 auto;
}

@media (max-width: 680px) {
  .dashboard-shell {
    padding-left: 1rem;
    padding-right: 1rem;
    gap: 0.5rem;
  }

  .dashboard-shell--operator .topnav-left {
    gap: 0.5rem;
  }

  .dashboard-shell--operator .nav-tabs {
    gap: 0.125rem;
  }

  .dashboard-shell--operator .nav-tab {
    min-width: 4.25rem;
    padding-left: 0.55rem;
    padding-right: 0.55rem;
  }

  .dashboard-shell--agency {
    flex-wrap: wrap;
    row-gap: 0.4rem;
  }

  .dashboard-shell--agency .topnav-left {
    flex: 1 1 100%;
  }

  .dashboard-shell--agency .topnav-right {
    margin-left: auto;
  }

  .dashboard-shell--agency .page-label {
    max-width: 9rem;
  }

  .dashboard-shell--agency .agency-pill {
    max-width: 10rem;
  }

  .driver-fleet-header .header-actions,
  .driver-portal-header-actions {
    flex: 1 1 auto;
  }
}

@media (max-width: 600px) {
  .dashboard-shell--map {
    padding: 0.5rem 0.75rem;
  }

  .dashboard-shell--map .topnav-left {
    gap: 0.5rem;
  }

  .dashboard-shell--map .nav-tabs {
    display: none;
  }

  .dashboard-shell--map .logo {
    font-size: 1rem;
  }

  .dashboard-shell--map .logo svg {
    width: 24px !important;
    height: 24px !important;
    flex-basis: 24px;
  }

  .dashboard-shell--map .topnav-right {
    gap: 0.35rem;
  }

  .dashboard-shell--map #sub-badge {
    padding-left: 0.55rem;
    padding-right: 0.55rem;
    font-size: 0.68rem;
  }

  .dashboard-shell--map .status-text {
    max-width: 4rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .dashboard-shell--map #logout-btn {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

@media (max-width: 420px) {
  .dashboard-shell--agency .page-label {
    max-width: 7rem;
  }

  .dashboard-shell--agency .agency-pill {
    max-width: 8.5rem;
  }

  .driver-fleet-header {
    align-items: flex-start;
  }

  .driver-fleet-header .header-actions {
    width: 100%;
    justify-content: flex-start;
  }
}
