:root {
  --ink: #07111f;
  --navy: #0b2d5a;
  --blue: #1767a9;
  --teal: #0099ad;
  --green: #7fba3f;
  --orange: #f3a334;
  --red: #c83f34;
  --line: #b8c8d6;
  --panel: #ffffff;
  --soft: #edf5f9;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #dfeaf0;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  overflow-x: hidden;
}

.stats-page {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100vh;
  width: 100%;
}

.stats-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
  background: linear-gradient(180deg, #0b2d5a 0%, #113b77 100%);
  color: #fff;
  box-shadow: 5px 0 16px rgba(0, 0, 0, 0.18);
  z-index: 2;
}

.stats-sidebar img {
  display: block;
  width: 165px;
  max-width: 100%;
  margin: 0 auto 26px;
  padding: 10px;
  border-radius: 8px;
  background: #fff;
}

.stats-sidebar nav {
  display: grid;
  gap: 10px;
}

.stats-sidebar a,
.stats-sidebar button {
  display: block;
  width: 100%;
  padding: 12px 11px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 4px;
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
  text-align: left;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.stats-sidebar a:hover,
.stats-sidebar a:focus-visible,
.stats-sidebar button:hover,
.stats-sidebar button:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  outline: none;
}

.ops-calendar-nav {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ops-calendar-badge {
  min-width: 24px;
  border-radius: 999px;
  padding: 3px 7px;
  background: var(--orange);
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
}

.stats-main {
  min-width: 0;
  padding: 14px;
}

.stats-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 13px 18px;
  border-radius: 6px;
  background: var(--navy);
  color: #fff;
  box-shadow: 0 2px 8px rgba(17, 45, 75, 0.24);
}

.stats-title h1 {
  margin: 0;
  font-size: clamp(20px, 3vw, 38px);
  line-height: 1.05;
  font-weight: 900;
  text-align: center;
}

.stats-title span {
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
  color: #d7f1f6;
}

.period-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #8fa9ba;
  border-radius: 6px;
  background: #fff;
}

