/* Hallmark · checked: 2026-11-07 · genre: modern-minimal (inferred)
 * floor: 0 new FAIL (2 pre-existing on Reports: 34, 73) · fixed: 40 search field edge, 40 badge, 48 badge literal, 49a "Open cases" wrap · structural: app bar, grouped sidebar, Home v3
 * Hallmark · reworded "Good morning, Visitor" heading kept as the greeting; dropped the old "Last 7 days" stats card and its 28.4%/24.2%/93.2% figures · replaced by the five Home stat tiles
 * Hallmark · kept the Cases search form (view + q): the lint keys forms by action and now meets the top-bar search first, which also submits to /cases
 * built: the project · redesign: polish · v2.0.0 */
/* Workspace app shell: shared by the workspace pages and the Reports page (today's dashboard, served inside the workspace).
   Grouped sidebar, collapse to icons, top bar (search, action, notifications, account), phone tab bar, the unlock moment, Reports loading. */
:root { --nav-accent: #1F5BFF; --nav-paper: #FFFFFF; --nav-ink: #C5D2EA; --nav-muted: #9AA9C6; --nav-on: #12295A; --nav-deep: #061229;
  --nav-hair: rgba(255,255,255,.08); --nav-line: rgba(255,255,255,.14); --nav-line-strong: rgba(255,255,255,.3); --nav-focus: #8FB0FF;
  --nav-shadow: 0 6px 16px rgba(6,18,41,.14); --nav-alert: #B82E2E; --side-w: 236px; }
.side :focus-visible, .tabs :focus-visible, .skip:focus-visible { outline: 3px solid var(--nav-focus); outline-offset: 2px; }
.appbar :focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }  /* on the page surface; --nav-focus is for navy */
.nav .count { margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: 999px; background: var(--nav-accent); color: var(--nav-paper);
  font-size: 11.5px; font-weight: 600; text-align: center; }
.nav .subnav { margin: 2px 0 8px; }
.nav .subnav a { padding: 6px 12px 6px 38px; font-size: 13px; color: var(--nav-muted); }
a.brand { color: inherit; border-radius: 8px; }
.agent-line { margin-bottom: 12px; }
.tabs { display: none; }
.skip { position: absolute; left: 8px; top: 8px; transform: translateY(-200%); z-index: 70; background: var(--nav-accent); color: var(--nav-paper); padding: 8px 12px; border-radius: 8px; }
.skip:focus { transform: none; }

/* Grouped sidebar: groups fold open and shut (remembered), the list scrolls, the footer stays put */
.side .groups { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 0 -8px; padding: 0 8px 8px; scrollbar-width: thin; }
.grp { margin-bottom: 4px; }
.groups .nav a, .side .groups a { padding-top: 7px; padding-bottom: 7px; }  /* the 13 items fit a 900px-tall screen */
.grp > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; cursor: pointer; border-radius: 6px;
  padding: 8px 12px 4px; color: var(--nav-muted); font-size: 12px; font-weight: 600; }
.grp > summary::-webkit-details-marker { display: none; }
.grp > summary::after { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); margin-right: 2px; }
.grp:not([open]) > summary::after { transform: rotate(-45deg); }
.grp > summary:hover { color: var(--nav-paper); }
.side-foot { padding-top: 10px; border-top: 1px solid var(--nav-hair); }
.side-foot .nav { margin: 0 -8px 4px; }
.side-foot .nav a, .side-foot .nav button { font-size: 13px; padding: 7px 12px; }
.side-foot .nav form { margin: 0; }
.side-foot .nav button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; border-radius: 8px; background: none;
  color: var(--nav-ink); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; text-align: left; }
