/* RecoHR app shell (E46.1, reco-devops#476; DESIGN.md §5).
   Top bar with the main menu from 1024 px, ☰ drawer and dock below it, account menu, notification
   panel, search dialog, footer. Ported from the approved prototype (reco-demo/recohr/assets/hr.css:
   .topbar, .nav, .dock, .fab; admin.css: drawer). Loaded after ui.css; values come from tokens.css.
   Layers: dock 1010 < top bar 1020 (drawer, scrim and panels live inside it) < Bootstrap modals. */

[data-shell] [hidden], .shell-scrim[hidden] { display: none !important; }

/* ---------- Skip link ---------- */
.skip-link {
  position: fixed; left: 12px; top: -80px; z-index: 1100;
  padding: 10px 14px; border-radius: var(--radius-md);
  background: var(--navy); color: var(--white); font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; color: var(--white); }
.main-content:focus { outline: none; }

/* ---------- Maintenance banner for staff (BR-HRF-10) ---------- */
.maint-strip {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 12px;
  padding: 8px 16px; background: var(--orange-button); color: var(--white);
  font-size: 0.86rem; font-weight: 700; text-align: center;
}
.maint-strip a { color: var(--white); text-decoration: underline; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 1020; border-bottom: 1px solid var(--line); }
.topbar::before {
  /* Blur on a pseudo-element: a backdrop-filter on .topbar itself would trap the fixed drawer. */
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.topbar-in {
  height: var(--header-h); display: flex; align-items: center; gap: 10px;
  max-width: var(--container-max); margin-inline: auto; padding-inline: var(--gutter);
}
@media (min-width: 1024px) { .topbar-in { gap: 14px; } }
/* Brand = the horizontal RECO logo (same file as Sales Hub); the stacked one is for single screens. */
:where(.topbar, .site-footer) .brand { display: inline-flex; align-items: center; flex: none; text-decoration: none; }
:where(.topbar, .site-footer) .brand img { display: block; height: 32px; width: auto; }
.site-footer .brand img { height: 28px; }
.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topbar .icon-btn {
  position: relative; flex: none; width: var(--touch-min); height: var(--touch-min); padding: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: var(--white); color: var(--navy); cursor: pointer; text-decoration: none;
}
.topbar .icon-btn:hover { border-color: var(--navy); }
.topbar .icon-btn .dot {
  position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--orange); box-shadow: 0 0 0 2px var(--white);
}
@media (min-width: 1024px) { .topbar-burger { display: none !important; } }
.topbar a:focus-visible, .topbar button:focus-visible, .dock a:focus-visible, .dock button:focus-visible,
.site-footer a:focus-visible { outline: 2px solid var(--navy-2); outline-offset: 2px; }
.topbar .lang-switch { display: inline-flex; padding: 3px; border-radius: var(--radius-md); background: var(--soft); }
.topbar .lang-switch a {
  display: inline-flex; align-items: center; min-height: 36px; padding: 6px 10px; border-radius: var(--radius-sm);
  font-size: 0.8rem; font-weight: 600; color: var(--muted); text-decoration: none;
}
.topbar .lang-switch a[aria-current="true"] { background: var(--white); color: var(--navy); box-shadow: 0 2px 8px rgb(8 39 67 / 0.1); }

