/* BAW-D TABLES AND CHARTS CSS */

.revenue-chart {
  --bawd-chart-1: #083F4B;
  --bawd-chart-2: #2998A7;
  --bawd-chart-3: #7ABFBE;
  --bawd-chart-4: #E6F4F6;
  --bawd-chart-5: #0D6E82;
}

/* HIDDEN STUFF */
.darkness-stuff,
.revenue-chart .view-content {
  display: none;
}

/* GLOBAL TABLE WRAPPER */
.bawd-table {
  max-width: none;
  overflow-x: visible;
  overflow-y: visible;
}

.bawd-table .view-header,
.bawd-table .view-footer {
  max-width: none;
  overflow-x: visible;
  overflow-y: visible;
}

.bawd-table .view-content {
  max-width: 1400px;
  overflow-x: auto;
  overflow-y: visible;
}

/* Hide unused generated-footer stage if it remains in the View footer */
.bawd-table .view-footer .bawd-pl-footer-stage {
  display: none;
}

/* Generated JS total row inside the real table */
.bawd-table table.views-table tfoot tr.bawd-generated-total-row td,
.bawd-table table.table tfoot tr.bawd-generated-total-row td {
  background: #EEF7F8;
  color: #083F4B;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
  padding: 5px 12px;
  border-top: 2px solid #0D6E82;
}

.bawd-table table.views-table tfoot tr.bawd-generated-total-row td.bawd-table-description-cell,
.bawd-table table.table tfoot tr.bawd-generated-total-row td.bawd-table-description-cell {
  background: #E6F4F6;
  color: #083F4B;
  font-weight: 900;
  text-align: left;
  padding-left: 12px;
}

.bawd-table table.views-table tfoot tr.bawd-generated-total-row td.bawd-table-year-cell,
.bawd-table table.table tfoot tr.bawd-generated-total-row td.bawd-table-year-cell {
  background: #CFE9EE;
  color: #083F4B;
  font-weight: 900;
  text-align: right;
}

/* GLOBAL TABLE TYPOGRAPHY */
.bawd-table table.table,
.bawd-table table.views-table {
  width: max-content;
  min-width: 100%;
}

.bawd-table table.table th,
.bawd-table table.table td,
.bawd-table table.views-table th,
.bawd-table table.views-table td {
  font-size: 10px;
}

/* GLOBAL FINANCIAL TABLE COLOR + NUMERIC ALIGNMENT */
.bawd-table table thead th {
  background: #0D6E82;
  color: #FFFFFF;
  font-weight: 800;
}

.bawd-table table tbody td {
  background: #F8FAFB;
  color: #083F4B;
  text-align: right;
}

.bawd-table table tfoot td {
  background: #EEF7F8;
  color: #083F4B;
  font-weight: 800;
  text-align: right;
}

/* GLOBAL FINANCIAL TABLE SEMANTIC CELLS */
.bawd-table table .bawd-table-description-cell {
  background: #E6F4F6;
  color: #083F4B;
  font-weight: 700;
  text-align: left;
}

.bawd-table table .bawd-table-year-cell {
  background: #CFE9EE;
  color: #083F4B;
  font-weight: 800;
  text-align: right;
}

.bawd-table table thead .bawd-table-year-cell {
  background: #083F4B;
  color: #FFFFFF;
  font-weight: 800;
  text-align: right;
}

/* GENERATED FOOTER STAGE */
.bawd-table .view-footer .bawd-pl-footer-stage {
  margin: 0;
  padding: 0;
}

/* GENERATED P&L FOOTER TABLE */
.bawd-table .view-footer .bawd-pl-footer-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  margin-top: 0;
}

/* GENERATED P&L FOOTER CELLS */
.bawd-table .view-footer .bawd-pl-footer-table tfoot td,
.bawd-table .view-footer .bawd-pl-footer-table tfoot th {
  background: #EEF7F8;
  color: #083F4B;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
  font-size: 10px;
}

/* GENERATED P&L FOOTER LABEL CELL */
.bawd-table .view-footer .bawd-pl-footer-table tfoot td:first-child,
.bawd-table .view-footer .bawd-pl-footer-table tfoot th:first-child,
.bawd-table .view-footer .bawd-pl-footer-label {
  background: #E6F4F6;
  color: #083F4B;
  font-weight: 800;
  text-align: left;
}

