:root {
  --bg: #f6f4ef;
  --panel: #ffffff;
  --panel-soft: #f9faf7;
  --ink: #151515;
  --muted: #666b70;
  --line: #d9d9d2;
  --brand: #1f6f78;
  --brand-dark: #164e55;
  --accent: #b40818;
  --good: #147a3d;
  --warn: #a46100;
  --bad: #b40818;
  --shadow: 0 14px 35px rgba(20, 24, 28, 0.11);
}

body.theme-red {
  --bg: #f8f3f2;
  --panel: #ffffff;
  --panel-soft: #fff5f3;
  --ink: #191111;
  --muted: #6f5b58;
  --line: #ead2ce;
  --brand: #c8102e;
  --brand-dark: #8f071d;
  --accent: #d71920;
  --shadow: 0 14px 35px rgba(120, 10, 24, 0.13);
}

body.theme-dark-red {
  --bg: #211013;
  --panel: #2a1418;
  --panel-soft: #37191f;
  --ink: #fff6f4;
  --muted: #e4b8b1;
  --line: #573039;
  --brand: #b40818;
  --brand-dark: #ffb4aa;
  --accent: #ff3b3b;
  --good: #69d18e;
  --warn: #ffc86b;
  --bad: #ff8178;
  --shadow: 0 14px 35px rgba(0, 0, 0, 0.26);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

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

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.button-link {
  display: inline-grid;
  place-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.button-link.ghost {
  background: var(--panel);
  color: var(--brand-dark);
  border-color: var(--line);
}

button.secondary {
  background: #e9ece7;
  color: var(--ink);
}

body.theme-red button.secondary {
  background: #ffe4df;
  color: #8f071d;
}

body.theme-dark-red button.secondary {
  background: #492028;
  color: #fff6f4;
}

button.danger {
  background: var(--bad);
}

button.ghost {
  background: transparent;
  color: var(--brand-dark);
  border: 1px solid var(--line);
}

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

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

body.theme-dark-red input,
body.theme-dark-red select,
body.theme-dark-red textarea,
body.theme-dark-red .topbar,
body.theme-dark-red .admin-compact-header,
body.theme-dark-red .admin-batch-line,
body.theme-dark-red .compact-topline,
body.theme-dark-red .sticky-save {
  background: var(--panel);
}

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

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.loading {
  padding: 32px;
  color: var(--muted);
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(246, 244, 239, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: grid;
  gap: 7px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 8px 10px;
}

.admin-compact-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
}

.admin-compact-header strong,
.admin-compact-header span {
  display: block;
  overflow-wrap: anywhere;
}

.admin-compact-header > div:first-child > strong {
  font-size: 17px;
  line-height: 1.1;
}

.admin-compact-header > div:first-child > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-compact-header .auto-check-line {
  font-size: 11px;
  font-weight: 700;
}

.admin-compact-total {
  display: grid;
  gap: 5px;
  justify-items: end;
}

.admin-compact-total > strong {
  color: var(--brand-dark);
  font-size: 18px;
  line-height: 1.1;
}

.admin-compact-total > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}

.admin-batch-line {
  display: block;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: grid;
  gap: 2px;
}

.brand strong {
  font-size: 18px;
}

.brand span {
  color: var(--muted);
  font-size: 12px;
}

.active-batch {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
}

body.theme-red .active-batch {
  background: linear-gradient(135deg, #8f071d, #d71920);
}

.active-batch strong {
  display: block;
  font-size: 15px;
}

.active-batch span {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
}

.active-batch .batch-total {
  text-align: right;
  font-size: 20px;
  font-weight: 800;
}

.admin-staff-notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(20, 122, 61, 0.3);
  border-radius: 8px;
  background: rgba(20, 122, 61, 0.08);
}

.admin-staff-notice strong,
.admin-staff-notice span {
  display: block;
}

.admin-staff-notice strong {
  color: var(--good);
}

.admin-staff-notice span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.admin-staff-notice-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(76px, auto));
  gap: 6px;
}

.admin-alert-pill {
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid rgba(190, 0, 30, 0.28);
  border-radius: 8px;
  background: #ffe0e4;
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 900;
}

.admin-staff-message-pill {
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid rgba(20, 122, 61, 0.32);
  border-radius: 8px;
  background: rgba(20, 122, 61, 0.14);
  color: var(--good);
  font-size: 11px;
  font-weight: 900;
}

.admin-message-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(20, 122, 61, 0.28);
  border-radius: 8px;
  background: rgba(20, 122, 61, 0.09);
}

.admin-message-preview strong,
.admin-message-preview span {
  display: block;
}

.admin-message-preview strong {
  color: var(--good);
  font-size: 12px;
}

.admin-message-preview span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.admin-alert-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid rgba(164, 93, 0, 0.24);
  border-radius: 8px;
  background: #fff0d8;
  color: #6b3d00;
}

