:root {
  --font-display: "Poppins", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --brand-navy: #0b132b;
  --brand-primary: #2563eb;
  --brand-primary-hover: #1d4ed8;
  --brand-teal: #14b8a6;
  --brand-success: #22c55e;
  --brand-warning: #f59e0b;
  --brand-danger: #ef4444;
  --brand-special: #8b5cf6;
  --text-heading: var(--brand-navy);
  --text-primary: #334155;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-subtle: #a4adbc;
  --surface-canvas: #f8fafc;
  --surface-primary: #ffffff;
  --surface-secondary: #f8fafc;
  --surface-muted: #f1f5f9;
  --surface-selected: #eef4ff;
  --border-subtle: #edf2f7;
  --border-default: #e2e8f0;
  --border-strong: #cbd5e1;
  --interactive-hover: #f5f8ff;
  --interactive-selected: #eef4ff;
  --interactive-focus: rgba(37, 99, 235, 0.14);
  --chart-primary: var(--brand-primary);
  --chart-secondary: var(--brand-teal);
  --chart-positive: var(--brand-success);
  --chart-warning: var(--brand-warning);
  --chart-danger: var(--brand-danger);
  --chart-special: var(--brand-special);
  --app-bg: var(--surface-canvas);
  --app-surface: var(--surface-primary);
  --app-surface-subtle: var(--surface-secondary);
  --app-surface-accent: var(--surface-selected);
  --app-border: var(--border-default);
  --app-border-strong: var(--border-strong);
  --app-text: var(--text-primary);
  --app-heading: var(--text-heading);
  --app-muted: var(--text-secondary);
  --app-muted-strong: var(--text-primary);
  --app-primary: var(--brand-primary);
  --app-primary-hover: var(--brand-primary-hover);
  --app-primary-soft: #eef4ff;
  --app-primary-border: #bfdbfe;
  --app-success-bg: #ecfdf3;
  --app-success-text: #15803d;
  --app-warning-bg: #fffaeb;
  --app-warning-text: #b45309;
  --app-danger-bg: #fef3f2;
  --app-danger-text: #b91c1c;
  --app-muted-bg: var(--surface-muted);
  --app-muted-text: #566176;
  --app-purple: var(--brand-special);
  --app-purple-soft: #f1ecff;
  --app-orange: var(--brand-warning);
  --app-orange-soft: #fff1de;
  --app-teal: var(--brand-teal);
  --app-progress-track: #e2e8f0;
  --app-radius-sm: 8px;
  --app-radius-md: 14px;
  --app-shadow-sm: 0 1px 2px rgba(7, 19, 48, 0.035), 0 6px 18px rgba(7, 19, 48, 0.025);
  --app-shadow-md: 0 10px 24px rgba(7, 19, 48, 0.055);
  --transition-fast: 140ms ease;
  --app-sidebar-width: 242px;
  --app-topbar-height: 66px;
}

.reports-overview-page {
  display: grid;
  gap: 14px;
}

.reports-overview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.reports-overview-header h1 {
  margin: 0;
}

.reports-filter-card,
.reports-summary-strip,
.reports-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}

.reports-filter-card {
  display: grid;
  grid-template-columns: minmax(300px, 1.6fr) repeat(2, minmax(170px, 0.7fr));
  align-items: end;
  gap: 10px;
  padding: 12px 14px;
}

.reports-filter-card-all-companies {
  grid-template-columns: minmax(170px, 0.7fr) minmax(300px, 1.6fr) repeat(2, minmax(170px, 0.7fr));
}

.reports-period-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.reports-filter-actions {
  display: flex;
  align-items: center;
  grid-column: 1 / -1;
  justify-content: flex-end;
  gap: 8px;
}

.reports-filter-card .form-label {
  margin-bottom: 4px;
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.15;
}

.reports-clear-filters {
  text-decoration: none;
}

.reports-tabs {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 36px;
  border-bottom: 1px solid var(--app-border);
}

.reports-tab {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.reports-tab.is-active {
  color: var(--app-primary);
  font-weight: 600;
  border-bottom-color: var(--app-primary);
}

.reports-tab.is-disabled {
  color: var(--app-muted);
}

.reports-tab:not(.is-disabled):hover,
.reports-tab:not(.is-disabled):focus {
  color: var(--app-primary);
}

.reports-summary-strip {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) repeat(4, minmax(130px, 1fr));
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.reports-summary-title h2 {
  margin: 0 0 4px;
}

.reports-summary-title span,
.reports-summary-metric span {
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 500;
}

.reports-summary-metric {
  padding-left: 14px;
  border-left: 1px solid var(--app-border);
}

.reports-summary-metric span,
.reports-summary-metric strong {
  display: block;
}

.reports-summary-metric strong {
  margin-top: 3px;
  color: var(--text-heading);
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.reports-analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.75fr);
  gap: 14px;
  align-items: stretch;
}

.reports-card {
  min-width: 0;
  padding: 14px 16px;
}

.reports-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.reports-section-header h2 {
  margin: 0;
}

.reports-chart-wrap {
  position: relative;
  overflow-x: auto;
}

.reports-line-chart {
  width: 100%;
  min-width: 640px;
  height: auto;
  overflow: visible;
}

.reports-chart-axis {
  stroke: var(--app-border-strong);
  stroke-width: 1;
}

.reports-chart-gridline {
  stroke: #e8ebf1;
  stroke-dasharray: 3 4;
  stroke-width: 1;
}

.reports-chart-area {
  fill: rgba(37, 99, 235, 0.12);
  stroke: none;
}

.reports-chart-line {
  fill: none;
  stroke: var(--chart-primary);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reports-chart-point {
  fill: var(--app-surface);
  stroke: var(--chart-primary);
  stroke-width: 2.2;
}

.reports-chart-point:focus {
  outline: none;
  stroke-width: 3;
}

.reports-chart-y-label,
.reports-chart-x-label {
  fill: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
}

.reports-chart-x-label {
  text-anchor: middle;
}

.reports-chart-empty,
.reports-empty {
  padding: 20px 8px;
  color: var(--app-muted);
  font-size: 0.78rem;
  text-align: center;
}

.reports-chart-tooltip {
  position: absolute;
  z-index: 4;
  min-width: 118px;
  padding: 7px 9px;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--app-surface);
  box-shadow: var(--app-shadow-sm);
  pointer-events: none;
  transform: translate(-50%, -100%);
}

.reports-chart-tooltip span,
.reports-chart-tooltip strong {
  display: block;
  white-space: nowrap;
}

.reports-chart-tooltip span {
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 400;
}

.reports-chart-tooltip strong {
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 600;
}

.reports-ranked-list {
  display: grid;
  gap: 8px;
}

.reports-ranked-row {
  display: grid;
  grid-template-columns: 26px minmax(120px, 1fr) minmax(140px, 1.45fr) minmax(116px, auto) 54px;
  align-items: center;
  gap: 9px;
}

.reports-ranked-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: var(--app-muted-strong);
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: var(--app-surface-subtle);
  font-size: 0.72rem;
  font-weight: 600;
}

.reports-ranked-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reports-ranked-name span,
.reports-ranked-name a {
  color: var(--text-primary);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reports-ranked-name a:hover,
.reports-ranked-name a:focus {
  color: var(--app-primary);
}

.reports-ranked-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f7;
}

.reports-ranked-track span {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: var(--app-primary);
}

.reports-ranked-card:nth-child(2) .reports-ranked-track span {
  background: var(--chart-primary);
}

.reports-ranked-wide .reports-ranked-track span {
  background: var(--chart-secondary);
}

.reports-ranked-row strong,
.reports-ranked-share {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.reports-ranked-row strong {
  font-size: 0.76rem;
}

.reports-ranked-share {
  color: var(--text-secondary);
  font-size: 0.72rem;
}

.reports-cross-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
}

.reports-cross-toolbar h2 {
  margin: 0;
}

.reports-cross-toolbar span,
.reports-drilldown-meta {
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 400;
}

.reports-orientation-switch {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--app-surface-subtle);
}

.reports-orientation-button {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  color: var(--app-muted-strong);
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
}

.reports-orientation-button:hover,
.reports-orientation-button:focus {
  color: var(--app-primary);
}

.reports-orientation-button.is-active {
  color: var(--app-primary);
  background: var(--app-primary-soft);
  box-shadow: inset 0 0 0 1px var(--app-primary-border);
  font-weight: 600;
}

.reports-matrix-card {
  padding: 0;
  overflow: hidden;
}

.reports-matrix-scroll {
  max-width: 100%;
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
}

.reports-matrix-table {
  --matrix-grid: #dce6ef;
  --matrix-header: #eaf1f8;
  --matrix-name: #f3f7fb;
  --matrix-total: #eaf4fc;
  min-width: max-content;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--app-text);
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.reports-matrix-table th,
.reports-matrix-table td {
  min-width: 126px;
  max-width: 150px;
  padding: 8px 10px;
  border-right: 1px solid var(--matrix-grid);
  border-bottom: 1px solid var(--matrix-grid);
  text-align: right;
  white-space: nowrap;
}

.reports-matrix-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--brand-navy);
  background: var(--matrix-header);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
}

.reports-matrix-table thead th span {
  display: inline-block;
  max-width: 128px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.reports-matrix-table thead th .ui-entity-name {
  color: var(--brand-navy);
  font-size: 0.7rem;
  font-weight: 600;
}

.reports-matrix-table tbody th {
  color: var(--brand-navy);
  background: var(--matrix-name);
  font-weight: 600;
  text-align: left;
}

.reports-matrix-table tbody th .ui-entity-name {
  color: inherit;
  font-weight: 600;
}

.reports-matrix-table tbody tr:nth-child(even) td:not(.reports-matrix-total-column):not(.is-selected) {
  background: #f9fbfd;
}

.reports-matrix-table tbody tr:nth-child(even) th.reports-matrix-sticky:not(.is-selected-axis) {
  background: #edf3f8;
}

.reports-matrix-table tbody tr:hover td:not(.reports-matrix-total-column):not(.is-selected) {
  background: #f1f7fc;
}

.reports-matrix-table tbody tr:hover th.reports-matrix-sticky:not(.is-selected-axis) {
  background: #e8f2fa;
}

.reports-matrix-table tfoot th {
  color: var(--brand-navy);
  background: var(--matrix-total);
  font-size: 0.76rem;
  font-weight: 650;
  border-top: 2px solid #b9d2e8;
}

.reports-matrix-table td a {
  display: flex;
  justify-content: flex-end;
  color: #475569;
  font-weight: 500;
  text-decoration: none;
}

.reports-matrix-table td a:hover,
.reports-matrix-table td a:focus {
  color: var(--app-primary);
}

.reports-matrix-table td a:focus-visible {
  outline: 2px solid var(--app-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

.reports-matrix-table td.is-selected {
  background: var(--app-primary-soft);
  box-shadow: inset 0 0 0 2px var(--app-primary-border);
}

.reports-matrix-table td.is-selected a {
  color: var(--app-primary);
}

.reports-matrix-table .reports-zero-cell {
  display: block;
  color: #9aaabd;
  font-weight: 400;
  text-align: center;
}

.reports-matrix-sticky {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 144px;
  max-width: 160px;
  box-shadow: 1px 0 0 var(--matrix-grid);
}

.reports-matrix-total-column {
  min-width: 142px;
  max-width: 168px;
  color: var(--brand-navy);
  background: var(--matrix-total);
  border-left: 2px solid #b9d2e8;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.reports-matrix-table thead th.is-selected-axis,
.reports-matrix-table tbody th.is-selected-axis {
  color: #17488a;
  background: #dcecfb;
}

.reports-matrix-table thead th.is-selected-axis {
  box-shadow: inset 0 -2px 0 var(--app-primary-border);
}

.reports-matrix-table tbody th.is-selected-axis {
  box-shadow: inset 3px 0 0 var(--app-primary-border), 1px 0 0 var(--matrix-grid);
}

.reports-matrix-table tbody th.is-selected-axis .ui-entity-name {
  color: inherit;
}

.reports-matrix-table tfoot th.reports-matrix-total-column {
  background: #dcecfb;
  font-size: 0.84rem;
  font-weight: 700;
}

.reports-matrix-row-heading {
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 600;
}

.reports-cross-drilldown.has-selection {
  border-top: 2px solid var(--app-primary-border);
}

.reports-cross-drilldown .reports-section-header {
  align-items: flex-start;
  padding: 10px 12px;
  border-left: 3px solid var(--app-primary);
  border-radius: 6px;
  background: #f0f6fd;
}

.reports-cross-drilldown .reports-section-header.is-updated {
  animation: reports-cross-heading-update 700ms ease-out 1;
}

@keyframes reports-cross-heading-update {
  from { background: #dcecfb; }
  to { background: #f0f6fd; }
}

@media (prefers-reduced-motion: reduce) {
  .reports-cross-drilldown .reports-section-header.is-updated {
    animation: none;
  }
}

.reports-cross-drilldown .reports-section-header h2 {
  margin-bottom: 3px;
  font-size: 0.95rem;
  line-height: 1.25;
}

.reports-cross-drilldown .reports-section-header strong {
  white-space: nowrap;
}

.reports-drilldown-table {
  min-width: 760px;
  margin-bottom: 0;
  table-layout: fixed;
}

.reports-drilldown-table th:nth-child(1),
.reports-drilldown-table td:nth-child(1) {
  width: 126px;
}

.reports-drilldown-table th:nth-child(3),
.reports-drilldown-table td:nth-child(3),
.reports-drilldown-table th:nth-child(5),
.reports-drilldown-table td:nth-child(5) {
  width: 152px;
}

.reports-drilldown-table th:nth-child(4),
.reports-drilldown-table td:nth-child(4) {
  width: 124px;
}

.reports-drilldown-table > :not(caption) > * > * {
  padding: 7px 12px;
  border-bottom-color: var(--app-border);
}

.reports-drilldown-table thead th {
  color: var(--text-secondary);
  background: var(--app-surface-subtle);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.reports-drilldown-table tfoot th {
  color: var(--text-primary);
  background: var(--app-surface-subtle);
  font-size: 0.76rem;
  font-weight: 600;
  border-top: 1px solid var(--app-border-strong);
}

.reports-strong-money {
  color: var(--app-heading);
  font-weight: 650;
}

.reports-drilldown-date-cell {
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.reports-drilldown-number-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reports-drilldown-arrow {
  width: 44px;
  text-align: right;
}

.reports-breakdown-note {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  color: #31506f;
  border: 1px solid var(--app-primary-border);
  border-radius: var(--app-radius-sm);
  background: #f5f8ff;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.35;
}

.reports-breakdown-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 13px 16px;
}

.reports-breakdown-summary .reports-summary-metric:first-child {
  padding-left: 0;
  border-left: 0;
}

.reports-breakdown-table-card {
  padding: 12px 0 0;
  overflow: hidden;
}

.reports-breakdown-table-card .reports-section-header {
  align-items: flex-start;
  margin-bottom: 9px;
  padding: 0 16px;
}

.reports-breakdown-table-card .reports-section-header h2 {
  font-size: 1rem;
  line-height: 1.25;
}

.reports-breakdown-export {
  min-height: 32px;
  padding: 6px 12px;
  font-size: 0.72rem;
  font-weight: 600;
}

.reports-breakdown-table-wrap {
  overflow-x: auto;
}

.reports-breakdown-table {
  min-width: 1000px;
  margin-bottom: 0;
  table-layout: fixed;
}

.reports-breakdown-table th:nth-child(1),
.reports-breakdown-table td:nth-child(1) {
  width: 128px;
}

.reports-breakdown-table th:nth-child(2),
.reports-breakdown-table td:nth-child(2) {
  width: 110px;
}

.reports-breakdown-table th:nth-child(3),
.reports-breakdown-table td:nth-child(3),
.reports-breakdown-table th:nth-child(4),
.reports-breakdown-table td:nth-child(4) {
  width: 136px;
}

.reports-breakdown-table th:nth-child(5),
.reports-breakdown-table td:nth-child(5) {
  width: auto;
}

.reports-breakdown-table th:nth-child(6),
.reports-breakdown-table td:nth-child(6),
.reports-breakdown-table th:nth-child(8),
.reports-breakdown-table td:nth-child(8) {
  width: 140px;
}

.reports-breakdown-table th:nth-child(7),
.reports-breakdown-table td:nth-child(7) {
  width: 112px;
}

.reports-breakdown-table > :not(caption) > * > * {
  padding: 8px 11px;
  border-bottom-color: var(--app-border);
}

.reports-breakdown-table thead th {
  color: var(--text-secondary);
  background: var(--app-surface-subtle);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.reports-breakdown-table tbody td {
  color: var(--text-primary);
  font-size: 0.78rem;
  vertical-align: middle;
}

.reports-breakdown-period-cell,
.reports-breakdown-date-cell {
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.reports-breakdown-number-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reports-breakdown-pagination {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  color: var(--app-muted);
  font-size: 0.76rem;
  border-top: 1px solid var(--app-border);
}

@media (max-width: 1199.98px) {
  .reports-filter-card {
    grid-template-columns: minmax(260px, 1.5fr) repeat(2, minmax(150px, 0.8fr));
  }

  .reports-filter-card-all-companies {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reports-summary-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .reports-summary-title {
    grid-column: 1 / -1;
  }

  .reports-summary-metric:first-of-type {
    border-left: 0;
    padding-left: 0;
  }

  .reports-analysis-grid {
    grid-template-columns: 1fr;
  }

  .reports-matrix-table th,
  .reports-matrix-table td {
    min-width: 136px;
  }

  .reports-breakdown-pagination {
    grid-template-columns: 1fr;
  }

  .reports-breakdown-pagination .project-pagination,
  .reports-breakdown-pagination .project-page-size-form {
    justify-content: flex-start;
  }
}

@media (max-width: 991.98px) {
  .reports-filter-card,
  .reports-filter-card-all-companies {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reports-filter-actions {
    justify-content: flex-start;
  }

  .reports-ranked-row {
    grid-template-columns: 26px minmax(110px, 1fr) minmax(120px, 1.4fr) minmax(100px, auto);
  }

  .reports-ranked-share {
    display: none;
  }

  .reports-cross-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 767.98px) {
  .reports-filter-card,
  .reports-filter-card-all-companies,
  .reports-period-range,
  .reports-summary-strip,
  .reports-ranked-row {
    grid-template-columns: 1fr;
  }

  .reports-summary-metric {
    padding-left: 0;
    border-left: 0;
  }

  .reports-tabs {
    gap: 14px;
    overflow-x: auto;
  }
}

html {
  position: relative;
  min-height: 100%;
  font-size: 15px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--app-bg);
  color: var(--app-text);
  font-family: var(--font-body);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--app-primary);
  text-decoration: none;
  transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast);
}

a:hover {
  color: var(--app-primary-hover);
}

svg {
  display: block;
}

.app-layout {
  display: grid;
  grid-template-columns: var(--app-sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.app-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 18px 14px;
  background:
    radial-gradient(circle at 18% 0%, rgba(37, 99, 235, 0.16), transparent 30%),
    linear-gradient(180deg, #0b132b 0%, #071228 100%);
  border-right: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: none;
  z-index: 20;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  margin-bottom: 20px;
  padding: 0 6px;
  color: #f8fafc;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0;
}

.app-brand:hover {
  color: #ffffff;
}

.app-user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: var(--app-primary);
  color: #fff;
  font-weight: 700;
}

.app-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 33px;
  height: 33px;
  flex: 0 0 auto;
  color: #fff;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.app-brand-logo {
  width: 33px;
  height: 33px;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.26));
}

.tedakip-logo-blue {
  fill: var(--brand-primary);
}

.tedakip-logo-navy {
  fill: #020817;
  stroke: rgba(248, 250, 252, 0.14);
  stroke-width: 0.32;
}

.tedakip-logo-white-top,
.tedakip-logo-stem {
  fill: #f8fafc;
}

.tedakip-logo-teal {
  fill: var(--brand-teal);
}

.app-nav {
  display: grid;
  gap: 6px;
}

.app-nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 9px 14px;
  border-radius: 8px;
  color: rgba(226, 232, 240, 0.82);
  font-family: var(--font-display);
  font-size: 0.91rem;
  font-weight: 550;
  transition: color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
}

.app-nav-link:hover {
  background: rgba(37, 99, 235, 0.16);
  color: #ffffff;
}

.app-nav-link.is-active {
  background: var(--brand-primary);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.24);
}

.app-nav-link.is-active .app-icon {
  color: #ffffff;
}

.app-nav-link.is-disabled {
  color: rgba(148, 163, 184, 0.5);
  cursor: default;
}

.app-nav-link.is-disabled:hover {
  background: transparent;
  color: rgba(148, 163, 184, 0.5);
}

.app-icon {
  width: 19px;
  height: 19px;
  color: currentColor;
}

.app-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-nav-divider {
  height: 1px;
  margin: 18px 8px 14px;
  background: rgba(148, 163, 184, 0.16);
}

.app-user-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 12px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.app-user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: linear-gradient(145deg, var(--brand-primary), var(--brand-teal));
  color: #fff;
  font-weight: 700;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  font-size: 0.78rem;
}

.app-user-meta {
  min-width: 0;
}

.app-user-meta span,
.app-account-chip span:last-child {
  display: block;
  max-width: 150px;
  overflow: hidden;
  color: var(--app-heading);
  font-size: 0.84rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-sidebar .app-user-meta span {
  color: #f8fafc;
}

.app-user-meta button {
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(203, 213, 225, 0.72);
  font: inherit;
  font-size: 0.82rem;
}

.app-user-meta button:hover {
  color: #bfdbfe;
}

.app-main {
  display: flex;
  min-width: 0;
  min-height: 100vh;
  flex-direction: column;
}

.app-topbar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  min-height: var(--app-topbar-height);
  padding: 12px 28px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(226, 232, 240, 0.76);
  backdrop-filter: blur(12px);
  z-index: 15;
}

.app-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.app-primary-action {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  height: 34px;
  padding: 6px 13px;
  border-radius: 8px;
  font-size: 0.77rem;
  font-weight: 600;
  white-space: nowrap;
}

.app-search-form {
  position: relative;
  width: clamp(260px, 22vw, 320px);
  min-width: 0;
}

.app-search-form input {
  width: 100%;
  height: 34px;
  padding: 0 12px 0 34px;
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: 9px;
  background: var(--app-surface);
  font-size: 0.76rem;
  font-weight: 400;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

.app-search-form input::placeholder {
  color: var(--text-muted);
}

.app-search-form input:focus {
  border-color: var(--app-primary-border);
  box-shadow: 0 0 0 3px var(--interactive-focus);
}

.app-search-icon {
  position: absolute;
  top: 50%;
  left: 11px;
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  transform: translateY(-50%);
}

.app-search-icon svg,
.app-utility-control svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-utility-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  border-radius: 999px;
  background: var(--app-surface);
  cursor: default;
  transition: color var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
}

.app-utility-control:hover {
  color: var(--app-primary);
  border-color: var(--app-primary-border);
  background: var(--interactive-hover);
}

.app-utility-control svg {
  width: 16px;
  height: 16px;
}

.app-notification-menu {
  position: relative;
}

.app-notification-menu summary {
  list-style: none;
  cursor: pointer;
}

.app-notification-menu summary::-webkit-details-marker {
  display: none;
}

.app-notification-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--app-surface);
  border-radius: 999px;
  background: var(--brand-danger);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.16);
}

