:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #667085;
  --line: #d8dee8;
  --soft: #f4f7fb;
  --panel: #ffffff;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --danger: #b42318;
  --warn-bg: #fff7e6;
  --ok-bg: #e8f6ef;
  --title-bg: #eef2f6;
  --title-border: #d6dde8;
}

* {
  box-sizing: border-box;
}

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

.login-page {
  min-height: 100vh;
  background: #eef2f6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: auto;
}

.login-shell {
  width: 100%;
  min-height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.login-card {
  width: 100%;
  max-width: 430px;
  min-width: 320px;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(23, 32, 51, 0.18);
}

.login-logo {
  width: 82px;
  height: 82px;
  object-fit: contain;
  display: block;
  margin-bottom: 14px;
}

.login-card h1 {
  margin-top: 4px;
  font-size: 24px;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.login-form label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

.login-form select,
.login-form input {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

.login-form button {
  justify-content: center;
  min-height: 46px;
  margin-top: 4px;
}

.login-error {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: #fff5f3;
  color: var(--danger);
  font-weight: 800;
}

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

.shell {
  width: min(1280px, calc(100% - 28px));
  margin: 18px auto 40px;
}

.topbar {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-logo {
  width: 74px;
  height: 74px;
  object-fit: contain;
  flex: 0 0 auto;
}

.admin-header-badge {
  display: none;
}

.admin-access .admin-header-badge {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: block;
  color: #b42318;
  font-size: 22px;
  font-weight: 1000;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0;
}

.eyebrow,
.sub,
.muted {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  font-size: 25px;
}

h2 {
  font-size: 18px;
}

.clock {
  text-align: right;
  min-width: 172px;
}

.clock span,
.clock strong {
  display: block;
}

.clock strong {
  font-size: 24px;
}

.mode-banner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  margin: 12px 0;
  padding: 12px 14px;
  border: 2px solid var(--danger);
  border-radius: 8px;
  background: #fff5f3;
  color: var(--danger);
}

.mode-banner strong {
  font-size: 18px;
  font-weight: 900;
}

.mode-banner span {
  color: #7a271a;
  font-size: 14px;
  font-weight: 700;
}

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

.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.kpi span:first-child {
  margin: -4px -4px 8px;
  padding: 6px 8px;
  border: 1px solid var(--title-border);
  border-radius: 6px;
  background: var(--title-bg);
  color: #475467;
  font-weight: 800;
}

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

.kpi strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
}

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

.notice {
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--ok-bg);
  margin-bottom: 14px;
}

.notice.warn {
  background: var(--warn-bg);
  border-color: #f3c06b;
}

.notice.admin-cash {
  background: #fff5f5;
  border: 2px solid #b42318;
  color: #b42318;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.45;
}

.notice.admin-cash strong {
  color: #b42318;
  font-weight: 1000;
  text-transform: uppercase;
}

.notice.lock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff7ed;
  border-color: #fb923c;
  color: #7c2d12;
  font-weight: 800;
}

.notice.lock strong {
  color: #9a3412;
}

.notice-action {
  flex: 0 0 auto;
  border-color: #fb923c;
  background: #ffffff;
  color: #7c2d12;
  font-weight: 900;
}

.action-bar {
  display: grid;
  grid-template-columns: minmax(820px, 1fr) minmax(180px, 220px);
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  position: relative;
  min-height: 84px;
}

.action-buttons {
  display: flex;
  grid-column: 2;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.admin-access .shift-hero {
  display: none;
}

.admin-access .action-bar {
  grid-template-columns: 1fr;
  min-height: auto;
}

.admin-access .action-buttons {
  display: grid;
  grid-column: 1;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) minmax(240px, 1.7fr) minmax(140px, 1fr);
  width: 100%;
  align-items: stretch;
}

.admin-access .tabs,
.admin-access .admin-actions {
  display: contents;
}

.admin-access .action-buttons button {
  width: 100%;
  min-width: 0;
}

.habt-access .action-buttons {
  justify-content: flex-end;
}

.habt-access .tabs {
  width: min(200px, 100%);
  margin-left: auto;
}

.habt-access .tabs .tab:not(.hidden) {
  width: 100%;
}

.tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 0;
  position: static;
  transform: none;
}

