.cashmove-page {
  min-height: 100vh;
  padding: clamp(12px, 1.8vw, 26px);
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--erp-primary, #2563eb) 14%, transparent), transparent 34%),
    var(--erp-bg, #f8fafc);
}

.cashmove-hero,
.cashmove-toolbar,
.cashmove-summary article,
.cashmove-card,
.cashmove-group {
  border: 1px solid color-mix(in srgb, var(--erp-border, #dbe3ef) 82%, transparent);
  border-radius: 24px;
  background: color-mix(in srgb, var(--erp-surface, #fff) 96%, transparent);
  box-shadow: 0 20px 55px rgba(15, 23, 42, .07);
}

.cashmove-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: clamp(20px, 2.6vw, 34px);
  color: #fff;
  background: linear-gradient(135deg, var(--erp-sidebar, #0f172a), color-mix(in srgb, var(--erp-primary, #2563eb) 76%, #111827));
}

.cashmove-kicker {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  color: #dbeafe;
  font-weight: 900;
}

.cashmove-hero h1 {
  margin: 12px 0 8px;
  font-size: clamp(1.65rem, 2.8vw, 2.9rem);
  font-weight: 950;
}

.cashmove-hero p {
  max-width: 820px;
  margin: 0;
  color: rgba(255, 255, 255, .84);
}

.cashmove-actions,
.cashmove-tabs,
.cashmove-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cashmove-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 14px;
}

.cashmove-tabs button {
  border: 0;
  border-radius: 14px;
  padding: 11px 17px;
  color: var(--erp-muted, #64748b);
  background: color-mix(in srgb, var(--erp-primary, #2563eb) 7%, #fff);
  font-weight: 900;
}

.cashmove-tabs button.active {
  color: #fff;
  background: var(--erp-primary, #2563eb);
}

.cashmove-input {
  min-width: min(100%, 210px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid var(--erp-border, #dbe3ef);
  border-radius: 15px;
  background: #fff;
}

.cashmove-search { min-width: min(100%, 250px); }

.cashmove-unposted-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 7px 12px;
  border: 1px solid #f0d08b;
  border-radius: 15px;
  color: #7c5311;
  background: #fffaf0;
  cursor: pointer;
}

.cashmove-unposted-toggle > input { position: absolute; opacity: 0; pointer-events: none; }
.cashmove-unposted-toggle > span:last-child { display: grid; }
.cashmove-unposted-toggle strong { font-size: .82rem; font-weight: 950; }
.cashmove-unposted-toggle small { color: #9a6c21; font-size: .68rem; font-weight: 700; }
.cashmove-toggle-track { position: relative; width: 38px; height: 22px; flex: 0 0 auto; border-radius: 20px; background: #d4dbe4; transition: .2s ease; }
.cashmove-toggle-track i { position: absolute; top: 3px; right: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(15, 23, 42, .2); transition: .2s ease; }
.cashmove-unposted-toggle > input:checked + .cashmove-toggle-track { background: #d29327; }
.cashmove-unposted-toggle > input:checked + .cashmove-toggle-track i { transform: translateX(-16px); }
.cashmove-unposted-toggle:has(input:checked) { border-color: #d29327; background: #fff5d9; }

.cashmove-input span {
  color: var(--erp-muted, #64748b);
  font-weight: 900;
  white-space: nowrap;
}

.cashmove-input input,
.cashmove-input select {
  width: 100%;
  min-height: 44px;
  border: 0;
  outline: 0;
  background: transparent;
}

.cashmove-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.cashmove-summary article {
  padding: 16px;
}

.cashmove-summary span {
  display: block;
  color: var(--erp-muted, #64748b);
  font-weight: 850;
}

.cashmove-summary strong {
  display: block;
  margin-top: 8px;
  color: var(--erp-heading, #0f172a);
  font-size: clamp(1rem, 1.45vw, 1.35rem);
  font-weight: 950;
}

.positive { color: #047857 !important; }
.negative { color: #dc2626 !important; }
.muted { color: #64748b !important; }

.cashmove-card {
  margin-top: 16px;
  overflow: hidden;
}

.cashmove-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--erp-border, #dbe3ef);
}

.cashmove-card-head h2 {
  margin: 0;
  color: var(--erp-heading, #0f172a);
  font-size: 1.15rem;
  font-weight: 950;
}

.cashmove-card-head p,
.cashmove-card-head span {
  margin: 5px 0 0;
  color: var(--erp-muted, #64748b);
  font-weight: 750;
}

.cashmove-groups {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.cashmove-group {
  overflow: hidden;
  box-shadow: none;
}

.cashmove-group-toggle {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border: 0;
  padding: 16px;
  background: transparent;
  text-align: start;
}

.cashmove-group-title strong {
  display: block;
  color: var(--erp-heading, #0f172a);
  font-weight: 950;
}

.cashmove-group-title small {
  color: var(--erp-muted, #64748b);
  font-weight: 750;
}

.cashmove-group-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.cashmove-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #334155;
  background: #f1f5f9;
  font-weight: 900;
  white-space: nowrap;
}

.cashmove-pill.pending { color: #8a5808 !important; background: #fff1c6; }
.cashmove-unposted-row td { background: #fffbeb !important; border-color: #f2dfac !important; }
.cashmove-unposted-row td:first-child { border-right: 3px solid #d99a2b; }
.cashmove-unposted-badge { display: inline-flex; align-items: center; gap: 4px; margin-top: 5px; padding: 3px 7px; border-radius: 999px; color: #855509; background: #ffedb5; font-size: .69rem; font-weight: 900; }
.cashmove-unposted-divider td { padding: 9px 13px !important; color: #80530b; background: #fff1c7 !important; font-weight: 900; }

.cashmove-group-body {
  display: none;
  border-top: 1px solid var(--erp-border, #dbe3ef);
}

.cashmove-group.is-open .cashmove-group-body {
  display: block;
}

.cashmove-table {
  min-width: 1080px;
  margin: 0;
}

.cashmove-table th {
  padding: 13px;
  color: var(--erp-table-head-text, #334155);
  background: var(--erp-table-head, #eaf0f6);
  white-space: nowrap;
  font-weight: 950;
}

.cashmove-table td {
  padding: 12px 13px;
  vertical-align: middle;
  border-color: color-mix(in srgb, var(--erp-border, #dbe3ef) 75%, transparent);
}

.cashmove-money {
  direction: ltr;
  text-align: end;
  font-weight: 950;
  white-space: nowrap;
}

.cashmove-desc strong {
  display: block;
  color: var(--erp-heading, #0f172a);
}

.cashmove-desc small,
.cashmove-counterparty {
  color: var(--erp-muted, #64748b);
}

.cashmove-empty {
  padding: 34px;
  text-align: center;
  color: var(--erp-muted, #64748b);
}

.cashmove-print-report {
  display: none;
}

@media (max-width: 1200px) {
  .cashmove-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .cashmove-hero,
  .cashmove-toolbar,
  .cashmove-card-head {
    align-items: stretch;
    flex-direction: column;
  }
  .cashmove-actions .btn,
  .cashmove-tabs button,
  .cashmove-input {
    width: 100%;
  }
  .cashmove-summary { grid-template-columns: 1fr; }
  .cashmove-group-toggle { grid-template-columns: 1fr; }
  .cashmove-group-kpis { justify-content: flex-start; }
}

@media print {
  @page { size: A4 portrait; margin: 12mm 11mm 14mm; }

  body {
    color: #172033 !important;
    background: #fff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .no-print,
  .harplink-splash,
  body > nav,
  body > header,
  .erp-message-stack,
  .acc-mobile-menu-btn,
  .acc-sidebar-backdrop,
  .acc-sidebar,
  .sidebar,
  .cashmove-hero,
  .cashmove-toolbar,
  .cashmove-summary,
  .cashmove-card {
    display: none !important;
  }

  .app-wrapper,
  .app-content,
  .cashmove-page {
    width: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  .cashmove-print-report {
    display: block !important;
    direction: rtl;
    font-size: 10.5px;
  }

  .cashmove-print-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 2mm 1mm 5mm;
  }

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

  .cashmove-print-brand img,
  .cashmove-print-logo-fallback {
    width: 18mm;
    height: 18mm;
    object-fit: contain;
    border-radius: 4mm;
  }

  .cashmove-print-logo-fallback {
    display: grid;
    place-items: center;
    color: #fff;
    background: #173a63;
    font-size: 25px;
    font-weight: 950;
  }

  .cashmove-print-brand h1 {
    margin: 0 0 2px;
    color: #14243b;
    font-size: 19px;
    font-weight: 950;
  }

  .cashmove-print-brand p,
  .cashmove-print-document small {
    margin: 0;
    color: #64748b;
    font-weight: 700;
  }

  .cashmove-print-document {
    display: grid;
    justify-items: end;
    gap: 2px;
  }

  .cashmove-print-document span {
    color: #b0782c;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .8px;
  }

  .cashmove-print-document strong {
    color: #173a63;
    font-size: 15px;
    font-weight: 950;
  }

  .cashmove-print-accent {
    height: 2.3mm;
    border-radius: 20px;
    background: linear-gradient(90deg, #173a63 0 72%, #d7a14b 72% 100%);
  }

  .cashmove-print-meta {
    display: grid;
    grid-template-columns: 1.1fr 1.3fr 1.2fr;
    gap: 1px;
    margin: 5mm 0;
    overflow: hidden;
    border: 1px solid #dbe3ec;
    border-radius: 3mm;
    background: #dbe3ec;
  }

  .cashmove-print-meta div {
    padding: 3mm 4mm;
    background: #f7f9fc;
  }

  .cashmove-print-meta span,
  .cashmove-print-total span,
  .cashmove-print-footer span {
    display: block;
    margin-bottom: 2px;
    color: #718096;
    font-size: 8.5px;
    font-weight: 800;
  }

  .cashmove-print-meta strong { color: #24364d; font-weight: 900; }

  .cashmove-print-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5mm;
    padding: 4mm 5mm;
    border: 1px solid #d7e0ea;
    border-right: 1.5mm solid #d7a14b;
    border-radius: 3mm;
    background: linear-gradient(90deg, #fff, #f4f7fb);
  }

  .cashmove-print-total strong {
    direction: ltr;
    display: block;
    color: #173a63;
    font-size: 21px;
    font-weight: 950;
  }

  .cashmove-print-total p { margin: 0; color: #64748b; font-weight: 700; }

  .cashmove-print-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid #d4dde8;
    border-radius: 3mm;
  }

  .cashmove-print-table thead { display: table-header-group; }
  .cashmove-print-table tfoot { display: table-row-group; }
  .cashmove-print-table tr { break-inside: avoid; page-break-inside: avoid; }

  .cashmove-print-table th {
    padding: 3.2mm 2.5mm;
    border: 0;
    color: #fff;
    background: #173a63 !important;
    font-size: 9px;
    font-weight: 900;
    text-align: right;
  }

  .cashmove-print-table th:first-child,
  .cashmove-print-table td:first-child { text-align: center; }

  .cashmove-print-table td {
    padding: 3mm 2.5mm;
    border: 0;
    border-bottom: 1px solid #e5eaf0;
    color: #334155;
    background: #fff;
    vertical-align: middle;
  }

  .cashmove-print-table tbody tr:nth-child(even) td { background: #f8fafc !important; }
  .cashmove-print-table td strong { display: block; color: #172033; font-weight: 900; }
  .cashmove-print-table td small { display: block; margin-top: 2px; color: #7b8797; font-size: 8px; }
  .cashmove-print-code { direction: ltr; font-weight: 850; }

  .cashmove-print-type {
    display: inline-block;
    padding: 1.3mm 2.4mm;
    border-radius: 20px;
    color: #155e75;
    background: #e6f6fa !important;
    font-size: 8px;
    font-weight: 900;
  }

  .cashmove-print-type.is-bank { color: #4338ca; background: #eeecff !important; }

  .cashmove-print-balance {
    direction: ltr;
    color: #173a63 !important;
    font-size: 11px;
    font-weight: 950;
    text-align: left;
    white-space: nowrap;
  }

  .cashmove-print-balance.negative { color: #b42318 !important; }

  .cashmove-print-table tfoot td {
    padding: 3.5mm 2.5mm;
    border: 0;
    color: #173a63;
    background: #eaf0f6 !important;
    font-weight: 950;
  }

  .cashmove-print-table tfoot td:last-child {
    direction: ltr;
    font-size: 12px;
    text-align: left;
  }

  .cashmove-print-empty {
    padding: 14mm;
    border: 1px dashed #aebbc9;
    border-radius: 3mm;
    color: #64748b;
    text-align: center;
    font-weight: 800;
  }

  .cashmove-print-empty[hidden],
  .cashmove-print-table[hidden] { display: none !important; }

  .cashmove-print-footer {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: end;
    gap: 8mm;
    margin-top: 8mm;
    padding-top: 4mm;
    border-top: 1px solid #dbe3ec;
    color: #738093;
    font-size: 8px;
  }

  .cashmove-print-footer strong { color: #35465c; font-size: 9px; }
  .cashmove-print-footer p { margin: 0; text-align: center; }
  .cashmove-print-page { white-space: nowrap; }
  .cashmove-page-number::after { content: counter(page); }
}
