/*
 * Page building blocks for the redesigned pages (login, sales, products,
 * customers, ...), in the same look as the new POS and dashboard. Colours
 * come from bq.css's --mc-* / --bq-* variables (light and dark).
 *
 *   .pg              page wrapper (hides the old content header)
 *   .pg-head         title, subtitle and action buttons
 *   .pg-kpis/.pg-kpi small stat cards
 *   .pg-card         white card; .pg-card-h its header
 *   .pg-tools        search box + filter chips above a table
 *   .pg-table        table look (also used for DataTables)
 *   .pg-form/.pg-f   form grid and fields
 *   .pg-btn          buttons (.pri gradient, .ghost, .danger, .ic icon-only)
 *   .pg-badge        status pills (.ok .warn .bad .info)
 */

/* ---------- Page ---------- */
body.skin-bq .content-wrapper:has(.pg) > .content-header { display: none; }
body.skin-bq .content-wrapper:has(.pg) > .content { padding: 0; }
.pg { padding: 22px 24px 30px; color: var(--mc-text); }
.pg a { color: inherit; }
.pg-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.pg-head h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.pg-head p { margin: 4px 0 0; color: var(--mc-muted); font-size: 13px; }
.pg-head .pg-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.pg-back { display: inline-flex; align-items: center; gap: 6px; color: var(--mc-muted) !important; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.pg-back:hover { color: var(--mc-accent) !important; }

/* ---------- Buttons ---------- */
.pg-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
    border-radius: 12px; border: 1px solid var(--mc-border); background: var(--mc-surface); color: var(--mc-text) !important;
    font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap; text-decoration: none !important;
    box-shadow: var(--mc-shadow); transition: transform .12s, box-shadow .12s, background .12s;
}
.pg-btn:hover { background: var(--mc-surface-2); }
.pg-btn:active { transform: translateY(1px); }
.pg-btn.pri { background: var(--bq-grad); color: #fff !important; border-color: transparent; box-shadow: var(--bq-glow); }
.pg-btn.pri:hover { filter: brightness(1.05); }
/* Paint gradients across transparent borders as one image. The default
   padding-box + repeat otherwise tiles the opposite colour into the edge. */
html body :is(.pg-btn.pri, .btn-primary, .btn.bg-primary, .pg-resume, .mp-pay, .mp-cz-btn.pri, .bq-btn.pri) {
    background-origin: border-box !important;
    background-repeat: no-repeat !important;
}
.pg-btn.ghost { background: transparent; box-shadow: none; }
.pg-btn.danger { color: var(--mc-danger) !important; }
.pg-btn.sm { height: 32px; padding: 0 12px; font-size: 12px; border-radius: 10px; }
.pg-btn.ic { width: 34px; height: 34px; padding: 0; border-radius: 10px; box-shadow: none; }
.pg-btn .i { flex: none; }
.pg-btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- KPI cards ---------- */
.pg-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.pg-kpi {
    background: var(--mc-surface); border: 1px solid var(--mc-border); border-radius: 18px; box-shadow: var(--mc-shadow);
    padding: 14px 16px; min-width: 0;
}
.pg-kpi small { display: block; color: var(--mc-muted); font-size: 12px; font-weight: 600; }
.pg-kpi b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-kpi span { display: block; color: var(--mc-muted); font-size: 12px; margin-top: 2px; }
.pg-kpi.hero { background: var(--bq-grad); color: #fff; border-color: transparent; box-shadow: var(--bq-glow); }
.pg-kpi.hero small, .pg-kpi.hero span { color: rgba(255, 255, 255, .8); }

/* ---------- Cards ---------- */
.pg-card {
    background: var(--mc-surface); border: 1px solid var(--mc-border); border-radius: 20px; box-shadow: var(--mc-shadow);
    padding: 18px; margin-bottom: 16px; min-width: 0;
}
.pg-card-h { display: flex; align-items: center; gap: 10px; margin: -2px 0 14px; }
.pg-card-h h2, .pg-card-h h3 { margin: 0; font-size: 16px; font-weight: 800; }
.pg-card-h p { margin: 2px 0 0; color: var(--mc-muted); font-size: 12px; }
.pg-card-h .pg-actions { margin-left: auto; display: flex; gap: 8px; }
.pg-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.pg-grid.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

/* ---------- Toolbar ---------- */
.pg-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.pg-search {
    position: relative; flex: 1 1 260px; max-width: 420px;
}
.pg-search > .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--mc-muted); pointer-events: none; }
.pg-search input {
    width: 100%; height: 40px; padding: 0 12px 0 38px; border-radius: 12px; border: 1px solid var(--mc-border);
    background: var(--mc-surface-2); color: var(--mc-text); font-size: 14px; outline: none;
}
.pg-search input:focus { border-color: var(--mc-accent); background: var(--mc-surface); box-shadow: 0 0 0 3px var(--mc-accent-soft); }
.pg-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.pg-chip {
    height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--mc-border); background: var(--mc-surface);
    color: var(--mc-muted); font-weight: 700; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.pg-chip:hover { color: var(--mc-text); }
.pg-chip.on { background: var(--mc-text); color: var(--mc-surface); border-color: var(--mc-text); }
.pg-tools .pg-right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Filter panel (dates, customer, ...) */
.pg-filter { display: none; }
.pg-filter.open { display: block; }
.pg-filter .pg-form { margin-bottom: 4px; }

/* ---------- Table ---------- */
.pg-table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
.pg table.pg-table, .pg .pg-table table { width: 100% !important; border-collapse: separate !important; border-spacing: 0; margin: 0 !important; }
.pg .pg-table > thead > tr > th, .pg .pg-table thead th {
    background: transparent !important; color: var(--mc-muted) !important; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .05em; padding: 10px 10px !important; border: 0 !important;
    border-bottom: 1px solid var(--mc-border) !important; white-space: nowrap; vertical-align: bottom;
}
.pg .pg-table > tbody > tr > td, .pg .pg-table tbody td {
    padding: 12px 10px !important; border: 0 !important; border-bottom: 1px solid var(--mc-border) !important;
    background: transparent !important; color: var(--mc-text); vertical-align: middle; font-size: 13px;
}
.pg .pg-table > tbody > tr:hover > td { background: var(--mc-surface-2) !important; }
.pg .pg-table > tbody > tr:last-child > td { border-bottom: 0 !important; }
.pg .pg-table > tfoot > tr > th, .pg .pg-table > tfoot > tr > td {
    background: var(--mc-surface-2) !important; border: 0 !important; padding: 10px !important; font-weight: 800; color: var(--mc-text);
}
.pg .pg-table > tfoot > tr > th:first-child { border-radius: 12px 0 0 12px; }
.pg .pg-table > tfoot > tr > th:last-child { border-radius: 0 12px 12px 0; }
.pg .pg-table .num, .pg .pg-table td.text-right { text-align: right; font-variant-numeric: tabular-nums; }
.pg .pg-table td.nowrap, .pg .pg-table th.nowrap { white-space: nowrap; }
.pg .pg-table .dataTables_empty { color: var(--mc-muted); padding: 40px 0 !important; text-align: center; }
/* Old table striping / borders off */
.pg .pg-table.table-striped > tbody > tr:nth-of-type(odd) > td { background: transparent !important; }
.pg .pg-table.table-bordered, .pg .pg-table.table-bordered td, .pg .pg-table.table-bordered th { border-left: 0 !important; border-right: 0 !important; border-top: 0 !important; }
/* DataTables filter row (the per-column search inputs in tfoot) */
.pg .pg-table tfoot input, .pg .pg-table tfoot select {
    width: 100%; height: 32px; border-radius: 9px; border: 1px solid var(--mc-border); background: var(--mc-surface); padding: 0 8px;
    color: var(--mc-text); font-size: 12px; font-weight: 500;
}

