:root {
  --bg0: #edf6ee;
  --bg1: #e2f0e3;
  --bg2: #f8fbf6;
  --card: rgba(255, 255, 255, 0.96);
  --surface: rgba(246, 251, 246, 0.92);
  --text: #1f2f24;
  --muted: rgba(31, 47, 36, 0.64);
  --line: rgba(63, 102, 81, 0.16);
  --green: #5ea87a;
  --green2: #3d6a4f;
  --green-rgb: 94, 168, 122;
  --green2-rgb: 61, 106, 79;
  --red: #b54a3c;
  --amber: #d47a2a;
  --amber-rgb: 212, 122, 42;
  --accent-strong: #a75b1f;
  --shadow: 0 16px 44px rgba(53, 90, 67, 0.12);
  --shadow-soft: 0 10px 28px rgba(53, 90, 67, 0.09);
  --accent: linear-gradient(135deg, #f4c79f, #d47a2a);

  --radius: 14px;
  --radius2: 8px;
  --pad: 16px;
  --pad2: 12px;

  --font: "Avenir Next", "Poppins", "Trebuchet MS", "Gill Sans", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Monaco, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg0);
}
body {
  margin: 0;
  min-height: 100%;
  min-height: 100svh;
  min-height: 100dvh;
  color: var(--text);
  font-family: var(--font);
  background:
    radial-gradient(circle at top left, rgba(242, 196, 158, 0.48), transparent 36%),
    radial-gradient(circle at 85% 15%, rgba(177, 224, 193, 0.5), transparent 30%),
    linear-gradient(180deg, var(--bg0), var(--bg1) 62%, var(--bg2));
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

.app {
  min-height: 100%;
  min-height: 100svh;
  min-height: 100dvh;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  backdrop-filter: blur(12px);
  background: linear-gradient(180deg, rgba(250, 253, 250, 0.96), rgba(244, 250, 245, 0.86));
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(53, 90, 67, 0.08);
}

.topbar::after {
  content: "";
  display: block;
  height: 4px;
  width: 100%;
  background: linear-gradient(90deg, rgba(var(--green2-rgb), 0.82) 0%, rgba(var(--green-rgb), 0.74) 38%, rgba(var(--amber-rgb), 0.96) 72%, #b95d16 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.topbar-logo {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
  object-fit: contain;
  filter: drop-shadow(0 7px 16px rgba(39, 65, 50, 0.18));
  cursor: pointer;
}

.topbar-logo:focus-visible {
  outline: 2px solid rgba(var(--amber-rgb), 0.72);
  outline-offset: 2px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  max-width: 1480px;
  margin: 0 auto;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

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

.topbar-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.role-chip,
.soft-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}

.role-chip {
  background: rgba(200, 140, 90, 0.18);
  color: var(--accent-strong);
}

.soft-chip {
  background: rgba(94, 168, 122, 0.17);
  color: #2f6749;
}

.topbar-signout {
  padding: 8px 12px;
}

.app-version {
  font-size: 11px;
  color: var(--muted);
}

.content {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  min-width: 0;
  padding: 16px 16px 98px 16px; /* space for bottom nav */
  /* Extra space for iPhone "home indicator" safe area so the bottom nav doesn't cover content. */
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
  flex: 1;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: var(--pad);
  position: relative;
  overflow: hidden;
}

.card:before {
  display: none;
}

.row { display: flex; gap: 12px; align-items: center; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.col { display: flex; flex-direction: column; gap: 10px; }
.spacer { flex: 1; }

.h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }

label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.checkrow {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: -2px;
  margin-bottom: 0;
}

.checkrow span {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.35;
  white-space: normal;
}

.merma-flags {
  padding: 14px 16px;
  border: 1px solid rgba(var(--amber-rgb), 0.24);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(250, 240, 229, 0.94), rgba(255, 252, 247, 0.98));
  gap: 8px;
}

.merma-flags-title {
  font-size: 15px;
  font-weight: 780;
}

input, select, textarea {
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: none;
  border-color: rgba(var(--green-rgb), 0.58);
  box-shadow: 0 0 0 3px rgba(var(--green-rgb), 0.18);
}

input, select, textarea, button {
  font-family: inherit;
  font-size: 14px;
}

input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  width: 100%;
  padding: 11px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.94);
  outline: none;
}

