:root {
  color-scheme: light;
  --navy-950: #0a1f3d;
  --navy-900: #0f2f5f;
  --navy-800: #16457e;
  --slate-950: #111827;
  --slate-900: #0f172a;
  --slate-800: #1f2937;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --white: #ffffff;
  --teal: #0f766e;
  --emerald: #047857;
  --amber: #b45309;
  --red: #b91c1c;
  --purple: #6d28d9;
  --blue: #1d4ed8;
  --border: #d7dee8;
  --shadow: 0 16px 35px rgba(15, 23, 42, 0.08);
  --radius: 8px;
  --sidebar: 300px;
  --sidebar-collapsed: 86px;
  --topbar: 72px;
  --focus: 0 0 0 3px rgba(29, 78, 216, 0.25);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--slate-50);
}

body {
  margin: 0;
  color: var(--slate-800);
  background: var(--slate-50);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select,
textarea,
summary {
  outline: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  box-shadow: var(--focus);
}

a {
  color: var(--navy-800);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
  color: var(--navy-900);
  white-space: nowrap;
}

.icon {
  width: 1.15em;
  height: 1.15em;
  flex: 0 0 auto;
  vertical-align: -0.18em;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

.app-shell.is-collapsed {
  grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  height: 100vh;
  color: #dbeafe;
  background: var(--navy-950);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.brand-lockup {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 100px;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
  display: grid;
  width: 62px;
  height: 52px;
  flex: 0 0 62px;
  place-items: center;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  background: #123d73;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
}

.brand-lockup strong,
.brand-lockup small {
  display: block;
}

.brand-lockup strong {
  color: #ffffff;
  font-size: 0.98rem;
  line-height: 1.25;
  letter-spacing: 0;
  text-wrap: balance;
}

.brand-lockup small {
  color: #bfdbfe;
  max-width: 100%;
  margin-top: 6px;
  padding-top: 0;
  font-size: 0.86rem;
  line-height: 1.28;
}

.brand-lockup div {
  min-width: 0;
  max-width: 100%;
  padding-block: 0;
}

.sidebar nav,
.mobile-drawer nav {
  display: grid;
  gap: 4px;
  padding: 12px;
}

.sidebar nav {
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
}

.sidebar nav a,
.mobile-drawer nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: inherit;
  font-weight: 650;
  text-decoration: none;
}

.sidebar nav a:hover,
.sidebar nav a.active,
.mobile-drawer nav a:hover,
.mobile-drawer nav a.active {
  background: rgba(255, 255, 255, 0.1);
}

.nav-group {
  margin: 14px 10px 4px;
  color: #93c5fd;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mobile-drawer .nav-group {
  margin-top: 10px;
}

.sidebar-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: auto 12px 14px;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  color: #dbeafe;
  cursor: pointer;
}

.is-collapsed .sidebar span:not(.brand-mark),
.is-collapsed .sidebar small,
.is-collapsed .sidebar strong,
.is-collapsed .sidebar-toggle span,
.is-collapsed .sidebar .nav-group {
  display: none;
}

.is-collapsed .brand-lockup,
.is-collapsed .sidebar nav a,
.is-collapsed .sidebar-toggle {
  justify-content: center;
}

.is-collapsed .brand-lockup {
  padding-inline: 10px;
}

.is-collapsed .sidebar nav {
  gap: 8px;
  padding: 14px 8px;
  overflow-x: hidden;
}

.is-collapsed .sidebar nav a {
  width: 52px;
  min-height: 52px;
  margin-inline: auto;
  padding: 0;
}

.is-collapsed .sidebar nav a .icon,
.is-collapsed .sidebar-toggle .icon {
  width: 22px;
  height: 22px;
}

.is-collapsed .sidebar-toggle {
  width: 52px;
  min-height: 52px;
  margin-inline: auto;
  padding: 0;
}

.app-main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--topbar);
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
}

.topbar-title {
  min-width: 0;
  flex: 1;
}

.topbar-title span,
.breadcrumb,
.field small,
.summary-copy small,
.panel-head p,
.page-heading p,
.last-updated,
.applied-filters {
  color: var(--slate-600);
}

.topbar-title strong {
  display: block;
  color: var(--slate-950);
  font-size: 1.08rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.connection-state,
.alert-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--slate-700);
  font-weight: 650;
}

.alert-pill {
  color: var(--red);
  text-decoration: none;
}

#main-content {
  width: min(100%, 1600px);
  margin: 0 auto;
  padding: 24px;
}

#main-content:focus {
  outline: none;
}

.page-heading,
.profile-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.page-heading h1,
.profile-header h1 {
  margin: 0;
  color: var(--slate-950);
  font-size: clamp(1.65rem, 2vw, 2.15rem);
  line-height: 1.15;
  letter-spacing: 0;
}

.breadcrumb {
  margin: 0 0 4px;
  font-weight: 700;
}

.page-actions,
.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.action-row .btn {
  padding: 14px 28px;
}

.profile-actions {
  display: grid;
  grid-template-columns: max-content max-content;
  justify-content: end;
  align-content: start;
  min-width: min(430px, 100%);
}

.profile-actions .btn {
  min-height: 54px;
}

.profile-actions [data-action="print-page"] {
  grid-column: 1 / -1;
  width: 100%;
}

.btn,
.icon-btn,
.row-actions button,
.row-actions a,
.data-table button,
.mobile-card-actions button,
.mobile-card-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 750;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--navy-900);
  color: #ffffff;
}

.btn-secondary {
  border-color: var(--border);
  background: var(--white);
  color: var(--navy-900);
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--slate-700);
}

.btn:disabled,
button:disabled,
.btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.icon-btn {
  width: 44px;
  padding: 0;
  border-color: var(--border);
  background: var(--white);
  color: var(--slate-700);
}

.menu-button {
  display: none;
}

.panel,
.summary-card,
.state-card,
.mobile-record-card,
.report-preview {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.panel-head h2,
.form-section-heading h2,
.state-card h2 {
  margin: 0;
  color: var(--slate-950);
  font-size: 1.05rem;
  letter-spacing: 0;
}

.panel-head p,
.form-section-heading p {
  margin: 4px 0 0;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.summary-grid.compact {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.summary-card {
  display: flex;
  gap: 12px;
  min-height: 126px;
  padding: 16px;
  color: inherit;
  text-decoration: none;
}

.summary-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: var(--radius);
  background: #e0f2fe;
  color: var(--navy-900);
}

.summary-copy span,
.summary-copy small,
.summary-copy em {
  display: block;
}

.summary-copy span {
  font-weight: 750;
}

.summary-copy strong {
  display: block;
  margin: 6px 0 4px;
  color: var(--slate-950);
  font-size: 1.5rem;
  line-height: 1.1;
}

.summary-copy em {
  color: var(--emerald);
  font-style: normal;
  font-weight: 750;
}

.control-panel,
.list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin: 14px 0 0;
}

.table-pagination span {
  color: var(--slate-600);
  font-size: 0.9rem;
  font-weight: 750;
}

.control-panel label,
.list-toolbar label,
.filter-grid label,
.mapping-grid label {
  display: grid;
  gap: 5px;
  color: var(--slate-600);
  font-size: 0.9rem;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius);
  background: var(--white);
  color: var(--slate-900);
  padding: 10px 12px;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

input[readonly] {
  background: var(--slate-100);
  color: var(--slate-600);
}

.search-input {
  position: relative;
  flex: 1 1 300px;
}

.search-input .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--slate-500);
}

.search-input input {
  padding-left: 38px;
  padding-right: 48px;
}

.search-input input::-webkit-search-cancel-button,
.search-input input::-webkit-search-decoration {
  -webkit-appearance: none;
  margin: 0;
}

.search-input button {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  min-height: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.filter-details,
.column-details {
  position: relative;
}

summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--navy-900);
  font-weight: 750;
  cursor: pointer;
}

.filter-grid,
.column-toggles {
  position: absolute;
  z-index: 30;
  right: 0;
  top: calc(100% + 8px);
  display: grid;
  width: min(720px, calc(100vw - 36px));
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.column-toggles {
  width: 300px;
  grid-template-columns: 1fr;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chips button {
  min-height: 34px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--navy-900);
  cursor: pointer;
}

.setup-filter-shell,
.report-filter-shell,
.module-filter-shell {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.setup-filter-shell .toolbar-row {
  align-items: center;
  justify-content: space-between;
}

.setup-filter-details,
.report-filter-details,
.module-filter-details {
  width: fit-content;
}

.setup-filter-details .filter-grid,
.report-filter-details .filter-grid,
.module-filter-details .filter-grid {
  left: 0;
  right: auto;
}

.muted {
  color: var(--slate-600);
  font-weight: 750;
}

.phase-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 170px;
}

.phase-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--slate-50);
  color: var(--navy-900);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.phase-chip .status-badge {
  min-height: 22px;
  padding: 2px 6px;
  font-size: 0.72rem;
}

.archive-mini {
  border-radius: 999px;
  background: #e5e7eb;
  color: var(--slate-700);
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1;
  padding: 5px 7px;
}

.phase-more {
  color: var(--slate-600);
  font-size: 0.78rem;
  font-weight: 850;
}

.result-count {
  margin: 0 0 0 auto;
  color: var(--slate-600);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
}

.dashboard-grid.supporting-charts {
  align-items: stretch;
}

.supporting-charts .svg-chart-card {
  height: 100%;
}

.setup-payment-analytics {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.setup-payment-analytics .panel-head {
  align-items: center;
}

.payment-progress-value {
  color: #20bf72;
  font-size: 1.25rem;
  white-space: nowrap;
}

.payment-bar-chart-wrap {
  width: 100%;
  overflow: hidden;
  padding: 4px 0 2px;
}

.payment-bar-chart {
  display: block;
  width: 100%;
  min-height: 260px;
}

.payment-bar-chart text {
  fill: var(--slate-700);
  font-size: 0.76rem;
  font-weight: 850;
}

.payment-bar-chart rect {
  filter: drop-shadow(0 8px 14px rgba(15, 47, 95, 0.11));
}

.payment-bar-chart .is-fund {
  fill: #20bf72;
}

.payment-bar-chart .is-paid {
  fill: #102c6d;
}

.payment-bar-chart .is-balance {
  fill: #8ea1b8;
}

.payment-chart-grid {
  stroke: #e2e8f0;
  stroke-width: 1;
}

.payment-chart-axis {
  stroke: #d7dee8;
  stroke-width: 1;
}

.payment-bar-chart .zero-bar-marker {
  stroke: #102c6d;
  stroke-linecap: round;
  stroke-width: 3;
}

.payment-bar-chart .payment-chart-axis-label {
  fill: #6b7f99;
  font-size: 0.62rem;
}

.payment-bar-chart .payment-chart-value {
  fill: #244262;
  font-size: 0.56rem;
  font-weight: 850;
}

.payment-bar-chart .payment-chart-value.is-inside {
  fill: rgba(255, 255, 255, 0.9);
}

.payment-bar-chart .payment-chart-label {
  fill: #22334a;
  font-size: 0.68rem;
  font-weight: 850;
}

.payment-progress-chart {
  display: grid;
  gap: 14px;
}

.payment-progress-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(220px, 2fr) minmax(130px, auto);
  align-items: center;
  gap: 14px;
  color: var(--slate-700);
  font-weight: 850;
}

.payment-progress-row strong {
  color: var(--navy);
  text-align: right;
}

.payment-progress-track {
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6edf5;
}

.payment-progress-track i {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
}

.payment-progress-track .is-fund {
  background: var(--navy);
}

.payment-progress-track .is-paid {
  background: var(--green);
}

.payment-progress-track .is-balance {
  background: #e49a12;
}

.payment-analytics-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.payment-analytics-metrics span {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--slate-50);
  color: var(--navy);
  font-weight: 900;
}

.payment-analytics-metrics b {
  color: var(--slate-600);
  font-size: 0.78rem;
}

.dashboard-table-card {
  overflow: hidden;
  padding: 0;
}

.dashboard-table-card .panel-head {
  min-height: 76px;
  margin: 0;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  background: #fbfdff;
}

