:root {
  color-scheme: light;
  --paper: #f5f3ee;
  --paper-strong: #ffffff;
  --ink: #20272b;
  --ink-muted: #657076;
  --line: #d8d3c9;
  --blue: #285f88;
  --green: #49745a;
  --ochre: #b57933;
  --red: #923d42;
  --shadow: 0 18px 44px rgba(28, 34, 38, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(245, 243, 238, 0.92), rgba(245, 243, 238, 0.96)),
    url("/assets/avaw-ready-room-20260707.png") center / cover fixed;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

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

button {
  cursor: pointer;
}

.login-page {
  min-height: 100vh;
  background: #15191c;
  color: #ffffff;
}

.login-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  overflow: hidden;
  isolation: isolate;
}

.login-hero-media,
.login-hero-media img,
.login-hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.login-hero-media {
  z-index: -2;
}

.login-hero-media img {
  display: block;
  object-fit: cover;
  object-position: center;
}

.login-hero-shade {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(9, 12, 14, 0.94) 0%, rgba(9, 12, 14, 0.82) 30%, rgba(9, 12, 14, 0.4) 54%, rgba(9, 12, 14, 0.08) 78%),
    linear-gradient(0deg, rgba(8, 10, 11, 0.62) 0%, transparent 34%, rgba(8, 10, 11, 0.26) 100%);
}

.login-content {
  width: min(100%, 1600px);
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: clamp(32px, 5vh, 60px) clamp(28px, 6vw, 96px) 30px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  color: #ffffff;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  width: fit-content;
}

.login-roundel {
  width: 70px;
  height: 70px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.46));
}

.login-brand span,
.login-brand strong {
  display: block;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.62);
}

.login-brand span {
  margin-bottom: 3px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.login-brand strong {
  font-size: clamp(15px, 1.3vw, 19px);
  letter-spacing: 0.015em;
}

.login-copy {
  width: min(610px, 46vw);
  align-self: center;
  padding: 32px 0 70px;
}

.login-eyebrow {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.login-copy h1 {
  max-width: 11ch;
  margin: 0;
  font-size: clamp(44px, 5.4vw, 76px);
  font-weight: 760;
  letter-spacing: -0.045em;
  line-height: 0.98;
  text-wrap: balance;
  text-shadow: 0 3px 24px rgba(0, 0, 0, 0.48);
}

.login-intro {
  max-width: 560px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(15px, 1.25vw, 18px);
  line-height: 1.6;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
}

.login-alert,
.login-unavailable {
  max-width: 520px;
  margin: 22px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 191, 191, 0.42);
  border-radius: 6px;
  background: rgba(73, 16, 20, 0.68);
  color: #ffe1e1;
  font-size: 14px;
  backdrop-filter: blur(8px);
}

.login-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.login-discord-button {
  min-height: 52px;
  padding: 0 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: #5865f2;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
  color: #ffffff;
  font-size: 15px;
  font-weight: 750;
  transition: background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.login-discord-button svg {
  width: 22px;
  height: 22px;
}

.login-discord-button:hover {
  background: #6874f5;
  box-shadow: 0 15px 34px rgba(0, 0, 0, 0.38);
  transform: translateY(-1px);
}

.login-discord-button:focus-visible,
.login-footer a:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 4px;
}

.login-access-note {
  max-width: 520px;
  margin: 17px 0 0;
  color: rgba(255, 255, 255, 0.56);
  font-size: 12px;
  line-height: 1.55;
}

.login-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  letter-spacing: 0.035em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.72);
}

.login-footer a {
  color: rgba(255, 255, 255, 0.7);
}

.login-footer a:hover {
  color: #ffffff;
}

@media (max-width: 700px) {
  .login-hero {
    overflow: auto;
  }

  .login-hero-media img {
    object-position: center;
  }

  .login-hero-shade {
    background:
      linear-gradient(180deg, rgba(8, 11, 13, 0.91) 0%, rgba(8, 11, 13, 0.76) 31%, rgba(8, 11, 13, 0.3) 56%, rgba(8, 11, 13, 0.44) 100%),
      linear-gradient(90deg, rgba(8, 10, 12, 0.25), transparent 62%);
  }

  .login-content {
    padding: 24px 21px 18px;
  }

  .login-brand {
    gap: 12px;
  }

  .login-roundel {
    width: 56px;
    height: 56px;
  }

  .login-brand span {
    font-size: 9px;
    letter-spacing: 0.13em;
  }

  .login-brand strong {
    max-width: 225px;
    font-size: 13px;
    line-height: 1.25;
  }

  .login-copy {
    width: 100%;
    align-self: start;
    margin-top: clamp(24px, 4vh, 38px);
    padding: 0 0 30px;
  }

  .login-eyebrow {
    margin-bottom: 13px;
    font-size: 10px;
  }

  .login-copy h1 {
    max-width: 10ch;
    font-size: clamp(36px, 10.5vw, 48px);
    line-height: 1;
  }

  .login-intro {
    max-width: 34ch;
    margin-top: 18px;
    font-size: 14px;
    line-height: 1.5;
  }

  .login-actions {
    margin-top: 23px;
  }

  .login-discord-button {
    width: min(100%, 310px);
    min-height: 50px;
  }

  .login-access-note {
    display: none;
  }

  .login-footer {
    gap: 6px;
    font-size: 10px;
  }
}