input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--green);
}

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

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

@media (max-width: 720px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .topbar-inner { padding-left: 14px; padding-right: 14px; }
  .content { padding-left: 14px; padding-right: 14px; }
  .topbar-signout { padding: 6px 8px; }
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    font-size: 16px;
  }
  .bottomnav-inner {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-left: 10px;
    padding-right: 10px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }
  .navbtn {
    flex: 0 0 88px;
    scroll-snap-align: center;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.92);
  padding: 11px 14px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
  min-height: 44px;
  font-weight: 700;
}

.btn:active { transform: translateY(1px); }
.btn:hover:not([disabled]) { transform: translateY(-1px); }
.btn[disabled] {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(140deg, #73c596, #5ea87a 72%, #4f9269);
  color: #fff9f4;
  box-shadow: 0 12px 24px rgba(66, 118, 87, 0.22);
}
.btn-danger {
  border-color: rgba(179, 54, 40, 0.2);
  color: var(--red);
  background: rgba(255, 241, 239, 0.94);
}
.btn-ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.btn.preset-active {
  border-color: rgba(var(--amber-rgb), 0.46);
  background: linear-gradient(180deg, rgba(var(--amber-rgb), 0.4), rgba(var(--amber-rgb), 0.18));
  color: #5a2f13;
}

.pillbar { display: flex; flex-wrap: wrap; gap: 10px; }
.pill {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: rgba(248, 253, 246, 0.90);
  cursor: pointer;
}
.pill[aria-pressed="true"] {
  border-color: rgba(var(--amber-rgb), 0.46);
  background: linear-gradient(180deg, rgba(var(--amber-rgb), 0.4), rgba(var(--amber-rgb), 0.18));
  color: #5a2f13;
}

.notice {
  border-radius: var(--radius2);
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.65);
}
.notice.error { border-color: rgba(179, 41, 47, 0.35); }
.notice.ok { border-color: rgba(var(--green-rgb), 0.35); }
.notice.warn { border-color: rgba(var(--amber-rgb), 0.35); }

.table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: var(--radius2);
  border: 1px solid var(--line);
  background: rgba(246, 252, 244, 0.93);
}
.table th, .table td {
  text-align: left;
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.table th {
  font-size: 12px;
  font-weight: 800;
  color: #fff7f0;
  background: linear-gradient(180deg, rgba(var(--amber-rgb), 0.98), rgba(185, 93, 22, 0.96));
  border-bottom: 1px solid rgba(153, 72, 16, 0.76);
}
.table tr:last-child td { border-bottom: 0; }

.bottomnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  box-sizing: border-box;
  padding-left: 8px;
  padding-right: 8px;
  z-index: 20;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(248, 251, 248, 0.98), rgba(239, 245, 240, 0.99));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: auto;
  box-shadow: 0 -8px 26px rgba(53, 90, 67, 0.1);
  border-image: linear-gradient(90deg, transparent, rgba(56, 90, 64, 0.16), transparent) 1;
}

.bottomnav-inner {
  max-width: 980px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: 8px;
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
}

.navbtn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 64px;
  padding: 8px 3px 7px;
  border-radius: 5px;
  border: 1px solid rgba(160, 174, 164, 0.48);
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  background: rgba(251, 253, 251, 0.94);
}

.navbtn .icon { font-size: 17px; line-height: 1; }
.navbtn .label {
  font-size: 11px;
  line-height: 1.05;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
}

