:root {
  color-scheme: light;
  font-family: Arial, "Noto Sans TC", "PingFang TC", sans-serif;
  --brand-green-primary: #154734;
  --brand-green-secondary: #215732;
  --brand-green-dark: #13322b;
  --brand-green-muted: #8aa194;
  --brand-gold-muted: #d6cf8d;
  --brand: var(--brand-green-primary);
  --brand-strong: var(--brand-green-dark);
  --brand-soft: #e8f0ea;
  --ink: #202124;
  --muted: #656b74;
  --line: #ddd8cf;
  --surface: #ffffff;
  --surface-soft: #fbfaf6;
  --bg: #f6f7f4;
  --danger: #b42318;
  --warning: #b7791f;
  --success: #207344;
  --shadow: 0 14px 34px rgba(26, 31, 28, 0.06);
  --shadow-strong: 0 18px 46px rgba(26, 31, 28, 0.1);
  --radius: 8px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(246,247,244,.96) 260px), var(--bg);
  color: var(--ink);
}
button, input, select, textarea { font: inherit; }
button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 0 13px;
  color: #fff;
  background: var(--brand);
  cursor: pointer;
}
button:hover { background: var(--brand-strong); }
button.secondary { color: var(--brand); background: var(--brand-soft); }
button.danger { color: #fff; background: var(--danger); }
button.link-button {
  min-height: 30px;
  padding: 0;
  color: var(--brand);
  background: transparent;
  font-weight: 800;
}
button.link-button:hover { color: var(--brand-strong); background: transparent; }
button.icon { width: 38px; padding: 0; }
button:disabled { opacity: .55; cursor: not-allowed; }
input, select, textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
}
input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 0;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(21, 71, 52, .12);
}
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }

.login {
  width: min(420px, calc(100% - 40px));
  margin: 10vh auto;
}
.login h1, .page-title h1 { margin: 0; color: var(--brand-strong); letter-spacing: 0; }
.login p, .page-title p { margin: 8px 0 0; color: var(--muted); line-height: 1.55; }
.login .card { display: grid; gap: 14px; }

.shell { display: grid; grid-template-columns: 272px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(18px);
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  line-height: 0;
}
.brand-logo img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}
.brand-logo-horizontal.brand-logo-sm { width: 120px; }
.brand-logo-horizontal.brand-logo-md { width: 155px; }
.brand-logo-vertical.brand-logo-lg { width: min(190px, 68vw); }
.brand-logo-symbol.brand-logo-sm { width: 38px; flex: 0 0 38px; }
.brand-logo-fallback {
  color: var(--brand-strong);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.2;
}
.brand-sidebar {
  border-bottom: 1px solid rgba(221, 216, 207, .72);
  margin-bottom: 10px;
}
.brand-sidebar-a {
  display: grid;
  justify-items: start;
  gap: 5px;
  padding: 4px 8px 14px;
}
.brand-sidebar-a small {
  padding-left: 2px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
}
.brand-sidebar-b {
  min-height: 58px;
  padding: 4px 8px 14px;
}
.brand strong { color: var(--brand-strong); }
.login-brand {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-bottom: 18px;
  text-align: center;
}
.login-brand strong {
  color: var(--brand-strong);
  font-size: 22px;
}
.login-brand small { font-weight: 700; }
.locale-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.login .locale-switch { justify-self: end; }
.user-box .locale-switch {
  width: 100%;
  margin-top: 10px;
}
button.locale-option {
  flex: 1 1 0;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}
button.locale-option:hover {
  color: var(--brand-strong);
  background: var(--brand-soft);
}
button.locale-option.active {
  color: #fff;
  background: var(--brand);
}
.document-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.document-header > div {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
}
.document-header strong {
  color: var(--brand-strong);
  font-size: 18px;
}
.nav-group { margin: 9px 0; }
.nav-group-title { padding: 7px 10px 4px; color: var(--muted); font-size: 12px; font-weight: 800; }
.nav-link {
  display: flex; align-items: center;
  width: 100%;
  min-height: 36px;
  padding: 0 10px 0 22px;
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  line-height: 36px;
  text-align: left;
}
.nav-link.active, .nav-link:hover { background: var(--brand-soft); color: var(--brand-strong); }
.user-box {
  margin-top: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}
.user-box small { color: var(--muted); }

