/* Aircraft Inventory — inside hangar at /pilot/hangar/inventory/ */

.rcs-hangar-inventory-page .rcs-hangar-wrap {
  max-width: min(1400px, calc(100vw - 32px));
}

@media (min-width: 1600px) {
  .rcs-hangar-inventory-page .rcs-hangar-wrap {
    max-width: min(1520px, calc(100vw - 48px));
  }
}

.rcs-hangar-inventory-page .fi-chrome .rcs-pilot-nav,
.rcs-pilot-subchrome .rcs-pilot-nav {
  display: none;
}

.fi-chrome-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  width: 100%;
}

.fi-chrome-row .rcs-page-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.fi-back-btn {
  margin-left: auto;
  white-space: nowrap;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

button.fi-back-btn {
  appearance: none;
  cursor: pointer;
  font: inherit;
}

.fi-stage {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 8px 12px 20px;
}

.fi-sheet {
  max-width: none;
  margin: 0;
}

.fi-sheet-head {
  margin-bottom: 10px;
  padding: 0 4px;
}

.fi-sheet-meta {
  margin: 0;
  font-size: 13px;
  color: var(--rcs-muted);
}

.rcs-hangar-inventory-page .fi-sheet-head {
  margin-bottom: 8px;
  padding: 0;
}

.rcs-hangar-inventory-page .fi-sheet-meta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .rcs-hangar-inventory-page .fi-sheet-meta {
  color: var(--rcs-text, #0f172a);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  text-shadow: none;
}

.fi-sheet-meta-badge {
  flex: 0 0 auto;
}

.fi-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--rcs-panel);
  border: 1px solid var(--rcs-border);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
}

.fi-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  width: 100%;
}

[data-theme="dark"] .fi-toolbar {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
}

.fi-search-wrap {
  flex: 1 1 220px;
  min-width: 0;
}

.fi-search,
.fi-select {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--rcs-border);
  background: var(--rcs-input-bg);
  color: var(--rcs-text);
  font: inherit;
}

.fi-select {
  flex: 0 1 auto;
  width: auto;
  min-width: 130px;
}

.fi-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}

.fi-chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--rcs-border);
  background: var(--rcs-input-bg);
  color: var(--rcs-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.fi-chip.is-active {
  border-color: rgba(34, 197, 94, 0.45);
  color: var(--rcs-text);
  background: rgba(34, 197, 94, 0.12);
}

.fi-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

@media (min-width: 960px) {
  .fi-layout {
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 16px;
  }

  .fi-table-scroll {
    overflow-x: visible;
  }

  .fi-table th,
  .fi-table td {
    padding: 9px 10px;
  }
}

.fi-table-panel {
  border-radius: 14px;
  background: var(--rcs-panel);
  border: 1px solid var(--rcs-border);
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .fi-table-panel {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
}

.fi-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.fi-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.fi-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--rcs-input-bg);
  border-bottom: 1px solid var(--rcs-border);
}

.fi-table th {
  padding: 10px 12px;
  text-align: left;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rcs-muted);
  white-space: nowrap;
}

.fi-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--rcs-border);
  vertical-align: middle;
  color: var(--rcs-text);
}

.fi-row {
  cursor: pointer;
  transition: background 0.12s ease;
}

.fi-row:hover {
  background: rgba(34, 197, 94, 0.06);
}

.fi-row.is-selected {
  background: rgba(34, 197, 94, 0.12);
}

.fi-col-star {
  width: 44px;
  text-align: center;
}

.fi-col-model {
  min-width: 140px;
}

.fi-col-model strong {
  display: block;
  font-weight: 800;
  line-height: 1.25;
}

.fi-tbl-sub {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--rcs-muted);
  font-weight: 500;
}

.fi-col-num {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.fi-table th.fi-col-num,
.fi-table th.fi-col-flights {
  text-align: right;
}

.fi-col-power {
  min-width: 100px;
  max-width: 180px;
  font-size: 12px;
  color: var(--rcs-muted);
}

.fi-col-date {
  white-space: nowrap;
  font-size: 12px;
  color: var(--rcs-muted);
}

.fi-date-compact {
  display: none;
}

.fi-col-added,
.fi-col-edited {
  min-width: 88px;
}

.fi-col-flights {
  width: 64px;
}

.fi-tbl-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--rcs-input-bg);
  color: var(--rcs-muted);
}