.navbtn[aria-current="page"] {
  color: #55351e;
  border-color: rgba(var(--amber-rgb), 0.6);
  background: linear-gradient(180deg, rgba(var(--amber-rgb), 0.36), rgba(var(--amber-rgb), 0.2));
  box-shadow: 0 6px 16px rgba(var(--amber-rgb), 0.2);
}

.navbtn:not([aria-current="page"]):active {
  color: var(--text);
  background: rgba(var(--green-rgb), 0.18);
}

.navbtn:not([aria-current="page"]):hover {
  border-color: rgba(var(--green-rgb), 0.48);
  background: rgba(var(--green-rgb), 0.18);
}

.navbtn .label {
  letter-spacing: 0.1px;
}

.navbtn .icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.navbtn:active {
  transform: translateY(1px);
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 12px 0;
}

.cash-line-grid,
.cash-adjustment-grid {
  display: grid;
  gap: 10px;
  align-items: center;
}

.cash-line-grid {
  grid-template-columns: minmax(160px, 1.2fr) minmax(110px, 0.8fr) minmax(92px, 0.6fr) minmax(180px, 1.2fr) auto;
}

.cash-adjustment-grid {
  grid-template-columns: minmax(210px, 1.35fr) minmax(104px, 0.74fr) minmax(104px, 0.74fr) minmax(150px, 0.95fr) minmax(170px, 1fr) minmax(150px, 0.95fr);
}

.cash-adjustment-grid-employee {
  grid-template-columns: minmax(220px, 1.6fr) minmax(112px, 0.72fr);
}

.cash-adjustment-quick-card {
  gap: 10px;
  padding: 14px 16px;
  border-radius: 16px;
}

.cash-adjustment-quick-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.15;
}

.cash-adjustment-quick-note {
  font-size: 14px;
  line-height: 1.35;
}

.cash-adjustment-quick-field {
  display: grid;
  gap: 6px;
}

.cash-adjustment-quick-label {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cash-adjustment-quick-input {
  min-height: 52px;
  font-size: 18px;
  font-weight: 760;
}

.cash-line-grid > *,
.cash-adjustment-grid > * {
  min-width: 0;
}

.cash-line-grid-head,
.cash-adjustment-grid-head {
  font-size: 11px;
}

.cash-inline-box {
  min-height: 44px;
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.76);
  overflow: hidden;
}

.cash-inline-box > * {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.cash-inline-value {
  font-size: 13px;
}

.cash-adjustment-priority {
  padding: 8px 10px;
  border: 1px solid rgba(179, 41, 47, 0.18);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 245, 245, 0.96), rgba(255, 255, 255, 0.98));
}

.cash-adjustment-priority-title {
  font-size: 15px;
  font-weight: 820;
  letter-spacing: 0.15px;
}

.cash-vault-total-row,
.cash-vault-grand-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.86);
}

.cash-vault-grand-total {
  margin-top: 4px;
  border-color: rgba(var(--green-rgb), 0.22);
  background: linear-gradient(180deg, rgba(236, 245, 235, 0.98), rgba(255, 252, 247, 0.98));
}

.cash-static-box {
  background: rgba(247, 248, 242, 0.96);
}

.cash-static-value {
  font-size: 13px;
}

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

.cash-denomination-summary-grid {
  grid-column: 1 / -1;
}

.cash-denomination-summary-card {
  min-height: 96px;
  border-color: rgba(var(--green-rgb), 0.18);
  background: linear-gradient(180deg, rgba(236, 245, 235, 0.96), rgba(255, 252, 247, 0.98));
}

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

.cash-summary-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 110px;
  border-color: rgba(var(--green-rgb), 0.24);
  background: linear-gradient(180deg, rgba(236, 245, 235, 0.94), rgba(255, 252, 247, 0.98));
}

.cash-summary-label {
  font-size: 12px;
  color: var(--muted);
}

.cash-summary-value {
  font-size: 19px;
  font-weight: 760;
  line-height: 1.2;
}