.period-toolbar label {
  display: grid;
  gap: 4px;
  color: #344f62;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.period-toolbar input,
.period-toolbar select {
  height: 38px;
  border: 1px solid #aebfcb;
  border-radius: 4px;
  padding: 7px 9px;
  background: #fff;
  font: 800 13px Arial, Helvetica, sans-serif;
}

.period-toolbar button {
  height: 38px;
  border: 1px solid #0f7789;
  border-radius: 4px;
  padding: 0 12px;
  background: #0f7789;
  color: #fff;
  font: 900 12px Arial, Helvetica, sans-serif;
  cursor: pointer;
}

.period-toolbar span {
  color: #536b7a;
  font-size: 12px;
  font-weight: 800;
}

.ops-calendar-summary {
  margin-bottom: 12px;
}

.ops-calendar-summary a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(220px, auto);
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border: 1px solid #8fa9ba;
  border-radius: 6px;
  background: linear-gradient(135deg, #102f5e 0%, #0f7789 100%);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 1px 5px rgba(13, 37, 58, 0.16);
}

.ops-calendar-summary span {
  font-size: 15px;
  font-weight: 900;
  text-transform: uppercase;
}

.ops-calendar-summary strong {
  min-width: 58px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  padding: 7px 12px;
  background: #f3a334;
  color: #07111f;
  font-size: 28px;
  line-height: 1;
  text-align: center;
}

.ops-calendar-summary small {
  color: #d8eef4;
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.manpower-grid,
.manpower-summary-section,
.fleet-section,
.chart-grid,
.crew-exp-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.table-card,
.chart-card,
.bar-card,
.delay-table,
.crew-card,
.task-section,
.payroll-card,
.notes-card,
.manpower-summary-card,
.fleet-card {
  min-width: 0;
  border: 1px solid #8fa9ba;
  border-radius: 6px;
  background: var(--panel);
  box-shadow: 0 1px 5px rgba(13, 37, 58, 0.12);
}

.table-card.wide {
  grid-column: span 8;
  overflow: hidden;
}

.payroll-card {
  grid-column: span 2;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  min-height: 160px;
  background: #102f5e;
  color: #fff;
}

.payroll-card span {
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.payroll-card strong {
  width: min(120px, 90%);
  padding: 17px 8px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: var(--teal);
  font-size: 42px;
  line-height: 1;
  text-align: center;
}

.notes-card {
  grid-column: span 2;
  padding: 10px 12px;
  background: #102f5e;
  color: #fff;
  font-weight: 700;
}

.notes-card h2 {
  margin: 0 0 8px;
  font-size: 15px;
}

.manpower-summary-section {
  align-items: start;
}

.manpower-summary-card {
  grid-column: span 12;
  overflow: hidden;
  border-color: #8fa9ba;
  background: linear-gradient(180deg, #f8fbfd 0%, #eef5f8 100%);
}

.manpower-summary-table {
  overflow-x: auto;
  border-top: 1px solid #90aabd;
  background: #d8e6ee;
}

.summary-grid-table {
  display: grid;
  grid-template-columns: minmax(165px, 1.45fr) repeat(9, minmax(70px, 1fr));
  min-width: 820px;
  color: #07111f;
  font-weight: 800;
}

.summary-cell {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-right: 1px solid #c2d1dc;
  border-bottom: 1px solid #c2d1dc;
  padding: 5px 7px;
  background: #fbfdfe;
  color: #102f5e;
  font: 900 clamp(10px, 0.82vw, 13px) / 1 Arial, Helvetica, sans-serif;
  text-align: center;
}

.summary-grid-table .summary-cell:nth-child(20n + 11),
.summary-grid-table .summary-cell:nth-child(20n + 12),
.summary-grid-table .summary-cell:nth-child(20n + 13),
.summary-grid-table .summary-cell:nth-child(20n + 14),
.summary-grid-table .summary-cell:nth-child(20n + 15),
.summary-grid-table .summary-cell:nth-child(20n + 16),
.summary-grid-table .summary-cell:nth-child(20n + 17),
.summary-grid-table .summary-cell:nth-child(20n + 18),
.summary-grid-table .summary-cell:nth-child(20n + 19),
.summary-grid-table .summary-cell:nth-child(20n + 20) {
  background: #f3f8fb;
}

button.summary-cell {
  cursor: pointer;
}

button.summary-cell:hover,
button.summary-cell:focus-visible {
  background: #dff3f6;
  outline: 2px solid #0f7789;
  outline-offset: -2px;
}

.summary-head {
  min-height: 34px;
  border-right-color: rgba(255, 255, 255, 0.18);
  border-bottom-color: #0b2d5a;
  background: linear-gradient(180deg, #123b70 0%, #0b2d5a 100%);
  color: #fff;
  font-size: clamp(11px, 0.95vw, 14px);
  letter-spacing: 0;
}

.summary-label {
  justify-content: flex-start;
  padding-left: 12px;
  background: #edf5f9;
  color: #07111f;
  font-size: clamp(12px, 0.95vw, 15px);
  text-align: left;
}

.summary-separator {
  border-top: 3px solid #0b2d5a;
}

.summary-local,
.summary-local-pct {
  background: #ecf7ef;
}

.summary-expat,
.summary-expat-pct {
  background: #fff7e7;
}

.summary-male,
.summary-male-pct {
  background: #eef5ff;
}

.summary-female,
.summary-female-pct {
  background: #fdf0f5;
}

.summary-percent {
  color: #0f7789;
  font-size: clamp(10px, 0.78vw, 12px);
}

.summary-total {
  background: #e6f4f6;
  color: #0b2d5a;
  font-size: clamp(11px, 0.9vw, 14px);
}

.dhc6-graph-section {
  margin-bottom: 12px;
  min-width: 0;
  border: 1px solid #8fa9ba;
  border-radius: 6px;
  background: linear-gradient(180deg, #f8fbfd 0%, #eef5f8 100%);
  box-shadow: 0 1px 5px rgba(13, 37, 58, 0.12);
  overflow: hidden;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #9eb4c3;
  background: #102f5e;
  color: #fff;
}

.section-title-row h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
}

.section-title-row p {
  margin: 3px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 11px;
  font-weight: 800;
}

.section-title-row span {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.dhc6-graph-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
}

.dhc6-graph-card {
  min-width: 0;
  border: 1px solid #c4d3de;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(10, 31, 50, 0.12);
  overflow: hidden;
}

.dhc6-graph-card svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 240px;
  background: #fff;
}

.crew-chart-title {
  fill: #111827;
  font: 900 18px Arial, Helvetica, sans-serif;
}

.crew-grid-line {
  stroke: #d7e1e8;
  stroke-width: 1;
}

.crew-axis-line {
  stroke: #91a5b4;
  stroke-width: 1.2;
}

.crew-axis-label,
.crew-x-label,
.crew-legend-label {
  fill: #1f2937;
  font: 800 10px Arial, Helvetica, sans-serif;
}

.crew-x-label {
  font-size: 9px;
}

.crew-data-label {
  fill: #111827;
  font: 900 11px Arial, Helvetica, sans-serif;
}

.crew-data-label.red-label,
.crew-limit-label {
  fill: #d42027;
}

.crew-limit-label {
  font: 900 11px Arial, Helvetica, sans-serif;
}

.bar-label {
  fill: #111827;
  font-size: 10px;
}

.chart-empty {
  fill: #536b7a;
  font: 900 16px Arial, Helvetica, sans-serif;
}

.fleet-section {
  align-items: start;
}

.fleet-card {
  grid-column: span 12;
  overflow: hidden;
  background: #eef2f5;
}

.fleet-title {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  gap: 10px;
  padding: 5px 12px;
  background: linear-gradient(180deg, #111922 0%, #05080c 100%);
  color: #fff;
  font-size: clamp(14px, 1.55vw, 20px);
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.45);
}

.fleet-title span {
  min-width: 0;
}

.fleet-title button {
  position: absolute;
  right: 10px;
  width: 28px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font: 900 18px/1 Arial, Helvetica, sans-serif;
  cursor: pointer;
}

.fleet-title button:hover,
.fleet-title button:focus-visible {
  background: #fff;
  color: #0b2d5a;
  outline: none;
}

.fleet-table {
  display: grid;
  border-top: 1px solid #6f7f88;
  background: #dfe6eb;
  color: #202932;
  font-size: 13px;
  font-weight: 800;
}

.fleet-row {
  display: grid;
  grid-template-columns: 64px minmax(86px, 120px) minmax(120px, 180px) minmax(90px, 150px) minmax(0, 1fr);
  background: #f5f7f8;
}

.fleet-row:not(.fleet-head) {
  cursor: pointer;
}

.fleet-row:not(.fleet-head):hover,
.fleet-row:not(.fleet-head):focus-visible {
  outline: 2px solid #0f7789;
  outline-offset: -2px;
  filter: brightness(0.98);
}

.fleet-row > div {
  min-height: 27px;
  padding: 4px 7px;
  border-right: 1px solid #778892;
  border-bottom: 1px solid #778892;
  display: flex;
  align-items: center;
}

.fleet-row > div:first-child,
.fleet-row > div:nth-child(2),
.fleet-row > div:nth-child(4) {
  justify-content: center;
  text-align: center;
}

.fleet-head {
  background: #c6e1ee;
  color: #1d3445;
  font-size: 13px;
  font-weight: 900;
}

.fleet-head > div {
  justify-content: center;
  min-height: 30px;
}

.fleet-remarks {
  font-size: 13px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.fleet-counts {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  border-top: 2px solid #111922;
  background: #778892;
}

.fleet-count-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 5px 8px;
  background: #f8fbfd;
  color: #102f5e;
}

.fleet-count-item span {
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.fleet-count-item strong {
  display: grid;
  place-items: center;
  min-width: 26px;
  height: 22px;
  border-radius: 999px;
  background: #102f5e;
  color: #fff;
  font-size: 12px;
}

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

.note-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.note-number {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #0f7789;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.note-item p,
.note-empty {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
}

.card-title,
.task-section h2,
.chart-card h2,
.bar-card h2,
.crew-card h2 {
  margin: 0;
  padding: 8px 10px;
  border-bottom: 1px solid #8fa9ba;
  background: #113b77;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}

.bar-card h2 span {
  color: #cff8ff;
}

.excel-table {
  display: grid;
  width: 100%;
  font-size: 12px;
  font-weight: 800;
}

.excel-row {
  display: grid;
  grid-template-columns: minmax(92px, 1.4fr) repeat(13, minmax(34px, 1fr));
}

.excel-row > div {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 28px;
  padding: 6px 4px;
  border-right: 1px solid #1b3144;
  border-bottom: 1px solid #1b3144;
  text-align: center;
  overflow-wrap: anywhere;
}

.excel-row > div:first-child {
  justify-content: flex-start;
  text-align: left;
  background: #0b2d5a;
  color: #fff;
}

.excel-head > div {
  background: #0b2d5a;
  color: #fff;
  font-size: 10px;
}

.chart-card,
.bar-card {
  grid-column: span 6;
  overflow: hidden;
}

.chart-card svg {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
}

.chart-card.dark {
  background: #162b3a;
}

.chart-card.dark svg {
  background: #162b3a;
}

.delay-table {
  grid-column: span 6;
  overflow: hidden;
}

.summary-table {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  font-weight: 900;
  text-align: center;
}

.summary-table div {
  padding: 10px 8px;
  border-right: 1px solid #8fa9ba;
}

.summary-table div:last-child {
  border-right: 0;
}

.summary-table small {
  display: block;
  margin-bottom: 4px;
  color: #466272;
  font-size: 11px;
}

.summary-table strong {
  color: var(--blue);
  font-size: 24px;
}

.util-bars {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
  gap: 9px;
  min-height: 260px;
  padding: 18px 16px 12px;
}

.util-item {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 8px;
  min-width: 0;
  height: 230px;
}

.util-column {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 176px;
  border-left: 1px solid #d5e0e8;
  border-bottom: 1px solid #859bac;
}

.util-fill {
  width: min(38px, 70%);
  min-height: 3px;
  border-radius: 4px 4px 0 0;
  background: var(--teal);
}

.util-value {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  font-weight: 900;
}

.util-label {
  min-height: 38px;
  color: #102f5e;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
}

.crew-card {
  grid-column: span 3;
  overflow: hidden;
  cursor: pointer;
}

.crew-card:hover,
.crew-card:focus-visible {
  outline: 2px solid #0f7789;
  outline-offset: -2px;
  box-shadow: 0 0 0 3px rgba(15, 119, 137, 0.12), 0 1px 5px rgba(13, 37, 58, 0.12);
}

.crew-body {
  display: grid;
  gap: 1px;
  background: #8fa9ba;
}

.crew-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  background: #fff;
  font-size: 12px;
  font-weight: 900;
}

.crew-row strong {
  color: var(--blue);
  font-size: 20px;
}

.crew-row.highlight {
  background: #e7f5f1;
}

.crew-row.warn strong {
  color: var(--red);
}

.crew-util-section {
  margin-bottom: 12px;
  border: 1px solid #8fa9ba;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 1px 5px rgba(13, 37, 58, 0.12);
  overflow: hidden;
}

.crew-util-heading {
  display: grid;
  grid-template-columns: minmax(40px, 1fr) auto minmax(40px, 1fr);
  align-items: center;
  gap: 14px;
  padding: 9px 14px;
  background: #fff;
}

.crew-util-heading span {
  height: 3px;
  background: #0b2d5a;
}

.crew-util-heading h2 {
  margin: 0;
  color: #0b2d5a;
  font-size: clamp(18px, 2.4vw, 32px);
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.crew-util-heading-main {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.crew-util-heading-main label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #344f62;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.crew-util-heading-main select {
  height: 28px;
  border: 1px solid #8fa9ba;
  border-radius: 4px;
  padding: 3px 8px;
  background: #fff;
  color: #07111f;
  font: 900 12px Arial, Helvetica, sans-serif;
}

.crew-util-tables {
  display: grid;
  gap: 10px;
  padding: 0 10px 10px;
}

.crew-util-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #748998;
  border-radius: 5px;
  background: #eef3f6;
}

.crew-util-title {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 28px;
  padding: 4px 44px;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}

.crew-util-card.captains .crew-util-title {
  background: #7e207f;
}

.crew-util-card.first-officers .crew-util-title {
  background: #075d76;
}

.crew-util-card.cabin-crew .crew-util-title {
  background: #0e7790;
}

.crew-util-title button {
  position: absolute;
  right: 8px;
  top: 4px;
  width: 26px;
  height: 20px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font: 900 16px/1 Arial, Helvetica, sans-serif;
  cursor: pointer;
}

.crew-util-title button:hover,
.crew-util-title button:focus-visible {
  background: #fff;
  color: #0b2d5a;
  outline: none;
}

.crew-util-table {
  display: grid;
  grid-template-columns: minmax(58px, .9fr) repeat(13, minmax(48px, 1fr));
  width: 100%;
  background: #728594;
  gap: 1px;
  font-size: clamp(9px, .64vw, 11px);
  font-weight: 800;
}

.crew-util-cell {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 24px;
  margin: 0;
  border: 0;
  padding: 3px 4px;
  background: #fff;
  color: #07111f;
  font: inherit;
  line-height: 1.1;
  text-align: center;
  overflow-wrap: anywhere;
}

button.crew-util-cell {
  cursor: pointer;
}

button.crew-util-cell:hover,
button.crew-util-cell:focus-visible {
  box-shadow: inset 0 0 0 2px #0f7789;
  outline: none;
}

.crew-util-head {
  min-height: 30px;
  background: #c9e4ef;
  color: #173446;
  font-size: clamp(8px, .58vw, 10px);
  font-weight: 900;
}

.crew-util-cell.good {
  background: #89c96b;
}

.crew-util-cell.warm {
  background: #ffd965;
}

.crew-util-cell.hot {
  background: #e45e51;
  color: #fff;
}

.crew-util-cell.low {
  background: #f2b28d;
}

.crew-util-modal-panel {
  width: min(1040px, 100%);
}

.crew-util-meta {
  grid-template-columns: 240px minmax(0, 1fr);
  align-items: center;
}

.crew-util-meta span {
  color: #496575;
  font-size: 12px;
  font-weight: 800;
}

.crew-util-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

.crew-util-form label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: #344f62;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.crew-util-form input,
.crew-util-form select {
  width: 100%;
  min-width: 0;
  border: 1px solid #aebfcb;
  border-radius: 6px;
  padding: 10px 11px;
  background: #fff;
  color: #07111f;
  font: 800 13px Arial, Helvetica, sans-serif;
}

.crew-util-modal-actions {
  display: flex;
  gap: 10px;
}

.crew-util-modal-actions button {
  min-width: 110px;
}

.crew-util-modal-actions .danger {
  border-color: #9c2f2a;
  background: #fff;
  color: #9c2f2a;
}

.task-section {
  margin-bottom: 12px;
  overflow: hidden;
}

.task-rings {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
}

.task-item {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 0;
  text-align: center;
}

.task-ring {
  display: grid;
  place-items: center;
  width: min(118px, 100%);
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--orange) var(--angle), #dfe8ee 0);
}

.task-ring span {
  display: grid;
  place-items: center;
  width: 74%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
  color: var(--navy);
  font-size: 28px;
  font-weight: 900;
}

.task-name {
  font-size: 12px;
  font-weight: 900;
  color: #102f5e;
}

.task-due {
  color: #536b7a;
  font-size: 11px;
  font-weight: 800;
}

.empty-state {
  padding: 24px;
  border: 1px solid #8fa9ba;
  border-radius: 6px;
  background: #fff;
  color: #536b7a;
  font-weight: 800;
}

.stats-modal[hidden] {
  display: none;
}

.stats-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(7, 17, 31, 0.58);
  backdrop-filter: blur(5px);
}

.stats-modal-panel {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  width: min(1240px, 100%);
  max-height: min(920px, calc(100vh - 44px));
  overflow: hidden;
  border: 1px solid rgba(143, 169, 186, 0.95);
  border-radius: 10px;
  background: #eef5f8;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.38);
}

.report-panel {
  width: min(980px, 100%);
}

.stats-modal-head,
.stats-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: #fff;
}

.stats-modal-head {
  border-bottom: 1px solid #91aabd;
  background: linear-gradient(135deg, #0b2d5a 0%, #12446f 70%, #0f7789 100%);
  color: #fff;
}

.stats-modal-head h2 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 900;
}

.stats-modal-head p {
  margin: 0;
  color: #d8eef4;
  font-size: 13px;
  font-weight: 700;
}

.stats-modal-head button {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.stats-editor-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid #b8c8d6;
  background: #f8fbfd;
}

.stats-editor-meta label,
.stats-edit-grid label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: #344f62;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.stats-editor-meta input,
.stats-edit-grid input,
.stats-edit-grid select,
.stats-edit-grid textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #aebfcb;
  border-radius: 6px;
  padding: 10px 11px;
  background: #fff;
  color: #07111f;
  font: 800 13px Arial, Helvetica, sans-serif;
}

.stats-editor-meta input:focus,
.stats-edit-grid input:focus,
.stats-edit-grid select:focus,
.stats-edit-grid textarea:focus {
  border-color: #0f7789;
  box-shadow: 0 0 0 3px rgba(15, 119, 137, 0.16);
  outline: none;
}

.stats-edit-grid textarea {
  min-height: 72px;
  resize: vertical;
}

.stats-editor-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 18px;
  border-bottom: 1px solid #b8c8d6;
  background: #dfeaf0;
}

.stats-editor-tabs button {
  flex: 0 0 auto;
  border: 1px solid #9eb4c3;
  border-radius: 999px;
  padding: 9px 14px;
  background: #fff;
  color: #102f5e;
  font: 900 12px Arial, Helvetica, sans-serif;
  cursor: pointer;
}

.stats-editor-tabs button.active {
  background: #113b77;
  border-color: #113b77;
  color: #fff;
}

.stats-editor-body {
  min-height: 0;
  overflow: auto;
  padding: 18px;
  background: linear-gradient(180deg, #eef5f8 0%, #f8fbfd 100%);
}

.stats-edit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

.stats-edit-grid.wide {
  grid-template-columns: repeat(6, minmax(95px, 1fr));
}

.stats-edit-grid.row-settings {
  grid-template-columns: minmax(220px, 1fr) 150px;
  margin-bottom: 10px;
}

.stats-edit-grid.fleet-edit-grid {
  grid-template-columns: 110px 150px 110px minmax(180px, 1fr) 120px;
}

.compact-modal .stats-modal-panel,
.manpower-summary-modal-panel {
  width: min(760px, 100%);
  max-height: min(92vh, 720px);
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.manpower-summary-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.manpower-summary-form label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: #344f62;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.manpower-summary-form input {
  width: 100%;
  min-width: 0;
  border: 1px solid #aebfcb;
  border-radius: 6px;
  padding: 10px 11px;
  background: #fff;
  color: #07111f;
  font: 800 13px Arial, Helvetica, sans-serif;
}

.manpower-summary-form input[readonly] {
  background: #e8f2f7;
  color: #102f5e;
}

.manpower-summary-form label:first-of-type {
  grid-column: span 2;
}

.summary-delete-row {
  border: 1px solid #9c2f2a !important;
  background: #fff !important;
  color: #9c2f2a !important;
}

.summary-delete-row:hover,
.summary-delete-row:focus-visible {
  background: #fff1f0 !important;
  outline: none;
}

#manpowerSummaryStatus {
  flex: 1 1 auto;
  color: #536b7a;
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

.stats-edit-grid input[type="color"] {
  height: 38px;
  padding: 3px;
}

.stats-edit-grid input.auto-field {
  background: #e8f2f7;
  color: #102f5e;
}

.auto-note {
  color: #607684;
  font-size: 10px;
  font-weight: 800;
  text-transform: none;
}

.notes-editor {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid #b8c8d6;
  border-radius: 8px;
  background: #f8fbfd;
}

.add-note {
  justify-self: stretch;
  border: 1px solid #0f7789;
  border-radius: 6px;
  padding: 12px 14px;
  background: #e7f5f7;
  color: #0b5260;
  font: 900 12px Arial, Helvetica, sans-serif;
  text-align: center;
  cursor: pointer;
}

.add-note:hover,
.add-note:focus-visible {
  background: #d6eef2;
  outline: none;
}

.note-edit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid #b8c8d6;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(13, 37, 58, 0.08);
}

.note-edit-row label {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  color: #102f5e;
  font-size: 13px;
  text-transform: none;
}

.note-edit-row textarea {
  width: 100%;
  min-height: 82px;
  line-height: 1.45;
  resize: vertical;
}

.delete-note {
  align-self: center;
  width: 44px;
  height: 44px;
  border: 1px solid #bdcbd5;
  border-radius: 6px;
  background: #fff;
  color: #9c2f2a;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.delete-note:hover,
.delete-note:focus-visible {
  border-color: #9c2f2a;
  background: #fff1f0;
  outline: none;
}

.delete-fleet-row {
  align-self: center;
  width: 44px;
  height: 44px;
  border: 1px solid #bdcbd5;
  border-radius: 6px;
  background: #fff;
  color: #9c2f2a;
  font: 900 15px Arial, Helvetica, sans-serif;
  cursor: pointer;
}

.delete-fleet-row:hover,
.delete-fleet-row:focus-visible {
  border-color: #9c2f2a;
  background: #fff1f0;
  outline: none;
}

.stats-edit-section {
  display: grid;
  gap: 14px;
}

.stats-edit-section h3 {
  margin: 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #113b77 0%, #0f7789 100%);
  color: #fff;
  font-size: 14px;
}

.otp-entry-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.otp-period-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 260px));
  gap: 12px;
  padding: 14px;
  border: 1px solid #b8c8d6;
  border-radius: 8px;
  background: #fff;
}

