/* ---- E&O Summary Cards ---- */
.eo-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
  align-items: stretch;
}
/* E&O Exposure card spans 2 columns to fit Reserve + adjustment lines. */
.eo-card-total-wide {
  grid-column: span 2;
}

.eo-card {
  border: 1px solid var(--border, #ddd);
  border-radius: 8px;
  padding: 12px 16px;
  min-width: 0;
  text-align: center;
  background: var(--bg-card, #fff);
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}
.eo-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.eo-card-active {
  border-color: var(--accent, #2563eb);
  box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}
.eo-card-total {
  cursor: default;
  border-color: var(--border-strong, #999);
  background: var(--bg-alt, #f8f9fa);
}
.eo-card-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted, #666);
}
.eo-card-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}
.eo-card-sub {
  font-size: 11px;
  color: var(--text-muted, #666);
  line-height: 1.4;
}
.eo-card-sub-warn {
  font-size: 11px;
  color: #d97706;
  font-weight: 600;
  line-height: 1.4;
}
/* Reconciliation modal */
.eo-recon-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.eo-recon-table th, .eo-recon-table td { padding: 6px 8px; text-align: left; }
.eo-recon-table td.num, .eo-recon-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.eo-recon-table tbody tr.eo-recon-class td { border-bottom: 1px solid var(--border, #ddd); }
.eo-recon-table tfoot td { font-weight: 600; }
.eo-recon-table .eo-recon-divider td { border-top: 2px solid var(--border-strong, #999); padding-top: 8px; }
.eo-recon-table .eo-recon-bridge td { color: #d97706; }
.eo-recon-table .eo-recon-final td { background: var(--bg-alt, #f8f9fa); border-top: 1px solid var(--border-strong, #999); }
.eo-recon-note { margin-top: 12px; font-size: 12px; color: var(--text-muted, #666); }

.eo-card-ok .eo-card-value { color: #16a34a; }
.eo-card-ok-new .eo-card-value { color: #2563eb; }
.eo-card-excess .eo-card-value { color: #d97706; }
.eo-card-obsolete .eo-card-value { color: #dc2626; }
.eo-card-total .eo-card-value { color: var(--text, #111); }

.eo-card-delta {
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
}
.eo-card-delta.neg { color: #dc2626; }
.eo-card-delta.pos { color: #16a34a; }

/* ---- State badges ---- */
.eo-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.eo-badge.eo-state-ok { background: #dcfce7; color: #166534; }
.eo-badge.eo-state-ok-new { background: #dbeafe; color: #1e40af; }
.eo-badge.eo-state-excess { background: #fef3c7; color: #92400e; }
.eo-badge.eo-state-obsolete { background: #fee2e2; color: #991b1b; }

/* ---- Row tinting ---- */
#eoTableBody tr.eo-state-obsolete { background: rgba(220,38,38,0.04); }
#eoTableBody tr.eo-state-excess { background: rgba(217,119,6,0.04); }

/* ---- Table ---- */
#eoTableWrap {
  overflow-x: auto;
}
#eoTableWrap table {
  width: 100%;
  min-width: 1200px;
}
#eoTableWrap th[data-col] {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 16px;
}
#eoTableWrap th[data-col]::after {
  content: '';
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  border: 4px solid transparent;
}
#eoTableWrap th.sort-asc::after {
  border-bottom-color: var(--text, #111);
  top: calc(50% - 2px);
}
#eoTableWrap th.sort-desc::after {
  border-top-color: var(--text, #111);
  top: calc(50% + 2px);
}

/* ---- Reserve account input ---- */
#eoReserveAccount {
  width: 80px;
}

/* ---- Warehouse filter dropdown ---- */
.eo-whs-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 50;
  min-width: 180px;
  max-height: 300px;
  overflow-y: auto;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, #ddd);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  padding: 4px 0;
  margin-top: 2px;
}
.eo-whs-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background 0.1s;
}
.eo-whs-item:hover {
  background: var(--bg-hover, #f0f4ff);
}
.eo-whs-item.selected {
  background: rgba(37,99,235,0.08);
  font-weight: 600;
}
.eo-whs-item.selected::before {
  content: '\2713';
  color: var(--accent, #2563eb);
  font-weight: 700;
  width: 14px;
  text-align: center;
}
.eo-whs-item:not(.selected)::before {
  content: '';
  width: 14px;
}
.eo-whs-sep {
  height: 1px;
  background: var(--border, #ddd);
  margin: 4px 0;
}

/* ---- Export dropdown ---- */
.eo-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eo-export-btn .chev {
  font-size: 11px;
  opacity: 0.85;
  transform: translateY(1px);
}
.eo-export-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 50;
  min-width: 220px;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, #ddd);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.14);
  padding: 6px;
  margin-top: 4px;
}
.eo-export-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  transition: background 0.1s;
}
.eo-export-item:hover {
  background: var(--bg-hover, #f0f4ff);
}
.eo-export-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #111);
}
.eo-export-item-sub {
  font-size: 11px;
  color: var(--text-muted, #666);
}