.main { min-width: 0; padding: 14px 16px; }
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.mobile-menu { display: none; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
}
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.section-title h2 { margin: 0; font-size: 18px; color: var(--brand-strong); }
.muted { color: var(--muted); }
.stat strong { display: block; margin-top: 8px; color: var(--brand); font-size: 30px; }
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}
.badge.warn { background: #fff4d6; color: var(--warning); }
.badge.danger { background: #fee4e2; color: var(--danger); }
.badge.gray { background: #f1f1ee; color: var(--muted); }
.toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-bottom: 14px; }
.toolbar label { min-width: 160px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; white-space: nowrap; }
th { color: var(--muted); font-size: 12px; background: var(--surface-soft); }
td.actions { display: flex; gap: 8px; }
.monthly-detail-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
}
.monthly-detail-table-wrap table {
  table-layout: fixed;
  width: 1450px;
  min-width: 1450px;
  border-collapse: separate;
  border-spacing: 0;
}
.monthly-detail-table-wrap th,
.monthly-detail-table-wrap td {
  padding: 10px 12px;
  vertical-align: middle;
  white-space: nowrap;
}
.monthly-detail-table-wrap th {
  line-height: 1.25;
}
.monthly-detail-table-wrap th:nth-child(1),
.monthly-detail-table-wrap td:nth-child(1) { width: 110px; }
.monthly-detail-table-wrap th:nth-child(2),
.monthly-detail-table-wrap td:nth-child(2) { width: 140px; }
.monthly-detail-table-wrap th:nth-child(3),
.monthly-detail-table-wrap td:nth-child(3) { width: 130px; }
.monthly-detail-table-wrap th:nth-child(4),
.monthly-detail-table-wrap td:nth-child(4) { width: 80px; }
.monthly-detail-table-wrap th:nth-child(5),
.monthly-detail-table-wrap td:nth-child(5) { width: 90px; }
.monthly-detail-table-wrap th:nth-child(6),
.monthly-detail-table-wrap td:nth-child(6),
.monthly-detail-table-wrap th:nth-child(7),
.monthly-detail-table-wrap td:nth-child(7) {
  width: 105px;
  text-align: center;
}
.monthly-detail-table-wrap th:nth-child(8),
.monthly-detail-table-wrap td:nth-child(8) { width: 130px; }
.monthly-detail-table-wrap th:nth-child(9),
.monthly-detail-table-wrap td:nth-child(9),
.monthly-detail-table-wrap th:nth-child(10),
.monthly-detail-table-wrap td:nth-child(10) { width: 105px; }
.monthly-detail-table-wrap th:nth-child(11),
.monthly-detail-table-wrap td:nth-child(11),
.monthly-detail-table-wrap th:nth-child(12),
.monthly-detail-table-wrap td:nth-child(12) { width: 115px; }
.monthly-detail-table-wrap th:nth-child(1),
.monthly-detail-table-wrap td:nth-child(1),
.monthly-detail-table-wrap th:nth-child(2),
.monthly-detail-table-wrap td:nth-child(2) {
  position: sticky;
  background: #fff;
  z-index: 2;
}
.monthly-detail-table-wrap th:nth-child(1),
.monthly-detail-table-wrap td:nth-child(1) { left: 0; }
.monthly-detail-table-wrap th:nth-child(2),
.monthly-detail-table-wrap td:nth-child(2) {
  left: 110px;
  box-shadow: 1px 0 0 rgba(21, 71, 52, 0.12);
}
.monthly-detail-table-wrap th:nth-child(1),
.monthly-detail-table-wrap th:nth-child(2) {
  background: var(--surface-soft);
  z-index: 3;
}
.monthly-detail-table-wrap th:nth-child(4),
.monthly-detail-table-wrap td:nth-child(4),
.monthly-detail-table-wrap th:nth-child(5),
.monthly-detail-table-wrap td:nth-child(5) {
  text-align: center;
}
.monthly-detail-table-wrap td:nth-child(3),
.monthly-detail-table-wrap td:nth-child(8),
.monthly-detail-table-wrap td:nth-child(9),
.monthly-detail-table-wrap td:nth-child(10),
.monthly-detail-table-wrap td:nth-child(11),
.monthly-detail-table-wrap td:nth-child(12) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.monthly-sales-diff { font-weight: 800; }
.empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface-soft); }
.alert { padding: 10px 12px; border-radius: var(--radius); background: #fff4d6; color: #7a4d00; font-weight: 700; }
.daily-page {
  display: grid;
  gap: 8px;
}
.daily-page .daily-tabs {
  display: inline-flex;
  width: max-content;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}
.daily-tabs button {
  min-height: 28px;
  padding: 0 11px;
  color: var(--muted);
  background: transparent;
}
.daily-tabs button.active {
  color: #fff;
  background: var(--brand);
}
.daily-form-card,
.daily-records-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.daily-form-card {
  padding: 8px 8px 11px;
}
.daily-basic-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 2fr;
  gap: 7px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}
