:root {
  color-scheme: light dark;
  --cvms-bg: #f5f7fb;
  --cvms-surface: #ffffff;
  --cvms-surface-2: #eef3f8;
  --cvms-border: #d9e1ea;
  --cvms-text: #172033;
  --cvms-muted: #667085;
  --cvms-primary: #2457d6;
  --cvms-primary-soft: #e9efff;
  --cvms-success: #17835b;
  --cvms-warning: #a15c00;
  --cvms-danger: #c93636;
  --cvms-grid: #b4bfcc;
  --cvms-grid-strong: #7b8796;
  --cvms-header-bg: #e1e7ef;
  --cvms-input-bg: #ffffff;
  --cvms-locked-bg: #eef2f7;
  --cvms-shadow: 0 16px 40px rgba(23, 32, 51, 0.08);
}

html {
  font-size: 105%;
}

[data-bs-theme="dark"] {
  --cvms-bg: #101418;
  --cvms-surface: #171d23;
  --cvms-surface-2: #202932;
  --cvms-border: #31404d;
  --cvms-text: #eef4f8;
  --cvms-muted: #a7b2bd;
  --cvms-primary: #7aa2ff;
  --cvms-primary-soft: #1d2b4d;
  --cvms-success: #55c99d;
  --cvms-warning: #f0b35a;
  --cvms-danger: #ff7676;
  --cvms-grid: #566273;
  --cvms-grid-strong: #8793a3;
  --cvms-header-bg: #273241;
  --cvms-input-bg: #141a20;
  --cvms-locked-bg: #202832;
  --cvms-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
}

body {
  background: var(--cvms-bg);
  color: var(--cvms-text);
}

.app-header {
  background: color-mix(in srgb, var(--cvms-surface) 94%, transparent) !important;
  backdrop-filter: blur(12px);
}

.app-main {
  max-width: none;
  padding-left: 0.45rem !important;
  padding-right: 0.45rem !important;
  padding-top: 0.45rem !important;
}

.brand-block {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--cvms-primary);
  color: white;
  font-size: 0.9rem;
  letter-spacing: 0;
}

.brand-title,
.brand-subtitle {
  display: block;
  line-height: 1.15;
}

.brand-subtitle {
  color: var(--cvms-muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.header-actions {
  min-width: 0;
}

.user-pill,
.mode-pill {
  border: 1px solid var(--cvms-border);
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  color: var(--cvms-muted);
  background: var(--cvms-surface);
  font-size: 0.82rem;
  white-space: nowrap;
}

.icon-button {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.login-shell {
  min-height: calc(100vh - 90px);
  display: grid;
  place-items: center;
}

.login-panel {
  width: min(420px, 100%);
  background: var(--cvms-surface) !important;
  box-shadow: var(--cvms-shadow);
}

.app-tabs {
  background: var(--cvms-surface);
  border: 1px solid var(--cvms-border);
  border-radius: 8px;
  padding: 0.35rem;
  gap: 0.25rem;
  box-shadow: 0 8px 20px rgba(23, 32, 51, 0.04);
}

.app-tabs .nav-link {
  border: 0;
  border-radius: 6px;
  color: var(--cvms-muted);
  font-weight: 600;
  min-height: 42px;
}

.app-tabs .nav-link.active {
  background: var(--cvms-primary-soft);
  color: var(--cvms-primary);
}

.app-actionbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--cvms-border);
  border-radius: 4px;
  padding: 0.35rem;
  background: var(--cvms-surface);
}

.actionbar-left {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.app-actionbar .btn {
  min-height: 30px;
  padding: 0.16rem 0.55rem;
}

.home-date-search {
  display: inline-grid;
  grid-template-columns: auto minmax(9.5rem, 12rem) auto;
  align-items: center;
  gap: 0.28rem;
  border: 1px solid var(--cvms-grid);
  border-radius: 4px;
  padding: 0.18rem;
  background: color-mix(in srgb, var(--cvms-header-bg) 32%, var(--cvms-surface));
}

.home-date-search label {
  margin: 0;
  padding-left: 0.22rem;
  color: var(--cvms-muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.home-date-search .form-control {
  min-height: 30px;
  border-color: var(--cvms-grid);
  font-size: 0.84rem;
  font-weight: 750;
}

.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--cvms-surface);
  color: var(--cvms-text);
  border: 1px solid var(--cvms-border);
  border-radius: 8px;
  padding: 0.75rem;
  box-shadow: 0 10px 24px rgba(23, 32, 51, 0.05);
}

.dashboard-hero .eyebrow {
  color: var(--cvms-muted);
}

.hero-total {
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  line-height: 1;
  font-weight: 800;
}

.hero-meta {
  margin-top: 0.25rem;
  color: var(--cvms-muted);
  font-weight: 700;
  font-size: 0.82rem;
}

.hero-meta.danger {
  color: var(--cvms-danger);
}

.safe-balance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  gap: 0.5rem;
  min-width: min(420px, 100%);
}

.safe-balance-grid > div {
  border: 1px solid var(--cvms-border);
  border-radius: 4px;
  padding: 0.45rem 0.55rem;
  background: var(--cvms-surface-2);
}

.safe-balance-grid span {
  display: block;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--cvms-muted);
  text-transform: uppercase;
}

.safe-balance-grid strong {
  display: block;
  margin-top: 0.1rem;
  font-size: 1.05rem;
}

.safe-balance-grid .danger {
  border-color: var(--cvms-danger);
  background: color-mix(in srgb, var(--cvms-danger) 13%, var(--cvms-surface));
  color: var(--cvms-danger);
}

.section-block {
  background: var(--cvms-surface);
  border: 1px solid var(--cvms-border);
  border-radius: 4px;
  padding: 0.75rem;
  box-shadow: none;
}

.eyebrow {
  color: var(--cvms-muted);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.form-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--cvms-border);
}

.transaction-entry {
  padding: 0;
  overflow: hidden;
  border-radius: 4px;
}

.movement-date-strip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.55rem;
  border-top: 1px solid var(--cvms-grid);
  border-bottom: 1px solid var(--cvms-grid);
  background: color-mix(in srgb, var(--cvms-header-bg) 55%, var(--cvms-surface));
  color: var(--cvms-muted);
  font-size: 0.85rem;
  font-weight: 850;
  text-transform: uppercase;
}

.movement-date-strip strong {
  color: var(--cvms-text);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.home-history-panel {
  margin: 0 0 0.5rem;
  padding: 0.45rem;
}

.embedded-history-panel {
  margin: 0;
  border-bottom: 1px solid var(--cvms-grid);
  background: color-mix(in srgb, var(--cvms-surface-2) 34%, var(--cvms-surface));
}

.home-history-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}

