:root {
  --brown-950: #2c170d;
  --brown-900: #351d12;
  --brown-850: #3e2317;
  --brown-800: #4b3021;
  --brown-700: #6a4a34;
  --cream-50: #fbf8f3;
  --cream-100: #f6f1ea;
  --cream-150: #f0e8df;
  --sand-200: #e6d6c5;
  --sand-300: #d1b89e;
  --green-700: #2c4b2b;
  --green-600: #4f6f47;
  --green-100: #dbe8d5;
  --amber-600: #b66f32;
  --amber-100: #f5ddbc;
  --red-700: #bc1212;
  --red-100: #ffe9e9;
  --text: #1c1713;
  --muted: #74685d;
  --line: #d7c8bc;
  --panel: #fffdf9;
  --shadow: 0 18px 45px rgba(53, 29, 18, 0.08);
  --sidebar-bg: #f7f4ee;
  --sidebar-ink: #39281d;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

@media (min-width: 981px) {
  html {
    zoom: 0.9;
  }
}

body {
  margin: 0;
  background: var(--cream-50);
  color: var(--text);
  font-family: Inter, Segoe UI, Arial, sans-serif;
  font-size: 13px;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.hidden {
  display: none !important;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.muted {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green-600);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--cream-100);
}

.login-panel {
  width: min(430px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 38px;
}

.brand-seal {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  background: var(--brown-950);
  color: #f8e6ce;
  border: 1px solid var(--sand-300);
  font-weight: 950;
}

.login-panel h1 {
  margin-bottom: 6px;
  font-size: 38px;
  line-height: 1;
}

.shift-open-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #07371d;
}

.shift-open-card {
  width: min(640px, 100%);
  overflow: hidden;
  background: var(--panel);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
}

.shift-open-head {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 32px 40px;
  background: var(--brown-700);
  color: #fff7ee;
}

.shift-open-head h1 {
  margin: 0 0 6px;
  font-size: 26px;
  line-height: 1.1;
}

.shift-open-head p {
  margin: 0;
  color: #f3dfca;
  font-size: 17px;
}

.shift-open-icon {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.18);
}

.shift-open-icon .nav-icon {
  width: 28px;
  height: 28px;
  stroke-width: 2.4px;
}

.shift-open-body {
  padding: 38px 40px 28px;
}

.shift-open-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 28px;
  padding: 18px 20px;
  background: var(--cream-100);
}

.shift-open-summary div {
  min-width: 0;
}

.shift-open-summary span {
  display: block;
  margin-bottom: 8px;
  color: var(--brown-700);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.shift-open-summary strong {
  display: block;
  overflow: hidden;
  color: #0f0d0b;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shift-open-form {
  display: grid;
  gap: 22px;
}

.money-input {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-height: 88px;
  border: 2px solid var(--brown-700);
  background: #eaded2;
}

.money-input span {
  padding-left: 24px;
  color: var(--text);
  font-size: 32px;
  font-weight: 950;
}

.money-input input {
  min-height: 84px;
  border: 0;
  background: transparent;
  font-size: 30px;
  font-weight: 950;
}

.shift-open-submit {
  min-height: 74px;
  margin-top: 10px;
  font-size: 19px;
  text-transform: uppercase;
}

.shift-open-notice {
  margin: 8px 0 0;
  color: #7f927b;
  text-align: center;
}

.shift-open-logout {
  display: block;
  margin: 18px auto 0;
  color: var(--brown-700);
}

.login-form,
.stack-form {
  display: grid;
  gap: 16px;
}

.login-form {
  margin-top: 32px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--brown-700);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 9px 11px;
  outline: none;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--amber-600);
  box-shadow: 0 0 0 3px rgba(182, 111, 50, 0.12);
}

.btn {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  padding: 7px 13px;
  color: var(--text);
  font-weight: 900;
  white-space: nowrap;
}

.btn-primary {
  background: var(--brown-850);
  border-color: var(--brown-850);
  color: #fff7ef;
}

.btn-primary:hover {
  background: var(--brown-950);
}

.btn-warm {
  background: var(--amber-600);
  border-color: var(--amber-600);
  color: #fff8ef;
}

.btn-outline {
  border-color: var(--line);
  background: transparent;
  color: var(--brown-850);
}

.btn-outline:hover {
  background: #fff8f0;
}

.btn-ghost-light {
  border-color: rgba(255, 255, 255, 0.38);
  color: #ead7c5;
}

.btn-danger-soft {
  background: var(--red-100);
  border-color: #ffbaba;
  color: var(--red-700);
}

.btn-danger {
  background: #9f1010;
  border-color: #9f1010;
  color: #fff;
}

.btn-danger:hover {
  background: #7f0d0d;
}

.btn-full {
  width: 100%;
}

.btn-mini {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.link-button,
.support-link,
.top-link,
.icon-button {
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 900;
}

.link-button {
  color: var(--brown-800);
}

.icon-button {
  min-width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #dcc7b5;
}

.form-error {
  min-height: 20px;
  color: var(--red-700);
  font-size: 14px;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 274px minmax(0, 1fr);
  grid-template-rows: 54px minmax(0, 1fr);
}

.sidebar {
  grid-column: 1;
  grid-row: 2;
  position: sticky;
  top: 54px;
  height: calc(100vh - 54px);
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  color: var(--sidebar-ink);
  border-right: 1px solid var(--sand-200);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 116px;
  padding: 24px 22px;
  border-bottom: 1px solid var(--sand-200);
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  background: var(--brown-800);
  color: #fff8ef;
  border-radius: 6px;
}

.brand-block h1 {
  margin: 0;
  color: var(--brown-900);
  font-size: 17px;
  letter-spacing: 0.02em;
  line-height: 1.08;
  font-weight: 950;
  white-space: normal;
}

.brand-block h1 span {
  display: block;
}

.brand-block p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.side-nav {
  display: grid;
  gap: 4px;
  padding: 18px 14px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #5a4638;
  padding: 0 14px;
  text-align: left;
  font-size: 13px;
  font-weight: 900;
}

.nav-item:hover {
  background: #eee8df;
  color: var(--brown-900);
}

.nav-item.active {
  background: var(--green-700);
  color: #fff8ef;
  box-shadow: inset 4px 0 0 #c7ddb8;
}

.nav-glyph {
  width: 24px;
  color: #e7c8a8;
  font-size: 11px;
  font-weight: 950;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: currentColor;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-support {
  display: grid;
  gap: 12px;
  margin-top: auto;
  padding: 18px 26px 22px;
  border-top: 1px solid var(--sand-200);
}

.sidebar-context {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--brown-700);
  font-size: 12px;
  font-weight: 850;
}

.support-link {
  width: fit-content;
  color: var(--muted);
  font-size: 13px;
}

.workspace {
  grid-column: 2;
  grid-row: 2;
  position: relative;
  min-width: 0;
  padding-bottom: 38px;
}

.topbar {
  grid-column: 1 / -1;
  grid-row: 1;
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  background: var(--brown-800);
  color: #ead7c5;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.topbar-product {
  flex: 0 0 auto;
  color: #fff7ee;
  font-size: 14px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.top-links,
.top-actions,
.toolbar-actions,
.inline-form,
.cash-actions,
.quick-move-form,
.close-form {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-links {
  gap: 6px;
}

.topbar .top-actions {
  gap: 8px;
}

.top-link {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #ead7c5;
  font-size: 12px;
  font-weight: 850;
}

.top-link:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fffaf3;
}

.top-link.active {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.12);
  color: #fffaf3;
}

.connection-status,
.header-logout,
.header-print-toggle {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 6px;
  padding: 0 11px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 900;
}

.connection-status {
  background: #0ea977;
  color: #f4fff9;
}

.connection-status.offline {
  background: #815a43;
  color: #fff1e7;
}

.connection-status .nav-icon,
.header-logout .nav-icon,
.header-print-toggle .nav-icon {
  width: 17px;
  height: 17px;
}

.header-print-toggle {
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff7ee;
  font-size: 11px;
  font-weight: 900;
}

.header-print-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
}

.header-print-toggle.active {
  border-color: #0ea977;
  background: #0ea977;
  color: #f4fff9;
}

.header-logout {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: transparent;
  color: #fff7ee;
}

.header-logout:hover {
  background: rgba(255, 255, 255, 0.09);
}

.icon-status {
  min-width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #d7edd0;
  font-size: 11px;
  font-weight: 950;
}

.icon-status.neutral {
  color: #d9bfa8;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.content-wrap {
  width: auto;
  max-width: none;
  margin: 0;
  padding: 20px 24px 54px;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 22px;
}

.page-heading h1 {
  margin-bottom: 10px;
  font-size: 28px;
  line-height: 1.05;
  font-weight: 950;
}

.page-heading.compact h1 {
  font-size: 28px;
}

.dashboard-heading {
  align-items: center;
}

.dashboard-kicker {
  width: fit-content;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  padding: 0 13px;
  background: #416f3d;
  color: #fff7ee;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.dashboard-kicker .nav-icon {
  width: 16px;
  height: 16px;
}

.certificate-expiry-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid #e9c687;
  border-radius: 14px;
  background: #fff8e8;
  color: var(--brown-950);
}

.certificate-expiry-banner.notice {
  border-color: #c9c7ef;
  background: #f5f4ff;
}

.certificate-expiry-banner.warning {
  border-color: #e9c687;
  background: #fff8e8;
}

.certificate-expiry-banner.critical {
  border-color: #efaaaa;
  background: #fff0f0;
}

.certificate-expiry-banner strong,
.certificate-expiry-banner span {
  display: block;
}

.certificate-expiry-banner span {
  margin-top: 3px;
  font-size: 13px;
}

.certificate-expiry-date {
  flex: 0 0 auto;
  text-align: right;
}

.certificate-expiry-date span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.toolbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
  align-items: start;
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-main {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 16px;
}

.dashboard-side {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 16px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 14px;
}

.dashboard-kpi-row {
  margin-bottom: 16px;
}

.kpi-card,
.panel,
.mini-card {
  background: var(--panel);
  border: 1px solid var(--line);
}

.kpi-card {
  position: relative;
  min-height: 108px;
  overflow: hidden;
  padding: 15px 17px;
  border-color: #e4d6c8;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(53, 29, 18, 0.05);
}

.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--amber-600);
}

