:root {
  --orange: #16a34a;
  --orange-dark: #0f8f45;
  --blue: #2563eb;
  --green: #16a34a;
  --red: #dc2626;
  --gray: #64748b;
  --bg: #f8fafc;
  --card: #ffffff;
  --line: #dbe3ef;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: #111827;
}

button, input, textarea {
  font: inherit;
}

select {
  font: inherit;
}

.login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.login-card, .card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .08);
}

.login-card {
  width: min(420px, 100%);
  padding: 22px;
}

.brand {
  margin: 0 0 6px;
  color: var(--orange-dark);
  font-size: 24px;
  font-weight: 800;
}

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

.field {
  width: 100%;
  min-height: 46px;
  border: 1px solid #9aa8ba;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  color: #111827;
  outline: none;
}

.field::placeholder {
  color: #53657d;
  opacity: 1;
}

.field:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(211, 84, 0, .12);
}

.btn {
  border: 0;
  border-radius: 10px;
  padding: 11px 14px;
  background: var(--orange);
  color: #fff;
  font-weight: 800;
}

.btn.blue {
  background: var(--blue);
}

.btn.green {
  background: var(--green);
}

.btn.red {
  background: var(--red);
}

.btn.gray {
  background: var(--gray);
}

.btn.block {
  width: 100%;
}

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--orange);
  color: #fff;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
}

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

.top .muted {
  color: rgba(255, 255, 255, .88);
}

.tabs {
  position: sticky;
  top: 65px;
  z-index: 18;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-behavior: auto;
  scroll-padding-inline: 50%;
  -webkit-overflow-scrolling: touch;
  padding: 10px;
  background: #eef4fb;
  border-bottom: 1px solid var(--line);
}

.tab {
  flex: 0 0 auto;
  padding: 10px 13px;
  border: 1px solid #c7d3e2;
  border-radius: 999px;
  background: #fff;
  color: var(--orange-dark);
  font-weight: 800;
}

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

.page {
  padding: 12px;
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
}

.home-page {
  padding: 0 0 calc(28px + env(safe-area-inset-bottom));
  min-height: 100dvh;
  background: #f6f7f9;
}

.home-hero {
  position: relative;
  padding: 22px 16px 24px;
  color: #fff;
  background:
    radial-gradient(circle at 18% 42%, rgba(255,255,255,.20) 0 13%, transparent 14%),
    radial-gradient(circle at 88% 28%, rgba(255,255,255,.14) 0 10%, transparent 11%),
    linear-gradient(135deg, #11a45a 0%, #65d93f 100%);
  overflow: hidden;
}

.home-hero::before {
  content: "";
  position: absolute;
  left: -34px;
  top: 92px;
  width: 230px;
  height: 230px;
  border-radius: 45%;
  background: rgba(255, 255, 255, .16);
  transform: rotate(38deg);
}

.home-greeting,
.home-profit-card {
  position: relative;
  z-index: 1;
}

.home-toolbar {
  display: grid;
  grid-template-columns: 56px 1fr 52px 52px;
  gap: 10px;
  align-items: center;
}

.home-store,
.home-round {
  border: 0;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  color: #16a34a;
  background: rgba(255, 255, 255, .72);
  font-weight: 900;
}

.home-store {
  background: #f3f9bf;
  color: #0f8f45;
}

.home-search {
  min-width: 0;
  height: 52px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px;
  align-items: center;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .24);
  color: rgba(255, 255, 255, .95);
}

.home-search span {
  font-size: 25px;
  line-height: 1;
}

.home-search input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: #fff;
  font-size: 18px;
}

.home-search input::placeholder {
  color: rgba(255, 255, 255, .9);
}

.home-greeting {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 0;
  font-size: 23px;
  font-weight: 500;
}

.home-greeting button {
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 999px;
  padding: 7px 12px;
  color: #fff;
  background: rgba(255,255,255,.14);
  font-weight: 800;
}

.home-profit-card {
  margin-top: 28px;
  padding: 16px;
  border-radius: 12px;
  background: #fff;
  color: #111827;
  box-shadow: 0 16px 32px rgba(15, 23, 42, .12);
}

