/*
 * Общий стиль кабинета (по макетам 10.10.2026): зелёный акцент, белые карточки со скруглением,
 * тонкие рамки вместо теней, крупные заголовки, «таблетки» статусов.
 * Подключается последним в layouts/cabinet — перекрывает старые стили. Префикс body — чтобы быть сильнее собранного CSS.
 */
:root {
    --ui-g: #2b9c9a;        /* основной бирюзовый (как на образце) */
    --ui-g-dark: #23807e;
    --ui-g-soft: #e2f2f2;   /* фон иконок, подсказок */
    --ui-red: #b91c1c;
    --ui-red-soft: #fee2e2;
    --ui-amber-soft: #fef3c7;
    --ui-line: #e5e7eb;
    --ui-muted: #6b7280;
    --ui-text: #111827;
    --ui-bg: #f5f7fa;
    --ui-radius: 14px;
}

body { background: var(--ui-bg) !important; color: var(--ui-text); font-family: Inter, "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; }

/* шапка */
body > header { background: #fff !important; border-bottom: 1px solid var(--ui-line) !important; box-shadow: none !important; }

/* хлебные крошки */
body .breadcrumbs { font-size: 15px; color: var(--ui-muted); }
body .breadcrumbs a { color: var(--ui-g); }
body .breadcrumbs a:hover { text-decoration: underline; }
body main hr.my-5 { border-color: var(--ui-line); margin: 14px 0 18px; }

/* заголовок страницы (h1 внутри контента) */
body .ui-title { font-size: 28px; font-weight: 800; line-height: 1.15; margin-bottom: 16px; }
body .ui-sub { color: var(--ui-muted); margin-top: -10px; margin-bottom: 16px; }

/* карточки */
body .card:not(.card-link):not([class*="bg-"]) { background: #fff; border: 1px solid var(--ui-line); border-radius: var(--ui-radius); box-shadow: none; }

/* большие кнопки разделов на главных */
/* цвет кнопки берётся из её класса (bg-blue-700 и т.п.), без класса — зелёный */
body a.card-link { color: #fff !important; display: flex; align-items: center; justify-content: center; min-height: 72px; border: 0; border-radius: var(--ui-radius);
    font-size: 17px; font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,.06); transition: transform .12s, filter .12s; }
body a.card-link:hover { transform: translateY(-1px); filter: brightness(1.07); }

/* кнопки */
body .btn { border-radius: 10px; box-shadow: none; font-weight: 600; border: 1px solid transparent; transition: filter .12s, background .12s; }
body .btn:hover { filter: brightness(1.06); }
body .btn-sm { border-radius: 8px; }
body .btn-primary { background: var(--ui-g) !important; color: #fff !important; }
body .btn-success { background: var(--ui-g-dark) !important; color: #fff !important; }
body .btn-danger { background: #dc2626 !important; color: #fff !important; }
body .btn-secondary { background: #fff !important; color: #374151 !important; border-color: var(--ui-line) !important; }

/* поля ввода */
body main input[type=text], body main input[type=number], body main input[type=date], body main input[type=search],
body main input[type=password], body main input[type=tel], body main input[type=email], body main select, body main textarea {
    border: 1px solid #d1d5db; border-radius: 10px; background: #fff; padding: 8px 12px; min-height: 42px; transition: border-color .12s, box-shadow .12s;
}
body main textarea { min-height: 80px; }
body main input:focus, body main select:focus, body main textarea:focus { outline: none; border-color: var(--ui-g); box-shadow: 0 0 0 3px rgba(43,156,154,.18); }
body main input[type=checkbox], body main input[type=radio] { accent-color: var(--ui-g); width: 16px; height: 16px; }
body main label { color: #374151; }

/* ссылки */
body main a.link { color: var(--ui-g); font-weight: 600; }
body main a.link:hover { text-decoration: underline; }

/* таблицы: белая карточка, светлая шапка, тонкие линии */
body main table.table-sm { background: #fff; border-collapse: separate; border-spacing: 0; border: 1px solid var(--ui-line); border-radius: 12px; overflow: hidden; width: 100%; }
body main table.table-sm th { background: #f9fafb; color: #4b5563; font-weight: 700; font-size: 14px; padding: 11px 12px; border: 0; border-bottom: 1px solid var(--ui-line); }
body main table.table-sm td { padding: 10px 12px; font-size: 14px; border: 0; border-bottom: 1px solid #f1f5f9; }
body main table.table-sm tr:last-child td { border-bottom: 0; }
body main table.table-sm tr:hover td { background-color: #f9fafb; }

/* уведомления после действий */
body .alert { border-radius: 12px; border: 1px solid; padding: 12px 16px; font-weight: 600; }
body .alert-success { background: var(--ui-g-soft); border-color: #bbf7d0; color: var(--ui-g-dark); }
body .alert-danger, body .alert-error { background: var(--ui-red-soft); border-color: #fecaca; color: var(--ui-red); }

/* «таблетки» статусов — можно использовать на любой странице */
body .ui-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; font-weight: 700; font-size: 14px; white-space: nowrap; }
body .ui-pill.ok { background: #dcfce7; color: var(--ui-g-dark); }
body .ui-pill.bad { background: var(--ui-red-soft); color: var(--ui-red); }
body .ui-pill.warn { background: var(--ui-amber-soft); color: #b45309; }
body .ui-pill.muted { background: #f3f4f6; color: #374151; }

/* меню разделов на главных (группы с иконками) */
body .ui-menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
body .ui-menu .group { background: #fff; border: 1px solid var(--ui-line); border-radius: var(--ui-radius); padding: 16px 18px 8px; }
body .ui-menu .group h3 { font-size: 13px; font-weight: 800; letter-spacing: .06em; color: #4b5563; text-transform: uppercase; margin-bottom: 8px; }
body .ui-menu a.item { display: flex; align-items: center; gap: 12px; padding: 9px 0; font-weight: 600; color: var(--ui-text); }
body .ui-menu a.item .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--ui-g-soft); color: var(--ui-g); display: inline-flex; align-items: center; justify-content: center; flex: none; }
body .ui-menu a.item .ic svg { width: 19px; height: 19px; }
body .ui-menu a.item .go { margin-left: auto; color: #9ca3af; }
body .ui-menu a.item:hover { color: var(--ui-g); }
body .ui-menu a.item .badge { background: var(--ui-red); color: #fff; border-radius: 999px; font-size: 12px; font-weight: 800; padding: 0 7px; margin-left: 6px; }

/* полоса уведомления (новые клиенты и т.п.) */
body .ui-banner { display: flex; align-items: center; gap: 10px; border-radius: var(--ui-radius); padding: 14px 18px; border: 1px solid; font-weight: 700; }
body .ui-banner.red { background: #fdecec; border-color: #f8caca; color: var(--ui-red); }
body .ui-banner.green { background: var(--ui-g-soft); border-color: #c6ead2; color: var(--ui-g-dark); }
body .ui-banner .act { margin-left: auto; background: #fff; border: 1px solid currentColor; border-radius: 10px; padding: 6px 14px; font-weight: 600; font-size: 14px; }

/* пагинация */
body nav[role=navigation] a, body nav[role=navigation] span[aria-current] span { border-radius: 8px !important; }

@media (max-width: 700px) {
    body .ui-title { font-size: 22px; }
    body main table.table-sm.m-cards { border: 0; background: transparent; }
    body main table.table-sm.m-cards tr { background: #fff; }
}
body summary.ui-banner::-webkit-details-marker { display: none; }

/* рабочие плитки на главных (оператор и др.): белая карточка, иконка, крупная подпись, счётчик */
body .ui-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
body a.ui-tile { position: relative; display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--ui-line); border-radius: var(--ui-radius);
    padding: 18px 18px; min-height: 84px; font-size: 18px; font-weight: 700; color: var(--ui-text); transition: border-color .12s, transform .12s, box-shadow .12s; }
body a.ui-tile:hover { border-color: var(--ui-g); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.06); }
body a.ui-tile .ic { width: 46px; height: 46px; border-radius: 12px; background: var(--ui-g-soft); color: var(--ui-g); display: inline-flex; align-items: center; justify-content: center; flex: none; }
body a.ui-tile .ic svg { width: 24px; height: 24px; }
body a.ui-tile.main { background: var(--ui-g); border-color: var(--ui-g); color: #fff; }
body a.ui-tile.main .ic { background: rgba(255,255,255,.18); color: #fff; }
body a.ui-tile .cnt { position: absolute; top: -8px; right: -8px; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px; background: var(--ui-red); color: #fff;
    font-size: 14px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 3px var(--ui-bg); }
body .ui-banner.orange { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
body .ui-banner.pink { background: #fdf2f8; border-color: #fbcfe8; color: #9d174d; }
body a.ui-banner:hover { filter: brightness(.98); }

/* ===== каркас «вариант А»: тёмная боковая панель + верхняя строка ===== */
:root { --sb-w: 236px; --sb-bg: #1c2533; --sb-bg2: #243042; --sb-text: #c9d3df; --sb-active: #2bbdd0; --sb-line: #2c384b; }
body.has-sb { display: block; }
.sb { position: fixed; top: 0; left: 0; bottom: 0; width: var(--sb-w); background: var(--sb-bg); color: var(--sb-text); display: flex; flex-direction: column; z-index: 40; }
.sb-logo { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--sb-line); }
.sb-logo img { height: 36px; border-radius: 6px; }
.sb-close { display: none; color: var(--sb-text); font-size: 18px; }
.sb nav { flex: 1; overflow-y: auto; padding: 10px; }
.sb-sec { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #7c8aa0; margin: 16px 10px 6px; }
.sb nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px; margin-bottom: 2px; font-size: 14px; color: var(--sb-text); }
.sb nav a svg { width: 18px; height: 18px; flex: none; }
.sb nav a:hover { background: var(--sb-bg2); color: #fff; }
.sb nav a.on { background: var(--sb-active); color: #fff; font-weight: 600; }
.sb nav a .b { margin-left: auto; background: #e23d3d; color: #fff; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 0 7px; line-height: 18px; }
.sb-foot { padding: 12px 16px; font-size: 11px; color: #7c8aa0; border-top: 1px solid var(--sb-line); }
.app-main { margin-left: var(--sb-w); min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; padding: 10px 24px; background: #fff; border-bottom: 1px solid var(--ui-line); }
.sb-burger { display: none; font-size: 22px; color: #374151; }
.tb-title { min-width: 0; }
.tb-title h1 { font-size: 20px; font-weight: 800; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-title .breadcrumbs { font-size: 13px; color: var(--ui-muted); margin-top: 1px; }
.tb-title .breadcrumbs .sep { margin: 0 5px; color: #c0c6cf; }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.tb-search { display: flex; align-items: center; gap: 8px; width: 280px; padding: 0 12px; border: 1px solid var(--ui-line); border-radius: 8px; background: #f9fafb; color: var(--ui-muted); }
.tb-search svg { width: 16px; height: 16px; flex: none; }
body .tb-search input { border: 0 !important; background: transparent !important; box-shadow: none !important; min-height: 36px !important; padding: 0 !important; width: 100%; outline: none; }
.tb-user { display: flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }
.tb-user .av { width: 30px; height: 30px; border-radius: 999px; background: var(--ui-g); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.tb-user .nm { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.tb-user .out { color: #dc2626; font-weight: 600; margin-left: 6px; }
.app-content { padding: 22px 24px 40px; }
.sb-backdrop { display: none; }
@media (max-width: 1000px) {
    .sb { transform: translateX(-100%); transition: transform .2s; }
    body.sb-open .sb { transform: none; }
    body.sb-open .sb-backdrop { display: block; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.35); z-index: 35; }
    .sb-close { display: block; }
    .app-main { margin-left: 0; }
    .sb-burger { display: block; }
    .tb-search { display: none; }
    .tb-user .nm { display: none; }
    .topbar { padding: 10px 14px; }
    .app-content { padding: 16px 12px 40px; }
}

/* ===== оператор: ТСД на Android (узкий экран, управление пальцем) ===== */
/* панель всегда под ☰ — экран не тратится на меню */
body.role-operator .sb { transform: translateX(-100%); transition: transform .2s; width: 86vw; max-width: 320px; }
body.role-operator.sb-open .sb { transform: none; }
body.role-operator.sb-open .sb-backdrop { display: block; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.35); z-index: 35; }
body.role-operator .sb-close { display: block; font-size: 22px; padding: 4px 8px; }
body.role-operator .app-main { margin-left: 0; }
body.role-operator .sb-burger { display: block; font-size: 26px; padding: 2px 6px; }
body.role-operator .sb nav a { padding: 14px 14px; font-size: 17px; }
body.role-operator .sb nav a svg { width: 22px; height: 22px; }
body.role-operator .sb nav a .b { font-size: 14px; line-height: 22px; padding: 0 9px; }
body.role-operator .tb-search { display: none; }
body.role-operator .tb-user .nm { display: none; }
body.role-operator .topbar { padding: 8px 12px; gap: 10px; }
body.role-operator .tb-title h1 { font-size: 18px; }
body.role-operator .tb-title .breadcrumbs { display: none; }
body.role-operator .app-content { padding: 12px 10px 40px; max-width: none; }
/* плитки: одна колонка, крупно */
body.role-operator .ui-tiles { grid-template-columns: 1fr; gap: 10px; }
body.role-operator a.ui-tile { min-height: 68px; font-size: 19px; padding: 14px 16px; }
body.role-operator a.ui-tile .ic { width: 44px; height: 44px; }
body.role-operator a.ui-tile .cnt { top: 50%; right: 14px; transform: translateY(-50%); min-width: 34px; height: 34px; font-size: 16px; box-shadow: none; }
body.role-operator .ui-banner { font-size: 16px; padding: 14px; flex-wrap: wrap; }
body.role-operator .ui-banner .act { margin-left: 0; }
/* поля и кнопки под палец и сканер */
body.role-operator main input[type=text], body.role-operator main input[type=number], body.role-operator main input[type=search], body.role-operator main select { min-height: 48px; font-size: 17px; }
body.role-operator .btn { min-height: 44px; padding-left: 16px; padding-right: 16px; font-size: 16px; }
body.role-operator .btn-sm { min-height: 38px; font-size: 15px; }
/* на широком экране (компьютер на складе) плитки в 2 колонки */
@media (min-width: 900px) { body.role-operator .ui-tiles { grid-template-columns: 1fr 1fr; } }

/* ===== списки: фильтры одной карточкой, строки белые с цветной полоской статуса, аккуратные кнопки ===== */
/* фильтры: ряд маленьких карточек → одна белая карточка */
body main div.flex.flex-wrap:has(> .card.px-4) { background: #fff; border: 1px solid var(--ui-line); border-radius: var(--ui-radius); padding: 14px 16px; gap: 12px 20px !important; align-items: flex-end; }
body main div.flex.flex-wrap > .card.px-4 { border: 0 !important; padding: 0 !important; background: transparent !important; box-shadow: none !important; border-radius: 0; }
body main div.flex.flex-wrap > .card.px-4 > br:first-child { display: none; }
body main div.flex.flex-wrap > .card.px-4 label { font-size: 13px; color: var(--ui-muted); font-weight: 600; }
body main .flex.justify-between > div:has(> form) { flex: 1; }
body main hr.mb-5.mt-3, body main hr.my-5 { display: none; }
/* строки: вместо заливки всей строки — белая строка и цветная полоска слева */
/* мягкие цвета статусов (получено / упаковано / отправлено) + полоска слева */
body main table.table-sm tr[class*="bg-yellow"] > td, body main table.table-sm tr[class*="bg-orange"] > td { background-color: #fdefc4 !important; }
body main table.table-sm tr[class*="bg-green"] > td { background-color: #d6f3e0 !important; }
body main table.table-sm tr[class*="bg-sky"] > td, body main table.table-sm tr[class*="bg-blue"] > td { background-color: #d4e8fc !important; }
body main table.table-sm tr[class*="bg-red"] > td { background-color: #fadada !important; }
body main table.table-sm tr[class*="bg-"]:hover > td { filter: brightness(.97); }
body main table.table-sm tr[class*="bg-yellow"] > td:first-child, body main table.table-sm tr[class*="bg-orange"] > td:first-child { box-shadow: inset 4px 0 0 #f5a00f; }
body main table.table-sm tr[class*="bg-green"] > td:first-child { box-shadow: inset 4px 0 0 #2ea56a; }
body main table.table-sm tr[class*="bg-sky"] > td:first-child, body main table.table-sm tr[class*="bg-blue"] > td:first-child { box-shadow: inset 4px 0 0 #2196f3; }
body main table.table-sm tr[class*="bg-red"] > td:first-child { box-shadow: inset 4px 0 0 #e23d3d; }
body main table.table-sm td.text-gray-300 { color: #9ca3af; font-size: 12px; }
/* кнопки в таблицах: светлые, не кричат */
body main table .btn-sm { box-shadow: none !important; padding: 4px 10px; font-size: 13px; border-radius: 8px; }
body main table .btn-sm.btn-primary { background: var(--ui-g-soft) !important; color: var(--ui-g-dark) !important; }
body main table .btn-sm.btn-danger { background: #fee2e2 !important; color: #b91c1c !important; }
body main table .btn-sm.bg-white { border-color: var(--ui-line) !important; }
/* «Показано 1 - 15 из 674» и пагинация */
body main nav[role=navigation] { margin: 4px 0; }

/* видимые линии таблиц: сетка по ячейкам */
body main table.table-sm th, body main table.table-sm td { border-right: 1px solid #c9d1da !important; border-bottom: 1px solid #c9d1da !important; }
body main table.table-sm th:last-child, body main table.table-sm td:last-child { border-right: 0 !important; }
body main table.table-sm tr:last-child > td { border-bottom: 0 !important; }

/* текст в таблицах плотнее и темнее — лучше читается на цветных строках */
body main table.table-sm td { font-weight: 500; color: #111827; font-size: 14.5px; }
body main table.table-sm th { color: #1f2937; font-weight: 700; }
body main table.table-sm td.text-gray-300 { color: #6b7280 !important; font-weight: 500; }

/* печать: в новом каркасе main лежит внутри .app-main — показываем обёртку, прячем панель и верхнюю строку */
@media print {
    body > .app-main { display: block !important; margin: 0 !important; }
    body > .sb, body > .sb-backdrop, .topbar { display: none !important; }
    main.app-content { padding: 0 !important; }
    main.app-content > *:not(#print-area) { display: none !important; }
}

/* таблицы в стиле макета (накладные клиентов и др.): по центру и с чёткой сеткой, как остальные */
body main table.cb-table th, body main table.cb-table td, body main table.cb-table .r { text-align: center !important; padding-left: 12px !important; padding-right: 12px !important; }
body main table.cb-table th, body main table.cb-table td { border-right: 1px solid #c9d1da; border-bottom: 1px solid #c9d1da; }
body main table.cb-table th:last-child, body main table.cb-table td:last-child { border-right: 0; }
body main table.cb-table td { font-weight: 500; color: #111827; }
body main table.table-sm { border-color: #c9d1da; }

/* этикетка мешка (Упаковки → «Печать»): на весь лист, размеры от бумаги, а не в пикселях */
@media print {
    #print-area #code_number, #print-area #mixed_title { line-height: 1.05; }
    body main.app-content > #print-area { position: static !important; background: #fff !important; height: 96vh; display: flex !important; flex-direction: column; justify-content: center; align-items: center; gap: 2vh; }
    #print-area #code_number { font-size: 17vw !important; letter-spacing: .02em !important; }
    #print-area #mixed_title { font-size: 9vw !important; }
    #print-area #mixed_codes { font-size: 6vw !important; }
    #print-area #barcode { display: block; width: 92vw !important; height: 42vh !important; margin: 0 auto; }
}

/* ===== цвета строк: вариант 1 «Чистый» — строки белые, статус полоской слева (на телефоне — у карточки) ===== */
body main table.table-sm tr[class*="bg-"] > td { background-color: #fff !important; }
body main table.table-sm tr[class*="bg-"]:hover > td { background-color: #f8fafc !important; filter: none; }
body main table.table-sm tr[class*="bg-yellow"] > td:first-child, body main table.table-sm tr[class*="bg-orange"] > td:first-child { box-shadow: inset 5px 0 0 #f59e0b; }
body main table.table-sm tr[class*="bg-green"] > td:first-child { box-shadow: inset 5px 0 0 #10b981; }
body main table.table-sm tr[class*="bg-sky"] > td:first-child, body main table.table-sm tr[class*="bg-blue"] > td:first-child { box-shadow: inset 5px 0 0 #6366f1; }
body main table.table-sm tr[class*="bg-red"] > td:first-child { box-shadow: inset 5px 0 0 #ef4444; }
@media (max-width: 700px) {
    body main table.m-cards tr[class*="bg-"] > td:first-child { box-shadow: none !important; }
    body main table.m-cards tr[class*="bg-yellow"], body main table.m-cards tr[class*="bg-orange"] { border-left: 6px solid #f59e0b !important; }
    body main table.m-cards tr[class*="bg-green"] { border-left: 6px solid #10b981 !important; }
    body main table.m-cards tr[class*="bg-sky"], body main table.m-cards tr[class*="bg-blue"] { border-left: 6px solid #6366f1 !important; }
    body main table.m-cards tr[class*="bg-red"] { border-left: 6px solid #ef4444 !important; }
}

/* ===== цвета строк: вариант 2 «Пастель» — вся строка мягким цветом (перекрывает вариант 1 выше) ===== */
body main table.table-sm tr[class*="bg-yellow"] > td, body main table.table-sm tr[class*="bg-orange"] > td { background-color: #fff5a8 !important; }
body main table.table-sm tr[class*="bg-green"] > td { background-color: #d9f5ea !important; }
body main table.table-sm tr[class*="bg-sky"] > td, body main table.table-sm tr[class*="bg-blue"] > td { background-color: #b9ddf7 !important; }
body main table.table-sm tr[class*="bg-red"] > td { background-color: #fde2e2 !important; }
body main table.table-sm tr[class*="bg-"] > td:first-child { box-shadow: none; }
body main table.table-sm tr[class*="bg-"]:hover > td { filter: brightness(.97); }
@media (max-width: 700px) {
    body main table.m-cards tr[class*="bg-yellow"], body main table.m-cards tr[class*="bg-orange"] { background: #fff5a8 !important; border-left: 1px solid #d1d5db !important; }
    body main table.m-cards tr[class*="bg-green"] { background: #d9f5ea !important; border-left: 1px solid #d1d5db !important; }
    body main table.m-cards tr[class*="bg-sky"], body main table.m-cards tr[class*="bg-blue"] { background: #b9ddf7 !important; border-left: 1px solid #d1d5db !important; }
    body main table.m-cards tr[class*="bg-red"] { background: #fde2e2 !important; border-left: 1px solid #d1d5db !important; }
}

/* кнопки в строках таблиц: насыщенные, чтобы были видны на цветных (пастельных) строках */
body main table .btn-sm.btn-primary { background: #2b9c9a !important; color: #fff !important; }
body main table .btn-sm.btn-danger { background: #dc2626 !important; color: #fff !important; }
body main table .btn-sm.btn-primary:hover, body main table .btn-sm.btn-danger:hover { filter: brightness(1.08); }

/* карточки на телефоне/ТСД: линии между строками карточки и чёткая рамка — чтобы не сливалось */
@media (max-width: 700px) {
    body main table.m-cards tr { border: 1px solid #b9c2cd !important; border-radius: 12px; padding: 4px 12px !important; margin-bottom: 10px; }
    body main table.m-cards td { border-bottom: 1px solid #cfd6de !important; padding-top: 7px !important; padding-bottom: 7px !important; }
    body main table.m-cards td:last-child, body main table.m-cards td.m-empty + td:last-child { border-bottom: 0 !important; }
    body main table.m-cards td::before { top: 8px; color: #4b5563; font-weight: 600; }
}
/* карточки со своим цветом (шапка «Добавить» зелёная, «Удалить» красная, уведомления) — цвет сохраняется, только скругление и рамка */
body .card[class*="bg-"]:not(.card-link) { border-radius: var(--ui-radius); box-shadow: none; }

/* страховка: цвета кнопок, которых может не быть в собранном CSS (иначе кнопка прозрачная с белым текстом) */
body .bg-blue-600 { background-color: #2563eb; } body .bg-blue-700 { background-color: #1d4ed8; }
body .bg-indigo-700 { background-color: #4338ca; } body .bg-teal-700 { background-color: #0f766e; }
body .bg-green-700 { background-color: #15803d; } body .bg-red-700 { background-color: #b91c1c; }
body .bg-orange-600 { background-color: #ea580c; } body .bg-yellow-700 { background-color: #a16207; }
body .hover\:bg-blue-800:hover { background-color: #1e40af; }

/* ===== общие блоки списков: сводка-карточки и вкладки статусов ===== */
body .ui-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 16px; }
body .ui-stat { background: #fff; border: 1px solid var(--ui-line); border-radius: 12px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
body .ui-stat .t { color: var(--ui-muted); font-size: 13px; }
body .ui-stat .v { font-size: 24px; font-weight: 800; margin-top: 3px; white-space: nowrap; color: var(--ui-text); }
body .ui-stat .d { font-size: 12px; font-weight: 600; color: var(--ui-muted); margin-top: 2px; }
body .ui-stat .ic { width: 40px; height: 40px; border-radius: 10px; color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
body .ui-stat .ic svg { width: 20px; height: 20px; }
body .ui-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
body .ui-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border: 1px solid var(--ui-line); border-radius: 999px; font-weight: 700; background: #fff; color: #374151; }
body .ui-tabs a .n { background: #f3f4f6; border-radius: 999px; padding: 0 7px; font-size: 13px; }
body .ui-tabs a.on { background: var(--ui-g); border-color: var(--ui-g); color: #fff; }
body .ui-tabs a.on .n { background: rgba(255,255,255,.25); }
body .ui-tabs .r { margin-left: auto; color: var(--ui-muted); }
body.role-operator .ui-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
body.role-operator .ui-stat .v { font-size: 20px; }
body.role-operator .ui-stat .ic { display: none; }
/* сводка-карточка как кнопка-фильтр */
body a.ui-stat.link { cursor: pointer; transition: border-color .12s, box-shadow .12s; }
body a.ui-stat.link:hover { border-color: var(--ui-g); }
body a.ui-stat.on { border: 2px solid var(--ui-g); box-shadow: 0 0 0 3px rgba(43,156,154,.15); background: #f2fbfa; }

/* ===== ТСД оператора: крупное поле скана + свёрнутые фильтры (упаковки, все треки) ===== */
.op-scan { background: #fff; border: 1px solid var(--ui-line); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.op-scan-l { display: block; font-weight: 700; color: #374151; margin-bottom: 8px; font-size: 15px; }
.op-scan-row { display: flex; gap: 8px; }
body main .op-scan-row input { flex: 1; min-width: 0; min-height: 52px !important; font-size: 20px !important; font-weight: 700; border: 2px solid var(--ui-g) !important; }
.op-scan-row .btn { min-height: 52px; padding: 0 18px; }
.op-create { display: flex; align-items: center; justify-content: center; margin-top: 10px; min-height: 52px; border-radius: 12px; background: #ea580c; color: #fff !important; font-size: 18px; font-weight: 800; }
.op-more { margin-top: 10px; }
.op-more summary { cursor: pointer; font-weight: 700; color: var(--ui-g-dark); padding: 6px 0; list-style: none; }
.op-more summary::-webkit-details-marker { display: none; }
.op-more-in { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
body main .op-more-in select, body main .op-more-in input { width: 100%; }
/* верхняя строка: переключатель языка не переносится (中文 в одну строку) */
.topbar .lang-switch, .topbar [class*="lang"] a, .topbar [class*="lang"] span { white-space: nowrap; }
body.role-operator .tb-title h1 { font-size: 17px; }
.rts-top { display: flex; flex-direction: column; }

/* колокольчик уведомлений клиента */
.tb-bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; color: inherit; }
.tb-bell:hover { background: rgba(0,0,0,.05); }
.tb-bell svg { width: 22px; height: 22px; }
.tb-bell-n { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #dc2626; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