.kpi-card::after {
  content: none;
}

.kpi-card.success {
  background: #416f3d;
  border-color: #416f3d;
  color: #fffdf7;
}

.kpi-card.success::before {
  background: #8fbc82;
}

.kpi-card.cash {
  background: #fff8ec;
}

.kpi-card.margin {
  background: #fff1cb;
}

.kpi-card.warn {
  background: #e8f4dc;
}

.kpi-card.danger {
  background: #ffe9e6;
  border-color: #efb3ad;
}

.kpi-card:nth-child(5) {
  background: #edf6ef;
}

.kpi-card span,
.mini-card span {
  display: block;
  color: var(--brown-800);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.15;
  text-transform: uppercase;
}

.kpi-card strong {
  display: block;
  margin-top: 20px;
  font-size: 26px;
  line-height: 1;
}

.kpi-card.success span {
  color: rgba(255, 253, 247, 0.9);
}

.kpi-card.success strong,
.mini-card.success strong {
  color: inherit;
}

.kpi-card.warn strong,
.mini-card.warn strong {
  color: var(--amber-600);
}

.kpi-card.danger strong,
.mini-card.danger strong {
  color: var(--red-700);
}

.panel {
  padding: 16px;
  border-radius: 8px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.panel-head h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
  font-weight: 950;
}

.state-list {
  display: grid;
}

.state-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 38px;
  border-bottom: 1px solid #e7dcd1;
  color: var(--muted);
}

.state-row strong {
  color: var(--text);
  font-size: 16px;
}

.state-row.warning strong {
  color: var(--amber-600);
}

.state-row.danger strong {
  color: var(--red-700);
}

.payment-list {
  display: grid;
  gap: 14px;
  max-width: none;
}

.payment-row {
  display: grid;
  gap: 10px;
}

.payment-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  font-size: 15px;
}

.payment-row-head strong {
  font-size: 16px;
}

.track {
  height: 9px;
  overflow: hidden;
  background: #e3ddd7;
  border-radius: 999px;
}

.fill {
  height: 100%;
  background: var(--green-600);
  border-radius: inherit;
}

.fill.cash {
  background: var(--amber-600);
}

.fill.card {
  background: #766f69;
}

.fill.transfer {
  background: var(--brown-900);
}

.alert-list,
.compact-list,
.conversion-list,
.product-list,
.arqueo-list {
  display: grid;
  gap: 14px;
}

.alert-item,
.compact-item,
.conversion-item,
.product-line,
.arqueo-row {
  border: 1px solid #e4d5c8;
  background: #fffaf4;
}

.alert-item {
  padding: 15px 16px;
}

.alert-item.critical {
  border-color: #f0b5b5;
  background: #fff0f0;
}

.alert-item.warn {
  border-color: #efc99b;
  background: #fff8ee;
}

.alert-item strong,
.compact-item strong {
  display: block;
}

.alert-item span,
.compact-item span,
.conversion-item span,
.product-line span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.bottom-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
}

.compact-item,
.product-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 15px;
}

.recent-panel {
  min-height: 0;
}

.recent-panel .table-wrap {
  min-width: 0;
}

.recent-panel table {
  min-width: 700px;
  table-layout: fixed;
}

.recent-panel th,
.recent-panel td {
  padding: 10px 8px;
}

.recent-panel th:nth-child(1) { width: 82px; }
.recent-panel th:nth-child(2) { width: 120px; }
.recent-panel th:nth-child(3) { width: 190px; }
.recent-panel th:nth-child(4) { width: 120px; }
.recent-panel th:nth-child(5) { width: 88px; }
.recent-panel th:nth-child(6) { width: 132px; }

.recent-operation {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.recent-document {
  color: var(--brown-800);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.dashboard-preview-panel {
  min-width: 0;
}

.dashboard-preview-panel .compact-list {
  gap: 10px;
}

.dashboard-preview-panel .compact-item {
  min-height: 68px;
}

.expiry-item.critical {
  border-color: #f0b5b5;
  background: #fff0f0;
}

.expiry-item.warn {
  border-color: #efc99b;
  background: #fff8ee;
}

.dashboard-detail-modal-card {
  width: min(920px, calc(100vw - 40px));
}

.dashboard-detail-list {
  display: grid;
  gap: 10px;
  max-height: min(58vh, 560px);
  padding: 0 20px 18px;
  overflow: auto;
}

.dashboard-detail-list > .muted {
  margin: 0;
  padding: 18px 0;
  text-align: center;
}

.dashboard-detail-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
  padding: 12px 14px;
  border: 1px solid #e4d5c8;
  background: #fffaf4;
}

.dashboard-detail-item.critical {
  border-color: #f0b5b5;
  background: #fff0f0;
}

.dashboard-detail-item.warn {
  border-color: #efc99b;
  background: #fff8ee;
}

.dashboard-detail-item > div:first-child {
  min-width: 0;
}

.dashboard-detail-item strong,
.dashboard-detail-item span {
  display: block;
}

.dashboard-detail-item > div:first-child > span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.dashboard-detail-value {
  flex: 0 0 auto;
  color: var(--brown-950);
  text-align: right;
}

.dashboard-detail-side {
  display: grid;
  flex: 0 0 auto;
  justify-items: end;
  gap: 6px;
}

.dashboard-detail-side .badge {
  width: max-content;
}

.dashboard-detail-footer {
  display: flex;
  justify-content: center;
  padding: 0 20px 22px;
}

.dashboard-detail-footer .muted {
  margin: 0;
}

.settings-alerts-panel {
  margin-bottom: 0;
}

.settings-overview {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.settings-overview-card {
  min-height: 118px;
  display: grid;
  align-content: space-between;
  gap: 7px;
  padding: 16px;
  border: 1px solid #e2d4c7;
  background: #fffdfb;
  color: var(--brown-900);
  text-align: left;
  cursor: pointer;
}

.settings-overview-card:hover,
.settings-overview-card.active {
  border-color: #8a5b35;
  background: #fff8f0;
}

.settings-overview-card span,
.settings-overview-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.settings-overview-card strong {
  color: var(--brown-850);
  font-size: 24px;
  line-height: 1;
}

.settings-section-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
  padding: 7px;
  border: 1px solid #eaded3;
  background: #fffdfb;
  overflow-x: auto;
}

.settings-section-tabs button {
  min-height: 42px;
  flex: 0 0 auto;
  padding: 0 15px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--brown-850);
  font-weight: 900;
  cursor: pointer;
}

.settings-section-tabs button:hover,
.settings-section-tabs button.active {
  border-color: #765139;
  background: var(--brown-850);
  color: #fffaf5;
}

.settings-section-panel {
  display: grid;
  gap: 16px;
}

.company-settings-panel {
  margin-bottom: 0;
}

.company-settings-layout {
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(300px, 0.8fr);
  gap: 22px;
  padding: 0 22px 22px;
}

.company-settings-fields {
  display: grid;
  gap: 14px;
}

.company-settings-fields > label,
.company-settings-grid label {
  display: grid;
  gap: 6px;
  color: var(--brown-850);
  font-size: 13px;
  font-weight: 900;
}

.company-settings-fields textarea {
  min-height: 96px;
  resize: vertical;
}

.company-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.company-settings-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 44px;
}

.company-settings-actions .muted {
  margin: 0;
  font-size: 12px;
}

.company-receipt-preview {
  min-width: 0;
  padding: 16px;
  border: 1px solid #eaded3;
  background: #fffdfb;
}

.company-receipt-preview h3 {
  margin: 0 0 12px;
  color: var(--brown-850);
}

.company-receipt-preview pre {
  max-width: 100%;
  margin: 0;
  overflow-x: auto;
  padding: 14px;
  border: 1px solid #e2d4c7;
  background: #fff;
  color: #111;
  font: 700 12px/1.45 "Courier New", monospace;
  white-space: pre-wrap;
}

.print-driver-token {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid #cbe6d7;
  background: #edf8f1;
}

.print-driver-token p {
  margin: 6px 0 10px;
  font-size: 13px;
}

.print-driver-token-row {
  display: flex;
  gap: 10px;
}

.print-driver-token-row input {
  min-width: 0;
  flex: 1;
  font-family: Consolas, monospace;
}

.print-driver-bind-btn {
  flex: 0 0 auto;
}

.market-driver-link-entry {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfb;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.market-driver-link-entry:hover {
  border-color: var(--brown-500);
  background: #fff8ee;
}

.market-driver-link-entry:focus-visible {
  outline: 3px solid rgba(180, 104, 35, 0.28);
  outline-offset: 2px;
}

.market-driver-link-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 6px;
  background: var(--brown-100);
  color: var(--brown-800);
}

.market-driver-link-icon .nav-icon {
  width: 21px;
  height: 21px;
}

.market-driver-link-copy strong,
.market-driver-link-copy small {
  display: block;
}

.market-driver-link-copy strong {
  font-size: 17px;
}

.market-driver-link-copy small {
  margin-top: 4px;
  color: var(--ink-muted);
  font-size: 14px;
}

.market-driver-link-arrow {
  color: var(--brown-700);
  font-size: 32px;
  line-height: 1;
}

.market-print-driver-modal-card {
  width: min(1120px, calc(100vw - 40px));
}

.market-print-driver-modal-body {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  padding: 20px 22px;
}

.market-print-driver-new-form,
.market-print-driver-server-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfb;
}

.market-print-driver-new-form {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 20px;
}

.market-print-driver-new-form h3 {
  margin: 0;
  font-size: 21px;
}

.market-print-driver-new-form .muted {
  margin: -7px 0 2px;
}

.market-print-driver-generate {
  width: 100%;
  min-height: 44px;
}

.market-print-driver-help {
  margin: 0;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.45;
}

.market-print-driver-status-column {
  min-width: 0;
}

.market-print-driver-server-card {
  display: grid;
  gap: 6px;
  padding: 16px;
}

.market-print-driver-server-card span {
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.market-print-driver-server-card strong {
  overflow-wrap: anywhere;
}

.market-print-driver-status-column .print-driver-token {
  margin: 14px 0;
}

.market-print-driver-status-column .print-driver-token textarea {
  width: 100%;
  min-height: 78px;
  resize: vertical;
  font-family: Consolas, monospace;
}

.market-print-driver-token-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 10px;
}

.market-print-driver-modal-actions {
  padding: 0 22px 20px;
}