.tab,
.ghost,
.primary {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  background: #fff;
  cursor: pointer;
}

.tab {
  min-width: 106px;
  text-align: center;
  font-weight: 800;
}

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

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

.admin-actions.hidden {
  display: none;
}

.admin-button,
.correction-open-button {
  margin-left: 0;
  padding-right: 12px;
  padding-left: 12px;
  font-size: 13px;
  font-weight: 900;
  color: #ffffff;
}

.correction-open-button {
  border-color: #b42318;
  background: #b42318;
  width: 232px;
  max-width: 100%;
}

.correction-open-button:hover {
  background: #912018;
  border-color: #912018;
}

.admin-button {
  width: 128px;
  max-width: 100%;
  border-color: #155eef;
  background: #155eef;
}

.admin-button:hover {
  background: #004eeb;
  border-color: #004eeb;
}

.print-action {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
  font-weight: 900;
}

.print-action:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.add-late-button {
  background: #16a34a;
  color: #ffffff;
  border-color: #15803d;
  font-weight: 900;
}

.add-late-button:hover {
  background: #15803d;
  border-color: #166534;
}

.primary:hover {
  background: var(--brand-dark);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.shift-hero {
  display: flex;
  justify-content: flex-start;
  margin: 0;
  padding: 0;
}

.shift-hero-inner {
  min-width: 0;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(420px, 1fr) 34px minmax(150px, 190px) minmax(170px, 210px);
  grid-template-rows: 1fr;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 14px;
  border: 3px solid #0f766e;
  border-radius: 8px;
  background: #172033;
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(23, 32, 51, 0.2);
}

.shift-hero-label {
  font-size: 15px;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
}

.shift-user-label {
  display: block;
  grid-column: 3;
  font-size: 22px;
  font-weight: 1000;
  line-height: 1;
  color: #99f6e4;
  letter-spacing: 0;
  white-space: nowrap;
  text-align: center;
}

.shift-help-button {
  grid-column: 2;
  justify-self: center;
}

.shift-hero-inner.night {
  border-color: #f97316;
  background: #111827;
  box-shadow: 0 12px 28px rgba(249, 115, 22, 0.28);
}

.shift-hero-inner.night .shift-user-label {
  color: #ffffff;
  font-size: 23px;
  text-transform: uppercase;
}

.shift-hero-control {
  display: grid;
  grid-column: 4;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 4px;
  color: #e6f7f4;
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
}

.shift-hero-control select {
  min-height: 40px;
  border: 2px solid #99f6e4;
  background: #ffffff;
  color: #0f172a;
  font-size: 15px;
  font-weight: 900;
  text-align: center;
  cursor: pointer;
}

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

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

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 9px 10px;
  border: 1px solid var(--title-border);
  border-radius: 8px;
  background: var(--title-bg);
}

.panel-title h2 {
  color: #344054;
}

.cash-panel .panel-title {
  min-height: 45px;
}

.shift-panel .panel-title {
  min-height: 34px;
  margin-bottom: 8px;
}

.label-with-help,
.label-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.habt-help {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
  border: 2px solid var(--brand);
  border-radius: 999px;
  background: #ffffff;
  color: var(--brand-dark);
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.habt-access .habt-help {
  display: inline-flex;
}

.admin-access .habt-help {
  display: none !important;
}

.habt-help:hover,
.habt-help:focus-visible {
  background: var(--ok-bg);
  color: #0f5132;
  outline: 3px solid rgba(15, 118, 110, 0.2);
  outline-offset: 2px;
}

.inline-help {
  width: 22px;
  min-width: 22px;
  height: 22px;
  border-width: 1px;
  font-size: 12px;
}

.shift-help-button {
  grid-column: 2;
  justify-self: center;
  align-self: center;
}

.shift-panel #signaturePanelTitle {
  color: #15803d;
}

.shift-panel,
.cash-panel {
  display: flex;
  flex-direction: column;
}

.cash-panel .cash-layout {
  flex: 1;
}

#cashTotal {
  font-size: 30px;
  font-weight: 700;
}

#cashTotal.balanced {
  color: #155eef;
}

#cashTotal.unbalanced {
  color: var(--danger);
  font-size: 42px;
  font-weight: 900;
}