.home-history-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.25rem;
}

.home-history-summary span {
  border: 1px solid var(--cvms-grid);
  border-radius: 4px;
  padding: 0.14rem 0.34rem;
  background: color-mix(in srgb, var(--cvms-header-bg) 38%, var(--cvms-surface));
  color: var(--cvms-muted);
  font-size: 0.76rem;
  font-weight: 850;
  white-space: nowrap;
}

.home-history-summary strong {
  margin-left: 0.18rem;
  color: var(--cvms-text);
  font-variant-numeric: tabular-nums;
}

.home-history-summary .danger,
.home-history-summary .danger strong {
  border-color: var(--cvms-danger);
  color: var(--cvms-danger);
  background: color-mix(in srgb, var(--cvms-danger) 12%, var(--cvms-surface));
}

.home-history-wrap {
  max-height: 13rem;
  overflow-y: auto;
}

.home-history-table th,
.home-history-table td {
  white-space: nowrap;
}

.home-history-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.transaction-workspace {
  display: block;
  min-height: 0;
  background: var(--cvms-surface);
}

.transaction-sheet-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--cvms-grid);
  border-left: 0;
  border-right: 0;
  background: var(--cvms-surface);
}

.transaction-sheet {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.86rem;
}

.transaction-sheet th,
.transaction-sheet td {
  border: 1px solid var(--cvms-grid);
  padding: 0.2rem 0.22rem;
  vertical-align: middle;
}

.transaction-sheet .sheet-input-cell {
  padding: 0;
}

.transaction-sheet th {
  background: var(--cvms-header-bg);
  color: var(--cvms-text);
  font-weight: 900;
  text-align: center;
}

.transaction-sheet thead tr:first-child th {
  border-color: var(--cvms-grid);
  border-bottom-width: 1px;
  background: color-mix(in srgb, var(--cvms-header-bg) 78%, var(--cvms-surface));
}

.transaction-sheet thead tr:nth-child(2) th {
  background: var(--cvms-header-bg);
  border-bottom-width: 1px;
}

.transaction-sheet thead tr:nth-child(3) th {
  background: color-mix(in srgb, var(--cvms-surface) 56%, var(--cvms-header-bg));
  font-weight: 800;
}

.transaction-sheet tbody td {
  background: var(--cvms-input-bg);
}

.transaction-sheet .sheet-group-start,
.transaction-sheet .sheet-subgroup-start,
.transaction-sheet .sheet-total-col,
.transaction-sheet .sheet-total-cell,
.safe-matrix-table .sheet-group-start,
.safe-matrix-table .sheet-total-col,
.safe-matrix-table .sheet-total-cell {
  border-left: 1px solid var(--cvms-grid);
}

.transaction-sheet .sheet-total-cell {
  background: color-mix(in srgb, var(--cvms-header-bg) 54%, var(--cvms-surface));
  color: var(--cvms-text);
  font-weight: 900;
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding-inline: 0.28rem;
}

.transaction-sheet .sheet-total-cell.active-total {
  background: color-mix(in srgb, var(--cvms-primary-soft) 42%, var(--cvms-surface));
  color: var(--cvms-primary);
}

.transaction-sheet .sheet-total-cell strong {
  display: block;
  white-space: nowrap;
}

.entry-sheet-wrap {
  border-top-width: 1px;
  border-bottom-width: 1px;
}

.entry-sheet {
  min-width: 980px;
  font-size: 0.88rem;
}

.entry-sheet th,
.entry-sheet td {
  padding: 0.16rem 0.18rem;
}

.entry-sheet .sheet-row-label {
  text-align: left;
  background: color-mix(in srgb, var(--cvms-header-bg) 68%, var(--cvms-surface));
}

.entry-sheet .sheet-row-label span {
  display: block;
  color: var(--cvms-muted);
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1.05;
  text-transform: uppercase;
}

.entry-sheet .sheet-row-label strong {
  display: block;
  margin-top: 0.04rem;
  color: var(--cvms-text);
  font-size: 0.9rem;
  line-height: 1.05;
}

.entry-sheet .entry-input-host {
  padding: 0;
  background: color-mix(in srgb, var(--cvms-primary-soft) 18%, var(--cvms-input-bg));
}

.entry-input-grid {
  display: grid;
  min-height: 39px;
}

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

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

.entry-input-box {
  display: grid;
  align-items: stretch;
  border-left: 1px solid var(--cvms-grid);
  background: var(--cvms-input-bg);
}

.entry-input-box:first-child {
  border-left: 0;
}

.entry-input-box.disabled {
  background: var(--cvms-locked-bg);
  opacity: 0.68;
}

.entry-sheet .sheet-qty-input {
  min-height: 39px;
  color: var(--cvms-text);
  font-size: 1.02rem;
  font-weight: 760;
}

.entry-sheet .sheet-qty-input.is-zero {
  color: color-mix(in srgb, var(--cvms-muted) 82%, var(--cvms-text));
  font-weight: 620;
}

.entry-sheet .sheet-qty-input.has-value {
  color: var(--cvms-text);
  font-weight: 860;
}

.entry-sheet .sheet-muted-cell {
  background:
    repeating-linear-gradient(
      135deg,
      color-mix(in srgb, var(--cvms-locked-bg) 92%, var(--cvms-surface)) 0,
      color-mix(in srgb, var(--cvms-locked-bg) 92%, var(--cvms-surface)) 7px,
      color-mix(in srgb, var(--cvms-locked-bg) 68%, var(--cvms-surface)) 7px,
      color-mix(in srgb, var(--cvms-locked-bg) 68%, var(--cvms-surface)) 14px
    );
}

.entry-balance-row th,
.entry-balance-row td {
  background: color-mix(in srgb, var(--cvms-header-bg) 40%, var(--cvms-surface));
}

.entry-balance-row .balance-message {
  padding: 0.12rem 0.25rem;
}

.entry-balance-row .entry-difference-chip {
  display: flex;
  justify-content: center;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0.12rem 0.1rem;
}

.entry-balance-row .entry-difference-chip.danger {
  background: color-mix(in srgb, var(--cvms-danger) 13%, var(--cvms-surface));
  outline: 1px solid var(--cvms-danger);
  outline-offset: -1px;
}

.transaction-sheet .sheet-fixed-col {
  width: 7rem;
}

.transaction-sheet .sheet-pos-col {
  width: 4.1rem;
}

.sheet-readonly-input,
.sheet-qty-input {
  width: 100%;
  min-height: 29px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--cvms-text);
  text-align: center;
  font-weight: 800;
  padding: 0.05rem 0.1rem;
}

