/* Assets & Hangar / Contract Management Styles */

.assets-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.assets-tabs-group {
  display: inline-flex;
  background: #e5ecef;
  border-radius: 6px;
  padding: 3px;
  gap: 2px;
}

.assets-tabs-group .tab-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.assets-tabs-group .tab-button:hover {
  color: var(--ink);
}

.assets-tabs-group .tab-button.active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.assets-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.subview-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.assets-pane[hidden] {
  display: none !important;
}

/* Hangars Grid */
.hangars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.hangar-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.hangar-card:hover {
  border-color: #b8c7cb;
  box-shadow: 0 4px 12px rgba(18, 33, 44, 0.05);
}

.hangar-header {
  padding: 12px 18px;
  background: #f8fafb;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hangar-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.division-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: #e2e8ea;
  color: #3b4d56;
}

.hangar-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

.hangar-header-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hangar-inventory-badge {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 12px;
  background: #e0f2fe;
  color: #0284c7;
  font-weight: 650;
}

.hangar-count-badge {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 12px;
  background: var(--teal-soft);
  color: #04635f;
  font-weight: 600;
}

.hangar-summary-bar {
  padding: 8px 18px;
  background: #fdfdfd;
  border-bottom: 1px solid #edf1f2;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
}

.hangar-summary-item strong {
  color: var(--ink);
  margin-left: 2px;
}

.hangar-summary-item strong.hangar-summary-value {
  color: #0f766e;
  font-weight: 700;
}

/* Hangar Inventory Section */
.hangar-inventory-section {
  padding: 14px 18px 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.hangar-inventory-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.inventory-heading {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.inventory-heading svg {
  color: var(--teal);
}

.inventory-count-hint {
  font-size: 11px;
  color: var(--muted);
}

.hangar-items-table-wrap {
  border: 1px solid var(--line);
  border-radius: 6px;
  max-height: 250px;
  overflow-y: auto;
  overflow-x: auto;
  background: #fff;
}

.hangar-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.hangar-items-table th {
  background: #f8fafb;
  color: var(--muted);
  font-weight: 650;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 11px;
}

.hangar-items-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #edf1f2;
  vertical-align: middle;
}

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

.item-name-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 130px;
}

.item-name-line {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
}

.item-inline-qty {
  display: inline;
  font-size: 12px;
  font-weight: 400;
  color: #64748b;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-left: 2px;
  line-height: inherit;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.item-name-text {
  font-weight: 600;
  color: var(--ink);
}

.item-val-th {
  text-align: right;
  width: 140px;
}

.item-val-td {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.item-val-text {
  color: #64748b;
  font-family: var(--font-mono, "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace);
  font-size: 12px;
  font-weight: 400;
  opacity: 0.9;
}

.item-custom-name {
  font-size: 11px;
  color: var(--teal);
  font-style: italic;
}

.item-container-tag {
  font-size: 10px;
  color: var(--muted);
}

.item-qty-td {
  text-align: right;
  white-space: nowrap;
  width: 70px;
}

.item-qty-num {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #1e293b;
}

.item-est-value {
  font-size: 11px;
  color: #0d9488;
  font-weight: 600;
  margin-top: 1px;
  white-space: nowrap;
}

.item-loc-td {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-location-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #475569;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-status-td {
  text-align: center;
  width: 70px;
  white-space: nowrap;
}

.pack-badge {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.pack-assembled {
  background: #e2e8f0;
  color: #475569;
}

.pack-singleton {
  background: #fef3c7;
  color: #b45309;
}

.hangar-empty-items {
  padding: 26px 16px;
  text-align: center;
  background: #fbfcfc;
  border: 1px dashed var(--line);
  border-radius: 6px;
  margin: 2px 0;
}

/* Collapsible Hangar Permissions Section */
.hangar-permissions-details {
  border-top: 1px solid var(--line);
  background: #f8fafb;
  margin-top: auto;
}

.hangar-permissions-details[open] {
  background: #fff;
}

.hangar-permissions-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  transition: background 0.15s ease, color 0.15s ease;
  list-style: none;
}

.hangar-permissions-summary::-webkit-details-marker {
  display: none;
}

.hangar-permissions-summary:hover {
  background: #f1f5f9;
  color: var(--ink);
}

.summary-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.shield-icon {
  width: 14px;
  height: 14px;
  color: var(--teal);
  flex-shrink: 0;
}

.summary-title {
  font-weight: 650;
  color: var(--ink);
  font-size: 12px;
}

.summary-badge {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
  background: #e2e8ea;
  color: #334155;
  font-weight: 600;
}

.summary-hint {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
}

.summary-right {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.summary-chevron {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

details.hangar-permissions-details[open] .summary-chevron {
  transform: rotate(180deg);
}

.hangar-permissions-details .hangar-members-list {
  padding: 10px 18px 14px;
  max-height: 260px;
  overflow-y: auto;
  border-top: 1px solid #edf1f2;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hangar-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: #fbfcfc;
  border: 1px solid #edf1f2;
  border-radius: 6px;
  gap: 10px;
  transition: background 0.15s ease;
}

.hangar-member-row:hover {
  background: #f4f7f6;
  border-color: var(--line);
}

.member-identity-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.member-char-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-nick-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.qq-badge {
  color: var(--muted);
  font-size: 11px;
}

.member-perms-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.member-badges-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.member-scopes-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--muted);
}

.scope-pill {
  background: #edf1f2;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 500;
}

/* Permission Badges */
.perm-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

.perm-director {
  background: #fff3d6;
  color: #8f5800;
  border: 1px solid #ffd885;
}

.perm-take {
  background: #e2f6ee;
  color: #0b7847;
  border: 1px solid #b7e8d3;
}

.perm-query {
  background: #e8f0fe;
  color: #1a56db;
  border: 1px solid #cad9f8;
}

.perm-container {
  background: #f2eafd;
  color: #632eb8;
  border: 1px solid #dfcbf7;
}

.perm-grantable {
  background: #f4f5f6;
  color: #55626a;
  border: 1px dashed #b8c4c9;
}

/* Contracts Table & Panel */
.contracts-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
}

.contracts-table-wrapper {
  overflow-x: auto;
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  max-height: 60vh;
}

.contracts-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  font-size: 13px;
}

.contracts-table th,
.contracts-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid #edf1f2;
}