.dashboard-table-wrap {
  max-height: 320px;
  overflow: auto;
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.dashboard-table th,
.dashboard-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.dashboard-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef4fb;
  color: var(--slate-700);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.dashboard-table tr:last-child td {
  border-bottom: 0;
}

.dashboard-table tbody tr:nth-child(odd) {
  background: #fbfdff;
}

.dashboard-table tbody tr:hover {
  background: #f0f7ff;
}

.dashboard-table .is-right {
  text-align: right;
}

.dashboard-row-label {
  color: var(--slate-950);
  font-weight: 800;
}

.dashboard-metric {
  display: grid;
  min-width: 128px;
  gap: 6px;
  justify-items: end;
}

.dashboard-metric strong {
  color: var(--slate-950);
  font-variant-numeric: tabular-nums;
}

.metric-track {
  display: block;
  width: min(150px, 100%);
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--slate-100);
}

.metric-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--navy-800);
}

.dashboard-empty {
  display: grid;
  min-height: 148px;
  place-items: center;
  padding: 18px;
  color: var(--slate-600);
  text-align: center;
}

.attention-type {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #fee2e2;
  color: var(--red);
  font-size: 0.82rem;
  font-weight: 850;
  white-space: nowrap;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--slate-100);
  color: var(--slate-700);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.chart-card {
  min-height: 320px;
}

.chart-canvas-wrap {
  position: relative;
  width: 100%;
  height: 360px;
  padding: 8px 0;
}

.chart-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.bar-chart {
  display: flex;
  align-items: end;
  gap: 10px;
  height: 205px;
  padding: 12px 4px 0;
}

.bar-item {
  display: grid;
  flex: 1;
  align-items: end;
  min-width: 28px;
  height: 100%;
  gap: 7px;
}

.bar-item span {
  display: block;
  min-height: 8px;
  border-radius: 6px 6px 0 0;
  background: var(--navy-800);
}

.bar-item small {
  color: var(--slate-600);
  text-align: center;
  writing-mode: vertical-rl;
}

.line-chart {
  width: 100%;
  height: 220px;
  color: var(--teal);
}

.line-chart circle {
  fill: var(--navy-900);
}

.donut-wrap {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.donut-chart {
  width: 180px;
  height: 180px;
  transform: rotate(-90deg);
}

.donut-chart circle {
  fill: none;
  stroke-width: 14;
  stroke: var(--navy-800);
}

.donut-chart text {
  transform: rotate(90deg);
  transform-origin: 50% 50%;
  text-anchor: middle;
  font-weight: 800;
  fill: var(--slate-950);
}

.donut-1 {
  stroke: var(--teal) !important;
}

.donut-2 {
  stroke: var(--amber) !important;
}

.donut-3 {
  stroke: var(--red) !important;
}

.donut-4 {
  stroke: var(--purple) !important;
}

.donut-wrap ul,
.attention-list,
.error-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.donut-wrap li,
.attention-list li,
.error-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--slate-50);
}

.legend-dot,
.status-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: currentColor;
}

.chart-empty {
  display: grid;
  min-height: 200px;
  place-items: center;
  color: var(--slate-600);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--slate-50);
}

.compact-chart-empty {
  min-height: 150px;
  margin-top: 8px;
}

.svg-chart-card,
.performance-chart-card {
  overflow: hidden;
}

.svg-chart-card {
  display: flex;
  flex-direction: column;
}

.performance-chart-scroll {
  overflow-x: hidden;
  overflow-y: hidden;
  padding: 4px 0 8px;
}

.performance-chart-scroll:focus-visible {
  outline: 2px solid var(--navy-700);
  outline-offset: 3px;
}

.responsive-chart {
  display: block;
  width: 100%;
  height: auto;
  min-height: 220px;
  overflow: visible;
}

.responsive-chart.performance-chart {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.responsive-chart text {
  fill: var(--slate-600);
  font-size: 0.78rem;
  font-weight: 750;
}

.responsive-chart g:focus {
  outline: none;
}

.responsive-chart g:focus rect,
.responsive-chart g:focus circle {
  filter: drop-shadow(0 0 0.35rem rgba(29, 78, 216, 0.35));
}

.chart-axis {
  stroke: #cbd5e1;
  stroke-width: 1;
}

.performance-chart .chart-grid-line {
  stroke: #dbe4ef;
  stroke-width: 1;
}

.performance-chart .chart-axis-title {
  fill: var(--slate-700);
  font-size: 0.78rem;
  font-weight: 850;
}

.performance-chart text {
  fill: var(--slate-700);
  font-size: 0.78rem;
  font-weight: 800;
}

.performance-chart .performance-x-label {
  font-size: 0.72rem;
}

.performance-chart .performance-point-label {
  fill: var(--slate-900);
  font-size: 0.8rem;
  font-weight: 900;
}

.performance-chart .rate-hit-point {
  fill: transparent;
  stroke: transparent;
}

.svg-chart-card .responsive-chart {
  min-height: 160px;
}

.distribution-chart {
  margin-top: 4px;
  align-self: start;
}

.distribution-chart .chart-label {
  fill: var(--slate-950);
  font-size: 0.82rem;
  font-weight: 850;
}

.distribution-chart .chart-value {
  fill: var(--slate-700);
  font-size: 0.8rem;
  font-weight: 850;
}

.chart-track {
  fill: #e7edf4;
}

.chart-bar {
  transition: width 160ms ease;
}

.chart-breakdown {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.chart-breakdown li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fbfdff;
}

.chart-breakdown span,
.chart-breakdown strong {
  min-width: 0;
}

.chart-breakdown span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--slate-800);
  font-weight: 750;
}