/* GENERATED P&L YEAR TOTAL CELLS */
.bawd-table .view-footer .bawd-pl-footer-table tfoot td.views-field-nothing,
.bawd-table .view-footer .bawd-pl-footer-table tfoot td.views-field-nothing-1,
.bawd-table .view-footer .bawd-pl-footer-table tfoot td.views-field-nothing-2,
.bawd-table .view-footer .bawd-pl-footer-table tfoot td.views-field-nothing-3,
.bawd-table .view-footer .bawd-pl-footer-table tfoot td.views-field-nothing-4 {
  background: #CFE9EE;
  color: #083F4B;
  font-weight: 800;
}

/* DATA / CASH CALENDAR FORM TABLES */
.data-calendar-layout .field--widget-number input {
  font-size: 11px;
  line-height: 1.1;
  padding: 4px 6px;
  font-variant-numeric: tabular-nums;
}

.data-calendar-layout .calendar-total-value {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* CHART BASE */
.bawd-revenue-chart-controls {
  display: flex;
  align-items: center;
  gap: 80px;
}

.bawd-chart-toggle-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* DIRECT COST / COGS DATA TABLE */
.bawd-table.cogs-table.cogs-table-data table.table th,
.bawd-table.cogs-table.cogs-table-data table.table td,
.bawd-table.cogs-table.cogs-table-data table.views-table th,
.bawd-table.cogs-table.cogs-table-data table.views-table td {
  font-variant-numeric: tabular-nums;
}

/* FINANCIAL PREVIEW CONTROLS */
.bawd-preview-control-block,
.bawd-preview-table-controls,
.bawd-graphs-block .bawd-preview-chart-controls,
.bawd-preview-chart-block .bawd-preview-chart-controls,
.bawd-graphs-block .bawd-preview-chart-type-controls,
.bawd-preview-chart-block .bawd-preview-chart-type-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}

.bawd-preview-toggle-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.bawd-preview-button {
  appearance: none;
  border: 1px solid #0D6E82;
  border-radius: 999px;
  background: #F8FAFB;
  color: #083F4B;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1;
  padding: 8px 13px;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.bawd-preview-button:hover,
.bawd-preview-button:focus {
  background: #E6F4F6;
  border-color: #2998A7;
  color: #083F4B;
  outline: none;
}

.bawd-preview-button:focus-visible {
  box-shadow: 0 0 0 3px rgba(41, 152, 167, 0.25);
}

.bawd-preview-button.is-active {
  background: #083F4B;
  border-color: #083F4B;
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(8, 63, 75, 0.24);
}

.bawd-preview-button.is-active:hover,
.bawd-preview-button.is-active:focus {
  background: #0D6E82;
  border-color: #0D6E82;
  color: #FFFFFF;
}

/* PREVIEW BLOCK SPACING */
.bawd-preview-table-block,
.bawd-graphs-block,
.bawd-preview-chart-block {
  margin-top: 14px;
}

.bawd-preview-chart-stage {
  width: 100%;
  max-width: 100%;
  min-height: 420px;
  overflow-x: auto;
  overflow-y: hidden;
}

.bawd-preview-chart-stage > div {
  margin-left: auto;
  margin-right: auto;
}

/* OPTIONAL COMPACT MOBILE BEHAVIOR */
@media (max-width: 640px) {
  .bawd-preview-button {
    font-size: 0.75rem;
    padding: 7px 10px;
  }

  .bawd-preview-toggle-group {
    gap: 5px;
  }
}

/* BAW-D LOCKED FINANCIAL FORM FIELDS */
.bawd-readonly,
.bawd-readonly-wrapper input,
.bawd-readonly-wrapper select,
.bawd-readonly-wrapper textarea {
  background: #EEF2F3 !important;
  color: #5B6870 !important;
  border-color: #B8C6CC !important;
  cursor: not-allowed !important;
}

.bawd-readonly-wrapper {
  opacity: 0.78;
}

.bawd-readonly-wrapper label {
  color: #5B6870 !important;
}

.bawd-readonly-wrapper .chosen-container .chosen-single,
.bawd-readonly-wrapper .chosen-container .chosen-choices {
  background: #EEF2F3 !important;
  color: #5B6870 !important;
  border-color: #B8C6CC !important;
  cursor: not-allowed !important;
}

.bawd-readonly-wrapper .chosen-container {
  pointer-events: none;
}

/* BAW-D COMPLEX OUTPUT TABLES */
.bawd-complex {
  max-width: none;
  overflow-x: visible;
  overflow-y: visible;
}

.bawd-complex .complex-output {
  max-width: none;
  overflow-x: visible;
  overflow-y: visible;
}

.bawd-complex .complex-title {
  margin: 0 0 12px;
}

.bawd-complex .complex-title h2 {
  margin: 0 0 4px;
  color: #083F4B;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.2;
}

.bawd-complex .complex-title p {
  margin: 0;
  color: #083F4B;
  font-size: 0.8125rem;
  line-height: 1.35;
}

/* COMPLEX CONTROLS */
.bawd-complex .complex-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}

