/* Потвърди — стилове */
:root {
  --green: #166534;
  --green-dark: #14532d;
  --green-soft: #dcfce7;
  --orange: #ea580c;
  --orange-soft: #ffedd5;
  --red: #b91c1c;
  --red-soft: #fee2e2;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --blue: #1d4ed8;
  --blue-soft: #dbeafe;
  --ink: #0f172a;
  --ink-2: #475569;
  --line: #e2e8f0;
  --bg: #f6f7f5;
  --card: #ffffff;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 1px rgba(15, 23, 42, .04);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; line-height: 1.25; margin: 0 0 16px; letter-spacing: -.01em; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 18px 0 8px; }
code { background: #eef2ef; padding: 1px 6px; border-radius: 6px; font-size: 13px; word-break: break-all; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.good { color: var(--green) !important; }
.bad { color: var(--red) !important; }
.warn { color: var(--amber) !important; }

/* Горна лента */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 24px;
  background: var(--green-dark); color: #fff; padding: 0 24px; height: 56px;
}
.brand { color: #fff; font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-block; width: 30px; height: 30px; flex: none;
  background: url(icon.png) center / contain no-repeat; color: transparent; font-size: 0; overflow: hidden;
}
.topbar .brand-mark { background-image: url(icon-white.png); }
.mainnav { display: flex; gap: 4px; flex: 1; }
.shopswitch select { margin: 0; min-height: 34px; padding: 4px 30px 4px 10px; background-color: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 8px; font-weight: 600; max-width: 220px; }
.shopswitch select option { color: var(--ink); background: #fff; }
.mainnav a { color: #d1fae5; padding: 8px 12px; border-radius: 8px; font-weight: 500; }
.mainnav a:hover { background: rgba(255, 255, 255, .08); text-decoration: none; }
.mainnav a.active { background: rgba(255, 255, 255, .14); color: #fff; }
.mainnav .logout { margin-left: auto; }
/* Меню с категории */
.mainnav { align-items: center; }
.navgroup { position: relative; }
.mainnav .navg { display: inline-flex; align-items: center; gap: 6px; }
.navg .caret { font-size: 10px; opacity: .7; }
.navbadge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--orange); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.navmenu {
  display: none; position: absolute; top: 100%; left: 0; min-width: 250px; padding: 6px; z-index: 20;
  background: #fff; border-radius: 10px; box-shadow: 0 10px 30px rgba(15, 23, 42, .18); border: 1px solid #e2e8f0;
}
.navgroup:hover .navmenu, .navgroup:focus-within .navmenu { display: block; }
.navmenu a { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--ink); padding: 8px 10px; border-radius: 6px; font-weight: 500; white-space: nowrap; }
.navmenu a:hover { background: #f1f5f9; }
.navmenu a.current { background: #ecfdf5; color: var(--green-dark); font-weight: 600; }
.navsep { padding: 8px 10px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #94a3b8; border-top: 1px solid #eef2f7; margin-top: 4px; }
.crumbs { font-size: 12px; color: #94a3b8; margin: -8px 0 10px; }
.crumbs span { margin: 0 4px; }
.topbar input.navtoggle, .navburger { display: none; }
.testbar { background: var(--amber-soft); color: #78350f; text-align: center; padding: 8px 16px; font-size: 13px; }
.testbar a { color: #78350f; text-decoration: underline; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 24px; }
.foot { text-align: center; color: #94a3b8; font-size: 12px; padding: 24px; }

/* Заглавия и бутони */
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.pagehead h1 { margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.actions, .btnrow { display: flex; gap: 8px; flex-wrap: wrap; }
.back { margin: 0 0 8px; font-size: 14px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--green); color: #fff; border: 1px solid var(--green); border-radius: 10px;
  padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; min-height: 40px;
}
.btn:hover { background: var(--green-dark); text-decoration: none; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: #f1f5f9; }
.btn-danger { background: #fff; color: var(--red); border-color: #fecaca; }
.btn-danger:hover { background: var(--red-soft); }
.btn-block { width: 100%; }
.linkbtn { background: none; border: 0; color: var(--green); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
form.inline { display: inline; }

/* Съобщения */
.flash { padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; border: 1px solid; }
.flash-ok { background: var(--green-soft); border-color: #bbf7d0; color: #14532d; }
.flash-err { background: var(--red-soft); border-color: #fecaca; color: #7f1d1d; }
.flash-warn { background: var(--amber-soft); border-color: #fde68a; color: #78350f; }
.errors { color: var(--red); font-size: 14px; }

/* Карти */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  display: flex; flex-direction: column; gap: 4px; color: var(--ink); box-shadow: var(--shadow);
}
a.card:hover { border-color: #a7c4b0; text-decoration: none; }
.card-num { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.card-label { color: var(--ink-2); font-size: 13px; }

/* Панели */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.panelhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.panelhead h2 { margin: 0; }
.narrow { max-width: 720px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2 > .panel { margin-bottom: 0; }
.grid2 + .panel, .grid2 + section { margin-top: 16px; }
.empty { background: var(--card); border: 1px dashed #cbd5e1; border-radius: var(--radius); padding: 40px 20px; text-align: center; }

/* Филтри */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { padding: 7px 12px; border-radius: 999px; color: var(--ink-2); font-weight: 500; font-size: 14px; border: 1px solid transparent; }
.tabs a:hover { background: #fff; text-decoration: none; }
.tabs a.active { background: #fff; color: var(--ink); border-color: var(--line); }
.search { display: flex; gap: 6px; }
.search input { width: 240px; }
.bulkbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.bulkbar select { width: auto; }
.pager { display: flex; gap: 4px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.pager a { padding: 6px 11px; border-radius: 8px; background: #fff; border: 1px solid var(--line); color: var(--ink); }
.pager a.active { background: var(--green); color: #fff; border-color: var(--green); }

/* Таблици */
.tablewrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel .tablewrap { box-shadow: none; }
.list { width: 100%; border-collapse: collapse; }
.list th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafbfa; }
.list td { padding: 11px 12px; border-bottom: 1px solid #eef2f0; vertical-align: top; }
.list tr:last-child td { border-bottom: 0; }
.list tbody tr:hover { background: #fafcfb; }
.list .num { text-align: right; font-variant-numeric: tabular-nums; }
.list .chk { width: 36px; }
.list .clip { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .sub { color: var(--ink-2); font-size: 13px; }
.list.compact td, .list.compact th { padding: 8px 10px; }
.panel > .list.compact { border: 1px solid var(--line); border-radius: 10px; }
.mapping select { min-width: 220px; }

/* Статуси */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.st-pending { background: var(--blue-soft); color: var(--blue); }
.st-confirmed { background: var(--green-soft); color: var(--green); }
.st-rejected { background: var(--red-soft); color: var(--red); }
.st-noanswer { background: var(--amber-soft); color: var(--amber); }
.st-shipped { background: #e2e8f0; color: #334155; }
.st-archived { background: #f1f5f9; color: #64748b; border: 1px dashed #cbd5e1; }

/* Форми */
.form label { display: block; font-weight: 500; font-size: 14px; margin-bottom: 14px; }
.form label small { display: block; font-weight: 400; color: var(--ink-2); margin-top: 4px; }
input, select, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid #cbd5e1; border-radius: 10px; min-height: 42px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #86efac; outline-offset: 0; border-color: var(--green); }
input[type=checkbox], input[type=radio] { display: inline-block; width: auto; min-height: 0; margin: 0 6px 0 0; accent-color: var(--green); }
.form label.check { display: flex; align-items: center; font-weight: 400; }
.form h2 { margin-top: 8px; padding-top: 8px; }
.form h2:not(:first-of-type) { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 20px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px 2px; margin: 0 0 16px; }
legend { font-weight: 600; padding: 0 6px; }
.copyrow { display: flex; gap: 8px; margin-top: 6px; }
.copyrow input { margin: 0; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.code, pre.code { background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: 12px; font: 12.5px/1.5 ui-monospace, Menlo, monospace; overflow: auto; white-space: pre-wrap; word-break: break-all; max-height: 360px; }
textarea.code { color: #e2e8f0; }
details summary { cursor: pointer; color: var(--green); }
.steps { padding-left: 20px; }
.steps li { margin-bottom: 8px; }
.dl { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; margin: 0; }
.dl dt { color: var(--ink-2); font-size: 14px; }
.dl dd { margin: 0; word-break: break-word; }
.preview { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 16px; }
.bubble { background: #e9f7ee; border-radius: 14px 14px 14px 4px; padding: 10px 12px; margin: 6px 0 12px; max-width: 420px; font-size: 14px; word-break: break-word; }

/* Графика */
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); margin-bottom: 12px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.sw-ok, .seg-ok { background: #16a34a; }
.sw-rej, .seg-rej { background: #dc2626; }
.sw-na, .seg-na { background: #f59e0b; }
.sw-wait, .seg-wait { background: #93c5fd; }
.bars { display: grid; grid-template-columns: repeat(var(--n), 1fr); align-items: end; gap: 3px; height: 180px; border-bottom: 1px solid var(--line); }
.bar { height: 100%; display: flex; align-items: flex-end; }
.stack { width: 100%; display: flex; flex-direction: column; border-radius: 4px 4px 0 0; overflow: hidden; min-height: 0; }
.seg { display: block; min-height: 2px; }
.bars-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); margin-top: 6px; }

/* Вход */
body.auth { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.auth-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px; width: 100%; max-width: 400px; box-shadow: 0 10px 30px rgba(15, 23, 42, .06); }
.auth-card.wide { max-width: 560px; }
.auth-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; margin-bottom: 18px; color: var(--green-dark); }

/* Публична страница за клиента */
body.public { min-height: 100vh; background: linear-gradient(180deg, #ecfdf3 0, var(--bg) 280px) no-repeat, var(--bg); }
.pub { max-width: 480px; margin: 0 auto; padding: 20px 16px 40px; }
.pub-head { text-align: center; margin: 8px 0 18px; }
.pub-logo { max-height: 56px; max-width: 200px; }
.pub-shop { font-weight: 700; font-size: 20px; color: var(--green-dark); }
.pub-card { background: #fff; border-radius: 18px; padding: 22px 20px; box-shadow: 0 8px 28px rgba(15, 23, 42, .08); }
.pub-card h1 { font-size: 22px; margin-bottom: 14px; }
.pub-hello { margin: 0 0 4px; color: var(--ink-2); }
.pub-summary { border: 1px solid var(--line); border-radius: 14px; margin: 0 0 18px; }
.pub-row { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.pub-row:last-child { border-bottom: 0; }
.pub-row span { font-size: 13px; color: var(--ink-2); }
.pub-total { background: #f0fdf4; border-radius: 0 0 14px 14px; }
.pub-total b { font-size: 22px; color: var(--green-dark); }
.pub-btn { display: block; width: 100%; border: 0; border-radius: 14px; padding: 16px; font: inherit; font-size: 17px; font-weight: 700; cursor: pointer; margin-top: 10px; min-height: 56px; }
.pub-yes { background: var(--green); color: #fff; box-shadow: 0 4px 14px rgba(22, 101, 52, .35); }
.pub-yes:hover { background: var(--green-dark); }
.pub-alt { background: var(--orange); color: #fff; }
.pub-no { background: #f1f5f9; color: #334155; }
.pub-more { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.pub-more summary { color: var(--ink-2); font-weight: 500; padding: 4px 0; }
.pub-more[open] summary { color: var(--ink); margin-bottom: 8px; }
.pub-radio { display: flex; align-items: center; padding: 8px 0; font-size: 15px; }
.pub-foot { text-align: center; color: var(--ink-2); font-size: 14px; margin-top: 18px; }
.pub-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 4px auto 14px; font-size: 32px; font-weight: 700; background: #f1f5f9; color: #64748b; }
.pub-icon.ok { background: var(--green-soft); color: var(--green); }

/* Мобилни */
@media (max-width: 860px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .grid2, .row2 { grid-template-columns: 1fr; }
  .grid2 > .panel { margin-bottom: 0; }
  .search input { width: 100%; }
  .search { flex: 1; }
}
@media (max-width: 720px) {
  .wrap { padding: 16px; }
  .topbar { padding: 0 16px; flex-wrap: wrap; height: auto; min-height: 56px; }
  .shopswitch { order: 2; }
  .navburger { display: block; margin-left: auto; font-size: 22px; cursor: pointer; padding: 10px 4px; }
  .mainnav { display: none; flex-basis: 100%; flex-direction: column; padding-bottom: 10px; }
  .navtoggle:checked ~ .mainnav { display: flex; max-height: calc(100dvh - 60px); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .mainnav .logout { margin-left: 0; }
  .mainnav { align-items: stretch; }
  .navmenu { display: block; position: static; box-shadow: none; border: 0; background: transparent; padding: 0 0 6px 12px; min-width: 0; }
  .navmenu a { color: #d1fae5; white-space: normal; }
  .navmenu a:hover, .navmenu a.current { background: rgba(255, 255, 255, .1); color: #fff; }
  .navsep { color: #6ee7b7; border-top-color: rgba(255,255,255,.12); }
  .navg .caret { display: none; }
  .list .clip, .list .m-hide, .list.hide-sm-6 th:nth-child(7), .list.hide-sm-6 td:nth-child(7), .list.hide-sm-6 th:nth-child(2), .list.hide-sm-6 td:nth-child(2) { display: none; }
  .list td, .list th { padding: 10px 8px; }
  .list .nowrap { white-space: normal; }
  .list td.num { white-space: nowrap; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  h1 { font-size: 21px; }
}

/* Рискови телефони */
.list tr.risk-row td { background: #fef2f2; }
.list tr.risk-row td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.list tr.risk-row:hover td { background: #fee2e2; }
.list tr.dup-row td { background: #fef2f2; }
.list tr.dup-row td:first-child { box-shadow: inset 4px 0 0 #dc2626; }
.list tr.dup-row:hover td { background: #fee2e2; }
.st-dup { background: #dc2626; color: #fff; }
.st-repeat { background: #e0f2fe; color: #075985; }

/* Табло */
.sect { font-size: 15px; color: #475569; margin: 22px 0 10px; font-weight: 600; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 12px; }
.kpi { display: flex; flex-direction: column; gap: 4px; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 14px 16px; color: var(--ink); }
a.kpi:hover { border-color: #94a3b8; text-decoration: none; }
.kpi.accent { background: #ecfdf5; border-color: #a7f3d0; }
.kpi-l { font-size: 12px; color: #64748b; font-weight: 600; }
.kpi-n { font-size: 26px; font-weight: 700; line-height: 1.15; }
.kpi-s { font-size: 12px; color: #64748b; }
.kpi-h { font-size: 12px; color: #64748b; line-height: 1.35; }
.kpis-fit { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.kpi.warnbox { border-color: #fdba74; background: #fff7ed; }
.kpi.locked { background: #f8fafc; border-style: dashed; }
.kpi.locked .kpi-n { font-size: 22px; }
.kpi-n small { font-size: 15px; font-weight: 600; }
.mainnav .navsingle { color: #d1fae5; padding: 8px 12px; border-radius: 8px; font-weight: 500; }
.mainnav .navsingle.active { background: rgba(255, 255, 255, .14); color: #fff; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 8px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.bar-cols { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.bar-cols span { width: 42%; min-height: 1px; border-radius: 3px 3px 0 0; }
.b-o { background: #cbd5e1; }
.b-d { background: var(--green, #16a34a); }
.bar-l { font-size: 10px; color: #94a3b8; margin-top: 4px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: middle; }
@media (max-width: 720px) { .kpis { grid-template-columns: 1fr 1fr; } .kpi-n { font-size: 21px; } }

/* ---------- Продукти в поръчките ---------- */
.btn-sm { padding: 4px 10px; font-size: 13px; border-radius: 8px; min-height: 30px; }
.pitems { display: grid; gap: 4px; min-width: 180px; max-width: 300px; }
.pitem { display: flex; align-items: center; gap: 8px; line-height: 1.25; font-size: 13.5px; }
.pitem img, .pimg-none { width: 36px; height: 36px; object-fit: contain; border-radius: 6px; background: #f1f5f9; flex: none; border: 1px solid var(--line); }
.pimg-none { display: inline-block; }
.pimg-none.big { width: 88px; height: 88px; }
.pname { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.oitems { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.oitem { display: flex; gap: 12px; align-items: center; }
.oitem img { width: 88px; height: 88px; object-fit: contain; border-radius: 10px; background: #f1f5f9; border: 1px solid var(--line); }
.prodlist .pthumb { width: 60px; }
.prodlist .pthumb img { width: 50px; height: 50px; object-fit: contain; border-radius: 8px; background: #f1f5f9; border: 1px solid var(--line); display: block; }
.list td.acts { text-align: right; }
.list td.acts .btn { display: flex; width: 100%; margin: 0 0 4px; }
.list td.acts { width: 120px; }
tr.orow { cursor: pointer; }
tr.orow:hover td { background: #f8fafc; }
tr.orow.sel td { background: #ecfdf5; }

/* ---------- Бърз преглед (страничен панел) ---------- */
.drawer { position: fixed; inset: 0; z-index: 100; }
.drawer[hidden] { display: none; }
.drawer-back { position: absolute; inset: 0; background: rgba(15, 23, 42, .35); }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(760px, 100%); background: var(--bg); box-shadow: -10px 0 30px rgba(15, 23, 42, .18); display: flex; flex-direction: column; animation: drawerIn .18s ease-out; }
@keyframes drawerIn { from { transform: translateX(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; gap: 6px; padding: 10px 12px; background: #fff; border-bottom: 1px solid var(--line); }
.drawer-title { flex: 1; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 0 6px; }
.drawer iframe { flex: 1; width: 100%; border: 0; background: var(--bg); }
body.noscroll { overflow: hidden; }
body.embed .wrap { padding: 14px 16px; max-width: none; }
body.embed .foot { display: none; }
body.embed .grid2 { grid-template-columns: 1fr; }

/* ---------- Чекаут ---------- */
.co-admin { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; align-items: start; }
.co-admin aside { position: sticky; top: 12px; }
.offer-row { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.oimg { width: 64px; height: 64px; flex: none; border-radius: 8px; background: #f1f5f9; border: 1px solid var(--line); overflow: hidden; }
.oimg img { width: 100%; height: 100%; object-fit: contain; }
.grid-offer { flex: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 10px; }
.grid-offer .span2 { grid-column: span 2; }
.grid-offer label { font-size: 13px; }
.grid-offer select, .grid-offer input { width: 100%; }
textarea.code { width: 100%; font: 12.5px/1.45 ui-monospace, Menlo, Consolas, monospace; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; resize: vertical; }
.co-preview { width: 100%; height: 760px; border: 1px solid var(--line); border-radius: 12px; background: #f3f4f6; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 500; margin-top: 8px; }
label.check input { width: auto; }
@media (max-width: 980px) {
  .co-admin { grid-template-columns: 1fr; }
  .co-admin aside { position: static; }
  .grid-offer { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .list td.acts { width: auto; }
  .pitems { min-width: 140px; }
}

/* ---------- Режим за продажба ---------- */
.progress { height: 8px; background: #e2e8f0; border-radius: 99px; overflow: hidden; margin: 0 0 18px; }
.progress span { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.onboard { display: grid; gap: 10px; margin-bottom: 18px; }
.ob-step { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; color: var(--ink); text-decoration: none; }
.ob-step:hover { border-color: var(--green); text-decoration: none; }
.ob-step.ok { background: #f0fdf4; }
.ob-n { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: #f1f5f9; color: var(--ink-2); }
.ob-step.ok .ob-n { background: var(--green); color: #fff; }
.ob-t { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.ob-go { font-weight: 700; color: var(--green); white-space: nowrap; font-size: 14px; }
.ob-step.ok .ob-go { color: var(--ink-2); font-weight: 500; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 8px; }
.plan { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.plan-name { font-weight: 700; }
.plan-price { font-size: 22px; font-weight: 800; }
.plan-price span { font-size: 13px; font-weight: 500; color: var(--ink-2); margin-left: 4px; }
.plan-sub { font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.legal { white-space: normal; font-size: 15px; line-height: 1.6; }
a.auth-brand { text-decoration: none; }
.admin-tabs { margin-bottom: 14px; }

/* Потребители и права */
.whoami { font-size: 12px; color: rgba(255,255,255,.75); padding: 0 8px; white-space: nowrap; align-self: center; }
.roles { display: grid; gap: 8px; margin-bottom: 14px; }
.form label.rolepick { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0; cursor: pointer; }
.rolepick:has(input:checked) { border-color: var(--brand, #166534); background: #f3faf5; }
.rolepick input { margin-top: 3px; }
.rolepick small { display: block; color: var(--ink-2); font-weight: 400; }
.form .lbl { font-weight: 500; font-size: 14px; margin-bottom: 6px; }
.uedit summary { list-style: none; display: inline-block; }
.uedit summary::-webkit-details-marker { display: none; }
.uedit[open] { min-width: 280px; }
.uedit[open] form { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fff; }
.perms td.yes { color: #166534; font-weight: 700; text-align: center; }
.perms td.no { color: #cbd5e1; text-align: center; }
.perms th { text-align: center; }
.perms th:first-child { text-align: left; }
tr.muted td { opacity: .6; }
.btn.danger { color: #b91c1c; }
.scopebar { display: flex; gap: 6px; margin: 0 0 12px; flex-wrap: wrap; }
.scopebar a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; color: var(--ink-2); background: #fff; text-decoration: none; }
.scopebar a.active { background: var(--ink, #0f172a); color: #fff; border-color: transparent; }
.scopebar .navbadge { margin-left: 4px; }
.shoptag { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }

/* меню за смяна на статуса в списъка */
.stmenu { position: relative; display: inline-block; }
.stbtn { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; display: inline-flex; align-items: center; gap: 2px; }
.stbtn .caret { font-size: 10px; color: var(--muted, #64748b); }
.stbtn:hover .badge { filter: brightness(.95); box-shadow: 0 0 0 2px rgba(0,0,0,.08); }
.stpop { position: fixed; z-index: 1000; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15,23,42,.15); padding: 8px; display: flex; flex-direction: column; gap: 6px; min-width: 150px; }
.stpop .badge { border: 0; cursor: pointer; text-align: center; padding: 7px 12px; font-size: 13px; }
.stpop .badge:hover { filter: brightness(.93); }
.stpop .badge.cur { cursor: default; outline: 2px solid currentColor; outline-offset: -2px; }
.stpop .st-archived { margin-top: 4px; }

/* брой поръчки на клиента до името */
.custcnt { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: #e2e8f0; color: #334155; font-size: 11.5px; font-weight: 700; text-decoration: none; vertical-align: 1px; }
.custcnt.many { background: #1e3a8a; color: #fff; }
.custcnt.dup { background: #dc2626; color: #fff; }
.custcnt:hover { filter: brightness(1.1); text-decoration: none; }
.custhead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: space-between; }

/* странично меню със статусите (като в Middleware) */
.olayout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 18px; align-items: start; }
.stside { position: sticky; top: 76px; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 7px; }
.stside-h { font-weight: 700; font-size: 13px; color: #475569; margin: 2px 2px 4px; text-transform: uppercase; letter-spacing: .04em; }
.sti { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 8px; color: #fff; font-weight: 600; font-size: 14px; text-decoration: none; border: 2px solid transparent; }
.sti:hover { filter: brightness(1.08); text-decoration: none; color: #fff; }
.sti .stc { background: rgba(255,255,255,.25); border-radius: 999px; padding: 1px 8px; font-size: 12px; min-width: 26px; text-align: center; }
.sti.on { border-color: #0f172a; box-shadow: 0 0 0 2px #fff inset; }
.sti-all { background: #334155; }
.sti-pending { background: #7c8591; }
.sti-no_answer { background: #e29b00; }
.sti-confirmed { background: #15803d; }
.sti-shipped { background: #e8792b; }
.sti-rejected { background: #111827; }
.sti-duplicate { background: #dc2626; }
.sti-archived { background: #94a3b8; }
.olayout .toolbar .tabs { display: none; }
.st-dupl { background: #dc2626; color: #fff; }
.st-near { background: #fef3c7; color: #92400e; }
.custcnt.near { background: #f59e0b; color: #fff; }
@media (max-width: 900px) {
  .olayout { display: block; }
  .stside { position: static; flex-direction: row; overflow-x: auto; padding: 8px; gap: 6px; margin-bottom: 10px; -webkit-overflow-scrolling: touch; }
  .stside-h { display: none; }
  .sti { flex: 0 0 auto; padding: 6px 10px; font-size: 13px; }
}

.stside-f { font-size: 20px; font-weight: 700; color: #334155; margin: 0 2px 2px; }
.stclear { background: #3b82d6; color: #fff; border-color: #3b82d6; justify-content: center; text-align: center; margin-bottom: 8px; }
.stclear:hover { background: #2f6fbf; color: #fff; }
@media (max-width: 900px) { .stside-f { display: none; } .stclear { flex: 0 0 auto; margin: 0; padding: 6px 10px; font-size: 13px; } }

.sentday { display: flex; align-items: center; gap: 8px; padding: 6px 4px 10px; color: #334155; font-weight: 600; font-size: 14px; text-decoration: none; border-bottom: 1px solid #e2e8f0; margin-bottom: 4px; }
.sentday:hover { text-decoration: none; color: #0f172a; }
.sentday .tgl { width: 34px; height: 18px; border-radius: 999px; background: #cbd5e1; position: relative; flex: 0 0 auto; transition: background .15s; }
.sentday .tgl::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left .15s; }
.sentday.on .tgl { background: #e8792b; }
.sentday.on .tgl::after { left: 18px; }
.sentday .stl { flex: 1; }
.sentday .stc { background: #e2e8f0; border-radius: 999px; padding: 1px 8px; font-size: 12px; }
@media (max-width: 900px) { .sentday { flex: 0 0 auto; border: 0; margin: 0; padding: 6px 8px; } }

/* Активни / Архивирани */
.viewsw { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.viewsw a { padding: 9px 16px; border-radius: 8px; background: #d9dde3; color: #334155; font-weight: 600; text-decoration: none; font-size: 15px; }
.viewsw a.on { background: #4b5563; color: #fff; }
.viewsw a:hover { text-decoration: none; filter: brightness(.96); }

/* компактно странично меню */
.olayout { grid-template-columns: 160px minmax(0, 1fr); gap: 14px; }
.stside { padding: 8px; gap: 4px; top: 70px; max-height: calc(100vh - 84px); overflow-y: auto; }
.stside-f { font-size: 15px; margin: 0 2px; }
.stclear { padding: 5px 8px; font-size: 12.5px; margin-bottom: 4px; min-height: 0; }
.stside-h { font-size: 11px; margin: 4px 2px 2px; }
.sti { padding: 4px 8px; font-size: 12.5px; border-radius: 6px; border-width: 1.5px; }
.sti .stc { font-size: 11px; padding: 0 6px; min-width: 22px; }
.sentday { font-size: 12.5px; padding: 4px 2px 6px; gap: 6px; }
.sentday .tgl { width: 28px; height: 15px; }
.sentday .tgl::after { width: 11px; height: 11px; }
.sentday.on .tgl::after { left: 15px; }
/* страницата с поръчките е по-широка — менюто е по-вляво, а таблицата има повече място */
.wrap:has(.olayout) { max-width: 1440px; }
.olayout { grid-template-columns: 150px minmax(0, 1fr); }
@media (max-width: 900px) { .stside { max-height: none; } }

/* оставащи поръчки и SMS в горната лента */
.usage { display: inline-flex; gap: 6px; align-items: center; margin-left: auto; }
.uchip { position: relative; display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.12); color: #fff; font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap; }
.uchip:hover { background: rgba(255,255,255,.22); color: #fff; text-decoration: none; }
.uchip.low { background: #dc2626; }
.uchip .ui { font-size: 14px; }
.uchip[data-tip]:hover::after { content: attr(data-tip); white-space: pre-line; position: absolute; top: calc(100% + 8px); right: 0; z-index: 2000; background: #111827; color: #fff;
  font-weight: 500; font-size: 13px; line-height: 1.5; padding: 8px 12px; border-radius: 8px; min-width: 210px; text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.usage + .logout, .usage + .whoami { margin-left: 8px; }
@media (max-width: 900px) { .usage { margin: 6px 0; } .uchip[data-tip]:hover::after { left: 0; right: auto; } }

/* Новини */
.newslayout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; }
.newsside { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.newsside-h { padding: 10px 14px; font-weight: 700; background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
.newsside a { padding: 8px 14px; border-bottom: 1px solid #f1f5f9; color: #334155; text-decoration: none; font-size: 14px; }
.newsside a.on, .newsside a:hover { background: #f1f5f9; }
.newsitem { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 18px 20px; margin-bottom: 14px; }
.newsitem.unread { border-left: 5px solid #dc2626; }
.newsitem h2 { margin: 0 0 6px; font-size: 22px; }
.newsitem h2 a { color: #1e3a8a; text-decoration: none; }
.newsmeta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: #64748b; font-size: 13px; margin-bottom: 10px; }
.newsexc { background: #f8fafc; border-left: 4px solid #cbd5e1; padding: 10px 14px; margin-bottom: 10px; color: #334155; }
.newsbody { font-size: 15.5px; line-height: 1.65; }
.newsbody ul { padding-left: 22px; }
@media (max-width: 900px) { .newslayout { grid-template-columns: 1fr; } }

.st-redirected { background: #dbeafe; color: #1d4ed8; }
.sti-redirected { background: #3b82d6; }
.redirrow td { background: #f8fafc; }
.redirform { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.redirform select { max-width: 560px; }
.stalledw .list td { padding: 7px 8px; }

.st-abandoned { background: #e2e8f0; color: #475569; border: 1px dashed #94a3b8; }
.sti-abandoned { background: #8fa3bf; }

/* спасени колички */
.list tr.rec-row td { background: #ecfdf5; }
.list tr.rec-row td:first-child { box-shadow: inset 4px 0 0 #16a34a; }
.st-recov { background: #16a34a; color: #fff; }
.recbox a { margin-left: 4px; }

/* тикети */
.tkhead { display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap; align-items:center; }
.tkthread { display:flex; flex-direction:column; gap:10px; margin:14px 0; }
.tkmsg { max-width:760px; border:1px solid var(--line, #e2e8f0); border-radius:12px; padding:10px 14px; background:#fff; }
.tkmsg.tk-admin { align-self:flex-end; background:#ecfdf5; border-color:#a7f3d0; }
.tkmsg.tk-client { align-self:flex-start; }
.tkmeta { font-size:12px; color:#64748b; margin-bottom:4px; }
.tkbody p { margin:0 0 6px; }
.tkfile img { max-width:320px; max-height:240px; border-radius:8px; border:1px solid #e2e8f0; margin-top:6px; }
.list tr.tk-new td { background:#fff7ed; font-weight:500; }
.tkform { max-width:760px; }

/* очаква товарителница след пренасочване */
.awaitwb { color: #1d4ed8; font-weight: 600; }
.awaitpanel { border-left: 4px solid #3b82f6; background: #eff6ff; }

/* табове Активни/Архивирани вляво, търсачката вдясно на същия ред */
.vtop { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.vtop .toolbar { margin-left: auto; }
.vtop .viewsw { margin-bottom: 12px; }

.scopesel label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); font-weight: 600; }
.scopesel select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 14px; font-weight: 600; color: var(--ink, #0f172a); min-width: 220px; }

/* табовете Активни/Архивирани — в средата, търсачката — вдясно */
.vtop { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; }
.vtop .viewsw { grid-column: 2; justify-content: center; }
.vtop .toolbar { grid-column: 3; justify-self: end; margin-left: 0; }
@media (max-width: 900px) { .vtop { display: flex; flex-direction: column; align-items: stretch; } .vtop .toolbar { justify-self: auto; } }

/* себестойност в продуктите */
.pcost { width: 72px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; text-align: right; font: inherit; }
.pcost.ok { border-color: #16a34a; background: #f0fdf4; }
.pcost.err { border-color: #dc2626; background: #fef2f2; }
.pcostrow { white-space: nowrap; margin-bottom: 4px; }
.pcostcell .pmargin { color: #15803d; }
.pcostcell .pmargin.bad { color: #dc2626; }
.pcostcell input.pcost { display: inline-block; width: 80px; margin: 0; vertical-align: middle; }
.pcostrow .small { display: inline-block; min-width: 70px; text-align: right; margin-right: 4px; }
.pcostcell .pmargin { margin-top: 2px; }

/* печалби и разходи */
.pfilter { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.pfilter label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.pfilter select, .finper select, .fincomp select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; font-weight: 600; }
.pcards2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 14px 0; }
.pcards4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 14px 0; }
.pcard { background: #fff; border: 1px solid var(--line); border-left: 5px solid #94a3b8; border-radius: 14px; padding: 16px 18px; }
.pcard.good { border-left-color: #22c55e; } .pcard.bad { border-left-color: #ef4444; } .pcard.warn { border-left-color: #f59e0b; }
.pcard .pl { color: #475569; font-size: 14px; }
.pcard .pv { font-size: 26px; font-weight: 700; margin: 6px 0; }
.pcard .ps { font-size: 13px; color: #64748b; }
.pcard.good .ps { color: #15803d; } .pcard.bad .ps { color: #b91c1c; } .pcard.warn .ps { color: #b45309; }
b.good { color: #15803d; } b.bad { color: #dc2626; }
.finbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fincomp label { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; }
.fintabs { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
@media (max-width: 900px) { .pcards2, .pcards4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .pcards2, .pcards4 { grid-template-columns: 1fr; } }

/* магазини, куриери, SMS, потребители — подредени списъци */
.smstabs { margin: 0 0 16px; }
.list td.c, .list th.c { text-align: center; }
.list td.r { text-align: right; }
.list .ok { color: #16a34a; font-weight: 700; font-size: 18px; }
.list td.c .bad { font-weight: 700; font-size: 18px; }
.clogo { height: 18px; width: auto; max-width: 90px; object-fit: contain; vertical-align: middle; margin-right: 8px; }
.clogo.lg { height: 26px; max-width: 120px; }
h1 .clogo.lg { height: 30px; margin-right: 6px; vertical-align: -4px; }
.cbmark { font-size: 13px; color: #0891b2; font-weight: 600; }
.shoplist td, .courlist td { vertical-align: middle; }
.shopedit { align-items: start; }
.urole h2 { font-size: 17px; margin-bottom: 10px; }
.urole h2 .small { font-weight: 400; }
.setlinks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 18px; }
.setlinks a { display: flex; flex-direction: column; gap: 4px; color: var(--ink); margin: 0; }
.setlinks a:hover { text-decoration: none; border-color: var(--green); }
.setlinks span { font-size: 13px; color: var(--ink-2); }

/* НЕкоректен.ком */
.nklist { margin-top: 8px; display: grid; gap: 8px; }
.nkitem { background: #fff; border: 1px solid #fecaca; border-radius: 10px; padding: 8px 12px; color: var(--ink); font-weight: 400; }
.nkbox summary { cursor: pointer; }
.dangerzone { border-color: #fecaca; }
.dangerzone h2 { color: #b91c1c; }
.btn.danger:not(.btn-ghost) { background: #dc2626; border-color: #dc2626; color: #fff; }

/* ръководство */
.gsearch { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.gsearch input { flex: 1; font-size: 16px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.guide { display: grid; grid-template-columns: 230px 1fr; gap: 20px; align-items: start; }
.gcats { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; }
.gcats a { padding: 8px 10px; border-radius: 10px; color: var(--ink); font-size: 14px; display: flex; gap: 6px; align-items: center; }
.gcats a small { margin-left: auto; color: var(--ink-2); }
.gcats a:hover { background: #fff; text-decoration: none; }
.gcats a.off { opacity: .35; }
.gcat { margin-bottom: 18px; scroll-margin-top: 16px; }
.gcat h2 { font-size: 18px; margin: 0 0 10px; }
.gart { padding: 0; margin-bottom: 8px; scroll-margin-top: 16px; }
.gart summary { cursor: pointer; padding: 13px 16px; font-weight: 600; list-style: none; }
.gart summary::-webkit-details-marker { display: none; }
.gart summary::before { content: '›'; display: inline-block; width: 16px; color: var(--ink-2); transition: transform .15s; }
.gart[open] summary::before { transform: rotate(90deg); }
.gbody { padding: 0 16px 14px 32px; line-height: 1.55; }
.gbody ul, .gbody ol { padding-left: 20px; }
.gbody li { margin: 4px 0; }
.glink { margin-left: 8px; }
@media (max-width: 760px) { .guide { grid-template-columns: 1fr; } .gcats { position: static; flex-direction: row; flex-wrap: wrap; } }

/* Facebook бутон */
.btn.fbbtn { background: #1877f2; border-color: #1877f2; color: #fff; }
.btn.fbbtn b { font-family: Arial, sans-serif; font-size: 17px; margin-right: 4px; }
.btn.fbbtn.lg { padding: 12px 22px; font-size: 16px; }
.fbhero { text-align: center; padding: 28px 20px; }

.pkpi .pcard { padding: 14px 16px; }
.pkpi .pv { font-size: 22px; }
/* по-сбито горно меню, за да се събира на по-тесни екрани */
@media (max-width: 1800px) { .topbar { gap: 12px; padding: 0 14px; } .mainnav { gap: 1px; } .mainnav a { padding: 7px 8px; font-size: 14px; } .mainnav .navg { gap: 4px; } }
@media (max-width: 1600px) { .mainnav a { padding: 6px 6px; font-size: 13px; } .brand { font-size: 16px; } .navg .caret { display: none; } }
/* под 1440px менюто става „хамбургер“ (иначе не се събира) */
@media (max-width: 1440px) {
  .topbar { flex-wrap: wrap; height: auto; min-height: 56px; }
  .shopswitch { order: 2; }
  .navburger { display: block; margin-left: auto; font-size: 22px; cursor: pointer; padding: 10px 4px; }
  .mainnav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; padding-bottom: 10px; }
  .navtoggle:checked ~ .mainnav { display: flex; max-height: calc(100dvh - 60px); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .mainnav .logout { margin-left: 0; }
  .navmenu { display: block; position: static; box-shadow: none; border: 0; background: transparent; padding: 0 0 6px 12px; min-width: 0; }
  .navmenu a { color: #d1fae5; white-space: normal; }
  .navmenu a:hover, .navmenu a.current { background: rgba(255, 255, 255, .1); color: #fff; }
  .navsep { color: #6ee7b7; border-top-color: rgba(255,255,255,.12); }
  .navg .caret { display: none; }
}
.pfilter-p { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0; }

/* иконка НОВО до новите функции (временно) */
.newbadge { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 5px; background: #16a34a; color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .04em; line-height: 16px; vertical-align: 1px; }
/* промяна на продуктите в поръчка — на телефон редовете стават карти */
@media (max-width: 640px) {
  .itedit thead { display: none; }
  .itedit, .itedit tbody, .itedit tr, .itedit td { display: block; width: 100%; }
  .itedit tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; padding: 10px; border-bottom: 1px solid var(--line); }
  .itedit td { padding: 0; border: 0; }
  .itedit td:first-child, .itedit td:nth-child(2) { grid-column: 1 / -1; }
  .itedit td:first-child input { min-width: 0 !important; }
  .itedit input { width: 100% !important; }
  .itedit .itsum { align-self: center; font-weight: 700; }
}

/* ===== Поръчки: етапи, оценка за риск, лента за избраните, режим звънене (ноември 2026) ===== */
.stages { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; margin: 0 0 8px; }
.stage { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-top: 4px solid #cbd5e1; border-radius: var(--radius); color: var(--ink); box-shadow: var(--shadow); min-width: 0; }
.stage:hover { text-decoration: none; border-color: #94a3b8; }
.stage .sn { font-size: 24px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stage .sl { font-size: 13px; color: var(--ink-2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage.all { border-top-color: var(--ink); }
.stage.st-pending { border-top-color: var(--blue); }
.stage.st-noanswer { border-top-color: var(--amber); }
.stage.st-confirmed { border-top-color: var(--green); }
.stage.st-shipped { border-top-color: #0f766e; }
.stage.st-office { border-top-color: var(--orange); }
.stage.st-rejected { border-top-color: var(--red); }
.stage.st-pending, .stage.st-noanswer, .stage.st-confirmed, .stage.st-shipped, .stage.st-office, .stage.st-rejected { background: var(--card); color: var(--ink); }
.stage.on { border-color: var(--ink); border-width: 2px; border-top-width: 4px; padding: 11px 13px; background: #f8fafc; }
.hint { color: var(--ink-2); font-size: 13px; margin: 0 0 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.callmode-btn { font-weight: 700; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.legend .lg { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 3px 10px; border-radius: 999px; border: 1px solid transparent; }
.legend .lg b { font-variant-numeric: tabular-nums; }
.legend .lg:hover { text-decoration: none; filter: brightness(.96); }
.legend .lg.on { border-color: currentColor; box-shadow: 0 0 0 1px currentColor inset; }
.legend .sentday { background: #fff; border-color: var(--line); color: var(--ink); }
.legend .sentday.on { background: var(--green-soft); color: var(--green); }
.legend .clear { color: var(--ink-2); }
.olayout.nostside { display: block; }
.st-office { background: var(--orange-soft); color: var(--orange); }
/* цветна лента вляво на реда по статуса */
table.list tr.orow > td:first-child { box-shadow: inset 4px 0 0 transparent; }
tr.ro-pending > td:first-child { box-shadow: inset 4px 0 0 var(--blue) !important; }
tr.ro-no_answer > td:first-child { box-shadow: inset 4px 0 0 var(--amber) !important; }
tr.ro-confirmed > td:first-child { box-shadow: inset 4px 0 0 var(--green) !important; }
tr.ro-shipped > td:first-child { box-shadow: inset 4px 0 0 #0f766e !important; }
tr.ro-redirected > td:first-child { box-shadow: inset 4px 0 0 var(--blue) !important; }
tr.ro-rejected > td:first-child, tr.ro-duplicate > td:first-child { box-shadow: inset 4px 0 0 var(--red) !important; }
tr.ro-abandoned > td:first-child { box-shadow: inset 4px 0 0 #7c3aed !important; }
tr.orow.picked > td { background: #f0fdf4; }
/* оценка за риск */
.score { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 22px; padding: 0 6px; border-radius: 999px; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; vertical-align: 1px; cursor: help; }
.score.sc0 { background: var(--green-soft); color: var(--green); }
.score.sc1 { background: var(--amber-soft); color: var(--amber); }
.score.sc2 { background: var(--red); color: #fff; }
.riskbox { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 0 0 14px; background: var(--card); }
.riskbox.rk1 { border-color: #fcd34d; background: #fffbeb; }
.riskbox.rk2 { border-color: #fca5a5; background: #fef2f2; }
.riskbox .rkhead { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.meterbar { position: relative; height: 8px; border-radius: 999px; margin: 10px 0 8px; background: linear-gradient(90deg, #22c55e 0 40%, #f59e0b 40% 70%, #dc2626 70% 100%); }
.meterbar i { position: absolute; top: -4px; width: 4px; height: 16px; border-radius: 2px; background: var(--ink); box-shadow: 0 0 0 2px #fff; }
.factors { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 13px; }
.factors li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); padding: 3px 0; }
.factors li:last-child { border-bottom: 0; }
/* плаваща лента за избраните */
.selbar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 40; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: calc(100vw - 24px); background: #0f172a; color: #fff; padding: 10px 12px; border-radius: 14px; box-shadow: 0 10px 30px rgba(15,23,42,.35); }
.selbar[hidden] { display: none; }
.selbar > span { font-weight: 600; margin-right: 4px; }
.selbar .sb { border: 0; border-radius: 9px; padding: 8px 12px; font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; background: var(--green); color: #fff; }
.selbar .sb.gh { background: transparent; color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }
.selbar .sb.rd { background: var(--red-soft); color: var(--red); }
.selbar .sb.o { background: var(--orange); color: #fff; }
/* режим звънене */
.callwrap { max-width: 640px; margin: 0 auto; }
.callhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.callprog { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-bottom: 12px; }
.callprog i { display: block; height: 100%; background: var(--green); }
.callcard { padding: 18px; }
.callempty { text-align: center; padding: 36px 18px; }
.cc-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.cc-name { font-size: 22px; font-weight: 800; line-height: 1.2; }
.cc-sum { font-size: 22px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cc-phone { display: block; margin: 14px 0 10px; padding: 14px; text-align: center; font-size: 26px; font-weight: 800; letter-spacing: .02em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--green-soft); color: var(--green); border-radius: var(--radius); }
.cc-phone:hover { text-decoration: none; filter: brightness(.97); }
.cc-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.cc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.cc-grid .cc-wide { grid-column: 1 / -1; }
.cc-l { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 2px; }
.cc-acts { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; align-items: start; }
.cc-acts form { margin: 0; }
.cc-big { width: 100%; min-height: 52px; font-size: 16px; justify-content: center; display: flex; align-items: center; gap: 8px; }
.cc-big kbd, .callwrap kbd { font: 11px ui-monospace, monospace; padding: 1px 5px; border-radius: 4px; background: rgba(0,0,0,.08); }
.cc-rej summary { list-style: none; cursor: pointer; }
.cc-rej summary::-webkit-details-marker { display: none; }
.cc-reasons { display: grid; gap: 6px; margin-top: 8px; }
.cc-reasons .btn { justify-content: flex-start; text-align: left; white-space: normal; }
.cc-rej[open] { grid-column: 1 / -1; grid-row: 2; }
.cc-more { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
@media (max-width: 1100px) { .stages { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .stages { grid-template-columns: repeat(7, minmax(108px, 1fr)); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
  .stage { scroll-snap-align: start; }
  .cc-grid { grid-template-columns: 1fr; }
  .cc-acts { grid-template-columns: 1fr; }
  .cc-rej[open] { grid-row: auto; }
  .selbar { bottom: 10px; left: 12px; right: 12px; transform: none; }
}

/* ===== Нова рамка: горна лента, странично меню, долно меню на телефон (ноември 2026) ===== */
.top2 { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; height: 60px; padding: 0 18px; background: #fff; border-bottom: 1px solid var(--line); }
.brand2 { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 19px; letter-spacing: -.01em; flex: none; }
.brand2:hover { text-decoration: none; }
.logo2 { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; background: var(--orange); color: #fff; font-size: 17px; font-weight: 900; }
.gsearch2 { flex: 1; max-width: 440px; margin: 0; }
.gsearch2 input { width: 100%; margin: 0; min-height: 38px; padding: 7px 12px; border-radius: 10px; background: #f3f5f2; border: 1px solid transparent; }
.gsearch2 input:focus { background: #fff; border-color: var(--green); }
.top2 .shopswitch select { background-color: #fff; color: var(--ink); border: 1px solid var(--line); }
.top2 .shopswitch select option { color: var(--ink); }
.t2right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.t2right .uchip { color: var(--ink); background: #f3f5f2; }
.t2right .whoami { color: var(--ink-2); font-size: 13px; }
.report2 { font-size: 13px; font-weight: 700; color: var(--orange); border: 1px dashed var(--orange); background: var(--orange-soft); padding: 6px 10px; border-radius: 9px; white-space: nowrap; }
.report2:hover { text-decoration: none; filter: brightness(.97); }
.logout2 { color: var(--ink-2); font-size: 13.5px; font-weight: 600; }
.t2burger { display: none; border: 0; background: transparent; font-size: 22px; padding: 6px; cursor: pointer; color: var(--ink); }
.shell2 { display: flex; align-items: stretch; min-height: calc(100vh - 60px); }
.side2 { flex: 0 0 232px; background: #f3f5f2; border-right: 1px solid var(--line); padding: 14px 10px 24px; position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; }
.side2 .sitem { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 600; font-size: 14.5px; }
.side2 .sitem:hover { background: #e8ece6; text-decoration: none; color: var(--ink); }
.side2 .sitem.on { background: var(--green-soft); color: var(--green); }
.side2 .sb { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--orange); color: #fff; font-size: 11.5px; font-weight: 800; }
.side2 .sgrp { margin: 16px 12px 6px; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #64748b; }
.side2 .ssub { display: grid; gap: 1px; margin: 2px 0 6px 10px; padding-left: 8px; border-left: 2px solid #d9e3d6; }
.side2 .ssub a { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 8px; color: var(--ink-2); font-size: 13.5px; }
.side2 .ssub a:hover { background: #e8ece6; text-decoration: none; }
.side2 .ssub a.current { color: var(--green-dark); font-weight: 700; background: #fff; }
.side2 .ssep { margin: 8px 10px 2px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #94a3b8; }
.side2 .slog { display: none; }
.main2 { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main2 .wrap { max-width: 1240px; width: 100%; flex: 1; }
.sideback { display: none; }
.bnav { display: none; }
@media (max-width: 900px) {
  .top2 { gap: 8px; padding: 0 10px; height: 56px; }
  .t2burger { display: inline-block; }
  .gsearch2 { display: none; }
  .t2right .whoami, .t2right .logout2 { display: none; }
  .report2 { padding: 5px 8px; font-size: 12px; }
  .brand2 .bname { display: none; }
  .top2 .shopswitch select { max-width: 150px; }
  .shell2 { display: block; min-height: 0; }
  .side2 { position: fixed; z-index: 50; top: 0; left: 0; bottom: 0; height: auto; width: 270px; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 8px 0 30px rgba(15,23,42,.15); background: #f3f5f2; }
  body.sideopen .side2 { transform: none; }
  body.sideopen .sideback { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(15,23,42,.35); }
  .side2 .slog { display: flex; margin-top: 12px; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .bnav { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; z-index: 35; left: 0; right: 0; bottom: 0; padding-bottom: env(safe-area-inset-bottom, 0px); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(15,23,42,.06); }
  .bnav a, .bnav button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 60px; border: 0; background: transparent; font: inherit; font-size: 11.5px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
  .bnav a:hover { text-decoration: none; }
  .bnav .bi { font-size: 19px; line-height: 1; }
  .bnav .on { color: var(--green); }
  .bnav b { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--orange); color: #fff; font-size: 10.5px; display: inline-flex; align-items: center; justify-content: center; }
  .selbar { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
}
.side2 .newbadge { align-self: center; flex: none; margin-left: auto; }
@media (max-width: 900px) { .top2 .shopswitch { flex: 1; min-width: 0; display: flex; justify-content: flex-end; } .top2 .shopswitch select { width: 100%; max-width: 220px; } }
@media (max-width: 480px) { .report2 { display: none; } }

/* ===== Известия, здраве на системата ===== */
.tog { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-weight: 500; cursor: pointer; }
.tog:last-of-type { border-bottom: 0; }
.tog > input[type=checkbox] { appearance: none; -webkit-appearance: none; flex: none; width: 42px; height: 24px; border-radius: 999px; background: #cbd5e1; position: relative; cursor: pointer; margin: 0; transition: background .15s; }
.tog > input[type=checkbox]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.tog > input[type=checkbox]:checked { background: var(--green); }
.tog > input[type=checkbox]:checked::after { left: 21px; }
.smsbox { white-space: normal; font-size: 14.5px; line-height: 1.6; background: #ecfdf5; border: 1px solid #bbf7d0; border-radius: 14px 14px 14px 4px; padding: 12px 14px; max-width: 420px; }
.hgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.hc { display: flex; flex-direction: column; gap: 4px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.hc .badge { align-self: flex-start; }
.hc-warn { border-left-color: var(--amber); }
.hc-bad { border-left-color: var(--red); background: #fef2f2; }
.hc .hv { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.hc .small { overflow-wrap: anywhere; }
.themetgl { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 14px; padding: 9px 12px; border: 1px dashed #cbd5e1; border-radius: 10px; background: transparent; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }

/* ===== Тъмна тема (включва се от менюто, помни се в браузъра) ===== */
html[data-theme=dark] { color-scheme: dark;
  --green: #4ade80; --green-dark: #86efac; --green-soft: #12301f; --orange: #fb923c; --orange-soft: #3a2414;
  --red: #f87171; --red-soft: #3b1717; --amber: #fbbf24; --amber-soft: #352a0e; --blue: #93c5fd; --blue-soft: #172a45;
  --ink: #e5e9e4; --ink-2: #a3aea4; --line: #2b332d; --bg: #111512; --card: #181d19; --shadow: none; }
html[data-theme=dark] body { background: var(--bg); color: var(--ink); }
html[data-theme=dark] .top2, html[data-theme=dark] .bnav { background: #151a16; border-color: var(--line); }
html[data-theme=dark] .side2 { background: #141914; border-color: var(--line); }
html[data-theme=dark] .side2 .sitem:hover, html[data-theme=dark] .side2 .ssub a:hover { background: #1f2620; }
html[data-theme=dark] .side2 .ssub a.current { background: #1f2620; }
html[data-theme=dark] .side2 .ssub { border-color: #2b332d; }
html[data-theme=dark] .gsearch2 input { background: #1f2620; }
html[data-theme=dark] input, html[data-theme=dark] select, html[data-theme=dark] textarea { background: #1b211c; color: var(--ink); border-color: #354036; }
html[data-theme=dark] .btn-ghost, html[data-theme=dark] .stage, html[data-theme=dark] .legend .sentday, html[data-theme=dark] .top2 .shopswitch select { background: var(--card); color: var(--ink); border-color: var(--line); }
html[data-theme=dark] .stage.on { background: #1f2620; border-color: var(--ink); }
html[data-theme=dark] .btn:not(.btn-ghost):not(.btn-danger) { background: #16a34a; border-color: #16a34a; color: #fff; }
html[data-theme=dark] .btn-danger { background: var(--card); }
html[data-theme=dark] .list th { background: #1b211c; }
html[data-theme=dark] .list td { border-color: var(--line); }
html[data-theme=dark] .list tbody tr:hover, html[data-theme=dark] tr.orow.picked > td { background: #1d241e; }
html[data-theme=dark] .risk-row td, html[data-theme=dark] .dup-row td { background: #2a1717 !important; }
html[data-theme=dark] .riskbox { background: var(--card); }
html[data-theme=dark] .riskbox.rk1 { background: #2b2410; border-color: #6b5413; }
html[data-theme=dark] .riskbox.rk2, html[data-theme=dark] .hc-bad { background: #2a1717; border-color: #7f2a2a; }
html[data-theme=dark] .meterbar i { background: #fff; box-shadow: 0 0 0 2px #111; }
html[data-theme=dark] .flash-ok { color: #bbf7d0; border-color: #1f5133; }
html[data-theme=dark] .flash-err { color: #fecaca; border-color: #6b2323; }
html[data-theme=dark] .flash-warn, html[data-theme=dark] .testbar { color: #fde68a; border-color: #5c4710; background: var(--amber-soft); }
html[data-theme=dark] .smsbox { background: #12301f; border-color: #1f5133; }
html[data-theme=dark] code { background: #1f2620; }
html[data-theme=dark] .selbar { background: #000; }
html[data-theme=dark] .st-shipped, html[data-theme=dark] .st-abandoned { background: #262d27; color: #cbd5cc; }
html[data-theme=dark] .score.sc2 { background: #dc2626; }
html[data-theme=dark] .logo2 { background: var(--orange); }
html[data-theme=dark] .empty { background: var(--card); }
.st-delivered { background: #ccfbf1; color: #0f766e; }
.st-returned { background: #fde2e2; color: #9f1239; border: 1px dashed #fda4af; }
.stage.st-delivered { border-top-color: #0f766e; background: var(--card); color: var(--ink); }
tr.ro-delivered > td:first-child { box-shadow: inset 4px 0 0 #0f766e !important; }
tr.ro-returned > td:first-child { box-shadow: inset 4px 0 0 #9f1239 !important; }
.stages { grid-template-columns: repeat(8, minmax(0, 1fr)); }
@media (max-width: 1100px) { .stages { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 640px) { .stages { grid-template-columns: repeat(8, minmax(108px, 1fr)); } }
html[data-theme=dark] .st-delivered { background: #0f2f2b; color: #5eead4; }
html[data-theme=dark] .st-returned { background: #3a1520; color: #fda4af; }
.stage.st-returned { border-top-color: #9f1239; background: var(--card); color: var(--ink); }
.stages { grid-template-columns: repeat(9, minmax(0, 1fr)); }
.stage .sl { font-size: 12.5px; }
@media (max-width: 1280px) { .stages { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 640px) { .stages { grid-template-columns: repeat(9, minmax(104px, 1fr)); } }
.stage .sl { white-space: normal; overflow: visible; line-height: 1.25; }
.stage.st-returned { border: 1px solid var(--line); border-top: 4px solid #9f1239; }
.stage.st-returned.on { border-color: var(--ink); border-width: 2px; border-top-width: 4px; }

/* ===== Страница за потвърждение v2 (c.php) + ъпсел ===== */
body.pv2 { background: linear-gradient(180deg, #e7f6ec 0, #f3f7f2 260px) no-repeat, #f3f7f2; color: #0f172a; }
.pv2 .pub { padding-bottom: 32px; }
.pv2 .pub-head { margin: 4px 0 14px; }
.v2-hello { margin: 0; color: var(--ink-2); font-size: 15px; }
.v2-h1 { font-size: 24px; line-height: 1.2; margin: 2px 0 14px; letter-spacing: -.01em; }
.v2-note { margin: -6px 0 12px; font-size: 14px; color: var(--amber); }
.v2-order { padding: 16px; }
.v2-cap { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin-bottom: 8px; }
.v2-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.v2-items li { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; }
.v2-items img, .v2-noimg, .v2-offer img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: #eef2ef; display: block; }
.v2-iname { font-weight: 600; font-size: 15px; line-height: 1.3; min-width: 0; }
.v2-iname small { display: block; font-weight: 500; color: var(--ink-2); font-size: 13px; }
.v2-iq { font-weight: 700; color: var(--ink-2); }
.v2-plain { margin: 0; font-weight: 600; }
.v2-child { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--amber-soft); font-size: 14px; }
.v2-child span { display: block; color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.v2-dest { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.v2-dest span, .v2-total span { font-size: 13px; color: var(--ink-2); }
.v2-total { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: #f0fdf4; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.v2-total b { font-size: 22px; color: var(--green-dark); font-variant-numeric: tabular-nums; }
.v2-fee { margin: 8px 2px 0; font-size: 13px; color: var(--ink-2); }
.v2-up { margin-top: 14px; border: 2px dashed #f59e0b; background: #fffbeb; border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.v2-uphead { display: flex; flex-direction: column; gap: 2px; }
.v2-uphead b { font-size: 17px; }
.v2-uphead small { color: var(--ink-2); font-size: 13px; }
.v2-tag { align-self: flex-start; background: #b45309; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; border-radius: 6px; padding: 2px 8px; margin-bottom: 4px; }
.v2-offer { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; background: #fff; border: 2px solid #fde68a; border-radius: 14px; padding: 10px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.v2-offer img, .v2-offer .v2-noimg { width: 56px; height: 56px; }
.v2-offer input { position: absolute; opacity: 0; pointer-events: none; }
.v2-offer.on { border-color: var(--green); box-shadow: 0 0 0 3px rgba(22, 101, 52, .12); }
.v2-offer:focus-within { outline: 3px solid #93c5fd; outline-offset: 2px; }
.v2-otxt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.v2-otxt b { font-size: 15px; line-height: 1.25; }
.v2-price { font-weight: 800; color: var(--green-dark); font-size: 16px; }
.v2-price s { color: #94a3b8; font-weight: 500; font-size: 13px; }
.v2-price em { font-style: normal; font-size: 12px; background: var(--red-soft); color: var(--red); border-radius: 5px; padding: 1px 5px; }
.v2-add i { font-style: normal; font-weight: 800; font-size: 14px; border-radius: 10px; padding: 9px 12px; white-space: nowrap; display: inline-block; }
.v2-add .off { background: var(--orange); color: #fff; }
.v2-add .on { display: none; background: var(--green-soft); color: var(--green); }
.v2-offer.on .v2-add .on { display: inline-block; }
.v2-offer.on .v2-add .off { display: none; }
.v2-go { margin-top: 14px; font-size: 18px; min-height: 60px; }
.v2-sec { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.v2-sec button { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 13px 10px; font: inherit; font-weight: 700; font-size: 15px; color: var(--ink); cursor: pointer; }
.v2-sec button.on { border-color: var(--ink); }
.v2-sec .v2-red { color: var(--red); }
.v2-sec .v2-red.on { border-color: var(--red); }
.v2-panel { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.v2js .v2-panel { display: none; }
.v2js .v2-panel.show { display: flex; }
.v2-panel textarea, .v2-panel input[name=reason_other] { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 12px; padding: 12px; font: inherit; font-size: 16px; margin-top: 6px; }
.v2-reasons { display: flex; flex-direction: column; gap: 8px; }
.v2-reasons label { position: relative; }
.v2-reasons input { position: absolute; opacity: 0; }
.v2-reasons span { display: block; border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; font-weight: 600; background: #fff; cursor: pointer; }
.v2-reasons input:checked + span { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.v2-reasons input:focus-visible + span { outline: 3px solid #93c5fd; }
.v2-nobtn { background: var(--red); color: #fff; }
.v2-added { color: var(--green); font-weight: 600; }
@media (max-width: 360px) { .v2-offer { grid-template-columns: 48px 1fr; } .v2-add { grid-column: 1 / -1; } .v2-add i { display: block; text-align: center; } .v2-offer.on .v2-add .on { display: block; } }
.upbox { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius); padding: 14px 16px; margin: 0 0 14px; }
.upbox p { margin: 4px 0 0; max-width: 70ch; }
.upstats { display: flex; gap: 18px; align-items: flex-end; flex-wrap: wrap; }
.upstats div { display: flex; flex-direction: column; }
.upstats b { font-size: 20px; }
.upstats span { font-size: 12px; color: var(--ink-2); }
.upcell { white-space: nowrap; }
.upcell .upprice { width: 70px; margin-left: 6px; }
.upcell .upprice.ok { border-color: var(--green); } .upcell .upprice.err { border-color: var(--red); }
@media (max-width: 760px) { .upbox { grid-template-columns: 1fr; } }
html[data-theme=dark] .upbox { background: #2a2310; border-color: #5c4a14; }
.tog.upt { display: inline-flex; padding: 0; border: 0; vertical-align: middle; }
.upcell input.upprice { display: inline-block; width: 72px; padding: 6px 8px; }
.shipname { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; max-width: 260px; }
.shipname span { font-size: 11px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.shipname input { padding: 6px 8px; font-size: 13px; }
.shipname input.ok { border-color: var(--green); } .shipname input.err { border-color: var(--red); }
.costbar { border-radius: var(--radius); padding: 12px 16px; margin: 0 0 14px; border: 1px solid var(--line); background: var(--card); display: flex; flex-direction: column; gap: 8px; }
.costbar.miss { border-color: #fdba74; background: var(--orange-soft); }
.costbar.ok { border-color: #86efac; background: var(--green-soft); }
.costbar-top { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.costbar-n { margin-left: auto; font-size: 13px; font-weight: 600; }
.costbar .prog { height: 8px; border-radius: 4px; background: rgba(15,23,42,.08); overflow: hidden; }
.costbar .prog i { display: block; height: 100%; background: var(--green); }
.costtabs { margin: 0; }
html[data-theme=dark] .costbar.miss { background: #3a2412; border-color: #7c3e12; }
html[data-theme=dark] .costbar.ok { background: #12301d; border-color: #1f5a33; }
/* оригиналното лого */
.logo2img { height: 30px; width: auto; display: block; }
.logo2img.dk, .logo2ico { display: none; }
html[data-theme=dark] .logo2img.lt { display: none; }
html[data-theme=dark] .logo2img.dk { display: block; }
.auth-logo { height: 40px; width: auto; display: block; }
@media (max-width: 760px) { .logo2img.lt, html[data-theme=dark] .logo2img.dk { display: none; } .logo2ico { display: block; height: 30px; width: 30px; } }
.v2-svc { margin-top: 14px; border: 2px solid #bfdbfe; background: #eff6ff; border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.v2-svc .v2-offer { border-color: #bfdbfe; }
.v2-bolt { width: 56px; height: 56px; border-radius: 12px; background: #dbeafe; display: grid; place-items: center; font-size: 26px; }
.v2-svc .v2-price { color: var(--blue); }
.v2-svc .v2-add .off { background: var(--blue); }
.v2-svcnote { color: var(--ink-2); font-size: 13px; }
.v2-bolt { color: var(--blue); }
.smsmeter { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 6px; }
.smswarn { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--amber); font-weight: 600; }
.savings { margin: 18px 0 6px; border-color: #bbf7d0; background: linear-gradient(180deg, #f0fdf4, var(--card)); }
.savings h2 { margin: 0 0 12px; }
.svgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.svgrid .li { display: flex; flex-direction: column; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.svgrid .li span { font-size: 13px; color: var(--ink-2); }
.svgrid .li b { font-size: 22px; }
.svgrid .li small { color: var(--ink-2); font-size: 12px; }
.svtot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: var(--green-soft); }
.svtot b { font-size: 22px; color: var(--green-dark); }
html[data-theme=dark] .savings { background: var(--card); border-color: #1f5a33; }
html[data-theme=dark] .svtot { background: #12301d; }
html[data-theme=dark] .svtot b { color: #86efac; }
.gsearch2 { position: relative; }
.gres2 { position: absolute; top: calc(100% + 6px); left: 0; right: 0; min-width: 340px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(15,23,42,.14); padding: 6px; z-index: 60; max-height: 70vh; overflow: auto; }
.gres2 h5 { margin: 6px 8px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.gres2 a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 14px; }
.gres2 a:hover { background: var(--green-soft); text-decoration: none; }
.gres2 a small { display: block; color: var(--ink-2); font-size: 12px; }
.gres2 .gall { justify-content: center; color: var(--green); font-weight: 600; border-top: 1px solid var(--line); border-radius: 0; margin-top: 4px; }
.gres2 .gnone { margin: 8px 10px; color: var(--ink-2); font-size: 14px; }
.repwrap { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; }
.repwrap[hidden] { display: none; }
.repmodal { background: var(--card); border-radius: 14px; padding: 20px; width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.repmodal h3 { margin: 0; }
.repctx { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 12px; color: var(--ink-2); }
.repctx div { white-space: pre-wrap; margin-top: 4px; font-family: ui-monospace, Menlo, monospace; }
.permgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 2px 14px; margin-bottom: 6px; }
.permgrid .check { margin: 0; }
.permnote { color: var(--amber) !important; }
.addrwarn { display: flex; flex-direction: column; gap: 8px; border: 1px solid #fca5a5; background: var(--red-soft); color: #7f1d1d; border-radius: var(--radius); padding: 12px 14px; margin: 0 0 14px; }
.addrfix { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }
.addrfix select { flex: 1; min-width: 220px; margin: 0; }
html[data-theme=dark] .addrwarn { background: #3a1414; border-color: #7f1d1d; color: #fecaca; }
.quotes { margin: 4px 0 10px; }
.couriersq { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.couriersq label { display: grid; grid-template-columns: 20px 1fr auto; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; cursor: pointer; margin: 0; font-weight: 500; }
.couriersq label small { display: block; color: var(--ink-2); font-size: 12px; font-weight: 400; }
.couriersq label.best { border-color: var(--green); background: var(--green-soft); }
.couriersq label.na { opacity: .6; }
.couriersq input { margin: 0; }
html[data-theme=dark] .couriersq label.best { background: #12301d; }
.couriersq h5 { margin: 6px 0 0; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.adsetup ol { margin: 6px 0 8px; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.adsetup .copy { display: flex; gap: 8px; margin-top: 6px; }
.adsetup .copy input { flex: 1; margin: 0; font-size: 12px; }
.adrep tr.adbad td:first-child { box-shadow: inset 4px 0 0 var(--red); }
.adrep tr.adgood td:first-child { box-shadow: inset 4px 0 0 var(--green); }
.adrep td.num { white-space: nowrap; }
.btn[hidden] { display: none !important; }
.oprday { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.oprday input { margin: 0; width: auto; }
.oprtab th.num { white-space: normal; min-width: 70px; }
.oprtab tfoot td { border-top: 2px solid var(--line); }

/* Обединяване на поръчки в 1 пратка */
.flash-info { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
html[data-theme=dark] .flash-info { background: #10213f; border-color: #1e3a8a; color: #bfdbfe; }
.mergeban, .mergedone { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.mergeban a:not(.btn), .mergedone a { color: inherit; text-decoration: underline; }
.mergebox { border: 1px solid #bfdbfe; background: #eff6ff; border-radius: var(--radius); padding: 14px 16px; margin: 0 0 14px; display: flex; flex-direction: column; gap: 10px; }
html[data-theme=dark] .mergebox { background: #10213f; border-color: #1e3a8a; }
.mergebox h3 { margin: 0; font-size: 16px; }
.mergebox > p { margin: 0; }
.mergeone { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; margin: 0; }
.mergehead { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mergeres { font-size: 14px; }
.mergeone .chk { display: flex; gap: 8px; align-items: center; margin: 0; font-weight: 500; }
.mergeone .chk input { width: auto; margin: 0; }
.mergeaddr { display: flex; flex-direction: column; gap: 6px; border: 1px solid #fde68a; background: var(--amber-soft); border-radius: 8px; padding: 8px 10px; }
.mergeone .btn { align-self: flex-start; }

/* Статуси обратно към магазина (Webixty) */
.hooksteps { display: grid; gap: 8px; margin: 10px 0 14px; padding-left: 20px; }
.hooksteps code { word-break: break-all; }
.hookform { display: grid; gap: 12px; max-width: 760px; }
.hookform label { display: grid; gap: 6px; margin: 0; }
.hookform label.chk { display: flex; align-items: center; gap: 8px; }
.hookform label.chk input { width: auto; margin: 0; }
.hookform .row { display: flex; gap: 8px; flex-wrap: wrap; }

/* Поръчка: всяка секция с цвят и иконка, за да се вижда къде свършва едната и започва другата */
.osec { --sc: #64748b; padding-top: 0; border-top: 4px solid var(--sc); overflow: hidden; }
.osec > h2:first-child, .osec > .panelhead:first-child { margin: 0 -20px 16px; padding: 12px 20px; background: color-mix(in srgb, var(--sc) 9%, var(--card)); border-bottom: 1px solid color-mix(in srgb, var(--sc) 22%, var(--line)); }
.osec > .panelhead:first-child h2, .osec > h2:first-child { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.osec > .panelhead:first-child h2::before, .osec > h2:first-child::before { content: var(--si); flex: none; width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center; font-size: 15px; background: color-mix(in srgb, var(--sc) 18%, var(--card)); }
.osec-items  { --sc: #7c3aed; --si: "🛒"; }
.osec-client { --sc: #2563eb; --si: "👤"; }
.osec-act    { --sc: #15803d; --si: "⚡"; }
.osec-ship   { --sc: #ea580c; --si: "🚚"; }
.osec-sms    { --sc: #0891b2; --si: "💬"; }
.osec-hist   { --sc: #64748b; --si: "🕘"; }
.osec-other  { --sc: #9333ea; --si: "📋"; }
.osec .dl dt { color: var(--ink-2, #64748b); }
.notebox { border: 1px dashed color-mix(in srgb, var(--sc) 35%, var(--line)); border-radius: 12px; padding: 12px; margin-bottom: 14px; background: color-mix(in srgb, var(--sc) 4%, var(--card)); }
.notebox label { margin: 0; }
.notebar { display: flex; justify-content: flex-end; margin-top: 8px; }

/* Интеграции: затворени секции, отваря се само избраната */
.accintro { margin-top: -6px; }
.accgrp { margin: 22px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
.panel.acc { padding: 0; margin-bottom: 10px; overflow: hidden; }
.acchead { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 12px; padding: 16px 20px; cursor: pointer; }
.acchead:hover { background: color-mix(in srgb, var(--ink) 4%, var(--card)); }
.acchead:focus-visible { outline: 2px solid var(--accent, #1c6b35); outline-offset: -2px; }
.acct { flex: 1; min-width: 0; display: grid; gap: 2px; }
.acct b { font-size: 16px; }
.acct small { color: var(--ink-2); font-size: 13px; }
.accchev { font-size: 22px; line-height: 1; color: var(--ink-2); transition: transform .15s; }
.acc.open .accchev { transform: rotate(90deg); }
.accbody { display: none; padding: 4px 20px 20px; border-top: 1px solid var(--line); }
.acc.open .accbody { display: block; }
.acc.open { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent, #1c6b35) 35%, transparent), var(--shadow); }
.wxsync { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.wxsync h3 { margin: 0 0 8px; }
.wxmap { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px 16px; margin-bottom: 8px; }
.wxmap label { display: grid; gap: 4px; margin: 0; }
.wxmap label span { font-size: 13px; color: var(--ink-2); }

/* Логата на платформите и куриерите */
.bicon { width: 22px; height: 22px; border-radius: 6px; object-fit: contain; vertical-align: middle; margin-right: 8px; background: #fff; box-shadow: 0 0 0 1px var(--line); flex: none; }
.bicon.wide { width: auto; max-width: 70px; padding: 2px 4px; }
.bicon-txt { display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.pbadge { display: inline-flex; align-items: center; white-space: nowrap; font-weight: 600; }
.ob-logo { width: 34px; height: 34px; border-radius: 9px; margin: 0 4px 0 0; }
.accgrp .bicon { width: 18px; height: 18px; margin-right: 6px; }
.acct b .bicon { width: 24px; height: 24px; }
.badge .bicon { width: 16px; height: 16px; border-radius: 4px; margin-right: 5px; box-shadow: none; }
.couriersq .bicon { width: 20px; height: 20px; }
.ob-step { align-items: center; }
.smspause { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.smspause > div { display: grid; gap: 2px; min-width: 0; flex: 1; }
.smspause.on { border-color: #f59e0b; background: color-mix(in srgb, #f59e0b 12%, var(--card)); }
.catchup { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 12px 0; padding: 10px 14px; border-radius: 10px; background: color-mix(in srgb, #f59e0b 12%, var(--card)); border: 1px solid color-mix(in srgb, #f59e0b 40%, var(--line)); }
.smsbillk { grid-template-columns: minmax(0, 420px); margin-bottom: 14px; }
.notifyall summary { cursor: pointer; } .notifyall form { margin-top: 10px; }