.app-notification-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: min(320px, calc(100vw - 32px));
  padding: 9px;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--app-surface);
  box-shadow: var(--app-shadow-md);
}

.app-notification-panel-head {
  padding: 2px 3px 8px;
  color: var(--text-heading);
  font-size: 0.78rem;
  font-weight: 650;
}

.app-notification-empty {
  margin: 0;
  padding: 12px 8px;
  color: var(--text-secondary);
  font-size: 0.76rem;
  text-align: center;
}

.app-notification-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-notification-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-secondary);
}

.app-notification-link {
  color: inherit;
  text-decoration: none;
}

.app-notification-link:hover,
.app-notification-link:focus-visible {
  border-color: var(--app-border);
  background: var(--interactive-hover);
}

.app-notification-item span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--app-warning-text);
  border-radius: 999px;
  background: var(--app-warning-bg);
}

.app-notification-item svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-notification-item p {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.32;
}

.app-account-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 36px;
  padding: 3px 10px 3px 3px;
  background: var(--app-surface);
  border: 1px solid var(--border-default);
  border-radius: 999px;
}

.app-account-chip .app-user-avatar {
  width: 28px;
  height: 28px;
}

.app-content {
  width: 100%;
  min-width: 0;
  padding: 24px 32px 32px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.page-header h1 {
  margin: 0;
  color: var(--app-heading);
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: 0;
}

.page-header p {
  margin: 4px 0 0;
  color: var(--app-muted);
}

.panel,
.summary-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-md);
  box-shadow: var(--app-shadow-sm);
}

.panel {
  padding: 20px;
  margin-bottom: 16px;
}

.narrow-panel {
  max-width: 560px;
}

.panel h2,
.section-toolbar h2 {
  margin: 0 0 16px;
  color: var(--app-heading);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 650;
}

.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-toolbar h2 {
  margin-bottom: 0;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: start;
  gap: 16px;
}

.form-validation-summary {
  grid-column: 1 / -1;
}

.invoice-form {
  max-width: 920px;
}

.invoice-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 16px;
}

.amount-grid {
  max-width: 760px;
}

.form-label {
  color: var(--app-muted-strong);
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 500;
}

.form-control,
.form-select {
  min-height: 34px;
  box-sizing: border-box;
  color: var(--app-text);
  border-color: var(--app-border-strong);
  border-radius: 8px;
  background-color: var(--app-surface);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.25;
  box-shadow: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

.form-control::placeholder {
  color: #98a2b3;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: var(--app-primary-border);
  box-shadow: 0 0 0 4px var(--interactive-focus);
}

.readonly-amount {
  background-color: var(--interactive-hover);
  color: var(--app-heading);
  border-color: var(--app-primary-border);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.derived-period-display {
  background-color: var(--app-surface-subtle);
  color: var(--app-heading);
  border-color: var(--app-border);
  cursor: default;
  user-select: none;
}

.form-field {
  min-width: 0;
}

.year-field {
  max-width: 180px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  box-sizing: border-box;
  padding: 6px 13px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: none;
  transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-sm {
  min-height: 28px;
  padding: 4px 9px;
  font-size: 0.74rem;
}

.btn-primary {
  background-color: var(--app-primary);
  border-color: var(--app-primary);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--app-primary-hover);
  border-color: var(--app-primary-hover);
}

.auth-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 12%, rgba(37, 99, 235, 0.05), transparent 34%),
    var(--surface-canvas);
}

.auth-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px 20px;
}

.auth-shell {
  width: min(100%, 920px);
}

.auth-card {
  display: grid;
  grid-template-columns: minmax(280px, 0.4fr) minmax(0, 0.6fr);
  overflow: hidden;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 16px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.12);
}

.auth-brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 78px;
  min-height: 430px;
  padding: 40px 34px;
  overflow: hidden;
  color: #f8fafc;
  background: #0b132b;
}

.auth-brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.055) 0 1px, transparent 1px 92px),
    radial-gradient(circle at 20% 8%, rgba(37, 99, 235, 0.2), transparent 32%),
    radial-gradient(circle at 92% 96%, rgba(20, 184, 166, 0.13), transparent 34%);
  background-size: auto, auto, auto;
  pointer-events: none;
}

.auth-brand-lockup,
.auth-brand-message,
.auth-brand-accent {
  position: relative;
  z-index: 1;
}

.auth-brand-lockup {
  display: flex;
  align-items: center;
  gap: 13px;
}

.auth-brand-mark {
  width: 46px;
  height: 46px;
}

.auth-brand-mark .app-brand-logo {
  width: 46px;
  height: 46px;
}

.auth-wordmark {
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
}

.auth-brand-message {
  display: grid;
  gap: 18px;
}

.auth-brand-message p {
  max-width: 270px;
  margin: 0;
  color: rgba(226, 232, 240, 0.9);
  font-family: var(--font-display);
  font-size: 1.38rem;
  font-weight: 600;
  line-height: 1.35;
}

.auth-brand-accent {
  display: block;
  width: 112px;
  height: 1px;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.95), rgba(20, 184, 166, 0.78), transparent);
}

.auth-form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 54px;
  background: var(--surface-primary);
}

.auth-form-header {
  margin-bottom: 26px;
}

.auth-form-header h1 {
  margin: 0;
  color: var(--brand-navy);
  font-family: var(--font-display);
  font-size: 1.48rem;
  font-weight: 650;
  line-height: 1.25;
}

.auth-form-header p {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.auth-form {
  display: grid;
  gap: 17px;
}

.auth-field {
  display: grid;
  gap: 6px;
}

.auth-field .form-label {
  margin: 0;
}

.auth-field .form-control {
  min-height: 40px;
  padding: 8px 11px;
  font-size: 0.88rem;
}

.auth-validation-summary {
  margin-bottom: 0;
  font-size: 0.82rem;
}

.auth-validation-summary ul {
  margin-bottom: 0;
  padding-left: 1.1rem;
}

.auth-remember {
  min-height: 24px;
  margin: 1px 0 0;
  color: var(--app-muted-strong);
  font-size: 0.82rem;
}

.auth-submit {
  width: 100%;
  min-height: 42px;
  margin-top: 5px;
  font-size: 0.88rem;
}

.btn-outline-primary {
  color: var(--app-primary);
  border-color: var(--app-primary-border);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-check:checked + .btn-outline-primary {
  color: var(--app-primary);
  background: var(--app-primary-soft);
  border-color: var(--app-primary-border);
}

.btn-outline-secondary {
  color: var(--app-muted-strong);
  border-color: var(--app-border-strong);
}

.btn-outline-secondary:hover {
  color: var(--app-heading);
  background: var(--app-surface-subtle);
  border-color: var(--app-border-strong);
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus {
  box-shadow: 0 0 0 4px var(--interactive-focus);
}

.data-table {
  margin-bottom: 0;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.8rem;
}

.table > :not(caption) > * > * {
  padding: 11px 14px;
  border-bottom-color: var(--app-border);
}

.data-table thead th {
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  background: var(--app-surface-subtle);
  border-bottom-color: var(--app-border);
}

.sortable-header-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: inherit;
  text-decoration: none;
  vertical-align: middle;
}

.sortable-header-link-end {
  justify-content: flex-end;
}

.sortable-header-link:hover,
.sortable-header-link:focus {
  color: var(--brand-blue);
  text-decoration: none;
}

.sortable-header-link.is-active {
  color: var(--brand-blue);
}

.sortable-chevrons {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  width: 8px;
  flex: 0 0 8px;
}

.sortable-chevron {
  width: 0;
  height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  opacity: 0.38;
}

.sortable-chevron-up {
  border-bottom: 4px solid currentColor;
}

.sortable-chevron-down {
  border-top: 4px solid currentColor;
}

.sortable-chevron.is-active {
  opacity: 1;
}

.data-table tbody tr:hover {
  background: #f8fbff;
}

.data-table tfoot th {
  background: var(--app-surface-subtle);
}

.ui-page-title {
  color: var(--text-heading);
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
}

.ui-section-title {
  color: var(--text-heading);
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.25;
}

.ui-entity-name {
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.25;
}

.ui-money {
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ui-list-money {
  color: #475569;
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ui-list-money-muted {
  color: var(--text-secondary);
  font-weight: 450;
}

.ui-list-money-strong {
  color: var(--brand-navy);
  font-weight: 600;
}

.ui-body-value {
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.25;
}

.data-table .ui-body-value,
.reports-matrix-table .ui-body-value {
  color: var(--text-secondary);
}

.ui-meta {
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 400;
}

.ui-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 3px 8px;
  color: var(--text-primary);
  border: 1px solid var(--app-primary-border);
  border-radius: 999px;
  background: var(--app-primary-soft);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.1;
}

.ui-filter-chip span {
  color: var(--app-primary);
  font-size: 0.78rem;
  line-height: 1;
}

.ui-filter-chip:hover,
.ui-filter-chip:focus {
  color: var(--app-primary);
  border-color: var(--app-primary-border);
  background: var(--app-primary-soft);
}

.ui-filter-clear {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  color: var(--app-primary);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.1;
}

.ui-filter-clear:hover,
.ui-filter-clear:focus {
  color: var(--app-primary-hover);
  text-decoration: underline;
}

.invoice-list-header h1,
.suppliers-list-header h1,
.projects-list-header h1,
.reports-page-header h1,
.supplier-detail-header h1,
.project-detail-header h1 {
  color: var(--text-heading);
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
}

.invoice-list-header p,
.suppliers-list-header p,
.projects-list-header p,
.reports-page-header p,
.supplier-detail-header p,
.project-detail-header p {
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 400;
}

.actions-column {
  width: 260px;
}

.actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inline-action {
  display: inline;
}

.status-badge,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
}

.status-active {
  background: var(--app-success-bg);
  color: var(--app-success-text);
}

.status-inactive {
  background: var(--app-muted-bg);
  color: var(--app-muted-text);
}

.status-voided {
  background: var(--app-danger-bg);
  color: var(--app-danger-text);
}

.alert {
  border-radius: var(--app-radius-md);
  border-width: 1px;
  box-shadow: var(--app-shadow-sm);
}

.alert-success {
  color: var(--app-success-text);
  background: var(--app-success-bg);
  border-color: rgba(34, 197, 94, 0.28);
}

.alert-danger {
  color: var(--app-danger-text);
  background: var(--app-danger-bg);
  border-color: rgba(239, 68, 68, 0.28);
}

.report-header {
  align-items: center;
}

.report-selector-panel {
  padding: 16px 20px;
}

.report-period-form {
  display: grid;
  grid-template-columns: minmax(260px, 420px) auto;
  align-items: end;
  gap: 16px;
}

.report-period-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 16px;
}

.report-period-title h2 {
  display: inline-block;
  margin: 0 12px 0 0;
  color: var(--app-heading);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 650;
}

.header-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.supplier-summary-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dashboard-summary-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.summary-card {
  padding: 16px;
}

.summary-card span {
  display: block;
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.summary-card strong {
  display: block;
  color: var(--app-heading);
  font-size: 1.25rem;
  font-weight: 650;
  line-height: 1.25;
}

.comparison-layout {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  gap: 16px;
}

.comparison-status {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-md);
  padding: 16px;
}

.comparison-status span,
.comparison-periods span {
  display: block;
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.comparison-status strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 650;
  line-height: 1.2;
}

.comparison-positive {
  background: var(--app-success-bg);
  color: var(--app-success-text);
}

.comparison-negative {
  background: var(--app-danger-bg);
  color: var(--app-danger-text);
}

.comparison-neutral {
  background: var(--app-muted-bg);
  color: var(--app-muted-text);
}

.comparison-periods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.comparison-periods div {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-md);
  padding: 16px;
}

.comparison-periods strong,
.comparison-periods small {
  display: block;
}