.print-driver-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 8px;
}

.print-driver-list {
  display: grid;
  gap: 8px;
}

.print-driver-row {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(220px, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid #eaded3;
  background: #fffdfb;
}

.print-driver-row strong,
.print-driver-row span {
  display: block;
}

.print-driver-row .muted {
  margin-top: 5px;
  font-size: 12px;
}

.market-print-settings-form {
  display: grid;
  gap: 14px;
  margin: 4px 0 18px;
  padding: 16px 0 18px;
  border-bottom: 1px solid #eaded3;
}

.market-print-settings-head,
.market-print-agent-actions,
.market-print-settings-actions,
.market-print-auto-option {
  display: flex;
  align-items: center;
  gap: 12px;
}

.market-print-settings-head {
  justify-content: space-between;
}

.market-print-settings-head strong {
  color: var(--brown-850);
}

.market-print-settings-head .muted {
  margin: 4px 0 0;
  font-size: 13px;
}

.market-print-agent-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.market-print-auto-option {
  align-items: flex-start;
  padding: 12px 0;
  border-top: 1px solid #f0e7df;
  border-bottom: 1px solid #f0e7df;
  cursor: pointer;
}

.market-print-auto-option input {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--green-700);
}

.market-print-auto-option span {
  display: grid;
  gap: 3px;
}

.market-print-auto-option strong {
  color: var(--brown-850);
}

.market-print-auto-option small {
  color: var(--muted);
  font-size: 12px;
}

.market-print-config-grid {
  display: grid;
  grid-template-columns: minmax(180px, 230px) minmax(240px, 1fr) minmax(240px, 1fr);
  gap: 14px;
}

.market-print-config-grid label {
  display: grid;
  gap: 6px;
  color: var(--brown-850);
  font-size: 13px;
  font-weight: 900;
}

.market-print-config-grid label small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.market-print-settings-actions {
  align-items: center;
  flex-wrap: wrap;
}

.market-print-settings-actions .muted {
  margin: 0;
  font-size: 12px;
}

.alert-settings-form {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(180px, 260px) minmax(220px, 1fr);
  align-items: end;
  gap: 14px;
}

.alert-settings-form label {
  display: grid;
  gap: 6px;
  color: var(--brown-850);
  font-size: 13px;
  font-weight: 900;
}

.alert-settings-form label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.alert-settings-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}

.alert-settings-actions .muted {
  margin: 0;
  font-size: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 12px;
  background: var(--green-100);
  color: var(--green-700);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-pill.neutral {
  background: #eee8e2;
  color: var(--brown-700);
}

.status-pill.danger {
  background: var(--red-100);
  color: var(--red-700);
}

.status-pill.warn {
  background: #fff1df;
  color: var(--amber-600);
}

.pos-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  min-height: calc(100vh - 58px - 34px);
}

.pos-catalog {
  padding: 20px 24px 62px;
}

.pos-meta {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
  margin-bottom: 14px;
  color: var(--brown-800);
}

.pos-search input {
  height: 46px;
  border-color: #f0d5b2;
  box-shadow: 0 0 0 3px rgba(182, 111, 50, 0.09);
  font-size: 14px;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 22px;
}

.chip {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  padding: 0 18px;
  font-weight: 850;
}

.chip.active {
  background: var(--brown-900);
  color: #fff4e6;
  border-color: var(--brown-900);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  gap: 14px;
}

.product-card {
  position: relative;
  width: 100%;
  min-height: 164px;
  display: grid;
  grid-template-rows: 112px minmax(52px, 1fr);
  align-content: start;
  overflow: hidden;
  padding: 0;
  background: #f8f2ea;
  border: 1px solid #e2d2c4;
  border-radius: 8px;
  color: var(--text);
  text-align: left;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.product-card:hover,
.product-card:focus-visible {
  border-color: var(--amber-600);
  box-shadow: 0 12px 30px rgba(53, 29, 18, 0.12);
  transform: translateY(-1px);
}

.product-card:active {
  transform: translateY(0);
}

.product-card.low {
  border-color: #e2a85f;
  background: #fffaf2;
}

.product-card.out {
  border-color: #e09797;
  background: #fff8f7;
}

.product-card h4 {
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 13px;
  line-height: 1.15;
}

.product-card-media {
  position: relative;
  grid-row: 1;
  width: auto;
  height: 102px;
  margin: 10px 10px 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 0;
  background: #fffdf8;
  color: var(--brown-700);
  font-size: 24px;
  font-weight: 950;
  z-index: 0;
}

.product-card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0;
  background: transparent;
}

.product-card-media.placeholder {
  background:
    linear-gradient(135deg, rgba(65, 111, 61, 0.14), rgba(202, 123, 49, 0.16)),
    #f7efe5;
  letter-spacing: 0.04em;
}

.product-card-chip,
.add-cue {
  display: none;
}

.product-card-price {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  padding: 4px 8px;
  background: rgba(72, 49, 41, 0.9);
  color: #fff7ed;
  border-radius: 4px;
  box-shadow: 0 8px 18px rgba(53, 29, 18, 0.12);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
}

.product-card-info {
  position: relative;
  grid-row: 2;
  z-index: 1;
  width: 100%;
  min-width: 0;
  padding: 8px 10px 10px;
  background: #fffdf9;
}

.product-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}

.stock-pill {
  max-width: 100%;
  overflow: hidden;
  padding: 3px 6px;
  background: #edf6ef;
  color: #2d622d;
  font-size: 9px;
  font-weight: 950;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.stock-pill.warn {
  background: #fff0d5;
  color: #a15f17;
}

.stock-pill.danger {
  background: #ffe1df;
  color: #b20d18;
}

.ticket-panel {
  position: sticky;
  top: 58px;
  height: calc(100vh - 58px - 34px);
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  background: #fffaf4;
  border-left: 1px solid var(--line);
}

.ticket-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px 12px;
  border-bottom: 1px solid var(--line);
}

.ticket-head h3 {
  margin: 0;
  font-size: 21px;
}

.ticket-tools {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}

.cart-items {
  padding: 10px 16px;
  overflow: auto;
}

.cart-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid #eaded3;
}

.cart-info {
  min-width: 0;
}

.cart-qty {
  width: 58px;
  min-height: 34px;
  padding: 6px 7px;
  text-align: center;
}

.cart-name {
  font-weight: 900;
  line-height: 1.25;
}

.cart-unit {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.cart-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.qty-stepper {
  display: grid;
  grid-template-columns: 34px 58px 34px;
  gap: 5px;
  align-items: center;
}

.qty-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: #fff8f0;
  color: var(--brown-950);
  font-size: 18px;
  font-weight: 950;
}

.cart-line-total {
  color: var(--brown-900);
  font-size: 15px;
}

.remove-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.ticket-total {
  display: grid;
  gap: 10px;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
}

