:root {
  --bg: #f0f3f7;
  --bg-soft: #e4eaf1;
  --panel: #ffffff;
  --ink: #1a2332;
  --muted: #6b7a8d;
  --line: #d5dde8;
  --primary: #0d6e6e;
  --primary-dark: #095555;
  --accent: #c45c26;
  --good: #1f7a4d;
  --danger: #b33a3a;
  --shadow: 0 8px 28px rgba(26, 35, 50, 0.08);
  --radius: 14px;
  --font: "Segoe UI", "Trebuchet MS", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, #d9ebe8 0%, transparent 40%),
    radial-gradient(circle at 90% 10%, #f3e4d8 0%, transparent 35%),
    linear-gradient(180deg, #f7f9fc 0%, var(--bg) 100%);
}

a { color: var(--primary); text-decoration: none; }
button, input, select { font: inherit; }

.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: rgba(255,255,255,0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand {
  font-weight: 800;
  letter-spacing: 0.02em;
  font-size: 1.2rem;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.store-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--primary-dark);
}
.compare-table .active-row { background: rgba(13, 110, 110, 0.08); }
.compare-table .total-row { background: var(--bg-soft); font-weight: 600; }
.store-select-panel {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
/* Network reports page */
.nc-page { display: grid; gap: 1rem; }
.nc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.nc-head h1 { margin: 0 0 0.25rem; font-size: 1.45rem; }
.nc-store-panel { padding: 1rem 1.15rem; }
.nc-store-head { margin-bottom: 0.75rem; }
.nc-store-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.nc-store-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.85rem;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  transition: border-color 0.15s, background 0.15s;
}
.nc-store-tab:hover { border-color: var(--primary); background: #f3fbfa; }
.nc-store-tab.is-active {
  border-color: var(--primary);
  background: rgba(13, 110, 110, 0.08);
  color: var(--primary-dark);
}
.nc-store-tab-name { max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nc-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.nc-summary-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.35rem;
}
.nc-summary-card.accent { border-color: var(--primary); }
.nc-summary-label { color: var(--muted); font-size: 0.88rem; font-weight: 600; }
.nc-summary-value { font-size: 1.45rem; font-weight: 800; color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.nc-copy-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: #eef8f7;
  border: 1px solid rgba(13, 110, 110, 0.22);
}
.nc-copy-bar[hidden] { display: none !important; }
.nc-copy-bar-hint { margin: 0; font-size: 0.9rem; color: var(--muted); line-height: 1.4; flex: 1 1 12rem; }
.nc-products-head { flex-wrap: wrap; align-items: flex-start; }
.nc-products-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}
.nc-products-tools .inline-search { margin-left: 0; }
#btnToggleCopyMode.is-active {
  border-color: var(--primary);
  background: #e8f6f5;
  color: var(--primary-dark);
}
.copy-mode-only { display: none !important; }
.nc-page.nc-copy-active th.copy-mode-only,
.nc-page.nc-copy-active td.copy-mode-only {
  display: table-cell !important;
}
.nc-page.nc-copy-active .cat-actions .copy-mode-only {
  display: inline !important;
}
.nc-page.nc-copy-active .nc-product-table tbody tr:has(.product-pick:checked) {
  background: #f3fbfa;
}
.cat-list-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}
.cat-count {
  flex-shrink: 0;
  min-width: 1.6rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}
.cat-list li.active .cat-count {
  background: rgba(13, 110, 110, 0.15);
  color: var(--primary-dark);
}
.nc-product-table .col-check { width: 2.5rem; text-align: center; display: none; }
.nc-product-table .col-check input { width: 1.1rem; height: 1.1rem; }

/* Copy wizard */
.modal-box.copy-wizard-box {
  width: min(960px, calc(100% - 1.5rem));
  max-width: 100%;
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  gap: 0;
}
.copy-wizard-header {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--line);
}
.copy-wizard-header .modal-title { margin: 0; }
.copy-wizard-sub { margin: 0.35rem 0 0; font-size: 0.9rem; }
.copy-wizard-steps {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
  font-weight: 700;
  flex-shrink: 0;
}
.copy-wizard-step-label { color: var(--muted); }
.copy-wizard-step-label.is-active { color: var(--primary-dark); }
.copy-wizard-step-sep { color: var(--muted); }
.copy-wizard-step-select,
.copy-wizard-step-conflicts {
  padding: 1rem 1.15rem;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 0;
  height: 0;
  min-height: 0;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.copy-wizard-target-label {
  display: grid;
  gap: 0.35rem;
  max-width: 360px;
  margin-bottom: 0.75rem;
  font-weight: 600;
}
.copy-wizard-hint { margin: 0 0 0.85rem; font-size: 0.9rem; }
.copy-wizard-layout {
  display: grid;
  grid-template-columns: minmax(220px, 34%) 1fr;
  gap: 0.85rem;
  min-height: 200px;
  max-height: min(48vh, 420px);
}
.copy-wizard-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.copy-wizard-panel h4 {
  margin: 0;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.copy-wizard-cat-list {
  list-style: none;
  margin: 0;
  padding: 0.35rem;
  overflow: auto;
  flex: 1 1 auto;
}
.copy-wizard-cat-item { margin: 0; }
.copy-wizard-cat-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
}
.copy-wizard-cat-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border: none;
  background: transparent;
  text-align: left;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
}
.copy-wizard-cat-item.is-active .copy-wizard-cat-btn {
  background: #eef8f7;
  color: var(--primary-dark);
}
.copy-wizard-cat-name { font-weight: 700; }
.copy-wizard-cat-count {
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
}
.copy-wizard-product-list {
  padding: 0.5rem 0.75rem;
  overflow: auto;
  flex: 1 1 auto;
  display: grid;
  gap: 0.35rem;
}
.copy-wizard-product-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.35rem;
  border-radius: 8px;
}
.copy-wizard-product-row:hover { background: var(--bg-soft); }
.copy-wizard-barcode { font-size: 0.78rem; color: var(--muted); margin-left: auto; }
.copy-wizard-target-map {
  margin-top: 0.85rem;
  padding: 0.85rem;
  border: 1px solid rgba(13, 110, 110, 0.22);
  border-radius: 12px;
  background: #eef8f7;
}
.copy-wizard-map-hint { margin: 0 0 0.65rem; font-size: 0.9rem; }
.copy-wizard-map-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(180px, 1.2fr);
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 0.5rem;
  font-weight: 600;
}
.copy-wizard-conflicts { display: grid; gap: 0.65rem; }
.copy-conflict-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem;
  background: #fff;
}
.copy-conflict-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: baseline;
}
.copy-conflict-exists { margin: 0.35rem 0 0.65rem; font-size: 0.88rem; }
.copy-conflict-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-weight: 600;
}
.copy-wizard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.15rem;
  border-top: 1px solid var(--line);
  background: #fff;
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 2;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.06);
}
.copy-wizard-footer-right {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-left: auto;
}

.nr-page {
  display: grid;
  gap: 1rem;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}
.nr-head h1 { margin: 0 0 0.25rem; font-size: 1.45rem; }
.nr-breadcrumb { margin: 0 0 0.35rem; font-size: 0.9rem; }
.nr-breadcrumb a { color: var(--primary); text-decoration: none; }
.nr-filter-panel { padding: 1rem 1.15rem; }
.nr-filter-form { display: grid; gap: 1.15rem; }
.nr-date-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
}
.nr-date-row .btn {
  align-self: flex-end;
  min-height: 42px;
}
.nr-filter-form.is-loading { opacity: 0.72; pointer-events: none; }
.nr-date-row label { display: grid; gap: 0.25rem; font-size: 0.9rem; }
.nr-stores-block {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}
.nr-stores-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.nr-selected-count {
  margin-left: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}