.sheet-readonly-input {
  background: color-mix(in srgb, var(--cvms-header-bg) 42%, var(--cvms-input-bg));
}

.sheet-readonly-input {
  font-weight: 700;
  font-size: 0.84rem;
}

.sheet-qty-input:focus,
.sheet-readonly-input:focus {
  outline: 2px solid color-mix(in srgb, var(--cvms-primary) 45%, transparent);
  outline-offset: -2px;
  background: var(--cvms-surface);
}

.sheet-qty-input:disabled {
  background: color-mix(in srgb, var(--cvms-surface-2) 70%, transparent);
  color: var(--cvms-muted);
}

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

.sheet-qty-input {
  appearance: textfield;
}

.sheet-register-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.15rem;
}

.sheet-register-buttons .choice-button {
  min-height: 29px;
  padding: 0.05rem 0.12rem;
  text-align: center;
  font-size: 0.79rem;
  border-radius: 2px;
}

.transaction-safe-panel,
.transaction-pos-panel {
  background: var(--cvms-surface);
  min-width: 0;
}

.transaction-safe-panel {
  padding: 0.62rem 0 0.34rem;
  border-bottom: 1px solid var(--cvms-grid);
  background: color-mix(in srgb, var(--cvms-surface-2) 46%, var(--cvms-surface));
}

.safe-panel-header,
.pos-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.safe-panel-header {
  margin-bottom: 0.22rem;
  padding-inline: 0.28rem;
}

.safe-panel-header strong {
  color: var(--cvms-primary);
  font-size: 1.08rem;
  white-space: nowrap;
  border: 1px solid var(--cvms-grid);
  border-radius: 4px;
  padding: 0.08rem 0.36rem;
  background: var(--cvms-surface);
}

.safe-total-strip {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.18rem;
  width: max-content;
  max-width: calc(100% - 0.36rem);
  margin: 0.22rem 0.18rem 0;
  overflow-x: auto;
}

.safe-total-strip > div {
  flex: 0 0 10.5ch;
  display: grid;
  align-content: center;
  justify-items: center;
  border: 1px solid var(--cvms-grid);
  border-radius: 4px;
  padding: 0.22rem 0.24rem;
  background: color-mix(in srgb, var(--cvms-header-bg) 42%, var(--cvms-surface));
  text-align: center;
}

.safe-total-strip span {
  display: block;
  color: var(--cvms-muted);
  font-size: 0.77rem;
  font-weight: 800;
  text-transform: uppercase;
}

.safe-total-strip strong {
  display: block;
  margin-top: 0.1rem;
  font-size: 1.03rem;
}

.safe-total-strip > .safe-strip-symbol {
  flex: 0 0 1.2rem;
  display: grid;
  place-items: center;
  align-self: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--cvms-grid-strong);
  font-size: 1.15rem;
  font-weight: 950;
  line-height: 1;
  padding: 0;
}

#transaction-safe-total-card {
  flex-basis: 11.5ch;
  border-color: var(--cvms-primary);
  background: color-mix(in srgb, var(--cvms-primary-soft) 68%, var(--cvms-surface));
}

#transaction-safe-total-card strong {
  color: var(--cvms-primary);
}

.safe-total-strip .danger {
  border-color: var(--cvms-danger);
  color: var(--cvms-danger);
  background: color-mix(in srgb, var(--cvms-danger) 13%, var(--cvms-surface));
}

.transaction-safe-panel .sheet-table {
  width: 100%;
  min-width: 980px;
  font-size: 0.84rem;
  table-layout: fixed;
  border: 1px solid var(--cvms-grid);
  cursor: default;
}

.transaction-safe-panel .table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.transaction-safe-panel .sheet-table th,
.transaction-safe-panel .sheet-table td {
  border-color: var(--cvms-grid);
  border-width: 1px;
  padding: 0.2rem 0.16rem;
}

.transaction-safe-panel .sheet-table th {
  background: color-mix(in srgb, var(--cvms-header-bg) 70%, var(--cvms-surface-2));
  color: var(--cvms-text);
}

.transaction-safe-panel .sheet-table tr:nth-child(2) td,
.transaction-safe-panel .sheet-table tr:nth-child(3) td {
  background: color-mix(in srgb, var(--cvms-surface-2) 58%, var(--cvms-surface));
  color: var(--cvms-text);
}

.transaction-safe-panel .sheet-table tr:nth-child(2) th,
.transaction-safe-panel .sheet-table tr:nth-child(3) th {
  background: color-mix(in srgb, var(--cvms-header-bg) 78%, var(--cvms-surface));
}

.safe-matrix-table th:first-child,
.safe-matrix-table td:first-child {
  width: 7rem;
}

.safe-matrix-table {
  min-width: 980px;
}

.safe-matrix-table td {
  font-variant-numeric: tabular-nums;
}

.safe-matrix-table td,
.safe-matrix-table th {
  overflow: hidden;
  text-overflow: clip;
  user-select: none;
  white-space: nowrap;
}

.safe-matrix-table .sheet-total-cell {
  background: color-mix(in srgb, var(--cvms-header-bg) 46%, var(--cvms-surface));
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.safe-matrix-table .sheet-total-col,
.safe-matrix-table .sheet-total-cell {
  width: 7.2rem;
}

.safe-matrix-table td.projected-change,
.safe-total-strip > div.projected-change {
  background: color-mix(in srgb, var(--cvms-primary-soft) 62%, var(--cvms-surface)) !important;
  color: var(--cvms-primary);
}

.safe-matrix-table td.projected-negative {
  background: color-mix(in srgb, var(--cvms-danger) 16%, var(--cvms-surface)) !important;
  color: var(--cvms-danger) !important;
}

.projected-delta {
  display: inline-block;
  margin-left: 0.18rem;
  color: var(--cvms-primary);
  font-size: 0.7rem;
  font-weight: 950;
}

.projected-negative .projected-delta {
  color: var(--cvms-danger);
}

.transaction-safe-panel .status-badge {
  padding: 0.08rem 0.28rem;
  font-size: 0.73rem;
}

.transaction-pos-panel {
  display: flex;
  flex-direction: column;
}

.pos-panel-header {
  padding: 0.38rem 0.45rem;
  border-bottom: 1px solid var(--cvms-grid);
  background: var(--cvms-surface);
}

.register-tabs {
  justify-content: flex-end;
}

.pos-summary-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.3rem;
  padding: 0.35rem;
  background: transparent;
}