.ticket-total div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.ticket-total .total-line {
  align-items: baseline;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.ticket-total .total-line strong {
  color: var(--brown-900);
  font-size: 27px;
}

.btn-charge {
  margin: 0 18px 18px;
  min-height: 48px;
  font-size: 18px;
}

.inventory-metrics,
.cash-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.cash-cards {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.mini-card {
  min-height: 84px;
  padding: 15px;
}

.mini-card strong {
  display: block;
  margin-top: 10px;
  font-size: 22px;
  line-height: 1.05;
}

.mini-card.expected {
  background: var(--amber-100);
  border-color: #b48b54;
}

.filter-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) repeat(3, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
}

/* Comprobantes follows the compact administrative rhythm used by Restobar. */
.documents-page .documents-heading {
  margin-bottom: 18px;
}

.documents-page .documents-heading h1 {
  font-size: 30px;
  line-height: 1.12;
}

.documents-page .documents-heading .muted {
  font-size: 14px;
}

.documents-refresh-btn,
.documents-apply-btn {
  min-height: 40px;
  padding: 0 16px;
  background: var(--green-700);
  border-color: var(--green-700);
  color: #fff;
  font-size: 14px;
}

.documents-refresh-btn:hover,
.documents-apply-btn:hover {
  background: #1f3d1f;
}

.documents-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.documents-summary-card {
  min-height: 112px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border: 1px solid #eaded3;
  border-radius: 8px;
  background: #fff;
}

.documents-summary-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.documents-summary-card strong {
  display: block;
  margin-top: 24px;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

.documents-summary-icon {
  width: 24px;
  height: 24px;
  color: var(--green-600);
}

.documents-summary-card.pending .documents-summary-icon {
  color: #1674a5;
}

.documents-summary-card.rejected .documents-summary-icon {
  color: var(--red-700);
}

.documents-summary-card.internal .documents-summary-icon {
  color: var(--brown-700);
}

.documents-panel {
  padding: 0;
  overflow: hidden;
  border-color: #eaded3;
  background: #fff;
}

.documents-filter-panel {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) 180px 155px 180px 165px 165px auto;
  align-items: end;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid #eaded3;
}

.documents-filter-panel label {
  display: grid;
  gap: 7px;
  color: var(--brown-800);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.documents-filter-panel input,
.documents-filter-panel select {
  min-height: 40px;
  padding: 8px 12px;
  background: #fff;
}

.documents-filter-actions {
  display: flex;
  gap: 8px;
}

.documents-filter-actions .btn {
  min-height: 40px;
  padding: 0 15px;
  font-size: 14px;
}

.documents-clear-btn {
  border-color: #e7ddd4;
  background: #f7f4ee;
  color: var(--text);
}

.documents-panel table {
  font-size: 14px;
}

.documents-panel th {
  padding: 13px 16px;
  background: #fffdf9;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.documents-panel td {
  padding: 13px 16px;
  border-color: #f0e8df;
}

.documents-panel tbody tr:hover {
  background: #fbf8f3;
}

.documents-action-cell {
  text-align: right;
}

.documents-resend-btn {
  min-height: 32px;
  padding: 0 12px;
  background: var(--brown-700);
  border-color: var(--brown-700);
  color: #fff;
  font-size: 12px;
}

.documents-resend-btn:hover {
  background: var(--brown-850);
}

.documents-no-action {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.inventory-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.inventory-table-panel {
  padding: 0;
  overflow: hidden;
}

.conversion-item {
  padding: 14px;
}

.conversion-item strong {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.count-control-panel {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(300px, 1.4fr) 180px;
  gap: 16px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.count-status-box {
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: var(--cream-100);
}

.count-status-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.count-search-panel {
  grid-template-columns: minmax(320px, 1fr) auto auto auto;
  align-items: end;
}

.count-table-panel {
  padding: 0;
}

.count-table th,
.count-table td {
  vertical-align: middle;
}

.count-history-cell {
  max-width: 280px;
  font-weight: 800;
}

.count-history-cell .calc-mul,
.count-calc-expression .calc-mul {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--amber-600);
}

.count-history-cell .calc-mul em,
.count-calc-expression .calc-mul em {
  color: var(--green-600);
  font-style: normal;
}

.calc-plus {
  color: var(--muted);
  margin: 0 5px;
}

.calc-pending {
  color: #f0a23f;
  margin-left: 5px;
}

.calc-invalid {
  color: var(--red-700);
}

.count-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.count-actions .subtle {
  color: var(--muted);
}

.count-product-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mobile-count-summary {
  display: none;
}

.code-chip,
.counted-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  background: var(--cream-100);
  color: var(--brown-700);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.code-chip.barcode {
  border-color: rgba(95, 113, 88, 0.35);
  background: #edf4e8;
  color: var(--green-700);
}

.code-chip.qr {
  border-color: rgba(180, 110, 60, 0.35);
  background: #fff0dd;
  color: var(--amber-700);
}

.code-chip.both {
  border-color: rgba(75, 52, 37, 0.35);
  background: #f5eadf;
  color: var(--brown-900);
}

.code-chip.missing {
  background: #f4f1ee;
  color: var(--muted);
}

.counted-chip {
  margin-top: 7px;
  border-color: rgba(95, 113, 88, 0.26);
  background: #eef7ec;
  color: var(--green-700);
}

body:not(.count-review-mode) .count-system-cell,
body:not(.count-review-mode) .count-diff-cell,
body:not(.count-review-mode) .count-table th:nth-child(3),
body:not(.count-review-mode) .count-table th:nth-child(5),
body:not(.count-review-mode) .count-metrics .warn {
  display: none;
}

.field-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.field-actions.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.field-action-btn {
  min-height: 34px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--brown-900);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.field-action-btn:hover {
  border-color: var(--amber-600);
}

.image-actions {
  align-items: stretch;
  grid-template-columns: minmax(0, 1fr) 120px;
}

.product-image-file {
  min-width: 0;
  padding: 7px;
  border: 1px dashed var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.product-image-box {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: stretch;
  gap: 14px;
  border: 1px solid #e4d5c8;
  background: #fffaf4;
  padding: 12px;
}

.product-image-preview {
  display: grid;
  place-items: center;
  min-height: 104px;
  border: 1px dashed #c9b7a8;
  background: #f8f2ec;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.product-image-preview img {
  display: block;
  width: 100%;
  height: 104px;
  object-fit: contain;
}

.product-info-body {
  padding: 20px 22px 22px;
}

.product-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.product-info-grid div {
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--cream-50);
}

.product-info-grid .full {
  grid-column: 1 / -1;
}

.product-info-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.product-info-grid strong {
  overflow-wrap: anywhere;
}

.count-calculator-card {
  width: min(620px, calc(100vw - 28px));
  background: #111;
  color: #fff;
  border-color: #111;
}

.count-calculator-card .modal-head {
  border-bottom: 1px solid #2c2c2c;
}

.count-calculator-card .muted {
  color: #b9b9b9;
}

.count-calculator-card .icon-button.dark {
  border-color: #3a3a3a;
  color: #fff;
  background: #222;
}

.count-calculator-body {
  display: grid;
  gap: 18px;
  padding: 18px 22px 22px;
}

.count-calculator-display {
  min-height: 170px;
  display: grid;
  align-content: end;
  gap: 12px;
  padding: 18px;
  border-radius: 8px;
  background: #050505;
}

.count-calc-history {
  display: grid;
  justify-items: end;
  gap: 5px;
  min-height: 44px;
  color: #8c8c8c;
  font-size: 16px;
  font-weight: 800;
}

.count-calc-expression {
  min-height: 48px;
  text-align: right;
  overflow-wrap: anywhere;
  font-size: 34px;
  font-weight: 950;
  line-height: 1.1;
}

.count-calc-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #d8d8d8;
  font-weight: 800;
}

.count-calc-total strong {
  color: #fff;
  font-size: 34px;
}

.count-keypad {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.count-keypad button {
  min-height: 66px;
  border: 0;
  border-radius: 8px;
  background: #252525;
  color: #fff;
  font-size: 24px;
  font-weight: 950;
}

.count-keypad button[data-count-key="+"],
.count-keypad button[data-count-key="x"] {
  color: #f0a23f;
}

.count-keypad .key-save {
  grid-column: 1 / -1;
  background: var(--amber-600);
}

.scanner-modal-card {
  width: min(620px, calc(100vw - 28px));
}

.scanner-box {
  position: relative;
  overflow: hidden;
  min-height: 360px;
  background: #111;
}

.scanner-box video {
  width: 100%;
  height: 360px;
  object-fit: cover;
  display: block;
}

.scanner-status {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  padding: 12px 14px;
  background: rgba(17, 17, 17, 0.82);
  color: #fff;
  font-weight: 800;
}

.kardex-list {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
}

.inventory-modal-card {
  width: min(820px, calc(100vw - 40px));
  max-height: 88vh;
  overflow: auto;
}

.movement-modal-card {
  width: min(900px, calc(100vw - 40px));
}

.modal-head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.conversion-modal-list,
.movement-modal-list {
  max-height: 62vh;
  overflow: auto;
  padding-right: 4px;
}

.kardex-item {
  display: grid;
  gap: 7px;
  padding: 12px 13px;
  border: 1px solid #e4d5c8;
  background: #fffaf4;
}

.kardex-item-head,
.kardex-item-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.kardex-item strong {
  font-size: 14px;
}

.kardex-item .in {
  color: var(--green-700);
}

.kardex-item .out {
  color: var(--red-700);
}

.row-action {
  min-height: 30px;
  border: 1px solid var(--line);
  background: #fff8f0;
  padding: 5px 9px;
  color: var(--brown-850);
  font-size: 12px;
  font-weight: 900;
}

.reports-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 22px;
  margin-bottom: 22px;
}

.reports-heading {
  align-items: flex-end;
}

.reports-eyebrow {
  display: block;
  margin-bottom: 6px;
  color: #087653;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .12em;
}

.reports-export-actions,
.admin-report-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}

.admin-report-filter-panel {
  margin-bottom: 18px;
}

.admin-report-filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 14px;
  align-items: end;
}

.admin-report-filter-grid label {
  display: grid;
  gap: 6px;
  color: var(--brown-850);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.admin-report-filter-grid input,
.admin-report-filter-grid select {
  min-width: 0;
}

.admin-report-filter-actions {
  margin-top: 16px;
}

.admin-report-filter-actions .muted {
  margin: 0;
}

.admin-report-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.admin-report-card {
  min-height: 104px;
  border: 1px solid #eaded3;
  border-radius: 10px;
  background: #fff;
  padding: 15px;
}

.admin-report-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.admin-report-card strong {
  display: block;
  margin-top: 16px;
  color: var(--brown-850);
  font-size: 22px;
}

.admin-report-card.primary { border-color: #276d4c; background: #1c6a45; }
.admin-report-card.primary span,
.admin-report-card.primary strong { color: #fff; }
.admin-report-card.cash { background: #eaf2f6; }
.admin-report-card.good { border-color: #a9ddc6; background: #edf9f2; }
.admin-report-card.good strong { color: #087653; }
.admin-report-card.warn { border-color: #efd69f; background: #fff8e8; }
.admin-report-card.danger { border-color: #e8b9b9; background: #fff1f1; }
.admin-report-card.danger strong { color: #a14040; }

.admin-report-results {
  margin-bottom: 28px;
}

.admin-report-empty {
  min-height: 230px;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--muted);
}

.admin-report-empty h3 {
  margin: 0;
  color: var(--brown-850);
}

.admin-report-empty p {
  max-width: 520px;
  margin: 8px 0 0;
}

.admin-report-readonly {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  background: #edf4f9;
  color: #3c657d;
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
}

.admin-report-table {
  max-height: 620px;
}

.reports-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin: 8px 0 14px;
}

.reports-section-heading h2 {
  margin: 0;
  color: var(--brown-850);
  font-size: 20px;
}

.reports-section-heading p {
  margin: 5px 0 0;
}

.table-wrap {
  overflow: auto;
}

.table-wrap.small table {
  min-width: 760px;
}

table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid #eaded3;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--brown-800);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 10px;
  background: #efe8e1;
  color: var(--brown-800);
  font-size: 12px;
  font-weight: 900;
}

.badge.good {
  background: var(--green-100);
  color: var(--green-700);
}

.badge.warn {
  background: #fff1df;
  color: var(--amber-600);
}

.badge.danger {
  background: var(--red-100);
  color: var(--red-700);
}

.cash-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(320px, 0.9fr);
  gap: 18px;
  margin-bottom: 18px;
}

.close-layout {
  align-items: start;
}

.date-box {
  text-align: right;
  color: var(--brown-800);
}

.date-box span {
  display: block;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.date-box strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
}

.arqueo-row {
  display: grid;
  grid-template-columns: 1fr 140px 170px 120px;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border-left: 0;
  border-right: 0;
  border-top: 0;
}

.arqueo-row input {
  min-height: 40px;
}

.close-method-panel .arqueo-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.close-method-card {
  display: grid;
  gap: 12px;
  min-height: 122px;
  padding: 24px 22px;
  border: 1px solid #cfe0f6;
  background: #edf5ff;
}

.close-method-card span {
  color: var(--brown-700);
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.close-method-card strong {
  color: #06110c;
  font-size: 27px;
}

.close-method-card small {
  color: var(--muted);
  font-weight: 800;
}

.close-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 20px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  text-transform: uppercase;
}

.close-total-row span {
  color: var(--brown-700);
  font-size: 14px;
  font-weight: 950;
}

.close-total-row strong {
  color: #075b35;
  font-size: 30px;
}

.close-balance-panel {
  display: grid;
  gap: 16px;
}

.close-formula {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.close-expected-box span {
  display: block;
  margin-bottom: 8px;
  color: var(--brown-700);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.close-expected-box strong {
  color: #075b35;
  font-size: 32px;
}

.counted-cash-label input {
  min-height: 68px;
  font-size: 25px;
  font-weight: 900;
}

.counted-cash-label input:placeholder-shown {
  color: var(--muted);
}

.close-diff {
  min-height: 44px;
  display: grid;
  place-items: center;
  background: var(--cream-100);
  color: var(--brown-700);
  font-weight: 950;
}

.close-bottom-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.42fr);
  gap: 22px;
  align-items: start;
}

.close-side-panel {
  display: grid;
  gap: 18px;
}

.digital-verification {
  display: grid;
  gap: 10px;
}

.digital-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--cream-100);
}

.digital-row span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.close-form-stack {
  display: grid;
  gap: 16px;
  align-items: stretch;
}

.print-checks {
  display: grid;
  gap: 10px;
}

.print-checks > span {
  color: var(--brown-700);
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.print-checks label {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #e4d5c8;
  background: var(--cream-100);
  color: var(--text);
  letter-spacing: 0;
  text-transform: none;
}

.print-checks input {
  width: auto;
  min-height: auto;
}

.close-confirm-modal {
  z-index: 70;
}

.close-confirm-card {
  border-radius: 8px;
}

.close-confirm-card .icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--brown-800);
  font-size: 18px;
  font-weight: 900;
}

.close-confirm-body {
  display: grid;
  gap: 10px;
  padding: 18px 22px;
}

.close-confirm-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--cream-100);
}

.close-confirm-option input {
  width: 18px;
  height: 18px;
  min-height: auto;
  margin-top: 3px;
  accent-color: var(--brown-700);
}

.close-confirm-option strong,
.close-confirm-option small {
  display: block;
}

.close-confirm-option small {
  margin-top: 3px;
  color: var(--muted);
}

.close-history-panel {
  margin-bottom: 32px;
}

.shift-history-list {
  display: grid;
  gap: 12px;
}

.shift-history-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid #e4d5c8;
  background: #fffaf4;
}