.side-foot .nav button:hover { background: var(--navy-900); color: var(--nav-paper); }
.side-foot .nav button svg { width: 16px; height: 16px; opacity: .85; flex: none; }
.collapse { display: flex; align-items: center; gap: 10px; width: calc(100% + 16px); margin: 0 -8px; padding: 7px 12px; border: 0; border-radius: 8px;
  background: none; color: var(--nav-muted); font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.collapse:hover { background: var(--nav-hair); color: var(--nav-paper); }
.collapse svg { width: 16px; height: 16px; flex: none; }

/* Collapsed to icons (desktop only; remembered per browser) */
@media (min-width: 821px) {
  .side-mini { --side-w: 72px; }
  .side-mini .side { width: 72px; padding-left: 12px; padding-right: 12px; }
  .side-mini main { margin-left: 72px; }
  .side-mini .side .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .side-mini .client, .side-mini .subnav, .side-mini .agent-line { display: none; }
  .side-mini .brand { width: 34px; overflow: hidden; padding: 0 0 26px 4px; }
  .side-mini .brand svg { flex: none; }
  .side-mini .nav a, .side-mini .side-foot .nav button { position: relative; justify-content: center; padding-left: 0; padding-right: 0; }
  .side-mini .grp > summary { font-size: 0; padding: 8px 6px; }
  .side-mini .grp > summary::after { display: none; }
  .side-mini .grp > summary::before { content: ""; flex: 1; height: 1px; background: var(--nav-line); }
  .side-mini .side-foot { padding-left: 0; padding-right: 0; }
  .side-mini .side-foot .nav { margin: 0 0 4px; }
  .side-mini .collapse { width: 100%; margin: 0; justify-content: center; padding-left: 0; padding-right: 0; }
  .side-mini .collapse svg { transform: scaleX(-1); }
  .side-mini .nav .count { position: absolute; top: 1px; right: 2px; min-width: 16px; padding: 0 4px; font-size: 10px; line-height: 16px; }
}

/* Top bar: search, the one action that needs you, notifications, account */
.appbar { position: sticky; top: 0; z-index: 25; display: flex; align-items: center; gap: 12px; margin: -28px -36px 22px; padding: 10px 36px;
  background: var(--bg); border-bottom: 1px solid var(--line); }
html { scroll-padding-top: 76px; }  /* WCAG 2.4.11: focus never lands under the sticky top bar */
.appbar-brand, .search-open { display: none; }
.appbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.appbar .btn { white-space: nowrap; }
.appbar .btn svg { width: 16px; height: 16px; }
.search { position: relative; flex: 0 1 440px; min-width: 0; }
.search > svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { min-height: 40px; padding: 8px 64px 8px 36px; }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px;
  font: 500 12px/1.4 var(--font-body, inherit); color: var(--muted); background: var(--soft); pointer-events: none; }
.search-results { position: absolute; left: 0; top: calc(100% + 6px); z-index: 40; width: max(100%, 420px); max-height: 420px; overflow-y: auto; padding: 6px;
  border-radius: 12px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--nav-shadow); }
.search-results a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.search-results a b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results a small { display: block; color: var(--muted); font-size: 12.5px; }
.search-results a[aria-selected="true"], .search-results a:hover { background: var(--soft); }
.search-results p { padding: 10px; color: var(--muted); }
.notif, .acct { position: relative; }
.notif > summary, .acct > summary { list-style: none; margin: 0; cursor: pointer; }
.notif > summary::-webkit-details-marker, .acct > summary::-webkit-details-marker { display: none; }
.notif > summary { position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); color: var(--text); }
.notif > summary:hover { border-color: var(--muted); }
.notif > summary svg { width: 18px; height: 18px; }
.dotn { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--nav-alert);  /* fixed in both themes: 5.9:1 with white */
  color: var(--nav-paper); font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; }