.chart-breakdown i {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.chart-breakdown strong {
  color: var(--slate-950);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chart-breakdown small {
  color: var(--slate-500);
  font-weight: 800;
}

.chart-summary {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 8px;
  color: var(--slate-700);
  font-size: 0.88rem;
  font-weight: 800;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.chart-legend i {
  width: 22px;
  height: 10px;
  border-radius: 999px;
}

.legend-target,
.bar-target {
  fill: #37a2a6;
  background: #37a2a6;
}

.legend-actual,
.bar-actual {
  fill: #102c6d;
  background: #102c6d;
}

.legend-rate {
  background: #f59e0b;
}

.rate-line {
  fill: none;
  stroke: #f59e0b;
  stroke-width: 3;
}

.rate-point {
  fill: #f59e0b;
  stroke: var(--white);
  stroke-width: 2;
}

.setup-filter-panel label {
  flex: 1 1 190px;
}

.underlying-data {
  margin-bottom: 16px;
}

.underlying-data > summary {
  margin-bottom: 12px;
}

.underlying-data .dashboard-table-card {
  border: 0;
  box-shadow: none;
}

.delinquent-panel {
  margin-bottom: 18px;
}

.delinquent-panel + .supporting-charts {
  margin-top: 18px;
}

.setup-kpis .summary-card {
  min-height: 118px;
}

.quick-actions {
  margin-bottom: 18px;
}

.reference-dashboard {
  position: relative;
  display: grid;
  gap: 28px;
  padding: 34px;
  overflow: hidden;
  border: 1px solid #bfe7d2;
  border-radius: var(--radius);
  background: #dff8ec;
}

.reference-dashboard-decor {
  position: absolute;
  top: -18px;
  right: 24px;
  width: 230px;
  height: 100px;
  opacity: 0.75;
  pointer-events: none;
}

.reference-dashboard-decor::before,
.reference-dashboard-decor::after {
  position: absolute;
  content: "";
}

.reference-dashboard-decor::before {
  inset: 0 64px 18px 0;
  background-image: radial-gradient(#0f2f5f 1px, transparent 1px);
  background-size: 9px 9px;
  transform: rotate(16deg);
}

.reference-dashboard-decor::after {
  right: 0;
  top: 0;
  width: 86px;
  height: 86px;
  border-radius: 0 0 0 38px;
  background: #20bf72;
}

.reference-dashboard-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.reference-dashboard-head h1 {
  margin: 0;
  color: #172033;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.reference-dashboard-head p {
  max-width: 920px;
  margin: 10px 0 0;
  color: #334155;
}

.reference-dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  max-width: 560px;
}

.reference-dashboard-actions label {
  display: grid;
  min-width: 150px;
  gap: 5px;
  color: #334155;
  font-size: 0.84rem;
  font-weight: 850;
}

.reference-dashboard-actions input,
.reference-dashboard-actions select {
  min-height: 40px;
  background: #ffffff;
}

.reference-kpi-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.reference-kpi-card {
  position: relative;
  display: grid;
  min-height: 116px;
  place-items: center;
  padding: 48px 22px 22px;
  border: 1px solid #cfdbe8;
  border-radius: 4px;
  background: #ffffff;
  color: #172033;
  text-align: center;
  text-decoration: none;
}

.reference-kpi-card:hover {
  text-decoration: none;
  border-color: #9ab9d4;
}

.reference-kpi-ribbon {
  position: absolute;
  top: -13px;
  left: 8%;
  right: 8%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 900;
  box-shadow: 0 10px 20px rgba(15, 47, 95, 0.1);
}

.reference-kpi-green {
  background: #20bf72;
}

.reference-kpi-navy {
  background: #102c6d;
}

.reference-kpi-card strong {
  display: block;
  color: #172033;
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.reference-kpi-card small {
  max-width: 240px;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 700;
}

.reference-main-grid,
.reference-lower-grid {
  display: grid;
  gap: 26px;
}

.reference-main-grid {
  grid-template-columns: minmax(0, 1fr);
}

.reference-lower-grid {
  grid-template-columns: minmax(0, 2fr) minmax(250px, 1fr) minmax(250px, 1fr);
}

.reference-panel {
  position: relative;
  min-width: 0;
  border: 1px solid #cfdbe8;
  border-radius: 4px;
  background: #ffffff;
}

.reference-chart-panel,
.reference-due-panel,
.reference-small-panel {
  padding: 56px 28px 26px;
}

.reference-panel-title {
  position: absolute;
  top: -18px;
  left: 50%;
  min-width: min(320px, 75%);
  min-height: 38px;
  padding: 10px 24px;
  border-radius: 8px;
  color: #ffffff;
  text-align: center;
  font-weight: 900;
  transform: translateX(-50%);
}

.reference-title-green {
  background: #20bf72;
}

.reference-title-navy {
  background: #102c6d;
}

.reference-chart-copy {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
  margin-bottom: 8px;
}

.reference-chart-copy p {
  margin: 0;
  color: #334155;
  font-size: 0.86rem;
}

.reference-chart-copy strong {
  color: #20a96a;
  font-size: 0.9rem;
}

.reference-chart-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 0 10px;
  scrollbar-gutter: stable;
}

.reference-chart-scroll.no-scroll {
  overflow-x: hidden;
  padding-bottom: 2px;
  scrollbar-gutter: auto;
}

.reference-chart-scroll:focus-visible {
  outline: 3px solid rgba(15, 47, 95, 0.22);
  outline-offset: 3px;
}

.reference-line-chart,
.reference-comparison-chart {
  display: block;
  width: auto;
  min-width: 100%;
  max-width: none;
  height: auto;
  min-height: 430px;
  overflow: visible;
}

.reference-chart-scroll.no-scroll .reference-line-chart,
.reference-chart-scroll.no-scroll .reference-comparison-chart {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.reference-chart-scroll.no-scroll .reference-comparison-chart {
  min-height: 360px;
}

.reference-grid-line {
  stroke: #d7dee8;
  stroke-width: 1;
}

.reference-line-path {
  fill: none;
  stroke: #20bf72;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.reference-line-point {
  fill: #20bf72;
  stroke: #ffffff;
  stroke-width: 2;
}

.reference-line-hit {
  fill: transparent;
  stroke: transparent;
}

.reference-line-chart text,
.reference-comparison-chart text {
  fill: #334155;
  font-size: 0.78rem;
  font-weight: 750;
}

.reference-axis-label {
  fill: #64748b;
  font-size: 0.68rem;
  font-weight: 700;
}

.reference-axis-title {
  fill: #0f2f5f;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.reference-point-value {
  fill: #0f2f5f;
  font-size: 0.7rem;
  font-weight: 900;
}

.reference-x-label {
  fill: #334155;
  font-size: 0.64rem;
  font-weight: 850;
}

.reference-x-title {
  fill: #0f2f5f;
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.03em;
}

.reference-target-bar,
.reference-actual-bar {
  fill: #20bf72;
}

.reference-actual-bar {
  fill: #102c6d;
}

.reference-legend {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 850;
}

.reference-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.reference-legend i {
  width: 14px;
  height: 8px;
  border-radius: 999px;
}

.reference-legend .is-target {
  background: #20bf72;
}

.reference-legend .is-actual {
  background: #102c6d;
}

.reference-table-wrap {
  max-height: 250px;
  overflow: auto;
}

.reference-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.reference-table th,
.reference-table td {
  padding: 10px 12px;
  border: 1px solid #dbe3ed;
  text-align: left;
  vertical-align: middle;
}

.reference-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #20bf72;
  color: #ffffff;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}

.reference-table td {
  background: #ffffff;
}

.reference-table tbody tr:nth-child(even) td {
  background: #f8fbff;
}

.reference-small-panel h2 {
  margin: 0 0 12px;
  color: #172033;
  font-size: 1rem;
  text-align: center;
}

.reference-donut-wrap {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.reference-donut {
  width: 160px;
  height: 160px;
  transform: rotate(-90deg);
}

.reference-donut circle {
  fill: none;
  stroke-width: 14;
}

.reference-donut text {
  fill: #172033;
  font-size: 1.15rem;
  font-weight: 900;
  text-anchor: middle;
  transform: rotate(90deg);
  transform-origin: 52px 52px;
}

.reference-donut-wrap ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.reference-donut-wrap li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 800;
}

.reference-donut-wrap li strong {
  color: #0f2f5f;
  font-size: 0.82rem;
  font-weight: 950;
}

.reference-donut-wrap i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
}

.reference-small-footer {
  margin: 10px 0 0;
  color: #172033;
  font-size: 0.84rem;
  font-weight: 850;
}

.reference-source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.reference-source-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #cfdbe8;
  border-radius: 6px;
  background: #ffffff;
}

.reference-source-head {
  display: grid;
  gap: 8px;
  padding: 18px 18px 14px;
}

.reference-source-head h2 {
  margin: 0;
  color: #111827;
  font-size: 1.05rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.reference-source-head p {
  margin: 0;
  color: #475569;
}

.reference-source-table-wrap {
  max-height: 352px;
  overflow: auto;
  border-top: 1px solid #d8e2ee;
}

.reference-source-table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  table-layout: fixed;
}

.reference-source-table th,
.reference-source-table td {
  padding: 13px 14px;
  border-bottom: 1px solid #d8e2ee;
  vertical-align: middle;
}

.reference-source-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eaf2fb;
  color: #0f2f5f;
  font-size: 0.72rem;
  font-weight: 900;
  text-align: left;
  text-transform: uppercase;
}

.reference-source-table td {
  color: #0f172a;
  background: #ffffff;
}

.reference-source-table tbody tr:nth-child(even) td {
  background: #fbfdff;
}

.reference-source-table .is-label {
  font-weight: 900;
}

.reference-source-table .is-right {
  text-align: right;
}

.reference-source-table .dashboard-metric {
  margin-left: auto;
  min-width: 0;
  width: 100%;
}

.reference-source-table .metric-track {
  width: 100%;
  max-width: 170px;
}

.reference-dashboard-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: #334155;
  font-size: 0.86rem;
  font-weight: 750;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.attention-list li {
  align-items: flex-start;
  flex-direction: column;
}

.attention-list span {
  color: var(--red);
  font-weight: 800;
}

.attention-list em {
  color: var(--slate-600);
  font-style: normal;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-success {
  background: #dcfce7;
  color: #166534;
}

.status-danger {
  background: #fee2e2;
  color: #991b1b;
}

.status-warning {
  background: #fef3c7;
  color: #92400e;
}

.status-info {
  background: #dbeafe;
  color: #1e40af;
}

.status-review {
  background: #e0f2fe;
  color: #075985;
}

.status-purple {
  background: #ede9fe;
  color: #5b21b6;
}

.status-neutral {
  background: var(--slate-100);
  color: var(--slate-700);
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
}

.data-table {
  width: 100%;
  min-width: 1050px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.92rem;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eef4fb;
  color: var(--slate-700);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.payment-history-table {
  min-width: 520px;
}

.payment-history-table tfoot td {
  border-top: 2px solid var(--border);
  border-bottom: 0;
  background: var(--slate-50);
  color: var(--navy);
  font-weight: 900;
}

.data-table th:first-child,
.data-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: inherit;
}

.data-table th:first-child {
  z-index: 3;
  background: #eef4fb;
}

.data-table th[data-col="actions"],
.data-table td[data-col="actions"] {
  position: sticky;
  right: 0;
  z-index: 2;
  min-width: 148px;
  background: inherit;
  box-shadow: -10px 0 14px -14px rgba(15, 23, 42, 0.72);
}

.data-table th[data-col="actions"] {
  z-index: 4;
  background: #eef4fb;
}

.monthly-gross-sales-table th.sticky-col-1,
.monthly-gross-sales-table td.sticky-col-1 {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fff;
  min-width: 80px;
  width: 80px;
}

.monthly-gross-sales-table th.sticky-col-2,
.monthly-gross-sales-table td.sticky-col-2 {
  position: sticky;
  left: 80px;
  z-index: 3;
  background: #fff;
  min-width: 200px;
  width: 200px;
  box-shadow: 6px 0 8px -8px rgba(15, 23, 42, 0.3);
}

.monthly-gross-sales-table thead th.sticky-col-1 {
  z-index: 5;
  background: #eef4fb;
}

.monthly-gross-sales-table thead th.sticky-col-2 {
  z-index: 5;
  background: #eef4fb;
}

.monthly-gross-sales-table tbody tr:nth-child(odd) td.sticky-col-1,
.monthly-gross-sales-table tbody tr:nth-child(odd) td.sticky-col-2 {
  background: #fbfdff;
}

.monthly-gross-sales-table tbody tr:hover td.sticky-col-1,
.monthly-gross-sales-table tbody tr:hover td.sticky-col-2 {
  background: #f0f7ff;
}

.additional-employment-table th.sticky-col-1,
.additional-employment-table td.sticky-col-1 {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fff;
  min-width: 80px;
  width: 80px;
}

.additional-employment-table th.sticky-col-2,
.additional-employment-table td.sticky-col-2 {
  position: sticky;
  left: 80px;
  z-index: 3;
  background: #fff;
  min-width: 180px;
  width: 180px;
  box-shadow: 6px 0 8px -8px rgba(15, 23, 42, 0.3);
}

.additional-employment-table thead th.sticky-col-1 {
  z-index: 5;
  background: #eef4fb;
}

.additional-employment-table thead th.sticky-col-2 {
  z-index: 5;
  background: #eef4fb;
}

.additional-employment-table tbody tr:nth-child(odd) td.sticky-col-1,
.additional-employment-table tbody tr:nth-child(odd) td.sticky-col-2 {
  background: #fbfdff;
}

.additional-employment-table tbody tr:hover td.sticky-col-1,
.additional-employment-table tbody tr:hover td.sticky-col-2 {
  background: #f0f7ff;
}

.data-table td[data-col="actions"] {
  background: var(--white);
}

.data-table tbody tr:nth-child(odd) td[data-col="actions"] {
  background: #fbfdff;
}

.data-table tbody tr:hover td[data-col="actions"] {
  background: #f0f7ff;
}

.data-table tbody tr:nth-child(odd) {
  background: #fbfdff;
}

.data-table tbody tr:hover {
  background: #f0f7ff;
}

.data-table th button {
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-transform: inherit;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: fit-content;
}

.row-actions a,
.row-actions button,
.data-table button {
  min-height: 34px;
  padding: 6px 9px;
  border-color: var(--border);
  background: var(--white);
  color: var(--navy-800);
}

.mobile-record-list {
  display: none;
}

.mobile-record-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.mobile-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.mobile-card-head h3 {
  margin: 0;
  color: var(--slate-950);
  font-size: 1rem;
}

.mobile-card-head p {
  margin: 2px 0 0;
  color: var(--slate-600);
}

.mobile-record-card dl,
.detail-panel dl,
.report-preview dl,
.comparison-drawer dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.mobile-record-card dt,
.detail-panel dt {
  color: var(--slate-600);
  font-size: 0.82rem;
  font-weight: 800;
}

.mobile-record-card dd,
.detail-panel dd {
  margin: 0;
  color: var(--slate-950);
  font-weight: 750;
}

.mobile-card-actions {
  display: flex;
  gap: 8px;
}

.record-form,
.wizard,
.archive-grid {
  display: grid;
  gap: 18px;
}

.form-section {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
}

.field {
  display: grid;
  grid-template-rows: auto minmax(44px, auto) minmax(1.2em, auto) minmax(1.2em, auto);
  gap: 6px;
  color: var(--slate-700);
  font-weight: 750;
}

.field textarea {
  align-self: stretch;
}

.field small {
  min-height: 1.2em;
}

.address-field {
  align-self: start;
}

.address-field input,
.address-field select {
  min-height: 46px;
}

.segmented-field {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.segmented-field legend {
  flex: 0 0 100%;
  color: var(--slate-700);
  font-weight: 800;
}

.segmented-field label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--slate-700);
  font-weight: 800;
}

.segmented-field input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--navy-900);
}

.field span b {
  color: var(--red);
  padding-left: 2px;
}

.span-2 {
  grid-column: 1 / -1;
}

.field-error,
[data-import-file-error] {
  min-height: 1.2em;
  color: var(--red);
  font-size: 0.86rem;
  font-style: normal;
}

[aria-invalid="true"] {
  border-color: var(--red);
}

.error-summary {
  padding: 14px;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  background: #fef2f2;
  color: var(--red);
}

.error-summary ul {
  margin-bottom: 0;
}

.file-upload {
  display: grid;
  min-height: 132px;
  place-items: center;
  gap: 6px;
  padding: 16px;
  border: 1px dashed #94a3b8;
  border-radius: var(--radius);
  background: var(--slate-50);
  color: var(--slate-700);
  text-align: center;
  cursor: pointer;
}

.file-upload input {
  max-width: 280px;
}

.moa-upload-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.moa-upload-field > span {
  font-weight: 600;
  color: var(--heading);
}

.moa-upload-field > small {
  color: var(--slate-500);
  font-size: 0.8em;
  margin-bottom: 4px;
}

.moa-upload-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--slate-100);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.moa-upload-status .moa-file-name {
  flex: 1;
  font-weight: 500;
  color: var(--heading);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.moa-upload-empty {
  padding: 8px 12px;
  background: var(--slate-50);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--slate-500);
  font-style: italic;
  font-size: 0.9em;
}

.moa-file-input {
  margin-top: 4px;
}

.subform,
.financial-preview,
.calculation-callout,
.legacy-info,
.service-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--slate-50);
}

.subform,
.financial-preview,
.calculation-callout,
.service-card {
  padding: 14px;
}

.financial-preview,
.calculation-callout {
  display: grid;
  gap: 8px;
  color: var(--slate-700);
  font-weight: 750;
}

.financial-preview strong,
.calculation-callout strong {
  color: var(--slate-950);
}

.peso-note {
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  background: #eff6ff;
  color: var(--navy-900);
  font-weight: 750;
}

.peso-note strong {
  font-weight: 900;
}

.service-editor,
.service-list,
.service-timeline {
  display: grid;
  gap: 12px;
}

.service-card {
  display: grid;
  gap: 12px;
}

.service-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.service-card strong,
.service-timeline strong {
  color: var(--slate-950);
}

.service-card p,
.service-timeline p {
  margin: 4px 0 0;
  color: var(--slate-600);
}

.setup-phase-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 12px;
  border: 1px dashed #bfdbfe;
  border-radius: var(--radius);
  background: var(--white);
}

.mini-panel-head,
.expected-output-row,
.expected-output-report-row {
  display: grid;
  gap: 10px;
}

.mini-panel-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.form003-draft-section .mini-panel-head {
  min-width: 0;
}

.form003-draft-section .mini-panel-head .btn {
  justify-self: end;
  white-space: nowrap;
}

.mini-panel-head h4,
.mini-panel-head p {
  margin: 0;
}

.mini-panel-head p {
  color: var(--slate-600);
}

.expected-output-editor,
.expected-output-report-editor {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--slate-50);
}