.admin-alert-strip strong,
.admin-alert-strip span {
  font-size: 12px;
  font-weight: 900;
}

.admin-alert-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.fee-profile-hint {
  align-self: center;
  color: var(--good);
  font-size: 12px;
  font-weight: 900;
}

.discount-rider-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.discount-rider-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.discount-rider-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.discount-rider-row strong,
.discount-rider-row span {
  overflow-wrap: anywhere;
}

.discount-rider-row span {
  grid-column: 1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.discount-rider-row button {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.alert-history-list {
  display: grid;
  gap: 8px;
  max-height: min(62vh, 620px);
  overflow: auto;
  padding-right: 2px;
}

.alert-history-filters {
  margin: 0 0 10px;
}

.alert-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, auto);
  gap: 8px;
  align-items: start;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.alert-history-row.is-unread {
  border-color: rgba(190, 0, 30, 0.28);
  background: #fff4f5;
}

.alert-history-row strong,
.alert-history-row span,
.alert-history-row small {
  display: block;
  overflow-wrap: anywhere;
}

.alert-type-badge {
  display: inline-block !important;
  width: fit-content;
  margin: 0 0 5px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff !important;
  font-size: 10px !important;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.alert-history-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.alert-history-row small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.alert-history-actions {
  display: grid;
  gap: 6px;
  justify-items: stretch;
}

.alert-no-action {
  margin-top: 0 !important;
  color: var(--muted);
  font-size: 11px !important;
  font-weight: 900;
  text-align: right;
}

.tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(100px, 1fr);
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tab {
  min-height: 40px;
  white-space: nowrap;
  background: #fff;
  color: var(--muted);
  border: 1px solid var(--line);
}

.tab.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.tab-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  min-height: 20px;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.tab.active .tab-badge {
  background: #fff;
  color: var(--brand);
}

.submission-row-card {
  align-items: stretch;
}

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

.submission-actions .badge {
  grid-column: 1 / -1;
  justify-self: start;
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 12px 36px;
}

main.staff-shell {
  max-width: 560px;
  min-height: 100vh;
  padding: 10px;
}

.staff-panel {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: calc(100vh - 20px);
  padding: 12px;
}

.staff-panel.is-loading {
  opacity: 0.72;
}

.staff-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.staff-title h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.05;
  white-space: nowrap;
}

.staff-title h1 span {
  display: inline-block;
  color: var(--muted);
  font-size: 13px;
}

.staff-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.staff-title .staff-login-line {
  margin-top: 4px;
  color: var(--accent);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.staff-title-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

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

.staff-title-actions.one {
  grid-template-columns: 1fr;
}

.staff-title button,
.staff-title-actions button {
  min-height: 38px;
  padding: 0 8px;
  font-size: 12px;
}

.staff-top-actions {
  display: grid;
  grid-template-columns: auto auto;
  gap: 6px;
  align-items: start;
}

.staff-logout-button {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 11px;
}

.staff-update-button {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 11px;
}

.staff-login-form {
  gap: 10px;
  margin-top: 8px;
}

.staff-login-form .auth-message {
  padding: 10px;
}

.staff-login-form button {
  min-height: 48px;
}

.staff-active {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
}

.staff-active span {
  font-size: 15px;
  font-weight: 800;
}

.staff-active strong {
  font-size: 32px;
  line-height: 1;
}

.staff-active small {
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
}

.staff-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.staff-tools-fold {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.staff-tools-fold summary {
  min-height: 38px;
  display: grid;
  align-items: center;
  padding: 0 10px;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.staff-tools-fold .staff-tools {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  background: transparent;
}

.staff-attachment-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.staff-attachment-panel strong,
.staff-attachment-panel span {
  display: block;
  overflow-wrap: anywhere;
}

.staff-attachment-panel span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.staff-list {
  display: grid;
  gap: 7px;
}

.staff-list-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.staff-list-toolbar strong {
  color: var(--text);
  font-size: 14px;
}

.staff-list-toolbar label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.staff-list-toolbar select {
  min-height: 34px;
  padding: 5px 28px 5px 10px;
  font-size: 12px;
  font-weight: 900;
}

.staff-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.staff-row span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.staff-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 16px;
}

.staff-row em {
  color: var(--brand-dark);
  font-style: normal;
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
}

.staff-empty {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.staff-empty strong {
  font-size: 16px;
}

.staff-empty span {
  color: var(--muted);
  font-size: 13px;
}

.staff-ready-banner,
.staff-tools,
.staff-ready-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.staff-ready-banner strong {
  color: var(--good);
}

.staff-ready-banner span {
  color: var(--muted);
  font-size: 13px;
}

.staff-ready-banner small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.staff-ready-actions {
  display: flex;
  justify-content: flex-end;
}

.staff-ready-actions .mini-button {
  min-width: 104px;
}

.staff-ready-panel button.is-waiting {
  background: var(--panel-soft);
  color: var(--muted);
  border-color: var(--line);
}

.legend-panel {
  position: relative;
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 14px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.legend-caption {
  position: absolute;
  top: -9px;
  left: 10px;
  padding: 0 6px;
  background: var(--panel-soft);
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.staff-reply-panel {
  margin-top: 2px;
}

.staff-reply-attention {
  border-color: rgba(164, 93, 0, 0.32);
  background: #fff2d6;
}

.staff-reply-attention .legend-caption {
  background: #fff2d6;
  color: #8a5200;
}

.staff-reply-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.staff-reply-row strong,
.staff-reply-row span {
  display: block;
  overflow-wrap: anywhere;
}

.staff-reply-row strong {
  font-size: 13px;
}

.staff-reply-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.staff-tools {
  grid-template-columns: minmax(0, 1fr) auto;
}

.staff-check-row {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.staff-check-row.is-exact {
  border-color: rgba(20, 122, 61, 0.35);
  background: rgba(20, 122, 61, 0.06);
}

.staff-check-row.is-saving {
  opacity: 0.65;
}

.staff-check-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.staff-check-main > span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.staff-check-main strong,
.staff-check-main small {
  display: block;
}

.staff-check-main strong {
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.1;
}

.staff-check-main small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.staff-check-main small.good {
  color: var(--good);
}

.staff-check-main small.warn {
  color: var(--warn);
}

.staff-check-main small.staff-attribution {
  color: var(--muted);
  font-size: 10px;
}

.staff-check-main em {
  color: var(--brand-dark);
  font-style: normal;
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
}

.staff-check-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.staff-check-toggle input {
  width: 20px;
  min-width: 20px;
  min-height: 20px;
  padding: 0;
  accent-color: var(--brand);
}

.staff-remove-rider {
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border-color: rgba(190, 0, 30, 0.25);
  color: var(--brand-dark);
}

.staff-check-row textarea,
.staff-ready-panel textarea {
  min-height: 54px;
  padding: 8px 10px;
  font-size: 13px;
}

.staff-ready-label {
  display: grid;
  gap: 2px;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 900;
}

.staff-ready-label small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.staff-rider-modal {
  max-width: 520px;
}

.staff-rider-list,
.staff-rider-form {
  display: grid;
  gap: 8px;
}

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

.staff-history-tab {
  min-height: 40px;
  background: var(--panel-soft);
  color: var(--brand-dark);
}

.staff-history-tab.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

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

.staff-history-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

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

.staff-history-riders {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.staff-history-rider-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  align-items: center;
  padding: 8px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.staff-history-rider-row:first-child {
  border-top: 0;
}

.staff-history-rider-row strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.staff-history-rider-row span {
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.staff-history-rider-row em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.staff-rider-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.staff-rider-row-actions {
  display: grid;
  gap: 6px;
}

.staff-rider-row .list-title {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.staff-rider-row strong {
  overflow-wrap: anywhere;
}

.staff-rider-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.customer-auth-panel {
  display: grid;
  gap: 12px;
}

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

.auth-tab {
  min-height: 40px;
}

.auth-tab.active {
  background: var(--brand);
  color: #fff;
}

.auth-message {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}

.auth-message.good {
  color: var(--good);
}

.auth-message.bad {
  color: var(--bad);
}

.auth-message.warn {
  color: var(--warn);
}

.auth-form {
  display: grid;
  gap: 9px;
}

.auth-help {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

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

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

.account-row {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.account-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, auto);
  gap: 7px;
  align-items: center;
}

.account-actions select {
  min-height: 38px;
  padding: 6px 8px;
}

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

.grid.two {
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
}

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

.panel.pad {
  padding: 14px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title h1,
.section-title h2 {
  margin: 0;
  font-size: 20px;
}

.section-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.form-grid .span {
  grid-column: 1 / -1;
}

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

.metric {
  min-height: 74px;
  padding: 12px;
  border-radius: 8px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 7px;
  font-size: 20px;
}

.metric.good strong {
  color: var(--good);
}

.metric.bad strong {
  color: var(--bad);
}

.metric.warn strong {
  color: var(--warn);
}

.money-table {
  width: 100%;
  border-collapse: collapse;
}

.money-table th,
.money-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px;
  text-align: left;
}

.money-table th {
  background: #eeeeeb;
  color: var(--ink);
  font-size: 13px;
}

.money-table td:last-child,
.money-table th:last-child {
  text-align: right;
}

.money-table input {
  min-height: 38px;
  padding: 8px;
  text-align: right;
}

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

.row-actions button {
  flex: 1 1 155px;
}

.report-workspace {
  display: grid;
  gap: 10px;
}

.batch-attachment-panel {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

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

.attachment-head strong,
.attachment-head span {
  display: block;
  overflow-wrap: anywhere;
}

.attachment-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.attachment-upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
  gap: 8px;
}

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

.report-view-tab {
  min-height: 40px;
  background: var(--panel);
  color: var(--brand-dark);
  border: 1px solid var(--line);
}

.report-view-tab.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.report-tools {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.report-tools label {
  max-width: 560px;
}

.report-sort-select {
  max-width: 220px;
}

.png-preview-box {
  max-height: min(62vh, 640px);
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.png-preview-box img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  background: #fff;
}

.png-preview-actions {
  margin-top: 10px;
}

.muted-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.report-batch-select {
  gap: 5px;
}

.report-batch-select select {
  min-height: 42px;
  background: var(--panel);
  font-weight: 700;
}

.snapshot-status {
  display: grid;
  gap: 3px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
}

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

.snapshot-status.locked {
  border-color: rgba(14, 116, 144, 0.32);
}

.snapshot-status.live {
  border-color: rgba(180, 83, 9, 0.32);
}

.snapshot-warning {
  color: var(--danger);
  font-weight: 700;
}

.title-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.filter-pills {
  display: grid;
  grid-template-columns: repeat(5, minmax(96px, 1fr));
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.filter-pill {
  min-height: 40px;
  background: var(--panel-soft);
  color: var(--brand-dark);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.filter-pill.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.filter-pill span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  min-height: 22px;
  margin-left: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.digital-row,
.settings-row,
.customer-row,
.batch-row,
.transaction-row {
  display: grid;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.transaction-row.voided-row {
  background: rgba(180, 0, 30, 0.06);
}

.transaction-row.voided-row .list-title strong {
  color: var(--bad);
}

.submission-row-card.archived-submission-row {
  background: rgba(0, 0, 0, 0.025);
}

.old-record-note {
  color: var(--warn) !important;
  font-weight: 800;
}

.section-help {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.digital-row {
  grid-template-columns: 1fr 120px 44px;
}

.settings-row {
  grid-template-columns: 1fr 1fr 1fr 72px;
}

.note-template-list {
  display: grid;
  gap: 8px;
}

.note-template-section {
  display: grid;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.mini-section-title {
  display: grid;
  gap: 2px;
}

.mini-section-title strong {
  color: var(--ink);
}

.mini-section-title span {
  color: var(--muted);
  font-size: 12px;
}

.note-template-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(0, 1.4fr) auto 74px;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.note-template-new {
  margin-top: 10px;
}

.checkline {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

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

.deploy-checklist {
  display: grid;
  gap: 7px;
}

.deploy-checklist .checkline {
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.02);
  white-space: normal;
}

.safety-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.safety-steps li {
  line-height: 1.35;
}

.customer-row {
  grid-template-columns: 1fr auto;
}

.batch-row,
.transaction-row {
  grid-template-columns: 1fr auto;
}

.list-title {
  display: grid;
  gap: 4px;
}

.list-title strong {
  font-size: 15px;
}

.list-title span {
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eceff0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.badge.good {
  background: #e1f4e8;
  color: var(--good);
}

.badge.bad {
  background: #ffe4e7;
  color: var(--bad);
}

.badge.warn {
  background: #fff0d8;
  color: var(--warn);
}

.report-wrap {
  display: grid;
  gap: 12px;
}

.report-card {
  width: min(100%, 860px);
  margin: 0 auto;
  background: #fff;
  color: #0d0d0d;
  border: 2px solid #777;
  padding: 46px 52px 34px;
  box-shadow: var(--shadow);
}

.report-date {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 10px;
  border-bottom: 2px solid #777;
  font-size: 24px;
}

.report-hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  margin-top: 48px;
  border: 2px solid #777;
}

.report-group {
  display: grid;
  place-items: center;
  min-height: 118px;
  background: #6d6d6a;
  color: #fff;
  text-align: center;
  font-size: 60px;
  font-weight: 900;
}

.report-group span {
  display: block;
  margin-top: 4px;
  font-size: 19px;
}

.report-total {
  display: grid;
  align-content: center;
  padding: 10px 18px;
}

.report-total span {
  font-size: 26px;
  font-weight: 900;
}

.report-total strong {
  margin-top: 18px;
  color: #a80008;
  text-align: center;
  font-size: 48px;
}

.report-table {
  width: 100%;
  margin-top: 52px;
  border-collapse: collapse;
  font-size: 25px;
}

.report-table th {
  background: #d9d9d9;
  padding: 14px 10px;
  text-align: left;
}

.report-table th:last-child,
.report-table td:last-child {
  text-align: right;
}

.report-table td {
  border-bottom: 2px solid #e0e0e0;
  padding: 9px 10px;
}

.report-row-note {
  display: block;
  margin-top: 2px;
  color: #666;
  font-size: 10px;
  font-weight: 800;
}

.report-foot {
  margin-top: 34px;
  color: #555;
  font-size: 16px;
}

.toast {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 80;
  max-width: 560px;
  margin: 0 auto;
  padding: 12px 14px;
  border-radius: 8px;
  background: #111;
  color: #fff;
  box-shadow: var(--shadow);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.42);
}

.modal {
  width: min(100%, 560px);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 18px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

body.theme-dark-red .modal {
  background: var(--panel);
  color: var(--ink);
}

.modal h3 {
  margin: 0 0 8px;
}

.modal p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.4;
}

.modal-message-preview {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.chat-thread {
  display: grid;
  gap: 8px;
  max-height: min(48vh, 420px);
  overflow: auto;
  padding: 2px;
}

.chat-bubble {
  display: grid;
  gap: 4px;
  width: min(92%, 420px);
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.chat-bubble.from-admin {
  justify-self: end;
  border-color: rgba(190, 0, 30, 0.24);
  background: #fff0f2;
}

.chat-bubble.from-staff {
  justify-self: start;
  border-color: rgba(33, 126, 134, 0.26);
  background: rgba(33, 126, 134, 0.08);
}

.chat-bubble.from-ready {
  justify-self: start;
  border-color: rgba(20, 122, 61, 0.28);
  background: rgba(20, 122, 61, 0.08);
}

.chat-bubble strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.chat-bubble p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.chat-bubble span,
.chat-empty {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.chat-empty {
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.hidden {
  display: none !important;
}

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

.move-grid .span,
.correction-fields .customer-field {
  grid-column: 1 / -1;
}

.compact-topline {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.compact-topline strong,
.compact-topline span {
  display: block;
  overflow-wrap: anywhere;
}

.compact-topline span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.compact-toggle,
.mini-button {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 12px;
}

.theme-toggle {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--brand-dark);
  font-size: 12px;
}

.theme-picker {
  display: grid;
  grid-template-columns: auto minmax(92px, 118px);
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.theme-picker select {
  min-height: 34px;
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
}

.option-theme-picker {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.option-theme-picker select {
  width: 100%;
  min-height: 44px;
  font-size: 14px;
}

.customer-title-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.settings-button {
  min-height: 38px;
  padding: 7px 10px;
  font-size: 12px;
}

.notes-button {
  min-height: 38px;
  padding: 7px 10px;
  font-size: 12px;
}

.notes-button::before {
  content: "\1F4DD";
  margin-right: 4px;
}

.icon-button {
  width: 36px;
  min-height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 16px;
}

.app-version {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.settings-panel {
  position: absolute;
  top: 58px;
  right: 12px;
  z-index: 35;
  width: min(360px, calc(100% - 24px));
  display: grid;
  gap: 8px;
  margin: 0 0 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  box-shadow: var(--shadow);
}

.settings-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.app-update-notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
  padding: 8px 10px;
  border: 1px solid #f0c36c;
  border-radius: 8px;
  background: #fff7e6;
  color: #6a4200;
}

.app-update-notice strong,
.app-update-notice span {
  display: block;
}

.app-update-notice span {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.settings-panel-head strong {
  color: var(--ink);
  font-size: 14px;
}

.settings-theme {
  grid-template-columns: minmax(0, 1fr) minmax(112px, 150px);
}

.compact-row-actions {
  margin-top: 0;
}

.local-ref {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.local-status-sync {
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.compact-form {
  padding: 12px;
}

.compact-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.compact-title h1 {
  margin: 0;
  font-size: 18px;
}

.compact-title p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.compact-fields {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(110px, 0.8fr) minmax(90px, 0.7fr);
  gap: 8px;
}

.customer-primary-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}

.notebook-button {
  min-height: 46px;
  padding: 8px 10px;
  font-size: 12px;
}

.edit-info-button {
  min-height: 46px;
  padding: 8px 10px;
  font-size: 13px;
}

.remit-entry-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 0.52fr);
  gap: 8px;
  align-items: stretch;
  margin-top: 8px;
}

.remit-fee-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(98px, 0.42fr);
  gap: 8px;
  align-items: stretch;
  margin-top: 8px;
}

#customerRemit,
#customerFeeDisplay {
  font-size: 22px;
  font-weight: 900;
}

.fee-toggle {
  min-height: 46px;
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.15;
}

.fee-toggle input {
  width: auto;
  min-height: auto;
}

.include-fee-row {
  min-height: 46px;
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.2;
}

.include-fee-row input {
  width: 24px;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  accent-color: var(--brand);
}

.admin-include-fee-row {
  min-height: 46px;
  margin-top: 0;
  font-size: 13px;
  font-weight: 800;
}

.compact-fields .span {
  grid-column: 1 / -1;
}

.compact-fields input,
.compact-fields select,
.compact-notes textarea {
  min-height: 38px;
  padding: 8px 10px;
}

.float-field {
  position: relative;
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.float-field input,
.float-field select,
.float-field textarea {
  width: 100%;
  min-height: 46px;
  padding: 17px 10px 6px;
}

.float-field input[readonly] {
  color: var(--muted);
  background: rgba(0, 0, 0, 0.035);
}

.float-field span {
  position: absolute;
  left: 11px;
  top: 14px;
  pointer-events: none;
  color: var(--muted);
  font-size: 14px;
  transition: top 0.14s ease, font-size 0.14s ease, color 0.14s ease;
}

.float-field input:focus + span,
.float-field input:not(:placeholder-shown) + span,
.float-field input[data-format-money] + span,
.float-field select:focus + span,
.float-field select + span,
.float-field textarea:focus + span,
.float-field textarea:not(:placeholder-shown) + span {
  top: 5px;
  color: var(--brand-dark);
  font-size: 10px;
}

.duplicate-warning {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #f4c77a;
  border-radius: 8px;
  background: #fff7e6;
}

.duplicate-warning strong,
.duplicate-warning span {
  display: block;
}

.duplicate-warning span {
  color: var(--muted);
  font-size: 13px;
}

.duplicate-warning div {
  display: flex;
  gap: 8px;
}

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

.compact-summary .metric {
  min-height: 58px;
  padding: 8px;
}

.compact-summary .metric strong {
  margin-top: 4px;
  font-size: 16px;
}

.compact-summary .metric.priority strong {
  font-size: 18px;
}

.customer-fee-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin: 6px 0 2px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.customer-fee-line strong {
  color: var(--brand-dark);
  text-align: right;
}

.main-wallet-section {
  display: grid;
  gap: 5px;
  margin-top: 6px;
}

.main-wallet-section .mini-section-title {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: end;
}

.main-wallet-section .mini-section-title strong {
  font-size: 13px;
}

.main-wallet-section .mini-section-title span {
  font-size: 11px;
  text-align: right;
}

.main-wallet-table {
  margin: 0;
}

.main-wallet-table th,
.main-wallet-table td {
  padding: 4px 6px;
}

.main-wallet-table td:first-child {
  width: 40%;
}

.main-wallet-table td:nth-child(2) {
  width: 38%;
}

.main-wallet-table td:last-child {
  width: 22%;
}

.main-wallet-label {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.extra-wallet-row td {
  background: rgba(255, 255, 255, 0.58);
}

#customerSubmitBlock {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

#fastSubmitSlot .compact-notes {
  margin-top: 2px;
}

#fastSubmitSlot .compact-notes textarea {
  min-height: 48px;
}

#fastSubmitSlot .submit-panel {
  margin-top: 2px;
}

.admin-pay-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 8px 0 6px;
}

.admin-pay-summary div {
  min-height: 50px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.admin-pay-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.admin-pay-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.admin-pay-summary small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.admin-pay-summary div:last-child {
  border-color: rgba(20, 122, 61, 0.28);
  background: rgba(20, 122, 61, 0.06);
}

.admin-pay-summary div:last-child strong {
  color: var(--brand-dark);
}

.counter-sticky-status {
  position: sticky;
  top: 6px;
  z-index: 12;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 8px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 18px rgba(20, 24, 28, 0.08);
}

body.theme-dark-red .counter-sticky-status {
  background: rgba(42, 20, 24, 0.96);
}

.counter-sticky-status div {
  min-height: 62px;
  padding: 8px 7px;
  border-right: 1px solid var(--line);
}

.counter-sticky-status div:last-child {
  border-right: 0;
  background: var(--panel-soft);
}

.counter-sticky-status span,
.detail-fields span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.counter-sticky-status strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.08;
}

.counter-sticky-status small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.15;
}

.counter-sticky-status .good strong {
  color: var(--good);
}

.counter-sticky-status .bad strong {
  color: var(--bad);
}

.counter-sticky-status .warn strong {
  color: var(--warn);
}

.counter-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

.counter-head h2 {
  margin: 0;
  font-size: 16px;
}

.counter-head div {
  display: grid;
  grid-template-columns: minmax(104px, 1fr) auto;
  gap: 6px;
  justify-content: flex-end;
}

.reset-counter-small {
  min-height: 30px;
  align-self: center;
  padding: 4px 8px;
  border-color: #f1b9be;
  color: var(--bad);
  font-size: 11px;
}

.wallet-add-button {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 0 5px;
  border-radius: 8px;
  font-size: 10px;
  line-height: 1;
  white-space: normal;
}

.compact-money th,
.compact-money td {
  padding: 5px 7px;
}

.compact-money input,
.compact-money select {
  min-height: 34px;
  padding: 6px 8px;
}

.compact-money td:first-child {
  width: 38%;
  font-weight: 700;
}

.compact-money td:nth-child(2) {
  width: 34%;
}

.compact-money td:last-child {
  width: 28%;
}

.compact-number {
  text-align: right;
}

tr.digital-row {
  display: table-row;
  padding: 0;
  border-bottom: 0;
}

.payment-method-control {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}

.payment-logo {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.payment-logo img {
  display: block;
  max-width: 30px;
  max-height: 24px;
}

.payment-logo-fallback {
  color: var(--brand-dark);
  font-size: 10px;
  font-weight: 900;
}

.detail-payment-method {
  display: inline-grid;
  grid-template-columns: 28px auto;
  justify-content: start;
}

.detail-payment-method .payment-logo {
  width: 28px;
  height: 28px;
}

.detail-payment-method .payment-logo img {
  max-width: 25px;
  max-height: 20px;
}

.danger-note {
  margin: 10px 0 0;
  color: var(--bad);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.mini-list {
  display: grid;
  gap: 8px;
  margin: 8px 0 12px;
}

.mini-list-row {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.mini-list-row strong {
  font-size: 13px;
}

.mini-list-row span {
  color: var(--muted);
  font-size: 12px;
}

.add-payment-inline {
  width: 100%;
  margin-top: 8px;
}

.payment-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, 0.42fr);
  gap: 8px;
}

.short-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 0.7fr);
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.short-action span {
  color: var(--bad);
  font-size: 13px;
  font-weight: 800;
}

.remember-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 0;
  color: var(--muted);
  font-size: 13px;
}

.remember-row label {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
}

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

.submit-panel {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.submit-panel div {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

#checkSubmissionStatus {
  min-width: 104px;
}

#submitForChecking {
  min-width: 150px;
}

.recent-status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.recent-status-note {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.submit-panel .good {
  color: var(--good);
}

.submit-panel .bad {
  color: var(--bad);
}

.submit-panel .warn {
  color: var(--warn);
}

.local-record-list {
  display: grid;
  gap: 8px;
}

.local-delete-tools {
  display: grid;
  gap: 7px;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.local-delete-tools strong,
.local-delete-tools span {
  display: block;
}

.local-delete-tools span {
  color: var(--muted);
  font-size: 12px;
}

.history-delete-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.history-delete-grid input {
  min-height: 34px;
  padding: 6px 8px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef3f7;
  color: #3d6478;
  font-size: 11px;
  font-weight: 900;
}

.status-badge.submitted,
.status-badge.new-after-confirmed {
  background: #fff0d8;
  color: var(--warn);
}

.status-badge.confirmed {
  background: #e1f4e8;
  color: var(--good);
}

.status-badge.needs-correction {
  background: #fff0d8;
  color: #a45d00;
}

.status-badge.rejected {
  background: #ffe4e7;
  color: var(--bad);
}

.status-badge.offline-saved,
.status-badge.offline-queued {
  background: #e8f0ff;
  color: #345c9c;
}

.record-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.notebook-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(96px, 0.42fr);
  gap: 8px;
  margin-bottom: 10px;
}

.notebook-form textarea {
  min-height: 72px;
  resize: vertical;
}

.notebook-form textarea,
.notebook-form input {
  width: 100%;
}

.notebook-form button {
  grid-column: 1 / -1;
}

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

.notebook-item {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

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

.notebook-item span {
  color: var(--muted);
  font-size: 12px;
}

.notebook-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(76px, auto);
  gap: 6px;
}

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

.guide-list div {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.guide-list strong {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
}

.guide-list span {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.autocomplete-list {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
}

.autocomplete-option {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--ink);
  text-align: left;
}

.autocomplete-option span {
  color: var(--muted);
  font-size: 12px;
}

.search-input {
  margin-bottom: 10px;
}

.history-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.detail-modal h4 {
  margin: 12px 0 6px;
}

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

.detail-table td:nth-child(2) {
  text-align: center;
}

.detail-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin: 8px 0;
}

.detail-fields div,
.detail-note {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.detail-fields strong {
  display: block;
  margin-top: 3px;
}

.detail-note {
  color: var(--muted);
  font-size: 13px;
}

.compact-notes {
  margin-top: 8px;
}

.compact-notes textarea {
  min-height: 48px;
}

.sticky-save {
  position: sticky;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr minmax(108px, 0.38fr);
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.sticky-save div {
  min-height: 44px;
  display: grid;
  align-items: center;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--panel-soft);
  font-weight: 800;
}

.sticky-save .good {
  color: var(--good);
}

.sticky-save .bad {
  color: var(--bad);
}

.sticky-save .warn {
  color: var(--warn);
}

.customer-home {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
}

.customer-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

@media (max-width: 760px) {
  .grid.two,
  .form-grid,
  .summary-strip {
    grid-template-columns: 1fr;
  }

  .active-batch {
    grid-template-columns: 1fr;
  }

  .admin-staff-notice,
  .staff-tools,
  .staff-attachment-panel,
  .attachment-head,
  .attachment-upload-row {
    grid-template-columns: 1fr;
  }

  .active-batch .batch-total {
    text-align: left;
  }

  .report-card {
    padding: 26px 18px 22px;
  }

  .report-date {
    font-size: 17px;
  }

  .report-hero {
    grid-template-columns: 1fr;
    margin-top: 32px;
  }

  .report-group {
    min-height: 88px;
    font-size: 44px;
  }

  .report-total strong {
    font-size: 38px;
  }

  .report-table {
    margin-top: 32px;
    font-size: 18px;
  }

  .digital-row,
  .settings-row,
  .note-template-row {
    grid-template-columns: 1fr;
  }

  .account-actions {
    grid-template-columns: 1fr 1fr;
  }

  .account-actions select {
    grid-column: 1 / -1;
  }

  tr.digital-row {
    display: table-row;
  }

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

  .customer-primary-fields {
    grid-template-columns: minmax(0, 1fr) 86px;
  }

  .notebook-button {
    grid-column: 1 / -1;
  }

  .remit-entry-row {
    grid-template-columns: minmax(0, 1fr) minmax(112px, 0.52fr);
  }

  .compact-fields .customer-field {
    grid-column: 1 / -1;
  }

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

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

  .sticky-save {
    grid-template-columns: 1fr 112px;
  }

  .admin-pay-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .admin-pay-summary div {
    min-height: 46px;
    padding: 7px 8px;
  }

  .admin-pay-summary strong {
    font-size: 14px;
  }

  .topbar-inner {
    gap: 7px;
    padding: 8px;
  }

  .admin-compact-header {
    gap: 7px;
    padding: 7px 8px;
  }

  .admin-compact-header > div:first-child > strong,
  .admin-compact-total > strong {
    font-size: 16px;
  }

  .admin-compact-total .mini-button {
    min-height: 30px;
    padding: 5px 7px;
    font-size: 11px;
  }

  .admin-batch-line {
    padding: 6px 8px;
    font-size: 11px;
  }

  .compact-form {
    padding: 10px;
  }

  .compact-title {
    margin-bottom: 8px;
  }

  .compact-topline {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .compact-actions {
    display: grid;
    grid-template-columns: minmax(74px, 112px);
    justify-content: end;
    width: 100%;
    align-items: stretch;
  }

  .option-theme-picker {
    grid-template-columns: 1fr;
    width: 100%;
    min-width: 0;
  }

  .option-theme-picker select,
  .compact-toggle {
    width: 100%;
    min-width: 0;
  }

  .customer-title-actions {
    align-items: end;
  }

  .active-batch {
    padding: 10px;
  }

  .tabs {
    grid-auto-flow: row;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-columns: initial;
    gap: 5px;
    overflow-x: visible;
    padding-bottom: 0;
  }

  .tab {
    min-height: 34px;
    padding: 5px 6px;
    font-size: 12px;
    white-space: normal;
  }

  .submission-row-card {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .submission-row-card .list-title {
    min-width: 0;
  }

  .submission-row-card .list-title strong,
  .submission-row-card .list-title span {
    overflow-wrap: anywhere;
  }

  .submission-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .submission-actions .badge {
    grid-column: 1 / -1;
  }

  .submission-actions button {
    min-height: 38px;
    padding: 6px 7px;
  }

  main {
    padding: 10px 8px 28px;
  }

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

  .filter-pills {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow-x: visible;
    gap: 6px;
  }

  .filter-pill {
    min-height: 36px;
    padding: 6px 8px;
    font-size: 12px;
  }

  .move-grid,
  .correction-fields {
    grid-template-columns: 1fr;
  }

  .history-filters input:last-of-type,
  .history-filters select:last-child {
    grid-column: span 1;
  }

  .counter-sticky-status strong {
    font-size: 20px;
  }

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

  .counter-head {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .counter-head div {
    width: auto;
    max-width: none;
    grid-template-columns: auto;
  }

  .reset-counter-small {
    min-width: 0;
    padding-inline: 8px;
  }

  .short-action {
    grid-template-columns: 1fr;
  }

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

  .admin-alert-actions {
    width: 100%;
    justify-content: stretch;
  }

  .admin-alert-actions button {
    flex: 1 1 118px;
  }

  .alert-history-row {
    grid-template-columns: 1fr;
  }

  .discount-rider-add {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #fff;
  }

  .topbar,
  .no-print,
  .toast {
    display: none !important;
  }

  main {
    padding: 0;
  }

  .report-card {
    width: 100%;
    border: 0;
    box-shadow: none;
  }
}