.contracts-table th {
  background: #f8fafb;
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  position: sticky;
  top: 0;
  z-index: 1;
  box-shadow: 0 1px 0 var(--line);
}

.contracts-table tr:hover td {
  background: #f8fbfa;
}

.contracts-table .num-col {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.contracts-table .action-col {
  text-align: center;
  width: 90px;
}

.contract-type-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: #edf1f2;
  color: #3f5159;
}

.type-badge-exchange {
  background: #e6f4ea;
  color: #137333;
}

.type-badge-courier {
  background: #e8f0fe;
  color: #1a73e8;
}

.type-badge-auction {
  background: #fef7e0;
  color: #b06000;
}

.contract-status-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.status-badge-outstanding {
  background: #fff0d4;
  color: #9c5400;
}

.status-badge-in_progress {
  background: #e0f2fe;
  color: #0369a1;
}

.status-badge-finished {
  background: #e6f4ea;
  color: #137333;
}

.status-badge-deleted,
.status-badge-cancelled {
  background: #f1f3f4;
  color: #5f6368;
}

.status-badge-failed,
.status-badge-rejected {
  background: #fce8e6;
  color: #c5221f;
}

.contract-title-cell {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contract-parties-cell {
  line-height: 1.35;
  white-space: nowrap;
}

.contract-party-issuer {
  font-weight: 500;
  color: var(--ink);
}

.contract-party-acceptor {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.contract-loc-cell {
  max-width: 200px;
  overflow: hidden;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.contract-loc-start {
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contract-loc-end {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contract-loc-arrow {
  color: var(--teal, #0f766e);
  font-weight: 600;
  margin-right: 2px;
}

.contract-loc-single {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.isk-price {
  font-weight: 600;
  color: var(--ink);
}

.contracts-pagination-header,
.contracts-pagination-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.contracts-pagination-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #edf1f2;
}

.pagination-btn {
  padding: 4px 10px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 4px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  color: var(--ink);
  transition: background 0.15s ease;
}

.pagination-btn:hover:not(:disabled) {
  background: #f4f7f6;
  border-color: #b8c4c9;
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Contract Items Modal Dialog */
.contract-items-dialog {
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  max-width: 680px;
  width: 90vw;
  background: var(--panel);
}

.contract-items-dialog::backdrop {
  background: rgba(18, 33, 44, 0.55);
  backdrop-filter: blur(2px);
}

.contract-items-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 85vh;
}

.contract-items-body {
  overflow-y: auto;
  max-height: 55vh;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.contract-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.contract-items-table th,
.contract-items-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #edf1f2;
  text-align: left;
}

.contract-items-table th {
  background: #f8fafb;
  color: var(--muted);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
}

.contract-items-table .qty-col {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.item-badge-included {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  background: #e6f4ea;
  color: #137333;
}

.item-badge-requested {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  background: #fce8e6;
  color: #c5221f;
}

/* Hangars Standalone Search & Station Filter Controls */
.hangars-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  width: 100%;
}

.hangars-search-box {
  flex: 0 1 480px;
  max-width: 50%;
  min-width: 220px;
  position: relative;
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 6px;
  height: 38px;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hangars-search-box:focus-within {
  border-color: var(--teal, #0f766e);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.search-box-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px 0 12px;
  color: #64748b;
  flex-shrink: 0;
}

.hangars-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  padding: 8px 0;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink);
}

.hangars-search-input::placeholder {
  color: #94a3b8;
}

.hangars-search-clear {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 18px;
  line-height: 1;
  padding: 0 10px;
  cursor: pointer;
  transition: color 0.15s ease;
  flex-shrink: 0;
}

.hangars-search-clear:hover {
  color: var(--ink);
}

.hangars-station-box {
  flex: 0 1 380px;
  max-width: 50%;
  min-width: 240px;
  position: relative;
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 6px;
  height: 38px;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hangars-station-box:hover {
  border-color: #cbd5e1;
}

.hangars-station-box.is-open,
.hangars-station-box:focus-within {
  border-color: var(--teal, #0f766e);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.hangars-station-trigger {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 10px;
  border: none;
  background: transparent;
  color: var(--ink, #0f172a);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  user-select: none;
}

.hangars-station-trigger:focus-visible {
  outline: none;
}

.station-box-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  flex-shrink: 0;
}

.station-label-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  color: var(--ink, #0f172a);
  font-size: 13px;
}

.hangars-station-box.has-active-filter .station-label-text {
  font-weight: 600;
  color: #0f766e;
}

.station-chevron-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  flex-shrink: 0;
  transition: transform 0.2s ease, color 0.15s ease;
}

.hangars-station-box.is-open .station-chevron-icon {
  transform: rotate(180deg);
  color: #0f766e;
}

.station-box-clear {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 17px;
  line-height: 1;
  padding: 0 10px 0 2px;
  cursor: pointer;
  transition: color 0.15s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.station-box-clear:hover {
  color: var(--ink, #0f172a);
}

/* Custom Modern Dropdown Popover */
.hangars-station-dropdown {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  width: max(100%, 360px);
  max-width: 480px;
  max-height: 320px;
  background: #ffffff;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 8px;
  box-shadow: 0 12px 28px -4px rgba(15, 23, 42, 0.12), 0 4px 10px -2px rgba(15, 23, 42, 0.05);
  z-index: 120;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hangars-station-dropdown[hidden] {
  display: none !important;
}

.hangars-station-dropdown::-webkit-scrollbar {
  width: 5px;
}

.hangars-station-dropdown::-webkit-scrollbar-track {
  background: transparent;
}

.hangars-station-dropdown::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.hangars-station-dropdown::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.station-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  text-decoration: none;
  border: 1px solid transparent;
  user-select: none;
}

.station-dropdown-item:hover,
.station-dropdown-item.is-focused {
  background-color: #f1f5f9;
}

.station-dropdown-item.is-selected {
  background-color: #f0fdfa;
  border-color: #ccfbf1;
}

.station-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.station-item-name {
  font-size: 13px;
  font-weight: 550;
  color: var(--ink, #0f172a);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.35;
}

.station-dropdown-item.is-selected .station-item-name {
  color: #0f766e;
  font-weight: 650;
}

.station-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.2;
}

.station-item-count {
  font-variant-numeric: tabular-nums;
}

.station-item-val {
  padding: 1px 6px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #334155;
  font-size: 11px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}

.station-dropdown-item.is-selected .station-item-val {
  background: #ccfbf1;
  color: #0f766e;
}

.station-item-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0f766e;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .hangars-filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .hangars-search-box,
  .hangars-station-box {
    max-width: 100%;
    width: 100%;
  }
}

/* Global Hangar Live Search Results Panel */
.hangars-search-results-panel {
  background: var(--panel);
  border: 1.5px solid #0f766e;
  border-radius: 8px;
  margin-bottom: 24px;
  box-shadow: 0 4px 16px rgba(15, 118, 110, 0.08);
  overflow: hidden;
}

.search-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: #f0fdfa;
  border-bottom: 1px solid #ccfbf1;
  flex-wrap: wrap;
  gap: 10px;
}

.results-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.results-badge {
  display: inline-block;
  padding: 2px 8px;
  background: #0f766e;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.search-results-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #0f766e;
}

.search-results-table-wrap {
  max-height: 400px;
  overflow-y: auto;
}

.search-results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.search-results-table th,
.search-results-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid #edf1f2;
  vertical-align: middle;
}

.search-results-table th {
  background: #f8fafb;
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  position: sticky;
  top: 0;
  z-index: 1;
  box-shadow: 0 1px 0 var(--line);
}

.search-results-table tr:hover td {
  background: #f8fbfa;
}

.search-results-table .qty-col,
.search-results-table .val-col {
  text-align: right;
}

.search-results-table .empty-results-cell {
  text-align: center;
  padding: 32px 16px;
  color: var(--muted);
  font-style: italic;
}

.hangar-loc-tag {
  display: inline-flex;
  align-items: center;
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.hangar-loc-tag:hover {
  background: #e0e7ff;
  border-color: #a5b4fc;
  color: #3730a3;
}

.corp-tag {
  display: inline-block;
  font-size: 11px;
  color: #475569;
  background: #f1f5f9;
  border-radius: 3px;
  padding: 2px 6px;
}

/* Flash highlight animation for hangar cards */
@keyframes hangarHighlightPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(15, 118, 110, 0.7);
    border-color: #0f766e;
  }
  50% {
    box-shadow: 0 0 0 6px rgba(15, 118, 110, 0.35);
    border-color: #0f766e;
    background-color: #f0fdfa;
  }
  100% {
    box-shadow: 0 0 0 0 rgba(15, 118, 110, 0);
    border-color: var(--line);
  }
}

.hangar-card.highlight-flash {
  animation: hangarHighlightPulse 2s ease-out;
}

/* =========================================================
 * Contracts Loading Mask & Fitted Ships Enhancement
 * ========================================================= */

.contracts-table-wrapper {
  position: relative;
}

.table-loading-spinner-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.table-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: inherit;
  animation: fadeInMask 0.2s ease-out;
}

@keyframes fadeInMask {
  from { opacity: 0; }
  to { opacity: 1; }
}

.table-loading-overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

.contract-modal-loading-mask {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  gap: 14px;
  padding: 32px 20px;
  text-align: center;
}

.contract-modal-loading-mask .auth-loading-spinner {
  width: 38px;
  height: 38px;
}

.contract-modal-loading-mask .loading-title {
  font-size: 15px;
  font-weight: 650;
  color: var(--ink);
  margin: 0;
}

.contract-modal-loading-mask .loading-desc {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

/* Outer table fitted ship badge */
.fitted-ship-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  margin-right: 6px;
  vertical-align: middle;
  white-space: nowrap;
}

.btn-view-fit {
  background: #f0fdf4 !important;
  border-color: #86efac !important;
  color: #166534 !important;
  font-weight: 600 !important;
}

.btn-view-fit:hover {
  background: #166534 !important;
  color: #ffffff !important;
}

/* Fitted Ship Modal View */
.contract-items-dialog {
  max-width: 760px;
}

.fitted-ship-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 4px;
}

.fitted-ship-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.fitted-ship-render-wrap {
  width: 84px;
  height: 84px;
  flex-shrink: 0;
  background: radial-gradient(circle, #334155 0%, #0f172a 100%);
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.fitted-ship-render {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.fitted-ship-meta {
  flex: 1;
  min-width: 0;
}

.fitted-ship-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.fitted-ship-tag {
  font-size: 11px;
  font-weight: 600;
  color: #0369a1;
  background: #e0f2fe;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid #bae6fd;
}

.fitted-ship-custom-tag {
  font-size: 11px;
  font-weight: 600;
  color: #6b21a8;
  background: #f3e8ff;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid #e9d5ff;
}

.fitted-ship-name {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 4px;
  line-height: 1.3;
}

.fitted-ship-sub {
  font-size: 12px;
  color: #64748b;
  margin: 0 0 6px;
}

.fitted-ship-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.fitted-ship-stats span {
  display: inline-flex;
  align-items: center;
  background: transparent;
  padding: 0;
  border: none;
  font-weight: 400;
  color: var(--muted);
}

.contract-items-top-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
  padding: 2px 0;
}

.contract-items-top-summary span {
  font-weight: 400;
  color: var(--muted);
}

.fitted-groups-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fitted-section {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.fitted-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.fitted-section-title {
  font-size: 13px;
  font-weight: 650;
  color: #1e293b;
}

.fitted-section-count {
  font-size: 11px;
  color: #64748b;
}

.contract-item-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.contract-item-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 3px;
  border: 1px solid #e2e8f0;
  background: #0f172a;
}

.contract-item-en-name {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  font-weight: normal;
}

.isk-price-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}

.contract-primary-price {
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.contract-estimate-price {
  font-size: 11px;
  color: #64748b;
  margin-top: 3px;
  white-space: nowrap;
}

/* Asset Hangar Audit */
#audit-controls .search-input,
#permissions-controls .search-input {
  min-width: 220px;
}

.assets-audit-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
  margin-top: 4px;
}

.assets-audit-layout--merged {
  grid-template-columns: minmax(210px, 1fr) minmax(0, 2fr);
}

.assets-audit-hangar-panel {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  min-width: 0;
}

.assets-audit-hangar-panel > .panel-heading {
  padding: 14px 16px;
  min-height: 69px;
  display: flex;
  align-items: center;
}

.assets-audit-hangar-panel .finance-wallet-list {
  flex: 1;
  min-height: 0;
  max-height: 540px;
  overflow-y: auto;
  align-content: start;
}

.assets-audit-hangar-row {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  min-height: 0;
  padding: 12px 16px;
}

.assets-audit-hangar-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.assets-audit-hangar-top b {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assets-audit-hangar-top strong {
  flex-shrink: 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.assets-audit-hangar-row small {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.assets-audit-hangar-row small.assets-audit-new-badge.has-new {
  color: var(--teal);
  font-weight: 650;
}

.assets-audit-detail-panel {
  padding: 0;
  overflow: hidden;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.assets-audit-detail-panel > .panel-heading {
  padding: 14px 16px;
  min-height: 69px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: nowrap;
}

.assets-audit-detail-panel > .hint {
  margin: 0;
  padding: 20px 18px;
}

.assets-audit-heading-main {
  min-width: 0;
  flex: 1;
}

.assets-audit-heading-main .eyebrow {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.assets-audit-heading-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  flex-wrap: nowrap;
}

.assets-audit-heading-title h2 {
  margin: 0;
  font-size: 15px;
  white-space: nowrap;
  flex-shrink: 0;
}

.assets-audit-heading-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.assets-audit-heading-sub {
  margin: 3px 0 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.assets-audit-heading-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.assets-audit-delta {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.assets-audit-delta.hint {
  margin: 0;
  font-weight: 500;
}

.assets-audit-section {
  padding: 0;
  border-bottom: 1px solid var(--line);
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.assets-permissions-members-panel .assets-audit-section {
  padding: 14px 16px;
}

.assets-audit-section:last-child {
  border-bottom: 0;
}

.assets-audit-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.assets-audit-section-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}

.assets-audit-category-filter {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  min-height: 28px;
  cursor: pointer;
}

.assets-audit-category-filter:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
}

.assets-audit-detail-panel .mail-pagination {
  margin: 0;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.assets-audit-section-header h3 {
  margin: 0;
  font-size: 14px;
  color: var(--ink);
}

.assets-audit-section-count {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.assets-audit-feed-wrap {
  flex: 1;
  min-height: 220px;
  max-height: 540px;
  overflow-y: auto;
  border: 0;
  border-radius: 0;
  background: #fff;
  overscroll-behavior: contain;
}

.assets-audit-feed {
  list-style: none;
  margin: 0;
  padding: 0;
}

.assets-audit-feed-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 70px;
  padding: 15px 16px;
  border-bottom: 1px solid #edf1f2;
  border-left: 3px solid transparent;
  transition: background-color .18s ease, border-left-color .22s ease;
}

.assets-audit-feed-row:hover {
  background: #f8fbfa;
}

.assets-audit-feed-row.is-increase {
  background: #effaf3;
}

.assets-audit-feed-row.is-increase:hover {
  background: #e4f6eb;
}

.assets-audit-feed-row.is-decrease {
  background: #fdf0f2;
}

.assets-audit-feed-row.is-decrease:hover {
  background: #fae4e8;
}

.assets-audit-feed-row.is-unseen {
  border-left-color: var(--teal);
}

.assets-audit-feed-row.is-unseen:not(.is-increase):not(.is-decrease) {
  background: #f3faf8;
}

.assets-audit-feed-row.is-unseen:not(.is-increase):not(.is-decrease):hover {
  background: #eaf5f2;
}

.audit-unread-dot {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  color: #04635f;
  background: var(--teal-soft);
  flex-shrink: 0;
}

.assets-audit-feed-row:last-child {
  border-bottom: 0;
}

.audit-feed-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.audit-feed-title-line {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.audit-feed-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-feed-meta {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-feed-metrics {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.audit-feed-qty {
  font-size: 13px;
  white-space: nowrap;
}

.audit-feed-qty small {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
}

.audit-feed-val {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.assets-audit-container-row {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.assets-audit-presence-row {
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  cursor: pointer;
}

.assets-audit-feed-row.is-linked-hover {
  box-shadow: inset 3px 0 0 rgba(12, 124, 134, 0.55);
}

.assets-audit-feed-row.is-linked-active {
  box-shadow: inset 3px 0 0 var(--teal);
  outline: 1px solid rgba(12, 124, 134, 0.35);
  outline-offset: -1px;
}

.audit-presence-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.audit-presence-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.audit-presence-delta {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.audit-presence-members {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.audit-presence-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.4;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  max-width: 100%;
}

.audit-presence-pill b {
  font-weight: 650;
  white-space: nowrap;
}

.audit-presence-pill small {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

.audit-presence-pill.is-active {
  background: #edf7f5;
  border-color: #b7ded9;
  color: #0f5f58;
}

.audit-presence-pill.is-idle {
  background: #f8fafb;
  color: var(--muted);
}

.audit-system-dot {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  color: #9a5b13;
  background: #fef3c7;
  border-radius: 4px;
  padding: 0 4px;
}

.audit-presence-pill.is-system {
  background: #fffbeb;
  border-color: #fde68a;
  color: #78350f;
}

.audit-presence-idle-note,
.audit-presence-empty {
  font-size: 11px;
  color: var(--muted);
}

.assets-audit-subdivider {
  padding: 7px 16px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: #f5f7f9;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.assets-audit-pair-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: #f8fafb;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.assets-audit-pair-columns span {
  padding: 7px 16px;
  min-width: 0;
}

.assets-audit-pair-columns span + span {
  border-left: 1px solid var(--line);
}

.assets-audit-paired-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  justify-content: initial;
  padding: 0;
  gap: 0;
}

.audit-pair-change {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  min-width: 0;
}

.audit-pair-ops {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 12px 16px;
  min-width: 0;
  border-left: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.42);
}

.audit-container-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.audit-container-actor {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.audit-feed-actor {
  font-size: 13px;
  color: var(--ink);
}

.audit-feed-time {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.assets-audit-history-row {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.audit-container-body {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.audit-container-item {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assets-audit-empty {
  margin: 0;
  padding: 24px 16px;
  text-align: center;
}

.assets-audit-table-wrap {
  flex: 1;
  min-height: 220px;
  max-height: 540px;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: #fff;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

.assets-audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.assets-audit-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafb;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.assets-audit-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #edf1f2;
  vertical-align: middle;
}

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

.assets-audit-table .num-col {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.audit-event-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 650;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

.audit-event-added,
.audit-event-increased {
  background: #e6f6ef;
  color: #137349;
}

.audit-event-removed,
.audit-event-decreased {
  background: #fdecec;
  color: #b42318;
}

.audit-event-neutral {
  background: #eef2f6;
  color: #475569;
}

.assets-audit-members-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  max-height: 460px;
  overflow: auto;
  scrollbar-gutter: stable;
}

.assets-audit-members-grid .hangar-member-row {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fafcfd;
}

.assets-audit-role-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.assets-audit-hangar-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

@media (max-width: 1180px) {
  .assets-audit-layout:not(.assets-audit-layout--merged) {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .assets-audit-layout--merged {
    grid-template-columns: 1fr;
  }

  .assets-audit-pair-columns {
    display: none;
  }

  .assets-audit-paired-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .audit-pair-ops {
    border-left: 0;
    border-top: 1px dashed rgba(15, 23, 42, 0.1);
    padding-top: 10px;
  }
}

@media (max-width: 700px) {
  .assets-audit-detail-panel > .panel-heading {
    padding-inline: 12px;
  }

  .assets-audit-heading-right {
    align-items: flex-start;
  }
}