.cash-form-card .h1 {
  font-size: 20px;
}

.cash-form-intro,
.cash-section-note {
  font-size: 14px;
  line-height: 1.5;
}

.cash-guide-list {
  margin: 8px 0 0 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  line-height: 1.5;
}

.cash-guide-highlight {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(var(--green-rgb), 0.24);
  background: linear-gradient(180deg, rgba(236, 245, 235, 0.96), rgba(255, 252, 247, 0.98));
}

.cash-guide-highlight-title {
  font-size: 15px;
  font-weight: 820;
}

.cash-guide-highlight-body {
  font-size: 14px;
  line-height: 1.5;
}

.cash-guide-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cash-guide-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(var(--amber-rgb), 0.24);
  background: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.cash-draft-bar {
  padding: 10px 12px;
  border: 1px solid rgba(23, 32, 47, 0.10);
  border-radius: 14px;
  background: rgba(248, 248, 242, 0.94);
}

.cash-draft-status {
  font-size: 13px;
  line-height: 1.45;
}

.cash-pos-warning-wrap {
  margin: 6px 0 4px;
}

.cash-pos-warning {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(var(--amber-rgb), 0.34);
  background: linear-gradient(180deg, rgba(249, 239, 228, 0.96), rgba(255, 252, 247, 0.98));
  box-shadow: 0 10px 24px rgba(var(--amber-rgb), 0.10);
}

.cash-pos-info {
  border-color: rgba(var(--green-rgb), 0.26);
  background: linear-gradient(180deg, rgba(236, 245, 235, 0.96), rgba(255, 252, 247, 0.98));
  box-shadow: 0 10px 24px rgba(var(--green-rgb), 0.10);
}

.cash-pos-warn {
  border-width: 2px;
  border-color: rgba(164, 44, 31, 0.58);
  background: linear-gradient(180deg, rgba(255, 224, 218, 0.99), rgba(255, 244, 241, 0.99));
  box-shadow: 0 14px 30px rgba(164, 44, 31, 0.16);
}

.cash-pos-warn .cash-pos-warning-title {
  color: #9f2418;
}

.cash-pos-warn .cash-pos-warning-body {
  font-size: 16px;
  font-weight: 820;
}

.cash-pos-warn .cash-pos-warning-note {
  color: #7a1f17;
  font-weight: 760;
}

.cash-pos-warning-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #8b5e00;
}

.cash-pos-warning-body {
  font-size: 15px;
  line-height: 1.55;
  font-weight: 720;
  color: var(--text);
}

.cash-pos-warning-note {
  font-size: 13px;
  line-height: 1.45;
}

.cash-form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cash-form-label {
  margin-bottom: 0;
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
}

.cash-form-field input[readonly],
.cash-form-field textarea[readonly] {
  background: rgba(244, 248, 241, 0.98);
  color: var(--green2);
  font-weight: 760;
}

.cash-form-field input:not([type="checkbox"]):not([type="radio"]),
.cash-form-field select,
.cash-form-field textarea {
  font-size: 16px;
  padding: 14px 14px;
}

.cash-form-field textarea {
  min-height: 112px;
}

.cash-priority-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(var(--green-rgb), 0.18);
  background: linear-gradient(180deg, rgba(var(--green-rgb), 0.10), rgba(255, 252, 247, 0.94));
}

.cash-priority-title {
  font-size: 19px;
  font-weight: 780;
}

.cash-priority-note {
  font-size: 14px;
  line-height: 1.5;
}

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

.cash-priority-field {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(23, 32, 47, 0.10);
  box-shadow: var(--shadow-soft);
}

.cash-priority-accent {
  border-color: rgba(var(--amber-rgb), 0.26);
  background: rgba(var(--amber-rgb), 0.12);
}