.shift-history-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.shift-history-actions {
  display: flex;
  gap: 8px;
}

.shift-history-actions button {
  min-height: 34px;
  border: 0;
  background: var(--cream-100);
  padding: 7px 13px;
  font-weight: 950;
}

.open-form {
  margin-top: 22px;
}

.replenishment-panel,
.movements-panel,
.quick-move-panel {
  margin-bottom: 22px;
}

.cash-actions {
  justify-content: flex-end;
  margin: 26px 0 22px;
}

.close-form {
  align-items: center;
}

.close-form input {
  width: 180px;
}

.quick-move-form {
  align-items: end;
}

.quick-move-form select,
.quick-move-form input {
  max-width: 260px;
}

.module-placeholder {
  min-height: 220px;
  display: grid;
  align-content: center;
  gap: 14px;
}

.module-placeholder h3 {
  margin-bottom: 0;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(420px, 520px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.settings-user-editor,
.settings-users-table {
  min-height: 560px;
}

.settings-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 220px;
  gap: 12px;
  padding: 0 0 14px;
}

.settings-user-editor .panel-head,
.settings-users-table .panel-head {
  min-height: 72px;
}

.inline-user-form {
  display: grid;
  gap: 16px;
  padding: 0 22px 22px;
}

.inline-user-form label {
  display: grid;
  gap: 8px;
}

.users-config-table table {
  table-layout: fixed;
}

.users-config-table th:nth-child(1),
.users-config-table td:nth-child(1) {
  width: 34%;
}

.users-config-table th:nth-child(2),
.users-config-table td:nth-child(2) {
  width: 22%;
}

.users-config-table th:nth-child(3),
.users-config-table td:nth-child(3) {
  width: 18%;
}

.users-config-table th:nth-child(4),
.users-config-table td:nth-child(4) {
  width: 26%;
  text-align: right;
}

.settings-note {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  background: #fff8f0;
}

.settings-note strong {
  color: var(--brown-900);
}

.settings-note span {
  color: var(--muted);
  line-height: 1.35;
}

.danger-link {
  color: var(--red-700);
}

.danger-link:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.user-modal-card {
  width: min(1040px, calc(100vw - 36px));
}

.user-form {
  display: grid;
  gap: 18px;
  padding: 18px 22px 22px;
}

.user-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.switch-row {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #fff8f0;
  font-weight: 900;
}

.switch-row input {
  width: auto;
  min-height: auto;
}

.permissions-editor {
  border: 1px solid var(--line);
  background: #fffdf9;
  min-height: 300px;
}

.panel-head.inline {
  border-bottom: 1px solid var(--line);
}

.permission-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 14px;
  max-height: 360px;
  overflow-y: auto;
}

.permission-group {
  border: 1px solid #eaded3;
  background: #fffaf4;
}

.permission-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 13px;
  border-bottom: 1px solid #eaded3;
}

.permission-group-head span {
  color: var(--brown-800);
  font-weight: 950;
}

.permission-checks {
  display: grid;
  gap: 8px;
  padding: 12px 13px;
}

.permission-checks label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 30px;
  padding: 9px 10px;
  border-radius: 6px;
  background: #f7fbf5;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.permission-checks input {
  width: auto;
  min-height: auto;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.inline-user-form .modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.product-line strong:last-child,
.compact-item strong:last-child {
  white-space: nowrap;
}

.stock-ok {
  color: var(--green-700);
  font-weight: 950;
}

.stock-low {
  color: var(--amber-600);
  font-weight: 950;
}

.stock-out {
  color: var(--red-700);
  font-weight: 950;
}

.app-footer {
  position: fixed;
  left: 274px;
  right: 0;
  bottom: 0;
  z-index: 12;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: #f4eee8;
  border-top: 1px solid var(--line);
  color: var(--brown-800);
  font-size: 13px;
}

.app-footer span:nth-last-child(-n + 2) {
  margin-left: auto;
}

.app-footer span:last-child {
  margin-left: 0;
}

.toast {
  position: fixed;
  top: 78px;
  right: 24px;
  z-index: 30;
  max-width: 380px;
  padding: 14px 18px;
  background: var(--brown-950);
  color: #fff7ef;
  box-shadow: var(--shadow);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(44, 23, 13, 0.48);
}

.modal-card {
  width: min(980px, 100%);
  max-height: min(820px, calc(100vh - 44px));
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 24px 70px rgba(44, 23, 13, 0.28);
}

.compact-modal {
  width: min(560px, 100%);
}

.document-detail-modal-card {
  width: min(1180px, calc(100vw - 40px));
}

.document-detail-body {
  padding: 18px 20px 22px;
}

.document-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
  gap: 18px;
}

.document-detail-main,
.document-ticket-panel {
  min-width: 0;
}

.document-ticket-panel {
  padding: 16px;
  background: #fffaf4;
  border: 1px solid var(--line);
}

.document-ticket-panel h3,
.document-detail-section h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.document-ticket-panel pre {
  max-height: 460px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  color: #1f1711;
  font: bold 12px/1.35 "Courier New", monospace;
  white-space: pre;
}

.document-detail-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.document-detail-summary > div,
.document-detail-section {
  padding: 12px;
  border: 1px solid var(--line);
  background: #fffdfa;
}

.document-detail-summary span,
.document-detail-line span,
.document-total-row span,
.document-audit-row small {
  color: var(--muted);
}

.document-detail-summary span {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.document-detail-summary strong {
  display: block;
  overflow-wrap: anywhere;
}

.document-detail-section + .document-detail-section {
  margin-top: 12px;
}

.document-detail-line,
.document-total-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-top: 1px solid #eee3d9;
}

.document-detail-line strong,
.document-total-row strong {
  flex: 0 0 auto;
}

.document-total-row.total {
  margin-top: 4px;
  font-size: 17px;
  font-weight: 900;
}

.document-detail-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.document-detail-actions .btn {
  justify-content: center;
}

.document-audit-list {
  display: grid;
  gap: 8px;
}

.document-audit-row {
  display: grid;
  gap: 3px;
  padding: 9px 0;
  border-top: 1px solid #eee3d9;
}

.document-audit-row span,
.document-audit-row small {
  font-size: 12px;
}

.document-change-help {
  margin: -2px 0 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  font-size: 25px;
}

.icon-button.dark {
  border-color: var(--line);
  color: var(--brown-950);
}

.payment-modal-card {
  width: min(1080px, 100%);
}

.payment-modal-pro {
  background: #fffaf4;
}

.payment-modal-head {
  padding: 18px 22px;
  background: #fffdf9;
}

.payment-modal-head .muted {
  margin: 5px 0 0;
  font-weight: 800;
}

.payment-modal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 16px;
  padding: 16px 18px 18px;
}

.payment-detail,
.payment-form,
.payment-total-box,
.payment-block {
  background: #fffdf9;
  border: 1px solid #e4d5c8;
}

.payment-ticket-preview {
  display: grid;
  align-content: start;
  min-height: 520px;
  overflow: hidden;
}

.payment-ticket-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--brown-800);
  font-weight: 900;
}

.payment-ticket-title strong {
  color: var(--green-700);
  font-size: 22px;
}

.payment-lines {
  max-height: 410px;
}

.compact-table table {
  min-width: 560px;
}

.payment-form-pro {
  display: grid;
  gap: 10px;
  padding: 0;
  background: transparent;
  border: 0;
}

.payment-block {
  display: grid;
  gap: 10px;
  padding: 13px;
}

.payment-block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.payment-block-head span {
  font-weight: 950;
}

.payment-block-head small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: right;
}

