:root{
  --g:#1a6b3c;--gd:#145730;--gl:#d4edda;--gm:#a8d5b7;
  --red:#c0392b;--rl:#fadbd8;
  --grn:#27ae60;--gnl:#d5f5e3;
  --org:#e67e22;--ol:#fdebd0;
  --blu:#2980b9;--bl:#d6eaf8;
  --pur:#8e44ad;--pl:#f4ecf7;
  --ylw:#f39c12;--yl:#fef9e7;
  --bg:#f0f4f2;--sur:#fff;--brd:#e0e8e3;
  --txt:#1a1a1a;--sub:#3a3a3a;--mut:#8a9a8e;
  --sh:0 1px 8px rgba(0,0,0,.07);--shl:0 8px 32px rgba(0,0,0,.13);
  --r:14px;--nav:62px;
}
*{margin:0;padding:0;box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{height:100%;overflow:hidden}
body{font-family:'Nunito',sans-serif;background:var(--bg);color:var(--txt);font-size:15px}
.scr{position:fixed;inset:0;display:none;flex-direction:column;background:var(--bg);z-index:1}
.scr.on{display:flex}
.page{display:none}.page.on{display:flex;flex-direction:column;flex:1;overflow:hidden}

/* LOGIN */
#s-login,#s-register{background:linear-gradient(155deg,#1a6b3c 0%,#0d3d22 100%);align-items:center;justify-content:flex-start;padding:24px;overflow-y:auto}
.lg-logo{text-align:center;margin-bottom:20px;margin-top:16px}
.lg-logo .icon{font-size:52px;display:block;margin-bottom:6px}
.lg-logo h1{font-size:28px;font-weight:900;color:#fff;letter-spacing:-1px}
.lg-logo p{color:rgba(255,255,255,.6);font-size:13px;margin-top:3px}
.lc{background:#fff;border-radius:20px;padding:24px 20px;width:100%;max-width:380px;box-shadow:0 20px 60px rgba(0,0,0,.3);margin-bottom:24px}
.lc h2{font-size:17px;font-weight:800;margin-bottom:16px;color:var(--txt)}
.lc-dark{background:transparent;border-radius:0;padding:0;width:100%;max-width:380px;margin-bottom:24px}
.f{margin-bottom:13px}
.f label{font-size:11px;font-weight:700;color:var(--mut);text-transform:uppercase;letter-spacing:.5px;display:block;margin-bottom:5px}
.f input,.f select,.f textarea{width:100%;padding:12px 13px;border:1.5px solid var(--brd);border-radius:10px;font-family:'Nunito',sans-serif;font-size:15px;outline:none;background:#fff;color:var(--txt);transition:border-color .2s}
.f input:focus,.f select:focus,.f textarea:focus{border-color:var(--g)}
.f textarea{resize:none;height:68px}
.fr{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.f-pw{position:relative}
.f-pw input{padding-right:44px}
.pw-eye{position:absolute;right:12px;top:50%;transform:translateY(-50%);cursor:pointer;font-size:18px;background:none;border:none;color:var(--mut)}
.btn-login{width:100%;padding:14px;background:var(--g);color:#fff;border:none;border-radius:12px;font-family:'Nunito',sans-serif;font-size:16px;font-weight:800;cursor:pointer;margin-top:4px}
.btn-login:active{background:var(--gd);transform:scale(.98)}
.login-err{color:var(--red);font-size:13px;font-weight:700;text-align:center;margin-top:8px;min-height:18px}

/* YANDEX SUGGEST AUTOCOMPLETE */
.ya-suggest{position:relative}
.ya-suggest-list{position:absolute;top:100%;left:0;right:0;background:#fff;border:1.5px solid var(--brd);border-top:none;border-radius:0 0 10px 10px;z-index:9999;max-height:200px;overflow-y:auto;box-shadow:0 8px 24px rgba(0,0,0,.12)}
.ya-suggest-item{padding:10px 13px;font-size:13px;cursor:pointer;border-bottom:1px solid #f1f5f9;line-height:1.3}
.ya-suggest-item:last-child{border-bottom:none}
.ya-suggest-item:hover,.ya-suggest-item.active{background:var(--gl)}
.ya-suggest-item strong{color:var(--g)}
/* MASTER PANEL */
.mtb{
  flex:1;padding:8px 4px;border:none;border-bottom:2px solid transparent;background:none;
  font-family:'Nunito',sans-serif;font-size:18px;font-weight:700;cursor:pointer;
  color:var(--mut);white-space:nowrap;margin-bottom:-2px;transition:color .15s;min-width:40px;
  max-width:52px;outline:none;text-align:center;
}
.mtb.on{color:#312e81 !important;border-bottom:2px solid #312e81 !important;font-weight:800;}
.mtb:hover:not(.on){color:#4f46e5;}
.feat-row{display:flex;align-items:center;gap:10px;padding:12px 0;border-bottom:1px solid var(--brd)}
.feat-row:last-child{border-bottom:none}
.toggle{width:44px;height:24px;background:#e2e8f0;border-radius:12px;position:relative;cursor:pointer;transition:background .2s;flex-shrink:0;border:none;outline:none}
.toggle.on{background:var(--g)}
.toggle::after{content:'';position:absolute;top:2px;left:2px;width:20px;height:20px;background:#fff;border-radius:50%;transition:left .2s;box-shadow:0 1px 3px rgba(0,0,0,.2)}
.toggle.on::after{left:22px}
.plan-badge{display:inline-block;padding:3px 10px;border-radius:20px;font-size:11px;font-weight:800}
.plan-free{background:#f1f5f9;color:#64748b}
.plan-pro{background:#fef3c7;color:#92400e}
.plan-max{background:linear-gradient(90deg,#7c3aed,#2563eb);color:#fff}
/* TOPBAR */
.tb{background:var(--g);color:#fff;padding:14px 16px;display:flex;align-items:center;gap:10px;flex-shrink:0;padding-top:max(14px,env(safe-area-inset-top,14px))}
.tb-t{font-size:17px;font-weight:800;flex:1}
.tb-a{font-size:22px;cursor:pointer;padding:2px 4px;background:none;border:none;color:#fff}
.tb-av{width:32px;height:32px;background:rgba(255,255,255,.2);border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:800;cursor:pointer;flex-shrink:0}
.sync-dot{width:8px;height:8px;border-radius:50%;background:#4ade80;flex-shrink:0}
.sync-dot.off{background:#9ca3af}

/* CONTENT */
.cnt{flex:1;overflow-y:auto;padding:14px;padding-bottom:calc(var(--nav)+14px);-webkit-overflow-scrolling:touch}
.cnt.nn{padding-bottom:16px}

/* BOTTOM NAV */
.bn{position:fixed;bottom:0;left:0;right:0;height:var(--nav);background:#fff;border-top:1px solid var(--brd);display:flex;align-items:center;padding-bottom:env(safe-area-inset-bottom,0);box-shadow:0 -2px 12px rgba(0,0,0,.06);z-index:50}
.nt{flex:1;display:flex;flex-direction:column;align-items:center;padding:7px 2px;cursor:pointer;position:relative}
.nt .ni{font-size:20px;line-height:1;margin-bottom:2px}
.nt .nl{font-size:9px;font-weight:700;color:var(--mut)}
.nt.on .nl{color:var(--g)}
.nt.on .ni{transform:translateY(-1px)}
.nt.on{background:rgba(26,107,60,0.12);border-radius:16px;}
.nb{position:absolute;top:5px;right:calc(50% - 18px);background:var(--red);color:#fff;border-radius:10px;font-size:10px;font-weight:800;padding:1px 5px;min-width:16px;text-align:center}

/* CARDS */
.card{background:var(--sur);border-radius:var(--r);box-shadow:var(--sh);margin-bottom:12px;overflow:hidden}
.sg{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:14px}
.sb{background:var(--sur);border-radius:var(--r);padding:13px;box-shadow:var(--sh);position:relative;overflow:hidden}
.sb::before{content:'';position:absolute;top:0;left:0;right:0;height:3px;background:var(--ac,var(--g))}
.sb .sl{font-size:10px;font-weight:700;color:var(--mut);text-transform:uppercase;letter-spacing:.3px;margin-bottom:4px}
.sb .sv{font-size:22px;font-weight:900;color:var(--ac,var(--g));line-height:1}
.sb .ss{font-size:11px;color:var(--mut);margin-top:3px}

/* LIST */
.li{display:flex;align-items:center;gap:11px;padding:12px 15px;background:var(--sur);border-bottom:1px solid var(--brd);cursor:pointer;transition:background .1s}
.li:last-child{border-bottom:none}
.li:active{background:#f5f8f5}
.lic{width:40px;height:40px;border-radius:11px;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:18px}
.lib{flex:1;min-width:0}
.lit{font-weight:700;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lis{font-size:11px;color:var(--mut);margin-top:2px}
.lir{text-align:right;flex-shrink:0}

/* BADGES */
.badge{display:inline-flex;align-items:center;padding:2px 8px;border-radius:20px;font-size:11px;font-weight:700;white-space:nowrap}
.bd{background:#e8f5fd;color:var(--blu)}
.bp{background:var(--yl);color:var(--ylw)}
.bg{background:var(--gnl);color:var(--grn)}
.br{background:var(--rl);color:var(--red)}
.bo{background:var(--ol);color:var(--org)}
.bdr{background:#f0e6f8;color:var(--pur)}

/* BUTTONS */
.btn{padding:13px 18px;border-radius:12px;border:none;cursor:pointer;font-family:'Nunito',sans-serif;font-size:15px;font-weight:800;display:flex;align-items:center;justify-content:center;gap:7px;transition:all .15s;width:100%}
.btn:active{transform:scale(.97)}
.btn-g{background:var(--g);color:#fff}.btn-g:active{background:var(--gd)}
.btn-grn{background:var(--grn);color:#fff}
.btn-org{background:var(--org);color:#fff}
.btn-o{background:#fff;color:var(--g);border:2px solid var(--g)}
.btn-gh{background:var(--bg);color:var(--sub);border:1.5px solid var(--brd)}
.btn-r{background:var(--red);color:#fff}
.btn-sm{padding:8px 13px;font-size:13px;border-radius:9px;width:auto}
.btn-pur{background:var(--pur);color:#fff}

/* GREET */
.greet{background:linear-gradient(135deg,var(--g) 0%,var(--gd) 100%);border-radius:var(--r);padding:18px;margin-bottom:14px;color:#fff;position:relative;overflow:hidden}
.greet::after{content:'📒';position:absolute;right:-10px;bottom:-14px;font-size:70px;opacity:.1}
.greet .gh{font-size:12px;opacity:.7;margin-bottom:2px}
.greet .gn{font-size:20px;font-weight:900}
.greet .gd{font-size:11px;opacity:.6;margin-top:2px}

/* SECTION */
.sec{display:flex;align-items:center;justify-content:space-between;margin-bottom:9px;margin-top:4px}
.sec h3{font-size:15px;font-weight:800}
.sec a{font-size:13px;color:var(--g);font-weight:700;cursor:pointer}

/* SEARCH BAR */
.search-bar{display:flex;align-items:center;background:#fff;border:1.5px solid var(--brd);border-radius:12px;padding:0 14px;margin-bottom:12px;gap:8px}
.search-bar input{flex:1;padding:12px 0;border:none;outline:none;font-family:'Nunito',sans-serif;font-size:14px;background:transparent;color:var(--txt)}
.search-bar .si{font-size:18px;color:var(--mut)}

/* PRODUCT PICKER */
.ppick{background:var(--bg);border-radius:10px;padding:4px;margin-bottom:4px}
.pr{display:flex;align-items:center;padding:10px 11px;background:#fff;border-radius:8px;margin-bottom:4px;gap:8px}
.pr:last-child{margin-bottom:0}
.pn{flex:1;font-weight:700;font-size:13px;min-width:0}
.pn .pc{font-size:10px;color:var(--mut);font-weight:600}
.pp{font-size:12px;color:var(--mut);white-space:nowrap}
.qc{display:flex;align-items:center;flex-shrink:0}
.qb{width:30px;height:30px;border-radius:7px;border:none;cursor:pointer;font-size:17px;font-weight:800;display:flex;align-items:center;justify-content:center}
.qb.m{background:#f0f0f0;color:var(--sub)}
.qb.p{background:var(--g);color:#fff}
.qb:active{transform:scale(.85)}
.qv{min-width:28px;text-align:center;font-weight:800;font-size:14px}

/* ORDER SUMMARY */
.osum{background:var(--gl);border-radius:10px;padding:13px;margin-bottom:14px}
.or{display:flex;justify-content:space-between;font-size:13px;margin-bottom:5px}
.or:last-child{margin-bottom:0;font-weight:900;font-size:16px;color:var(--g)}

/* DISCOUNT BADGE */
.disc-badge{background:var(--rl);color:var(--red);border-radius:8px;padding:4px 10px;font-size:13px;font-weight:800;display:inline-flex;align-items:center;gap:4px}

/* SHEET */
.ov{position:fixed;inset:0;background:rgba(0,0,0,.46);z-index:200;display:none;align-items:flex-end;backdrop-filter:blur(3px)}
.ov.on{display:flex}
.sh{background:#fff;border-radius:20px 20px 0 0;width:100%;max-height:94vh;overflow-y:auto;animation:sup .25s ease}
.hndl{width:36px;height:4px;background:#ddd;border-radius:4px;margin:11px auto 0}
.shd{padding:14px 18px 10px;border-bottom:1px solid var(--brd)}
.shd h3{font-size:17px;font-weight:900}
.shb{padding:18px}
@keyframes sup{from{transform:translateY(100%)}to{transform:translateY(0)}}
@keyframes scan-line{from{opacity:0.3;top:20%}to{opacity:1;top:80%}}

/* TOAST */
.toast{position:fixed;top:18px;left:50%;transform:translateX(-50%) translateY(-80px);background:#1a1a1a;color:#fff;padding:11px 18px;border-radius:12px;font-size:13px;font-weight:700;z-index:999;transition:transform .3s;white-space:nowrap;box-shadow:0 8px 24px rgba(0,0,0,.3)}
.toast.on{transform:translateX(-50%) translateY(0)}

/* EMPTY */
.emp{text-align:center;padding:36px 20px}
.emp .ei{font-size:44px;margin-bottom:8px}
.emp .et{font-size:15px;font-weight:800;color:var(--sub);margin-bottom:4px}
.emp .es{font-size:12px;color:var(--mut);line-height:1.5}

/* PILLS */
.pills{display:flex;gap:7px;overflow-x:auto;padding-bottom:4px;margin-bottom:12px;scrollbar-width:none}
.pills::-webkit-scrollbar{display:none}
.pill{padding:6px 13px;border-radius:20px;font-size:13px;font-weight:700;white-space:nowrap;cursor:pointer;border:none;font-family:'Nunito',sans-serif;background:#e0e8e3;color:var(--sub);flex-shrink:0}
.pill.on{background:var(--g);color:#fff}

/* BAR CHART */
.bch{display:flex;align-items:flex-end;gap:5px;height:80px;padding:0 2px;margin-top:10px}
.bw{flex:1;display:flex;flex-direction:column;align-items:center;gap:3px}
.bar{width:100%;border-radius:4px 4px 0 0;background:var(--g);min-height:3px}
.blbl{font-size:9px;color:var(--mut);font-weight:700}

/* DEBT */
.dr{display:flex;align-items:center;gap:10px;padding:12px 15px;border-bottom:1px solid var(--brd);cursor:pointer}
.dr:last-child{border-bottom:none}
.da{width:38px;height:38px;background:var(--ol);border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:900;color:var(--org);flex-shrink:0}

/* DETAIL ROW */
.drow{display:flex;justify-content:space-between;padding:9px 0;border-bottom:1px solid var(--brd);font-size:14px}
.drow:last-child{border-bottom:none}

/* PROGRESS */
.pb{background:#eee;border-radius:4px;height:5px;overflow:hidden;margin-top:5px}
.pf{height:100%;border-radius:4px;background:var(--g)}

/* CLIENT CARD */
.cc{background:#fff;border-radius:var(--r);box-shadow:var(--sh);padding:14px;margin-bottom:10px}
.cc-head{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.cc-av{width:44px;height:44px;background:var(--gl);border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:17px;font-weight:900;color:var(--g);flex-shrink:0}
.cc-name{font-weight:800;font-size:15px}
.cc-sub{font-size:12px;color:var(--mut);margin-top:2px}
.cc-fields{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.cc-field{background:var(--bg);border-radius:9px;padding:8px 10px}
.cc-fl{font-size:10px;color:var(--mut);font-weight:700;text-transform:uppercase;margin-bottom:2px}
.cc-fv{font-size:13px;font-weight:700;color:var(--txt)}

/* UNIT TAG */
.unit-wrap{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.unit-tag{padding:6px 12px;border-radius:8px;border:1.5px solid var(--brd);font-size:13px;font-weight:700;cursor:pointer;background:#fff;font-family:'Nunito',sans-serif;color:var(--sub)}
.unit-tag.on{border-color:var(--g);background:var(--gl);color:var(--g)}

/* STATUS INDICATOR for orders */
.status-track{display:flex;align-items:center;gap:0;margin:12px 0}
.st-step{flex:1;text-align:center}
.st-dot{width:20px;height:20px;border-radius:50%;margin:0 auto 4px;border:2px solid var(--brd);background:#fff;position:relative;z-index:1}
.st-dot.done{background:var(--g);border-color:var(--g)}
.st-dot.active{background:#fff;border-color:var(--g);box-shadow:0 0 0 3px var(--gl)}
.st-label{font-size:9px;color:var(--mut);font-weight:700}
.st-line{flex:1;height:2px;background:var(--brd);margin-top:-14px;z-index:0}
.st-line.done{background:var(--g)}

.mt8{margin-top:8px}.mt14{margin-top:14px}
.info-box{background:var(--gl);border-radius:10px;padding:13px;margin-bottom:14px;border:1px solid var(--gm)}
.info-box p{font-size:13px;color:var(--gd);line-height:1.7}
.info-box strong{font-weight:800}
/* DAY PILLS */
.day-grid{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px}
.dp{width:36px;height:36px;border-radius:50%;border:2px solid var(--brd);font-size:12px;font-weight:800;cursor:pointer;background:#fff;font-family:'Nunito',sans-serif;color:var(--mut);display:flex;align-items:center;justify-content:center}
.dp.on{background:var(--g);border-color:var(--g);color:#fff}
/* MAP */
.map-wrap{border-radius:12px;overflow:hidden;height:220px;margin-bottom:12px;border:1.5px solid var(--brd)}
#cf-map{height:100%;width:100%}
.map-coords{font-size:12px;color:var(--mut);text-align:center;margin-bottom:10px;font-weight:600}
/* SYNC PROGRESS */
.sync-bar{background:var(--bg);border-radius:12px;padding:12px 14px;margin-bottom:14px;display:flex;align-items:center;gap:12px}
.sync-ring{width:44px;height:44px;flex-shrink:0;position:relative}
.sync-ring svg{transform:rotate(-90deg)}
.sync-ring .ring-bg{fill:none;stroke:#e0e8e3;stroke-width:4}
.sync-ring .ring-fg{fill:none;stroke:var(--g);stroke-width:4;stroke-linecap:round;transition:stroke-dashoffset .5s}
.sync-ring .ring-txt{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:900;color:var(--g)}
/* PRINT */
@media print{
  .bn,.tb,.ov,.toast{display:none!important}
  body{background:#fff}
  #print-area{display:block!important}
  .scr,.page{position:static!important;height:auto!important;overflow:visible!important}
}
#print-area{display:none}

/* ============================================================
   BAZARBOOK THEME SYSTEM — AMOLED × SLATE
   Светлая = оригинальная зелёная, Тёмная = AMOLED×Slate
   ============================================================ */

/* === ТЁМНАЯ ТЕМА === */
body.theme-dark {
  --bg:#0b1120;
  --sur:#111c2e;
  --sur2:#172036;
  --brd:rgba(148,163,184,0.12);
  --txt:#f0f6ff;
  --sub:#8ba3c0;
  --mut:#455870;
  --sh:0 4px 20px rgba(0,0,0,0.5);
  --shl:0 8px 32px rgba(0,0,0,0.6);
}
body.theme-dark { background:var(--bg) !important; color:var(--txt); }
body.theme-dark .scr.on { background:var(--bg); }
body.theme-dark .page { background:transparent; }
body.theme-dark .cnt { background:transparent; }

/* Топ-бар */
body.theme-dark .tb {
  background:#0b1120 !important;
  border-bottom:1px solid rgba(148,163,184,0.1);
}
body.theme-dark .tb-t { color:#fff; }
body.theme-dark .tb-a { color:rgba(255,255,255,0.8); }
body.theme-dark .tb-av {
  background:rgba(0,210,106,0.15);
  border:1.5px solid rgba(0,210,106,0.25);
  color:#00d26a;
}
body.theme-dark .sync-dot { background:#00d26a; box-shadow:0 0 8px rgba(0,210,106,0.5); }
body.theme-dark .sync-dot.off { background:#455870; box-shadow:none; }

/* Нижний навбар — плавающий */
body.theme-dark .bn {
  background:rgba(17,28,46,0.97) !important;
  border:1px solid rgba(148,163,184,0.1) !important;
  border-top:none !important;
  border-radius:26px !important;
  bottom:10px !important;
  left:12px !important;
  right:12px !important;
  box-shadow:0 8px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,210,106,0.05) !important;
  height:60px !important;
}
body.theme-dark .nt .ni { color:#455870; }
body.theme-dark .nt .nl { color:#455870; }
body.theme-dark .nt.on { background:rgba(0,210,106,0.1); border-radius:18px; }
body.theme-dark .nt.on .ni { color:#00d26a; transform:none; }
body.theme-dark .nt.on .nl { color:#00d26a; font-weight:900; }
body.theme-dark .nb { background:var(--red); }

/* Карточки */
body.theme-dark .card {
  background:#111c2e;
  box-shadow:0 2px 12px rgba(0,0,0,0.4), 0 0 0 1px rgba(148,163,184,0.08);
  border:none;
}
body.theme-dark .sb {
  background:#111c2e;
  box-shadow:0 2px 12px rgba(0,0,0,0.4), 0 0 0 1px rgba(148,163,184,0.08);
  border:none;
}
body.theme-dark .sb::before { background:rgba(0,210,106,0.4); }
body.theme-dark .sb .sv { color:#00d26a; }
body.theme-dark .sb .sl { color:#455870; }
body.theme-dark .sb .ss { color:#455870; }

/* Приветствие */
body.theme-dark .greet {
  background:linear-gradient(135deg,rgba(0,168,85,0.2),rgba(17,28,46,0.8)) !important;
  border:1px solid rgba(0,210,106,0.15) !important;
  border-radius:18px !important;
}
body.theme-dark .greet .gh { color:rgba(255,255,255,0.55) !important; opacity:1 !important; }
body.theme-dark .greet .gn { color:#00d26a !important; }
body.theme-dark .greet .gd { color:rgba(255,255,255,0.4) !important; opacity:1 !important; }

/* Текст в списках */
body.theme-dark .li { background:#111c2e; border-bottom-color:rgba(148,163,184,0.08); }
body.theme-dark .li:active { background:#172036; }
body.theme-dark .lit { color:var(--txt); }
body.theme-dark .lis { color:var(--sub); }
body.theme-dark .drow { border-bottom-color:rgba(148,163,184,0.08); color:var(--txt); }
body.theme-dark .sec h3 { color:var(--txt); }
body.theme-dark .sec a { color:#00d26a; }
body.theme-dark .dr { border-bottom-color:rgba(148,163,184,0.08); }

/* Кнопки — сплошные, без градиента */
body.theme-dark .btn-g   { background:#00a855 !important; color:#fff !important; border:none !important; border-radius:18px !important; }
body.theme-dark .btn-grn { background:#009f50 !important; color:#fff !important; border:none !important; border-radius:18px !important; }
body.theme-dark .btn-org { background:#c2410c !important; color:#fff !important; border:none !important; border-radius:18px !important; }
body.theme-dark .btn-r   { background:#dc2626 !important; color:#fff !important; border:none !important; border-radius:18px !important; }
body.theme-dark .btn-pur { background:#6d28d9 !important; color:#fff !important; border:none !important; border-radius:18px !important; }
body.theme-dark .btn-gh  {
  background:#172036 !important;
  color:#8ba3c0 !important;
  border:1px solid rgba(148,163,184,0.12) !important;
  border-radius:18px !important;
}
body.theme-dark .btn-o {
  background:transparent !important;
  color:#00d26a !important;
  border:2px solid #00d26a !important;
  border-radius:18px !important;
}
body.theme-dark .btn { border-radius:18px !important; }
body.theme-dark .btn-sm { border-radius:12px !important; }
body.theme-dark .btn:active { filter:brightness(1.12); transform:scale(0.97); }
body.theme-dark .btn-login { background:#00a855 !important; border-radius:14px !important; }

/* Поля ввода */
body.theme-dark .f input,
body.theme-dark .f select,
body.theme-dark .f textarea {
  background:#172036 !important;
  border:1.5px solid rgba(148,163,184,0.15) !important;
  color:var(--txt) !important;
  border-radius:12px !important;
}
body.theme-dark .f input:focus,
body.theme-dark .f select:focus,
body.theme-dark .f textarea:focus { border-color:rgba(0,210,106,0.4) !important; }
body.theme-dark .f input::placeholder,
body.theme-dark .f textarea::placeholder { color:#455870 !important; }
body.theme-dark .f label { color:#8ba3c0 !important; }
body.theme-dark select option { background:#111c2e; color:#f0f6ff; }

/* Pills */
body.theme-dark .pill {
  background:#172036 !important;
  border:1px solid rgba(148,163,184,0.1) !important;
  color:#8ba3c0 !important;
}
body.theme-dark .pill.on {
  background:rgba(0,210,106,0.15) !important;
  border-color:rgba(0,210,106,0.3) !important;
  color:#00d26a !important;
}

/* Search bar */
body.theme-dark .search-bar {
  background:#172036 !important;
  border-color:rgba(148,163,184,0.15) !important;
}
body.theme-dark .search-bar input { color:var(--txt) !important; }
body.theme-dark .search-bar .si { color:#455870; }

/* Шторки */
body.theme-dark .ov { background:rgba(0,0,0,0.7); }
body.theme-dark .sh {
  background:#111c2e !important;
  border-top:1px solid rgba(148,163,184,0.1);
  border-radius:22px 22px 0 0 !important;
}
body.theme-dark .shd { border-bottom-color:rgba(148,163,184,0.1); }
body.theme-dark .shd h3 { color:var(--txt); }
body.theme-dark .shb { color:var(--txt); }
body.theme-dark .hndl { background:#455870; }

/* Sync bar */
body.theme-dark .sync-bar {
  background:#111c2e !important;
  border:1px solid rgba(148,163,184,0.08);
}
body.theme-dark .sync-ring .ring-bg { stroke:#172036; }
body.theme-dark .sync-ring .ring-fg { stroke:#00d26a; }
body.theme-dark .sync-ring .ring-txt { color:#00d26a; }

/* Info box */
body.theme-dark .info-box {
  background:#172036 !important;
  border-color:rgba(148,163,184,0.1) !important;
}
body.theme-dark .info-box p { color:var(--sub) !important; }

/* Product picker */
body.theme-dark .ppick { background:#0b1120; }
body.theme-dark .pr { background:#172036; }
body.theme-dark .qb.m { background:#172036; color:var(--sub); }

/* Order summary */
body.theme-dark .osum { background:#172036; }
body.theme-dark .or { color:var(--txt); }
body.theme-dark .or:last-child { color:#00d26a; }

/* Client card */
body.theme-dark .cc { background:#111c2e; }
body.theme-dark .cc-av { background:rgba(0,210,106,0.1); color:#00d26a; }
body.theme-dark .cc-fv { color:var(--txt); }
body.theme-dark .cc-field { background:#172036; }

/* Progress bar */
body.theme-dark .pb { background:#172036; }
body.theme-dark .pf { background:#00d26a; }

/* Unit tags */
body.theme-dark .unit-tag { background:#172036; border-color:rgba(148,163,184,0.15); color:var(--sub); }
body.theme-dark .unit-tag.on { background:rgba(0,210,106,0.15); border-color:#00d26a; color:#00d26a; }

/* Ya suggest */
body.theme-dark .ya-suggest-list { background:#111c2e; border-color:rgba(148,163,184,0.15); }
body.theme-dark .ya-suggest-item { border-bottom-color:rgba(148,163,184,0.08); color:var(--txt); }
body.theme-dark .ya-suggest-item:hover { background:#172036; }

/* Toggle switch */
body.theme-dark .toggle { background:#172036; }
body.theme-dark .toggle.on { background:#00a855; }

/* Status track */
body.theme-dark .st-dot { background:#111c2e; border-color:#172036; }
body.theme-dark .st-dot.done { background:#00a855; border-color:#00a855; }
body.theme-dark .st-dot.active { background:#111c2e; border-color:#00d26a; box-shadow:0 0 0 3px rgba(0,210,106,0.15); }
body.theme-dark .st-line { background:#172036; }
body.theme-dark .st-line.done { background:#00a855; }
body.theme-dark .st-label { color:#455870; }

/* Badges в тёмной теме */
body.theme-dark .bd { background:rgba(96,165,250,0.15); color:#60a5fa; }
body.theme-dark .bg { background:rgba(0,210,106,0.15); color:#00d26a; }
body.theme-dark .br { background:rgba(220,38,38,0.15); color:#f87171; }
body.theme-dark .bo { background:rgba(194,65,12,0.15); color:#fb923c; }
body.theme-dark .bp { background:rgba(234,179,8,0.15); color:#facc15; }
body.theme-dark .bdr { background:rgba(109,40,217,0.15); color:#a78bfa; }

/* Feat row */
body.theme-dark .feat-row { border-bottom-color:rgba(148,163,184,0.08); }

/* Master panel */
body.theme-dark #s-master { background:var(--bg); }
body.theme-dark #m-body { background:var(--bg); }
body.theme-dark #m-tab-label { background:#0f1929 !important; color:#8ba3c0 !important; border-color:rgba(148,163,184,0.1) !important; }
body.theme-dark .mtb { color:#455870 !important; }
body.theme-dark .mtb.on { border-bottom-color:#00d26a !important; color:#00d26a !important; }
body.theme-dark [style*="background:#f8faff"] { background:#111c2e !important; }
body.theme-dark [style*="background:#fff"] { background:#111c2e !important; }
body.theme-dark [style*="background:var(--bg)"] { background:#0b1120 !important; }
body.theme-dark [style*="color:var(--txt)"] { color:var(--txt) !important; }
body.theme-dark [style*="color:var(--mut)"] { color:#455870 !important; }
body.theme-dark [style*="color:var(--sub)"] { color:#8ba3c0 !important; }

/* Логин — всегда зелёный */
body.theme-dark #s-login,
body.theme-dark #s-register { background:linear-gradient(155deg,#1a6b3c 0%,#0d3d22 100%) !important; }
/* FIX #2: .lc glass-стили только в тёмной теме (раньше перекрывали светлую) */
body.theme-dark .lc {
  background:rgba(255,255,255,0.1) !important;
  border:1px solid rgba(255,255,255,0.18) !important;
  border-radius:20px !important;
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
}
body.theme-dark .lc h2, body.theme-dark .lc label { color:#fff !important; }
body.theme-dark .lc input {
  background:rgba(255,255,255,0.12) !important;
  border:1px solid rgba(255,255,255,0.2) !important;
  color:#fff !important;
  border-radius:12px !important;
}
body.theme-dark .lc input::placeholder { color:rgba(255,255,255,0.4) !important; }

/* Offline/queue banners */
body.theme-dark #offline-banner { background:#1a1a0a !important; border-color:#856404 !important; }
body.theme-dark #queue-banner { background:#0a1a0f !important; border-color:#166534 !important; }

/* === СВЕТЛАЯ ТЕМА — оригинальная зелёная === */
body.theme-light .bn {
  background:#fff !important;
  border:none !important;
  border-top:1px solid var(--brd) !important;
  border-radius:0 !important;
  bottom:0 !important;
  left:0 !important;
  right:0 !important;
  box-shadow:0 -2px 12px rgba(0,0,0,.06) !important;
  height:var(--nav) !important;
}
body.theme-light .nt.on .ni { color:var(--g); transform:translateY(-1px); }
body.theme-light .nt.on .nl { color:var(--g); }

/* ── VISITS MODULE ── */
.vi{display:inline-flex;align-items:center;gap:4px;font-size:11px;font-weight:800;padding:3px 8px;border-radius:20px;white-space:nowrap;flex-shrink:0}
.vi-green{background:var(--gnl);color:var(--grn)}
.vi-yellow{background:var(--ol);color:var(--org)}
.vi-red{background:var(--rl);color:var(--red)}
.vi-none{background:#f0f0f0;color:var(--mut)}

.vh{display:flex;align-items:flex-start;gap:10px;padding:10px 0;border-bottom:1px solid var(--brd)}
.vh:last-child{border-bottom:none}
.vh-dot{width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:14px;flex-shrink:0}
.vh-body{flex:1}
.vh-res{font-size:13px;font-weight:700;color:var(--txt)}
.vh-date{font-size:11px;color:var(--mut);margin-top:2px}
.vh-note{font-size:11px;color:var(--mut);font-style:italic;margin-top:2px}

.result-opt{display:flex;align-items:center;gap:12px;padding:13px 14px;border-radius:12px;margin-bottom:8px;cursor:pointer;border:2px solid transparent;background:var(--bg);transition:all .15s}
.result-opt.sel{border-color:var(--g);background:var(--gl)}
.result-opt:active{opacity:.8}
.ro-icon{font-size:22px;width:34px;text-align:center;flex-shrink:0}
.ro-text{font-weight:700;font-size:14px;color:var(--txt)}

/* ── VISIT FLOW ── */
.choice{display:flex;align-items:center;gap:14px;padding:16px;border-radius:14px;margin-bottom:10px;cursor:pointer;border:2px solid transparent;transition:all .15s}
.choice:active{opacity:.8}
.choice.primary{background:var(--gl);border-color:var(--g)}
.choice.secondary{background:var(--bg);border:2px solid var(--brd)}
.ch-icon{font-size:32px;width:48px;text-align:center;flex-shrink:0}
.ch-title{font-weight:800;font-size:15px;color:var(--txt)}
.ch-sub{font-size:12px;color:var(--mut);margin-top:3px}
.ch-arrow{margin-left:auto;color:var(--mut);font-size:20px;flex-shrink:0}

.chip{padding:8px 14px;border-radius:20px;font-size:13px;font-weight:700;border:2px solid var(--brd);background:#fff;cursor:pointer;color:var(--sub);transition:all .15s;display:inline-block}
.chip-on{background:var(--rl);border-color:var(--red);color:var(--red)}

.ta{width:100%;padding:11px 13px;border:1.5px solid var(--brd);border-radius:10px;font-family:'Nunito',sans-serif;font-size:14px;outline:none;resize:none;color:var(--txt);background:#fff;margin-top:10px}
