/* WCG Admin — app chrome in the Backline style (2026-10-05, Duane: "replicate
 * the look of HPAC / Backline"). Source of the look: Backline app
 * (C:\Projects\Backline\app\src\index.css, routes.tsx Chrome, OfficeSurface
 * bottom bar + "All sections" sheet), re-coloured to WCG: charcoal nav,
 * Cover Orange as the highlight. Loaded after mobile.css. Only the chrome
 * (sidebar/drawer, top bar, bottom bar, sheet) changes; page content keeps
 * the existing admin styling.
 */
:root {
  --nav-bg: #1d1d1f;
  --nav-bg-2: #262628;
  --nav-fg: #fffefd;
  --nav-fg-muted: #a9a49c;
  --nav-line: rgba(255, 255, 255, 0.08);
  --nav-pill: rgba(255, 255, 255, 0.10);
  --nav-btn-bg: rgba(255, 255, 255, 0.12);
  --nav-btn-line: rgba(255, 255, 255, 0.26);
  --nav-hi: #EB4E2D;            /* Cover Orange: indicator + icon highlight on dark */
  --shadow-bar: 0 10px 15px -3px rgba(0, 0, 0, 0.18), 0 4px 6px -4px rgba(0, 0, 0, 0.14);
  --shadow-pop: 0 18px 50px rgba(0, 0, 0, 0.30);
  --ease-std: cubic-bezier(0.2, 0, 0, 1);
}

/* Line icons (inline SVG, 2px stroke, square caps per the WCG brand rules). */
.svgi { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; stroke-linejoin: miter; display: block; }

/* ── Sidebar / drawer ── */
.sidebar { background: var(--nav-bg); border-right: 1px solid var(--nav-line); color: var(--nav-fg); }
.sidebar .brand { padding: 6px 8px 14px; border-bottom: 1px solid var(--nav-line); margin-bottom: 6px; display: flex; align-items: center; gap: 10px; }
.sidebar .brand img { filter: none; }
.sidebar .brand span { color: var(--nav-hi) !important; }
.sidebar .group { color: var(--nav-fg-muted); font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; padding: 0 12px; }
.sidebar .navitem {
  color: var(--nav-fg-muted); border-radius: 999px; font-weight: 600; gap: 12px;
  transition: background-color .15s ease, color .15s ease;
}
.sidebar .navitem .ico { color: inherit; width: 20px; display: inline-flex; justify-content: center; }
.sidebar .navitem:hover { background: var(--nav-pill); color: var(--nav-fg); }
.sidebar .navitem.active { background: var(--nav-pill); color: var(--nav-fg); box-shadow: inset 3px 0 0 var(--nav-hi); }
.sidebar .navitem.active .ico { color: var(--nav-hi); }
.sidebar .muted, .sidebar .small, .sidebar #wcg-signed-in-as { color: var(--nav-fg-muted) !important; }
.sidebar a#wcg-sign-out { color: var(--nav-hi) !important; }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 999px; }