.signature-grid,
.signature-box,
.cash-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.signature-box {
  padding: 10px;
  border: 2px solid #f0b4ad;
  border-radius: 8px;
  background: #fff5f3;
}

.day-cash-summary {
  margin-bottom: 10px;
  padding: 10px;
  border: 2px solid #16a34a;
  border-radius: 8px;
  background: #f0fdf4;
  color: #14532d;
}

.global-day-cash-summary {
  margin-bottom: 16px;
}

.day-cash-summary-title {
  margin: 0 0 10px;
  color: #15803d;
  font-size: 20px;
  font-weight: 1000;
}

.day-cash-summary-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 12px;
  align-items: end;
  margin-bottom: 8px;
}

.day-cash-date-control {
  color: #14532d;
  font-size: 14px;
  font-weight: 1000;
}

.day-cash-date-control span {
  display: block;
  margin-bottom: 4px;
  font-weight: 1000;
}

.day-cash-date-control input {
  min-height: 40px;
  border: 2px solid #16a34a;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
}

.day-cash-date-help {
  margin: 0 0 10px;
  color: #15803d;
  font-weight: 800;
}

.day-cash-summary ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.day-cash-summary li {
  display: grid;
  grid-template-columns: 110px 72px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  background: #ffffff;
}

.day-cash-summary li.missing {
  background: #ffffff;
  border-color: #bbf7d0;
}

.day-cash-summary strong {
  color: #15803d;
  font-weight: 1000;
}

.day-cash-summary span {
  color: var(--ink);
  font-weight: 900;
}

.day-cash-summary small {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.day-cash-summary p {
  margin: 9px 0 0;
  color: #15803d;
  font-weight: 900;
}

.day-cash-summary .signature-required-note {
  color: #15803d;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.25;
}

.day-cash-summary .correction-detail-note {
  margin-top: 18px;
  color: #b42318;
  font-weight: 1000;
}

.day-cash-summary .archive-consult-note {
  margin-top: 6px;
  color: #15803d;
  font-weight: 1000;
}

.missing-signature {
  color: #b42318 !important;
  font-weight: 1000;
}

.missing-signature-line {
  color: #b42318 !important;
  font-weight: 1000 !important;
}

.signature-label {
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
}

.signature-label input {
  margin-top: 4px;
  padding: 8px 9px;
  font-size: 14px;
  font-weight: 400;
}

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

.field-hint,
.required-hint {
  display: inline;
  font-size: 12px;
  font-style: italic;
  font-weight: 400;
}

.required-hint {
  color: var(--danger);
}

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

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

input:disabled,
textarea:disabled,
select:disabled,
button:disabled,
input[readonly] {
  background: #edf1f5;
  color: #778192;
}

.warning {
  display: block;
  margin: 8px 0 0;
  padding: 12px 14px;
  border: 2px solid #dc2626;
  border-radius: 8px;
  background: #fff5f5;
  color: var(--danger);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
}

.warning strong {
  display: block;
  margin-bottom: 8px;
  font-size: 22px;
  font-weight: 900;
}

.warning .inline-strong {
  display: inline;
  margin: 0;
  font-size: inherit;
  font-weight: 900;
}

.warning p {
  margin: 0;
}

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

.denom-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.denom-row strong {
  font-size: 14px;
}

.cash-fields {
  display: grid;
  gap: 12px;
  align-content: start;
}

.gap-box {
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--soft);
  padding: 12px;
}

.gap-box span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.piece-summary span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.gap-box strong {
  font-size: 24px;
}

#cashGap {
  color: var(--danger);
  font-weight: 900;
}

#cashPieceTotal.no-piece {
  color: var(--danger);
}

#cashPieceTotal.has-piece {
  color: #12805c;
  font-weight: 900;
}

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

.piece-summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--soft);
}

.piece-summary strong {
  display: block;
  margin-top: 5px;
  font-size: 22px;
}

.piece-summary .no-piece {
  color: var(--danger);
}

.piece-summary .has-piece {
  color: #12805c;
  font-weight: 900;
}

.carry-notice {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #8fd0ad;
  border-radius: 8px;
  background: #e8f6ef;
  color: #0b6848;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.carry-notice.warn {
  border-color: #f3c06b;
  background: #fff7e6;
  color: #9a5b13;
}

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