/* ---------- Main menu: horizontal from 1024 px ---------- */
.shell-nav-head { display: none; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 2px; }
.nav-link {
  position: relative; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 8px 10px;
  border: 0; border-radius: var(--radius-md); background: none; cursor: pointer; white-space: nowrap;
  font: inherit; font-size: 0.9rem; font-weight: 600; color: var(--ink); text-decoration: none;
  transition: background 0.16s ease;
}
.nav-link:hover { background: var(--soft); color: var(--navy); }
.nav-link[aria-current="page"], .nav-link[data-current] { color: var(--navy); background: color-mix(in srgb, var(--orange) 13%, transparent); }
.nav-link svg.i { width: 18px; height: 18px; }
.nav-link .caret { width: 15px; height: 15px; transition: transform 0.16s ease; }
.nav-link[aria-expanded="true"] .caret { transform: rotate(180deg); }
.nav-panel { display: none; }
.nav-dd > .nav-link[aria-expanded="true"] + .nav-panel { display: block; }
.nav-groups { display: grid; gap: 4px 18px; }
.nav-group { min-width: 0; }
.nav-group-title {
  margin: 8px 10px 4px; font-family: var(--font-body); font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.nav-group ul { list-style: none; margin: 0; padding: 0; }
.nav-group a {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 10px; border-radius: var(--radius-md);
  color: var(--ink); text-decoration: none; font-size: 0.9rem; line-height: 1.3;
}
.nav-group a:hover { background: var(--soft); color: var(--navy); }
.nav-group a svg.i { width: 18px; height: 18px; color: var(--muted); }
.nav-group a:hover svg.i { color: var(--navy); }

@media (min-width: 1024px) {
  .shell-nav { min-width: 0; }
  .nav-panel {
    position: fixed; top: calc(var(--header-h) + 6px); left: 50%; transform: translateX(-50%); z-index: 2;
    width: min(var(--panel-w, 760px), calc(100vw - 2 * var(--gutter)));
    max-height: calc(100vh - var(--header-h) - 24px); overflow-y: auto; padding: 12px;
    background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-float);
  }
  .nav-dd-wide { --panel-w: 1120px; }
  .nav-panel .nav-groups { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
@media (min-width: 1024px) and (max-width: 1279.98px) {
  /* Text only between 1024 and 1280 so the seven entries fit next to search, bell and account. */
  .nav-list > li > .nav-link > svg.i:first-child { display: none; }
  .nav-link { padding-inline: 9px; }
}
@media (min-width: 1024px) {
  /* Set by shell.js when the menu still does not fit (reco-devops#1469). */
  .shell-nav.is-tight .nav-list > li > .nav-link > svg.i:first-child { display: none; }
  .shell-nav.is-tight .nav-link { padding-inline: 9px; }
}

/* ---------- Drawer under 1024 px ---------- */
@media (max-width: 1023.98px) {
  .shell-nav {
    position: fixed; inset: 0 auto 0 0; z-index: 3; width: min(340px, 88vw);
    display: flex; flex-direction: column; background: var(--white); box-shadow: var(--shadow-float);
    transform: translateX(-102%); visibility: hidden; transition: transform 0.22s ease, visibility 0s linear 0.22s;
  }
  .shell-nav.is-open { transform: none; visibility: visible; transition: transform 0.22s ease; }
  .shell-nav-head {
    display: flex; align-items: center; justify-content: space-between; flex: none;
    height: var(--header-h); padding: 0 10px 0 var(--gutter); border-bottom: 1px solid var(--line);
  }
  .nav-list { flex: 1; flex-direction: column; align-items: stretch; gap: 2px; overflow-y: auto; padding: 10px 10px 24px; overscroll-behavior: contain; }
  .nav-link { width: 100%; min-height: var(--touch-min); padding: 10px 12px; }
  .nav-link .caret { margin-left: auto; }
  .nav-panel { padding: 0 0 8px 12px; }
  .nav-group a { min-height: var(--touch-min); }
  .shell-scrim { position: fixed; inset: 0; z-index: 2; background: rgb(5 25 40 / 0.45); }
}
@media (min-width: 1024px) { .shell-scrim { display: none !important; } }
@media (max-width: 1023.98px) { body.shell-locked { overflow: hidden; } }
@media (prefers-reduced-motion: reduce) { .shell-nav, .shell-nav.is-open { transition: none; } }

/* ---------- Account menu and notification panel ---------- */
.shell-dd { position: relative; }
.shell-panel {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 2;
  width: min(360px, calc(100vw - 2 * var(--gutter))); max-height: calc(100vh - var(--header-h) - 24px); overflow-y: auto;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-float);
  text-align: left;
}
@media (max-width: 767.98px) {
  .shell-panel { position: fixed; top: calc(var(--header-h) + 8px); left: var(--gutter); right: var(--gutter); width: auto; }
}
.me {
  display: inline-flex; align-items: center; gap: 10px; min-height: var(--touch-min); padding: 2px; border: 0;
  border-radius: var(--radius-pill); background: none; cursor: pointer; font: inherit; text-align: left; color: inherit;
}
.me .avatar.sm { width: 36px; height: 36px; }
.account-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 12px; border-bottom: 1px solid var(--line); }
.account-who { min-width: 0; }
.account-who b { display: block; font-size: 0.95rem; color: var(--navy); overflow-wrap: anywhere; }
.account-who span { font-size: 0.8rem; color: var(--muted); }
.menu-title { margin: 10px 18px 0; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.menu-list { list-style: none; margin: 0; padding: 4px 8px; }
.menu-list > li > form { display: contents; }
.menu-list > li > a, .menu-list > li > button, .menu-list > li > form > button {
  width: 100%; display: flex; align-items: center; gap: 10px; min-height: var(--touch-min); padding: 8px 10px;
  border: 0; border-radius: var(--radius-md); background: none; cursor: pointer; text-align: left;
  font: inherit; font-size: 0.9rem; color: var(--ink); text-decoration: none;
}
.menu-list > li > a:hover, .menu-list > li > button:hover, .menu-list > li > form > button:hover { background: var(--soft); color: var(--navy); }
.menu-list svg.i { width: 18px; height: 18px; color: var(--muted); }
.menu-list .danger, .menu-list .danger svg.i { color: var(--danger); }
.menu-foot { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.lang-row { display: flex; align-items: center; gap: 10px; min-height: var(--touch-min); padding: 4px 10px; font-size: 0.9rem; }
.lang-row > svg.i { width: 18px; height: 18px; color: var(--muted); }
.lang-row .lang-switch { margin-left: auto; }

.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 1.04rem; }
.panel-head .muted { font-size: 0.8rem; }
.notif-list { list-style: none; margin: 0; padding: 4px 0; }
.notif-item {
  width: 100%; display: flex; gap: 10px; padding: 10px 16px; border: 0; background: none; cursor: pointer;
  font: inherit; text-align: left; color: var(--ink);
}
.notif-item:hover { background: var(--soft); }
.notif-item.unread { background: color-mix(in srgb, var(--notice) 70%, var(--white)); }
.notif-item .ico-tile { width: 34px; height: 34px; border-radius: 10px; }
.notif-item .ico-tile svg.i { width: 17px; height: 17px; }
.notif-item .txt { min-width: 0; flex: 1; }
.notif-item b { display: block; font-size: 0.88rem; color: var(--navy); }
.notif-item p {
  margin: 2px 0 0; font-size: 0.8rem; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.notif-item time { display: block; margin-top: 2px; font-size: 0.72rem; color: var(--muted); }
.notif-msg { padding: 24px 16px; text-align: center; color: var(--muted); font-size: 0.88rem; }
.panel-foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; padding: 8px 16px;
  border-top: 1px solid var(--line); background: color-mix(in srgb, var(--soft) 50%, var(--white));
}
.panel-foot a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font-size: 0.84rem; font-weight: 700; color: var(--navy-2); text-decoration: none; }
.panel-foot a svg.i { width: 16px; height: 16px; }

