/* Shared look for the admin dashboard pages (Command Center, Contacts, Team,
   Audit log, the Automation screens and Feedback review).

   Built from the staff app's colors and type (staff-look.css): navy band,
   orange for the main action, Roboto with condensed numbers, white rounded
   cards on grey. Each admin page still carries its own <style> block; this
   file loads after it and re-points the shared tokens, so one change here
   shows up on every admin page.

   Styles only. No markup, script, data or permission changes ride on it, and
   every page keeps working if this file fails to load. */

:root{
  --pb-navy:#11254C; --pb-navy-2:#1E3561; --pb-orange:#F47920; --pb-orange-ink:#B5530B;
  --pb-pale:#C9D2E3; --pb-pale-2:#9FB0CF;

  --page:#F4F5F7;
  --surface-1:#ffffff;
  --surface-2:#F8F9FB;
  --sidebar:var(--pb-navy);
  --sidebar-hover:var(--pb-navy-2);
  --sidebar-active:var(--pb-orange);
  --text-primary:#11254C;
  --text-secondary:#33415C;
  --text-muted:#5B6782;
  --grid:#E6E9EF;
  --axis:#C9D2E3;
  --border:rgba(17,37,76,0.12);
  --border-strong:rgba(17,37,76,0.22);
  --radius:14px;
  --radius-sm:10px;
  --shadow:0 1px 2px rgba(17,37,76,.05);
  --font:Roboto,system-ui,-apple-system,"Segoe UI",sans-serif;
  --font-num:"Roboto Condensed",Roboto,system-ui,sans-serif;
  --pb-on-primary:#11254C;
  --pb-band-text:#ffffff;
  --pb-band-muted:var(--pb-pale);
}
:root[data-theme="dark"]{
  --page:#0B1220;
  --surface-1:#141D2E;
  --surface-2:#18233A;
  --sidebar:#0A1630;
  --sidebar-hover:#1E3561;
  --text-primary:#E8EDF6;
  --text-secondary:#C3CBDB;
  --text-muted:#8F9BB2;
  --grid:#24304A;
  --axis:#33415C;
  --border:rgba(232,237,246,0.10);
  --border-strong:rgba(232,237,246,0.20);
  --shadow:0 1px 2px rgba(0,0,0,.35);
}

body{font-family:var(--font);}

/* Page header: the staff app's navy band. */
body > header, #main > header{background:var(--sidebar);color:var(--pb-band-text);border-bottom:0;}
body > header h1, body > header h2, #main > header h1, #main > header h2{
  color:var(--pb-band-text);font-family:var(--font-num);font-weight:800;font-size:22px;letter-spacing:0;}
body > header strong{color:var(--pb-band-text);}
body > header .muted, #main > header .muted{color:var(--pb-band-muted);}
body > header a, #main > header a,
body > header a.back, body > header a.nav{color:var(--pb-band-text);opacity:.92;}
body > header a:hover, #main > header a:hover{opacity:1;text-decoration:underline;}

/* Buttons: orange for the main action, outlined for the rest, red only for delete. */
.btn, .ghost{border-radius:var(--radius-sm);font-weight:500;font-size:13px;min-height:36px;}
.btn.primary, .btn.primary:hover:not(:disabled), .btn.approve, .btn.on, .login-card button{
  background:var(--pb-orange);border-color:var(--pb-orange);color:var(--pb-on-primary);font-weight:700;}
.btn.primary:hover:not(:disabled){filter:brightness(.95);}
.seg button.on{background:var(--pb-orange);color:var(--pb-on-primary);font-weight:700;}
.btn.danger{color:var(--critical);}
body > header select, body > header input, #main > header select{min-height:36px;}
:focus-visible{outline:2px solid var(--pb-orange);outline-offset:2px;}

/* Cards and numbers. */
.card{box-shadow:var(--shadow);}
.card h3{font-weight:700;}
.kpi .value{font-family:var(--font-num);font-weight:800;font-size:28px;letter-spacing:0;}