.home-profit-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: #6b7280;
}

.home-profit-head strong {
  letter-spacing: .5px;
}

.home-profit-head button {
  border: 0;
  background: transparent;
  color: #16a34a;
  font-weight: 900;
}

.home-money-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
  text-align: center;
}

.home-money-row span {
  display: block;
  color: #4b5563;
  font-size: 13px;
  font-weight: 800;
}

.home-money-row strong {
  display: block;
  margin-top: 6px;
  font-size: clamp(16px, 4.4vw, 22px);
  font-weight: 950;
  white-space: nowrap;
}

.home-money-row .income {
  color: #0ea5e9;
}

.home-money-row .expense {
  color: #ea580c;
}

.home-content {
  padding: 20px 16px 0;
}

.home-content h2 {
  margin: 0 0 16px;
  font-size: 25px;
  line-height: 1.2;
}

.home-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.home-feature {
  min-height: 104px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: #111827;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .12);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 10px 6px;
}

.home-feature span {
  min-width: 38px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #16a34a;
  background: #dcfce7;
  font-size: 13px;
  font-weight: 950;
}

.home-feature strong {
  font-size: 17px;
  line-height: 1.12;
}

.home-section {
  margin-top: 20px;
}

.home-section-title {
  margin-bottom: 10px;
  color: #111827;
  font-size: 21px;
  font-weight: 950;
}

.home-task-list,
.home-order-list {
  display: grid;
  gap: 8px;
}

.home-task-row {
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: #fff;
  color: #111827;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .08);
  display: grid;
  grid-template-columns: 52px 1.2fr 1fr 1fr;
  gap: 8px 10px;
  align-items: center;
  padding: 12px;
  text-align: left;
}

.home-task-row strong {
  font-size: 18px;
  font-weight: 950;
}

.home-task-row span,
.home-task-row em {
  min-width: 0;
  color: #52627a;
  font-size: 13px;
  font-style: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-task-row span:nth-child(2) {
  color: #111827;
  font-size: 15px;
  font-weight: 900;
}

.home-task-row.done {
  opacity: .68;
}

.home-order-row {
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: #fff;
  color: #111827;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .08);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 13px 12px;
  text-align: left;
}

.home-order-row strong,
.home-order-row span {
  display: block;
}

.home-order-row strong {
  font-size: 17px;
  font-weight: 950;
}

.home-order-row span {
  margin-top: 4px;
  color: #52627a;
  font-size: 13px;
}

.home-order-row b {
  color: #0ea5e9;
  font-size: 17px;
  white-space: nowrap;
}

.home-empty {
  border-radius: 12px;
  background: #fff;
  color: #6b7280;
  padding: 16px;
}

@media (max-width: 390px) {
  .home-toolbar {
    grid-template-columns: 48px 1fr 44px 44px;
    gap: 8px;
  }

  .home-store,
  .home-round {
    width: 44px;
    height: 44px;
  }

  .home-search {
    height: 46px;
  }

  .home-task-row {
    grid-template-columns: 44px 1fr 1fr;
  }
}

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

.stats {
  grid-template-columns: repeat(2, 1fr);
}

.card {
  padding: 14px;
}

.label {
  color: #52627a;
  font-size: 13px;
  font-weight: 700;
}

.value {
  margin-top: 6px;
  color: var(--green);
  font-size: 16px;
  font-weight: 900;
}

.value.red {
  color: var(--red);
}

.value.blue {
  color: var(--blue);
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.row > * {
  min-width: 0;
}

.form-grid {
  display: grid;
  gap: 8px;
}

.form-grid .btn {
  min-height: 44px;
}

.textarea {
  min-height: 110px;
  resize: vertical;
}

.stock-calc {
  margin-top: 8px;
  padding: 10px;
  border-radius: 10px;
  background: #fff7ed;
  color: var(--orange-dark);
  font-weight: 800;
}

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

.item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}

button.item,
button.finance-row {
  width: 100%;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  color: inherit;
  font: inherit;
  text-align: left;
}

.editable-item {
  cursor: pointer;
}

.item-title {
  font-weight: 850;
}

.item-sub {
  margin-top: 4px;
  color: #4b5f79;
  font-size: 13px;
}

.total-row {
  border-color: #16a34a;
  background: #f0fdf4;
}

.total-row .value {
  font-size: 21px;
}

.cart-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.suggest {
  border: 1px solid #f59e0b;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 6px;
  background: #fff;
}

.suggest button {
  width: 100%;
  display: block;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #edf1f7;
  padding: 10px;
  background: #fff;
  color: #111827;
}

.suggest button:last-child {
  border-bottom: 0;
}

.paybox {
  position: sticky;
  bottom: 0;
  margin: 12px -12px calc(-80px - env(safe-area-inset-bottom));
  padding: 12px;
  background: #eef4fb;
  border-top: 1px solid var(--line);
}

.pay-title {
  color: var(--orange-dark);
  font-size: 16px;
  font-weight: 900;
  margin-bottom: 10px;
}

.pay-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 42px;
}