/* ── Top bar: charcoal, translucent pill buttons ── */
.topbar { background: var(--nav-bg); color: var(--nav-fg); border-bottom: 1px solid var(--nav-line); box-shadow: var(--shadow-bar); }
.topbar .crumb, .topbar .crumb b, .topbar .crumb span { color: var(--nav-fg); }
.topbar .crumb > span { color: var(--nav-fg-muted); }
.topbar .search { background: var(--nav-btn-bg); border: 1px solid var(--nav-btn-line); border-radius: 10px; }
.topbar .search input { background: transparent; color: var(--nav-fg); }
.topbar .search input::placeholder { color: var(--nav-fg-muted); }
.topbar .search .ico, .topbar .search .kbd { color: var(--nav-fg-muted); }
.topbar .search .kbd { background: transparent; border-color: var(--nav-btn-line); }
.topbar .iconbtn, .topbar .role-pill {
  background: var(--nav-btn-bg); border: 1px solid var(--nav-btn-line); color: var(--nav-fg); border-radius: 10px;
}
.topbar .role-pill .dot { background: var(--nav-hi); }
.topbar .avatar { background: var(--nav-hi); color: #fff; border: 1px solid var(--nav-btn-line); }
.topbar .t-sub, .topbar .t-logo { display: none; }
/* Desktop: the breadcrumb truncates rather than overlapping the search box. */
.topbar .crumb { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; }
.topbar .crumb b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .search { min-width: 0; }

/* ── Bottom bar + "All sections" sheet (phones and tablets) ── */
.wmore, .wmore-scrim { display: none; }

@media (max-width: 900px) {
  .sidebar { width: min(320px, calc(100vw - 56px)); box-shadow: var(--shadow-pop); transition: transform 250ms var(--ease-std); }
  .nav-scrim { background: rgba(0, 0, 0, 0.5); }
  .sidebar .navitem { min-height: 52px; font-size: 14px; padding: 0 16px; }

  .topbar { height: calc(56px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 10px 0 10px; gap: 8px; }
  .topbar .hamburger, .topbar .m-search {
    width: 44px; height: 44px; border-radius: 10px; color: var(--nav-fg);
    background: var(--nav-btn-bg); border: 1px solid var(--nav-btn-line);
  }
  .topbar .hamburger:active, .topbar .m-search:active { background: rgba(255, 255, 255, 0.22); }
  .topbar .t-logo { display: block; height: 30px; width: auto; flex: none; }
  /* min-width:0 + overflow:hidden lets a long page title end in … instead of
     running under the search button (Duane, 2026-10-05: Questions & requests). */
  .topbar .crumb { display: flex; flex-direction: column; justify-content: center; align-items: stretch; text-align: left; line-height: 1.1; min-width: 0; overflow: hidden; }
  .topbar .crumb b { display: block; max-width: 100%; }
  .topbar .crumb b { font-size: 16px; font-weight: 800; letter-spacing: -0.01em; color: var(--nav-fg); }
  .topbar .t-sub { display: block !important; font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--nav-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .avatar { width: 36px; height: 36px; flex: none; }
  #wcg-live-err { top: calc(56px + env(safe-area-inset-top)) !important; }

  .bottomnav {
    background: var(--nav-bg); border-top: 1px solid var(--nav-line);
    height: calc(60px + env(safe-area-inset-bottom));
  }
  .bottomnav a { color: var(--nav-fg-muted); border-top: 2px solid transparent; gap: 4px; font-size: 10px; font-weight: 600; }
  .bottomnav a .ico { display: flex; }
  .bottomnav a.active { color: var(--nav-fg); border-top-color: var(--nav-hi); }
  .bottomnav a.active .ico { color: var(--nav-hi); }
  .bottomnav a .badge {
    top: 4px; left: calc(50% + 4px); min-width: 18px; height: 18px; line-height: 15px; font-size: 10.5px; font-weight: 700;
    background: #fff3ef; color: #9a2a12; border: 1.5px solid var(--nav-hi);
  }
  body #wcg-demo-banner { bottom: calc(60px + env(safe-area-inset-bottom)); }

  .wmore-scrim { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, 0.5); opacity: 0; transition: opacity 250ms var(--ease-std); }
  .wmore {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 81; max-height: 85dvh; overflow-y: auto;
    background: var(--wf-panel); color: var(--wf-ink); border-radius: 16px 16px 0 0; box-shadow: var(--shadow-pop);
    padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); transform: translateY(100%);
    transition: transform 300ms cubic-bezier(0.05, 0.7, 0.1, 1); overscroll-behavior: contain;
  }
  body.more-open .wmore-scrim, body.more-open .wmore { display: block; }
  body.more-open .wmore-scrim.on { opacity: 1; }
  body.more-open .wmore.on { transform: none; }
  body.more-open { overflow: hidden; }
  body.more-open #wcg-demo-banner { display: none !important; }
  .wmore .handle { width: 36px; height: 4px; border-radius: 999px; background: var(--wf-line); margin: 4px auto 10px; }
  .wmore .wm-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
  .wmore .wm-h h2 { margin: 0; font-size: 16px; font-weight: 800; }
  .wmore .wm-x { width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--wf-ink-2); display: inline-flex; align-items: center; justify-content: center; }
  .wmore .wm-group { font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--wf-ink-3); margin: 12px 2px 8px; }
  .wmore .wm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .wmore .wm-item {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    min-height: 76px; padding: 10px 6px; border-radius: 14px; border: 1px solid var(--wf-line); background: var(--wf-bg);
    color: var(--wf-ink); font-size: 11px; font-weight: 600; line-height: 1.2; text-align: center; overflow-wrap: anywhere;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 8px 24px rgba(0, 0, 0, 0.05);
  }
  .wmore .wm-item:active { transform: translateY(1px); }
  .wmore .wm-item.active { background: var(--nav-bg); color: var(--nav-fg); border-color: var(--nav-bg); }
  .wmore .wm-item.active .svgi { color: var(--nav-hi); }
  .wmore .wm-badge { position: absolute; top: 6px; right: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--nav-hi); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 18px; }
}