/* Cell helpers */
.pg-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pg-av {
    width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center;
    background: var(--mc-accent-soft); color: var(--mc-accent); font-weight: 800; font-size: 13px;
}
.pg-who b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-who small { display: block; color: var(--mc-muted); font-size: 12px; }
.pg-thumb { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: var(--mc-surface-2); flex: none; }
/* Reserve table thumbnail space even before the image finishes loading. */
.pg img.pg-table-thumb { width: 32px; height: 32px; object-fit: contain; }
.pg-muted { color: var(--mc-muted); }
.pg-money { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pg-row-actions { display: inline-flex; gap: 4px; justify-content: flex-end; white-space: nowrap; }
.pg-row-actions .btn, .pg-row-actions a, .pg-row-actions button {
    width: 32px; height: 32px; border-radius: 9px !important; display: inline-grid !important; place-items: center; padding: 0 !important;
    background: var(--mc-surface-2) !important; color: var(--mc-muted) !important; border: 0 !important; box-shadow: none !important; font-size: 13px;
}
.pg-row-actions .btn:hover, .pg-row-actions a:hover { color: var(--mc-accent) !important; background: var(--mc-accent-soft) !important; }
.pg-row-actions .btn-danger:hover, .pg-row-actions a.po-delete:hover, .pg-row-actions a[href*="delete"]:hover { color: var(--mc-danger) !important; }
.pg-row-actions .btn-group { display: inline-flex; gap: 4px; }

/* ---------- Badges ---------- */
.pg-badge, .pg .pg-table .label {
    display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 999px;
    font-size: 11px; font-weight: 700; white-space: nowrap; background: var(--mc-surface-2) !important; color: var(--mc-muted) !important;
    text-decoration: none !important; line-height: 24px;
}
.pg-badge.ok, .pg .pg-table .label-success { background: color-mix(in srgb, var(--mc-success) 15%, transparent) !important; color: var(--mc-success) !important; }
.pg-badge.warn, .pg .pg-table .label-warning, .pg .pg-table .label-primary { background: color-mix(in srgb, var(--mc-warning) 18%, transparent) !important; color: color-mix(in srgb, var(--mc-warning) 75%, var(--mc-text)) !important; }
.pg-badge.bad, .pg .pg-table .label-danger { background: color-mix(in srgb, var(--mc-danger) 14%, transparent) !important; color: var(--mc-danger) !important; }
.pg-badge.info, .pg .pg-table .label-info { background: color-mix(in srgb, var(--mc-info) 14%, transparent) !important; color: var(--mc-info) !important; }

/* ---------- DataTables controls inside .pg ---------- */
.pg .dataTables_wrapper { padding: 0; }
.pg .dataTables_wrapper .row { margin: 0; }
.pg .dataTables_wrapper .row > [class*="col-"] { padding: 0; }
.pg .dataTables_length, .pg .dataTables_info { color: var(--mc-muted); font-size: 12px; }
.pg .dataTables_length select {
    height: 32px; border-radius: 9px; border: 1px solid var(--mc-border); background: var(--mc-surface); color: var(--mc-text); padding: 0 6px; margin: 0 4px;
}
.pg .dataTables_paginate .pagination { margin: 0; display: inline-flex; gap: 4px; }
.pg .dataTables_paginate .pagination > li > a, .pg .dataTables_paginate .pagination > li > span {
    border-radius: 9px !important; border: 1px solid var(--mc-border) !important; background: var(--mc-surface) !important;
    color: var(--mc-text) !important; min-width: 34px; height: 34px; line-height: 20px; text-align: center; margin: 0 !important; font-weight: 600;
}
.pg .dataTables_paginate .pagination > .active > a { background: var(--bq-grad) !important; color: #fff !important; border-color: transparent !important; }
.pg .dataTables_paginate .pagination > .disabled > a { opacity: .45; }
.pg .dt-buttons .btn, .pg .dt-buttons .dt-button {
    height: 32px; border-radius: 9px !important; border: 1px solid var(--mc-border) !important; background: var(--mc-surface) !important;
    color: var(--mc-muted) !important; font-size: 12px; font-weight: 700; padding: 0 10px; box-shadow: none !important; margin-right: 4px;
}
.pg .dt-buttons .btn:hover { color: var(--mc-text) !important; }
.pg-dt-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.pg-dt-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.pg-dt-top .dt-buttons { margin-left: auto; }
.pg-dt-top.pg-dt-in { margin: 0; gap: 8px; }
/* Page size in the toolbar: just the box ("25"), same height as the buttons. */
.pg-dt-in .dataTables_length label { margin: 0; font-size: 0; display: flex; align-items: center; }
.pg-dt-in .dataTables_length select { font-size: 13px; height: 34px !important; min-height: 0 !important; padding: 0 28px 0 12px !important; margin: 0 !important; }
.pg-dt-in .dataTables_length .select2-container { font-size: 13px; }
.pg-dt-top.pg-dt-in .dt-buttons { margin-left: 0; }

/* ---------- Forms ---------- */
.pg-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.pg-form.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pg-form.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pg-form .wide { grid-column: 1 / -1; }
.pg-f { min-width: 0; margin: 0; }
.pg-f > label, .pg-f .control-label { display: block; font-size: 12px; font-weight: 700; color: var(--mc-muted); margin: 0 0 6px; }
.pg-f .pg-hint { display: block; color: var(--mc-muted); font-size: 11px; margin-top: 5px; }
.pg .form-control, .pg-f input[type="text"], .pg-f input[type="number"], .pg-f input[type="email"], .pg-f input[type="password"], .pg-f input[type="file"], .pg-f textarea, .pg-f select {
    width: 100%; min-height: 42px; border-radius: 12px !important; border: 1px solid var(--mc-border) !important;
    background: var(--mc-surface-2) !important; color: var(--mc-text) !important; padding: 8px 12px; font-size: 14px; box-shadow: none !important;
}
.pg .form-control:focus, .pg-f input:focus, .pg-f textarea:focus, .pg-f select:focus {
    border-color: var(--mc-accent) !important; background: var(--mc-surface) !important; box-shadow: 0 0 0 3px var(--mc-accent-soft) !important; outline: none;
}
.pg textarea.form-control { min-height: 90px; }
.pg .select2-container .select2-selection--single,
.pg .select2-container .select2-selection--multiple { min-height: 42px; border-radius: 12px !important; border: 1px solid var(--mc-border) !important; background: var(--mc-surface-2) !important; }
.pg .select2-container .select2-selection--single .select2-selection__rendered { line-height: 40px; padding-left: 12px; color: var(--mc-text); }
.pg .select2-container .select2-selection--single .select2-selection__arrow { height: 40px; }
.pg .input-group .input-group-addon { border-radius: 12px 0 0 12px !important; background: var(--mc-surface) !important; border-color: var(--mc-border) !important; color: var(--mc-muted); }
.pg .input-group .form-control:last-child { border-radius: 0 12px 12px 0 !important; }
.pg-form-foot { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--mc-border); }
.pg-section-t { grid-column: 1 / -1; margin: 6px 0 -4px; font-size: 13px; font-weight: 800; color: var(--mc-text); display: flex; align-items: center; gap: 8px; }
.pg-section-t::after { content: ''; flex: 1; height: 1px; background: var(--mc-border); }
.pg .help-block { color: var(--mc-muted); font-size: 11px; }
.pg-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 13px; }