.pay-line.strong {
  font-weight: 900;
}

.pay-line.strong strong {
  color: var(--blue);
  font-size: 18px;
}

.pay-input {
  width: 138px;
  min-height: 38px;
  padding: 8px 10px;
  text-align: right;
}

.pay-suggest {
  margin: 8px 0;
  padding: 8px;
  border-radius: 10px;
  background: #e2e8f0;
}

.pay-radio {
  min-height: 38px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  color: #111827;
}

.pay-radio input {
  width: 20px;
  height: 20px;
}

.calendar-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .08);
}

.calendar-nav {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  gap: 8px;
  align-items: center;
  text-align: center;
}

.calendar-title {
  color: var(--orange-dark);
  font-size: 19px;
  font-weight: 900;
}

.calendar-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 12px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.calendar-week div {
  padding: 7px 2px;
  border-radius: 8px;
  background: var(--orange);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-top: 5px;
}

.calendar-day {
  min-height: 64px;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  padding: 6px 4px;
  background: #fff;
  color: #111827;
  text-align: left;
  overflow: hidden;
}

.calendar-day.empty {
  background: transparent;
  border-color: transparent;
}

.calendar-day.has-task {
  background: #e5e7eb;
  border-color: #cbd5e1;
  color: #0f172a;
  font-weight: 900;
}

.calendar-day.has-finance:not(.selected) {
  background: #f8fafc;
}

.calendar-day.selected {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}

.calendar-day.today:not(.selected) {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}

.day-number {
  display: block;
  font-size: 16px;
  font-weight: 900;
}

.lunar-date {
  display: block;
  margin-top: 1px;
  color: #475569;
  font-size: 10px;
  font-weight: 800;
}

.calendar-day.selected .lunar-date {
  color: rgba(255, 255, 255, .9);
}

.day-info {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 800;
}

.cell-money {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.05;
  font-weight: 900;
  white-space: nowrap;
}

.cell-money.income {
  color: #0ea5e9;
}

.cell-money.expense {
  color: #ea580c;
}

.calendar-day.selected .cell-money {
  color: #fff;
}

.day-note {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-item.done {
  opacity: .72;
}

.task-item.done .item-title {
  text-decoration: line-through;
}

.task-form-card {
  margin-top: 10px;
}

.selected-day-panel {
  scroll-margin-top: 150px;
}

.day-section-card {
  margin-top: 10px;
}

.day-profit-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: #374151;
  font-weight: 900;
}

.day-profit-line strong {
  font-size: 20px;
}

.task-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 10px;
}

.finance-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
  padding: 12px 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}

.finance-summary span {
  display: block;
  color: #4b5563;
  font-size: 13px;
  font-weight: 900;
}

.finance-summary strong {
  display: block;
  margin-top: 5px;
  font-size: 19px;
  line-height: 1.1;
}

.finance-income {
  color: #0ea5e9;
}

.finance-expense {
  color: #ea580c;
}

.finance-list {
  margin-top: 10px;
  padding: 0;
  overflow: hidden;
}

.finance-day-section {
  scroll-margin-top: 150px;
}

