@media screen {
  .fw51-order-actions { display:flex; align-items:flex-end; gap:12px; flex-wrap:wrap; }
  .fw51-order-period { display:flex; flex-direction:column; gap:5px; font-size:11px; font-weight:700; color:var(--muted-foreground); }
  .fw51-order-period select { max-width:100%; min-height:46px; border:1px solid var(--fw50-line); border-radius:12px; padding:0 12px; background:var(--fw50-white); color:var(--fw50-ink); font-size:13px; font-weight:700; }
  .fw51-order-period select:focus-visible { outline:2px solid #8175b5; outline-offset:2px; }
  .fw51-add-order { background:#079452!important; color:white!important; min-height:46px; padding:0 20px; border-radius:12px; box-shadow:0 8px 18px #07945228; }
  .fw51-modal-overlay { position:fixed; inset:0; z-index:60; background:#18172e99; backdrop-filter:blur(5px); }
  .fw51-order-modal { position:fixed; z-index:61; top:50%; left:50%; transform:translate(-50%,-50%); width:min(760px,calc(100vw - 32px)); max-height:calc(100dvh - 32px); overflow:auto; background:var(--fw50-white,#fff); color:var(--fw50-ink,#181e35); border:1px solid var(--fw50-line,#e6e8f0); border-radius:22px; box-shadow:0 24px 90px #16132b55; }
  .fw51-modal-head { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; padding:22px 26px 18px; border-bottom:1px solid var(--fw50-line); }
  .fw51-modal-head h2 { font-size:27px; font-weight:800; letter-spacing:-.04em; line-height:1.2; margin:4px 0; }
  .fw51-modal-head p { font-size:12px; color:var(--muted-foreground); }
  .fw51-modal-head .fw51-modal-kicker { font-size:10px; font-weight:800; letter-spacing:.12em; color:#8175b5; }
  .fw51-modal-close { width:36px; height:36px; flex:none; border-radius:10px; background:var(--fw50-soft); font-size:25px; line-height:1; }
  .fw51-modal-close:disabled { opacity:.5; }
  .fw51-modal-body { padding:22px 26px; }
  .fw51-modal-body form label { font-size:12px; font-weight:700; }
  .fw51-modal-body form input,.fw51-modal-body form textarea,.fw51-modal-body form button[role=combobox] { border-radius:9px; min-height:41px; }
  body:has(.fw51-order-modal) [data-radix-popper-content-wrapper] { z-index:75!important; }
  .fw51-login { box-sizing:border-box; min-height:100dvh; width:100%; display:grid; grid-template-columns:1.05fr 1fr; background:#f3f5fa; color:#181e35; padding:0!important; margin:0!important; max-width:none!important; }
  .fw51-login-brand { min-height:100dvh; background:radial-gradient(circle at 85% 12%,#7564c46b,transparent 37%),linear-gradient(140deg,#33265c,#17152e 85%); padding:clamp(28px,5vw,78px); display:flex; flex-direction:column; justify-content:space-between; color:#fff; }
  .fw51-login-logo { display:flex; align-items:center; justify-content:center; background:#fff; width:185px; min-height:72px; border-radius:15px; padding:14px; }
  .fw51-login-logo img { width:157px; height:auto; }
  .fw51-login-story { max-width:540px; padding:40px 0; }
  .fw51-login-overline { text-transform:uppercase; color:#8175b5; letter-spacing:.16em; font-size:11px; font-weight:800; }
  .fw51-login-brand .fw51-login-overline { color:#a8dfbc; }
  .fw51-login-story h1 { font-size:clamp(40px,5.3vw,78px); line-height:1.04; font-weight:800; letter-spacing:-.06em; margin:14px 0 22px; }
  .fw51-login-story > p:not(.fw51-login-overline) { font-size:clamp(15px,1.6vw,19px); line-height:1.65; color:#d8d5ed; max-width:440px; }
  .fw51-login-feature { display:flex; align-items:center; gap:22px; margin-top:34px; }
  .fw51-login-feature span { display:grid; place-items:center; height:58px; width:58px; border:1px solid #ffffff35; border-radius:17px; background:#ffffff12; font-weight:800; font-size:18px; }
  .fw51-login-route { color:#66dca0; font-size:18px; letter-spacing:.13em; }
  .fw51-login-footer { color:#a9a3c6; font-size:11px; letter-spacing:.08em; }
  .fw51-login-form-side { display:flex; align-items:center; justify-content:center; padding:40px; }
  .fw51-login-form-card { background:#fff; border:1px solid #e6e8f0; width:min(100%,445px); padding:36px; border-radius:24px; box-shadow:0 12px 48px #211a4910; }
  .fw51-login-form-card h2 { font-size:34px; font-weight:800; letter-spacing:-.05em; line-height:1.1; margin:12px 0; }
  .fw51-login-desc { font-size:14px; color:#737b98; margin-bottom:28px; }
  .fw51-login form label { display:block; font-size:13px; font-weight:700; margin:16px 0 7px; }
  .fw51-login form input { width:100%; height:49px; padding:12px 14px; border:1px solid #dce0e9; border-radius:10px; background:#f9faff; color:#181e35; font:inherit; outline:none; }
  .fw51-login form input:focus { border-color:#8175b5; box-shadow:0 0 0 3px #8175b526; }
  .fw51-password-wrap { position:relative; }
  .fw51-password-wrap input { padding-right:75px!important; }
  .fw51-password-toggle { position:absolute; right:12px; top:50%; transform:translateY(-50%); color:#6253a4; font-size:12px; font-weight:700; }
  .fw51-login-submit { width:100%; min-height:49px; margin-top:24px; background:#079452; border-radius:11px; color:#fff; font-size:14px; font-weight:800; box-shadow:0 7px 20px #07945224; }
  .fw51-login-submit:disabled { opacity:.65; }
  .fw51-login-error { color:#9d262c; background:#fcebed; border-radius:9px; padding:10px; margin-top:12px; font-size:12px; }
  .fw51-login-help { font-size:11px; color:#737b98; margin-top:20px; text-align:center; }
  .fw51-login-mobile-logo { display:none; }
  @media(max-width:800px){.fw51-login{grid-template-columns:1fr; align-items:center}.fw51-login-brand{display:none}.fw51-login-form-side{min-height:100dvh;padding:24px 16px;flex-direction:column;gap:22px}.fw51-login-mobile-logo{display:block}.fw51-login-mobile-logo img{width:170px}.fw51-login-form-card{padding:25px;border-radius:18px}.fw51-modal-head,.fw51-modal-body{padding:16px}.fw51-order-modal{max-height:calc(100dvh - 16px);width:calc(100vw - 16px);border-radius:15px}}
  @media(prefers-reduced-motion:no-preference){.fw51-order-modal{animation:fw51-enter .18s ease-out}.fw51-login-form-card{animation:fw51-fade .35s ease-out}@keyframes fw51-enter{from{opacity:0;transform:translate(-50%,-48%) scale(.98)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}@keyframes fw51-fade{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}}
}


/* V65 — Mobile workspace. Desktop sidebar and print rules stay unchanged. */
@media screen {
  .fw65-menu-trigger,.fw65-menu-shade,.fw65-drawer-head{display:none}
  @media(max-width:1023px){
    body.fw65-menu-open{overflow:hidden}
    header.no-print{position:sticky!important;top:0;z-index:40;background:var(--fw50-white,#fff);box-shadow:0 3px 20px #17152e12}
    header.no-print > div:last-child{min-height:64px;gap:8px;padding:8px 12px;max-width:100%;width:100%;box-sizing:border-box}
    header.no-print > div:last-child > a{min-width:0;flex:1;justify-content:flex-start}
    header.no-print > div:last-child > a img{width:clamp(105px,32vw,145px);height:auto;max-height:40px;object-fit:contain}
    header.no-print > div:last-child > a span,.fw65-exit-label{display:none}
    header.no-print > div:last-child > div{gap:2px;flex:none}
    header.no-print > div:last-child > div button,.fw65-menu-trigger{min-height:44px;min-width:44px;padding:0;border-radius:12px;display:inline-flex;align-items:center;justify-content:center}
    .fw65-menu-trigger{color:var(--fw50-ink,#181e35);background:var(--fw50-soft,#edf0f6);border:1px solid var(--fw50-line,#e6e8f0)}
    .fw65-menu-trigger svg{width:23px;height:23px}
    .fw65-menu-shade{display:block;position:fixed;inset:0;width:100%;height:100%;background:#14132c99;z-index:1;border:0;backdrop-filter:blur(2px)}
    .fw-team-nav{position:fixed!important;inset:0 auto 0 0;z-index:2;display:flex!important;flex-direction:column;align-items:stretch;justify-content:flex-start;flex-wrap:nowrap;width:min(310px,calc(100% - 38px));max-width:none;margin:0;padding:max(20px,env(safe-area-inset-top)) 16px max(24px,env(safe-area-inset-bottom));gap:7px;border:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;background:linear-gradient(155deg,#28204f,#17152e 80%);color:#eae8fa;box-shadow:18px 0 50px #14132c40;visibility:hidden;transform:translateX(-105%);transition:transform .24s ease,visibility .24s}
    .fw-team-nav.fw65-drawer-open{visibility:visible;transform:translateX(0)}
    .fw65-drawer-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:6px 3px 20px;border-bottom:1px solid #ffffff20;margin-bottom:10px}
    .fw65-drawer-head strong{display:block;color:#fff;font-size:21px;font-weight:800;letter-spacing:.055em}
    .fw65-drawer-head small{display:block;font-size:11px;color:#c7c4e3;margin-top:4px}
    .fw65-drawer-close{display:grid;place-items:center;width:44px;height:44px;flex:none;border-radius:12px;color:white;background:#ffffff16;font-size:27px;line-height:1}
    .fw-team-nav .fw-nav-caption{display:block;color:#a7a0cc;font-size:11px;letter-spacing:.14em;padding:8px 11px}
    .fw-team-nav .fw-team-user{display:block;color:#dff9e8;background:#ffffff10;border:1px solid #ffffff17;border-radius:12px;white-space:normal;padding:12px;margin:7px 0;text-align:left}
    .fw-team-nav a{display:flex;gap:12px;align-items:center;min-height:49px;padding:12px;color:#d7d4ef;border-radius:12px;font-size:14px;white-space:normal}
    .fw-team-nav a svg{width:20px;height:20px;flex:none}
    .fw-team-nav .fw-nav-orders{background:#ffffff18;color:white;box-shadow:inset 3px 0 #52dc91}
    .fw-team-nav a:hover{color:white;background:#ffffff20}
    .fw50-dashboard main{min-width:0;max-width:100%}
    .fw50-dashboard .fw-status-quickfilters{display:flex;flex-wrap:wrap;overflow:visible;gap:6px}
    .fw50-dashboard .fw-status-quickfilters button{min-height:40px}
    .fw50-dashboard .fw50-table{max-width:100%}
  }
  @media(max-width:800px){
    .fw51-login{min-height:100vh;min-height:100svh;background:radial-gradient(ellipse at 10% 0,#29765b80,transparent 48%),linear-gradient(155deg,#27224e,#15182e 80%);align-items:stretch}
    .fw51-login-form-side{min-height:100vh;min-height:100svh;padding:max(28px,env(safe-area-inset-top)) 16px max(28px,env(safe-area-inset-bottom));gap:24px;width:100%;box-sizing:border-box}
    .fw51-login-mobile-logo{display:flex;align-items:center;justify-content:center;background:#fff;width:182px;min-height:64px;padding:12px;border-radius:15px;box-shadow:0 10px 30px #0002}
    .fw51-login-mobile-logo img{width:155px;height:auto}
    .fw51-login-form-card{box-sizing:border-box;width:min(100%,460px);padding:clamp(20px,6vw,30px);border-radius:23px;border:1px solid #fff;box-shadow:0 22px 65px #07091545}
    .fw51-login-form-card h2{font-size:clamp(27px,8vw,34px);margin:10px 0}
    .fw51-login-desc{margin-bottom:20px;line-height:1.5}
    .fw51-login form input{font-size:16px!important;height:52px}
    .fw51-password-toggle{min-height:44px;padding:0 4px}
    .fw51-login-submit{min-height:52px;border-radius:12px;font-size:15px}
    .fw51-login-error{font-size:13px;line-height:1.45}
    .fw51-login-help{line-height:1.5}
    .fw51-modal-body form input,.fw51-modal-body form textarea,.fw51-modal-body form select,.fw51-modal-body form button[role=combobox]{font-size:16px!important;min-height:44px}
  }
  @media(max-width:639px){
    .fw50-dashboard main > .fw50-hero{padding:18px 16px}
    .fw50-dashboard .fw51-order-actions{display:grid;grid-template-columns:minmax(0,1fr);gap:10px;align-items:stretch}
    .fw51-order-period select,.fw51-add-order{width:100%;font-size:16px}
    .fw50-dashboard main .fw50-kpis > :nth-child(n+3){grid-column:1/-1;min-height:90px}
    .fw50-dashboard main .fw50-kpis .font-display{font-size:clamp(21px,7vw,27px)}
    .fw50-dashboard main .fw50-kpis .text-muted-foreground{font-size:11px;line-height:1.4}
    .fw50-dashboard .fw50-table ul.divide-y > li{padding:14px 12px;overflow-wrap:anywhere}
    .fw50-dashboard input[type=search],.fw50-dashboard input[type=text],.fw50-dashboard select{font-size:16px}
  }
  @media(prefers-reduced-motion:reduce){.fw-team-nav{transition:none!important}}
}

/* V66: FlexPosta settings live in the sidebar, never over the orders. */
@media screen {
  #fw-flex-settings-btn{display:none!important}
  .fw-team-nav .fw66-flex-nav{display:flex;align-items:center;gap:12px;width:100%;min-height:44px;flex:none;text-align:left;box-sizing:border-box;color:#c7c4e3;font-size:13px;font-weight:700;border:0;border-top:1px solid #ffffff19;border-radius:11px;background:transparent;margin-top:10px;padding:12px;cursor:pointer}
  .fw-team-nav .fw66-flex-nav:hover,.fw-team-nav .fw66-flex-nav:focus-visible{color:#fff;background:#ffffff18}
  .fw-team-nav .fw66-flex-nav svg{width:19px;height:19px;flex:none}
  @media(max-width:1023px){
    .fw-team-nav .fw66-flex-nav{min-height:49px;font-size:14px;color:#d7d4ef}
    #fw-flex-modal{overflow:auto;box-sizing:border-box}
    #fw-flex-modal>div{max-height:calc(100dvh - 40px);overflow:auto;box-sizing:border-box}
  }
}

