/* ==========================================================================
   SchemCAD — SPI BIOS / UEFI Inspector, MSDM Patcher & .CAP Stripper Styles
   Strict .bi-* Namespace | Zero Upload Client-Side Workstation UI
   ========================================================================== */

.bi-root {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #0e131d;
  color: var(--text, #e8edf5);
  font-family: var(--sans, "Inter", "Segoe UI", system-ui, sans-serif);
  font-size: 12.5px;
  line-height: 1.42;
  overflow: hidden;
  user-select: text;
}

.bi-mono {
  font-family: var(--mono, "JetBrains Mono", "Cascadia Code", "Consolas", monospace);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "zero" 1;
}

/* Top bar: Mode Tabs + Zero-Upload Privacy Indicator */
.bi-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: #121926;
  border-bottom: 1px solid #243044;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.bi-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.bi-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #151d2b;
  color: #9aa6b8;
  border: 1px solid #273348;
  border-radius: 4px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.bi-tab:hover {
  background: #1c2638;
  color: #e8edf5;
  border-color: #384864;
}

.bi-tab.is-active {
  background: rgba(44, 165, 104, 0.16);
  color: #7ee2b1;
  border-color: rgba(44, 165, 104, 0.58);
  box-shadow: inset 0 -2px 0 #2ca568;
}

.bi-tab--donor.is-active {
  background: rgba(220, 160, 58, 0.16);
  color: #f5ce85;
  border-color: rgba(220, 160, 58, 0.58);
  box-shadow: inset 0 -2px 0 #dca03a;
}

.bi-privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  background: rgba(44, 165, 104, 0.1);
  border: 1px solid rgba(44, 165, 104, 0.34);
  border-radius: 3px;
  color: #8be0b6;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.bi-privacy-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2ca568;
  flex-shrink: 0;
}

/* Scrollable Pane Container */
.bi-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bi-pane {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.bi-pane.is-active {
  display: flex;
}

/* Dropzones */
.bi-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 18px 16px;
  background: #151d2b;
  border: 1.5px dashed #33435d;
  border-radius: 6px;
  text-align: center;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.bi-dropzone:hover,
.bi-dropzone.is-dragover {
  background: #1a2436;
  border-color: #dca03a;
}

.bi-dropzone.is-loaded {
  padding: 12px 14px;
  border-style: solid;
  border-color: rgba(44, 165, 104, 0.5);
  background: linear-gradient(180deg, rgba(44, 165, 104, 0.08) 0%, #151d2b 100%);
}

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

.bi-dropzone-title {
  font-size: 13px;
  font-weight: 600;
  color: #e8edf5;
}

.bi-dropzone-sub {
  font-size: 11.5px;
  color: #8b9bb4;
}

.bi-ext-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.bi-ext-badge {
  font-family: var(--mono, monospace);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  color: #c5d1e3;
  background: #0e131d;
  border: 1px solid #28354a;
}

.bi-loaded-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  flex-wrap: wrap;
  text-align: left;
}

.bi-loaded-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.bi-file-name {
  font-family: var(--mono, monospace);
  font-size: 12.5px;
  font-weight: 700;
  color: #f3f7fc;
  word-break: break-all;
}

/* Pills & Badges */
.bi-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 3px;
  font-family: var(--mono, monospace);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.bi-badge--ok {
  color: #7ee2b1;
  background: rgba(44, 165, 104, 0.16);
  border: 1px solid rgba(44, 165, 104, 0.48);
}

.bi-badge--gold {
  color: #f5ce85;
  background: rgba(220, 160, 58, 0.16);
  border: 1px solid rgba(220, 160, 58, 0.5);
}

.bi-badge--danger {
  color: #fca5a5;
  background: rgba(223, 84, 84, 0.16);
  border: 1px solid rgba(223, 84, 84, 0.5);
}

.bi-badge--blue {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.16);
  border: 1px solid rgba(59, 130, 246, 0.46);
}

.bi-badge--muted {
  color: #9aa6b8;
  background: #0e131d;
  border: 1px solid #28354a;
}

/* Action Banners (.CAP Stripper, 1.8V Warning) */
.bi-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 6px;
  background: #151d2b;
  border: 1px solid #2b3950;
  flex-wrap: wrap;
}

.bi-banner--cap {
  background: linear-gradient(90deg, rgba(220, 160, 58, 0.15) 0%, rgba(44, 165, 104, 0.1) 100%);
  border-color: rgba(220, 160, 58, 0.62);
}

.bi-banner--18v {
  background: linear-gradient(90deg, rgba(223, 84, 84, 0.18) 0%, rgba(220, 160, 58, 0.1) 100%);
  border-color: rgba(223, 84, 84, 0.65);
}

.bi-banner--18v-hint {
  background: rgba(220, 160, 58, 0.11);
  border-color: rgba(220, 160, 58, 0.48);
}

