/* App styles on top of Materio */
.app-brand-logo img { max-height: 34px; max-width: 150px; }
.auth-logo img { max-height: 56px; max-width: 220px; }

/* tables */
.table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.table th.sortable::after { content: '\2195'; opacity: .3; margin-left: .25rem; font-size: .8em; }
.table th.sortable[data-dir="asc"]::after { content: '\25B2'; opacity: 1; }
.table th.sortable[data-dir="desc"]::after { content: '\25BC'; opacity: 1; }
.table td, .table th { vertical-align: middle; }
.table-loading { opacity: .5; pointer-events: none; }
.text-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.cursor-pointer { cursor: pointer; }
.qty-input { width: 90px; }
.code-input { letter-spacing: .5em; font-size: 1.5rem; text-align: center; }
.product-search-results { max-height: 280px; overflow-y: auto; }

/* filter bar (v5 createFilterSelect) */
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; }
.filter-bar .form-control, .filter-bar .form-select { min-width: 130px; }
.filter-bar .filter-field { display: flex; flex-direction: column; }
.filter-bar .filter-field label { font-size: .75rem; text-transform: uppercase; color: var(--bs-secondary-color, #8592a3); margin-bottom: .25rem; }
.filter-dropdown { display: none; position: absolute; top: calc(100% + 4px); left: 0; z-index: 1060; width: 300px; max-width: 90vw;
  background: var(--bs-body-bg, #fff); border: 1px solid rgba(67, 89, 113, .15); border-radius: .5rem; padding: .75rem; }
.filter-dropdown.show { display: block; }
.filter-options { max-height: 260px; overflow-y: auto; }
.filter-option { display: flex; align-items: center; padding: .25rem .35rem; border-radius: .25rem; cursor: pointer; margin: 0; }
.filter-option:hover { background: rgba(184, 83, 46, .08); }
.filter-list { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; min-height: 1.5rem; }
.filter-chip { border: 1px solid rgba(67, 89, 113, .2); border-radius: .375rem; padding: .15rem .5rem; font-size: .8125rem; background: rgba(184, 83, 46, .04); }
.filter-chip-value { cursor: pointer; border-bottom: 1px dashed currentColor; }
.filter-chip-value:hover { color: var(--bs-danger, #ff3e1d); text-decoration: line-through; }

/* snackbar notifications (v5 js-snackbar: top centre) */
.snackbar-box { position: fixed; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: .5rem;
  width: min(560px, calc(100vw - 2rem)); pointer-events: none; }
.snackbar { pointer-events: auto; display: flex; align-items: flex-start; gap: .65rem; padding: .75rem .75rem .75rem 1rem; border-radius: .6rem;
  background: #fff; color: #384551; box-shadow: 0 .5rem 1.5rem rgba(34, 48, 62, .18); border-left: 5px solid #b8532e; animation: snackbar-in .2s ease-out; }
.snackbar-hide { opacity: 0; transform: translateY(-8px); transition: all .25s; }
.snackbar-icon { font-size: 1.4rem; line-height: 1.2; }
.snackbar-text { flex: 1; padding-top: .1rem; word-break: break-word; }
.snackbar-close { border: 0; background: transparent; color: inherit; opacity: .55; font-size: 1.25rem; line-height: 1; padding: 0 .1rem; }
.snackbar-close:hover { opacity: 1; }
.snackbar-success { border-left-color: #71dd37; } .snackbar-success .snackbar-icon { color: #71dd37; }
.snackbar-error { border-left-color: #ff3e1d; background: #fff5f3; } .snackbar-error .snackbar-icon { color: #ff3e1d; }
.snackbar-warning { border-left-color: #ffab00; } .snackbar-warning .snackbar-icon { color: #ffab00; }
.snackbar-info { border-left-color: #03c3ec; } .snackbar-info .snackbar-icon { color: #03c3ec; }
@keyframes snackbar-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* scanner screen */
.scan-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: .75rem; }
.scan-input { font-size: 1.6rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-align: center; }
.scan-feedback { border-radius: .6rem; padding: 1rem 1.25rem; min-height: 96px; transition: background .15s; }
.scan-feedback.ok { background: #e8fadf; border: 2px solid #71dd37; }
.scan-feedback.warn { background: #fff2d6; border: 2px solid #ffab00; }
.scan-feedback.err { background: #ffe0db; border: 2px solid #ff3e1d; }
.scan-feedback.idle { background: rgba(67, 89, 113, .05); border: 2px dashed rgba(67, 89, 113, .2); }
.scan-big { font-size: 2rem; font-weight: 700; line-height: 1.1; }
.scan-position { font-size: 1.1rem; }
.item-done td { background: rgba(113, 221, 55, .09) !important; }
.item-over td { background: rgba(255, 171, 0, .12) !important; }
.item-flash td { animation: item-flash 1s ease-out; }
@keyframes item-flash { from { background: rgba(184, 83, 46, .35); } }

/* theme toggle (navbar) */
.theme-toggle .theme-icon-dark { display: none; }
html.dark-style .theme-toggle .theme-icon-dark { display: inline-block; }
html.dark-style .theme-toggle .theme-icon-light { display: none; }

/* collapsible menu (desktop): a round icon button next to the logo (fold / unfold icon), hovering the narrow menu shows it whole */
.sidebar-toggle { width: 2.125rem; height: 2.125rem; flex: 0 0 auto; border-radius: 50%; display: inline-flex !important; align-items: center; justify-content: center;
  font-size: 1.3rem; line-height: 1; color: var(--bs-heading-color); transition: background-color .15s, color .15s; }
.sidebar-toggle:hover, .sidebar-toggle:focus-visible { background: rgba(var(--bs-primary-rgb), .12); color: var(--bs-primary); outline: 0; }
.sidebar-toggle:active { background: rgba(var(--bs-primary-rgb), .2); }
.sidebar-toggle i { line-height: 1; }
.sidebar-toggle .sidebar-toggle-unfold, .sidebar-toggle .sidebar-toggle-close { display: none; }
@media (min-width: 1200px) {
  .layout-menu-collapsed .sidebar-toggle .sidebar-toggle-fold { display: none; }
  .layout-menu-collapsed .sidebar-toggle .sidebar-toggle-unfold { display: inline-block; }
  .layout-menu-collapsed:not(.layout-menu-hover) .app-brand { padding-left: 1rem; padding-right: 1rem; }
  .layout-menu-collapsed:not(.layout-menu-hover) .app-brand-logo { display: none; }
  html.layout-menu-collapsed:not(.layout-menu-hover):not(.layout-menu-offcanvas):not(.layout-menu-fixed-offcanvas) .layout-menu .app-brand .layout-menu-toggle { display: inline-flex !important; }
  .layout-menu-collapsed:not(.layout-menu-hover) .app-brand .layout-menu-toggle { position: static; margin: 0 auto !important; transform: none; opacity: 1 !important; }
}
/* drawer on a phone / tablet: the same button closes it */
@media (max-width: 1199.98px) {
  .sidebar-toggle .sidebar-toggle-fold { display: none; }
  .sidebar-toggle .sidebar-toggle-close { display: inline-block; }
}

/* row the user came back to from a detail page */
.row-return > td { animation: row-return 2.4s ease-out; }
@keyframes row-return { 0%, 30% { background-color: rgba(184, 83, 46, .22); } 100% { background-color: transparent; } }

/* shipment status flow (Novo -> Spakirano -> Na dostavi -> Dostavljeno) */
.status-flow { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.status-step { display: flex; align-items: center; gap: .45rem; color: var(--bs-secondary-color, #a1acb8); font-weight: 500; }
.status-step-dot { width: 1.75rem; height: 1.75rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem;
  border: 2px solid currentColor; }
.status-step.done { color: var(--bs-body-color, #697a8d); }
.status-step.done .status-step-dot { background: rgba(184, 83, 46, .12); border-color: rgba(184, 83, 46, .35); color: #b8532e; }
.status-step.final.current { color: #71dd37; }
.status-step.current .status-step-dot { background: currentColor; }
.status-step.current .status-step-dot > span { color: #fff; }
.status-step.current .status-step-label { font-weight: 600; }
.status-step-line { width: 2rem; height: 2px; background: rgba(67, 89, 113, .2); }
.status-card { transition: transform .15s, box-shadow .15s; }
.status-card:hover { transform: translateY(-2px); }

/* shipment flags next to the status (packed, stock taken off): plain muted icons */
.shipment-flag { font-size: 1.1rem; color: var(--bs-secondary-color, #8592a3); vertical-align: middle; margin: 0 .1rem; }

/* --- one typography for every table: same font, size and weight in all cells; secondary text only muted, never smaller,
   no monospace. Headers share one style. Lists (TableView) keep each record on one line. */
.table { font-size: .875rem; font-family: inherit; }
.table > :not(caption) > * > * { font-size: inherit; line-height: 1.45; }
.table th { font-size: .75rem !important; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.table td small, .table td .small, .table td.small, .table td .text-mono, .table td.text-mono { font-size: inherit !important; font-family: inherit !important; }
.table td .badge { font-size: .75rem; font-weight: 500; }
.table td .fw-semibold, .table td b, .table td strong { font-weight: 600; }
.table-oneline > tbody > tr > td { white-space: nowrap; }
.table-oneline .cell-truncate { display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }

/* brand mark (logo without an image) */
.brand-mark { display: inline-flex; align-items: center; justify-content: center; border-radius: .5rem; background: linear-gradient(135deg, #b8532e, #d08a6b); color: #fff; font-size: 1.15em; box-shadow: 0 2px 6px rgba(140,87,255,.35); }
.brand-mark i { line-height: 1; }
.code-input { letter-spacing: .5em; font-size: 1.25rem; text-align: center; }
.channel-dot { width: .6rem; height: .6rem; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.status-tabs .nav-link { padding: .35rem .8rem; font-size: .875rem; }
.status-tabs .nav-link .badge { margin-left: .35rem; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .25rem 1rem; }
.kv dt { font-weight: 400; color: var(--bs-secondary-color); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; } /* long URLs / click IDs wrap instead of widening the page */
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ===================================================================================================================
   Mobile / tablet (mobile-foundation). Phones < 768px, touch screens = (pointer: coarse).
   =================================================================================================================== */

/* topbar: page title also on the phone (cut with an ellipsis), safe areas of notched phones */
.navbar-page-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 767.98px) {
  .navbar-page-title { font-size: 1rem; }
  .layout-navbar .navbar-nav-right { min-width: 0; flex: 1 1 auto; gap: .25rem; }
  .layout-navbar .navbar-nav .nav-item.me-1, .layout-navbar .navbar-nav .nav-item.me-2 { margin-right: 0 !important; }
  .content-wrapper > .container-p-y { padding-top: 1rem !important; padding-bottom: 1rem !important; }
  .container-xxl, .container-fluid { padding-left: .75rem !important; padding-right: .75rem !important; }
  .card-body { padding: 1rem; }
  .card-header { padding: .875rem 1rem; }
  .card-footer { padding: .75rem 1rem; }
  h4, .h4 { font-size: 1.25rem; }
}
.content-footer .container-xxl { padding-bottom: max(.5rem, env(safe-area-inset-bottom)) !important; }
.layout-menu .menu-inner { padding-bottom: env(safe-area-inset-bottom); }
@media (max-width: 1199.98px) {
  .layout-navbar.navbar-detached { margin-left: max(.75rem, env(safe-area-inset-left)) !important; margin-right: max(.75rem, env(safe-area-inset-right)) !important; }
  /* the offcanvas menu: bigger rows, easy to hit with a thumb */
  .layout-menu .menu-inner > .menu-item > .menu-link { min-height: 44px; }
  .layout-menu .menu-inner > .menu-header { margin-top: 1rem !important; }
}

/* touch screens: 16px inputs (iOS does not zoom in on focus), targets of at least 44px */
@media (max-width: 767.98px), (pointer: coarse) {
  .form-control, .form-select, .input-group-text, .form-control-sm, .form-select-sm { font-size: 16px !important; }
  .form-control:not(textarea):not([type=color]):not(.code-input), .form-select { min-height: 44px; }
  .form-control-sm:not(textarea), .form-select-sm { min-height: 40px; }
  .btn:not(.btn-xs):not(.btn-icon) { min-height: 44px; }
  .btn-sm:not(.btn-icon) { min-height: 40px; }
  .btn-icon:not(.btn-xs) { width: 44px; height: 44px; }
  .table .btn-sm:not(.btn-icon) { min-height: 36px; }
  .table .btn-icon.btn-sm { width: 38px; height: 38px; }
  .table .btn.py-0 { min-height: 30px; }
  .nav-pills .nav-link, .nav-tabs .nav-link { min-height: 44px; display: flex; align-items: center; }
  .page-link { min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
  .form-check:not(.form-check-inline) { min-height: 32px; display: flex; align-items: center; gap: .5rem; padding-left: 0; }
  .form-check .form-check-input { width: 1.35rem; height: 1.35rem; margin-top: 0; flex: 0 0 auto; float: none; margin-left: 0; }
  .form-switch .form-check-input { width: 2.4rem; }
  .table .form-check-input, .grid-check { width: 1.35rem; height: 1.35rem; }
  .dropdown-item { padding-top: .65rem; padding-bottom: .65rem; }
  .layout-navbar .nav-link.btn-icon, .layout-navbar .layout-menu-toggle .nav-link { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .btn-close { width: 1.5rem; height: 1.5rem; padding: .6rem; }
}

/* tabs (and pills marked .nav-scroll): one scrollable row on a phone instead of breaking out of / filling the screen */
@media (max-width: 767.98px) {
  .nav-tabs, .nav-scroll { flex-wrap: nowrap !important; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .nav-tabs::-webkit-scrollbar, .nav-scroll::-webkit-scrollbar { display: none; }
  .nav-tabs .nav-item, .nav-scroll .nav-item { flex: 0 0 auto; }
  .nav-tabs .nav-link, .nav-scroll .nav-link { white-space: nowrap; }
  /* toolbars (buttons, small selects, KPI boxes side by side) wrap instead of pushing the page wider */
  .content-wrapper .d-flex[class*="gap-"]:not(.flex-nowrap):not(.flex-column):not(.input-group) { flex-wrap: wrap; }
  .content-wrapper .card-header .form-control[style*="width"], .content-wrapper .card-header .form-select[style*="width"] { flex: 1 1 140px; width: auto !important; }
  .btn-group { flex-wrap: wrap; }
  pre { white-space: pre-wrap; word-break: break-word; }
  h4.money, h5.money, .h4.money, .h5.money { white-space: normal; } /* KPI tiles two per row */
}

/* modals: whole screen on a phone (header and buttons stay in view, the body scrolls); confirmations stay small */
@media (max-width: 575.98px) {
  .modal:not(#confirmModal) .modal-dialog { margin: 0; max-width: none; width: 100%; min-height: 100%; align-items: stretch; padding: 0 !important; }
  .modal:not(#confirmModal) .modal-content { border-radius: 0; border: 0; min-height: 100vh; min-height: 100dvh; }
  .modal:not(#confirmModal) .modal-header { position: sticky; top: 0; z-index: 3; background: var(--bs-modal-bg, var(--bs-paper-bg, #fff)); padding-top: max(1rem, env(safe-area-inset-top)); }
  .modal:not(#confirmModal) .modal-body { flex: 1 1 auto; }
  .modal:not(#confirmModal) .modal-footer { position: sticky; bottom: 0; z-index: 3; background: var(--bs-modal-bg, var(--bs-paper-bg, #fff)); box-shadow: 0 -.25rem 1rem rgba(46, 38, 61, .1); }
  .modal .modal-footer { padding-bottom: max(.75rem, env(safe-area-inset-bottom)); flex-wrap: wrap; gap: .5rem; }
  .modal .modal-footer > .btn { flex: 1 1 auto; margin: 0; }
  .modal .modal-footer > .btn.me-auto { flex-basis: 100%; order: 3; }
  #confirmModal .modal-dialog { margin: auto .75rem; min-height: 100%; }
}

/* notifications: bottom of the screen on a phone (thumb reach, not over the title), above the home indicator */
@media (max-width: 767.98px) {
  .snackbar-box { top: auto; bottom: max(1rem, env(safe-area-inset-bottom)); width: calc(100vw - 1.5rem); }
  .snackbar { padding: .85rem .75rem .85rem 1rem; }
  .snackbar-close { min-width: 36px; min-height: 36px; }
}
html.dark-style .snackbar { background: #3b352e; color: #efe8df; box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .45); }
html.dark-style .snackbar-error { background: #3d2b3d; }
html.dark-style .filter-dropdown { border-color: rgba(231, 227, 252, .12); }
html.dark-style .filter-chip { border-color: rgba(231, 227, 252, .2); }
html.dark-style .scan-feedback.ok { background: rgba(113, 221, 55, .14); }
html.dark-style .scan-feedback.warn { background: rgba(255, 171, 0, .14); }
html.dark-style .scan-feedback.err { background: rgba(255, 62, 29, .14); }

/* TableView on a phone: filters fold into the card header (active filters stay visible), multi-select is a bottom sheet */
.grid-filter-toggle, .filter-dropdown-done { display: none !important; }
@media (max-width: 767.98px) {
  .grid-filter-toggle { display: inline-flex !important; margin-right: auto; }
  .grid-filters.grid-filters-collapsed .grid-filters-body > :not([data-grid-filterlist]) { display: none !important; }
  .grid-filters.grid-filters-collapsed.grid-filters-empty .grid-filters-body { display: none; }
  .grid-filters .card-header { flex-wrap: wrap; gap: .5rem; }
  .grid-filters .card-header > h5 { display: none; }
  .grid-filters .card-header .btn-sm { --bs-btn-padding-x: .6rem; }
  .filter-bar { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem .75rem; }
  .filter-bar .filter-field { min-width: 0; }
  .filter-bar .filter-field:has(input[type=search]) { grid-column: 1 / -1; }
  .filter-bar .form-control, .filter-bar .form-select { min-width: 0 !important; max-width: none !important; width: 100% !important; }
  .filter-bar [data-filter-select] > .filter-btn { width: 100%; justify-content: flex-start; }
  .filter-dropdown.show { position: fixed; left: .5rem; right: .5rem; bottom: .5rem; top: auto; width: auto; max-width: none; z-index: 1095;
    padding-bottom: max(.75rem, env(safe-area-inset-bottom)); box-shadow: 0 -.5rem 2rem rgba(0, 0, 0, .3) !important; }
  .filter-dropdown .filter-options { max-height: 45vh; }
  .filter-dropdown .filter-option { min-height: 40px; }
  .filter-dropdown-done { display: flex !important; width: 100%; margin-top: .5rem; }
  .filter-list .filter-chip { padding: .3rem .6rem; }
}

/* TableView on a phone: every row is a card (label: value lines); a th with data-stack="hide" is left out */
.grid-mobile-bar { display: none !important; }
@media (max-width: 767.98px) {
  .grid-mobile-bar { display: flex !important; gap: .5rem; align-items: center; padding: .5rem 1rem; border-bottom: 1px solid var(--bs-border-color); }
  .grid-mobile-bar .form-select { flex: 1 1 auto; }
  .table-responsive:has(> .table-stack) { overflow: visible; }
  .table-stack { display: block; }
  .table-stack > thead { display: none; }
  .table-stack > tbody { display: block; }
  .table-stack > tbody > tr { display: block; position: relative; padding: .7rem 1rem .6rem; border-bottom: 1px solid var(--bs-border-color); }
  .table-stack > tbody > tr:last-child { border-bottom: 0; }
  /* block + floated label: the cell content keeps flowing inline (name + badge stay together) */
  .table-stack > tbody > tr > td { display: block; padding: .12rem 0 !important; border: 0 !important; white-space: normal !important;
    text-align: right !important; background: transparent; box-shadow: none; overflow-wrap: anywhere; }
  .table-stack > tbody > tr > td::before { content: attr(data-label); float: left; max-width: 45%; margin-right: .75rem; text-align: left; color: var(--bs-secondary-color);
    font-size: .75rem; line-height: 1.9; text-transform: uppercase; letter-spacing: .03em; overflow-wrap: normal; }
  .table-stack > tbody > tr > td::after { content: ''; display: table; clear: both; }
  .table-stack > tbody > tr > td[data-label=""]::before, .table-stack > tbody > tr > td[colspan]::before { display: none; }
  .table-stack > tbody > tr > td:empty, .table-stack > tbody > tr > td.stack-hide { display: none; }
  .table-stack > tbody > tr > td[colspan] { display: block; text-align: center !important; }
  /* the first column with content is the title of the card */
  .table-stack > tbody > tr > td.stack-title { text-align: left !important; font-size: 1rem; font-weight: 500; padding-bottom: .3rem !important; padding-right: 2.5rem !important; }
  .table-stack > tbody > tr > td.stack-title::before { display: none; }
  .table-stack > tbody > tr > td.stack-check { position: absolute; top: .6rem; right: 1rem; padding: 0 !important; }
  .table-stack > tbody > tr > td.stack-check::before { display: none; }
  .table-stack > tbody > tr > td.stack-actions { padding-top: .35rem !important; }
  .table-stack > tbody > tr > td.stack-actions::before { display: none; }
  .table-stack .cell-truncate { max-width: 60vw !important; }
}

/* tables kept as tables on a phone: horizontal scroll with a visible hint (shadow at the cut edge) */
.table-responsive.scroll-x-more { background: linear-gradient(to left, rgba(46, 38, 61, .16), transparent 16px) right / 16px 100% no-repeat; }

/* pagination: centred, per page on its own line on a phone */
@media (max-width: 575.98px) {
  [data-grid-pagination] { width: 100%; display: flex; justify-content: center; }
  .pagination { flex-wrap: wrap; justify-content: center; gap: .15rem; }
}

/* login / 2FA on a phone: less padding around the card */
@media (max-width: 575.98px) {
  .authentication-wrapper .card.p-7 { padding: 1rem !important; }
  .authentication-wrapper .authentication-inner { margin-left: .5rem !important; margin-right: .5rem !important; }
}

/* long forms (settings): the save button stays at hand on a phone */
@media (max-width: 767.98px) {
  .sticky-actions { position: sticky; bottom: 0; z-index: 5; margin-left: -.75rem; margin-right: -.75rem; padding: .6rem .75rem max(.6rem, env(safe-area-inset-bottom));
    background: var(--bs-body-bg); box-shadow: 0 -.25rem 1rem rgba(46, 38, 61, .12); }
  .sticky-actions > .btn { flex: 1 1 auto; }
}

/* production (production & orders area): touch-friendly queue cards next to the machine */
.prod-cards .prod-check { width: 1.6rem; height: 1.6rem; margin-top: .1rem; }
.prod-status .btn, .prod-touch { min-height: 48px; }
.prod-status .btn { flex: 1 1 0; padding-left: .25rem; padding-right: .25rem; white-space: normal; line-height: 1.1; }
.prod-stat-click { cursor: pointer; }
.prod-bulk .btn { min-height: 38px; }
.prod-stat { min-height: 40px; white-space: nowrap; justify-content: flex-start; padding: .35rem .85rem !important; }
.prod-stat .fs-5 { font-size: 1.125rem !important; font-variant-numeric: tabular-nums; }
/* KPI chips: one scrollable row on a phone (markup: flex-nowrap flex-sm-wrap, so the foundation toolbar wrap rule skips it) */
@media (max-width: 575.98px) { #prodStats { scrollbar-width: none; } #prodStats .prod-stat { flex: 0 0 auto; } }
.table-danger-subtle > td { background-color: rgba(var(--bs-danger-rgb), .06); }
@media (max-width: 991.98px) {
  .prod-bulk { position: sticky; top: var(--app-sticky-top, 64px); z-index: 3; background: var(--bs-card-bg, var(--bs-body-bg, #fff)); }
  .prod-bulk .btn { flex: 1 1 auto; min-height: 44px; }
  #prodBulk:not(.has-selection) > .btn { display: none !important; }
}

/* item editor (personalization & catalog area): section jump bar, print area preview on the mockup, option rows */
.item-section-nav { position: sticky; top: 4rem; z-index: 4; display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; padding: .4rem 0;
  background: var(--bs-body-bg); }
.item-section-nav::-webkit-scrollbar { display: none; }
.item-section-nav .btn { flex: 0 0 auto; white-space: nowrap; }
#itemPage [id$="Card"], #itemPage #itemForm { scroll-margin-top: 7.5rem; }
.print-area-preview { position: relative; width: 100%; aspect-ratio: 1 / 1; background: repeating-conic-gradient(rgba(127, 127, 127, .12) 0 25%, transparent 0 50%) 0 0 / 20px 20px;
  border: 1px solid var(--bs-border-color); border-radius: .375rem; overflow: hidden; touch-action: none; user-select: none; }
.print-area-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.print-area-box { position: absolute; border: 2px dashed var(--bs-primary); background: rgba(var(--bs-primary-rgb), .15); cursor: move;
  display: flex; align-items: center; justify-content: center; font-size: .7rem; color: var(--bs-primary); text-align: center; line-height: 1.1; overflow: hidden; }
.print-area-box .pa-handle { position: absolute; right: -2px; bottom: -2px; width: 18px; height: 18px; background: var(--bs-primary); cursor: nwse-resize; border-radius: 3px 0 0 0; }
.print-area-thumb { position: relative; width: 44px; height: 44px; border: 1px solid var(--bs-border-color); border-radius: .25rem; overflow: hidden; background: rgba(127, 127, 127, .08); }
.print-area-thumb img { width: 100%; height: 100%; object-fit: fill; }
.print-area-thumb span { position: absolute; border: 1px solid var(--bs-primary); background: rgba(var(--bs-primary-rgb), .25); }
.opt-row { border-bottom: 1px solid var(--bs-border-color); padding: .4rem 0; }
/* item KPIs: a grid of tiles on a phone (all five visible, no row cut off at the screen edge) */
@media (max-width: 767.98px) {
  .item-head-tools { width: 100%; }
  .item-kpis { width: 100%; grid-template-columns: repeat(auto-fit, minmax(6.25rem, 1fr)); }
  .item-kpis > div { min-width: 0; overflow-wrap: anywhere; }
}
@media (max-width: 767.98px) {
  .opt-row .form-control, .opt-row .form-check-input { min-height: 38px; }
}

/* ---------- shell (what the panel needs of the template's demo.css) */
.menu .app-brand { height: 64px; }
.layout-navbar-fixed .layout-wrapper:not(.layout-without-menu) .layout-page { padding-top: 64px !important; }
.content-wrapper .navbar { z-index: auto; }
/* wide screens: lists use the room instead of scrolling sideways in a narrow column */
@media (min-width: 1400px) { .layout-compact .container-xxl, .container-xxl { max-width: 1760px; } }

/* ---------- logo: heart mark + wordmark (the same as the storefront) */
.app-brand-link { gap: .5rem; text-decoration: none; }
.app-brand-logo { display: inline-flex; color: var(--bs-primary); }
.brand-mark { background: none; box-shadow: none; border-radius: 0; }
.brand-word { font: 600 1.6rem/1 "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif; letter-spacing: -.01em; color: var(--bs-heading-color); text-transform: none; }
.authentication-wrapper .brand-word { font-size: 2rem; }
.layout-menu-collapsed:not(.layout-menu-hover) .layout-menu .brand-word { display: none; }

/* ---------- coupon chip: code + number of redemptions side by side (never on top of each other) */
.coupon-chip { display: inline-flex; align-items: stretch; margin: 2px 4px 2px 0; padding: 0; border: 1px solid rgba(var(--bs-success-rgb), .55); border-radius: .375rem; background: transparent;
  font: 500 .75rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--bs-success); cursor: pointer; overflow: hidden; white-space: nowrap; vertical-align: middle; }
.coupon-chip:hover { background: rgba(var(--bs-success-rgb), .08); }
.coupon-chip .coupon-code { padding: .3rem .45rem; }
.coupon-chip .coupon-n { padding: .3rem .4rem; background: rgba(var(--bs-success-rgb), .16); font-weight: 600; min-width: 1.6rem; text-align: center; }
.coupon-chip.off { border-color: var(--bs-border-color); color: var(--bs-secondary-color); }
.coupon-chip.off .coupon-n { background: rgba(var(--bs-secondary-rgb), .16); }
.app-brand-logo .brand-mark { color: var(--bs-primary); }
/* promotions: long names / targets may wrap, so the whole row fits without scrolling sideways */
#promoRows td:nth-child(1), #promoRows td:nth-child(3), #ruleRows td:nth-child(2), #ruleRows td:nth-child(4) { white-space: normal; min-width: 170px; }
html.dark-style .content-wrapper a:not(.btn):not(.nav-link):not(.dropdown-item):not(.page-link) { color: #e59168; }

/* ===================================================================================================================
   One look for every page (panel polish). Rules of the house:
   - type: page title h4, card title h5, table header .75rem caps, body .875-.9375rem, meta = same size, muted
   - buttons: primary action filled accent, secondary outline, destructive outline danger; normal size for page
     actions, .btn-sm for rows, card headers and filter bars; icon before the label; sentence case, never Capitalised Words
   - badges: status = pill label, count = pill in a tab / button with a gap, tag = small label on the meta line
   - lists: line 1 of a cell is the name only, line 2 (.cell-meta) carries tags and muted details; numbers right, tabular
   =================================================================================================================== */

/* --- sentence case everywhere (the theme capitalises every word of buttons, tabs and badges) */
.btn, .nav .nav-link, .nav-pills .nav-link, .nav-tabs .nav-link, .badge, .dropdown-item, .page-link, .menu-link { text-transform: none; }

/* --- the top bar is a clean edge: content scrolls away under a page-coloured band, nothing shows through or beside it */
.layout-navbar-fixed .layout-page::before { content: ''; position: fixed; top: 0; left: 0; right: 0; height: 64px; background: var(--bs-body-bg); z-index: 9; pointer-events: none; }
.layout-navbar-fixed .layout-page .layout-navbar.navbar-detached { backdrop-filter: none; -webkit-backdrop-filter: none; }
.layout-navbar-fixed .window-scrolled .bg-navbar-theme.layout-navbar { background-color: #fff !important; box-shadow: 0 .25rem .75rem rgba(50, 46, 41, .14); }
html.dark-style.layout-navbar-fixed .window-scrolled .bg-navbar-theme.layout-navbar { background-color: #3d3731 !important; box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .35); }
/* sticky parts of a page stop below the top bar */
:root { --app-sticky-top: 64px; }

/* --- controls: one height for page-level inputs and buttons (38px), one for small ones (32px) */
/* a fixed height instead of the theme's vertical padding (which changes with focus / input groups): nothing jumps */
.form-control:where(:not(textarea, [type=file], [type=color], .code-input, .scan-input, .form-floating > *)),
.form-select:where(:not([multiple], [size], .form-floating > *)) { height: 2.375rem; padding-top: 0 !important; padding-bottom: 0 !important; }
.form-control-sm:where(:not(textarea, [type=file], [type=color])), .form-select-sm:where(:not([multiple], [size])) { height: 2rem; font-size: .8125rem; }
.input-group > .form-control, .input-group > .form-select { height: auto; min-height: 2.375rem; }
.input-group-sm > .form-control, .input-group-sm > .form-select { min-height: 2rem; }
textarea.form-control { padding-top: .5rem; padding-bottom: .5rem; }
.btn { --bs-btn-padding-y: .5rem; --bs-btn-padding-x: 1rem; --bs-btn-font-size: .875rem; min-height: 2.375rem; gap: .1rem; }
.btn-sm, .btn-group-sm > .btn { --bs-btn-padding-y: .3rem; --bs-btn-padding-x: .75rem; --bs-btn-font-size: .8125rem; min-height: 2rem; }
.btn.py-0 { min-height: 1.625rem; }
.btn-icon { min-height: 0; }
.btn-group > .btn { white-space: nowrap; }
.input-group-text { padding-top: 0 !important; padding-bottom: 0 !important; }
.form-label { margin-bottom: .3rem; }
.form-text { margin-top: .3rem; }

/* --- tabs and pills: the count badge never touches the label */
.nav-link > .badge, .btn > .badge:not(:first-child) { margin-left: .5rem !important; flex: none; }
.nav-link > .badge { font-size: .75rem; font-weight: 600; min-width: 1.6rem; padding: .25em .55em; }
.nav-pills .nav-link, .nav-tabs .nav-link { padding: .5rem 1rem; white-space: nowrap; }
.nav-pills .nav-link.py-1, .status-tabs .nav-link { padding: .4rem .85rem; font-size: .875rem; }
.nav-pills .nav-link:not(.active) > .badge.bg-label-secondary { background: rgba(var(--bs-secondary-rgb), .16) !important; }
.nav-tabs { margin-bottom: 1.25rem !important; }

/* --- badges: one size, never broken in two, a gap to what stands next to them */
.badge { white-space: nowrap; letter-spacing: 0; }
.badge + .badge, .badge + .btn, .btn + .badge { margin-left: .3rem; }
.d-flex[class*="gap-"] > .badge + .badge, .d-flex[class*="gap-"] > .badge + .btn, .d-flex[class*="gap-"] > .btn + .badge { margin-left: 0; }
.badge.text-wrap { white-space: normal; }

/* --- cards: one padding, title and subtitle in the header, actions on the right */
.card-header { padding: 1rem 1.25rem; }
.card-header h5, .card-header .h5 { font-size: 1.0625rem; line-height: 1.35; }
.card-header h5 + small, .card-header h5 ~ small.text-muted { display: block; margin-top: .15rem; line-height: 1.4; }
.card-body { padding: 1.25rem; }
.card-header + .card-body:not(.border-top):not(.border-bottom) { padding-top: .25rem; }
.card-footer { padding: .75rem 1.25rem; }
h4, .h4 { font-size: 1.375rem; }

/* --- tables: one density; numbers right with tabular figures; the action column is the last one */
.table > :not(caption) > * > * { padding: .6rem .875rem; }
.table-sm > :not(caption) > * > * { padding: .5rem .875rem; }
.table > thead > tr > th { padding-top: .7rem; padding-bottom: .7rem; }
.table > :not(caption) > * > :first-child { padding-left: 1.25rem; }
.table > :not(caption) > * > :last-child { padding-right: 1.25rem; }
.table td.text-end, .table th.text-end, .money { font-variant-numeric: tabular-nums; }
.table td.text-end { white-space: nowrap; }
.table .btn-icon.btn-sm { width: 1.875rem; height: 1.875rem; }
/* second line of a cell: tags first, then muted details; the first line stays the name alone */
.cell-meta { display: block; margin-top: .1rem; color: var(--bs-secondary-color); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cell-meta .badge { font-size: .6875rem; padding: .2em .5em; vertical-align: 1px; margin-right: .4rem; }
.cell-meta .badge + .badge { margin-left: 0; }
.cell-main { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
td.cell-w-sm { max-width: 9rem; } td.cell-w-md { max-width: 12rem; } td.cell-w-lg { max-width: 17rem; }
td[class*="cell-w-"] { overflow: hidden; }
.table-oneline td .cell-truncate { max-width: 100%; }
td.cell-tag { width: 1%; white-space: nowrap; }
/* empty state of any list / card */
.empty-state, .table td[colspan].text-muted { text-align: center; color: var(--bs-secondary-color); padding: 1.75rem 1rem !important; }

/* --- filter card of the lists: compact and calm */
@media (min-width: 768px) {
  .grid-filters > .card-header { padding: .75rem 1.25rem .35rem; }
  .grid-filters > .card-header h5 { font-size: .9375rem; }
  .grid-filters > .card-body { padding: .35rem 1.25rem .8rem; }
  .grid-filters .filter-bar { gap: .5rem .6rem; margin-bottom: .65rem !important; }
  .grid-filters .grid-filters-body > .d-flex { gap: .4rem 1.25rem !important; margin-bottom: .5rem !important; font-size: .8125rem; }
  .grid-filters .grid-filters-body > small { display: none !important; }
  .grid-filters.grid-filters-empty [data-grid-filterlist] { display: none; }
  .grid-filters [data-grid-filterlist] { min-height: 0; margin-top: .6rem; }
  .filter-bar .filter-field label { font-size: .6875rem; letter-spacing: .03em; margin-bottom: .15rem; }
  .filter-bar .form-control, .filter-bar .form-select { height: 2rem; padding-left: .6rem; font-size: .8125rem; min-width: 110px; }
  .filter-bar .filter-btn { min-height: 2rem; height: 2rem; padding: 0 .7rem; font-size: .8125rem; font-weight: 500; }
}
.filter-bar .filter-btn, .filter-bar .filter-btn:hover, .filter-bar .filter-btn:focus, .filter-bar .filter-btn:active { background: transparent !important; border: 1px solid var(--bs-border-color) !important; color: var(--bs-body-color) !important; box-shadow: none !important; }
.filter-bar .filter-btn:hover { border-color: rgba(var(--bs-primary-rgb), .55) !important; color: var(--bs-primary) !important; }
.filter-bar .filter-btn > i { opacity: .6; }
.filter-bar .filter-btn .filter-count:empty { display: none; }
.filter-bar .filter-btn:has(.filter-count:not(:empty)) { border-color: var(--bs-primary) !important; color: var(--bs-primary) !important; background: rgba(var(--bs-primary-rgb), .07) !important; }
.filter-chip { border-color: rgba(var(--bs-primary-rgb), .3); background: rgba(var(--bs-primary-rgb), .06); padding: .1rem .5rem; font-size: .75rem; border-radius: 50rem; }
.filter-option:hover { background: rgba(var(--bs-primary-rgb), .08); }
/* list card header: total on the left, actions on the right */
[data-grid-info] { font-size: .875rem; }

/* --- KPI tile (one component on every page): small muted label, large value on its own line, the change vs the
   previous period as small coloured text, optional muted hint; no icons. Markup: .card.kpi > .card-body >
   .kpi-label + .kpi-main(h5.kpi-value + delta badge) + .kpi-hint */
.kpi > .card-body { display: flex; flex-direction: column; gap: .2rem; padding: 1.1rem 1.25rem; min-width: 0; }
.kpi-label { font-size: .8125rem; font-weight: 500; color: var(--bs-secondary-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .6rem; min-width: 0; }
.kpi-value { margin: 0; font-size: 1.5rem; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; color: var(--bs-heading-color); white-space: nowrap; font-variant-numeric: tabular-nums; }
.kpi .badge { background: transparent !important; padding: 0; margin: 0; font-size: .8125rem; font-weight: 600; border-radius: 0; }
.kpi .badge.bg-label-secondary { color: var(--bs-secondary-color) !important; }
.kpi-hint { font-size: .8125rem; line-height: 1.45; color: var(--bs-secondary-color); overflow-wrap: anywhere; }
.kpi-hint b { font-weight: 600; color: var(--bs-body-color); white-space: nowrap; }
@media (max-width: 767.98px) { .kpi > .card-body { padding: .85rem 1rem; } .kpi-value { font-size: 1.2rem; white-space: normal; } }
/* six dashboard tiles in one row only where each still has room for its number */
@media (min-width: 1700px) { #kpiTiles > [class*="col-"] { flex: 0 0 16.6667%; max-width: 16.6667%; } }
/* compact stats in a detail page header (customer, item, product): the same label / value order */
#cKpis > div, #iKpis > div, #pKpis > div.border { text-align: left !important; padding: .45rem .9rem !important; min-width: 6.5rem; }
#cKpis > div > .small, #iKpis > div > .small, #pKpis > div.border > .small { font-size: .75rem; }
#cKpis > div > .fw-medium, #iKpis > div > .fw-medium, #pKpis > div.border > .fw-medium { font-size: 1.0625rem; font-weight: 600 !important; color: var(--bs-heading-color); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* --- small status dot (lists of things to do, stat chips) instead of coloured icon boxes */
.status-dot { width: .55rem; height: .55rem; border-radius: 50%; flex: 0 0 auto; display: inline-block; }
.queue-row { display: flex; align-items: center; gap: .75rem; padding: .7rem 0; color: var(--bs-body-color) !important; border-bottom: 1px solid var(--bs-border-color); text-decoration: none; }
.queue-row:first-child { padding-top: .25rem; }
.queue-row:hover .queue-label { color: var(--bs-primary); }
.queue-label { flex: 1 1 auto; min-width: 0; }
.queue-value { font-size: 1.0625rem; font-weight: 600; color: var(--bs-heading-color); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* --- labelled bars (funnel, top items, share of a total): label left, number right, bar in the accent colour below */
.bar-row { margin-bottom: .9rem; }
.bar-row:last-child { margin-bottom: 0; }
.bar-row-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font-size: .875rem; }
.bar-row-head > :first-child { min-width: 0; }
.bar-row .progress { height: .45rem; margin-top: .3rem; background: rgba(var(--bs-primary-rgb), .12); }
.bar-row-note { font-size: .75rem; color: var(--bs-secondary-color); margin-top: .2rem; }
.chart-box { min-height: 300px; }
@media (min-width: 1700px) { #kpiTiles .kpi-value { font-size: 1.3rem; } }
/* the top bar is as wide as the content below it (the theme stops it at 1440px) */
@media (min-width: 1400px) { .layout-navbar.navbar-detached.container-xxl { max-width: calc(1760px - 1.5rem * 2); } }

/* --- reviews: one review = one roomy row; its three actions are normal small buttons with a gap */
.review-row { display: flex; gap: .9rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--bs-border-color); }
.review-row:last-child { border-bottom: 0; }
.review-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .6rem; margin: .2rem 0 .35rem; font-size: .8125rem; color: var(--bs-secondary-color); }
.review-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.review-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.review-comment { padding: .75rem 0; border-bottom: 1px solid var(--bs-border-color); }
.review-comment:first-child { padding-top: 0; }
.review-comment:last-child { padding-bottom: 0; border-bottom: 0; }
.review-comment .review-body { margin: .3rem 0 .15rem; }

/* --- production queue on a desktop: compact rows that fit 1280px (order | thumbnail + item + content | qty | due, payment, status buttons) */
.prod-table > tbody > tr > td { vertical-align: top; padding-top: .75rem; padding-bottom: .75rem; }
.prod-table .prod-col-order { white-space: nowrap; width: 1%; }
.prod-table .prod-col-item { max-width: 0; width: 60%; overflow: hidden; }
.prod-table .prod-col-item > .d-flex { padding: 0 6px 6px 0; }
.min-w-0 { min-width: 0 !important; }
.prod-table .prod-col-item .cell-meta b { font-weight: 600; color: var(--bs-body-color); }
.prod-table .prod-col-state { width: 1%; min-width: 18.5rem; }
.prod-table .prod-col-state .cell-meta { max-width: 19rem; }
.prod-table .prod-qty { font-size: 1.25rem; font-weight: 700; color: var(--bs-heading-color); width: 1%; }
.prod-table .prod-status-sm .btn { --bs-btn-padding-x: .6rem; }
.prod-thumb { position: relative; flex: 0 0 auto; width: 64px; height: 64px; }
.prod-thumb img { width: 64px; height: 64px; object-fit: cover; border-radius: .375rem; border: 1px solid var(--bs-border-color); display: block; }
.prod-thumb-dl { position: absolute; right: -6px; bottom: -6px; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .85rem;
  background: var(--bs-card-bg, #fff); border: 1px solid var(--bs-border-color); color: var(--bs-body-color) !important; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.prod-thumb-dl:hover { color: var(--bs-primary) !important; border-color: var(--bs-primary); }
html.dark-style .prod-thumb-dl { background: #3d3731; }

/* --- page header: title + one-line description on the left, actions on the right */
.page-head { display: block; }
.page-head p { font-size: .875rem; max-width: 70rem; }

/* --- colour field (picker + #rrggbb + clear) and the swatch of a chosen colour in a list */
.color-field .form-control-color { flex: 0 0 3rem; max-width: 3rem; padding: .25rem; min-height: 2.375rem; height: auto; }
.color-field .form-control-color.is-empty { opacity: .35; }
.color-swatch { width: 1rem; height: 1rem; border-radius: 50%; flex: 0 0 auto; display: inline-block; border: 1px solid rgba(0, 0, 0, .15); }
.color-swatch.is-empty { background: transparent; border: 1px dashed var(--bs-secondary-color); }
html.dark-style .color-swatch { border-color: rgba(255, 255, 255, .25); }

/* --- sidebar: sections of a group (Settings) */
.layout-menu .menu-sub > .menu-item > .menu-link { padding-top: .45rem; padding-bottom: .45rem; font-size: .9375rem; }
.layout-menu .menu-sub > .menu-item.active > .menu-link { font-weight: 600; }

/* dark mode: accent-tinted labels stay readable on the dark paper */
html.dark-style .badge.bg-label-primary, html.dark-style .btn-label-primary { color: color-mix(in srgb, var(--bs-primary) 55%, #fff) !important; }
.input-group:has(button) .form-control, .input-group:focus-within .form-control, .input-group:focus-within .form-select { padding-top: 0 !important; padding-bottom: 0 !important; }
.input-group > .btn { min-height: 0; }
.color-field .form-control-color { padding: .3rem !important; }

/* --- share of a total as a small inline bar in a table cell (attribution) */
.share-col { width: 22%; min-width: 9rem; white-space: nowrap; }
.share-bar { display: inline-block; vertical-align: middle; width: calc(100% - 3.2rem); height: .45rem; border-radius: 1rem; background: rgba(var(--bs-primary-rgb), .12); overflow: hidden; }
.share-bar > span { display: block; height: 100%; border-radius: 1rem; background: var(--bs-primary); }
.share-pct { display: inline-block; width: 3rem; text-align: right; color: var(--bs-secondary-color); font-variant-numeric: tabular-nums; }
.table > tbody > tr.table-total > td { font-weight: 600; border-top: 2px solid var(--bs-border-color); color: var(--bs-heading-color); }
/* segmented switches in a card header keep a gap between two groups */
.card-header .btn-group + .btn-group { margin-left: .25rem; }
.d-inline-flex > .channel-dot { margin-right: .25rem; }
/* card header: the title block takes the room, the actions stay on the right on the same line */
@media (min-width: 768px) {
  .card-header.d-flex > div:first-child:not(:only-child):not(.d-flex) { flex: 1 1 14rem; min-width: 0; }
  .card-header.d-flex > .btn, .card-header.d-flex > .btn-group { flex: 0 0 auto; }
}
@media (min-width: 1400px) { .mk-tiles > .col-xxl .kpi-value { font-size: 1.25rem; } }
/* long column titles break into two lines instead of pushing the table wider than its card (sortable ones stay on one line) */
.table th, .table th.sortable { white-space: normal; line-height: 1.3; vertical-align: bottom; }
.table th.text-end { text-wrap: balance; }
.table th.sortable::after { white-space: nowrap; }

/* --- lists on a 1280px-class screen (content about 970px): tighter cells and the least important columns (.col-wide) left out,
   so the table fits its card instead of being cut at the right edge; from 1400px everything is shown */
@media (min-width: 768px) and (max-width: 1399.98px) {
  .table .col-wide { display: none; }
  .table-oneline.table-stack { font-size: .8125rem; }
  .table-oneline.table-stack > :not(caption) > * > * { padding-left: .55rem; padding-right: .55rem; }
  .table-oneline.table-stack > :not(caption) > * > :first-child { padding-left: 1.25rem; }
  .table-oneline.table-stack > :not(caption) > * > :last-child { padding-right: 1.25rem; }
  .table-oneline.table-stack td .badge { font-size: .6875rem; }
}
@media (min-width: 1400px) { .col-narrow-only { display: none; } }
@media (max-width: 767.98px) { .col-narrow-only { display: none; } }
td.cell-w-xl { max-width: 22rem; }

/* --- detail pages: tables in a narrow column wrap their text instead of being cut */
#oMarketing .table td, #persRows td, #areaRows td { white-space: normal; }
#oMarketing .table td:first-child, #oMarketing .table td.text-end { white-space: nowrap; }
#oMarketing .table > :not(caption) > * > * { padding-left: .4rem; padding-right: .4rem; }
#oMarketing .table > :not(caption) > * > :first-child { padding-left: 0; }
#oMarketing .table > :not(caption) > * > :last-child { padding-right: 0; }
/* item type choice: equal buttons in a tidy grid */
#typeChoice { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); }
#typeChoice .btn { white-space: nowrap; }
/* phone cards of a list: cells are as wide as the card, meta lines right-aligned under the value */
@media (max-width: 767.98px) {
  .table-stack > tbody > tr > td[class*="cell-w-"] { max-width: none; overflow: visible; }
  .table-stack > tbody > tr > td .cell-meta, .table-stack > tbody > tr > td .cell-main { white-space: normal; overflow: visible; }
  .table-stack > tbody > tr > td.stack-title .cell-meta { font-size: .875rem; font-weight: 400; }
}
/* top bar on a narrow phone: the switchers need the room, a one-letter stump of the page title helps nobody */
@media (max-width: 419.98px) { .navbar-page-title { display: none; } .layout-navbar .navbar-nav.ms-auto { margin-left: auto !important; } }
/* settings sections on a phone / tablet: always one scrolling row */
.st-nav { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.st-nav::-webkit-scrollbar { display: none; }
.st-nav .nav-item { flex: 0 0 auto; }
@media (min-width: 1400px) { #cmTiles .kpi-value { font-size: 1.25rem; } }

/* --- cards side by side in a row end on the same line (a column holding one card) */
.row.g-4 > [class*="col-"] > .card.mb-4:only-child { height: calc(100% - 1.5rem); }
/* --- light mode: the template's bright green / amber / cyan label texts are too pale on their tint; same hue, darker */
html:not(.dark-style) .badge.bg-label-success { color: color-mix(in srgb, var(--bs-success) 58%, #000) !important; }
html:not(.dark-style) .badge.bg-label-warning { color: color-mix(in srgb, var(--bs-warning) 55%, #000) !important; }
html:not(.dark-style) .badge.bg-label-info { color: color-mix(in srgb, var(--bs-info) 60%, #000) !important; }
html:not(.dark-style) .badge.bg-label-secondary { color: color-mix(in srgb, var(--bs-secondary) 70%, #000) !important; }
html:not(.dark-style) .kpi .badge.bg-label-success, html:not(.dark-style) .table .text-success { color: color-mix(in srgb, var(--bs-success) 62%, #000) !important; }

/* --- export: the one "Izvoz" button of the panel (app.js addExport): small outline, icon before the label, always the
   last action on the right of the card header. A header that is only a title (+ subtitle) becomes title | button. */
.btn-export { flex: none; white-space: nowrap; align-self: center; }
.card-header.has-export { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem .75rem; }
.card-header.has-export > .card-header-main { flex: 1 1 auto; min-width: 0; }
.card-header.has-export > .btn-export { align-self: flex-start; }
.modal-header > .btn-export { margin-left: auto; }
.modal-header > .btn-export + .btn-close { margin-left: .5rem; }
/* a card or block without a header: the button on its own slim line, right aligned */
.export-bar { display: flex; justify-content: flex-end; margin-bottom: .5rem; }
.card > .export-bar { margin: 0; padding: .75rem 1.25rem 0; }
/* the title block of a "title | actions" header gives way (its subtitle wraps) before the actions drop to a second line */
.card-header.d-flex:has(.btn-export) > div:first-child:has(> h5, > .h5) { flex: 1 1 7rem; min-width: 0; }

/* =====================================================================================================================
   In-page navigation - the same two components on every page (STYLE RULES):
   1. .page-tabs  (ul.nav.nav-tabs.page-tabs, first thing on the page): the sections / views of a page - settings sections,
      marketing reports, items / categories / brands, promotions / price rules, production views, tools / subscribers.
      Underlined text tabs with an icon; they wrap onto a second line on a desktop and scroll sideways on a phone.
   2. .status-tabs (ul.nav.nav-pills.status-tabs, above the list it filters): states of a list with their counts -
      order / production / review statuses, translation groups.
   ===================================================================================================================== */
.page-tabs { display: flex; flex-wrap: wrap; gap: 0 .25rem; margin: 0 0 1.5rem !important; padding: 0; border: 0; border-bottom: 1px solid var(--bs-border-color); background: none !important; box-shadow: none !important; }
.page-tabs .nav-item { margin: 0; }
.page-tabs .nav-link { display: inline-flex; align-items: center; gap: .4rem; padding: .7rem .9rem !important; margin-bottom: -1px; border: 0 !important; border-bottom: 2px solid transparent !important; border-radius: 0 !important;
  background: none !important; box-shadow: none !important; color: var(--bs-body-color); font-size: .9375rem; font-weight: 500; white-space: nowrap; transition: color .15s, border-color .15s; }
.page-tabs .nav-link i { font-size: 1.1rem; margin: 0 !important; opacity: .75; }
.page-tabs .nav-link:hover { color: var(--bs-primary); border-bottom-color: rgba(var(--bs-primary-rgb), .35) !important; }
.page-tabs .nav-link.active { color: var(--bs-primary); border-bottom-color: var(--bs-primary) !important; font-weight: 600; }
.page-tabs .nav-link.active i { opacity: 1; }
.page-tabs .nav-link::before, .page-tabs .nav-link::after, .page-tabs ~ .tab-slider, .page-tabs .tab-slider { display: none !important; }
@media (max-width: 1199.98px) { .page-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; } .page-tabs::-webkit-scrollbar { display: none; } .page-tabs .nav-item { flex: 0 0 auto; } }
