/* PW Card Co admin -- shared look, in the live store's style (brand kit v1: Documents/PW Card Co/brand).
   Loaded LAST on every page, so these tokens win over each page's own :root values and every screen ends up in
   the same palette: white / paper backgrounds, ink text, teal-700 actions, Montserrat, IBM Plex Mono for numbers.
   Light only, like the store (the phone scanner keeps its own dark camera look). */

@font-face { font-family: "Montserrat"; src: url("/static/fonts/Montserrat-VariableFont_wght.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/static/fonts/IBMPlexMono-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }

:root {
  color-scheme: light;
  /* brand */
  --pw-teal-900: #1E4A52; --pw-teal-700: #2F6B75; --pw-teal-600: #3E828E; --pw-teal-500: #5696A0;
  --pw-teal-300: #8CC6D0; --pw-teal-200: #B2D0D7; --pw-teal-100: #E1EDF5;
  --pw-ink: #1F2A2E; --pw-slate: #5B6B70; --pw-steel: #A6C4D1; --pw-line: #DCE5E8; --pw-paper: #F6FAFB;
  --pw-spark: #F2B33D; --pw-ember: #C8412F; --pw-leaf: #2E8B57;
  --font-body: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgb(31 42 46 / .06); --shadow-md: 0 6px 20px rgb(31 42 46 / .08); --shadow-lift: 0 12px 32px rgb(47 107 117 / .18);
  /* the names the pages use */
  --bg: var(--pw-paper); --panel: #ffffff; --panel-2: #F1F6F8; --border: var(--pw-line); --text: var(--pw-ink); --muted: var(--pw-slate); --faint: #8FA0A5;
  --accent: var(--pw-teal-700); --accent-hover: var(--pw-teal-900); --accent-soft: var(--pw-teal-100);
  --brand: var(--pw-teal-200); --brand-soft: #EEF5F8; --brand-ink: var(--pw-teal-900); --soft: #EEF5F8;
  --danger: var(--pw-ember); --ok: var(--pw-leaf); --good: var(--pw-leaf); --warn: #B7791F;
  --badge-increment: var(--pw-teal-700); --badge-add: #2f5f9e; --badge-create: #7a4fae;
  --pw-nav-h: 60px;
}
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { background: var(--bg); color: var(--text); font-family: var(--font-body); }
button, input, select, textarea { font-family: var(--font-body); }
h1, h2, h3 { font-family: var(--font-body); letter-spacing: -.015em; }
h1 { font-weight: 800; }
h2, h3 { font-weight: 700; }
/* numbers read like a collector's ledger: set codes, card numbers, grades, prices */
code, kbd, .mono, .price, .sku, .cert { font-family: var(--font-mono); }
a { color: var(--accent); }

/* buttons, fields: card-shaped corners, teal focus */
button { border-radius: var(--radius-md); transition: background-color .15s, box-shadow .15s, transform .05s; }
button:active:not(:disabled) { transform: translateY(1px); }
input[type=text], input[type=search], input[type=number], input[type=email], input[type=tel], input[type=password], input[type=date], input:not([type]), select, textarea {
  border-radius: var(--radius-sm); }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 2px solid var(--pw-teal-500); outline-offset: 1px; }
::selection { background: var(--pw-teal-200); }

/* ------------------------------------------------------------------ top navigation (every staff page) */
.pwnav { position: sticky; top: 0; z-index: 40; background: rgb(255 255 255 / .92); backdrop-filter: saturate(1.4) blur(10px);
         border-bottom: 1px solid var(--border); padding-top: env(safe-area-inset-top); }
.pwnav .pwnav-in { max-width: 1320px; margin: 0 auto; height: var(--pw-nav-h); padding: 0 24px; display: flex; align-items: center; gap: 22px; }
.pwnav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 800; font-size: 15px;
               letter-spacing: -.01em; white-space: nowrap; flex: none; }
