:root {
  color-scheme: light dark;
  font-family: system-ui, sans-serif;
}

body {
  margin: 0;
  color: #1a1a1a;
  background: #fafafa;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #dce9ff 0%, #4287ff 100%);
  /* background: #b3cfff; */
  color: white;
}

.navbar a {
  color: white;
  margin-left: 1rem;
  text-decoration: none;
}

.brand {
  margin-left: 0 !important;
  line-height: 0;
}

.brand-logo {
  height: 100px;
  width: auto;
  display: block;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 20px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 3px;
  width: 100%;
  background: white;
  border-radius: 2px;
}

.nav-dropdown {
  position: relative;
  display: inline-block;
  margin-left: 1rem;
}

.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: transparent;
  border: none;
  color: white;
  font: inherit;
  padding: 0;
  cursor: pointer;
}

.nav-dropdown-trigger::after {
  content: "\25be";
  font-size: 0.7em;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 20;
  min-width: 180px;
  margin-top: 0.6rem;
  padding: 0.25rem 0;
  background: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-dropdown-menu.open {
  display: block;
}

.nav-dropdown-menu a {
  display: block;
  margin-left: 0;
  padding: 0.5rem 1rem;
  color: #1a1a1a;
}

.nav-dropdown-menu a:hover {
  background: #f0f4ff;
}

@media (max-width: 720px) {
  .navbar {
    flex-wrap: wrap;
  }

  .brand-logo {
    height: 32px;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 0.75rem;
    margin-top: 1rem;
  }

  .nav-links.open {
    display: flex;
  }

  .navbar a {
    margin-left: 0;
  }

  .nav-dropdown {
    margin-left: 0;
    width: 100%;
  }

  .nav-dropdown-menu {
    display: none;
    position: static;
    box-shadow: none;
    border: none;
    background: transparent;
    margin-top: 0.5rem;
    padding-left: 1rem;
  }

  .nav-dropdown-menu.open {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .nav-dropdown-menu a {
    color: white;
    padding: 0;
  }

  .nav-dropdown-menu a:hover {
    background: transparent;
  }
}

.container {
  max-width: 640px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.container:has(table) {
  max-width: 900px;
}

.table-scroll {
  /* Wide tables scroll within their own box instead of pushing the whole
     page wider than the viewport on small screens. */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

th,
td {
  text-align: left;
  padding: 0.5rem;
  border-bottom: 1px solid #ddd;
}

.field {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
}

.field label {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.field input,
.field select {
  padding: 0.5rem;
  font-size: 1rem;
}

.checkbox-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.25rem 1rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.checkbox-list li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.checkbox-list input {
  width: auto;
}

.checkbox-list-wide {
  display: block;
}

.checkbox-list-wide li {
  display: block;
  padding: 0.75rem 0;
  border-bottom: 1px solid #eee;
}

.checkbox-list-wide li:last-child {
  border-bottom: none;
}

.checkbox-list-wide .field {
  margin: 0.4rem 0 0 1.5rem;
}

.exercise-select {
  display: block;
  width: 100%;
  max-width: 360px;
  padding: 0.4rem;
  font-size: 1rem;
  margin: 0.25rem 0 0.75rem;
}

.multiselect-dropdown {
  position: relative;
  display: block;
  width: 100%;
  max-width: 480px;
  margin: 0.25rem 0 0.75rem;
}

.multiselect-trigger {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  font-size: 1rem;
  line-height: 1.4;
  white-space: normal;
  background: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
}

.multiselect-trigger::after {
  content: "\25be";
  position: absolute;
  top: 50%;
  right: 0.75rem;
  transform: translateY(-50%);
  color: #666;
}

.multiselect-panel {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 20;
  width: max-content;
  min-width: 100%;
  max-width: min(480px, calc(100vw - 2rem));
  max-height: 280px;
  overflow-y: auto;
  margin-top: 0.25rem;
  padding: 0.25rem 0;
  background: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.multiselect-option {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
}

.multiselect-option:hover {
  background: #f0f4ff;
}

.multiselect-option input {
  width: auto;
  flex-shrink: 0;
  margin-top: 0.2rem;
}

.multiselect-option span {
  white-space: normal;
  word-break: break-word;
}

.error {
  color: #b00020;
  font-size: 0.875rem;
  margin: 0.25rem 0 0;
}

.flash {
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.flash-error {
  background: #fdecea;
  color: #b00020;
}

.flash-success {
  background: #e6f4ea;
  color: #1e7e34;
}

button,
input[type="submit"] {
  padding: 0.6rem 1.2rem;
  background: #0b3d91;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
}

td.actions {
  white-space: nowrap;
}

.filter-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.filter-form select {
  padding: 0.4rem;
  font-size: 1rem;
}

.inline-form {
  display: inline-block;
  margin-left: 0.75rem;
}

.btn-small {
  padding: 0.3rem 0.6rem;
  font-size: 0.85rem;
}

.btn-danger {
  background: #b00020;
}

.progress-bar {
  background: #eee;
  border-radius: 4px;
  height: 0.75rem;
  overflow: hidden;
  margin: 0.5rem 0 1rem;
}

.progress-bar-fill {
  background: #1e7e34;
  height: 100%;
}

.badge-complete {
  display: inline-block;
  vertical-align: middle;
  font-size: 0.75rem;
  background: #1e7e34;
  color: white;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: normal;
  margin-left: 0.5rem;
}

.badge-warning {
  display: inline-block;
  vertical-align: middle;
  font-size: 0.75rem;
  background: #b45309;
  color: white;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: normal;
  margin-left: 0.5rem;
}

.badge-danger {
  display: inline-block;
  vertical-align: middle;
  font-size: 0.75rem;
  background: #b00020;
  color: white;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: normal;
  margin-left: 0.5rem;
}

.row-needs-completion {
  background: #fdf6ec;
}

.row-attention {
  background: #fdecea;
}

.exercise-pager {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #ddd;
}

.exercise-subsection {
  border-left: 3px solid #ddd;
  padding: 0.25rem 0 0.25rem 1rem;
  margin-bottom: 1rem;
}

.exercise-subsection h3 {
  margin-bottom: 0.25rem;
}

.dashboard-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.25rem;
  border-radius: 8px;
  background: #0b3d91;
  color: white;
  text-decoration: none;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tile-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.tile-desc {
  font-size: 0.85rem;
  opacity: 0.9;
}

.tile button {
  align-self: flex-start;
  margin-top: 0.35rem;
  background: white;
  color: #0b3d91;
}

.progress-panel {
  background: white;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-top: 1.5rem;
}

.progress-panel h2 {
  margin-top: 0;
}

.encouragement {
  color: #1e7e34;
  font-weight: 600;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.stat-label {
  font-size: 0.8rem;
  color: #666;
}

.next-lesson-banner {
  background: #eaf1ff;
  border: 1px solid #b9d0ff;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-top: 1rem;
}

.weather-panel {
  background: white;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-top: 1.5rem;
}

.weather-panel h2 {
  margin-top: 0;
}

.metar-raw {
  font-family: monospace;
  background: #f5f5f5;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  overflow-x: auto;
  white-space: nowrap;
}

.metar-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.25rem 1rem;
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
}

.flight-cat-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  color: white;
  margin-right: 0.5rem;
}

.flight-cat-vfr {
  background: #1e7e34;
}

.flight-cat-mvfr {
  background: #0b3d91;
}

.flight-cat-ifr {
  background: #b00020;
}

.flight-cat-lifr {
  background: #7b1fa2;
}

.aircraft-thumb {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  cursor: pointer;
}

.aircraft-thumb-large {
  max-width: 320px;
  max-height: 240px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  margin-top: 0.25rem;
}

.chart-subtitle {
  margin-top: -0.5rem;
  color: #666;
  font-size: 0.85rem;
}

.chart-wrap {
  position: relative;
  margin-top: 1rem;
}

.aircraft-hours-chart {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

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

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

.chart-axis-label {
  fill: #666;
  font-size: 9px;
}

.chart-axis-label-today {
  fill: #0b3d91;
  font-weight: 700;
}

.chart-today-line {
  stroke: #ddd;
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.chart-line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart-end-label {
  font-size: 9px;
  fill: #1a1a1a;
}

.chart-crosshair {
  stroke: #999;
  stroke-width: 1;
  pointer-events: none;
}

.chart-tooltip {
  position: absolute;
  z-index: 5;
  min-width: 140px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  padding: 0.5rem 0.65rem;
  font-size: 0.8rem;
  pointer-events: none;
}

.chart-tooltip-day {
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.chart-tooltip ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.chart-tooltip li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.chart-tooltip-swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chart-tooltip-name {
  color: #666;
}

.chart-tooltip-value {
  font-weight: 700;
  margin-left: auto;
}

.chart-legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 1rem 0 0;
  padding: 0;
  font-size: 0.85rem;
}

.chart-legend li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.chart-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Make the footer stay at the bottom on short pages */
html,
body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
}

.container {
    flex: 1;
}

/* Footer */
.site-footer {
    background: #1f2937;
    color: #e5e7eb;
    margin-top: 3rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}

.footer-section h4 {
    margin-bottom: 0.75rem;
    color: #fff;
}

.footer-section p {
    margin: 0.4rem 0;
    line-height: 1.6;
}

.footer-section a {
    color: #93c5fd;
    text-decoration: none;
}

.footer-section a:hover {
    text-decoration: underline;
}

.aircraft-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.aircraft-summary-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem 1.1rem;
  background: white;
  border: 1px solid #eee;
  border-left: 4px solid #ccc;
  border-radius: 8px;
}

.aircraft-summary-card.status-airworthy {
  border-left-color: #1e7e34;
}

.aircraft-summary-card.status-attention {
  border-left-color: #b45309;
}

.aircraft-summary-card.status-grounded {
  border-left-color: #b00020;
}

.aircraft-summary-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.aircraft-summary-reg {
  font-size: 1.15rem;
  font-weight: 700;
}

.aircraft-summary-type {
  margin: 0;
  color: #666;
  font-size: 0.85rem;
}

.aircraft-summary-hours {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.aircraft-summary-hours .stat-value {
  font-size: 1.35rem;
}

.dashboard-welcome {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dashboard-welcome-logo {
  height: 56px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  border-radius: 6px;
}

.dashboard-welcome h1 {
  margin: 0;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.12);
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
    color: #cbd5e1;
}

td.date-cell {
  /* Browsers treat "-" as a line-break opportunity, so a DD-MM-YYYY date
     can wrap mid-string in a narrow table column without this. */
  white-space: nowrap;
}

/* Landing page - overrides the app's narrow form/table container so the
   hero and section bands can run full-width, each with its own centred
   .section-inner wrapper. Scoped to body.landing so every other page's
   layout is untouched. */
body.landing .container {
  max-width: none;
  margin: 0;
  padding: 0;
}

/* The hero already repeats Register/Log in as its own CTAs, so the top
   nav is redundant noise on first arrival - hidden on this page only. */
body.landing .navbar {
  display: none;
}

.section-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.hero {
  background: linear-gradient(135deg, #8e8e8e 0%, #4287ff 100%);
  color: white;
  padding: 4rem 0 3.5rem;
  text-align: center;
}

.hero-logo {
  height: 180px;
  width: auto;
  margin-bottom: 0.5rem;
}

.hero-tagline {
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #cfe0ff;
  margin: 0 0 1.5rem;
  font-weight: 600;
}

.hero-eyebrow {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: 2.5rem;
  line-height: 1.15;
  margin: 0 0 1rem;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.hero-subhead {
  font-size: 1.1rem;
  color: #e5edff;
  max-width: 620px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.btn-hero {
  display: inline-block;
  padding: 0.85rem 1.75rem;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
  font-size: 1rem;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn-hero:hover {
  transform: translateY(-2px);
}

.btn-hero-primary {
  background: white;
  color: #0b3d91;
}

.btn-hero-primary:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.btn-hero-secondary {
  background: transparent;
  color: white;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
}

.btn-hero-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.hero-note {
  font-size: 0.85rem;
  color: #cfe0ff;
  margin: 0;
}

.section {
  padding: 3.5rem 0;
}

.section-alt {
  background: #f4f7fc;
}

.section-title {
  font-size: 1.75rem;
  text-align: center;
  margin: 0 0 1rem;
  color: #0b3d91;
}

.section-lead {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #333;
}

.landing-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.landing-photo {
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  background-color: #e5edff;
  background-image: linear-gradient(135deg, #dce8ff, #f4f7fc);
  background-size: cover;
  background-position: center;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.feature-card {
  background: white;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  padding: 1.5rem;
}

.feature-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #4287ff;
  background: #eaf1ff;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

.feature-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.feature-card p {
  margin: 0;
  color: #555;
  font-size: 0.92rem;
  line-height: 1.55;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.role-card {
  background: white;
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
  border-top: 4px solid #4287ff;
}

.role-card h3 {
  margin: 0 0 0.5rem;
  color: #0b3d91;
}

.role-card p {
  margin: 0;
  color: #555;
  font-size: 0.92rem;
  line-height: 1.55;
}

.cta-banner {
  background: #0b3d91;
  color: white;
  padding: 3rem 0;
  text-align: center;
}

.cta-banner-inner h2 {
  margin: 0 0 1.5rem;
  font-size: 1.6rem;
}

@media (max-width: 720px) {
  .hero h1 {
    font-size: 1.9rem;
  }

  .landing-photos {
    grid-template-columns: 1fr;
  }

  .feature-grid,
  .role-grid {
    grid-template-columns: 1fr;
  }
}