.otp-period-controls label {
  display: grid;
  gap: 6px;
  color: #344f62;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.otp-period-controls input {
  border: 1px solid #aebfcb;
  border-radius: 6px;
  padding: 10px 11px;
  font: 800 13px Arial, Helvetica, sans-serif;
}

.otp-entry-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #b8c8d6;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(13, 37, 58, 0.08);
}

.otp-entry-subtitle {
  margin: 2px 0 -2px;
  color: #536b7a;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.otp-entry-card h4 {
  margin: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #d5e0e8;
  color: #102f5e;
  font-size: 15px;
  font-weight: 900;
}

.editor-period-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #8fb9c4;
  border-radius: 8px;
  background: linear-gradient(135deg, #102f5e 0%, #0f7789 100%);
  color: #fff;
}

.editor-period-actions span {
  min-width: 0;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.editor-period-actions button {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 6px;
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font: 900 12px Arial, Helvetica, sans-serif;
  cursor: pointer;
}

.editor-period-actions button.primary {
  background: #ffffff;
  border-color: #86d6e3;
  color: #0b2d5a;
}

.editor-period-actions button:hover,
.editor-period-actions button:focus-visible {
  background: rgba(255, 255, 255, 0.24);
  outline: none;
}

.editor-period-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.stats-edit-row {
  padding: 14px;
  border: 1px solid #b8c8d6;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(13, 37, 58, 0.08);
}

.stats-edit-row-title {
  margin: 0 0 10px;
  color: #102f5e;
  font-size: 13px;
  font-weight: 900;
}

.fleet-editor-block {
  display: grid;
  gap: 10px;
}

.fleet-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fleet-editor-head h3 {
  flex: 1;
}

.add-fleet-row {
  border: 1px solid #0f7789;
  border-radius: 6px;
  padding: 10px 13px;
  background: #e7f5f7;
  color: #0b5260;
  font: 900 12px Arial, Helvetica, sans-serif;
  cursor: pointer;
}

.fleet-edit-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 44px;
  gap: 12px;
  align-items: end;
  padding: 12px;
  border: 1px solid #b8c8d6;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(13, 37, 58, 0.08);
}