.expected-output-list,
.expected-output-report-list {
  display: grid;
  gap: 10px;
}

.activity-row {
  display: grid;
  grid-template-columns: 180px 1fr 150px 90px;
  gap: 14px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
}

.activity-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.activity-cell-label {
  font-size: 0.78rem;
  font-weight: 750;
  color: var(--slate-700);
}

.activity-cell input[type="date"],
.activity-cell input[type="text"] {
  height: 38px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.88rem;
}

.activity-cell textarea {
  min-height: 60px;
  max-height: 120px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.88rem;
  resize: vertical;
}

.activity-check-cell {
  justify-content: flex-start;
}

.activity-checkbox-label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

.activity-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #0891b2;
}

.activity-action-cell {
  justify-content: flex-start;
}

.activity-action-cell .btn {
  height: 38px;
}

.activity-row + .activity-row {
  margin-top: -1px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.form003-draft-section {
  display: grid;
  min-width: 0;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--slate-50);
  overflow: hidden;
}

.status-report-actions {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.status-report-actions .btn {
  justify-content: center;
  min-width: 132px;
  white-space: nowrap;
}

.form003-draft-list {
  display: grid;
  min-width: 0;
  gap: 14px;
}

.form003-draft-row {
  display: grid;
  min-width: 0;
  column-gap: 18px;
  row-gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
}

.activity-draft-row {
  padding: 0;
  border: none;
  background: transparent;
}

.activity-draft-row .activity-cell input[type="date"],
.activity-draft-row .activity-cell input[type="text"] {
  border: 1px solid var(--border);
}

.activity-draft-row .activity-cell textarea {
  border: 1px solid var(--border);
}

.equipment-draft-row {
  position: relative;
  grid-template-columns: minmax(88px, 0.25fr) minmax(220px, 1fr) minmax(130px, 0.45fr) minmax(180px, 0.75fr);
  align-items: end;
  padding-right: 144px;
}

.equipment-draft-row .field:nth-of-type(5) {
  grid-column: 1 / -1;
}

.expected-draft-row {
  grid-template-columns: repeat(3, minmax(0, 1fr)) 112px;
  align-items: center;
}

.form003-draft-row textarea {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  resize: vertical;
}

.form003-draft-row .field,
.form003-draft-row input {
  min-width: 0;
}

.form003-draft-row [data-action="remove-form003-row"] {
  align-self: center;
  justify-self: end;
  min-width: 104px;
}

.checkbox-field {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  padding: 4px 0;
  min-height: 0;
  grid-template-rows: unset;
  grid-column: span 1;
}

.checkbox-field span {
  order: 1;
  color: var(--text);
  font-weight: 700;
  font-size: 0.92rem;
}

.checkbox-field input[type="checkbox"] {
  order: 2;
  width: 16px;
  height: 16px;
  accent-color: #0891b2;
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-field .field-error {
  display: none;
}

.equipment-draft-row [data-action="remove-form003-row"] {
  position: absolute;
  top: 16px;
  right: 16px;
  grid-column: auto;
  grid-row: auto;
  align-self: auto;
  justify-self: auto;
}

.calculation-callout.compact {
  padding: 10px 12px;
  gap: 4px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.expected-output-report-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
}

.warning-callout {
  border-color: #fbbf24;
  background: #fffbeb;
}

.setup-phase-panel {
  margin-top: 16px;
}

.setup-phase-table-wrap {
  overflow-x: auto;
}

.setup-phase-table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
}

.setup-phase-table th,
.setup-phase-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.setup-phase-table th {
  color: var(--slate-600);
  font-size: 0.82rem;
  font-weight: 850;
  text-transform: uppercase;
}

.setup-phase-table td {
  color: var(--slate-950);
  font-weight: 700;
}

.legacy-info {
  grid-column: 1 / -1;
  padding: 10px 12px;
}

.legacy-info summary {
  min-height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
}

.legacy-info dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0 0;
}

.legacy-info dt {
  color: var(--slate-600);
  font-size: 0.82rem;
  font-weight: 800;
}

.legacy-info dd {
  margin: 0;
  color: var(--slate-950);
  font-weight: 750;
}

.is-hidden {
  display: none !important;
}

.legacy-info {
  display: none !important;
}