@media (min-width: 701px) and (max-height: 720px) {
  .login-content {
    padding-top: 26px;
    padding-bottom: 15px;
  }

  .login-roundel {
    width: 58px;
    height: 58px;
  }

  .login-copy {
    padding-bottom: 20px;
  }

  .login-copy h1 {
    font-size: clamp(40px, 5vw, 62px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-discord-button {
    transition: none;
  }
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.roundel {
  width: 52px;
  height: 52px;
  display: block;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.2));
}

.brand-text strong,
.brand-text span {
  display: block;
}

.brand-text strong {
  font-size: 18px;
}

.brand-text span {
  color: var(--ink-muted);
  font-size: 13px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  transition: grid-template-columns 0.18s ease;
  background:
    linear-gradient(90deg, rgba(245, 243, 238, 0.88), rgba(245, 243, 238, 0.96)),
    url("/assets/avaw-ready-room-20260707.png") center / cover fixed;
}

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

.sidebar {
  height: 100vh;
  max-height: 100vh;
  min-height: 0;
  padding: 24px 18px;
  background:
    linear-gradient(180deg, rgba(34, 41, 45, 0.94), rgba(34, 41, 45, 0.9)),
    url("/assets/avaw-ready-room-20260707.png") 22% center / cover;
  color: #f7f1e4;
  position: sticky;
  top: 0;
  align-self: start;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
}

.sidebar-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 10px;
  align-items: center;
}

.sidebar .brand-text span {
  color: rgba(247, 241, 228, 0.68);
}

.sidebar-toggle {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  color: rgba(247, 241, 228, 0.82);
  background: rgba(255, 255, 255, 0.06);
  font-weight: 800;
}

.sidebar-toggle:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-list {
  display: grid;
  gap: 8px;
  margin: 34px 0 0;
}

.nav-link {
  width: 100%;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 0;
  border-radius: 7px;
  color: rgba(247, 241, 228, 0.8);
  background: transparent;
  text-align: left;
}

.nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

.nav-glyph {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 12px;
  font-weight: 700;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 28px;
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
  color: rgba(247, 241, 228, 0.64);
}

.sidebar-version {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: none;
}

.ftl-attribution {
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
  color: rgba(247, 241, 228, 0.72);
  font-size: 11px;
  line-height: 1.35;
}

.ftl-attribution:hover {
  color: #ffffff;
}

.ftl-infinity-logo {
  width: 54px;
  height: auto;
}

.sidebar-collapsed .sidebar-footer {
  justify-items: center;
}

.sidebar-collapsed .sidebar-version,
.sidebar-collapsed .sidebar-footer-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.sidebar-collapsed .ftl-infinity-logo {
  width: 42px;
}

.sidebar-collapsed .sidebar {
  padding-left: 12px;
  padding-right: 12px;
}

.sidebar-collapsed .sidebar-top {
  grid-template-columns: 1fr;
  justify-items: center;
}

.sidebar-collapsed .brand-lockup {
  justify-content: center;
}

.sidebar-collapsed .roundel {
  width: 42px;
  height: 42px;
}

.sidebar-collapsed .brand-text,
.sidebar-collapsed .nav-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.sidebar-collapsed .nav-list {
  margin-top: 24px;
}

.sidebar-collapsed .nav-link {
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 0;
  padding: 11px 8px;
}

.sidebar-collapsed .nav-glyph {
  width: 34px;
  height: 34px;
}

.content {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 28px;
  background: rgba(245, 243, 238, 0.92);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.topbar p {
  margin: 2px 0 0;
  color: var(--ink-muted);
  font-size: 13px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.main {
  padding: 28px;
  display: grid;
  gap: 22px;
  align-content: start;
}

.masthead {
  min-height: 236px;
  display: grid;
  align-items: end;
  padding: 26px;
  background:
    linear-gradient(180deg, rgba(32, 39, 43, 0.12), rgba(32, 39, 43, 0.82)),
    url("/assets/avaw-ready-room-20260707.png") center / cover;
  color: #fff;
  border-radius: 8px;
  overflow: hidden;
}

.masthead h2 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.05;
  letter-spacing: 0;
}

.masthead p {
  max-width: 680px;
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.8);
}

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

.stat-card,
.panel {
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(28, 34, 38, 0.06);
  min-width: 0;
}

.stat-card {
  min-height: 110px;
  padding: 18px;
  display: grid;
  align-content: space-between;
}

.stat-label {
  color: var(--ink-muted);
  font-size: 13px;
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 0;
}

.panel {
  padding: 20px;
}

.panel-header,
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.panel-header h2,
.panel-header h3 {
  margin: 0;
}

.panel-header p {
  margin: 3px 0 0;
  color: var(--ink-muted);
  font-size: 13px;
}

.button,
.ghost-button,
.danger-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 7px;
  padding: 0 14px;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.button {
  color: #ffffff;
  background: var(--blue);
}

.button:hover {
  background: #1f4f73;
}