.nr-store-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.65rem;
}
.nr-store-tile {
  position: relative;
  display: block;
  cursor: pointer;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  user-select: none;
}
.nr-store-tile input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.nr-store-tile-body {
  display: grid;
  gap: 0.35rem;
  padding: 0.75rem 2rem 0.75rem 0.85rem;
}
.nr-store-tile-name {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.25;
  word-break: break-word;
}
.nr-store-tile-meta .badge { margin-left: 0; }
.nr-store-tile-check {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  border: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: transparent;
  background: #fff;
}
.nr-store-tile.is-selected {
  border-color: var(--primary);
  background: rgba(13, 110, 110, 0.06);
  box-shadow: 0 0 0 1px rgba(13, 110, 110, 0.12);
}
.nr-store-tile.is-selected .nr-store-tile-check {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.nr-store-tile.is-remote.is-selected {
  border-color: #0a7a7a;
}
.nr-summary-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}
.nl-extra-filters {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.nl-filter-block {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  background: #fff;
}
.nl-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.nl-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.35rem 0.75rem;
  max-height: 220px;
  overflow: auto;
}
.nl-check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.88rem;
  line-height: 1.35;
}
.nl-check-item input { margin-top: 0.15rem; flex-shrink: 0; }
.nl-filter-note { margin: 0.55rem 0 0; font-size: 0.82rem; }
.nl-logs-table td:last-child {
  word-break: break-word;
  max-width: 420px;
}
.network-logs-page .nr-filter-form.is-loading { opacity: 0.72; pointer-events: none; }
.nr-errors {
  border-color: #e0a800;
  background: #fff8e6;
}
.nr-errors ul { margin: 0.5rem 0 0; padding-left: 1.1rem; }
.nr-row-error { background: #fffafa; }
.nr-row-msg { font-size: 0.8rem; margin-top: 0.15rem; font-weight: 500; }
.nr-totals-grid .stat-value {
  font-size: clamp(0.95rem, 2.2vw, 1.35rem);
  word-break: break-word;
}
.nr-pivot-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 1rem 1rem;
}
.nr-pivot-panel .panel-head { padding: 0.85rem 1rem 0; }
.nr-pivot-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
}
.nr-pivot-table th,
.nr-pivot-table td {
  padding: 0.55rem 0.5rem;
  font-size: 0.88rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid var(--line);
}
.nr-pivot-table thead th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  background: var(--bg-soft);
  position: sticky;
  top: 0;
  z-index: 2;
}
.nr-pivot-table th:first-child,
.nr-pivot-table th[scope="row"] {
  text-align: left;
  font-weight: 700;
}
.nr-pivot-table th[scope="row"] {
  color: var(--muted);
  background: #fff;
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 7rem;
}
.nr-pivot-table tbody tr:last-child td,
.nr-pivot-table tbody tr:last-child th {
  border-bottom: none;
}
.nr-pivot-accent th[scope="row"],
.nr-pivot-accent td { background: rgba(13, 110, 110, 0.04); }
.nr-pivot-accent td:last-child strong { color: var(--primary-dark); }
.nr-pivot-good th[scope="row"],
.nr-pivot-good td { background: rgba(31, 122, 77, 0.05); }
.nr-pivot-good td:last-child strong { color: var(--good); }
.nr-single-store-card { padding: 0 1rem 1rem; }
.nr-single-store-head {
  padding: 0.2rem 0 0.75rem;
  font-size: 1.05rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.75rem;
}
.nr-single-store-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0;
}
.nr-single-store-metrics > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: var(--bg-soft);
}
.nr-single-store-metrics dt {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}
.nr-single-store-metrics dd {
  margin: 0;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.nr-single-store-metrics .is-highlight {
  grid-column: 1 / -1;
  background: rgba(31, 122, 77, 0.08);
  border: 1px solid rgba(31, 122, 77, 0.18);
}
.nr-collapsible summary {
  cursor: pointer;
  list-style: none;
  padding: 0.85rem 1rem;
}
.nr-collapsible summary::-webkit-details-marker { display: none; }
.nr-collapsible summary h2 { margin: 0; font-size: 1.05rem; display: inline; }
.nr-collapsible .table-wrap { padding: 0 1rem 1rem; }
.nr-table-scroll { overflow-x: auto; }
.nr-empty { text-align: center; padding: 2rem 1rem; }
@media (max-width: 640px) {
  .nc-summary-grid { grid-template-columns: 1fr; }
  .nc-summary-value { font-size: 1.25rem; }

  .nc-store-tabs { flex-direction: column; }
  .nc-store-tab { width: 100%; justify-content: space-between; }
  .nc-products-tools { width: 100%; margin-left: 0; }
  .nc-products-tools .inline-search { flex: 1 1 100%; }
  .nc-products-tools .inline-search input { flex: 1; min-width: 0; }
  .nc-copy-bar { flex-direction: column; align-items: stretch; }
  .nc-copy-bar .btn { width: 100%; min-height: 44px; }
  .copy-wizard-layout { grid-template-columns: 1fr; min-height: 0; }
  .copy-wizard-map-row { grid-template-columns: 1fr; }
  .copy-wizard-footer { flex-direction: column; align-items: stretch; }
  .copy-wizard-footer-right { width: 100%; margin-left: 0; }
  .copy-wizard-footer-right .btn { flex: 1; min-height: 44px; }

  .nr-store-tiles { grid-template-columns: 1fr; }
  .nr-date-row { flex-direction: column; align-items: stretch; }
  .nr-date-row label { width: 100%; }
  .nr-metrics-grid { grid-template-columns: 1fr; }
  .nr-metric-total { font-size: 1.3rem; }
  .nr-pivot-wrap { padding: 0 0.75rem 0.85rem; }
  .nr-pivot-table thead { display: none; }
  .nr-pivot-table tbody tr {
    display: block;
    margin-bottom: 0.65rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.65rem 0.75rem;
    background: #fff;
    box-shadow: var(--shadow);
  }
  .nr-pivot-table tbody tr.nr-pivot-accent {
    border-color: rgba(13, 110, 110, 0.25);
    background: rgba(13, 110, 110, 0.04);
  }
  .nr-pivot-table tbody tr.nr-pivot-good {
    border-color: rgba(31, 122, 77, 0.25);
    background: rgba(31, 122, 77, 0.05);
  }
  .nr-pivot-table tbody th[scope="row"] {
    display: block;
    position: static;
    padding: 0 0 0.55rem;
    margin-bottom: 0.45rem;
    border-bottom: 1px solid var(--line);
    font-size: 0.95rem;
    color: var(--ink);
    background: transparent;
  }
  .nr-pivot-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0;
    text-align: right;
    border-bottom: none;
    background: transparent !important;
  }
  .nr-pivot-table tbody td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 600;
    font-size: 0.84rem;
    text-align: left;
    flex: 1;
    min-width: 0;
  }
  .nr-single-store-metrics { grid-template-columns: 1fr; }
}
.store-select-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.store-check-all {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}
.store-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.35rem 1rem;
}
.store-check-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}
.network-report-filter .date-range { margin-bottom: 0; }
.period-label { margin: 0.5rem 0 1rem; }
.badge {
  font-size: 0.7rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: var(--primary);
  color: #fff;
  margin-left: 0.35rem;
}
.badge-soft {
  background: var(--bg-soft);
  color: var(--muted);
}
.federation-key {
  display: block;
  word-break: break-all;
  padding: 0.5rem 0.75rem;
  background: var(--bg-soft);
  border-radius: 8px;
  font-size: 0.85rem;
  flex: 1;
}
.dev-price-compare-form {
  display: grid;
  gap: 1rem;
  max-width: 48rem;
}
.dev-store-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.35rem 0.75rem;
  margin-top: 0.5rem;
}
.dev-price-search input {
  width: min(100%, 22rem);
  margin-top: 0.35rem;
}
.dev-price-compare-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.dev-catalog-stats {
  margin: 0.5rem 0 1rem;
}
.dev-catalog-rebuild-form {
  margin-top: 0.25rem;
}
.dev-price-compare-table code {
  font-size: 0.82rem;
  word-break: break-all;
}
.dev-price-compare-table th,
.dev-price-compare-table td {
  font-size: 0.88rem;
  vertical-align: top;
}
.dev-price-subhead th {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
}
.dev-price-alt-name {
  font-size: 0.78rem;
}
.dev-remote-server-list {
  display: grid;
  gap: 0.65rem;
}
.dev-remote-server-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  background: var(--bg-soft);
}
.dev-remote-server-item summary {
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.dev-remote-server-form {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.75rem;
  max-width: 36rem;
}
.dev-store-pick-disabled {
  opacity: 0.55;
}
.dev-compare-errors .dev-error-list {
  margin: 0.35rem 0 0;
  padding-left: 1.2rem;
}
.dev-page { display: grid; gap: 1.25rem; }
.dev-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.dev-page-head h1 { margin: 0 0 0.25rem; font-size: 1.5rem; }
.dev-breadcrumb { margin: 0 0 0.35rem; font-size: 0.9rem; }
.dev-breadcrumb a { color: var(--primary); text-decoration: none; }
.dev-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: 1.25rem;
  align-items: start;
}
.dev-sidebar { display: grid; gap: 1rem; }
.dev-main { display: grid; gap: 1.25rem; min-width: 0; }
.dev-section { margin: 0; }
.dev-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}
.dev-section-title h2 { margin: 0; font-size: 1.15rem; }
.dev-section-desc, .dev-footnote, .dev-hint, .dev-empty, .dev-empty-in-section {
  margin: 0.35rem 0 0.75rem;
  font-size: 0.9rem;
}
.dev-section-link { margin-left: auto; }
.dev-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}
.dev-form-stack { display: grid; gap: 0.75rem; }
.dev-form-stack-wrap h2 { margin: 0 0 0.75rem; font-size: 1rem; }
.dev-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}
.dev-form-grid .dev-span-2 { grid-column: 1 / -1; }
.dev-form-actions { grid-column: 1 / -1; }
.dev-federation summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.dev-federation summary::-webkit-details-marker { display: none; }
.dev-key-row { display: flex; gap: 0.5rem; align-items: flex-start; margin-top: 0.75rem; }
.dev-network-list { display: grid; gap: 0.85rem; }
.dev-network-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  background: #fff;
}
.dev-network-block-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.dev-network-block-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.dev-danger-zone {
  border-color: rgba(179, 58, 58, 0.35);
  background: #fffafa;
}
.dev-danger-zone h2 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: var(--danger);
}
.dev-network-block-head h3 { margin: 0; font-size: 1.05rem; }
.dev-network-block-head p { margin: 0.15rem 0 0; font-size: 0.85rem; }
.dev-store-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.dev-store-chips-lg .dev-store-chip { padding: 0.35rem 0.65rem; }
.dev-store-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(13, 110, 110, 0.1);
  color: var(--primary-dark);
  font-size: 0.85rem;
  font-weight: 600;
}
.dev-store-chip.standalone { background: #eef1f4; color: #4a5568; }
.dev-store-chip.remote em {
  font-style: normal;
  font-size: 0.7rem;
  opacity: 0.75;
  text-transform: uppercase;
}
.dev-store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.85rem;
}
.dev-store-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  background: #fff;
  display: grid;
  gap: 0.65rem;
}
.dev-store-card.is-remote { border-color: rgba(13, 110, 110, 0.35); }
.dev-store-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.dev-store-rename {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}
.dev-store-name-input {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: 1rem;
  border: 1px solid transparent;
  background: transparent;
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
}
.dev-store-name-input:focus {
  border-color: var(--line);
  background: #fff;
  outline: none;
}
.dev-store-badges { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.badge-network { background: rgba(13, 110, 110, 0.15); color: var(--primary-dark); }
.badge-standalone { background: #eef1f4; color: #5a6578; }
.dev-store-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.dev-store-activity {
  display: grid;
  gap: 0.35rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: rgba(13, 110, 110, 0.06);
  border: 1px solid rgba(13, 110, 110, 0.12);
  font-size: 0.85rem;
}
.dev-store-activity-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
}
.dev-store-activity-label {
  color: var(--muted);
}
.dev-store-activity-details {
  color: var(--text);
}
.dev-store-activity-user {
  color: var(--muted);
  font-size: 0.8rem;
}
.remote-printers-page .remote-server-url code {
  word-break: break-all;
}
.remote-pairing-box {
  margin: 0.75rem 0;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: rgba(13, 110, 110, 0.08);
  border: 1px solid rgba(13, 110, 110, 0.15);
}
.remote-pairing-code {
  font-size: 1.35rem;
  letter-spacing: 0.15em;
}
.remote-agents-list {
  display: grid;
  gap: 1rem;
}
.remote-agent-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  background: #fff;
}
.remote-agent-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}
.remote-status {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}
.remote-status.is-online {
  color: #0f766e;
  background: rgba(15, 118, 110, 0.12);
}
.remote-status.is-offline {
  color: #9a3412;
  background: rgba(154, 52, 18, 0.1);
}
.remote-printers-table {
  margin-top: 0.65rem;
  font-size: 0.88rem;
}
.remote-inline-form,
.remote-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.75rem;
}
.remote-assign-form .form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin: 0.75rem 0;
}
.product-label-modal {
  max-width: 28rem;
}
.product-label-form fieldset {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 0.5rem;
  padding: 0.75rem;
  margin: 0.75rem 0;
}
.product-label-form legend {
  padding: 0 0.35rem;
  font-size: 0.9rem;
}
.product-label-size-options {
  display: grid;
  gap: 0.5rem;
}
.product-label-size-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 0.5rem;
  cursor: pointer;
}
.product-label-size-option:has(input:checked) {
  border-color: #0d6e6e;
  background: rgba(13, 110, 110, 0.06);
}
.product-label-size-option input {
  margin: 0;
}
.product-label-product {
  margin: 0 0 0.75rem;
}
.settings-payment-links {
  margin: 0.75rem 0 1rem;
}
.products-table .col-markup {
  text-align: right;
  white-space: nowrap;
}
.product-markup-pct {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.product-markup-pct.is-positive {
  color: #0f766e;
}
.product-markup-pct.is-negative {
  color: #b91c1c;
}
.product-markup-pct.is-zero,
.product-markup-pct.is-muted {
  color: #64748b;
  font-weight: 500;
}
.sale-price-markup-form fieldset {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 0.5rem;
  padding: 0.85rem 1rem;
  margin: 1rem 0;
}
.sale-price-markup-form legend {
  padding: 0 0.35rem;
}
.sale-price-default-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}
.sale-price-scales-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
}
.sale-price-scales-head h3 {
  margin: 0;
}
.sale-price-scales-table input {
  width: 100%;
  min-width: 5rem;
}
.sale-price-preview {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border-radius: 0.5rem;
  background: rgba(13, 110, 110, 0.05);
}
.sale-price-preview-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.65rem;
  margin-top: 0.65rem;
}
.sale-price-preview-result {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0d6e6e;
}
.product-label-form .form-error {
  color: #b91c1c;
  font-size: 0.9rem;
  margin: 0.5rem 0 0;
}
.remote-hint-warn {
  margin: 0.5rem 0 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: rgba(180, 83, 9, 0.1);
  border: 1px solid rgba(180, 83, 9, 0.2);
  color: #9a3412;
  font-size: 0.9rem;
}
.remote-store-badge {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.95rem;
}
.remote-other-stores {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--border);
}
.remote-other-stores ul {
  margin: 0.35rem 0 0.5rem 1.1rem;
}
.dev-store-network-form,
.dev-store-remote-form,
.dev-store-license-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
.dev-inline-label { font-size: 0.85rem; color: var(--muted); margin: 0; }
.dev-store-remote {
  border-top: 1px dashed var(--line);
  padding-top: 0.5rem;
}
.dev-store-remote summary {
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-dark);
}
.dev-store-remote-form {
  margin-top: 0.5rem;
  display: grid;
  gap: 0.5rem;
}
.dev-store-remote-form label { display: grid; gap: 0.2rem; font-size: 0.85rem; }
.dev-remote-test-form { margin-top: 0.5rem; }
.nr-remote-panel { padding: 1rem 1.15rem; }
.nr-remote-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.75rem;
  background: #fff;
}
.nr-remote-block summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.nr-remote-form {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.75rem;
}
.nr-remote-form label { display: grid; gap: 0.25rem; font-size: 0.9rem; font-weight: 600; }
.nr-remote-form-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.nr-remote-test-form { margin-top: 0.35rem; }
.dev-store-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--line);
}
.dev-admin-list {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
}
.dev-admin-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.dev-admin-password-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.dev-admin-password-form input[type="password"] {
  flex: 1;
  min-width: 120px;
}
.dev-admin-name {
  font-weight: 600;
  min-width: 5rem;
}
.dev-store-admins {
  margin-top: 0.35rem;
  font-size: 0.9rem;
}
.dev-store-owner {
  margin-top: 0.35rem;
  font-size: 0.9rem;
}
.dev-store-owner > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink-muted);
}
.dev-store-owner-form {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--line);
}
.dev-store-owner-form label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.85rem;
}
.dev-store-admins > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink-muted);
}
.dev-admin-create-form {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--line);
}
.dev-admin-create-form label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.85rem;
}
@media (max-width: 900px) {
  .dev-layout { grid-template-columns: 1fr; }
  .dev-form-grid { grid-template-columns: 1fr; }
  .dev-form-grid .dev-span-2, .dev-form-actions { grid-column: auto; }
}
.remote-form input[type="url"] { min-width: 180px; }
.text-danger { color: var(--danger); }
.flash-warning {
  background: #fff8e6;
  border: 1px solid #e0a800;
  color: #7a5b00;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
}
.simple-list { margin: 0.75rem 0 0; padding-left: 1.2rem; }
.panel-actions { margin-top: 1rem; }
.rename-form { display: flex; gap: 0.35rem; align-items: center; flex-wrap: wrap; }
.rename-form input[type="text"] { min-width: 140px; }
.store-actions-cell { white-space: nowrap; }
.store-actions-cell form { margin: 0.15rem 0; }
.col-num { width: 3rem; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.form-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; }
.nav { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.nav a {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
}
.nav a.active, .nav a:hover {
  background: var(--primary);
  color: #fff;
}
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.user-label { color: var(--muted); font-size: 0.9rem; }
.user-label-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: color 0.15s, text-decoration-color 0.15s;
}
.user-label-btn:hover,
.user-label-btn:focus-visible {
  color: var(--primary-dark);
  text-decoration-color: currentColor;
}
.license-chip { position: relative; }
.license-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--primary-dark);
  cursor: pointer;
}
.license-btn:hover { background: var(--bg-soft); }
.license-chip.warn .license-btn {
  border-color: #e0a800;
  color: #9a6700;
  background: #fff8e6;
}
.license-chip.expired .license-btn {
  border-color: var(--danger);
  color: var(--danger);
  background: #fde8e8;
}
.license-chip.countdown .license-countdown-btn {
  position: relative;
  overflow: hidden;
  width: auto;
  min-width: 148px;
  height: auto;
  padding: 0.42rem 0.85rem 0.42rem 0.65rem;
  gap: 0.55rem;
  border-radius: 999px;
  border: 2px solid #f0b429;
  background: linear-gradient(135deg, #fff4d6 0%, #ffe8a3 55%, #ffd36b 100%);
  color: #7a4a00;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.65) inset,
    0 4px 14px rgba(240, 180, 41, 0.35),
    0 0 22px rgba(255, 193, 59, 0.28);
  animation: license-countdown-pulse 2.4s ease-in-out infinite;
}
.license-chip.countdown .license-countdown-btn:hover {
  background: linear-gradient(135deg, #fff8e8 0%, #ffedb8 55%, #ffdc7a 100%);
}
.license-chip.countdown.countdown-urgent .license-countdown-btn {
  border-color: #f08c2a;
  background: linear-gradient(135deg, #fff0e0 0%, #ffd0a0 55%, #ffb347 100%);
  color: #8a3b00;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.65) inset,
    0 4px 16px rgba(240, 140, 42, 0.4),
    0 0 24px rgba(255, 153, 51, 0.32);
}
.license-chip.countdown.countdown-critical .license-countdown-btn {
  border-color: #e04545;
  background: linear-gradient(135deg, #ffe8e8 0%, #ffb8b8 55%, #ff8a8a 100%);
  color: #8f1010;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.65) inset,
    0 4px 18px rgba(224, 69, 69, 0.42),
    0 0 28px rgba(255, 90, 90, 0.38);
  animation: license-countdown-critical 1.1s ease-in-out infinite;
}
.license-countdown-glow {
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.55) 0%, transparent 68%);
  pointer-events: none;
  animation: license-countdown-shimmer 3s linear infinite;
}
.license-countdown-icon {
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.license-countdown-body {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.02rem;
  line-height: 1.05;
  text-align: left;
}
.license-countdown-label {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.82;
}
.license-countdown-time {
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  min-width: 5.4rem;
}
.license-popover-countdown {
  margin: 0.15rem 0 0.25rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: linear-gradient(135deg, #fff4d6 0%, #ffe8a3 100%);
  border: 1px solid #f0b429;
  display: grid;
  gap: 0.15rem;
}
.license-popover-countdown-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8a5a00;
}
.license-popover-countdown-time {
  font-variant-numeric: tabular-nums;
  font-size: 1.25rem;
  letter-spacing: 0.06em;
  color: #7a4a00;
}
@keyframes license-countdown-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}
@keyframes license-countdown-critical {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.65) inset,
      0 4px 18px rgba(224, 69, 69, 0.42),
      0 0 28px rgba(255, 90, 90, 0.38);
  }
  50% {
    transform: scale(1.03);
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.65) inset,
      0 6px 22px rgba(224, 69, 69, 0.55),
      0 0 36px rgba(255, 90, 90, 0.48);
  }
}
@keyframes license-countdown-shimmer {
  0% { transform: translateX(-18%) rotate(0deg); opacity: 0.35; }
  50% { opacity: 0.65; }
  100% { transform: translateX(18%) rotate(0deg); opacity: 0.35; }
}
body.license-blocked {
  overflow: hidden;
  pointer-events: none;
}
body.license-blocked .license-expired-overlay {
  pointer-events: auto;
}
.license-expired-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(15, 22, 32, 0.72);
  backdrop-filter: blur(8px);
}
.license-expired-overlay.hidden { display: none; }
.license-expired-card {
  width: min(420px, 100%);
  padding: 2rem 1.75rem;
  border-radius: 20px;
  background: #fff;
  border: 2px solid #e04545;
  box-shadow:
    0 24px 60px rgba(15, 22, 32, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.75) inset;
  text-align: center;
  display: grid;
  gap: 0.85rem;
  animation: license-expired-in 0.35s ease-out;
}
.license-expired-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--danger);
  background: linear-gradient(180deg, #ffe8e8 0%, #ffd0d0 100%);
  border: 2px solid #ffb8b8;
}
.license-expired-card h2 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.35;
  color: var(--danger);
}
.license-expired-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}
.license-expired-card .btn {
  justify-self: center;
  min-width: 160px;
  margin-top: 0.35rem;
}
@keyframes license-expired-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.license-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.85rem 1rem;
  z-index: 80;
  font-size: 0.9rem;
  display: grid;
  gap: 0.35rem;
}
.license-popover-title {
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 0.15rem;
}
.license-popover-warn { color: var(--danger); font-weight: 700; }
.license-manage-link {
  margin-top: 0.4rem;
  font-weight: 700;
  display: inline-block;
}
.license-page { display: grid; gap: 1.25rem; max-width: 1200px; margin: 0 auto; }
.license-page-head h1 { margin: 0 0 0.35rem; font-size: 1.45rem; }
.license-countdown-time,
.license-card-countdown {
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  letter-spacing: 0.06em;
}
.license-card-countdown {
  font-size: 1rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 2px solid #f0b429;
  background: linear-gradient(135deg, #fff4d6 0%, #ffd36b 100%);
  color: #7a4a00;
  box-shadow: 0 4px 12px rgba(240, 180, 41, 0.28);
}
.license-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  margin-top: 0.85rem;
}
.license-network-groups {
  display: grid;
  gap: 1.25rem;
  margin-top: 0.85rem;
}
.license-network-group {
  border: 2px solid var(--net-border, #93c5fd);
  border-radius: calc(var(--radius) + 4px);
  background: var(--net-bg, #f0f6ff);
  padding: 1rem;
  display: grid;
  gap: 0.85rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}
.license-network-group.warn {
  border-color: #e6a817;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55), 0 0 0 1px rgba(230, 168, 23, 0.25);
}
.license-network-group.expired {
  border-color: var(--danger);
}
.license-network-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.15rem 0.25rem 0;
}
.license-network-group-head h3 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--net-accent, #1d4f91);
}
.license-network-group .license-source-badge {
  margin-top: 0.35rem;
  color: var(--net-accent, #1d4f91);
  background: var(--net-badge-bg, #dbeafe);
  border-color: var(--net-border, #93c5fd);
}
.license-network-group .license-card {
  background: var(--net-card-bg, #fff);
  border-color: var(--net-border-soft, #bfdbfe);
}
.license-network-group .license-card-days {
  color: var(--net-accent, #1d4f91);
}
.license-network-stores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}
.license-network-stores-title {
  grid-column: 1 / -1;
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--net-accent, #1d4f91);
  opacity: 0.85;
}
.license-store-in-network h4 {
  margin: 0;
  font-size: 1rem;
}
.license-card-standalone {
  background: #fff;
}
.license-standalone-panel .license-source-badge.store {
  color: #0f5c5c;
  background: #d9f0f0;
  border: 1px solid #9fd9d9;
}
.license-network-tone-0 {
  --net-bg: #eef4ff;
  --net-border: #60a5fa;
  --net-border-soft: #bfdbfe;
  --net-accent: #1d4ed8;
  --net-badge-bg: #dbeafe;
  --net-card-bg: #f8fbff;
}
.license-network-tone-1 {
  --net-bg: #ecfdf5;
  --net-border: #34d399;
  --net-border-soft: #a7f3d0;
  --net-accent: #047857;
  --net-badge-bg: #d1fae5;
  --net-card-bg: #f6fffb;
}
.license-network-tone-2 {
  --net-bg: #fdf4ff;
  --net-border: #e879f9;
  --net-border-soft: #f5d0fe;
  --net-accent: #a21caf;
  --net-badge-bg: #fae8ff;
  --net-card-bg: #fff8fe;
}
.license-network-tone-3 {
  --net-bg: #fff7ed;
  --net-border: #fb923c;
  --net-border-soft: #fed7aa;
  --net-accent: #c2410c;
  --net-badge-bg: #ffedd5;
  --net-card-bg: #fffaf5;
}
.license-network-tone-4 {
  --net-bg: #fef2f2;
  --net-border: #f87171;
  --net-border-soft: #fecaca;
  --net-accent: #b91c1c;
  --net-badge-bg: #fee2e2;
  --net-card-bg: #fff8f8;
}
.license-network-tone-5 {
  --net-bg: #f5f3ff;
  --net-border: #a78bfa;
  --net-border-soft: #ddd6fe;
  --net-accent: #6d28d9;
  --net-badge-bg: #ede9fe;
  --net-card-bg: #faf8ff;
}
.license-network-tone-6 {
  --net-bg: #ecfeff;
  --net-border: #22d3ee;
  --net-border-soft: #a5f3fc;
  --net-accent: #0e7490;
  --net-badge-bg: #cffafe;
  --net-card-bg: #f7feff;
}
.license-network-tone-7 {
  --net-bg: #fefce8;
  --net-border: #facc15;
  --net-border-soft: #fde68a;
  --net-accent: #a16207;
  --net-badge-bg: #fef9c3;
  --net-card-bg: #fffef5;
}
.license-card-networked,
.license-network-card {
  /* legacy aliases — colors come from .license-network-group */
}
.license-source-badge {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.license-source-badge.store {
  color: #0f5c5c;
  background: #d9f0f0;
  border: 1px solid #9fd9d9;
}
.license-network-note {
  margin: 0;
  font-size: 0.88rem;
}
.license-card-readonly {
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px dashed var(--line);
  display: grid;
  gap: 0.2rem;
}
.license-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  background: var(--bg);
  display: grid;
  gap: 0.75rem;
}
.license-card.warn { border-color: #e6a817; box-shadow: inset 0 0 0 1px rgba(230, 168, 23, 0.25); }
.license-card.expired { border-color: var(--danger); }
.license-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.license-card-head h3 { margin: 0; font-size: 1.05rem; }
.license-card-meta { margin: 0.15rem 0 0; font-size: 0.85rem; }
.license-card-days {
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}
.license-card-badge.expired {
  color: var(--danger);
  font-weight: 700;
  font-size: 0.85rem;
}
.license-card-current { margin: 0; }
.license-card-form {
  display: grid;
  gap: 0.55rem;
}
.license-card-form label { margin: 0; }
.license-history { margin-top: 0.25rem; }
.license-history summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
}
.license-history-list {
  list-style: none;
  margin: 0.65rem 0 0.75rem;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.license-history-row {
  display: grid;
  gap: 0.15rem;
  cursor: pointer;
}
.license-history-expires { font-weight: 600; }
.license-history-meta { font-size: 0.82rem; }
.license-inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem;
}
.license-inline-form label { margin: 0; }
.license-table td .muted { font-size: 0.85rem; }
.license-table .text-danger { color: var(--danger); font-weight: 600; }
.lang-switch { display: flex; gap: 0.25rem; }
.lang-switch a {
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.85rem;
}
.lang-switch a.active { background: var(--bg-soft); color: var(--ink); }
.lang-switch.center { justify-content: center; margin-top: 1rem; }

.main { padding: 1rem 1.25rem 2rem; max-width: 1400px; margin: 0 auto; }
.main-sales, .main-ob { max-width: none; }
body.ob-send-open .main-ob {
  height: calc(100dvh - 72px);
  display: flex;
  flex-direction: column;
  padding-bottom: 0.75rem;
  overflow: hidden;
}
body.ob-send-open .ob-page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
body.ob-send-open .ob-pane[data-pane="send"].is-active {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
body.ob-send-open .ob-send-layout {
  flex: 1;
  height: auto;
  min-height: 0;
}
.main-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  margin-bottom: 1rem;
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}
.panel-head h2, .panel h2 {
  margin: 0;
  font-size: 1.1rem;
}
.muted { color: var(--muted); }
.hidden { display: none !important; }

.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  padding: 0.55rem 0.95rem;
  cursor: pointer;
  font-weight: 600;
  max-width: 100%;
  box-sizing: border-box;
}
.btn:hover { background: var(--bg-soft); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.85rem; border-radius: 8px; }
.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  padding: 0;
  font-size: 0.8rem;
}

.form { display: grid; gap: 0.75rem; }
.form label { display: grid; gap: 0.35rem; font-weight: 600; font-size: 0.9rem; }
.form input, .form select, .filters input, .filters select,
.inline-search input, .scanner-input, .date-filter input,
.expense-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  background: #fff;
  min-height: 44px;
  font-size: 1rem;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
}
.form-inline label { min-width: 160px; }
.input-with-btn { display: flex; gap: 0.5rem; }
.input-with-btn input { flex: 1; }

.login-page { width: min(420px, 100%); }
.login-card {
  background: var(--panel);
  border-radius: 18px;
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.login-card h1 { margin: 0 0 0.25rem; color: var(--primary-dark); }

.flash-wrap { margin-bottom: 0.75rem; }
.flash {
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  margin-bottom: 0.4rem;
  font-weight: 600;
}
.flash-success { background: #e5f6ec; color: var(--good); }
.flash-danger { background: #fde8e8; color: var(--danger); }
.flash-warning { background: #fff4e0; color: #9a6700; }

/* Sales */
.sales-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
  height: calc(100vh - 168px);
  min-height: 420px;
}
.sales-left, .sales-right {
  margin: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.scanner-input {
  flex: 1;
  min-width: 220px;
  border: 2px solid var(--primary) !important;
  background: #f3fbfa !important;
}
.panel-head-scanner {
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}
.panel-head-scanner h2 {
  margin: 0;
}
.scanner-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
}
.scanner-camera-btn {
  flex-shrink: 0;
  padding: 0.45rem 0.55rem;
  line-height: 0;
}
.camera-https-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(196, 92, 38, 0.35);
  background: linear-gradient(135deg, #fff8f0 0%, #fff3e6 100%);
}
.camera-https-banner.hidden { display: none !important; }
.camera-https-banner-text {
  flex: 1;
  min-width: 0;
}
.camera-https-banner-text p {
  margin: 0.25rem 0 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.camera-https-url {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.85);
  font-size: 0.82rem;
  word-break: break-all;
}
.camera-https-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.camera-https-link {
  font-weight: 700;
  color: var(--primary-dark);
  text-decoration: underline;
}
.sales-camera-error .camera-https-link,
#barcodeScanError .camera-https-link {
  display: inline-block;
  margin-top: 0.35rem;
}
.mobile-cart-bar {
  display: none;
}
@media (max-width: 960px) {
  .mobile-cart-bar {
    display: flex;
    align-items: stretch;
    gap: 0.65rem;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    padding: 0.65rem 0.75rem calc(0.65rem + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(18, 28, 40, 0.1);
  }
  .mobile-cart-bar-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.1rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg-soft);
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
  }
  .mobile-cart-bar-info:active {
    background: #eef6f5;
  }
  .mobile-cart-bar-label {
    font-size: 0.78rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .mobile-cart-bar-info strong {
    font-size: 1.2rem;
    line-height: 1.15;
  }
  .mobile-cart-bar-count {
    position: absolute;
    top: -0.35rem;
    right: -0.35rem;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.35rem;
    text-align: center;
  }
  .mobile-cart-bar-info {
    position: relative;
  }
  .mobile-cart-bar-checkout {
    flex-shrink: 0;
    min-width: 7.5rem;
    min-height: 52px;
    padding-left: 1rem;
    padding-right: 1rem;
    border-radius: 14px;
    font-size: 1rem;
  }
  .main-sales {
    padding-bottom: calc(5.75rem + env(safe-area-inset-bottom));
  }
}
.mobile-scan-fab {
  display: none;
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 850;
  width: 3.25rem;
  height: 3.25rem;
  border: none;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.mobile-scan-fab:active {
  transform: scale(0.96);
}
.barcode-scan-modal {
  z-index: 200;
}
.barcode-scan-modal .modal-box {
  max-width: min(96vw, 420px);
  padding: 0.75rem;
}
.barcode-scan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.barcode-scan-head h2 {
  margin: 0;
  font-size: 1.05rem;
}
.barcode-reader {
  width: 100%;
  min-height: 260px;
  border-radius: 10px;
  overflow: hidden;
  background: #111;
}
.barcode-reader video {
  object-fit: cover;
}
.barcode-scan-hint {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
}
.barcode-preview-wrap {
  margin-top: 0.5rem;
  padding: 0.65rem 0.5rem;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #fafafa;
  text-align: center;
}
.barcode-preview-wrap.has-barcode {
  cursor: zoom-in;
}
.barcode-preview-wrap.has-barcode:active {
  opacity: 0.92;
}
.form-barcode-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}
.form-barcode-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-muted);
}
.product-barcodes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.product-barcodes-list {
  display: grid;
  gap: 0.55rem;
}
.product-barcode-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: start;
}
.product-barcode-row .product-barcode-input {
  width: 100%;
  min-width: 0;
}
.product-barcode-row .barcode-form-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}
.product-barcode-remove {
  min-width: 2rem;
  padding: 0.25rem 0.45rem;
  font-size: 1.15rem;
  line-height: 1;
}
.barcode-cell:not(.barcode-cell-empty) {
  cursor: zoom-in;
}
.barcode-zoom-modal {
  z-index: 230;
}
.barcode-list-modal {
  z-index: 220;
}
.barcode-list-box {
  width: min(520px, calc(100% - 1.5rem));
  max-height: min(88vh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 1rem 1.15rem 1.15rem;
  gap: 0;
}
.barcode-list-box .barcode-list-head,
.barcode-list-box .barcode-list-hint {
  flex-shrink: 0;
}
.barcode-list-box .barcode-list-hint {
  margin: 0 0 0.75rem;
}
.barcode-list-scroll {
  flex: 1 1 0;
  height: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.barcode-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.barcode-list-head h2 {
  margin: 0;
  font-size: 1.15rem;
}
.barcode-list-hint {
  font-size: 0.82rem;
}
.barcode-list-items {
  display: grid;
  gap: 0.55rem;
}
.barcode-list-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: zoom-in;
  text-align: left;
}
.barcode-list-item:hover {
  background: var(--bg-soft);
}
.barcode-list-item-preview {
  min-width: 88px;
  max-width: 120px;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}
.barcode-list-item-preview .barcode-svg {
  width: 100%;
  height: auto;
}
.barcode-list-item-preview-text {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
}
.barcode-list-item-code {
  font-size: 0.92rem;
  font-weight: 700;
  word-break: break-all;
}
.barcode-count-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.35rem 0.55rem;
  border: none;
  background: transparent;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  position: relative;
  z-index: 2;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.barcode-count-btn:hover {
  color: var(--primary-dark, #0a6b62);
  background: var(--bg-soft);
  border-radius: 8px;
  text-decoration: none;
}
.table td .barcode-count-btn {
  margin: 0 auto;
}
.barcode-zoom-text {
  padding: 1rem 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  word-break: break-all;
  text-align: center;
}
body.barcode-list-open {
  overflow: hidden;
}
.barcode-zoom-modal .modal-box {
  max-width: min(96vw, 480px);
  padding: 0.85rem;
}
.barcode-zoom-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.barcode-zoom-head h2 {
  margin: 0;
  font-size: 1.05rem;
}
.barcode-zoom-body {
  padding: 0.75rem 0.5rem;
  background: #fff;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.barcode-zoom-svg {
  display: block;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}
body.barcode-zoom-open {
  overflow: hidden;
}
.barcode-preview-svg {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}
.barcode-preview-svg.hidden {
  display: none;
}
.barcode-preview-empty {
  margin: 0.35rem 0;
  font-size: 0.85rem;
}
.barcode-preview-empty.hidden {
  display: none;
}
.barcode-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
}
.barcode-text-input {
  flex: 1 1 180px;
  min-width: 0;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.barcode-form-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.barcode-form-actions {
  justify-content: flex-start;
}
.barcode-cell {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 120px;
  padding: 0.15rem 0;
}
.barcode-cell .barcode-svg {
  display: block;
  max-width: 100%;
  height: auto;
}
.table .barcode-cell {
  vertical-align: middle;
}
body.barcode-scan-open {
  overflow: hidden;
}
.sales-camera-wrap {
  display: none;
  margin-bottom: 0.65rem;
}
.sales-camera-wrap.is-active {
  display: block;
}
.sales-camera-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.sales-camera-hint {
  margin: 0;
  font-size: 0.8rem;
}
.sales-camera-error {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  text-align: center;
}
.sales-inline-reader {
  min-height: 200px;
}
@media (max-width: 900px) {
  .mobile-scan-fab {
    display: inline-flex;
  }
  .main {
    padding-bottom: 4.5rem;
  }
  .main-sales .mobile-scan-fab {
    display: none;
  }
  .main-sales {
    padding-bottom: calc(5.75rem + env(safe-area-inset-bottom));
  }
}
.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  grid-auto-rows: max-content;
  gap: 0.6rem;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  align-content: start;
  align-items: start;
}
.product-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem;
  cursor: pointer;
  background: linear-gradient(180deg, #fff, #f8fafc);
  transition: transform 0.12s ease, border-color 0.12s ease;
  overflow: visible;
  min-width: 0;
  min-height: min-content;
  height: auto;
  align-self: start;
  box-sizing: border-box;
}
.product-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}
.product-card .pthumb-btn {
  display: block;
  width: 56px;
  height: 56px;
  max-width: 56px;
  max-height: 56px;
  margin: 0 0 0.4rem;
  padding: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
  border-radius: 10px;
  overflow: hidden;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}