.notif-menu, .acct-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; padding: 8px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--nav-shadow); }
.notif-menu { width: 320px; }
.notif-head { display: block; padding: 6px 8px 8px; font-weight: 600; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.notif-item { display: flex; gap: 10px; align-items: baseline; padding: 9px 8px; border-radius: 8px; color: var(--text); font-size: 13.5px; }
.notif-item:hover { background: var(--soft); }
.notif-item i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.notif-item i.bad { background: var(--red); } .notif-item i.warn { background: var(--amber); } .notif-item i.ok { background: var(--green); }
.notif-empty { padding: 10px 8px; color: var(--muted); font-size: 13.5px; }

/* Account menu */
.acct summary { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 10px 4px 4px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--card); color: var(--text); font-size: 13px; font-weight: 500; }
.acct summary:hover { border-color: var(--muted); }
.acct .avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--nav-on); color: var(--nav-paper); font-size: 12px; font-weight: 600; }
.acct .avatar.lg { width: 38px; height: 38px; font-size: 14px; }
.acct-name { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct .chev { width: 14px; height: 14px; color: var(--muted); flex: none; }
.acct[open] .chev { transform: rotate(180deg); }
.acct-menu { width: 280px; }
.acct-who { display: flex; gap: 10px; align-items: center; padding: 8px; min-width: 0; }
.acct-who > div { min-width: 0; }
.acct-who b { display: block; font-size: 14px; font-weight: 600; color: var(--text); }
.acct-who small { display: block; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.acct-meta { font-size: 13px; color: var(--muted); padding: 0 8px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 8px; border: 0; border-radius: 8px;
  background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; text-decoration: none; }
.menu-item:hover { background: var(--soft); }
.menu-item svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.menu-item .moon, :root[data-theme="dark"] .menu-item .sun { display: none; }
:root[data-theme="dark"] .menu-item .moon { display: block; }
.acct-menu form { margin: 4px 0 0; padding-top: 4px; border-top: 1px solid var(--line); }

/* Reports: cards breathe while data.json loads, instead of showing dashes */
main[aria-busy="true"] .card { animation: skel 900ms ease-in-out infinite alternate; }
@keyframes skel { to { opacity: .45; } }

/* The unlock moment: the navy door folds into the sidebar, the greeting fades, the room fades up. 780 ms in all. */
.unlock { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; pointer-events: none;
  background: var(--nav-deep); color: var(--nav-paper); animation: unlock-door 780ms cubic-bezier(.65,0,.25,1) both; }
.unlock p { font-size: 22px; font-weight: 600; text-align: center; padding: 0 24px; animation: unlock-hi 780ms ease both; }
.unlock small { display: block; font-size: 13px; font-weight: 500; color: var(--nav-muted); margin-bottom: 6px; }
@keyframes unlock-door { 0%, 50% { clip-path: inset(0); opacity: 1; }
  85% { clip-path: inset(0 calc(100% - var(--side-w)) 0 0); opacity: 1; } 100% { clip-path: inset(0 calc(100% - var(--side-w)) 0 0); opacity: 0; visibility: hidden; } }
@keyframes unlock-door-up { 0%, 50% { clip-path: inset(0); opacity: 1; }
  85% { clip-path: inset(0 0 calc(100% - 56px) 0); opacity: 1; } 100% { clip-path: inset(0 0 calc(100% - 56px) 0); opacity: 0; visibility: hidden; } }
@keyframes unlock-hi { 0% { opacity: 0; transform: translateY(6px); } 15%, 50% { opacity: 1; transform: none; } 70%, 100% { opacity: 0; } }
@keyframes unlock-up { from { opacity: 0; transform: translateY(10px); } }
@keyframes unlock-fade { from { opacity: 0; } }
.unlock-on main > * { animation: unlock-up 380ms ease-out 400ms both; }
.unlock-on main > .top, .unlock-on main > .appbar { animation-name: unlock-fade; }
.unlock-on .side > * { animation: unlock-fade 300ms ease-out 480ms both; }

/* Phone: the top bar takes over from the sidebar (brand, search, notifications, account); a tab bar at the bottom */
@media (max-width: 820px) {
  body .side { display: none; }
  .appbar { margin: -20px -16px 16px; padding: 8px 12px; min-height: 56px; gap: 8px; background: var(--nav-deep); border-bottom-color: var(--nav-hair); }
  .appbar :focus-visible { outline-color: var(--nav-focus); }
  .appbar-brand { display: flex; align-items: center; border-radius: 8px; }
  .appbar-brand svg { height: 24px; width: auto; }
  .appbar-actions > .btn, .acct-name, .acct .chev, .search kbd { display: none; }
  .search { display: none; }
  .search-open { display: grid; margin-left: auto; border-radius: 50%; background: transparent; border-color: var(--nav-line); color: var(--nav-paper); }
  .appbar-actions { margin-left: 0; }
  .appbar.searching .search { display: block; position: absolute; inset: 8px 12px; flex: none; z-index: 2; }
  .appbar.searching .search-results { width: 100%; }
  .notif > summary, .acct summary { border-color: var(--nav-line); background: var(--nav-deep); color: var(--nav-paper); }
  .acct summary { padding: 3px; }
  .notif-menu { width: 300px; right: -48px; }
  .acct-menu { width: 288px; }  /* fits a 320px screen from the right edge */
  .unlock { animation-name: unlock-door-up; }
  .tabs { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--nav-deep);
    border-top: 1px solid var(--nav-hair); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; color: var(--nav-muted);
    font-size: 11px; font-weight: 500; border-radius: 10px; position: relative; text-decoration: none; }
  .tabs a.on { color: var(--nav-paper); background: var(--nav-on); }
  .tabs svg { width: 20px; height: 20px; }
  .tabs .count { position: absolute; top: 2px; right: calc(50% - 20px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px;
    background: var(--nav-accent); color: var(--nav-paper); font-size: 10px; line-height: 16px; text-align: center; }
  main { padding-bottom: 104px !important; }
  html { scroll-padding-top: 68px; scroll-padding-bottom: 88px; }  /* ...or under the tab bar */
}
@media (prefers-reduced-motion: reduce) {
  .unlock { display: none; }
  .unlock-on main > *, .unlock-on .side > * { animation: none; }
  main[aria-busy="true"] .card { animation: none; opacity: .6; }
  .acct[open] .chev { transform: none; }
}
