:root{--ink:#173a35;--muted:#82918d;--deep:#0f322d;--accent:#d1a86c;--accent2:#f4e7d4;--bg:#f7f8f6;--surface:#fff;--border:#e9eeeb;--green:#3e8f70;--danger:#bf5860;--shadow:0 16px 55px rgba(22,56,48,.07)}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;font-family:Manrope,system-ui,-apple-system,sans-serif;color:var(--ink);background:var(--bg)}button,input,select,textarea{font:inherit}button{cursor:pointer}button:disabled{opacity:.55;cursor:not-allowed}a{text-decoration:none;color:inherit}h1,h2,h3,p{margin-top:0}svg{vertical-align:middle;flex-shrink:0}input,select,textarea{outline:none}input:focus,select:focus,textarea:focus{border-color:#8eb7a3!important;box-shadow:0 0 0 3px #d3e7dd88}
.app-shell{display:flex;min-height:100vh}.sidebar{background:var(--deep);color:#e9f1ed;width:262px;flex-shrink:0;padding:30px 19px 20px;display:flex;flex-direction:column;position:sticky;top:0;height:100vh}.brand{display:flex;gap:12px;align-items:center;padding:0 10px;margin-bottom:54px}.brand-symbol{width:46px;height:46px;display:grid;place-items:center;border-radius:16px;background:linear-gradient(145deg,#ecdcaf,#c99a66);color:#28433c;font-size:29px;box-shadow:0 5px 18px #061c1845}.brand b{display:block;font-size:21px;letter-spacing:-.8px;color:#fff}.brand small{display:block;font-size:9px;letter-spacing:.5px;color:#b2c7bc;margin-top:3px}.workspace-label{font-size:10px;letter-spacing:1.25px;color:#779a8c;font-weight:800;padding:0 16px 14px}.navigation{display:flex;flex-direction:column;gap:6px}.nav-item{background:transparent;color:#a9c6ba;border:0;width:100%;text-align:left;padding:13px 15px;border-radius:12px;display:flex;align-items:center;gap:13px;font-size:13px;font-weight:700}.nav-item svg{opacity:.8}.nav-item:hover{background:#ffffff0f}.nav-item.active{background:#315249;color:#fff}.nav-item.active svg{color:#eaca8f;opacity:1}.sidebar-bottom{margin-top:auto}.side-user{margin-top:17px;display:flex;gap:11px;align-items:center;padding:9px}.side-user strong{font-size:12px;color:white;display:block}.side-user small{font-size:10px;color:#a3c2b5}.avatar{display:inline-grid;place-items:center;width:34px;height:34px;border-radius:11px;background:#e7d5b2;color:#3d584b;font-size:12px;font-weight:800}
.work-area{flex:1;min-width:0}.topbar{height:92px;padding:0 43px;background:#fff;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:center}.topbar-title{display:flex;flex-direction:column;gap:4px}.eyebrow{font-size:10px;letter-spacing:1.5px;font-weight:800;color:#ba9869}.topbar-title strong{font-size:17px;letter-spacing:-.4px}.top-actions{display:flex;gap:20px;align-items:center}.live-dot{font-size:11px;color:#648478;display:flex;align-items:center;gap:7px}.live-dot i{background:#68b895;width:7px;height:7px;border-radius:50%;box-shadow:0 0 0 4px #e5f5ee}.date-label{font-size:12px;color:#96a7a0;font-weight:600}.profile-circle{height:35px;width:35px;background:#f2e7d3;color:#a17c45;border-radius:50%;display:grid;place-items:center;font-size:11px;font-weight:800}.content{max-width:1460px;padding:35px 43px 70px;margin:auto}.page-head{display:flex;justify-content:space-between;gap:20px;align-items:center;margin:0 0 26px}.page-title{font-size:28px;letter-spacing:-1.1px;margin:0 0 7px;line-height:1.3;font-weight:800}.subtitle{font-size:12px;color:var(--muted);margin:0}.btn{border:1px solid transparent;border-radius:11px;min-height:41px;padding:10px 17px;display:inline-flex;align-items:center;gap:9px;font-size:12px;font-weight:800;justify-content:center;transition:.2s}.btn:hover{transform:translateY(-1px)}.btn-primary{background:var(--deep);color:#fff}.btn-primary:hover{background:#215044}.btn-light{color:#386455;background:#edf4f0;border-color:#e0ece5}.btn-outline{color:#53665d;background:white;border-color:#e5ebe6}.btn-accent{background:#e7ce9d;color:#3a493b}.btn-danger{background:#fff0f0;color:#b54b55}.btn-sm{min-height:31px;padding:6px 11px;font-size:11px}.btn-icon{width:36px;padding:7px}.actions-line{display:flex;gap:9px;flex-wrap:wrap;align-items:center}.screen-banner{background:linear-gradient(111deg,#143c35,#255747);color:white;border-radius:22px;padding:28px 32px;display:flex;gap:18px;justify-content:space-between;position:relative;overflow:hidden;min-height:150px;margin-bottom:22px}.screen-banner:after{content:'✿';position:absolute;right:20px;top:-81px;color:#ffffff0c;font-size:260px}.screen-banner > div{z-index:1}.banner-tag{display:inline-flex;gap:7px;align-items:center;color:#e6ca92;font-size:10px;letter-spacing:1.3px;font-weight:800;text-transform:uppercase}.screen-banner h2{font-size:24px;letter-spacing:-.7px;margin:10px 0 7px}.screen-banner p{font-size:12px;color:#d6e4db;margin:0;max-width:460px;line-height:1.7}.banner-art{z-index:1;display:flex;align-items:center;margin-right:40px;font-size:65px;color:#dabb7b;opacity:.9}
.grid-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:15px;margin-bottom:22px}.stat-card,.panel,.route-card,.order-card,.staff-card{background:var(--surface);border:1px solid var(--border);border-radius:17px;box-shadow:0 3px 13px #163d2f06}.stat-card{padding:21px 19px;position:relative;overflow:hidden}.stat-card:after{content:'';position:absolute;right:-31px;top:-27px;width:83px;height:83px;border-radius:50%;background:#e8f4ef50}.stat-head{display:flex;align-items:center;justify-content:space-between}.stat-name{font-size:11px;color:#8e9b96;font-weight:700}.stat-icon{height:33px;width:33px;border-radius:11px;display:grid;place-items:center;background:#eef4f0;color:#5c917d}.stat-value{font-size:31px;font-weight:800;letter-spacing:-.9px;margin:17px 0 3px}.stat-foot{font-size:10px;color:#8c9c94}.dashboard-columns{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(280px,1fr);gap:18px}.panel{padding:22px}.panel-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 0 18px}.panel-heading h3{font-size:14px;letter-spacing:-.3px;margin:0}.link-button{border:0;background:none;color:#448b70;font-size:11px;font-weight:800}.table-scroll{overflow:auto}.data-table{width:100%;border-collapse:collapse;white-space:nowrap}.data-table th{font-size:10px;letter-spacing:.7px;font-weight:800;color:#a1ada6;text-align:left;border-bottom:1px solid #eaf0ec;padding:11px 10px;text-transform:uppercase}.data-table td{font-size:12px;color:#40594f;padding:15px 10px;border-bottom:1px solid #f0f3f1}.data-table tr:last-child td{border:0}.data-table tbody tr{cursor:pointer}.data-table tbody tr:hover{background:#f8fbf8}.id-num{font-weight:800;color:#b38a54}.client-cell strong{display:block;font-size:12px;color:#243f34}.client-cell small{font-size:10px;color:#a2aca7}.status{display:inline-flex;align-items:center;gap:6px;padding:6px 9px;border-radius:7px;font-weight:800;font-size:10px;white-space:nowrap}.status:before{content:'';width:6px;height:6px;border-radius:50%;background:currentColor}.status-processing{background:#f0f2f6;color:#6d778a}.status-assembling{background:#fff1dc;color:#bd8d44}.status-ready{background:#e6f5e9;color:#4d9b64}.status-dispatched{background:#e3f0fb;color:#4b90b9}.status-delivered{background:#e2f3ec;color:#33856a}.status-cancelled{background:#ffe7e8;color:#b76065}
.route-mini{display:flex;align-items:center;gap:11px;padding:13px 0;border-bottom:1px solid #edf0ed}.route-mini:last-child{border:0}.route-letter{width:36px;height:36px;background:#f5f0e6;border-radius:11px;display:grid;place-items:center;color:#b5905c}.route-mini strong{font-size:12px;display:block}.route-mini small{font-size:10px;color:#97a39c;display:block;margin-top:3px}.route-mini b{margin-left:auto;background:#eff6f2;border-radius:9px;padding:7px 10px;font-size:12px}.toolbar{padding:17px;background:white;border:1px solid var(--border);border-radius:16px;display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-bottom:17px}.field-input,.field-select{background:#fff;border:1px solid #e5ece7;color:#344e43;border-radius:10px;min-height:41px;padding:10px 12px;font-size:12px;max-width:100%;min-width:0}.field-input::placeholder{color:#b2beb6}.field-select{appearance:none;padding-right:28px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%2386968d' stroke-width='2'/%3E%3C/svg%3E");background-position:right 9px center;background-repeat:no-repeat}.search-input{min-width:230px;flex:1}.search-wrap{display:flex;align-items:center;position:relative;flex:1;min-width:180px}.search-wrap svg{position:absolute;left:12px;color:#96a89e}.search-wrap input{padding-left:36px;width:100%}.filter-date{max-width:150px}.toolbar .field-select{width:160px}.count-text{font-size:11px;color:#99a79c;margin-bottom:12px}.order-cards{display:none}.empty{padding:60px 20px;text-align:center;color:#8a9b91}.empty-icon{font-size:50px;opacity:.45;margin-bottom:12px}.empty h3{font-size:15px;color:#4d6259;margin:0 0 7px}.empty p{font-size:12px;line-height:1.7}.notice{border-radius:12px;padding:12px 14px;background:#f6ead0;color:#876a37;font-size:11px;font-weight:700;margin-bottom:16px;line-height:1.6}.error-notice{background:#ffecec;color:#a64747}.small-muted{font-size:11px;color:#93a39a;line-height:1.6}
.filters-strip{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:14px 0 19px}.pill{border:1px solid #e6eeea;background:white;padding:8px 13px;border-radius:999px;font-size:11px;font-weight:700;color:#628072}.pill.active{background:#e6f2ea;border-color:#cfe4d5;color:#236b4f}.route-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}.route-card{padding:20px}.route-header{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}.route-name{display:block;font-weight:800;font-size:15px;margin-bottom:5px}.route-sub{font-size:11px;color:#9aa89f}.count-round{border-radius:12px;background:#edf5ef;color:#4b8669;font-size:16px;font-weight:800;min-width:37px;height:36px;display:grid;place-items:center}.route-slot{display:flex;justify-content:space-between;align-items:center;padding:12px 0 10px;border-bottom:1px solid #eff2ef;font-size:11px}.route-slot b{font-size:12px;color:#315e4b}.route-slot small{color:#98a99e;font-size:10px}.route-slot:last-child{border:0}.delivery-list{margin-top:10px;border-top:1px solid #eef2ef}.delivery-line{padding:10px 0;border-bottom:1px dashed #e7eee9;display:grid;grid-template-columns:50px minmax(0,1fr) auto;align-items:center;gap:9px}.delivery-line:last-child{border:0}.delivery-line strong{font-size:11px}.delivery-line small{display:block;color:#879b8c;font-size:10px;margin-top:3px}.section-note{display:flex;gap:8px;align-items:center;font-size:11px;color:#8b9d90;margin:0 0 20px}.tab-switches{display:flex;gap:5px;padding:5px;background:#edf4ee;border-radius:11px}.tab-switches button{background:transparent;border:0;border-radius:8px;padding:9px 12px;color:#799084;font-size:11px;font-weight:800}.tab-switches button.active{background:#fff;box-shadow:0 2px 8px #00000008;color:#3a6d54}.staff-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px}.staff-card{padding:18px}.staff-top{display:flex;gap:11px;align-items:center}.staff-top strong{font-size:12px;display:block}.staff-top small{font-size:10px;color:#8fa095;display:block;margin-top:5px}.staff-roles{margin-top:16px;border-top:1px solid var(--border);padding-top:12px;display:flex;justify-content:space-between;align-items:center}.role-tag{font-size:10px;background:#eaf0ed;color:#49755f;border-radius:7px;padding:5px 9px;font-weight:800}.staff-off{opacity:.5}.staff-off .role-tag{background:#ffe7e8;color:#a34d4d}.soft-hint{background:#ecf5ef;border-radius:13px;padding:14px 16px;font-size:11px;color:#62836e;margin-bottom:17px;line-height:1.65}
.loading{min-height:240px;display:grid;place-items:center;align-content:center;gap:13px;color:#90a397;font-size:12px}.spinner{width:28px;height:28px;border:3px solid #e4ece6;border-top:3px solid #568b71;border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}
.modal-backdrop{position:fixed;inset:0;z-index:50;background:#132c2580;display:flex;justify-content:center;align-items:center;padding:14px;overflow:auto;backdrop-filter:blur(4px)}.modal{width:100%;max-width:640px;background:#fff;border-radius:20px;box-shadow:0 25px 75px #0d241d40;max-height:min(95vh,1000px);overflow:auto;animation:rise .2s ease}.modal.wide{max-width:760px}@keyframes rise{from{transform:translateY(11px);opacity:.5}to{transform:translateY(0);opacity:1}}.modal-head{display:flex;justify-content:space-between;align-items:flex-start;padding:22px 25px 18px;border-bottom:1px solid #eef1ee}.modal-head h3{font-size:18px;letter-spacing:-.5px;margin:0 0 4px}.modal-head p{font-size:11px;color:#93a198;margin:0}.close-btn{height:33px;width:33px;display:grid;place-items:center;border:0;background:#f0f4f1;border-radius:10px;color:#6f8a7b}.modal-body{padding:22px 25px}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}.form-field{display:flex;flex-direction:column;gap:7px;min-width:0}.form-field label{font-size:11px;font-weight:800;color:#536e60}.form-field .field-input,.form-field .field-select{width:100%;min-height:43px}.form-field textarea{resize:vertical;min-height:90px}.span-two{grid-column:1/-1}.form-help{color:#a2b0a5;font-size:10px;margin:0}.modal-actions{display:flex;gap:9px;justify-content:flex-end;padding:18px 25px 22px;border-top:1px solid #eef2ef;flex-wrap:wrap}.detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.detail-cell{background:#f7faf7;border-radius:11px;padding:12px}.detail-cell small{display:block;color:#93a69a;font-size:10px;margin-bottom:7px}.detail-cell strong{font-size:12px;line-height:1.6;overflow-wrap:anywhere}.status-progress{display:flex;gap:5px;margin-bottom:18px}.progress-step{flex:1;min-height:8px;background:#ebeeeb;border-radius:99px}.progress-step.done{background:#6ca58b}.timeline{margin:12px 0 0;padding:0;list-style:none}.timeline li{position:relative;padding:0 0 16px 19px;border-left:1px solid #dfe7e1;margin-left:7px}.timeline li:before{content:'';position:absolute;left:-5px;top:4px;width:9px;height:9px;border-radius:50%;background:#8cbea4}.timeline li:last-child{border-left-color:transparent}.timeline strong{font-size:11px}.timeline small{display:block;color:#97a89a;font-size:10px;margin-top:5px}.toast-holder{position:fixed;bottom:25px;right:25px;z-index:90;max-width:400px}.toast{background:#183b30;color:#fff;border-radius:13px;padding:13px 17px;font-size:12px;box-shadow:var(--shadow);margin-top:10px}.toast.error{background:#b34a52}.mobile-nav{display:none}
.demo-banner{background:#f9eecd;border:1px solid #f0ddb0;color:#9d7638;border-radius:12px;padding:11px 13px;margin-bottom:20px;font-size:11px;font-weight:700;line-height:1.5}.demo-banner strong{font-weight:800}
@media(max-width:1120px){.sidebar{width:220px}.content{padding:27px 25px 55px}.topbar{padding:0 25px}.grid-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.staff-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-columns{grid-template-columns:1fr}}
@media(max-width:760px){.sidebar{display:none}.app-shell{display:block}.work-area{width:100%}.topbar{height:77px;padding:8px 17px}.topbar-title strong{font-size:15px}.top-actions{gap:10px}.top-actions .date-label,.top-actions .live-dot{display:none}.content{padding:21px 14px 100px}.page-title{font-size:23px}.page-head{align-items:flex-start}.page-head .btn{font-size:11px;padding:9px 11px;min-height:37px}.grid-stats{gap:9px;margin-bottom:16px}.stat-card{padding:16px}.stat-value{font-size:27px}.dashboard-columns{gap:12px}.panel{padding:15px}.screen-banner{min-height:135px;border-radius:17px;padding:22px 21px}.screen-banner h2{font-size:19px}.banner-art{display:none}.route-grid{grid-template-columns:1fr}.toolbar{padding:11px;gap:9px}.toolbar .field-select{flex:1;width:145px}.order-cards{display:block}.table-scroll.orders-desktop{display:none}.order-card{padding:15px;margin-bottom:10px;cursor:pointer}.order-top{display:flex;justify-content:space-between;margin-bottom:10px}.order-grid{display:flex;gap:10px;flex-wrap:wrap;color:#82978a;font-size:11px;margin:10px 0}.order-main{font-size:14px;font-weight:800}.order-main small{color:#a4b0a6;font-size:10px;font-weight:500;margin-left:3px}.staff-grid{grid-template-columns:1fr}.mobile-nav{display:flex;position:fixed;bottom:0;left:0;right:0;z-index:30;background:#fff;border-top:1px solid #e4ede6;justify-content:space-around;padding:10px 6px calc(9px + env(safe-area-inset-bottom));box-shadow:0 -7px 30px #1e3c2912}.mobile-item{display:flex;align-items:center;flex-direction:column;gap:5px;border:0;background:none;color:#9aac9e;min-width:57px;font-size:9px;font-weight:800}.mobile-item.active{color:#286d54}.mobile-item svg{width:20px;height:20px}.modal-backdrop{padding:0;align-items:flex-end}.modal{border-radius:19px 19px 0 0;max-height:94vh}.modal-head,.modal-body{padding:17px}.modal-actions{padding:13px 17px calc(18px + env(safe-area-inset-bottom))}.form-grid{gap:12px}.toast-holder{bottom:95px;left:12px;right:12px;max-width:initial}.tab-switches{overflow-x:auto}}
@media(max-width:390px){.form-grid{grid-template-columns:1fr}.span-two{grid-column:auto}.date-label{display:none}.page-head{gap:10px}.btn{padding:9px 11px}.stat-name{font-size:10px}}
@media print{body{background:#fff!important}.sidebar,.topbar,.mobile-nav,.page-head .actions-line,.toolbar,.filters-strip,.btn,.demo-banner,.notice{display:none!important}.content{padding:0!important}.route-grid{display:block}.route-card{break-inside:avoid;box-shadow:none;margin:0 0 12px}.app-shell{display:block}.work-area{display:block}.page-head{display:block!important}.page-head .btn{display:none!important}}

/* 2.0.2: fail-closed auth gate. No app controls are visible or operable before login. */
.auth-gate{display:none;position:fixed;inset:0;z-index:1000;align-items:center;justify-content:center;padding:24px;background:#f4f7f3;text-align:center}
body.auth-locked .auth-gate{display:flex}
body.auth-locked .app-shell,body.auth-locked .mobile-nav,body.auth-locked #modalRoot,body.auth-locked #toasts{display:none!important}
.auth-gate-card{width:100%;max-width:440px;background:#fff;border:1px solid #e4ebe5;border-radius:20px;padding:32px 25px;box-shadow:0 14px 45px #123d2912}
.auth-gate h1{margin:8px 0 10px;font-size:21px;color:#183b30}
.auth-gate p{margin:0 auto 22px;max-width:340px;line-height:1.65;font-size:13px;color:#60766b;overflow-wrap:anywhere}
.auth-gate-symbol{font-size:40px;color:#46876b}
.auth-gate-loading{display:grid;justify-items:center;gap:14px}
.auth-gate-loading p{margin:0}
.auth-retry{min-height:44px;min-width:200px;cursor:pointer}
[hidden]{display:none!important}
@media print{body.auth-locked .auth-gate{display:flex!important}}


/* Narciss 2.0.6 · iPhone notch / Dynamic Island / Telegram fullscreen safe areas.
   Hardware inset is max() of CSS env, Telegram CSS and JS; Telegram chrome inset
   is added separately. This prevents double-counting the same notch. */
:root{
  --nf-safe-top:max(env(safe-area-inset-top,0px),var(--tg-safe-area-inset-top,0px),var(--narciss-safe-top,0px));
  --nf-safe-right:max(env(safe-area-inset-right,0px),var(--tg-safe-area-inset-right,0px),var(--narciss-safe-right,0px));
  --nf-safe-bottom:max(env(safe-area-inset-bottom,0px),var(--tg-safe-area-inset-bottom,0px),var(--narciss-safe-bottom,0px));
  --nf-safe-left:max(env(safe-area-inset-left,0px),var(--tg-safe-area-inset-left,0px),var(--narciss-safe-left,0px));
  --nf-content-top:max(var(--tg-content-safe-area-inset-top,0px),var(--narciss-content-top,0px));
  --nf-content-right:max(var(--tg-content-safe-area-inset-right,0px),var(--narciss-content-right,0px));
  --nf-content-bottom:max(var(--tg-content-safe-area-inset-bottom,0px),var(--narciss-content-bottom,0px));
  --nf-content-left:max(var(--tg-content-safe-area-inset-left,0px),var(--narciss-content-left,0px));
  --nf-top:0px;
  --nf-right:0px;
  --nf-bottom:var(--nf-safe-bottom);
  --nf-left:0px;
}
html.narciss-fullscreen{
  --nf-top:calc(var(--nf-safe-top) + var(--nf-content-top));
  --nf-right:calc(var(--nf-safe-right) + var(--nf-content-right));
  --nf-bottom:calc(var(--nf-safe-bottom) + var(--nf-content-bottom));
  --nf-left:calc(var(--nf-safe-left) + var(--nf-content-left));
}
/* Stable Telegram viewport height avoids mobile 100vh mismatches. */
.app-shell{min-height:var(--narciss-viewport-height,100dvh)}
html.narciss-fullscreen .sidebar{
  height:var(--narciss-viewport-height,100dvh);
  padding-top:calc(30px + var(--nf-top));
  padding-bottom:calc(20px + var(--nf-bottom));
  padding-left:calc(19px + var(--nf-left));
}
html.narciss-fullscreen .topbar{
  height:calc(92px + var(--nf-top));
  padding-top:var(--nf-top);
  padding-left:calc(43px + var(--nf-left));
  padding-right:calc(43px + var(--nf-right));
}
html.narciss-fullscreen .content{
  padding-left:calc(43px + var(--nf-left));
  padding-right:calc(43px + var(--nf-right));
  padding-bottom:calc(70px + var(--nf-bottom));
}
.auth-gate{
  padding-top:calc(24px + var(--nf-top));
  padding-bottom:calc(24px + var(--nf-bottom));
  padding-left:calc(24px + var(--nf-left));
  padding-right:calc(24px + var(--nf-right));
  overflow-y:auto;
}
@media (max-width:760px){
  html.narciss-fullscreen .topbar{
    height:calc(77px + var(--nf-top));
    padding-top:calc(8px + var(--nf-top));
    padding-left:calc(17px + var(--nf-left));
    padding-right:calc(17px + var(--nf-right));
  }
  html.narciss-fullscreen .content{
    padding:21px calc(14px + var(--nf-right)) calc(100px + var(--nf-bottom)) calc(14px + var(--nf-left));
  }
  .mobile-nav{
    padding:10px calc(6px + var(--nf-right)) calc(9px + var(--nf-bottom)) calc(6px + var(--nf-left));
  }
  .modal-backdrop{
    padding-top:var(--nf-top);
    padding-right:var(--nf-right);
    padding-left:var(--nf-left);
  }
  .modal{max-height:calc(var(--narciss-viewport-height,100dvh) - var(--nf-top))}
  .modal-actions{padding-bottom:calc(18px + var(--nf-bottom))}
  .toast-holder{bottom:calc(95px + var(--nf-bottom));left:calc(12px + var(--nf-left));right:calc(12px + var(--nf-right))}
}
@media print{
  .app-shell{min-height:auto}
  .content,html.narciss-fullscreen .content{padding:0!important}
}

/* On iOS (including iPhone with Dynamic Island), header and controls must
   remain fully visible when Telegram switches the Mini App to fullscreen. */
html.narciss-fullscreen body { background: var(--bg); }
html.narciss-fullscreen .topbar { background: #fff; }
@media(max-width:760px){
  html.narciss-fullscreen .topbar { min-height: calc(77px + var(--nf-top)); }
  html.narciss-fullscreen .mobile-nav { bottom:0; }
}
/* CSS Fullscreen API fallback for clients which do not expose isFullscreen. */
@media (display-mode: fullscreen) {
  html:not(.narciss-fullscreen) .topbar { padding-top: env(safe-area-inset-top,0px); height:calc(92px + env(safe-area-inset-top,0px)); }
}

.build-stamp{font-size:10px;font-weight:700;letter-spacing:.2px;color:#9caea4;white-space:nowrap}
@media(max-width:760px){.top-actions{gap:8px}.build-stamp{font-size:9px}}

/* Narciss 2.1.0 — conditional order form, pickup dashboard, and payment controls */
.order-type-caption{margin:2px 0 10px;color:#638275;font-size:11px;font-weight:800;letter-spacing:.11em}
.order-type-switch{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin:0 0 20px;padding:6px;border:1px solid #dfebe1;background:#f4f8f3;border-radius:15px}
.order-type-choice{display:flex;align-items:center;justify-content:center;gap:10px;border:1px solid transparent;border-radius:11px;background:transparent;padding:13px 12px;font-weight:800;font-size:13px;color:#678171;cursor:pointer;min-height:48px;transition:background .16s,border-color .16s,color .16s}
.order-type-choice.active{background:#fff;border-color:#a7cbb1;color:#1d664e;box-shadow:0 3px 13px #173d2911}
.order-type-choice:hover{color:#1e654d}
.order-delivery-fields{margin:18px 0 0;padding:16px;background:#f7faf7;border:1px solid #e4ece4;border-radius:14px}
.order-delivery-fields[hidden]{display:none!important}
.form-section-title{display:flex;align-items:center;gap:8px;font-size:12px;color:#1f5945;margin:0 0 13px}
.order-rest-fields{margin-top:16px}
.order-type-switch + input + .form-grid{margin-top:8px}
.payment-actions{display:flex;align-items:center;flex-wrap:wrap;gap:7px}
.flag-btn{border:1px solid transparent;border-radius:9px;padding:8px 10px;font-size:11px;font-weight:800;line-height:1.3;cursor:pointer;white-space:nowrap;min-height:32px;transition:background .16s}
.flag-yes{background:#e4f3e9;border-color:#b5dac0;color:#236f48}
.flag-no{background:#fff3e8;border-color:#f1d6ba;color:#97613f}
.flag-btn:focus-visible,.order-type-choice:focus-visible{outline:3px solid #87c2a5;outline-offset:2px}
.fulfillment-card{background:#fff;border:1px solid #e4ece5;border-radius:14px;padding:15px;margin-bottom:10px;box-shadow:0 4px 18px #0e332408}
.fulfillment-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;cursor:pointer;padding-bottom:11px;border-bottom:1px solid #f0f2ed}
.fulfillment-head>div{display:flex;align-items:center;gap:10px;flex-wrap:wrap;min-width:0}
.fulfillment-head b{font-size:12px;color:#244636}
.fulfillment-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px 15px;padding:13px 0;cursor:pointer}
.order-fact{display:flex;flex-direction:column;gap:3px;min-width:0}
.order-fact small{font-size:10px;font-weight:750;color:#91a39a}
.order-fact span{font-size:12px;line-height:1.45;color:#294d3b;overflow-wrap:anywhere;white-space:pre-wrap}
.fulfillment-card>.payment-actions{padding-top:10px;border-top:1px solid #eff3ef}
.pickup-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.pickup-grid .fulfillment-card{margin-bottom:0}
.detail-payment{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;background:#f5faf6;border:1px solid #e1eee5;border-radius:12px;padding:14px}
.detail-payment strong,.detail-status-line strong{font-size:12px}
.detail-status-line{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:13px}
.order-card-main{cursor:pointer;padding:0 0 12px}
.order-card>.payment-actions{border-top:1px solid #e8eee9;padding-top:10px}
.orders-desktop .payment-actions{min-width:125px;flex-direction:column;align-items:stretch}
.orders-desktop .flag-btn{text-align:center}
.status-assembled{background:#e5f2f3;color:#24777a}
@media(max-width:1100px){.pickup-grid{grid-template-columns:1fr}}
@media(max-width:760px){
  .mobile-nav{gap:0;padding-left:max(2px,var(--nf-left));padding-right:max(2px,var(--nf-right))}
  .mobile-item{min-width:0;flex:1;padding:1px 0;font-size:9px;gap:4px}
  .mobile-item span{white-space:nowrap;letter-spacing:-.15px}
  .mobile-item svg{width:19px;height:19px}
  .pickup-grid{gap:11px}
  .fulfillment-facts{gap:10px;grid-template-columns:repeat(2,minmax(0,1fr))}
  .order-delivery-fields{padding:12px}
  .order-type-choice{font-size:12px;min-height:48px}
  .modal-head{flex-shrink:0}
  .modal-actions{flex-shrink:0}
}
@media(max-width:390px){.fulfillment-facts{grid-template-columns:1fr 1fr}.order-type-choice{font-size:11px;gap:5px}.flag-btn{font-size:10px;padding:8px}}
@media print{.flag-btn,.payment-actions .flag-btn{border:0;box-shadow:none}.order-type-switch{display:none}}

/* v2.1.1: payment and fiscal receipt are visible but not interactive for florist. */
.payment-readonly .flag-btn{cursor:default;display:inline-flex;align-items:center;justify-content:center}


/* Narciss 2.1.2: manually selected and locally remembered appearance. */
.theme-toggle{
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  min-width:100px;min-height:36px;padding:7px 11px;border-radius:11px;
  border:1px solid #dfe8e2;background:#f5f8f5;color:#315c4a;
  font-size:11px;font-weight:800;white-space:nowrap;transition:background .15s,border-color .15s;
}
.theme-toggle:hover{background:#e8f1e9;border-color:#b3cdbb}
.theme-toggle:focus-visible{outline:3px solid #6eb79c;outline-offset:2px}
.theme-toggle-icon{font-size:18px;line-height:1}
@media(max-width:760px){
  .theme-toggle{min-width:38px;width:38px;height:38px;padding:0}
  #themeToggleText{display:none}
}
@media(max-width:390px){.top-actions{gap:6px}.build-stamp{display:none}}

html[data-theme="dark"]{
  color-scheme:dark;
  --ink:#e2eeea;--muted:#a6b9b4;--deep:#152b2c;--accent:#e1bd83;
  --accent2:#3e3b31;--bg:#101b20;--surface:#192b30;--border:#30454a;
  --green:#73bea1;--danger:#ee8f96;--shadow:0 16px 55px #0005;
}
html[data-theme="dark"] .sidebar{background:#0e2628}
html[data-theme="dark"] .topbar,
html[data-theme="dark"].narciss-fullscreen .topbar{background:#182a2f;border-bottom-color:var(--border)}
html[data-theme="dark"] .theme-toggle{background:#263c3c;border-color:#476160;color:#f4d298}
html[data-theme="dark"] .theme-toggle:hover{background:#36524d}
html[data-theme="dark"] .eyebrow,html[data-theme="dark"] .id-num{color:#ebc88e}
html[data-theme="dark"] .date-label,html[data-theme="dark"] .build-stamp{color:#a0b9b4}
html[data-theme="dark"] .live-dot{color:#afd5bd}
html[data-theme="dark"] .live-dot i{box-shadow:0 0 0 4px #24473f}
html[data-theme="dark"] .profile-circle{background:#423c30;color:#e9cd98}
html[data-theme="dark"] .screen-banner{background:linear-gradient(110deg,#184237,#205444)}
html[data-theme="dark"] .screen-banner p{color:#d4e5df}
html[data-theme="dark"] .stat-card:after{background:#42796316}
html[data-theme="dark"] .stat-name,html[data-theme="dark"] .stat-foot,
html[data-theme="dark"] .client-cell small,html[data-theme="dark"] .route-sub,
html[data-theme="dark"] .route-slot small,html[data-theme="dark"] .delivery-line small,
html[data-theme="dark"] .staff-top small,html[data-theme="dark"] .timeline small,
html[data-theme="dark"] .modal-head p,html[data-theme="dark"] .form-help,
html[data-theme="dark"] .small-muted,html[data-theme="dark"] .section-note,
html[data-theme="dark"] .count-text,html[data-theme="dark"] .order-fact small{
  color:#9db6b0;
}
html[data-theme="dark"] .client-cell strong,html[data-theme="dark"] .data-table td,
html[data-theme="dark"] .empty h3,html[data-theme="dark"] .route-slot b,
html[data-theme="dark"] .form-field label,html[data-theme="dark"] .fulfillment-head b,
html[data-theme="dark"] .fulfillment-facts .order-fact span{
  color:#dce9e3;
}
html[data-theme="dark"] .stat-icon,html[data-theme="dark"] .count-round,
html[data-theme="dark"] .route-mini b,html[data-theme="dark"] .role-tag{
  background:#29443f;color:#a4ddbb;
}
html[data-theme="dark"] .toolbar,html[data-theme="dark"] .pill,
html[data-theme="dark"] .modal,html[data-theme="dark"] .fulfillment-card{
  background:var(--surface);border-color:var(--border);
}
html[data-theme="dark"] .field-input,html[data-theme="dark"] .field-select,
html[data-theme="dark"] input,html[data-theme="dark"] select,
html[data-theme="dark"] textarea{
  background-color:#14262c;color:#e0ece8;border-color:#3a5558;
}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder{
  color:#92aaa7;
}
html[data-theme="dark"] input:focus,html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus{box-shadow:0 0 0 3px #345b5388}
html[data-theme="dark"] .field-select{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%23adc3b8' stroke-width='2'/%3E%3C/svg%3E");
}
html[data-theme="dark"] .search-wrap svg{color:#a0b6b2}
html[data-theme="dark"] .btn-primary{background:#356c5b;color:#fff}
html[data-theme="dark"] .btn-primary:hover{background:#43886f}
html[data-theme="dark"] .btn-light,html[data-theme="dark"] .btn-outline,
html[data-theme="dark"] .close-btn{background:#283d3e;border-color:#3d5857;color:#d6e8df}
html[data-theme="dark"] .btn-light:hover,html[data-theme="dark"] .btn-outline:hover,
html[data-theme="dark"] .close-btn:hover{background:#36534c}
html[data-theme="dark"] .btn-danger{background:#482f37;color:#ffb2b6}
html[data-theme="dark"] .link-button{color:#98dab7}
html[data-theme="dark"] .data-table th{color:#acc1b9;border-bottom-color:var(--border)}
html[data-theme="dark"] .data-table td,html[data-theme="dark"] .route-mini,
html[data-theme="dark"] .route-slot,html[data-theme="dark"] .order-card>.payment-actions,
html[data-theme="dark"] .fulfillment-head,html[data-theme="dark"] .fulfillment-card>.payment-actions,
html[data-theme="dark"] .staff-roles{border-color:var(--border)}
html[data-theme="dark"] .data-table tbody tr:hover{background:#263b3b}
html[data-theme="dark"] .route-letter{background:#3e3a31;color:#e1bd83}
html[data-theme="dark"] .pill{color:#bdd8ca}
html[data-theme="dark"] .pill.active{background:#315345;border-color:#476e5a;color:#d7f3dc}
html[data-theme="dark"] .tab-switches,html[data-theme="dark"] .order-type-switch{
  background:#14272b;border-color:#34504a;
}
html[data-theme="dark"] .tab-switches button,html[data-theme="dark"] .order-type-choice{color:#b2cbc0}
html[data-theme="dark"] .tab-switches button.active,
html[data-theme="dark"] .order-type-choice.active{background:#315249;border-color:#55816a;color:#f5f5e5}
html[data-theme="dark"] .soft-hint,html[data-theme="dark"] .detail-cell,
html[data-theme="dark"] .detail-payment,html[data-theme="dark"] .order-delivery-fields{
  background:#203837;border:1px solid #37544c;color:#c3ded1;
}
html[data-theme="dark"] .detail-payment strong,html[data-theme="dark"] .detail-status-line strong{color:#e6eeea}
html[data-theme="dark"] .modal-head,html[data-theme="dark"] .modal-actions,
html[data-theme="dark"] .delivery-list,html[data-theme="dark"] .delivery-line,
html[data-theme="dark"] .timeline li{border-color:var(--border)}
html[data-theme="dark"] .progress-step{background:#344945}
html[data-theme="dark"] .progress-step.done{background:#80c4a1}
html[data-theme="dark"] .flag-yes{background:#244d3e;border-color:#417b5a;color:#b2e6c4}
html[data-theme="dark"] .flag-no{background:#4a352d;border-color:#825c45;color:#ffd8a8}
html[data-theme="dark"] .status-processing{background:#374456;color:#c2cede}
html[data-theme="dark"] .status-assembling{background:#51432b;color:#f4d08c}
html[data-theme="dark"] .status-assembled{background:#25484d;color:#9cdbdb}
html[data-theme="dark"] .status-ready,html[data-theme="dark"] .status-delivered{background:#244b3c;color:#a1daba}
html[data-theme="dark"] .status-dispatched{background:#29475b;color:#a9d1f1}
html[data-theme="dark"] .status-cancelled{background:#572e37;color:#ffb9bf}
html[data-theme="dark"] .role-tag{background:#2f4b42;color:#b1e5bf}
html[data-theme="dark"] .staff-off .role-tag{background:#522d35;color:#f4a8af}
html[data-theme="dark"] .empty{color:#9eb4ae}
html[data-theme="dark"] .notice,html[data-theme="dark"] .demo-banner{background:#4c3e2b;border-color:#74613b;color:#f5d79c}
html[data-theme="dark"] .error-notice{background:#542e37;color:#ffc0c6}
html[data-theme="dark"] .auth-gate{background:var(--bg)}
html[data-theme="dark"] .auth-gate-card{background:var(--surface);border-color:var(--border);box-shadow:0 15px 45px #0006}
html[data-theme="dark"] .auth-gate h1{color:var(--ink)}
html[data-theme="dark"] .auth-gate p{color:var(--muted)}
html[data-theme="dark"] .auth-gate-symbol{color:#e3c18b}
html[data-theme="dark"] .mobile-nav{background:#172c30;border-top-color:var(--border)}
html[data-theme="dark"] .mobile-item{color:#a8c9be}
html[data-theme="dark"] .mobile-item.active{color:#e4c58b}
@media print{
  html[data-theme="dark"]{color-scheme:light;--bg:#fff;--surface:#fff;--ink:#173a35;--border:#e9eeeb;--muted:#82918d}
  html[data-theme="dark"] .route-card,html[data-theme="dark"] .fulfillment-card,
  html[data-theme="dark"] .panel{background:#fff;color:#173a35;border-color:#dee6df;box-shadow:none}
  html[data-theme="dark"] .fulfillment-head b,html[data-theme="dark"] .order-fact span,
  html[data-theme="dark"] .route-slot b,html[data-theme="dark"] .data-table td{color:#173a35}
}

/* Narciss 2.1.3: shared florist purchasing board and personal assignments */
.flower-panel{margin:22px 0}
.flower-panel-heading{align-items:center;gap:15px;flex-wrap:wrap}
.flower-panel-heading h3{font-size:18px}
.flower-panel-heading p{margin-top:5px}
.flower-tabs{display:flex;gap:7px;flex-wrap:wrap;margin:18px 0 17px}
.flower-tabs button{border:1px solid var(--border);background:var(--surface);color:var(--muted);padding:9px 13px;border-radius:11px;font:inherit;font-size:12px;font-weight:750;cursor:pointer}
.flower-tabs button.active{background:#e3f2e8;border-color:#8fc2a8;color:#265840}
.flower-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,270px),1fr));gap:13px}
.flower-reminder{padding:16px;background:#fbfdf9;border:1px solid #dce9dd;border-radius:14px;min-width:0}
.flower-reminder-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.flower-reminder-head strong{color:var(--ink);font-size:15px;overflow-wrap:anywhere}
.flower-mark{color:#559477;font-size:20px}
.flower-date{display:inline-flex;align-items:center;gap:4px;color:#788e7e;font-size:11px;white-space:nowrap}
.flower-quantity{font-size:13px;color:var(--ink);margin-top:12px}
.flower-comment{margin:9px 0 0;color:var(--muted);font-size:13px;white-space:pre-wrap;overflow-wrap:anywhere}
.flower-reminder-foot{display:flex;justify-content:space-between;align-items:center;gap:9px;margin-top:16px;flex-wrap:wrap}
.flower-done{font-size:12px;color:#337d52;font-weight:750}
.payment-method-label{font-size:12px;font-weight:700;color:var(--ink);margin-bottom:6px}
.pagination-line{justify-content:center;align-items:center;margin-top:15px}
html[data-theme="dark"] .flower-reminder{background:#1c3233;border-color:#3a554d}
html[data-theme="dark"] .flower-reminder-head strong,html[data-theme="dark"] .flower-quantity,html[data-theme="dark"] .payment-method-label{color:#e1eee7}
html[data-theme="dark"] .flower-mark,html[data-theme="dark"] .flower-done{color:#a1dab4}
html[data-theme="dark"] .flower-tabs button{background:#1b3033;color:#b8d0c4;border-color:#38524c}
html[data-theme="dark"] .flower-tabs button.active{background:#315345;color:#ebf5ed;border-color:#608e70}
html[data-theme="dark"] .flower-date{color:#a7beb4}
@media(max-width:760px){.flower-panel{margin:15px 0}.flower-grid{grid-template-columns:1fr}.flower-tabs{gap:6px}.flower-tabs button{font-size:11px;padding:9px 10px}.flower-reminder{padding:13px}}
@media(max-width:390px){.flower-reminder-head{flex-wrap:wrap}.flower-panel-heading .btn{width:100%;justify-content:center}}
@media print{.flower-panel{display:none!important}}

/* Narciss 2.1.5 — multiple role controls and permission matrix */
.permissions-panel{margin-bottom:20px}
.permissions-panel .panel-heading{padding-bottom:14px}
.permissions-heading{display:flex;gap:12px;flex-wrap:wrap;align-items:center;justify-content:space-between}
.permissions-toggle{display:inline-flex;align-items:center;justify-content:center;gap:8px;white-space:nowrap}
.permissions-toggle svg{transition:transform .18s ease}
.permissions-toggle[aria-expanded="true"] svg{transform:rotate(180deg)}
.permissions-toggle:focus-visible{outline:3px solid #70b69e;outline-offset:2px}
.permissions-body[hidden]{display:none}
.permissions-table-wrap{width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
.permissions-table{width:100%;border-collapse:collapse;min-width:600px;font-size:12px}
.permissions-table th,.permissions-table td{text-align:left;padding:11px 12px;border-bottom:1px solid var(--border,#e2e9e4);vertical-align:top}
.permissions-table th{font-weight:700;white-space:nowrap;background:#edf4ee;color:#27473d}
.permissions-table td:first-child{font-weight:600;min-width:190px}
.permissions-table .permission-cell{white-space:normal;min-width:110px}
.permissions-body>.small-muted{padding:12px 16px 16px;line-height:1.6}
html[data-theme="dark"] .permissions-table th{background:#284246;color:#e8f2ed;border-bottom-color:#456064}
html[data-theme="dark"] .permissions-table td{color:#dbe9e3;border-bottom-color:var(--border)}
html[data-theme="dark"] .permissions-panel .panel-heading h3{color:#e6efe9}
@media print{html[data-theme="dark"] .permissions-table th{background:#edf4ee;color:#27473d}}
.role-tags,.role-choices{display:flex;gap:7px;flex-wrap:wrap}
.role-choices{padding:4px 0}
.role-choice{display:flex;align-items:center;gap:9px;border:1px solid var(--border,#d9e5de);border-radius:10px;padding:10px 13px;cursor:pointer;background:var(--card,#fff);font-size:13px;font-weight:600}
.role-choice input{accent-color:#337e60;width:17px;height:17px;cursor:pointer}
.role-choice:has(input:checked){border-color:#438a70;background:rgba(47,133,96,.1)}
.permission-preview{border:1px solid var(--border,#dce7df);border-radius:12px;padding:14px;margin-top:18px}
.permission-preview-title{font-size:14px;font-weight:700;margin-bottom:10px}
.permission-preview-grid{display:grid;gap:0}
.permission-preview-row{display:flex;justify-content:space-between;align-items:start;gap:12px;padding:8px 0;border-bottom:1px solid var(--border,#e5ebe6);font-size:12px}
.permission-preview-row:last-child{border-bottom:0}
.permission-preview-row strong{max-width:48%;text-align:right}
.permission-deny{color:var(--muted,#819188)}
.permission-allow{color:var(--accent,#397e63)}
@media(max-width:600px){.permissions-panel{margin-left:0;margin-right:0}.permission-preview-row{font-size:11px}.role-choice{flex:1 1 125px}}
.login-form{display:grid;gap:14px;text-align:left}.login-form label{display:grid;gap:6px;font-weight:600}.login-form .field-input{width:100%;min-width:0}.login-form .btn{width:100%}.logout-btn{white-space:nowrap}@media(max-width:480px){.top-actions .profile-circle{display:none}.logout-btn{padding:5px 8px;min-height:32px}.topbar-title{min-width:0}.topbar-title strong{overflow-wrap:anywhere}}

.profile-circle{border:0;cursor:pointer;flex:none}.profile-circle:focus-visible{outline:2px solid currentColor;outline-offset:3px}@media(max-width:480px){.top-actions .profile-circle{display:grid}.top-actions .logout-btn{display:none}}

/* My orders: date and sorting controls reuse both theme palettes. */
.mine-toolbar{align-items:flex-end;flex-wrap:wrap}
.mine-filter{display:flex;flex-direction:column;gap:5px;flex:0 1 auto;min-width:0}
.mine-filter .field-input,.mine-filter .field-select{width:100%;min-width:0;max-width:100%;box-sizing:border-box}
.mine-date-actions{flex-wrap:wrap}
@media(max-width:540px){.mine-filter{flex:1 1 100%;width:100%}.mine-date-actions{width:100%}.mine-date-actions .btn{flex:1}}