.payment-row {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, minmax(130px, 1fr));
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.payment-row .label {
  font-weight: 700;
  color: var(--ink);
  padding-bottom: 10px;
}

.payment-hint {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  font-style: italic;
}

.payment-row.cb-alert {
  border-color: var(--danger);
  background: #fff5f3;
}

.payment-row input.gap-alert {
  border-color: var(--danger);
  color: var(--danger);
  font-weight: 900;
}

.late-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.business-alert {
  border: 1px solid #f3c06b;
  border-radius: 8px;
  background: #fff7e6;
  padding: 12px;
  margin-bottom: 12px;
}

.business-alert.needs-detail {
  border-color: var(--danger);
  background: #fff5f3;
}

.business-alert strong {
  color: var(--danger);
  font-size: 16px;
}

.business-alert p {
  margin: 6px 0 0;
  line-height: 1.4;
}

.business-alert ol {
  margin: 8px 0 0;
  padding-left: 24px;
}

.business-alert li {
  margin: 6px 0;
  line-height: 1.45;
}

.business-alert .business-term {
  font-weight: 900;
}

.business-alert .business-note {
  color: #667085;
  font-style: italic;
  font-weight: 400;
}

.late-row,
.voucher-row {
  display: grid;
  grid-template-columns: 1fr 1fr 160px auto;
  gap: 8px;
  align-items: end;
}

.late-row {
  grid-template-columns: 160px 1fr 150px 130px auto;
}

.fixed-late-type {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 900;
}

.actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
}

#saveMessage {
  margin: 0;
  color: var(--brand-dark);
  font-weight: 700;
}

#saveMessage.error {
  color: var(--danger);
}

.correction-panel {
  margin-bottom: 14px;
  border: 2px solid #b42318;
  background: #fff5f5;
}

.correction-panel h2 {
  color: #b42318;
}

.correction-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 12px;
}

.notice.correction {
  background: #fff5f5;
  border-color: #b42318;
  color: #b42318;
  font-weight: 900;
}

.admin-dialog.correction-lookup-dialog {
  width: min(860px, calc(100% - 20px));
}

.admin-dialog.correction-editor-dialog {
  width: min(1240px, calc(100% - 14px));
  max-height: calc(100vh - 18px);
  max-height: calc(100dvh - 18px);
}

.correction-lookup-dialog::backdrop,
.correction-editor-dialog::backdrop {
  background: rgba(70, 18, 9, 0.68);
}

.correction-lookup-dialog .admin-card,
.admin-card.correction-editor-card {
  max-height: calc(100vh - 18px);
  max-height: calc(100dvh - 18px);
  border: 4px solid #b42318;
  background: #fffafa;
  box-shadow: 0 34px 100px rgba(88, 17, 9, 0.42);
}

.correction-lookup-dialog .panel-title,
.correction-editor-card > .panel-title {
  align-items: flex-start;
  margin: -18px -18px 0;
  padding: 20px 22px;
  border-bottom: 4px solid #ffb020;
  border-radius: 4px 4px 0 0;
  background: #b42318;
  color: #ffffff;
}

.correction-lookup-dialog .panel-title h2,
#correctionEditorTitle {
  color: #ffffff;
  font-size: clamp(26px, 3vw, 40px);
  font-weight: 1000;
  line-height: 1.05;
  text-transform: uppercase;
}

.correction-editor-subtitle {
  display: block;
  margin-top: 10px;
  color: #fff2cc;
  font-size: clamp(21px, 2.2vw, 32px);
  font-weight: 1000;
  line-height: 1.15;
}

.correction-lookup-dialog .panel-title .ghost,
.correction-editor-card > .panel-title .ghost {
  border: 2px solid #ffffff;
  background: #ffffff;
  color: #b42318;
  font-weight: 1000;
}

.correction-lookup-dialog .panel-title .ghost:hover,
.correction-editor-card > .panel-title .ghost:hover {
  background: #fff2cc;
}

.correction-editor-body {
  display: grid;
  gap: 14px;
  min-width: 0;
}

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

.correction-editor-warning {
  margin-bottom: 2px;
}