.pwnav-brand img { height: 34px; width: auto; display: block; }
.pwnav-brand small { font-weight: 600; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.pwnav-links { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 0 1 auto; min-width: 0; margin-right: auto; }
.pwnav-links .short { display: none; }
.pwnav-links::-webkit-scrollbar { display: none; }
.pwnav-links a { position: relative; display: flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; text-decoration: none;
                 color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; transition: background-color .15s, color .15s; }
.pwnav-links a:hover { background: var(--brand-soft); color: var(--text); }
.pwnav-links a.on { background: var(--pw-teal-100); color: var(--pw-teal-900); }
.pwnav-links svg { width: 17px; height: 17px; flex: none; }
.pwbadge, .pwnav-links .pwbadge, .pwsub .pwbadge { background: var(--pw-ember); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700;
                                                   padding: 1px 7px; line-height: 1.5; font-family: var(--font-mono); }
.pwnav-extra { display: flex; align-items: center; gap: 8px; flex: 0 1 auto; min-width: 0; }
.pwnav-extra .act { margin: 0; background: var(--brand-soft); color: var(--text); max-width: 300px; min-width: 0; }
.pwnav-extra .act > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pwnav-extra .appctl button { background: var(--brand-soft); color: var(--text); }
.pwdraft { background: #FDF3DC; color: #7A5410; font-weight: 600; font-size: 12.5px; text-align: center; padding: 6px; border-bottom: 1px solid #F3E2B8; }
/* the current section's screens, as tabs under the menu */
.pwsub { border-top: 1px solid var(--border); }
.pwsub-in { max-width: 1320px; margin: 0 auto; padding: 0 24px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.pwsub-in::-webkit-scrollbar { display: none; }
.pwsub a { position: relative; display: flex; align-items: center; gap: 6px; padding: 11px 10px 10px; text-decoration: none; white-space: nowrap;
           color: var(--muted); font-weight: 600; font-size: 13.5px; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s; }
.pwsub a:hover { color: var(--text); }
.pwsub a.on { color: var(--pw-teal-900); border-bottom-color: var(--pw-teal-700); }
@media (max-width: 760px) { .pwsub-in { padding: 0 8px; } .pwsub a { padding: 10px 9px 9px; font-size: 13px; } }
@media (max-width: 760px) {
  .pwnav .pwnav-in { padding: 0 12px; gap: 10px; }
  .pwnav-brand span, .pwnav-brand small { display: none; }
  .pwnav-links a { padding: 8px 10px; font-size: 13.5px; }
  .pwnav-links .long { display: none; }
  .pwnav-links .short { display: inline; }
  .pwnav-links a:not(.on) .short { display: none; }   /* phones: icons, plus the name of the section you're in */
  .pwnav-links a:not(.on) { padding: 8px 9px; }
  .pwnav-extra .txt { display: none; }
}
/* narrower screens: keep Restart / Stop, shrink the status pill to its dot */
@media (max-width: 1180px) { .pwnav-extra .act > span:last-child { display: none; } .pwnav-extra .act { padding: 8px; } }
@media (max-width: 760px) { .pwnav-extra .appctl button { padding: 5px 8px; font-size: 12px; } }

/* page title bars that sit under the menu (show desk) -- calmer, like the rest */
.pwnav + header, .pwdraft + header { background: var(--panel) !important; color: var(--text) !important; border-bottom: 1px solid var(--border); }
.pwnav + header input, .pwdraft + header input { background: var(--bg) !important; color: var(--text) !important; border: 1px solid var(--border) !important; }
.pwnav + header a, .pwnav + header .phones code, .pwdraft + header a, .pwdraft + header .phones code { color: var(--text) !important; }
.pwnav + header .phones code, .pwdraft + header .phones code { background: var(--brand-soft) !important; }

/* page title bars on the Shows screens: line their contents up with the menu, store-style title */
.pwnav + header, .pwdraft + header { padding: 16px max(24px, calc((100% - 1320px) / 2 + 24px)) !important; }
.pwnav + header h1, .pwdraft + header h1 { font-size: 1.35rem !important; font-weight: 800; letter-spacing: -.02em; }
.pwnav + header button, .pwdraft + header button { background: var(--pw-teal-700) !important; color: #fff !important; }

/* ------------------------------------------------------------------ home dashboard */
.pwhome { max-width: 1320px; margin: 0 auto; padding: 36px 24px 80px; display: flex; flex-direction: column; gap: 24px; }
.pwhome h1 { margin: 0; font-size: clamp(28px, 3.4vw, 40px); font-weight: 800; letter-spacing: -.025em; }
.pwhome h1 em { font-style: normal; color: var(--pw-teal-500); }
.pwhome .sub { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.pwtiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.pwtile { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; display: flex; flex-direction: column; gap: 16px;
          text-decoration: none; color: var(--text); transition: border-color .2s, box-shadow .2s, transform .2s; min-width: 0; box-shadow: var(--shadow-sm); }
.pwtile:hover { border-color: var(--pw-teal-200); box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.pwtile .hd { display: flex; align-items: center; gap: 12px; }
.pwtile .ic { width: 40px; height: 40px; border-radius: 12px; background: var(--pw-teal-100); color: var(--pw-teal-700); display: grid; place-items: center; flex: none; }
.pwtile .ic svg { width: 20px; height: 20px; }
.pwtile h2 { margin: 0; font-size: 17px; }
.pwtile .what { margin: 2px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.pwtile .nums { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.pwtile .num { background: var(--pw-paper); border: 1px solid #E9F0F2; border-radius: 12px; padding: 10px 12px; min-width: 0; }
.pwtile .num b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: var(--pw-teal-700); font-variant-numeric: tabular-nums; }
.pwtile .num span { font-size: 11.5px; color: var(--muted); font-weight: 600; line-height: 1.3; display: block; }
.pwtile .num.hot { background: #FDF3DC; border-color: #F3E2B8; } .pwtile .num.hot b { color: #9A5B10; }
.pwtile .todo { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.pwtile .todo li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--pw-paper); }
.pwtile .todo li span:last-child { color: var(--muted); white-space: nowrap; }
.pwtile .go { margin-top: auto; font-weight: 700; color: var(--accent); font-size: 14px; }
.pwtile.off { opacity: .55; }

/* ------------------------------------------------------------------ the store's eyebrow / stat style, for any page */
.pw-eyebrow { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }

/* the Show desk's money row: big ledger numbers with small labels, like the store's stats */
body .totals { padding: 18px max(24px, calc((100% - 1320px) / 2 + 24px)); gap: 36px; }
body .totals .stat .n { font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: var(--pw-teal-700); font-variant-numeric: tabular-nums; }
body .totals .stat .l { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-top: 2px; }

/* phone tools: the PW logo goes back to the phones' front door (/m) */
.pwback { display: inline-flex; align-items: center; flex: none; }
header .pwback img { height: 28px; width: auto; display: block; }

/* phone tools' top bars (Price check, Buy, Slabs): white like the store's header, not the old steel-blue strip */
body > header:first-child { background: rgb(255 255 255 / .94) !important; color: var(--text) !important; border-bottom: 1px solid var(--border);
                            backdrop-filter: saturate(1.4) blur(10px); }
body > header:first-child .t, body > header:first-child b { font-weight: 800; letter-spacing: -.01em; }
body > header:first-child a:not(.pwback), body > header:first-child button { background: var(--brand-soft) !important; color: var(--pw-teal-900) !important;
                            border: 1px solid #DCE9EE !important; }

/* Home: the store's hero + a show-day card */
.pwhome .hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.pwhome .show { display: flex; align-items: center; gap: 22px; background: linear-gradient(135deg, #E1EDF5, #F3F8FA); border: 1px solid #D3E4EB;
                border-radius: var(--radius-lg); padding: 14px 16px 14px 20px; flex-wrap: wrap; }
.pwhome .show b { display: block; font-size: 1.05rem; font-weight: 700; margin-top: 2px; }
.pwhome .show .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.pwbtn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 15px; border-radius: var(--radius-md); background: var(--pw-teal-700); color: #fff;
              font-weight: 600; font-size: 14px; text-decoration: none; border: 1.5px solid var(--pw-teal-700); transition: background-color .15s; }
.pwbtn:hover { background: var(--pw-teal-900); border-color: var(--pw-teal-900); }
.pwbtn.sec { background: #fff; color: var(--pw-teal-700); }
.pwbtn.sec:hover { background: var(--brand-soft); }

/* show tools: Sell | Price, the same switcher on both screens */
.apptabs { display: inline-flex; background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; }
body > header:first-child .apptabs a { background: none !important; border: 0 !important; color: var(--muted) !important; padding: 6px 16px; border-radius: 999px;
                                       font-weight: 700; font-size: .9rem; text-decoration: none; }
body > header:first-child .apptabs a.on { background: #fff !important; color: var(--pw-teal-900) !important; box-shadow: var(--shadow-sm); }