.annual-year-form {
  display: grid;
  grid-template-columns: auto minmax(110px, 140px) auto;
  align-items: end;
  gap: 8px;
}

.dashboard-filter-form {
  display: grid;
  grid-template-columns: minmax(260px, 420px) auto;
  align-items: end;
  gap: 16px;
}

.dashboard-project-form {
  display: grid;
  grid-template-columns: auto minmax(220px, 320px) auto;
  align-items: end;
  gap: 8px;
}

.empty-state {
  border: 1px dashed var(--app-border-strong);
  border-radius: var(--app-radius-md);
  color: var(--app-muted);
  padding: 24px;
  text-align: center;
  background: var(--app-surface-subtle);
}

.empty-state p {
  margin-bottom: 0;
}

.system-state-page {
  display: grid;
  justify-items: center;
  padding: clamp(28px, 6vh, 56px) 0;
}

.system-state-card {
  display: grid;
  justify-items: start;
  gap: 16px;
  width: min(100%, 520px);
  padding: 24px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-md);
  background: var(--app-surface);
  box-shadow: var(--app-shadow-sm);
}

.system-state-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--app-primary-border);
  border-radius: 10px;
  color: var(--app-primary);
  background: var(--app-primary-soft);
}

.system-state-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.system-state-icon-error {
  color: var(--app-danger-text);
  border-color: rgba(239, 68, 68, 0.22);
  background: var(--app-danger-bg);
}

.system-state-copy {
  display: grid;
  gap: 7px;
}

.system-state-copy h1 {
  margin: 0;
  color: var(--text-heading);
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
}

.system-state-copy p {
  max-width: 44rem;
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.55;
}

.system-state-reference {
  width: 100%;
  margin: 2px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--app-border);
  color: var(--text-secondary);
  font-size: 0.74rem;
  line-height: 1.45;
}

.system-state-reference code {
  color: var(--app-heading);
  font-size: 0.72rem;
}

.lifecycle-note {
  color: var(--app-muted);
  font-size: 0.76rem;
  line-height: 1.35;
  margin: 8px 0 0;
}

.prerequisite-alert p {
  margin-bottom: 6px;
}

.prerequisite-alert a {
  display: inline-block;
  margin: 0 16px 6px 0;
}

.detail-list {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 12px 20px;
  margin: 0;
}

.detail-list dt {
  color: var(--app-muted);
  font-weight: 600;
}

.detail-list dd {
  margin: 0;
}

.invoice-detail-page {
  display: grid;
  gap: 14px;
}

.invoice-detail-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--app-muted);
  font-size: 0.9rem;
}

.invoice-detail-breadcrumb a {
  color: var(--app-muted-strong);
  text-decoration: none;
}

.invoice-detail-breadcrumb a:hover,
.invoice-detail-breadcrumb a:focus {
  color: var(--app-primary);
}

.invoice-detail-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 0;
  padding: 16px 18px;
}

.invoice-detail-summary.is-voided {
  border-color: rgba(239, 68, 68, 0.26);
  box-shadow: inset 3px 0 0 rgba(239, 68, 68, 0.58), var(--app-shadow-sm);
}

.invoice-detail-summary-main {
  min-width: 0;
}

.invoice-detail-eyebrow,
.invoice-detail-summary-total span,
.invoice-detail-document-meta span {
  display: block;
  color: var(--app-muted);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.invoice-detail-summary h1 {
  margin: 2px 0 6px;
  color: var(--app-heading);
  font-family: var(--font-display);
  font-size: 1.42rem;
  font-weight: 650;
  line-height: 1.2;
}

.invoice-detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  color: var(--app-muted-strong);
  font-size: 0.86rem;
}

.invoice-detail-summary-total {
  min-width: 150px;
  text-align: right;
}

.invoice-detail-summary-total strong {
  display: block;
  margin-top: 2px;
  color: var(--app-heading);
  font-size: 1.18rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.invoice-detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.invoice-detail-layout {
  display: grid;
  gap: 16px;
  align-items: start;
}

.invoice-detail-layout.has-document {
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
}

.invoice-detail-layout.no-document {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
}

.invoice-detail-layout.provider-invoice-detail-layout.is-pdf-preview-open {
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
}

.provider-invoice-workbench {
  display: grid;
  min-width: 0;
  gap: 16px;
}

.invoice-info-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 0;
  padding: 16px;
}

.invoice-info-section {
  display: grid;
  gap: 9px;
}

.invoice-info-section + .invoice-info-section {
  padding-top: 12px;
  border-top: 1px solid var(--app-border);
}

.invoice-info-section h2 {
  margin: 0;
  color: var(--app-heading);
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.25;
}

.invoice-voided-state-block {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) minmax(150px, 0.65fr);
  gap: 10px 12px;
  align-items: start;
  padding: 11px 12px;
  border: 1px solid rgba(239, 68, 68, 0.24);
  border-left-width: 3px;
  border-radius: var(--app-radius-sm);
  background: var(--app-danger-bg);
}

.invoice-voided-state-icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--app-danger-text);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 7px;
  background: #fff;
}

.invoice-voided-state-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.invoice-voided-state-label {
  display: block;
  margin-bottom: 3px;
  color: var(--app-danger-text);
  font-size: 0.7rem;
  font-weight: 600;
}

.invoice-voided-state-block h3 {
  margin: 0 0 5px;
  color: var(--app-danger-text);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.25;
}

.invoice-voided-state-block strong,
.invoice-voided-state-block p {
  margin: 0;
  color: var(--app-heading);
  font-size: 0.8rem;
  line-height: 1.35;
}

.invoice-voided-state-block strong {
  font-family: var(--font-display);
  font-weight: 650;
}

.invoice-readonly-list {
  display: grid;
  grid-template-columns: minmax(150px, 180px) minmax(0, 520px);
  gap: 7px 14px;
  justify-content: start;
  margin: 0;
}

.invoice-readonly-list dt,
.invoice-amount-list dt {
  color: var(--app-muted);
  font-size: 0.76rem;
  font-weight: 500;
}

.invoice-readonly-list dd,
.invoice-amount-list dd {
  margin: 0;
  min-width: 0;
  color: var(--app-text);
  font-size: 0.82rem;
  font-weight: 450;
}

.invoice-amount-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.invoice-amount-list > div {
  padding: 10px 11px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface-subtle);
}

.invoice-amount-list dd {
  margin-top: 4px;
  font-weight: 560;
  font-variant-numeric: tabular-nums;
}

.invoice-amount-list .is-total dd {
  color: var(--app-heading);
  font-weight: 650;
}

.invoice-detail-document-panel {
  min-width: 0;
  margin-bottom: 0;
  padding: 14px;
}

.invoice-detail-layout.has-document .invoice-detail-document-panel {
  position: sticky;
  top: calc(var(--app-topbar-height) + 16px);
}

.invoice-detail-document-toolbar {
  margin-bottom: 8px;
}

.invoice-detail-document-toolbar.is-empty {
  display: block;
}

.invoice-detail-document-toolbar.is-empty .invoice-pdf-file {
  display: grid;
  gap: 3px;
}

.invoice-detail-document-toolbar.is-empty .invoice-pdf-file strong {
  white-space: normal;
}

.invoice-detail-document-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--app-muted-strong);
  font-size: 0.78rem;
}

.invoice-detail-document-meta strong {
  color: var(--app-text);
  font-weight: 560;
}

.invoice-detail-pdf-preview {
  height: min(840px, calc(100dvh - var(--app-topbar-height) - 190px));
  min-height: 550px;
}

.invoice-detail-empty-document {
  display: grid;
  gap: 12px;
}

.invoice-detail-empty-document-note {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: #fbfcff;
}

.invoice-detail-empty-document-note p {
  margin: 0;
  color: var(--app-muted-strong);
  font-size: 0.8rem;
  line-height: 1.35;
}

.invoice-detail-empty-document-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #4f6b9a;
  border: 1px solid #e4e9f3;
  border-radius: 8px;
  background: #f3f6fb;
}

.invoice-detail-empty-document-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-height: 820px) and (min-width: 992px) {
  .invoice-detail-page {
    gap: 12px;
  }

  .invoice-detail-summary {
    padding: 14px 16px;
  }

  .invoice-info-panel,
  .invoice-detail-document-panel {
    padding: 14px;
  }

  .invoice-info-panel {
    gap: 12px;
  }

  .invoice-info-section + .invoice-info-section {
    padding-top: 10px;
  }

  .invoice-readonly-list {
    gap: 7px 12px;
  }

  .invoice-amount-list > div {
    padding: 10px;
  }

  .invoice-detail-pdf-preview {
    height: calc(100dvh - var(--app-topbar-height) - 172px);
    min-height: 455px;
  }
}

@media (max-width: 1199.98px) and (min-width: 992px) {
  .invoice-detail-layout.has-document {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  }

  .invoice-detail-layout.no-document {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  }

  .invoice-detail-summary {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .invoice-detail-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

.invoice-create-header {
  margin-bottom: 14px;
}

.invoice-create-layout {
  display: grid;
  gap: 16px;
  align-items: start;
}

.invoice-create-layout.is-manual {
  grid-template-columns: minmax(0, 2fr) minmax(300px, 0.95fr);
}

.invoice-create-layout.has-pdf {
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
}

.invoice-edit-has-document {
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
}

.invoice-entry-panel,
.invoice-document-panel {
  min-width: 0;
}

.invoice-entry-panel {
  padding: 16px;
  border-radius: 12px;
}

.invoice-form {
  display: grid;
  gap: 14px;
}

.invoice-form-section {
  display: grid;
  gap: 9px;
}

.invoice-form-section h2,
.invoice-document-head h2 {
  margin: 0;
  color: var(--app-heading);
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.25;
}

.invoice-form .form-label {
  margin-bottom: 4px;
  color: var(--app-muted-strong);
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.25;
}

.invoice-form .form-text {
  margin-top: 5px;
  color: var(--app-muted);
  font-size: 0.72rem;
  line-height: 1.3;
}

.invoice-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.invoice-main-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(180px, 0.8fr);
}

.invoice-field-wide {
  grid-column: span 2;
}

.invoice-company-match-row { display: flex; align-items: center; gap: 7px; min-width: 0; }
.invoice-company-match-value { flex: 1; min-width: 0; }
.invoice-company-match-value[data-company-match-status="Mismatched"] { color: var(--app-danger-text); border-color: var(--app-danger-text); background: var(--app-danger-bg); }
.invoice-company-match-inline { font-size: .72rem; line-height: 1.3; }
.invoice-company-match-inline.is-mismatched { color: var(--app-danger-text); }
.invoice-company-match-help { position: relative; display: inline-flex; flex: 0 0 auto; align-items: center; }
.invoice-company-match-info { width: 20px; height: 20px; padding: 0; border: 1px solid currentColor; border-radius: 50%; background: transparent; color: var(--app-muted-strong); font-size: .72rem; font-weight: 700; line-height: 18px; text-align: center; cursor: help; }
.invoice-company-match-help.is-mismatched .invoice-company-match-info { color: var(--app-danger-text); }
.invoice-company-match-info:focus-visible { outline: 2px solid var(--app-primary); outline-offset: 2px; }
.invoice-company-match-tooltip { display: none; position: absolute; z-index: 20; top: calc(100% + 6px); right: 0; width: min(290px, calc(100vw - 36px)); padding: 8px 10px; border: 1px solid var(--app-border); border-radius: 7px; background: var(--app-surface); box-shadow: 0 6px 20px rgb(0 0 0 / .13); color: var(--app-heading); font-size: .75rem; line-height: 1.4; }
.invoice-company-match-help:hover .invoice-company-match-tooltip,
.invoice-company-match-help:focus-within .invoice-company-match-tooltip { display: block; }
.invoice-company-match-help.is-tooltip-dismissed .invoice-company-match-tooltip { display: none; }
.invoice-entity-label-row { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; min-height: 20px; }
.invoice-create-layout .invoice-entity-label-row .form-label { margin-bottom: 0; }
.invoice-supplier-name-help { vertical-align: middle; }
.invoice-supplier-name-help .invoice-company-match-info { position: relative; width: 14px; height: 14px; font-size: 10px; line-height: 12px; color: var(--app-warning-text); }
.invoice-supplier-name-help .invoice-company-match-info::after { content: ""; position: absolute; inset: -9px; }
.invoice-supplier-name-help .invoice-company-match-tooltip { left: 0; right: auto; overflow-wrap: anywhere; }
[data-supplier-document-help][hidden], #invoiceSupplierFieldError[hidden] { display: none !important; }
#invoiceSupplierFieldError:not([hidden]) { display: block; }

.amount-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.invoice-create-layout.has-batch .amount-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.project-grid {
  grid-template-columns: minmax(220px, 0.5fr);
}

.invoice-create-actions {
  padding-top: 0;
}

.invoice-create-layout.has-pdf .invoice-document-panel {
  position: sticky;
  top: calc(var(--app-topbar-height) + 16px);
}

.invoice-edit-has-document .invoice-document-panel {
  position: sticky;
  top: calc(var(--app-topbar-height) + 16px);
}

.invoice-document-panel {
  padding: 14px;
  border-radius: 12px;
}

.invoice-document-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.invoice-document-head p {
  margin: 3px 0 0;
  color: var(--app-muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.invoice-document-empty {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  padding: 13px;
  margin-bottom: 10px;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: #fbfcff;
}

.invoice-document-empty h3 {
  margin: 0 0 4px;
  color: var(--app-heading);
  font-size: 0.9rem;
  font-weight: 600;
}

.invoice-document-empty p {
  margin: 0;
  color: var(--app-muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.invoice-document-empty-icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #4f6b9a;
  border: 1px solid #e4e9f3;
  border-radius: var(--app-radius-sm);
  background: #f3f6fb;
}

.invoice-document-empty-icon svg,
.invoice-pdf-actions svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.invoice-document-upload {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.invoice-create-layout.has-pdf .invoice-document-upload {
  margin-bottom: 8px;
}

.invoice-document-upload.is-compact {
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.invoice-document-upload.is-historical .invoice-file-picker {
  border-style: solid;
  border-color: var(--app-border);
  background: var(--app-surface);
}

.invoice-document-upload.is-historical .invoice-file-picker-icon {
  color: var(--app-muted-strong);
  border-color: var(--app-border);
  background: var(--app-surface-subtle);
}

.invoice-upload-control {
  min-width: 0;
}

.invoice-file-picker-shell {
  position: relative;
  display: flex;
  min-width: 0;
}

.invoice-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.invoice-file-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 7px 10px;
  color: var(--app-text);
  border: 1px dashed var(--app-border-strong);
  border-radius: 10px;
  background: var(--app-surface-subtle);
  cursor: pointer;
}

.invoice-file-picker:hover {
  border-color: var(--app-primary-border);
  background: #f8faff;
}

.invoice-upload-control:focus-within .invoice-file-picker {
  border-color: var(--app-primary-border);
  box-shadow: 0 0 0 4px var(--interactive-focus);
}

.invoice-document-upload:not(.is-compact) .invoice-file-picker {
  min-height: 58px;
  padding: 9px 42px 9px 11px;
  border-color: #b7c7ff;
  background: #f6f9ff;
}

.invoice-document-upload:not(.is-compact) .invoice-file-picker:hover,
.invoice-document-upload:not(.is-compact).is-file-selected .invoice-file-picker {
  border-color: #9db4ff;
  background: #f1f6ff;
}

.invoice-document-upload:not(.is-compact) .invoice-file-picker-icon {
  width: 36px;
  height: 36px;
  color: var(--app-primary);
  border-color: #b7c7ff;
  background: #eaf1ff;
}

.invoice-document-upload:not(.is-compact) .invoice-file-picker-icon svg {
  width: 19px;
  height: 19px;
  stroke-width: 2;
}

.invoice-document-upload:not(.is-compact) .invoice-file-picker-title {
  font-size: 0.86rem;
  font-weight: 650;
}

.invoice-document-upload:not(.is-compact) .invoice-file-picker-name {
  margin-top: 2px;
  color: var(--app-muted-strong);
  font-size: 0.76rem;
}

.invoice-document-upload:not(.is-compact).is-file-selected .invoice-file-picker-name {
  color: var(--app-heading);
  font-weight: 560;
}

.invoice-file-clear {
  position: absolute;
  top: 50%;
  right: 8px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  color: var(--app-muted-strong);
  border: 1px solid var(--app-border-strong);
  border-radius: 999px;
  background: var(--app-surface);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1;
  transform: translateY(-50%);
}

.invoice-file-clear:hover,
.invoice-file-clear:focus {
  color: var(--app-heading);
  border-color: var(--app-primary-border);
  background: var(--app-primary-soft);
}

.invoice-document-upload.is-compact .invoice-file-clear {
  display: none;
}

.invoice-file-picker-icon,
.invoice-pdf-file-icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  color: var(--app-primary);
  border: 1px solid var(--app-primary-border);
  border-radius: 7px;
  background: var(--app-primary-soft);
}

.invoice-file-picker-icon svg,
.invoice-pdf-file-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.invoice-file-picker-title,
.invoice-file-picker-name {
  display: block;
  min-width: 0;
}

.invoice-file-picker-title {
  color: var(--app-heading);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.25;
}

.invoice-file-picker-name {
  overflow: hidden;
  color: var(--app-muted);
  font-size: 0.74rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invoice-document-upload .form-text {
  margin-top: 5px;
  color: var(--app-muted);
  font-size: 0.72rem;
  line-height: 1.25;
}

.invoice-document-upload.is-compact .invoice-file-picker {
  min-height: 34px;
  padding: 4px 8px;
  border-style: solid;
  border-radius: 8px;
}

.invoice-document-upload.is-compact .invoice-file-picker-icon {
  width: 24px;
  height: 24px;
}

.invoice-document-upload.is-compact .invoice-file-picker-icon svg {
  width: 14px;
  height: 14px;
}

.invoice-document-upload.is-compact .form-text {
  display: none;
}

.invoice-pdf-workspace {
  display: grid;
  gap: 8px;
}

.invoice-pdf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface-subtle);
}

.invoice-pdf-file {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 9px;
}

.invoice-pdf-file-meta {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.invoice-pdf-file strong {
  overflow: hidden;
  color: var(--app-heading);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invoice-pdf-file span {
  color: var(--app-muted);
  font-size: 0.74rem;
  line-height: 1.25;
}

.invoice-pdf-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.invoice-pdf-actions .inline-action {
  margin: 0;
}

.document-detail-list {
  grid-template-columns: minmax(120px, 150px) 1fr;
  margin-bottom: 16px;
}

.document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.invoice-pdf-preview {
  width: 100%;
  height: min(860px, calc(100dvh - var(--app-topbar-height) - 136px));
  min-height: 540px;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-muted-bg);
}

.invoice-document-panel > .alert {
  margin-bottom: 8px;
  border-radius: 8px;
  font-size: 0.76rem;
  line-height: 1.25;
  padding: 7px 10px;
}

.invoice-document-panel > .alert-success {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  color: var(--app-success-text);
  border-color: #bfe8cc;
  background: var(--app-success-bg);
}

.invoice-void-panel {
  max-width: 960px;
}

.invoice-void-warning {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  padding: 9px 11px;
  color: var(--app-warning-text);
  border: 1px solid rgba(245, 158, 11, 0.34);
  border-radius: var(--app-radius-sm);
  background: var(--app-warning-bg);
  font-size: 0.8rem;
  line-height: 1.35;
}

.invoice-void-warning-icon {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: var(--app-warning-text);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 7px;
  background: #fff;
}

.invoice-void-warning-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.invoice-void-summary {
  margin-bottom: 14px;
  padding: 13px 14px;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface-subtle);
}

.invoice-void-summary-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--app-border);
}

.invoice-void-summary-head span {
  color: var(--app-muted);
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: uppercase;
}

.invoice-void-summary-head strong {
  color: var(--app-heading);
  font-family: var(--font-body);
  font-size: 0.94rem;
  font-weight: 650;
}

.invoice-void-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 14px;
  margin: 0;
}