.correction-lookup-dialog .admin-impact-warning,
.admin-impact-warning.correction-editor-warning {
  border: 3px solid #ffb020;
  background: #fff7e6;
  color: #7a271a;
  font-size: 18px;
}

.admin-impact-warning,
.confirm-warning-text {
  margin: 0;
  padding: 12px 14px;
  border: 2px solid #b42318;
  border-radius: 8px;
  background: #fff5f5;
  color: #b42318;
  font-weight: 900;
  line-height: 1.35;
}

.admin-impact-warning {
  display: grid;
  gap: 4px;
}

.admin-impact-warning strong {
  font-size: 20px;
  text-transform: uppercase;
}

.correction-lookup-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 1fr);
  gap: 12px;
}

#correctionLookupMessage {
  margin: 0;
  color: var(--brand-dark);
  font-weight: 800;
}

#correctionLookupMessage.error {
  color: var(--danger);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.archive-subtitle {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.admin-direction-panel {
  display: grid;
  gap: 4px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 2px solid #155eef;
  border-radius: 8px;
  background: #eff6ff;
  color: #172033;
}

.admin-direction-panel strong {
  color: #b42318;
  font-size: 17px;
  font-weight: 1000;
}

.admin-direction-panel span {
  color: #155eef;
  font-size: 13px;
  font-weight: 800;
}

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

.archive-filter-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.archive-filter-card > strong {
  display: block;
  margin: -4px -4px 2px;
  padding: 7px 9px;
  border: 1px solid var(--title-border);
  border-radius: 6px;
  background: var(--title-bg);
  color: var(--brand-dark);
  font-size: 15px;
  font-weight: 1000;
}

.archive-filter-card label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.archive-filter-card input {
  margin-top: 5px;
  min-height: 40px;
  border: 1px solid #b7c0cc;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
}

.archive-filter-card button {
  justify-content: center;
  font-weight: 900;
}

.print-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.print-options legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.print-options label {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 14px;
}

.print-options input {
  width: auto;
}

.print-envelope-option {
  color: #14532d !important;
  font-weight: 1000;
}

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

.user-errors-filter-panel {
  display: grid;
  grid-template-columns: minmax(160px, 0.65fr) minmax(160px, 0.65fr) minmax(360px, 1.5fr) auto;
  gap: 10px;
  align-items: end;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
}

.user-errors-type-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-width: 0;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
}

.user-errors-type-filter legend {
  padding: 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.user-errors-type-filter label {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.user-errors-type-filter input {
  width: auto;
}

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

.user-errors-filter-actions button {
  min-height: 42px;
  white-space: nowrap;
}

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

.user-errors-summary article {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
}

.user-errors-summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.user-errors-summary strong {
  color: #b42318;
  font-size: 20px;
  font-weight: 1000;
}

.user-errors-list {
  display: grid;
  gap: 12px;
  min-height: 220px;
  align-content: start;
  overflow-anchor: none;
}

.user-error-day {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
}

.user-error-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--title-border);
  border-radius: 8px;
  background: var(--title-bg);
}

.user-error-day-header strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 1000;
}

.user-error-day-header span {
  color: #b42318;
  font-size: 13px;
  font-weight: 900;
}

.user-errors-grid-header {
  display: grid;
  grid-template-columns: minmax(120px, 0.55fr) minmax(260px, 1fr) minmax(260px, 1fr) minmax(360px, 1.45fr);
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff5f3;
  color: #7a271a;
  font-size: 12px;
  font-weight: 1000;
  text-transform: uppercase;
}