.cash-inline-guide {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(var(--amber-rgb), 0.22);
  background: linear-gradient(180deg, rgba(249, 240, 230, 0.94), rgba(255, 252, 247, 0.98));
}

.cash-inline-guide-list {
  margin-top: 0;
}

.cash-priority-field .cash-form-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.35px;
}

.cash-priority-field input:not([type="checkbox"]):not([type="radio"]),
.cash-priority-field select {
  font-size: 22px;
  font-weight: 780;
  min-height: 60px;
}

.optional-mark {
  display: inline-block;
  font-size: 1.08em;
  font-weight: 820;
  letter-spacing: 0.02em;
  color: var(--text);
}

.required-mark,
.auto-mark {
  display: inline-block;
  margin-left: 2px;
  font-size: 0.92em;
  font-weight: 820;
  letter-spacing: 0.02em;
}

.required-mark {
  color: #9b4b00;
}

.auto-mark {
  color: var(--green2);
}

.cash-diff-ok {
  color: var(--green2);
}

.cash-diff-warn {
  color: var(--amber);
}

.cash-diff-error {
  color: var(--red);
}

.cash-printable {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cash-print-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cash-report-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cash-report-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(var(--green-rgb), 0.24);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(236, 245, 235, 0.90), rgba(255, 252, 247, 0.96));
}

.cash-report-diff.cash-diff-ok {
  border-color: rgba(var(--green-rgb), 0.22);
  background: rgba(var(--green-rgb), 0.10);
}

.cash-report-diff.cash-diff-warn {
  border-color: rgba(var(--amber-rgb), 0.24);
  background: rgba(var(--amber-rgb), 0.10);
}

.cash-report-diff.cash-diff-error {
  border-color: rgba(179, 41, 47, 0.24);
  background: rgba(179, 41, 47, 0.08);
}

.cash-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 4px;
}

.cash-print-warning {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(var(--amber-rgb), 0.32);
  background: linear-gradient(180deg, rgba(249, 239, 228, 0.92), rgba(255, 252, 247, 0.98));
}

.cash-print-warning-warn {
  border-width: 2px;
  border-color: rgba(164, 44, 31, 0.56);
  background: linear-gradient(180deg, rgba(255, 224, 218, 0.97), rgba(255, 244, 241, 0.99));
}

.cash-print-warning-warn .cash-print-warning-title {
  color: #9f2418;
}

.cash-print-warning-warn .cash-print-warning-body {
  font-size: 14px;
  font-weight: 780;
}

.cash-print-warning-warn .cash-print-warning-note {
  color: #7a1f17;
  font-weight: 720;
}

.cash-print-warning-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #8b5e00;
}

.cash-print-warning-body {
  font-size: 13px;
  line-height: 1.45;
  font-weight: 720;
}

.cash-print-warning-note {
  font-size: 12px;
  line-height: 1.4;
}

