/* MediPOS theme: purple on white, and near-black in dark mode.
   Tokens first; dark mode overrides the same tokens. */
:root {
  --mp-primary: #8b5cf6;
  --mp-primary-rgb: 139, 92, 246;
  --mp-primary-hover: #7c3aed;
  --mp-primary-2: #c4b5fd;
  --mp-primary-subtle: rgba(139, 92, 246, .12);
  --mp-body-bg: #f8f7fc;
  --mp-surface: #ffffff;
  --mp-border: #ebe8f3;
  --mp-text: #3a3646;
  --mp-heading: #17141f;
  --mp-muted: #6f6a80;
  --mp-brand-1: var(--mp-heading); /* the name next to the logo; Platform → Branding can set both */
  --mp-brand-2: var(--mp-primary);
  --mp-hover: rgba(23, 20, 31, .05);
  --mp-shadow: 0 3px 12px rgba(23, 20, 31, .07);
  --mp-sidebar-w: 260px;
  --mp-topbar-h: 62px;
  --mp-radius: 10px;
}

[data-bs-theme="dark"] {
  --mp-primary-subtle: rgba(139, 92, 246, .22);
  --mp-body-bg: #050505;
  --mp-surface: #111017;
  --mp-border: #26232f;
  --mp-text: #d9d6e2;
  --mp-heading: #fafafa;
  --mp-muted: #a19dab;
  --mp-hover: rgba(255, 255, 255, .06);
  --mp-shadow: 0 3px 16px rgba(0, 0, 0, .55);
}

/* Map tokens onto Bootstrap's variables (this file loads after Bootstrap). */
:root,
[data-bs-theme] {
  --bs-body-font-family: "Outfit", "Hind Siliguri", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-body-font-size: .9375rem;
  --bs-body-bg: var(--mp-body-bg);
  --bs-body-color: var(--mp-text);
  --bs-emphasis-color: var(--mp-heading);
  --bs-secondary-color: var(--mp-muted);
  --bs-border-color: var(--mp-border);
  --bs-primary: var(--mp-primary);
  --bs-primary-rgb: var(--mp-primary-rgb);
  --bs-link-color: var(--mp-primary);
  --bs-link-color-rgb: var(--mp-primary-rgb);
  --bs-link-hover-color: var(--mp-primary-hover);
  --bs-link-hover-color-rgb: 124, 58, 237;
  --bs-heading-color: var(--mp-heading);
}

body { background: var(--mp-body-bg); color: var(--mp-text); }
a { text-decoration: none; }

.btn-primary {
  --bs-btn-bg: var(--mp-primary);
  --bs-btn-border-color: var(--mp-primary);
  --bs-btn-hover-bg: var(--mp-primary-hover);
  --bs-btn-hover-border-color: var(--mp-primary-hover);
  --bs-btn-active-bg: var(--mp-primary-hover);
  --bs-btn-active-border-color: var(--mp-primary-hover);
  --bs-btn-disabled-bg: var(--mp-primary);
  --bs-btn-disabled-border-color: var(--mp-primary);
  --bs-btn-focus-shadow-rgb: var(--mp-primary-rgb);
  box-shadow: 0 2px 6px rgba(var(--mp-primary-rgb), .35);
}
.btn-outline-primary {
  --bs-btn-color: var(--mp-primary);
  --bs-btn-border-color: var(--mp-primary);
  --bs-btn-hover-bg: var(--mp-primary);
  --bs-btn-hover-border-color: var(--mp-primary);
  --bs-btn-active-bg: var(--mp-primary-hover);
  --bs-btn-active-border-color: var(--mp-primary-hover);
}
.form-control, .form-select { border-color: var(--mp-border); background-color: var(--mp-surface); }
.form-control:focus, .form-select:focus {
  border-color: var(--mp-primary);
  box-shadow: 0 0 0 .2rem rgba(var(--mp-primary-rgb), .15);
}
.form-check-input:checked { background-color: var(--mp-primary); border-color: var(--mp-primary); }
.form-check-input:focus { box-shadow: 0 0 0 .2rem rgba(var(--mp-primary-rgb), .15); border-color: var(--mp-primary); }
.form-label { font-size: .8125rem; font-weight: 500; color: var(--mp-heading); }

.card {
  --bs-card-bg: var(--mp-surface);
  --bs-card-border-color: transparent;
  --bs-card-border-radius: var(--mp-radius);
  --bs-card-cap-bg: transparent;
  box-shadow: var(--mp-shadow);
}
.card-header { padding: 1.1rem 1.5rem .25rem; border-bottom: 0; }
.card-body { padding: 1.5rem; }
.card-title { font-size: 1.05rem; font-weight: 600; margin: 0; }
.dropdown-menu { --bs-dropdown-bg: var(--mp-surface); --bs-dropdown-border-color: var(--mp-border); box-shadow: var(--mp-shadow); }
.dropdown-item { display: flex; align-items: center; gap: .5rem; }
.dropdown-item:active { background: var(--mp-primary); }
.modal-content { background: var(--mp-surface); }

/* Brand */
/* The brand (Platform → Branding): the logo, then the name in two colours ("Thing" + purple "bd") over the product. */
.brand-mark { height: 34px; width: auto; max-width: 68px; flex: none; display: block; object-fit: contain; }
.brand-text { font-weight: 700; font-size: 1.3rem; line-height: 1.05; color: var(--mp-heading); letter-spacing: -.01em; }
.brand-text small { display: block; font-size: .78rem; font-weight: 700; letter-spacing: 0; color: var(--mp-brand-1); }
.brand-text small span { color: var(--mp-brand-2); }
.brand-preview { display: flex; align-items: center; gap: .6rem; padding: .9rem 1rem; border: 1px solid var(--mp-border); border-radius: .75rem; }
.brand-icon-preview { border-radius: 14px; box-shadow: 0 1px 6px rgba(0, 0, 0, .12); }

/* Sidebar */
.app-sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 1040;
  width: var(--mp-sidebar-w);
  display: flex; flex-direction: column;
  background: var(--mp-surface);
  box-shadow: var(--mp-shadow);
  transition: transform .2s ease;
}
.sidebar-brand { display: flex; align-items: center; gap: .6rem; height: var(--mp-topbar-h); padding: 0 1.4rem; margin-top: .5rem; }
.sidebar-tenant {
  display: flex; align-items: center; gap: .5rem;
  margin: 0 1rem .5rem; padding: .5rem .75rem; border-radius: 8px;
  background: var(--mp-primary-subtle); color: var(--mp-primary);
  font-size: .8125rem; font-weight: 600;
}
.sidebar-tenant span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: .25rem .9rem 1.5rem; }
.nav-section {
  padding: 1.1rem .75rem .4rem;
  font-size: .6875rem; font-weight: 500; letter-spacing: .07em; text-transform: uppercase;
  color: var(--mp-muted);
}
.sidebar-nav .nav-link {
  display: flex; align-items: center; gap: .7rem;
  margin-bottom: 2px; padding: .55rem .8rem; border-radius: 7px;
  color: var(--mp-text); font-size: .9375rem;
}
.sidebar-nav .nav-link > .bi:first-child { font-size: 1.15rem; }
.sidebar-nav .nav-link:hover { background: var(--mp-hover); color: var(--mp-heading); }
.sidebar-nav .nav-link.active {
  background: linear-gradient(72deg, var(--mp-primary), var(--mp-primary-2));
  color: #fff;
  box-shadow: 0 2px 6px rgba(var(--mp-primary-rgb), .4);
}
.nav-caret { margin-left: auto; font-size: .75rem; transition: transform .2s ease; }
.sidebar-nav .nav-link:not(.collapsed) .nav-caret { transform: rotate(90deg); }
.sidebar-nav .nav-child { position: relative; padding-left: 2.7rem; font-size: .875rem; }
.sidebar-nav .nav-child::before {
  content: ""; position: absolute; left: 1.3rem;
  width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor;
}
.sidebar-nav .nav-child.active {
  background: var(--mp-primary-subtle); color: var(--mp-primary);
  box-shadow: none; font-weight: 600;
}
.sidebar-nav .nav-child.active::before { background: currentColor; }