.user-error-card {
  display: grid;
  grid-template-columns: minmax(120px, 0.55fr) minmax(260px, 1fr) minmax(260px, 1fr) minmax(360px, 1.45fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-left: 5px solid #b42318;
  border-radius: 8px;
  background: #ffffff;
}

.user-error-ref {
  display: grid;
  gap: 4px;
}

.user-error-ref strong {
  color: var(--ink);
  font-size: 20px;
  font-weight: 1000;
}

.user-error-ref small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.user-error-motifs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.user-error-type {
  display: inline-block;
  padding: 5px 9px;
  border: 1px solid #b42318;
  border-radius: 999px;
  background: #fff5f3;
  color: #b42318;
  font-size: 12.5px;
  font-weight: 1000;
  text-transform: uppercase;
}

.user-error-people {
  display: grid;
  gap: 4px;
}

.user-error-people span {
  color: #7a271a;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.user-error-people strong {
  color: var(--ink);
  font-size: 14px;
}

.user-error-details {
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.38;
}

.user-error-details li {
  margin: 2px 0;
}

.user-error-alert {
  margin: 0;
  padding: 10px 12px;
  border: 2px solid #b42318;
  border-radius: 8px;
  background: #fff5f3;
  color: #b42318;
  font-weight: 900;
}

.safe-deposit-panel {
  margin: 0 0 14px;
  padding: 16px;
  border: 2px solid #16a34a;
  border-radius: 8px;
  background: #f0fdf4;
}

.safe-deposit-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--title-border);
  border-radius: 8px;
  background: var(--title-bg);
}

.safe-deposit-title h3 {
  color: #14532d;
  font-size: 22px;
  font-weight: 1000;
  margin: 0;
}

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

.safe-deposit-title > strong {
  color: #14532d;
  font-size: 28px;
  font-weight: 1000;
}

.safe-deposit-table-wrap {
  overflow-x: auto;
}

.safe-deposit-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.safe-deposit-table th,
.safe-deposit-table td {
  border: 1px solid #c9d2df;
  padding: 8px 9px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

.safe-deposit-table th {
  background: #dcfce7;
  color: var(--ink);
}

.safe-deposit-table tfoot th {
  background: #e8f6ef;
  font-weight: 900;
}

.safe-voucher-list {
  margin: 0;
  padding-left: 18px;
}

.safe-voucher-list li {
  margin: 2px 0;
}

.operator-cell {
  font-weight: 800;
}

.archive-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--soft);
}

.archive-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid var(--title-border);
  border-radius: 8px;
  background: var(--title-bg);
}

.archive-status-line {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  align-items: center;
}

.archive-operators {
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid #c9d2df;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
}

.archive-operators strong {
  color: var(--brand-dark);
  font-weight: 1000;
}

.corrected-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border: 2px solid #b42318;
  border-radius: 999px;
  background: #fff5f5;
  color: #b42318;
  font-size: 13px;
  font-weight: 1000;
  text-transform: uppercase;
}

.archive-card dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.archive-card dt {
  color: var(--muted);
  font-size: 12px;
}

.archive-card dd {
  margin: 3px 0 0;
  font-weight: 700;
}

.correction-tag {
  margin: 10px 0 0;
  padding: 8px 10px;
  border: 2px solid #b42318;
  border-radius: 8px;
  background: #fff5f5;
  color: #b42318;
  font-weight: 900;
}

.correction-button {
  margin-top: 10px;
  border-color: #b42318;
  color: #b42318;
  font-weight: 900;
}

.admin-dialog {
  width: min(680px, calc(100% - 24px));
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
  overflow: hidden;
}

.admin-dialog:has(#adminSettingsForm:not(.hidden)) {
  width: min(1120px, calc(100% - 24px));
}

.admin-dialog.settings-open {
  width: min(1120px, calc(100% - 24px));
}

.admin-dialog::backdrop {
  background: rgba(23, 32, 51, 0.44);
}