.product-card .pthumb,
.product-grid img.pthumb {
  display: block;
  width: 56px;
  height: 56px;
  max-width: 56px;
  max-height: 56px;
  min-width: 0;
  min-height: 0;
  object-fit: cover;
  object-position: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  pointer-events: none;
  user-select: none;
}
.product-photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  background: rgba(8, 12, 18, 0.94);
  cursor: zoom-out;
  touch-action: manipulation;
}
.product-photo-lightbox.hidden {
  display: none;
}
.product-photo-lightbox-img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 5rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  user-select: none;
}
.product-photo-lightbox-caption {
  margin: 0;
  max-width: min(96vw, 640px);
  text-align: center;
  color: rgba(255, 255, 255, 0.92);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  pointer-events: none;
}
.product-photo-section {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 0.75rem;
}
.product-photo-preview-wrap {
  margin: 0.5rem 0;
}
.product-photo-preview {
  display: block;
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}
.product-photo-empty {
  margin: 0.35rem 0;
  font-size: 0.88rem;
}
.product-photo-file-label input[type="file"] {
  margin-top: 0.35rem;
  max-width: 100%;
}
.product-settings-form {
  max-width: 36rem;
}
.product-settings-foot {
  margin: 0.5rem 0 1rem;
}
.settings-card-icon--products {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
}
.product-card .pname {
  font-weight: 700;
  margin-bottom: 0.35rem;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.product-card .pprice {
  color: var(--primary-dark);
  font-weight: 800;
  line-height: 1.25;
  white-space: normal;
}
.product-card .pstock {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.25rem;
  line-height: 1.25;
}
.product-card.out { opacity: 0.45; }

.cart-table-wrap { flex: 1; min-height: 0; overflow: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  padding: 0.55rem 0.45rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.table th { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
.cart-table input[type="number"] {
  width: 70px;
  padding: 0.3rem;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.cart-footer {
  border-top: 1px solid var(--line);
  padding-top: 0.85rem;
  margin-top: 0.5rem;
}
.cart-total { font-size: 1.2rem; margin-bottom: 0.75rem; }
.cart-total strong { color: var(--primary-dark); }

/* Products */
.products-layout {
  display: grid;
  grid-template-columns: minmax(240px, 260px) minmax(0, 1fr);
  gap: 0.75rem;
  min-width: 0;
}
.products-layout > .panel,
.products-layout > section {
  min-width: 0;
}
.categories-panel {
  min-width: 240px;
}
.products-panel .table-wrap {
  overflow-x: visible;
}
.products-panel .inline-search input {
  width: min(9rem, 100%);
  min-width: 0;
}
.products-table {
  table-layout: fixed;
  width: 100%;
  font-size: 0.84rem;
}
.products-table th,
.products-table td {
  padding: 0.34rem 0.28rem;
}
.products-table th {
  font-size: 0.68rem;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: normal;
  vertical-align: bottom;
}
.products-table td {
  overflow: hidden;
}
.products-table .col-num {
  width: 1.75rem;
  font-size: 0.82rem;
}
.products-table th:nth-child(2),
.products-table td:nth-child(2) {
  width: 14%;
}
.products-table td:nth-child(2) strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.products-table th:nth-child(3),
.products-table td:nth-child(3) {
  width: 8%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.products-table th:nth-child(4),
.products-table td:nth-child(4),
.products-table th:nth-child(5),
.products-table td:nth-child(5) {
  width: 9%;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.products-table .col-markup {
  width: 3.75rem;
  font-size: 0.78rem;
  padding-right: 0.15rem;
  text-align: right;
  white-space: nowrap;
}
.products-table th:nth-child(7),
.products-table td:nth-child(7) {
  width: 6.5%;
  font-size: 0.78rem;
  white-space: nowrap;
}
.products-table th:nth-child(8),
.products-table td:nth-child(8) {
  width: 4.75rem;
}
.products-table th:nth-child(9),
.products-table td.actions {
  width: 7rem;
}
.products-table .barcode-cell {
  min-width: 0;
  max-width: 4.5rem;
  padding: 0.05rem 0;
}
.products-table .barcode-cell .barcode-svg {
  display: block;
  max-width: 4.25rem;
  height: auto !important;
}
.products-table .barcode-count-btn {
  font-size: 0.68rem;
  padding: 0.12rem 0.25rem;
  line-height: 1.2;
  white-space: normal;
  text-align: center;
}
.products-table td.actions {
  width: 7rem;
  white-space: nowrap;
  overflow: visible;
  padding: 0.22rem 0.1rem;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.12rem;
  align-items: center;
  justify-content: flex-end;
}
.products-table td.actions form {
  display: inline-flex;
  margin: 0;
}
.btn-icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  padding: 0;
  line-height: 1;
  border-radius: 8px;
  flex-shrink: 0;
  border: 1px solid transparent;
}
.btn-icon-action svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
  pointer-events: none;
}
.btn-icon-action svg path,
.btn-icon-action svg circle {
  stroke: currentColor;
}
.btn-icon-edit {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}
.btn-icon-edit:hover {
  background: #dbeafe;
}
.btn-icon-stock {
  background: #ea580c;
  border-color: #c2410c;
  color: #fff;
}
.btn-icon-stock:hover {
  background: #c2410c;
}
.btn-icon-label {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #047857;
}
.btn-icon-label:hover {
  background: #d1fae5;
}
.btn-icon-delete {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}
.btn-icon-delete:hover {
  background: #fee2e2;
}
.products-table tfoot td {
  overflow: visible;
}
.categories-panel .cat-list li {
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
}
.categories-panel .cat-list-link {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}
.categories-panel .cat-list-link > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.categories-panel .cat-actions {
  display: inline-flex;
  flex: 0 0 auto;
  width: auto;
  margin-left: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
}
.categories-panel .cat-actions .inline-delete-form {
  display: inline-flex;
  margin: 0;
}
.categories-panel .cat-actions .btn-icon-action {
  width: 1.75rem;
  height: 1.75rem;
  min-width: 1.75rem;
  border-radius: 7px;
}
.categories-panel .cat-actions .btn-icon-action svg {
  width: 1rem;
  height: 1rem;
}
.categories-panel .panel-head {
  flex-direction: column;
  align-items: stretch;
}
.categories-panel .panel-head .btn-sm {
  width: 100%;
  justify-content: center;
}
.products-deleted-panel { margin-top: 1rem; }
.products-deleted-wide { grid-column: 1 / -1; }
.products-summary-grid { margin-bottom: 1rem; }
.products-category-totals {
  margin: 0 0 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  background: var(--bg-soft);
}
.products-category-totals summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}
.table-compact th,
.table-compact td {
  padding: 0.45rem 0.55rem;
  font-size: 0.88rem;
}
.products-totals-row td {
  background: var(--bg-soft);
  font-weight: 700;
  border-top: 2px solid var(--border);
}
.products-category-totals tr.is-highlight td {
  background: rgba(13, 110, 110, 0.08);
}
.col-num {
  width: 2.5rem;
  text-align: center;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.products-table .col-num { font-size: 0.88rem; }
.products-deleted-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  cursor: pointer;
  list-style: none;
}
.products-deleted-summary h2 {
  margin: 0;
  font-size: 1.05rem;
}
.products-deleted-table .is-deleted-row td {
  color: var(--muted);
}
.products-deleted-table .is-deleted-row strong {
  color: var(--ink);
  text-decoration: line-through;
  text-decoration-color: rgba(0, 0, 0, 0.25);
}
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  margin-bottom: 0.25rem;
}
.cat-list li.active, .cat-list li:hover { background: var(--bg-soft); }
.cat-list a { color: var(--ink); font-weight: 600; flex: 1; }
.inline-search { display: flex; gap: 0.4rem; margin-left: auto; }
.table-wrap { overflow: auto; }
.actions { white-space: nowrap; }
.actions .inline-delete-form,
.cat-actions .inline-delete-form {
  display: inline;
  margin: 0;
}
.cat-actions {
  display: inline-flex;
  gap: 0.55rem;
  align-items: center;
  margin-left: 0.5rem;
}
.btn-link-danger {
  color: #b42318;
}

/* Reports */
.reports-page {
  max-width: 100%;
  overflow-x: hidden;
}
.date-filter {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.date-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
}
.date-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.date-filter label { display: grid; gap: 0.3rem; font-weight: 600; }
.date-filter-row label.delivery-flag {
  width: auto;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  min-height: 42px;
  font-weight: 600;
}

/* Hisobotlar — metrikalar */
.reports-metrics {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
  min-width: 0;
}
.reports-metrics-primary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: stretch;
}
.reports-metrics-primary > :only-child {
  grid-column: 1 / -1;
}
.reports-metrics-secondary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: stretch;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
  min-width: 0;
}
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .reports-metrics-secondary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .reports-metrics-primary { grid-template-columns: 1fr; }
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  text-align: left;
  font: inherit;
  color: inherit;
  min-width: 0;
}
.stat-card-compact {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 5.5rem;
}
.stat-card-compact .stat-value {
  font-size: clamp(1.05rem, 2.8vw, 1.28rem);
}
.stat-card-grouped {
  border-left: 4px solid var(--primary);
  padding: 1.05rem 1.15rem 1.1rem;
  height: 100%;
}
.stat-card-grouped .stat-label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.45rem;
}
.stat-card-grouped .stat-value {
  font-size: clamp(1.25rem, 3.2vw, 1.65rem);
  line-height: 1.15;
  word-break: break-word;
}
.stat-card.clickable {
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.stat-card.clickable:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 10px 24px rgba(13, 110, 110, 0.12);
}
.stat-card.accent { border-color: var(--primary); }
.stat-card.good { border-color: var(--good); }
.stat-card-danger {
  border-color: rgba(179, 58, 58, 0.45);
  border-left: 4px solid var(--danger);
}
.stat-card-danger .stat-value {
  color: var(--danger);
}
.stat-card-danger.clickable:hover {
  border-color: var(--danger);
  box-shadow: 0 10px 24px rgba(179, 58, 58, 0.12);
}
.stat-breakdown-row.stat-tone-danger,
.stat-breakdown-row.stat-tone-danger strong {
  color: var(--danger);
}
.stat-breakdown-row.stat-tone-danger:hover {
  color: var(--danger);
  background: rgba(179, 58, 58, 0.08);
}
.stat-breakdown-row.stat-tone-good,
.stat-breakdown-row.stat-tone-good strong {
  color: var(--good);
}
.stat-breakdown-row.stat-tone-good:hover {
  color: var(--good);
  background: rgba(31, 122, 77, 0.08);
}
.stat-value-btn {
  display: block;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: color 0.12s ease;
}
.stat-value-btn:hover {
  color: var(--primary-dark);
}
.stat-breakdown {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.1rem;
}
.stat-breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  width: 100%;
  background: none;
  border: none;
  border-radius: 8px;
  padding: 0.4rem 0.35rem;
  margin: 0 -0.35rem;
  font: inherit;
  font-size: 0.82rem;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: color 0.12s ease, background 0.12s ease;
}
.stat-breakdown-row:hover {
  color: var(--primary-dark);
  background: rgba(13, 110, 110, 0.06);
}
.stat-breakdown-row span {
  flex: 1 1 auto;
  min-width: 0;
}
.stat-breakdown-row strong {
  flex-shrink: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 0.92em;
}
.stat-breakdown-row-static {
  cursor: default;
  margin-top: 0.2rem;
  padding-top: 0.55rem;
  border-top: 1px dashed var(--line);
  color: var(--text);
  font-weight: 600;
}
.stat-breakdown-row-static:hover {
  color: var(--text);
  background: none;
}
.stat-breakdown-row-register {
  margin-top: 0.2rem;
  padding-top: 0.55rem;
  border-top: 1px dashed var(--line);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}