.invoice-void-summary-grid div {
  min-width: 0;
}

.invoice-void-summary-grid dt {
  margin-bottom: 3px;
  color: var(--app-muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.invoice-void-summary-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--app-heading);
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 560;
  line-height: 1.3;
}

.invoice-void-form {
  max-width: 720px;
}

.invoice-void-form textarea {
  min-height: 112px;
}

@media (max-height: 820px) and (min-width: 992px) {
  .invoice-create-header {
    margin-bottom: 12px;
  }

  .invoice-entry-panel,
  .invoice-document-panel {
    padding: 14px;
  }

  .invoice-form,
  .invoice-form-section {
    gap: 10px;
  }

  .invoice-form-grid {
    gap: 10px;
  }

  .invoice-create-layout.has-pdf {
    gap: 14px;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  }

  .invoice-edit-has-document {
    gap: 14px;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  }

  .invoice-create-layout.has-pdf .form-label {
    margin-bottom: 4px;
  }

  .invoice-create-layout.has-pdf .form-control,
  .invoice-create-layout.has-pdf .form-select,
  .invoice-create-layout.has-pdf .readonly-amount {
    min-height: 34px;
  }

  .invoice-create-layout.has-pdf .lifecycle-note,
  .invoice-create-layout.has-pdf .form-text {
    font-size: 0.72rem;
  }

  .invoice-pdf-toolbar {
    padding: 8px 10px;
  }

  .invoice-pdf-preview {
    height: calc(100dvh - var(--app-topbar-height) - 124px);
    min-height: 500px;
  }
}

@media (max-width: 1199.98px) and (min-width: 992px) {
  .invoice-create-layout.is-manual {
    grid-template-columns: minmax(0, 1.85fr) minmax(280px, 0.9fr);
  }

  .invoice-create-layout.has-pdf {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  }

  .invoice-edit-has-document {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  }

  .invoice-pdf-preview {
    min-height: 500px;
  }
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.footer {
  width: 100%;
  margin-top: auto;
  padding: 0 28px 20px;
  color: var(--app-muted);
  font-size: 0.86rem;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.app-main:has(.dashboard-page) .footer {
  display: none;
}

.app-layout:has(.dashboard-page) {
  --app-topbar-height: 64px;
}

.app-content:has(.dashboard-page) {
  box-sizing: border-box;
  min-height: 0;
  height: calc(100dvh - var(--app-topbar-height));
  padding: 0 28px 14px;
}

.dashboard-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 50px 112px minmax(238px, 1.18fr) minmax(184px, 0.82fr) 88px;
  grid-template-areas:
    "hero period"
    "kpis kpis"
    "main main"
    "analysis analysis"
    "pro pro";
  gap: 13px;
  height: 100%;
  min-height: 0;
}

.dashboard-hero {
  grid-area: hero;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 0;
}

.dashboard-hero h1 {
  margin: 0;
  color: var(--text-heading);
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
}

.dashboard-hero p,
.dashboard-card-header p,
.dashboard-empty-compact p,
.dashboard-pro-copy p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 400;
}

.dashboard-period-strip {
  grid-area: period;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.dashboard-period-form {
  display: grid;
  grid-template-columns: auto minmax(210px, 280px);
  align-items: center;
  gap: 8px;
}

.dashboard-period-form .form-label {
  margin-bottom: 0;
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 500;
}

.dashboard-period-form .form-select {
  min-height: 34px;
  border-radius: 8px;
  font-size: 0.77rem;
}

.dashboard-new-invoice-action {
  align-self: center;
  box-sizing: border-box;
  min-height: 34px;
  height: 34px;
  max-height: 34px;
  padding-block: 0;
  line-height: 1;
}

.dashboard-kpi-grid {
  grid-area: kpis;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  min-height: 0;
}

.dashboard-kpi-card,
.dashboard-chart-card,
.dashboard-list-card,
.dashboard-ranking-card,
.dashboard-distribution-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 12px;
  box-shadow: var(--app-shadow-sm);
}

.dashboard-kpi-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 0;
  padding: 14px 18px;
}

.dashboard-kpi-card > div:last-child > span:first-child {
  display: block;
  margin-bottom: 4px;
  color: #475569;
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.18;
}

.dashboard-kpi-card strong {
  display: block;
  color: var(--text-heading);
  font-family: var(--font-body);
  font-size: 1.34rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  letter-spacing: 0;
}

.dashboard-kpi-comparison {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.66rem;
  font-weight: 500;
  line-height: 1.1;
}

.dashboard-kpi-comparison span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin: 0;
  border-radius: 999px;
  font-size: 0.62rem;
}

.dashboard-kpi-comparison.is-positive {
  color: var(--app-success-text);
}

.dashboard-kpi-comparison.is-positive span {
  background: var(--app-success-bg);
}

.dashboard-kpi-comparison.is-negative {
  color: var(--app-danger-text);
}

.dashboard-kpi-comparison.is-negative span {
  background: var(--app-danger-bg);
}

.dashboard-kpi-comparison.is-neutral span {
  background: #eef1f6;
}

.dashboard-kpi-icon,
.dashboard-empty-icon,
.dashboard-pro-mark,
.dashboard-invoice-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.dashboard-kpi-icon {
  width: 40px;
  height: 40px;
  border: 1px solid transparent;
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.dashboard-kpi-icon svg,
.dashboard-empty-icon svg,
.dashboard-pro-mark svg,
.dashboard-invoice-icon svg,
.dashboard-pro-features svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-kpi-icon-blue {
  color: var(--app-primary);
  background: rgba(37, 99, 235, 0.09);
  border-color: rgba(37, 99, 235, 0.16);
}

.dashboard-kpi-icon-green {
  color: var(--app-success-text);
  background: rgba(34, 197, 94, 0.09);
  border-color: rgba(34, 197, 94, 0.16);
}

.dashboard-kpi-icon-violet {
  color: var(--brand-teal);
  background: rgba(20, 184, 166, 0.1);
  border-color: rgba(20, 184, 166, 0.18);
}

.dashboard-kpi-icon-amber {
  color: var(--app-orange);
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.18);
}

.dashboard-main-grid {
  grid-area: main;
  display: grid;
  grid-template-columns: minmax(0, 1.54fr) minmax(350px, 0.96fr);
  gap: 14px;
  min-height: 0;
}

.dashboard-analysis-grid {
  grid-area: analysis;
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(0, 1.04fr);
  gap: 14px;
  min-height: 0;
}

.dashboard-chart-card,
.dashboard-list-card,
.dashboard-ranking-card,
.dashboard-distribution-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  margin-bottom: 0;
  padding: 16px 18px;
}

.dashboard-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.dashboard-card-header h2 {
  margin: 0;
  color: var(--text-heading);
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
}

.dashboard-card-header h2 span {
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 400;
}

.dashboard-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 4px 9px;
  color: var(--app-primary);
  border: 1px solid var(--app-primary-border);
  border-radius: 8px;
  background: #f8fbff;
  font-size: 0.69rem;
  font-weight: 500;
  white-space: nowrap;
}

.dashboard-card-link:hover,
.dashboard-card-link:focus {
  color: var(--app-primary-hover);
  background: var(--app-primary-soft);
}

.dashboard-year-form {
  width: 92px;
}

.dashboard-year-form .form-select {
  min-height: 30px;
  padding-top: 3px;
  padding-bottom: 3px;
  border-radius: 8px;
  font-size: 0.76rem;
}

.dashboard-chart-wrap {
  position: relative;
  min-height: 0;
}

.dashboard-line-chart {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: visible;
}

.dashboard-chart-grid {
  stroke: #e2e8f0;
  stroke-dasharray: 3 4;
  stroke-width: 1;
}

.dashboard-chart-axis {
  fill: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
}

.dashboard-chart-area {
  fill: url("#dashboardChartGradient");
}

.dashboard-chart-line {
  fill: none;
  stroke: var(--chart-primary);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.dashboard-chart-point {
  fill: var(--app-surface);
  stroke: var(--chart-primary);
  stroke-width: 2.2;
}

.dashboard-chart-point:focus {
  outline: none;
  stroke-width: 3;
}

.dashboard-chart-tooltip {
  position: absolute;
  z-index: 4;
  min-width: 118px;
  padding: 7px 9px;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: var(--app-surface);
  box-shadow: var(--app-shadow-sm);
  pointer-events: none;
  transform: translate(-50%, -100%);
}

.dashboard-chart-tooltip span,
.dashboard-chart-tooltip strong {
  display: block;
  white-space: nowrap;
}

.dashboard-chart-tooltip span {
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 400;
}

.dashboard-chart-tooltip strong {
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 600;
}

.dashboard-empty-compact {
  display: grid;
  min-height: 0;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 14px;
  color: var(--app-muted);
  text-align: center;
  background: var(--app-surface-subtle);
  border: 1px dashed var(--app-border-strong);
  border-radius: var(--app-radius-md);
}

.dashboard-empty-icon {
  width: 36px;
  height: 36px;
  color: var(--app-muted-strong);
  background: var(--app-muted-bg);
  border-radius: 12px;
}

.dashboard-invoice-list {
  display: grid;
  min-height: 0;
}

.dashboard-invoice-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 110px 82px;
  align-items: center;
  column-gap: 10px;
  row-gap: 0;
  min-height: 42px;
  padding: 6px 0;
  color: var(--app-text);
  border-bottom: 1px solid #edf0f5;
}

.dashboard-invoice-row:last-child {
  border-bottom: 0;
}

.dashboard-invoice-row:hover,
.dashboard-invoice-row:focus {
  color: var(--app-primary);
}

.dashboard-invoice-icon {
  width: 28px;
  height: 28px;
  color: #657089;
  border: 1px solid #dfe4ee;
  border-radius: 7px;
  background: #f8faff;
}

.dashboard-invoice-icon svg {
  width: 15px;
  height: 15px;
}

.dashboard-invoice-main,
.dashboard-invoice-amount,
.dashboard-invoice-meta {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.dashboard-invoice-main strong,
.dashboard-invoice-amount strong {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.22;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-invoice-main small,
.dashboard-invoice-meta small {
  color: var(--text-secondary);
  font-size: 0.66rem;
  font-weight: 400;
  line-height: 1.22;
  white-space: nowrap;
}

.dashboard-invoice-amount {
  padding-right: 12px;
  justify-items: end;
  text-align: right;
}

.dashboard-invoice-meta {
  display: grid;
  align-items: center;
  row-gap: 2px;
  justify-items: end;
  text-align: right;
}

.dashboard-invoice-amount strong {
  color: var(--text-primary);
  font-size: 0.76rem;
  font-weight: 600;
}

.dashboard-invoice-meta em {
  display: inline-flex;
  align-items: center;
  min-height: 17px;
  padding: 2px 6px;
  color: var(--app-success-text);
  border-radius: 999px;
  background: var(--app-success-bg);
  font-size: 0.6rem;
  font-style: normal;
  font-weight: 500;
  line-height: 1;
}

.dashboard-supplier-rank-head,
.dashboard-project-legend-head {
  display: grid;
  color: var(--text-muted);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.dashboard-supplier-rank-head {
  grid-template-columns: 25px minmax(130px, 1fr) minmax(140px, 1.4fr) minmax(94px, auto) 56px;
  gap: 11px;
  margin-bottom: 7px;
}

.dashboard-supplier-rank-head span:first-child {
  grid-column: 2;
}

.dashboard-supplier-rank-head span:nth-child(2) {
  grid-column: 4;
  text-align: right;
}

.dashboard-supplier-rank-head span:nth-child(3) {
  grid-column: 5;
  text-align: right;
}

.dashboard-ranked-list {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 0;
}

.dashboard-ranked-row {
  display: grid;
  grid-template-columns: 25px minmax(130px, 1fr) minmax(140px, 1.4fr) minmax(94px, auto) 56px;
  align-items: center;
  gap: 11px;
}

.dashboard-rank-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 21px;
  color: #4c5f88;
  border-radius: 999px;
  background: #f0f3f8;
  font-size: 0.76rem;
  font-weight: 600;
}

.dashboard-ranked-row:first-child .dashboard-rank-pill {
  color: var(--app-primary);
  background: #e6ebfd;
}

.dashboard-ranked-row strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 0.76rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-ranked-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--app-progress-track);
}

.dashboard-ranked-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--chart-secondary);
}

