* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f0f0f;
  color: #f5f5f5;
  min-height: 100vh;
}

.app-header {
  background: #1a1a1a;
  border-bottom: 1px solid #2a2a2a;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-header h1 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.header-actions { display: flex; gap: 8px; }

.btn {
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn:hover { background: #2563eb; }
.btn-secondary { background: #2a2a2a; color: #ccc; }
.btn-secondary:hover { background: #333; color: #fff; }
.btn-danger { background: #ef4444; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 5px 10px; font-size: 0.78rem; }

.container { max-width: 1100px; margin: 0 auto; padding: 24px; }

/* Summary stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 16px;
}

.stat-card .label { font-size: 0.75rem; color: #888; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.stat-card .value { font-size: 1.4rem; font-weight: 700; }
.stat-card .value.positive { color: #22c55e; }
.stat-card .value.negative { color: #ef4444; }

/* Table */
.items-table-wrap { background: #1a1a1a; border-radius: 12px; border: 1px solid #2a2a2a; overflow: hidden; }

.items-table { width: 100%; border-collapse: collapse; }
.items-table th {
  background: #1f1f1f;
  padding: 12px 16px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid #2a2a2a;
  white-space: nowrap;
}
.items-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #1e1e1e;
  font-size: 0.875rem;
  vertical-align: middle;
}
.items-table tr:last-child td { border-bottom: none; }
.items-table tr:hover td { background: #161616; }

.items-table .item-name { font-weight: 600; color: #fff; }
.items-table .category-badge {
  background: #2a2a2a;
  color: #aaa;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.72rem;
}
.items-table .status-badge {
  border-radius: 4px;
  padding: 3px 9px;
  font-size: 0.72rem;
  font-weight: 600;
}
.status-in_stock { background: #065f46; color: #34d399; }
.status-sold { background: #7c2d12; color: #fb923c; }
.status-reserved { background: #1e1b4b; color: #a5b4fc; }

.condition-badge {
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 600;
}
.condition-new { background: #14532d; color: #86efac; }
.condition-like_new { background: #1e3a5f; color: #93c5fd; }
.condition-good { background: #2a2a2a; color: #aaa; }
.condition-fair { background: #3b2a00; color: #fbbf24; }

.margin-positive { color: #22c55e; font-weight: 600; }
.margin-negative { color: #ef4444; font-weight: 600; }
.margin-none { color: #555; }

.actions-cell { display: flex; gap: 6px; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal-overlay.hidden { display: none; }

.modal {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 14px;
  padding: 28px;
  width: 480px;
  max-width: 95vw;
}
.modal h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 20px; color: #fff; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 0.78rem; color: #888; margin-bottom: 5px; font-weight: 500; }
.form-group input, .form-group select {
  width: 100%;
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 7px;
  padding: 9px 12px;
  font-size: 0.875rem;
  color: #f5f5f5;
  outline: none;
  transition: border-color 0.15s;
}
.form-group input:focus, .form-group select:focus { border-color: #3b82f6; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: #555;
}
.empty-state p { margin-top: 10px; font-size: 0.875rem; }

@media (max-width: 700px) {
  .items-table th:nth-child(4), .items-table td:nth-child(4),
  .items-table th:nth-child(5), .items-table td:nth-child(5) { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}