/*
 * BranchDaily Web — Unified Internal Page Header
 *
 * Desktop/tablet:
 * - Matches the Daily Report header proportions/width.
 * - Keeps the light-blue identity requested for internal pages.
 * - Makes page content shells use the same usable width as the header.
 *
 * Mobile:
 * - Intentionally preserves the compact app-like layout.
 */

@media (min-width: 801px) {
  .bd-screen:not(.narrow) {
    width: min(1280px, calc(100% - 56px));
    padding-top: 24px;
  }

  .bd-topbar {
    min-height: 76px;
    margin-bottom: 18px;
    padding: 12px 16px;
    border: 1px solid rgba(198, 220, 229, .95);
    border-radius: 23px;
    background: linear-gradient(180deg, #eef7fb 0%, #e7f3f8 100%);
    color: var(--bd-on-primary-container);
    box-shadow: 0 8px 30px rgba(28, 66, 82, .055);
    display: grid;
    grid-template-columns: minmax(48px, 1fr) auto minmax(48px, 1fr);
    align-items: center;
    gap: 10px;
  }

  .bd-topbar-title {
    min-width: 0;
    text-align: center;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 1px;
  }

  .bd-topbar-title > span {
    display: block;
    color: var(--bd-primary);
    font-size: 10px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: .3px;
  }

  .bd-topbar h1 {
    margin: 2px 0 0;
    font-size: 22px;
    line-height: 1.3;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
  }

  .bd-topbar > .bd-icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(255,255,255,.78);
    color: var(--bd-primary);
    justify-self: start;
  }

  .bd-topbar > .bd-icon-btn:hover {
    background: #fff;
  }

  .bd-topbar > .bd-icon-btn .bd-icon {
    width: 22px;
    height: 22px;
  }

  .bd-topbar-actions {
    min-width: 48px;
    justify-self: end;
  }

  .bd-topbar-actions .bd-icon-btn,
  .bd-topbar-actions .bd-topbar-text-action {
    background: rgba(255,255,255,.76);
  }

  /*
   * These pages previously had narrower inner shells (780–1040 px),
   * which made the header look detached from the cards beneath it.
   * On desktop they now use the same content width as the shared header.
   */
  .bd-screen:not(.narrow) .history-shell,
  .bd-screen:not(.narrow) .notifications-shell,
  .bd-screen:not(.narrow) .server-admin-shell,
  .bd-screen:not(.narrow) .departments-layout,
  .bd-screen:not(.narrow) .account-layout,
  .bd-screen:not(.narrow) .developer-shell {
    width: 100%;
    max-width: none;
    margin-inline: 0;
  }
}

/*
 * Mobile is intentionally kept compact and app-like.
 * Only the title wrapper is normalized; existing mobile sizes stay intact.
 */
@media (max-width: 800px) {
  .bd-topbar {
    grid-template-columns: 44px minmax(0,1fr) 44px;
  }

  .bd-topbar-title {
    min-width: 0;
    text-align: center;
  }

  .bd-topbar-title > span {
    display: none;
  }

  .bd-topbar-title h1,
  .bd-topbar h1 {
    margin: 0;
    font-size: 17px;
    line-height: 1.35;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .bd-topbar-actions {
    min-width: 44px;
  }
}