.record-form .sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px;
  margin-top: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.profile-header {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.tabs button {
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--slate-700);
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.tabs button.active {
  background: var(--navy-900);
  color: #ffffff;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.detail-grid > * {
  min-width: 0;
}

.detail-grid .data-table {
  min-width: 0;
  width: 100%;
}

.market-outlets-scroll {
  width: 100%;
  overflow-x: auto;
}

.market-outlets-scroll .data-table {
  min-width: 560px;
}

.market-outlets-scroll th,
.market-outlets-scroll td {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.overview-card {
  background: var(--white, #ffffff);
  border: 1px solid var(--border, #d6e0ee);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  min-width: 0;
  overflow: hidden;
}
.overview-card--full {
  grid-column: 1 / -1;
}

.overview-card--standard {
  grid-column: auto;
}

.overview-card--standard .overview-table {
  min-width: 0;
}
.overview-card-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--slate-950, #0f172a);
  margin: 0 0 4px;
}
.overview-card-helper {
  font-size: 0.82rem;
  color: var(--muted, #475569);
  margin: 0 0 16px;
  line-height: 1.45;
}
.overview-kv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 20px;
  margin: 0;
}
.overview-kv dt {
  color: var(--slate-600, #475569);
  font-size: 0.82rem;
  font-weight: 700;
}
.overview-kv dd {
  margin: 0;
  color: var(--slate-950, #0f172a);
  font-weight: 700;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}
.overview-card .overview-kv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 20px;
  margin: 0;
}
.overview-table-scroll {
  display: block;
  max-width: 100%;
  width: 100%;
  overflow-x: auto;
}
.overview-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.overview-table th {
  background: var(--slate-100, #eef4fb);
  color: var(--slate-800, #1e293b);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border, #d6e0ee);
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.overview-table td {
  padding: 10px 12px;
  font-size: 0.85rem;
  color: var(--slate-800, #1e293b);
  border-bottom: 1px solid var(--slate-100, #e2e8f0);
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.overview-table tr:last-child td {
  border-bottom: 0;
}
.overview-table td[style*="text-align:right"] {
  text-align: right;
}
.overview-table tfoot td,
.overview-table .overview-table-total td {
  font-weight: 800;
  border-top: 2px solid var(--border, #d6e0ee);
  background: var(--slate-50, #f8fafc);
}

.overview-table--wide {
  min-width: 980px;
  table-layout: auto;
}

.overview-table--wide th,
.overview-table--wide td {
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.overview-table--employees th,
.overview-table--employees td {
  min-width: 72px;
}

.overview-table--employees th:nth-child(1),
.overview-table--employees td:nth-child(1) {
  min-width: 112px;
}

.overview-table--employees th:nth-child(2),
.overview-table--employees td:nth-child(2),
.overview-table--employees th:nth-child(3),
.overview-table--employees td:nth-child(3) {
  min-width: 150px;
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
}

.overview-table--employees th:nth-child(6),
.overview-table--employees td:nth-child(6) {
  min-width: 116px;
}

.overview-table--employees th:last-child,
.overview-table--employees td:last-child {
  min-width: 112px;
}

.overview-table--employees td {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.overview-total-box {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--slate-50, #f8fafc);
  border: 1px solid var(--border, #d6e0ee);
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--slate-950, #0f172a);
  text-align: right;
}
.overview-empty {
  border: 1px dashed var(--border, #cbd5e1);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  color: var(--muted, #64748b);
  background: var(--slate-50, #f8fafc);
  font-size: 0.85rem;
}
.overview-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.overview-stats .overview-stat {
  font-size: 0.85rem;
  color: var(--slate-700, #334155);
}
.overview-stats .overview-stat strong {
  color: var(--slate-950, #0f172a);
  font-weight: 800;
}


.read-only-panel {
  background: #f8fbff;
}

.timeline-panel {
  margin-top: 16px;
}

.timeline {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 10px;
  align-items: center;
}

.timeline li span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--navy-800);
}

.timeline time {
  color: var(--slate-600);
}

.dashboard-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
  padding: 6px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
}

.dashboard-tabs a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border-radius: 8px;
  color: var(--navy-900);
  font-weight: 850;
  text-decoration: none;
}

.dashboard-tabs a.active {
  background: var(--navy-900);
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(16, 54, 106, 0.2);
}

.analytics-dashboard {
  display: grid;
  gap: 18px;
}

.analytics-toolbar {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
}

.analytics-toolbar label {
  display: grid;
  gap: 6px;
  color: var(--navy-900);
  font-weight: 850;
}

.analytics-summary-grid,
.analytics-chart-grid {
  display: grid;
  gap: 14px;
}

.analytics-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.analytics-summary-grid-balanced {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.analytics-chart-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.analytics-card,
.analytics-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
}

.analytics-card {
  position: relative;
  display: grid;
  min-height: 116px;
  place-items: center;
  padding: 48px 22px 22px;
  border: 1px solid #cfdbe8;
  border-radius: 4px;
  background: #ffffff;
  color: #172033;
  text-align: center;
  text-decoration: none;
}

.analytics-card .icon {
  display: none;
}

.analytics-card .analytics-ribbon .icon {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  color: #ffffff;
  fill: #ffffff;
}

.analytics-card .analytics-ribbon span {
  color: #ffffff;
}

.analytics-ribbon {
  position: absolute;
  top: -13px;
  left: 8%;
  right: 8%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 900;
  box-shadow: 0 10px 20px rgba(15, 47, 95, 0.1);
}

.analytics-ribbon span,
.analytics-ribbon .icon {
  color: #ffffff;
}

.analytics-ribbon-green {
  background: #20bf72;
}

.analytics-ribbon-navy {
  background: #102c6d;
}

.analytics-ribbon-teal {
  background: #37a2a6;
}

.analytics-ribbon-amber {
  background: #f59e0b;
}

.analytics-card span,
.analytics-panel h3 {
  color: var(--navy-900);
  font-weight: 900;
}

.analytics-card strong {
  display: block;
  color: #172033;
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.analytics-card small,
.analytics-panel p,
.analytics-legend em {
  color: #475569;
  font-size: 0.82rem;
  font-weight: 700;
  max-width: 240px;
}

.analytics-summary-card {
  align-items: start;
  min-height: 142px;
}

.analytics-summary-card > span {
  align-self: center;
}

.analytics-summary-donut {
  position: relative;
  display: grid;
  width: 82px;
  height: 82px;
  place-items: center;
}

.analytics-summary-donut svg {
  width: 82px;
  height: 82px;
  overflow: visible;
  transform: rotate(-90deg);
}

.analytics-summary-donut circle {
  fill: none;
  stroke-linecap: round;
  stroke-width: 4.5;
}

.analytics-summary-donut strong {
  position: absolute;
  color: var(--navy-900);
  font-size: 1.1rem;
  line-height: 1;
}

.analytics-summary-list {
  display: grid;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.analytics-summary-donut-card .analytics-summary-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 4px;
}

.analytics-summary-list p {
  display: grid;
  grid-template-columns: auto minmax(92px, 1fr) auto auto;
  gap: 6px;
  align-items: center;
  margin: 0;
  color: var(--navy-900);
  font-size: 0.8rem;
  font-weight: 800;
}

.analytics-summary-list span {
  min-width: 0;
  white-space: normal;
}

.analytics-summary-list b {
  color: var(--text);
  font-weight: 950;
}

.analytics-summary-list em {
  color: var(--muted);
  font-style: normal;
  font-weight: 750;
  white-space: nowrap;
}

.analytics-dot {
  display: inline-block;
  flex: 0 0 auto;
  align-self: center;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: 1px solid rgba(15, 47, 95, 0.08);
}

.analytics-arc-dot-0 {
  background: #1fbf74;
}

.analytics-arc-dot-1 {
  background: #102c6d;
}

.analytics-arc-dot-2 {
  background: #0f766e;
}

.analytics-arc-dot-3 {
  background: #b45309;
}

.analytics-arc-dot-4 {
  background: #b91c1c;
}

.analytics-panel {
  padding: 18px;
}

.analytics-panel h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
}

.analytics-doughnut {
  position: relative;
  display: grid;
  width: 180px;
  height: 180px;
  max-width: 100%;
  margin: 0 auto 14px;
  place-items: center;
}

.analytics-doughnut svg {
  width: 180px;
  height: 180px;
  overflow: visible;
  transform: rotate(-90deg);
}

.analytics-doughnut circle {
  fill: none;
  stroke-linecap: round;
  stroke-width: 4.5;
}

.analytics-track {
  stroke: #e2e8f0;
}

.analytics-arc-0 {
  stroke: var(--green);
}

.analytics-arc-1 {
  stroke: var(--navy-900);
}

.analytics-arc-2 {
  stroke: var(--teal);
}

.analytics-arc-3 {
  stroke: var(--amber);
}

.analytics-arc-4 {
  stroke: var(--red);
}

.analytics-hole {
  fill: #ffffff;
  stroke: rgba(15, 23, 42, 0.08);
  stroke-width: 1;
}

.analytics-doughnut strong {
  position: absolute;
  color: var(--navy-900);
  font-size: 1.7rem;
}

.analytics-pie-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.analytics-pie-panel h3 {
  align-self: flex-start;
}

.analytics-pie-wrap {
  position: relative;
  width: 100%;
  max-width: 320px;
  height: 300px;
}

.analytics-pie-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.analytics-legend,
.analytics-bar-panel {
  display: grid;
  gap: 9px;
}

.analytics-legend span {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  color: var(--text);
  font-size: 0.92rem;
}

.analytics-legend b {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--green);
}

.analytics-bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 2fr) auto auto;
  gap: 10px;
  align-items: center;
  font-size: 0.92rem;
}

.analytics-bar-row.is-vertical {
  grid-template-columns: minmax(86px, 1fr) minmax(100px, 2fr) auto auto;
}

.analytics-bar-row > span {
  color: var(--navy-900);
  font-weight: 850;
}

.analytics-bar-track {
  display: grid;
  gap: 3px;
}

.analytics-bar-track i {
  display: block;
  width: var(--bar);
  min-width: 3px;
  height: 12px;
  border-radius: 999px;
  background: var(--green);
}

.analytics-bar-track i.secondary {
  background: var(--navy-900);
}

.analytics-bar-row strong {
  color: var(--text);
  white-space: nowrap;
}

.analytics-bar-row em {
  color: var(--muted);
  font-style: normal;
  white-space: nowrap;
}

.analytics-panel-head {
  display: flex;
  gap: 12px;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.analytics-map-canvas {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  border: 1px dashed #b7c8dd;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(20, 184, 166, 0.08)),
    #f8fafc;
  touch-action: pan-x pan-y;
}

.analytics-leaflet-map {
  position: absolute;
  inset: 0;
  z-index: 1;
  min-height: inherit;
  border-radius: inherit;
  background:
    radial-gradient(circle at 50% 50%, rgba(31, 191, 116, 0.18), transparent 46%),
    linear-gradient(135deg, #eefbf5, #e7f2f7);
}


.analytics-map-loading,
.analytics-map-fallback {
  position: absolute;
  inset: 18px;
  z-index: 1;
}

.analytics-map-fallback {
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
}

.analytics-map-fallback p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.analytics-map-fallback span {
  color: var(--muted);
  font-size: 0.9rem;
}

.analytics-map-stage {
  position: absolute;
  inset: 0;
  min-width: 720px;
  min-height: 520px;
  transform: translate(var(--pan-x, 0px), var(--pan-y, 0px));
  transition: transform 120ms ease;
  will-change: transform;
}

.analytics-ilocos-map {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(360px, 48%);
  height: calc(100% - 44px);
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 18px 24px rgba(15, 23, 42, 0.16));
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.analytics-map-marker {
  position: absolute;
  z-index: 2;
  left: var(--x);
  top: var(--y);
  display: grid;
  width: var(--size);
  height: var(--size);
  min-width: 34px;
  min-height: 34px;
  place-items: center;
  border: 3px solid #ffffff;
  border-radius: 999px;
  background: var(--navy-900);
  color: #ffffff;
  font-weight: 950;
  text-decoration: none;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.2);
  transform: translate(-50%, -50%);
  transition: background 140ms ease, box-shadow 140ms ease;
}

.analytics-map-marker.is-selected {
  outline: 4px solid rgba(31, 191, 116, 0.28);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.3);
}

.analytics-map-marker.heat-low {
  background: #2563eb;
}

.analytics-map-marker.heat-medium {
  background: #f59e0b;
}

.analytics-map-marker.heat-high {
  background: #b91c1c;
}

.analytics-map-marker:hover,
.analytics-map-marker:focus-visible {
  background: var(--green);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.24);
}

.analytics-map-legend {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--navy-900);
  font-size: 0.82rem;
  font-weight: 850;
}

.analytics-map-legend strong {
  color: var(--text);
  font-size: 0.78rem;
}

.analytics-map-legend .legend-items {
  display: flex;
  gap: 10px;
  align-items: center;
}

.analytics-map-legend span {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  white-space: nowrap;
}

.analytics-map-legend i {
  width: 11px;
  height: 11px;
  border-radius: 999px;
}

.analytics-map-legend .heat-low {
  background: #2563eb;
}

.analytics-map-legend .heat-medium {
  background: #f59e0b;
}

.analytics-map-legend .heat-high {
  background: #15803d;
}

.analytics-map-legend .heat-none {
  background: #dc2626;
}

.analytics-map-legend .pin-active {
  background: #22c55e;
}

.analytics-map-legend .pin-complete {
  background: #64748b;
}

.analytics-map-legend .pin-terminated {
  background: #dc2626;
}

.analytics-map-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.leaflet-reset-view {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--navy-900);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
  cursor: pointer;
}

.leaflet-reset-view:hover,
.leaflet-reset-view:focus-visible {
  border-color: rgba(15, 47, 102, 0.35);
  background: #ffffff;
}

.analytics-district-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.analytics-district-chip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  color: var(--navy-900);
  text-decoration: none;
  font-weight: 850;
}

.analytics-district-chip::before {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #94a3b8;
  content: "";
}

.analytics-district-chip {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}

.analytics-district-chip span {
  min-width: 0;
}

.analytics-district-chip strong {
  color: var(--text);
}

.analytics-district-chip em {
  color: var(--muted);
  font-style: normal;
}

.analytics-district-chip.heat-low::before {
  background: #2563eb;
}

.analytics-district-chip.heat-medium::before {
  background: #f59e0b;
}

.analytics-district-chip.heat-high::before {
  background: #15803d;
}

.analytics-district-chip.heat-none::before {
  background: #dc2626;
}

.analytics-district-chip.chip-status--ongoing::before {
  background: #22c55e;
}

.analytics-district-chip.chip-status--completed::before {
  background: #64748b;
}

.analytics-district-chip.chip-status--terminated::before {
  background: #dc2626;
}

.analytics-district-chip.chip-status--unknown::before {
  background: #94a3b8;
}

.analytics-district-chip.is-selected {
  border-color: rgba(31, 191, 116, 0.65);
  background: rgba(31, 191, 116, 0.1);
}

.analytics-map-popup {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 14px;
  border-radius: 12px;
  background: var(--slate-50);
}

.analytics-map-popup p {
  display: grid;
  gap: 2px;
  margin: 0;
}

.analytics-map-popup b {
  color: var(--navy-900);
}

.map-firm-popup {
  display: grid;
  gap: 5px;
  min-width: 220px;
  color: #0f172a;
  font-size: 0.82rem;
}

.map-firm-popup strong {
  color: #0f2f66;
  font-size: 0.95rem;
}

.map-firm-popup span {
  display: block;
}

.map-firm-popup ul {
  margin: 4px 0;
  padding-left: 16px;
}

.map-firm-popup a {
  color: #0f2f66;
  font-weight: 900;
}

.missing-coordinate-list {
  display: grid;
  gap: 8px;
}

.missing-coordinate-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
}

.missing-coordinate-list span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.missing-coordinate-list em {
  color: #92400e;
  font-style: normal;
  font-weight: 900;
}

.advanced-location-panel {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}

.advanced-location-panel summary {
  cursor: pointer;
  color: var(--navy-900);
  font-weight: 900;
}

.advanced-location-panel .form-grid {
  margin-top: 12px;
  row-gap: 14px;
}

.advanced-location-panel .checkbox-line {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  color: var(--slate-700);
  font-weight: 800;
}

.advanced-location-panel .checkbox-line input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--navy-900);
}

.analytics-firm-list {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow: auto;
}

.firm-list-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.firm-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  vertical-align: middle;
}

.firm-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  flex-shrink: 0;
}

.firm-status-badge--ongoing {
  color: #047857;
  background: #d1fae5;
  border: 1px solid #6ee7b7;
}

.firm-status-badge--ongoing .firm-status-dot {
  background: #22c55e;
}

.firm-status-badge--completed {
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
}

.firm-status-badge--completed .firm-status-dot {
  background: #64748b;
}

.firm-status-badge--terminated {
  color: #b91c1c;
  background: #fee2e2;
  border: 1px solid #fca5a5;
}

.firm-status-badge--terminated .firm-status-dot {
  background: #dc2626;
}

.firm-status-badge--unknown {
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.firm-status-badge--unknown .firm-status-dot {
  background: #94a3b8;
}

.project-municipality-panel {
  margin-top: 18px;
}

.project-summary-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.project-municipality-panel .analytics-panel-head strong,
.project-summary-badges strong {
  align-self: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(31, 191, 116, 0.12);
  color: var(--green);
  white-space: nowrap;
}

.project-municipality-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
  margin-top: 14px;
}

.project-district-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
}

.project-district-card header {
  display: grid;
  gap: 6px;
}

.project-district-card h4,
.project-district-card p {
  margin: 0;
}

.project-district-card h4 {
  color: var(--navy-900);
  font-size: 1.05rem;
}

.project-district-card p {
  color: var(--muted);
  font-size: 0.9rem;
}

.project-district-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-district-metrics span {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--slate-50);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.project-district-metrics b {
  color: var(--navy-900);
}

.project-municipality-list {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.project-municipality-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--slate-50);
  color: var(--text);
  text-decoration: none;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.project-municipality-row:hover,
.project-municipality-row:focus-visible,
.project-municipality-row.is-selected {
  border-color: rgba(31, 191, 116, 0.65);
  background: rgba(31, 191, 116, 0.09);
  transform: translateY(-1px);
}

.project-municipality-row.is-zero {
  border-color: rgba(220, 38, 38, 0.34);
  background: #fff5f5;
}

.project-municipality-row.is-zero .project-municipality-name,
.project-municipality-row.is-zero > strong,
.project-municipality-row.is-zero > small {
  color: #b91c1c;
}

.project-municipality-row.is-zero .project-sector-breakdown em {
  background: #fee2e2;
  color: #991b1b;
}

.project-municipality-row.is-zero:hover,
.project-municipality-row.is-zero:focus-visible,
.project-municipality-row.is-zero.is-selected {
  border-color: rgba(220, 38, 38, 0.68);
  background: #fef2f2;
}

.project-municipality-name {
  min-width: 0;
  color: var(--navy-900);
  font-weight: 900;
}

.project-municipality-row > strong {
  justify-self: end;
  color: var(--navy-900);
  font-size: 1.05rem;
}

.project-municipality-row > small {
  grid-column: 2;
  justify-self: end;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.project-investment-line,
.project-count-line {
  grid-column: 1 / -1;
  color: var(--navy-900);
  font-size: 0.82rem;
  font-weight: 850;
}

.project-investment-line b {
  color: var(--green);
}

.project-count-line {
  color: var(--muted);
  font-size: 0.78rem;
}

.project-sector-breakdown {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.project-sector-breakdown em {
  padding: 4px 7px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
}

.sales-chart-panel {
  overflow: hidden;
}

.sales-chart {
  display: grid;
  grid-template-columns: repeat(12, minmax(54px, 1fr));
  gap: 10px;
  min-height: 260px;
  overflow-x: auto;
  padding: 18px 4px 8px;
}

.sales-chart-month {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 8px;
  min-width: 54px;
  min-height: 220px;
}

.sales-bars {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 5px;
  min-height: 190px;
  border-bottom: 1px solid var(--border);
}

.sales-bars span {
  width: 16px;
  min-height: 3px;
  border-radius: 999px 999px 0 0;
}

.sales-bars .target {
  background: var(--green);
}

.sales-bars .actual {
  background: var(--navy-900);
}

.sales-bars .before {
  background: var(--slate-400);
}

.sales-bars .after {
  background: var(--navy-900);
}

.sales-bars .additional {
  background: var(--green);
}

.sales-chart-month strong {
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.chart-legend span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.chart-legend i {
  width: 14px;
  height: 10px;
  border-radius: 999px;
}

.legend-target {
  background: var(--green);
}

.legend-actual {
  background: var(--navy-900);
}

.legend-before {
  background: var(--slate-400);
}

.legend-after {
  background: var(--navy-900);
}

.legend-additional {
  background: var(--green);
}

.progress-panel,
.allocation-panel,
.warning-panel,
.effect-preview {
  margin-bottom: 16px;
}

.progress-meter {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--slate-100);
}

.progress-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.allocation-summary,
.warning-text,
.amount-warning {
  color: var(--red);
  font-weight: 800;
}

.comparison-drawer,
.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 50;
  width: min(480px, 100vw);
  height: 100vh;
  padding: 18px;
  overflow: auto;
  border-left: 1px solid var(--border);
  background: var(--white);
  box-shadow: -20px 0 45px rgba(15, 23, 42, 0.16);
  transform: translateX(110%);
  transition: transform 160ms ease;
}

.mobile-drawer {
  left: 0;
  right: auto;
  width: min(360px, calc(100vw - 48px));
  color: #dbeafe;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 0;
  background: var(--navy-950);
  box-shadow: 20px 0 45px rgba(15, 23, 42, 0.16);
  transform: translateX(-110%);
}

.mobile-drawer .icon-btn {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #dbeafe;
}

.comparison-drawer.open,
.drawer-open .mobile-drawer {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.compare-grid section {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--slate-50);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: none;
  background: rgba(15, 23, 42, 0.45);
}

.drawer-open .drawer-backdrop {
  display: block;
}

.upload-workspace {
  margin-bottom: 18px;
}

.upload-workspace .action-row {
  justify-content: flex-end;
  margin-top: 4px;
}

.upload-workspace .btn[type="submit"] {
  min-width: 170px;
}

.report-preview {
  padding: 18px;
}

.status-report003-preview {
  overflow: auto;
}

.status-report003-preview .form003 {
  page: setup-form-003;
  max-width: 920px;
  margin: 0 auto;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.08);
}

.status-report003-preview .form003 h1,
.status-report003-preview .form003 h2,
.status-report003-preview .form003 p {
  color: #111827;
}

.status-report003-preview .form003 table {
  font-size: 0.86rem;
}

.status-report-editor textarea {
  min-height: 42px;
}

.status-report-editor .form003-draft-row textarea {
  min-height: 42px;
}

@page setup-form-003 {
  size: A4 portrait;
  margin: 12mm;
}

.print-header {
  display: none;
  text-align: center;
}

.signature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  margin-top: 40px;
}

.signature-grid span {
  padding-top: 18px;
  border-top: 1px solid var(--slate-700);
  text-align: center;
  font-weight: 750;
}

.wizard-steps {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wizard-steps li {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--slate-600);
  font-size: 0.84rem;
  font-weight: 750;
}

.wizard-steps span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  background: var(--slate-100);
  color: var(--slate-700);
}