.compact-field {
  gap: 3px;
  font-size: 12px;
}
.compact-field input,
.compact-field select,
.money-field span {
  min-height: 28px;
}
.compact-field input,
.compact-field select {
  padding: 4px 7px;
}
.compact-field input[readonly] {
  color: var(--muted);
  background: var(--surface-soft);
}
.note-field small {
  display: none;
  margin-left: 8px;
  color: var(--warning);
  font-weight: 800;
}
.note-field small.visible {
  display: inline;
}
.money-field span {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.inline-money { display: block; }
.money-field input {
  min-height: 28px;
  border: 0;
  padding: 5px 7px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  box-shadow: none;
}
.money-field em {
  padding: 0 8px 0 4px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}
.readonly-metric {
  display: grid;
  gap: 4px;
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}
.readonly-metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.readonly-metric strong {
  color: var(--brand);
  font-size: 14px;
}
.daily-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding-top: 8px;
  padding-bottom: 4px;
  align-items: start;
}
.daily-expense-section {
  margin-top: 0;
}
.daily-expense-section .section-title small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 700;
}
.expense-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.7;
}
.expense-summary b { color: var(--line); }
.expense-summary strong {
  color: var(--brand);
  font-size: 13px;
  font-weight: 900;
}
.expense-table {
  min-width: 0;
  table-layout: fixed;
}
.expense-table th:nth-child(1) { width: 25%; }
.expense-table th:nth-child(2) { width: 50%; }
.expense-table th:nth-child(3) { width: 25%; }
.expense-table th,
.expense-table td {
  padding: 4px 6px;
  vertical-align: middle;
}
.expense-table input,
.expense-table select {
  min-height: 28px;
  padding: 4px 7px;
}
.expense-table .num {
  text-align: right;
}
.expense-money {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  width: min(260px, 100%);
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.expense-money input {
  min-height: 26px;
  border: 0;
  text-align: right;
  box-shadow: none;
}
.expense-money em {
  padding-right: 8px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}
.small-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
}
.expense-table tr.row-error input,
.expense-table tr.row-error select,
.expense-table tr.row-error .expense-money {
  border-color: var(--danger);
  background: #fff8f7;
}
.daily-section {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(221, 216, 207, 0.84);
  border-radius: var(--radius);
  background: #fff;
}
.daily-section h2,
.check-block h2 {
  margin: 0;
  color: var(--brand-strong);
  font-size: 15px;
}
.compact-title { margin-bottom: 7px; }
.daily-operation-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px 18px;
}
.daily-row-stack {
  display: grid;
  gap: 5px;
}
.daily-row-stack + .daily-row-stack {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(221, 216, 207, 0.72);
}
.daily-row-stack h3 {
  margin: 0 0 1px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.daily-input-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 30px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.daily-input-row > span {
  line-height: 1.25;
  white-space: nowrap;
}
.daily-input-row input,
.daily-money-control,
.daily-readonly-row strong {
  width: calc(100% - 14px);
  max-width: 520px;
  min-height: 30px;
  justify-self: end;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.daily-input-row input {
  padding: 5px 8px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.daily-money-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
}
.daily-money-control input {
  min-height: 28px;
  border: 0;
  box-shadow: none;
}
.daily-money-control em {
  display: none;
  padding: 0 8px 0 3px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}
.daily-readonly-row strong {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 4px 8px;
  color: var(--brand);
  background: var(--surface-soft);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.delivery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 5px 0 4px;
  color: var(--muted);
  font-size: 12px;
}
.delivery-header strong { color: var(--brand-strong); }
.delivery-header span { font-weight: 800; }
.daily-mini-grid {
  display: grid;
  gap: 7px;
}
.daily-mini-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 8px;
}
.daily-mini-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.daily-mini-grid.one {
  grid-template-columns: 1fr;
}
.delivery-table-wrap {
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.delivery-table {
  min-width: 0;
  table-layout: fixed;
}
.delivery-table th,
.delivery-table td {
  padding: 4px 6px;
  vertical-align: middle;
}
.delivery-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.delivery-table td:nth-child(2),
.delivery-table td:nth-child(3) {
  text-align: center;
}
.delivery-table th:nth-child(1) { width: 20%; }
.delivery-table th:nth-child(2) { width: 20%; }
.delivery-table th:nth-child(3) { width: 20%; }
.delivery-table th:nth-child(4) { width: 40%; }
.delivery-table input {
  min-height: 28px;
  padding: 4px 7px;
  text-align: right;
}
.delivery-table td:nth-child(2) input,
.delivery-table td:nth-child(3) input {
  width: calc(100% - 12px);
  margin: 0 auto;
}
.delivery-table td:nth-child(4) .inline-money {
  width: calc(100% - 12px);
  margin-left: auto;
}
.delivery-table .money-field input {
  min-height: 26px;
}
.delivery-total-row th,
.delivery-total-row td {
  color: var(--brand);
  font-weight: 900;
  background: rgba(32, 115, 68, 0.055);
}
.payment-compose-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}
.payment-compose-line b {
  color: var(--line-strong);
}
.payment-compose-line strong {
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}
.daily-reconciliation-section {
  margin-top: 0;
}
.reconciliation-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 20px;
}
.reconciliation-grid div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(221, 216, 207, 0.58);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.reconciliation-grid strong {
  color: var(--ink);
  font-size: 14px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.reconciliation-grid .primary-result strong {
  color: var(--brand);
}
.reconciliation-grid .status-text {
  font-size: 13px;
  font-weight: 900;
}
.reconciliation-grid .status-text.ok {
  color: var(--success);
}
.reconciliation-grid .status-text.warn {
  color: var(--danger);
}
.readonly-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  margin-top: 10px;
  padding: 7px 9px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
}
.readonly-line strong,
.result-list dd,
.daily-record-table .num {
  font-variant-numeric: tabular-nums;
}
.readonly-line strong {
  color: var(--brand);
}
.daily-closeout-section {
  display: grid;
  gap: 7px;
  align-self: start;
}
.daily-closeout-section .daily-input-row {
  grid-template-columns: 146px minmax(0, 1fr);
}
.closeout-subsection {
  display: grid;
  gap: 6px;
}
.closeout-subsection h3 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.closeout-divider {
  height: 1px;
  background: var(--line);
}
.closeout-status .status-note {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-top: 0;
  padding: 2px 7px;
  font-size: 12px;
  background: transparent;
}
.closeout-status {
  display: flex;
  justify-content: flex-end;
}
.compact-closeout { gap: 6px; }
.result-list {
  display: grid;
  gap: 4px;
  margin: 0;
}
.result-list div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  min-height: 26px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(221, 216, 207, 0.58);
}
.result-list dt {
  color: var(--muted);
  font-size: 13px;
}
.result-list dd {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
}
.result-list .primary-result dd {
  color: var(--brand);
}
.compact-result-list {
  gap: 0;
}
.compact-result-list div {
  min-height: 25px;
  padding: 3px 0;
}
.compact-result-list dt {
  font-size: 12px;
}
.compact-result-list dd {
  font-size: 14px;
  text-align: right;
}
.value-with-badge {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}
.status-badge.ok {
  color: var(--success);
  background: rgba(32, 115, 68, 0.08);
}
.status-badge.warn {
  color: var(--danger);
  background: rgba(180, 35, 24, 0.08);
}
.danger-text {
  color: var(--danger) !important;
}
.status-note {
  margin-top: 8px;
  padding: 7px 9px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
}
.status-note.ok {
  color: var(--success);
  background: rgba(32, 115, 68, 0.07);
}
.status-note.warn {
  color: var(--danger);
  background: rgba(180, 35, 24, 0.08);
}
.daily-action-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: 8px -9px -12px;
  padding: 8px 9px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  background: rgba(255,255,255,.94);
}
.daily-action-bar div {
  display: flex;
  gap: 8px;
}
.daily-records-panel {
  padding: 12px;
}
.daily-record-toolbar {
  display: grid;
  grid-template-columns: 140px 140px 170px 130px minmax(180px, 1fr) auto auto;
  align-items: end;
  gap: 8px;
  margin-bottom: 8px;
}
.daily-record-toolbar label {
  min-width: 0;
  gap: 3px;
  font-size: 12px;
}
.daily-record-toolbar input,
.daily-record-toolbar select {
  min-height: 30px;
  padding: 5px 8px;
}
.daily-record-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.daily-record-summary strong,
.ok-text {
  color: var(--brand);
}
.warn-text,
.draft-text {
  color: var(--warning);
}
.daily-record-group {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}
.daily-record-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}
.daily-record-group-head h2 {
  margin: 0;
  color: var(--brand-strong);
  font-size: 15px;
}
.daily-record-group-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.daily-group-status {
  display: flex;
  gap: 10px;
  font-size: 12px;
  font-weight: 900;
}
.daily-record-table.grouped {
  min-width: 980px;
}
.daily-record-table th,
.daily-record-table td {
  padding: 7px 9px;
}
.record-status {
  font-size: 12px;
  font-weight: 900;
}
.record-status.ok { color: var(--success); }
.record-status.warn { color: var(--warning); }
.record-status.draft { color: var(--muted); }
.daily-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  justify-content: flex-end;
  background: rgba(20, 31, 28, .28);
}
.record-drawer {
  width: min(640px, 92vw);
  height: 100vh;
  overflow-y: auto;
  padding: 14px;
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: -20px 0 34px rgba(20,31,28,.15);
}
.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h2 {
  margin: 0 0 5px;
  color: var(--brand-strong);
  font-size: 20px;
}
.drawer-section {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.drawer-section h3 {
  margin: 0 0 7px;
  color: var(--brand-strong);
  font-size: 14px;
}
.drawer-pairs,
.drawer-two-col,
.drawer-reconcile {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}
.drawer-reconcile {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.drawer-pairs div,
.drawer-two-col div,
.drawer-reconcile div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  min-height: 26px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(221, 216, 207, .58);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.drawer-pairs strong,
.drawer-two-col strong,
.drawer-reconcile strong {
  color: var(--ink);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.drawer-table {
  min-width: 0;
  table-layout: fixed;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.drawer-table th,
.drawer-table td {
  padding: 6px 8px;
}
.drawer-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.drawer-summary strong,
.drawer-summary .strong {
  color: var(--brand);
  font-weight: 900;
}
.daily-record-toolbar {
  display: grid;
  grid-template-columns: 140px 140px 140px 150px minmax(170px, 1fr) auto auto auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
}
.daily-record-toolbar label {
  gap: 4px;
  font-size: 12px;
}
.daily-record-toolbar input,
.daily-record-toolbar select {
  min-height: 34px;
  padding: 6px 9px;
}
.daily-table-wrap {
  max-height: calc(100vh - 290px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.daily-record-table {
  min-width: 1180px;
}
.daily-record-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
}
.daily-record-table tbody tr:nth-child(even) {
  background: rgba(251, 250, 246, 0.72);
}
.daily-record-table td,
.daily-record-table th {
  padding: 8px 10px;
}
.daily-record-table .num {
  text-align: right;
}
.daily-record-table .strong {
  font-weight: 800;
}
.daily-actions {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}
.daily-actions button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 13px;
}
.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  padding: 12px 14px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-strong);
  color: #fff;
  background: var(--brand);
}
.toast.error { background: var(--danger); }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(20, 31, 28, .36);
}
.modal { width: min(620px, 100%); max-height: 90vh; overflow: auto; }
.hidden { display: none !important; }

@media (max-width: 860px) {
  .shell { display: block; }
  .sidebar {
    position: fixed;
    z-index: 15;
    inset: 0 auto 0 0;
    width: min(310px, 88vw);
    transform: translateX(-105%);
    transition: transform .18s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { display: inline-grid; place-items: center; }
  .main { padding: 16px; }
  .topbar { align-items: center; }
  .grid.two, .grid.three, .form-grid { grid-template-columns: 1fr; }
  table { min-width: 0; }
  .table-wrap { border: 0; background: transparent; overflow: visible; }
  table, thead, tbody, tr, th, td { display: block; }
  thead { display: none; }
  tr { margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); overflow: hidden; }
  td { display: flex; justify-content: space-between; gap: 14px; white-space: normal; }
  td::before { content: attr(data-label); color: var(--muted); font-weight: 800; }
}
