/*! WorkflowEra app shell v1 – mobile (Android-style) UI. Desktop layout is not changed. */
:root{
  --wf-navy:#0B1B4D;--wf-blue:#1B3A9C;--wf-gold:#FFB627;--wf-ink:#0E1633;--wf-mut:#5B6688;--wf-line:#E3E7F2;
  --wf-nav-h:calc(64px + env(safe-area-inset-bottom));
  --wf-bar-h:calc(56px + env(safe-area-inset-top));
}
.wf-bnav,.wf-install,.wf-ptr,.wf-install-link{display:none}

/* thin page-change bar (all sizes) */
.wf-progress{position:fixed;top:0;left:0;height:3px;width:0;z-index:100001;background:linear-gradient(90deg,var(--wf-gold),#FF8A3D);box-shadow:0 0 8px rgba(255,182,39,.6);pointer-events:none;opacity:0}
.wf-progress.run{opacity:1;animation:wfProg 8s cubic-bezier(.1,.7,.2,1) forwards}
.wf-progress.done{opacity:0;width:100%;transition:opacity .3s}
@keyframes wfProg{0%{width:0}15%{width:45%}50%{width:75%}100%{width:92%}}

@media (max-width:767px){
  html.wf-shell{-webkit-tap-highlight-color:transparent}
  html.wf-shell body{overflow-x:clip;overscroll-behavior-y:contain}
  html.wf-lock,html.wf-lock body{overflow:hidden!important}
  html.wf-has-bnav body{padding-bottom:var(--wf-nav-h)!important}

  /* no zoom-in when typing on phones */
  html.wf-shell input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),
  html.wf-shell select,html.wf-shell textarea{font-size:16px!important}

  /* ---------- bottom navigation ---------- */
  .wf-bnav{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:9990;height:var(--wf-nav-h);
    padding:6px 4px env(safe-area-inset-bottom);box-sizing:border-box;
    background:rgba(255,255,255,.97);-webkit-backdrop-filter:saturate(1.6) blur(14px);backdrop-filter:saturate(1.6) blur(14px);
    border-top:1px solid var(--wf-line);box-shadow:0 -6px 24px rgba(15,31,92,.08)}
  .wf-bnav a,.wf-bnav button{all:unset;box-sizing:border-box;flex:1 1 0;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
    font:600 11px/1.15 Inter,"Noto Sans Devanagari",system-ui,-apple-system,sans-serif;color:var(--wf-mut);cursor:pointer;text-align:center;-webkit-tap-highlight-color:transparent}
  .wf-bnav .wf-lb{max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 2px}
  .wf-bnav .wf-ic{width:52px;height:30px;border-radius:999px;display:flex;align-items:center;justify-content:center;transition:background-color .2s,transform .12s}
  .wf-bnav svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
  /* beat the CRM sidebar rule "nav a{color:#cbd5e1!important;...}" */
  html .wf-bnav a,html .wf-bnav a:hover,html .wf-bnav button{color:var(--wf-mut)!important;background:none!important;border:0!important;border-radius:0!important;font-weight:600!important}
  html .wf-bnav .on,html .wf-bnav .on:hover{color:var(--wf-blue)!important;font-weight:700!important}
  .wf-bnav .on .wf-ic{background:#E3EAFF}
  .wf-bnav a:active .wf-ic,.wf-bnav button:active .wf-ic{transform:scale(.9)}
  .wf-bnav a:focus-visible .wf-ic,.wf-bnav button:focus-visible .wf-ic{outline:2px solid var(--wf-gold);outline-offset:2px}

  /* ---------- CRM app bar ---------- */
  html.wf-ctx-app header.wf-appbar{background:var(--wf-navy)!important;min-height:var(--wf-bar-h);box-sizing:border-box;
    padding:calc(env(safe-area-inset-top) + 8px) 12px 8px!important;gap:10px;box-shadow:0 2px 14px rgba(5,12,40,.28)!important}
  html.wf-ctx-app header.wf-appbar > div{min-width:0;flex:1;gap:12px!important}
  html.wf-ctx-app header.wf-appbar button[onclick]{width:40px;height:40px;flex:none;display:flex;align-items:center;justify-content:center;
    padding:0!important;font-size:19px;border-radius:12px!important;background:rgba(255,255,255,.1)!important;color:#fff!important}
  html.wf-ctx-app header.wf-appbar form{display:none}
  html.wf-ctx-app header.wf-appbar.has-title > div > span{display:none!important}
  .wf-appbar-title{font:700 18px/1.2 Inter,system-ui,sans-serif;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
  .wf-avatar{all:unset;flex:none;width:36px;height:36px;border-radius:50%;background:var(--wf-gold);color:#241600;
    font:800 15px/36px Inter,system-ui,sans-serif;text-align:center;cursor:pointer;box-shadow:0 0 0 2px rgba(255,255,255,.18)}

  /* ---------- CRM drawer ---------- */
  html.wf-ctx-app #sidebar{width:min(84vw,320px)!important;max-width:320px;overflow-y:auto;overscroll-behavior:contain;
    padding:calc(env(safe-area-inset-top) + 22px) 16px calc(env(safe-area-inset-bottom) + 18px)!important;
    border-radius:0 24px 24px 0;box-shadow:16px 0 48px rgba(0,0,0,.4);z-index:10000!important;
    transition:transform .26s cubic-bezier(.2,.8,.2,1)!important}
  html.wf-ctx-app #backdrop{z-index:9995!important;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}
  html.wf-ctx-app #sidebar nav a.sidebar-link{padding:13px 14px!important;font-size:15px!important;gap:14px!important;border-radius:14px!important}
  html.wf-ctx-app #sidebar nav a.sidebar-link span:first-child{font-size:18px;width:24px;text-align:center}
  .wf-install-link{all:unset;box-sizing:border-box;display:flex;align-items:center;gap:10px;width:100%;margin:14px 0 4px;padding:12px 14px;border-radius:14px;
    background:var(--wf-gold);color:#241600;font:800 14px Inter,system-ui,sans-serif;cursor:pointer}
  .wf-install-link svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}

  /* ---------- CRM content ---------- */
  html.wf-ctx-app main{overflow:visible!important;padding:14px 14px calc(var(--wf-nav-h) + 18px)!important;max-width:100vw}
  html.wf-ctx-app main img,html.wf-ctx-app main video,html.wf-ctx-app main iframe{max-width:100%}
  html.wf-ctx-app .wf-toptabs{position:sticky;top:var(--wf-bar-h);z-index:30;margin:-14px -14px 14px!important;border-radius:0!important;
    border-width:0 0 1px!important;padding:8px 10px!important;scrollbar-width:none;box-shadow:0 4px 12px rgba(15,23,42,.06)!important}
  html.wf-ctx-app .wf-toptabs::-webkit-scrollbar{display:none}
  html.wf-ctx-app body .wf-toptabs a.wf-tt{padding:8px 14px!important;font-size:13px}
  .wf-tscroll{overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%;border-radius:12px}
  .wf-tscroll > table{min-width:100%}
  /* big desktop paddings feel cramped on phones */
  html.wf-ctx-app main .p-8{padding:18px!important}
  html.wf-ctx-app main .p-10{padding:20px!important}
  html.wf-ctx-app main .rounded-2xl,html.wf-ctx-app main .rounded-3xl{border-radius:18px!important}

  /* ---------- login / register ---------- */
  html.wf-ctx-auth body{display:flex!important;flex-direction:column!important;align-items:stretch!important;justify-content:flex-end!important;
    min-height:100vh;min-height:100dvh;padding:0!important;background:linear-gradient(170deg,var(--wf-navy) 0%,var(--wf-blue) 100%)!important}
  .wf-auth-hero{flex:1 0 auto;display:flex;flex-direction:column;justify-content:flex-end;gap:6px;color:#fff;
    padding:calc(env(safe-area-inset-top) + 28px) 24px 26px;font-family:Inter,system-ui,sans-serif}
  .wf-auth-hero img{width:56px;height:56px;border-radius:16px;box-shadow:0 10px 26px rgba(0,0,0,.35);margin-bottom:10px}
  .wf-auth-hero h1{margin:0;font-size:27px;font-weight:800;letter-spacing:-.02em}
  .wf-auth-hero p{margin:0;color:#C9D3F5;font-size:15px}
  html.wf-ctx-auth .wf-auth-card{max-width:none!important;width:100%!important;border:0!important;border-radius:28px 28px 0 0!important;
    padding:26px 22px calc(26px + env(safe-area-inset-bottom))!important;box-shadow:0 -12px 40px rgba(5,12,40,.25)!important}
  html.wf-ctx-auth .wf-auth-card > div:first-child{display:none!important}
  html.wf-ctx-auth .wf-auth-card h2{font-size:21px!important}
  html.wf-ctx-auth .wf-auth-card input{border:1.5px solid #D9DEEB!important;border-radius:14px!important;padding:13px 14px!important;background:#F8F9FD}
  html.wf-ctx-auth .wf-auth-card input:focus{outline:none;border-color:var(--wf-blue)!important;background:#fff;box-shadow:0 0 0 3px #E3EAFF}
  html.wf-ctx-auth .wf-auth-card button[type=submit]{background:var(--wf-blue)!important;border-radius:14px!important;padding:15px!important;font-size:16px!important;font-weight:800!important;box-shadow:0 10px 24px rgba(27,58,156,.3)}
  html.wf-ctx-auth .wf-auth-card label{font-size:13px;color:#2E3A5E}

  /* ---------- password eye ---------- */
  .wf-pw{position:relative}
  .wf-pw input{padding-right:48px!important}
  .wf-pw-eye{all:unset;position:absolute;right:6px;top:50%;transform:translateY(-50%);width:40px;height:40px;display:flex;align-items:center;justify-content:center;border-radius:10px;color:#5B6688;cursor:pointer}
  .wf-pw-eye svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}

  /* ---------- install banner ---------- */
  .wf-install{display:flex;align-items:center;gap:12px;position:fixed;left:10px;right:10px;z-index:9992;
    bottom:calc(var(--wf-nav-h) + 10px);padding:12px 12px 12px 12px;border-radius:18px;background:#fff;color:var(--wf-ink);
    box-shadow:0 14px 40px rgba(15,31,92,.25);border:1px solid var(--wf-line);font-family:Inter,"Noto Sans Devanagari",system-ui,sans-serif;
    transform:translateY(140%);transition:transform .35s cubic-bezier(.2,.8,.2,1)}
  html:not(.wf-has-bnav) .wf-install{bottom:calc(10px + env(safe-area-inset-bottom))}
  /* login / register: banner at the top so it never covers the Sign in button */
  html.wf-ctx-auth .wf-install{top:calc(env(safe-area-inset-top) + 10px);bottom:auto;transform:translateY(-160%)}
  html.wf-ctx-auth .wf-install.show{transform:none}
  .wf-install.show{transform:none}
  .wf-install img{width:44px;height:44px;border-radius:12px;flex:none}
  .wf-install-t{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.3}
  .wf-install-t b{font-size:14.5px}
  .wf-install-t span{font-size:12.5px;color:var(--wf-mut)}
  .wf-install-go{all:unset;flex:none;background:var(--wf-blue);color:#fff;font:800 14px Inter,system-ui,sans-serif;padding:10px 16px;border-radius:12px;cursor:pointer}
  .wf-install-x{all:unset;flex:none;width:30px;height:30px;text-align:center;font:400 22px/30px system-ui;color:#8A93AE;cursor:pointer;border-radius:50%}

  /* ---------- pull to refresh ---------- */
  .wf-ptr{display:flex;position:fixed;top:calc(env(safe-area-inset-top) + 10px);left:50%;z-index:10002;width:40px;height:40px;border-radius:50%;
    align-items:center;justify-content:center;background:#fff;color:var(--wf-blue);box-shadow:0 4px 14px rgba(0,0,0,.2);opacity:0;transform:translate(-50%,-60px);pointer-events:none}
  .wf-ptr svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round}
  .wf-ptr.ready{background:var(--wf-blue);color:#fff}
  .wf-ptr.spin{animation:wfSpin .8s linear infinite}
  @keyframes wfSpin{to{transform:translate(-50%,40px) rotate(360deg)}}

  /* ---------- installed app: no browser feel ---------- */
  html.wf-standalone body{-webkit-user-select:none;user-select:none}
  html.wf-standalone input,html.wf-standalone textarea,html.wf-standalone [contenteditable],
  html.wf-standalone main p,html.wf-standalone main td,html.wf-standalone main span{-webkit-user-select:text;user-select:text}
}

@media (max-width:767px) and (prefers-reduced-motion:reduce){
  .wf-install,html.wf-ctx-app #sidebar{transition:none!important}
  .wf-progress.run{animation:none;width:60%}
}