.ghost-button {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.ghost-button:hover {
  border-color: #b9b1a2;
}

.danger-button {
  color: #ffffff;
  background: var(--red);
}

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

.field {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 13px;
  color: var(--ink-muted);
}

.field > span {
  font-size: 13px;
  color: var(--ink-muted);
}

.field input,
.field select,
.field textarea,
.search-input,
.inline-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.inline-input {
  min-width: 180px;
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
}

/* Viewport-level tables can use native sticky headers without an overflow ancestor. */
@media (min-width: 1001px) {
  .main .table-wrap {
    overflow: visible;
  }

  .main .table-wrap table {
    min-width: 100%;
  }

  .main .hash-modal .table-wrap,
  .main .dossier-record-table {
    overflow-x: auto;
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1040px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.roster-summary-table {
  min-width: 900px;
  table-layout: fixed;
  font-size: 14px;
}

.roster-summary-table th,
.roster-summary-table td {
  padding-inline: 7px;
}

.roster-summary-table th:nth-child(1) { width: 16%; }
.roster-summary-table th:nth-child(2) { width: 9%; }
.roster-summary-table th:nth-child(3) { width: 9%; }
.roster-summary-table th:nth-child(4) { width: 19%; }
.roster-summary-table th:nth-child(5) { width: 8%; }
.roster-summary-table th:nth-child(6) { width: 11%; }
.roster-summary-table th:nth-child(7) { width: 20%; }
.roster-summary-table th:nth-child(8) { width: 8%; }

.roster-discord-id {
  overflow-wrap: anywhere;
}

th {
  color: var(--ink-muted);
  font-size: 12px;
  text-transform: uppercase;
}

/* Table headers remain with their own table and naturally yield at the next section. */
.table-wrap thead th,
.dossier-record-table thead th {
  position: sticky;
  top: var(--sticky-table-offset, 72px);
  z-index: 6;
  background: var(--paper-strong);
  box-shadow: 0 1px 0 var(--line), 0 4px 8px rgba(34, 45, 40, 0.06);
}

.hash-modal .table-wrap thead th,
.hash-modal .dossier-record-table thead th {
  top: 0;
}

.roster-summary-table .access-column {
  text-align: right;
}

.roster-summary-table .access-column .row-actions {
  justify-content: flex-end;
}

.secondary-line {
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 12px;
}

.status-pill,
.confidence-pill,
.role-pill,
.lead-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-active,
.confidence-high,
.confidence-manual,
.lead-pill,
.role-pilot {
  background: rgba(73, 116, 90, 0.14);
  color: #315d43;
}

.status-pending {
  background: rgba(181, 121, 51, 0.18);
  color: #80541f;
}

.status-reserve,
.confidence-medium,
.role-crew {
  background: rgba(181, 121, 51, 0.16);
  color: #80541f;
}

.role-controller {
  background: rgba(40, 95, 136, 0.14);
  color: #204d70;
}

.status-leave,
.status-training {
  background: rgba(40, 95, 136, 0.14);
  color: #204d70;
}

.role-member {
  background: rgba(63, 57, 49, 0.1);
  color: #50483e;
}

.status-retired,
.confidence-low {
  background: rgba(146, 61, 66, 0.13);
  color: #7f3035;
}

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 190px;
  padding: 28px;
  border: 2px dashed #b9b1a2;
  border-radius: 8px;
  background: #fbfaf7;
  text-align: center;
}

.import-drop-zone {
  position: relative;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 24px;
  overflow: hidden;
  text-align: left;
  cursor: pointer;
}

.import-drop-zone::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0 44%, rgba(73,116,90,.08) 50%, transparent 56%);
  transform: translateX(-120%);
  pointer-events: none;
}

.drop-zone.dragging,
.drop-zone.armed {
  border-color: var(--green);
  background: rgba(73, 116, 90, 0.08);
}

.import-drop-zone.dragging::before,
.import-drop-zone.armed::before,
.import-drop-zone.processing::before {
  animation: runway-scan 1.8s linear infinite;
}

.drop-zone input {
  margin-top: 14px;
}

.radar-scope {
  position: relative;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  border: 1px solid rgba(73,116,90,.42);
  background:
    radial-gradient(circle at center, rgba(73,116,90,.18) 0 2px, transparent 3px),
    repeating-radial-gradient(circle at center, transparent 0 22px, rgba(73,116,90,.18) 23px 24px),
    linear-gradient(rgba(73,116,90,.18), rgba(73,116,90,.18)) 50% 0/1px 100% no-repeat,
    linear-gradient(90deg, rgba(73,116,90,.18), rgba(73,116,90,.18)) 0 50%/100% 1px no-repeat,
    #f4f1e8;
  box-shadow: inset 0 0 18px rgba(49,93,67,.18), 0 10px 28px rgba(37,32,26,.12);
}

.radar-sweep {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: conic-gradient(from -20deg, transparent 0deg, rgba(73,116,90,.03) 20deg, rgba(73,116,90,.22) 46deg, rgba(73,116,90,.62) 52deg, transparent 53deg);
  animation: radar-sweep 2.2s linear infinite;
}

.flight-track {
  position: absolute;
  left: 28px;
  right: 22px;
  top: 70px;
  border-top: 1px dashed rgba(40,95,136,.55);
  transform: rotate(-24deg);
}

.flight-blip {
  position: absolute;
  width: 12px;
  height: 12px;
  right: 30px;
  top: 44px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(40,95,136,.15), 0 0 18px rgba(40,95,136,.45);
}

.import-drop-zone.armed .flight-blip,
.import-drop-zone.processing .flight-blip {
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(73,116,90,.16), 0 0 20px rgba(73,116,90,.55);
}

.import-drop-copy {
  position: relative;
  z-index: 1;
}

.import-next-note {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(73,116,90,.24);
  border-radius: 8px;
  background: rgba(73,116,90,.08);
  color: #315d43;
}

.import-next-note[hidden] {
  display: none;
}

.import-next-note span {
  color: var(--ink-muted);
  font-size: 13px;
}

button:disabled {
  opacity: .58;
  cursor: not-allowed;
}

@keyframes radar-sweep {
  to { transform: rotate(360deg); }
}

@keyframes runway-scan {
  to { transform: translateX(120%); }
}

.file-picker-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-action {
  background: #f3f0e8;
}

.attendance-workbench {
  display: grid;
  gap: 18px;
  align-items: start;
}

.attendance-side {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 18px;
  min-width: 0;
}

.attendance-sheet-panel {
  min-width: 0;
}

.import-launch-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.import-launch-panel h2 {
  margin: 0;
}

.import-launch-panel p {
  max-width: 740px;
  margin: 3px 0 0;
  color: var(--ink-muted);
  font-size: 13px;
}

