.financial-report {
  --report-blue: #147db8;
  --report-green: #267e62;
  --report-amber: #b28427;
  display: grid;
  gap: 22px;
}
.report-filters {
  display: grid;
  grid-template-columns: 100px repeat(4, minmax(110px, 1fr)) 130px 130px;
  gap: 12px;
  background: #fff;
  border: 1px solid #dce5ed;
  border-radius: 14px;
  padding: 18px;
  align-items: end;
}
.report-filters label {
  font-size: 12px;
  font-weight: 600;
  color: #52677b;
  display: grid;
  gap: 7px;
}
.report-filters input,
.report-filters select {
  width: 100%;
  min-width: 0;
  height: 39px;
  font-size: 13px;
  padding: 8px 10px;
}
.report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.dashboard-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.dashboard-grid > .report-card {
  grid-column: span 2;
}
.dashboard-grid > .report-card:nth-child(n + 4) {
  grid-column: span 3;
}
.dashboard-grid > .report-card:nth-child(n + 4) {
  padding-bottom: 22px;
}
@media (max-width: 1100px) {
  .report-grid.dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-grid > .report-card {
    grid-column: span 1;
  }
  .dashboard-grid > .report-card:nth-child(3) {
    grid-column: 1 / -1;
  }
  .dashboard-grid > .report-card:nth-child(n + 4) {
    grid-column: span 1;
  }
}
@media (max-width: 720px) {
  .report-grid.dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .dashboard-grid > .report-card {
    grid-column: 1 / -1;
  }
}
.report-card {
  min-width: 0;
  background: #fff;
  border: 1px solid #dce5ed;
  border-radius: 16px;
  padding: 22px 20px 12px;
  box-shadow: 0 2px 5px #17354d05;
  overflow: hidden;
}
.report-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
}
.report-card h2 {
  font-size: 16px;
  font-weight: 650;
  margin: 0;
  letter-spacing: -0.2px;
}
.report-number {
  display: block;
  font-size: clamp(24px, 2.6vw, 36px);
  font-weight: 650;
  letter-spacing: -1px;
  line-height: 1.4;
  margin: 12px 0 8px;
  font-variant-numeric: tabular-nums;
  color: #17354d;
}
.report-edit {
  font-size: 11px !important;
  padding: 6px 8px !important;
  min-height: 30px !important;
}
.report-reserved {
  min-height: 230px;
  background: #ffffff70;
  box-shadow: none;
}
.report-chart svg {
  width: 100%;
  height: auto;
  overflow: visible;
}
.chart-grid {
  stroke: #e6ecf1;
  stroke-dasharray: 3 5;
}
.chart-axis {
  fill: #596d80;
  font-size: 9px;
  font-family: inherit;
}
.chart-bar {
  fill: #aacce1;
  transition: fill 0.16s ease;
}
.chart-bar:hover {
  fill: #147db8;
}
.chart-bar.negative {
  fill: #d49b93;
}
.chart-line {
  fill: none;
  stroke: #147db8;
  stroke-width: 2.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.chart-budget {
  fill: none;
  stroke: #328569;
  stroke-width: 1.8;
  stroke-dasharray: 5 5;
}
.chart-legend {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 3px 0 12px;
  font-size: 10px;
  color: #52677b;
}
.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.chart-legend i {
  width: 13px;
  height: 3px;
  background: #147db8;
  display: inline-block;
}
.chart-legend .legend-bar {
  background: #aacce1;
  height: 7px;
  border-radius: 1px;
}
.chart-legend .legend-budget {
  background: transparent;
  border-top: 2px dashed #328569;
}
.report-tabs {
  display: flex;
  gap: 5px;
  padding: 5px;
  border: 1px solid #dce5ed;
  border-radius: 12px;
  width: max-content;
  max-width: 100%;
  background: #eaf0f5;
  overflow: auto;
}
.report-tabs button {
  border: 0;
  background: transparent;
  box-shadow: none;
  white-space: nowrap;
  font-size: 13px;
  padding: 10px 17px;
}
.report-tabs button.selected {
  background: #fff;
  box-shadow: 0 1px 3px #143a5320;
  color: #08639a;
}
.report-table-panel {
  border: 1px solid #dce5ed;
  background: #fff;
  border-radius: 15px;
  overflow: hidden;
}
.report-table-panel > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 19px 22px;
  gap: 12px;
}
.report-table-panel h2 {
  font-size: 17px;
  margin: 0;
}
.report-scroll {
  overflow: auto;
  max-width: 100%;
  scrollbar-width: thin;
}
.report-scroll table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.report-scroll th {
  white-space: nowrap;
  font-size: 11px;
  letter-spacing: 0;
  font-weight: 600;
  background: #f0f5f9;
  color: #52677b;
  padding: 14px 16px;
  border-top: 1px solid #e4ebf1;
  border-bottom: 1px solid #e4ebf1;
}
.report-scroll td {
  padding: 15px 16px;
  white-space: nowrap;
  border-bottom: 1px solid #ecf0f4;
}
.report-scroll tr:hover td {
  background: #f8fbfd;
}
.report-scroll tr:last-child td {
  border-bottom: 0;
}
.report-value {
  padding: 0 !important;
  min-height: 28px !important;
  border: 0 !important;
  border-radius: 4px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #086aa6 !important;
  font-size: inherit !important;
  font-weight: 600 !important;
  white-space: nowrap;
}
.report-value:hover {
  text-decoration: underline;
}
.report-negative {
  color: #a63837;
}
.report-phase {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 6px;
  background: #eef2f6;
  color: #4b6073;
  font-size: 11px;
}
.report-phase.execution {
  background: #e5f2fc;
  color: #096b9f;
}
.report-phase.technical {
  background: #fff1d9;
  color: #896020;
}
.report-phase.administrative {
  background: #e5f3ec;
  color: #246b53;
}
.report-project-totals {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 22px;
}
.report-project-totals > div {
  display: grid;
  gap: 8px;
}
.report-project-totals span {
  font-size: 12px;
  color: #5d7184;
}
.report-project-totals strong {
  font-size: 23px;
  font-variant-numeric: tabular-nums;
}
.report-project-charts {
  grid-template-columns: 1fr 1fr;
  padding: 0 22px 18px;
}
.report-forecast-summary {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  padding: 15px 22px;
  background: #f5f8fb;
  font-size: 12px;
}
.report-forecast-summary strong {
  margin-left: 8px;
}
.report-history {
  padding: 15px 22px;
  border-top: 1px solid #e4ebf1;
}
.report-history summary {
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.report-detail {
  padding: 24px;
}
.report-detail > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}
.report-detail h2 {
  font-size: 20px;
  margin: 0;
}
.report-detail footer {
  padding-top: 18px;
  text-align: right;
}
@media (prefers-reduced-motion: no-preference) {
  .report-card {
    animation: report-appear 0.24s ease-out both;
  }
  .report-card:nth-child(2) {
    animation-delay: 0.035s;
  }
  .report-card:nth-child(3) {
    animation-delay: 0.07s;
  }
  @keyframes report-appear {
    from {
      opacity: 0;
      transform: translateY(5px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}
@media (max-width: 1250px) {
  .report-filters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .report-grid {
    gap: 12px;
  }
  .report-card {
    padding: 17px 13px 9px;
  }
}
@media (max-width: 1000px) {
  .report-grid {
    grid-template-columns: 1fr;
  }
  .report-card .report-chart {
    max-width: 630px;
    margin: auto;
  }
  .report-project-charts {
    grid-template-columns: 1fr 1fr;
  }
  .report-reserved {
    min-height: 150px;
  }
}
@media (max-width: 600px) {
  .report-filters {
    grid-template-columns: 1fr 1fr;
    padding: 13px;
  }
  .report-project-charts {
    grid-template-columns: 1fr;
    padding: 0 12px 12px;
  }
  .report-project-totals {
    grid-template-columns: 1fr 1fr;
    padding: 16px;
  }
  .report-tabs {
    width: 100%;
  }
  .report-tabs button {
    padding: 8px 10px;
    font-size: 12px;
  }
  .report-detail {
    padding: 12px;
  }
  .report-number {
    font-size: 30px;
  }
}

.report-units {
  color: var(--muted, #536c80);
  font-size: 12px;
  margin: -8px 0 18px;
}
.report-total td,
.report-total th {
  font-weight: 700;
  background: #edf4f8;
  border-top: 2px solid #c8dbe8;
}
.project-status.calculation {
  background: #edf2f7;
  color: #475569;
}
.project-status.execution {
  background: #e0f2fe;
  color: #075985;
}
.project-status.technical {
  background: #fff3ce;
  color: #854d0e;
}
.project-status.administrative {
  background: #dcfce7;
  color: #166534;
}
.project-lifecycle .current .phase-mark {
  background: #0875b3;
  color: #fff;
}
.project-lifecycle .current {
  background: #f0f8fd;
}

.invoice-term-table {
  width: 100%;
  margin: 2mm 0;
  border-collapse: collapse;
  font-size: 11px;
}
.invoice-term-table th,
.invoice-term-table td {
  padding: 1.4mm 2mm;
  border-bottom: 1px solid #d5dce3;
  text-align: left;
  vertical-align: top;
}
.invoice-term-table th:last-child,
.invoice-term-table td:last-child {
  text-align: right;
  white-space: nowrap;
}
.invoice-term-table td small {
  display: block;
  font-size: 10px;
}
.invoice-term-table .term-paid {
  background: #c8cfd6;
  color: #263644;
}
.invoice-term-table .term-invoiced {
  background: #e5e9ed;
  color: #34495e;
}
.invoice-term-table .term-current {
  font-weight: 700;
  border-left: 2px solid #0875b3;
}
.installment-card.paid {
  background: #d8dee5;
  border-color: #b8c3ce;
  color: #23374c;
}
.installment-card.paid .installment-number {
  background: #b8c3ce;
  color: #23374c;
}
@media print {
  .invoice-term-table .term-paid,
  .invoice-term-table .term-invoiced {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

.invoice-custom-image {
  display: block;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
}
.invoice-shape svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.designer-align {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.designer-align button {
  font-size: 12px;
  min-height: 32px;
  padding: 5px 9px;
}
.designer-toolbar {
  gap: 10px;
  flex-wrap: wrap;
}
.manual-profit {
  font-size: 12px;
  color: #25634b;
  align-self: end;
  padding: 12px 0;
}

.accountancy-chart {
  border: 1px solid var(--line, #dbe6ed);
  border-radius: 14px;
  padding: 20px;
}
.accountancy-chart header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.accountancy-chart h2 {
  font-size: 16px;
  margin: 0;
}
.accountancy-chart label {
  display: flex;
  align-items: center;
  gap: 10px;
}
.accountancy-chart .report-chart {
  max-width: 760px;
  margin: auto;
}
.accountancy-chart svg {
  max-height: 260px;
}

.payment-term-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 12px;
  align-items: end;
}
.payment-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.payment-term-fields label {
  min-width: 0;
}

.invoice-remaining-summary:has(.invoice-term-table)
  [data-design-part="remaining-rows"] {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3mm;
}
.invoice-remaining-summary:has(.invoice-term-table)
  [data-design-part="remaining-rows"]
  > div {
  display: block;
  margin: 0;
  padding: 2mm;
  background: #eef3f7;
  border-radius: 1mm;
}
.invoice-remaining-summary:has(.invoice-term-table)
  [data-design-part="remaining-rows"]
  dd {
  text-align: left;
  margin: 1mm 0 0;
  font-size: 12px;
  font-weight: 700;
}
.invoice-remaining-summary:has(.invoice-term-table)
  [data-design-part="remaining-rows"]
  dt {
  font-size: 10px;
  white-space: normal;
  min-height: 3em;
}

.invoice-designer .invoice-canvas {
  position: relative;
}
.designer-selection-box {
  position: absolute;
  pointer-events: none;
  border: 1px solid #1688e1;
  z-index: 1000;
  box-sizing: border-box;
}
.selection-handle {
  position: absolute;
  display: block !important;
  width: var(--handle-size, 9px);
  height: var(--handle-size, 9px);
  background: white;
  border: var(--handle-border, 1.5px) solid #1688e1;
  border-radius: 1px;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  touch-action: none;
}
.handle-nw {
  left: 0;
  top: 0;
  cursor: nwse-resize;
}
.handle-n {
  left: 50%;
  top: 0;
  cursor: ns-resize;
}
.handle-ne {
  left: 100%;
  top: 0;
  cursor: nesw-resize;
}
.handle-e {
  left: 100%;
  top: 50%;
  cursor: ew-resize;
}
.handle-se {
  left: 100%;
  top: 100%;
  cursor: nwse-resize;
}
.handle-s {
  left: 50%;
  top: 100%;
  cursor: ns-resize;
}
.handle-sw {
  left: 0;
  top: 100%;
  cursor: nesw-resize;
}
.handle-w {
  left: 0;
  top: 50%;
  cursor: ew-resize;
}
.invoice-designer .invoice-canvas [data-invoice-block],
.invoice-designer .invoice-canvas [data-design-part] {
  touch-action: none;
}
.invoice-designer.is-manipulating {
  user-select: none;
  cursor: grabbing;
}
.invoice-designer .designer-resize {
  display: none !important;
}

/* 2.18: compact financial workflows and direct object manipulation. */
.icon-button {
  width: 38px;
  height: 38px;
  padding: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-button svg,
.work-entry .actions svg,
.work-category-tools svg {
  width: 18px;
  height: 18px;
}
.icon-button.danger,
svg.danger {
  color: #b73b45;
}
.client-info {
  max-height: 60vh;
  overflow: auto;
}
.settings-section {
  scroll-margin-top: 100px;
}
.report-project-charts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.report-project-charts .report-card {
  padding: 16px 20px;
  min-height: 0;
}
.report-project-charts .report-number {
  font-size: 26px;
  margin: 8px 0;
}
.report-project-charts .report-chart svg {
  height: auto;
  aspect-ratio: 405 / 220;
  width: 100%;
}
.report-project-charts .report-chart {
  max-width: none;
  margin: 8px 0 0;
}
.quote-metric-description {
  color: #52687a;
  font-size: 14px;
  line-height: 1.6;
  max-width: 35ch;
}
.quote-metric-link {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  margin-top: 12px;
  font-size: 13px;
}
.report-cumulative {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  padding: 20px;
  gap: 12px;
  border-bottom: 1px solid #dbe6ed;
  background: #f7fafc;
}
.week-section-title {
  margin: 22px 20px 12px;
  font-size: 14px;
}
.week-period-note {
  margin: 0 20px 14px;
  font-size: 12px;
  color: #52687a;
}
.week-total td {
  background: #eaf2f7;
  font-weight: 700;
  border-top: 2px solid #d0dfe9;
}
.report-cumulative span {
  display: block;
  color: #536c80;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.report-cumulative strong {
  display: block;
  font-size: clamp(13px, 1.1vw, 19px);
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}
.report-cumulative button {
  padding: 0;
  text-align: left;
  font-size: inherit;
}
.week-report .report-scroll {
  overflow: visible;
}
.week-report table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
}
.week-report th,
.week-report td {
  white-space: normal;
  overflow-wrap: anywhere;
  padding: 12px 7px;
  font-size: 12px;
  min-width: 0;
  vertical-align: top;
}
.week-report .report-value {
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  padding: 0;
  font-size: inherit;
}
.project-lifecycle {
  padding: 8px 20px !important;
  gap: 0;
}
.project-lifecycle li {
  padding: 20px 0 !important;
  background: transparent !important;
  border-bottom: 1px solid #e4ebf1;
  gap: 14px;
}
.project-lifecycle li:last-child {
  border-bottom: 0;
}
.project-lifecycle li.current .phase-mark {
  background: #176ba1;
  box-shadow: 0 0 0 5px #e4f2fc;
  color: white;
}
.project-lifecycle .phase-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  flex-shrink: 0;
}
.project-lifecycle .phase-select {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 20px;
  box-shadow: none;
}
.project-lifecycle .phase-select.selected {
  background: #e6f3fb;
  color: #195c89;
  border-color: #cde5f5;
}
.accounting-tools {
  flex-wrap: wrap;
}
.invoice-term-table tr.term-previous {
  background: #d0d5dc;
  color: #394451;
}
.invoice-term-table tfoot th,
.invoice-term-table tfoot td {
  border-top: 1px solid #bfcbd5;
  padding-top: 12px;
  background: white;
}
.invoice-term-table tfoot th {
  text-align: right;
}
@media (max-width: 1000px) {
  .report-cumulative {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .week-report table,
  .week-report tbody,
  .week-report tr,
  .week-report td {
    display: block;
    width: 100%;
  }
  .week-report thead {
    display: none;
  }
  .week-report tr {
    padding: 12px;
    border-bottom: 1px solid #dbe6ed;
  }
  .week-report td {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 6px;
  }
  .week-report td:before {
    content: attr(data-label);
    font-weight: 600;
    color: #536c80;
  }
  .report-cumulative {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .report-project-charts {
    grid-template-columns: 1fr;
  }
  .project-lifecycle .phase-select {
    padding: 8px;
    font-size: 11px;
  }
}

.report-filters {
  grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
}

body .nav button.active,
body .nav button.active svg {
  color: #07537e !important;
}
@media (min-width: 1200px) {
  .report-filters {
    grid-template-columns: repeat(5, minmax(125px, 1fr));
  }
}
body .nav button.active {
  background: #dceefb !important;
}

.payment-token {
  justify-self: start;
  font-size: 12px;
  padding: 3px 0;
  margin-top: -6px;
}

/* Neox 2.21: readable report columns and consistent form rhythm. */
.week-report .report-scroll {
  overflow: auto;
  overscroll-behavior-inline: contain;
}
.week-report table {
  table-layout: auto;
  min-width: 1400px;
}
.week-report .week-cumulative-panel table {
  min-width: 1100px;
}
.week-report th,
.week-report td {
  overflow-wrap: normal;
  word-break: normal;
  padding: 15px 18px;
  vertical-align: middle;
}
.week-report th {
  white-space: nowrap;
  line-height: 1.6;
  font-size: 12px;
  font-weight: 650;
  color: #39566c;
}
.week-report td {
  white-space: nowrap;
  line-height: 1.5;
}
.week-report td[data-label="Projectomschrijving"] {
  min-width: 200px;
  max-width: 320px;
  white-space: normal;
}
.week-report .report-value {
  white-space: nowrap;
  overflow-wrap: normal;
}
.week-report td:nth-child(n + 7),
.week-report th:nth-child(n + 7),
.week-cumulative-panel td:nth-child(n + 3),
.week-cumulative-panel th:nth-child(n + 3) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.week-report .week-total td {
  background: #edf5fa;
  border-top: 1px solid #d5e3ec;
  font-weight: 700;
}
.week-report thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}
.manual-profit {
  grid-column: 1 / -1;
  padding: 8px 0 0;
  font-weight: 650;
  min-height: 26px;
}
.manual-profit.is-profit {
  color: #23704e;
}
.manual-profit.is-loss {
  color: #b52c3d;
}
.manual-profit.is-unknown {
  color: #65798a;
}
.editor-form .line-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 14px 16px;
}
.editor-form .fields,
.editor-form .form-grid {
  align-items: end;
}
.editor-form label {
  min-width: 0;
}
.editor-form label input,
.editor-form label select {
  width: 100%;
  min-width: 0;
}
.editor-form .fields > label:has(input.full) {
  grid-column: 1 / -1;
}
.editor-form .line-top > label {
  flex: 1;
}
input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.required-star {
  color: #b52c3d;
}
@media (max-width: 760px) {
  .week-report table,
  .week-report .week-cumulative-panel table {
    min-width: 0;
  }
  .week-report td,
  .week-report td:nth-child(n + 7),
  .week-cumulative-panel td:nth-child(n + 3) {
    text-align: left;
    white-space: normal;
  }
  .week-report .report-value {
    white-space: normal;
  }
  .week-report td[data-label="Projectomschrijving"] {
    min-width: 0;
    max-width: none;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .invoice-addition-line,
  .editor-form .line-edit {
    animation: neox-line-reveal 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
  .project-content,
  .report-table-panel {
    animation: neox-panel-reveal 280ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
  .week-report tbody td {
    transition: background-color 160ms ease;
  }
  @keyframes neox-line-reveal {
    from {
      opacity: 0;
      transform: translateY(6px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
  @keyframes neox-panel-reveal {
    from {
      opacity: 0;
      transform: translateY(4px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}
