/* ---- Login page (landing.html) and branch selection (home_branches.html). ----
   Self-hosted fonts only: these two pages make no external requests. */
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/poppins-400.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/fonts/poppins-500.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/fonts/poppins-600.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("/static/fonts/poppins-700.woff2") format("woff2"); }
@font-face {
    font-family: "Archivo"; font-style: normal; font-display: swap;
    font-weight: 100 900; font-stretch: 62% 125%;
    src: url("/static/fonts/archivo-variable.woff2") format("woff2-variations"),
         url("/static/fonts/archivo-variable.woff2") format("woff2");
}

:root {
    color-scheme: light;
    --ink: #16181D; --ink-3: #2A2E36; --muted: #6B6F78; --line: #E4E1DA;
    --page: #F4F3F0;
    --yolk: #F2A93B; --yolk-hi: #F8C572; --yolk-deep: #D9861A; --yolk-wash: #FDF1DC;
    --white: #FBF8F2; --green: #2E9D5B; --green-wash: #E3F3EA; --red: #C8453A; --red-wash: #FBE9E7;
    --display: "Archivo", "Arial Narrow", Arial, sans-serif;
    --body: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: var(--body); color: var(--ink); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
:focus-visible { outline: 3px solid var(--yolk); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ================= LOGIN ================= */
body.login-body { background: var(--ink); }
.login {
    min-height: 100vh; min-height: 100dvh;
    display: flex; flex-direction: column; align-items: center; padding: 36px 16px 48px;
    background: radial-gradient(900px 500px at 50% 30%, rgba(242,169,59,.08), rgba(242,169,59,0) 70%), var(--ink);
    color: #fff;
}
/* Logo on the dark page, so the light version (static/brand/boss-logo-light.svg). The full name is real text for sharpness. */
.lock { margin: 0; display: flex; flex-direction: column; align-items: center; font-weight: normal; }
.lock img { display: block; height: 48px; width: auto; }
.lock-name { display: block; margin-top: 8px; font: 600 10px/1.2 "Poppins", sans-serif; letter-spacing: .24em; text-transform: uppercase; color: #B9B2A4; text-align: center; }
/* Street scene (static/js/street_scene.js). The script sets the canvas height. */
.scene { width: min(100%, 1100px); margin-top: 28px; border-radius: 24px; overflow: hidden; position: relative; background: #0E1530; box-shadow: 0 40px 80px -40px rgba(0,0,0,.9); border: 1px solid rgba(255,255,255,.07); }
.scene canvas { display: block; width: 100%; height: auto; }

/* No backdrop-filter: over this flat background it looks the same, and with
   the animated scene on the page it roughly doubled the CPU cost of every frame. */
.card { margin-top: 28px; width: min(100%, 460px); background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.1); border-radius: 24px; padding: 30px; box-shadow: 0 40px 80px -40px rgba(0,0,0,.8); }
.card label { display: block; font-size: 13px; color: #B7BAC2; margin: 0 0 8px; }
.card .field { margin-bottom: 18px; }
.card input { width: 100%; padding: 15px 16px; border-radius: 14px; border: 1px solid rgba(255,255,255,.12); background: rgba(0,0,0,.25); color: #fff; font-size: 16px; transition: border-color .2s, box-shadow .2s; }
.card input:focus { outline: none; border-color: var(--yolk); box-shadow: 0 0 0 4px rgba(242,169,59,.18); }
.card .pw { position: relative; }
.card .pw input { padding-right: 72px; }
.card .pw button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: none; color: #8C909A; font-size: 13px; cursor: pointer; padding: 8px; border-radius: 8px; }
.card .pw button:hover { color: #fff; }
.go { width: 100%; margin-top: 6px; padding: 16px; border: none; border-radius: 14px; background: var(--yolk); color: var(--ink); font-weight: 700; font-size: 16px; cursor: pointer; position: relative; overflow: hidden; transition: transform .15s; }
.go:hover { transform: translateY(-1px); }
.go::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%); transform: translateX(-100%); animation: sheen 3.5s ease 1.5s infinite; pointer-events: none; }
@keyframes sheen { 0% { transform: translateX(-100%); } 30%, 100% { transform: translateX(100%); } }
.msg { min-height: 20px; font-size: 13px; color: #F3B6AF; margin: 12px 0 0; text-align: center; }
.foot { margin-top: 22px; font-size: 12.5px; color: #6E727B; text-align: center; line-height: 1.6; }

/* ================= BRANCH SELECTION ================= */
body.home-body { background: var(--page); }
.home { min-height: 100vh; min-height: 100dvh; background: var(--page); position: relative; overflow: hidden; }
.nav { display: flex; align-items: center; gap: 12px 24px; padding: 14px 28px; background: rgba(255,255,255,.8); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); position: relative; z-index: 2; flex-wrap: wrap; }
.nav .lk { display: flex; align-items: center; line-height: 0; }
.nav .lk img { display: block; height: 26px; width: auto; }
.nav .links { display: flex; gap: 4px 18px; font-size: 14px; flex-wrap: wrap; }
.nav .links a { color: var(--ink-3); text-decoration: none; padding: 2px 0; border-bottom: 2px solid transparent; }
.nav .links a:hover { border-bottom-color: var(--yolk); }
.nav .links a[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--yolk); }
.nav .links a.locked { color: #A3A6AD; cursor: not-allowed; display: inline-flex; align-items: center; gap: 4px; }
.nav .links a.locked:hover { border-bottom-color: transparent; }
.nav .links a.locked svg { width: 13px; height: 13px; }
.nav .me { margin-left: auto; font-size: 14px; color: var(--muted); display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap; }
.nav .me b { color: var(--ink); font-weight: 600; }
.nav .me a { color: var(--muted); text-decoration: none; }
.nav .me a:hover { color: var(--ink); text-decoration: underline; }
.badge { font-size: 11px; background: var(--yolk-wash); color: #8A5A0F; padding: 3px 8px; border-radius: 6px; font-weight: 600; }
.sun { position: absolute; width: 780px; height: 780px; right: -220px; top: -380px; border-radius: 50%; background: radial-gradient(circle, rgba(242,169,59,.35), rgba(242,169,59,0) 62%); animation: drift 18s ease-in-out infinite alternate; pointer-events: none; }
@keyframes drift { to { transform: translate(-80px, 40px); } }
.inner { max-width: 1240px; margin: 0 auto; padding: 56px 28px 80px; position: relative; z-index: 1; }
.greet { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.greet h1 { font-family: var(--display); font-stretch: 118%; font-weight: 800; font-size: clamp(34px, 5vw, 64px); line-height: 1.02; margin: 0; letter-spacing: -.01em; overflow-wrap: anywhere; }
.greet p { margin: 12px 0 0; color: var(--muted); font-size: 16px; }
.health { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; padding: 8px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); }
.pill i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(46,157,91,.5); animation: pulse 2.4s infinite; }
.pill.bad { background: var(--red-wash); border-color: #F0C4BE; color: #8E2A21; }
.pill.bad i { background: var(--red); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(46,157,91,.45); } 70% { box-shadow: 0 0 0 8px rgba(46,157,91,0); } 100% { box-shadow: 0 0 0 0 rgba(46,157,91,0); } }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 44px; }
.bc { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 26px; padding: 26px 26px 22px; text-decoration: none; color: inherit; overflow: hidden;
    transition: transform .35s cubic-bezier(.2,.9,.3,1), box-shadow .35s, border-color .35s; display: flex; flex-direction: column; min-height: 250px; }
.bc::before { content: ""; position: absolute; width: 220px; height: 220px; right: -90px; top: -110px; border-radius: 50%;
    background: radial-gradient(circle at 34% 30%, var(--yolk-hi), var(--yolk) 55%, var(--yolk-deep)); opacity: .14; transition: transform .5s cubic-bezier(.2,.9,.3,1), opacity .35s; }
.bc:hover, .bc:focus-visible { transform: translateY(-6px); box-shadow: 0 34px 60px -30px rgba(160,100,20,.45); border-color: #EACB95; }
.bc:hover::before, .bc:focus-visible::before { transform: scale(1.35) translate(-14px, 14px); opacity: .3; }
.bc .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; position: relative; }
.bc h2 { font-family: var(--display); font-stretch: 112%; font-weight: 800; font-size: 28px; line-height: 1.05; margin: 0; min-width: 0; overflow-wrap: anywhere; }
.bc h2 small { display: block; font: 500 13.5px/1.4 var(--body); color: var(--muted); margin-top: 6px; letter-spacing: 0; }
.status { flex: none; font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 999px; background: var(--green-wash); color: #1F6F40; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.status i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.status.closed { background: #F1EFEA; color: var(--muted); }
.status.closed i { background: #B8B4AB; }
.stats { margin-top: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding-top: 26px; border-top: 1px dashed var(--line); position: relative; }
.stats b { display: block; font-family: var(--display); font-stretch: 105%; font-weight: 700; font-size: 24px; font-variant-numeric: tabular-nums; }
.stats b.txt { font-size: 20px; line-height: 1.2; white-space: nowrap; }
.stats span { font-size: 12.5px; color: var(--muted); line-height: 1.3; display: block; }
.faces { display: flex; margin: 14px 0 22px; position: relative; }
.faces span { width: 34px; height: 34px; border-radius: 50%; border: 2px solid #fff; margin-left: -6px; display: grid; place-items: center; font-size: 11px; font-weight: 600; color: #fff; }
.faces span:first-child { margin-left: 0; }
.faces span.more { background: var(--ink-3); }
.faces-empty { margin: 14px 0 22px; font-size: 13px; color: var(--muted); position: relative; min-height: 34px; display: flex; align-items: center; }
.go-arrow { position: absolute; right: 22px; bottom: 22px; width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 20px; opacity: 0; transform: scale(.6); transition: all .3s; }
.bc:hover .go-arrow, .bc:focus-visible .go-arrow { opacity: 1; transform: none; }
.bc.office { background: var(--ink); color: #fff; border-color: var(--ink); }
.bc.office h2 small, .bc.office .stats span { color: #9CA0A8; }
.bc.office .stats { border-top-color: #343842; }
.bc.office .go-arrow { background: var(--yolk); color: var(--ink); }
.empty-note { margin-top: 40px; color: var(--muted); }
.js .bc { opacity: 0; transform: translateY(30px); }
.js .bc.in { animation: cardin .7s cubic-bezier(.2,.9,.3,1) forwards; animation-delay: var(--d); }
.js .bc.shown { opacity: 1; transform: none; animation: none; }
.js .bc.shown:hover, .js .bc.shown:focus-visible { transform: translateY(-6px); }
@keyframes cardin { to { opacity: 1; transform: none; } }

@media (max-width: 980px) { .grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) {
    .grid { grid-template-columns: 1fr; }
    .nav { padding: 12px 16px; }
    .nav .me { margin-left: 0; width: 100%; }
    .inner { padding: 36px 16px 56px; }
    .card { padding: 22px; }
    .bc h2 { font-size: 26px; }
}
@media (max-width: 560px) {
    .lock b { font-size: 34px; }
    .lock i { width: 36px; height: 36px; }
    .lock small { font-size: 8.5px; letter-spacing: .22em; }
    .scene { border-radius: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .js .bc { opacity: 1; transform: none; }
}

/* ================= BRANCH SECTIONS (home.html) ================= */
.sec-inner { padding-top: 40px; }
.sec-head { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: end; }
.sec-back { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); padding: 6px 0; text-decoration: none; }
.sec-back:hover { color: var(--ink); }
.sec-back svg { transition: transform .2s; }
.sec-back:hover svg { transform: translateX(-3px); }
.sec-head h1 { font-family: var(--display); font-stretch: 122%; font-weight: 800; font-size: clamp(40px, 6vw, 76px); line-height: .95; letter-spacing: -.015em; margin: 14px 0 0; overflow-wrap: anywhere; }
.sec-head h1 span { display: block; font: 600 15px/1 var(--body); letter-spacing: 0; color: var(--muted); margin-bottom: 12px; font-stretch: 100%; }
.sec-health { margin-top: 18px; }
.sec-front { width: 300px; max-width: 40vw; }
.sec-front svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 24px 30px rgba(22,24,29,.18)); }
.sec-front .glow { animation: sec-glow 3.2s ease-in-out infinite alternate; }
@keyframes sec-glow { from { opacity: .75; } to { opacity: 1; } }

.sec-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 40px; }
.sc { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 26px 24px 24px; min-height: 190px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; color: inherit; text-decoration: none;
    transition: transform .35s cubic-bezier(.2,.9,.3,1), box-shadow .35s, border-color .35s; }
.sc::before { content: ""; position: absolute; width: 200px; height: 200px; right: -90px; bottom: -110px; border-radius: 50%; background: radial-gradient(circle at 34% 30%, var(--yolk-hi), var(--yolk) 55%, var(--yolk-deep)); opacity: .12; transition: transform .5s cubic-bezier(.2,.9,.3,1), opacity .35s; }
a.sc:hover, a.sc:focus-visible { transform: translateY(-6px); box-shadow: 0 30px 56px -30px rgba(160,100,20,.5); border-color: #EACB95; }
a.sc:hover::before, a.sc:focus-visible::before { transform: scale(1.4) translate(-12px, -12px); opacity: .3; }
.sc .ic { width: 64px; height: 64px; border-radius: 18px; background: var(--yolk-wash); display: grid; place-items: center; position: relative; transition: background .3s; }
a.sc:hover .ic, a.sc:focus-visible .ic { background: #FBE3B8; }
.sc .ic svg { width: 40px; height: 40px; overflow: visible; }
.sc h2 { font-family: var(--display); font-stretch: 112%; font-weight: 800; font-size: 25px; margin: 0; position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sc .arr { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; opacity: 0; transform: translateX(-8px) scale(.8); transition: all .3s; }
a.sc:hover .arr, a.sc:focus-visible .arr { opacity: 1; transform: none; }

/* Locked: the section exists but this role can't open it. Same look as the
   old locked tile (faded, grey lock, note on hover); no lift, yolk or arrow. */
.sc.locked { --o: .45; opacity: .45; cursor: not-allowed; }
.sc.locked .ic { background: #EFEDE8; color: var(--muted); }
.sc.locked .ic .s { stroke: var(--muted); }
.sc.locked h2 { flex-direction: column; align-items: flex-start; gap: 4px; }
.sc-note { display: none; font: 500 11.5px/1.3 var(--body); color: var(--muted); font-stretch: 100%; }
.sc.locked:hover .sc-note { display: block; }

/* Icon strokes and fills */
.ic .s { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ic .f { fill: var(--yolk); }
.ic .fw { fill: #fff; }
/* Shifts: calendar page flips */
.ic .cal-page { transform-origin: 20px 12px; transform-box: view-box; }
a.sc:hover .cal-page, a.sc:focus-visible .cal-page { animation: sec-flip .7s cubic-bezier(.3,.7,.3,1); }
@keyframes sec-flip { 0% { transform: none; } 45% { transform: scaleY(0); } 46% { transform: scaleY(0); } 100% { transform: none; } }
/* Staff: people hop */
.ic .p1, .ic .p2 { transform-box: view-box; }
a.sc:hover .p1, a.sc:focus-visible .p1 { animation: sec-hop .6s ease; }
a.sc:hover .p2, a.sc:focus-visible .p2 { animation: sec-hop .6s ease .12s; }
@keyframes sec-hop { 40% { transform: translateY(-5px); } 70% { transform: translateY(1px); } }
/* Payroll: coin spins */
.ic .coin { transform-origin: 20px 20px; transform-box: view-box; }
a.sc:hover .coin, a.sc:focus-visible .coin { animation: sec-spin .9s cubic-bezier(.3,.6,.3,1); }
@keyframes sec-spin { 0% { transform: scaleX(1); } 25% { transform: scaleX(0); } 50% { transform: scaleX(-1); } 75% { transform: scaleX(0); } 100% { transform: scaleX(1); } }
/* Purchasing: cart rolls */
.ic .cart { transform-box: view-box; }
a.sc:hover .cart, a.sc:focus-visible .cart { animation: sec-roll .9s cubic-bezier(.4,.1,.3,1); }
@keyframes sec-roll { 35% { transform: translateX(7px); } 65% { transform: translateX(-3px); } 100% { transform: none; } }
/* Stock: top box drops */
.ic .box-top { transform-box: view-box; }
a.sc:hover .box-top, a.sc:focus-visible .box-top { animation: sec-drop .7s cubic-bezier(.3,1.5,.5,1); }
@keyframes sec-drop { 0% { transform: translateY(-12px); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; } }
/* The Menu: cloche lifts, steam rises */
.ic .lid { transform-origin: 20px 22px; transform-box: view-box; transition: transform .45s cubic-bezier(.3,1.4,.5,1); }
a.sc:hover .lid, a.sc:focus-visible .lid { transform: translateY(-7px) rotate(-12deg); }
.ic .steam { opacity: 0; transition: opacity .3s; }
a.sc:hover .steam, a.sc:focus-visible .steam { opacity: 1; animation: sec-steam 1.4s ease-in-out infinite; }
@keyframes sec-steam { 0% { transform: translateY(2px); opacity: 0; } 40% { opacity: 1; } 100% { transform: translateY(-6px); opacity: 0; } }
/* Costs: receipt prints */
.ic .rcpt { transform-box: view-box; }
a.sc:hover .rcpt, a.sc:focus-visible .rcpt { animation: sec-print .8s cubic-bezier(.3,.7,.3,1); }
@keyframes sec-print { 0% { transform: translateY(-14px); } 100% { transform: none; } }
/* Sales: bars grow */
.ic .bar { transform-box: fill-box; transform-origin: bottom; }
a.sc:hover .bar, a.sc:focus-visible .bar { animation: sec-grow .6s cubic-bezier(.3,1.4,.5,1) both; }
a.sc:hover .b2, a.sc:focus-visible .b2 { animation-delay: .08s; }
a.sc:hover .b3, a.sc:focus-visible .b3 { animation-delay: .16s; }
@keyframes sec-grow { from { transform: scaleY(.1); } }

/* Entrance wave (static/js/branch_sections.js), then back to hover styles */
.js .sc { opacity: 0; transform: translateY(26px); }
.js .sc.in { animation: secin .7s cubic-bezier(.2,.9,.3,1) forwards; animation-delay: var(--d); }
@keyframes secin { to { opacity: var(--o, 1); transform: none; } }
.js .sc.done { opacity: var(--o, 1); transform: none; animation: none; }
.js a.sc.done:hover, .js a.sc.done:focus-visible { transform: translateY(-6px); }

@media (max-width: 1060px) { .sec-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) {
    .sec-grid { grid-template-columns: 1fr 1fr; }
    .sec-head { grid-template-columns: 1fr; }
    .sec-front { width: 220px; max-width: 70%; }
}
@media (max-width: 460px) {
    .sec-grid { grid-template-columns: 1fr; }
    .sec-inner { padding: 28px 16px 56px; }
    .sc { min-height: 96px; padding: 18px 20px; flex-direction: row; align-items: center; justify-content: flex-start; }
    .sc h2 { flex: 1; margin-left: 16px; }
    /* The hover arrow never shows on a phone, but it still took 44px of the
       title's row, so longer titles ("Profit & Loss") wrapped. */
    .sc .arr { display: none; }
}
@media (max-width: 359px) {
    .sc h2 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
    .js .sc { opacity: var(--o, 1); transform: none; }
}

/* The Pass badge in the /home nav (same as style.css). */
.nav .pass-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px; background: #C8453A; color: #fff; font-size: 11px; font-weight: 700; line-height: 1; vertical-align: 1px; }
