:root {
  color-scheme: light;
  --bg: #f4f7fc;
  --ink: #0b1731;
  --muted: #64748b;
  --line: #d8e2f2;
  --panel: #ffffff;
  --accent: #165dff;
  --accent-2: #c83a32;
  --accent-3: #f3b83f;
  --brand-blue: #165dff;
  --brand-cyan: #1688f8;
  --brand-navy: #071e49;
  --primary: var(--brand-blue);
  --soft: #edf3ff;
  --brand-blue-soft: #edf3ff;
  --brand-blue-line: #c7d8f7;
  --brand-blue-muted: #dfe9ff;
  --success: #147446;
  --success-soft: #e8f6ef;
  --success-line: #c8e4da;
  --shadow: 0 16px 42px rgba(31, 61, 116, 0.1);
  --shadow-soft: 0 8px 24px rgba(31, 61, 116, 0.08);
}

@media (max-width: 720px) {
  body .panel-head.recurring-heading {
    align-items: stretch;
    flex-direction: column;
  }
}

.recurring-view {
  display: grid;
  gap: 18px;
}

.panel-head.recurring-heading {
  align-items: flex-start;
}

.recurring-heading h3,
.recurring-calendar-head h4,
.recurring-agenda-head h4,
.recurring-rules-head h4 {
  margin: 2px 0 0;
}

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