.dashboard-ranked-amount,
.dashboard-ranked-share {
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.dashboard-ranked-amount {
  color: var(--text-primary);
  font-weight: 580;
  text-align: right;
}

.dashboard-ranked-share {
  color: var(--text-secondary);
  font-weight: 450;
}

.dashboard-donut-layout {
  display: grid;
  grid-template-columns: minmax(136px, 0.68fr) minmax(0, 1.32fr);
  align-items: center;
  gap: 18px;
  min-height: 0;
}

.dashboard-donut {
  position: relative;
  width: min(152px, 100%);
  aspect-ratio: 1;
  justify-self: center;
  border-radius: 50%;
}

.dashboard-donut::before {
  position: absolute;
  inset: 24px;
  content: "";
  background: var(--app-surface);
  border-radius: 50%;
}

.dashboard-donut > div {
  position: absolute;
  inset: 37px;
  display: grid;
  place-content: center;
  text-align: center;
}

.dashboard-donut strong {
  display: block;
  color: var(--text-heading);
  font-size: 0.7rem;
  font-weight: 620;
  line-height: 1.05;
  white-space: nowrap;
}

.dashboard-donut span {
  display: block;
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 0.68rem;
}

.dashboard-project-legend {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.dashboard-project-legend-head {
  grid-template-columns: minmax(0, 1fr) minmax(92px, auto) 52px;
  gap: 12px;
}

.dashboard-project-legend-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(92px, auto) 52px;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.dashboard-legend-name {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 0.74rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-color-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 999px;
}

.dashboard-dot-0 { background: var(--chart-primary); }
.dashboard-dot-1 { background: var(--chart-secondary); }
.dashboard-dot-2 { background: var(--chart-positive); }
.dashboard-dot-3 { background: var(--chart-warning); }
.dashboard-dot-4 { background: var(--chart-special); }

.dashboard-project-legend-row strong,
.dashboard-project-legend-row span:last-child {
  font-size: 0.73rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.dashboard-project-legend-row strong {
  color: var(--text-primary);
  font-weight: 580;
}

.dashboard-project-legend-row span:last-child {
  color: var(--text-secondary);
  font-weight: 450;
}

.dashboard-pro-banner {
  grid-area: pro;
  display: grid;
  grid-template-columns: 54px minmax(285px, 0.76fr) minmax(610px, 1.24fr);
  align-items: center;
  gap: 16px;
  min-height: 0;
  padding: 9px 16px;
  overflow: visible;
  background:
    radial-gradient(circle at 6% 22%, rgba(20, 184, 166, 0.2), transparent 32%),
    radial-gradient(circle at 96% 8%, rgba(37, 99, 235, 0.12), transparent 34%),
    linear-gradient(100deg, #f8fafc 0%, #f5f9ff 50%, #effcf9 100%);
  border: 1px solid rgba(20, 184, 166, 0.2);
  border-radius: 12px;
  box-shadow: var(--app-shadow-sm);
}

.dashboard-pro-mark {
  width: 50px;
  height: 50px;
  color: #ffffff;
  background:
    linear-gradient(145deg, var(--brand-navy) 0%, #123170 58%, var(--brand-primary) 100%);
  border-radius: 14px;
  box-shadow: 0 12px 26px rgba(11, 19, 43, 0.16), inset -8px -8px 0 rgba(20, 184, 166, 0.2);
}

.dashboard-pro-mark svg {
  width: 28px;
  height: 28px;
  stroke-width: 1.7;
}

.dashboard-pro-copy span {
  display: block;
  margin-bottom: 2px;
  color: var(--brand-teal);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.dashboard-pro-copy h2 {
  margin: 0;
  color: var(--app-heading);
  font-size: 0.94rem;
  font-weight: 650;
  line-height: 1.15;
}

.dashboard-pro-copy p {
  max-width: 500px;
  margin-top: 3px;
  line-height: 1.22;
}

.dashboard-pro-copy .dashboard-pro-cta {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  margin-top: 4px;
  margin-bottom: 0;
  padding: 3px 9px;
  color: var(--brand-primary);
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1;
}

.dashboard-pro-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 12px;
}

.dashboard-pro-features > div {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.44);
}

.dashboard-pro-features i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 31px;
  height: 31px;
  color: var(--brand-teal);
  background: rgba(20, 184, 166, 0.1);
  border-radius: 10px;
}

.dashboard-pro-features i svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.8;
}

.dashboard-pro-features span,
.dashboard-pro-features strong,
.dashboard-pro-features small {
  display: block;
  min-width: 0;
}

.dashboard-pro-features strong {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 0.73rem;
  font-weight: 600;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-pro-features small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 0.65rem;
  font-weight: 400;
  line-height: 1.22;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

@media (min-width: 992px) and (max-height: 900px) {
  .app-layout:has(.dashboard-page) {
    --app-topbar-height: 58px;
  }

  .app-main:has(.dashboard-page) .app-topbar {
    padding-top: 9px;
    padding-bottom: 9px;
  }

  .app-content:has(.dashboard-page) {
    height: calc(100dvh - var(--app-topbar-height));
    padding: 0 26px 10px;
  }

  .dashboard-page {
    grid-template-rows: 42px 96px 236px 178px 82px;
    gap: 11px;
  }

  .dashboard-hero h1 {
    font-size: 1.34rem;
  }

  .dashboard-hero p,
  .dashboard-card-header p,
  .dashboard-empty-compact p,
  .dashboard-pro-copy p {
    margin-top: 2px;
    font-size: 0.78rem;
  }

  .dashboard-period-form .form-select,
  .dashboard-year-form .form-select {
    min-height: 32px;
    padding-top: 4px;
    padding-bottom: 4px;
    font-size: 0.76rem;
  }

  .dashboard-kpi-grid,
  .dashboard-main-grid,
  .dashboard-analysis-grid {
    gap: 12px;
  }

  .dashboard-kpi-card {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 13px;
    padding: 13px 17px;
  }

  .dashboard-kpi-icon {
    width: 38px;
    height: 38px;
  }

  .dashboard-kpi-icon svg {
    width: 17px;
    height: 17px;
  }

  .dashboard-kpi-card > div:last-child > span:first-child {
    margin-bottom: 3px;
    font-size: 0.74rem;
  }

  .dashboard-kpi-card strong {
    font-size: 1.32rem;
  }

  .dashboard-chart-card,
  .dashboard-list-card,
  .dashboard-ranking-card,
  .dashboard-distribution-card {
    padding: 12px 16px;
  }

  .dashboard-card-header {
    margin-bottom: 7px;
  }

  .dashboard-card-header h2 {
    font-size: 0.82rem;
  }

  .dashboard-card-link {
    min-height: 25px;
    padding: 3px 8px;
    font-size: 0.68rem;
  }

  .dashboard-chart-axis {
    font-size: 10px;
  }

  .dashboard-invoice-row {
    min-height: 36px;
    padding: 4px 0;
  }

  .dashboard-invoice-icon {
    width: 24px;
    height: 24px;
  }

  .dashboard-invoice-main strong,
  .dashboard-invoice-amount strong,
  .dashboard-ranked-row strong,
  .dashboard-legend-name {
    font-size: 0.74rem;
  }

  .dashboard-invoice-main small,
  .dashboard-invoice-meta small,
  .dashboard-ranked-amount,
  .dashboard-ranked-share,
  .dashboard-project-legend-row strong,
  .dashboard-project-legend-row span:last-child {
    font-size: 0.68rem;
  }

  .dashboard-ranked-list {
    gap: 5px;
  }

  .dashboard-ranked-row {
    grid-template-columns: 24px minmax(106px, 1fr) minmax(100px, 1.25fr) minmax(84px, auto) 48px;
    gap: 8px;
  }

  .dashboard-supplier-rank-head {
    grid-template-columns: 24px minmax(106px, 1fr) minmax(100px, 1.25fr) minmax(84px, auto) 48px;
    gap: 8px;
    margin-bottom: 5px;
  }

  .dashboard-donut-layout {
    grid-template-columns: 126px minmax(0, 1fr);
    gap: 14px;
  }

  .dashboard-donut {
    width: 124px;
  }

  .dashboard-donut::before {
    inset: 22px;
  }

  .dashboard-donut > div {
    inset: 36px;
  }

  .dashboard-donut strong {
    font-size: 0.72rem;
  }

  .dashboard-project-legend {
    gap: 7px;
  }

  .dashboard-pro-banner {
    grid-template-columns: 46px minmax(260px, 0.78fr) minmax(520px, 1.22fr);
    gap: 12px;
    padding: 7px 15px;
  }

  .dashboard-pro-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .dashboard-pro-mark svg {
    width: 27px;
    height: 27px;
  }

  .dashboard-pro-copy h2 {
    font-size: 0.86rem;
  }

  .dashboard-pro-copy .dashboard-pro-cta {
    min-height: 23px;
    margin-top: 5px;
    padding: 3px 8px;
    font-size: 0.64rem;
  }

  .dashboard-pro-features {
    gap: 8px;
  }

  .dashboard-pro-features > div {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 7px;
    padding: 6px 7px;
  }

  .dashboard-pro-features i {
    width: 27px;
    height: 27px;
  }

  .dashboard-pro-features strong {
    font-size: 0.68rem;
  }

  .dashboard-pro-features small {
    font-size: 0.58rem;
  }
}

@media (min-width: 992px) and (max-height: 800px) {
  .app-layout:has(.dashboard-page) {
    --app-topbar-height: 56px;
  }

  .app-content:has(.dashboard-page) {
    padding: 0 24px 8px;
  }

  .dashboard-page {
    grid-template-rows: 38px 88px 214px 158px 78px;
    gap: 9px;
  }

  .dashboard-hero h1 {
    font-size: 1.26rem;
  }

  .dashboard-period-form {
    grid-template-columns: auto minmax(190px, 250px);
  }

  .dashboard-kpi-card {
    padding: 11px 15px;
  }

  .dashboard-kpi-card strong {
    font-size: 1.22rem;
  }

  .dashboard-chart-card,
  .dashboard-list-card,
  .dashboard-ranking-card,
  .dashboard-distribution-card {
    padding: 10px 14px;
  }

  .dashboard-invoice-row {
    min-height: 33px;
    padding: 3px 0;
  }

  .dashboard-donut {
    width: 110px;
  }

  .dashboard-donut::before {
    inset: 19px;
  }

  .dashboard-donut > div {
    inset: 31px;
  }

  .dashboard-donut strong {
    font-size: 0.66rem;
  }

  .dashboard-project-legend {
    gap: 5px;
  }

  .dashboard-pro-copy p {
    max-width: 620px;
    font-size: 0.64rem;
  }

  .dashboard-pro-copy .dashboard-pro-cta {
    margin-top: 4px;
  }

  .dashboard-pro-features > div {
    padding: 5px 6px;
  }

  .dashboard-pro-features small {
    -webkit-line-clamp: 1;
  }
}

.invoice-list-page {
  display: grid;
  gap: 13px;
}

.invoice-list-page .invoice-filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
}

.invoice-list-page .invoice-filter-field {
  flex: 1 1 115px;
  min-width: 115px;
}

.invoice-list-page .invoice-search-field {
  flex: 0 1 270px;
  min-width: min(260px, 100%);
  max-width: 300px;
}

.invoice-list-page .invoice-search-field .form-label {
  margin-bottom: 4px;
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.1;
}

.invoice-list-page .invoice-search-field svg {
  top: auto;
  bottom: 10px;
  transform: none;
}

.invoice-list-page .invoice-filter-submit {
  flex: 0 0 62px;
  align-self: flex-start;
  margin-top: calc(0.68rem * 1.1 + 4px);
}

.invoice-list-page .invoice-filter-form .form-label { display: block; }

.invoice-list-page .invoice-live-search-message {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  color: var(--text-secondary);
  font-size: 0.72rem;
}

.invoice-list-page .invoice-live-search-message[hidden],
.invoice-list-page .invoice-live-search-message [hidden] {
  display: none;
}

.invoice-list-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 1px;
}

.invoice-list-header h1 {
  margin: 0;
  color: var(--text-heading);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
}

.invoice-list-header p {
  margin: 3px 0 0;
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 400;
  line-height: 1.35;
}

.invoice-filter-panel,
.invoice-table-panel {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}

.invoice-filter-panel {
  padding: 12px 14px;
}

.invoice-filter-form {
  display: grid;
  grid-template-columns: minmax(280px, 1.55fr) minmax(178px, 0.78fr) minmax(158px, 0.72fr) minmax(150px, 0.68fr) 62px;
  align-items: end;
  gap: 10px;
}

.invoice-search-field {
  position: relative;
}

.invoice-search-field svg {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 15px;
  height: 15px;
  color: var(--app-muted);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: translateY(-50%);
  pointer-events: none;
}

.invoice-search-field .form-control {
  padding-left: 36px;
}

.invoice-filter-field .form-label {
  margin-bottom: 4px;
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.1;
}

.invoice-filter-submit {
  width: 62px;
  min-width: 62px;
  height: 34px;
  min-height: 34px;
  padding: 0 12px;
  align-self: end;
}

.invoice-active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
}

.invoice-filter-chip,
.invoice-clear-filters {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  font-size: 0.7rem;
}

.invoice-filter-chip {
  gap: 6px;
  padding: 3px 8px;
  color: var(--text-primary);
  background: #f4f7ff;
  border: 1px solid #dbe5ff;
  border-radius: 999px;
  font-weight: 500;
}

.invoice-filter-chip:hover,
.invoice-clear-filters:hover {
  color: var(--app-primary);
}

.invoice-clear-filters {
  margin-left: 2px;
  color: var(--app-primary);
  font-weight: 600;
}

.invoice-table-panel {
  overflow: hidden;
}

.invoice-table-panel .table-responsive {
  position: relative;
  overflow-x: auto;
}

.provider-review-metadata { font-size: .8rem; color: var(--app-muted); overflow-wrap: anywhere; }
.provider-review-metadata summary { cursor: pointer; }
.provider-review-metadata dl { margin: 10px 0 0; }
.provider-review-layout input[readonly] { color: var(--app-text); opacity: 1; }
@media (max-width: 991.98px) {
  .provider-review-layout.invoice-create-layout { grid-template-columns: minmax(0, 1fr); }
}

.invoice-table {
  min-width: 1160px;
  table-layout: fixed;
}

.invoice-list-page .invoice-table th:first-child,
.invoice-list-page .invoice-table td:first-child {
  width: 96px;
  white-space: nowrap;
}

.invoice-table > :not(caption) > * > * {
  padding: 9px 12px;
  border-bottom-color: var(--app-border);
  vertical-align: middle;
}

.invoice-table thead th {
  background: var(--app-surface-subtle);
  color: var(--text-secondary);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

.invoice-list-page .invoice-table thead th {
  background: #edf3f8;
  color: #334155;
  border-bottom-color: #cbd8e5;
  font-size: 0.72rem;
}

.invoice-list-page .invoice-table tbody tr:nth-child(even) > td {
  background: #fbfcfe;
}

.invoice-list-page .invoice-table tbody tr:hover > td {
  background: #f1f7fd;
}

.invoice-list-page .invoice-table th:nth-child(6),
.invoice-list-page .invoice-table td:nth-child(6) {
  border-left: 1px solid #d8e3ed;
}

.invoice-list-page .invoice-table .sortable-header-link.is-active {
  color: var(--brand-navy);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--brand-blue);
  text-underline-offset: 4px;
}

.invoice-list-page .invoice-table .sortable-chevron.is-active {
  color: var(--brand-blue);
  opacity: 1;
}

.invoice-list-page .invoice-supplier-name {
  color: var(--brand-navy);
  font-weight: 650;
}

.invoice-list-page .invoice-company-name {
  margin-top: 3px;
  color: #64748b;
  font-size: 0.69rem;
  font-weight: 400;
  line-height: 1.25;
}

.invoice-list-page .invoice-project-name {
  font-weight: 400;
}

.invoice-list-page .invoice-money-cell {
  font-weight: 400;
}

.invoice-table th:nth-child(2),
.invoice-table td:nth-child(2) {
  width: 112px;
}

.invoice-table th:nth-child(3),
.invoice-table td:nth-child(3),
.invoice-table th:nth-child(4),
.invoice-table td:nth-child(4) {
  width: 16%;
}

.invoice-table th:nth-child(5),
.invoice-table td:nth-child(5) {
  width: 15%;
}

.invoice-table th:nth-child(6),
.invoice-table td:nth-child(6),
.invoice-table th:nth-child(8),
.invoice-table td:nth-child(8) {
  width: 132px;
}

.invoice-table th:nth-child(7),
.invoice-table td:nth-child(7) {
  width: 112px;
}

.invoice-table tbody tr:hover {
  background: #f8fbff;
}

.invoice-table tbody td {
  height: 48px;
}

.invoice-strong-cell {
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 500;
}

.invoice-date-cell {
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.invoice-number-cell {
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.invoice-number-line {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  gap: 6px;
  min-width: 0;
}

.invoice-number-line > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invoice-list-status {
  flex: 0 0 auto;
  min-width: 0;
  padding: 2px 7px;
  border: 1px solid rgba(239, 68, 68, 0.24);
  font-size: 0.66rem;
  line-height: 1.1;
}

.invoice-money-cell {
  text-align: right;
}

.invoice-total-cell {
  text-align: right;
}

.invoice-detail-column {
  width: 38px;
  text-align: right;
}

.invoice-detail-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  color: var(--text-muted);
  border: 1px solid transparent;
  border-radius: 999px;
}

.invoice-detail-link:hover,
.invoice-detail-link:focus {
  color: var(--app-primary);
  background: var(--app-primary-soft);
  border-color: var(--app-primary-border);
}

.invoice-detail-link svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.invoice-pagination-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 9px 14px;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 400;
  border-top: 1px solid var(--app-border);
}

.invoice-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.invoice-page-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 9px;
  color: var(--app-muted-strong);
  border: 1px solid var(--app-border);
  border-radius: 7px;
  font-size: 0.72rem;
  font-weight: 500;
}

.invoice-page-button:hover {
  color: var(--app-primary);
  background: var(--app-primary-soft);
  border-color: var(--app-primary-border);
}

.invoice-page-button.is-disabled {
  color: #98a2b3;
  pointer-events: none;
}