.fi-tbl-status--active {
  color: var(--rcs-status, #22c55e);
  background: rgba(34, 197, 94, 0.12);
}

.fi-tbl-status--building {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
}

.fi-tbl-empty {
  text-align: center;
  padding: 28px 16px !important;
  color: var(--rcs-muted);
}

.fi-star-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--rcs-muted);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}

.fi-star-btn.is-on {
  color: #facc15;
}

.fi-star-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.fi-detail-panel {
  position: sticky;
  top: 8px;
}

.fi-detail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: var(--rcs-panel);
  border: 1px solid var(--rcs-border);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .fi-detail {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.32);
}

.fi-detail--empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--rcs-muted);
  font-size: 13px;
  line-height: 1.5;
}

.fi-detail-photo-frame,
button.fi-detail-photo-frame,
.fi-detail-photo-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
}

.fi-detail-photo-frame img,
button.fi-detail-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fi-detail-photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--rcs-input-bg);
  color: var(--rcs-muted);
  font-size: 12px;
}

.fi-detail-photo-placeholder svg {
  width: 40px;
  height: 40px;
  opacity: 0.45;
}

.fi-detail-hero {
  padding: 4px 0 0;
}

.fi-detail-hero .hg-spec-hero-name {
  font-size: clamp(1.1rem, 2.5vw, 1.45rem);
}

.fi-detail-mfr {
  margin: -4px 0 8px;
  font-size: 12px;
  color: var(--rcs-muted);
}

.fi-detail-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.fi-detail-stat {
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--rcs-input-bg);
  border: 1px solid var(--rcs-border);
}

.fi-detail-stat-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rcs-muted);
}

.fi-detail-stat-value {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  font-weight: 800;
  color: var(--rcs-text);
}

.fi-detail-status-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rcs-muted);
}

.fi-status-select {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--rcs-border);
  background: var(--rcs-input-bg);
  color: var(--rcs-text);
  font: inherit;
  font-size: 13px;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
}

.fi-detail-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fi-detail-actions .hg-btn {
  width: 100%;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}

.fi-delete-zone {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(239, 68, 68, 0.25);
}

.fi-delete-lead {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--rcs-muted);
}

.fi-delete-btn {
  width: 100%;
}

.fi-delete-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.fi-delete-modal[hidden] {
  display: none !important;
}

.fi-delete-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

[data-theme="light"] .fi-delete-modal-backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.fi-delete-modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  padding: 20px 18px 16px;
  border-radius: 14px;
  background: var(--rcs-panel);
  border: 1px solid rgba(239, 68, 68, 0.35);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

.fi-delete-modal-title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ef4444;
  line-height: 1.35;
}

.fi-delete-modal-name {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--rcs-text);
}

.fi-delete-modal-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--rcs-text);
  cursor: pointer;
  user-select: none;
}

.fi-delete-modal-check input {
  margin-top: 2px;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  accent-color: #ef4444;
}

.fi-delete-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fi-delete-modal-actions .hg-btn {
  flex: 1 1 auto;
  min-width: 120px;
  justify-content: center;
}

.fi-toast {
  position: fixed;
  left: 50%;
  bottom: 72px;
  transform: translateX(-50%);
  max-width: min(92vw, 420px);
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.94);
  color: #f9fafb;
  font-size: 13px;
  z-index: 40;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

[data-theme="light"] .fi-toast {
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  border: 1px solid var(--rcs-border);
}

.hg-empty--inline {
  flex: 0 0 auto;
  min-width: 200px;
  max-width: 280px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--rcs-panel);
  border: 1px dashed var(--rcs-border);
}

.hg-deck-link {
  font-size: 12px;
  font-weight: 700;
  color: var(--rcs-accent-text, #dd0206);
  text-decoration: none;
  white-space: nowrap;
}

.hg-deck-link:hover {
  text-decoration: underline;
}

@media (max-width: 959px) {
  .fi-detail-panel {
    position: static;
  }

  .fi-table th.fi-col-power,
  .fi-table td.fi-col-power,
  .fi-table th.fi-col-added,
  .fi-table td.fi-col-added {
    display: none;
  }

  .fi-date-full {
    display: none;
  }

  .fi-date-compact {
    display: inline;
  }

  .fi-table th.fi-col-edited,
  .fi-table td.fi-col-edited {
    font-size: 11px;
  }
}

@media (max-width: 640px) {
  .fi-table th.fi-col-num:not(.fi-col-flights),
  .fi-table td.fi-col-num:not(.fi-col-flights) {
    display: none;
  }

  .fi-table th.fi-col-date:not(.fi-col-edited),
  .fi-table td.fi-col-date:not(.fi-col-edited) {
    display: none;
  }
}