/* Definition list (view pages) */
.pg-dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: 13px; }
.pg-dl dt { color: var(--mc-muted); font-weight: 600; }
.pg-dl dd { margin: 0; font-weight: 600; text-align: right; }
.pg-total-row { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0; border-bottom: 1px dashed var(--mc-border); font-size: 13px; }
.pg-total-row:last-child { border-bottom: 0; }
.pg-total-row.big { font-size: 18px; font-weight: 800; }
.pg-total-row span { color: var(--mc-muted); }

/* Empty state */
.pg-empty { text-align: center; color: var(--mc-muted); padding: 40px 10px; }
.pg-empty .i { margin: 0 auto 10px; opacity: .6; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .pg-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pg-grid, .pg-grid.even { grid-template-columns: minmax(0, 1fr); }
    .pg-form.cols-3, .pg-form.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
    .pg { padding: 16px 12px 90px; }
    .pg-head h1 { font-size: 22px; }
    .pg-head .pg-actions { margin-left: 0; width: 100%; }
    .pg-head .pg-actions .pg-btn { flex: 1; }
    .pg-kpi b { font-size: 18px; }
    .pg-form, .pg-form.cols-3, .pg-form.cols-4 { grid-template-columns: minmax(0, 1fr); }
    .pg-card { padding: 14px; border-radius: 18px; }
    .pg-table-wrap { margin: 0 -14px; padding: 0 14px; }
    .pg-search { max-width: none; }
}