.stat-breakdown-row-register:hover {
  color: var(--primary-dark);
  background: rgba(13, 110, 110, 0.06);
}
.stat-label { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.35rem; }
.stat-value { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }

.reports-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}
.reports-page-head-text {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.reports-period-chip {
  margin: 0;
  padding: 0.35rem 0.75rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}
.reports-scope-hint {
  margin: -0.35rem 0 0.85rem;
  padding: 0.55rem 0.85rem;
  background: rgba(13, 110, 110, 0.08);
  border: 1px solid rgba(13, 110, 110, 0.2);
  border-radius: var(--radius);
  font-size: 0.88rem;
  color: var(--primary-dark);
}
.reports-multi-panel {
  margin-bottom: 1rem;
}
.reports-multi-hint {
  margin: -0.25rem 0 1rem;
  font-size: 0.88rem;
}
.reports-kassa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}
.reports-kassa-card {
  background: linear-gradient(165deg, var(--panel) 0%, rgba(13, 110, 110, 0.04) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 1.05rem;
  box-shadow: var(--shadow);
  min-width: 0;
}
.reports-kassa-card-head {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}
.reports-kassa-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.reports-kassa-name {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-dark);
}
.reports-kassa-revenue {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  text-align: left;
  font: inherit;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  color: inherit;
}
.reports-kassa-share {
  display: block;
  width: 100%;
  margin: 0.35rem 0 0.5rem;
  padding: 0;
  border: none;
  background: none;
  text-align: left;
  font: inherit;
  font-size: 0.82rem;
  color: var(--muted);
}
.reports-scope-click {
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}
.reports-scope-click:hover {
  color: var(--primary-dark);
  background: rgba(13, 110, 110, 0.08);
  box-shadow: 0 0 0 2px rgba(13, 110, 110, 0.12);
}
.reports-kassa-stats .reports-scope-click {
  padding: 0.1rem 0.25rem;
  margin: -0.1rem -0.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: inherit;
}
.reports-kassa-profit .reports-scope-click {
  color: var(--good);
}
.reports-kassa-profit .reports-scope-click:hover {
  color: var(--good);
  background: rgba(31, 122, 77, 0.1);
  box-shadow: 0 0 0 2px rgba(31, 122, 77, 0.15);
}
.reports-cashier-amount.reports-scope-click {
  border: none;
  background: none;
  font: inherit;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 0.15rem 0.35rem;
}
.reports-cashier-meta.reports-scope-click {
  border: none;
  background: none;
  font: inherit;
  padding: 0.15rem 0.35rem;
}