.pos-summary-card {
  display: grid;
  grid-template-columns: minmax(4rem, 1fr) repeat(3, minmax(3.8rem, auto));
  gap: 0.32rem;
  align-items: center;
  border: 1px solid var(--cvms-grid);
  border-radius: 4px;
  padding: 0.3rem 0.38rem;
  background: var(--cvms-surface);
  color: var(--cvms-text);
  text-align: left;
}

.pos-summary-card span:not(.pos-summary-name) {
  text-align: right;
}

.pos-summary-card small {
  display: block;
  color: var(--cvms-muted);
  font-size: 0.73rem;
  font-weight: 800;
  line-height: 1.05;
  text-transform: uppercase;
}

.pos-summary-card strong {
  display: block;
  margin-top: 0.05rem;
  font-size: 0.95rem;
  line-height: 1.1;
}

.pos-summary-name {
  font-weight: 900;
  color: var(--cvms-text);
}

.selected-row {
  border-color: color-mix(in srgb, var(--cvms-primary) 55%, var(--cvms-border));
  background: var(--cvms-primary-soft);
  color: var(--cvms-primary);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cvms-primary) 18%, transparent);
}

.selected-row .pos-summary-name,
.selected-row small,
.selected-row strong {
  color: var(--cvms-primary);
}

[data-register-row] {
  cursor: pointer;
}

.transaction-pos-panel .entry-control-grid {
  grid-template-columns: minmax(310px, max-content) minmax(130px, 170px);
  align-items: end;
  justify-content: start;
  padding: 0.28rem 0.35rem;
}

.entry-control-grid {
  display: grid;
  grid-template-columns: minmax(280px, 2fr) minmax(160px, 1fr) minmax(180px, 1fr) minmax(210px, 1fr);
  gap: 0.35rem;
  padding: 0.45rem;
  border-bottom: 1px solid var(--cvms-grid);
  background: var(--cvms-surface-2);
}

.transaction-menu {
  border-top: 0;
  background: color-mix(in srgb, var(--cvms-header-bg) 58%, var(--cvms-surface));
}

.entry-control.wide {
  min-width: 0;
}

.entry-control .form-label {
  margin-bottom: 0.22rem;
  color: var(--cvms-muted);
  font-size: 0.79rem;
  font-weight: 800;
  text-transform: uppercase;
}

.choice-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.choice-button {
  min-height: 32px;
  border: 1px solid var(--cvms-border);
  border-radius: 4px;
  padding: 0.28rem 0.48rem;
  background: var(--cvms-surface);
  color: var(--cvms-text);
  font-weight: 800;
  text-align: left;
  font-size: 0.9rem;
}

.choice-button.active {
  border-color: var(--cvms-primary);
  background: var(--cvms-primary-soft);
  color: var(--cvms-primary);
}

.choice-button:disabled {
  opacity: 0.5;
}

.choice-strip.compact .choice-button {
  flex: 1 1 120px;
  text-align: center;
}

.movement-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 1px;
  background: var(--cvms-border);
  border-bottom: 1px solid var(--cvms-border);
}

.movement-panel {
  background: var(--cvms-surface);
  padding: 0.45rem;
}

.movement-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.movement-panel-header span {
  color: var(--cvms-primary);
  font-weight: 900;
  font-size: 0.95rem;
}

.note-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.55fr) minmax(220px, 1fr);
  gap: 0.4rem;
  padding: 0.45rem;
  border-bottom: 1px solid var(--cvms-border);
}

.entry-footer {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
  align-items: center;
  padding: 0.45rem;
  border-top: 1px solid var(--cvms-grid);
  background: var(--cvms-surface-2);
}

.entry-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.top-entry-actions {
  align-self: end;
}

.entry-actions .btn {
  min-width: 7rem;
}

.footer-balance-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.balance-message {
  margin-top: 0;
  font-size: 0.95rem;
  font-weight: 800;
}

.entry-difference-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  border: 1.5px solid var(--cvms-grid);
  border-radius: 4px;
  padding: 0.16rem 0.38rem;
  background: var(--cvms-surface);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.entry-difference-chip span {
  color: var(--cvms-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.entry-difference-chip.danger {
  border-color: var(--cvms-danger);
  background: color-mix(in srgb, var(--cvms-danger) 13%, var(--cvms-surface));
  color: var(--cvms-danger);
}

.entry-difference-chip.danger span,
.entry-difference-chip.danger strong {
  color: var(--cvms-danger);
}

.balance-message.ok {
  color: var(--cvms-success);
}

.balance-message.warning {
  color: var(--cvms-warning);
}

.balance-message.danger {
  color: var(--cvms-danger);
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--cvms-border);
  border-radius: 4px;
  padding: 0.45rem 0.6rem;
  background: var(--cvms-surface-2);
}

.inventory-card {
  border: 1px solid var(--cvms-border);
  border-radius: 8px;
  padding: 0.95rem;
  min-height: 148px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--cvms-surface);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.inventory-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--cvms-primary) 55%, var(--cvms-border));
  box-shadow: 0 12px 28px rgba(23, 32, 51, 0.08);
}

.inventory-card.low {
  border-color: var(--cvms-danger);
  background: color-mix(in srgb, var(--cvms-danger) 8%, var(--cvms-surface));
}

.inventory-card .display-6 {
  font-weight: 800;
  color: var(--cvms-text);
}

.inventory-meta {
  color: var(--cvms-muted);
  font-size: 0.84rem;
}

.inventory-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--cvms-surface-2);
  margin-top: 0.7rem;
}

.inventory-progress span {
  display: block;
  height: 100%;
  width: var(--level);
  min-width: 7px;
  border-radius: inherit;
  background: var(--cvms-success);
}

.inventory-card.low .inventory-progress span {
  background: var(--cvms-danger);
}

.money-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
  gap: 0.28rem;
}

.compact-money,
.compact-money-grid {
  grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
}

.simple-entry-header {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(145px, 185px) auto;
  justify-content: start;
  gap: 0.45rem;
  align-items: end;
  padding: 0.45rem;
  border-bottom: 1px solid var(--cvms-grid);
  background: color-mix(in srgb, var(--cvms-header-bg) 58%, var(--cvms-surface));
}

.simple-entry-header .manager-field {
  min-width: 145px;
  max-width: 185px;
}

#cashier-id {
  min-height: 42px;
}

.entry-date-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.25rem;
}

.entry-date-control .btn,
.entry-date-control .form-control {
  min-height: 42px;
}

.pos-choice-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pos-choice-strip .choice-button {
  min-height: 42px;
  text-align: center;
  font-size: 1rem;
}

.history-date-mode .entry-sheet-wrap,
.history-date-mode .transaction-safe-panel,
.history-date-mode .optional-notes {
  opacity: 0.72;
}