/* All-sections sheet, 2026-10-06: a colour per section, and "Needs you now" first. --wm-c is set per section. */
.wmore .wm-sec { --wm-c: #475569; }
.wmore .wm-sec .wm-group { display: flex; align-items: center; gap: 8px; color: var(--wm-c); }
.wmore .wm-sec .wm-group::before { content: ''; width: 4px; height: 14px; border-radius: 2px; background: var(--wm-c); }
.wmore .wm-sec .wm-item {
  background: color-mix(in srgb, var(--wm-c) 9%, var(--wf-panel));
  border-color: color-mix(in srgb, var(--wm-c) 28%, var(--wf-line));
}
.wmore .wm-ico { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; background: var(--wm-c); color: #fff; box-shadow: 0 2px 6px color-mix(in srgb, var(--wm-c) 35%, transparent); }
.wmore .wm-ico .svgi { color: #fff !important; }
.wmore .wm-sec .wm-item.active { background: var(--nav-bg); color: var(--nav-fg); border-color: var(--wm-c); box-shadow: inset 0 0 0 2px var(--wm-c); }
.wmore .wm-item.hot { border: 2px solid var(--nav-hi); box-shadow: 0 0 0 3px color-mix(in srgb, var(--nav-hi) 25%, transparent); }
.wmore .wm-item.hot .wm-badge { min-width: 22px; height: 22px; line-height: 22px; font-size: 12px; top: 4px; right: 6px; box-shadow: 0 0 0 2px var(--wf-panel); }
.wmore .wm-needs { margin: 0 0 6px; padding: 10px; border-radius: 16px; background: color-mix(in srgb, var(--nav-hi) 10%, var(--wf-panel)); border: 1.5px solid color-mix(in srgb, var(--nav-hi) 45%, transparent); }
.wmore .wm-needs-h { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--nav-hi); margin: 0 2px 8px; }
.wmore .wm-pulse { width: 10px; height: 10px; border-radius: 999px; background: var(--nav-hi); box-shadow: 0 0 0 0 color-mix(in srgb, var(--nav-hi) 60%, transparent); animation: wm-pulse 1.6s ease-out infinite; }
@keyframes wm-pulse { 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.wmore .wm-need { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; margin-top: 8px; border-radius: 12px; background: var(--nav-hi); color: #fff; text-decoration: none; font-weight: 700; box-shadow: 0 6px 18px color-mix(in srgb, var(--nav-hi) 35%, transparent); }
.wmore .wm-need:first-of-type { margin-top: 0; }
.wmore .wm-need-n { min-width: 34px; height: 34px; padding: 0 8px; border-radius: 999px; background: #fff; color: var(--nav-hi); font-size: 16px; font-weight: 900; display: inline-flex; align-items: center; justify-content: center; }
.wmore .wm-need-t { flex: 1; min-width: 0; font-size: 15px; overflow-wrap: anywhere; }
.wmore .wm-need-go { font-size: 13px; opacity: 0.95; white-space: nowrap; }
.bottomnav a[data-tab="menu"] { position: relative; }
.bottomnav .menu-dot { position: absolute; top: 6px; left: calc(50% + 8px); width: 10px; height: 10px; border-radius: 999px; background: var(--nav-hi); box-shadow: 0 0 0 2px var(--nav-bg, #111); }
.bottomnav .menu-dot[hidden] { display: none; }

/* Narrowest phones (Galaxy Flip ~338px): the title needs the logo's room. */
@media (max-width: 380px) { .topbar .t-logo { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .wmore .wm-pulse { animation: none !important; }
  .sidebar, .wmore, .wmore-scrim, .sidebar .navitem { transition-duration: .01ms !important; }
}

/* R-129 (2026-10-12): the lead row just saved flashes once, so it is easy to find again. */
@keyframes wf-row-flash { 0%, 40% { background: color-mix(in srgb, var(--wf-accent) 22%, transparent); } 100% { background: transparent; } }
.tbl tr.wf-row-flash > td { animation: wf-row-flash 2.4s ease-out; }

/* Dad 2026-10-12: Snap & mark up on every page, one tap from the top bar (was only inside Help). Staff only, like the Help row. */
.topbar .snapbtn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 8px; border: 0; background: var(--wf-accent); color: #fff; font: 600 13px/1 inherit; cursor: pointer; }
.topbar .snapbtn:hover { filter: brightness(1.08); }
.topbar .snapbtn:focus-visible { outline: 2px solid var(--wf-accent); outline-offset: 2px; }
body:not([data-role="admin"]):not([data-role="support"]) .topbar .snapbtn { display: none; }
@media (max-width: 760px) { .topbar .snapbtn { padding: 0 9px; height: 34px; } .topbar .snapbtn span { display: none; } }