.confirm-dialog {
  width: min(720px, calc(100% - 24px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
}

.confirm-dialog::backdrop {
  background: rgba(23, 32, 51, 0.56);
}

.confirm-card {
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(23, 32, 51, 0.22);
}

.confirm-card h2 {
  font-size: 24px;
}

.correction-confirm-card {
  border: 2px solid #b42318;
}

.confirm-lead {
  margin: 0;
  color: var(--danger);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
}

.confirm-lead strong {
  font-weight: 900;
}

.confirm-amounts {
  display: grid;
  gap: 10px;
  margin: 0;
}

.confirm-amounts div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.confirm-amounts dt {
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
}

.confirm-amounts dd {
  margin: 0;
  color: #155eef;
  font-size: 26px;
  font-weight: 900;
}

.confirm-question {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
}

.confirm-note {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.alert-card {
  border: 3px solid #b42318;
  box-shadow: 0 24px 70px rgba(122, 39, 26, 0.32);
}

.alert-card h2 {
  color: #b42318;
  font-size: 34px;
  letter-spacing: 0;
}

.alert-collaborator {
  margin: 0;
  padding: 12px 14px;
  border: 2px solid #f5b5ad;
  border-radius: 8px;
  background: #fff5f3;
  color: #172033;
  font-size: 20px;
  font-weight: 900;
}

.alert-collaborator strong {
  color: #b42318;
  font-size: 24px;
  font-weight: 1000;
  text-transform: uppercase;
}

.alert-warning-text {
  margin: 0;
  color: #7a271a;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.38;
}

.danger-confirm {
  background: #b42318;
  box-shadow: 0 12px 24px rgba(180, 35, 24, 0.24);
}

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

.admin-card {
  display: grid;
  gap: 14px;
  margin-bottom: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow: auto;
  overscroll-behavior: contain;
}

.admin-dialog.settings-open .admin-card {
  gap: 10px;
  max-height: calc(100vh - 28px);
  max-height: calc(100dvh - 28px);
  padding: 14px;
}

#adminSettingsForm .panel-title {
  margin-bottom: 4px;
}

.admin-settings-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(520px, 1.28fr);
  gap: 10px;
  align-items: start;
}

.admin-settings-section {
  display: grid;
  gap: 8px;
  min-height: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.admin-settings-section textarea {
  height: min(32vh, 300px);
  height: min(32dvh, 300px);
  min-height: 220px;
}

.admin-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--title-border);
  border-radius: 8px;
  background: var(--title-bg);
}

.admin-section-title h3 {
  color: var(--ink);
  font-size: 17px;
  font-weight: 1000;
}

.admin-section-title span,
.admin-password-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.authorized-names-alert {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #f5b5ad;
  border-radius: 8px;
  background: #fff5f3;
  color: var(--danger);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.35;
}

.authorized-names-help {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.access-users-list {
  display: grid;
  gap: 8px;
  max-height: min(38vh, 340px);
  max-height: min(38dvh, 340px);
  overflow: auto;
  padding-right: 2px;
}

.access-user-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(130px, 0.82fr) minmax(150px, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 8px;
  border: 1px solid #c9d2df;
  border-radius: 8px;
  background: #ffffff;
}

.access-user-row label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.access-user-row input,
.access-user-row select {
  min-height: 36px;
}

.access-user-row button {
  min-height: 36px;
  padding-inline: 10px;
  color: #b42318;
  font-weight: 900;
  white-space: nowrap;
}

.add-access-user {
  justify-self: start;
  border-color: #16a34a;
  color: #14532d;
  font-weight: 900;
}

.device-settings-section {
  grid-column: 1 / -1;
}

.device-security-toggle {
  display: flex;
  gap: 8px;
  align-items: center;
  width: fit-content;
  color: #14532d;
  font-weight: 900;
}

.device-security-toggle input {
  width: 18px;
  height: 18px;
}

.trusted-devices-list {
  display: grid;
  gap: 8px;
  max-height: min(32vh, 280px);
  max-height: min(32dvh, 280px);
  overflow: auto;
  padding-right: 2px;
}

.trusted-device-row {
  display: grid;
  grid-template-columns: minmax(90px, 0.85fr) minmax(130px, 1fr) minmax(150px, 1fr) minmax(90px, 0.7fr);
  gap: 8px;
  align-items: end;
  padding: 8px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #ffffff;
}

.trusted-device-row label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.trusted-device-row input,
.trusted-device-row select {
  min-height: 36px;
}

.trusted-device-link {
  grid-column: 1 / -2;
}

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

.trusted-device-actions button {
  min-height: 36px;
  font-weight: 900;
}

.add-trusted-device {
  justify-self: start;
  border-color: #16a34a;
  color: #14532d;
  font-weight: 900;
}

.danger-text {
  color: #b42318;
}

.login-link-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid var(--brand);
  border-radius: 6px;
  background: var(--brand);
  color: #ffffff;
  font-weight: 900;
  text-decoration: none;
}

.login-check-device {
  margin: 10px 0 0;
}

.login-secondary-link {
  display: block;
  margin-top: 12px;
  color: var(--brand-dark);
  font-weight: 900;
  text-align: center;
}