.optional-notes summary,
.admin-details summary {
  cursor: pointer;
  color: var(--cvms-muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.simple-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.5rem;
  padding: 0.55rem;
  border-bottom: 1px solid var(--cvms-grid);
  background: var(--cvms-surface);
}

.flow-panel {
  min-width: 0;
  border: 1.5px solid var(--cvms-grid);
  border-radius: 4px;
  background: var(--cvms-surface);
  overflow: hidden;
}

.flow-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.42rem 0.5rem;
  border-bottom: 1.5px solid var(--cvms-grid);
  background: color-mix(in srgb, var(--cvms-header-bg) 70%, var(--cvms-surface));
}

.flow-panel-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 950;
}

.flow-total {
  min-width: 5.8rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.flow-total span {
  display: block;
  color: var(--cvms-muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.flow-total strong {
  display: block;
  color: var(--cvms-primary);
  font-size: 1rem;
}

.flow-total.active-total {
  color: var(--cvms-primary);
}

.flow-panel > .money-grid {
  padding: 0.45rem;
}

.flow-subtitle {
  padding: 0.38rem 0.5rem 0.08rem;
  color: var(--cvms-muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.money-tile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 3.2rem;
  align-items: center;
  gap: 0.28rem;
  border: 1.5px solid var(--cvms-grid);
  border-radius: 4px;
  padding: 0.28rem;
  background: color-mix(in srgb, var(--cvms-surface-2) 64%, var(--cvms-surface));
}

.money-tile label {
  margin: 0;
  min-width: 0;
}

.money-tile label span {
  display: block;
  color: var(--cvms-text);
  font-size: 0.9rem;
  font-weight: 950;
  line-height: 1.05;
}

.money-tile label small {
  display: block;
  color: var(--cvms-muted);
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
}

.money-tile input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--cvms-grid);
  border-radius: 3px;
  background: var(--cvms-input-bg);
  color: var(--cvms-text);
  text-align: center;
  font-size: 1.05rem;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.money-tile input:focus {
  outline: 2px solid color-mix(in srgb, var(--cvms-primary) 45%, transparent);
  outline-offset: 0;
}

.money-tile.disabled {
  opacity: 0.42;
}

.diff-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
  padding: 0.45rem 0.5rem;
  border: 1.5px solid var(--cvms-grid);
  border-radius: 4px;
  background: color-mix(in srgb, var(--cvms-header-bg) 40%, var(--cvms-surface));
}

.optional-notes {
  padding: 0.42rem 0.5rem;
  border-bottom: 1px solid var(--cvms-border);
  background: var(--cvms-surface);
}

.optional-notes .note-grid {
  padding: 0.45rem 0 0;
  border-bottom: 0;
}

.admin-details summary {
  margin-bottom: 0.35rem;
}

.money-input {
  border: 1px solid var(--cvms-border);
  border-radius: 4px;
  padding: 0.28rem;
  background: var(--cvms-surface-2);
}

.money-input label {
  display: flex;
  justify-content: space-between;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.78rem;
  margin-bottom: 0.22rem;
  color: var(--cvms-text);
}

.money-input label strong {
  font-size: 0.86rem;
}

.denomination-value {
  color: var(--cvms-muted);
  font-weight: 600;
  font-size: 0.68rem;
}

.quantity-stepper {
  display: grid;
  grid-template-columns: 2.45rem 1.55rem;
  gap: 0.18rem;
  justify-content: end;
  align-items: stretch;
}

.quantity-stepper .form-control {
  text-align: center;
  font-weight: 800;
  width: 2.45rem;
  min-height: 34px;
  padding-inline: 0.15rem;
  font-size: 0.92rem;
}

.stepper-stack {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 0.18rem;
}

.stepper-button {
  border: 1px solid var(--cvms-border);
  border-radius: 4px;
  background: var(--cvms-surface);
  color: var(--cvms-text);
  font-weight: 800;
  width: 1.55rem;
  min-height: 0;
  line-height: 1;
  padding: 0;
  font-size: 0.76rem;
}

.stepper-button:disabled,
.money-input:has(input:disabled) {
  opacity: 0.52;
}

.calculation-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.28rem;
}

.calculation-strip > div {
  border: 1px solid var(--cvms-border);
  border-radius: 4px;
  padding: 0.35rem 0.45rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--cvms-surface);
}

.calculation-strip > div.danger,
.diff-cell.danger {
  border-color: var(--cvms-danger);
  background: color-mix(in srgb, var(--cvms-danger) 13%, var(--cvms-surface));
  color: var(--cvms-danger);
}

.calculation-strip > div.danger span,
.calculation-strip > div.danger strong {
  color: var(--cvms-danger);
}

.diff-cell {
  border-radius: 6px;
  font-weight: 800;
}

.calculation-strip span {
  color: var(--cvms-muted);
  font-size: 0.81rem;
}

.calculation-strip strong {
  font-size: 1.06rem;
}

.type-badge,
.status-badge {
  border-radius: 999px;
  padding: 0.25rem 0.5rem;
  font-size: 0.81rem;
  font-weight: 800;
  white-space: nowrap;
}

.type-badge {
  color: var(--cvms-primary);
  background: var(--cvms-primary-soft);
}

.status-badge.active {
  color: var(--cvms-success);
  background: color-mix(in srgb, var(--cvms-success) 12%, transparent);
}

.status-badge.void {
  color: var(--cvms-danger);
  background: color-mix(in srgb, var(--cvms-danger) 12%, transparent);
}

.action-buttons {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.25rem;
}

.action-buttons .btn {
  min-height: 30px;
  padding: 0.16rem 0.42rem;
  font-size: 0.76rem;
}

.table-responsive {
  border: 1px solid var(--cvms-grid);
  border-radius: 4px;
}

.audit-log-wrap {
  max-height: 11.5rem;
  overflow-y: auto;
}

.audit-dialog-panel {
  width: min(1040px, calc(100vw - 1.2rem));
}

.admin-transactions-panel {
  width: min(1220px, calc(100vw - 1.2rem));
}

.users-dialog-panel {
  width: min(940px, calc(100vw - 1.2rem));
}

.user-create-grid {
  display: grid;
  grid-template-columns: minmax(10rem, 1.1fr) minmax(8rem, 0.8fr) minmax(8rem, 0.8fr) auto;
  gap: 0.55rem;
  align-items: end;
  padding: 0.6rem;
  border: 1px solid var(--cvms-grid);
  border-radius: 4px;
  background: var(--cvms-surface-2);
}

.user-create-submit {
  min-width: 7rem;
}

