* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f7f9;
  color: #17202a;
}

.page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px 14px 56px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 22px;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  letter-spacing: -0.04em;
}

h2 {
  margin: 0 0 14px;
  font-size: 1.25rem;
}

.eyebrow {
  margin: 0 0 6px;
  color: #5b6b7a;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
}

.version-note {
  display: inline-block;
  margin: 10px 0 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: #17202a;
  color: white;
  font-weight: 800;
}

.lede {
  max-width: 800px;
  color: #44515f;
  line-height: 1.55;
  font-size: 1.05rem;
}

.card {
  background: white;
  border: 1px solid #e0e5eb;
  border-radius: 18px;
  padding: 18px;
  margin: 18px 0;
  box-shadow: 0 12px 32px rgba(23, 32, 42, 0.06);
}

.file-box,
.category-toolbar label {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid #d8dee6;
  border-radius: 14px;
  background: #fbfcfd;
  font-weight: 700;
}

input,
select {
  font: inherit;
}

input[type="file"],
input[type="text"],
input[type="number"],
select {
  width: 100%;
  padding: 8px;
  border: 1px solid #cdd5df;
  border-radius: 10px;
  background: white;
}

input.money {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.actions.tight {
  margin-top: 0;
}

button,
.button-link {
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  background: #1f6feb;
  color: white;
  text-decoration: none;
  display: inline-block;
}

button.secondary {
  background: #e7edf5;
  color: #17202a;
}

button.danger {
  background: #b42318;
  color: white;
}

button.restore {
  background: #198754;
  color: white;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.hero-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.status {
  margin: 14px 0 0;
  color: #44515f;
  font-weight: 700;
}

.muted {
  color: #5b6b7a;
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.category-toolbar {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 14px;
  margin: 16px 0;
}

.warning {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-weight: 700;
  line-height: 1.45;
}

.table-wrap {
  overflow: auto;
  border: 1px solid #e0e5eb;
  border-radius: 14px;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 1180px;
  font-size: 0.88rem;
}

th,
td {
  padding: 8px;
  border-bottom: 1px solid #e9edf2;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f1f4f8;
  position: sticky;
  top: 0;
  z-index: 1;
}

td.actions-cell {
  white-space: nowrap;
}

.status-pill {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #067647;
  font-weight: 800;
}

.status-pill.deleted {
  background: #fee4e2;
  color: #b42318;
}

.status-pill.new {
  background: #eef4ff;
  color: #1f6feb;
}

.deleted-row {
  opacity: 0.6;
  background: #fff8f7;
}

.used-yes {
  color: #067647;
  font-weight: 800;
}

.used-no {
  color: #667085;
}

ul {
  margin-bottom: 0;
  line-height: 1.6;
}

@media (max-width: 800px) {
  .hero,
  .section-header,
  .category-toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }
}


.order-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}

.order-buttons button {
  padding: 6px 9px;
  font-size: 0.85rem;
}

.order-buttons button:disabled {
  opacity: 0.35;
}


/* v22: wider categories maintenance layout */
#categoriesTable input[type="text"],
#categoriesTable input[type="number"],
#categoriesTable select {
  padding: 8px;
}

#categoriesTable th:nth-child(1),
#categoriesTable td:nth-child(1) {
  width: 80px;
}

#categoriesTable th:nth-child(2),
#categoriesTable td:nth-child(2) {
  min-width: 230px;
}

#categoriesTable th:nth-child(3),
#categoriesTable td:nth-child(3) {
  width: 120px;
}

#categoriesTable th:nth-child(4),
#categoriesTable td:nth-child(4),
#categoriesTable th:nth-child(5),
#categoriesTable td:nth-child(5) {
  width: 130px;
}

#categoriesTable th:nth-child(6),
#categoriesTable td:nth-child(6) {
  width: 140px;
}

#categoriesTable th:nth-child(7),
#categoriesTable td:nth-child(7) {
  width: 70px;
}

#categoriesTable th:nth-child(8),
#categoriesTable td:nth-child(8) {
  width: 95px;
}

#categoriesTable th:nth-child(9),
#categoriesTable td:nth-child(9) {
  width: 90px;
}