.checkout-rename-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.checkout-rename-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.75rem;
}
.checkout-rename-label {
  display: grid;
  gap: 0.25rem;
  flex: 1 1 12rem;
  min-width: 0;
  font-weight: 600;
}
.checkout-rename-label input {
  width: 100%;
}
.reports-kassa-share-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(13, 110, 110, 0.12);
  overflow: hidden;
  margin-bottom: 0.85rem;
}
.reports-kassa-share-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  min-width: 2px;
}
.reports-kassa-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 0.75rem;
  margin: 0;
  font-size: 0.82rem;
}
.reports-kassa-stats div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.reports-kassa-stats dt {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}
.reports-kassa-stats dd {
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.reports-kassa-profit {
  color: var(--good);
}
.reports-cashiers-block {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.reports-cashiers-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 700;
}
.reports-cashier-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.reports-cashier-row {
  display: grid;
  grid-template-columns: minmax(4rem, 6rem) 1fr auto auto;
  gap: 0.5rem 0.75rem;
  align-items: center;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.02);
}
.reports-cashier-list--solo .reports-cashier-row {
  grid-template-columns: 1fr auto auto;
}
.reports-cashier-name {
  font-weight: 700;
}
.reports-cashier-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(13, 110, 110, 0.1);
  overflow: hidden;
  min-width: 0;
}
.reports-cashier-bar > span {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: inherit;
  opacity: 0.85;
}
.reports-cashier-meta {
  font-size: 0.78rem;
  white-space: nowrap;
}
.reports-cashier-amount {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.reports-cashier-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.reports-cashier-tag {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: rgba(13, 110, 110, 0.1);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary-dark);
}
.outside-shift-row td {
  background: rgba(13, 110, 110, 0.04);
}
@media (max-width: 640px) {
  .reports-cashier-row {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }
  .reports-cashier-bar {
    grid-column: 1 / -1;
  }
  .reports-cashier-list--solo .reports-cashier-row {
    grid-template-columns: 1fr auto;
  }
}

/* Multi-store metric panels (network reports) */
.nr-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}
.nr-metric-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
}
.nr-metric-panel.accent { border-left: 4px solid var(--primary); }
.nr-metric-panel.good { border-left: 4px solid var(--good); }
.nr-metric-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--line);
}
.nr-metric-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.nr-metric-total {
  font-size: 1.5rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--primary-dark);
  line-height: 1.1;
}
.nr-metric-panel.good .nr-metric-total { color: var(--good); }
.nr-metric-stores {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.nr-metric-store-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.98rem;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  background: var(--bg-soft);
}
.nr-metric-store-row .name {
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nr-metric-store-row .val {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: 1.02rem;
}
.nr-metric-store-row.is-error .val { color: var(--danger); }

.unit-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--primary);
  background: #e8f6f4;
  vertical-align: middle;
}
.access-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.65rem;
  margin-top: 0.75rem;
  align-items: stretch;
}
.check-card {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
}
.check-card input { width: 18px; height: 18px; }
.check-card-wide { grid-column: 1 / -1; align-items: flex-start; font-weight: 600; }
.check-card-wide small { font-weight: 500; display: inline-block; margin-top: 0.2rem; }
.access-grid .btn { grid-column: 1 / -1; justify-self: start; min-width: 160px; }
.staff-permissions-form { margin-top: 0.75rem; }
.perm-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.perm-section-title {
  cursor: pointer;
  font-weight: 700;
  padding: 0.85rem 1rem;
  list-style: none;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}
.perm-section[open] .perm-section-title { border-bottom-color: var(--line); }
.perm-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.55rem;
  padding: 0.85rem;
}
.perm-check { min-height: 48px; }
.perm-check input {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.staff-permissions-form > .btn { margin-top: 0.35rem; }
.new-user-form .new-user-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}
.new-user-form .new-user-fields label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 160px;
  flex: 1 1 160px;
}
.new-user-form .new-user-fields input,
.new-user-form .new-user-fields select {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 1rem;
  background: #fff;
}
.new-user-permissions {
  margin-bottom: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}
.new-user-permissions.hidden { display: none; }
.new-user-modal-root .modal-box.new-user-modal {
  width: min(720px, calc(100vw - 1.5rem));
  max-width: 100%;
  max-height: min(92vh, 100dvh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 0.65rem;
  padding-top: 1rem;
}
.new-user-modal-head {
  margin-bottom: 0;
  padding: 0 0.15rem;
}
.new-user-modal-head .modal-title {
  font-size: 1.25rem;
}
.new-user-modal .new-user-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
  gap: 0.65rem;
}
.new-user-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(62vh, 560px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}
.new-user-modal-actions {
  flex-shrink: 0;
  margin-top: 0.15rem;
}
.panel-head-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.panel-head-actions h2 { margin: 0; }
.user-permissions-page .user-permissions-panel {
  padding-bottom: 0.85rem;
}
.user-permissions-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.user-permissions-scroll {
  display: grid;
  gap: 0.5rem;
}
.user-permissions-save .btn {
  min-width: 160px;
}
html.is-android-app .main {
  padding-bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
}
html.is-android-app body.modal-open .main {
  padding-bottom: 0;
}
html.is-android-app .cashiers-page,
html.is-android-app .settings-page {
  padding-bottom: 0.25rem;
}
.inline-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 0.5rem;
}
.expense-panel {
  border: 2px solid #cfe7e5;
}
.expense-form-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr auto;
  gap: 0.75rem;
  align-items: end;
}
.expense-form-grid label {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
}
.expense-form-grid input {
  min-height: 48px;
  font-size: 1.05rem;
}

/* Modal */
html.modal-open,
body.modal-open {
  overflow: hidden;
  overscroll-behavior: none;
}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(18, 28, 40, 0.55);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 0.75rem;
  overflow: hidden;
  overscroll-behavior: contain;
}
.modal-box {
  background: #fff;
  border-radius: 20px;
  padding: 1.35rem 1.25rem 1.25rem;
  width: min(440px, calc(100% - 1.5rem));
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.28);
  display: grid;
  gap: 0.95rem;
}
.modal-sheet {
  width: min(480px, calc(100% - 1.5rem));
  max-width: 100%;
  font-size: 1.05rem;
}
.modal-box.modal-wide-sheet {
  width: min(560px, calc(100% - 1.5rem));
  max-height: min(88vh, 820px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 0.65rem;
}
.modal-wide-sheet {
  width: min(560px, calc(100% - 1.5rem));
}
.modal-body-scroll {
  flex: 1 1 auto;
  height: auto;
  min-height: 6rem;
  max-height: min(62vh, 540px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.modal-wide-sheet .modal-head-row,
.modal-wide-sheet .muted,
.modal-wide-sheet .detail-total,
.modal-wide-sheet .detail-meta,
.modal-wide-sheet .period-row {
  flex-shrink: 0;
}
.modal-wide-sheet .click-list,
.modal-wide-sheet .logs-list,
.modal-wide-sheet .history-detail,
.modal-wide-sheet .table-wrap,
.modal-body-scroll .click-list,
.modal-body-scroll .history-detail,
.modal-body-scroll .logs-list,
.modal-body-scroll .table-wrap {
  overflow: visible;
  flex: unset;
  min-height: unset;
}
body.modal-open .product-grid,
body.modal-open .cart-table-wrap,
body.modal-open .sales-layout,
body.modal-open .reports-page,
body.modal-open .main,
body.modal-open .table-scroll-panel,
body.modal-open .nc-page,
body.modal-open .nr-page {
  overflow: hidden !important;
}
.modal .table-wrap {
  overflow: auto;
  max-height: none;
}
.modal-product-sheet {
  width: min(640px, calc(100% - 1.5rem));
  max-width: 100%;
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-product-sheet > .modal-head-row {
  position: static;
  flex-shrink: 0;
  box-shadow: none;
  padding-bottom: 0.35rem;
}
.product-modal-form {
  display: grid;
  gap: 1rem;
}
.product-form-section {
  display: grid;
  gap: 0.75rem;
}
.product-form-row {
  display: grid;
  gap: 0.75rem;
}
.product-form-row-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.product-field {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 0.92rem;
}
.product-field input,
.product-field select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-weight: 600;
}
.product-price-warning {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid #e0a800;
  background: #fff8e6;
  color: #7a5a00;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.45;
}
.product-field-unit { max-width: 280px; }
.product-stock-panel {
  padding: 1rem 1.05rem;
  border-radius: 14px;
  border: 1px solid rgba(13, 110, 110, 0.18);
  background: linear-gradient(145deg, #f6fbfb 0%, #f8fafc 100%);
  display: grid;
  gap: 0.85rem;
}
.product-stock-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.product-stock-title {
  margin: 0;
  font-size: 1rem;
  color: var(--primary-dark);
}
.product-stock-sub {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  line-height: 1.35;
  max-width: 28rem;
}
.product-stock-badge {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--primary-dark);
  white-space: nowrap;
}
.product-stock-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 0.35rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
}
.product-stock-mode {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 0.75rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.product-stock-mode-icon {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--bg-soft);
  font-size: 0.95rem;
  line-height: 1;
}
.product-stock-mode.is-active {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: 0 4px 14px rgba(13, 110, 110, 0.12);
}
.product-stock-mode.is-active .product-stock-mode-icon {
  background: rgba(13, 110, 110, 0.12);
  color: var(--primary-dark);
}
.product-stock-body { min-height: 0; }
.product-stock-pane .product-field input {
  font-size: 1.15rem;
  min-height: 48px;
}
.product-field-hint {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.35;
}
.product-stock-panel.is-new .product-stock-modes { display: none; }
.product-modal-form.is-receive-mode .product-form-section:first-child .product-form-row {
  grid-template-columns: 1fr;
}
.product-modal-form.is-receive-mode .product-form-edit-only,
.product-modal-form.is-receive-mode #stockModeToggle,
.product-modal-form.is-receive-mode #stockSetPane {
  display: none !important;
}
.product-modal-form.is-receive-mode .product-form-receive-only,
.product-modal-form.is-intake-mode .product-form-receive-only {
  display: block !important;
}
.product-modal-form.is-receive-mode .product-form-prices-section,
.product-modal-form.is-intake-mode .product-form-prices-section {
  margin-top: 0.15rem;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(196, 92, 38, 0.22);
  background: #fffaf6;
}
.product-modal-form.is-receive-mode .product-form-prices .product-field input,
.product-modal-form.is-intake-mode .product-form-prices .product-field input {
  min-height: 48px;
  font-size: 1.05rem;
}
.product-modal-form.is-receive-mode .product-field-name input {
  font-size: 1.1rem;
  font-weight: 800;
  background: var(--bg-soft);
  border-color: transparent;
}
.product-modal-form.is-receive-mode .product-stock-panel,
.product-modal-form.is-intake-mode .product-stock-panel {
  border-color: rgba(196, 92, 38, 0.35);
  background: linear-gradient(145deg, #fff9f4 0%, #fff 100%);
  box-shadow: 0 8px 24px rgba(196, 92, 38, 0.1);
}
.product-modal-form.is-receive-mode .product-stock-pane .product-field input,
.product-modal-form.is-intake-mode .product-stock-pane[data-mode="add"] .product-field input {
  font-size: 1.45rem;
  min-height: 56px;
  text-align: center;
  border-color: rgba(196, 92, 38, 0.35);
}
.product-modal-form.is-receive-mode .modal-actions .btn-primary {
  background: var(--accent);
  border-color: var(--accent);
}
.modal-wide { width: min(560px, 100%); max-width: 100%; }
.modal-title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.01em;
  word-break: break-word;
}
.modal-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 600;
  word-break: break-word;
}
.modal-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
  margin-bottom: 0.35rem;
}
.modal-close-btn {
  flex-shrink: 0;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0;
  font-size: 1.5rem;
  line-height: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-weight: 700;
}
.modal-close-btn:hover {
  color: var(--ink);
  background: var(--bg-soft);
}
#catModal .modal-head-row {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #fff;
  padding-bottom: 0.5rem;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}
.modal-head-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  flex-wrap: wrap;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.15rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.modal-actions-stack {
  flex-direction: column-reverse;
}
.modal-actions-stack .btn {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.btn-lg {
  padding: 0.9rem 1.1rem;
  font-size: 1.1rem;
  border-radius: 14px;
  min-height: 52px;
}
.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn-danger:hover { filter: brightness(0.92); }
.btn-toolbar {
  background: #fff;
  border: 1px solid var(--line);
  font-weight: 700;
  min-height: 44px;
}
.btn-toolbar.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-toolbar.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.qty-stepper {
  display: grid;
  grid-template-columns: minmax(48px, 56px) minmax(0, 1fr) minmax(48px, 56px);
  gap: 0.5rem;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.qty-stepper input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
  padding: 0.75rem 0.35rem;
  border: 2px solid var(--line);
  border-radius: 14px;
  min-height: 52px;
  -moz-appearance: textfield;
}
.qty-stepper input::-webkit-outer-spin-button,
.qty-stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.qty-btn {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font-size: 1.5rem;
  min-height: 52px;
  padding: 0.35rem;
  border-radius: 14px;
  font-weight: 700;
}

.pay-total-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #e7f5f4, #f7fbfb);
  border: 1px solid #cfe7e5;
  border-radius: 16px;
  padding: 1rem 1.1rem;
  font-size: 1.15rem;
  font-weight: 700;
}
.pay-total-banner strong {
  font-size: 1.55rem;
  color: var(--primary-dark);
}

.modal-pay.pay-modal-sheet {
  display: flex;
  flex-direction: column;
  width: min(700px, calc(100% - 1.5rem));
  max-width: 100%;
  max-height: min(92vh, 760px);
  padding: 0;
  overflow: hidden;
}

.modal-pay.pay-modal-sheet .pay-modal-head {
  padding: 1rem 1.15rem 0.35rem;
  flex-shrink: 0;
}

.modal-pay.pay-modal-sheet .pay-modal-head .modal-title {
  margin: 0;
}

.modal-pay.pay-modal-sheet .pay-modal-body {
  padding: 0.5rem 1.15rem 0.75rem;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.modal-pay.pay-modal-sheet .pay-modal-footer {
  flex-shrink: 0;
  padding: 0 1.15rem 1rem;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #fafcfd 0%, #fff 100%);
}

.pay-total-hero {
  margin-bottom: 0.65rem;
  padding: 0.85rem 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.pay-total-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pay-total-value {
  font-size: clamp(1.45rem, 4vw, 1.85rem);
  font-variant-numeric: tabular-nums;
}

.pay-discount-wrap {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}
.pay-discount-toggle {
  width: 100%;
  min-height: 44px;
  border: 1.5px dashed #0d6e6e;
  color: #0d6e6e;
  font-weight: 700;
}
.pay-discount-panel {
  display: grid;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 1px solid #cfe7e5;
  border-radius: 14px;
  background: #f7fbfb;
}
.pay-discount-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}
.pay-discount-modes label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}
.pay-discount-hint { margin: 0; min-height: 1.1em; }
.pay-discount-summary {
  display: grid;
  gap: 0.25rem;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  background: #fff7ed;
  border: 1px solid #f3d7b0;
}
.pay-discount-summary div {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-weight: 600;
}
.pay-discount-summary strong { font-variant-numeric: tabular-nums; }

.pay-methods-list {
  display: grid;
  gap: 0.5rem;
}

.pay-methods-list.has-many {
  grid-template-columns: 1fr;
}