.wizard-steps .active,
.wizard-steps .done {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: var(--navy-900);
}

.wizard-steps .active span,
.wizard-steps .done span {
  background: var(--navy-900);
  color: #ffffff;
}

.wizard-panel {
  min-height: 300px;
}

.choice-list,
.mapping-grid,
.import-stats {
  display: grid;
  gap: 12px;
}

.choice-list label {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--slate-800);
  font-weight: 700;
}

.choice-list input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--navy-900);
}

.choice-list span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.mapping-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.import-stats {
  grid-template-columns: auto 1fr auto 1fr;
  align-items: center;
  width: fit-content;
  margin-bottom: 12px;
}

.import-stats strong {
  color: var(--navy-900);
  font-size: 1.6rem;
}

.success-state,
.placeholder-box {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  background: #f0fdf4;
  color: #166534;
}

.placeholder-box {
  border-color: var(--border);
  background: var(--slate-50);
  color: var(--slate-700);
}

.archive-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.archive-section article {
  display: grid;
  gap: 6px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.archive-section article:last-child {
  border-bottom: 0;
}

.state-card {
  display: grid;
  place-items: center;
  min-height: 190px;
  padding: 24px;
  text-align: center;
}

.loading-skeleton {
  display: grid;
  gap: 10px;
}

.loading-skeleton span {
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e2e8f0, #f8fafc, #e2e8f0);
  background-size: 220% 100%;
  animation: shimmer 1.3s linear infinite;
}

@keyframes shimmer {
  to {
    background-position: -220% 0;
  }
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: grid;
  gap: 10px;
  width: min(420px, calc(100vw - 36px));
}

.app-toastify.toastify {
  width: min(420px, calc(100vw - 36px));
  max-width: min(420px, calc(100vw - 36px));
  border: 0;
  border-radius: 10px;
  background: transparent !important;
  color: inherit;
  box-shadow: none !important;
}

.app-toastify.toastify.on {
  animation: toast-slide-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.toast {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 28px;
  align-items: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid #b9d8c5;
  border-left: 5px solid var(--green);
  border-radius: 10px;
  background: #f7fff9;
  color: var(--text);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
  animation: toast-slide-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform, opacity;
}

.toast.is-leaving {
  animation: toast-slide-out 180ms ease-in forwards;
}

.toast-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: transparent;
  color: #ffffff;
  font-weight: 900;
}

.toast-icon svg {
  width: 30px;
  height: 30px;
}

.toast-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.toast-copy strong {
  color: #0f5132;
  font-size: 0.92rem;
  line-height: 1.2;
}

.toast-copy span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.toast-actions {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.toast-actions .btn {
  min-height: 34px;
  padding: 7px 12px;
  font-size: 0.85rem;
}

.toast-confirm {
  grid-template-columns: 34px minmax(0, 1fr) 28px;
}

.toast-confirm .toast-progress {
  display: none;
}

.toast-close {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.toast-close svg {
  width: 14px;
  height: 14px;
}

.toast-close:hover,
.toast-close:focus-visible {
  background: rgba(15, 23, 42, 0.08);
  color: var(--text);
}

.toast-warning {
  border-color: #f3b7bd;
  border-left-color: var(--red);
  background: #fff5f6;
}

.toast-warning .toast-icon {
  background: transparent;
  color: #ffffff;
}

.toast-warning .toast-copy strong {
  color: #842029;
}

.toast-danger {
  border-color: #f3b7bd;
  border-left-color: var(--red);
  background: #fff5f6;
}

.toast-danger .toast-icon {
  background: transparent;
}

.toast-danger .toast-copy strong {
  color: #842029;
}

.toast-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: var(--green);
  transform-origin: left;
  animation: toast-progress var(--toast-duration, 4600ms) linear forwards;
}

.toast-warning .toast-progress {
  background: var(--red);
}

.toast-danger .toast-progress {
  background: var(--red);
}

@keyframes toast-slide-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-slide-out {
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

@keyframes toast-progress {
  to {
    transform: scaleX(0);
  }
}

[hidden] {
  display: none !important;
}

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

  .reference-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reference-lower-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reference-due-panel {
    grid-column: 1 / -1;
  }

  .analytics-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .analytics-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-grid.compact,
  .action-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .dashboard-tabs,
  .analytics-toolbar,
  .analytics-panel-head,
  .targets-panel-head {
    display: grid;
  }

  .dashboard-tabs a,
  .analytics-toolbar .btn {
    width: 100%;
  }

  .analytics-toolbar,
  .analytics-summary-grid,
  .analytics-chart-grid,
  .project-municipality-grid {
    grid-template-columns: 1fr;
  }

  .analytics-bar-row,
  .analytics-bar-row.is-vertical {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .analytics-map-canvas {
    min-height: 300px;
  }

  .project-municipality-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

@media (max-width: 1180px) and (min-width: 1041px) {
  .app-shell {
    grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr);
  }

  .sidebar span:not(.brand-mark),
  .sidebar small,
  .sidebar strong,
  .sidebar-toggle span {
    display: none;
  }

  .brand-lockup,
  .sidebar nav a,
  .sidebar-toggle {
    justify-content: center;
  }
}

@media (max-width: 1040px) {
  .app-shell,
  .app-shell.is-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .menu-button {
    display: inline-flex;
  }

  .mobile-drawer {
    display: block;
  }

  .topbar {
    padding: 10px 14px;
  }

  .topbar-title span {
    display: none;
  }

  #main-content {
    padding: 18px 14px 96px;
  }

  .summary-grid,
  .dashboard-grid,
  .detail-grid,
  .overview-grid,
  .archive-grid,
  .reference-main-grid,
  .reference-lower-grid,
  .reference-source-grid {
    grid-template-columns: 1fr;
  }

  .overview-card--full {
    grid-column: auto;
  }

  .reference-dashboard-head {
    display: grid;
  }

  .reference-dashboard-actions {
    justify-content: flex-start;
  }

  .reference-due-panel {
    grid-column: auto;
  }

  .summary-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .payment-analytics-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-section {
    grid-template-columns: 1fr;
  }

  .activity-draft-row,
  .expected-draft-row,
  .expected-output-row[data-status-report-row="activities"] {
    grid-template-columns: 1fr;
  }

  .activity-row {
    grid-template-columns: 1fr;
  }

  .equipment-draft-row {
    grid-template-columns: 1fr;
    padding-right: 16px;
  }

  .equipment-draft-row [data-action="remove-form003-row"] {
    position: static;
  }

  .form003-draft-row [data-action="remove-form003-row"] {
    justify-self: start;
  }

  .wizard-steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body {
    font-size: 15px;
  }

  .topbar-actions .btn,
  .connection-state {
    display: none;
  }

  .page-heading,
  .profile-header {
    display: grid;
  }

  .page-actions,
  .action-row,
  .sticky-actions,
  .mobile-card-actions {
    width: 100%;
  }

  .profile-actions {
    grid-template-columns: 1fr;
    justify-content: stretch;
    min-width: 0;
  }

  .profile-actions [data-action="print-page"] {
    grid-column: auto;
  }

  .page-actions .btn,
  .action-row .btn,
  .sticky-actions .btn,
  .sticky-actions button,
  .mobile-card-actions .btn,
  .mobile-card-actions button {
    flex: 1 1 auto;
  }

  .summary-grid,
  .summary-grid.compact,
  .reference-kpi-grid,
  .action-grid,
  .status-report-actions,
  .form-grid,
  .mapping-grid,
  .compare-grid,
  .signature-grid,
  .activity-draft-row,
  .equipment-draft-row,
  .expected-draft-row,
  .expected-output-row[data-status-report-row="activities"] {
    grid-template-columns: 1fr;
  }

  .activity-row {
    grid-template-columns: 1fr;
  }

  .payment-progress-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .payment-progress-row strong {
    text-align: left;
  }

  .payment-analytics-metrics {
    grid-template-columns: 1fr;
  }

  .reference-dashboard {
    gap: 20px;
    padding: 22px 16px;
  }

  .reference-dashboard-decor {
    display: none;
  }

  .reference-dashboard-head h1 {
    font-size: 2rem;
  }

  .reference-dashboard-actions label {
    width: 100%;
  }

  .reference-panel-title {
    position: static;
    min-width: 0;
    width: 100%;
    margin: -8px auto 12px;
    transform: none;
  }

  .reference-chart-panel,
  .reference-due-panel,
  .reference-small-panel {
    padding: 18px 16px;
  }

  .reference-source-head {
    padding: 15px 14px 12px;
  }

  .reference-source-table th,
  .reference-source-table td {
    padding: 11px 12px;
  }

  .control-panel,
  .list-toolbar {
    align-items: stretch;
  }

  .control-panel label,
  .list-toolbar label,
  .filter-details,
  .column-details,
  .search-input {
    width: 100%;
  }

  .filter-grid {
    position: fixed;
    inset: 0;
    z-index: 60;
    width: 100vw;
    height: 100vh;
    overflow: auto;
    grid-template-columns: 1fr;
    align-content: start;
    border-radius: 0;
  }

  .table-wrap {
    display: none;
  }

  .mobile-record-list {
    display: grid;
    gap: 12px;
  }

  .mobile-record-card dl,
  .detail-panel dl {
    grid-template-columns: 1fr;
  }

  .donut-wrap {
    grid-template-columns: 1fr;
  }

  .bar-chart {
    overflow-x: auto;
  }

  .bar-item {
    min-width: 44px;
  }

  .wizard-steps {
    display: flex;
    overflow-x: auto;
  }

  .wizard-steps li {
    min-width: 140px;
  }

  .toast-region {
    bottom: 84px;
  }

  .app-toastify.toastify {
    right: 12px !important;
    bottom: 84px !important;
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
  }

  .project-district-card {
    padding: 12px;
  }

  .project-municipality-row {
    grid-template-columns: 1fr;
  }

  .project-municipality-row > strong,
  .project-municipality-row > small {
    grid-column: auto;
    justify-self: start;
  }
}

@media (max-width: 420px) {
  .mobile-drawer {
    width: min(320px, calc(100vw - 36px));
    padding: 14px;
  }

  .topbar-title strong {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .summary-card {
    min-height: 112px;
  }

  .summary-copy strong {
    font-size: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

.targets-page {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
}

.targets-panel {
  margin-top: 0;
  min-width: 0;
}

.targets-panel-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.targets-panel-title {
  flex: 1;
  min-width: 0;
}

.targets-panel-title h3 {
  margin: 0 0 2px;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--slate-900);
}

.targets-panel-title p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--slate-500);
}

.targets-edit-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.targets-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #d6e0ee;
  border-radius: 10px;
  background: var(--white);
}

.targets-table {
  width: 100%;
  min-width: 1280px;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.targets-table th,
.targets-table td {
  padding: 9px 12px;
  border: 1px solid #e2e8f0;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.targets-th-indicator {
  position: sticky;
  left: 0;
  z-index: 4;
  background: #fdf6e3;
  color: var(--slate-800);
  font-weight: 800;
  text-align: left;
  min-width: 260px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.targets-th-target {
  background: #fdf6e3;
  color: #b91c1c;
  font-weight: 800;
  text-transform: uppercase;
  min-width: 130px;
  letter-spacing: 0.02em;
}

.targets-th-quarter {
  background: #fdf6e3;
  color: var(--slate-700);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.78rem;
}

.targets-th-month {
  background: #fefce8;
  color: var(--slate-600);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.74rem;
  min-width: 64px;
  letter-spacing: 0.02em;
}

.targets-th-todate {
  background: #eef4fb;
  color: #1d4ed8;
  font-weight: 800;
  text-transform: uppercase;
  min-width: 100px;
  letter-spacing: 0.02em;
}

.targets-th-accomp {
  background: #ecfdf5;
  color: #15803d;
  font-weight: 800;
  text-transform: uppercase;
  min-width: 100px;
  letter-spacing: 0.02em;
}

.targets-td-indicator {
  position: sticky;
  left: 0;
  z-index: 2;
  background: inherit;
  text-align: left;
  font-weight: 700;
  color: var(--slate-800);
}

.targets-table tbody tr:nth-child(odd) .targets-td-indicator {
  background: #fbfdff;
}

.targets-table tbody tr:nth-child(even) .targets-td-indicator {
  background: #f8fafc;
}

.targets-table tbody tr:hover .targets-td-indicator {
  background: #f0f7ff;
}

.targets-td-target {
  color: #b91c1c;
  font-weight: 700;
}

.targets-td-month {
  font-weight: 600;
  font-size: 0.8rem;
}

.targets-td-future {
  color: var(--slate-400);
  background: #fafbfc;
}

.targets-td-todate {
  background: #f0f7ff;
  font-weight: 800;
}

.targets-td-accomp {
  background: #f0fdf4;
  font-weight: 800;
  color: #15803d;
}

.targets-td-accomp.target-status-below {
  background: #fef2f2;
  color: #b91c1c;
}

.targets-td-accomp.target-status-met {
  background: #f0fdf4;
  color: #15803d;
}

.targets-td-accomp.target-status-exceeded {
  background: #eff6ff;
  color: #1d4ed8;
}

.targets-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  padding: 24px;
}

.targets-modal {
  background: var(--white, #fff);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}

.targets-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 0;
}

.targets-modal-head h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--slate-900, #0f172a);
}

.targets-modal-close {
  font-size: 1.2rem;
  line-height: 1;
  padding: 4px 8px;
}

.targets-modal-body {
  padding: 16px 24px;
}

.targets-modal-note {
  margin: 0 0 16px;
  font-size: 0.85rem;
  color: var(--slate-600, #475569);
}

.targets-modal-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.targets-modal-field label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--slate-700, #334155);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.targets-modal-input-wrap {
  display: flex;
  align-items: center;
  gap: 0;
}

.targets-modal-unit {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 38px;
  padding: 0 8px;
  background: var(--slate-100, #f1f5f9);
  border: 1px solid var(--border, #e2e8f0);
  border-right: 0;
  border-radius: 6px 0 0 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--slate-600, #475569);
}

.targets-modal-input-wrap input {
  flex: 1;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--slate-900, #0f172a);
  background: var(--white, #fff);
}

.targets-modal-input-wrap input:focus {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
  border-color: #2563eb;
}

.targets-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 24px 18px;
}

.pi-section {
  margin-top: 0;
}

.pi-header {
  margin-bottom: 20px;
}

.pi-header h3 {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--slate-900);
}

.pi-header p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--slate-500);
}

.pi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px 16px;
  padding-top: 14px;
}