.bawd-complex .complex-control-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.bawd-complex .complex-button-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.bawd-complex .complex-button {
  appearance: none;
  border: 1px solid #0D6E82;
  border-radius: 999px;
  background: #F8FAFB;
  color: #083F4B;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1;
  padding: 8px 13px;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.bawd-complex .complex-button:hover,
.bawd-complex .complex-button:focus {
  background: #E6F4F6;
  border-color: #2998A7;
  color: #083F4B;
  outline: none;
}

.bawd-complex .complex-button:focus-visible {
  box-shadow: 0 0 0 3px rgba(41, 152, 167, 0.25);
}

.bawd-complex .complex-button.is-active {
  background: #083F4B;
  border-color: #083F4B;
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(8, 63, 75, 0.24);
}

.bawd-complex .complex-button.is-active:hover,
.bawd-complex .complex-button.is-active:focus {
  background: #0D6E82;
  border-color: #0D6E82;
  color: #FFFFFF;
}

/* COMPLEX TABLE WRAPPER */
.bawd-complex .complex-stage {
  max-width: 1400px;
  overflow-x: visible;
  overflow-y: visible;
}

.bawd-complex .complex-table-wrap {
  max-width: 1400px;
  overflow-x: visible;
  overflow-y: visible;
}

.bawd-complex .complex-table-scroll {
  max-width: 1400px;
  overflow-x: auto;
  overflow-y: visible;
}

.bawd-complex table.complex-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.bawd-complex table.complex-table th,
.bawd-complex table.complex-table td {
  font-size: 10px;
  padding: 5px 12px;
  border-bottom: 1px solid #FFFFFF;
  white-space: nowrap;
}

/* COMPLEX TABLE HEADER */
.bawd-complex table.complex-table thead th {
  background: #0D6E82;
  color: #FFFFFF;
  font-weight: 800;
  text-align: right;
}

.bawd-complex table.complex-table thead th.complex-label-cell {
  text-align: left;
}

/* COMPLEX TABLE BODY */
.bawd-complex table.complex-table tbody td {
  background: #F8FAFB;
  color: #083F4B;
  text-align: right;
}

.bawd-complex table.complex-table tbody td.complex-label-cell {
  background: #E6F4F6;
  color: #083F4B;
  font-weight: 700;
  text-align: left;
}

.bawd-complex table.complex-table .complex-year-cell {
  background: #CFE9EE;
  color: #083F4B;
  font-weight: 800;
  text-align: right;
}

.bawd-complex table.complex-table thead .complex-year-cell {
  background: #083F4B;
  color: #FFFFFF;
  font-weight: 800;
  text-align: right;
}

/* COMPLEX TOTAL / COLLAPSE ROWS */
.bawd-complex table.complex-table tr.complex-total-row td {
  background: #EEF7F8;
  color: #083F4B;
  font-weight: 900;
  text-align: right;
  border-top: 2px solid #0D6E82;
}

.bawd-complex table.complex-table tr.complex-total-row td.complex-label-cell {
  background: #E6F4F6;
  color: #083F4B;
  font-weight: 900;
  text-align: left;
}

.bawd-complex table.complex-table tr.complex-total-row td.complex-year-cell {
  background: #CFE9EE;
  color: #083F4B;
  font-weight: 900;
  text-align: right;
}

/* COMPLEX LINE ITEM ROWS */
.bawd-complex table.complex-table tr.complex-line-row td {
  background: #F8FAFB;
  color: #083F4B;
  font-weight: 700;
}

.bawd-complex table.complex-table tr.complex-line-row td.complex-label-cell {
  background: #F8FAFB;
  color: #083F4B;
  font-weight: 700;
  padding-left: 34px;
}

/* COMPLEX DISCLOSURE BUTTON */
.bawd-complex table.complex-table .complex-toggle {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #083F4B;
  font: inherit;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.bawd-complex table.complex-table .complex-toggle:disabled {
  cursor: default;
}

.bawd-complex table.complex-table .complex-toggle:focus {
  outline: none;
}

.bawd-complex table.complex-table .complex-toggle:focus-visible {
  box-shadow: 0 0 0 3px rgba(41, 152, 167, 0.25);
}

.bawd-complex table.complex-table .complex-toggle-icon {
  display: inline-block;
  width: 14px;
  color: #083F4B;
  font-weight: 900;
  text-align: center;
}

.bawd-complex table.complex-table .complex-toggle-label {
  color: #083F4B;
  font-weight: 900;
}

.bawd-complex table.complex-table .complex-note {
  margin-left: 12px;
  color: #5B6870;
  font-size: 0.75rem;
  font-weight: 700;
}

/* EXPENSES COMPLEX TABLE */
.bawd-complex.expenses-complex.expenses-complex-table .expenses-output {
  margin-top: 14px;
}

.bawd-complex.expenses-complex.expenses-complex-table .expenses-loading {
  color: #083F4B;
  font-size: 0.8125rem;
  font-weight: 700;
}

.bawd-complex.expenses-complex.expenses-complex-table table.expenses-table tr.expenses-total-row--cogs td.complex-label-cell {
  border-left: 4px solid #083F4B;
}

.bawd-complex.expenses-complex.expenses-complex-table table.expenses-table tr.expenses-total-row--fixed td.complex-label-cell {
  border-left: 4px solid #2998A7;
}

.bawd-complex.expenses-complex.expenses-complex-table table.expenses-table tr.expenses-total-row--personnel td.complex-label-cell {
  border-left: 4px solid #7ABFBE;
}

.bawd-complex.expenses-complex.expenses-complex-table table.expenses-table tr.expenses-total-row--startup td.complex-label-cell {
  border-left: 4px solid #CFE9EE;
}

.bawd-complex.expenses-complex.expenses-complex-table table.expenses-table tr.expenses-total-row--pl-adjustments td.complex-label-cell {
  border-left: 4px solid #0D6E82;
}

/* MOBILE COMPLEX CONTROLS */
@media (max-width: 640px) {
  .bawd-complex .complex-button {
    font-size: 0.75rem;
    padding: 7px 10px;
  }

  .bawd-complex .complex-button-group {
    gap: 5px;
  }

  .bawd-complex table.complex-table th,
  .bawd-complex table.complex-table td {
    font-size: 9px;
    padding: 5px 9px;
  }
}

/* COMPLEX YEAR COLUMN LOCK */
.bawd-complex table.complex-table thead th.complex-year-cell {
  background: #083F4B;
  color: #FFFFFF;
  font-weight: 900;
  text-align: right;
}

.bawd-complex table.complex-table tbody td.complex-year-cell,
.bawd-complex table.complex-table tr.complex-line-row td.complex-year-cell,
.bawd-complex table.complex-table tr.complex-total-row td.complex-year-cell {
  background: #CFE9EE;
  color: #083F4B;
  font-weight: 900;
  text-align: right;
}

/* COMPLEX GRAND TOTAL ROW */
.bawd-complex table.complex-table tr.complex-grand-total-row td {
  background: #083F4B;
  color: #FFFFFF;
  font-weight: 900;
  text-align: right;
  border-top: 3px solid #083F4B;
  border-bottom: 3px solid #083F4B;
}

.bawd-complex table.complex-table tr.complex-grand-total-row td.complex-label-cell {
  background: #083F4B;
  color: #FFFFFF;
  font-weight: 900;
  text-align: left;
}

.bawd-complex table.complex-table tr.complex-grand-total-row td.complex-year-cell {
  background: #0D6E82;
  color: #FFFFFF;
  font-weight: 900;
  text-align: right;
}

/* COMPLEX PANEL DECK */
.bawd-complex .complex-panel-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}

.bawd-complex .complex-panel-deck {
  max-width: 1400px;
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid #CFE9EE;
  border-radius: 10px;
  background: #F8FAFB;
}

.bawd-complex .complex-panel {
  min-height: 220px;
}

.bawd-complex .expenses-chart-panel::before {
  content: "Expenses chart panel";
  display: block;
  color: #083F4B;
  font-size: 0.875rem;
  font-weight: 900;
}

.bawd-complex .expenses-kpi-panel::before {
  content: "Expenses KPI panel";
  display: block;
  color: #083F4B;
  font-size: 0.875rem;
  font-weight: 900;
}

.bawd-complex .expenses-help-panel::before {
  content: "What is this?";
  display: block;
  color: #083F4B;
  font-size: 0.875rem;
  font-weight: 900;
}