.finance-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #f1f5f9;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: #374151;
  font-weight: 900;
}

.finance-day-section:first-child .finance-day-header {
  border-top: 0;
}

.finance-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 13px 14px;
  border-bottom: 1px solid #edf1f7;
  background: #fff;
}

.check-line {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #374151;
  font-weight: 800;
}

.check-line input {
  width: 20px;
  height: 20px;
}

.editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(15, 23, 42, .55);
}

.editor-card {
  width: min(620px, 100%);
  max-height: calc(100dvh - 28px);
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
}

.editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--orange-dark);
  font-size: 18px;
}

.finance-row.income strong {
  color: #0ea5e9;
}

.finance-row.expense strong {
  color: #475569;
}

.scanner-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #fff;
  display: grid;
  place-items: stretch;
  padding: 0;
}

.scanner-card {
  width: 100%;
  min-height: 100dvh;
  background: #fff;
  border-radius: 0;
  padding: calc(8px + env(safe-area-inset-top)) 0 calc(18px + env(safe-area-inset-bottom));
  box-shadow: none;
  display: flex;
  flex-direction: column;
}

.scanner-head {
  min-height: 58px;
  display: grid;
  grid-template-columns: 64px 1fr 86px;
  align-items: center;
  padding: 0 14px;
  font-size: 22px;
  color: #111827;
}

.scanner-back,
.scanner-manual {
  border: 0;
  background: transparent;
  color: #111827;
  font-weight: 800;
}

.scanner-back {
  font-size: 42px;
  line-height: 1;
  text-align: left;
}

.scanner-manual {
  font-size: 20px;
  text-decoration: underline;
  line-height: 1.05;
}

.scanner-manual span {
  font-size: 13px;
  text-decoration: none;
}

.scanner-mode {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 28px 14px;
}

.scanner-mode-btn {
  border: 0;
  border-radius: 8px;
  background: #e5e7eb;
  color: #2563eb;
  font-weight: 800;
  padding: 10px 14px;
}

.scanner-mode-btn.active {
  color: #16a34a;
  background: #eef2f7;
}

.scanner-stage {
  position: relative;
  min-height: 52dvh;
  background: #0f172a;
  overflow: hidden;
}

#scannerVideo {
  width: 100%;
  height: 52dvh;
  margin: 0;
  object-fit: cover;
  border-radius: 0;
  background: #0f172a;
}

#html5qrReader {
  width: 100%;
  height: 52dvh;
  margin: 0;
  overflow: hidden;
  border-radius: 0;
  background: #0f172a;
}

#quaggaReader {
  width: 100%;
  height: 52dvh;
  margin: 0;
  overflow: hidden;
  border-radius: 0;
  background: #0f172a;
  display: none;
}

#html5qrReader video {
  width: 100% !important;
  min-height: 52dvh;
  object-fit: cover;
}

#quaggaReader video,
#quaggaReader canvas {
  width: 100% !important;
  min-height: 52dvh;
  object-fit: cover;
}

#quaggaReader canvas.drawingBuffer {
  position: absolute;
  left: 0;
  top: 0;
}

#html5qrReader__scan_region {
  min-height: 52dvh;
}

.scan-frame {
  position: absolute;
  left: 50%;
  top: 48%;
  width: min(72vw, 340px);
  height: min(34vh, 240px);
  transform: translate(-50%, -50%);
  border-radius: 12px;
  background: rgba(255, 255, 255, .18);
  box-shadow: 0 0 0 999px rgba(0, 0, 0, .32);
  pointer-events: none;
}

.scan-frame::before,
.scan-frame::after {
  content: "";
  position: absolute;
  inset: -2px;
  border: 5px solid transparent;
  border-radius: 14px;
}

.scan-frame::before {
  border-top-color: #22c55e;
  border-left-color: #22c55e;
  clip-path: polygon(0 0, 34% 0, 34% 16%, 16% 16%, 16% 34%, 0 34%);
}

.scan-frame::after {
  border-right-color: #22c55e;
  border-bottom-color: #22c55e;
  clip-path: polygon(66% 84%, 84% 84%, 84% 66%, 100% 66%, 100% 100%, 66% 100%);
}

