/* Uses CSS variables from base.css for light/dark theming */

.btn {
  appearance: none;
  border: 1px solid rgba(0,0,0,.15);
  background: var(--surface);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
}
.btn:hover { 
  filter: brightness(0.98); 
}

.btn:active { 
  transform: translateY(1px); 
}

.btn-danger { 
  border-color: rgba(220, 20, 60, .35); 
}

.btn-primary { 
  border-color: rgba(0, 119, 204, .35); 
}

.fullwidth { 
  width: 100%; 
}

.muted {
  color: var(--muted);
  margin-top: 6px;
  font-size: 0.95rem;
}

/* ===== TOP controls layout ===== */
.top-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: end;
}
.top-field { display: grid; gap: 6px; }
.top-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Table */
.table-wrap { 
  overflow-x: auto; 
}

.inventory-table { 
  width: 100%; 
  border-collapse: separate; 
  border-spacing: 0 0; 
}

.inventory-table th, .inventory-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,0,0,.08);
  vertical-align: middle;
}
.inventory-table thead th { 
  text-align: left; 
  font-weight: 800; 
}

.inventory-table td.qty { 
  text-align: right; 
  white-space: nowrap; 
}

.inventory-table tfoot td { 
  padding-top: 14px; 
  border-bottom: none; 
}

/* Inputs & controls */
.input-name {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.15);
  background: var(--surface);
  color: var(--text);
}
.input-name[readonly] { 
  opacity: .9; 
  cursor: not-allowed; 
}

.controls { 
  display: inline-flex; 
  align-items: center; 
  gap: 8px; 
}

.ctrl-btn {
  border: 1px solid rgba(0,0,0,.15);
  background: var(--surface);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 800;
  min-width: 2.25rem;
}
.ctrl-btn:active { 
  transform: translateY(1px); 
}

/* Disabled minus button */
.ctrl-btn:disabled { 
  opacity: 0.5; 
  cursor: not-allowed; 
}

/* ===== Section separators (special rows) ===== */
.row-separator td {
  padding: 1px 0 8px;
  border: none;
  text-align: center;
  background: rgba(0, 119, 204, 0.24);
}
.sep-line {
  height: 0;
  background: rgba(0,0,0,0.12);
  margin: 8px 0 4px;
}
.sep-label {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.95rem;
  letter-spacing: 0.10em;
}
body.dark .sep-line { 
  background: rgba(255,255,255,0.18); 
}

/* Mobile tweaks */
@media (max-width: 800px) {
  .top-grid { 
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .inventory-table th:nth-child(3),
  .inventory-table td:nth-child(3) { width: 1%; }
}
