

:root{color-scheme:light;--bg:#f3f6fb;--panel:#fff;--panel-soft:#f8faff;--line:#e1e8f1;--text:#17263b;--muted:#718198;--blue:#2478e8;--green:#15966e;--red:#d94e5b;--gold:#c98219;--purple:#7652ce;--shadow:0 5px 18px rgba(24,48,82,.07)}
*{box-sizing:border-box}html{background:var(--bg)}body{margin:0;background:var(--bg);color:var(--text);font:15px/1.4 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;min-height:100vh;-webkit-tap-highlight-color:transparent}button,input,textarea,select{font:inherit}button{border:0;border-radius:13px;padding:14px 13px;background:var(--blue);color:#fff;font-weight:850;min-height:48px;cursor:pointer;touch-action:manipulation;box-shadow:0 2px 5px rgba(20,54,98,.10)}button:active{transform:translateY(1px)}button:disabled{opacity:.5}
.wrap{width:100%;max-width:560px;margin:0 auto;padding:14px 13px calc(30px + env(safe-area-inset-bottom))}.top{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:4px 2px 15px}.brand{font-weight:950;letter-spacing:1.1px;font-size:21px;color:#183456}.brand span{color:var(--blue)}.sub{font-size:12px;color:var(--muted);margin-top:2px}.pill{border:1px solid #dce6f1;background:#fff;border-radius:30px;padding:8px 11px;color:#40536d;font-size:12px;font-weight:750;max-width:45%;overflow-wrap:anywhere}
.top-tools{display:flex;align-items:center;gap:7px;min-width:0}.fullscreen-btn{flex:0 0 auto;width:38px;height:38px;padding:0;border:1px solid #dce6f1;border-radius:11px;background:#fff;color:#40536d;font-size:23px;line-height:1;box-shadow:0 2px 6px rgba(30,55,85,.05)}.fullscreen-btn.is-active{background:#eaf2fb;border-color:#cbdced;color:#1e568a}.fullscreen-btn:active{transform:scale(.96)}
.panel{background:var(--panel);border:1px solid var(--line);border-radius:18px;padding:15px;margin:0 0 13px;box-shadow:var(--shadow)}.title{font-size:17px;font-weight:900;margin:0 0 13px;color:#203752}.grid{display:grid;grid-template-columns:1fr 1fr;gap:9px}.service{min-height:76px;text-align:left;display:flex;align-items:center;gap:10px;padding:12px;background:#e8f2ff;color:#1857a8;box-shadow:none;border:1px solid #d5e7ff}.service b{display:block;font-size:12px;line-height:1.25;letter-spacing:.15px}.service small{display:block;color:#59718e;font-size:11px;font-weight:600;margin-top:4px}.service .ico{font-size:24px;flex:0 0 27px}.service.own{background:#f1ebff;color:#6945b4;border-color:#e5d9ff}.service.own small{color:#756795}.service.puck{background:#e6f8f7;color:#087d79;border-color:#ccefeb}.service.puck small{color:#547f7d}.service.stick{background:#fff3e5;color:#a85b13;border-color:#ffe4c5}.service.stick small{color:#8a735b}.service.sharp{background:#eaf0f8;color:#385678;border-color:#d9e3ef;grid-column:1/-1;min-height:68px}
.field{margin:12px 0}.field label{display:block;font-size:13px;font-weight:800;color:#435873;margin:0 0 6px}.field input,.field textarea,.field select{width:100%;background:#fff;border:1px solid #d7e1ec;border-radius:11px;padding:13px;color:var(--text);outline:none;min-height:48px;font-size:16px}.field textarea{min-height:68px;resize:vertical}.field input:focus,.field textarea:focus,.field select:focus{border-color:var(--blue);box-shadow:0 0 0 3px rgba(36,120,232,.12)}.hint{background:#eef6ff;border:1px solid #d6e9ff;border-radius:10px;padding:10px;color:#235b98;font-weight:800;font-size:13px}.pay{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}.pay button{background:#f2f5f9;color:#50627a;border:1px solid #e1e7ef;font-size:11px;padding:10px 3px;box-shadow:none}.pay button.sel[data-p="QR КОД"]{background:#e1f6f5;color:#087a76;outline:2px solid #52bdb6}.pay button.sel[data-p="КАРТА"]{background:#e8efff;color:#3159b0;outline:2px solid #8aa7f1}.pay button.sel[data-p="НАЛИЧНЫЕ"]{background:#e6f6ec;color:#197344;outline:2px solid #73c695}.actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:14px}.primary{background:#2478e8;color:#fff}.secondary{background:#edf2f8;color:#3d5572;border:1px solid #e0e7f0;box-shadow:none}.success{background:#16885e}.danger{background:#d94e5b}.wide{width:100%}.muted{color:var(--muted)}.hidden{display:none!important}.size-list{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}.size-cell{display:flex;align-items:center;justify-content:space-between;background:#f7f9fc;border:1px solid #e2e9f1;border-radius:10px;padding:7px}.size-cell span{font-weight:850;font-size:13px}.size-cell button{min-height:34px;width:32px;padding:0;background:#e6eef8;color:#294b75;box-shadow:none}.size-cell strong{min-width:18px;text-align:center}
.statusbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;font-size:12px;color:var(--muted)}.dot{width:8px;height:8px;border-radius:50%;display:inline-block;background:var(--green);margin-right:5px}.dot.off{background:var(--gold)}.shift-actions{display:flex;gap:8px;margin-top:11px}.shift-actions button{flex:1;font-size:12px;padding:12px 8px}.order{border:1px solid #e1e8f0;border-left:5px solid var(--blue);border-radius:13px;padding:12px;margin:9px 0;background:#fff;box-shadow:0 2px 7px rgba(30,55,85,.04)}.order.own{border-left-color:var(--purple)}.order.puck{border-left-color:#23aaa5}.order.stick{border-left-color:#e49a45}.order.sharp{border-left-color:#8199b6}.order.overdue{border-color:#e7a4a8;background:#fff7f7}.orderhead{display:flex;justify-content:space-between;align-items:flex-start;gap:8px}.orderhead-right{display:flex;flex-direction:column;align-items:flex-end;gap:4px;flex-shrink:0}.order-number{font-size:10px;font-weight:900;letter-spacing:.35px;color:#315b87;background:#edf4fb;border:1px solid #dce8f4;border-radius:6px;padding:3px 6px;white-space:nowrap;font-variant-numeric:tabular-nums}.ordername{font-weight:900;font-size:16px;overflow-wrap:anywhere;color:#263d58}.amount{font-weight:950;font-size:18px;white-space:nowrap;color:#183c68}.meta{font-size:12px;color:#718198;margin-top:7px;line-height:1.45}.timer{font-size:13px;font-weight:900;color:#a56b12;margin-top:8px}.overdue .timer{color:#c33c49}.tag{display:inline-block;margin-top:8px;border-radius:7px;padding:5px 8px;font-size:10px;font-weight:900;background:#edf2f7;color:#50627a}.tag.qr{background:#e1f6f5;color:#087a76}.tag.card{background:#e8efff;color:#3159b0}.tag.cash{background:#e6f6ec;color:#197344}.order button{width:100%;margin-top:10px}.section{margin:19px 0 8px;color:#617995;font-size:12px;font-weight:950;letter-spacing:.8px}.empty{text-align:center;color:#8795a8;padding:22px 8px;font-size:13px}.msg{font-size:13px;font-weight:750;color:#2369b2;min-height:20px;margin:7px 2px}.tabs{display:flex;gap:7px;margin-bottom:12px}.tabs button{flex:1;background:#edf2f8;color:#50627a;font-size:12px;box-shadow:none}.tabs button.active{background:#2478e8;color:#fff}.login{max-width:420px;margin:9vh auto;padding:18px}.login .brand{text-align:center;font-size:25px;margin-bottom:18px}.login-panel{padding:20px}.login-mark{width:58px;height:58px;margin:0 auto 12px;border-radius:18px;display:grid;place-items:center;background:#e8f2ff;color:#2478e8;font-size:30px}.login .title{text-align:center}.admin-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.admin-grid button{font-size:11px;padding:11px 8px}.statrow{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;border-bottom:1px solid var(--line);padding:9px 0;font-size:13px;color:#40536d}.statrow>span{flex:1;min-width:130px}.staff-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}.staff-actions button{font-size:10px;white-space:nowrap}.refresh{margin-top:10px}.logout{background:#fff;color:#a0444d;border:1px solid #f0dadd;box-shadow:none;margin-top:2px}.foot{font-size:11px;color:#94a1b1;text-align:center;margin:17px 0}.boot{padding:35vh 20px;text-align:center;font-weight:900;color:#183456}
@media(max-width:370px){.wrap{padding:9px 9px calc(24px + env(safe-area-inset-bottom))}.panel{padding:12px}.brand{font-size:18px}.service{padding:10px;gap:7px}.service b{font-size:11px}.service small{font-size:10px}.size-list{grid-template-columns:repeat(2,1fr)}.shift-actions button{font-size:10px}}


/* Защита от повторной отправки и понятная финансовая статистика */
button.is-loading{opacity:.72;cursor:wait;transform:none;position:relative}
button:disabled{opacity:.58;cursor:wait;transform:none}
.stats-head{background:linear-gradient(135deg,#edf5ff,#f8fbff);border:1px solid #dceafd;border-radius:15px;padding:16px;margin:8px 0 10px}
.stats-kicker{font-size:10px;letter-spacing:1px;font-weight:900;color:#66809f}
.stats-total{font-size:30px;line-height:1.15;font-weight:950;letter-spacing:-.8px;color:#173d69;margin-top:5px;font-variant-numeric:tabular-nums}
.stats-count{font-size:12px;color:#73869e;margin-top:5px;font-weight:650}
.stats-payments{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin:0 0 20px}
.stats-payments>div{min-width:0;background:#fff;border:1px solid #e4eaf2;border-radius:12px;padding:10px 8px;display:flex;flex-direction:column;gap:5px}
.stats-payments small{font-size:9px;letter-spacing:.35px;color:#7b8ba0;font-weight:850;white-space:nowrap}
.stats-payments b{font-size:13px;color:#2b405a;font-weight:900;white-space:nowrap;font-variant-numeric:tabular-nums}
.pay-dot{width:7px;height:7px;border-radius:50%}.qr-dot{background:#19a69b}.card-dot{background:#477fe0}.cash-dot{background:#26a36e}
.stats-section{margin:18px 0 20px}
.stats-section-title{display:flex;justify-content:space-between;align-items:center;color:#58718e;font-size:11px;font-weight:950;letter-spacing:.85px;margin:0 2px 8px}
.stats-section-title span{font-size:10px;letter-spacing:0;font-weight:750;color:#91a0b2}
.stats-item{background:#fff;border:1px solid #e4eaf1;border-radius:12px;padding:11px 12px;margin:7px 0;box-shadow:0 2px 7px rgba(30,55,85,.035)}
.stats-item-top{display:flex;justify-content:space-between;align-items:center;gap:10px;padding-bottom:9px;border-bottom:1px solid #edf1f6}
.stats-date{font-size:13px;font-weight:850;color:#334b67;min-width:0}
.stats-amount{font-size:16px;font-weight:950;color:#173d69;white-space:nowrap;font-variant-numeric:tabular-nums}
.stats-item-bottom{display:grid;grid-template-columns:repeat(3,minmax(0,1fr)) auto;align-items:center;gap:5px;padding-top:8px;color:#8291a4;font-size:10px}
.stats-item-bottom span{white-space:nowrap}.stats-item-bottom b{display:block;color:#526780;font-size:11px;margin-top:2px;font-variant-numeric:tabular-nums}
.stats-item-bottom .stats-orders{align-self:center;background:#f0f4f9;color:#5f7188;padding:5px 6px;border-radius:7px;font-weight:850;font-size:10px}
.stats-empty{text-align:center;padding:15px;color:#8b99aa;font-size:12px;background:#f8fafd;border-radius:10px}
@media(max-width:370px){.stats-total{font-size:26px}.stats-item{padding:10px}.stats-item-bottom{gap:3px;font-size:9px}.stats-item-bottom b{font-size:10px}.stats-payments>div{padding:9px 6px}.stats-payments b{font-size:11px}}
.sharp-stats{background:#f4f8f5;border:1px solid #dcebe0;border-radius:14px;padding:13px;margin:0 0 18px}.sharp-stats-title{font-size:11px;letter-spacing:.65px;font-weight:950;color:#42664d;margin-bottom:10px}.sharp-stats-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.sharp-stats-grid>div{min-width:0;background:#fff;border:1px solid #e4eee6;border-radius:10px;padding:9px}.sharp-stats-grid small{display:block;color:#788b7c;font-size:10px;font-weight:750;margin-bottom:4px}.sharp-stats-grid b{display:block;color:#294b33;font-size:16px;font-weight:950;font-variant-numeric:tabular-nums}.sharp-stats-grid .sharp-profit{background:#e7f5e9;border-color:#cce6d1}.sharp-stats-grid .sharp-profit b{color:#16713a;font-size:20px}.sharp-stats-grid em{display:block;font-style:normal;color:#63816a;font-size:10px;margin-top:3px}.stats-sharp-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px 8px;border-top:1px dashed #e4eaf0;margin-top:9px;padding-top:8px;color:#819080;font-size:10px}.stats-sharp-row b{color:#4d6852;font-size:11px}.stats-sharp-profit b{color:#16713a}@media(max-width:370px){.stats-sharp-row{font-size:9px}.stats-sharp-row b{font-size:10px}}

/* История смен в едином стиле с финансовой статистикой */
.shift-history-head{display:grid;grid-template-columns:.8fr .8fr 1.4fr;gap:7px;margin:8px 0 15px;padding:12px;background:linear-gradient(135deg,#edf5ff,#f8fbff);border:1px solid #dceafd;border-radius:14px}
.shift-history-head>div{min-width:0}.shift-history-head small,.shift-times small,.shift-money small{display:block;color:#8191a5;font-size:9px;font-weight:900;letter-spacing:.45px;margin-bottom:4px}.shift-history-head b{display:block;color:#24496f;font-size:15px;font-weight:950;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.shift-history-head>div:last-child b{font-size:17px;color:#173d69}
.shift-history-list{display:grid;gap:9px}.shift-card{background:#fff;border:1px solid #e4eaf1;border-radius:14px;padding:12px;box-shadow:0 2px 7px rgba(30,55,85,.035);min-width:0}.shift-card.is-open{border-color:#cfe8d8;background:linear-gradient(135deg,#fff,#fbfffc)}.shift-card-top{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;padding-bottom:9px;border-bottom:1px solid #edf1f6}.shift-number{font-size:13px;font-weight:950;letter-spacing:.35px;color:#334b67}.shift-cashier{font-size:12px;color:#8291a4;font-weight:650;margin-top:3px}.shift-status{flex:0 0 auto;border-radius:20px;padding:5px 8px;font-size:9px;font-weight:950;letter-spacing:.4px}.shift-status.closed{background:#edf2f7;color:#63758b}.shift-status.open{background:#e5f6eb;color:#197344}.shift-times{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:10px 0 8px}.shift-times>div,.shift-money>div{min-width:0}.shift-times b{display:block;font-size:11px;line-height:1.35;color:#526780;font-weight:800;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}.shift-money{display:grid;grid-template-columns:1fr auto;align-items:end;gap:8px;background:#f6f9fd;border:1px solid #edf1f6;border-radius:10px;padding:9px 10px}.shift-revenue b{display:block;color:#173d69;font-size:20px;line-height:1.15;font-weight:950;font-variant-numeric:tabular-nums}.shift-orders{text-align:right}.shift-orders b{display:block;color:#526780;font-size:16px;font-weight:950}.shift-payments{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;padding-top:9px;color:#8291a4;font-size:10px}.shift-payments span{min-width:0}.shift-payments b{display:block;color:#526780;font-size:11px;margin-top:2px;font-variant-numeric:tabular-nums}
@media(max-width:370px){.shift-history-head{gap:5px;padding:10px 8px}.shift-history-head small{font-size:8px}.shift-history-head b{font-size:13px}.shift-history-head>div:last-child b{font-size:14px}.shift-card{padding:10px}.shift-revenue b{font-size:18px}.shift-times b{font-size:10px}.shift-payments{font-size:9px}.shift-payments b{font-size:10px}}

/* Администраторский редактор смен и аудит */
.danger{background:#fff1f1!important;color:#a33b45!important;border:1px solid #f0cfd2!important;box-shadow:none!important}
.shift-edit-btn{margin-top:11px!important}
.shift-card.is-void{opacity:.72;border-style:dashed}
.shift-status.void{background:#fcebed;color:#a33b45}
.shift-editor{margin-top:16px;padding:14px;background:#f8fafc;border:1px solid #dce5ef;border-radius:14px;scroll-margin-top:12px}
.editor-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;margin-bottom:12px}
.editor-head h3{font-size:16px;color:#263f5c;margin:0}.editor-head p{font-size:12px;color:#8291a4;margin:4px 0 0}
.editor-head button{min-height:34px;padding:7px 10px;font-size:10px}
.editor-dates{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.editor-dates .field,.edit-order-fields .field{min-width:0;margin-bottom:8px}
.editor-dates input,.edit-order-fields input,.edit-order-fields select{min-width:0;width:100%;font-size:12px;padding:10px 7px}
.editor-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}
.editor-actions button{font-size:10px;padding:11px 7px}
.editor-note{font-size:11px;line-height:1.45;color:#6f8197;background:#eef3f8;border-radius:9px;padding:10px;margin:12px 0}
.shift-editor h4{font-size:12px;letter-spacing:.5px;color:#58718e;margin:17px 0 8px}
.edit-order{background:#fff;border:1px solid #e2e9f1;border-radius:12px;padding:11px;margin:8px 0}
.edit-order-top{display:flex;justify-content:space-between;align-items:flex-start;gap:8px;padding-bottom:8px;border-bottom:1px solid #edf1f6}
.edit-order-top b{font-size:12px;color:#314a67}.edit-order-top> b:last-child{font-size:15px;white-space:nowrap;color:#173d69}
.edit-order-top small{display:block;color:#8795a8;font-size:10px;margin-top:3px;line-height:1.4}
.edit-order-fields{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}
.edit-order .field{margin-bottom:8px}.edit-order .field label,.editor-dates .field label{font-size:10px}
.edit-order button{font-size:10px;padding:10px}
.audit-item{border:1px solid #e4eaf1;border-radius:10px;padding:10px;margin:7px 0;background:#fff;font-size:11px;line-height:1.5;color:#65778e}
.audit-item>b{display:block;color:#314a67;font-size:12px}.audit-item small{display:block;color:#8a98a9;margin-top:4px}.audit-old{color:#a34a52}.audit-new{color:#187347;font-weight:800}
@media(max-width:370px){.shift-editor{padding:10px}.editor-dates{grid-template-columns:1fr}.editor-actions{grid-template-columns:1fr}.edit-order-fields{gap:5px}.editor-head h3{font-size:14px}}


/* Полноэкранный режим */
:fullscreen{background:var(--bg)}
:fullscreen body{min-height:100%;overscroll-behavior:none}
:-webkit-full-screen{background:var(--bg)}
@media(max-width:370px){.top-tools{gap:5px}.fullscreen-btn{width:35px;height:35px;font-size:21px}.pill{padding:7px 9px;font-size:11px}}
</style>


/* Резервная касса: дополнительные состояния */
.msg.error{color:#c43e4c;background:#fff2f3;border:1px solid #f3d4d7;border-radius:9px;padding:8px 10px}
.statusbar{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.statusbar .dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:#d94e5b}
.statusbar .dot.off{background:#d99a32}
.stats-payments{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin:10px 0}
.stats-payments>div{min-width:0;background:#f8faff;border:1px solid #e1e8f1;border-radius:11px;padding:10px 8px;display:flex;flex-direction:column;gap:5px}
.stats-payments small{font-size:9px;letter-spacing:.35px;color:#7b8ba0;font-weight:850;white-space:nowrap}
.stats-payments b{font-size:14px;color:#2b405a;font-weight:900;white-space:nowrap;font-variant-numeric:tabular-nums}
.statrow small{font-size:11px;color:#8291a4;font-weight:500;line-height:1.45}
.stats-item{background:#fff;border:1px solid #e4eaf1;border-radius:12px;padding:11px 12px;margin:8px 0}
.stats-item-top{display:flex;justify-content:space-between;align-items:center;gap:10px;padding-bottom:9px;border-bottom:1px solid #edf1f6}
.stats-date{font-size:13px;font-weight:850;color:#334b67;min-width:0}
.stats-amount{font-size:16px;font-weight:950;color:#173d69;white-space:nowrap}
.stats-item .wide{width:100%;margin-top:10px}
@media(max-width:370px){.stats-payments>div{padding:9px 5px}.stats-payments b{font-size:12px}}