.pi-card {
  position: relative;
  border: 1px solid #d6e0ee;
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  padding-top: 32px;
}

.pi-title-box {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  min-width: min(260px, 85%);
  padding: 9px 18px;
  border-radius: 8px;
  background: #102c6d;
  color: #ffffff;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1.3;
  z-index: 1;
}

.pi-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pi-badge.pi-status-exceeded {
  background: #dbeafe;
  color: #1d4ed8;
}

.pi-badge.pi-status-met {
  background: #dcfce7;
  color: #15803d;
}

.pi-badge.pi-status-below {
  background: #fee2e2;
  color: #b91c1c;
}

.pi-badge.pi-status-none {
  background: var(--slate-100);
  color: var(--slate-600);
}

.pi-card-body {
  padding: 18px 20px 20px;
}

.pi-card-top {
  display: flex;
  justify-content: center;
  padding-bottom: 12px;
  margin-bottom: 8px;
}

.pi-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 0;
}

.pi-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.pi-value {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--slate-800);
}

.pi-value-actual {
  color: var(--slate-900);
}

.pi-progress-wrap {
  padding: 10px 0 6px;
}

.pi-progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--slate-100);
  overflow: hidden;
}

.pi-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease;
  min-width: 2px;
}

.pi-progress-fill.pi-status-exceeded {
  background: #1d4ed8;
}

.pi-progress-fill.pi-status-met {
  background: #15803d;
}

.pi-progress-fill.pi-status-below {
  background: #b91c1c;
}

.pi-progress-fill.pi-status-none {
  background: var(--slate-300);
}

.pi-accomp-row {
  padding-top: 6px;
  border-top: 1px solid #eef2f7;
}

.pi-accomp.pi-status-exceeded {
  color: #1d4ed8;
}

.pi-accomp.pi-status-met {
  color: #15803d;
}

.pi-accomp.pi-status-below {
  color: #b91c1c;
}

.pi-accomp.pi-status-none {
  color: var(--slate-500);
}

@media (max-width: 960px) {
  .pi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .pi-grid {
    grid-template-columns: 1fr;
  }
}

.targets-td-clickable {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
  color: #1e40af;
  transition: background 0.15s ease;
}

.targets-td-clickable:hover {
  background: #eff6ff;
}

.targets-drilldown {
  margin-top: 16px;
  border: 1px solid #d6e0ee;
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.targets-drilldown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.targets-drilldown-head h4 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--slate-800);
}

.targets-drilldown-summary {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 20px;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.85rem;
  color: var(--slate-700);
  flex-wrap: wrap;
}

.targets-drilldown-summary strong {
  color: var(--slate-900);
}

.targets-drilldown-empty {
  padding: 24px 20px;
  margin: 0;
  text-align: center;
  color: var(--slate-500);
  font-size: 0.88rem;
}

.targets-drilldown-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.targets-drilldown-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.targets-drilldown-table th {
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  text-align: left;
  font-weight: 700;
  color: var(--slate-700);
  text-transform: uppercase;
  font-size: 0.74rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.targets-drilldown-table td {
  padding: 9px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--slate-700);
}

.targets-drilldown-table tbody tr:hover {
  background: #f8fafc;
}

.targets-drilldown-close {
  flex-shrink: 0;
}