.import-launch-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.workflow-steps {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.workflow-step {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.workflow-step.active {
  border-color: rgba(73, 116, 90, 0.42);
  background: rgba(73, 116, 90, 0.08);
}

.workflow-number {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  font-weight: 800;
}

.workflow-step strong,
.workflow-step span {
  display: block;
}

.workflow-step span {
  color: var(--ink-muted);
  font-size: 13px;
}

.import-review-form {
  display: grid;
  gap: 16px;
}

.manual-controller-panel {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(40, 95, 136, 0.24);
  border-radius: 8px;
  background: #f7fafb;
}

.manual-controller-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.manual-controller-heading h3 {
  margin: 0;
  font-size: 16px;
}

.manual-controller-heading p {
  margin: 3px 0 0;
  color: var(--ink-muted);
  font-size: 13px;
}

.switch-control {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.switch-control input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.switch-track {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #c8c1b4;
  transition: background 0.15s ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(22, 25, 28, 0.18);
  transition: transform 0.15s ease;
}

.switch-control input:checked + .switch-track {
  background: #285f88;
}

.switch-control input:checked + .switch-track::after {
  transform: translateX(18px);
}

.manual-controller-body {
  display: grid;
  gap: 12px;
}

.manual-controller-body[hidden],
.manual-controller-row[hidden] {
  display: none !important;
}

.controller-count-field {
  max-width: 220px;
}

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

.manual-controller-grid [hidden] {
  display: none !important;
}

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

.review-summary .stat-card {
  min-height: 82px;
  padding: 12px;
}

.review-summary .stat-value {
  font-size: 24px;
}

.pilot-review-list {
  display: grid;
  gap: 12px;
  max-height: min(58vh, 720px);
  overflow: auto;
  padding-right: 4px;
}

.pilot-review-row {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.review-row-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.review-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.review-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 0.92fr) minmax(0, 1.18fr);
  gap: 10px;
}

.flight-lead-control {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid rgba(73, 116, 90, 0.24);
  border-radius: 7px;
  background: rgba(73, 116, 90, 0.07);
}

.flight-lead-control input {
  margin-top: 3px;
}

.flight-lead-control strong,
.flight-lead-control small {
  display: block;
}

.flight-lead-control small {
  color: var(--ink-muted);
}

.validation-panel {
  border-color: rgba(40, 95, 136, 0.28);
}

.validation-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.member-open-button {
  max-width: 220px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  text-align: left;
}

.member-open-button:hover {
  text-decoration: underline;
}

.member-open-button.secondary {
  color: var(--ink);
}

.tag-list {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.airframe-tag {
  min-height: 26px;
  max-width: 150px;
  padding: 0 9px;
  border: 1px solid rgba(40, 95, 136, 0.2);
  border-radius: 999px;
  background: rgba(40, 95, 136, 0.08);
  color: #204d70;
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.airframe-tag:hover {
  background: rgba(40, 95, 136, 0.14);
}

.validation-table {
  min-width: 980px;
}

.identity-audit {
  margin-bottom: 18px;
}

.identity-table {
  min-width: 820px;
}

.mission-list {
  display: grid;
  max-height: min(70vh, 760px);
  overflow: auto;
}

.mission-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.mission-row:last-child {
  border-bottom: 0;
}

.mission-row:hover,
.mission-row.active {
  background: #f6f2ea;
}

.mission-row.active {
  box-shadow: inset 3px 0 0 var(--blue);
}

.mission-row strong {
  display: block;
}

.muted {
  color: var(--ink-muted);
}

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

.dashboard-wide {
  grid-column: 1 / -1;
}

.trend-list,
.leaderboard-list {
  display: grid;
  gap: 10px;
}

.trend-row,
.leaderboard-row {
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(245, 243, 238, 0.58);
}

.trend-row {
  grid-template-columns: minmax(190px, 1.3fr) minmax(160px, 2fr) repeat(3, minmax(72px, auto));
}

.leaderboard-row {
  grid-template-columns: 34px minmax(0, 1fr) auto;
}

.warning-row {
  border-color: rgba(146, 61, 66, 0.28);
  background: rgba(146, 61, 66, 0.05);
}

.rank-number {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(40, 95, 136, 0.1);
  color: var(--blue);
  font-weight: 800;
  font-size: 12px;
}

.trend-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(40, 95, 136, 0.12);
  overflow: hidden;
}

.trend-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green));
}

.trend-stat {
  text-align: right;
}

.trend-stat > strong,
.trend-stat > span {
  display: block;
}

.trend-stat > span {
  color: var(--ink-muted);
  font-size: 12px;
}

.mission-duration-stat {
  min-width: 116px;
}

.duration-parts {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 8px;
}

.duration-part {
  display: inline-flex !important;
  align-items: baseline;
  gap: 3px;
  line-height: inherit;
}

.duration-part strong {
  color: var(--ink);
  font-size: 16px;
  line-height: inherit;
}

.duration-part > span {
  color: var(--ink-muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1;
  text-transform: uppercase;
}

.attendance-chart {
  width: 100%;
  min-height: 260px;
  padding: 8px 4px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(40, 95, 136, 0.04), rgba(255, 255, 255, 0.72));
}

.attendance-chart svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 240px;
  overflow: visible;
}

.chart-gridline {
  stroke: rgba(42, 54, 62, 0.14);
  stroke-width: 1;
}

.chart-axis-label,
.chart-point-date {
  fill: var(--ink-muted);
  font-size: 12px;
}

.chart-point-date {
  font-weight: 700;
}