.pay-method-row {
  display: grid;
  grid-template-columns: auto 1fr minmax(8.5rem, 11rem);
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.pay-method-row.is-focused,
.pay-method-row:focus-within {
  border-color: #8ec9c4;
  box-shadow: 0 0 0 3px rgba(13, 110, 110, 0.12);
}

.pay-method-row.is-active {
  border-color: #b8ddd9;
  background: #f8fcfb;
}

.pay-method-row.is-primary {
  border-style: dashed;
  border-color: #c5dedc;
  background: #f6fbfb;
}

.pay-method-icon {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.pay-icon-cash { background: linear-gradient(145deg, #1f7a4d, #166534); }
.pay-icon-card { background: linear-gradient(145deg, #2563eb, #1d4ed8); }
.pay-icon-click { background: linear-gradient(145deg, #0d9488, #0f766e); }
.pay-icon-transfer { background: linear-gradient(145deg, #7c3aed, #6d28d9); }
.pay-icon-debt { background: linear-gradient(145deg, #c45c26, #9a3412); }
.pay-icon-default { background: linear-gradient(145deg, #64748b, #475569); }

.pay-method-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  min-width: 0;
}

.pay-method-input {
  width: 100%;
  min-width: 0;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0.55rem 0.7rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  text-align: right;
  outline: none;
  -moz-appearance: textfield;
}

.pay-method-row.is-focused .pay-method-input,
.pay-method-row:focus-within .pay-method-input {
  border-color: #8ec9c4;
  box-shadow: 0 0 0 3px rgba(13, 110, 110, 0.1);
}

.pay-method-input::-webkit-outer-spin-button,
.pay-method-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

@media (max-width: 480px) {
  .modal-pay.pay-modal-sheet {
    width: min(480px, calc(100% - 1.5rem));
  }
  .pay-method-row {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
  }
  .pay-method-name {
    grid-column: 2;
  }
  .pay-method-input {
    grid-column: 1 / -1;
    text-align: left;
  }
}

.pay-status-card {
  margin: 0.85rem 0 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.pay-status-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 600;
}

.pay-status-row strong {
  font-size: 1.25rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.pay-status-hint {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  font-weight: 700;
  min-height: 1.2em;
}

.pay-status-card.is-ready {
  border-color: #b7e4c7;
  background: #f0fdf4;
}

.pay-status-card.is-ready .pay-status-hint {
  color: var(--good);
}

.pay-status-card.is-short {
  border-color: #fde68a;
  background: #fffbeb;
}

.pay-status-card.is-short .pay-status-hint {
  color: #b45309;
}

.pay-status-card.is-over {
  border-color: #fecaca;
  background: #fef2f2;
}

.pay-status-card.is-over .pay-status-hint {
  color: var(--danger);
}

.pay-modal-actions {
  margin-top: 0;
}

.pay-debtor-block {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.35rem;
  margin-bottom: 0.25rem;
  padding: 0.85rem;
  border-radius: 14px;
  border: 1px solid #f0d9c8;
  background: #fffaf6;
}

.pay-methods-list .pay-debtor-block {
  grid-column: 1 / -1;
}

.pay-debtor-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 800;
  color: #9a3412;
}

.pay-field {
  display: grid;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 1.05rem;
}
.pay-field input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0.75rem 0.85rem;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  min-height: 48px;
  background: #fff;
}
.pay-field input:focus {
  outline: none;
  border-color: #8ec9c4;
  box-shadow: 0 0 0 3px rgba(13, 110, 110, 0.1);
}

.pay-sum-line {
  margin: 0;
  font-size: 1.05rem;
  color: var(--muted);
}
.pay-sum-line strong { color: var(--ink); font-size: 1.15rem; }

.sale-edit-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--primary);
  background: rgba(13, 110, 110, 0.08);
}
.sale-edit-banner.hidden { display: none; }
.sale-edit-banner-text {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}
.sale-edit-banner-text strong {
  font-size: 0.95rem;
}
.sale-edit-banner-text .muted {
  font-size: 0.82rem;
}

.sales-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}
.shift-status {
  display: flex;
  flex: 1 1 300px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.85rem;
  min-height: 44px;
  padding: 0.6rem 0.85rem;
  border: 1px solid #efcaca;
  border-radius: 12px;
  background: #fff5f5;
  color: #8a2929;
}
.shift-status span { font-size: 0.92rem; }
.shift-status-open {
  border-color: #b8dfcf;
  background: #edf9f4;
  color: #176446;
}
.shift-status-busy {
  border-color: #f0d5a8;
  background: #fff8e9;
  color: #79530d;
}
.shift-mode-form {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.65rem;
  margin-top: 0.75rem;
}
.shift-mode-form .check-card { min-width: 180px; }
.shift-admin-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0.75rem 0;
  padding: 0.8rem 0.9rem;
  border: 1px solid #f0d5a8;
  border-radius: 12px;
  background: #fff8e9;
}
.shift-report-table { min-width: 0; width: 100%; }
.table-compact th,
.table-compact td {
  padding: 0.55rem 0.45rem;
  font-size: 0.88rem;
  white-space: nowrap;
}
.table-scroll-panel {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}
@media (min-width: 900px) {
  .shift-report-table { min-width: 980px; }
}
.shift-difference { color: var(--danger); font-weight: 800; }
.outside-shift-row td {
  background: #fff8e9;
  border-top: 2px solid #f0d5a8;
}

.settings-page {
  display: grid;
  gap: 1.15rem;
  max-width: 920px;
  margin: 0 auto;
}
.settings-head { margin-bottom: 0.15rem; }
.settings-head h1 {
  margin: 0 0 0.3rem;
  font-size: 1.55rem;
  color: var(--primary-dark);
}
.settings-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.settings-store-panel { padding: 1rem 1.15rem; }
.settings-store-inner {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.settings-store-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(13, 110, 110, 0.1);
  color: var(--primary-dark);
}
.settings-store-icon svg { width: 22px; height: 22px; }
.settings-store-form { flex: 1; min-width: 0; }
.settings-store-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
}
.settings-store-label {
  flex: 1 1 220px;
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 0.92rem;
}
.settings-store-input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 1rem;
  background: #fff;
}
.settings-help-form {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}
.settings-help-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
}
.settings-help-status {
  margin: 0;
  font-size: 0.88rem;
}
.settings-help-btn {
  flex-shrink: 0;
}
.settings-store-save {
  align-self: flex-end;
  min-width: 7.5rem;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}
.settings-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 84px;
  padding: 1rem 1.1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.settings-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(13, 110, 110, 0.12);
}
.settings-card-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
}
.settings-card-icon svg { width: 22px; height: 22px; }
.settings-card-icon--tg {
  background: rgba(34, 158, 217, 0.12);
  color: #1a8fc7;
}
.settings-card-icon--print {
  background: rgba(13, 110, 110, 0.1);
  color: var(--primary-dark);
}
.settings-card-icon--backup {
  background: rgba(196, 92, 38, 0.1);
  color: var(--accent);
}
.settings-card-body {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0.25rem;
}
.settings-card-title {
  font-size: 1rem;
  color: var(--ink);
}
.settings-card-meta {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.settings-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.settings-status.is-active {
  background: rgba(31, 122, 77, 0.12);
  color: var(--good);
}
.settings-status.is-off {
  background: var(--bg-soft);
  color: var(--muted);
}
.settings-card-arrow {
  flex-shrink: 0;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--muted);
  opacity: 0.45;
  transition: transform 0.15s, opacity 0.15s;
}
.settings-card:hover .settings-card-arrow {
  transform: translateX(3px);
  opacity: 0.85;
  color: var(--primary);
}

.settings-backup-card {
  padding: 0;
  overflow: hidden;
  position: relative;
}
.settings-backup-card-top {
  position: absolute;
  top: 1rem;
  right: 2.85rem;
  z-index: 2;
}
.settings-backup-trigger {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  min-height: 84px;
  padding: 1rem 1.1rem;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: background 0.15s;
}
.settings-backup-trigger:hover {
  background: rgba(13, 110, 110, 0.04);
}
.settings-backup-trigger.is-open {
  background: rgba(13, 110, 110, 0.06);
  border-bottom: 1px solid var(--line);
}
.settings-backup-trigger-body {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0.35rem;
}
.settings-backup-trigger-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
}
.settings-backup-title {
  margin: 0;
  font-size: 1rem;
  color: var(--ink);
}
.settings-backup-trigger-label {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.65rem;
  border-radius: 999px;
  background: rgba(196, 92, 38, 0.1);
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
}
.settings-backup-hint {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
}
.settings-backup-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
}
.settings-backup-badge {
  font-size: 0.82rem;
  font-weight: 600;
}
.settings-backup-chevron {
  flex-shrink: 0;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--muted);
  opacity: 0.45;
  transition: transform 0.2s, opacity 0.15s, color 0.15s;
}
.settings-backup-trigger:hover .settings-backup-chevron,
.settings-backup-trigger.is-open .settings-backup-chevron {
  opacity: 0.85;
  color: var(--primary);
}
.settings-backup-trigger.is-open .settings-backup-chevron {
  transform: rotate(90deg);
}
.settings-backup-config {
  animation: settingsBackupReveal 0.22s ease;
}
@keyframes settingsBackupReveal {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.settings-backup-config-inner {
  padding: 1rem 1.1rem 1.15rem;
  display: grid;
  gap: 1rem;
}
.settings-backup-section {
  display: grid;
  gap: 0.65rem;
}
.settings-backup-section--manual {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.settings-backup-section-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary-dark);
}
.settings-backup-form {
  display: grid;
  gap: 1rem;
}
.settings-backup-form-foot {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.15rem;
}
.settings-backup-schedule {
  padding: 0.95rem 1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #f8fbfa 0%, #f4f7fb 100%);
  border: 1px solid var(--line);
  display: grid;
  gap: 0.75rem;
}
.settings-backup-schedule--telegram {
  background: linear-gradient(135deg, #f7fbff 0%, #f4f8fb 100%);
}
.settings-backup-toggle { max-width: 100%; }
.settings-backup-schedule-hint { margin: 0; font-size: 0.88rem; }
.settings-backup-times {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}
.settings-backup-times label {
  display: grid;
  gap: 0.3rem;
  font-weight: 700;
  font-size: 0.88rem;
}
.settings-backup-times input {
  padding: 0.6rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.settings-backup-last {
  margin: 0;
  padding-top: 0.35rem;
  border-top: 1px dashed var(--line);
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  align-items: baseline;
}
.settings-backup-last-label { color: var(--muted); font-weight: 600; }
.settings-backup-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.75rem;
}
.settings-backup-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  width: 100%;
}
.backup-import-form {
  display: block;
  min-width: 0;
}
.backup-import-form .backup-file-btn {
  width: 100%;
}
.settings-backup-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.settings-backup-foot {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
}
.settings-backup-telegram-hint { margin: 0; font-size: 0.85rem; line-height: 1.45; }
.settings-backup-startup { margin-top: 0; }
.settings-backup-telegram-warn { color: #9a6700; font-weight: 600; margin: 0; }
.settings-backup-telegram-foot { margin: 0; font-size: 0.85rem; line-height: 1.45; }
.settings-backup-telegram {
  margin: 0;
  padding: 0;
  border: 0;
}
.settings-backup-recipients {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.5rem;
}
.settings-backup-recipient-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
}
.backup-import-users-page { max-width: 720px; margin: 0 auto; }
.backup-import-users-page h1 { margin: 0.35rem 0 0.5rem; font-size: 1.35rem; }
.backup-import-file { margin: 0.75rem 0 1rem; }
.backup-import-users-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.backup-import-users-list {
  display: grid;
  gap: 0.45rem;
  max-height: 420px;
  overflow: auto;
  margin-bottom: 1rem;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-soft);
}
.backup-import-user-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  cursor: pointer;
}
.backup-import-user-body {
  display: grid;
  gap: 0.15rem;
}
.backup-import-user-name { font-weight: 700; }
.backup-import-user-meta { font-size: 0.85rem; }
.backup-import-users-note.is-warn {
  color: #9a6700;
  font-weight: 600;
}
.backup-import-users-actions { margin-top: 0.5rem; }
.network-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.network-user-edit-form {
  display: grid;
  gap: 0.75rem;
}
.status-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}
.status-pill.is-active { background: #dafbe1; color: #116329; }
.status-pill.is-inactive { background: #ffebe9; color: #cf222e; }
.backup-file-btn { position: relative; overflow: hidden; cursor: pointer; }
.backup-file-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
/* legacy aliases */
.settings-actions { margin-top: 0.85rem; }
.settings-link-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  width: min(100%, 420px);
  text-align: left;
  text-decoration: none;
}
.settings-link-card span {
  font-weight: 600;
  opacity: 0.85;
  font-size: 0.95rem;
}
.backup-panel { margin-top: 0; }
.backup-form { margin-top: 0.75rem; }
.backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
  align-items: center;
}
.printer-discover-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 0.5rem 0 1rem;
}
.printer-discover-block {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border, #d8e0ea);
  border-radius: 10px;
  background: #f8fafc;
}
.printer-discover-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.printer-discover-status,
.printer-actions-row .muted {
  margin: 0;
}
.printer-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1rem;
}
.printer-download-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1.15rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border, #d8e0ea);
  border-radius: 10px;
  background: #f8fafc;
}
.printer-download-row .muted {
  margin: 0;
  flex: 1;
  min-width: 12rem;
}
.dev-backup-schedule {
  display: grid;
  gap: 0.85rem;
}
.dev-backup-stores { display: grid; gap: 0.75rem; }
.dev-backup-store {
  border: 1px solid var(--line, #d8e0ea);
  border-radius: 12px;
  background: #fff;
  padding: 0.35rem 1rem 0.85rem;
}
.dev-backup-store > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.65rem 0;
}
.dev-backup-store > summary::-webkit-details-marker { display: none; }
.dev-backup-store-head { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: baseline; }
.dev-backup-now { margin: 0 0 0.85rem; }
.dev-backup-upload {
  display: grid;
  gap: 0.45rem;
  margin: 0 0 0.85rem;
  padding: 0.75rem 0.85rem;
  border: 1px dashed var(--line, #d8e0ea);
  border-radius: 10px;
  background: #f8fafc;
}
.dev-backup-upload .muted { margin: 0; }
.dev-backup-upload .btn { justify-self: start; }
.dev-backup-table { margin-top: 0.85rem; }
.dev-backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.dev-backup-actions form { margin: 0; }
.dev-backup-custom { display: grid; gap: 0.75rem; }
.dev-backup-custom[hidden] { display: none; }
.dev-backup-picks-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.dev-backup-picks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.15rem 0.75rem;
  margin-top: 0.4rem;
  max-height: 280px;
  overflow: auto;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--line, #d8e0ea);
  border-radius: 10px;
  background: #fff;
}
.form .dev-backup-pick {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.28rem 0;
  font-weight: 600;
  cursor: pointer;
}
.form .dev-backup-pick input {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  flex: 0 0 auto;
}
.form .dev-backup-pick-all { font-weight: 600; }
.sale-print-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}
.sale-print-actions .btn { flex: 1; min-width: 140px; }
.sale-print-actions + .btn-danger,
#reportDetailList > .btn-danger {
  margin-top: 0.75rem;
}
.discover-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.discover-list .discover-ip { min-width: 130px; }
.telegram-bot-form,
.telegram-add-form {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.telegram-bot-form label,
.telegram-add-form label,
.telegram-recipient-head label {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
}
.telegram-enable { max-width: 360px; }
.telegram-interval {
  display: grid;
  gap: 0.5rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7fbfb;
}
.telegram-interval-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 160px));
  gap: 0.65rem;
}
.telegram-interval-row input {
  min-height: 44px;
}
.telegram-cash-stores {
  margin-top: 0.75rem;
}
.telegram-cash-stores-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.telegram-page .tg-bot-name {
  margin: -4px 0 12px;
  font-size: 0.9rem;
}
.telegram-page .tg-bot-name--err {
  color: #b42318;
}