.recurring-summary article {
  display: grid;
  gap: 5px;
  min-height: 112px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.recurring-summary article.danger {
  border-color: #f1c9c3;
  background: #fff7f5;
}

.recurring-summary article.warning {
  border-color: #efd899;
  background: #fff9e9;
}

.recurring-summary article.success {
  border-color: var(--success-line);
  background: var(--success-soft);
}

.recurring-summary span,
.recurring-summary small {
  color: var(--muted);
  font-weight: 750;
}

.recurring-summary strong {
  align-self: end;
  font-size: 1.35rem;
}

.recurring-summary .danger strong {
  color: #b7362b;
}

.recurring-summary .warning strong {
  color: #8a5a00;
}

.recurring-summary .success strong {
  color: var(--success);
}

.recurring-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.recurring-calendar {
  min-width: 0;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.recurring-calendar-head,
.recurring-rules-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
}

.recurring-calendar-nav {
  display: flex;
  gap: 6px;
}

.recurring-calendar-nav button {
  min-height: 40px;
}

.recurring-weekdays,
.recurring-days {
  min-width: 760px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.recurring-weekdays {
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.recurring-weekdays span {
  padding: 9px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-align: center;
  text-transform: uppercase;
}

.recurring-day {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 5px;
  min-width: 0;
  min-height: 108px;
  padding: 8px;
  overflow: hidden;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.recurring-day:nth-child(7n + 1) {
  border-left: 1px solid var(--line);
}

.recurring-day:hover,
.recurring-day:focus-visible,
.recurring-day.selected {
  background: #fff9e9;
}

.recurring-day:focus-visible {
  z-index: 1;
  outline: 2px solid var(--accent-3);
  outline-offset: -2px;
}

.recurring-day.outside {
  color: #a1aaa6;
  background: #f8faf8;
}

.recurring-day.today .recurring-day-number {
  color: #fff;
  background: var(--accent);
}

.recurring-day-number {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 900;
}

.recurring-day-events {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
}

.recurring-event {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 4px 6px;
  overflow: hidden;
  border-left: 3px solid #9aa49f;
  border-radius: 4px;
  background: #eef1ef;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recurring-event b {
  overflow: hidden;
  font-size: 0.67rem;
  text-overflow: ellipsis;
}

.recurring-event.overdue {
  border-left-color: #c43b30;
  background: #fde5e1;
  color: #9c2c24;
}

.recurring-event.soon {
  border-left-color: var(--accent-3);
  background: #fff1ca;
  color: #795314;
}

.recurring-event.paid {
  border-left-color: var(--success);
  background: #e1f2ec;
  color: #116d58;
}

.recurring-agenda {
  min-width: 0;
  padding: 16px 0 4px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.recurring-agenda-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.recurring-agenda-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.recurring-agenda-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid #9aa49f;
  border-radius: 6px;
  background: #f7f9f8;
}

.recurring-agenda-item.overdue {
  border-color: #efc1bb;
  border-left-color: #c43b30;
  background: #fff2f0;
}

.recurring-agenda-item.soon {
  border-color: #efd998;
  border-left-color: var(--accent-3);
  background: #fff9e8;
}

.recurring-agenda-item.paid {
  border-color: #b9ded2;
  border-left-color: var(--success);
  background: var(--success-soft);
}

.recurring-agenda-item > div {
  display: grid;
  align-content: start;
  gap: 3px;
  min-width: 0;
}

.recurring-agenda-item > div:nth-child(2) {
  justify-items: end;
}

.recurring-agenda-item span,
.recurring-agenda-item small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.recurring-agenda-item button {
  grid-column: 1 / -1;
  width: 100%;
}

.recurring-agenda-item.overdue strong,
.recurring-agenda-item.overdue .recurring-status {
  color: #a12f27;
}

.recurring-status,
.recurring-rule-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.76rem !important;
  font-weight: 850 !important;
}

.recurring-status.overdue {
  color: #a12f27;
  background: #fde3df;
}

.recurring-status.soon {
  color: #795314;
  background: #fff0c7;
}

.recurring-status.paid,
.recurring-rule-status.active {
  color: #116d58;
  background: #dff1eb;
}

.recurring-status.scheduled,
.recurring-rule-status.paused {
  color: #5f6965;
  background: #e9eeeb;
}

.recurring-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 0 8px;
}

.recurring-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.recurring-legend span::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9aa49f;
  content: "";
}

.recurring-legend .overdue::before { background: #c43b30; }
.recurring-legend .soon::before { background: var(--accent-3); }
.recurring-legend .paid::before { background: var(--success); }

.recurring-rules-head {
  padding-bottom: 0;
  border-top: 1px solid var(--line);
}

.recurring-rules-head > span {
  color: var(--muted);
  font-weight: 800;
}

.recurring-table-wrap .table-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 650;
}

.modal.recurring-payment-modal {
  width: min(900px, calc(100vw - 32px));
}

@media (max-width: 1180px) {
  .recurring-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .recurring-agenda-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .recurring-summary {
    grid-template-columns: 1fr;
  }

  .recurring-heading,
  .recurring-calendar-head,
  .recurring-agenda-head,
  .recurring-rules-head {
    align-items: stretch;
    flex-direction: column;
  }

  .recurring-agenda-list {
    grid-template-columns: 1fr;
  }

  .recurring-heading button,
  .recurring-calendar-nav button {
    flex: 1;
  }

  .recurring-calendar-nav {
    width: 100%;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(320px, 0.48fr) minmax(420px, 0.52fr);
  background: var(--bg);
}

.login-screen[hidden] {
  display: none;
}

.login-card {
  width: min(520px, calc(100% - 32px));
  align-self: center;
  justify-self: center;
  display: grid;
  gap: 22px;
  padding: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
}

.login-card .brand span {
  color: var(--muted);
}

.login-card h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 4px 0;
}

.login-art {
  min-height: 100vh;
  display: grid;
  align-content: space-between;
  padding: 34px;
  color: #fff;
  background: var(--brand-navy);
}

.login-brand .brand-mark {
  width: min(100%, 460px);
  height: 118px;
  background: #fff;
  color: var(--brand-blue);
}

.brand-suite {
  display: grid;
  gap: 2px;
  margin-top: 8px;
}

.brand-suite strong {
  font-size: 0.88rem;
}

.login-brand .brand-suite span,
.sidebar .brand-suite span {
  color: #9fb3d6;
  font-size: 0.76rem;
  font-weight: 700;
}

.login-preview {
  width: min(520px, 100%);
  min-height: 330px;
  align-self: center;
  justify-self: center;
  display: grid;
  gap: 18px;
  padding: 24px;
  border-radius: 8px;
  background: #0d2a60;
  border: 1px solid rgba(113, 160, 255, 0.32);
  box-shadow: 0 30px 80px rgba(0, 10, 40, 0.28);
}

.preview-bar {
  height: 48px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
}

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

.preview-grid span {
  height: 78px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.preview-chart {
  min-height: 120px;
  border-radius: 8px;
  background: #dfe9ff;
}

.login-help {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

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

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

.sidebar {
  background: var(--brand-navy);
  color: #f5fbf8;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand,
.user-chip,
.metric,
.list-row,
.cart-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark,
.avatar {
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-weight: 800;
}

.brand-mark {
  width: 58px;
  height: 58px;
  background: #fff;
  color: var(--brand-blue);
  border: 1px solid #d6e2fb;
  overflow: hidden;
  position: relative;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0;
  box-sizing: border-box;
}

.brand-mark.official-logo img {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: auto;
  transform: translateY(-50%);
}

.brand-mark.custom-logo img {
  padding: 6px;
}

.brand span,
.session-box span,
.session-box small,
.user-chip small,
.eyebrow,
.muted {
  color: var(--muted);
}

.sidebar .brand span,
.sidebar .session-box span,
.sidebar .session-box small {
  color: #9fb3d6;
}

.sidebar .brand {
  display: block;
}

.sidebar .brand-mark {
  width: 100%;
  height: 94px;
  border-radius: 8px;
}

.sidebar .brand.has-company-brand .brand-mark {
  background: #fff;
  border-color: rgba(214, 226, 251, 0.82);
}

.sidebar .brand.has-company-brand .brand-mark img {
  padding: 10px;
}

.sidebar .brand.has-company-brand .brand-suite strong {
  color: #fff;
  font-size: 0.94rem;
  overflow-wrap: anywhere;
}

.sidebar .brand.has-company-brand .brand-suite span {
  color: #9fb3d6;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav a {
  width: 100%;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 9px 10px;
  border-radius: 8px;
  background: transparent;
  color: #cbd8ee;
  text-align: left;
  text-decoration: none;
  font-size: 0.95rem;
}

.nav-glyph {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #b9cced;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.nav-glyph svg {
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav a.active,
.nav a:hover {
  background: #214f9d;
  color: #fff;
  box-shadow: inset 3px 0 0 #5b94ff;
}

.nav a.active .nav-glyph,
.nav a:hover .nav-glyph {
  background: #e6eeff;
  color: var(--brand-blue);
}

.loyalty-preview { display: grid; gap: 6px; margin-top: 20px; padding: 18px; border-radius: 12px; background: #edf3ff; color: var(--ink); }
.loyalty-preview span, .loyalty-preview small { color: var(--muted); }
.loyalty-sale-field { display: inline-flex; align-items: center; gap: 8px; }
.loyalty-sale-field input { width: 88px; min-height: 30px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 7px; }
.loyalty-coupon-preview { display: grid; gap: 10px; padding: 18px; background: #edf3ff; border-radius: 12px; }
.loyalty-coupon-preview strong { color: var(--brand-blue); font-size: 1.3rem; letter-spacing: .08em; }
.loyalty-coupon-preview textarea { min-height: 100px; }

.nav svg,
.empty svg {
  width: 20px;
  height: 20px;
}

.session-box {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  background: #0b2859;
}

.main {
  padding: 24px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

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

h1 {
  font-size: clamp(1.9rem, 3vw, 3rem);
  line-height: 1;
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.logout-chip {
  gap: 12px;
}

.logout-label {
  padding-left: 12px;
  border-left: 1px solid var(--line);
  color: #b7362b;
  font-size: 0.86rem;
  font-weight: 800;
}

select,
input,
textarea {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  min-width: 0;
}

textarea {
  min-height: 88px;
  padding: 10px 12px;
  resize: vertical;
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.user-chip {
  padding: 7px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  text-align: left;
}

.avatar {
  width: 34px;
  height: 34px;
  background: #e7eeff;
  color: var(--brand-blue);
}

.hero-panel {
  min-height: 190px;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--ink);
  border: 1px solid #cfddf8;
  background: #edf3ff;
  box-shadow: var(--shadow);
}

.hero-branding {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.hero-logo-frame {
  width: min(720px, 58vw);
  height: 134px;
  overflow: hidden;
  position: relative;
}

.hero-logo-frame img {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: auto;
  transform: translateY(-50%);
  mix-blend-mode: multiply;
}

.hero-suite {
  color: #536987;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.hero-stats {
  display: grid;
  gap: 8px;
  min-width: 230px;
}

.hero-stats[hidden] {
  display: none;
}

.hero-stats span {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #d5e1f7;
  background: rgba(255, 255, 255, 0.82);
  color: #405575;
}

.view {
  display: grid;
  gap: 16px;
  min-width: 0;
}

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

.metric-action {
  width: 100%;
  text-align: left;
}

.metric-action:hover {
  border-color: rgba(22, 93, 255, 0.45);
  box-shadow: 0 14px 34px rgba(22, 93, 255, 0.12);
}

.metric,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.metric {
  min-height: 112px;
  padding: 18px;
  align-items: flex-start;
}

.metric-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--soft);
  color: var(--accent);
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 1.65rem;
}

.metric.metric-danger {
  border-color: #f3c7c1;
  background:
    linear-gradient(135deg, rgba(183, 54, 43, 0.1), transparent 62%),
    #fff6f4;
}

.metric.metric-danger .metric-icon {
  background: #fce2de;
  color: #b7362b;
}

.metric.metric-danger strong {
  color: #b7362b;
}

.metric.metric-danger .muted {
  color: #8f4138;
}

.debt-value {
  color: #b7362b;
  font-weight: 900;
}

.metric.metric-positive {
  border-color: var(--success-line);
  background:
    linear-gradient(135deg, rgba(20, 116, 70, 0.11), transparent 62%),
    #fbfcff;
}

.metric.metric-positive .metric-icon {
  background: #e2f5ee;
  color: #087a56;
}

.metric.metric-positive strong {
  color: #087a56;
}

.metric.metric-negative {
  border-color: #f3c7c1;
  background:
    linear-gradient(135deg, rgba(183, 54, 43, 0.1), transparent 62%),
    #fff6f4;
}

.metric.metric-negative .metric-icon {
  background: #fce2de;
  color: #b7362b;
}

.metric.metric-negative strong {
  color: #b7362b;
}

.report-danger-value {
  color: #b7362b;
}

.content-grid {
  display: grid;
  gap: 16px;
}

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

.sales-layout {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.sales-tabs-compact {
  margin-bottom: 10px;
}

.sales-tabs,
.cash-tabs {
  display: flex;
  width: fit-content;
  max-width: 100%;
  gap: 6px;
  margin-bottom: 14px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf2fa;
  box-shadow: var(--shadow-soft);
  flex-wrap: wrap;
}

.sales-tabs button,
.cash-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 9px 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
}

.sales-tabs button.active,
.cash-tabs button.active {
  background: var(--brand-navy);
  color: #fff;
  box-shadow: 0 10px 22px rgba(7, 30, 73, 0.16);
}

.administration-tabs {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.administration-tabs button {
  width: 100%;
}

.sales-tab-panel,
.cash-tab-panel {
  display: grid;
  gap: 14px;
}

.sales-tab-panel[hidden],
.cash-tab-panel[hidden] {
  display: none;
}

.panel {
  padding: 16px;
  min-width: 0;
  max-width: 100%;
}

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

.panel-head h3 {
  font-size: 1.05rem;
}

.dollar-panel {
  overflow: hidden;
}

.dashboard-page {
  display: grid;
  gap: 16px;
}

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

.dashboard-metrics .metric {
  min-height: 104px;
  padding: 16px;
}

.dashboard-metrics .metric strong {
  font-size: clamp(1.1rem, 1.8vw, 1.55rem);
}

.dashboard-focus-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 16px;
}

.dashboard-pulse-panel,
.dashboard-actions-panel,
.dashboard-card {
  overflow: hidden;
}

.dashboard-pulse-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-pulse,
.dashboard-mini {
  min-height: 86px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.dashboard-pulse span,
.dashboard-mini span,
.dashboard-bar span,
.dashboard-total-line span,
.dashboard-action small,
.dashboard-branch-row small {
  color: var(--muted);
  font-weight: 700;
}

.dashboard-pulse strong,
.dashboard-mini strong {
  font-size: 1.25rem;
}

.dashboard-pulse.positive,
.dashboard-mini.positive {
  background: var(--success-soft);
  border-color: var(--success-line);
}

.dashboard-pulse.positive strong,
.dashboard-mini.positive strong {
  color: var(--success);
}

.dashboard-pulse.negative,
.dashboard-mini.negative {
  background: #fff5f2;
  border-color: #f2c9c1;
}

.dashboard-pulse.negative strong,
.dashboard-mini.negative strong {
  color: #b7362b;
}

.dashboard-action-list,
.dashboard-bars,
.dashboard-branch-list {
  display: grid;
  gap: 10px;
}

.dashboard-action {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
  color: var(--ink);
  text-align: left;
}

.dashboard-action span {
  display: grid;
  gap: 4px;
}

.dashboard-action b {
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--accent);
}

.dashboard-action.danger {
  background: #fff5f2;
  border-color: #f2c9c1;
}

.dashboard-action.warn {
  background: #fff8e7;
  border-color: #f0dfa8;
}

.dashboard-action.ok {
  background: #edf3ff;
  border-color: #d8e2f2;
}

.dashboard-total-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #edf1ee;
  margin-bottom: 10px;
}

.dashboard-total-line strong {
  font-size: 1.35rem;
}

.dashboard-bar {
  display: grid;
  gap: 8px;
}

.dashboard-bar > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.dashboard-bar span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-bar > i,
.dashboard-branch-row i {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5ebf5;
}

.dashboard-bar > i b,
.dashboard-branch-row i {
  display: block;
}

.dashboard-bar > i b {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.dashboard-bar.danger > i b {
  background: #b7362b;
}

.dashboard-bar.neutral > i b {
  background: #6a7470;
}

.dashboard-branch-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 0.5fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.dashboard-branch-row > span {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.dashboard-branch-row i {
  height: 8px;
  background: var(--accent);
}

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

.dollar-card {
  display: grid;
  gap: 14px;
}

.dollar-table {
  display: grid;
  gap: 6px;
}

.dollar-row {
  display: grid;
  grid-template-columns: 1fr 0.8fr 0.8fr;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border-radius: 8px;
  background: #fbfcff;
}

.dollar-row:nth-child(odd):not(.dollar-head) {
  background: #f4f7f5;
}

.dollar-row strong {
  font-size: 1.03rem;
}

.dollar-row span {
  font-weight: 850;
}

.dollar-head {
  padding-top: 0;
  padding-bottom: 4px;
  background: transparent;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.78rem;
}

.dollar-footer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dollar-footer div {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(22, 93, 255, 0.08), transparent 68%),
    #fff;
}

.dollar-footer strong {
  overflow-wrap: anywhere;
}

.subscription-alerts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.subscription-alert {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.subscription-alert span,
.subscription-alert small {
  color: var(--muted);
}

.subscription-alert strong {
  font-size: 1.6rem;
}

.subscription-alert.bad {
  background: #fff6f4;
  border-color: #f3c7c1;
}

.subscription-alert.bad strong,
.subscription-alert.bad span {
  color: #b7362b;
}

.subscription-alert.warn {
  background: #fff8e8;
  border-color: #f4dfad;
}

.subscription-alert.warn strong,
.subscription-alert.warn span {
  color: #815600;
}

.subscription-row-alert td {
  background: #fff8f6;
}

.subscription-timeline {
  display: grid;
  gap: 10px;
}

.subscription-timeline-row {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) minmax(160px, 0.7fr) minmax(160px, 0.7fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.subscription-timeline-row div {
  min-width: 0;
}

.subscription-timeline-row span,
.subscription-timeline-row small {
  display: block;
  color: var(--muted);
}

.tax-hero {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(420px, 0.9fr);
  gap: 16px;
  align-items: end;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(22, 93, 255, 0.11), transparent 62%),
    #fff;
  box-shadow: 0 10px 28px rgba(32, 44, 40, 0.06);
}

.tax-hero h3 {
  font-size: 1.6rem;
  margin: 4px 0 6px;
}

.tax-hero p {
  color: var(--muted);
}

.tax-period {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.tax-position-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.tax-position-grid article {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.tax-position-grid span,
.tax-position-grid small {
  color: var(--muted);
}

.tax-position-grid strong {
  font-size: 1.25rem;
}

.tax-position-grid .tax-due {
  border-color: #f3c7c1;
  background: #fff6f4;
}

.tax-position-grid .tax-due strong {
  color: #b7362b;
}

.tax-position-grid .tax-credit {
  border-color: #c7d8f7;
  background: #f2fbf7;
}

.tax-position-grid .tax-credit strong {
  color: var(--accent);
}

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

.tax-alert {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid #f3c7c1;
  border-radius: 8px;
  background: #fff6f4;
}

.tax-alert strong {
  color: #b7362b;
}

.tax-alert span {
  color: #70413c;
  font-size: 0.9rem;
}

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

.arca-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 14px;
  align-items: stretch;
  padding: 18px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(17, 39, 34, 0.96), rgba(16, 134, 107, 0.86)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0 2px, transparent 2px 22px);
  color: #fff;
}

.arca-hero h3 {
  margin: 4px 0 6px;
  font-size: 1.65rem;
}

.arca-hero p {
  max-width: 760px;
  color: rgba(255, 255, 255, 0.82);
}

.arca-status-card {
  display: grid;
  gap: 8px;
  align-content: center;
  padding: 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.arca-status-card span,
.arca-status-card small {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 750;
}

.arca-status-card strong {
  font-size: 1.45rem;
}

.arca-status-card.active strong {
  color: #dfe9ff;
}

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

.arca-readiness article {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.arca-readiness article.ok {
  background: #edf3ff;
  border-color: #d8e2f2;
}

.arca-readiness article.warn {
  background: #fff8ea;
  border-color: #f2dfaa;
}

.arca-readiness span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.arca-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 16px;
}

.arca-form,
.arca-flow {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.toggle-field,
.arca-checks label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-weight: 800;
  color: var(--text);
}

.arca-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 4px;
}

.arca-checks label {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.arca-flow {
  display: grid;
  gap: 12px;
  align-content: start;
}

.arca-flow article {
  display: grid;
  gap: 5px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.arca-flow article strong {
  color: var(--accent);
}

.arca-flow article span,
.arca-security-note span,
.arca-mini-summary span {
  color: var(--muted);
}

.arca-security-note {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid #f0c4bd;
  border-radius: 8px;
  background: #fff6f4;
}

.arca-security-note strong {
  color: #aa3329;
}

.arca-mini-summary {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 8px;
  background: #edf3ff;
}

.primary,
.secondary,
.ghost,
.danger {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 750;
  max-width: 100%;
  white-space: normal;
}

.primary {
  background: var(--accent);
  color: #fff;
}

.secondary {
  background: var(--brand-navy);
  color: #fff;
}

.ghost {
  background: #eef2f8;
  color: var(--ink);
}

.danger {
  background: #fce2de;
  color: #9b2d21;
}

.full {
  width: 100%;
}

.filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 220px);
  gap: 10px;
  margin-bottom: 10px;
}

.sale-product-filters {
  grid-template-columns: 1fr;
}

.sale-product-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 8px;
}

.sale-product-search.no-create {
  grid-template-columns: minmax(0, 1fr);
}

.quick-add-product {
  display: grid;
  place-items: center;
  min-height: 48px;
  border: 1px solid #c7d8f7;
  border-radius: 8px;
  color: #165dff;
  background: #edf3ff;
  font-size: 1.35rem;
  font-weight: 950;
}

.quick-add-product:hover {
  border-color: #165dff;
  background: #dff0ea;
}

.quick-add-product[hidden] {
  display: none;
}

.barcode-scan-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.55fr);
  gap: 10px;
  align-items: end;
  margin: 0 0 10px;
  padding: 10px;
  border: 1px solid #c7d8f7;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(22, 93, 255, 0.1), transparent 68%),
    #fbfcff;
}

.barcode-scan-box .field {
  margin: 0;
}

.barcode-scan-box input {
  font-size: 0.95rem;
  font-weight: 800;
}

.barcode-scan-box span {
  min-height: 38px;
  display: grid;
  place-items: center;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  font-weight: 750;
  text-align: center;
  font-size: 0.86rem;
}

.barcode-scan-box span.ok {
  color: #165dff;
  background: #edf3ff;
  border-color: #c7d8f7;
}

.barcode-scan-box span.bad {
  color: #b7362b;
  background: #fff6f4;
  border-color: #f3c7c1;
}

.table-search-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin: 10px 0 12px;
}

.table-search-bar .field {
  margin: 0;
}

.table-search-bar .muted {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  white-space: nowrap;
}

.expense-filter-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(150px, 0.8fr) minmax(150px, 0.8fr);
  gap: 12px;
  align-items: end;
  margin: 10px 0 14px;
}

.expense-filter-panel .field {
  margin: 0;
}

.expense-filter-total {
  min-height: 64px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #edf3ff;
}

.expense-filter-total span,
.expense-filter-total small {
  color: var(--muted);
  font-weight: 750;
}

.expense-filter-total strong {
  font-size: 1.18rem;
}

.expense-date-panel {
  display: grid;
  grid-template-columns: minmax(360px, 1.4fr) minmax(150px, 0.5fr) minmax(150px, 0.5fr) minmax(190px, 0.7fr) auto;
  gap: 12px;
  align-items: end;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.expense-date-panel .field {
  margin: 0;
}

.period-dropdown {
  display: grid;
  gap: 5px;
  min-width: 220px;
}

.period-dropdown span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.period-dropdown select {
  width: 100%;
  min-height: 44px;
  padding: 9px 38px 9px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.expense-period-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.expense-period-tabs button {
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid #d8e2f2;
  background: #eef2ef;
  color: var(--ink);
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.expense-period-tabs button:hover,
.expense-period-tabs button:focus-visible,
.expense-period-tabs button.active {
  border-color: var(--accent-3);
  background: #fff3d8;
  color: var(--ink);
  box-shadow: inset 0 -3px 0 var(--accent-3);
}

.expense-period-tabs button:focus-visible {
  outline: 2px solid var(--accent-3);
  outline-offset: 2px;
}

.expense-period-label {
  min-height: 64px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #edf3ff;
}

.expense-period-label span {
  color: var(--muted);
  font-weight: 800;
}

.expense-period-label strong {
  color: var(--primary);
  font-size: 0.98rem;
  overflow-wrap: anywhere;
}

.expense-command-hero {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 16px;
  margin: 0 0 12px;
  padding: 16px;
  border: 1px solid #d8e2f2;
  border-radius: 8px;
  background:
    linear-gradient(135deg, #edf3ff, #fff),
    repeating-linear-gradient(135deg, rgba(22, 93, 255, 0.08) 0 2px, transparent 2px 18px);
}

.expense-command-hero h3 {
  margin: 2px 0 5px;
  font-size: 1.35rem;
}

.expense-hero-total {
  min-width: 220px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #071e49;
  color: #fff;
}

.expense-hero-total span,
.expense-hero-total small {
  color: #dfe9ff;
  font-weight: 800;
}

.expense-hero-total strong {
  font-size: 1.45rem;
}

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

.expense-kpi-grid article {
  min-height: 92px;
  display: grid;
  align-content: space-between;
  gap: 7px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.expense-kpi-grid article.accent {
  border-color: #d8e2f2;
  background: #edf3ff;
}

.expense-kpi-grid article.warn {
  border-color: #f3dfab;
  background: #fff8e6;
}

.expense-kpi-grid span,
.expense-kpi-grid small {
  color: var(--muted);
  font-weight: 800;
}

.expense-kpi-grid strong {
  color: var(--ink);
  font-size: 1.12rem;
  overflow-wrap: anywhere;
}

.expense-insight-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(280px, 0.85fr);
  gap: 12px;
  margin-bottom: 14px;
}

.expense-insight-grid article {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.panel-head.compact {
  margin-bottom: 10px;
}

.panel-head.compact h3 {
  font-size: 1rem;
}

.expense-bars,
.expense-recommendations {
  display: grid;
  gap: 9px;
}

.expense-bar-row {
  display: grid;
  gap: 6px;
}

.expense-bar-row div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.expense-bar-row strong,
.expense-bar-row small {
  display: block;
}

.expense-bar-row small {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.expense-bar-row i {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2ef;
}

.expense-bar-row b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #165dff, #42a58b);
}

.expense-recommendations p {
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid #edf0ee;
  color: var(--ink);
  font-weight: 750;
}

.expense-recommendations p:last-child {
  border-bottom: 0;
}

.expense-pill {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 4px 9px;
  border-radius: 8px;
  background: #edf3ff;
  color: var(--primary);
  font-weight: 850;
}

.expense-pill.soft {
  background: #f4f0e3;
  color: #815600;
}

.expense-amount {
  color: #b7362b;
  white-space: nowrap;
}

.purchase-filter-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(170px, 0.8fr) minmax(150px, 0.65fr) minmax(150px, 0.65fr);
  gap: 12px;
  align-items: end;
  margin: 10px 0 14px;
}

.purchase-filter-panel .field {
  margin: 0;
}

.purchase-period-dropdown { grid-column: 1 / -1; }

.purchase-period-tabs button {
  min-height: 42px;
  padding: 0 9px;
  border: 1px solid #d8e2f2;
  background: #eef2ef;
  color: var(--ink);
}

.purchase-period-tabs button:hover,
.purchase-period-tabs button:focus-visible,
.purchase-period-tabs button.active {
  border-color: var(--accent-3);
  background: #fff3d8;
  color: var(--ink);
  box-shadow: inset 0 -3px 0 var(--accent-3);
}

.purchase-clear-period {
  min-height: 42px;
}

.purchase-command {
  display: grid;
  gap: 14px;
  margin-top: 8px;
}

.purchase-command-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.34fr);
  gap: 14px;
  align-items: stretch;
  padding: 18px;
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(7, 30, 73, 0.96), rgba(22, 93, 255, 0.85)),
    repeating-linear-gradient(135deg, rgba(245, 179, 61, 0.18) 0 2px, transparent 2px 24px);
}

.purchase-command-hero h3 {
  margin: 2px 0 6px;
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
}

.purchase-command-hero p,
.purchase-command-hero .eyebrow {
  color: #dfe9ff;
}

.purchase-command-debt {
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.purchase-command-debt span,
.purchase-command-debt small {
  color: #dfe9ff;
  font-weight: 800;
}

.purchase-command-debt strong {
  color: #fff;
  font-size: 1.6rem;
}

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

.purchase-insight-grid article {
  min-height: 188px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.purchase-insight-grid .panel-head {
  margin-bottom: 10px;
}

.panel-head.compact h4 {
  font-size: 0.98rem;
}

.purchase-insight-row,
.purchase-aging-row {
  display: grid;
  gap: 7px;
  padding: 10px 0;
  border-top: 1px solid #edf1ee;
}

.purchase-insight-row:first-child,
.purchase-aging-row:first-child {
  border-top: 0;
}

.purchase-insight-row {
  grid-template-columns: minmax(0, 1fr) minmax(120px, 0.55fr);
  align-items: center;
}

.purchase-insight-row span,
.purchase-aging-row span {
  min-width: 0;
}

.purchase-insight-row small {
  display: block;
  color: var(--muted);
  font-weight: 700;
}

.purchase-insight-row i,
.purchase-aging-row i {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2ee;
}

.purchase-insight-row em,
.purchase-aging-row em {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #b7362b;
}

.purchase-aging-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.purchase-aging-row i {
  grid-column: 1 / -1;
}

.purchase-aging-row.danger strong {
  color: #b7362b;
}

.purchase-reading {
  background: #edf3ff !important;
  border-color: #d8e2f2 !important;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  background: #fff3d8;
  color: #795314;
  font-weight: 750;
  font-size: 0.85rem;
}

.product-grid {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 8px;
  max-height: 330px;
  min-height: 0;
  overflow: auto;
  padding: 8px;
  border: 1px solid #cfded8;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 32px rgba(15, 39, 33, 0.16);
}

.product-grid[hidden] {
  display: none;
}

.product-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 3px 10px;
  min-height: 72px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
  text-align: left;
}

.product-card:hover {
  border-color: var(--accent);
}

.product-card strong {
  font-size: 0.9rem;
  line-height: 1.08;
  grid-column: 1;
}

.product-card span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.15;
  grid-column: 1;
}

.product-card .product-code {
  color: var(--primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 850;
}

.product-card.no-stock-control {
  border-color: rgba(22, 93, 255, 0.28);
  background: linear-gradient(135deg, rgba(22, 93, 255, 0.07), #fbfcff 62%);
}

.stock-free {
  color: var(--accent);
  font-weight: 800;
}

.sale-missing-product {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  min-height: 126px;
  padding: 16px;
  border: 1px dashed #c7d8f7;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(22, 93, 255, 0.1), transparent 70%),
    #fbfcff;
}

.sale-missing-product div {
  display: grid;
  gap: 5px;
}

.sale-missing-product span,
.sale-missing-product small {
  color: var(--muted);
  font-weight: 800;
}

.sale-missing-product strong {
  font-size: 1.15rem;
}

.product-card b {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 1.02rem;
  white-space: nowrap;
}

.product-card small {
  grid-column: 1;
}

.checkout-panel {
  position: static;
  align-self: start;
  border-top: 4px solid var(--brand-blue);
  display: grid;
  gap: 10px;
  max-width: none;
}

.sale-workspace-panel {
  min-height: calc(100vh - 210px);
}

.counter-order-host {
  margin-bottom: 12px;
}

.counter-order-head {
  align-items: center;
}

.counter-order-count {
  min-width: 112px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff2cf;
  color: #7f5700;
  font-weight: 900;
  text-align: center;
}

.counter-order-list {
  display: grid;
  border-top: 1px solid #e1e9e5;
}

.counter-order-operational-list {
  max-height: 430px;
  overflow: auto;
}

.counter-order-empty {
  min-height: 54px;
  display: grid;
  place-items: center;
  border-top: 1px solid #e1e9e5;
  color: var(--muted);
  font-weight: 750;
  text-align: center;
}

.counter-order-row {
  display: grid;
  grid-template-columns: 90px minmax(180px, 1.2fr) minmax(160px, 1fr) minmax(130px, 0.7fr) minmax(150px, 0.8fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 76px;
  padding: 10px 0;
  border-bottom: 1px solid #e1e9e5;
}

.counter-order-row > div:not(.row-actions) {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.counter-order-row span:not(.status),
.counter-order-row small {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.counter-order-row strong {
  overflow-wrap: anywhere;
}

.counter-order-number strong {
  font-size: 1.15rem;
}

.counter-order-history {
  margin-top: 10px;
  border-top: 1px solid #e1e9e5;
}

.counter-order-history summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 48px;
  padding: 8px 2px;
  color: var(--muted);
  font-weight: 850;
  cursor: pointer;
  list-style: none;
}

.counter-order-history summary::-webkit-details-marker {
  display: none;
}

.counter-order-history summary::before {
  content: "+";
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  border-radius: 6px;
  background: #edf3f0;
  color: var(--ink);
  font-size: 1.05rem;
}

.counter-order-history[open] summary::before {
  content: "−";
}

.counter-order-history summary span {
  margin-right: auto;
}

.counter-order-history summary strong {
  color: var(--ink);
  font-size: 0.82rem;
}

.counter-order-history-list {
  max-height: 300px;
  overflow: auto;
  border-bottom: 1px solid #e1e9e5;
}

.counter-order-history-list .counter-order-row {
  min-height: 66px;
  opacity: 0.86;
}

.counter-order-history-empty {
  margin: 0;
  padding: 12px 2px 16px;
}

.active-counter-order-notice {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid #e9ca72;
  border-radius: 8px;
  background: #fff8e6;
}

.active-counter-order-notice > div {
  display: grid;
  gap: 3px;
}

.active-counter-order-notice small {
  color: var(--muted);
  font-weight: 750;
}

.sale-flow-step {
  padding: 12px;
  border: 1px solid #d8e2f2;
  border-radius: 8px;
  background: #fff;
}

.sale-customer-step {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(320px, 1fr);
  gap: 20px;
  align-items: center;
  background: #fbfcff;
}

.sale-step-heading {
  display: grid;
  gap: 2px;
}

.sale-step-heading h3,
.sale-step-heading p {
  margin: 0;
}

.sale-details-step {
  display: grid;
  gap: 10px;
}

.sale-customer-step .sale-customer-field,
.sale-customer-step .select-add-row {
  margin: 0;
}

.sale-product-picker {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #d8e2f2;
  border-radius: 8px;
  background: #fbfcff;
}

.sale-product-toolbar {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(230px, 0.42fr);
  gap: 8px;
  align-items: start;
}

.sale-product-toolbar input,
.sale-product-toolbar select {
  min-width: 0;
}

.sale-product-lookup {
  position: relative;
  min-width: 0;
}

.sale-scan-status {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.checkout-panel h3 {
  font-size: 1.18rem;
}

.sale-cash-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 0;
}

.sale-cash-card {
  display: grid;
  gap: 3px;
  min-height: 58px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #edf3ff;
}

.sale-cash-card span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.sale-cash-card strong {
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.cart-list,
#cash-summary,
#cash-detail,
#cash-movements,
#cash-closures,
#cash-overview,
#stock-alerts,
#rubric-summary,
#top-products,
#insights,
#sale-payments,
#payment-summary,
.quick-sale {
  display: grid;
  gap: 10px;
}

.cash-audit-filters {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) minmax(150px, 0.7fr) minmax(190px, 0.9fr) minmax(140px, 0.65fr) minmax(140px, 0.65fr);
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #deebe5;
  border-radius: 8px;
  background:
    linear-gradient(180deg, #fbfcff, #f5faf7),
    repeating-linear-gradient(135deg, rgba(22, 93, 255, 0.04) 0 2px, transparent 2px 18px);
}

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

.cash-audit-summary article {
  display: grid;
  gap: 6px;
  min-height: 92px;
  padding: 14px;
  border: 1px solid #deebe5;
  border-radius: 8px;
  background: #fbfcff;
}

.cash-audit-summary article.danger {
  border-color: #f0cac4;
  background: #fff6f4;
}

.cash-audit-summary span,
.cash-audit-summary small,
.cash-method-row small {
  color: var(--muted);
  font-weight: 850;
}

.cash-audit-summary strong {
  font-size: 1.35rem;
}

.cash-audit-summary article.danger strong {
  color: #b2392e;
}

.cash-audit-methods,
.cash-audit-list {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.cash-method-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid #edf1ee;
}

.cash-method-row:first-of-type {
  border-top: 0;
}

.cash-method-row span {
  display: grid;
  gap: 3px;
}

.cash-method-row b {
  color: var(--primary);
  white-space: nowrap;
}

.cash-audit-row strong.positive {
  color: var(--primary);
}

.cash-audit-row strong.negative {
  color: #b2392e;
}

.checkout-panel .cart-list {
  min-height: 180px;
  max-height: 310px;
  overflow: auto;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.service-checkout-notice {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin: 12px 0;
  padding: 14px;
  border: 1px solid #d8e2f2;
  border-radius: 8px;
  background:
    linear-gradient(90deg, #edf3ff, #fbfcff),
    repeating-linear-gradient(135deg, rgba(22, 93, 255, 0.08) 0 2px, transparent 2px 18px);
}

.service-checkout-notice span,
.service-checkout-notice small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.service-checkout-notice strong {
  display: block;
  margin: 3px 0;
  color: var(--ink);
}

.remittance-panel {
  display: grid;
  gap: 14px;
  border-top: 4px solid var(--primary);
}

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

.remittance-command article {
  display: grid;
  gap: 6px;
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #edf3ff, #fff),
    repeating-linear-gradient(135deg, rgba(22, 93, 255, 0.08) 0 2px, transparent 2px 18px);
}

.remittance-command span,
.remittance-command small,
.remittance-group-head small {
  color: var(--muted);
  font-weight: 800;
}

.remittance-command strong {
  font-size: 1.25rem;
  overflow-wrap: anywhere;
}

.remittance-group,
.remittance-invoices {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.remittance-group-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.remittance-group-head strong,
.remittance-group-head small {
  display: block;
}

.cart-table-head,
.cart-product-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.14fr) minmax(220px, 1.08fr) minmax(140px, 0.72fr) minmax(80px, 0.5fr) minmax(100px, 0.64fr) minmax(105px, 0.62fr) minmax(110px, 0.68fr);
  gap: 10px;
  align-items: center;
}

.cart-table-head {
  padding: 0 0 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.cart-row {
  padding: 8px 0;
  border-bottom: 1px solid #edf0ee;
}

.list-row {
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #edf0ee;
}

.cart-item-main {
  position: relative;
  display: grid;
  gap: 5px;
  min-width: 0;
  padding-right: 34px;
}

.cart-item-main strong {
  font-size: 1.02rem;
}

.cart-item-main small {
  color: var(--muted);
  font-weight: 850;
}

.cart-row-subtotal {
  justify-self: stretch;
  padding: 10px 12px;
  border-radius: 8px;
  background: #edf3ff;
  text-align: right;
  white-space: nowrap;
}

.cart-line-final {
  justify-self: stretch;
  padding: 11px 12px;
  border-radius: 8px;
  background: var(--brand-blue);
  color: #fff;
  font-size: 1rem;
  text-align: right;
  white-space: nowrap;
}

.cart-row-subtotal strong,
.cart-row-subtotal small,
.cart-vat-field small {
  display: block;
}

.cart-row-subtotal small,
.cart-vat-field small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.cart-cell-field {
  position: relative;
  display: block;
  min-width: 0;
}

.cart-cell-field input,
.cart-cell-field select {
  width: 100%;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
  font: inherit;
  font-weight: 850;
}

.cart-discount-field input {
  padding-right: 26px;
}

.cart-discount-field > span {
  position: absolute;
  top: 50%;
  right: 9px;
  color: var(--muted);
  font-weight: 900;
  transform: translateY(-50%);
}

.cart-item-main .cart-remove {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
}

.cart-total-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.14fr) minmax(220px, 1.08fr) minmax(140px, 0.72fr) minmax(80px, 0.5fr) minmax(100px, 0.64fr) minmax(105px, 0.62fr) minmax(110px, 0.68fr);
  gap: 10px;
  align-items: center;
  margin-top: 4px;
  padding-top: 12px;
}

.cart-total-row strong:first-child {
  grid-column: 1 / 7;
}

.cart-total-row strong:last-child {
  grid-column: 7;
  justify-self: stretch;
  padding: 12px 14px;
  border-radius: 8px;
  background: #165dff;
  color: white;
  font-size: 1.18rem;
  text-align: right;
}

.service-cart-row {
  align-items: center;
}

.cart-row button {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #f3e5e2;
  color: #9b2d21;
}

.cart-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  justify-content: flex-start;
}

.cart-qty-field {
  display: grid;
  grid-template-columns: 64px 70px;
  align-items: center;
  gap: 6px;
  width: 140px;
  min-width: 140px;
}

.cart-qty-field input {
  width: 64px;
  min-height: 38px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 900;
  text-align: center;
  background: #fbfcff;
}

.cart-unit-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 70px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #edf2ef;
}

.cart-row .cart-unit-switch button {
  width: auto;
  height: 30px;
  min-width: 0;
  padding: 0 4px;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
}

.cart-row .cart-unit-switch button:hover {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.cart-row .cart-unit-switch button.is-active {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 1px 3px rgba(7, 30, 73, 0.18);
}

.cart-qty-field small,
.cart-cell-field small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-align: center;
}

.cart-input-with-unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  overflow: hidden;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.cart-cell-field .cart-input-with-unit input {
  min-width: 0;
  min-height: 36px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.cart-input-with-unit small {
  display: grid;
  min-width: 54px;
  place-items: center;
  padding: 0 9px;
  border-left: 1px solid var(--line);
  background: #edf3ff;
  color: var(--accent);
  white-space: nowrap;
}

.cart-scale-reading {
  color: var(--green) !important;
  font-weight: 800;
}

.field {
  display: grid;
  gap: 7px;
  margin: 12px 0;
  color: var(--muted);
  font-weight: 650;
}

.field[hidden] {
  display: none;
}

.select-add-field {
  align-content: start;
}

.select-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
}

.select-add-row .icon-button {
  align-self: end;
  font-weight: 900;
  color: #165dff;
}

.sale-customer-field {
  margin-bottom: 0;
}

.service-customer-picker {
  padding: 14px;
  border: 1px solid #d8e2f2;
  border-radius: 8px;
  background:
    linear-gradient(180deg, #edf3ff, #fff),
    repeating-linear-gradient(135deg, rgba(22, 93, 255, 0.08) 0 2px, transparent 2px 18px);
}

.service-customer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  gap: 10px;
  align-items: center;
}

.service-customer-row .icon-button {
  width: 46px;
  height: 46px;
  align-self: stretch;
  color: var(--accent);
  font-size: 24px;
  font-weight: 900;
}

.service-customer-help {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 800;
}

.payment-box {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.sale-type-help {
  display: grid;
  gap: 3px;
  margin-top: -4px;
  padding: 9px 11px;
  border: 1px solid #deebe5;
  border-radius: 8px;
  background: #f4faf7;
}

.sale-type-help:empty {
  display: none;
}

.sale-type-help strong {
  color: var(--ink);
}

.sale-type-help span {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.86rem;
}

.installment-box {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.installment-box[hidden] {
  display: none;
}

.credit-limit-box {
  display: grid;
  gap: 5px;
  margin: 0 0 10px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #edf3ff;
}

.credit-limit-box.bad {
  background: #fde8e4;
}

.credit-limit-box span,
.credit-limit-box small {
  color: var(--muted);
  font-weight: 750;
}

.credit-limit-box strong {
  font-size: 1.05rem;
}

.compact-head {
  margin-bottom: 0;
}

.compact-head h3 {
  font-size: 1rem;
}

.payment-row {
  display: block;
  padding: 8px;
  border: 1px solid #edf0ee;
  border-radius: 8px;
  background: #fff;
}

.payment-main-row {
  display: grid;
  grid-template-columns: minmax(118px, 0.9fr) minmax(150px, 1fr) minmax(108px, 0.8fr) 38px;
  gap: 8px;
}

.payment-row button {
  min-height: 36px;
}

.payment-row.is-current-account {
  border-color: #bfe0d5;
  background: #edf3ff;
}

.payment-row.is-current-account select:disabled,
.payment-row.is-current-account input:disabled {
  color: #49635b;
  opacity: 1;
  background: #f8fcfa;
}

.payment-row.is-cheque {
  border-color: #e2cf91;
  background: #fffdf5;
}

.cheque-payment-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border-top: 1px solid #eadfb8;
}

.cheque-payment-title {
  grid-column: 1 / -1;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.cheque-payment-title div {
  display: grid;
  gap: 2px;
}

.cheque-payment-title small {
  color: var(--muted);
  font-weight: 750;
}

.receivable-payment-modal {
  width: min(980px, calc(100vw - 32px));
}

.receivable-payment-form {
  display: grid;
  gap: 14px;
}

.receivable-payment-form .receivable-operation-alert {
  margin: 0;
}

.cheque-portfolio-field {
  align-content: center;
  min-height: 76px;
  padding: 10px 12px;
  border: 1px solid #e2cf91;
  background: #fff8df;
}

.cheque-portfolio-field span,
.cheque-portfolio-field small {
  color: var(--muted);
}

.cheque-portfolio-field strong {
  font-size: 1rem;
}

.receivable-cheque-fields {
  margin-top: 0;
  border: 1px solid #eadfb8;
  background: #fffdf5;
}

.checkout-panel {
  padding: 14px;
}

.sale-panel-head {
  margin-bottom: 10px;
}

.sale-panel-head h3 {
  font-size: 1.12rem;
}

.sale-create-product {
  min-height: 42px;
  padding-inline: 14px;
}

.checkout-fields {
  display: grid;
  grid-template-columns: minmax(220px, 1.25fr) minmax(170px, 0.85fr) minmax(190px, 0.9fr);
  gap: 9px;
  align-items: end;
}

.product-transfer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.checkout-fields .field {
  margin: 0;
}

.checkout-fields .sale-category-field {
  grid-column: span 1;
}

.checkout-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding-top: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), var(--panel) 38%);
}

.sale-document-shortcuts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.sale-shortcut-button {
  min-width: 0;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.sale-shortcut-button:hover,
.sale-shortcut-button:focus-visible {
  border-color: var(--accent-3);
  background: #fff6dc;
}

.sale-shortcut-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.sale-shortcut-button kbd {
  min-width: 34px;
  padding: 5px 7px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  line-height: 1;
  text-align: center;
}

.checkout-actions .primary {
  min-height: 50px;
  font-size: 1.05rem;
}

@media (max-width: 680px) {
  .sale-document-shortcuts {
    grid-template-columns: 1fr;
  }

  .sale-shortcut-button {
    justify-content: flex-start;
    padding-inline: 14px;
  }
}

.checkout-panel .select-add-row {
  grid-template-columns: minmax(0, 1fr) 42px;
}

.payment-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
}

.payment-totals span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-weight: 750;
  font-size: 1rem;
}

.payment-totals strong {
  color: var(--ink);
  font-size: 1.2rem;
}

.payment-totals strong.negative {
  color: #b7362b;
}

.product-import-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.product-import-summary article {
  display: grid;
  gap: 5px;
  min-height: 88px;
  padding: 13px;
  border: 1px solid #deebe5;
  border-radius: 8px;
  background: #fbfcff;
}

.product-import-summary article.bad {
  border-color: #f1c8c2;
  background: #fff4f2;
}

.product-import-summary span,
.product-import-help span {
  color: var(--muted);
  font-weight: 800;
}

.product-import-summary strong {
  font-size: 1.55rem;
}

.product-import-help,
.product-import-errors {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 8px;
}

.product-import-help {
  border: 1px solid #d8e2f2;
  background: #edf3ff;
}

.product-import-errors {
  border: 1px solid #f1c8c2;
  background: #fff4f2;
}

.product-import-errors p {
  margin: 0;
  color: #9b2d21;
  font-weight: 750;
}

.product-import-preview {
  max-height: 360px;
  overflow: auto;
}

.users-command {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 10px;
}

.users-command article {
  display: grid;
  gap: 6px;
  min-height: 102px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.users-command article:first-child {
  background: linear-gradient(135deg, #edf3ff, #fbfcff);
  border-color: #d8e2f2;
}

.users-command article.warn {
  background: #fff7e2;
  border-color: #f3dfab;
}

.users-command span,
.users-command small,
.users-note {
  color: var(--muted);
  font-weight: 750;
}

.users-command strong {
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1;
}

.user-identity-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 210px;
}

.user-identity-cell > span {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #e5f4ec;
  color: #0f7d66;
  font-weight: 900;
}

.user-identity-cell strong,
.user-identity-cell small {
  display: block;
}

.user-identity-cell small {
  max-width: 210px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.role-pill,
.branch-pill,
.seller-pill,
.user-status-pill,
.permission-tags span,
.permission-tags strong {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 9px;
  border-radius: 8px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.role-pill,
.branch-pill,
.permission-tags span {
  background: #f0f4f2;
  color: var(--ink);
}

.seller-pill {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  background: #edf3ff;
  color: #0f7d66;
}

.seller-pill small {
  color: #2f7f68;
  font-size: 0.76rem;
  font-weight: 800;
}

.user-status-pill.ok {
  background: #e5f4ec;
  color: #147446;
}

.user-status-pill.bad {
  background: #fce2de;
  color: #a43327;
}

.permission-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 440px;
}

.permission-tags strong {
  background: #fff2d0;
  color: #815600;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  max-width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 100%;
  table-layout: auto;
  font-size: 0.92rem;
}

th,
td {
  padding: 10px 10px;
  border-bottom: 1px solid #edf0ee;
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
  word-break: normal;
}

th {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0;
  white-space: nowrap;
}

td {
  line-height: 1.22;
}

.status {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.76rem;
}

.ok {
  background: #e5f4ec;
  color: #147446;
}

.warn {
  background: #fff2d0;
  color: #815600;
}

.bad {
  background: #fce2de;
  color: #a43327;
}

.delivery-pending {
  background: #f8d7d2;
  color: #a62f24;
  border: 1px solid #eeb8b0;
}

.service-status-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.service-status-cell .status {
  white-space: nowrap;
}

.service-intake-attention {
  border: 1px solid #e9aaa2;
  background: #fce2de;
  color: #a43327;
}

.service-attention-note {
  display: inline-block;
  color: #a62f24;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.15;
}

.delivery-action {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 14px;
  background: #b83227;
  color: #fff;
  font-weight: 800;
}

.delivery-pending-callout {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid #e9aaa2;
  border-left: 5px solid #b83227;
  border-radius: 8px;
  background: #fff3f1;
  color: #8f291f;
}

.delivery-pending-callout strong {
  font-size: 1rem;
}

.crm-page {
  display: grid;
  gap: 14px;
}

.crm-command {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border: 1px solid #d8e2f2;
  border-radius: 8px;
  background:
    linear-gradient(135deg, #edf3ff, #fff),
    repeating-linear-gradient(135deg, rgba(22, 93, 255, 0.08) 0 2px, transparent 2px 18px);
}

.crm-command h3 {
  margin: 2px 0 6px;
  font-size: 1.25rem;
}

.crm-summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.crm-alert-list,
.crm-seller-list,
.crm-task-list,
.crm-opportunity-list,
.crm-stage-list {
  display: grid;
  gap: 8px;
}

.crm-alert,
.crm-seller-row,
.crm-task-row,
.crm-opportunity-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.crm-alert.ok {
  border-color: #d8e2f2;
  background: #edf3ff;
}

.crm-alert.warn,
.crm-task-row.overdue {
  border-color: #f3dfab;
  background: #fff7e2;
}

.crm-alert.bad {
  border-color: #efc6bf;
  background: #fff0ed;
}

.crm-alert strong,
.crm-alert small,
.crm-seller-row strong,
.crm-seller-row small,
.crm-task-row strong,
.crm-task-row small,
.crm-opportunity-line strong,
.crm-opportunity-line small {
  display: block;
}

.crm-alert small,
.crm-seller-row small,
.crm-task-row small,
.crm-opportunity-line small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.crm-seller-row b,
.crm-opportunity-line b {
  color: var(--accent);
  white-space: nowrap;
}

.crm-pipeline {
  display: grid;
  grid-template-columns: repeat(7, minmax(210px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.crm-stage {
  display: grid;
  gap: 10px;
  min-width: 210px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.crm-stage header {
  display: grid;
  gap: 4px;
  padding: 4px 2px 8px;
  border-bottom: 1px solid #e5eeea;
}

.crm-stage header span,
.crm-stage header small {
  color: var(--muted);
  font-weight: 850;
}

.crm-stage header strong {
  color: var(--ink);
}

.crm-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #dbe8e3;
  border-radius: 8px;
  background: #fff;
}

.crm-card-head,
.crm-card-money,
.crm-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.crm-card-head span {
  padding: 5px 8px;
  border-radius: 8px;
  background: #e5f4ec;
  color: #147446;
  font-size: 0.76rem;
  font-weight: 900;
}

.crm-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 750;
}

.crm-card-money b {
  color: var(--ink);
}

.crm-card-money small {
  color: var(--accent);
  font-weight: 850;
}

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

.crm-card-actions button,
.crm-task-row button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 0.8rem;
}

.crm-empty-stage {
  padding: 12px;
  border: 1px dashed #d8e4df;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 750;
  text-align: center;
}

.quote-board {
  display: grid;
  gap: 12px;
}

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

.quote-summary-strip div,
.quote-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.quote-summary-strip div {
  padding: 14px;
}

.quote-summary-strip span,
.quote-card small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.quote-summary-strip strong {
  display: block;
  margin-top: 4px;
  font-size: 1.35rem;
  color: var(--ink);
}

.quote-list {
  display: grid;
  gap: 10px;
}

.quote-card {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(150px, 0.45fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
}

.quote-card.converted {
  border-color: #d8e2f2;
  background: #eff8f4;
}

.quote-card strong {
  display: block;
  color: var(--ink);
}

.quote-card-detail {
  display: grid;
  gap: 4px;
  justify-items: start;
}

.cash-control {
  display: grid;
  grid-template-columns: 1fr 1fr 120px 120px;
  gap: 10px;
  align-items: end;
  margin-bottom: 16px;
}

.cash-control.compact {
  grid-template-columns: 130px minmax(0, 1fr) 130px 170px 110px;
}

.cash-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.cash-card {
  min-height: 118px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(32, 44, 40, 0.06);
}

.cash-card span {
  color: var(--muted);
  font-weight: 750;
}

.cash-card strong {
  font-size: 1.75rem;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.cash-card.positive strong,
.positive {
  color: var(--success);
}

.cash-card.negative strong,
.negative {
  color: #b7362b;
}

.cash-layout {
  grid-template-columns: minmax(520px, 1.15fr) minmax(360px, 0.85fr);
  align-items: start;
}

.cash-layout > .panel {
  border-top: 4px solid var(--primary);
  box-shadow: 0 16px 34px rgba(24, 38, 33, 0.08);
}

.cash-layout > .panel:last-child {
  border-top-color: var(--accent);
  background:
    linear-gradient(180deg, #fbfcff, #fff),
    repeating-linear-gradient(135deg, rgba(22, 93, 255, 0.04) 0 2px, transparent 2px 18px);
}

.cash-open-grid,
.cash-move-grid {
  display: grid;
  gap: 12px;
  align-items: end;
}

.cash-open-grid {
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.2fr);
}

.cash-open-grid button {
  width: 100%;
}

.cash-move-grid {
  grid-template-columns: minmax(140px, 0.8fr) minmax(180px, 1fr) minmax(150px, 0.75fr);
  padding: 12px;
  border: 1px solid #deebe5;
  border-radius: 8px;
  background: #fbfcff;
}

.cash-move-grid button {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
}

.cash-move-grid .field:nth-child(5),
.cash-move-grid .field:nth-child(6) {
  grid-column: 1 / -1;
}

.cash-move-grid .primary {
  margin-top: 4px;
}

.cash-summary-list {
  margin-top: 8px;
  display: grid;
  gap: 2px;
}

.cash-help {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #edf3ff;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.cash-summary-list .list-row {
  min-height: 48px;
}

.cash-close-form {
  display: grid;
  gap: 14px;
}

.cash-close-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(7, 30, 73, 0.96), rgba(22, 93, 255, 0.9)),
    repeating-linear-gradient(135deg, rgba(245, 179, 61, 0.18) 0 2px, transparent 2px 20px);
  color: #fff;
}

.cash-close-hero h4 {
  margin: 2px 0 4px;
  font-size: 1.45rem;
}

.cash-close-hero p,
.cash-close-hero .eyebrow {
  margin: 0;
  color: #cfe5dd;
}

.cash-close-hero strong {
  font-size: 1.7rem;
}

.cash-close-grid,
.cash-close-inputs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.cash-close-grid article {
  min-height: 92px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.cash-close-grid span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.cash-close-grid strong {
  font-size: 1.1rem;
}

.cash-close-explain {
  display: grid;
  gap: 5px;
  padding: 14px;
  border-radius: 8px;
  background: #edf3ff;
  color: var(--ink);
}

.cash-close-breakdown {
  display: grid;
}

.cash-close-breakdown section {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.cash-close-breakdown h4 {
  margin: 0 0 6px;
}

.cash-close-breakdown .list-row {
  min-height: 42px;
}

.cash-close-explain span {
  color: var(--muted);
}

.cash-close-inputs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cash-close-inputs .field {
  margin: 0;
}

.cash-close-inputs .full-row {
  grid-column: 1 / -1;
}

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

.treasury-tabs {
  width: max-content;
  max-width: 100%;
}

.treasury-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.treasury-tabs button span {
  min-width: 24px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #e2eee9;
  color: var(--ink);
  text-align: center;
  font-size: 0.75rem;
}

.treasury-tabs button.active span {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.cheque-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.32fr);
  gap: 22px;
  align-items: center;
  padding: 22px;
  border-radius: 8px;
  color: #fff;
  background: #071e49;
}

.cheque-hero h2,
.cheque-hero p {
  margin: 0;
}

.cheque-hero p:not(.eyebrow) {
  margin-top: 7px;
  color: #dfe9ff;
}

.cheque-hero-balance {
  display: grid;
  gap: 4px;
  padding-left: 22px;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
}

.cheque-hero-balance strong {
  font-size: 1.7rem;
}

.cheque-hero-balance small {
  color: #dfe9ff;
}

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

.cheque-summary-grid article {
  display: grid;
  gap: 5px;
  min-height: 104px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.cheque-summary-grid article strong {
  font-size: 1.25rem;
}

.cheque-summary-grid article small,
.cheque-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.cheque-control-panel,
.cheque-filters {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.cheque-filters {
  grid-template-columns: minmax(280px, 1fr) minmax(180px, 0.3fr);
}

.cheque-filters > *,
.cheque-filters input,
.cheque-filters select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.cheque-control-panel .table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

.cheque-status {
  display: inline-flex;
  padding: 6px 9px;
  border-radius: 6px;
  font-weight: 850;
  color: #67501b;
  background: #fff0c2;
}

.cheque-status.depositado {
  color: #315b79;
  background: #e2f0fa;
}

.cheque-status.acreditado {
  color: #116b4e;
  background: #dff2e9;
}

.cheque-status.rechazado {
  color: #ac3027;
  background: #fde1dc;
}

.cheque-detail-modal {
  width: min(900px, calc(100vw - 32px));
}

.cheque-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 16px;
  border-radius: 8px;
  background: #edf3ff;
}

.cheque-detail-head h3,
.cheque-detail-head p {
  margin: 3px 0 0;
}

.cheque-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.cheque-detail-grid div,
.cheque-rejection {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.cheque-detail-grid span,
.cheque-rejection span {
  color: var(--muted);
}

.cheque-rejection {
  margin-top: 12px;
  border-color: #efb9b2;
  background: #fff4f2;
}

.treasury-card {
  min-height: 118px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(22, 93, 255, 0.09), transparent 60%),
    #fff;
  box-shadow: 0 10px 28px rgba(32, 44, 40, 0.06);
}

.treasury-card span,
.treasury-card small {
  color: var(--muted);
  font-weight: 800;
}

.treasury-card strong {
  font-size: 1.45rem;
}

.branch-cash-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.branch-cash-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.branch-cash-card h4 {
  margin: 2px 0 4px;
  font-size: 1.2rem;
}

.branch-cash-card button {
  width: 100%;
}

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

.branch-cash-numbers div {
  display: grid;
  gap: 5px;
  padding: 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #edf1ee;
}

.branch-cash-numbers span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.branch-cash-numbers strong {
  font-size: 0.98rem;
  overflow-wrap: anywhere;
}

.branch-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.branch-summary-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(22, 93, 255, 0.08), transparent 65%),
    #fbfcff;
}

.branch-summary-top,
.branch-summary-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.branch-summary-top h4 {
  margin: 3px 0;
  font-size: 1.15rem;
}

.branch-summary-top small,
.branch-summary-footer small {
  color: var(--muted);
}

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

.branch-summary-numbers div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.branch-summary-numbers span {
  display: block;
  color: var(--muted);
  font-weight: 750;
  font-size: 0.8rem;
}

.branch-summary-numbers strong {
  display: block;
  margin-top: 5px;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.total-row {
  font-size: 1.06rem;
}

.reports-hero {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
}

.reports-hero h2 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.reports-filter {
  min-width: min(340px, 100%);
}

.reports-filter input {
  width: 100%;
}

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

.report-card {
  min-height: 116px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(22, 93, 255, 0.07), transparent 42%),
    #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 10px 28px rgba(32, 44, 40, 0.06);
}

.report-card:hover,
.report-card.active {
  background:
    linear-gradient(90deg, rgba(245, 179, 61, 0.16), rgba(22, 93, 255, 0.09)),
    #fff;
  border-color: rgba(22, 93, 255, 0.45);
  color: var(--ink);
}

.report-card:hover {
  transform: translateY(-1px);
}

.report-badge {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #071e49;
  color: #f5b33d;
  font-size: 0.9rem;
  font-weight: 950;
  letter-spacing: 0.03em;
}

.report-badge svg {
  width: 28px;
  height: 28px;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.report-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.report-card strong {
  font-size: 0.98rem;
}

.report-card small {
  color: var(--muted);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.report-arrow {
  align-self: end;
  padding: 6px 9px;
  border-radius: 8px;
  background: #eef2ef;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
}

.report-detail {
  display: grid;
  gap: 18px;
  border-top: 4px solid #165dff;
}

.report-page {
  display: grid;
  gap: 20px;
}

.report-page-head {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.report-page-head h2 {
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1;
}

.client-action-group {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: nowrap;
}

.client-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  min-width: 138px;
  padding: 9px 14px;
  border-radius: 10px;
  font-weight: 850;
  line-height: 1.15;
}

.client-action-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  flex: 0 0 20px;
}

.client-action-icon svg {
  width: 100%;
  height: 100%;
}

.client-action-button.points-action {
  border-color: #b9c9ee;
  background: #edf3ff;
  color: var(--primary);
}

.client-action-button.birthday-action {
  border-color: #ead39a;
  background: #fff7df;
  color: #8b6414;
}

.client-action-button.sale-action {
  border-color: #9ccdb5;
  background: #e8f7ef;
  color: #147044;
}

.report-period-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(150px, 220px)) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.report-period-panel > div {
  display: grid;
  gap: 4px;
}

.report-period-panel > div strong {
  font-size: 1.05rem;
}

.report-period-panel label {
  display: grid;
  gap: 5px;
}

.report-period-panel label span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.report-period-panel select,
.report-period-panel input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.category-report-controls {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) repeat(2, minmax(210px, 320px));
  gap: 14px;
  align-items: end;
  padding: 16px;
  border-left: 4px solid var(--accent);
  background: #edf3ff;
}

.category-report-controls > div {
  display: grid;
  gap: 4px;
}

.category-report-controls > div strong {
  font-size: 1.05rem;
}

.category-report-controls > div small,
.report-calculation-note {
  color: var(--muted);
  line-height: 1.4;
}

.category-report-controls label {
  display: grid;
  gap: 5px;
}

.category-report-controls label span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.category-report-controls select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.report-insights {
  display: grid;
  gap: 8px;
}

.report-visual-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.report-visual-grid.two-cards {
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.5fr);
}

.report-chart-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(32, 44, 40, 0.06);
}

.report-chart-card .panel-head {
  margin: 0;
}

.category-report-visuals {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.category-product-ranking {
  display: grid;
  gap: 2px;
}

.category-product-ranking > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
  padding: 10px 0;
  border-bottom: 1px solid #edf1ee;
}

.category-product-ranking > div:last-child {
  border-bottom: 0;
}

.category-product-ranking span {
  display: flex;
  min-width: 0;
  gap: 8px;
  align-items: center;
  font-weight: 800;
}

.category-product-ranking span b {
  display: inline-grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  border-radius: 6px;
  background: #fff1c9;
  color: #7a5200;
  font-size: 0.76rem;
}

.category-product-ranking small {
  grid-column: 1 / -1;
  padding-left: 32px;
  color: var(--muted);
}

.report-calculation-note {
  padding-top: 10px;
  border-top: 1px solid #edf1ee;
  font-size: 0.76rem;
}

.technical-category-visuals {
  align-items: stretch;
}

.technical-category-visuals .report-chart-card {
  min-height: 310px;
}

.technical-count-bar .report-bar div strong,
.technical-count-bar > div > strong {
  min-width: 28px;
  text-align: right;
}

.technical-report-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  border-left: 4px solid #efb43e;
  background: #fff8e7;
  color: var(--muted);
  line-height: 1.4;
}

.technical-report-note strong {
  color: var(--ink);
}

.report-bar {
  display: grid;
  gap: 8px;
}

.report-bar div,
.report-result-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.report-bar span,
.report-result-line span,
.account-bars span,
.profit-ring span {
  color: var(--muted);
  font-weight: 800;
}

.report-bar strong,
.report-result-line strong {
  white-space: nowrap;
}

.report-bar i {
  display: block;
  height: 12px;
  border-radius: 999px;
  background: #d8e2f2;
}

.report-bar.positive i {
  background: var(--success);
}

.report-bar.negative i {
  background: #b7362b;
}

.report-bar.neutral i {
  background: #f5b33d;
}

.report-result-line {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid #edf1ee;
}

.profit-command-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.7fr);
  gap: 14px;
}

.profit-command-card,
.profit-margin-card,
.profit-signal-grid article {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(32, 44, 40, 0.06);
}

.profit-command-card,
.profit-margin-card {
  display: grid;
  align-content: start;
  gap: 14px;
}

.profit-command-hero {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  padding: 18px;
  border-radius: 8px;
  background: linear-gradient(135deg, #10251f, #16856e);
  color: #fff;
}

.profit-command-hero div {
  display: grid;
  gap: 6px;
}

.profit-command-hero span:first-child {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 900;
}

.profit-command-hero strong {
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1;
}

.profit-command-hero strong.positive {
  color: #fff;
  text-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.profit-command-hero strong.negative {
  color: #ffe2dc;
}

.profit-total-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid #edf1ee;
}

.profit-total-row span {
  color: var(--muted);
  font-weight: 900;
}

.profit-total-row strong {
  font-size: 1.35rem;
  white-space: nowrap;
}

.profit-meter {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 8px;
  background: #fbfcff;
  border: 1px solid #deebe5;
}

.profit-meter-top {
  display: grid;
  gap: 2px;
}

.profit-meter-top strong {
  color: var(--ink);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
}

.profit-meter-track {
  position: relative;
  display: grid;
  grid-template-columns: 25fr 20fr 55fr;
  min-height: 52px;
  overflow: hidden;
  border: 1px solid #d8e2f2;
  border-radius: 8px;
  background: #f6faf8;
}

.profit-meter-track span {
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
}

.profit-meter-track .low {
  background: #b7362b;
}

.profit-meter-track .mid {
  background: #f0b94d;
  color: #3f3000;
}

.profit-meter-track .high {
  background: #165dff;
}

.profit-meter-track b {
  position: absolute;
  top: 5px;
  bottom: 5px;
  width: 4px;
  border-radius: 999px;
  background: #10251f;
  transform: translateX(-2px);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.85), 0 8px 18px rgba(16, 37, 31, 0.28);
}

.profit-meter-scale,
.profit-ratio-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.profit-meter-top span,
.profit-meter-scale span,
.profit-ratio-list span,
.profit-signal-grid span,
.profit-signal-grid small {
  color: var(--muted);
  font-weight: 800;
}

.profit-ratio-list {
  display: grid;
  gap: 10px;
}

.profit-ratio-list div {
  padding-bottom: 10px;
  border-bottom: 1px solid #edf1ee;
}

.profit-ratio-list div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.profit-signal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.profit-signal-grid article {
  display: grid;
  gap: 8px;
}

.profit-signal-grid strong {
  font-size: 1.3rem;
}

.ai-page {
  display: grid;
  gap: 16px;
}

.ai-hero {
  min-height: 180px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  padding: 24px;
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(7, 30, 73, 0.96), rgba(22, 93, 255, 0.84)),
    repeating-linear-gradient(135deg, rgba(245, 179, 61, 0.16) 0 2px, transparent 2px 24px);
}

.ai-hero h2 {
  margin: 4px 0;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 0.98;
}

.ai-hero p {
  max-width: 720px;
  margin: 0;
  color: #d8eee7;
  font-weight: 700;
}

.ai-hero strong,
.ai-feature-card span {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.ai-feature-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.ai-feature-card,
.ai-report-card {
  display: grid;
  align-content: start;
  gap: 9px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(32, 44, 40, 0.06);
}

.ai-feature-card span {
  width: 44px;
  height: 36px;
  display: grid;
  place-items: center;
  background: #edf3ff;
  color: var(--accent);
  font-weight: 900;
}

.ai-feature-card strong,
.ai-report-card strong {
  font-size: 1.05rem;
}

.ai-feature-card small,
.ai-report-card p {
  color: var(--muted);
  font-weight: 700;
}

.ai-chat-log {
  min-height: 330px;
  max-height: 430px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.ai-message {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.ai-message span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #dff1ea;
  color: var(--accent);
  font-weight: 900;
}

.ai-message p {
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  font-weight: 700;
}

.ai-message.user span {
  background: #1f2d29;
  color: #fff;
}

.ai-message.user p {
  background: #edf4f1;
}

.ai-chat-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.ai-chat-input input {
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.ai-settings-grid textarea {
  min-height: 96px;
}

.ai-check {
  align-self: end;
  min-height: 50px;
}

.inline-actions {
  margin-top: 12px;
}

.ai-faq-list {
  display: grid;
  gap: 10px;
}

.ai-faq-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.ai-faq-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 700;
}

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

.ai-report-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.ai-report-card span {
  color: var(--muted);
  font-weight: 900;
}

.account-bars {
  display: grid;
  gap: 10px;
}

.account-bars div {
  display: grid;
  gap: 5px;
}

.account-bars strong {
  font-size: 0.92rem;
}

.account-bars i {
  display: block;
  height: 9px;
  border-radius: 999px;
  background: #165dff;
}

.profit-ring {
  min-height: 180px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  border-radius: 8px;
  background:
    radial-gradient(circle at center, #fff 0 48%, transparent 49%),
    conic-gradient(#165dff 0 64%, #f5b33d 64% 78%, #fce2de 78% 100%);
  text-align: center;
}

.profit-ring strong {
  font-size: 2.2rem;
}

.client-profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.client-profile-grid div {
  min-height: 92px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.client-profile-grid span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.client-profile-grid strong {
  font-size: 0.95rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.client-type-summary {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(22, 93, 255, 0.08), rgba(255, 255, 255, 0.92));
}

.client-type-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.client-type-grid article {
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
}

.client-type-grid span {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.client-type-grid strong {
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1.1;
}

.client-type-grid small {
  color: var(--muted);
  font-weight: 800;
}

.sale-category-panel {
  padding: 16px;
}

.sale-category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.sale-category-grid article {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(22, 93, 255, 0.1), rgba(255, 255, 255, 0.94));
}

.sale-category-grid span,
.sale-category-pill {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.sale-category-grid strong {
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1.1;
}

.sale-category-grid small {
  color: var(--muted);
  font-weight: 800;
}

.sale-category-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--soft);
  text-transform: none;
}

.sale-category-cell {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.sale-category-edit {
  min-height: 28px;
  padding: 3px 8px;
  font-size: 0.78rem;
}

.receipt-row-actions {
  min-width: 245px;
}

.receipt-payment-correction {
  border-color: #e7c66d;
  background: #fff6dc;
}

.receipt-payment-correction:hover,
.receipt-payment-correction:focus-visible {
  border-color: var(--accent-3);
  background: #ffedb5;
}

.debt-alert-panel {
  border-left: 5px solid var(--accent);
}

.debt-alert-panel.has-overdue {
  border-left-color: #b7362b;
}

.client-credit-panel {
  display: grid;
  gap: 14px;
  border-left: 5px solid var(--accent);
}

.client-credit-panel.needs-attention {
  border-left-color: #c53b30;
}

.credit-status-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 16px;
  border: 1px solid #d8e2f2;
  border-radius: 8px;
  background: #edf3ff;
}

.credit-status-callout > div {
  display: grid;
  gap: 4px;
}

.credit-status-callout strong {
  font-size: 1.06rem;
}

.credit-status-callout span,
.credit-limit-grid small,
.credit-limit-history span,
.credit-limit-history small {
  color: var(--muted);
  font-weight: 700;
}

.credit-status-callout b {
  color: var(--primary);
  font-size: 1.35rem;
  white-space: nowrap;
}

.credit-status-callout.blocked {
  border-color: #f1c2bc;
  background: #fff6f4;
}

.credit-status-callout.blocked b {
  color: #b7362b;
}

.credit-limit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.credit-limit-grid article {
  display: grid;
  align-content: center;
  gap: 6px;
  min-height: 104px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.credit-limit-grid span,
.credit-limit-history span {
  font-size: 0.8rem;
  font-weight: 800;
}

.credit-limit-grid strong {
  font-size: 1.14rem;
}

.credit-debt-card {
  border-color: #f1c2bc !important;
  background: #fff8f7 !important;
}

.credit-debt-card strong {
  color: #b7362b;
}

.credit-limit-history {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 7px 12px;
  padding-top: 2px;
}

.credit-limit-history strong {
  color: var(--ink);
}

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

.debt-summary-grid div {
  min-height: 82px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.debt-summary-grid span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.debt-summary-grid strong {
  font-size: 1.12rem;
}

.client-current-account {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.client-current-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid #d8e2f2;
  border-radius: 8px;
  background: #edf3ff;
}

.client-current-note strong {
  color: var(--primary);
  white-space: nowrap;
}

.client-current-note span {
  color: var(--muted);
  font-weight: 750;
}

.client-current-invoice-tools {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #d8e2f2;
  border-radius: 8px;
  background: #fbfcff;
}

.client-current-invoice-tools > div {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.client-current-invoice-tools strong,
.client-current-invoice-tools b {
  color: var(--primary);
}

.client-current-invoice-tools span {
  color: var(--muted);
  font-weight: 750;
}

.client-current-table table {
  min-width: 1160px;
  table-layout: fixed;
}

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

.client-current-table th:nth-child(1),
.client-current-table td:nth-child(1) {
  width: 48px;
  text-align: center;
}

.client-current-table th:nth-child(2),
.client-current-table td:nth-child(2) {
  width: 84px;
}

.client-current-table th:nth-child(3),
.client-current-table td:nth-child(3) {
  width: auto;
  overflow-wrap: anywhere;
}

.client-current-table th:nth-child(4),
.client-current-table td:nth-child(4),
.client-current-table th:nth-child(5),
.client-current-table td:nth-child(5),
.client-current-table th:nth-child(6),
.client-current-table td:nth-child(6) {
  width: 130px;
  white-space: nowrap;
}

.client-current-table th:nth-child(7),
.client-current-table td:nth-child(7) {
  width: 96px;
  white-space: nowrap;
}

.client-current-table th:nth-child(8),
.client-current-table td:nth-child(8) {
  width: 110px;
  white-space: nowrap;
}

.client-current-table th:nth-child(9),
.client-current-table td:nth-child(9) {
  width: 170px;
  white-space: nowrap;
}

.client-current-table .row-actions {
  flex-wrap: nowrap;
}

.client-current-table .row-actions button {
  min-width: 72px;
}

.client-current-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 18px;
  padding: 13px 16px;
  border-radius: 8px;
  border: 1px solid #f3c7c1;
  background: #fff6f4;
  color: #8f4138;
}

.client-current-footer span {
  font-weight: 850;
}

.client-current-footer strong {
  font-size: 1.35rem;
}

.client-payment-history {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.client-payment-history h4 {
  margin: 0;
  font-size: 1.02rem;
}

.client-payment-history table {
  min-width: 820px;
}

.debt-detail {
  display: grid;
  gap: 14px;
}

.debt-overdue-row td {
  background: #fff6f4;
}

.debt-callout {
  display: grid;
  gap: 5px;
  padding: 14px;
  border-radius: 8px;
  background: #edf3ff;
  color: var(--ink);
}

.debt-callout span {
  color: var(--muted);
}

.receivable-detail {
  display: grid;
  gap: 14px;
}

.receivable-command-panel {
  display: grid;
  grid-template-columns: minmax(280px, 0.75fr) minmax(0, 1.25fr);
  gap: 14px;
  align-items: stretch;
  padding: 16px;
  border: 1px solid #d8e2f2;
  border-radius: 8px;
  background:
    linear-gradient(135deg, #edf3ff, #fff),
    repeating-linear-gradient(135deg, rgba(22, 93, 255, 0.08) 0 2px, transparent 2px 18px);
}

.receivable-command-panel h3 {
  margin: 2px 0 6px;
  font-size: 1.35rem;
}

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

.receivable-command-grid article {
  min-height: 92px;
  display: grid;
  align-content: space-between;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.receivable-command-grid article.bad {
  border-color: #efc6bf;
  background: #fff0ed;
}

.receivable-command-grid article.ok {
  border-color: #d8e2f2;
  background: #edf3ff;
}

.receivable-command-grid span,
.receivable-command-grid small {
  color: var(--muted);
  font-weight: 800;
}

.receivable-command-grid strong {
  color: var(--ink);
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.receivable-tabs {
  margin-bottom: 16px;
}

.payable-command-panel {
  border-color: #efc6bf;
  background:
    linear-gradient(135deg, #fff6f4, #fff),
    repeating-linear-gradient(135deg, rgba(184, 48, 39, 0.08) 0 2px, transparent 2px 18px);
}

.receivable-detail-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
  padding: 16px;
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(7, 30, 73, 0.97), rgba(22, 93, 255, 0.92)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0 2px, transparent 2px 18px);
}

.receivable-detail-hero h4 {
  margin: 2px 0 4px;
  font-size: 1.45rem;
  line-height: 1.05;
}

.receivable-detail-hero p,
.receivable-detail-hero .eyebrow {
  margin: 0;
  color: #dfe9ff;
}

.receivable-detail-hero strong {
  font-size: 1.7rem;
}

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

.receivable-kpi-grid article {
  min-height: 92px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.receivable-kpi-grid span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.receivable-kpi-grid strong {
  font-size: 1.1rem;
}

.receivable-alert {
  display: grid;
  gap: 5px;
  padding: 14px;
  border-radius: 8px;
  background: #edf3ff;
  color: var(--ink);
}

.receivable-alert.has-overdue {
  background: #fde8e4;
}

.receivable-alert span {
  color: var(--muted);
}

.receivable-invoice-box {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d8e2f2;
  border-radius: 8px;
  background:
    linear-gradient(135deg, #edf3ff, #fff),
    repeating-linear-gradient(135deg, rgba(22, 93, 255, 0.06) 0 2px, transparent 2px 18px);
}

.receivable-invoice-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  gap: 14px;
  align-items: stretch;
}

.receivable-invoice-head h4 {
  margin: 2px 0 5px;
  font-size: 1.15rem;
}

.receivable-invoice-head p {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.receivable-invoice-total {
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px;
  border: 1px solid #bfe0d5;
  border-radius: 8px;
  background: #fff;
}

.receivable-invoice-total span,
.receivable-invoice-total small,
.receivable-invoice-box .eyebrow {
  color: var(--muted);
  font-weight: 850;
}

.receivable-invoice-total strong {
  color: var(--primary);
  font-size: 1.35rem;
}

.receivable-remittance-filters {
  display: grid;
  grid-template-columns: minmax(140px, 0.8fr) minmax(130px, 0.7fr) minmax(130px, 0.7fr) minmax(220px, 1.3fr) minmax(170px, 0.8fr);
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid #dce9e5;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.receivable-remittance-filters label,
.receivable-remittance-filter-total {
  display: grid;
  gap: 5px;
}

.receivable-remittance-filters span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.receivable-remittance-filters input,
.receivable-remittance-filters select {
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.receivable-remittance-filter-total {
  min-height: 42px;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: #e9f6f1;
  text-align: right;
}

.receivable-remittance-filter-total strong {
  color: var(--primary);
  font-size: 1.02rem;
}

.receivable-remittance-list {
  display: grid;
  gap: 8px;
}

.receivable-remittance-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) max-content;
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.receivable-remittance-item:hover {
  border-color: #9ed0c0;
  box-shadow: 0 8px 20px rgba(22, 93, 255, 0.08);
}

.receivable-remittance-item span,
.receivable-remittance-item small {
  display: block;
}

.receivable-remittance-item .receivable-remittance-products {
  color: var(--ink);
  font-weight: 850;
}

.receivable-remittance-item small {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 750;
}

.receivable-remittance-item b {
  color: var(--ink);
  font-size: 1.03rem;
  white-space: nowrap;
}

.receivable-invoice-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.receivable-invoice-empty {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px dashed #d8e2f2;
}

.receivable-invoice-empty span {
  color: var(--muted);
  font-weight: 750;
}

.customer-invoice-history {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.customer-invoice-history h4 {
  margin: 0;
  font-size: 1.05rem;
}

.debt-alert-panel .customer-invoice-history {
  margin-top: 14px;
}

.client-history-summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--muted);
}

.client-history-summary strong {
  color: var(--ink);
  font-size: 1.12rem;
}

.client-history-filters {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(150px, 0.7fr) minmax(150px, 0.7fr) minmax(260px, 1.5fr);
  gap: 10px;
  margin-bottom: 14px;
}

.client-history-filters .field {
  margin: 0;
}

.compact-action {
  margin-top: 5px;
  padding: 6px 8px;
  font-size: 0.78rem;
}

.receivable-operation-alert {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid #d8e2f2;
  border-radius: 8px;
  background:
    linear-gradient(90deg, #edf3ff, #fbfcff),
    repeating-linear-gradient(135deg, rgba(22, 93, 255, 0.08) 0 2px, transparent 2px 18px);
}

.receivable-operation-alert.has-overdue {
  border-color: #f0bbb3;
  background: #fff0ed;
}

.receivable-operation-alert span {
  color: var(--muted);
  font-weight: 750;
}

.receivable-detail-table table {
  min-width: 1080px;
  table-layout: fixed;
  font-size: 0.84rem;
}

.receivable-detail-table th,
.receivable-detail-table td {
  padding: 10px 8px;
  overflow-wrap: normal;
  word-break: normal;
}

.receivable-detail-table th:nth-child(1),
.receivable-detail-table td:nth-child(1) {
  width: 74px;
}

.receivable-detail-table th:nth-child(2),
.receivable-detail-table td:nth-child(2) {
  width: auto;
  white-space: normal;
  overflow-wrap: anywhere;
}

.receivable-detail-table th:nth-child(3),
.receivable-detail-table td:nth-child(3),
.receivable-detail-table th:nth-child(4),
.receivable-detail-table td:nth-child(4),
.receivable-detail-table th:nth-child(5),
.receivable-detail-table td:nth-child(5) {
  width: 92px;
}

.receivable-detail-table th:nth-child(6),
.receivable-detail-table td:nth-child(6) {
  width: 84px;
}

.receivable-detail-table th:nth-child(7),
.receivable-detail-table td:nth-child(7) {
  width: 116px;
}

.receivable-detail-table th:nth-child(8),
.receivable-detail-table td:nth-child(8) {
  width: 178px;
}

.receivable-detail-table td:nth-child(1),
.receivable-detail-table td:nth-child(3),
.receivable-detail-table td:nth-child(4),
.receivable-detail-table td:nth-child(5),
.receivable-detail-table td:nth-child(6),
.receivable-detail-table td:nth-child(7),
.receivable-detail-table td:nth-child(8) {
  white-space: nowrap;
}

.receivable-detail-table .ghost,
.receivable-detail-table .mini-action {
  min-height: 34px;
  padding: 0 10px;
  white-space: nowrap;
}

.receivable-detail-table .mini-action {
  min-width: 72px;
}

.receivable-detail-table .row-actions {
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 8px;
}

.receivable-detail-table .row-actions button {
  min-width: 74px;
  justify-content: center;
}

.receivable-detail-table .status {
  min-width: 92px;
  justify-content: center;
  white-space: nowrap;
}

.receivable-operation {
  display: grid;
  gap: 14px;
}

.receivable-operation-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.receivable-operation-grid section {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.receivable-operation-grid h4 {
  margin: 0;
}

.receivable-operation-grid table {
  min-width: 720px;
}

.danger-callout {
  background: #fde8e4;
}

.settings-page {
  display: grid;
  gap: 20px;
}

.settings-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
}

.settings-head h2 {
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1;
}

.settings-company {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.logo-uploader {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.logo-preview {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #edf3ff;
  color: #165dff;
  font-size: 2.4rem;
  font-weight: 850;
  overflow: hidden;
}

.logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
}

.logo-file {
  position: relative;
  width: 100%;
  min-height: 46px;
  display: grid;
  place-items: center;
  padding: 11px 14px;
  border-radius: 8px;
  color: #fff;
  text-align: center;
  cursor: pointer;
}

.logo-upload-copy {
  display: grid;
  gap: 3px;
}

.logo-upload-copy strong {
  color: var(--ink);
}

.logo-upload-copy small {
  color: var(--muted);
  font-size: 0.78rem;
}

.logo-file input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.logo-file:hover {
  filter: brightness(0.96);
}

.logo-remove {
  width: 100%;
}

.settings-form-grid {
  align-content: start;
  gap: 18px;
}

.settings-form-grid .field {
  margin: 0;
}

.settings-users {
  display: grid;
  gap: 14px;
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
}

.user-permission-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

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

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

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

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

.receipt-format-card {
  display: grid;
  gap: 6px;
  min-height: 118px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.receipt-format-card.selected {
  border-color: var(--green);
  box-shadow: inset 0 4px 0 var(--green);
  background: #edf3ff;
}

.receipt-format-card span,
.receipt-format-card small {
  color: var(--muted);
}

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

.permission-editor {
  display: grid;
  gap: 12px;
}

.permission-section {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.permission-section > strong {
  display: block;
  color: var(--ink);
  font-size: 0.98rem;
}

.permission-section > small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.sales-tab-permissions {
  border-color: #d8e2f2;
  background: #f3fbf8;
}

.check-row {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fbfcff;
}

.check-row input {
  min-height: auto;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.row-actions button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 0.84rem;
  white-space: nowrap;
}

.mini-action {
  min-height: 30px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 25, 22, 0.45);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(760px, 100%);
  max-height: min(780px, calc(100vh - 36px));
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow);
}

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

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

.modal.purchase-modal {
  width: min(1120px, 100%);
}

.modal.purchase-detail-modal {
  width: min(1050px, 100%);
}

.modal.branch-detail-modal {
  width: min(1120px, 100%);
}

.modal.debt-detail-modal {
  width: min(980px, 100%);
}

.modal.receivable-detail-modal {
  width: min(1120px, calc(100vw - 24px));
  padding: 16px;
}

.modal.receivable-detail-modal .panel-head {
  align-items: center;
  margin-bottom: 12px;
}

.modal.receivable-detail-modal #modal-title {
  max-width: calc(100% - 58px);
  line-height: 1.1;
  overflow-wrap: normal;
}

.modal.cash-close-modal {
  width: min(860px, 100%);
}

.modal.account-history-modal {
  width: min(1500px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.account-history-head {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(420px, 1.25fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 18px;
}

.account-history-head > div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.account-history-head > div:first-child {
  display: grid;
  gap: 4px;
}

.account-history-head > div:first-child > strong {
  font-size: 28px;
}

.account-history-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.account-history-summary span {
  display: grid;
  align-content: center;
  gap: 5px;
  min-width: 0;
}

.account-history-summary strong {
  font-size: 20px;
}

.account-history-table {
  max-height: min(480px, 55vh);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.account-history-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
}

.account-history-table .numeric {
  text-align: right;
  white-space: nowrap;
}

.movement-kind {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--soft);
  font-weight: 700;
  white-space: nowrap;
}

.movement-kind.expense {
  color: #b83227;
  background: #fde4df;
}

.account-history-table .expense-heading {
  color: #b83227;
}

.account-history-filters {
  display: grid;
  grid-template-columns: 1.15fr repeat(3, minmax(135px, 0.8fr)) minmax(210px, 1.4fr) auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.account-history-filters label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.account-history-filters label > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.account-history-filters input,
.account-history-filters select {
  width: 100%;
  min-width: 0;
}

.account-history-filter-actions,
.account-history-pagination > div {
  display: flex;
  gap: 8px;
  align-items: center;
}

.account-history-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  color: var(--muted);
}

.account-history-pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.correction-button {
  white-space: nowrap;
}

.corrected-movement {
  background: #f7f8f7;
}

.corrected-movement > td:not(.negative) {
  color: var(--muted);
}

.correction-label {
  display: block;
  width: max-content;
  margin-top: 5px;
  padding: 3px 6px;
  border-radius: 5px;
  color: #73520d;
  background: #fff1c7;
  font-weight: 700;
}

.correction-warning {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #efd38b;
  border-radius: 8px;
  color: #60460b;
  background: #fff8e5;
}

.account-movement-detail {
  display: grid;
  gap: 14px;
}

.account-movement-detail-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid #c7d8f7;
  border-radius: 8px;
  background: #edf3ff;
}

.account-movement-detail-hero.expense {
  border-color: #f3c7c1;
  background: #fff6f4;
}

.account-movement-detail-hero h4 {
  margin: 4px 0;
  font-size: 1.35rem;
}

.account-movement-detail-hero p {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.account-movement-detail-hero > strong {
  font-size: 1.55rem;
  white-space: nowrap;
}

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

.account-movement-detail-grid article,
.account-movement-detail-note {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.account-movement-detail-grid span,
.account-movement-detail-note strong {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.account-movement-detail-grid strong {
  overflow-wrap: anywhere;
}

.account-movement-detail-note span {
  color: var(--ink);
  font-weight: 750;
  line-height: 1.35;
}

.account-movement-detail-note.warning {
  border-color: #f2dfac;
  background: #fff8e6;
}

@media (max-width: 720px) {
  .account-history-head {
    grid-template-columns: 1fr;
  }

  .account-history-summary {
    grid-template-columns: 1fr;
  }

  .account-history-filters {
    grid-template-columns: 1fr;
  }

  .account-history-pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .account-movement-detail-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .account-movement-detail-grid {
    grid-template-columns: 1fr;
  }
}

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

.form-grid .full-row {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.product-form {
  display: grid;
  gap: 14px;
}

.purchase-form {
  display: grid;
  gap: 16px;
}

.purchase-form .full-row {
  grid-column: 1 / -1;
}

.purchase-entry-panel {
  padding: 14px;
  border: 1px solid #d8e2f2;
  border-radius: 8px;
  background:
    linear-gradient(90deg, #edf3ff, rgba(255, 255, 255, 0.96)),
    repeating-linear-gradient(135deg, rgba(22, 93, 255, 0.08) 0 2px, transparent 2px 18px);
}

.purchase-entry-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.purchase-entry-head h4 {
  margin: 2px 0 4px;
  font-size: 1.25rem;
}

.purchase-entry-head p {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

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

.purchase-summary article {
  min-height: 86px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.purchase-summary span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

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

.purchase-summary strong {
  font-size: 1.18rem;
}

.purchase-summary .debt-card {
  background: #fff6f4;
  border-color: #f3c7c1;
}

.purchase-summary .debt-card strong,
.purchase-debt.is-due {
  color: #b7362b;
}

.purchase-detail {
  display: grid;
  gap: 14px;
}

.purchase-detail-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
  padding: 16px;
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(7, 30, 73, 0.97), rgba(22, 93, 255, 0.92)),
    repeating-linear-gradient(135deg, rgba(245, 179, 61, 0.17) 0 2px, transparent 2px 18px);
}

.purchase-detail-hero h4 {
  margin: 2px 0 4px;
  font-size: 1.45rem;
}

.purchase-detail-hero p,
.purchase-detail-hero .eyebrow {
  margin: 0;
  color: #dfe9ff;
}

.purchase-detail-hero strong {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 1.6rem;
}

.purchase-detail-hero .negative {
  color: #ffd9d4;
}

.purchase-detail-hero .positive {
  color: #dfe9ff;
}

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

.purchase-detail-grid article,
.purchase-detail-info div,
.purchase-notes {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.purchase-detail-grid article {
  min-height: 86px;
  align-content: space-between;
}

.purchase-detail-info {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.purchase-detail-grid span,
.purchase-detail-info span,
.purchase-notes span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.purchase-detail-grid strong,
.purchase-detail-info strong,
.purchase-notes strong {
  overflow-wrap: anywhere;
}

.purchase-detail-grid .debt-card {
  background: #fff6f4;
  border-color: #f3c7c1;
}

.purchase-detail-grid .debt-card strong {
  color: #b7362b;
}

.purchase-detail-table table {
  min-width: 760px;
}

.branch-detail {
  display: grid;
  gap: 14px;
}

.branch-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, #edf3ff, rgba(255, 255, 255, 0.94)),
    repeating-linear-gradient(135deg, rgba(22, 93, 255, 0.1) 0 2px, transparent 2px 18px);
}

.branch-detail-head h4 {
  margin: 2px 0 4px;
  font-size: 1.45rem;
}

.branch-detail-status {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.branch-detail-status small {
  color: var(--muted);
}

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

.branch-kpi-grid article {
  min-height: 96px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.branch-kpi-grid span,
.branch-kpi-grid small {
  color: var(--muted);
  font-weight: 750;
}

.branch-kpi-grid strong {
  font-size: 1.28rem;
}

.branch-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 12px;
}

.branch-detail-grid.wide {
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
}

.branch-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.branch-card h4 {
  margin: 0 0 10px;
}

.branch-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.branch-card-head h4 {
  margin: 0;
}

.branch-payment-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.branch-payment-grid article {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.branch-payment-grid span,
.branch-payment-grid small {
  color: var(--muted);
  font-weight: 750;
}

.branch-payment-grid strong {
  font-size: 1.1rem;
  overflow-wrap: anywhere;
}

.branch-activity-list {
  display: grid;
  gap: 8px;
}

.branch-activity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.branch-activity-row:last-child {
  border-bottom: 0;
}

.branch-activity-row span,
.branch-activity-row small {
  display: block;
  color: var(--muted);
}

.branch-card .list-row {
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #edf1ee;
}

.branch-card .list-row:last-child {
  border-bottom: 0;
}

.technical-board,
.service-command-panel {
  border-top: 4px solid var(--primary);
}

.service-command-panel {
  padding: 18px;
}

.service-filter-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.6fr) repeat(3, minmax(180px, 1fr));
  gap: 12px;
  margin: 14px 0;
}

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

.service-insight-grid article {
  display: grid;
  gap: 7px;
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(22, 93, 255, 0.08), rgba(255, 255, 255, 0.95));
}

.service-insight-grid article.warn {
  border-color: rgba(188, 58, 47, 0.28);
  background: #fff5f2;
}

.service-insight-grid article.ok {
  border-color: rgba(22, 93, 255, 0.24);
  background: #eef8f3;
}

.service-insight-grid span,
.service-insight-grid small {
  color: var(--muted);
  font-weight: 850;
}

.service-insight-grid strong {
  color: var(--ink);
  font-size: 1.3rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.technical-flow {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.technical-flow article {
  min-height: 106px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #edf3ff, #fff),
    repeating-linear-gradient(135deg, rgba(22, 93, 255, 0.08) 0 2px, transparent 2px 18px);
}

.technical-flow span,
.technical-flow small {
  color: var(--muted);
  font-weight: 800;
}

.technical-flow strong {
  color: var(--primary);
  font-size: 1.7rem;
}

.technical-flow article.attention-stage {
  border-color: #e9aaa2;
  background: #fff3f1;
}

.technical-flow article.attention-stage span,
.technical-flow article.attention-stage strong {
  color: #a62f24;
}

.modal.service-detail-modal {
  width: min(1280px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
}

.service-detail {
  display: grid;
  gap: 14px;
}

.service-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
  padding: 16px;
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(7, 30, 73, 0.97), rgba(22, 93, 255, 0.92)),
    repeating-linear-gradient(135deg, rgba(245, 179, 61, 0.17) 0 2px, transparent 2px 18px);
}

.service-hero h4 {
  margin: 2px 0 4px;
  font-size: 1.45rem;
}

.service-hero p,
.service-hero .eyebrow {
  margin: 0;
  color: #dfe9ff;
}

.service-hero strong {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 1.5rem;
}

.service-kpi-grid,
.service-detail-grid {
  display: grid;
  gap: 10px;
}

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

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

.service-kpi-grid article,
.service-detail-grid article {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.service-kpi-grid span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.service-kpi-grid strong {
  font-size: 1.18rem;
}

.service-detail-grid h4 {
  margin: 0;
}

.service-detail-grid p {
  margin: 0;
  line-height: 1.45;
}

.service-report-section {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #d8e2f2;
  border-radius: 8px;
  background: #fbfcff;
}

.service-report-section h4 {
  margin: 0;
}

.service-report-table th:nth-child(n + 2),
.service-report-table td:nth-child(n + 2) {
  text-align: right;
}

.service-internal-note {
  border-left: 4px solid #f5b33d !important;
  background: #fffaf0 !important;
}

.service-timeline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.service-timeline span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  font-weight: 850;
}

.service-timeline span.done {
  border-color: #d8e2f2;
  color: var(--primary);
  background: #edf3ff;
}

.service-timeline span.rejected {
  border-color: #e9aaa2;
  color: #fff;
  background: #b83227;
}

.service-history-list {
  display: grid;
  gap: 10px;
}

.service-history-card {
  display: grid;
  grid-template-columns: minmax(210px, 0.8fr) minmax(230px, 1fr) minmax(230px, 1fr) minmax(170px, 0.6fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.service-history-card strong,
.service-history-card span,
.service-history-card small {
  display: block;
}

.service-history-card span,
.service-history-card small {
  color: var(--muted);
  font-weight: 750;
}

.service-history-card p {
  margin: 2px 0 0;
}

.service-history-identity {
  display: grid;
  gap: 4px;
}

.service-history-result {
  display: grid;
  justify-items: start;
  gap: 5px;
}

.service-history-result .status {
  display: inline-flex;
}

.service-rejected-callout {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid #e9aaa2;
  border-left: 5px solid #b83227;
  border-radius: 8px;
  background: #fff3f1;
  color: #8f291f;
}

.service-rejected-callout strong {
  font-size: 1rem;
}

.service-rejected-callout small {
  color: #a43327;
  font-weight: 750;
}

.service-approval-history {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.service-approval-history article {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.service-approval-history article p {
  grid-column: 2 / -1;
  margin: 0;
}

.service-quote-form {
  display: grid;
  gap: 14px;
}

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

.service-parts-box {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d8e2f2;
  border-radius: 8px;
  background: #fbfcff;
}

.service-parts-lines {
  display: grid;
  gap: 10px;
}

.service-part-line {
  display: grid;
  grid-template-columns: minmax(360px, 1.75fr) minmax(110px, 0.42fr) minmax(150px, 0.55fr) minmax(170px, 0.65fr) 58px;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.service-part-line .field {
  margin: 0;
}

.service-part-picker {
  position: relative;
}

.service-part-results {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 50px;
  display: grid;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
  padding: 8px;
  border: 1px solid #d8e2f2;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.service-part-results[hidden] {
  display: none;
}

.service-part-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 14px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.service-part-result:hover {
  border-color: #9ed8ca;
  background: #edf3ff;
}

.service-part-result strong,
.service-part-result span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.service-part-result span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.service-part-result b {
  grid-row: span 2;
  align-self: center;
  color: var(--primary);
  white-space: nowrap;
}

.service-part-no-results {
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff6e5;
  color: #7a5600;
  font-weight: 800;
}

.service-parts-total {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  background: #edf3ff;
}

.service-parts-total span {
  color: var(--muted);
  font-weight: 800;
}

.purchase-section {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.purchase-section.compact {
  grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(150px, 0.8fr));
  align-items: end;
}

.purchase-section .field {
  margin: 0;
}

.purchase-lines {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.purchase-line {
  display: grid;
  grid-template-columns: minmax(230px, 1.35fr) minmax(120px, 0.65fr) minmax(90px, 0.45fr) minmax(130px, 0.65fr) minmax(110px, 0.55fr) minmax(130px, 0.65fr) minmax(130px, 0.65fr) 42px;
  gap: 8px;
  align-items: end;
}

.purchase-line .field {
  margin: 0;
}

.purchase-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #edf3ff;
  color: var(--ink);
  font-weight: 850;
}

.purchase-total strong {
  font-size: 1.35rem;
}

.product-hero-form {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(7, 30, 73, 0.96), rgba(22, 93, 255, 0.9)),
    repeating-linear-gradient(135deg, rgba(245, 179, 61, 0.18) 0 2px, transparent 2px 20px);
  color: #fff;
}

.product-hero-form h4 {
  margin: 2px 0 4px;
  font-size: 1.45rem;
}

.product-hero-form .muted,
.product-hero-form .eyebrow {
  color: #cfe5dd;
}

.product-hero-form strong {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
}

.product-form-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(7, 30, 73, 0.05);
}

.form-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 2px;
}

.form-section-title span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #071e49;
  color: #f5b33d;
  font-size: 0.76rem;
  font-weight: 900;
}

.form-section-title h4 {
  margin: 0;
  color: var(--ink);
}

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

.product-identity-section {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
}

.product-form-section .field:first-child {
  grid-column: span 2;
}

.product-identity-section .field:first-child {
  grid-column: span 6;
}

.product-identity-section .field:nth-child(2) {
  grid-column: span 3;
}

.product-identity-section .product-barcode-field {
  grid-column: span 3;
}

.product-identity-section .select-add-field:nth-child(4),
.product-identity-section .field:nth-child(5),
.product-identity-section .select-add-field:nth-child(6) {
  grid-column: span 4;
}

.product-form-section .field,
.product-form-section .select-add-field {
  margin: 0;
}

.scale-config-panel {
  display: grid;
  gap: 14px;
  padding: 16px 0 0;
  border-top: 1px solid #cfe2da;
}

.scale-config-panel[hidden] {
  display: none;
}

.scale-config-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.scale-config-head h4 {
  margin: 2px 0 0;
}

.scale-config-head > small {
  max-width: 560px;
  color: var(--muted);
  font-weight: 650;
}

.scale-config-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border-left: 4px solid var(--green);
  background: #f2f8f5;
}

.scale-config-grid .field {
  margin: 0;
}

.scale-test-field {
  grid-column: 1 / -1;
}

.scale-test-field small {
  min-height: 20px;
  color: var(--muted);
}

.scale-test-field small.is-ok {
  color: var(--green);
}

.scale-test-field small.is-bad {
  color: var(--danger);
}

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

.supplier-form {
  display: grid;
  gap: 14px;
}

.supplier-form-section {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border: 1px solid #d7e2dc;
  border-radius: 8px;
  background: linear-gradient(180deg, #fbfcff, #f7faf8);
}

.supplier-form-section .field {
  grid-column: span 3;
  margin: 0;
}

.supplier-main-section .supplier-name-field,
.supplier-billing-section .billing-name-field,
.supplier-form-section .full-row {
  grid-column: 1 / -1;
}

.supplier-main-section .field:nth-child(4),
.supplier-main-section .field:nth-child(5),
.supplier-main-section .field:nth-child(6),
.supplier-main-section .field:nth-child(7),
.supplier-purchase-section .field,
.supplier-billing-section .field {
  grid-column: span 4;
}

.supplier-main-section .field:nth-child(2),
.supplier-main-section .field:nth-child(3),
.supplier-main-section .field:nth-child(4) {
  grid-column: span 4;
}

.supplier-purchase-section .full-row {
  grid-column: 1 / -1;
}

.supplier-contacts-section {
  gap: 10px;
}

.supplier-contact-head,
.supplier-contact-list {
  grid-column: 1 / -1;
}

.supplier-contact-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 2px;
}

.supplier-contact-head span {
  color: var(--muted);
  font-weight: 900;
}

.supplier-contact-list {
  display: grid;
  gap: 10px;
}

.supplier-contact-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) minmax(140px, 1fr) minmax(140px, 1fr) minmax(130px, 0.9fr) minmax(180px, 1.1fr) 42px;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid #d7e2dc;
  border-radius: 8px;
  background: #fff;
}

.supplier-contact-row .field {
  margin: 0;
}

.supplier-contact-remove {
  min-height: 42px;
  background: #f9e4df;
  color: var(--danger);
}

.supplier-contact-remove:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.supplier-tax-field {
  align-content: start;
}

.supplier-tax-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.supplier-tax-field input {
  min-width: 0;
}

.supplier-tax-verify {
  min-width: 118px;
  min-height: 100%;
  padding-inline: 14px;
  color: var(--primary);
}

.supplier-tax-status {
  grid-column: 1 / -1;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #d7e2dc;
  background: #f1f6f3;
  color: var(--muted);
  font-weight: 800;
}

.supplier-tax-status.valid {
  border-color: #b8dfd2;
  background: #edf3ff;
  color: var(--primary);
}

.supplier-tax-status.invalid {
  border-color: #f0c7c0;
  background: #fde8e4;
  color: var(--danger);
}

.supplier-tax-status.pending {
  border-color: #ead8a6;
  background: #fff7df;
  color: #8c650b;
}

.modal.client-modal {
  width: min(1480px, 100%);
  max-height: min(920px, calc(100vh - 24px));
  padding: 28px;
  border-radius: 14px;
}

.modal.client-modal #modal-title {
  font-size: clamp(1.5rem, 2.2vw, 2.15rem);
  margin-bottom: 20px;
}

.modal.client-modal .form-actions {
  position: sticky;
  bottom: -28px;
  z-index: 2;
  margin: 22px -28px -28px;
  padding: 16px 28px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
}

.client-form {
  display: grid;
  gap: 14px;
}

.client-form-section {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  padding: 20px;
  border: 1px solid #d7e2dc;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfcff, #f7faf8);
}

.client-form-section .field,
.client-form-section .select-add-field {
  grid-column: span 4;
  margin: 0;
}

.client-main-section .client-name-field,
.client-billing-section .billing-name-field,
.client-form-section .full-row {
  grid-column: 1 / -1;
}

.client-contacts-section {
  gap: 10px;
}

.client-contact-head,
.client-contact-list,
.client-billing-help {
  grid-column: 1 / -1;
}

.client-contact-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 2px;
}

.client-contact-head span {
  color: var(--muted);
  font-weight: 900;
}

.client-contact-list {
  display: grid;
  gap: 10px;
}

.client-contact-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) minmax(140px, 1fr) minmax(140px, 1fr) minmax(130px, 0.9fr) minmax(180px, 1.1fr) 42px;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid #d7e2dc;
  border-radius: 8px;
  background: #fff;
}

.client-contact-row .field {
  margin: 0;
}

.client-contact-remove {
  min-height: 42px;
  background: #f9e4df;
  color: var(--danger);
}

.client-contact-remove:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.client-billing-help {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #d8e2f2;
  border-radius: 8px;
  background: #edf3ff;
  color: var(--muted);
}

.client-billing-help strong {
  color: var(--ink);
}

.client-tax-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.client-tax-field input {
  min-width: 0;
}

.client-tax-verify {
  min-width: 118px;
  min-height: 100%;
  padding-inline: 14px;
  color: var(--primary);
}

.client-tax-status {
  grid-column: 1 / -1;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #d7e2dc;
  background: #f1f6f3;
  color: var(--muted);
  font-weight: 800;
}

.client-tax-status.valid {
  border-color: #b8dfd2;
  background: #edf3ff;
  color: var(--primary);
}

.client-tax-status.invalid {
  border-color: #f0c7c0;
  background: #fde8e4;
  color: var(--danger);
}

.client-tax-status.pending {
  border-color: #ead8a6;
  background: #fff7df;
  color: #8c650b;
}

.product-barcode-field {
  position: relative;
  min-height: 148px;
  padding: 14px;
  border: 1px solid #d8e2f2;
  border-radius: 8px;
  background:
    linear-gradient(180deg, #edf3ff, #fff),
    repeating-linear-gradient(135deg, rgba(22, 93, 255, 0.08) 0 2px, transparent 2px 18px);
  box-shadow: inset 0 4px 0 var(--primary);
}

.product-barcode-field::after {
  content: "SCAN";
  position: absolute;
  right: 12px;
  top: 10px;
  padding: 4px 7px;
  border-radius: 8px;
  background: #e1f2ec;
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 900;
}

.product-barcode-field input {
  font-weight: 900;
  letter-spacing: 0;
  margin-top: 8px;
  background: #fff;
}

.product-barcode-field small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.25;
}

.product-barcode-field small.ok {
  color: var(--primary);
}

.compact-section .field:first-child {
  grid-column: span 1;
}

.stock-section {
  grid-template-columns: minmax(180px, 0.7fr) minmax(260px, 1fr) minmax(180px, 0.7fr);
}

.product-stock-field {
  gap: 6px;
}

.product-stock-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.product-stock-input input {
  border-radius: 8px 0 0 8px;
}

.product-stock-input strong {
  display: grid;
  min-width: 58px;
  place-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  background: #edf3ff;
  color: var(--accent);
  font-size: 0.9rem;
  text-transform: lowercase;
}

.product-stock-field small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.3;
}

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

.price-columns section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.price-columns h4 {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--accent);
}

.product-actions {
  display: grid;
  grid-template-columns: 160px 1fr 1fr;
}

.product-actions button {
  min-height: 46px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  max-width: 360px;
  padding: 13px 15px;
  border-radius: 8px;
  background: var(--brand-navy);
  color: #fff;
  box-shadow: var(--shadow);
  font-weight: 750;
}

.toast[hidden] {
  display: none;
}

.chart {
  height: 260px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  align-items: end;
  padding-top: 18px;
}

.bar {
  min-height: 38px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #165dff, #22a685);
  position: relative;
}

.bar span {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  font-size: 0.78rem;
  font-weight: 800;
}

.bar small {
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translateX(-50%);
  color: var(--muted);
  font-weight: 700;
}

.empty {
  min-height: 120px;
  display: grid;
  place-items: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1060px) {
  .counter-order-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .counter-order-row .row-actions {
    justify-content: flex-start;
  }

  .login-screen {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .login-art {
    min-height: 360px;
  }

  .login-preview {
    display: none;
  }

  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

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


  .barcode-scan-box,
  .sale-product-toolbar,
  .sale-customer-step,
  .checkout-fields,
  .session-box {
    grid-template-columns: 1fr;
  }

  .session-box {
    display: none;
  }

  .supplier-form-section .field,
  .client-form-section .field,
  .client-form-section .select-add-field,
  .supplier-main-section .field:nth-child(4),
  .supplier-main-section .field:nth-child(5),
  .supplier-main-section .field:nth-child(6),
  .supplier-main-section .field:nth-child(7),
  .supplier-purchase-section .field,
  .supplier-billing-section .field {
    grid-column: span 6;
  }

  .supplier-contact-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) 42px;
  }

  .client-contact-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) 42px;
  }

  .supplier-contact-row .field {
    grid-column: span 1;
  }

  .client-contact-row .field {
    grid-column: span 1;
  }

  .sales-layout,
  .remittance-command,
  .content-grid.two,
  .metric-grid,
  .dashboard-metrics,
  .dashboard-focus-grid,
  .dashboard-pulse-grid,
  .dashboard-mini-grid,
  .dashboard-branch-row,
  .cash-overview,
  .cash-layout,
  .cash-audit-filters,
  .cash-audit-summary,
  .cash-close-grid,
  .cash-close-inputs,
  .expense-command-hero,
  .expense-date-panel,
  .expense-kpi-grid,
  .expense-insight-grid,
  .treasury-overview,
  .branch-cash-grid,
  .branch-summary-grid,
  .branch-summary-numbers,
  .branch-detail-grid.wide,
  .branch-payment-grid,
  .branch-activity-row,
  .dollar-footer,
  .crm-command,
  .crm-summary-grid,
  .quote-summary-strip,
  .quote-card,
  .subscription-alerts,
  .subscription-timeline-row,
  .tax-hero,
  .tax-period,
  .tax-position-grid,
  .tax-alert-grid,
  .arca-hero,
  .arca-readiness,
  .arca-grid,
  .purchase-summary,
  .purchase-command-hero,
  .purchase-insight-grid,
  .users-command,
  .purchase-detail-grid,
  .purchase-detail-info,
  .reports-grid,
  .report-period-panel,
  .category-report-controls,
  .report-visual-grid,
  .report-visual-grid.two-cards,
  .profit-command-grid,
  .profit-signal-grid,
  .ai-feature-grid,
  .ai-report-grid,
  .ai-settings-grid,
  .client-profile-grid,
  .client-type-grid,
  .sale-category-grid,
  .credit-limit-grid,
  .debt-summary-grid,
  .receivable-command-panel,
  .receivable-command-grid,
  .receivable-remittance-filters,
  .receivable-invoice-head,
  .receivable-kpi-grid,
  .branch-kpi-grid,
  .technical-flow,
  .service-filter-grid,
  .service-insight-grid,
  .service-kpi-grid,
  .service-detail-grid,
  .service-history-card,
  .service-quote-grid,
  .service-part-line,
  .service-parts-total,
  .technical-report-note,
  .client-history-filters,
  .branch-detail-grid {
    grid-template-columns: 1fr;
  }

  .service-customer-row {
    grid-template-columns: 1fr;
  }

  .service-approval-history article {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .service-approval-history article p {
    grid-column: 1;
  }

  .reports-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .report-card {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .report-badge {
    width: 46px;
    height: 46px;
  }

  .report-arrow {
    grid-column: 2;
    justify-self: start;
  }

  .report-page-head {
    grid-template-columns: 1fr;
  }

  .client-action-group {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .client-current-note,
  .client-current-footer,
  .credit-status-callout {
    align-items: flex-start;
    flex-direction: column;
  }

  .ai-hero {
    align-items: start;
    flex-direction: column;
  }

  .ai-faq-row,
  .ai-chat-input {
    grid-template-columns: 1fr;
  }

  .settings-head,
  .settings-company {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .settings-actions-grid,
  .receipt-format-list,
  .compact-permissions {
    grid-template-columns: 1fr;
  }

  .checkout-panel {
    position: static;
  }

  .sale-products-panel {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .cart-row,
  .cart-total-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .cart-total-row strong:first-child,
  .cart-total-row strong:last-child {
    grid-column: auto;
  }

  .cart-table-head {
    display: none;
  }

  .cart-product-row > [data-cart-label]::before {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    content: attr(data-cart-label);
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  .cart-controls {
    justify-content: flex-start;
  }

  .cart-row-subtotal,
  .cart-line-final,
  .cart-total-row strong:last-child {
    text-align: left;
  }
}

@media (min-width: 1061px) and (max-width: 1360px) {
  .shell {
    grid-template-columns: 218px minmax(0, 1fr);
  }

  .sidebar {
    padding: 14px;
  }

  .main {
    padding: 14px;
  }

  .brand {
    gap: 10px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .brand strong,
  .nav a {
    font-size: 0.9rem;
  }

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

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

  .product-card strong,
  .product-card b {
    font-size: 0.95rem;
  }

  .product-card span,
  .product-card small {
    font-size: 0.86rem;
  }

  .sale-cash-strip {
    grid-template-columns: repeat(3, minmax(110px, 1fr));
  }

  .payment-main-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(88px, 0.8fr) 38px;
  }

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

@media (max-width: 720px) {
  .administration-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .counter-order-row {
    grid-template-columns: 1fr;
  }

  .active-counter-order-notice {
    align-items: stretch;
    flex-direction: column;
  }

  .login-art {
    min-height: auto;
    padding: 20px;
  }

  .login-card {
    width: calc(100% - 24px);
    padding: 22px;
    margin: 12px;
  }

  .main,
  .sidebar {
    padding: 16px;
  }

  .supplier-form-section {
    grid-template-columns: 1fr;
  }

  .client-form-section {
    grid-template-columns: 1fr;
  }

  .supplier-form-section .field,
  .client-form-section .field,
  .client-form-section .select-add-field,
  .supplier-main-section .field:nth-child(4),
  .supplier-main-section .field:nth-child(5),
  .supplier-main-section .field:nth-child(6),
  .supplier-main-section .field:nth-child(7),
  .supplier-purchase-section .field,
  .supplier-billing-section .field {
    grid-column: 1 / -1;
  }

  .supplier-contact-head {
    align-items: stretch;
    flex-direction: column;
  }

  .client-contact-head {
    align-items: stretch;
    flex-direction: column;
  }

  .supplier-contact-row {
    grid-template-columns: 1fr;
  }

  .client-contact-row {
    grid-template-columns: 1fr;
  }

  .supplier-contact-row .field,
  .supplier-contact-remove {
    grid-column: 1 / -1;
  }

  .client-contact-row .field,
  .client-contact-remove {
    grid-column: 1 / -1;
  }

  .supplier-tax-row {
    grid-template-columns: 1fr;
  }

  .client-tax-row {
    grid-template-columns: 1fr;
  }

  .topbar,
  .hero-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    justify-content: stretch;
  }

  .top-actions select,
  .user-chip {
    width: 100%;
  }

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


  .branch-detail-head {
    flex-direction: column;
  }

  .receivable-detail-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-stats {
    min-width: 0;
  }

  .hero-wordmark {
    gap: 0 9px;
    font-size: 2.35rem;
  }

  .hero-branding p {
    font-size: 1rem;
  }

  .cash-control {
    grid-template-columns: 1fr;
  }

  .cash-open-grid,
  .cash-move-grid {
    grid-template-columns: 1fr;
  }

  .cash-move-grid button {
    width: 100%;
  }

  .purchase-entry-head {
    flex-direction: column;
  }

  .cash-control.compact,
  .filters,
  .payment-totals,
  .product-import-summary,
  .sale-cash-strip,
  .table-search-bar,
  .expense-filter-panel,
  .expense-period-tabs,
  .payment-main-row,
  .cheque-payment-fields,
  .cheque-filters,
  .cheque-summary-grid,
  .cheque-detail-grid,
  .purchase-section,
  .purchase-section.compact,
  .purchase-line,
  .purchase-filter-panel,
  .product-hero-form,
  .form-grid,
  .permission-grid,
  .product-form-section,
  .scale-config-grid,
  .stock-section,
  .price-columns,
  .price-columns section,
  .product-actions {
    grid-template-columns: 1fr;
  }

  .scale-config-head {
    align-items: start;
    flex-direction: column;
  }

  .cheque-hero {
    grid-template-columns: 1fr;
  }

  .cheque-hero-balance {
    padding: 12px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.22);
    border-left: 0;
  }

  .cheque-payment-title {
    align-items: start;
    flex-direction: column;
  }
}

/* Dedicated purchase workspace: generous fields, no modal viewport. */
.purchase-workspace-open .hero-panel { display: none; }
.purchase-workspace { display: grid; gap: 24px; }
.purchase-workspace-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.purchase-workspace-heading h2 { margin: 6px 0; font-size: 1.8rem; }
.purchase-workspace-heading p { margin: 0; color: var(--muted); }
#purchase-entry-form { min-width: 0; }
.purchase-workspace .purchase-form { gap: 24px; }
.purchase-workspace .purchase-entry-panel { margin-bottom: -24px; border-radius: 14px 14px 0 0; border-bottom: 0; }
.purchase-workspace .purchase-section.compact { padding: 24px; background: white; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 14px 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.purchase-workspace .purchase-section.compact > :first-child { grid-column: span 2; }
.purchase-workspace .purchase-lines, .purchase-payment-panel { padding: 24px; background: white; border: 1px solid var(--line); border-radius: 14px; }
.purchase-workspace .compact-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.purchase-workspace h3, .purchase-workspace h4 { margin: 0; }
.purchase-workspace #purchase-lines { display: grid; gap: 18px; }
.purchase-workspace .purchase-line { padding: 20px; background: #f5f8ff; border: 1px solid var(--line); border-radius: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.purchase-workspace .purchase-line > :first-child { grid-column: span 2; }
.purchase-workspace .purchase-line > :nth-child(7) { grid-column: span 2; }
.purchase-workspace .purchase-line > button { justify-self: end; align-self: end; width: 42px; }
.purchase-workspace .field { min-width: 0; }
.purchase-workspace input, .purchase-workspace select { width: 100%; min-width: 0; min-height: 44px; }
.purchase-payment-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 18px; }
.purchase-workspace textarea { min-height: 100px; }
.purchase-workspace .purchase-total { padding: 22px 24px; border: 1px solid #cedeff; }
.purchase-entry-actions { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 18px; margin-top: 24px; background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 -6px 24px #0b20400c; }
.purchase-entry-actions > span { margin-right: auto; color: var(--muted); font-size: .85rem; }
@media (max-width: 1000px) {
  .purchase-payment-fields { grid-template-columns: 1fr; }
  .purchase-workspace .purchase-line { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .purchase-entry-actions { flex-wrap: wrap; }
  .purchase-entry-actions > span { flex-basis: 100%; }
}
@media (max-width: 600px) {
  .purchase-workspace-heading { align-items: flex-start; flex-direction: column; }
  .purchase-workspace .purchase-section.compact, .purchase-workspace .purchase-line { grid-template-columns: 1fr; padding: 16px; }
  .purchase-workspace .purchase-section.compact > :first-child, .purchase-workspace .purchase-line > :first-child, .purchase-workspace .purchase-line > :nth-child(7) { grid-column: auto; }
  .purchase-workspace .purchase-lines, .purchase-payment-panel { padding: 16px; }
  .purchase-entry-actions { position: static; }
}