/* ---------- Search dialog ---------- */
.topbar dialog.gs-dialog { width: min(640px, calc(100vw - 32px)); margin: 10vh auto auto; }
@media (max-width: 767.98px) {
  .topbar dialog.gs-dialog { width: 100vw; max-height: 88vh; margin: 0 0 auto; border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
  .topbar dialog.gs-dialog[open] { animation: none; }
}
.gs-head { display: flex; align-items: center; gap: 8px; padding: 14px 12px 12px 16px; border-bottom: 1px solid var(--line); }
.gs-form { flex: 1; min-width: 0; }
.gs-form .inp { min-height: 48px; font-size: 1rem; }
.gs-results { max-height: min(60vh, 520px); overflow-y: auto; padding: 6px 8px 10px; }
.gs-section h3 { margin: 10px 8px 4px; font-family: var(--font-body); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.gs-section ul { list-style: none; margin: 0; padding: 0; }
.gs-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--radius-md); color: var(--ink); text-decoration: none; }
.gs-item:hover, .gs-item:focus-visible { background: var(--soft); }
.gs-item .ico-tile { width: 36px; height: 36px; border-radius: 10px; }
.gs-item .txt { min-width: 0; }
.gs-item b { display: block; font-size: 0.92rem; color: var(--navy); }
.gs-item .sub { display: block; font-size: 0.8rem; color: var(--muted); }
.gs-item mark { background: var(--notice); color: inherit; padding: 0 1px; border-radius: 3px; }
.gs-msg { padding: 18px 10px; text-align: center; color: var(--muted); font-size: 0.88rem; }
.gs-foot { margin: 0; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 0.76rem; }
@media (hover: none) { .gs-foot { display: none; } }  /* the shortcut hint means nothing on a touch screen (reco-devops#1792) */
.gs-foot kbd { font: inherit; font-size: 0.72rem; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line); background: var(--soft); color: var(--ink); }

/* ---------- Dock under 1024 px ---------- */
.dock, .dock-spacer { display: none; }
@media (max-width: 1023.98px) {
  .dock-spacer { display: block; flex: none; height: calc(var(--dock-h) + env(safe-area-inset-bottom)); }
  .dock {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1010;
    height: calc(var(--dock-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    background: color-mix(in srgb, var(--white) 94%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
  }
}
.dock > a, .dock > button {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-width: 0; padding: 0 2px; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 0.68rem; font-weight: 600; color: var(--muted); text-decoration: none;
}
.dock > a > span:last-child, .dock > button > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock svg.i { width: 21px; height: 21px; }
.dock > a > .count { position: absolute; top: 8px; left: calc(50% + 6px); }
.nav-link .count { margin-left: 2px; }
.dock > [aria-current="page"] { color: var(--orange-text); }
.dock > [aria-current="page"]::before {
  content: ''; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--orange);
}
.dock .fab .fab-ring {
  width: 54px; height: 54px; margin-top: -26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, var(--orange), var(--orange-button)); color: var(--white);
  box-shadow: 0 10px 24px rgb(193 85 11 / 0.36), 0 0 0 5px var(--paper);
}
.dock .fab .fab-ring svg.i { width: 24px; height: 24px; }
.dock .fab[aria-current="page"]::before { display: none; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--white); padding: 22px var(--gutter) 14px; font-size: 0.84rem; color: var(--muted); }
.site-footer-in { max-width: var(--container-max); margin: 0 auto; display: grid; gap: 14px; }
@media (min-width: 768px) { .site-footer-in { grid-template-columns: 1.4fr 1fr; align-items: start; } }
.site-footer p { margin: 6px 0 0; }
.site-footer-name { color: var(--navy); font-weight: 600; }
.site-footer-contact { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer-contact li { display: flex; align-items: baseline; gap: 8px; }
.site-footer-contact i { width: 16px; flex: none; color: var(--muted); }
.site-footer-bottom {
  max-width: var(--container-max); margin: 14px auto 0; padding-top: 12px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; font-size: 0.78rem;
}
.site-footer-bottom a { color: var(--navy-2); font-weight: 600; }
