/* Staff layout composes the existing ARR panels, table, form and dialog styles. */
.staff-page main { max-width: 1200px; }
.staff-page .hero { margin-bottom: 24px; }
.staff-page .staff-brand { display: flex; align-items: center; }
.staff-brand img { width: 48px; height: 48px; border-radius: 12px; }
.staff-link { display: inline-flex; align-items: center; text-decoration: none; }
.staff-first-login { margin-top: 22px; }
/* phonecc (owner 5 Oct): the country code in front of the staff number -- fixed +91, Login sends staff codes to Indian WhatsApp numbers only. */
.staff-phone { display: flex; align-items: stretch; gap: 8px; }
.staff-phone input { flex: 1 1 0; min-width: 0; }
.staff-cc { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2, #F4F1F6); font-weight: 750; white-space: nowrap; }
.staff-first-login summary { min-height: 44px; padding-block: 10px; cursor: pointer; font-weight: 750; }
.staff-first-login li { margin-block: 8px; color: var(--muted); }
.staff-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 20px; }
.staff-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-block: 18px; }
.staff-actions .primary-button { width: auto; min-width: 150px; margin: 0; }
.staff-table { width: 100%; margin-block: 16px; }
.staff-table td { overflow-wrap: anywhere; }
.staff-table td small { display: block; margin-top: 4px; color: var(--muted); }
.staff-table th, .staff-table td { vertical-align: top; }
.staff-request-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.staff-request-actions small { flex-basis: 100%; }
.staff-detail-fields { display: grid; grid-template-columns: minmax(120px, .6fr) minmax(0, 1.4fr); gap: 12px; margin-block: 24px; }
.staff-detail-fields dt { color: var(--muted); }
.staff-detail-fields dd { margin: 0; overflow-wrap: anywhere; }
.staff-confirm-copy { margin-top: 20px; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.staff-page .crm-preview-form .empty-state { margin-top: 18px; }
.staff-page .crm-table-wrap { margin-top: 20px; }
.staff-page #staff-error { margin-block: 14px; }
.staff-page #staff-directory-actions { border-top: 1px solid var(--line); padding-top: 18px; }
@media (max-width: 700px) {
  .staff-page .topbar { flex-wrap: wrap; }
  .staff-brand img { width: 44px; height: 44px; }
  .staff-page .topbar > .topbar-actions { display: flex; flex-basis: 100%; margin-left: 0; }
  .staff-page .topbar-actions > * { flex: 1; justify-content: center; }
  .staff-form-grid { grid-template-columns: minmax(0, 1fr); }
  .staff-actions > button { flex: 1 1 150px; }
  .staff-detail-fields { grid-template-columns: minmax(100px, .6fr) minmax(0, 1fr); }
  .staff-page .panel-head { align-items: flex-start; flex-wrap: wrap; }
  .staff-table { min-width: 660px; }
}

/* rel61 (owner 14 Oct, "Sign-in, 1 button"): a recognised staff session shows only Continue (+ "Not you?"). */
#staff-login-form[data-recognised="true"]>:not(#staff-mobile-resume):not(#staff-mobile-status):not(#staff-use-other){display:none!important}
#staff-login-form[data-recognised="true"] #staff-mobile-resume{width:100%}
#staff-use-other{margin-top:8px;font-size:14px}
/* one link (owner 24 Oct): the 👑 owner / managers way in on the same page (same number + WhatsApp code, ARR Sign-in). */
#staff-manager-signin{display:block;margin-top:12px;text-align:center;text-decoration:none;box-sizing:border-box}
#staff-manager-signin[hidden]{display:none!important}

/* ARR One chrome on the staff command center and its offline gate. */
.arr-one-staff-shell .access-gate .access-logo { width: 80px; height: 80px; border-radius: 20px; }
.arr-one-staff-shell .brand-logo { width: 48px; height: 48px; border-radius: 12px; }
.arr-one-staff-shell .mtop img { width: 36px; height: 36px; border-radius: 9px; padding: 0; }

/* signin-one-1201 (owner 1 Dec, ADMIN_SIGNIN_ONE_SCREEN_MODE): the sign-in page is ONE card -- logo, mobile number, Send code,
   the WhatsApp code, Sign in -- with two small footer links. Applies only under html[data-signin-one="enabled"] (the server
   adds it, src/staff-signin-one-screen.mjs). Three type sizes: 22px (name), 16px (fields, buttons), 13px (notes, links). */
html[data-signin-one="enabled"] body.staff-page{background:var(--surface-soft,#f8f4f7);min-height:100vh}
html[data-signin-one="enabled"] body.staff-page:has(#staff-workspace[hidden]) .topbar,
html[data-signin-one="enabled"] body.staff-page:has(#staff-workspace[hidden]) .skip-link,
html[data-signin-one="enabled"] #staff-hero,
html[data-signin-one="enabled"] #staff-status,
html[data-signin-one="enabled"] #staff-access .panel-head,
html[data-signin-one="enabled"] #staff-access h3,
html[data-signin-one="enabled"] #staff-access .staff-first-login{display:none!important}
html[data-signin-one="enabled"] .staff-page main:has(#staff-workspace[hidden]){max-width:none;padding:16px;min-height:100vh;box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:center}
html[data-signin-one="enabled"] #staff-access{width:100%;max-width:380px;box-sizing:border-box;margin:0 auto;padding:28px 22px 18px;border-radius:20px;font-size:16px;line-height:1.4}
html[data-signin-one="enabled"] #staff-access .dialog-grid{display:block}
html[data-signin-one="enabled"] #staff-access .dialog-grid>section,
html[data-signin-one="enabled"] #staff-login-form{margin:0;padding:0;border:0;border-radius:0;background:none;box-shadow:none}
html[data-signin-one="enabled"] .signin-one-brand{display:flex;flex-direction:column;align-items:center;gap:8px;margin-bottom:18px}
html[data-signin-one="enabled"] .signin-one-brand img{width:56px;height:56px;border-radius:14px}
html[data-signin-one="enabled"] .signin-one-name{margin:0;font-size:22px;font-weight:800;color:var(--ink,#19161b)}
html[data-signin-one="enabled"] #staff-access label{display:block;margin:14px 0 6px;font-size:16px;font-weight:700}
html[data-signin-one="enabled"] #staff-access input{width:100%;box-sizing:border-box;min-height:48px;font-size:16px}
html[data-signin-one="enabled"] #staff-access .staff-phone input{width:auto}
html[data-signin-one="enabled"] #staff-access .primary-button{width:100%;min-height:48px;margin-top:16px;font-size:16px}
html[data-signin-one="enabled"] #staff-access .field-help,
html[data-signin-one="enabled"] #staff-access .micro-status,
html[data-signin-one="enabled"] #staff-access .staff-cc,
html[data-signin-one="enabled"] #staff-otp-again,
html[data-signin-one="enabled"] #staff-use-other{font-size:13px}
html[data-signin-one="enabled"] #staff-login-note{margin:0;text-align:center;color:var(--muted,#5f5862)}
html[data-signin-one="enabled"] #staff-otp-again,
html[data-signin-one="enabled"] .signin-one-foot .text-button{min-height:32px;margin:0;padding:0 4px;line-height:32px;border:0;background:none;font-size:13px;font-weight:600;text-decoration:none}
html[data-signin-one="enabled"] #staff-otp-again{margin-top:6px}
html[data-signin-one="enabled"] #staff-mobile-status{min-height:18px;margin-top:10px;text-align:center}
html[data-signin-one="enabled"] .signin-one-foot{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:4px 16px;margin:12px 0 0;padding-top:10px;border-top:1px solid var(--line,#ded7de)}
html[data-signin-one="enabled"] .signin-one-foot:not(:has(a:not([hidden]))){display:none}
html[data-signin-one="enabled"] .signin-one-foot a[hidden],
html[data-signin-one="enabled"] #staff-manager-signin[hidden]{display:none!important}
html[data-signin-one="enabled"] #staff-manager-signin{display:inline-flex;align-items:center;margin-top:0;text-align:center}

/* signin-one-1201 motion (owner 1 Dec: "super interactive"). Composite-only animations (transform / opacity); colours are
   ARR plum + amber with the Altrix multi-colour. Everything under html[data-signin-one="enabled"]; parts that need the
   script also need html[data-so-live] (public/staff.js signinOneMotion). prefers-reduced-motion turns all of it off. */
@keyframes so-rise{from{opacity:0;transform:translateY(18px)}to{opacity:1;transform:none}}
@keyframes so-pop{from{opacity:0;transform:scale(.82)}to{opacity:1;transform:none}}
@keyframes so-glow{0%,100%{opacity:.35;transform:scale(.92)}50%{opacity:.85;transform:scale(1.08)}}
@keyframes so-drift-a{from{transform:translate3d(-8vmax,-6vmax,0) scale(1)}to{transform:translate3d(10vmax,8vmax,0) scale(1.15)}}
@keyframes so-drift-b{from{transform:translate3d(8vmax,6vmax,0) scale(1.1)}to{transform:translate3d(-10vmax,-4vmax,0) scale(.95)}}
@keyframes so-drift-c{from{transform:translate3d(-4vmax,8vmax,0) scale(.9)}to{transform:translate3d(6vmax,-8vmax,0) scale(1.1)}}
@keyframes so-spin{to{transform:rotate(360deg)}}
@keyframes so-fade{from{opacity:0;transform:scale(.92)}to{opacity:1;transform:none}}
@keyframes so-slide{from{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:none}}
@keyframes so-digit{from{transform:scale(.8)}to{transform:none}}
@keyframes so-shake{0%,100%{transform:none}20%{transform:translateX(-8px)}40%{transform:translateX(7px)}60%{transform:translateX(-5px)}80%{transform:translateX(3px)}}
@keyframes so-ring{from{stroke-dashoffset:0}to{stroke-dashoffset:56.55}}
@keyframes so-done-in{from{opacity:0;transform:scale(.5)}to{opacity:1;transform:none}}
@keyframes so-draw{to{stroke-dashoffset:0}}
@keyframes so-leave{to{opacity:0;transform:scale(1.12)}}
/* (1) entrance + logo */
html[data-signin-one="enabled"] #staff-access{position:relative;animation:so-rise .4s cubic-bezier(.22,1,.36,1) both}
html[data-signin-one="enabled"] .signin-one-brand{position:relative}
html[data-signin-one="enabled"] .signin-one-brand::before{content:"";position:absolute;top:-12px;left:50%;width:80px;height:80px;margin-left:-40px;border-radius:26px;background:radial-gradient(circle,rgba(245,166,35,.6),rgba(104,20,123,.35) 55%,rgba(104,20,123,0) 72%);filter:blur(8px);animation:so-glow 3.2s ease-in-out infinite;pointer-events:none}
html[data-signin-one="enabled"] .signin-one-brand img{position:relative;animation:so-pop .5s cubic-bezier(.34,1.56,.64,1) .08s both}
html[data-signin-one="enabled"] .signin-one-name{position:relative}
/* (2) three soft colour blobs drifting behind the card (signed-out page only) */
html[data-signin-one="enabled"] body.staff-page:has(#staff-workspace[hidden])::before,
html[data-signin-one="enabled"] body.staff-page:has(#staff-workspace[hidden])::after,
html[data-signin-one="enabled"] .staff-page main:has(#staff-workspace[hidden])::before{content:"";position:fixed;z-index:-1;width:62vmax;height:62vmax;border-radius:50%;filter:blur(70px);opacity:.42;pointer-events:none;will-change:transform}
html[data-signin-one="enabled"] body.staff-page:has(#staff-workspace[hidden])::before{top:-24vmax;left:-20vmax;background:#68147B;animation:so-drift-a 24s ease-in-out infinite alternate}
html[data-signin-one="enabled"] body.staff-page:has(#staff-workspace[hidden])::after{bottom:-26vmax;right:-22vmax;background:#F5A623;animation:so-drift-b 28s ease-in-out infinite alternate}
html[data-signin-one="enabled"] .staff-page main:has(#staff-workspace[hidden])::before{top:30%;left:40%;width:44vmax;height:44vmax;background:linear-gradient(135deg,#19C3B1,#3B82F6 50%,#FF4F8B);opacity:.3;animation:so-drift-c 32s ease-in-out infinite alternate}
/* (3) mobile field: floating label, focus glow, check at 10 digits */
html[data-signin-one="enabled"][data-so-live] #staff-otp{position:relative}
html[data-signin-one="enabled"][data-so-live] #staff-otp>label[for="staff-otp-mobile"]{position:relative;z-index:1;transform-origin:0 50%;transition:transform .2s cubic-bezier(.22,1,.36,1),opacity .2s;pointer-events:none}
html[data-signin-one="enabled"][data-so-live] #staff-otp[data-so-focus="false"][data-so-filled="false"]>label[for="staff-otp-mobile"]{transform:translate(14px,41px);opacity:.7}
html[data-signin-one="enabled"][data-so-live] #staff-otp:has(.staff-cc)[data-so-focus="false"][data-so-filled="false"]>label[for="staff-otp-mobile"]{transform:translate(72px,41px)}
html[data-signin-one="enabled"][data-so-live] #staff-otp[data-so-focus="false"] #staff-otp-mobile::placeholder{color:transparent}
html[data-signin-one="enabled"][data-so-live] .so-mobile{position:relative}
html[data-signin-one="enabled"][data-so-live] .so-mobile::after{content:"";position:absolute;inset:-4px;border-radius:15px;box-shadow:0 0 0 3px rgba(104,20,123,.22),0 0 18px rgba(245,166,35,.45);opacity:0;transition:opacity .2s;pointer-events:none}
html[data-signin-one="enabled"][data-so-live] #staff-otp[data-so-focus="true"] .so-mobile::after{opacity:1}
html[data-signin-one="enabled"][data-so-live] #staff-otp-mobile:focus,
html[data-signin-one="enabled"][data-so-live] #staff-otp-code:focus{outline:none;box-shadow:none}
html[data-signin-one="enabled"][data-so-live] #staff-otp-mobile:focus{border-color:var(--plum-2,#68147B)}
html[data-signin-one="enabled"][data-so-live] #staff-otp-mobile{padding-right:40px}
html[data-signin-one="enabled"][data-so-live] .so-ok{position:absolute;right:12px;top:50%;width:22px;height:22px;margin-top:-11px;fill:none;stroke:#1a9e5a;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round;opacity:0;transform:scale(.4);transition:opacity .2s,transform .25s cubic-bezier(.34,1.56,.64,1);pointer-events:none}
html[data-signin-one="enabled"][data-so-live] #staff-otp[data-so-ten="true"] .so-ok{opacity:1;transform:none}
/* (4) Send code: spinner, then "Code sent"; the code row slides in */
html[data-signin-one="enabled"][data-so-live] #staff-mobile-complete{position:relative}
html[data-signin-one="enabled"][data-so-live] #staff-mobile-complete.so-busy{color:transparent;opacity:1}
html[data-signin-one="enabled"][data-so-live] #staff-mobile-complete.so-busy::after{content:"";position:absolute;left:50%;top:50%;width:20px;height:20px;margin:-12px 0 0 -12px;border-radius:50%;border:2px solid rgba(255,255,255,.35);border-top-color:#fff;animation:so-spin .7s linear infinite}
html[data-signin-one="enabled"][data-so-live] #staff-mobile-complete.so-sent{color:transparent}
html[data-signin-one="enabled"][data-so-live] #staff-mobile-complete.so-sent::after{content:"Code sent";position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding-left:26px;color:#fff;font-size:16px;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") no-repeat calc(50% - 46px) 50%/20px 20px;animation:so-fade .25s ease-out}
html[data-signin-one="enabled"][data-so-live] #staff-otp-code-row:not([hidden]){animation:so-slide .35s cubic-bezier(.22,1,.36,1)}
/* (5) six code boxes over the real one-time-code input */
html[data-signin-one="enabled"][data-so-live] .so-code{position:relative}
html[data-signin-one="enabled"][data-so-live] .so-boxes{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px}
html[data-signin-one="enabled"][data-so-live] .so-box{display:flex;align-items:center;justify-content:center;height:52px;border:1px solid var(--control-border,#c9bcc6);border-radius:12px;background:#fff;font-size:22px;font-weight:700;color:var(--ink,#19161b);transition:border-color .15s}
html[data-signin-one="enabled"][data-so-live] .so-box.so-full{animation:so-digit .16s ease-out}
html[data-signin-one="enabled"][data-so-live] .so-box.so-on{border-color:var(--plum-2,#68147B);box-shadow:0 0 0 3px rgba(104,20,123,.16)}
html[data-signin-one="enabled"][data-so-live] .so-code #staff-otp-code{position:absolute;inset:0;width:100%;height:100%;min-height:0;opacity:0;border:0;color:transparent;caret-color:transparent;background:transparent}
html[data-signin-one="enabled"][data-so-live] .so-code.so-shake{animation:so-shake .4s ease-in-out}
/* (7) resend ring (the page's own resend gap) */
html[data-signin-one="enabled"][data-so-live] #staff-otp-again{display:inline-flex;align-items:center;gap:6px}
html[data-signin-one="enabled"][data-so-live] .so-ring{display:none;width:16px;height:16px;transform:rotate(-90deg);fill:none;stroke:var(--plum-2,#68147B);stroke-width:3;stroke-linecap:round;stroke-dasharray:56.55;stroke-dashoffset:0}
html[data-signin-one="enabled"][data-so-live] #staff-otp-again.so-counting{opacity:.6}
html[data-signin-one="enabled"][data-so-live] #staff-otp-again.so-counting .so-ring{display:block}
html[data-signin-one="enabled"][data-so-live] #staff-otp-again.so-counting .so-ring circle{animation:so-ring 60s linear forwards}
/* (6) success: the check draws, the card zooms out into the role's home */
html[data-signin-one="enabled"] .so-done{position:absolute;left:50%;top:50%;width:76px;height:76px;margin:-38px 0 0 -38px;padding:18px;box-sizing:border-box;border-radius:50%;background:#1a9e5a;fill:none;stroke:#fff;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round;opacity:0;pointer-events:none}
html[data-signin-one="enabled"] .so-done path{stroke-dasharray:24;stroke-dashoffset:24}
html[data-signin-one="enabled"][data-so-state="done"] .so-done{animation:so-done-in .22s cubic-bezier(.34,1.56,.64,1) forwards}
html[data-signin-one="enabled"][data-so-state="done"] .so-done path{animation:so-draw .3s .12s ease-out forwards}
html[data-signin-one="enabled"][data-so-state="done"] #staff-access{animation:so-leave .4s .3s cubic-bezier(.4,0,1,1) forwards}
html[data-signin-one="enabled"][data-so-state="done"] #staff-login-form{opacity:.15;transition:opacity .2s}
/* (8) reduced motion: no animation, no transition, no drifting blobs */
@media (prefers-reduced-motion: reduce){
html[data-signin-one="enabled"] *,
html[data-signin-one="enabled"] *::before,
html[data-signin-one="enabled"] *::after{animation:none!important;transition:none!important}
html[data-signin-one="enabled"] body.staff-page::before,
html[data-signin-one="enabled"] body.staff-page::after,
html[data-signin-one="enabled"] .staff-page main::before,
html[data-signin-one="enabled"] .signin-one-brand::before{display:none!important}
}