/* Command Center side menu (index.html): staff-app navy with pale text. */
#nav{color:var(--pb-pale);}
#nav .brand{font-family:var(--font-num);font-weight:800;font-size:17px;}
.nav-head{color:var(--pb-pale-2);}
.nav-head:hover{color:#fff;}
.nav-item{color:var(--pb-pale);}
.nav-item.active{background:var(--sidebar-hover);color:#fff;}
.nav-foot, .nav-foot button{color:var(--pb-pale-2);}
.nav-who{color:#fff;}

/* Feedback review keeps its own small sheet; bring its band and cards in line. */
body > header a[href="/app/"]{color:var(--pb-band-text);}

/* Phones: thumb-sized controls. */
@media (max-width:760px){
  .btn, .ghost, select, input:not([type="checkbox"]):not([type="radio"]):not([type="range"]){min-height:44px;font-size:15px;}
  /* Table filter boxes stay compact; Contacts gets its own phone layout later. */
  th select, th input{min-height:0;font-size:inherit;}
  body > header h1, body > header h2, #main > header h1, #main > header h2{font-size:24px;}
}

/* One menu on the admin pages outside the Command Center (dashboard-nav.js).
   Drawn only after /api/auth/me answers; until then, and when signed out,
   none of these elements exist and the page is laid out as before. */
.pbn-side, .pbn-bar, .pbn-sheet{font-family:var(--font);}
.pbn-side{position:fixed;top:0;left:0;bottom:0;width:208px;box-sizing:border-box;z-index:19;overflow-y:auto;
  background:var(--sidebar);color:var(--pb-pale);padding:16px 10px calc(14px + env(safe-area-inset-bottom,0px));
  display:flex;flex-direction:column;gap:2px;}
.pbn-brand{font-family:var(--font-num);font-weight:800;font-size:18px;color:#fff;padding:0 8px 10px;}
.pbn-head{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--pb-pale-2);font-weight:700;padding:12px 8px 4px;}
.pbn-item{display:block;padding:7px 8px;border-radius:8px;color:var(--pb-pale);text-decoration:none;font-size:14px;line-height:1.3;}
.pbn-item:hover{background:var(--sidebar-hover);color:#fff;}
.pbn-item.on{background:#fff;color:var(--pb-navy);font-weight:700;}
.pbn-foot{margin-top:auto;padding:12px 8px 0;font-size:12px;color:var(--pb-pale-2);}
.pbn-who{color:#fff;font-weight:600;}
html.pbn-on body{padding-left:208px;}
.pbn-bar{display:none;}
.pbn-sheet{position:fixed;inset:0;z-index:1000;background:rgba(10,22,48,.45);display:flex;align-items:flex-end;}
.pbn-sheet[hidden]{display:none;}
.pbn-sheet-in{background:var(--sidebar);width:100%;max-height:80vh;overflow-y:auto;border-radius:16px 16px 0 0;
  padding:12px 12px calc(16px + env(safe-area-inset-bottom,0px));display:flex;flex-direction:column;gap:2px;}
.pbn-close{align-self:flex-end;background:transparent;border:1px solid var(--pb-pale);color:#fff;border-radius:8px;min-height:36px;padding:0 12px;}
.pbn-sheet .pbn-item{font-size:16px;padding:11px 10px;}
@media (max-width:760px){
  html.pbn-on body{padding-left:0;padding-bottom:calc(68px + env(safe-area-inset-bottom,0px));}
  .pbn-side{display:none;}
  .pbn-bar{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;position:fixed;left:0;right:0;bottom:0;z-index:19;
    background:var(--surface-1);border-top:1px solid var(--border);padding:6px 6px calc(6px + env(safe-area-inset-bottom,0px));}
  .pbn-tab{display:flex;align-items:center;justify-content:center;min-height:48px;border:0;background:transparent;
    color:var(--text-muted);font-size:13px;font-weight:600;text-decoration:none;border-radius:10px;}
  .pbn-tab.on{color:var(--text-primary);background:var(--page);box-shadow:inset 0 -3px 0 var(--pb-orange);}
  /* Command Center on a phone: the bottom bar replaces the old scrolling rail. */
  html.pbn-cc body{padding-bottom:calc(68px + env(safe-area-inset-bottom,0px));}
}