.invoice-page-size-form {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.invoice-page-size-form .form-label {
  margin-bottom: 0;
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 500;
}

.invoice-page-size-form .form-select {
  width: 72px;
  min-height: 30px;
  height: 30px;
  padding-top: 4px;
  padding-bottom: 4px;
  font-size: 0.72rem;
}

.suppliers-list-page {
  display: grid;
  gap: 14px;
}

.suppliers-list-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.suppliers-list-header h1 {
  margin: 0;
  color: var(--text-heading);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
}

.suppliers-list-header p {
  margin: 4px 0 0;
  color: var(--app-muted);
  font-size: 0.76rem;
  font-weight: 400;
  line-height: 1.35;
}

.master-data-form-panel,
.supplier-form-panel {
  max-width: 680px;
  padding: 18px;
}

.master-data-form,
.supplier-form {
  display: grid;
  gap: 14px;
}

.supplier-filter-panel,
.supplier-table-panel {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}

.supplier-filter-panel {
  padding: 12px 14px;
}

.supplier-filter-form {
  display: grid;
  grid-template-columns: minmax(280px, 1.55fr) minmax(178px, 0.78fr) minmax(158px, 0.72fr) 62px;
  align-items: end;
  gap: 10px;
}

.supplier-filter-form.supplier-filter-form-organization {
  grid-template-columns: minmax(150px, 0.9fr) minmax(200px, 1.4fr) minmax(132px, 0.8fr) minmax(150px, 0.8fr) 62px;
}

@media (max-width: 1199.98px) {
  .supplier-filter-form.supplier-filter-form-organization {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .supplier-filter-form.supplier-filter-form-organization {
    grid-template-columns: minmax(0, 1fr);
  }
}

.supplier-search-field,
.supplier-filter-field {
  min-width: 0;
}

.supplier-search-field {
  position: relative;
}

.supplier-search-field svg {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 15px;
  height: 15px;
  color: var(--app-muted);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: translateY(-50%);
  pointer-events: none;
}

.supplier-search-field .form-control {
  padding-left: 36px;
}

.supplier-filter-field .form-label,
.supplier-page-size-form .form-label {
  margin-bottom: 4px;
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.1;
}

.supplier-filter-submit {
  width: 62px;
  min-width: 62px;
  height: 34px;
  min-height: 34px;
  padding: 0 12px;
  align-self: end;
}

.supplier-active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
}

.supplier-filter-chip,
.supplier-clear-filters {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  font-size: 0.7rem;
}

.supplier-filter-chip {
  text-decoration: none;
}

.supplier-clear-filters {
  margin-left: 2px;
  color: var(--app-primary);
  font-weight: 600;
  text-decoration: none;
}

.supplier-clear-filters:hover,
.supplier-clear-filters:focus,
.supplier-filter-chip:hover,
.supplier-filter-chip:focus {
  color: var(--app-primary);
}

.supplier-table-panel {
  overflow: hidden;
}

.supplier-table-panel .table-responsive {
  overflow-x: auto;
}

.supplier-table {
  min-width: 1060px;
  table-layout: fixed;
}

.supplier-table > :not(caption) > * > * {
  padding: 9px 12px;
  border-bottom-color: var(--app-border);
  vertical-align: middle;
}

.supplier-table thead th {
  color: var(--text-secondary);
  background: var(--app-surface-subtle);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  white-space: nowrap;
}

.supplier-table th:nth-child(1),
.supplier-table td:nth-child(1) {
  width: 22%;
}

.supplier-table th:nth-child(2),
.supplier-table td:nth-child(2),
.supplier-table th:nth-child(3),
.supplier-table td:nth-child(3) {
  width: 74px;
}

.supplier-table th:nth-child(4),
.supplier-table td:nth-child(4),
.supplier-table th:nth-child(6),
.supplier-table td:nth-child(6) {
  width: 156px;
}

.supplier-table th:nth-child(5),
.supplier-table td:nth-child(5) {
  width: 124px;
}

.supplier-table th:nth-child(7),
.supplier-table td:nth-child(7) {
  width: 124px;
  text-align: right;
}

.supplier-table tbody tr {
  transition: background-color 0.15s ease;
}

.supplier-table tbody tr:hover {
  background: #f8fbff;
}

.supplier-table tbody tr:last-child > * {
  border-bottom: 0;
}

/* Supplier list keeps the Invoice-list hierarchy without changing other tables. */
.suppliers-list-page .supplier-filter-form,
.suppliers-list-page .supplier-filter-form.supplier-filter-form-organization {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.suppliers-list-page .supplier-filter-field {
  flex: 1 1 145px;
  min-width: 135px;
}

.suppliers-list-page .supplier-search-field {
  flex: 0 1 270px;
  min-width: min(240px, 100%);
  max-width: 300px;
}

.suppliers-list-page .supplier-search-field .form-label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-secondary);
  font-size: 0.68rem;
  line-height: 1.1;
}

.suppliers-list-page .supplier-search-field svg {
  top: auto;
  bottom: 10px;
  transform: none;
}

.suppliers-list-page .supplier-filter-submit {
  flex: 0 0 62px;
}

.suppliers-list-page .supplier-table {
  min-width: 1150px;
}

.suppliers-list-page .supplier-table thead th {
  background: #edf3f8;
  color: #334155;
  border-bottom-color: #cbd8e5;
  font-size: 0.72rem;
}

.suppliers-list-page .supplier-table tbody tr:nth-child(even) > td {
  background: #fbfcfe;
}

.suppliers-list-page .supplier-table tbody tr:hover > td {
  background: #f1f7fd;
}

.suppliers-list-page .supplier-table th:nth-child(4),
.suppliers-list-page .supplier-table td:nth-child(4) {
  border-left: 1px solid #d8e3ed;
}

.suppliers-list-page .supplier-table .sortable-header-link.is-active {
  color: var(--brand-navy);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--brand-blue);
  text-underline-offset: 4px;
}

.suppliers-list-page .supplier-table .sortable-chevron.is-active {
  color: var(--brand-blue);
  opacity: 1;
}

.suppliers-list-page .supplier-name-cell {
  color: var(--brand-navy);
  font-weight: 650;
}

.suppliers-list-page .supplier-money-cell,
.suppliers-list-page .supplier-total-cell {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.suppliers-list-page .supplier-money-cell { font-weight: 400; }
.suppliers-list-page .supplier-total-cell { font-weight: 700; }
.suppliers-list-page .supplier-quiet-value { color: #8190a2; font-weight: 400; }
.suppliers-list-page .supplier-actions-column { width: 245px; }
.suppliers-list-page .supplier-row-actions { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.suppliers-list-page .supplier-row-actions .btn { white-space: nowrap; }

.supplier-company-fieldset { border: 1px solid var(--app-border); border-radius: 10px; padding: 12px; }
.supplier-company-fieldset legend { float: none; width: auto; margin: 0 0 4px; font-size: 0.86rem; font-weight: 700; }
.supplier-company-fieldset p { color: var(--text-secondary); font-size: 0.78rem; }
.supplier-company-choice { display: flex; align-items: center; gap: 9px; padding: 7px 2px; }
.supplier-company-choice small { margin-left: auto; color: var(--text-secondary); }
.supplier-company-choice.is-disabled { color: var(--text-secondary); }

.supplier-name-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.supplier-count-cell {
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 450;
  font-variant-numeric: tabular-nums;
}

.supplier-money-cell {
  text-align: right;
}

.supplier-total-cell {
  text-align: right;
}

.supplier-date-cell {
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.supplier-detail-column {
  width: 38px;
  text-align: right;
}

.supplier-detail-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  color: var(--text-muted);
  border: 1px solid transparent;
  border-radius: 999px;
}

.supplier-detail-link:hover,
.supplier-detail-link:focus {
  color: var(--app-primary);
  background: var(--app-primary-soft);
  border-color: var(--app-primary-border);
}

.supplier-detail-link svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.supplier-pagination-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 9px 14px;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 400;
  border-top: 1px solid var(--app-border);
}

.supplier-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.supplier-page-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 4px 9px;
  color: var(--app-muted-strong);
  text-decoration: none;
  border: 1px solid var(--app-border);
  border-radius: 7px;
  background: var(--app-surface);
  font-size: 0.72rem;
  font-weight: 500;
}

.supplier-page-button:hover,
.supplier-page-button:focus {
  color: var(--app-primary);
  border-color: var(--app-primary-border);
  background: var(--app-primary-soft);
}

.supplier-page-button.is-disabled {
  color: #98a2b3;
  pointer-events: none;
}

.supplier-page-size-form {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.supplier-page-size-form .form-label {
  margin-bottom: 0;
}

.supplier-page-size-form .form-select {
  width: 72px;
  min-height: 30px;
  height: 30px;
  padding-top: 4px;
  padding-bottom: 4px;
  font-size: 0.72rem;
}

.projects-list-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.projects-list-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.projects-list-header h1 {
  margin: 0;
}

.projects-list-header p {
  margin: 3px 0 0;
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 400;
  line-height: 1.35;
}

.project-filter-panel,
.project-table-panel {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}

.project-filter-panel {
  padding: 12px 14px;
}

.project-filter-form {
  display: grid;
  grid-template-columns: minmax(280px, 1.55fr) minmax(178px, 0.78fr) minmax(158px, 0.72fr) 62px;
  align-items: end;
  gap: 10px;
}

.project-filter-form.project-filter-form-organization {
  grid-template-columns: minmax(150px, 0.9fr) minmax(200px, 1.4fr) minmax(132px, 0.8fr) minmax(150px, 0.8fr) 62px;
}

@media (max-width: 1199.98px) {
  .project-filter-form.project-filter-form-organization {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .project-filter-form.project-filter-form-organization {
    grid-template-columns: minmax(0, 1fr);
  }
}

.project-search-field,
.project-filter-field {
  min-width: 0;
}

.project-search-field {
  position: relative;
}

.project-search-field svg {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 15px;
  height: 15px;
  color: var(--app-muted);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: translateY(-50%);
  pointer-events: none;
}

.project-search-field .form-control {
  padding-left: 36px;
}

.project-filter-field .form-label,
.project-page-size-form .form-label {
  margin-bottom: 4px;
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.15;
}

.project-filter-submit {
  width: 62px;
  min-width: 62px;
  padding-inline: 12px;
}

.project-active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.project-filter-chip {
  text-decoration: none;
}

.project-clear-filters {
  text-decoration: none;
}

.project-clear-filters:hover,
.project-clear-filters:focus {
  color: var(--app-primary-hover);
}

.project-table-panel {
  overflow: hidden;
}

.project-table {
  min-width: 1060px;
  table-layout: fixed;
}

.project-table th:nth-child(1),
.project-table td:nth-child(1) {
  width: 22%;
}

.project-table th:nth-child(2),
.project-table td:nth-child(2),
.project-table th:nth-child(3),
.project-table td:nth-child(3) {
  width: 82px;
}

.project-table th:nth-child(4),
.project-table td:nth-child(4),
.project-table th:nth-child(6),
.project-table td:nth-child(6) {
  width: 156px;
}

.project-table th:nth-child(5),
.project-table td:nth-child(5) {
  width: 124px;
}

.project-table th:nth-child(7),
.project-table td:nth-child(7) {
  width: 124px;
  text-align: right;
}

.project-table th:nth-child(8),
.project-table td:nth-child(8) {
  width: 38px;
}

.project-table > :not(caption) > * > * {
  padding: 9px 12px;
  border-bottom-color: var(--app-border);
}

.project-table thead th {
  color: var(--text-secondary);
  background: var(--app-surface-subtle);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.project-table tbody tr {
  transition: background-color 0.15s ease;
}

.project-table tbody tr:hover {
  background: #f8fbff;
}

.project-table tbody tr:last-child > * {
  border-bottom: 0;
}

.project-name-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-count-cell {
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 450;
  font-variant-numeric: tabular-nums;
}

.project-money-cell {
  text-align: right;
}

.project-total-cell {
  text-align: right;
}

.project-date-cell {
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.project-detail-column {
  width: 38px;
  text-align: right;
}

.project-detail-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  color: var(--text-muted);
  border: 1px solid transparent;
  border-radius: 999px;
}

.project-detail-link:hover,
.project-detail-link:focus {
  color: var(--app-primary);
  background: var(--app-primary-soft);
  border-color: var(--app-primary-border);
}

.project-detail-link svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.project-pagination-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 9px 14px;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 400;
  border-top: 1px solid var(--app-border);
}

.project-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.project-page-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 30px;
  padding: 4px 9px;
  color: var(--app-muted-strong);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.1;
  text-decoration: none;
  border: 1px solid var(--app-border);
  border-radius: 7px;
  background: var(--app-surface);
}

.project-page-button:hover,
.project-page-button:focus {
  color: var(--app-primary);
  border-color: var(--app-primary-border);
  background: var(--app-primary-soft);
}

.project-page-button.is-disabled {
  color: var(--app-muted);
  pointer-events: none;
  opacity: 0.55;
}

.project-page-size-form {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.project-page-size-form .form-label {
  margin-bottom: 0;
}

.project-page-size-form .form-select {
  width: auto;
  min-width: 72px;
  min-height: 30px;
  padding-top: 4px;
  padding-bottom: 4px;
  font-size: 0.72rem;
}

.supplier-detail-page {
  display: grid;
  gap: 14px;
}

.supplier-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.supplier-detail-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
  color: var(--app-muted);
  font-size: 0.72rem;
  line-height: 1.25;
}

.supplier-detail-breadcrumb a {
  color: var(--app-muted-strong);
  font-weight: 500;
}

.supplier-detail-title h1 {
  margin: 0;
}

.supplier-detail-muted-status {
  display: inline-flex;
  margin-top: 6px;
  color: var(--app-muted);
  font-size: 0.72rem;
}

.supplier-detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.supplier-period-form {
  display: flex;
  align-items: center;
  gap: 7px;
}

.supplier-period-form .form-select {
  min-width: 220px;
}

.supplier-detail-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.supplier-detail-kpi,
.supplier-detail-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}

.supplier-detail-kpi {
  padding: 13px 15px;
}

.supplier-detail-kpi span {
  display: block;
  margin-bottom: 5px;
  color: var(--app-muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.supplier-detail-kpi strong {
  display: block;
  color: var(--text-heading);
  font-size: 1.08rem;
  font-weight: 650;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.supplier-detail-card {
  padding: 14px 16px;
}

.supplier-detail-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.supplier-detail-section-header h2 {
  margin: 0;
  font-family: var(--font-display);
}

.supplier-detail-empty {
  padding: 20px 8px;
  color: var(--app-muted);
  font-size: 0.78rem;
  text-align: center;
}

.supplier-project-bars {
  display: grid;
  gap: 8px;
}

.supplier-project-bar-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.9fr) minmax(240px, 4fr) minmax(132px, auto) 56px;
  align-items: center;
  gap: 12px;
}

.supplier-project-bar-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.supplier-project-bar-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f7;
}

.supplier-project-bar-track span {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: var(--app-primary);
}

.supplier-project-bar-value {
  text-align: right;
}

.supplier-project-bar-share {
  color: var(--app-muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.supplier-invoice-groups {
  display: grid;
  gap: 8px;
}

.supplier-invoice-group {
  overflow: hidden;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface);
}

.supplier-invoice-group summary {
  display: grid;
  grid-template-columns: 26px minmax(180px, 1fr) auto minmax(118px, auto);
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 7px 12px;
  background: var(--app-surface-subtle);
  cursor: pointer;
  list-style: none;
}

.supplier-invoice-group summary::-webkit-details-marker {
  display: none;
}

.supplier-invoice-group summary:hover {
  background: #f7f9fd;
}

.supplier-group-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: var(--text-muted);
  border: 1px solid var(--app-border);
  border-radius: 999px;
}

.supplier-group-toggle svg,
.supplier-detail-link svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.supplier-invoice-group[open] .supplier-group-toggle svg {
  transform: rotate(90deg);
}

.supplier-invoice-group summary strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.supplier-invoice-group summary span:not(.supplier-group-toggle):not(.supplier-group-total) {
  color: var(--app-muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.supplier-group-total {
  text-align: right;
}

.supplier-group-table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--app-border);
}

.supplier-group-table {
  min-width: 860px;
  margin: 0;
  table-layout: fixed;
}

.supplier-group-table th:nth-child(1),
.supplier-group-table td:nth-child(1) {
  width: 126px;
}

.supplier-group-table th:nth-child(2),
.supplier-group-table td:nth-child(2) {
  width: auto;
}

.supplier-group-table th:nth-child(3),
.supplier-group-table td:nth-child(3),
.supplier-group-table th:nth-child(5),
.supplier-group-table td:nth-child(5) {
  width: 152px;
}

.supplier-group-table th:nth-child(4),
.supplier-group-table td:nth-child(4) {
  width: 124px;
}

.supplier-group-table > :not(caption) > * > * {
  padding: 7px 12px;
  border-bottom-color: var(--app-border);
}

.supplier-group-table thead th {
  color: var(--text-secondary);
  background: var(--app-surface-subtle);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.supplier-group-table tbody td {
  vertical-align: middle;
}

.supplier-group-table tfoot th {
  color: var(--text-primary);
  background: var(--app-surface-subtle);
  font-size: 0.76rem;
  font-weight: 600;
  border-top: 1px solid var(--app-border-strong);
}

.supplier-invoice-date-cell {
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.supplier-invoice-number-cell {
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.supplier-detail-arrow-column {
  width: 44px;
  text-align: right;
}

.project-detail-page {
  display: grid;
  gap: 14px;
}

.project-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.project-detail-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
  color: var(--app-muted);
  font-size: 0.72rem;
  line-height: 1.25;
}

.project-detail-breadcrumb a {
  color: var(--app-muted-strong);
  font-weight: 500;
}

.project-detail-title h1 {
  margin: 0;
}

.project-detail-muted-status {
  display: inline-flex;
  margin-top: 6px;
  color: var(--app-muted);
  font-size: 0.72rem;
}

.project-detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.project-period-form {
  display: flex;
  align-items: center;
  gap: 7px;
}

.project-period-form .form-select {
  min-width: 220px;
}

.project-detail-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.project-detail-kpi,
.project-detail-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}

.project-detail-kpi {
  padding: 13px 15px;
}

.project-detail-kpi span,
.project-detail-kpi small {
  display: block;
  color: var(--app-muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.project-detail-kpi span {
  margin-bottom: 5px;
}

.project-detail-kpi small {
  margin-top: 4px;
  font-weight: 400;
  line-height: 1.25;
}

.project-detail-kpi strong {
  display: block;
  color: var(--text-heading);
  font-size: 1.08rem;
  font-weight: 650;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.project-detail-analysis {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  gap: 14px;
}

.project-detail-card {
  padding: 14px 16px;
}

.project-detail-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.project-detail-section-header h2 {
  margin: 0;
  font-family: var(--font-display);
}

.project-detail-empty {
  padding: 20px 8px;
  color: var(--app-muted);
  font-size: 0.78rem;
  text-align: center;
}

.project-supplier-bars {
  display: grid;
  gap: 8px;
}

.project-supplier-bar-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.9fr) minmax(240px, 4fr) minmax(132px, auto) 56px;
  align-items: center;
  gap: 12px;
}

.project-supplier-bar-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-supplier-bar-name a,
.project-top-supplier-list a,
.project-invoice-group summary strong a {
  color: var(--text-primary);
  text-decoration: none;
}

.project-supplier-bar-name a:hover,
.project-supplier-bar-name a:focus,
.project-top-supplier-list a:hover,
.project-top-supplier-list a:focus,
.project-invoice-group summary strong a:hover,
.project-invoice-group summary strong a:focus {
  color: var(--app-primary);
}

.project-supplier-bar-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f7;
}

.project-supplier-bar-track span {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: var(--app-primary);
}

.project-supplier-bar-value {
  text-align: right;
}

.project-supplier-bar-share {
  color: var(--app-muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.project-top-supplier-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.project-top-supplier-list li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 30px;
}

.project-top-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: var(--app-muted-strong);
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: var(--app-surface-subtle);
  font-size: 0.72rem;
  font-weight: 600;
}

.project-top-supplier-list strong {
  text-align: right;
}

.project-invoice-groups {
  display: grid;
  gap: 8px;
}

.project-invoice-group {
  overflow: hidden;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface);
}

.project-invoice-group summary {
  display: grid;
  grid-template-columns: 26px minmax(180px, 1fr) auto minmax(118px, auto);
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 7px 12px;
  background: var(--app-surface-subtle);
  cursor: pointer;
  list-style: none;
}

.project-invoice-group summary::-webkit-details-marker {
  display: none;
}

.project-invoice-group summary:hover {
  background: #f7f9fd;
}

.project-group-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: var(--text-muted);
  border: 1px solid var(--app-border);
  border-radius: 999px;
}