.scanner-float {
  position: absolute;
  right: 24px;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: #111827;
  font-size: 24px;
  font-weight: 900;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
}

.scanner-float.flash {
  bottom: 126px;
}

.scanner-float.camera {
  bottom: 52px;
}

.scanner-empty {
  flex: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 28px;
  text-align: center;
}

.scanner-icon {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #ecfdf5;
  color: #22c55e;
  font-size: 42px;
  font-weight: 900;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(15, 23, 42, .45);
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-card {
  width: min(94vw, 440px);
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 18px 46px rgba(15, 23, 42, .28);
}

.modal-title {
  color: var(--orange-dark);
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 6px;
}

.pill-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 0;
}

.pill {
  flex: 0 0 auto;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid #c7d3e2;
  background: #fff;
}

.error {
  color: var(--red);
  font-weight: 700;
  margin-top: 10px;
}

.notice {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  background: #fff7ed;
  color: #9a3412;
  font-weight: 700;
  line-height: 1.35;
}

@media (min-width: 720px) {
  .page {
    max-width: 900px;
    margin: 0 auto;
  }

  .task-form {
    grid-template-columns: repeat(2, 1fr);
  }
}

.finance-date-nav {
  display: grid;
  grid-template-columns: auto 34px minmax(0, 1fr) 34px;
  gap: 4px;
  align-items: center;
  margin: 0 0 8px;
  padding: 6px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}
.finance-date-label {
  font-size: 22px;
  font-weight: 900;
  color: #374151;
}
.date-arrow {
  border: 0;
  background: transparent;
  color: #374151;
  font-size: 28px;
  line-height: 1;
  padding: 0;
}
.finance-date-main {
  border: 0;
  border-radius: 12px;
  background: #fff7e6;
  color: #374151;
  font-size: 16px;
  font-weight: 900;
  padding: 8px 4px;
  white-space: nowrap;
}