.payment-total-row,
.payment-total-box {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.payment-total-row {
  padding: 16px;
  border-top: 1px solid var(--line);
  color: var(--brown-800);
}

.payment-total-row strong,
.payment-total-box strong {
  color: var(--green-700);
  font-size: 27px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--brown-700);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.segmented,
.payment-methods,
.payment-input-grid,
.mixed-payments,
.invoice-fields {
  display: grid;
  gap: 8px;
}

.segmented {
  grid-template-columns: repeat(3, 1fr);
}

.payment-methods {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.segment,
.pay-method {
  min-height: 40px;
  border: 1px solid var(--line);
  background: #fffdf9;
  color: var(--brown-850);
  font-weight: 900;
}

.pay-method.wide {
  grid-column: 1 / -1;
}

.segment.active,
.pay-method.active {
  background: var(--green-700);
  border-color: var(--green-700);
  color: #fff8ef;
}

.payment-input-grid,
.mixed-payments {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.invoice-fields {
  grid-template-columns: 1fr;
}

.payment-cash-fields {
  margin-top: 2px;
}

.payment-cash-fields input[readonly] {
  color: var(--green-700);
  font-weight: 950;
}

.payment-cash-fields input.danger {
  color: var(--red-700);
}

.mixed-payments {
  margin-top: 2px;
}

.mixed-summary {
  grid-column: 1 / -1;
  margin: 0;
  padding: 10px 12px;
  background: #fff1df;
  color: var(--amber-600);
  font-weight: 950;
  text-align: center;
}

.mixed-summary.ok {
  background: var(--green-100);
  color: var(--green-700);
}

.mixed-summary.warn {
  background: var(--red-100);
  color: var(--red-700);
}

.payment-confirm {
  min-height: 48px;
  font-size: 16px;
}

.mixed-payment-modal {
  z-index: 1200;
}

.mixed-payment-modal-card {
  width: min(780px, calc(100vw - 32px));
}

.mixed-payment-body {
  display: grid;
  gap: 14px;
  padding: 20px 28px 22px;
}

.mixed-payment-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: #fffaf4;
}

.mixed-payment-total span {
  color: var(--brown-700);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mixed-payment-total strong {
  color: var(--brown-950);
  font-size: 28px;
}

.mixed-payment-rows {
  display: grid;
  gap: 12px;
}

.mixed-payment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 200px) 42px;
  align-items: end;
  gap: 10px;
}

.mixed-payment-row label {
  display: grid;
  gap: 6px;
  color: var(--brown-700);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mixed-payment-row .icon-button {
  min-height: 42px;
}

.add-mixed-method {
  min-height: 46px;
  border: 1px dashed #d9bda6;
  background: #fffdf9;
  color: var(--brown-700);
  font-weight: 900;
}

.add-mixed-method:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.mixed-payment-summary {
  margin: 0;
  padding: 13px 15px;
  background: var(--red-100);
  color: var(--red-700);
  font-weight: 950;
}

.mixed-payment-summary.ok {
  background: var(--green-100);
  color: var(--green-700);
}

.mixed-payment-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px 28px 24px;
  border-top: 1px solid var(--line);
}

.mixed-payment-actions .btn {
  min-height: 48px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.check-grid label,
.checkline {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #fffdf9;
  color: var(--brown-800);
  letter-spacing: 0;
  text-transform: none;
}

.check-grid input,
.checkline input {
  width: auto;
  min-height: auto;
}

.product-admin-layout,
.purchase-layout,
.records-layout {
  display: grid;
  gap: 18px;
}

.product-admin-layout {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
}

.product-admin-full {
  grid-template-columns: minmax(0, 1fr);
}

.purchase-layout {
  grid-template-columns: minmax(0, 1.35fr) minmax(310px, 0.75fr);
}

.purchase-main-full {
  grid-template-columns: minmax(0, 1fr);
}

.records-layout {
  grid-template-columns: minmax(0, 1fr) 360px;
}

.records-action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.records-action-card {
  min-height: 108px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  background: #fffdf9;
  color: var(--brown-950);
  text-align: left;
}

.records-action-card strong,
.records-action-card span,
.records-action-card small {
  display: block;
}

.records-action-card strong {
  font-size: 18px;
}

.records-action-card span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.records-action-card small {
  margin-top: 12px;
  padding: 6px 8px;
  background: #f3ece4;
  color: var(--brown-800);
  font-size: 12px;
  font-weight: 900;
}

.records-action-card.income {
  border-left: 5px solid var(--green-700);
}

.records-action-card.expense {
  border-left: 5px solid var(--red-700);
}

.records-action-card.payable {
  border-left: 5px solid var(--amber-600);
}

.records-action-card.receivable {
  border-left: 5px solid #607c5a;
}

.credit-mini {
  border-left: 5px solid var(--green-700);
}

.credit-mini.warn {
  border-left-color: var(--amber-600);
}

.credit-mini.danger {
  border-left-color: var(--red-700);
}

.credit-mini.neutral {
  border-left-color: #8b796d;
}

.credit-modal-card {
  width: min(1180px, 100%);
}

.credit-modal-body {
  display: grid;
  gap: 16px;
  padding: 18px 22px 22px;
}

.credit-filter-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px 160px 160px 120px;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fffaf4;
}

.credit-summary-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.credit-summary-strip div {
  padding: 12px;
  border: 1px solid var(--line);
  background: #fffdf9;
}

.credit-summary-strip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.credit-summary-strip strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}

.credit-summary-strip .warn {
  border-color: #e3b16b;
  background: #fff8ee;
}

.credit-summary-strip .danger {
  border-color: #e1a09a;
  background: #fff5f3;
}

.credit-summary-strip p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
}

.credit-list {
  display: grid;
  gap: 12px;
}

.credit-card {
  display: grid;
  gap: 14px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-left: 5px solid #8b796d;
  background: #fffdf9;
}

.credit-card.warn {
  border-left-color: var(--amber-600);
  background: #fff8ee;
}

.credit-card.danger {
  border-left-color: var(--red-700);
  background: #fff5f3;
}

.credit-card-main,
.credit-payment-row {
  display: grid;
  gap: 12px;
}