.project-group-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.project-invoice-group[open] .project-group-toggle svg {
  transform: rotate(90deg);
}

.project-invoice-group summary strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-invoice-group summary span:not(.project-group-toggle):not(.project-group-total) {
  color: var(--app-muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.project-group-total {
  text-align: right;
}

.project-group-table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--app-border);
}

.project-group-table {
  min-width: 860px;
  margin: 0;
  table-layout: fixed;
}

.project-group-table th:nth-child(1),
.project-group-table td:nth-child(1) {
  width: 126px;
}

.project-group-table th:nth-child(2),
.project-group-table td:nth-child(2) {
  width: auto;
}

.project-group-table th:nth-child(3),
.project-group-table td:nth-child(3),
.project-group-table th:nth-child(5),
.project-group-table td:nth-child(5) {
  width: 152px;
}

.project-group-table th:nth-child(4),
.project-group-table td:nth-child(4) {
  width: 124px;
}

.project-group-table > :not(caption) > * > * {
  padding: 7px 12px;
  border-bottom-color: var(--app-border);
}

.project-group-table thead th {
  color: var(--text-secondary);
  background: var(--app-surface-subtle);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.project-group-table tbody td {
  vertical-align: middle;
}

.project-group-table tfoot th {
  color: var(--text-primary);
  background: var(--app-surface-subtle);
  font-size: 0.76rem;
  font-weight: 600;
  border-top: 1px solid var(--app-border-strong);
}

.project-invoice-date-cell {
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.project-invoice-number-cell {
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1199.98px) {
  .project-filter-form {
    grid-template-columns: minmax(220px, 1fr) minmax(160px, 0.75fr) minmax(160px, 0.75fr) auto;
    gap: 10px;
  }

  .project-table {
    min-width: 920px;
  }

  .project-table > :not(caption) > * > * {
    padding: 9px 10px;
  }

  .supplier-filter-form {
    grid-template-columns: minmax(220px, 1fr) minmax(160px, 0.75fr) minmax(150px, 0.75fr) auto;
    gap: 10px;
  }

  .supplier-table {
    min-width: 900px;
  }

  .supplier-table > :not(caption) > * > * {
    padding: 11px 10px;
  }

  .supplier-project-bar-row {
    grid-template-columns: minmax(120px, 0.9fr) minmax(180px, 3fr) minmax(118px, auto) minmax(50px, auto);
    gap: 10px;
  }

  .supplier-group-table > :not(caption) > * > * {
    padding: 8px 10px;
  }

  .project-supplier-bar-row {
    grid-template-columns: minmax(120px, 0.9fr) minmax(180px, 3fr) minmax(118px, auto) minmax(50px, auto);
    gap: 10px;
  }

  .project-group-table > :not(caption) > * > * {
    padding: 8px 10px;
  }
}
@media (max-width: 1199.98px) {
  .invoice-filter-form {
    grid-template-columns: minmax(240px, 1fr) repeat(3, minmax(150px, 0.8fr)) auto;
    gap: 10px;
  }

  .invoice-table > :not(caption) > * > * {
    padding: 11px 10px;
  }
}

@media (max-width: 991.98px) {
  .invoice-filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .invoice-filter-submit {
    justify-self: start;
  }

  .invoice-pagination-bar {
    grid-template-columns: 1fr;
  }

  .invoice-pagination,
  .invoice-page-size-form {
    justify-content: flex-start;
  }
}

.supplier-detail-page .supplier-invoice-group summary strong,
.project-detail-page .project-invoice-group summary strong {
  font-weight: 700;
}

.supplier-detail-page .supplier-group-table thead th.text-end,
.project-detail-page .project-group-table thead th.text-end {
  text-align: right;
}

.supplier-detail-page .supplier-group-table .detail-net-column,
.project-detail-page .project-group-table .detail-net-column {
  border-left: 1px solid var(--app-border-strong);
}

.supplier-detail-page .supplier-group-table .supplier-total-cell,
.project-detail-page .project-group-table .project-total-cell,
.supplier-detail-page .supplier-group-table .detail-gross-column,
.project-detail-page .project-group-table .detail-gross-column {
  font-weight: 700;
}

.supplier-detail-page .supplier-group-table tfoot th,
.project-detail-page .project-group-table tfoot th {
  background: #edf4fa;
  border-top: 1px solid var(--app-border-strong);
}

.supplier-switch-dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 22px 24px;
  color: var(--text-primary);
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(17, 43, 72, 0.22);
}

.supplier-switch-dialog::backdrop {
  background: rgba(16, 40, 66, 0.38);
  backdrop-filter: blur(3px);
}

.supplier-switch-dialog h2 { font-size: 1.1rem; font-weight: 700; }
.supplier-switch-dialog p { margin: 12px 0 20px; }
.supplier-switch-dialog form { text-align: right; }
@media (max-width: 991.98px) {
  :root {
    --app-sidebar-width: 232px;
  }

  .app-content {
    padding: 20px;
  }

  .app-topbar {
    padding: 14px 20px;
  }

  .app-account-chip {
    display: none;
  }

  .dashboard-kpi-grid,
  .dashboard-main-grid,
  .dashboard-analysis-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-main-grid {
    grid-template-columns: 1fr;
  }

  .project-filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-filter-submit {
    justify-self: start;
  }

  .project-pagination-bar {
    grid-template-columns: 1fr;
  }

  .project-pagination,
  .project-page-size-form {
    justify-content: flex-start;
  }

  .project-detail-header {
    flex-direction: column;
  }

  .project-detail-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .project-detail-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-detail-analysis {
    grid-template-columns: 1fr;
  }

  .project-supplier-bar-row {
    grid-template-columns: minmax(130px, 1fr) minmax(180px, 2fr) minmax(124px, auto);
  }

  .project-supplier-bar-share {
    display: none;
  }

  .supplier-detail-header {
    flex-direction: column;
  }

  .supplier-detail-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .supplier-detail-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .supplier-project-bar-row {
    grid-template-columns: minmax(130px, 1fr) minmax(180px, 2fr) minmax(124px, auto);
  }

  .supplier-project-bar-share {
    display: none;
  }
}

@media (max-width: 767.98px) {
  .auth-page {
    align-items: start;
    padding: 18px 14px;
  }

  .auth-card {
    grid-template-columns: 1fr;
    border-radius: 14px;
  }

  .auth-brand-panel {
    min-height: auto;
    gap: 18px;
    padding: 22px 22px 20px;
  }

  .auth-brand-mark,
  .auth-brand-mark .app-brand-logo {
    width: 34px;
    height: 34px;
  }

  .auth-wordmark {
    font-size: 1.18rem;
  }

  .auth-brand-message {
    gap: 12px;
  }

  .auth-brand-message p {
    max-width: none;
    font-size: 1rem;
    line-height: 1.35;
  }

  .auth-brand-accent {
    width: 58px;
  }

  .auth-form-panel {
    padding: 26px 22px 24px;
  }

  .auth-form-header {
    margin-bottom: 20px;
  }

  .auth-form-header h1 {
    font-size: 1.24rem;
  }

  .app-layout {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: static;
    height: auto;
    padding: 14px 16px;
    border-right: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  }

  .app-brand {
    margin-bottom: 12px;
  }

  .app-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-nav-divider {
    grid-column: 1 / -1;
    margin: 8px;
  }

  .app-user-panel {
    display: none;
  }

  .app-topbar {
    position: static;
    align-items: flex-end;
  }

  .app-topbar-actions {
    justify-content: flex-end;
  }

  .dashboard-hero,
  .dashboard-card-header,
  .dashboard-pro-banner {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .dashboard-hero,
  .dashboard-card-header {
    display: grid;
  }

  .dashboard-period-strip {
    justify-content: stretch;
  }

  .dashboard-period-form,
  .dashboard-kpi-grid,
  .dashboard-analysis-grid,
  .dashboard-distribution-row {
    grid-template-columns: 1fr;
  }

  .dashboard-pro-tag {
    justify-self: start;
    white-space: normal;
  }

  .page-header,
  .reports-overview-header,
  .section-toolbar {
    display: block;
  }

  .page-header .btn,
  .reports-overview-header .btn,
  .section-toolbar .btn-group,
  .section-toolbar form {
    margin-top: 12px;
  }

  .projects-list-header {
    flex-direction: column;
  }

  .inline-form,
  .report-period-form,
  .dashboard-filter-form,
  .dashboard-project-form,
  .invoice-form-grid,
  .invoice-detail-layout,
  .invoice-create-layout,
  .invoice-create-layout.is-manual,
  .invoice-create-layout.has-pdf,
  .detail-list,
  .comparison-layout,
  .comparison-periods,
  .annual-year-form {
    grid-template-columns: 1fr;
  }

  .project-filter-form {
    grid-template-columns: 1fr;
  }

  .summary-grid,
  .supplier-summary-grid,
  .dashboard-summary-grid,
  .supplier-detail-kpis,
  .supplier-project-bar-row {
    grid-template-columns: 1fr;
  }

  .supplier-detail-card,
  .supplier-detail-kpi {
    padding: 14px;
  }

  .project-detail-kpis,
  .project-supplier-bar-row {
    grid-template-columns: 1fr;
  }

  .project-detail-card,
  .project-detail-kpi {
    padding: 14px;
  }

  .project-period-form,
  .project-period-form .form-select,
  .project-detail-actions {
    width: 100%;
  }

  .project-period-form {
    align-items: stretch;
  }

  .project-invoice-group summary {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .project-invoice-group summary span:not(.project-group-toggle):not(.project-group-total),
  .project-group-total {
    grid-column: 2;
  }

  .supplier-period-form,
  .supplier-period-form .form-select,
  .supplier-detail-actions {
    width: 100%;
  }

  .supplier-period-form {
    align-items: stretch;
  }

  .supplier-invoice-group summary {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .supplier-invoice-group summary span:not(.supplier-group-toggle):not(.supplier-group-total),
  .supplier-group-total {
    grid-column: 2;
  }

  .year-field {
    max-width: none;
  }

  .actions-column {
    width: auto;
  }
}

@media (max-width: 991.98px) {
  .invoice-detail-layout.provider-invoice-detail-layout.is-pdf-preview-open {
    grid-template-columns: 1fr;
  }

  .invoice-edit-has-document {
    grid-template-columns: 1fr;
  }

  .invoice-edit-has-document .invoice-document-panel,
  .invoice-detail-layout.has-document .invoice-detail-document-panel {
    position: static;
  }

  .invoice-voided-state-block {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .invoice-voided-state-block > div {
    grid-column: 2;
  }

  .invoice-void-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .invoice-void-summary-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .invoice-void-summary-grid {
    grid-template-columns: 1fr;
  }
}
/* Batch candidates reuse the existing Yeni Fatura document card. */
.invoice-batch-review { width: 100%; }
.pdf-batch-candidates { display: grid; gap: 6px; }
.pdf-batch-candidate { border: 1px solid var(--app-border); border-radius: 8px; background: var(--app-surface); overflow: hidden; }
.pdf-batch-candidate.is-skipped { background: var(--app-surface-subtle); }
.pdf-batch-candidate-row { display: flex; align-items: center; gap: 6px; min-height: 42px; padding: 4px 8px; }
.pdf-batch-disclosure { display: flex; flex: 1; align-items: center; gap: 8px; min-width: 0; padding: 6px 4px; color: var(--app-heading); border: 0; background: transparent; text-align: left; }
.pdf-batch-disclosure:hover { color: var(--app-primary); }
.pdf-batch-disclosure-icon { flex: 0 0 14px; color: var(--app-muted-strong); font-size: .95rem; }
.pdf-batch-disclosure strong { overflow: hidden; font-size: .84rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.pdf-batch-skipped-label { color: var(--app-muted-strong); font-size: .72rem; font-weight: 650; }
.pdf-batch-skip-form { margin: 0; }
.pdf-batch-skip { color: var(--app-muted-strong); text-decoration: none; }
.pdf-batch-candidate-detail { display: grid; gap: 10px; padding: 10px; border-top: 1px solid var(--app-border); }
.pdf-batch-candidate-detail[hidden] { display: none; }
.pdf-batch-candidate-controls { display: flex; align-items: start; gap: 6px; }
.pdf-batch-assignment-form { flex: 1; }
.pdf-batch-evidence { padding-top: 2px; }
.pdf-batch-evidence h3 { margin-bottom: 8px; font-size: .84rem; }
.pdf-batch-evidence dl { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 5px 8px; margin-bottom: 10px; font-size: .76rem; }
.pdf-batch-evidence dt { color: var(--app-muted-strong); }
.pdf-batch-evidence dd { margin: 0; overflow-wrap: anywhere; }
.pdf-batch-evidence small { display: block; color: #9a5d00; }
.pdf-batch-boundaries { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--app-border); }
.pdf-batch-boundaries form { display: flex; align-items: end; gap: 6px; flex-wrap: wrap; }
.pdf-batch-boundaries label { flex-basis: 100%; font-size: .72rem; font-weight: 600; }
.batch-quick-supplier-dialog,
.invoice-inline-supplier-dialog { width: min(420px, calc(100vw - 32px)); padding: 20px; border: 1px solid var(--app-border); border-radius: 10px; background: var(--app-surface); color: var(--app-text); box-shadow: 0 18px 50px rgb(15 23 42 / 22%); }
.batch-quick-supplier-dialog::backdrop,
.invoice-inline-supplier-dialog::backdrop { background: rgb(15 23 42 / 38%); }
.batch-quick-supplier-dialog h3,
.invoice-inline-supplier-dialog h3 { margin: 0 0 14px; font-size: 1rem; }
.batch-quick-supplier-dialog form,
.invoice-inline-supplier-dialog form { display: grid; gap: 12px; }
.batch-quick-supplier-dialog .form-actions,
.invoice-inline-supplier-dialog .form-actions { margin-top: 2px; }
.app-company-switcher select,
.app-company-name {
  max-width: 15rem;
  min-height: 2.5rem;
  border: 1px solid #dbe3ef;
  border-radius: 0.65rem;
  background: #fff;
  color: #1f2a44;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
}
.app-company-name { display: inline-flex; align-items: center; }
.company-selection-card {
  max-width: 40rem;
  margin: 3rem auto;
  padding: 2rem;
  border: 1px solid #e4e9f2;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 0.5rem 1.5rem rgba(31, 42, 68, 0.08);
}
.company-selection-list { display: grid; gap: 0.75rem; margin-top: 1.5rem; }
.company-selection-list .btn { width: 100%; text-align: left; }
.organization-companies-panel { overflow: hidden; }
.organization-companies-table { margin-bottom: 0; min-width: 720px; }
.organization-companies-table td:last-child { text-align: right; }
.organization-company-actions { display: flex; justify-content: flex-end; gap: 0.5rem; flex-wrap: wrap; }
.organization-company-actions form { margin: 0; }
.organization-companies-page .organization-companies-panel { padding: 0; border: 1px solid var(--app-border); border-radius: 12px; box-shadow: 0 1px 2px rgba(16, 24, 40, .03); }
.organization-companies-page .organization-companies-table > :not(caption) > * > * { padding: 12px 16px; border-bottom: 1px solid #e3eaf1; vertical-align: middle; box-shadow: none; }
.organization-companies-page .organization-companies-table thead th { background: #edf3f8; color: #334155; border-bottom-color: #cbd8e5; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.organization-companies-page .organization-companies-table tbody td { background: #fff; font-size: .875rem; }
.organization-companies-page .organization-companies-table tbody tr:nth-child(even) > td { background: #fbfcfe; }
.organization-companies-page .organization-companies-table tbody tr:hover > td { background: #f1f7fd; }
.organization-companies-page .organization-companies-table tbody tr:last-child > td { border-bottom: 0; }
.organization-companies-page .organization-companies-table td:first-child strong { color: var(--brand-navy); font-weight: 650; }
.organization-companies-page .organization-tax-value { font-variant-numeric: tabular-nums; color: #526277; }
.organization-companies-page .organization-company-actions { align-items: center; gap: 6px; }
.organization-companies-page .organization-company-actions .btn { font-size: .75rem; padding: 5px 9px; white-space: nowrap; }
.organization-companies-page .organization-company-status,
.organization-user-access-page .organization-access-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border: 1px solid #dce2e8; border-radius: 6px; font-size: .72rem; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.organization-companies-page .organization-company-status.is-active,
.organization-user-access-page .organization-access-badge { background: #f0f7f3; border-color: #d7e8dd; color: #3a6850; }
.organization-companies-page .organization-company-status.is-inactive,
.organization-user-access-page .organization-access-badge.is-unavailable { background: #f3f5f7; color: #617082; }
.organization-user-access-page .organization-access-badge.is-unavailable { border-color: #dce2e8; }
.organization-companies-page .organization-company-status-dot { width: 5px; height: 5px; flex: 0 0 5px; border-radius: 50%; background: currentColor; }
.organization-companies-page .organization-company-selected { display: inline-block; padding: 2px 6px; border-radius: 5px; background: #edf3f8; color: #52677e; font-size: .7rem; font-weight: 500; white-space: nowrap; }
.form-modal .company-modal-form .alert { margin: 0; font-size: .875rem; line-height: 1.55; }
.form-modal .company-modal-form .form-check-label { line-height: 1.5; }
.organization-tax-missing { color: #9a5d00; font-weight: 600; }
.organization-tax-value { font-variant-numeric: tabular-nums; }
@media (max-width: 700px) {
  .pdf-batch-candidate-controls { align-items: stretch; flex-direction: column; }
}
/* OrganizationAdmin landing reuses the Company dashboard's four panel positions. */
.dashboard-page.org-dashboard-page {
  grid-template-rows: minmax(82px, auto) minmax(260px, 1.15fr) minmax(230px, 0.85fr);
  grid-template-areas: "hero period" "main main" "analysis analysis";
}
.org-dashboard-period-form { grid-template-columns: auto 90px minmax(130px, 170px); }
.org-dashboard-page .dashboard-main-grid { grid-template-columns: minmax(0, 1.54fr) minmax(350px, .96fr); }
.org-dashboard-page .dashboard-analysis-grid { grid-template-columns: minmax(0, .96fr) minmax(0, 1.04fr); }
.org-dashboard-page .dashboard-chart-card,
.org-dashboard-page .dashboard-ranking-card { grid-template-rows: auto minmax(0, 1fr); }
.org-dashboard-panel-body { min-width: 0; min-height: 0; overflow-y: auto; }
.org-dashboard-scope-note, .org-dashboard-period-note { color: var(--text-secondary); font-size: .72rem; margin: 0 0 8px; }
.org-dashboard-period-note { margin-bottom: 4px; }
.org-dashboard-table { width: 100%; border-collapse: collapse; font-size: .75rem; }
.org-dashboard-table th { color: var(--text-muted); font-size: .66rem; font-weight: 600; white-space: nowrap; }
.org-dashboard-table th, .org-dashboard-table td { padding: 7px 5px; border-bottom: 1px solid #edf0f5; vertical-align: top; }
.org-dashboard-table td { overflow-wrap: anywhere; }
.org-dashboard-table td.text-end { white-space: nowrap; font-variant-numeric: tabular-nums; }
.org-dashboard-table td small { display: block; margin-top: 2px; color: var(--text-secondary); font-size: .65rem; }
.org-dashboard-table tfoot { background: #eff6ff; font-weight: 700; }
.org-dashboard-project-selector { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; margin-bottom: 10px; }
.org-dashboard-project-selector label { color: var(--text-secondary); font-size: .7rem; white-space: nowrap; }
.org-dashboard-project-selector .form-select { min-width: 0; font-size: .72rem; }
.org-dashboard-summary-cards, .org-dashboard-project-cards { display: none; }
.org-dashboard-mobile-sort { display: none; }
.org-dashboard-page .dashboard-distribution-card { overflow-y: auto; }
.org-dashboard-page .dashboard-project-legend { overflow-y: auto; }
@media (min-width: 992px) and (max-height: 800px) {
  .dashboard-page.org-dashboard-page { grid-template-rows: minmax(82px, auto) minmax(214px, 1.15fr) minmax(158px, .85fr); }
}
@media (max-width: 991.98px) {
  .app-content:has(.org-dashboard-page) { height: auto; min-height: calc(100dvh - var(--app-topbar-height)); }
  .dashboard-page.org-dashboard-page { height: auto; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "hero" "period" "main" "analysis"; }
  .org-dashboard-page .dashboard-main-grid { grid-template-columns: minmax(0, 1fr); }
  .org-dashboard-page .dashboard-analysis-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .org-dashboard-page .dashboard-chart-card,
  .org-dashboard-page .dashboard-list-card,
  .org-dashboard-page .dashboard-ranking-card,
  .org-dashboard-page .dashboard-distribution-card { min-height: 190px; }
  .org-dashboard-panel-body { overflow: visible; }
}
@media (max-width: 767.98px) {
  .org-dashboard-page .dashboard-analysis-grid { grid-template-columns: minmax(0, 1fr); }
  .org-dashboard-mobile-sort { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 10px; color: var(--text-secondary); font-size: .72rem; }
  .org-dashboard-period-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: 100%; }
  .org-dashboard-period-form label { grid-column: 1 / -1; }
  .org-dashboard-table { display: none; }
  .org-dashboard-summary-cards, .org-dashboard-project-cards { display: grid; gap: 8px; }
  .org-dashboard-mobile-card { min-width: 0; padding: 11px; border: 1px solid var(--app-border); border-radius: 9px; background: var(--app-surface); }
  .org-dashboard-mobile-card strong, .org-dashboard-mobile-card small { display: block; overflow-wrap: anywhere; }
  .org-dashboard-mobile-card small, .org-dashboard-mobile-card p { margin: 3px 0 0; color: var(--text-secondary); font-size: .68rem; }
  .org-dashboard-mobile-card dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 8px 0 0; }
  .org-dashboard-mobile-card dt { color: var(--text-secondary); font-size: .62rem; }
  .org-dashboard-mobile-card dd { margin: 0; font-size: .72rem; font-weight: 600; overflow-wrap: anywhere; }
  .org-dashboard-total-card { background: #eff6ff; }
  .org-dashboard-project-selector { grid-template-columns: minmax(0, 1fr); }
  .org-dashboard-project-selector label { grid-column: 1 / -1; }
  .org-dashboard-page .dashboard-donut-layout { grid-template-columns: minmax(0, 1fr); }
}
.supplier-live-search-message:not([hidden]) {
    margin-top: .6rem;
    color: #49637c;
    font-size: .875rem;
}

.supplier-live-search-message button {
    border: 0;
    background: none;
    color: #145d9a;
    text-decoration: underline;
}

.supplier-deactivation-dialog {
    width: min(94vw, 31rem);
    border: 1px solid #c8d9e8;
    border-radius: .75rem;
    padding: 1.4rem;
    box-shadow: 0 1rem 3rem rgba(18, 43, 72, .2);
}

.supplier-deactivation-dialog::backdrop { background: rgba(18, 43, 72, .38); }
.supplier-deactivation-dialog h2 { font-size: 1.25rem; color: #173a5d; }
.supplier-deactivation-dialog p { color: #526a7e; }
.supplier-deactivation-choice { display: flex; gap: .65rem; align-items: center; margin: .65rem 0; }
.supplier-deactivation-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .6rem; margin-top: 1.3rem; }

/* Project list uses the accepted Supplier list hierarchy. */
.projects-list-page .project-filter-form,
.projects-list-page .project-filter-form.project-filter-form-organization {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}
.projects-list-page .project-filter-field { flex: 1 1 145px; min-width: 135px; }
.projects-list-page .project-search-field { flex: 0 1 270px; min-width: min(240px, 100%); max-width: 300px; }
.projects-list-page .project-search-field .form-label { display: block; margin-bottom: 4px; color: var(--text-secondary); font-size: .68rem; line-height: 1.1; }
.projects-list-page .project-search-field svg { top: auto; bottom: 10px; transform: none; }
.projects-list-page .project-filter-submit { flex: 0 0 62px; }
.projects-list-page .project-table { min-width: 1270px; }
.projects-list-page .project-table-panel .table-responsive { position: relative; }
.projects-list-page .project-table th:nth-child(1), .projects-list-page .project-table td:nth-child(1) { width: 20%; }
.projects-list-page .project-table th:nth-child(4), .projects-list-page .project-table td:nth-child(4),
.projects-list-page .project-table th:nth-child(6), .projects-list-page .project-table td:nth-child(6) { width: 142px; }
.projects-list-page .project-table th:nth-child(5), .projects-list-page .project-table td:nth-child(5) { width: 112px; }
.projects-list-page .project-table th:nth-child(7), .projects-list-page .project-table td:nth-child(7) { width: 118px; }
.projects-list-page .project-table th:nth-child(8), .projects-list-page .project-table td:nth-child(8) { width: 230px; }
.projects-list-page .project-table.project-table-organization { min-width: 1430px; }
.projects-list-page .project-table-organization th:nth-child(8), .projects-list-page .project-table-organization td:nth-child(8) { width: 340px; }
.projects-list-page .project-table th:nth-child(9), .projects-list-page .project-table td:nth-child(9) { width: 52px; }
.projects-list-page .project-table thead th { background: #edf3f8; color: #334155; border-bottom-color: #cbd8e5; font-size: .72rem; }
.projects-list-page .project-table tbody tr:nth-child(even) > td { background: #fbfcfe; }
.projects-list-page .project-table tbody tr:hover > td { background: #f1f7fd; }
.projects-list-page .project-table th:nth-child(4), .projects-list-page .project-table td:nth-child(4) { border-left: 1px solid #d8e3ed; }
.projects-list-page .project-table .sortable-header-link.is-active { color: var(--brand-navy); font-weight: 700; text-decoration: underline; text-decoration-color: var(--brand-blue); text-underline-offset: 4px; }
.projects-list-page .project-table .sortable-chevron.is-active { color: var(--brand-blue); opacity: 1; }
.projects-list-page .project-name-cell { color: var(--brand-navy); font-weight: 650; }
.projects-list-page .project-money-cell, .projects-list-page .project-total-cell { font-variant-numeric: tabular-nums; text-align: right; }
.projects-list-page .project-money-cell { font-weight: 400; }
.projects-list-page .project-total-cell { font-weight: 700; }
.projects-list-page .project-quiet-value { color: #8190a2; font-weight: 400; }
.projects-list-page .project-row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; }
.projects-list-page .project-row-actions .btn { white-space: nowrap; }
.project-live-search-message:not([hidden]) { margin-top: .6rem; color: #49637c; font-size: .875rem; }
.project-live-search-message button { border: 0; background: none; color: #145d9a; text-decoration: underline; }
.project-deactivation-dialog { width: min(94vw, 31rem); border: 1px solid #c8d9e8; border-radius: .75rem; padding: 1.4rem; box-shadow: 0 1rem 3rem rgba(18, 43, 72, .2); }
.project-deactivation-dialog::backdrop { background: rgba(18, 43, 72, .38); }
.project-deactivation-dialog h2 { font-size: 1.25rem; color: #173a5d; }
.project-deactivation-dialog p { color: #526a7e; }
.project-deactivation-choice { display: flex; gap: .65rem; align-items: center; margin: .65rem 0; }
.project-deactivation-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .6rem; margin-top: 1.3rem; }

/* Reusable form dialog. Existing warning/deactivation dialogs keep their own styling. */
.form-modal { width: min(680px, calc(100vw - 32px)); max-width: none; max-height: 90vh; max-height: 90dvh; margin: auto; padding: 0; border: 1px solid var(--app-border); border-radius: 14px; background: #fff; color: var(--text-primary); box-shadow: 0 18px 60px rgba(18, 43, 72, .18); overflow: hidden; }
.form-modal[open] { display: flex; flex-direction: column; }
.form-modal::backdrop { background: rgba(18, 43, 72, .38); backdrop-filter: blur(4px); }
.form-modal-header { display: flex; flex: 0 0 auto; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px 16px; border-bottom: 1px solid var(--app-border); }
.form-modal-header h2 { margin: 0; color: #173a5d; font-size: 1.25rem; font-weight: 700; }
.form-modal-header p { margin: 6px 0 0; color: var(--text-secondary); font-size: .875rem; }
.form-modal-close { display: grid; place-items: center; flex: 0 0 32px; height: 32px; margin: -5px -7px 0 0; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #526a7e; font-size: 1.6rem; line-height: 1; }
.form-modal-close:hover { background: #f0f5f9; }
.form-modal-close:focus-visible { outline: 2px solid #145d9a; outline-offset: 2px; }
.form-modal-host { display: flex; flex-direction: column; min-height: 0; }
.form-modal-host > form { display: flex; flex-direction: column; gap: 0; min-height: 0; }
.form-modal-fields { display: grid; gap: 14px; }
.form-modal .form-modal-fields { overflow-y: auto; overscroll-behavior: contain; padding: 18px 22px; min-height: 0; }
.form-modal [data-form-modal-footer] { flex: 0 0 auto; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin: 0; padding: 14px 22px; border-top: 1px solid var(--app-border); }
.form-modal [data-form-modal-cancel] { order: -1; }
.form-modal-status { flex: 0 0 auto; margin: 0; padding: 12px 22px; color: #526a7e; font-size: .875rem; }
.form-modal-retry { margin: 0 22px 20px; align-self: flex-start; }
.form-modal-discard { padding: 24px 22px; overflow-y: auto; }
.form-modal-discard h3 { font-size: 1.05rem; color: #173a5d; margin: 0 0 24px; }
.form-modal-discard-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.form-modal [hidden] { display: none !important; }
.form-modal [aria-busy="true"], .form-modal:disabled { cursor: progress; }
@media (prefers-reduced-motion: reduce) {
  .form-modal, .form-modal *, .form-modal::backdrop { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Company–Project directory reuses the accepted Companies table and compact badges. */
.project-affiliations-page .project-company-chip { background: #f0f4fa; border-color: #dae3ef; color: #49617d; }

/* Connections are compact badges, not a vertical status list. Other accepted tables stay unchanged. */
.project-affiliations-page .project-connection-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 7px; }
.project-affiliations-page .project-connection-badge { white-space: normal; max-width: 100%; overflow-wrap: anywhere; }
.project-affiliations-page .organization-companies-table { min-width: 0; table-layout: fixed; }
.project-affiliations-page .organization-companies-table > :not(caption) > * > * { padding: 9px 12px; }
.project-affiliations-page .organization-companies-table th:first-child { width: 25%; }
.project-affiliations-page .organization-companies-table th:last-child { width: 170px; }
@media (max-width: 640px) {
    .project-affiliations-page .organization-companies-table th:last-child { width: 115px; }
    .project-affiliations-page .organization-companies-table .btn { white-space: normal; }
    .project-affiliations-page .organization-companies-table > :not(caption) > * > * { padding: 8px; overflow-wrap: anywhere; }
}

/* Unified Settings: accepted sections remain independent, stacked, and locally styled. */
.settings-section { min-width: 0; scroll-margin-top: 100px; }
.settings-section + .settings-section { margin-top: 36px; padding-top: 28px; border-top: 1px solid #e2e8f0; }
.settings-section h2 { font-size: 1.25rem; font-weight: 650; margin-bottom: 8px; }
.settings-section .page-header { flex-wrap: wrap; gap: 12px; }
@media (max-width: 640px) {
    .settings-section + .settings-section { margin-top: 28px; padding-top: 20px; }
    .settings-section .page-header > div { min-width: 0; }
}
.settings-section .table-responsive { position: relative; }

/* Operational feedback stays outside the independently refreshed invoice results. */
.invoice-sync-row { display: flex; justify-content: flex-end; align-items: center; gap: 9px; flex-wrap: wrap; font-size: .72rem; color: var(--text-secondary); }
.invoice-sync-row .btn { padding: 3px 9px; font-size: .72rem; }
.app-dashboard-period { flex: 0 1 170px; min-width: 140px; }
.app-dashboard-period .form-select { height: 34px; font-size: .76rem; }
.app-topbar-actions { flex-wrap: wrap; }
.dashboard-kpi-icon-navy { color: #263b61; background: #f0f3f8; border-color: #e2e8f0; }
.dashboard-kpi-icon-teal { color: #138b91; background: #effafa; border-color: #dceeee; }
@media (max-width: 767.98px) {
  .app-dashboard-period { flex: 1 1 140px; }
  .app-topbar .app-search-form { flex: 1 1 180px; width: auto; }
  .invoice-list-header .app-primary-action { flex-shrink: 0; }
}

/* Remove the vacated greeting grid row; retain Company dashboard cards and chart semantics. */
.app-content:has(.company-dashboard-page) { height: auto; padding-top: 20px; }
.dashboard-page.company-dashboard-page {
  height: auto;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "kpis" "main" "analysis" "pro";
  grid-template-rows: minmax(96px, auto) minmax(236px, auto) minmax(178px, auto) auto;
}
.company-dashboard-page .dashboard-pro-banner { min-width: 0; }
@media (max-width: 1199.98px) {
  .company-dashboard-page .dashboard-pro-banner { grid-template-columns: 42px minmax(0, 1fr); }
  .company-dashboard-page .dashboard-pro-features { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
  .dashboard-page.company-dashboard-page { grid-template-rows: auto; }
  .company-dashboard-page .dashboard-kpi-card { min-height: 110px; }
  .company-dashboard-page .dashboard-analysis-grid { grid-template-columns: minmax(0, 1fr); }
  .company-dashboard-page .dashboard-ranked-track { display: none; }
  .company-dashboard-page .dashboard-ranked-row,
  .company-dashboard-page .dashboard-supplier-rank-head { grid-template-columns: 24px minmax(0, 1fr) auto 44px; }
}
@media (max-width: 575.98px) {
  .company-dashboard-page .dashboard-donut-layout { grid-template-columns: minmax(0, 1fr); }
  .company-dashboard-page .dashboard-donut { margin-inline: auto; }
  .company-dashboard-page .dashboard-pro-features { grid-template-columns: minmax(0, 1fr); }
}