.section-title {
  font-size: 18px;
  font-weight: 900;
  color: #0f172a;
  padding: 10px 14px 4px;
}
.qty-row{display:flex;gap:8px;align-items:center}.qty-row .small{width:42px;padding:10px 0}.qty-input{text-align:center;max-width:90px;min-width:64px}.field::placeholder, textarea::placeholder{color:#53657d;opacity:1}

/* B4C FIX1: photo capture fallback for non-secure LAN origins. */
.scanner-overlay {overflow-y:auto;}
.scanner-photo-panel {width:min(100%,420px);gap:10px;}
.scanner-photo-panel button {min-height:44px;}
.scanner-mode-btn:disabled {opacity:.55;}

/* B6A FIX4: show date on upcoming task rows without widening the grid. */
.home-task-date { display:block; font-size:11px; font-weight:600; color:#52627a; margin-top:3px; white-space:nowrap; }
.home-task-row:has(.home-task-date) { grid-template-columns: 76px 1.2fr 1fr 1fr; }
@media (max-width: 520px) { .home-task-row:has(.home-task-date) { grid-template-columns: 76px 1fr; } }

.shared-job{display:block;max-width:100%;font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#1d4ed8;background:#dbeafe;border-radius:3px;padding:2px}.shared-job.done{color:#166534;background:#dcfce7}

#mobileInvoiceForm [hidden]{display:none!important} #mobileInvoiceForm .invoice-job{padding:8px;border:1px solid #d1d5db;border-radius:8px;margin:6px 0;} #mobileInvoiceForm .field{margin:4px 0 9px;} #mobileInvoiceForm label{display:block;}

/* B6D-B2: scoped, responsive native payment dialog, independent from main page refresh. */
.b6d-pay-dialog{box-sizing:border-box;width:min(780px,calc(100% - 20px));max-width:100%;max-height:calc(100% - 24px);padding:0;border:1px solid #cbd5e1;border-radius:12px;background:#f5f7fa;color:#1f2937;overflow:hidden;margin:auto;font:inherit;}
.b6d-pay-dialog[open]{display:flex;flex-direction:column;}
.b6d-pay-dialog::backdrop{background:rgba(15,23,42,.58);}
.b6d-pay-dialog *{box-sizing:border-box;}
.b6d-pay-dialog .b6d-pay-head,.b6d-pay-dialog .b6d-pay-foot{padding:12px 16px;background:#fff;flex:none;}
.b6d-pay-dialog .b6d-pay-head{display:flex;align-items:center;justify-content:space-between;gap:8px;border-bottom:1px solid #dce3ea;color:#15803d;}
.b6d-pay-dialog .b6d-pay-body{overflow-y:auto;overscroll-behavior:contain;min-height:0;padding:12px 16px;}
.b6d-pay-dialog h3{margin:0 0 10px;font-size:16px;color:#15803d;overflow-wrap:anywhere;}
.b6d-pay-dialog section{border:1px solid #dce3ea;border-radius:9px;background:#fff;padding:12px;margin:12px 0;}
.b6d-pay-dialog .b6d-pay-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;}
.b6d-pay-dialog .b6d-pay-summary>div{background:#fff;padding:9px;border:1px solid #dce3ea;border-radius:8px;overflow-wrap:anywhere;}
.b6d-pay-dialog small{display:block;font-size:12px;color:#64748b;margin-bottom:5px;}
.b6d-pay-dialog .b6d-pay-summary b{font-size:16px;color:#15803d;}
.b6d-pay-dialog .b6d-pay-summary>div:last-child b{color:#c2410c;}
.b6d-pay-dialog label{display:block;font-size:14px;margin:8px 0;}
.b6d-pay-dialog input,.b6d-pay-dialog select{display:block;width:100%;height:auto;min-height:42px;margin-top:5px;border:1px solid #cbd5e1;border-radius:6px;padding:8px;font-size:16px;background:#fff;color:#1f2937;}
.b6d-pay-dialog button{border:1px solid #cbd5e1;background:#fff;color:#1d4ed8;padding:9px;border-radius:6px;font-size:14px;min-height:40px;cursor:pointer;}
.b6d-pay-dialog button:disabled{opacity:.5;cursor:default;}
.b6d-pay-dialog .b6d-pay-primary{width:100%;background:#15803d;color:#fff;border:0;font-weight:600;}
.b6d-pay-dialog .b6d-pay-quick{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;}
.b6d-pay-dialog .b6d-pay-quick [data-b=full]{background:#2563eb;color:white;}
.b6d-pay-dialog .b6d-pay-history{display:grid;grid-template-columns:minmax(120px,1fr) 1fr;gap:8px;border-bottom:1px solid #e2e8f0;padding:8px 0;overflow-wrap:anywhere;}
.b6d-pay-dialog .b6d-pay-foot{font-size:13px;color:#475569;border-top:1px solid #dce3ea;overflow-wrap:anywhere;}
@media(max-width:480px){.b6d-pay-dialog .b6d-pay-body{padding:10px;}.b6d-pay-dialog .b6d-pay-summary>div{padding:6px;}.b6d-pay-dialog .b6d-pay-summary b{font-size:14px;}.b6d-pay-dialog .b6d-pay-history{grid-template-columns:1fr;gap:2px;}.b6d-pay-dialog .b6d-pay-head,.b6d-pay-dialog .b6d-pay-foot{padding:8px 10px;}}

/* B3B FIX1: visibly locked until the existing ledger is opened. */
.b6d-pay-dialog .b6d-pay-open-hint{color:#92400e;background:#fffbeb;border:1px solid #fde68a;border-radius:6px;padding:9px;font-weight:600;}
.b6d-pay-dialog .b6d-pay-locked{color:#64748b;}
.b6d-pay-dialog input[type=checkbox]{display:inline-block;width:20px;height:20px;min-height:0;padding:0;margin:0 5px 0 0;vertical-align:middle;accent-color:#15803d;}

/* B6D-B3C PDF actions */
.mobile-pdf-actions{display:grid;gap:8px;}
.mobile-pdf-actions a{text-align:center;text-decoration:none;}
.mobile-pdf-actions [hidden]{display:none!important;}