.fleet-edit-row.focus-row {
  border-color: #0f7789;
  box-shadow: 0 0 0 3px rgba(15, 119, 137, 0.18), 0 1px 4px rgba(13, 37, 58, 0.08);
}

.fleet-edit-number {
  display: grid;
  place-items: center;
  height: 38px;
  border-radius: 6px;
  background: #102f5e;
  color: #fff;
  font-weight: 900;
}

.stats-modal-foot {
  border-top: 1px solid #b8c8d6;
  background: #f8fbfd;
}

.stats-modal-foot span {
  color: #344f62;
  font-size: 13px;
  font-weight: 800;
}

.stats-modal-foot button {
  border: 0;
  border-radius: 6px;
  padding: 12px 18px;
  background: #0f7789;
  color: #fff;
  font: 900 13px Arial, Helvetica, sans-serif;
  cursor: pointer;
}

.stats-modal-foot button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.report-summary {
  display: grid;
  gap: 12px;
}

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

.report-kpi {
  padding: 13px;
  border: 1px solid #b8c8d6;
  border-radius: 6px;
  background: #fff;
}

.report-kpi small {
  display: block;
  margin-bottom: 5px;
  color: #536b7a;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.report-kpi strong {
  color: #102f5e;
  font-size: 28px;
  font-weight: 900;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.report-table th,
.report-table td {
  padding: 8px 9px;
  border: 1px solid #9eb4c3;
  text-align: right;
}

.report-table th {
  background: #113b77;
  color: #fff;
}

.report-table th:first-child,
.report-table td:first-child {
  text-align: left;
}

@media (max-width: 1280px) {
  .stats-page {
    grid-template-columns: 180px minmax(0, 1fr);
  }

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

  .table-card.wide,
  .payroll-card,
  .notes-card,
  .manpower-summary-card,
  .fleet-card,
  .crew-util-card,
  .chart-card,
  .bar-card,
  .delay-table {
    grid-column: span 12;
  }

  .crew-card {
    grid-column: span 6;
  }
}

@media (max-width: 760px) {
  .stats-page {
    display: block;
  }

  .dhc6-graph-grid {
    grid-template-columns: 1fr;
  }

  .section-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats-sidebar {
    position: static;
    height: auto;
    padding: 12px;
  }

  .stats-sidebar img {
    width: 130px;
    margin-bottom: 12px;
  }

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

  .stats-main {
    padding: 10px;
  }

  .stats-title {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .ops-calendar-summary a {
    grid-template-columns: 1fr auto;
  }

  .ops-calendar-summary small {
    grid-column: 1 / -1;
    text-align: left;
  }

  .editor-period-actions {
    grid-template-columns: 1fr 1fr;
  }

  .editor-period-actions span {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .excel-table {
    font-size: 10px;
  }

  .excel-row {
    grid-template-columns: minmax(70px, 1.6fr) repeat(13, minmax(22px, 1fr));
  }

  .excel-row > div {
    min-height: 25px;
    padding: 5px 2px;
  }

  .util-bars,
  .task-rings {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .crew-card {
    grid-column: span 12;
  }

  .stats-modal {
    padding: 8px;
  }

  .stats-modal-panel {
    max-height: calc(100vh - 16px);
  }

  .stats-modal-head,
  .stats-modal-foot {
    align-items: flex-start;
  }

  .stats-editor-meta,
  .stats-edit-grid,
  .stats-edit-grid.wide,
  .stats-edit-grid.row-settings,
  .stats-edit-grid.fleet-edit-grid,
  .manpower-summary-form,
  .note-edit-row,
  .otp-entry-grid,
  .otp-period-controls,
  .report-kpis {
    grid-template-columns: 1fr;
  }

  .fleet-row {
    grid-template-columns: 38px 58px minmax(78px, 1fr) 58px minmax(100px, 1.35fr);
    font-size: 11px;
  }

  .summary-grid-table {
    min-width: 720px;
  }

  .summary-cell {
    min-height: 34px;
    font-size: 13px;
  }

  .summary-head,
  .summary-label {
    font-size: 13px;
  }

  .manpower-summary-form label:first-of-type {
    grid-column: span 1;
  }

  .fleet-row > div {
    min-height: 28px;
    padding: 4px;
  }

  .fleet-head {
    font-size: 11px;
  }

  .fleet-remarks {
    font-size: 11px;
  }

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

  .crew-util-heading {
    gap: 8px;
    padding: 8px;
  }

  .crew-util-tables {
    padding: 0 6px 6px;
  }

  .crew-util-table {
    grid-template-columns: minmax(42px, .9fr) repeat(13, minmax(24px, 1fr));
    font-size: 8px;
  }

  .crew-util-cell {
    min-height: 23px;
    padding: 2px;
  }

  .crew-util-head {
    font-size: 7px;
  }

  .crew-util-form,
  .crew-util-meta {
    grid-template-columns: 1fr;
  }

  .crew-util-modal-actions {
    width: 100%;
  }

  .crew-util-modal-actions button {
    flex: 1;
    min-width: 0;
  }

  .fleet-edit-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .fleet-edit-row .delete-fleet-row {
    grid-column: 2;
    justify-self: end;
  }

  .note-edit-row label {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #fff;
  }

  body.printing-report .stats-page {
    display: none;
  }

  body.printing-report .stats-modal {
    position: static;
    display: block;
    padding: 0;
    background: #fff;
  }

  body.printing-report .stats-modal[hidden] {
    display: none;
  }

  body.printing-report .stats-modal-panel {
    width: 100%;
    max-height: none;
    border: 0;
    box-shadow: none;
  }

  body.printing-report .stats-modal-foot,
  body.printing-report .stats-modal-head button {
    display: none;
  }

  .stats-sidebar {
    display: none;
  }

  .stats-page {
    display: block;
  }

  .stats-main {
    padding: 0;
  }
}