.login-device-help {
  margin: 12px 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

.hidden {
  display: none;
}

.help-dialog {
  width: min(520px, calc(100% - 24px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  background: transparent;
}

.help-dialog::backdrop {
  background: rgba(23, 32, 51, 0.5);
}

.help-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid #c8d2df;
  border-radius: 8px;
  background: #f1f5f9;
  box-shadow: 0 24px 70px rgba(23, 32, 51, 0.22);
}

.help-card .panel-title {
  margin-bottom: 0;
}

.help-card h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.15;
}

.help-body {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d5dde8;
  border-radius: 8px;
  background: #e8edf4;
}

.help-body p {
  margin: 0;
  color: #155eef;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.55;
}

#adminSettingsMessage {
  margin: 0;
  color: var(--brand-dark);
  font-weight: 700;
}

@media (max-width: 1120px) {
  .habt-access .action-bar {
    grid-template-columns: 1fr;
  }

  .habt-access .action-buttons {
    grid-column: 1;
    justify-content: flex-end;
  }

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

  .access-user-row {
    grid-template-columns: minmax(120px, 1fr) minmax(130px, 0.8fr) minmax(150px, 1fr) auto;
  }
}

@media (max-width: 900px) {
  .action-bar {
    grid-template-columns: 1fr;
  }

  .action-buttons {
    grid-column: 1;
    justify-content: center;
  }

  .admin-actions {
    justify-content: center;
  }

  .admin-access .action-buttons {
    grid-template-columns: 1fr;
  }

  .admin-access .correction-open-button {
    grid-column: auto;
  }

  .topbar,
  .signature-grid,
  .signature-box,
  .cash-layout,
  .form-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .clock {
    text-align: left;
  }

  .admin-access .admin-header-badge {
    position: static;
    transform: none;
    text-align: left;
  }

  .brand-logo {
    width: 64px;
    height: 64px;
  }

  .kpis,
  .archive-card dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mode-banner {
    grid-template-columns: 1fr;
  }

  .payment-row,
  .voucher-row,
  .correction-editor-body .form-grid,
  .archive-filter-panel,
  .user-errors-filter-panel,
  .user-errors-summary,
  .user-errors-grid-header,
  .user-error-card,
  .user-error-day-header,
  .day-cash-summary li,
  .day-cash-summary-header {
    grid-template-columns: 1fr;
  }

  .user-errors-filter-actions,
  .user-error-day-header {
    align-items: stretch;
    flex-direction: column;
  }

  .safe-deposit-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .confirm-amounts div,
  .confirm-actions,
  .correction-grid,
  .correction-lookup-grid,
  .admin-settings-grid,
  .access-user-row,
  .trusted-device-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .trusted-device-link {
    grid-column: auto;
  }

  .trusted-device-actions {
    justify-content: stretch;
  }
}

@media (max-width: 560px) {
  .login-page {
    padding: 14px;
  }

  .login-card {
    max-width: 100%;
    min-width: 0;
    padding: 22px;
  }

  .shell {
    width: min(100% - 16px, 1280px);
  }

  .kpis,
  .denoms,
  .piece-summary,
  .archive-card dl,
  .late-row {
    grid-template-columns: 1fr;
  }

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

  .tabs {
    grid-column: auto;
    justify-content: center;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .action-bar {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .notice.lock {
    align-items: stretch;
    flex-direction: column;
  }

  .notice-action {
    width: 100%;
  }

  .admin-actions {
    justify-self: stretch;
    justify-content: stretch;
  }

  .admin-actions button {
    flex: 1 1 100%;
  }

  .admin-access .action-buttons {
    grid-template-columns: 1fr;
  }

  .admin-access .correction-open-button {
    grid-column: auto;
  }

  .shift-hero-inner {
    grid-template-columns: minmax(0, 1fr) 34px minmax(100px, 150px);
    grid-template-rows: auto auto;
    gap: 8px;
    padding: 10px;
  }

  .shift-hero-control {
    grid-column: 1 / -1;
  }

  .shift-user-label {
    grid-column: 3;
  }

  .shift-user-label {
    font-size: 24px;
  }

  .shift-hero-inner.night .shift-user-label {
    font-size: 26px;
  }

  .shift-hero-label,
  .shift-hero-control select {
    text-align: center;
  }
}