.cash-signature-line {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cash-print-grid {
  display: grid;
  gap: 12px;
}

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

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

.movement-day-printable {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.movement-day-print-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.movement-day-detail-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.movement-day-sku-block {
  break-inside: avoid;
  page-break-inside: avoid;
}

.movement-day-sku-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.movement-day-sku-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.movement-day-chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  border-radius: 999px;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.2;
}

.cash-mode-card {
  gap: 10px;
}

.cash-mode-btn {
  min-width: 150px;
}

.cash-mode-btn-active {
  box-shadow: 0 10px 24px rgba(var(--amber-rgb), 0.24);
  border-color: rgba(var(--amber-rgb), 0.5);
  background: linear-gradient(180deg, rgba(var(--amber-rgb), 0.28), rgba(var(--amber-rgb), 0.12));
}

.cash-pos-mirror-note {
  line-height: 1.45;
}

.pos-cash-printable,
.cash-report-layout,
.cash-report-group-list,
.cash-flat-item-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cash-report-header-card {
  gap: 8px;
}

.cash-report-company {
  text-align: center;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.cash-report-company-sub {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.cash-report-banner {
  text-align: center;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(var(--green-rgb), 0.24), rgba(var(--green-rgb), 0.12));
  color: #35523c;
}

.cash-report-block {
  border: 1px solid rgba(19, 31, 21, 0.08);
  border-radius: 16px;
  background: rgba(255, 252, 247, 0.96);
  overflow: hidden;
}

.cash-report-block-title {
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 800;
  color: #f4fbf4;
  border-bottom: 1px solid rgba(var(--green2-rgb), 0.75);
  background: linear-gradient(180deg, rgba(var(--green2-rgb), 0.96), rgba(var(--green2-rgb), 0.84));
}

.cash-report-block-body {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cash-report-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid rgba(19, 31, 21, 0.06);
}

.cash-report-row:first-child {
  border-top: 0;
}

.cash-report-label {
  font-size: 13px;
}

.cash-report-value {
  text-align: right;
}

.cash-report-group-card {
  background: rgba(255, 255, 255, 0.96);
}

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

.cash-report-item-row,
.cash-flat-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px dashed rgba(19, 31, 21, 0.1);
}

.cash-report-item-row:first-of-type,
.cash-flat-item-row:first-of-type {
  border-top: 0;
}

.cash-report-item-name,
.cash-flat-item-name {
  font-weight: 700;
}

.cash-report-item-meta,
.cash-flat-item-qty {
  color: var(--muted);
  text-align: right;
}

.cash-report-item-total,
.cash-flat-item-total {
  min-width: 110px;
  text-align: right;
  font-weight: 800;
}

.cash-report-item-footer,
.cash-flat-item-footer {
  border-top: 1px solid rgba(19, 31, 21, 0.08);
  padding-top: 10px;
  text-align: right;
  font-weight: 800;
}

.movement-day-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.movement-day-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
}

.movement-day-filter-chip input {
  margin: 0;
}

.movement-day-presets {
  gap: 8px;
}

.movement-day-summary-total td {
  font-weight: 760;
  background: rgba(var(--green-rgb), 0.10);
  border-top: 2px solid rgba(var(--green-rgb), 0.18);
}

.right { text-align: right; }
.delta-pos { color: var(--green2); }
.delta-neg { color: var(--red); }

.thumbgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
@media (max-width: 720px) {
  .thumbgrid { grid-template-columns: repeat(2, 1fr); }
  .movement-day-summary { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .bottomnav {
    padding-left: 10px;
    padding-right: 10px;
  }
  .bottomnav-inner {
    gap: 7px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  }
  .navbtn {
    min-height: 64px;
    flex-basis: 84px;
    padding: 7px 4px 6px;
  }
  .navbtn .icon {
    font-size: 17px;
    width: 22px;
    height: 22px;
  }
  .navbtn .label {
    font-size: 10.5px;
  }
}

@media (max-width: 1040px) {
  .cash-denomination-grid,
  .cash-summary-grid,
  .cash-signatures,
  .cash-priority-grid,
  .cash-print-grid-2,
  .cash-print-grid-3 {
    grid-template-columns: 1fr;
  }
  .cash-line-grid,
  .cash-adjustment-grid {
    grid-template-columns: 1fr;
  }
  .cash-line-grid-head,
  .cash-adjustment-grid-head {
    display: none;
  }
}
.thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.78);
}

.thumb-video {
  display: block;
}

.movement-lines-preview {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.58);
  gap: 0;
}

.movement-card {
  cursor: pointer;
  touch-action: manipulation;
}

.movement-line-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
}

.movement-line-item:last-child {
  border-bottom: 0;
}

.movement-line-sku {
  font-weight: 700;
}