.telegram-page .telegram-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.telegram-page .telegram-section:first-of-type {
  margin-top: 0.75rem;
  padding-top: 0;
  border-top: none;
}
.telegram-section-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: var(--text);
}
.telegram-cash-section {
  background: #f7fbfb;
  border: 1px solid #dceeed;
  border-radius: 14px;
  padding: 1rem;
  margin-top: 1rem;
}
.tg-cash-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.tg-cash-grid-head,
.tg-cash-grid-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.5fr) 88px 88px 88px;
  gap: 0.65rem;
  align-items: center;
}
.tg-cash-grid-head {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0 0.25rem;
}
.tg-cash-grid-row {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
}
.tg-cash-grid-row.is-remote {
  border-color: #c5e8e4;
}
.tg-cash-store-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}
.tg-cash-store-name strong {
  font-weight: 600;
}
.tg-cash-toggle.check-card {
  justify-content: center;
  min-height: 44px;
  padding: 0.35rem;
}
.tg-cash-input input {
  width: 100%;
  min-height: 44px;
}
.tg-cash-footnote {
  margin: 0.85rem 0 0;
  font-size: 0.88rem;
}
.tg-cash-empty {
  grid-column: 1 / -1;
  padding: 0.5rem;
}
@media (max-width: 720px) {
  .tg-cash-grid-head {
    display: none;
  }
  .tg-cash-grid-row {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "name name"
      "toggle hours"
      "minutes minutes";
  }
  .tg-cash-store-name { grid-area: name; }
  .tg-cash-toggle { grid-area: toggle; }
  .tg-cash-hours { grid-area: hours; }
  .tg-cash-minutes { grid-area: minutes; }
}
.telegram-flags {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.55rem;
}
.telegram-recipient-list {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}

.panel-head-split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.tg-start-pick-list {
  display: grid;
  gap: 0.55rem;
}

.tg-start-pick-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  font: inherit;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.tg-start-pick-item:hover,
.tg-start-pick-item:active {
  border-color: var(--primary);
  background: #f3fbfa;
}

.tg-start-pick-main {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.tg-start-pick-id {
  font-size: 0.88rem;
  color: var(--muted);
}

.tg-start-pick-when {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}

.tg-start-pick-added {
  font-size: 0.8rem;
  color: #6b7280;
}

.tg-start-pick-item-added {
  opacity: 0.85;
}

.telegram-recipient-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem;
  background: #fff;
  display: grid;
  gap: 0.75rem;
}
.telegram-recipient-head {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.65rem;
}
.telegram-recipient-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
@media (max-width: 960px) {
  .telegram-recipient-actions .btn { width: 100%; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-backup-times { grid-template-columns: 1fr; }
  .settings-backup-actions { grid-template-columns: 1fr; }
  .settings-store-fields .btn { width: 100%; }
  .settings-store-save { width: 100%; }
  .settings-help-row { align-items: flex-start; }
}

.period-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: end;
}
.period-row label {
  display: grid;
  gap: 0.25rem;
  font-weight: 700;
  font-size: 0.95rem;
  flex: 1;
  min-width: 140px;
}
.period-row input {
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 44px;
  font-size: 1rem;
}

.click-list {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.35rem;
}
.click-item {
  display: grid;
  gap: 0.25rem;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
button.click-item:hover,
button.click-item:active {
  border-color: var(--primary);
  background: #f3fbfa;
}
.log-item { cursor: default; }
.click-item-main,
.click-item-sub {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.click-item-sub { color: var(--muted); font-size: 0.95rem; }
.pad { padding: 0.75rem; }
.history-detail { display: grid; gap: 0.85rem; }
.detail-meta {
  display: grid;
  gap: 0.35rem;
  font-size: 1.05rem;
  background: var(--bg-soft);
  border-radius: 14px;
  padding: 0.9rem 1rem;
}
.detail-total { font-size: 1.2rem; margin-top: 0.25rem; }
tr.row-clickable { cursor: pointer; }
tr.row-clickable:hover td { background: #f3fbfa; }
tr.sale-row-cancelled td,
tr.sale-row-cancelled td strong {
  color: #a3adba;
  font-size: 0.82rem;
  font-weight: 400;
}
tr.sale-row-cancelled:hover td { background: #f6f7f9; }
tr.delivery-row-rejected td,
tr.delivery-row-rejected td strong {
  color: #9a4d5c;
  font-weight: 500;
}
tr.delivery-row-rejected:hover td { background: #fdf4f6; }
.click-item.sale-cancelled,
.click-item.sale-cancelled strong {
  color: #a3adba;
  font-size: 0.86rem;
  font-weight: 400;
}
.delivery-nav-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--primary-dark);
}
.delivery-nav-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #c2410c;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
#deliveryNotify.modal {
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  background: rgba(18, 28, 40, 0.62);
}
.delivery-notify-box {
  width: min(440px, 100%);
  max-height: calc(100dvh - 1.5rem);
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.delivery-notify-box .modal-title,
.delivery-notify-box .modal-actions {
  flex-shrink: 0;
}
#deliveryNotify .modal-actions-stack {
  flex-direction: column;
}
.delivery-notify-body {
  display: grid;
  gap: 0.65rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.delivery-customer {
  display: grid;
  gap: 0.15rem;
}
.delivery-map-link {
  width: 100%;
  text-align: center;
}
.delivery-items-title { margin: 0 0 0.15rem; }
.delivery-section {
  display: grid;
  gap: 0.25rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.delivery-section-fee { background: #f3faf8; }
.delivery-section-total {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.35rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--line);
  font-weight: 700;
}
.delivery-grand { font-size: 1.05rem; font-weight: 700; }
.delivery-detail-line {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.25rem 0;
}
.delivery-receipt-link {
  display: grid;
  gap: 0.35rem;
  color: inherit;
  text-decoration: none;
}
.delivery-receipt-link span {
  font-size: 0.86rem;
  font-weight: 700;
}
.delivery-receipt {
  display: block;
  width: 100%;
  height: 160px;
  max-height: 160px;
  object-fit: contain;
  object-position: center;
  border-radius: 12px;
  background: #eef2f4;
  border: 1px solid var(--line);
}
.delivery-reject-box {
  width: 100%;
}
.delivery-reject-box textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 4.5rem;
  resize: vertical;
}
.delivery-reject-text {
  margin: 0.25rem 0 0;
  white-space: pre-wrap;
}
.sf-admin-map { height: 320px; border-radius: 16px; margin: 0.35rem 0 0; border: 1px solid var(--line); }
.sf-settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}
.sf-settings-head h1 {
  margin: 0 0 0.3rem;
  font-size: 1.55rem;
  color: var(--primary-dark);
}
.sf-form { display: grid; gap: 1rem; }
.sf-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.1rem 1.15rem 1.15rem;
  box-shadow: 0 8px 24px rgba(20, 40, 60, 0.04);
}
.sf-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.08rem;
}
.sf-card .muted { margin: 0 0 0.85rem; }
.sf-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.sf-card-top h2 { margin: 0 0 0.4rem; }
.sf-status {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.65rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}
.sf-status.on { background: #e7f6ee; color: #0f7a45; }
.sf-status.off { background: #f2f4f7; color: #667085; }
.sf-link-field { margin: 0; }
.sf-link-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.sf-link-row input { flex: 1; min-width: 0; }
.sf-link-row .btn { flex: 0 0 auto; white-space: nowrap; }
.sf-fee-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.sf-settings .tg-bot-name { margin: 0.35rem 0 0; font-size: 0.92rem; }
.sf-settings .tg-bot-name--err { color: #b42318; }
.sf-save-bar { display: flex; justify-content: flex-end; }
.sf-save-bar .btn { min-width: 9rem; }
@media (max-width: 640px) {
  .sf-settings-head, .sf-card-top, .sf-link-row, .sf-save-bar { flex-direction: column; align-items: stretch; }
  .sf-fee-grid { grid-template-columns: 1fr; }
  .sf-link-row .btn, .sf-save-bar .btn, .sf-card-top .btn { width: 100%; }
  .sf-admin-map { height: 260px; }
}
.dev-store-storefront {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.35rem 0 0.6rem;
}

@media (max-width: 960px) {
  .sales-layout, .products-layout { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; gap: 0.55rem; }
  .topbar-right { margin-left: 0; width: 100%; justify-content: space-between; }
  .nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .nav a { white-space: nowrap; font-size: 0.95rem; padding: 0.55rem 0.8rem; }
  .main { padding: 0.75rem; }
  .main-sales { padding-bottom: calc(5.75rem + env(safe-area-inset-bottom)); }
  .sales-layout { height: auto; min-height: auto; gap: 0.75rem; }
  .sales-left, .sales-right { min-height: auto; }
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    max-height: min(52vh, 520px);
    min-height: 12rem;
  }
  .product-card { padding: 0.75rem 0.65rem; min-height: min-content; }
  .product-card .pname { font-size: 0.92rem; line-height: 1.35; }
  .product-card .pprice { font-size: 1.1rem; }
  .cart-total { font-size: 1.35rem; }
  .table th, .table td { font-size: 0.95rem; padding: 0.65rem 0.4rem; }
  .cart-table input[type="number"] { width: 64px; min-height: 40px; font-size: 1rem; }
  .modal {
    align-items: end;
    padding: 0;
  }
  .modal-box,
  .modal-sheet,
  .modal-wide-sheet,
  .modal-product-sheet {
    width: 100%;
    max-width: 100%;
    border-radius: 22px 22px 0 0;
    max-height: min(92vh, 100dvh);
    padding: 1.25rem 1rem calc(1.1rem + env(safe-area-inset-bottom));
    overflow-x: hidden;
  }
  .modal-box.modal-wide-sheet,
  .modal-box.modal-product-sheet,
  .modal-box.copy-wizard-box,
  .modal-box.barcode-list-box {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .product-form-row-2 { grid-template-columns: 1fr; }
  .product-field-unit { max-width: none; }
  .qty-stepper {
    grid-template-columns: 48px minmax(0, 1fr) 48px;
  }
  .form-row { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reports-metrics-secondary { grid-template-columns: 1fr; }
  .stat-breakdown-row { min-height: 44px; font-size: 0.88rem; }
  .date-filter-row { flex-direction: column; align-items: stretch; }
  .date-filter-row label { width: 100%; }
  .date-filter-row .btn { width: 100%; min-height: 48px; }
  .date-filter-actions { flex-direction: column; }
  .date-filter-actions .btn,
  .date-filter .btn, .form-inline .btn { width: 100%; min-height: 48px; }
  .form-inline, .expense-form { flex-direction: column; align-items: stretch; }
  .expense-form-grid { grid-template-columns: 1fr; }
  .expense-form-grid .btn { width: 100%; }
  .shift-status { flex-basis: 100%; }
  .shift-mode-form .check-card,
  .shift-mode-form .btn { width: 100%; }
  .inline-search { width: 100%; margin-left: 0; }
  .login-card { padding: 1.5rem 1.2rem; }
  .login-card h1 { font-size: 1.7rem; }
  .login-card input { min-height: 48px; font-size: 1.05rem; }
}

@media (max-width: 480px) {
  .brand { font-size: 1.05rem; }
  .stat-value { font-size: 1.15rem; }
  .period-row { flex-direction: column; align-items: stretch; }
  .period-row .btn { width: 100%; }
  .stats-grid { grid-template-columns: 1fr; }
  .reports-metrics-secondary { grid-template-columns: 1fr; }
  .stat-card-compact { min-height: auto; }
  .stat-card-grouped .stat-value { font-size: 1.35rem; }
}

/* Mobile card layout for wide tables */
@media (max-width: 768px) {
  .products-table {
    table-layout: auto;
    font-size: 0.95rem;
  }
  .products-table th,
  .products-table td {
    padding: 0.42rem 0;
    overflow: visible;
  }
  .products-table th:nth-child(n),
  .products-table td:nth-child(n) {
    width: auto;
    max-width: none;
  }
  .products-table .barcode-cell {
    max-width: none;
  }
  .products-table td.actions {
    width: auto;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .products-table td.actions .btn-icon-action {
    width: 2.15rem;
    height: 2.15rem;
    min-width: 2.15rem;
  }
  .table-cards thead { display: none; }
  .table-cards tbody tr {
    display: block;
    margin-bottom: 0.85rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(26, 35, 50, 0.05);
  }
  .table-cards tbody tr:last-child { margin-bottom: 0; }
  .table-cards tbody tr.total-row,
  .table-cards tbody tr.active-row {
    border-width: 2px;
    border-color: var(--primary);
    background: rgba(13, 110, 110, 0.05);
  }
  .table-cards tbody tr.nr-row-error {
    border-color: #e8b4b4;
    background: #fffafa;
  }
  .table-cards tbody tr.outside-shift-row {
    border-style: dashed;
  }
  .table-cards tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.42rem 0;
    border: none;
    text-align: right;
    font-size: 0.95rem;
  }
  .table-cards tbody td:first-child {
    display: block;
    font-size: 1.05rem;
    font-weight: 800;
    padding-bottom: 0.55rem;
    margin-bottom: 0.35rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
  }
  .table-cards tbody td:first-child::before { display: none; }
  .table-cards tbody td[data-label]::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--muted);
    text-align: left;
    flex: 1;
    font-size: 0.88rem;
    padding-right: 0.5rem;
  }
  .table-cards tbody td[colspan] { display: none; }
  .table-cards tbody td.muted { display: block; text-align: center; }
  .table-cards tbody td.muted::before { display: none; }

  .panel-actions {
    display: grid;
    gap: 0.5rem;
  }
  .panel-actions .btn {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }

  .nr-summary-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }

  .compare-table .rename-form {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .compare-table .rename-form input[type="text"] {
    width: 100%;
    min-width: 0;
  }
  .compare-table .rename-form .btn { width: 100%; min-height: 44px; }
  .store-actions-cell .btn { width: 100%; min-height: 44px; margin: 0.25rem 0; }

  .dev-page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .dev-page-head .btn { width: 100%; }

  .dev-network-block-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .dev-network-block-actions {
    width: 100%;
    display: grid;
    gap: 0.4rem;
  }
  .dev-network-block-actions .btn { width: 100%; }

  .dev-store-actions {
    display: grid;
    gap: 0.4rem;
  }
  .dev-store-actions .btn { width: 100%; }

  .form-inline {
    flex-direction: column;
    align-items: stretch;
  }
  .form-inline label { width: 100%; }
  .form-inline .btn { width: 100%; min-height: 48px; }

  .date-range {
    flex-direction: column;
    align-items: stretch;
  }
  .date-range label { width: 100%; }
  .date-range .btn { width: 100%; min-height: 48px; }

  .nr-collapsible summary {
    padding: 1rem 0.85rem;
    min-height: 48px;
  }
  .nr-collapsible .table-wrap { padding: 0 0.75rem 0.85rem; }

  .table-cards tbody td[data-label].actions,
  .table-cards tbody td.store-actions-cell {
    flex-direction: column;
    align-items: stretch;
  }
  .table-cards tbody td[data-label].actions::before,
  .table-cards tbody td.store-actions-cell::before {
    margin-bottom: 0.25rem;
  }
  .table-cards tbody td.actions .btn,
  .table-cards tbody td.store-actions-cell .btn {
    width: 100%;
    min-height: 44px;
  }
  .table-cards tbody td.actions form { width: 100%; }

  .date-filter .btn { width: 100%; min-height: 48px; }
  .access-grid { grid-template-columns: 1fr; }
  .access-grid .btn { width: 100%; min-height: 48px; }

  .flash-wrap { margin-bottom: 0.75rem; }
  .flash { font-size: 0.95rem; padding: 0.75rem 0.85rem; }
}

/* Reports analytics */
.analytics-modal-root .modal-box.analytics-modal {
  width: min(640px, calc(100vw - 1rem));
  max-width: 100%;
  height: min(88vh, 760px);
  max-height: min(88vh, 760px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.analytics-modal-root .modal-head-row,
.analytics-modal-root .muted,
.analytics-modal-root .analytics-errors {
  flex-shrink: 0;
}
.analytics-modal-root #reportAnalyticsContent {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.analytics-panels {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  position: relative;
}
.analytics-panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.analytics-panel.hidden { display: none; }
.analytics-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding-right: 0.15rem;
}
.analytics-loading {
  padding: 2rem 0;
  text-align: center;
}
.analytics-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
  margin: 0.75rem 0 0.85rem;
  flex-shrink: 0;
}
.analytics-tabs--5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.analytics-tabs--6 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.analytics-tab {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: inherit;
  border-radius: 12px;
  padding: 0.55rem 0.45rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  text-align: center;
}
.analytics-tab.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.analytics-panel-head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.55rem;
  flex-shrink: 0;
}
.analytics-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}
.analytics-stat {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.8rem 0.85rem;
}
.analytics-stat:first-child {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.12), rgba(13, 148, 136, 0.04));
  border-color: rgba(13, 148, 136, 0.25);
}
.analytics-stat-label {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.analytics-stat-value {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.analytics-stat:first-child .analytics-stat-value {
  font-size: 1.45rem;
  color: var(--primary-dark);
}
.analytics-data-list {
  display: grid;
  gap: 0.35rem;
}
.analytics-data-head,
.analytics-data-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 3.2rem minmax(0, 1fr);
  align-items: center;
  gap: 0.45rem;
}
.analytics-data-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0.35rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--bg-soft);
  border-radius: 10px;
}
.analytics-data-head span:nth-child(2),
.analytics-data-head span:nth-child(3),
.analytics-data-count,
.analytics-data-value {
  text-align: right;
}
.analytics-data-row {
  position: relative;
  padding: 0.62rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.analytics-data-row.is-empty {
  opacity: 0.55;
}
.analytics-data-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--pct, 0%);
  max-width: 100%;
  background: linear-gradient(90deg, rgba(13, 148, 136, 0.16), rgba(13, 148, 136, 0.04));
  pointer-events: none;
}
.analytics-data-label,
.analytics-data-count,
.analytics-data-value {
  position: relative;
  z-index: 1;
  min-width: 0;
}
.analytics-data-label {
  font-weight: 700;
  font-size: 0.92rem;
}
.analytics-data-count {
  font-size: 0.88rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.analytics-data-value {
  font-weight: 800;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.analytics-chart-wrap {
  position: relative;
  height: min(280px, 42vh);
  margin-top: 0.25rem;
}
.analytics-empty {
  text-align: center;
  padding: 1.5rem 0.5rem;
}
.analytics-errors {
  margin: 0.5rem 0 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  background: #fde8e8;
  color: var(--danger);
  font-size: 0.92rem;
}
.analytics-errors ul {
  margin: 0.35rem 0 0;
  padding-left: 1.15rem;
}
@media (max-width: 768px) {
  .analytics-modal-root.modal {
    align-items: end;
    padding: 0;
  }
  .analytics-modal-root .modal-box.analytics-modal {
    width: 100%;
    max-width: 100%;
    height: min(92vh, 100dvh);
    max-height: min(92vh, 100dvh);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 22px 22px 0 0;
    padding: 1rem 0.85rem calc(0.85rem + env(safe-area-inset-bottom));
  }
  .analytics-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .analytics-tabs--5,
  .analytics-tabs--6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .analytics-tab {
    font-size: 0.82rem;
    padding: 0.65rem 0.5rem;
    min-height: 44px;
  }
  .analytics-summary-grid {
    grid-template-columns: 1fr 1fr;
  }
  .analytics-stat:first-child {
    grid-column: 1 / -1;
  }
  .analytics-chart-wrap {
    height: min(240px, 36vh);
  }
}
@media (max-width: 480px) {
  .analytics-data-head,
  .analytics-data-row {
    grid-template-columns: minmax(0, 1fr) 2.5rem minmax(4.5rem, 0.9fr);
    gap: 0.35rem;
  }
  .analytics-data-value {
    font-size: 0.84rem;
  }
}

.settings-card-icon--sales {
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  color: #fff;
}

.settings-card-icon--users {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #fff;
}

.debtors-page {
  display: grid;
  gap: 1rem;
  max-width: 720px;
  margin: 0 auto;
}

.debtors-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.debtors-total-banner {
  text-align: right;
}

.debtors-total-label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted, #64748b);
}

.debtors-total-value {
  font-size: 1.6rem;
  color: #b45309;
}

.debtors-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
}

