.tab-btn {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #9ca3af;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
}
.tab-btn:hover {
  color: #e5e7eb;
}
.tab-btn.active {
  color: #60a5fa;
  border-bottom-color: #3b82f6;
}

.input-field {
  background: #374151;
  border: 1px solid #4b5563;
  color: #f3f4f6;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
}
.input-field:focus {
  outline: none;
  border-color: #3b82f6;
}

.fieldset-toggle {
  cursor: pointer;
  user-select: none;
}
.fieldset-toggle::before {
  content: '\25B6';
  display: inline-block;
  margin-right: 0.5rem;
  font-size: 0.75rem;
  transition: transform 0.15s;
}
.fieldset-toggle.open::before {
  transform: rotate(90deg);
}

table.admin-table {
  width: 100%;
  border-collapse: collapse;
}
table.admin-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #9ca3af;
  border-bottom: 1px solid #374151;
}
table.admin-table td {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border-bottom: 1px solid #1f2937;
}
table.admin-table tr:hover {
  background: #1f2937;
}

.log-event {
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  display: inline-block;
}
.log-order_placed {
  background: #065f46;
  color: #6ee7b7;
}
.log-order_failed {
  background: #7f1d1d;
  color: #fca5a5;
}
.log-system_start {
  background: #1e3a5f;
  color: #93c5fd;
}
.log-admin_config_change {
  background: #713f12;
  color: #fcd34d;
}
.log-heartbeat {
  background: #1f2937;
  color: #6b7280;
}
.log-alert_received {
  background: #581c87;
  color: #d8b4fe;
}

.expandable-row {
  cursor: pointer;
}
.detail-row {
  display: none;
}
.detail-row.open {
  display: table-row;
}
.detail-row td {
  padding: 0.5rem 0.75rem;
  background: #111827;
}
.detail-row pre {
  font-size: 0.75rem;
  color: #9ca3af;
  white-space: pre-wrap;
  max-height: 200px;
  overflow-y: auto;
}

/* --- Change highlighting --- */
.field-changed .input-field,
.input-field.field-changed {
  border-color: #f59e0b;
  box-shadow: 0 0 0 1px #f59e0b40;
}
.field-changed label {
  color: #f59e0b;
}
.change-badge {
  display: none;
  margin-left: 0.5rem;
  font-size: 0.75rem;
  background: #f59e0b;
  color: #1f2937;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-weight: 600;
}
.change-badge.visible {
  display: inline-block;
}

/* --- Field tooltip --- */
.field-tip {
  position: relative;
}
.field-tip[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.375rem);
  background: #1f2937;
  color: #e5e7eb;
  font-size: 0.6875rem;
  line-height: 1.4;
  padding: 0.375rem 0.625rem;
  border-radius: 0.375rem;
  border: 1px solid #374151;
  white-space: pre-line;
  z-index: 50;
  pointer-events: none;
  min-width: 12rem;
  max-width: 20rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

/* --- Tier badges --- */
.tier-badge {
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  display: inline-block;
  font-weight: 600;
}
.tier-0 {
  background: #581c87;
  color: #d8b4fe;
}
.tier-1 {
  background: #7f1d1d;
  color: #fca5a5;
}
.tier-2 {
  background: #713f12;
  color: #fcd34d;
}
.tier-3 {
  background: #1e3a5f;
  color: #93c5fd;
}
.tier-inactionable {
  background: #1f2937;
  color: #6b7280;
}

/* --- Tier group header rows --- */
.tier-group-header td {
  padding: 0.75rem 0.75rem 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #374151;
  background: transparent;
}
.tier-group-header:hover {
  background: transparent !important;
}

/* --- Inline impact edit --- */
.impact-input {
  width: 3.5rem;
  background: #374151;
  border: 1px solid #4b5563;
  color: #f3f4f6;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  text-align: center;
}
.impact-input:focus {
  outline: none;
  border-color: #3b82f6;
}
.impact-input.field-changed {
  border-color: #f59e0b;
  box-shadow: 0 0 0 1px #f59e0b40;
}
.impact-save-btn {
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  background: #f59e0b;
  color: #1f2937;
  border-radius: 0.25rem;
  font-weight: 600;
  margin-left: 0.375rem;
  display: none;
  cursor: pointer;
}
.impact-save-btn:hover {
  background: #d97706;
}
.impact-save-btn.visible {
  display: inline-block;
}

/* --- Slippage rules: read-mode row --- */
.rule-row-view td {
  cursor: pointer;
}
.rule-row-view:hover {
  background: #1f2937;
}

/* --- Slippage rules: edit-mode row --- */
.rule-row-edit {
  background: #1e293b;
}
.rule-row-edit td {
  border-bottom-color: #334155;
}

.zone-input {
  text-align: center;
}

/* --- Status badges --- */
.status-badge {
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  font-weight: 600;
  text-transform: capitalize;
  display: inline-block;
}
.status-expected {
  background: #065f46;
  color: #6ee7b7;
}
.status-probable {
  background: #1e3a5f;
  color: #93c5fd;
}
.status-questionable {
  background: #713f12;
  color: #fcd34d;
}
.status-doubtful {
  background: #7c2d12;
  color: #fdba74;
}
.status-out {
  background: #7f1d1d;
  color: #fca5a5;
}
.status-unknown {
  background: #1f2937;
  color: #6b7280;
}

/* --- Star player purple text --- */
.player-star {
  color: #c084fc;
  font-weight: 500;
}

/* --- Game cards --- */
.game-card {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 0.5rem;
  padding: 1rem;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.game-card:hover {
  background: #2d3748;
  border-color: #4b5563;
}
.game-card.expanded {
  border-color: #3b82f6;
}
.game-card-detail {
  display: none;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #374151;
}
.game-card.expanded .game-card-detail {
  display: block;
}

/* --- Simulation result cards --- */
.sim-card {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 0.5rem;
  padding: 1rem;
}
.sim-card-actionable {
  border-color: #065f46;
}
.sim-card-not-actionable {
  border-color: #713f12;
}

/* --- Orderbook mini table --- */
.ob-table {
  font-size: 0.75rem;
  border-collapse: collapse;
  width: 100%;
}
.ob-table th {
  text-align: left;
  padding: 0.25rem 0.5rem;
  color: #9ca3af;
  font-size: 0.65rem;
  text-transform: uppercase;
  border-bottom: 1px solid #374151;
}
.ob-table td {
  padding: 0.25rem 0.5rem;
  border-bottom: 1px solid #1f2937;
}

/* --- Toggle switch --- */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  cursor: pointer;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #4b5563;
  border-radius: 9999px;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  bottom: 3px;
  width: 20px;
  height: 20px;
  background: #f3f4f6;
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider {
  background: #22c55e;
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}
.toggle-switch:hover .toggle-slider {
  box-shadow: 0 0 0 2px #3b82f640;
}

/* --- Log filter dropdown --- */
.log-filter-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.1s;
}
.log-filter-item:hover {
  background: #374151;
}
.log-filter-item label {
  cursor: pointer;
  flex: 1;
  color: #e5e7eb;
}
.log-filter-item input[type='checkbox'] {
  accent-color: #3b82f6;
}