.users-table-wrap {
  max-height: min(24rem, 52vh);
  overflow-y: auto;
}

.admin-history-toolbar {
  display: grid;
  grid-template-columns: minmax(10rem, 14rem) auto;
  gap: 0.5rem;
  justify-content: start;
  align-items: center;
}

.admin-history-wrap {
  max-height: min(24rem, 56vh);
}

.admin-command-bar,
.admin-log-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--cvms-border);
  border-radius: 4px;
  background: var(--cvms-surface-2);
}

.admin-command-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.audit-log-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--cvms-surface);
  box-shadow: inset 0 -1px 0 var(--cvms-grid);
}

.table {
  margin-bottom: 0;
}

.table thead th {
  color: var(--cvms-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
  background: var(--cvms-header-bg);
}

.sheet-wrap {
  background: var(--cvms-surface);
}

.sheet-table {
  --bs-table-bg: var(--cvms-surface);
  --bs-table-striped-bg: var(--cvms-surface-2);
  font-size: 0.88rem;
}

.sheet-table th,
.sheet-table td {
  border-color: var(--cvms-grid);
  border-width: 1px;
  padding: 0.38rem 0.5rem;
}

.sheet-table tbody tr:nth-child(even):not(.table-danger) {
  background: color-mix(in srgb, var(--cvms-surface-2) 58%, transparent);
}

.sheet-table .status-badge {
  padding: 0.15rem 0.4rem;
}

.safe-count-table .safe-count-input {
  width: 4.25rem;
  min-height: 30px;
  margin-left: auto;
  text-align: right;
  padding: 0.15rem 0.35rem;
}

.admin-edit-heading {
  --bs-table-bg: color-mix(in srgb, var(--cvms-primary) 10%, var(--cvms-header-bg));
  color: var(--cvms-primary);
  background-color: color-mix(in srgb, var(--cvms-primary) 10%, var(--cvms-header-bg)) !important;
}

.table thead th.admin-edit-heading {
  color: var(--cvms-primary);
}

.admin-edit-cell {
  --bs-table-bg: color-mix(in srgb, var(--cvms-primary) 7%, var(--cvms-surface));
  background-color: color-mix(in srgb, var(--cvms-primary) 7%, var(--cvms-surface)) !important;
}

.admin-edit-row {
  position: relative;
  margin: 0;
  padding: 0.3rem 0.3rem 0.3rem 0.56rem;
  border: 1px solid color-mix(in srgb, var(--cvms-primary) 24%, var(--cvms-grid));
  border-radius: 4px;
  background: color-mix(in srgb, var(--cvms-primary) 5%, var(--cvms-surface));
}

.admin-edit-row::before {
  content: "";
  position: absolute;
  left: 0.24rem;
  top: 0.32rem;
  bottom: 0.32rem;
  width: 3px;
  border-radius: 999px;
  background: var(--cvms-primary);
}

.admin-edit-input {
  border-color: color-mix(in srgb, var(--cvms-primary) 52%, var(--cvms-border));
  background: color-mix(in srgb, var(--cvms-primary) 8%, #fff);
  color: var(--cvms-text);
  font-weight: 850;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cvms-primary) 14%, transparent);
}

.admin-edit-input:focus {
  border-color: var(--cvms-primary);
  box-shadow: 0 0 0 0.18rem color-mix(in srgb, var(--cvms-primary) 18%, transparent);
}

.safe-count-subtotal-row th {
  border-top: 2px solid var(--cvms-grid-strong) !important;
  background: color-mix(in srgb, var(--cvms-primary-soft) 48%, var(--cvms-surface));
  color: var(--cvms-primary);
  font-weight: 950;
}

.vault-history-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem;
}

.vault-history-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.45rem;
}

.vault-history-heading > strong {
  color: var(--cvms-primary);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.snapshot-date-list-wrap {
  margin-top: 0.45rem;
}

.snapshot-date-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.28rem;
}

.snapshot-date-button {
  min-width: 0;
  border: 1px solid var(--cvms-grid);
  border-radius: 4px;
  padding: 0.32rem 0.4rem;
  background: var(--cvms-surface);
  color: var(--cvms-text);
  text-align: left;
  font: inherit;
}

.snapshot-date-button strong,
.snapshot-date-button span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.snapshot-date-button strong {
  font-size: 0.86rem;
  line-height: 1.1;
}

