/* Business colors: identity blue, receipts mint, tax lilac, drawer yellow. */
:root {
  --report-ink: #202725;
  --report-paper: #fafbf8;
  --report-basic: #e2edff;
  --report-receipts: #ddf4e8;
  --report-tax: #eee7fc;
  --report-cash: #fff1bc;
  --report-tips: #fce5ed;
  --report-focus: #dceaff;
  --report-error: #a61e2b;
  --report-line: 1.5px solid var(--report-ink);
  --report-shadow: 3px 3px 0 #202725;
  --report-radius: 6px;
  --report-gap: 12px;
}
body { background: var(--report-paper); color: var(--report-ink); }
::selection { background: #ffe07e; color: #202725; }
input, select, textarea { caret-color: #174eb5; font-variant-numeric: tabular-nums; }
.topbar { border-bottom: var(--report-line); background: #fff; }
.mobile-bottom-nav { border-top: var(--report-line); }
.store-strip { background: #fff; border: var(--report-line); border-radius: var(--report-radius); box-shadow: var(--report-shadow); padding: 14px 16px; }
.store-strip h1 { color: var(--report-ink); font-size: 24px; line-height: 1.3; }
.store-meta span { border: 1px solid var(--report-ink); background: var(--report-basic); border-radius: 4px; }
.revenue-form { --group-color: var(--report-basic); gap: 12px; }
.revenue-form [data-revenue-section="channels"] { --group-color: var(--report-receipts); }
.revenue-form [data-revenue-section="tax"] { --group-color: var(--report-tax); }
.revenue-form [data-revenue-section="cash"] { --group-color: var(--report-cash); }
.revenue-form > [data-revenue-section] {
  background: #fff;
  padding: 0 16px 16px;
  margin: 0;
  border: var(--report-line);
  border-radius: var(--report-radius);
  box-shadow: var(--report-shadow);
}
.revenue-form .section-title-row { background: var(--group-color); margin: 0 -16px 14px; padding: 12px 16px; border-bottom: var(--report-line); gap: 8px; flex-wrap: wrap; border-radius: 4px 4px 0 0; }
.revenue-form h2 { color: var(--report-ink); font-size: 19px; line-height: 1.3; }
.revenue-form h3 { color: var(--report-ink); font-size: 15px; margin: 18px 0 8px; }
.revenue-form .section-status { border: 1px solid var(--report-ink); box-shadow: none; border-radius: 4px; font-size: 11px; }
.revenue-form .grid, .revenue-form .quick-grid, .revenue-form .channel-grid { gap: var(--report-gap); }
.revenue-form label:not(.test-switch) { min-width: 0; padding: 6px; gap: 6px; border-radius: 4px; font-size: 13px; line-height: 1.45; color: var(--report-ink); border: 1px solid transparent; background: #fff; box-shadow: none; transition: background 120ms; }
.revenue-form .channel-card { border: 0; box-shadow: none; min-height: 0; }
.revenue-form .channel-grid { align-items: stretch; }
.revenue-form .channel-grid > .channel-card { align-self: stretch; grid-template-rows: 1fr auto; }
.revenue-form [data-altri-box]:has(.altri-fields[hidden]) {
  align-self: end; border: 1px solid transparent; border-radius: 4px;
  padding: 6px; background: transparent; box-shadow: none;
}
.revenue-form [data-altri-box] > [data-altri-toggle] {
  min-height: 46px; height: 46px; padding: 6px 8px; margin: 0; border-radius: 4px;
  font-size: 12px; line-height: 1.2; white-space: normal; box-shadow: none;
}
.revenue-form [data-altri-box]:has(.altri-fields:not([hidden])) {
  grid-column: 1 / -1; border: 0; border-top: 1px solid #a2aca6;
  padding: 10px 0 0; border-radius: 0; box-shadow: none;
}
.revenue-form input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]), .revenue-form select, .revenue-form textarea {
  background: #fff; color: var(--report-ink); border: 1px solid #64716b; border-radius: 4px; min-width: 0; max-width: 100%; width: 100%; box-sizing: border-box; box-shadow: none; min-height: 46px; padding: 10px; font-size: 16px; line-height: 1.4;
}
.revenue-form input[data-money], .revenue-form input[data-int] { text-align: right; font-variant-numeric: tabular-nums; }
.revenue-form label:not(.test-switch):focus-within { background: var(--report-focus); border-color: #174eb5; }
.revenue-form input:focus, .revenue-form select:focus, .revenue-form textarea:focus { outline: 2px solid #174eb5; outline-offset: 2px; }
.report-money-control { display: block; position: relative; min-width: 0; }
.revenue-form .report-money-control input { padding-right: 48px !important; }
.report-money-unit { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: #43554b; font-size: 11px; font-weight: 700; pointer-events: none; }
.revenue-form .computed-total { background: #f2f5f0; border: 0; border-top: 2px solid #64716b; border-radius: 0; padding: 12px; box-shadow: none; min-width: 0; }
.revenue-form .computed-total strong { font-size: 23px; line-height: 1.35; font-variant-numeric: tabular-nums; color: var(--report-ink); overflow-wrap: anywhere; }
.revenue-form .computed-total strong[data-report-currency]::after { content: ' EUR'; font-size: 11px; font-weight: 500; color: #43554b; }
.revenue-form .computed-total.primary-total { background: var(--report-receipts); border-top-color: #236846; }
.revenue-form .readonly-field, .revenue-form input[readonly] { background: #eef1ee; color: #43554b; border-style: dashed; }
.revenue-form .reconcile-panel { border: var(--report-line); background: #fff; border-radius: var(--report-radius); padding: 12px; box-shadow: var(--report-shadow); }
.revenue-form .reconcile-panel .primary-total strong { font-size: 28px; }
.revenue-form .computed-total.is-warning, .revenue-form .computed-total.is-blocked { background: #fff0f0; border-top-color: var(--report-error); }
.revenue-form .computed-total.is-warning strong, .revenue-form .computed-total.is-blocked strong { color: var(--report-error); }
.revenue-form .spesa-block, .revenue-form .mancia-block, .revenue-form .cash-reconcile { border: 0; border-top: 1px solid #a2aca6; border-radius: 0; background: transparent; padding: 12px 0; box-shadow: none; }
.revenue-form .spesa-head { flex-wrap: wrap; gap: 8px; }
.revenue-form .spesa-head h3 { margin: 0; }
.revenue-form .spesa-inline-total { font-variant-numeric: tabular-nums; }
.revenue-form .spesa-inline-total::after { content: ' EUR'; font-size: 11px; }
.revenue-form .mancia-block > .spesa-head { background: var(--report-tips); padding: 10px; border-radius: 4px; margin-bottom: 8px; }
.revenue-form .spesa-row { border: 0; border-bottom: 1px solid #a2aca6; background: #fff; padding: 8px 0 12px; box-shadow: none; }
.revenue-form .cash-reconcile h3 { background: var(--report-cash); padding: 10px; margin: 0; }
.revenue-form button.primary, .revenue-form > button[type="submit"] { background: #174eb5; border: var(--report-line); box-shadow: var(--report-shadow); border-radius: var(--report-radius); min-height: 48px; }
.revenue-form .ghost, .revenue-form .secondary { background: #fff; color: #253b31; border: 1px solid #64716b; box-shadow: none; }
.revenue-form .section-title-row .clear-form-button,
.revenue-form .section-title-row .test-switch {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 128px; min-height: 44px; height: 44px; padding: 6px 10px; margin: 0;
  border: 1px solid #64716b; border-radius: 4px; box-shadow: none;
  background: #fff; font-size: 12px; line-height: 1.25; white-space: normal;
}
.revenue-form > .reconcile-panel { margin: 0; }
.revenue-form button:disabled { background: #e5e9e5; color: #43554b; box-shadow: none; cursor: wait; }
.revenue-form .field-error, .revenue-form label.field-error { background: #fff0f0 !important; border: 1px solid var(--report-error); }
.report-inline-error { display: block; color: var(--report-error); font-size: 12px; line-height: 1.5; font-weight: 600; }
.report-save-state { border: 1px solid #64716b; border-radius: 4px; background: #fff; padding: 9px 12px; font-size: 12px; margin: 12px 0; line-height: 1.5; }
.report-save-state[data-state="dirty"] { background: var(--report-cash); }
.report-save-state[data-state="local"] { background: var(--report-receipts); }
.report-save-state[data-state="busy"] { background: var(--report-basic); }
.report-save-state[data-state="failed"] { background: #fff0f0; border-color: var(--report-error); color: var(--report-error); }
.revenue-form .submit-requirements, .revenue-form .upload-note, .revenue-form .edit-entry-rule { border: 0; border-top: 1px solid #a2aca6; border-radius: 0; background: #f7f9f6; box-shadow: none; padding: 12px; }
.submit-result-card { border: var(--report-line); border-radius: var(--report-radius); box-shadow: var(--report-shadow); }
.submit-result-card.error { border-color: var(--report-error); background: #fff4f4; }
.submit-result-card.success { background: var(--report-receipts); }
.finance-detail .detail-card h2 { border-bottom: 2px solid #202725; padding-bottom: 8px; }
.finance-detail .channel-detail-table th { background: var(--report-receipts); }
.finance-detail .handover-detail-table th { background: var(--report-basic); }
@media (max-width: 700px) {
  .revenue-form > [data-revenue-section] { padding: 0 10px 10px; margin: 0; }
  .revenue-form .section-title-row { margin: 0 -10px 10px; padding: 10px; }
  .revenue-form h2 { font-size: 17px; }
  .revenue-form .channel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .revenue-form label:not(.test-switch) { padding: 4px; font-size: 12px; }
  .revenue-form [data-altri-box]:has(.altri-fields[hidden]) { padding: 4px; }
  .revenue-form .computed-total strong { font-size: 21px; }
  .revenue-form .reconcile-panel .primary-total strong { font-size: 24px; }
  .store-strip h1 { font-size: 20px; }
  .revenue-form .cash-reconcile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .revenue-form .cash-reconcile-grid .cash-actual { grid-column: 1 / -1; }
  .revenue-form .cash-reconcile-grid .computed-total:last-child { grid-column: 1 / -1; }
  .revenue-form .section-title-row:has(.clear-form-button) {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
  }
  .revenue-form .section-title-row:has(.clear-form-button) h2 { grid-row: 1; grid-column: 1; }
  .revenue-form .section-title-row .section-status { justify-self: end; grid-row: 1; grid-column: 2; order: 0; }
  .revenue-form .section-title-row .clear-form-button { grid-row: 2; grid-column: 1; }
  .revenue-form .section-title-row .test-switch { grid-row: 2; grid-column: 2; }
  .revenue-form .section-title-row .clear-form-button,
  .revenue-form .section-title-row .test-switch { width: 100%; min-width: 0; order: 0; }
}
@media (prefers-reduced-motion: reduce) { .revenue-form label { transition: none; } }