.credit-card-main {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.credit-card h3 {
  margin: 0;
  font-size: 18px;
}

.credit-card p,
.credit-card span {
  margin: 5px 0 0;
  color: var(--muted);
}

.credit-amount {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.credit-amount strong {
  font-size: 22px;
}

.credit-payment-row {
  grid-template-columns: 150px 160px minmax(220px, 1fr) auto;
  align-items: end;
  padding-top: 12px;
  border-top: 1px solid #eaded3;
}

.empty-state {
  display: grid;
  gap: 6px;
  padding: 24px;
  border: 1px dashed var(--line);
  background: #fffaf4;
  color: var(--brown-850);
}

.empty-state span {
  color: var(--muted);
}

.compact-filter {
  grid-template-columns: minmax(260px, 1fr) 180px;
}

.product-admin-table,
.product-editor-panel,
.purchase-main,
.supplier-panel {
  align-self: start;
}

.product-editor-panel {
  position: sticky;
  top: 76px;
}

.product-modal-card {
  width: min(920px, 100%);
}

.product-modal-form {
  padding: 20px 22px 22px;
}

.conversion-preview {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--green-700);
  background: #f7fbf3;
  color: var(--brown-800);
  font-size: 13px;
}

.conversion-preview span {
  display: block;
  color: var(--muted);
}

.purchase-item-adder {
  display: grid;
  grid-template-columns: minmax(250px, 1.35fr) minmax(82px, 0.42fr) minmax(135px, 0.62fr) minmax(118px, 0.52fr) minmax(112px, 0.5fr) minmax(110px, 0.5fr) minmax(128px, 0.58fr) auto;
  gap: 10px;
  align-items: end;
}

.purchase-selection-hint {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  background: #fffaf4;
  font-size: 13px;
}

.purchase-selection-hint.active {
  border-style: solid;
  border-left: 5px solid var(--green-700);
  background: #f7fbf3;
  color: var(--brown-800);
}

.purchase-selection-hint.danger-hint {
  border-left-color: var(--danger);
  background: #fff1f1;
  color: #8d1010;
}

.purchase-selection-hint strong,
.purchase-selection-hint span {
  display: block;
}

.purchase-selection-hint span {
  margin-top: 4px;
  color: var(--muted);
}

.purchase-items-section {
  margin-top: 4px;
  padding-top: 18px;
  border-top: 6px solid var(--green-700);
}

.section-divider-title {
  margin-bottom: 10px;
  color: var(--brown-700);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.purchase-totals {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.purchase-totals div {
  padding: 12px;
  border: 1px solid var(--line);
  background: #fff8f0;
}

.purchase-totals span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.purchase-totals strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.supplier-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.supplier-item {
  width: 100%;
  border: 1px solid var(--line);
  background: #fffdf9;
  padding: 12px;
  text-align: left;
}

.supplier-item span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.supplier-item.inactive {
  opacity: 0.55;
}

.supplier-modal-card {
  width: min(1100px, 100%);
}

.supplier-modal-body {
  display: grid;
  gap: 16px;
  padding: 18px 20px 22px;
}

.transfer-modal-card {
  width: min(720px, 100%);
}

.transfer-form {
  padding: 18px 20px 22px;
}

.mobile-only-action {
  display: none;
}

body.mobile-inventory-mode .mobile-only-action {
  display: inline-flex;
}

.mobile-product-modal-card {
  width: min(760px, 100%);
}

.mobile-product-tools {
  padding: 0 20px 12px;
}

.mobile-products-list {
  display: grid;
  gap: 10px;
  max-height: 68vh;
  overflow: auto;
  padding: 0 20px 20px;
}

.mobile-product-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.mobile-product-thumb {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f7efe5;
  color: var(--brown-700);
  font-weight: 950;
}

.mobile-product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mobile-product-item strong,
.mobile-product-item span {
  display: block;
}

.mobile-product-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.mobile-product-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.supplier-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.supplier-list-pro {
  max-height: 430px;
  overflow: auto;
  padding-right: 4px;
}

.supplier-card {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(240px, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.supplier-products {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  background: #fff8f0;
  color: var(--brown-800);
  font-size: 12px;
  font-weight: 800;
}

.supplier-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.supplier-editor-box {
  border: 1px solid var(--line);
  background: #fffdf9;
  padding: 16px;
}

.market-credit-calendar-panel {
  padding: 22px;
}

.market-calendar-toolbar,
.market-calendar-nav,
.market-calendar-heading,
.market-calendar-jump span,
.market-calendar-summary {
  display: flex;
  align-items: center;
}

.market-calendar-toolbar {
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.market-calendar-nav,
.market-calendar-summary {
  gap: 8px;
}

.market-calendar-jump {
  display: grid;
  gap: 5px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

.market-calendar-jump span {
  gap: 8px;
}

.market-calendar-jump input {
  min-width: 150px;
}

.market-calendar-heading {
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
}

.market-calendar-heading .eyebrow {
  margin: 0 0 4px;
}

.market-calendar-heading h2 {
  margin: 0;
  text-transform: capitalize;
}

.market-calendar-summary span {
  display: grid;
  gap: 2px;
  min-width: 145px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  background: #fffdf9;
}

.market-calendar-summary small {
  color: var(--muted);
  font-weight: 700;
}

.market-calendar-summary strong {
  font-size: 17px;
}

.market-calendar-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
}

.market-calendar-weekdays,
.market-credit-calendar-grid {
  min-width: 910px;
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 9px;
}

.market-calendar-weekdays {
  margin-bottom: 8px;
}

.market-calendar-weekdays span {
  padding: 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.market-credit-calendar-grid.view-day {
  grid-template-columns: minmax(300px, 1fr);
  min-width: 0;
}

.market-credit-calendar-day {
  min-height: 162px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 13px;
  color: var(--ink);
  text-align: left;
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.market-credit-calendar-day:hover,
.market-credit-calendar-day:focus-visible {
  border-color: var(--brown-700);
  box-shadow: 0 0 0 3px rgba(109, 70, 45, .12);
  outline: none;
}

.market-credit-calendar-day.today {
  border: 2px solid var(--brown-700);
  background: #fff7ed;
}

.market-credit-calendar-day.outside-month {
  opacity: .58;
}

.market-credit-calendar-day.has-items {
  background: #fffaf4;
}

.market-calendar-day-label,
.market-calendar-day-count,
.market-calendar-amount {
  font-size: 12px;
}

.market-calendar-day-label {
  color: var(--muted);
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.market-credit-calendar-day > strong {
  font-size: 27px;
  line-height: 1;
}

.market-calendar-day-count {
  min-height: 18px;
  color: var(--muted);
  font-weight: 700;
}

.market-calendar-amount {
  font-weight: 700;
}

.market-calendar-amount.payable { color: #9a5900; }
.market-calendar-amount.receivable { color: var(--green-700); }

.calendar-day-modal-card {
  width: min(760px, calc(100vw - 32px));
}

.calendar-day-detail {
  display: grid;
  gap: 12px;
  padding: 18px 22px 22px;
}

.calendar-detail-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid #8b796d;
  background: #fffdf9;
}

.calendar-detail-item.payable { border-left-color: var(--amber-600); }
.calendar-detail-item.receivable { border-left-color: var(--green-700); }
.calendar-detail-item h3,
.calendar-detail-item p { margin: 7px 0 0; }
.calendar-detail-item p,
.calendar-detail-item small { color: var(--muted); }
.calendar-detail-item > div:last-child { display: grid; justify-items: end; align-content: start; gap: 7px; }
.calendar-detail-item > div:last-child strong { font-size: 18px; }

.danger-text {
  color: var(--red-700) !important;
}

.success-text {
  color: var(--green-700) !important;
}

.arqueo-header {
  display: grid;
  grid-template-columns: 1fr 140px 170px 120px;
  gap: 16px;
  padding: 0 18px 10px;
  color: var(--brown-700);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.mobile-inventory-mode {
  background: var(--cream-50);
  overflow-x: hidden;
}

body.mobile-inventory-mode .sidebar,
body.mobile-inventory-mode .topbar,
body.mobile-inventory-mode .app-footer,
body.mobile-inventory-mode .page:not([data-page-panel="physical-inventory"]) {
  display: none !important;
}

body.mobile-inventory-mode .shell,
body.mobile-inventory-mode .workspace {
  display: block;
  min-height: 100dvh;
  padding-bottom: 0;
}

body.mobile-inventory-mode .content-wrap {
  width: 100%;
  margin: 0;
  padding: 10px 12px 22px;
}

body.mobile-inventory-mode .page-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

body.mobile-inventory-mode .page-heading h1 {
  font-size: 22px;
}

body.mobile-inventory-mode .page-heading p {
  display: none;
}

body.mobile-inventory-mode .toolbar-actions,
body.mobile-inventory-mode .count-control-panel,
body.mobile-inventory-mode .count-search-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

body.mobile-inventory-mode .toolbar-actions {
  grid-template-columns: 1fr 1fr;
}

body.mobile-inventory-mode .count-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

body.mobile-inventory-mode:not(.count-review-mode) .count-metrics {
  display: none;
}

body.mobile-inventory-mode .toolbar-actions .btn,
body.mobile-inventory-mode .count-search-panel .btn {
  width: 100%;
  min-height: 46px;
}

body.mobile-inventory-mode .count-control-panel,
body.mobile-inventory-mode .filter-panel {
  padding: 12px;
  margin-bottom: 12px;
}

body.mobile-inventory-mode .mini-card {
  min-height: 66px;
  padding: 10px;
}

body.mobile-inventory-mode .count-table-panel {
  border: 0;
  background: transparent;
  overflow: hidden;
}

body.mobile-inventory-mode .count-table-panel .panel-head {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 6px;
  padding: 0 0 12px;
}

body.mobile-inventory-mode .count-table-panel .panel-head h3 {
  font-size: 22px;
  line-height: 1.05;
}

body.mobile-inventory-mode .count-table-panel .panel-head .muted {
  max-width: 100%;
  font-size: 12px;
  line-height: 1.35;
}

body.mobile-inventory-mode .count-table-panel .table-wrap {
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

body.mobile-inventory-mode .count-table thead {
  display: none;
}

body.mobile-inventory-mode .count-table,
body.mobile-inventory-mode .count-table tbody,
body.mobile-inventory-mode .count-table tr,
body.mobile-inventory-mode .count-table td {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

body.mobile-inventory-mode .count-table tr {
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 8px 18px rgba(53, 29, 18, 0.04);
}

body.mobile-inventory-mode .count-table td {
  border: 0;
  padding: 4px 0;
}

body.mobile-inventory-mode .count-code-cell,
body.mobile-inventory-mode .count-system-cell,
body.mobile-inventory-mode .count-counted-cell,
body.mobile-inventory-mode .count-diff-cell,
body.mobile-inventory-mode .count-history-cell {
  display: none !important;
}

body.mobile-inventory-mode .count-product-cell {
  padding: 0 !important;
  overflow: hidden;
}

body.mobile-inventory-mode .count-product-title {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 8px;
  max-width: 100%;
}

body.mobile-inventory-mode .count-product-title strong {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  line-height: 1.25;
}

body.mobile-inventory-mode .count-product-extra {
  display: none;
}

body.mobile-inventory-mode .code-chip {
  flex: 0 0 auto;
  font-size: 10px;
  white-space: nowrap;
}

body.mobile-inventory-mode .mobile-count-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 10px;
  max-width: 100%;
}

body.mobile-inventory-mode .mobile-count-summary span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid var(--line);
  background: var(--cream-50);
}

body.mobile-inventory-mode .mobile-count-summary small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

body.mobile-inventory-mode .mobile-count-summary strong {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.15;
  text-align: right;
  overflow-wrap: anywhere;
}

body.mobile-inventory-mode .count-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

body.mobile-inventory-mode .count-actions .row-action {
  min-height: 42px;
}

body.mobile-inventory-mode .count-actions [data-clear-count-item] {
  display: none;
}

body.mobile-inventory-mode .modal {
  padding: 0;
  place-items: stretch;
}

body.mobile-inventory-mode .count-calculator-card,
body.mobile-inventory-mode .scanner-modal-card,
body.mobile-inventory-mode .count-product-info-card,
body.mobile-inventory-mode .product-modal-card,
body.mobile-inventory-mode .mobile-product-modal-card,
body.mobile-inventory-mode .transfer-modal-card {
  width: 100vw;
  min-height: 100dvh;
  max-height: 100dvh;
  border-radius: 0;
  border: 0;
}

body.mobile-inventory-mode .product-modal-form,
body.mobile-inventory-mode .product-info-body,
body.mobile-inventory-mode .modal-head,
body.mobile-inventory-mode .mobile-product-tools,
body.mobile-inventory-mode .mobile-products-list,
body.mobile-inventory-mode .transfer-form {
  padding-left: 16px;
  padding-right: 16px;
}

body.mobile-inventory-mode .product-info-grid {
  grid-template-columns: 1fr;
}

body.mobile-inventory-mode .product-code-grid,
body.mobile-inventory-mode .field-actions.two {
  grid-template-columns: 1fr;
}

body.mobile-inventory-mode .field-actions {
  display: grid;
  grid-template-columns: 1fr;
}

body.mobile-inventory-mode .mobile-products-list {
  max-height: none;
}

body.mobile-inventory-mode .mobile-product-item {
  grid-template-columns: 54px minmax(0, 1fr);
}

body.mobile-inventory-mode .mobile-product-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

body.mobile-inventory-mode .product-image-box {
  grid-template-columns: 1fr;
}

body.mobile-inventory-mode .scanner-box,
body.mobile-inventory-mode .scanner-box video {
  min-height: 58dvh;
  height: 58dvh;
}

body.mobile-inventory-mode .count-calculator-display {
  min-height: 30dvh;
}

body.mobile-inventory-mode .count-calc-expression {
  font-size: 30px;
}

body.mobile-inventory-mode .count-keypad button {
  min-height: 62px;
}

@media (max-width: 1280px) {
  .shell {
    grid-template-columns: 252px minmax(0, 1fr);
  }

  .content-wrap {
    width: auto;
    padding: 20px 20px 54px;
  }

  .app-footer {
    left: 252px;
  }

  .dashboard-layout,
  .inventory-grid,
  .cash-layout,
  .close-bottom-layout,
  .reports-grid,
  .admin-report-filter-grid,
  .product-admin-layout,
  .purchase-layout,
  .records-layout,
  .settings-layout,
  .permission-list {
    grid-template-columns: 1fr;
  }

  .product-editor-panel {
    position: static;
  }

  .supplier-toolbar,
  .supplier-card {
    grid-template-columns: 1fr;
  }

  .supplier-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .cash-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-report-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .close-method-panel .arqueo-list {
    grid-template-columns: 1fr;
  }

  .payment-modal-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .records-action-grid,
  .credit-filter-grid,
  .credit-summary-strip,
  .credit-payment-row {
    grid-template-columns: 1fr 1fr;
  }

  .admin-report-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .payment-ticket-preview {
    min-height: auto;
  }

  .payment-lines {
    max-height: 260px;
  }
}

@media (max-width: 980px) {
  .shell {
    display: flex;
    flex-direction: column;
  }

  .sidebar {
    order: 1;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .brand-block {
    padding: 24px;
  }

  .side-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav-item {
    min-height: 48px;
    justify-content: center;
    padding: 0 8px;
    font-size: 13px;
  }

  .nav-glyph {
    display: none;
  }

  .nav-icon {
    display: none;
  }

  .sidebar-support {
    display: none;
  }

  .topbar {
    order: 2;
    position: static;
    flex-direction: column;
    align-items: stretch;
    padding: 12px 18px;
  }

  .workspace {
    order: 3;
  }

  .top-links,
  .top-actions {
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
  }

  .top-links {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .top-link {
    flex: 0 0 auto;
  }

  .content-wrap {
    width: auto;
    padding: 26px 18px 80px;
  }

  .page-heading,
  .dashboard-heading,
  .cash-actions,
  .quick-move-form,
  .close-form {
    flex-direction: column;
    align-items: stretch;
  }

  .kpi-grid,
  .inventory-metrics,
  .bottom-panels,
  .filter-panel,
  .count-control-panel,
  .count-search-panel,
  .form-grid.two,
  .form-grid.three,
  .form-grid.four,
  .check-grid,
  .payment-modal-layout,
  .payment-input-grid,
  .mixed-payments,
  .purchase-item-adder,
  .purchase-totals,
  .shift-open-summary,
  .settings-toolbar,
  .alert-settings-form,
  .market-print-config-grid,
  .user-form-grid {
    grid-template-columns: 1fr;
  }

  .alert-settings-actions,
  .market-print-settings-head,
  .market-print-agent-actions,
  .market-print-settings-actions,
  .dashboard-detail-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-detail-side {
    justify-items: start;
  }

  .dashboard-detail-value {
    text-align: left;
  }

  .shift-open-screen {
    align-items: start;
    padding: 16px;
  }

  .shift-open-head {
    padding: 24px;
  }

  .shift-open-body {
    padding: 26px 24px;
  }

  .money-input,
  .money-input input {
    min-height: 72px;
  }

  .money-input span,
  .money-input input {
    font-size: 25px;
  }

  .shift-history-card {
    grid-template-columns: 1fr;
  }

  .shift-history-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pos-layout {
    grid-template-columns: 1fr;
  }

  .ticket-panel {
    position: static;
    height: auto;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .app-footer {
    left: 0;
    overflow: auto;
  }

  .payment-modal-card {
    width: min(100vw - 24px, 720px);
  }

  .payment-modal-pro {
    max-height: calc(100vh - 24px);
  }

  .payment-modal-head {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .payment-total-strip,
  .payment-submit-row {
    grid-template-columns: 1fr;
  }

  .payment-methods {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mixed-payment-body {
    padding: 16px;
  }

  .mixed-payment-row,
  .mixed-payment-actions {
    grid-template-columns: 1fr;
  }

  .mixed-payment-row .icon-button {
    width: 100%;
  }

  .mixed-payment-actions {
    padding: 16px;
  }

  .arqueo-row {
    grid-template-columns: 1fr;
  }

  .arqueo-header {
    display: none;
  }

  .count-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .count-calculator-body {
    padding: 14px;
  }

  .count-calc-expression {
    font-size: 28px;
  }

  .count-keypad {
    gap: 9px;
  }

  .count-keypad button {
    min-height: 56px;
    font-size: 20px;
  }
}

.sunat-settings-panel {
  margin-bottom: 0;
}

.sunat-panel-heading {
  align-items: flex-start;
}

.sunat-eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--green-700, #047857);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
}

.sunat-banner-stack {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.sunat-banner {
  border: 1px solid #d9e3ee;
  border-radius: 10px;
  padding: 13px 15px;
  color: #29445b;
  font-size: 14px;
  line-height: 1.45;
}

.sunat-banner.warn { border-color: #efd69f; background: #fff8e8; color: #79531f; }
.sunat-banner.good { border-color: #a9ddc6; background: #edf9f2; color: #155d3c; }
.sunat-banner.info { border-color: #b9d9ef; background: #eff8ff; color: #155779; }

.sunat-card,
.sunat-cutover-card {
  border: 1px solid #eaded3;
  border-radius: 10px;
  background: #fff;
  padding: 20px;
}

.sunat-access-card {
  margin-bottom: 18px;
}

.sunat-workbench {
  display: grid;
  grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.sunat-credentials-card {
  background: #fffaf4;
}

.sunat-side-stack {
  display: grid;
  gap: 18px;
}

.sunat-checklist-card .panel-head,
.sunat-queue-control .panel-head {
  margin-bottom: 14px;
}

.sunat-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
}

.sunat-check-item {
  position: relative;
  min-height: 74px;
  border: 1px solid #eaded3;
  border-radius: 8px;
  background: #fffaf4;
  padding: 12px 44px 12px 13px;
}

.sunat-check-item::after {
  content: 'PEND.';
  position: absolute;
  top: 12px;
  right: 12px;
  color: #9a6c19;
  font-size: 10px;
  font-weight: 900;
}

.sunat-check-item strong,
.sunat-check-item span {
  display: block;
}

.sunat-check-item strong {
  color: var(--brown-850);
  font-size: 13px;
}

.sunat-check-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.sunat-check-item.good {
  border-color: #a9ddc6;
  background: #edf9f2;
}

.sunat-check-item.good::after { content: 'OK'; color: #087144; }

.sunat-check-item.warn {
  border-color: #efd69f;
  background: #fff8e8;
}

.sunat-check-item.danger {
  border-color: #e8b9b9;
  background: #fff1f1;
}

.sunat-config-form {
  display: grid;
  gap: 14px;
}

.sunat-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 14px;
}

.sunat-config-grid label,
.sunat-pfx-field {
  display: grid;
  gap: 6px;
  color: var(--brown-850);
  font-size: 13px;
  font-weight: 900;
}

.sunat-pfx-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.sunat-pfx-field textarea {
  min-height: 84px;
  resize: vertical;
}

.sunat-queue-section {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #eaded3;
}

.sunat-queue-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 10px;
}

.sunat-queue-summary > div,
.sunat-cutover-details > div {
  border: 1px solid #eaded3;
  border-radius: 8px;
  background: #fffaf4;
  padding: 11px 12px;
}

.sunat-queue-summary span,
.sunat-cutover-details span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .07em;
}

.sunat-queue-summary strong,
.sunat-cutover-details strong {
  display: block;
  margin-top: 6px;
  color: var(--brown-850);
  font-size: 20px;
}

.sunat-cutover-card {
  margin-top: 18px;
  border-color: #efd69f;
  background: #fff9e8;
}

.sunat-cutover-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
}

.sunat-locked-badge,
.sunat-readonly-badge,
.sunat-action-locked {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  background: #f3eee9;
  color: #876f5b;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.sunat-readonly-badge { background: #edf4f9; color: #3c657d; }
.sunat-action-locked { background: #fff1f1; color: #a14a4a; }

.sunat-full-card {
  margin-top: 18px;
}

.sunat-disabled-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sunat-queue-scroll {
  max-height: 360px;
}

.sunat-queue-scroll td {
  vertical-align: top;
}

.sunat-queue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 220px;
}

.sunat-queue-actions .row-action {
  white-space: nowrap;
}

@media (max-width: 1450px) {
  .documents-filter-panel {
    grid-template-columns: minmax(240px, 1fr) 180px 160px 180px;
  }

  .documents-filter-actions {
    grid-column: 3 / -1;
  }
}

@media (max-width: 1100px) {
  .documents-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .documents-filter-panel {
    grid-template-columns: minmax(240px, 1fr) 180px 160px;
  }

  .documents-filter-actions {
    grid-column: 1 / -1;
  }

  .settings-overview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .company-settings-layout {
    grid-template-columns: 1fr;
  }

  .sunat-workbench {
    grid-template-columns: 1fr;
  }

  .sunat-checklist,
  .sunat-config-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .sunat-cutover-details,
  .sunat-queue-summary {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}

@media (max-width: 620px) {
  .documents-summary-grid,
  .documents-filter-panel {
    grid-template-columns: 1fr;
  }

  .documents-filter-actions {
    grid-column: auto;
  }

  .documents-filter-actions .btn {
    flex: 1;
  }

  .document-detail-modal-card {
    width: min(100vw - 20px, 720px);
  }

  .document-detail-body {
    padding: 14px;
  }

  .document-detail-layout,
  .document-detail-summary {
    grid-template-columns: 1fr;
  }

  .document-ticket-panel pre {
    max-height: 300px;
  }

  .settings-overview {
    grid-template-columns: 1fr 1fr;
  }

  .settings-overview-card {
    min-height: 104px;
  }

  .settings-section-tabs {
    margin-right: -18px;
    padding-right: 18px;
  }

  .company-settings-grid {
    grid-template-columns: 1fr;
  }

  .sunat-checklist,
  .sunat-config-grid {
    grid-template-columns: 1fr;
  }

  .sunat-cutover-details,
  .sunat-queue-summary {
    grid-template-columns: 1fr 1fr;
  }

  .sunat-queue-actions {
    min-width: 180px;
  }

  .print-driver-token-row,
  .print-driver-head {
    align-items: stretch;
    flex-direction: column;
  }

  .print-driver-row {
    grid-template-columns: 1fr;
  }

  .market-print-driver-modal-card {
    width: min(100vw - 24px, 720px);
  }

  .market-print-driver-modal-body {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .market-print-driver-modal-actions {
    padding: 0 16px 16px;
  }

  .market-driver-link-entry {
    padding: 15px;
  }
}
body.sunat-developer-mode .side-nav .nav-item:not([data-page="settings"]),
body.sunat-developer-mode .top-links,
body.sunat-developer-mode .top-actions > :not(#logoutBtn),
body.sunat-developer-mode .sidebar-support,
body.sunat-developer-mode [data-page-panel]:not([data-page-panel="settings"]) {
  display: none !important;
}

body.sunat-developer-mode .top-actions {
  justify-content: flex-end;
}
body.sunat-developer-mode .side-nav .nav-item:not([data-page="settings"]),
body.sunat-developer-mode .top-links,
body.sunat-developer-mode .top-actions > :not(#logoutBtn),
body.sunat-developer-mode .sidebar-support,
body.sunat-developer-mode [data-page-panel]:not([data-page-panel="settings"]) {
  display: none !important;
}

body.sunat-developer-mode .top-actions {
  justify-content: flex-end;
}