.attendance-line {
  fill: none;
  stroke: var(--blue);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.attendance-point {
  fill: var(--paper-strong);
  stroke: var(--blue);
  stroke-width: 4;
}

.operational-trend-row {
  grid-template-columns: minmax(210px, 1.6fr) repeat(5, minmax(72px, auto));
}

.trend-mission {
  min-width: 0;
}

.leaderboard-value {
  text-align: right;
}

.leaderboard-value strong,
.leaderboard-value span {
  display: block;
}

.leaderboard-value span {
  color: var(--ink-muted);
  font-size: 11px;
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.empty-state {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--ink-muted);
  background: #fbfaf7;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(22, 28, 31, 0.52);
}

.modal {
  width: min(760px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.modal h2 {
  margin: 0 0 16px;
}

.modal-titlebar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.modal-titlebar h2 {
  margin: 0;
}

.modal-titlebar p {
  margin: 4px 0 0;
  color: var(--ink-muted);
  font-size: 13px;
}

.compact-button {
  min-height: 34px;
  padding: 0 11px;
}

.import-modal {
  width: min(1180px, calc(100vw - 36px));
  height: min(880px, calc(100vh - 36px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 0;
  overflow: hidden;
}

.import-modal-body {
  min-height: 0;
  overflow: auto;
  padding: 20px 22px 22px;
}

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

.import-modal .pilot-review-list {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.import-modal .validation-actions {
  position: sticky;
  bottom: -22px;
  padding: 14px 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #ffffff 35%);
}

.dossier-modal {
  width: min(1180px, calc(100vw - 36px));
  height: min(900px, calc(100vh - 36px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 0;
  overflow: hidden;
  background: #f7f4ec;
}

.dossier-file-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  border-bottom: 3px double #8f8778;
  background: #fffdf8;
}

.personnel-file {
  position: relative;
  isolation: isolate;
  border-radius: 10px 10px 7px 7px;
  background: #c9ad76;
  box-shadow:
    0 34px 90px rgba(20, 16, 10, 0.42),
    inset 0 0 0 1px rgba(93, 69, 35, 0.3);
}

.file-folder-tab {
  position: absolute;
  top: 0;
  left: 34px;
  z-index: 3;
  transform: translateY(-72%);
  min-width: 260px;
  padding: 10px 18px 13px;
  border: 1px solid #9d7c44;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: linear-gradient(180deg, #d9bf86, #c8a664);
  box-shadow: 0 -8px 22px rgba(28, 20, 10, 0.16);
}

.file-folder-tab span,
.file-folder-tab strong {
  display: block;
  color: #3d2f1b;
}

.file-folder-tab span {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.file-folder-tab strong {
  margin-top: 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
}

.personnel-file::before {
  content: "";
  position: absolute;
  inset: 64px 12px 10px;
  z-index: -1;
  border-radius: 8px;
  background: rgba(80, 56, 25, 0.18);
  transform: rotate(-0.4deg);
}

.personnel-file .dossier-file-header {
  margin: 14px 14px 0;
  border: 1px solid #9f8d70;
  border-bottom: 3px double #6d604b;
  border-radius: 8px 8px 0 0;
  background:
    linear-gradient(90deg, rgba(146, 61, 66, 0.08), transparent 34%),
    repeating-linear-gradient(0deg, rgba(37, 31, 22, 0.035) 0 1px, transparent 1px 5px),
    #f8f1df;
}

.dossier-agency em {
  display: block;
  margin-top: 4px;
  color: #7b6d58;
  font-size: 12px;
  font-style: normal;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.personnel-file .dossier-body {
  margin: 0 14px 14px;
  border: 1px solid #9f8d70;
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background:
    radial-gradient(circle at 12% 8%, rgba(146, 61, 66, 0.07), transparent 22%),
    linear-gradient(90deg, rgba(111, 78, 38, 0.08) 0 38px, transparent 38px),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(45, 38, 28, 0.045) 31px 32px),
    #f3ead8;
}

.personnel-page,
.file-page {
  position: relative;
  border-radius: 2px;
  background:
    linear-gradient(90deg, rgba(146, 61, 66, 0.08) 0 34px, transparent 34px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0)),
    #fff9ea;
  box-shadow:
    0 12px 24px rgba(55, 39, 18, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.personnel-page {
  grid-template-columns: 190px minmax(0, 1fr);
  padding-left: 52px;
}

.file-page {
  padding-left: 52px;
}

.dossier-paperclip {
  position: absolute;
  top: -12px;
  left: 82px;
  width: 52px;
  height: 92px;
  border: 5px solid rgba(87, 82, 73, 0.46);
  border-bottom-color: transparent;
  border-radius: 26px 26px 18px 18px;
  transform: rotate(-9deg);
  pointer-events: none;
}

.personnel-photo-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 14px 12px 12px;
  border: 1px solid #b8a98f;
  background: #ece4d4;
  box-shadow: 0 5px 14px rgba(45, 34, 18, 0.12);
  transform: rotate(-0.5deg);
}

.photo-label,
.photo-caption,
.file-eyebrow,
.section-tab {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.photo-label {
  color: #6d604b;
  font-size: 10px;
}

.photo-caption {
  color: #923d42;
  font-size: 11px;
}

.personnel-photo-card .dossier-avatar {
  width: 124px;
  height: 124px;
  aspect-ratio: 1 / 1;
  border: 1px solid #847965;
  border-radius: 2px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.12), transparent),
    #d7d0c2;
  font-size: 52px;
  overflow: hidden;
}

.personnel-photo-card .dossier-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #d7d0c2;
}

.file-eyebrow {
  display: inline-block;
  margin-bottom: 6px;
  color: #923d42;
  font-size: 11px;
}

.classification-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.classification-strip span {
  padding: 5px 8px;
  border: 1px solid #b8a98f;
  background: rgba(255, 255, 255, 0.44);
  color: #5e523f;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.personnel-file .dossier-stamp {
  top: 22px;
  right: 26px;
  padding: 7px 12px;
  border-width: 3px;
  opacity: 0.78;
  transform: rotate(4deg);
}

.section-tab {
  position: absolute;
  top: -13px;
  left: 64px;
  padding: 5px 10px;
  border: 1px solid #b8a98f;
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
  background: #e4d8be;
  color: #5e523f;
  font-size: 10px;
}

.personnel-file .dossier-facts,
.personnel-file .dossier-notes,
.personnel-file .dossier-mission-history {
  grid-column: 1 / -1;
  min-width: 0;
  width: 100%;
}

.personnel-file .dossier-mission-history h3 {
  margin: 0 0 14px;
}

.personnel-file .dossier-facts,
.personnel-file .dossier-stat,
.personnel-file .attendance-chart,
.personnel-file .dossier-record-table,
.personnel-file .dossier-notes {
  border-color: #b8a98f;
  background: rgba(255, 253, 248, 0.72);
}

.dossier-agency {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dossier-roundel {
  width: 58px;
  height: 58px;
  display: block;
  border-radius: 50%;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.24));
}

.dossier-agency span,
.dossier-agency strong,
.dossier-file-meta span,
.dossier-file-meta strong {
  display: block;
}

.dossier-agency span,
.dossier-file-meta span {
  color: #6c6254;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dossier-agency strong {
  margin-top: 2px;
  color: #20272b;
  font-size: 24px;
  line-height: 1.05;
  text-transform: uppercase;
}

.dossier-file-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  text-align: right;
}

.dossier-file-meta strong {
  color: #923d42;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 15px;
  letter-spacing: 0.04em;
}

.dossier-body {
  min-height: 0;
  overflow: auto;
  padding: 22px;
  display: grid;
  gap: 18px;
  background:
    linear-gradient(90deg, rgba(32, 39, 43, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(32, 39, 43, 0.03) 1px, transparent 1px),
    #f7f4ec;
  background-size: 26px 26px;
}

.dossier-cover,
.dossier-section {
  border: 1px solid #c7bda9;
  border-radius: 6px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 10px 24px rgba(28, 34, 38, 0.08);
}

.dossier-cover {
  position: relative;
  display: grid;
  grid-template-columns: minmax(230px, 0.44fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 22px;
}

.dossier-section {
  padding: 18px;
}

.dossier-stamp {
  position: absolute;
  top: 16px;
  right: 20px;
  padding: 5px 9px;
  border: 2px solid rgba(146, 61, 66, 0.72);
  border-radius: 4px;
  color: #923d42;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: rotate(1deg);
}

.dossier-member-heading {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.dossier-member-heading h2 {
  margin: 0;
  font-size: 32px;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
}

.dossier-member-heading p {
  margin: 8px 0 0;
  color: var(--ink-muted);
  font-size: 13px;
}

.dossier-avatar {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border: 2px solid #8f8778;
  border-radius: 6px;
  background: #f3f0e8;
  color: #20272b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 28px;
  font-weight: 800;
}

.dossier-facts {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid #c7bda9;
  border-radius: 6px;
  overflow: hidden;
}

.dossier-facts div {
  min-height: 76px;
  padding: 12px;
  border-right: 1px solid #d7cdbb;
  border-bottom: 1px solid #d7cdbb;
  background: #fffdf8;
}

.dossier-facts div:nth-child(5n) {
  border-right: 0;
}

.dossier-facts div:nth-last-child(-n + 5) {
  border-bottom: 0;
}

.dossier-facts dt {
  color: #6c6254;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dossier-facts dd {
  margin: 7px 0 0;
  font-weight: 800;
}

.dossier-facts .tag-list {
  gap: 4px;
}

.dossier-notes {
  grid-column: 1 / -1;
  padding: 12px 14px;
  border: 1px solid #d7cdbb;
  border-radius: 6px;
  background: #fffdf8;
}

.dossier-notes strong {
  display: block;
  color: #6c6254;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dossier-notes p {
  margin: 6px 0 0;
}

.dossier-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.dossier-section-heading h3,
.dossier-section-heading p {
  margin: 0;
}

.dossier-section-heading h3 {
  color: #20272b;
  font-size: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dossier-section-heading p {
  color: var(--ink-muted);
  font-size: 13px;
}

.admin-tabs {
  display: flex;
  align-items: flex-end;
  gap: clamp(20px, 3vw, 34px);
  margin: 0 0 24px;
  padding: 0 2px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}

.admin-tab-link {
  position: relative;
  flex: 0 0 auto;
  padding: 9px 0 13px;
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.admin-tab-link:hover {
  color: var(--ink);
}

.admin-tab-link.active {
  color: var(--blue);
}

.admin-tab-link.active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: currentColor;
}

.admin-tab-link:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
  border-radius: 2px;
}

.range-control {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.range-button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #c7bda9;
  border-radius: 5px;
  background: #fffdf8;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.range-button:hover,
.range-button.active {
  border-color: rgba(40, 95, 136, 0.36);
  background: rgba(40, 95, 136, 0.1);
  color: #204d70;
}

.sortie-filter-list {
  justify-content: flex-start;
  margin: 2px 0 12px;
}

.sortie-filter-button {
  border-width: 2px;
  opacity: 0.55;
  transition: opacity 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.sortie-filter-button.active {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(36, 32, 26, 0.12);
}

.sortie-pastel-purple {
  --sortie-pastel-bg: #eadcf8;
  --sortie-pastel-border: #c9a8ef;
  --sortie-pastel-ink: #4d3370;
}

.sortie-pastel-peach {
  --sortie-pastel-bg: #ffe2cf;
  --sortie-pastel-border: #f3b085;
  --sortie-pastel-ink: #764323;
}

.sortie-pastel-green {
  --sortie-pastel-bg: #dff3df;
  --sortie-pastel-border: #9dd39b;
  --sortie-pastel-ink: #2f6330;
}

.sortie-pastel-blue {
  --sortie-pastel-bg: #dceeff;
  --sortie-pastel-border: #9fc9ef;
  --sortie-pastel-ink: #2d567c;
}

.sortie-filter-button.sortie-pastel-purple,
.sortie-filter-button.sortie-pastel-peach,
.sortie-filter-button.sortie-pastel-green,
.sortie-filter-button.sortie-pastel-blue {
  border-color: var(--sortie-pastel-border);
  background: var(--sortie-pastel-bg);
  color: var(--sortie-pastel-ink);
}

.sortie-record-row.sortie-pastel-purple td,
.sortie-record-row.sortie-pastel-peach td,
.sortie-record-row.sortie-pastel-green td,
.sortie-record-row.sortie-pastel-blue td {
  background: color-mix(in srgb, var(--sortie-pastel-bg) 68%, #fffdf8);
  color: #2c3035;
}

.sortie-record-row:hover td {
  background: var(--sortie-pastel-bg);
}

.dossier-stat-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.overall-stat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 14px;
  align-items: stretch;
}

.primary-stat-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 0;
}

.airframe-hours-panel {
  padding: 13px;
  border: 1px solid #c7bda9;
  border-radius: 6px;
  background: #fffdf8;
}

.airframe-hours-panel h4 {
  margin: 0 0 10px;
  color: #6c6254;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

.airframe-hours-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(77, 65, 46, 0.06);
  color: #2c3035;
  font-size: 13px;
}

.airframe-hours-row strong {
  white-space: nowrap;
}

.dossier-stat {
  min-height: 76px;
  padding: 13px;
  border: 1px solid #c7bda9;
  border-radius: 6px;
  background: #fffdf8;
}

.dossier-stat span,
.dossier-stat strong {
  display: block;
}

.dossier-stat span {
  color: #6c6254;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dossier-stat strong {
  margin-top: 4px;
  font-size: 24px;
}

.attendance-chart {
  border: 1px solid #c7bda9;
  border-radius: 6px;
  background: #fffdf8;
  overflow: hidden;
}

.attendance-chart svg {
  width: 100%;
  min-height: 220px;
  display: block;
}

.attendance-chart rect {
  fill: var(--green);
}

.attendance-chart line {
  stroke: #b9b1a2;
  stroke-width: 1;
}

.attendance-chart text {
  fill: var(--ink-muted);
  font-size: 12px;
}

.dossier-record-table {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  border: 1px solid #c7bda9;
  border-radius: 6px;
}

.dossier-record-table table {
  width: 100%;
  min-width: 1120px;
  border: 0;
}

.dossier-record-table th {
  background: #e9e2d5;
  color: #423b31;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dossier-record-table td,
.dossier-record-table th {
  border-bottom-color: #d7cdbb;
}

.personnel-file .file-page-missions .dossier-section-heading {
  margin-bottom: 10px;
}

.personnel-file .file-page-missions .dossier-record-table table {
  min-width: 900px;
}

.personnel-file .file-page-missions .dossier-record-table th {
  font-size: 9px;
  letter-spacing: 0.03em;
  padding: 7px 8px;
}

.personnel-file .file-page-missions .dossier-record-table td {
  font-size: 12px;
  line-height: 1.25;
  padding: 7px 8px;
}

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

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  max-width: 420px;
  padding: 14px 16px;
  border-radius: 8px;
  color: #ffffff;
  background: #22292d;
  box-shadow: var(--shadow);
}

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

.hidden {
  display: none !important;
}

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

  .sidebar {
    height: auto;
    max-height: none;
    min-height: auto;
    position: static;
    overflow: visible;
  }

  .sidebar-footer {
    margin-top: 28px;
    padding-top: 0;
  }

  .sidebar-collapsed .sidebar-footer {
    justify-items: center;
  }

  .sidebar-collapsed .ftl-infinity-logo {
    width: 54px;
  }

  .sidebar-collapsed .sidebar {
    padding-left: 18px;
    padding-right: 18px;
  }

  .sidebar-collapsed .sidebar-top {
    grid-template-columns: minmax(0, 1fr) 34px;
    justify-items: stretch;
  }

  .sidebar-collapsed .brand-lockup {
    justify-content: flex-start;
  }

  .sidebar-collapsed .roundel {
    width: 52px;
    height: 52px;
  }

  .sidebar-collapsed .brand-text,
  .sidebar-collapsed .nav-label,
  .sidebar-collapsed .sidebar-version,
  .sidebar-collapsed .sidebar-footer-text {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 22px;
  }

  .sidebar-collapsed .nav-list {
    margin-top: 22px;
  }

  .sidebar-collapsed .nav-link {
    grid-template-columns: 26px minmax(0, 1fr);
    justify-items: stretch;
    gap: 10px;
    padding: 11px 12px;
  }

  .sidebar-collapsed .nav-glyph {
    width: 26px;
    height: 26px;
  }

  .stats-grid,
  .split-grid,
  .dashboard-grid,
  .attendance-workbench,
  .attendance-side,
  .dossier-cover,
  .dossier-facts,
  .overall-stat-layout,
  .dossier-stat-grid {
    grid-template-columns: 1fr;
  }

  .dossier-facts div,
  .trend-row {
    grid-template-columns: 1fr;
  }

  .trend-stat {
    text-align: left;
  }

  .duration-parts {
    justify-content: flex-start;
  }

  .dossier-facts div:nth-child(5n) {
    border-right: 0;
    border-bottom: 1px solid #d7cdbb;
  }

  .dossier-facts div:last-child {
    border-bottom: 0;
  }

  .range-control {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .main,
  .topbar,
  .sidebar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats-grid,
  .field-grid,
  .nav-list,
  .review-summary,
  .review-grid,
  .manual-controller-grid,
  .import-drop-zone {
    grid-template-columns: 1fr;
  }

  .import-launch-panel,
  .modal-titlebar,
  .dossier-file-header,
  .dossier-file-meta {
    align-items: stretch;
    flex-direction: column;
  }

  .dossier-file-meta {
    text-align: left;
  }

  .dossier-agency strong {
    font-size: 20px;
  }

  .import-modal {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
  }

  .dossier-modal {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
  }

  .import-modal .review-summary {
    grid-template-columns: 1fr;
  }

  .manual-controller-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* Laravel parity helpers */
.sr-only{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.nav-link{ text-decoration:none; }
.nav-link.active{ background: rgba(255,255,255,.09); color:#fff; }
.inline-form{ display:inline; }
.modal-actions{ display:flex; justify-content:flex-end; gap:10px; flex-wrap:wrap; margin-top:18px; }
.access-columns{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.alert{ border:1px solid rgba(146,61,66,.24); background:rgba(146,61,66,.08); color:#7f3035; padding:12px; border-radius:8px; margin-bottom:16px; }
.status-read{ background:rgba(40,95,136,.14); color:#204d70; }
.status-write{ background:rgba(73,116,90,.14); color:#315d43; }
@media (max-width: 820px){ .access-columns{ grid-template-columns:1fr; } }

/* Hash-targeted modals for server-rendered Laravel roster parity */
.hash-modal { display: none; }
.hash-modal:target { display: grid; }
.hash-modal .modal { max-height: min(92vh, 980px); overflow: auto; }
.hash-modal .modal-titlebar { position: sticky; top: 0; z-index: 2; background: var(--paper-strong); }

.player-action-preview {
  width: min(860px, 100%);
  padding: 0;
}

.player-action-timeline {
  list-style: none;
  margin: 0;
  padding: 12px 24px 24px;
}

.player-action-entry {
  position: relative;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 16px;
  padding: 13px 0 13px 24px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  line-height: 1.5;
}

.player-action-entry::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 19px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-muted);
  box-shadow: 0 0 0 4px var(--paper-strong);
}

.player-action-entry::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 27px;
  bottom: -14px;
  width: 2px;
  background: var(--line);
}

.player-action-entry:last-child {
  border-bottom: 0;
}

.player-action-entry:last-child::after {
  display: none;
}

.player-action-entry time {
  color: var(--ink-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.player-action-combat::before { background: var(--red); }
.player-action-flight::before { background: var(--blue); }

@media (max-width: 620px) {
  .player-action-timeline { padding-inline: 18px; }
  .player-action-entry { grid-template-columns: 1fr; gap: 3px; }
}

/* Discord role RBAC and operational mission history */
.rbac-role-palette { display:flex; flex-wrap:wrap; gap:10px; }
.rbac-role-card, .rbac-assigned-role { display:inline-flex; align-items:center; gap:8px; border:1px solid var(--line); border-radius:999px; background:var(--paper-strong); padding:8px 12px; }
.rbac-role-card[draggable="true"] { cursor:grab; box-shadow:0 2px 7px rgba(34,45,40,.08); }
.rbac-role-card[draggable="true"]:active { cursor:grabbing; }
.rbac-role-colour { width:10px; height:10px; border-radius:50%; background:var(--role-colour, var(--ink-muted)); box-shadow:0 0 0 2px rgba(0,0,0,.06); }
.rbac-permission-group { margin-top:18px; }
.rbac-permission-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.rbac-permission-lane { display:grid; gap:12px; min-height:190px; padding:16px; border:1px dashed rgba(73,116,90,.45); border-radius:10px; background:rgba(73,116,90,.035); transition:border-color .15s,background .15s,transform .15s; }
.rbac-permission-lane.is-dragover { border-color:var(--green); background:rgba(73,116,90,.12); transform:translateY(-2px); }
.rbac-permission-lane h3 { margin:0 0 5px; }
.rbac-permission-lane p { margin:0 0 6px; color:var(--ink-muted); }
.rbac-assigned-roles { display:flex; flex-wrap:wrap; align-content:flex-start; gap:7px; min-height:42px; }
.rbac-assigned-role { padding:6px 9px 6px 12px; background:#fff; }
.rbac-remove-role { border:0; background:transparent; color:var(--red); font-size:18px; line-height:1; cursor:pointer; }
.rbac-picker { display:flex; gap:8px; align-items:center; margin-top:auto; }
.rbac-picker select { min-width:0; flex:1; }
.rbac-save-bar { display:flex; align-items:center; justify-content:flex-end; gap:14px; margin-top:18px; padding:14px 18px; border:1px solid var(--line); border-radius:10px; background:rgba(250,249,246,.96); box-shadow:0 8px 28px rgba(31,42,37,.14); }
.mission-history-selector { margin-bottom:18px; }
.mission-selector-form { max-width:860px; }
.mission-stat-grid { grid-template-columns:repeat(auto-fit,minmax(120px,1fr)); }
.mission-participant-group { margin-top:18px; }
.controller-list { display:flex; flex-wrap:wrap; gap:10px; margin:0; padding:0; list-style:none; }
.controller-list li { min-width:180px; padding:12px 14px; border:1px solid var(--line); border-radius:8px; background:var(--paper); }
.economy-admin-panel, .economy-category-panel { margin-bottom:18px; }
.economy-editor { margin-top:18px; padding-top:18px; border-top:1px solid var(--line); }
.economy-card-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:14px; }
.economy-item-card { padding:16px; border:1px solid var(--line); border-radius:10px; background:var(--paper); }
.economy-item-card .inline-form { margin-top:10px; }
.checkbox-line { display:flex; align-items:center; gap:8px; }
.checkbox-line input { width:auto; }
.mission-participant-table { min-width:900px; font-size:.86rem; }
.mission-participant-table th, .mission-participant-table td { padding-left:8px; padding-right:8px; white-space:nowrap; }
.mission-participant-table td { vertical-align:middle; }
.participant-action-link { display:block; margin-top:4px; font-size:.78rem; font-weight:700; }
@media (max-width: 900px) {
  .rbac-permission-grid { grid-template-columns:1fr; }
  .rbac-save-bar { align-items:flex-start; flex-direction:column; }
}