.debtors-sort-field {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--muted, #64748b);
}

.debtors-sort-field select {
  min-width: 14rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  color: var(--ink);
}

.debtors-list {
  display: grid;
  gap: 0.65rem;
}

.debtor-card {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: none;
  cursor: pointer;
}

.debtor-card-main {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.debtor-card-name {
  font-size: 1.05rem;
}

.debtor-card-phone {
  font-size: 0.88rem;
  color: var(--muted, #64748b);
}

.debtor-card-meta {
  font-size: 0.8rem;
  color: var(--muted, #64748b);
  line-height: 1.35;
}

.debtor-card-balance {
  font-size: 1.15rem;
  font-weight: 700;
  color: #b45309;
  white-space: nowrap;
}

.debtor-detail-meta {
  font-size: 0.92rem;
  color: var(--muted, #64748b);
  padding: 0 0.25rem;
}

.debtor-history-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  align-items: start;
}

.debtor-history-col {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.debtor-history-col-title {
  margin: 0;
  padding: 0.35rem 0.5rem;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border-radius: 8px;
}

.debtor-history-col-charges .debtor-history-col-title {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.08);
}

.debtor-history-col-payments .debtor-history-col-title {
  color: #15803d;
  background: rgba(21, 128, 61, 0.08);
}

.debtor-history-col-list {
  display: grid;
  gap: 0.45rem;
}

.debtor-history-empty {
  margin: 0;
  padding: 0.5rem 0.55rem;
  font-size: 0.88rem;
}

.debtor-history-col-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.15rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 0.9rem;
}

.debtor-history-col-total-label {
  font-weight: 700;
}

.debtor-history-col-total-value {
  font-size: 1rem;
  white-space: nowrap;
}

.debtor-history-col-total-charges {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.18);
}

.debtor-history-col-total-charges .debtor-history-col-total-value {
  color: #dc2626;
}

.debtor-history-col-total-payments {
  color: #15803d;
  background: rgba(21, 128, 61, 0.1);
  border-color: rgba(21, 128, 61, 0.18);
}

.debtor-history-col-total-payments .debtor-history-col-total-value {
  color: #15803d;
}

.debtor-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.25rem 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: rgba(15, 118, 110, 0.06);
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  font: inherit;
  color: inherit;
}

.debtor-history-row.is-clickable {
  cursor: pointer;
}

button.debtor-history-row.is-clickable:hover,
button.debtor-history-row.is-clickable:active {
  border-color: var(--primary);
  background: #f3fbfa;
}

.debtor-history-when {
  grid-column: 1 / -1;
  font-size: 0.82rem;
  color: var(--muted, #64748b);
}

.debtor-history-amount {
  font-weight: 700;
  white-space: nowrap;
}

.debtor-history-row.is-payment .debtor-history-amount {
  color: #15803d;
}

.debtor-history-row.is-charge .debtor-history-amount {
  color: #dc2626;
}

.debtor-history-row.is-payment {
  background: rgba(21, 128, 61, 0.08);
}

.debtor-history-row.is-charge {
  background: rgba(220, 38, 38, 0.07);
}

button.debtor-history-row.is-payment.is-clickable:hover,
button.debtor-history-row.is-payment.is-clickable:active {
  background: rgba(21, 128, 61, 0.14);
  border-color: #15803d;
}

button.debtor-history-row.is-charge.is-clickable:hover,
button.debtor-history-row.is-charge.is-clickable:active {
  background: rgba(220, 38, 38, 0.12);
  border-color: #dc2626;
}

@media (max-width: 640px) {
  .debtor-history-grid {
    grid-template-columns: 1fr;
  }
}

#reportDetailModal .modal-body-scroll {
  min-height: 10rem;
  max-height: min(65vh, 560px);
}

#reportDetailModal .click-list {
  min-height: 2rem;
}

.debtor-tx-pay-summary {
  text-align: center;
  padding: 1.25rem;
}

.debtor-tx-pay-label {
  color: var(--muted, #64748b);
  margin-bottom: 0.35rem;
}

.debtor-tx-pay-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #15803d;
}

@media (max-width: 640px) {
  .debtors-head {
    flex-direction: column;
  }
  .debtors-total-banner {
    text-align: left;
  }
}

/* Users / permissions — mobile & APK */
@media (max-width: 768px) {
  .cashiers-page .panel-head-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .cashiers-page .panel-head-actions .btn {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }
  .cashiers-page .panel-head-with-help {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }
  .cashiers-page .panel-head-with-help .btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }
  .perm-section-grid {
    grid-template-columns: 1fr;
    gap: 0.45rem;
    padding: 0.75rem;
  }
  .perm-section-title {
    padding: 0.95rem 0.85rem;
    font-size: 1rem;
    min-height: 48px;
  }
  .perm-check {
    min-height: 52px;
    padding: 0.85rem 0.95rem;
    font-size: 0.95rem;
  }
  .perm-check input {
    width: 22px;
    height: 22px;
  }
  .new-user-form .new-user-fields {
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 0.75rem;
  }
  .new-user-form .new-user-fields label {
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
  }
  .new-user-form .new-user-fields input,
  .new-user-form .new-user-fields select {
    min-height: 48px;
    font-size: 16px;
  }
  .new-user-modal-root .modal-box.new-user-modal {
    width: 100%;
    max-width: 100%;
    max-height: min(94dvh, 100dvh);
    border-radius: 22px 22px 0 0;
    padding: 1rem 0.9rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
  }
  .new-user-modal-body {
    max-height: none;
    flex: 1 1 auto;
  }
  .new-user-modal-actions .btn {
    width: 100%;
    min-height: 48px;
  }
  .staff-permissions-form > .btn,
  .user-permissions-save .btn {
    width: 100%;
    min-height: 48px;
  }
  .user-permissions-page .user-permissions-panel {
    padding-bottom: 0;
  }
  .user-permissions-save {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin: 0 -0.15rem;
    padding: 0.85rem 0.15rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #fff 28%);
  }
  html.is-android-app .user-permissions-save {
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 480px) {
  .new-user-modal-head .modal-title {
    font-size: 1.12rem;
  }
  .perm-check span {
    line-height: 1.25;
  }
}

.delivery-page-head {
  justify-content: space-between;
  margin-bottom: 0.85rem;
}
.broadcast-box {
  width: min(980px, calc(100% - 1.5rem));
  max-height: min(92vh, 860px);
  overflow: auto;
}
.broadcast-table-wrap {
  max-height: 340px;
  overflow: auto;
  border: 1px solid #e4e8ee;
  border-radius: 12px;
}
.broadcast-table td {
  vertical-align: top;
}
.broadcast-check-col {
  width: 2.2rem;
  text-align: center;
}
.broadcast-all {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  white-space: nowrap;
  margin: 0;
}
.broadcast-table .num {
  text-align: right;
  white-space: nowrap;
}
.broadcast-stat {
  background: none;
  border: 0;
  padding: 0;
  color: #0f766e;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
#clientOrdersModal.modal {
  z-index: 200;
}
.client-orders-box {
  width: min(860px, calc(100% - 1.5rem));
  max-height: min(88vh, 720px);
  overflow: auto;
}
.broadcast-check {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin: 0;
}
.broadcast-check input {
  margin-top: 0.2rem;
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
}
.broadcast-client {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
  line-height: 1.35;
}
.broadcast-person {
  display: block;
}
.broadcast-field {
  display: grid;
  gap: 0.35rem;
}
.broadcast-field textarea,
.broadcast-field input[type="file"] {
  width: 100%;
  box-sizing: border-box;
}
.broadcast-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.nav a.nav-transfer {
  position: relative;
}
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  margin-left: 0.35rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #c2410c;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}
.nav a.active .nav-badge,
.nav a:hover .nav-badge {
  background: #fff;
  color: var(--primary-dark);
}
.ob-page { display: grid; gap: 1rem; }
.ob-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-start;
}
.ob-head h1 { margin: 0 0 0.25rem; font-size: 1.4rem; }
.ob-tabs { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.ob-tab {
  border: 2px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-weight: 700;
  cursor: pointer;
}
.ob-tab.is-active {
  border-color: var(--primary);
  background: rgba(13, 110, 110, 0.1);
  color: var(--primary-dark);
}
.ob-tab-count:empty { display: none; }
.ob-tab-count:not(:empty) {
  display: inline-flex;
  min-width: 1.1rem;
  margin-left: 0.25rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #c2410c;
  color: #fff;
  font-size: 0.75rem;
}
.ob-pane { display: none; }
.ob-pane.is-active { display: grid; gap: 1rem; }
.ob-flash {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: #eef6f6;
}
.ob-flash.is-ok { background: #ecfdf3; color: #166534; }
.ob-flash.is-bad { background: #fef2f2; color: #b91c1c; }
.ob-cards, .ob-history { display: grid; gap: 0.75rem; }
.ob-card, .ob-hist {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  background: #fff;
}
.ob-card.is-bad, .ob-hist.is-bad { border-color: #f1c0c0; background: #fff7f7; }
.ob-card.is-wait { border-color: #f0d48a; background: #fffbeb; }
.ob-card.is-ok { border-color: #b7e4c7; }
.ob-card-head, .ob-hist-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}
.ob-hist-head {
  width: 100%;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.ob-status {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--bg-soft);
}
.ob-status.is-wait { background: #fef3c7; color: #92400e; }
.ob-status.is-ok { background: #dcfce7; color: #166534; }
.ob-status.is-bad { background: #fee2e2; color: #b91c1c; }
.ob-mini { margin: 0.4rem 0; padding-left: 1.1rem; }
.ob-card-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.5rem; }
.ob-reject-reason { color: #b91c1c; font-weight: 600; }
.ob-send-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0;
}
.ob-send-fields {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(200px, 1.2fr);
  gap: 0.75rem;
  min-width: min(100%, 420px);
  flex: 1;
  max-width: 560px;
}
.ob-send-fields label {
  display: grid;
  gap: 0.3rem;
  font-weight: 600;
  font-size: 0.9rem;
}
.ob-send-fields select,
.ob-send-fields input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  background: #fff;
  min-height: 44px;
  font-size: 1rem;
  box-sizing: border-box;
}
.ob-send-layout {
  height: calc(100vh - 280px);
  min-height: 420px;
}
.product-card.in-cart {
  border-color: var(--primary);
  background: #f3fbfa;
  box-shadow: inset 0 0 0 1px var(--primary);
}
.ob-review-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 0.65rem 0 0;
}
.ob-modal { width: min(640px, calc(100% - 1.5rem)); max-height: min(88vh, 760px); overflow: auto; }
.ob-review-items { display: grid; gap: 0.45rem; margin: 0.75rem 0; }
.ob-check {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.ob-check input { margin-top: 0.2rem; width: 1.15rem; height: 1.15rem; }
.ob-events { padding-left: 1.1rem; }
.ob-alert { border-color: #f1c0c0; background: #fff7f7; }
.ob-hist-body { margin-top: 0.75rem; }
.ob-reject-field { display: grid; gap: 0.35rem; }
@media (max-width: 960px) {
  .ob-head { flex-direction: column; }
  .ob-send-bar { align-items: stretch; }
  .ob-send-fields { grid-template-columns: 1fr; max-width: none; }
  .ob-send-layout { height: auto; min-height: auto; }
}