.bi-banner--ok {
  background: rgba(44, 165, 104, 0.11);
  border-color: rgba(44, 165, 104, 0.48);
}

.bi-banner-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1 1 320px;
}

.bi-banner-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #f8fafc;
}

.bi-banner-desc {
  font-size: 11.5px;
  color: #cbd5e1;
}

/* Buttons */
.bi-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid #33435d;
  background: #1c2638;
  color: #e8edf5;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.13s ease, border-color 0.13s ease, transform 0.06s ease;
}

.bi-btn:hover:not(:disabled) {
  background: #25324a;
  border-color: #496085;
}

.bi-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.bi-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.bi-btn--emerald {
  background: #1f8a55;
  border-color: #2fb874;
  color: #ffffff;
}

.bi-btn--emerald:hover:not(:disabled) {
  background: #259f63;
  border-color: #48cc8b;
}

.bi-btn--gold {
  background: rgba(220, 160, 58, 0.2);
  border-color: #dca03a;
  color: #fde0a6;
}

.bi-btn--gold:hover:not(:disabled) {
  background: rgba(220, 160, 58, 0.32);
  border-color: #eab557;
}

.bi-btn--sm {
  padding: 3px 8px;
  font-size: 11px;
}

/* Diagnostic Cards Grid */
.bi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 740px) {
  .bi-grid {
    grid-template-columns: 1fr;
  }
}

.bi-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 11px 13px;
  background: #151d2b;
  border: 1px solid #243044;
  border-radius: 6px;
}

.bi-card--full {
  grid-column: 1 / -1;
}

.bi-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #1e293b;
  padding-bottom: 6px;
}

.bi-card-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9aa6b8;
}

.bi-kv-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.bi-kv {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.bi-kv-k {
  color: #8b9bb4;
  flex-shrink: 0;
}

.bi-kv-v {
  color: #e8edf5;
  text-align: right;
  word-break: break-all;
}

/* Windows Key Display Box */
.bi-key-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: #0e131d;
  border: 1px solid rgba(44, 165, 104, 0.45);
  border-radius: 4px;
  flex-wrap: wrap;
}

.bi-key-code {
  font-family: var(--mono, monospace);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #7ee2b1;
  user-select: all;
}

.bi-key-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Flash Descriptor Visual Map Bar */
.bi-region-bar {
  display: flex;
  width: 100%;
  height: 24px;
  background: #0b0f17;
  border: 1px solid #28354a;
  border-radius: 4px;
  overflow: hidden;
}

.bi-region-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 100%;
  font-family: var(--mono, monospace);
  font-size: 10px;
  font-weight: 700;
  color: #f8fafc;
  border-right: 1px solid rgba(14, 19, 29, 0.75);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 4px;
}

.bi-region-seg:last-child {
  border-right: none;
}

.bi-region-seg--fd {
  background: #2563eb;
}
.bi-region-seg--me {
  background: #b45309;
}
.bi-region-seg--gbe {
  background: #6d28d9;
}
.bi-region-seg--pdr {
  background: #475569;
}
.bi-region-seg--bios {
  background: #15803d;
}
.bi-region-seg--ec {
  background: #0f766e;
}
.bi-region-seg--gap {
  background: #1e293b;
  color: #64748b;
}

.bi-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.bi-table th,
.bi-table td {
  padding: 5px 8px;
  text-align: left;
  border-bottom: 1px solid #1e293b;
}

.bi-table th {
  color: #8b9bb4;
  font-weight: 600;
  font-size: 11px;
  background: #101724;
}

.bi-table tr:last-child td {
  border-bottom: none;
}

/* Donor Transfer 2-Slot Grid */
.bi-donor-slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 740px) {
  .bi-donor-slots {
    grid-template-columns: 1fr;
  }
}

.bi-slot-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px;
  background: #151d2b;
  border: 1px solid #26344b;
  border-radius: 6px;
}

.bi-slot-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #e8edf5;
}

.bi-slot-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(220, 160, 58, 0.2);
  border: 1px solid rgba(220, 160, 58, 0.6);
  color: #f5ce85;
  font-family: var(--mono, monospace);
  font-size: 11px;
  font-weight: 700;
}

.bi-donor-cta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #151d2b;
  border: 1px solid #2b3950;
  border-radius: 6px;
  flex-wrap: wrap;
}

/* Standalone Modal Fallback (if CadWindowManager is absent) */
.cad-bi-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(7, 10, 16, 0.76);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.cad-bi-modal {
  width: min(980px, 96vw);
  height: min(710px, 92vh);
  background: #0e131d;
  border: 1px solid #33435d;
  border-radius: 7px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cad-bi-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  background: #151d2b;
  border-bottom: 1px solid #26344b;
}

.cad-bi-modal-title {
  font-size: 13px;
  font-weight: 700;
  color: #e8edf5;
}

.cad-bi-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