@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }

  html,
  body {
    background: #ffffff;
    color: #111827;
    font-size: 10pt;
    line-height: 1.35;
    overflow: visible !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .sidebar,
  .topbar,
  .page-actions,
  .list-toolbar,
  .control-panel,
  .tabs,
  .sticky-actions,
  .toast-region,
  .app-toastify,
  .btn,
  button,
  .table-pagination,
  .row-actions,
  .mobile-record-list,
  .mobile-drawer,
  .drawer-backdrop {
    display: none !important;
  }

  .app-shell,
  .app-shell.is-collapsed {
    display: block;
  }

  #main-content {
    width: 100%;
    max-width: none;
    padding: 0 !important;
  }

  .app-main,
  .page-shell,
  .page-body {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    background: #ffffff !important;
  }

  .page-heading,
  .profile-header {
    display: block;
    margin: 0 0 10mm;
    padding-bottom: 4mm;
    border-bottom: 1px solid #cbd5e1;
  }

  .page-heading h1,
  .profile-header h1 {
    margin: 1mm 0 2mm;
    color: #0f172a;
    font-size: 18pt;
    line-height: 1.15;
  }

  .page-eyebrow,
  .page-heading p,
  .profile-header p {
    color: #334155 !important;
  }

  .reference-dashboard,
  .analytics-dashboard {
    padding: 0;
    border: 0;
    background: #ffffff !important;
  }

  .reference-dashboard-decor,
  .chart-summary,
  .analytics-map-tools,
  .analytics-map-list {
    display: none !important;
  }

  .reference-dashboard-head,
  .analytics-panel-head {
    display: block;
    margin-bottom: 12px;
  }

  .reference-main-grid,
  .reference-lower-grid,
  .dashboard-grid,
  .analytics-chart-grid,
  .analytics-summary-grid,
  .summary-grid {
    display: block;
  }

  .panel,
  .summary-card,
  .report-preview,
  .reference-panel,
  .analytics-panel,
  .analytics-map-panel,
  .reference-kpi-card {
    break-inside: avoid;
    page-break-inside: avoid;
    box-shadow: none;
    margin-bottom: 12px;
    border: 1px solid #cbd5e1;
    background: #ffffff !important;
  }

  .reference-panel-title {
    position: static;
    display: block;
    width: fit-content;
    min-width: 0;
    margin: 0 0 8px;
    transform: none;
  }

  .reference-chart-panel,
  .reference-due-panel,
  .reference-small-panel {
    padding: 12px;
  }

  .performance-chart-scroll,
  .reference-chart-scroll,
  .dashboard-table-wrap,
  .table-wrap {
    overflow: visible !important;
  }

  .responsive-chart,
  .performance-chart,
  .reference-line-chart,
  .reference-comparison-chart {
    max-width: 100%;
    height: auto;
  }

  .print-header {
    display: block;
    margin-bottom: 18px;
  }

  .print-report-page > .page-heading,
  .print-report-page > .control-panel,
  .print-report-page > .action-row,
  .print-report-page > .applied-filters,
  .print-report-page .status-report-editor,
  .print-report-page .status-report-form > .action-row {
    display: none !important;
  }

  .print-report-page .report-preview {
    break-inside: auto;
    page-break-inside: auto;
    padding: 0;
    border: 0;
    box-shadow: none;
    margin: 0;
  }

  .print-report-page .status-report003-preview .form003 {
    max-width: none;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .print-report-page .print-header {
    margin: 0 0 8mm;
    padding-bottom: 4mm;
    border-bottom: 1px solid #cbd5e1;
  }

  .print-report-page .print-header strong,
  .print-report-page .print-header span,
  .print-report-page .print-header p {
    display: block;
    margin: 0 0 1.5mm;
  }

  .print-report-page .print-header h1 {
    margin: 4mm 0 2mm;
    color: #0f172a;
    font-size: 18pt;
    line-height: 1.15;
  }

  .table-wrap {
    display: block;
    overflow: visible;
    border: 0;
    box-shadow: none;
  }

  .data-table,
  .dashboard-table,
  .report-preview table {
    min-width: 0;
    font-size: 8.5pt;
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
  }

  .data-table thead,
  .dashboard-table thead,
  .report-preview thead {
    display: table-header-group;
  }

  .data-table tfoot,
  .dashboard-table tfoot,
  .report-preview tfoot {
    display: table-footer-group;
  }

  .data-table tr,
  .dashboard-table tr,
  .report-preview tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .data-table th,
  .data-table td,
  .dashboard-table th,
  .dashboard-table td,
  .report-preview th,
  .report-preview td {
    padding: 5px 6px;
    border: 1px solid #cbd5e1;
    color: #111827 !important;
    white-space: normal;
    overflow-wrap: anywhere;
    vertical-align: top;
  }

  .data-table th,
  .dashboard-table th,
  .report-preview th {
    background: #eef2f7 !important;
    color: #0f172a !important;
    font-weight: 800;
    text-align: left;
  }

  .data-table th:first-child,
  .data-table td:first-child {
    position: static;
  }

  .data-table th[data-col="actions"],
  .data-table td[data-col="actions"],
  .dashboard-table th[data-col="actions"],
  .dashboard-table td[data-col="actions"] {
    display: none !important;
  }

  .data-table a,
  .dashboard-table a,
  .report-preview a {
    color: #111827 !important;
    text-decoration: none !important;
  }

  .status-pill,
  .badge,
  .tag,
  .setup-phase-pill {
    border: 1px solid #94a3b8 !important;
    background: #ffffff !important;
    color: #111827 !important;
    box-shadow: none !important;
  }

  .signature-grid,
  .report-signatures {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* Demand Letter UI */
.demand-letter-section {
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.demand-letter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  flex-wrap: wrap;
}
.demand-letter-row + .demand-letter-row {
  border-top: 1px solid #e2e8f0;
}
.demand-letter-row .badge {
  flex-shrink: 0;
}
.demand-letter-row span:nth-child(2) {
  flex: 1;
  min-width: 0;
  font-size: 0.9em;
  color: var(--slate-700);
}
.demand-letter-overlay .demand-letter-modal {
  max-width: 680px;
  width: 95vw;
}
.demand-letter-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.88em;
  color: var(--slate-600);
}
.demand-letter-warning {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  color: #92400e;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 0.9em;
}
.demand-letter-email-field {
  margin-bottom: 12px;
}
.demand-letter-email-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 0.85em;
  color: var(--slate-700);
}
.demand-letter-email-field .form-control {
  width: 100%;
}
.demand-letter-preview-text {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.82em;
  line-height: 1.5;
  white-space: pre-wrap;
  resize: vertical;
  min-height: 200px;
}
.demand-letter-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  background: #f1f5f9;
  border-radius: 6px;
  font-size: 0.85em;
}
.demand-letter-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.demand-letter-foot .btn {
  white-space: nowrap;
}
.badge-danger {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  white-space: nowrap;
}
.badge-warning {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  white-space: nowrap;
}

/* Change indicators for Project Status table */
.change-positive {
  color: #15803d;
  font-weight: 600;
}
.change-negative {
  color: #b91c1c;
  font-weight: 600;
}
.change-neutral {
  color: var(--muted);
}
.change-positive small,
.change-negative small,
.change-neutral small {
  font-weight: 400;
}

/* 5-Year Trend Analysis */
.trend-section {
  margin-top: 24px;
}
.trend-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.trend-card {
  position: relative;
  background: #fff;
  border: 1px solid #d6e0ee;
  border-radius: 12px;
  overflow: visible;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  padding-top: 32px;
}
.trend-card-header {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  min-width: min(260px, 85%);
  padding: 9px 18px;
  border-radius: 8px;
  background: #20bf72;
  color: #fff;
  font-weight: 900;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-align: center;
  line-height: 1.3;
  z-index: 1;
}
.trend-card-body {
  padding: 16px;
}
.trend-chart-wrap {
  position: relative;
  width: 100%;
  height: 260px;
}
@media (max-width: 960px) {
  .trend-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px) {
  .trend-chart-wrap {
    height: 200px;
  }
}

/* Phase Distribution */
.phase-dist-wrap {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  max-width: 800px;
}
.phase-dist-wrap .trend-card {
  flex: 1;
  min-width: 0;
  max-width: 520px;
}
.phase-dist-table {
  flex: 0 0 220px;
}
.phase-dist-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88em;
}
.phase-dist-tbl th,
.phase-dist-tbl td {
  padding: 8px 14px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}
.phase-dist-tbl th {
  font-weight: 700;
  color: #334155;
  background: #f8fafc;
}
.phase-dist-tbl td {
  color: #475569;
}
.phase-dist-count {
  font-weight: 700;
  text-align: right;
  color: #102c6d;
}
.pi-empty {
  text-align: center;
  padding: 40px 20px;
  color: #94a3b8;
  font-style: italic;
}
@media (max-width: 768px) {
  .phase-dist-wrap {
    flex-direction: column;
    max-width: none;
  }
  .phase-dist-wrap .trend-card {
    max-width: none;
  }
  .phase-dist-table {
    flex: none;
    width: 100%;
  }
}

/* Phase Breakdown */
.phase-dist-row {
  cursor: pointer;
  transition: background 0.15s;
}
.phase-dist-row:hover {
  background: #f0fdf4;
}
.phase-breakdown {
  margin-top: 20px;
}
.phase-breakdown-title {
  font-size: 1em;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 2px;
}
.phase-breakdown-sub {
  font-size: 0.85em;
  color: #64748b;
  margin: 0 0 16px;
}
.phase-breakdown-group {
  margin-bottom: 18px;
}
.phase-breakdown-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px 8px 0 0;
  border-bottom: none;
}
.phase-breakdown-group-label {
  font-weight: 700;
  color: #102c6d;
  font-size: 0.92em;
}
.phase-breakdown-group-count {
  font-size: 0.82em;
  color: #64748b;
}
.phase-breakdown-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85em;
  border: 1px solid #e2e8f0;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}
.phase-breakdown-tbl th {
  background: #f8fafc;
  font-weight: 700;
  color: #334155;
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}
.phase-breakdown-tbl td {
  padding: 8px 12px;
  color: #475569;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.phase-breakdown-tbl tbody tr:last-child td {
  border-bottom: none;
}
.phase-breakdown-tbl tbody tr:hover {
  background: #f8fafc;
}
@media (max-width: 960px) {
  .phase-breakdown-tbl {
    display: block;
    overflow-x: auto;
  }
}
.asset-updates-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}
.asset-updates-section-head h2 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}
.asset-updates-section-head p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.asset-updates-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.asset-update-card {
  border: 1px solid #e2e5ea;
  border-radius: 10px;
  padding: 18px 20px;
  background: #f9fafb;
}
.asset-update-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5e7eb;
}
.asset-update-card-head strong {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}
.asset-update-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
.asset-update-remarks {
  margin-top: 14px;
}
.asset-update-calc {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 18px;
}
@media (max-width: 960px) {
  .asset-update-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 640px) {
  .asset-update-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 440px) {
  .asset-update-grid {
    grid-template-columns: 1fr;
  }
}
.asset-update-history {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  background: #f9fafb;
}
.asset-update-history-head {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}
.asset-update-history-head h3 {
  margin: 0 0 4px 0;
  font-size: 0.95rem;
  font-weight: 700;
}
.asset-update-history-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.asset-update-history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.asset-update-history-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}
.asset-update-history-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f1f5f9;
}
.asset-update-history-card-head strong {
  font-size: 0.88rem;
  font-weight: 700;
}
.asset-update-history-card-head span {
  font-size: 0.85rem;
  color: var(--muted);
}
.asset-update-history-fields {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.88rem;
}
.btn-danger {
  color: var(--red);
  border-color: var(--red);
}
.btn-danger:hover {
  background: var(--red);
  color: #fff;
}
.btn-sm {
  min-height: 0;
  padding: 6px 10px;
  font-size: 0.85rem;
}
.empty-state {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  background: var(--slate-50);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.initial-sales-products-section {
  margin-top: 18px;
}
.initial-sales-products-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sales-product-lines-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.product-lines-content {
  min-width: 0;
  width: 100%;
}
.product-line-card {
  margin-bottom: 0;
}
.product-line-row {
  margin-bottom: 18px;
}
.product-line-row:last-child {
  margin-bottom: 0;
}
.product-line-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}
.product-line-row-head strong {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}
.market-outlet-row {
  margin-bottom: 18px;
}
.market-outlet-row:last-child {
  margin-bottom: 0;
}
.product-line-calc {
  margin-top: 14px;
}

/* Monthly Gross Sales Manager */
.monthly-accordion {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.month-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.month-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  background: var(--slate-50);
  border-bottom: 1px solid transparent;
  transition: background 0.15s;
}
.month-card-header:hover {
  background: var(--slate-100);
}
.month-card.expanded .month-card-header {
  border-bottom-color: var(--border);
  background: var(--surface);
}
.month-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.month-card-header .month-name {
  font-weight: 700;
  font-size: 0.95rem;
  min-width: 100px;
}
.month-card-header .month-total {
  font-weight: 600;
  color: var(--navy-800);
}
.month-toggle-btn {
  border: 0;
  background: transparent;
  color: var(--slate-500);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.month-toggle-btn:hover {
  background: var(--slate-200);
  color: var(--navy-700);
}
.month-toggle-btn:focus-visible {
  outline: 2px solid var(--navy-600);
  outline-offset: 2px;
}
.month-chevron {
  transition: transform 0.2s;
  display: block;
}
.month-card.expanded .month-chevron {
  transform: rotate(90deg);
}
.month-card-body {
  display: none;
  padding: 16px;
}
.month-card.expanded .month-card-body {
  display: block;
}
.month-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}
.month-status-no-data {
  background: var(--slate-100);
  color: var(--slate-500);
}
.month-status-draft {
  background: #fef3c7;
  color: #92400e;
}
.month-status-saved {
  background: #dcfce7;
  color: #166534;
}
.month-product-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
}
.month-product-table th {
  text-align: left;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--slate-600);
  padding: 6px 8px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.month-product-table th.text-right,
.month-product-table td.text-right {
  text-align: right;
}
.month-product-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.month-product-table td input {
  width: 100%;
  min-width: 60px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.88rem;
  background: var(--surface);
}
.month-product-table td input:focus {
  outline: 2px solid var(--navy-600);
  outline-offset: -1px;
}
.month-product-table td input[readonly] {
  background: var(--slate-50);
  color: var(--navy-800);
  font-weight: 600;
  border-color: transparent;
}
.month-product-table .subtotal-cell {
  font-weight: 600;
  color: var(--navy-800);
  white-space: nowrap;
}
.month-product-table .remove-btn {
  background: none;
  border: none;
  color: #dc2626;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 6px;
  border-radius: var(--radius);
}
.month-product-table .remove-btn:hover {
  background: #fee2e2;
}
.month-remarks {
  margin-top: 12px;
}
.month-remarks textarea {
  width: 100%;
  min-height: 60px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.88rem;
  resize: vertical;
}
.month-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.month-card-footer .month-total-label {
  font-weight: 600;
  color: var(--navy-800);
  font-size: 0.95rem;
}
.monthly-manager-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--slate-50);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.monthly-manager-summary .summary-label {
  font-weight: 700;
  color: var(--slate-700);
  font-size: 0.88rem;
}
.monthly-manager-summary .summary-value {
  font-weight: 800;
  color: var(--navy-900);
  font-size: 1rem;
}
@media (max-width: 768px) {
  .month-product-table {
    display: block;
    overflow-x: auto;
  }
  .month-card-header {
    flex-wrap: wrap;
  }
}