.movement-line-qty {
  white-space: nowrap;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
.modal {
  width: 100%;
  max-width: 980px;
  max-height: calc(100svh - 32px - env(safe-area-inset-bottom));
  max-height: calc(100dvh - 32px - env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.45);
  background: rgba(251, 247, 238, 0.92);
  box-shadow: 0 18px 60px rgba(0,0,0,0.26);
  padding: 14px;
}

@media print {
  @page {
    size: A4 landscape;
    margin: 8mm;
  }

  body {
    background: #fff;
    font-size: 10px;
  }

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

  .content {
    max-width: none;
    padding: 0;
  }

  .card {
    box-shadow: none;
    border-color: #d8d8d8;
    background: #fff;
  }

  .card:before {
    display: none;
  }

  .cash-printable {
    gap: 6px;
    font-size: 9.6px;
  }

  .cash-printable .card {
    padding: 7px 8px;
    border-radius: 8px;
    break-inside: auto;
    page-break-inside: auto;
  }

  .cash-printable .h1 {
    font-size: 11px;
    margin-bottom: 2px;
  }

  .cash-print-header {
    gap: 2px;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .cash-print-header .h1 {
    font-size: 13px;
  }

  .cash-printable .table th,
  .cash-printable .table td {
    padding: 4px 5px;
    font-size: 9px;
    line-height: 1.15;
  }

  .cash-printable .table th {
    font-size: 8px;
  }

  .movement-day-printable {
    gap: 6px;
    font-size: 9.6px;
  }

  .movement-day-printable .card {
    padding: 7px 8px;
    border-radius: 8px;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .movement-day-printable .h1 {
    font-size: 11px;
    margin-bottom: 2px;
  }

  .movement-day-print-header {
    gap: 2px;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .movement-day-print-header .h1 {
    font-size: 13px;
  }

  .movement-day-printable .table th,
  .movement-day-printable .table td {
    padding: 4px 5px;
    font-size: 9px;
    line-height: 1.15;
  }

  .movement-day-printable .table th {
    font-size: 8px;
  }

  .movement-day-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .movement-day-chip {
    padding: 4px 6px;
    font-size: 9px;
  }

  .movement-day-filter-chips {
    gap: 6px;
  }

  .movement-day-filter-chip {
    padding: 6px 8px;
    font-size: 10px;
  }

  .movement-day-presets {
    gap: 6px;
  }

  .cash-print-grid {
    gap: 6px;
  }

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

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

  .cash-report-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .cash-report-summary-row {
    padding: 5px 6px;
    gap: 8px;
    font-size: 9px;
  }

  .cash-signatures {
    margin-top: 2px;
    gap: 10px;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .cash-signature-line {
    padding-top: 6px;
    gap: 3px;
  }

  .cash-print-warning {
    margin-top: 6px;
    padding: 6px 7px;
    gap: 3px;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .cash-print-warning-title {
    font-size: 8.5px;
  }

  .cash-print-warning-body,
  .cash-print-warning-note {
    font-size: 8.5px;
    line-height: 1.25;
  }

  .cash-print-warning-warn {
    border-width: 1.25px;
  }

  .cash-print-warning-warn .cash-print-warning-title {
    font-size: 9px;
  }

  .cash-print-warning-warn .cash-print-warning-body {
    font-size: 9px;
    font-weight: 780;
  }

  .cash-print-warning-warn .cash-print-warning-note {
    font-size: 8.8px;
    font-weight: 720;
  }
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(251, 247, 238, 0.98);
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.camera-modal {
  max-width: 760px;
}

.camera-frame {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 20% 15%, rgba(230, 239, 228, 0.96), rgba(246, 248, 241, 0.94) 55%, rgba(239, 234, 226, 0.98));
  min-height: 260px;
}

.camera-video {
  display: block;
  width: 100%;
  max-height: min(68dvh, 720px);
  object-fit: cover;
  background: transparent;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.camera-video[data-ready="1"] {
  opacity: 1;
}

.camera-actions {
  justify-content: flex-end;
  padding-right: 10px;
}

.camera-capture-btn {
  margin-right: 6px;
}