/* ---------- Login (auth/login.php) ---------- */
html:has(body.lg-page), body.lg-page { min-height: 100%; }
body.lg-page { margin: 0; background: var(--bq-page) fixed !important; color: var(--mc-text); }
.lg { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); padding: 16px; gap: 16px; }
html[data-fs="l"] .lg { min-height: calc(100dvh / 1.12); }
html[data-fs="s"] .lg { min-height: calc(100dvh / .9); }
.lg-brand {
    position: relative; overflow: hidden; border-radius: 28px; background: var(--bq-grad); color: #fff; box-shadow: var(--bq-glow);
    display: flex; flex-direction: column; padding: 40px;
}
.lg-mark {
    width: 64px; height: 64px; border-radius: 20px; background: rgba(255, 255, 255, .22); display: grid; place-items: center;
    font-weight: 800; font-size: 22px; letter-spacing: -.02em; backdrop-filter: blur(6px); overflow: hidden; position: relative; z-index: 1;
}
.lg-mark img { max-width: 100%; max-height: 100%; }
.lg-brand-body { margin-top: auto; position: relative; z-index: 1; }
.lg-brand-body h1 { margin: 0; font-size: 44px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; color: #fff; }
.lg-brand-body p { margin: 12px 0 0; font-size: 16px; color: rgba(255, 255, 255, .85); max-width: 360px; }
.lg-clock { margin-top: 28px; position: relative; z-index: 1; }
.lg-clock .clock { display: inline-block; padding: 8px 14px; border-radius: 12px; background: rgba(255, 255, 255, .18); font-size: 13px; font-weight: 600; color: #fff; }
.lg-clock .clock:empty { display: none; }
.lg-orb { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.lg-orb.a { width: 420px; height: 420px; right: -140px; top: -120px; }
.lg-orb.b { width: 260px; height: 260px; right: 60px; bottom: -120px; background: rgba(255, 255, 255, .09); }
.lg-form {
    position: relative; border-radius: 28px; background: var(--mc-surface); border: 1px solid var(--mc-border); box-shadow: var(--mc-shadow);
    display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px 24px;
}
.lg-form-in { width: 100%; max-width: 380px; margin: auto 0; }
.lg-form h2 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.02em; color: var(--mc-text); }
.lg-sub { margin: 6px 0 26px; color: var(--mc-muted); }
.lg-scheme { position: absolute; top: 18px; right: 18px; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--mc-border); background: var(--mc-surface-2); color: var(--mc-muted); display: grid; place-items: center; cursor: pointer; }
.lg-scheme .i:last-child { display: none; }
body.bq-dark .lg-scheme .i:first-child { display: none; }
body.bq-dark .lg-scheme .i:last-child { display: block; }
.lg-f { display: grid; gap: 16px; }
.lg-field { position: relative; display: block; margin: 0; }
.lg-field > span { display: block; font-size: 12px; font-weight: 700; color: var(--mc-muted); margin-bottom: 6px; }
.lg-field > i { position: absolute; left: 14px; bottom: 15px; color: var(--mc-muted); pointer-events: none; }
.lg-field input {
    width: 100%; height: 50px; border-radius: 14px; border: 1px solid var(--mc-border); background: var(--mc-surface-2);
    padding: 0 46px 0 44px; font-size: 15px; color: var(--mc-text); outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
.lg-field input:focus { border-color: var(--mc-accent); background: var(--mc-surface); box-shadow: 0 0 0 4px var(--mc-accent-soft); }
.lg-eye { position: absolute; right: 8px; bottom: 8px; width: 34px; height: 34px; border-radius: 10px; border: 0; background: none; color: var(--mc-muted); display: grid; place-items: center; cursor: pointer; }
.lg-eye.on { color: var(--mc-accent); background: var(--mc-accent-soft); }
.lg-pw:not(.show) { -webkit-text-security: disc; text-security: disc; letter-spacing: .08em; }
.lg-pw:not(.show)::placeholder { letter-spacing: normal; }
.lg-captcha { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: end; }
.lg-captcha-img img { border-radius: 10px; display: block; }
.lg-remember { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 600; font-size: 13px; color: var(--mc-muted); cursor: pointer; user-select: none; }
.lg-remember input { position: absolute; opacity: 0; pointer-events: none; }
.lg-toggle { width: 38px; height: 22px; border-radius: 11px; background: var(--mc-border); position: relative; transition: background .15s; flex: none; }
.lg-toggle::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.lg-remember input:checked + .lg-toggle { background: var(--mc-accent); }
.lg-remember input:checked + .lg-toggle::after { transform: translateX(16px); }
.lg-remember input:focus-visible + .lg-toggle { outline: 2px solid var(--mc-accent); outline-offset: 3px; }
.lg-submit {
    height: 52px; border-radius: 14px; border: 0; background: var(--bq-grad); color: #fff; font-size: 16px; font-weight: 800; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px; box-shadow: var(--bq-glow); margin-top: 4px;
}
.lg-submit:hover { filter: brightness(1.05); }
.lg-submit.busy { opacity: .7; pointer-events: none; }
.lg-alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; font-size: 13px; margin-bottom: 16px; }
.lg-alert p { margin: 0; }
.lg-alert.bad { background: color-mix(in srgb, var(--mc-danger) 12%, transparent); color: var(--mc-danger); }
.lg-alert.ok { background: color-mix(in srgb, var(--mc-success) 12%, transparent); color: var(--mc-success); }
.lg-foot { margin: 20px 0 0; color: var(--mc-muted); font-size: 12px; }
@media (max-width: 860px) {
    .lg { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; padding: 12px; }
    .lg-brand { padding: 24px; min-height: 0; flex-direction: row; align-items: center; gap: 14px; }
    .lg-mark { width: 48px; height: 48px; border-radius: 14px; font-size: 16px; }
    .lg-brand-body { margin: 0; }
    .lg-brand-body h1 { font-size: 24px; }
    .lg-brand-body p, .lg-clock { display: none; }
    .lg-form { padding: 32px 18px 18px; }
}

/* ---------- Small extras ---------- */
.pg-btn.on { border-color: var(--mc-accent); color: var(--mc-accent) !important; background: var(--mc-accent-soft); }
.pg .pg-table tbody tr.row-selected > td { background: var(--mc-accent-soft) !important; }
.pg .pg-table.selectable-rows tbody tr[id] { cursor: pointer; }
.pg .pg-table .nowrap { white-space: nowrap; }
.pg .pg-table a.pg-badge:hover { filter: brightness(.95); }
.pg-row-actions a.truck-packing { color: var(--mc-danger) !important; }
.pg-row-actions a.truck-delivering { color: var(--mc-info) !important; }
.pg-row-actions a.truck-delivered { color: var(--mc-success) !important; }
.pg .dt-button-collection { border-radius: 14px; background: var(--mc-surface); border: 1px solid var(--mc-border); box-shadow: var(--mc-shadow-lg); padding: 6px; }
.pg .dt-button-collection .dt-button { display: block; width: 100%; text-align: left; margin: 2px 0; }
.pg .dt-button-collection .dt-button.active { color: var(--mc-accent) !important; background: var(--mc-accent-soft) !important; }
.pg .pg-table thead th.sorting, .pg .pg-table thead th.sorting_asc, .pg .pg-table thead th.sorting_desc { padding-right: 24px !important; }
.pg-search input::placeholder { font-weight: 400; color: var(--mc-muted); }
.pg .dt-buttons .btn, .pg .dt-buttons .dt-button { display: inline-flex; align-items: center; }

/* Phone: .pg-cards tables show each row as a card (labels from page.js). */
@media (max-width: 767px) {
    .pg-table-wrap:has(.pg-cards) { overflow: visible; margin: 0; padding: 0; }
    .pg table.pg-cards, .pg table.pg-cards > tbody { display: block; width: 100% !important; }
    .pg table.pg-cards > thead, .pg table.pg-cards > tfoot { display: none; }
    .pg table.pg-cards > tbody > tr {
        display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; padding: 12px 14px; margin-bottom: 10px;
        border: 1px solid var(--mc-border); border-radius: 16px; background: var(--mc-surface);
    }
    .pg table.pg-cards > tbody > tr > td { display: block; padding: 0 !important; border: 0 !important; text-align: left !important; min-width: 0; background: transparent !important; }
    .pg table.pg-cards > tbody > tr > td::before {
        content: attr(data-label); display: block; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--mc-muted); margin-bottom: 2px;
    }
    .pg table.pg-cards > tbody > tr > td.pg-c-main,
    .pg table.pg-cards > tbody > tr > td.pg-c-act { grid-column: 1 / -1; }
    .pg table.pg-cards > tbody > tr > td.pg-c-main::before,
    .pg table.pg-cards > tbody > tr > td.pg-c-act::before,
    .pg table.pg-cards > tbody > tr > td.pg-c-id::before { display: none; }
    .pg table.pg-cards > tbody > tr > td.pg-c-main { order: -2; padding-bottom: 8px !important; border-bottom: 1px dashed var(--mc-border) !important; }
    .pg table.pg-cards > tbody > tr > td.pg-c-id { order: -3; grid-column: 1 / -1; color: var(--mc-muted); font-size: 12px; }
    .pg table.pg-cards > tbody > tr > td.pg-c-act { padding-top: 8px !important; border-top: 1px dashed var(--mc-border) !important; }
    .pg table.pg-cards > tbody > tr > td.pg-c-act .pg-row-actions { justify-content: flex-start; }
    .pg table.pg-cards > tbody > tr > td.dataTables_empty { grid-column: 1 / -1; text-align: center !important; }
    .pg table.pg-cards > tbody > tr > td.dataTables_empty::before { display: none; }
    .pg table.pg-cards > tbody > tr:hover > td { background: transparent !important; }
    .pg table.pg-cards > tbody > tr > td.num { text-align: left !important; }
    .pg table.pg-cards > tbody > tr > td .text-right, .pg table.pg-cards > tbody > tr > td .text-center { text-align: left !important; }
    .pg table.pg-cards > tbody > tr > td .nowrap { white-space: normal; }
    .pg .pg-dt-top .dataTables_length { display: none; }
    .pg table.pg-cards > tbody > tr > td.pg-c-main { font-size: 15px; font-weight: 700; color: var(--mc-text); }
    .pg table.pg-cards > tbody > tr > td.pg-c-id { font-weight: 700; }
    /* Phone: cards show every column, so no column picker; paging centred. */
    .pg .dt-buttons .buttons-colvis { display: none !important; }
    .pg-dt-foot { justify-content: center; flex-direction: column-reverse; gap: 8px; }
    .pg table.pg-cards > tbody > tr > td.dataTables_empty { border: 0 !important; padding: 34px 0 !important; }
    .pg table.pg-cards > tbody > tr:has(> td.dataTables_empty) { border-style: dashed; background: transparent; }
}
/* Lists: page numbers as round chips, "1–3 of 3" small and quiet. */
.pg .dataTables_paginate .pagination > li > a, .pg .dataTables_paginate .pagination > li > span { border-radius: 999px !important; padding: 6px 12px; }
.pg .dataTables_paginate .pagination > li.previous > a, .pg .dataTables_paginate .pagination > li.next > a { font-size: 18px; line-height: 18px; padding: 6px 10px; }
.pg .dataTables_paginate .pagination > .disabled > a { opacity: .35; }
.pg .dataTables_info { padding-top: 0 !important; }
/* Older forms: info boxes and buttons take the page look. */
.pg .well { background: rgba(185, 112, 127, .07); border: 1px solid var(--mc-border); border-radius: 16px; box-shadow: none; padding: 14px 16px; color: var(--mc-text); }
.pg .well .text-info, .pg .well .text-primary, .pg .well .text-success { color: var(--mc-text); }
.pg .well b { color: var(--mc-accent, #b9707f); }
.pg .btn-info { background: var(--mc-surface) !important; color: var(--mc-text) !important; border: 1px solid var(--mc-border) !important; font-weight: 700; }

/* ---------- Modals (add/edit payment, payments, loan, quick views) ---------- */
body.skin-bq .modal-content {
    background: var(--mc-surface) !important; color: var(--mc-text); border: 1px solid var(--mc-border) !important;
    border-radius: 24px !important; box-shadow: var(--mc-shadow-lg) !important; overflow: hidden;
}
body.skin-bq .modal-header { border: 0 !important; padding: 20px 22px 6px !important; background: transparent !important; }
body.skin-bq .modal-header .modal-title { font-size: 18px; font-weight: 800; letter-spacing: -.01em; color: var(--mc-text); }
body.skin-bq .modal-header .close, body.skin-bq .modal-body > .close {
    width: 34px; height: 34px; border-radius: 10px; background: var(--mc-surface-2); opacity: 1; color: var(--mc-muted);
    text-shadow: none; font-size: 16px; display: grid; place-items: center; margin: -4px -6px 0 0;
}
body.skin-bq .modal-body { padding: 14px 22px !important; }
body.skin-bq .modal-footer { border-top: 1px solid var(--mc-border) !important; padding: 14px 22px !important; background: var(--mc-surface-2) !important; }
body.skin-bq .modal .form-group > label, body.skin-bq .modal .control-label { font-size: 12px; font-weight: 700; color: var(--mc-muted); margin-bottom: 6px; }
body.skin-bq .modal .form-control {
    min-height: 42px; border-radius: 12px !important; border: 1px solid var(--mc-border) !important; background: var(--mc-surface-2) !important;
    color: var(--mc-text) !important; box-shadow: none !important;
}
body.skin-bq .modal .form-control:focus { border-color: var(--mc-accent) !important; background: var(--mc-surface) !important; box-shadow: 0 0 0 3px var(--mc-accent-soft) !important; }
body.skin-bq .modal .select2-container .select2-selection--single { min-height: 42px; border-radius: 12px !important; border: 1px solid var(--mc-border) !important; background: var(--mc-surface-2) !important; }
body.skin-bq .modal .select2-container .select2-selection--single .select2-selection__rendered { line-height: 40px; }
body.skin-bq .modal .select2-container .select2-selection--single .select2-selection__arrow { height: 40px; }
body.skin-bq .modal .table { border-collapse: separate; border-spacing: 0; }
body.skin-bq .modal .table > thead > tr > th {
    background: transparent !important; color: var(--mc-muted) !important; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
    border: 0 !important; border-bottom: 1px solid var(--mc-border) !important;
}
body.skin-bq .modal .table > tbody > tr > td, body.skin-bq .modal .table > tfoot > tr > * {
    border: 0 !important; border-bottom: 1px solid var(--mc-border) !important; background: transparent !important; color: var(--mc-text);
}
body.skin-bq .modal .well, body.skin-bq .modal .panel { background: var(--mc-surface-2) !important; border: 0 !important; border-radius: 16px !important; box-shadow: none !important; }
body.skin-bq .modal .btn-primary { min-height: 42px; padding: 0 18px; font-weight: 700; }
body.skin-bq .modal .btn-default { min-height: 42px; border-radius: 12px !important; background: var(--mc-surface) !important; border: 1px solid var(--mc-border) !important; color: var(--mc-text) !important; }
.pg-row-actions a.pg-resume { width: auto !important; padding: 0 12px !important; display: inline-flex !important; gap: 6px; align-items: center; background: var(--bq-grad) !important; color: #fff !important; font-weight: 700; font-size: 12px; }
.pg-row-actions a.pg-resume:hover { color: #fff !important; filter: brightness(1.05); }
.pg-chips-scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.pg-chips-scroll::-webkit-scrollbar { display: none; }
.pg-chips-scroll .pg-chip { flex: none; text-decoration: none !important; }
a.pg-kpi { text-decoration: none !important; color: inherit !important; transition: transform .12s; }
a.pg-kpi:hover { transform: translateY(-2px); }
select.pg-btn { appearance: auto; padding-right: 10px; }
.pg .pg-av.pg-thumb { width: 40px; height: 40px; }

.pg .pg-table > thead > tr > th, .pg .pg-table > tbody > tr > td { text-align: left; }
.pg .pg-table > :is(thead, tbody, tfoot) > tr > :is(th, td).text-center { text-align: center !important; }
.pg .pg-table > :is(thead, tbody, tfoot) > tr > :is(th, td).text-right { text-align: right !important; }
.pg .pg-table > :is(thead, tfoot) > tr > .pg-align-right { text-align: right !important; }
.pg .pg-table > :is(thead, tfoot) > tr > .pg-align-center { text-align: center !important; }
.pg .pg-table > tbody > tr > td.num, .pg .pg-table > tfoot > tr > th.num, .pg .pg-table > thead > tr > th.num { text-align: right !important; }
.pg .pg-table > tfoot > tr > th { text-align: left; }
.pg-who { text-align: left; }

/* ---------- Product add / edit ---------- */
.pr-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.pr-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.pr-fields > .form-group { margin-bottom: 14px; min-width: 0; }
.pr-fields > .form-group:has(#name), .pr-fields > .form-group:has(#image), .pr-fields > .form-group:has(#type) { grid-column: 1 / -1; }
.pg .form-group > label { font-size: 12px; font-weight: 700; color: var(--mc-muted); margin-bottom: 6px; }
.pg .pr-side .well { background: var(--mc-surface-2) !important; border: 0 !important; border-radius: 16px !important; box-shadow: none !important; padding: 14px; margin-bottom: 12px; }
.pg .pr-side .well h4 { margin: 0 0 10px; font-size: 14px; font-weight: 800; }
.pg .pr-side .well .form-control { background: var(--mc-surface) !important; }
.pg input[type="file"] { padding: 9px 12px; width: 100%; border: 1px dashed var(--mc-border); border-radius: 12px; background: var(--mc-surface-2); }
.pg input[type="file"][hidden] { display: none !important; }
.pg .redactor-box, .pg .redactor-editor { border-radius: 12px; border-color: var(--mc-border) !important; }
.pg .table.items > thead > tr > th { font-size: 11px; text-transform: uppercase; color: var(--mc-muted); background: transparent !important; }
@media (max-width: 1100px) { .pr-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 767px) { .pr-fields { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Old form markup inside a new page (pgify) ---------- */
.pg-card.pg-narrow { max-width: 760px; }
.pg-narrow .row { margin: 0; }
.pg-narrow [class*="col-"] { width: 100%; float: none; padding: 0; }
.pg-narrow form > .row > [class*="col-"], .pg-narrow form > [class*="col-"], .pg-narrow .pg-auto { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.pg-narrow .form-group { margin-bottom: 14px; min-width: 0; }
.pg-narrow .form-group:has(input[type="submit"]), .pg-narrow .form-group:has(textarea), .pg-narrow .form-group:has(.btn) { grid-column: 1 / -1; }
.pg-narrow .form-group:has(input[type="submit"]) { display: flex; flex-direction: row-reverse; justify-content: flex-start; gap: 10px; border-top: 1px solid var(--mc-border); padding-top: 16px; margin: 6px 0 0; }
.pg .btn { height: 42px; padding: 0 18px; border-radius: 12px !important; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.pg .btn-primary:not(.btn-cancel) { background: var(--bq-grad) !important; border: 0 !important; color: #fff !important; box-shadow: var(--bq-glow); }
body.skin-bq .pg .btn-cancel, body.skin-bq .pg .btn-default { background: var(--mc-surface) !important; border: 1px solid var(--mc-border) !important; color: var(--mc-text) !important; box-shadow: none !important; }
@media (max-width: 767px) { .pg-narrow form > .row > [class*="col-"], .pg-narrow form > [class*="col-"], .pg-narrow .pg-auto { grid-template-columns: minmax(0, 1fr); } }
.pg-narrow .form-group:has(input[type="submit"]) .btn { margin: 0 !important; }

/* ---------- Old list pages inside .pg (pglist) ---------- */
.pg .dt-buttons .buttons-copy, .pg .dt-buttons .buttons-pdf { display: none !important; }
.pg .pg-table td .btn-group { display: inline-flex; gap: 4px; flex-wrap: nowrap; }
.pg .pg-table td .btn-group > .btn, .pg .pg-table td .btn-group > a {
    width: 32px; height: 32px; border-radius: 9px !important; display: inline-grid !important; place-items: center; padding: 0 !important; margin: 0 !important;
    background: var(--mc-surface-2) !important; color: var(--mc-muted) !important; border: 0 !important; box-shadow: none !important; font-size: 13px;
}
.pg .pg-table td .btn-group > a:hover { color: var(--mc-accent) !important; background: var(--mc-accent-soft) !important; }
.pg .pg-table td .text-center:has(> .btn-group) { text-align: right; }
.pg #form.panel, .pg .panel {
    background: var(--mc-surface-2) !important; border: 0 !important; border-radius: 16px !important; box-shadow: none !important; margin-bottom: 16px;
}
.pg .panel > .panel-heading { background: transparent !important; border: 0 !important; font-weight: 800; color: var(--mc-text) !important; padding: 14px 16px 0; }
.pg .panel > .panel-body { padding: 14px 16px; }
.pg #form .form-control, .pg .panel .form-control { background: var(--mc-surface) !important; }
.pg #form .row { display: flex; flex-wrap: wrap; }
.pg .box, .pg .box-body { background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0; }
.pg > .pg-card > .table-responsive, .pg .pg-card .table-responsive { border: 0; margin: 0; }
.pg .pg-table tfoot tr + tr th { background: transparent !important; padding-top: 6px !important; }
@media (max-width: 767px) { .pg .table-responsive:has(.pg-cards) { overflow: visible; } }
/* Desktop: one line per row (long tables scroll sideways inside the card). */
@media (min-width: 768px) {
    .pg .pg-table > tbody > tr > td { white-space: nowrap; }
    .pg .pg-table > tbody > tr > td .pg-who b, .pg .pg-table > tbody > tr > td.pg-wrap { white-space: normal; }
}

/* ---------- Area tabs (partials/pg_tabs.php) ---------- */
.pg-tabs {
    display: flex; gap: 6px; padding: 18px 24px 0; overflow-x: auto; scrollbar-width: none; white-space: nowrap;
}
.pg-tabs::-webkit-scrollbar { display: none; }
.pg-tabs a {
    flex: none; display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border-radius: 999px;
    background: var(--mc-surface); border: 1px solid var(--mc-border); color: var(--mc-muted) !important;
    font-size: 13px; font-weight: 700; text-decoration: none !important; transition: color .12s, background .12s;
}
.pg-tabs a:hover { color: var(--mc-text) !important; }
.pg-tabs a.on { background: var(--bq-grad); color: #fff !important; border-color: transparent; box-shadow: var(--bq-glow); }
.pg-tabs + .content-header, .pg-tabs ~ .content .pg, .content-wrapper:has(.pg-tabs) .pg { padding-top: 14px; }
@media (max-width: 767px) { .pg-tabs { padding: 12px 12px 0; } }

/* ---------- Footer row: totals only (no per-column filter boxes) ---------- */
.pg .pg-table tfoot input, .pg .pg-table tfoot select, .pg .pg-table tfoot .select2, .pg .pg-table tfoot .datepickercon { display: none !important; }

/* ---------- Old tabbed boxes inside .pg (profile) ---------- */
.pg .nav-tabs-custom { background: transparent !important; box-shadow: none !important; border: 0 !important; margin: 0; }
.pg .nav-tabs-custom > .nav-tabs { border: 0 !important; display: flex; gap: 6px; margin-bottom: 14px; background: transparent !important; }
.pg .nav-tabs-custom > .nav-tabs > li { margin: 0 !important; border: 0 !important; }
.pg .nav-tabs-custom > .nav-tabs > li > a {
    border-radius: 999px !important; border: 1px solid var(--mc-border) !important; background: var(--mc-surface) !important;
    color: var(--mc-muted) !important; font-weight: 700; font-size: 13px; padding: 8px 16px; margin: 0 !important;
}
.pg .nav-tabs-custom > .nav-tabs > li.active > a { background: var(--bq-grad) !important; color: #fff !important; border-color: transparent !important; }
.pg .nav-tabs-custom > .tab-content {
    background: var(--mc-surface) !important; border: 1px solid var(--mc-border) !important; border-radius: 20px; box-shadow: var(--mc-shadow); padding: 18px;
}
.pg .nav-tabs-custom > .tab-content .col-lg-6 { float: none; max-width: 640px; padding: 0; }
/* Old floated columns stay inside their card. */
.pg-card { display: flow-root; }
.pg .list-group-item { background: var(--mc-surface-2) !important; border: 0 !important; border-radius: 14px !important; margin-bottom: 8px; padding: 14px 16px; display: flow-root; }
.pg .list-group-item .btn-group { display: inline-flex; gap: 6px; }
.pg .list-group-item .btn { height: 34px; padding: 0 12px; font-size: 12px; }
.pg-subtabs { display: flex; gap: 2px; padding: 10px 24px 0; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.pg-subtabs::-webkit-scrollbar { display: none; }
.pg-subtabs a {
    flex: none; padding: 8px 12px; border-radius: 10px; color: var(--mc-muted) !important; font-size: 13px; font-weight: 600;
    text-decoration: none !important; position: relative;
}
.pg-subtabs a:hover { color: var(--mc-text) !important; background: var(--mc-surface); }
.pg-subtabs a.on { color: var(--mc-accent) !important; background: var(--mc-accent-soft); font-weight: 800; }
@media (max-width: 767px) { .pg-subtabs { padding: 8px 12px 0; } }

/* ---------- Tab styles (Settings > Shop > Tab style; body.tabs-<style>) ----------
 * pill (default, above) | segment | underline | soft | card | icon.
 * Each one styles the area tabs and the report sub-tabs together. */
.pg-tabs a, .pg-subtabs a { gap: 7px; }
.pg-tab-ic { display: none; font-style: normal; line-height: 0; }
.pg-tab-ic svg { display: block; }

/* Segment: one rounded track, the open tab a raised white key. */
.tabs-segment .pg-tabs { width: fit-content; max-width: calc(100% - 48px); margin: 18px 24px 0; padding: 4px; gap: 2px; background: var(--mc-surface-2); border: 1px solid var(--mc-border); border-radius: 14px; }
.tabs-segment .pg-tabs a { height: 34px; padding: 0 16px; border: 0; border-radius: 10px; background: transparent; }
.tabs-segment .pg-tabs a:hover { background: var(--mc-surface); }
.tabs-segment .pg-tabs a.on { background: var(--mc-surface); color: var(--mc-accent) !important; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.06); }
.tabs-segment .pg-subtabs { width: fit-content; max-width: calc(100% - 48px); margin: 10px 24px 0; padding: 3px; background: var(--mc-surface-2); border-radius: 11px; }
.tabs-segment .pg-subtabs a { padding: 6px 12px; border-radius: 8px; font-size: 12.5px; }
.tabs-segment .pg-subtabs a.on { background: var(--mc-surface); color: var(--mc-text) !important; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
@media (max-width: 767px) {
    .tabs-segment .pg-tabs { margin: 12px 12px 0; max-width: calc(100% - 24px); }
    .tabs-segment .pg-subtabs { margin: 8px 12px 0; max-width: calc(100% - 24px); }
}

/* Underline: plain words on a line, the open one underlined in the brand colour. */
.tabs-underline .pg-tabs { gap: 4px; padding-top: 12px; border-bottom: 1px solid var(--mc-border); }
.tabs-underline .pg-tabs a { position: relative; height: 46px; padding: 0 14px; border: 0; border-radius: 0; background: transparent; font-size: 13.5px; }
.tabs-underline .pg-tabs a::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--bq-grad, var(--mc-accent)); transform: scaleX(0); transition: transform .15s; }
.tabs-underline .pg-tabs a:hover::after { transform: scaleX(.4); }
.tabs-underline .pg-tabs a.on { background: transparent; color: var(--mc-accent) !important; box-shadow: none; }
.tabs-underline .pg-tabs a.on::after { transform: none; }
.tabs-underline .pg-subtabs { gap: 6px; padding-top: 12px; }
.tabs-underline .pg-subtabs a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--mc-border); background: var(--mc-surface); font-size: 12.5px; }
.tabs-underline .pg-subtabs a.on { border-color: var(--mc-accent); background: var(--mc-accent-soft); }
@media (max-width: 767px) { .tabs-underline .pg-tabs { padding-top: 4px; } .tabs-underline .pg-tabs a { height: 42px; padding: 0 12px; } }

/* Soft: no outlines, the open tab a light tint of the brand colour. */
.tabs-soft .pg-tabs { gap: 4px; }
.tabs-soft .pg-tabs a { border-color: transparent; background: transparent; border-radius: 12px; }
.tabs-soft .pg-tabs a:hover { background: var(--mc-surface); }
.tabs-soft .pg-tabs a.on { background: var(--mc-accent-soft); color: var(--mc-accent) !important; box-shadow: none; }
.tabs-soft .pg-subtabs { gap: 6px; }
.tabs-soft .pg-subtabs a { padding: 6px 12px; border-radius: 999px; border: 1px dashed var(--mc-border); font-size: 12.5px; }
.tabs-soft .pg-subtabs a.on { border: 1px solid var(--mc-accent); background: transparent; }

/* Card: each tab a small white card, the open one with a brand bar on top. */
.tabs-card .pg-tabs { gap: 8px; padding-bottom: 6px; }
.tabs-card .pg-tabs a { height: 42px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--mc-border); background: var(--mc-surface); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.tabs-card .pg-tabs a.on { background: var(--mc-surface); color: var(--mc-accent) !important; border-color: var(--mc-border); box-shadow: inset 0 3px 0 var(--mc-accent), 0 6px 18px rgba(0,0,0,.08); }
.tabs-card .pg-subtabs { gap: 4px; padding-top: 4px; }
.tabs-card .pg-subtabs a { padding: 7px 12px; border-radius: 10px; font-size: 12.5px; }
.tabs-card .pg-subtabs a.on { background: var(--mc-surface); color: var(--mc-accent) !important; box-shadow: inset 0 -2px 0 var(--mc-accent); border-radius: 10px 10px 4px 4px; }

/* Icon: pills with a small picture before each name. */
.tabs-icon .pg-tab-ic { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-left: -8px; border-radius: 50%; background: var(--mc-accent-soft); color: var(--mc-accent); }
.tabs-icon .pg-tabs a { height: 38px; padding: 0 14px; }
.tabs-icon .pg-tabs a.on .pg-tab-ic { background: rgba(255,255,255,.22); color: #fff; }
.tabs-icon .pg-subtabs a { display: inline-flex; align-items: center; }
.tabs-icon .pg-subtabs .pg-tab-ic { width: auto; height: auto; margin: 0; background: none; color: inherit; opacity: .8; }

/* ---------- Toasts: messages after an action (header.php) ---------- */
.bq-toasts {
    position: fixed; top: 18px; right: 18px; z-index: 3000; width: 380px; max-width: calc(100vw - 36px);
    display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.bq-toast {
    --tc: var(--mc-success);
    position: relative; overflow: hidden; pointer-events: auto;
    display: flex; align-items: flex-start; gap: 12px; padding: 14px 14px 16px;
    background: var(--mc-surface); color: var(--mc-text); border: 1px solid var(--mc-border); border-radius: 18px;
    box-shadow: var(--mc-shadow-lg); animation: bq-toast-in .28s cubic-bezier(.2, .9, .3, 1.2);
}
.bq-toast.bad { --tc: var(--mc-danger); }
.bq-toast.warn { --tc: var(--mc-warning); }
.bq-toast.out { animation: bq-toast-out .22s ease-in forwards; }
.bq-toast-ic {
    flex: none; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center;
    background: color-mix(in srgb, var(--tc) 15%, transparent); color: var(--tc);
}
.bq-toast-b { flex: 1; min-width: 0; font-size: 13px; line-height: 1.45; color: var(--mc-muted); padding-top: 1px; }
.bq-toast-b b { display: block; font-size: 14px; font-weight: 800; color: var(--mc-text); margin-bottom: 1px; }
.bq-toast-b p { margin: 0; }
.bq-toast-x {
    flex: none; width: 28px; height: 28px; border-radius: 9px; border: 0; background: transparent; color: var(--mc-muted);
    display: grid; place-items: center; cursor: pointer; margin: -2px -2px 0 0;
}
.bq-toast-x:hover { background: var(--mc-surface-2); color: var(--mc-text); }
.bq-toast-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--tc); opacity: .7; transform-origin: left; }
.bq-toast.timed .bq-toast-bar { animation: bq-toast-bar var(--life, 5s) linear forwards; }
.bq-toast.timed:hover .bq-toast-bar { animation-play-state: paused; }
.bq-toast:not(.timed) .bq-toast-bar { display: none; }
@keyframes bq-toast-in { from { opacity: 0; transform: translateY(-10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes bq-toast-out { to { opacity: 0; transform: translateX(24px); } }
@keyframes bq-toast-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
body.skin-bq .bq-toasts #custom-alerts .alert { margin: 0; }
@media (max-width: 767px) { .bq-toasts { top: 10px; right: 10px; left: 10px; width: auto; max-width: none; } }

/* Messages inside pages and pop-ups: soft tinted boxes instead of solid colour. */
body.skin-bq .pg .alert, body.skin-bq .modal .alert, body.skin-bq #custom-alerts .alert {
    border: 0 !important; border-radius: 14px !important; padding: 12px 14px; font-size: 13px; box-shadow: none;
    background: color-mix(in srgb, var(--mc-info) 12%, var(--mc-surface)) !important; color: var(--mc-text) !important;
}
body.skin-bq .pg .alert-success, body.skin-bq .modal .alert-success { background: color-mix(in srgb, var(--mc-success) 13%, var(--mc-surface)) !important; }
body.skin-bq .pg .alert-danger, body.skin-bq .modal .alert-danger { background: color-mix(in srgb, var(--mc-danger) 12%, var(--mc-surface)) !important; }
body.skin-bq .pg .alert-warning, body.skin-bq .modal .alert-warning { background: color-mix(in srgb, var(--mc-warning) 15%, var(--mc-surface)) !important; }
body.skin-bq .pg .alert .close, body.skin-bq .modal .alert .close { opacity: .5; text-shadow: none; color: var(--mc-text); }
.pg-card.pg-filter:not(.open) { display: none; }

/* ---------- Sideways rows: drag / swipe (page.js) ---------- */
.pg-tabs, .pg-subtabs, .pg-chips-scroll { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.pg-tabs.pg-sx-r, .pg-subtabs.pg-sx-r, .pg-chips-scroll.pg-sx-r { cursor: grab; }
.pg-sx-drag, .pg-sx-drag a { cursor: grabbing !important; user-select: none; }
/* Soft fade at an edge while more tabs sit past it. */
.pg-tabs.pg-sx-r, .pg-subtabs.pg-sx-r { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }
.pg-tabs.pg-sx-l, .pg-subtabs.pg-sx-l { -webkit-mask-image: linear-gradient(90deg, transparent, #000 36px); mask-image: linear-gradient(90deg, transparent, #000 36px); }
.pg-tabs.pg-sx-l.pg-sx-r, .pg-subtabs.pg-sx-l.pg-sx-r { -webkit-mask-image: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent); }


.pg-head form.pg-actions { align-items: center; } .pg-head form.pg-actions .form-control { width: auto; }

/* Colour icons (Settings > Shop > Icon style). */
.i-emo { display: inline-grid; place-items: center; text-align: center; overflow: hidden; flex: none; line-height: 1; font-style: normal; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; }

/* Status boxes (Products, Settings > Stores) and the store open/close dialog */
.wh-state.off { border: 1.5px dashed var(--mc-warning, #f59e0b); }
.wh-state.on { border: 1.5px solid var(--mc-success, #22c55e); }
/* Settings: which stores to close / open when Multiple Stores is switched */
.st-modal { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,.45); display: grid; place-items: center; padding: 16px; }
.st-modal[hidden] { display: none; }
.st-dlg { width: min(520px, 100%); max-height: 90vh; overflow: auto; margin: 0; }
.st-row { display: flex; gap: 10px; align-items: center; padding: 10px 8px; border-bottom: 1px solid var(--mc-border); cursor: pointer; font-weight: 400; margin: 0; }
.st-row[hidden] { display: none; }
.st-row input { width: 18px; height: 18px; flex: none; }
.st-row .pg-badge { margin-left: 6px; }

/* Back button left of a page title (Settings pages). */
.pg-head > div:has(> .pg-backbtn) { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center; }
.pg-head > div:has(> .pg-backbtn) > .pg-backbtn { grid-row: 1 / span 2; }
.pg-backbtn { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 16px; border-radius: 14px; background: var(--mc-surface); border: 1px solid var(--mc-border); font-weight: 700; font-size: 13.5px; color: var(--mc-text) !important; text-decoration: none !important; box-shadow: 0 4px 14px rgba(0,0,0,.04); white-space: nowrap; }
.pg-backbtn:hover { border-color: var(--mc-accent); }
.pg-backbtn-top { margin: 0 0 14px; }
.pg-head > div:has(> .pg-backbtn) > p { grid-column: 2; }

/* Export menu (export.js), on every page and every DataTable. */
.ex { position: relative; display: inline-flex; vertical-align: middle; }
.ex-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 1060; width: 100%; min-width: 0; box-sizing: border-box; padding: 6px; background: var(--mc-surface, #fff); border: 1px solid var(--mc-border, #eadfe1); box-shadow: 0 14px 34px rgba(60, 30, 40, .18); text-align: left; }
.ex-menu[hidden] { display: none !important; }
html body .ex-menu.ex-menu-floating{position:fixed!important;z-index:5005!important;bottom:auto!important;margin:0;max-width:calc(100vw - 16px);max-height:calc(100vh - 16px);overflow:auto}
.ex-menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 12px; font-size: 14px; font-weight: 600; color: var(--mc-text, #3a2a2e); cursor: pointer; }
.ex-menu button:hover { background: rgba(185, 112, 127, .1); }
.ex > .ex-btn:disabled { opacity: 1; }
.dt-buttons .dt-ex { margin-right: 6px; }
.dt-buttons .dt-ex .ex-btn { height: 34px; padding: 0 12px; font-size: 13px; }
html:not(#ui-x) body .ex-menu { border-radius: 16px !important; }
html:not(#ui-x) body .ex-menu button { border-radius: 10px !important; }
html:not(#ui-x) body .ex .ex-btn { border-radius: 12px !important; }
@media (max-width: 767px) { .ex-menu { right: auto; left: 0; } .pg-head .pg-actions .ex { flex: 1; } .pg-head .pg-actions .ex .ex-btn { width: 100%; justify-content: center; } }

/* ---------- Old reports: calendar (daily / monthly profit) and plain tables ---------- */
.pg .table-calendar { min-width: 0 !important; border-collapse: separate !important; border-spacing: 6px; border: 0 !important; background: none !important; }
.pg .table-calendar > tbody > tr > td, .pg .table-calendar > tbody > tr > th { border: 0 !important; background: var(--mc-surface, #fff); border-radius: 12px; vertical-align: top; padding: 8px !important; }
.pg .table-calendar > tbody > tr.active > th { background: transparent; font-weight: 800; font-size: 16px; }
.pg .table-calendar > tbody > tr.active > th a { display: inline-grid; place-items: center; min-width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--mc-border, #eadfe1); background: var(--mc-surface, #fff); color: var(--mc-text, #3a2a2e); text-decoration: none; font-weight: 700; }
.pg .table-calendar .cl_wday { color: var(--mc-muted, #8a7a7e); font-size: 12px; text-align: center; font-weight: 700; }
.pg .table-calendar td.cl_equal { background: transparent !important; }
.pg .table-calendar > tbody > tr > td:has(table) { background: rgba(185, 112, 127, .08); }
.pg .table-calendar td table { width: 100%; font-size: 11.5px; margin-top: 4px; }
.pg .table-calendar td table td { background: none !important; padding: 1px 0 !important; border: 0 !important; }
.pg .table-calendar .highlight { color: var(--mc-accent, #b9707f); font-weight: 800; }
@media (max-width: 767px) {
    .pg .calendar.table-responsive { overflow: visible; border: 0; }
    .pg .table-calendar, .pg .table-calendar > tbody, .pg .table-calendar > tbody > tr { display: block; width: 100%; }
    .pg .table-calendar > tbody > tr.active { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
    .pg .table-calendar > tbody > tr.active > th { display: block; padding: 0 !important; }
    .pg .table-calendar > tbody > tr:has(.cl_wday) { display: none; }
    .pg .table-calendar > tbody > tr > td { display: none; }
    .pg .table-calendar > tbody > tr > td:has(table) { display: block; margin: 0 0 8px; padding: 12px 14px !important; border-radius: 16px; background: var(--mc-surface, #fff); border: 1px solid var(--mc-border, #eadfe1) !important; }
    .pg .table-calendar > tbody > tr > td:has(table)::first-line { font-weight: 800; font-size: 16px; color: var(--mc-accent, #b9707f); }
    .pg .table-calendar td table { font-size: 13px; }
}
.pg table.table:not(.pg-table):not(.table-calendar) { border-color: var(--mc-border, #eadfe1) !important; background: var(--mc-surface, #fff); }
.pg table.table:not(.pg-table):not(.table-calendar) > thead > tr > th, .pg table.table:not(.pg-table):not(.table-calendar) > tbody > tr > th { background: rgba(185, 112, 127, .08); color: var(--mc-muted, #8a7a7e); font-size: 12px; font-weight: 700; border-color: var(--mc-border, #eadfe1) !important; }
.pg table.table:not(.pg-table):not(.table-calendar) td { border-color: var(--mc-border, #eadfe1) !important; }
.pg .table-calendar td table tr, .pg .table-calendar td table tr > td { background: none !important; }
/* Phones: tables in a dialog (product, purchase, adjustment view…) wrap
   their text and fit the screen instead of being cut off at the edge. */
@media (max-width: 767px) {
    .modal-body { overflow-x: auto; }
    .modal-body table.table { width: 100% !important; max-width: 100%; }
    .modal-body table.table > * > tr > td, .modal-body table.table > * > tr > th { white-space: normal !important; word-break: normal !important; overflow-wrap: normal !important; font-size: 12px; padding-left: 5px !important; padding-right: 5px !important; }
    .modal-body table.table > thead > tr > th { font-size: 10.5px; }
}