.snapshot-date-button span {
  margin-top: 0.08rem;
  color: var(--cvms-muted);
  font-size: 0.72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.snapshot-date-button.active {
  border-color: var(--cvms-primary);
  background: color-mix(in srgb, var(--cvms-primary-soft) 70%, var(--cvms-surface));
  color: var(--cvms-primary);
}

.snapshot-date-button.active span {
  color: var(--cvms-primary);
}

.snapshot-output {
  margin-top: 0.55rem;
}

.snapshot-selected-bar {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 0.28rem;
  margin-bottom: 0.28rem;
}

.snapshot-selected-bar > div {
  border: 1px solid var(--cvms-grid);
  border-radius: 4px;
  padding: 0.34rem 0.42rem;
  background: color-mix(in srgb, var(--cvms-primary-soft) 38%, var(--cvms-surface));
}

.snapshot-selected-bar span {
  display: block;
  color: var(--cvms-muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.snapshot-selected-bar strong {
  display: block;
  margin-top: 0.08rem;
  color: var(--cvms-primary);
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.snapshot-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.25rem;
  margin-bottom: 0.45rem;
}

.snapshot-summary-grid > div {
  border: 1px solid var(--cvms-grid);
  border-radius: 4px;
  padding: 0.28rem 0.35rem;
  background: color-mix(in srgb, var(--cvms-header-bg) 42%, var(--cvms-surface));
  min-width: 0;
}

.snapshot-summary-grid span {
  display: block;
  color: var(--cvms-muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.snapshot-summary-grid strong {
  display: block;
  overflow: hidden;
  margin-top: 0.06rem;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.snapshot-caption {
  margin: 0.55rem 0 0.25rem;
  color: var(--cvms-muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.snapshot-transaction-wrap {
  max-height: 11rem;
  overflow-y: auto;
}

.snapshot-transaction-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--cvms-header-bg);
}

.snapshot-restore-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.55rem;
  border-top: 1px solid var(--cvms-grid);
  padding-top: 0.45rem;
}

.snapshot-restore-strip strong,
.snapshot-restore-strip span {
  display: block;
}

.snapshot-restore-strip strong {
  font-size: 0.84rem;
}

.snapshot-restore-strip span {
  color: var(--cvms-muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.snapshot-empty {
  display: grid;
  gap: 0.18rem;
  padding: 0.75rem;
}

.snapshot-empty strong {
  color: var(--cvms-text);
}

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

.compact-empty {
  padding: 0.55rem;
  font-size: 0.8rem;
}

.compact-admin-notes {
  padding: 0;
  border-bottom: 0;
}

.empty-state {
  padding: 1.2rem;
  color: var(--cvms-muted);
  text-align: center;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(4px);
}

.dialog-panel {
  width: min(520px, 100%);
  background: var(--cvms-surface);
  border: 1px solid var(--cvms-border);
  border-radius: 4px;
  padding: 1rem;
  box-shadow: var(--cvms-shadow);
}

.dialog-panel.audit-dialog-panel {
  width: min(1040px, calc(100vw - 1.2rem));
}

.dialog-panel.admin-transactions-panel {
  width: min(1220px, calc(100vw - 1.2rem));
}

.dialog-panel.users-dialog-panel {
  width: min(940px, calc(100vw - 1.2rem));
}

.exchange-warning-panel {
  width: min(620px, calc(100vw - 1.2rem));
  border: 3px solid var(--cvms-danger);
  border-radius: 8px;
  padding: 1.25rem;
  background: color-mix(in srgb, var(--cvms-danger) 9%, var(--cvms-surface));
  text-align: center;
  box-shadow: 0 24px 70px color-mix(in srgb, var(--cvms-danger) 28%, rgba(15, 23, 42, 0.28));
}

.exchange-warning-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 0.6rem;
  border-radius: 999px;
  background: var(--cvms-danger);
  color: #fff;
  font-size: 2rem;
  font-weight: 950;
  line-height: 1;
}

.exchange-warning-panel h2 {
  margin: 0;
  color: var(--cvms-danger);
  font-size: 1.45rem;
  font-weight: 950;
}

.exchange-warning-copy {
  margin: 0.5rem auto 0.85rem;
  max-width: 28rem;
  color: var(--cvms-text);
  font-size: 1rem;
  font-weight: 750;
}

.exchange-warning-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  margin-bottom: 0.95rem;
}

.exchange-warning-grid > div {
  border: 2px solid color-mix(in srgb, var(--cvms-danger) 42%, var(--cvms-grid));
  border-radius: 6px;
  padding: 0.5rem 0.35rem;
  background: var(--cvms-surface);
}

.exchange-warning-grid span {
  display: block;
  color: var(--cvms-muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.exchange-warning-grid strong {
  display: block;
  margin-top: 0.12rem;
  color: var(--cvms-text);
  font-size: 1.18rem;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.exchange-warning-grid .warning-difference {
  background: color-mix(in srgb, var(--cvms-danger) 14%, var(--cvms-surface));
}

.exchange-warning-grid .warning-difference strong {
  color: var(--cvms-danger);
}

.utility-panel {
  width: min(1120px, calc(100vw - 1.2rem));
  max-height: calc(100vh - 1.2rem);
  overflow: auto;
  padding: 0.55rem;
}

.utility-panel-wide {
  width: min(1280px, calc(100vw - 1.2rem));
}

.utility-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.45rem;
  margin-bottom: 0.45rem;
  border-bottom: 1px solid var(--cvms-border);
}

.utility-section {
  padding: 0;
  border: 0;
}

.report-sheet {
  background: var(--cvms-surface);
}

.btn,
.form-control,
.form-select {
  border-radius: 4px;
}

.form-control,
.form-select {
  min-height: 34px;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

@media (max-width: 992px) {
  .app-main {
    padding-left: 0.35rem !important;
    padding-right: 0.35rem !important;
  }

  .dashboard-hero,
  .form-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .user-create-grid {
    grid-template-columns: 1fr;
  }

  .user-create-submit {
    width: 100%;
  }

  .entry-control-grid,
  .movement-grid,
  .note-grid,
  .entry-footer {
    grid-template-columns: 1fr;
  }

  .simple-entry-header {
    grid-template-columns: minmax(260px, 1fr) minmax(140px, 180px) auto;
    gap: 0.38rem;
  }

  .top-entry-actions .btn {
    min-height: 42px;
    min-width: 6.25rem;
    padding-inline: 0.55rem;
  }

  .simple-flow {
    grid-template-columns: 1fr;
  }

  .pos-panel-header {
    align-items: stretch;
    flex-direction: column;
  }

}

@media (max-width: 768px) {
  .app-header .container-fluid {
    align-items: center;
    gap: 0.35rem;
  }

  .brand-block {
    gap: 0.5rem;
    min-width: 0;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 7px;
    flex: 0 0 auto;
  }

  .brand-title {
    overflow: hidden;
    max-width: 44vw;
    font-size: 0.98rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-actions {
    gap: 0.3rem !important;
    margin-left: auto;
  }

  .user-pill {
    max-width: 9.2rem;
    overflow: hidden;
    padding-inline: 0.48rem;
    text-overflow: ellipsis;
  }

  .icon-button {
    width: 36px;
    height: 36px;
  }

  .app-actionbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 0.35rem;
  }

  .actionbar-left {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
  }

  .app-actionbar .btn {
    min-height: 40px;
    padding-inline: 0.45rem;
  }

  .home-date-search {
    grid-template-columns: auto minmax(0, 1fr) auto;
    width: 100%;
  }

  .home-history-header {
    align-items: stretch;
    flex-direction: column;
  }

  .home-history-summary {
    justify-content: stretch;
  }

  .home-history-summary span {
    flex: 1 1 calc(50% - 0.25rem);
  }

  .app-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .app-tabs .nav-link {
    white-space: nowrap;
  }

  .calculation-strip {
    grid-template-columns: 1fr;
  }

  .entry-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .transaction-entry {
    margin-inline: -0.45rem;
    border-radius: 4px;
  }

  .entry-control-grid,
  .simple-entry-header,
  .movement-panel,
  .note-grid,
  .entry-footer {
    padding: 0.45rem;
  }

  .simple-entry-header {
    grid-template-columns: minmax(0, 1fr) minmax(15rem, auto);
    gap: 0.38rem;
    align-items: end;
  }

  .simple-entry-header .pos-entry-control {
    grid-column: 1 / -1;
  }

  .simple-entry-header .manager-field {
    min-width: 0;
    max-width: none;
  }

  #cashier-id,
  .pos-choice-strip .choice-button,
  .top-entry-actions .btn {
    min-height: 44px;
  }

  .top-entry-actions {
    align-self: end;
    grid-template-columns: minmax(5.8rem, 0.8fr) minmax(8.6rem, 1.2fr);
  }

  .top-entry-actions .btn {
    min-width: 0;
    padding-inline: 0.42rem;
    white-space: nowrap;
  }

  .movement-date-strip {
    justify-content: center;
    padding-block: 0.38rem;
  }

  .simple-flow {
    gap: 0.45rem;
    padding: 0.45rem;
  }

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

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

  .money-tile {
    grid-template-columns: 1fr;
    gap: 0.18rem;
    padding: 0.26rem;
  }

  .money-tile label {
    text-align: center;
  }

  .money-tile input {
    min-height: 38px;
  }

  .diff-panel {
    grid-template-columns: 1fr;
  }

  .entry-footer {
    justify-content: stretch;
  }

  .pos-panel-header {
    padding: 0.45rem;
  }

  .transaction-safe-panel {
    padding: 0.24rem 0.14rem 0.28rem;
  }

  .transaction-sheet-wrap,
  .transaction-safe-panel .table-responsive {
    scrollbar-width: thin;
  }

  .entry-sheet {
    min-width: 920px;
  }

  .transaction-safe-panel .sheet-table,
  .safe-matrix-table {
    min-width: 920px;
  }

  .pos-summary-list {
    grid-template-columns: 1fr;
    padding: 0.35rem;
  }

  .pos-summary-card {
    grid-template-columns: minmax(4rem, 1fr) repeat(3, minmax(3.4rem, auto));
  }

  .safe-total-strip {
    gap: 0.12rem;
    width: max-content;
    max-width: calc(100% - 0.24rem);
  }

  .safe-total-strip > div:not(.safe-strip-symbol) {
    flex-basis: 10ch;
    padding: 0.18rem 0.16rem;
  }

  #transaction-safe-total-card {
    flex-basis: 11ch;
  }

  .safe-total-strip span {
    font-size: 0.66rem;
  }

  .safe-total-strip strong {
    font-size: 0.85rem;
  }

  .safe-total-strip > .safe-strip-symbol {
    font-size: 0.95rem;
    padding-inline: 0.02rem;
  }

  .exchange-warning-grid {
    grid-template-columns: 1fr;
  }

  .exchange-warning-panel h2 {
    font-size: 1.18rem;
  }

  .vault-history-controls {
    grid-template-columns: 1fr 1fr;
  }

  .vault-history-controls input {
    grid-column: 1 / -1;
  }

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

  .snapshot-date-list,
  .snapshot-selected-bar {
    grid-template-columns: 1fr;
  }

  .snapshot-restore-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .choice-button {
    flex: 1 1 calc(50% - 0.4rem);
    text-align: center;
    padding-inline: 0.45rem;
  }

  .compact-money {
    grid-template-columns: 1fr;
    gap: 0.28rem;
  }

  .money-input {
    display: grid;
    grid-template-columns: minmax(82px, 1fr) auto;
    align-items: center;
    gap: 0.35rem;
    padding: 0.32rem;
  }

  .money-input label {
    margin: 0;
    display: block;
  }

  .money-input label strong,
  .denomination-value {
    display: block;
  }

  .quantity-stepper {
    grid-template-columns: 2.8rem 1.7rem;
  }

  .brand-subtitle {
    display: none;
  }

  .user-pill {
    max-width: 128px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 576px) {
  html {
    font-size: 100%;
  }

  .app-header .container-fluid {
    flex-wrap: wrap;
    padding-inline: 0.45rem;
  }

  .brand-title {
    max-width: 54vw;
  }

  .header-actions {
    flex: 1 1 100%;
    justify-content: flex-end;
  }

  .user-pill {
    max-width: calc(100vw - 8.6rem);
  }

  .app-main {
    padding-left: 0.25rem !important;
    padding-right: 0.25rem !important;
  }

  .app-actionbar {
    grid-template-columns: 1fr auto;
    padding: 0.25rem;
  }

  .actionbar-left {
    grid-template-columns: 1fr 1fr;
  }

  .simple-entry-header {
    grid-template-columns: 1fr;
    padding: 0.38rem;
  }

  .simple-entry-header .pos-entry-control,
  .simple-entry-header .manager-field,
  .top-entry-actions {
    grid-column: 1;
  }

  .top-entry-actions {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  }

  .top-entry-actions .btn {
    min-height: 46px;
    padding-inline: 0.25rem;
    font-size: 0.95rem;
  }

  .movement-date-strip {
    font-size: 0.8rem;
  }

  .movement-date-strip strong {
    font-size: 0.95rem;
  }

  .entry-sheet {
    min-width: 860px;
    font-size: 0.82rem;
  }

  .entry-sheet .sheet-qty-input {
    min-height: 44px;
    font-size: 1rem;
  }

  .transaction-sheet .sheet-fixed-col,
  .safe-matrix-table th:first-child,
  .safe-matrix-table td:first-child {
    width: 6rem;
  }

  .transaction-safe-panel .sheet-table,
  .safe-matrix-table {
    min-width: 860px;
  }

  .safe-total-strip {
    margin-inline: 0.08rem;
    max-width: calc(100% - 0.16rem);
    display: grid;
    grid-template-columns:
      minmax(4.7rem, 1fr)
      0.72rem
      minmax(4.7rem, 1fr)
      0.72rem
      minmax(5.7rem, 1.18fr);
    align-items: stretch;
    gap: 0.08rem;
    width: auto;
    overflow: visible;
  }

  .safe-total-strip > div:not(.safe-strip-symbol) {
    min-width: 0;
    padding: 0.18rem 0.08rem;
  }

  #transaction-safe-total-card {
    min-width: 0;
  }

  .safe-total-strip span {
    font-size: 0.58rem;
    line-height: 1.05;
    white-space: nowrap;
  }

  .safe-total-strip strong {
    font-size: clamp(0.76rem, 3.2vw, 0.88rem);
    line-height: 1.12;
    white-space: nowrap;
  }

  .safe-total-strip > .safe-strip-symbol {
    min-width: 0;
    font-size: 0.82rem;
  }

  .optional-notes {
    padding-inline: 0.38rem;
  }

  .optional-notes .note-grid {
    grid-template-columns: 1fr;
  }

  .utility-panel,
  .dialog-panel.audit-dialog-panel,
  .dialog-panel.admin-transactions-panel,
  .dialog-panel.users-dialog-panel {
    width: calc(100vw - 0.6rem);
    max-height: calc(100vh - 0.6rem);
    padding: 0.45rem;
  }
}

@media print {
  nav, .nav, #alert-area, #load-report, #print-report, #pdf-link, #excel-link {
    display: none !important;
  }

  body {
    background: white;
  }

  .section-block,
  .table-responsive {
    border: 0;
    box-shadow: none;
  }
}