/* Main column */
.app-main { margin-left: var(--mp-sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.app-topbar {
  position: sticky; top: .75rem; z-index: 1030;
  display: flex; align-items: center; gap: .75rem;
  height: var(--mp-topbar-h); margin: .75rem 1.5rem 0; padding: 0 1rem;
  background: var(--mp-surface); border-radius: var(--mp-radius); box-shadow: var(--mp-shadow);
}
.topbar-search {
  display: flex; align-items: center; gap: .6rem;
  padding: .4rem .5rem; border: 0; background: transparent; color: var(--mp-muted);
}
.topbar-search:hover { color: var(--mp-heading); }
kbd { background: var(--mp-hover); color: var(--mp-muted); font-size: .7rem; border: 1px solid var(--mp-border); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.btn-icon {
  width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: transparent; color: var(--mp-text); font-size: 1.2rem;
}
.btn-icon:hover { background: var(--mp-hover); }
.theme-icon-to-light { display: none; }
[data-bs-theme="dark"] .theme-icon-to-light { display: inline; }
[data-bs-theme="dark"] .theme-icon-to-dark { display: none; }
.user-chip { display: flex; align-items: center; gap: .6rem; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--mp-primary-subtle); color: var(--mp-primary); font-weight: 700; font-size: .875rem;
}
.user-meta { flex-direction: column; line-height: 1.2; }
.user-meta strong { font-size: .875rem; color: var(--mp-heading); }
.user-meta small { font-size: .75rem; color: var(--mp-muted); }
.app-content { flex: 1; padding: 1.5rem; }
.app-footer { padding: 1rem 1.5rem; color: var(--mp-muted); font-size: .8125rem; }
.app-backdrop { display: none; }

.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.page-title { margin: 0; font-size: 1.375rem; font-weight: 600; }
.page-subtitle { margin: .2rem 0 0; color: var(--mp-muted); font-size: .875rem; }
.page-actions { display: flex; gap: .5rem; }
.app-messages .alert { box-shadow: var(--mp-shadow); }

/* Dashboard bits */
.welcome-card .card-body { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.welcome-icon { font-size: 3rem; color: var(--mp-primary); opacity: .25; }
.stat-card .card-body { display: flex; align-items: center; gap: 1rem; }
.stat-icon { width: 46px; height: 46px; border-radius: 9px; display: grid; place-items: center; font-size: 1.35rem; flex: none; }
.tone-primary { background: var(--mp-primary-subtle); color: var(--mp-primary); }
.tone-success { background: rgba(40, 199, 111, .14); color: #28c76f; }
.tone-warning { background: rgba(255, 159, 67, .16); color: #ff9f43; }
.tone-danger { background: rgba(234, 84, 85, .14); color: #ea5455; }
.stat-value { font-size: 1.5rem; font-weight: 600; color: var(--mp-heading); line-height: 1.2; }
.stat-label { color: var(--mp-muted); font-size: .875rem; }
.detail-list { display: grid; grid-template-columns: max-content 1fr; gap: .6rem 1.25rem; }
.detail-list dt { font-weight: 500; color: var(--mp-muted); }
.detail-list dd { margin: 0; color: var(--mp-heading); }

/* Command palette */
.command-dialog { max-width: 560px; margin-top: 12vh; }
.command-input { display: flex; align-items: center; gap: .6rem; padding: .75rem 1rem; border-bottom: 1px solid var(--mp-border); }
.command-input .form-control { border: 0; box-shadow: none; padding-left: 0; background: transparent; }
.command-results { display: flex; flex-direction: column; gap: 2px; }
.command-item {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .6rem .85rem; border-radius: 7px; color: var(--mp-text);
}
.command-item small { color: var(--mp-muted); }
.command-item.is-active, .command-item:hover { background: var(--mp-primary-subtle); color: var(--mp-primary); }

/* Auth pages */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 1.5rem 1rem;
  background:
    radial-gradient(600px 300px at 15% 10%, rgba(var(--mp-primary-rgb), .12), transparent 70%),
    radial-gradient(500px 300px at 85% 90%, rgba(var(--mp-primary-rgb), .1), transparent 70%),
    var(--mp-body-bg);
}
.auth-card { width: 100%; max-width: 430px; }
.auth-card .card-body { padding: 2.25rem; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: .6rem; margin-bottom: 1.75rem; }
.auth-title { font-size: 1.4rem; font-weight: 600; margin-bottom: .35rem; }

.auth-card-wide { max-width: 760px; }
.form-section-title {
  margin: 1.25rem 0 .9rem; padding-bottom: .4rem; border-bottom: 1px solid var(--mp-border);
  font-size: .8125rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--mp-muted);
}
.form-section-title:first-of-type { margin-top: 0; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Plan picker (sign-up) */
.plan-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .75rem; }
.plan-option { position: relative; cursor: pointer; }
.plan-option input { position: absolute; opacity: 0; pointer-events: none; }
.plan-card {
  display: flex; flex-direction: column; gap: .35rem; height: 100%;
  padding: 1rem; border: 1.5px solid var(--mp-border); border-radius: var(--mp-radius);
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.plan-option:hover .plan-card { border-color: rgba(var(--mp-primary-rgb), .5); }
.plan-option input:checked + .plan-card {
  border-color: var(--mp-primary); background: var(--mp-primary-subtle);
  box-shadow: 0 0 0 .2rem rgba(var(--mp-primary-rgb), .12);
}
.plan-option input:focus-visible + .plan-card { outline: 2px solid var(--mp-primary); outline-offset: 2px; }
.plan-name { font-weight: 600; color: var(--mp-heading); }
.plan-price { font-size: 1.35rem; font-weight: 700; color: var(--mp-primary); }
.plan-price small, .plan-summary-price small { font-size: .8rem; font-weight: 400; color: var(--mp-muted); }
.plan-limits { display: flex; flex-direction: column; gap: .15rem; font-size: .8125rem; color: var(--mp-muted); }
.plan-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.plan-summary-name { font-size: 1.5rem; font-weight: 700; color: var(--mp-heading); }
.plan-summary-price { font-size: 1.1rem; font-weight: 600; color: var(--mp-primary); }
.plan-list { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.plan-list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .65rem .85rem; border: 1px solid var(--mp-border); border-radius: 8px; }
.plan-list li.is-current { border-color: var(--mp-primary); background: var(--mp-primary-subtle); }
.usage-row + .usage-row { margin-top: 1.1rem; }
.progress { --bs-progress-bg: var(--mp-hover); --bs-progress-height: .5rem; --bs-progress-bar-bg: var(--mp-primary); }
.subscription-banner { box-shadow: var(--mp-shadow); }

/* Access state badges */
.state-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .6rem; border-radius: 50rem;
  font-size: .75rem; font-weight: 600; line-height: 1.4; white-space: nowrap; vertical-align: middle;
}
.state-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.state-trial { background: rgba(0, 186, 209, .14); color: #00a5ba; }
.state-active { background: rgba(40, 199, 111, .14); color: #1fa65a; }
.state-grace { background: rgba(255, 159, 67, .16); color: #e5821f; }
.state-expired { background: rgba(234, 84, 85, .14); color: #e04445; }
.state-suspended { background: rgba(130, 134, 139, .18); color: var(--mp-muted); }
.page-title .state-badge { margin-left: .4rem; font-size: .8rem; }
.tone-info { background: rgba(0, 186, 209, .14); color: #00a5ba; }

/* Lists & timeline */
.simple-list { list-style: none; margin: 0; padding: 0; }
.simple-list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .55rem 0; border-bottom: 1px dashed var(--mp-border); }
.simple-list li:last-child { border-bottom: 0; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline-item { position: relative; display: flex; gap: .9rem; padding-bottom: 1rem; }
.timeline-item:not(:last-child)::after { content: ""; position: absolute; left: 5px; top: 16px; bottom: 0; border-left: 1px solid var(--mp-border); }
.timeline-dot { flex: none; width: 11px; height: 11px; margin-top: 5px; border-radius: 50%; background: var(--mp-primary); box-shadow: 0 0 0 3px var(--mp-primary-subtle); }
.kind-payment .timeline-dot { background: #28c76f; box-shadow: 0 0 0 3px rgba(40, 199, 111, .18); }
.kind-suspended .timeline-dot { background: #ea5455; box-shadow: 0 0 0 3px rgba(234, 84, 85, .18); }
.kind-trial_extended .timeline-dot { background: #00bad1; box-shadow: 0 0 0 3px rgba(0, 186, 209, .18); }

/* Tables, DataTables, Select2 — blended into the theme */
.table { --bs-table-bg: transparent; --bs-table-color: var(--mp-text); --bs-table-hover-bg: var(--mp-hover); --bs-table-border-color: var(--mp-border); }
.table > thead th {
  font-size: .75rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--mp-muted); white-space: nowrap;
}
.table-filters { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }
.table-filter { width: 220px; max-width: 100%; }
div.dt-container .dt-search input { min-width: 240px; border-color: var(--mp-border); }
div.dt-container .dt-layout-table > .dt-layout-cell { overflow-x: auto; }
div.dt-container .dt-length select { border-color: var(--mp-border); }
div.dt-container .dt-info { color: var(--mp-muted); font-size: .8125rem; }
div.dt-container div.dt-processing { background: var(--mp-surface); border: 0; box-shadow: var(--mp-shadow); color: var(--mp-text); }
div.dt-container div.dt-processing > div:last-child { display: none; }
.pagination { --bs-pagination-color: var(--mp-text); --bs-pagination-bg: transparent; --bs-pagination-border-color: var(--mp-border);
  --bs-pagination-hover-bg: var(--mp-hover); --bs-pagination-hover-color: var(--mp-primary);
  --bs-pagination-active-bg: var(--mp-primary); --bs-pagination-active-border-color: var(--mp-primary);
  --bs-pagination-disabled-bg: transparent; --bs-pagination-focus-box-shadow: 0 0 0 .2rem rgba(var(--mp-primary-rgb), .15); }
table.dataTable thead > tr > th.dt-orderable-asc:hover, table.dataTable thead > tr > th.dt-orderable-desc:hover { outline: none; color: var(--mp-heading); }
.select2-container--bootstrap-5 .select2-selection {
  border-color: var(--mp-border); background-color: var(--mp-surface); color: var(--mp-text); font-size: inherit;
}
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered { color: var(--mp-text); }
.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection {
  border-color: var(--mp-primary); box-shadow: 0 0 0 .2rem rgba(var(--mp-primary-rgb), .15);
}
.select2-container--bootstrap-5 .select2-dropdown {
  background: var(--mp-surface); border-color: var(--mp-border); color: var(--mp-text); box-shadow: var(--mp-shadow);
}
.select2-container--bootstrap-5 .select2-dropdown .select2-search .select2-search__field { background: var(--bs-body-bg); color: var(--mp-text); border-color: var(--mp-border); }
.select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option.select2-results__option--highlighted { background: var(--mp-primary-subtle); color: var(--mp-primary); }
.select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option.select2-results__option--selected { background: var(--mp-primary); color: #fff; }

/* Outlet switcher */
.outlet-chip {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .4rem .75rem; border: 1px solid var(--mp-border); border-radius: 50rem;
  background: transparent; color: var(--mp-heading); font-size: .875rem; font-weight: 500;
}
.outlet-chip:not(:disabled):hover { border-color: var(--mp-primary); color: var(--mp-primary); }
.outlet-chip:disabled { opacity: 1; cursor: default; }
.outlet-chip .bi-shop { color: var(--mp-primary); }

/* Forms & settings */
.form-actions {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; gap: .5rem; align-items: center;
  margin-top: 1.5rem; padding: .9rem 0; background: var(--mp-body-bg);
}
.logo-preview {
  display: grid; place-items: center; min-height: 120px; padding: 1rem;
  border: 1px dashed var(--mp-border); border-radius: var(--mp-radius); background: var(--mp-hover);
}
.logo-preview img { max-width: 100%; max-height: 110px; object-fit: contain; }
.form-select[multiple] { min-height: 0; }

/* Role permission grid */
.perm-grid th, .perm-grid td { padding-top: .55rem; padding-bottom: .55rem; }
.perm-grid tbody td:first-child { font-weight: 500; color: var(--mp-heading); }
.perm-grid .perm-group th {
  padding-top: 1rem; border-bottom: 0;
  font-size: .7rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--mp-primary);
}
.perm-grid .form-check-input { width: 1.15em; height: 1.15em; cursor: pointer; }

/* Setup checklist */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; align-items: center; gap: .75rem; padding: .6rem 0; border-bottom: 1px dashed var(--mp-border); }
.checklist li:last-child { border-bottom: 0; }
.checklist .check { width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: .85rem; border: 1.5px solid var(--mp-border); color: var(--mp-muted); }
.checklist .is-done .check { background: #28c76f; border-color: #28c76f; color: #fff; }
.checklist .is-done .checklist-label { color: var(--mp-muted); text-decoration: line-through; }
.checklist a { margin-left: auto; font-size: .8125rem; white-space: nowrap; }

/* Medicines */
.kind-switch { display: inline-flex; gap: .25rem; padding: .25rem; border-radius: 50rem; background: var(--mp-hover); }
.kind-option { display: inline-flex; align-items: center; margin: 0; cursor: pointer; }
.kind-option input { position: absolute; opacity: 0; pointer-events: none; }
.kind-option span { padding: .35rem 1rem; border-radius: 50rem; font-size: .875rem; font-weight: 500; color: var(--mp-muted); }
.kind-option input:checked + span { background: var(--mp-surface); color: var(--mp-primary); box-shadow: var(--mp-shadow); }
.kind-option input:focus-visible + span { outline: 2px solid var(--mp-primary); }
.barcode-preview { max-width: 100%; height: auto; background: #fff; padding: .4rem; border-radius: 6px; }
.medicine-thumb { max-width: 100%; max-height: 140px; border-radius: 8px; object-fit: contain; }
.steps { padding-left: 1.2rem; margin-bottom: 1.5rem; }
.steps li { margin-bottom: .8rem; }
.error-table { max-height: 320px; overflow-y: auto; }

/* Purchases & stock */
.line-picker { flex: 1 1 360px; max-width: 520px; }
.purchase-lines th { white-space: nowrap; }
.purchase-lines td { min-width: 82px; vertical-align: top; }
.purchase-lines td:first-child { min-width: 200px; }
.purchase-lines td:nth-child(2) { min-width: 120px; }
.purchase-lines td:last-child { min-width: 0; }
.purchase-lines input[type="month"] { min-width: 140px; }
.totals { display: grid; grid-template-columns: 1fr minmax(140px, 200px); gap: .55rem 1rem; align-items: center; margin: 0; }
.totals dt { font-weight: 500; color: var(--mp-muted); }
.totals dd { margin: 0; text-align: right; color: var(--mp-heading); }
.totals dd input { text-align: right; }
.totals-select { text-align: left !important; }
.totals .totals-grand { font-size: 1.15rem; font-weight: 700; color: var(--mp-heading); padding-top: .4rem; border-top: 1px solid var(--mp-border); }
.balance-figure { font-size: 1.75rem; font-weight: 700; color: var(--mp-heading); line-height: 1.2; }
.detail-grid { grid-template-columns: max-content 1fr max-content 1fr; }
@media (max-width: 767.98px) { .detail-grid { grid-template-columns: max-content 1fr; } }

/* Language */
.lang-btn { width: auto; padding: 0 .55rem; border-radius: 50rem; gap: .3rem; display: inline-flex; align-items: center; }
.lang-code { font-size: .7rem; font-weight: 700; letter-spacing: .04em; }
.auth-languages { display: flex; justify-content: center; gap: .25rem; margin-top: 1rem; }
.auth-languages button { border: 0; background: transparent; color: var(--mp-muted); padding: .2rem .6rem; border-radius: 50rem; font-size: .875rem; }
.auth-languages button.is-current { background: var(--mp-primary-subtle); color: var(--mp-primary); font-weight: 600; }
.auth-wrap { flex-direction: column; display: flex; align-items: center; justify-content: center; }
html[lang="bn"] body { font-family: "Hind Siliguri", "Public Sans", system-ui, sans-serif; }

/* POS: a full-screen page with its own slim bar instead of the sidebar */
.pos-shell { --pos-bar-h: 58px; min-height: 100vh; display: flex; flex-direction: column; }
.pos-bar {
  position: sticky; top: 0; z-index: 1030;
  display: flex; align-items: center; gap: .6rem;
  height: var(--pos-bar-h); padding: 0 1rem;
  background: var(--mp-surface); box-shadow: var(--mp-shadow);
  border-style: solid; border-width: 3px 0 0; border-image: linear-gradient(90deg, #8b5cf6, #d6409f 50%, #f08c2b) 1;
}
.pos-brand { display: flex; align-items: center; gap: .5rem; text-decoration: none; }
.pos-brand .brand-text { font-size: 1.1rem; }
.pos-bar-info { font-size: .8125rem; color: var(--mp-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pos-bar-actions { margin-left: auto; display: flex; align-items: center; gap: .4rem; flex: none; }
.pos-main { flex: 1; padding: 1rem; min-width: 0; }
.pos { display: grid; grid-template-columns: minmax(0, 1fr) minmax(400px, 42%); gap: 1rem; align-items: start; }
.pos-left .card-body, .pos-right .card-body { padding: 1.1rem; }
.pos-cats { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .35rem; margin-bottom: .6rem; scrollbar-width: thin; }
.pos-cat {
  --tone: var(--mp-primary);
  flex: none; padding: .3rem .8rem; border: 1px solid var(--tone-line); border-radius: 999px;
  background: var(--tone-soft); color: var(--mp-heading); font-size: .8125rem; font-weight: 500; white-space: nowrap;
}
.pos-cat i { color: var(--tone); }
.pos-cat:hover { border-color: var(--tone); }
.pos-cat.is-active { background: var(--tone); border-color: var(--tone); color: #fff; box-shadow: 0 2px 6px var(--tone-line); }
.pos-cat.is-active i { color: #fff; }
.pos-cats.is-searching .pos-cat.is-active { background: var(--tone-soft); color: var(--mp-heading); box-shadow: none; }
.pos-cats.is-searching .pos-cat.is-active i { color: var(--tone); }
.pos-note { grid-column: 1 / -1; margin: 0; font-size: .8125rem; color: var(--mp-muted); }
.pos-search { position: relative; display: flex; align-items: center; }
.pos-search > .bi { position: absolute; left: 1rem; font-size: 1.25rem; color: var(--mp-muted); }
.pos-search input { padding-left: 2.8rem; padding-right: 3.2rem; font-size: 1.05rem; }
.pos-search kbd { position: absolute; right: .8rem; }
.pos-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; margin: .9rem 0; }
.pos-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .6rem; align-content: start; max-height: 55vh; overflow-y: auto; padding: 2px; }
.pos-result {
  --tone: var(--mp-primary);
  text-align: left; padding: .65rem .75rem; border: 1px solid var(--mp-border); border-left: 4px solid var(--tone); border-radius: 9px;
  background: linear-gradient(135deg, var(--tone-soft), var(--mp-surface) 55%); color: var(--mp-text);
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.pos-result:hover, .pos-result.is-active { border-color: var(--tone); box-shadow: 0 4px 12px var(--tone-line); transform: translateY(-1px); }
.pos-result.is-empty { opacity: .55; }
.pos-result-head { display: flex; gap: .5rem; align-items: flex-start; }
.pos-result-head .badge { margin-left: auto; }
.pos-result-icon {
  width: 28px; height: 28px; flex: none; border-radius: 8px; display: grid; place-items: center;
  background: var(--tone-soft); color: var(--tone); font-size: .95rem;
}
.pos-result-name { line-height: 1.25; }
.pos-result-foot { display: flex; flex-wrap: wrap; gap: .1rem .6rem; margin-top: .4rem; font-size: .8125rem; align-items: baseline; }
.pos-result-foot span { white-space: nowrap; }
.pos-result-foot strong { margin-left: auto; }
.pos-result-foot strong { color: var(--mp-heading); font-size: .95rem; }
.pos-hint { color: var(--mp-muted); margin: 1.5rem 0; grid-column: 1 / -1; }
.pos-customer { display: flex; gap: .5rem; }
.pos-customer .select2-container { flex: 1; min-width: 0; }
.pos-customer-info { min-height: 1.2em; margin: .4rem 0 .6rem; font-size: .8125rem; color: var(--mp-muted); }
.pos-cart { min-height: 160px; overflow-y: auto; border-radius: 9px; border: 1px solid var(--mp-border); }
.pos-cart thead th {
  position: sticky; top: 0; z-index: 1; border-bottom: 0;
  background: color-mix(in srgb, var(--mp-primary) 9%, var(--mp-surface)); color: var(--mp-primary);
}
.pos-cart tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--mp-primary) 3%, var(--mp-surface)); }
.pos-cart select { min-width: 84px; }
/* Quantity: a pill with a red "-" and a green "+" instead of the plain input group */
.qty-stepper {
  display: inline-flex; align-items: center; gap: 2px; padding: 2px;
  border: 1px solid var(--mp-border); border-radius: 999px; background: var(--mp-surface);
}
.qty-stepper:focus-within { border-color: var(--mp-primary); box-shadow: 0 0 0 .15rem rgba(var(--mp-primary-rgb), .15); }
.qty-btn {
  --tone: #12a389;
  width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--tone) 14%, transparent); color: var(--tone); font-size: .8rem;
  transition: background .12s, color .12s;
}
.qty-minus { --tone: #e5484d; }
.qty-btn:hover:not(:disabled) { background: var(--tone); color: #fff; }
.qty-btn:disabled { opacity: .35; cursor: default; }
.qty-stepper input {
  width: 38px; padding: 0; border: 0; background: transparent; color: var(--mp-heading);
  text-align: center; font-weight: 600; -moz-appearance: textfield; appearance: textfield;
}
.qty-stepper input:focus { outline: none; }
.qty-stepper input::-webkit-outer-spin-button, .qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pos-line-name { line-height: 1.25; min-width: 130px; }
.pos-batch-link { font-size: .75rem; text-decoration: none; }
.pos-totals {
  margin-top: .9rem; padding: .75rem 1rem; border-radius: 10px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--mp-primary) 8%, var(--mp-surface)), color-mix(in srgb, #d6409f 5%, var(--mp-surface)));
}
.pos-totals .totals-grand { font-size: 1.35rem; color: var(--mp-primary); border-top-color: color-mix(in srgb, var(--mp-primary) 25%, transparent); }
.pos-rounding-note { display: block; font-size: .72rem; font-weight: 400; color: var(--mp-muted); }
.pos-discount-mode { width: auto; padding-top: .1rem; padding-bottom: .1rem; }
.pos-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.pos-actions .pos-pay { flex: 1 1 130px; }
.pos-actions kbd { font-size: .65rem; }
.btn-soft {
  --tone: var(--mp-primary);
  background: var(--tone-soft); color: var(--tone); border: 1px solid var(--tone-line); font-weight: 500;
}
.btn-soft:hover, .btn-soft:focus-visible { background: var(--tone); border-color: var(--tone); color: #fff; }
.btn-soft kbd { background: transparent; color: inherit; border-color: currentColor; opacity: .75; }
.pos-pay {
  font-weight: 600; color: #fff; border: 0;
  background: linear-gradient(135deg, #22b573, #109a5e); box-shadow: 0 3px 10px rgba(16, 154, 94, .35);
}
.pos-pay:hover, .pos-pay:focus-visible { color: #fff; background: linear-gradient(135deg, #1fa868, #0c8a53); }
.pos-pay:disabled { color: #fff; background: linear-gradient(135deg, #22b573, #109a5e); box-shadow: none; opacity: .45; }
.pos-pay kbd { background: rgba(255, 255, 255, .2); color: #fff; border-color: rgba(255, 255, 255, .35); }
.pay-total { display: flex; justify-content: space-between; align-items: baseline; padding: .75rem 1rem; margin-bottom: 1rem; border-radius: 9px; background: var(--mp-primary-subtle); }
.pay-total strong { font-size: 1.6rem; color: var(--mp-primary); }
.pay-change { font-size: 1.4rem; font-weight: 700; color: #1fa65a; }
/* Colour families for the POS ("tone-*" sets --tone; the soft fill and outline are mixed from it) */
.tone-violet { --tone: #8b5cf6; } .tone-teal { --tone: #12a389; } .tone-orange { --tone: #ef8a2a; } .tone-sky { --tone: #2f95dc; }
.tone-red { --tone: #e5484d; } .tone-pink { --tone: #d6409f; } .tone-cyan { --tone: #0ea5b7; } .tone-amber { --tone: #d4930a; }
.tone-indigo { --tone: #5b6cf0; } .tone-slate { --tone: #6b7280; } .tone-rose { --tone: #f2545b; }
.pos-cat, .pos-result, .btn-soft {
  --tone-soft: color-mix(in srgb, var(--tone) 11%, transparent);
  --tone-line: color-mix(in srgb, var(--tone) 32%, transparent);
}
/* Wide screens: both panels fill the height below the bar; the grid and the cart scroll inside. */
@media (min-width: 992px) {
  .pos { height: calc(100vh - var(--pos-bar-h) - 2rem); align-items: stretch; }
  .pos-left, .pos-right { min-height: 0; }
  .pos-left .card-body, .pos-right .card-body { display: flex; flex-direction: column; min-height: 0; }
  .pos-results { flex: 1; min-height: 0; max-height: none; }
  .pos-cart { flex: 1; min-height: 120px; }
}
@media (max-width: 991.98px) { .pos { grid-template-columns: 1fr; } .pos-results { max-height: 42vh; } .pos-main { padding: .75rem; } .pos-bar { padding: 0 .75rem; } }

/* Label sheet: on screen a preview, on paper A4 with 5 × 13 labels */
.label-sheet { display: grid; grid-template-columns: repeat(5, 38mm); gap: 2mm; margin-top: 1.5rem; }
.label-sheet:empty { display: none; }
.label {
  width: 38mm; height: 21mm; padding: 1mm; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #fff; color: #000; border: 1px dashed #c8c8d0; border-radius: 2px; text-align: center;
}
.label svg { max-width: 100%; height: 10mm; }
.label-shop { font-size: 6pt; font-weight: 700; line-height: 1.1; }
.label-name { font-size: 6.5pt; line-height: 1.1; max-height: 2.2em; overflow: hidden; }
.label-price { font-size: 7pt; font-weight: 700; }
@media print {
  @page { size: A4; margin: 8mm; }
  body { background: #fff !important; }
  .app-sidebar, .app-topbar, .app-footer, .page-header, .no-print, .app-messages, .subscription-banner { display: none !important; }
  .app-main { margin: 0 !important; }
  .app-content { padding: 0 !important; }
  .label-sheet { margin: 0; }
  .label { border-color: #eee; break-inside: avoid; }
}

@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(-100%); }
  body.sidebar-open .app-sidebar { transform: none; }
  body.sidebar-open .app-backdrop { display: block; position: fixed; inset: 0; z-index: 1035; background: rgba(20, 18, 30, .45); }
  .app-main { margin-left: 0; }
  .app-topbar { margin: .75rem 1rem 0; }
  .app-content { padding: 1.25rem 1rem; }
  .app-footer { padding: 1rem; }
}
@media (max-width: 575.98px) {
  .auth-card .card-body { padding: 1.5rem; }
  .detail-list { grid-template-columns: 1fr; gap: .15rem; }
  .detail-list dd { margin-bottom: .6rem; }
}

/* Date picker (flatpickr) in the app's colours */
.mp-date-input {
  padding-right: 2.25rem;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2375718a'%3e%3cpath d='M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5M1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4z'/%3e%3cpath d='M11 7h2v2h-2zm-3 0h2v2H8zm-3 0h2v2H5zm6 3h2v2h-2zm-3 0h2v2H8zm-3 0h2v2H5z'/%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: right .75rem center; background-size: 15px;
}
.form-control-sm.mp-date-input { padding-right: 1.9rem; background-position: right .5rem center; background-size: 13px; }
.mp-date-input[readonly]:not(:disabled) { background-color: var(--bs-body-bg); }
.flatpickr-calendar {
  width: 296px; padding: .5rem; font-family: inherit; font-size: .875rem;
  background: var(--mp-surface); border: 1px solid var(--mp-border); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(47, 43, 61, .18);
}
.flatpickr-calendar::before, .flatpickr-calendar::after { display: none; }
.flatpickr-calendar.static { top: calc(100% + 4px); }
.flatpickr-months { align-items: center; margin-bottom: .25rem; }
.flatpickr-months .flatpickr-month { height: 36px; color: var(--mp-heading); fill: var(--mp-heading); background: transparent; }
.flatpickr-months .flatpickr-prev-month, .flatpickr-months .flatpickr-next-month {
  top: .5rem; height: 32px; width: 32px; padding: 8px; border-radius: 8px; color: var(--mp-muted); fill: var(--mp-muted);
}
.flatpickr-months .flatpickr-prev-month { left: .5rem; } .flatpickr-months .flatpickr-next-month { right: .5rem; }
.flatpickr-months .flatpickr-prev-month:hover, .flatpickr-months .flatpickr-next-month:hover { background: var(--mp-primary-subtle); }
.flatpickr-months .flatpickr-prev-month:hover svg, .flatpickr-months .flatpickr-next-month:hover svg { fill: var(--mp-primary); }
.flatpickr-current-month { padding-top: 6px; font-size: 1rem; font-weight: 600; }
.flatpickr-current-month .flatpickr-monthDropdown-months { font-weight: 600; color: var(--mp-heading); background: transparent; border-radius: 6px; }
.flatpickr-current-month .flatpickr-monthDropdown-months:hover, .flatpickr-current-month .numInputWrapper:hover { background: var(--mp-hover); }
.flatpickr-current-month .flatpickr-monthDropdown-months option { background: var(--mp-surface); color: var(--mp-text); }
.flatpickr-current-month input.cur-year { font-weight: 600; color: var(--mp-heading); }
.numInputWrapper span.arrowUp::after { border-bottom-color: var(--mp-muted); }
.numInputWrapper span.arrowDown::after { border-top-color: var(--mp-muted); }
.flatpickr-weekdays { background: transparent; }
span.flatpickr-weekday { background: transparent; color: var(--mp-muted); font-size: .75rem; font-weight: 600; }
.flatpickr-innerContainer, .flatpickr-rContainer, .flatpickr-days, .dayContainer { width: 278px; min-width: 278px; max-width: 278px; }
.flatpickr-day {
  max-width: 38px; height: 36px; line-height: 34px; margin: 1px 0; border-radius: 9px;
  color: var(--mp-text); border: 1px solid transparent;
}
.flatpickr-day:hover, .flatpickr-day:focus { background: var(--mp-hover); border-color: transparent; }
.flatpickr-day.today { border-color: var(--mp-primary); color: var(--mp-primary); font-weight: 600; }
.flatpickr-day.today:hover { background: var(--mp-primary-subtle); color: var(--mp-primary); border-color: var(--mp-primary); }
.flatpickr-day.selected, .flatpickr-day.selected:hover, .flatpickr-day.selected:focus {
  background: var(--mp-primary); border-color: var(--mp-primary); color: #fff; font-weight: 600;
  box-shadow: 0 3px 8px rgba(var(--mp-primary-rgb), .35);
}
.flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay { color: var(--mp-muted); opacity: .5; }
.flatpickr-day.flatpickr-disabled, .flatpickr-day.flatpickr-disabled:hover { color: var(--mp-muted); opacity: .3; background: transparent; }
.mp-picker-footer { display: flex; justify-content: space-between; gap: .5rem; margin-top: .35rem; padding-top: .45rem; border-top: 1px solid var(--mp-border); }
.mp-picker-footer button {
  padding: .25rem .7rem; border: 0; border-radius: 7px; background: transparent;
  color: var(--mp-primary); font-size: .8125rem; font-weight: 600;
}
.mp-picker-footer button:hover { background: var(--mp-primary-subtle); }
.mp-picker-footer button + button { color: var(--mp-muted); }
/* Month picker (purchase expiry) */
.flatpickr-monthSelect-months { margin: .25rem 0; }
.flatpickr-monthSelect-month {
  margin: 2px; padding: .45rem 0; border-radius: 9px; color: var(--mp-text); background: transparent; border: 1px solid transparent;
}
.flatpickr-monthSelect-month:hover { background: var(--mp-hover); }
.flatpickr-monthSelect-month.today { border-color: var(--mp-primary); color: var(--mp-primary); }
.flatpickr-monthSelect-month.selected, .flatpickr-monthSelect-month.selected:hover { background: var(--mp-primary); border-color: var(--mp-primary); color: #fff; }
.flatpickr-calendar.mp-month-picker, .flatpickr-monthSelect-theme-light { width: 296px; }
[data-bs-theme="dark"] .flatpickr-calendar { box-shadow: 0 12px 32px rgba(0, 0, 0, .45); }

/* Inventory control: figure tiles, expiry tiles, transfer route, line editor */
:where(.stat-tile, .expiry-tile) { --tone: var(--mp-primary); }  /* zero specificity: tone-* classes win */
.stat-tile, .expiry-tile {
  --tone-soft: color-mix(in srgb, var(--tone) 10%, transparent);
  --tone-line: color-mix(in srgb, var(--tone) 32%, transparent);
}
.stat-tile { border-top: 3px solid var(--tone); background: linear-gradient(160deg, var(--tone-soft), var(--mp-surface) 60%); }
.stat-tile .stat-label { font-size: .8125rem; }
.stat-figure { font-size: 1.6rem; font-weight: 700; line-height: 1.2; color: var(--tone, var(--mp-heading)); margin-top: .2rem; }
.expiry-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; padding: .9rem 1rem; text-align: left;
  border: 1px solid var(--mp-border); border-left: 4px solid var(--tone);
  background: linear-gradient(135deg, var(--tone-soft), var(--mp-surface) 65%); color: var(--mp-text);
  transition: box-shadow .12s, transform .12s;
}
.expiry-tile:hover { box-shadow: 0 4px 14px var(--tone-line); transform: translateY(-1px); }
.expiry-tile-label { font-size: .8125rem; font-weight: 600; color: var(--tone); }
.expiry-tile-value { font-size: 1.35rem; font-weight: 700; color: var(--mp-heading); }
.expiry-tile small { color: var(--mp-muted); font-size: .75rem; }
.transfer-route { display: flex; align-items: center; gap: 1rem; }
.route-stop { display: flex; flex-direction: column; min-width: 0; flex: 0 1 auto; }
.route-stop small { color: var(--mp-muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.route-stop strong { font-size: 1.15rem; color: var(--mp-heading); }
.route-stop span { font-size: .8125rem; color: var(--mp-muted); }
.route-line {
  --tone: #d4930a;
  position: relative; flex: 1; height: 2px; min-width: 60px; display: grid; place-items: center;
  background: repeating-linear-gradient(90deg, var(--tone) 0 8px, transparent 8px 14px);
}
.route-line i {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 1.1rem;
  background: var(--mp-surface); color: var(--tone); border: 2px solid var(--tone);
}
.route-received { --tone: #12a389; background: var(--tone); }
.route-cancelled { --tone: #9a9fbf; }
.stock-lines .lines-group td { background: color-mix(in srgb, var(--mp-primary) 6%, var(--mp-surface)); padding-top: .55rem; padding-bottom: .55rem; }
.stock-lines .lines-group td:first-child { border-left: 3px solid var(--mp-primary); }
.stock-lines .lines-new td { background: color-mix(in srgb, #12a389 6%, var(--mp-surface)); }
.stock-lines input { max-width: 150px; }
@media (max-width: 575.98px) { .transfer-route { flex-direction: column; align-items: stretch; } .route-stop.text-end { text-align: left !important; } .route-line { height: 30px; min-height: 30px; background: none; } }

/* Promotions: offer tags at the POS and the promotion cards */
.pos-offer {
  flex: none; margin-left: auto; padding: .1rem .45rem; border-radius: 6px; font-size: .72rem; font-weight: 700;
  background: linear-gradient(135deg, #f2545b, #ef8a2a); color: #fff; box-shadow: 0 2px 6px rgba(242, 84, 91, .35);
}
.pos-offer + .badge { margin-left: .25rem !important; }
.pos-line-offer { display: block; font-size: .72rem; font-weight: 600; color: #e5484d; }
:where(.promo-card) { --tone: var(--mp-primary); }
.promo-card { border-top: 4px solid var(--tone); background: linear-gradient(160deg, color-mix(in srgb, var(--tone) 9%, transparent), var(--mp-surface) 55%); }
.promo-card.is-idle { opacity: .75; }
.promo-value { font-size: 1.9rem; font-weight: 800; line-height: 1; color: var(--tone); }
.promo-value small { display: block; margin-top: .2rem; font-size: .75rem; font-weight: 600; color: var(--mp-muted); }
.promo-name { margin: .75rem 0 .5rem; font-size: 1.05rem; font-weight: 600; color: var(--mp-heading); }
.promo-facts { list-style: none; padding: 0; margin: 0 0 1rem; font-size: .8125rem; color: var(--mp-text); }
.promo-facts li { display: flex; gap: .45rem; margin-bottom: .25rem; }
.promo-facts i { color: var(--tone); }

/* Accounting: report tables, period filter, vouchers, chart groups */
.report-period { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.report-period > div:not(.report-presets) { min-width: 170px; }
.report-presets { display: flex; flex-wrap: wrap; gap: .35rem; }
.report-account { min-width: 280px; flex: 0 1 380px; }
.report-table td.amount, .report-table th.amount, .report-table .amount { white-space: nowrap; font-variant-numeric: tabular-nums; }
.report-table .report-section td {
  padding-top: .9rem; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--mp-primary); border-bottom-color: color-mix(in srgb, var(--mp-primary) 25%, transparent);
}
.report-table .report-subtotal td { font-weight: 600; color: var(--mp-heading); background: color-mix(in srgb, var(--mp-primary) 4%, var(--mp-surface)); }
.report-table .report-total td {
  font-size: 1.05rem; font-weight: 700; color: var(--mp-heading); border-top: 2px solid var(--mp-heading); border-bottom: 0;
  background: color-mix(in srgb, var(--mp-primary) 8%, var(--mp-surface));
}
.report-table .report-total.is-negative td { color: #e5484d; }
:where(.chart-group, .voucher-card) { --tone: var(--mp-primary); }
.chart-group, .voucher-card { border-top: 3px solid var(--tone); }
.chart-group .card-header .card-title, .voucher-card .card-header .card-title { color: var(--tone); }
.chart-group .table td { padding-left: 1rem; padding-right: 1rem; }
.category-bar { position: relative; display: flex; justify-content: space-between; gap: 1rem; padding: .3rem .6rem; margin-bottom: .35rem; border-radius: 7px; font-size: .875rem; overflow: hidden; }
.category-bar span, .category-bar strong { position: relative; z-index: 1; }
.category-bar i { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--mp-primary) 12%, transparent); border-radius: 7px; }
.fund-kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
:where(.fund-kind) { --tone: var(--mp-primary); }
.fund-kind {
  display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .7rem .4rem; margin: 0; cursor: pointer; text-align: center;
  border: 1px solid var(--mp-border); border-radius: 10px; font-size: .8125rem; font-weight: 500; color: var(--mp-text);
}
.fund-kind input { position: absolute; opacity: 0; pointer-events: none; }
.fund-kind i { font-size: 1.3rem; color: var(--tone); }
.fund-kind:has(input:checked) { border-color: var(--tone); background: color-mix(in srgb, var(--tone) 10%, transparent); box-shadow: 0 0 0 .15rem color-mix(in srgb, var(--tone) 25%, transparent); }
.fund-kind:has(input:focus-visible) { outline: 2px solid var(--tone); }
.entry-lines td { vertical-align: top; }
@media (max-width: 575.98px) { .fund-kinds { grid-template-columns: 1fr; } .report-account { min-width: 100%; } }
.category-rename { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.category-rename input[name=name] { flex: 1 1 160px; }
.category-rename input[name=description] { flex: 2 1 200px; }

/* Reports: hub cards, filter row, print header */
:where(.report-group) { --tone: var(--mp-primary); }
.report-group-title { display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; font-size: .8125rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tone); }
.report-card {
  display: flex; flex-direction: row; gap: .85rem; align-items: flex-start; padding: 1rem 1.1rem; text-decoration: none; color: var(--mp-text);
  border: 1px solid var(--mp-border); border-left: 4px solid var(--tone); transition: box-shadow .12s, transform .12s;
}
.report-card:hover { color: var(--mp-text); box-shadow: 0 4px 14px color-mix(in srgb, var(--tone) 25%, transparent); transform: translateY(-1px); }
.report-card strong { display: block; color: var(--mp-heading); margin-bottom: .15rem; }
.report-card small { display: block; color: var(--mp-muted); font-size: .8125rem; line-height: 1.35; }
.report-card-icon { width: 40px; height: 40px; flex: none; border-radius: 10px; display: grid; place-items: center; font-size: 1.2rem; color: var(--tone); background: color-mix(in srgb, var(--tone) 12%, transparent); }
.report-filters { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: flex-end; }
.report-filter { min-width: 190px; flex: 0 1 230px; }
.report-filter-wide { flex-basis: 320px; }
.report-filter-submit { min-width: 0; flex: none; }
.print-only { display: none; }
.report-print-head { margin-bottom: .75rem; font-size: .9rem; }
@media print {
  .print-only { display: block; }
  .report-table { font-size: 11px; }
  .dt-layout-row:not(.dt-layout-table) { display: none !important; }
}

/* Dashboard chart (single series: violet, a lighter step in dark mode) and share bars */
:root { --chart-1: #8b5cf6; }
[data-bs-theme="dark"] { --chart-1: #8b7dff; }
.mp-chart-box { position: relative; }
.mp-chart { display: block; width: 100%; height: auto; overflow: visible; }
.mp-chart-grid { stroke: var(--mp-border); stroke-width: 1; }
.mp-chart-axis { stroke: var(--mp-muted); stroke-width: 1; opacity: .5; }
.mp-chart-tick { fill: var(--mp-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.mp-chart-bar { fill: var(--chart-1); transition: opacity .12s; }
.mp-chart-hit { fill: transparent; }
.mp-chart-col { cursor: default; outline: none; }
.mp-chart-col.is-active .mp-chart-bar { opacity: .75; }
.mp-chart-col.is-active .mp-chart-hit, .mp-chart-col:focus-visible .mp-chart-hit { fill: color-mix(in srgb, var(--chart-1) 8%, transparent); }
.mp-chart-tip {
  position: absolute; transform: translate(-50%, -100%); pointer-events: none; white-space: nowrap; z-index: 2;
  padding: .35rem .6rem; border-radius: 8px; background: var(--mp-surface); border: 1px solid var(--mp-border); box-shadow: var(--mp-shadow);
  font-size: .8125rem; color: var(--mp-muted);
}
.mp-chart-tip strong { display: block; color: var(--mp-heading); font-size: .95rem; }
.share-row { margin-bottom: .85rem; }
.share-row:last-child { margin-bottom: 0; }
.share-track { height: 8px; margin: .35rem 0 .15rem; border-radius: 999px; background: color-mix(in srgb, var(--chart-1) 14%, transparent); overflow: hidden; }
.share-track span { display: block; height: 100%; border-radius: 999px; background: var(--chart-1); }

/* HR: attendance sheet, calendar and payroll. Status colour always sits next to its label. */
.att-toolbar { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.att-day { display: flex; gap: .4rem; align-items: center; }
.att-day .form-control, .att-day .mp-date-input { width: 170px; }
.att-counts { display: flex; flex-wrap: wrap; gap: .4rem; }
.att-chip, .att-pill, .att-mini, .att-summary li, .att-event {
  --tone-soft: color-mix(in srgb, var(--tone) 12%, transparent);
  --tone-line: color-mix(in srgb, var(--tone) 35%, transparent);
}
.att-chip { display: inline-flex; gap: .35rem; align-items: center; padding: .25rem .65rem; border-radius: 999px; background: var(--tone-soft); color: var(--mp-heading); font-size: .8125rem; }
.att-chip i { color: var(--tone); }
.att-chip strong { font-variant-numeric: tabular-nums; }
.att-sheet { padding: 0 1.25rem; }
.att-head, .att-row { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(292px, 3fr) 118px 118px minmax(0, 1fr); gap: .5rem .75rem; align-items: center; }
.att-head { padding: .6rem 0; border-bottom: 1px solid var(--mp-border); font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--mp-muted); }
.att-row { padding: .65rem 0; border-bottom: 1px solid var(--mp-border); }
.att-row:last-child { border-bottom: 0; }
.att-row.is-unmarked .att-person strong::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: .4rem; border-radius: 50%; background: var(--mp-muted); opacity: .5; vertical-align: middle; }
.att-person strong { display: block; color: var(--mp-heading); }
.att-person small { color: var(--mp-muted); }
.att-status { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; margin: 0; padding: 0; border: 0; min-width: 0; }
.att-pill {
  display: inline-flex; gap: .3rem; align-items: center; padding: .25rem .55rem; margin: 0; cursor: pointer; user-select: none;
  border: 1px solid var(--mp-border); border-radius: 999px; font-size: .8125rem; font-weight: 500; color: var(--mp-text); background: var(--mp-surface);
  transition: background .12s, border-color .12s;
}
.att-pill i { color: var(--tone); }
.att-pill:hover { border-color: var(--tone-line); background: var(--tone-soft); }
.btn-check:checked + .att-pill { background: var(--tone); border-color: var(--tone); color: #fff; }
.btn-check:checked + .att-pill i { color: #fff; }
.btn-check:focus-visible + .att-pill { outline: 2px solid var(--tone); outline-offset: 2px; }
.att-status:disabled .att-pill { cursor: default; opacity: .85; }
.att-clear { border: 0; background: none; color: var(--mp-muted); padding: .2rem .35rem; border-radius: 6px; }
.att-clear:hover { color: var(--mp-heading); background: var(--mp-border); }
.att-time, .att-note { margin: 0; }
.att-footer { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; background: transparent; padding: 1rem 1.25rem; }
@media (max-width: 991.98px) {
  .att-head { display: none; }
  .att-row { grid-template-columns: 1fr 1fr; }
  .att-person, .att-status, .att-note { grid-column: 1 / -1; }
}
@media (max-width: 575.98px) { .att-pill span { display: none; } .att-pill { padding: .35rem .55rem; } }

.att-cal-filter { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.att-cal-filter .form-select, .att-cal-filter .select2-container { min-width: 260px; max-width: 100%; }
.att-calendar {
  --fc-border-color: var(--mp-border); --fc-page-bg-color: var(--mp-surface); --fc-neutral-bg-color: var(--mp-body-bg, transparent);
  --fc-today-bg-color: color-mix(in srgb, var(--mp-primary) 7%, transparent);
  --fc-button-bg-color: var(--mp-surface); --fc-button-border-color: var(--mp-border); --fc-button-text-color: var(--mp-text);
  --fc-button-hover-bg-color: var(--mp-primary-subtle); --fc-button-hover-border-color: var(--mp-primary);
  --fc-button-active-bg-color: var(--mp-primary); --fc-button-active-border-color: var(--mp-primary);
  --fc-event-bg-color: transparent; --fc-event-border-color: transparent; --fc-event-text-color: var(--mp-heading);
}
.att-calendar .fc-toolbar-title { font-size: 1.15rem; font-weight: 600; color: var(--mp-heading); }
.att-calendar .fc-button { font-size: .8125rem; text-transform: capitalize; box-shadow: none !important; }
.att-calendar .fc-button-primary:not(:disabled).fc-button-active, .att-calendar .fc-button-primary:not(:disabled):active { color: #fff; }
.att-calendar .fc-col-header-cell-cushion, .att-calendar .fc-daygrid-day-number { color: var(--mp-muted); text-decoration: none; font-size: .8125rem; }
.att-calendar .fc-day-today .fc-daygrid-day-number { color: var(--mp-primary); font-weight: 700; }
.att-calendar .fc-daygrid-day { cursor: pointer; }
.att-calendar .fc-daygrid-day-frame { min-height: 92px; }
.att-event { margin: 1px 4px !important; padding: 1px 6px; border-radius: 6px; background: var(--tone-soft) !important; border-left: 3px solid var(--tone) !important; }
.att-event-body { display: flex; flex-wrap: wrap; gap: 0 .3rem; align-items: center; overflow: hidden; white-space: nowrap; font-size: .75rem; color: var(--mp-heading); }
.att-event-body span { overflow: hidden; text-overflow: ellipsis; }
.att-event-body small { flex-basis: 100%; padding-left: 1.05rem; color: var(--mp-muted); font-size: .6875rem; font-variant-numeric: tabular-nums; }
.att-event-body i { color: var(--tone); flex: none; }
.att-present { --tone: #12a389; } .att-late { --tone: #d4930a; } .att-half { --tone: #ef8a2a; }
.att-absent { --tone: #e5484d; } .att-leave { --tone: #2f95dc; } .att-off { --tone: #6b7280; }
.att-summary li { display: flex; justify-content: space-between; align-items: center; padding: .45rem .6rem; margin-bottom: .35rem; border-radius: 8px; background: var(--tone-soft); }
.att-summary li i { color: var(--tone); }
.att-summary strong { font-variant-numeric: tabular-nums; color: var(--mp-heading); }
.att-mini { display: inline-block; margin-left: .25rem; padding: 0 .35rem; border-radius: 4px; background: var(--tone-soft); color: var(--mp-heading); font-size: .6875rem; }

.payroll-table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--mp-muted); white-space: nowrap; }
.payroll-table td, .payroll-table th { padding-left: .75rem; padding-right: .75rem; }
.payroll-table tbody td:first-child, .payroll-table thead th:first-child, .payroll-table tfoot td:first-child { padding-left: 1.25rem; }
.payroll-input { width: 96px; margin-left: auto; text-align: right; font-variant-numeric: tabular-nums; }
.payroll-note { min-width: 130px; }
.payroll-person { min-width: 150px; white-space: nowrap; }
.payroll-table tfoot td { border-bottom: 0; background: var(--mp-primary-subtle); }
.payroll-how { padding-left: 1.1rem; }
.payroll-how li { margin-bottom: .3rem; }

/* Checking in yourself; the shop's networks and shifts */
.check-panel { border-top: 3px solid #12a389; }
.check-panel-head { display: flex; gap: .75rem; align-items: flex-start; justify-content: space-between; margin-bottom: 1rem; }
.check-panel .card-title i { color: #12a389; }
.check-times { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: .85rem; }
.check-times > div { padding: .6rem .8rem; border-radius: 10px; background: var(--mp-body-bg); }
.check-times span { display: block; font-size: .75rem; color: var(--mp-muted); }
.check-times strong { font-size: 1.15rem; color: var(--mp-heading); font-variant-numeric: tabular-nums; }
.check-network { display: flex; gap: .5rem; align-items: flex-start; padding: .55rem .75rem; border-radius: 10px; font-size: .8125rem; }
.check-network.is-ok { background: color-mix(in srgb, #12a389 12%, transparent); color: var(--mp-heading); }
.check-network.is-ok i { color: #12a389; }
.check-network.is-away { background: color-mix(in srgb, #d4930a 14%, transparent); color: var(--mp-heading); }
.check-network.is-away i { color: #d4930a; }
.att-self, .att-away { display: block; margin-top: .2rem; font-size: .75rem; white-space: normal; }
.att-self { color: var(--mp-muted); }
.att-away { color: #b07800; }
[data-bs-theme="dark"] .att-away { color: #e8b04a; }
.att-event-away { color: #b07800 !important; }
.net-list li { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .5rem .25rem; border-bottom: 1px solid var(--mp-border); }
.net-list li:last-child { border-bottom: 0; }
.net-list li.is-editing { background: var(--mp-primary-subtle); border-radius: 8px; padding-inline: .5rem; }
.shift-row { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(0, 1.6fr); gap: .5rem .75rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--mp-border); }
.shift-row:last-child { border-bottom: 0; }
.shift-row strong { color: var(--mp-heading); }
.shift-hours { color: #7c3aed; font-variant-numeric: tabular-nums; }
[data-bs-theme="dark"] .shift-hours { color: #c4b5fd; }
.shift-picks { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; margin: 0; padding: 0; border: 0; min-width: 0; }
.shift-picks .att-pill small { opacity: .8; font-variant-numeric: tabular-nums; }
.shift-people { display: flex; flex-wrap: wrap; gap: .25rem .75rem; margin-top: .3rem; font-size: .8125rem; color: var(--mp-text); }
.shift-people i { color: var(--mp-muted); }
@media (max-width: 575.98px) { .shift-row { grid-template-columns: 1fr; } .shift-picks { justify-content: flex-start; } }
.att-early { display: inline-flex; gap: .25rem; align-items: center; margin-top: .2rem; font-size: .75rem; font-weight: 600; color: #b5462f; white-space: nowrap; }
[data-bs-theme="dark"] .att-early { color: #f08a72; }
.att-event-early { color: #b5462f !important; }

/* Messages, campaigns and loyalty */
.msg-cell { max-width: 360px; }
.msg-body { white-space: pre-line; overflow-wrap: anywhere; font-size: .8125rem; line-height: 1.35; }
.msg-detail { max-width: 220px; overflow-wrap: anywhere; color: #b42318 !important; }
.sms-count { font-variant-numeric: tabular-nums; }
.sms-count.is-unicode { color: #b07800; }
.placeholder-help { margin: -.5rem 0 0; font-size: .75rem; line-height: 1.9; }
.placeholder-help code { padding: .1rem .35rem; border-radius: 6px; background: var(--mp-primary-subtle); color: var(--mp-heading); }
.credit-figure { font-size: 2rem; font-weight: 700; color: var(--mp-heading); font-variant-numeric: tabular-nums; line-height: 1.1; }
.credit-list li, .sent-list li { display: flex; justify-content: space-between; gap: .5rem; padding: .45rem 0; border-bottom: 1px solid var(--mp-border); font-size: .8125rem; }
.sent-list li { justify-content: flex-start; align-items: baseline; flex-wrap: wrap; }
.credit-list li:last-child, .sent-list li:last-child { border-bottom: 0; }
.sms-bubble { max-width: 420px; padding: .85rem 1rem; border-radius: 16px 16px 16px 4px; background: var(--mp-primary-subtle); color: var(--mp-heading); white-space: pre-line; overflow-wrap: anywhere; }
.campaign-reach { font-size: 1rem; margin-bottom: .5rem; }
.campaign-reach strong { font-size: 2rem; color: var(--mp-heading); font-variant-numeric: tabular-nums; }
.points-change { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--tone); }
.points-change.tone-teal { color: #0f8a74; }
.points-change.tone-red { color: #c43b40; }
[data-bs-theme="dark"] .points-change.tone-teal { color: #3fd0b4; }
[data-bs-theme="dark"] .points-change.tone-red { color: #f28b8f; }
.top-list { padding-left: 1.25rem; }
.top-list li { padding: .35rem 0; border-bottom: 1px solid var(--mp-border); }
.top-list li:last-child { border-bottom: 0; }
.top-list li strong { float: right; font-variant-numeric: tabular-nums; }
.example-box { padding: .65rem .8rem; border-radius: 10px; background: var(--mp-body-bg); }
.adjust-points summary { cursor: pointer; color: var(--mp-primary); font-size: .875rem; }
.settings-save { position: sticky; top: 88px; z-index: 2; }
.pos-points-note { display: block; font-size: .7rem; color: var(--mp-muted); font-weight: 400; }
.pos-points-value { display: block; margin-top: .15rem; font-size: .75rem; color: #0f8a74; text-align: right; }

/* Invoice & printing */
.show-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 1rem; }
.show-grid .form-check { margin-bottom: .6rem; }
.letterhead-preview { padding: .5rem; border: 1px dashed var(--mp-border); border-radius: 10px; background: #fff; }
.letterhead-preview img { display: block; width: 100%; max-height: 120px; object-fit: contain; }
.invoice-preview { position: sticky; top: 88px; }
.invoice-preview iframe { display: block; width: 100%; height: 70vh; min-height: 520px; border: 0; border-radius: 0 0 var(--bs-card-inner-border-radius) var(--bs-card-inner-border-radius); background: #eceaf3; }
.print-frame { position: fixed; right: 0; bottom: 0; width: 0; height: 0; border: 0; visibility: hidden; }
.export-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .75rem 1.25rem; margin-bottom: 1rem; }
.export-group { margin: 0; padding: 0; border: 0; min-width: 0; }
.export-group legend { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--mp-muted); margin-bottom: .35rem; }
.export-group .form-check { margin-bottom: .3rem; }

/* Audit log */
.audit-cell { max-width: 420px; }
.audit-summary { display: flex; flex-wrap: wrap; gap: .2rem .75rem; font-size: .8125rem; line-height: 1.35; }
.audit-change { overflow-wrap: anywhere; }
.audit-change b { font-weight: 600; color: var(--mp-heading); margin-right: .2rem; }
.audit-table th[scope=row] { width: 30%; font-weight: 600; color: var(--mp-heading); }
.audit-table td { overflow-wrap: anywhere; white-space: pre-line; }
.audit-before { color: #b42318; background: color-mix(in srgb, #e5484d 7%, transparent); }
.audit-after { color: #0f7a66; background: color-mix(in srgb, #12a389 8%, transparent); }
[data-bs-theme="dark"] .audit-before { color: #f28b8f; }
[data-bs-theme="dark"] .audit-after { color: #3fd0b4; }

/* Branch audits */
.audit-checks .audit-check { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: .5rem 1rem; align-items: center; padding: .75rem 1.25rem; border-bottom: 1px solid var(--mp-border); }
.audit-checks .audit-check:last-child { border-bottom: 0; }
.audit-check.is-issue { background: color-mix(in srgb, #e5484d 6%, transparent); }
.audit-check-head { display: flex; gap: .6rem; align-items: flex-start; }
.audit-check-head strong { color: var(--mp-heading); }
.audit-check-answer { display: grid; gap: .35rem; }
.audit-findings li { padding: .6rem 0; border-bottom: 1px solid var(--mp-border); }
.audit-findings li.is-resolved { opacity: .65; }
.audit-finding-form { margin-top: .75rem; }
.audit-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem 2rem; }
.audit-section h3 { font-size: .8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--mp-muted); margin: 0 0 .5rem; }
.audit-wide { grid-column: 1 / -1; }
@media (max-width: 767.98px) { .audit-checks .audit-check { grid-template-columns: 1fr; } }

/* Support chat */
.support-widget { position: fixed; right: 20px; bottom: 20px; z-index: 1080; }
.support-fab { width: 54px; height: 54px; border: 0; border-radius: 50%; background: var(--mp-primary); color: #fff; font-size: 1.4rem; box-shadow: 0 6px 20px rgba(139, 92, 246, .4); }
.support-fab:hover { filter: brightness(1.08); }
.support-fab:focus-visible { outline: 3px solid color-mix(in srgb, var(--mp-primary) 45%, transparent); outline-offset: 3px; }
.support-widget.is-open .support-fab { display: none; }
.support-panel { display: flex; flex-direction: column; width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 100px)); background: var(--mp-surface); border: 1px solid var(--mp-border); border-radius: 16px; box-shadow: 0 16px 44px rgba(20, 16, 50, .22); overflow: hidden; }
.support-panel[hidden] { display: none; }
.support-head { display: flex; align-items: center; justify-content: space-between; padding: .75rem 1rem; background: var(--mp-primary); color: #fff; }
.support-head button { border: 0; background: transparent; color: #fff; padding: .2rem .4rem; border-radius: 6px; }
.support-head button:hover { background: rgba(255, 255, 255, .18); }
.support-log { flex: 1; overflow-y: auto; padding: .9rem; display: flex; flex-direction: column; gap: .55rem; background: var(--mp-body-bg); }
.support-msg { max-width: 88%; padding: .55rem .75rem; border-radius: 14px; font-size: .875rem; line-height: 1.45; overflow-wrap: anywhere; }
.support-msg.is-assistant { align-self: flex-start; background: var(--mp-surface); border: 1px solid var(--mp-border); color: var(--mp-heading); border-bottom-left-radius: 4px; }
.support-msg.is-user { align-self: flex-end; background: var(--mp-primary); color: #fff; border-bottom-right-radius: 4px; }
.support-msg.is-waiting { color: var(--mp-muted); font-style: italic; }
.support-msg.is-error { border-color: #e5484d; color: #b42318; }
.support-msg a { font-weight: 600; }
.support-msg em { color: var(--mp-muted); }
.support-form { display: flex; gap: .5rem; padding: .6rem; border-top: 1px solid var(--mp-border); }
.support-form textarea { flex: 1; resize: none; border: 1px solid var(--mp-border); border-radius: 10px; padding: .45rem .6rem; font: inherit; font-size: .875rem; background: var(--mp-surface); color: var(--mp-text); }
.support-note { margin: 0; padding: 0 .75rem .55rem; font-size: .7rem; color: var(--mp-muted); }
@media print { .support-widget { display: none; } }

/* POS without internet */
.pos-net { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .6rem; border: 1px solid var(--mp-border); border-radius: 999px; background: var(--mp-surface); color: var(--mp-heading); font-size: .8125rem; }
.pos-net-dot { width: 9px; height: 9px; border-radius: 50%; background: #12a389; box-shadow: 0 0 0 3px color-mix(in srgb, #12a389 20%, transparent); }
.pos-net.is-offline { border-color: #d4930a; background: color-mix(in srgb, #d4930a 12%, var(--mp-surface)); }
.pos-net.is-offline .pos-net-dot { background: #d4930a; box-shadow: 0 0 0 3px color-mix(in srgb, #d4930a 25%, transparent); }
.pos-net.has-failed .badge { background: #e5484d !important; color: #fff !important; }
.offline-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--mp-border); }
.offline-row:last-child { border-bottom: 0; }
.offline-row.is-failed strong { color: #b42318; }
