.categories-page {
  --text-primary: #242934;
  --text-secondary: #606979;
}
.categories-page .orders-page__inner { container: categories / inline-size; }
.categories-page .orders-page__header { align-items: center; }
.categories-page .admin-primary-action { white-space: nowrap; }
.categories-panel {
  min-width: 0;
  border: 1px solid var(--orders-line);
  border-radius: var(--radius-xl);
  background: var(--card-bg);
  box-shadow: var(--orders-shadow);
}
.categories-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
}
.categories-toolbar .products-search { flex: 1 1 0; max-width: 390px; }
.categories-toolbar > p { flex: none; margin: 0; color: var(--text-secondary); font-size: 13px; }
.categories-table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.categories-table :is(th, td) { padding: 11px 14px; text-align: start; vertical-align: middle; }
.categories-table :is(th, td):first-child { padding-inline-start: 18px; }
.categories-table th {
  border-block: 1px solid var(--orders-line);
  background: var(--control-bg);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: var(--admin-weight-medium);
}
.categories-table th:nth-child(2) { width: 25%; }
.categories-table th:nth-child(3) { width: 14%; }
.categories-table th:nth-child(4) { width: 20%; }
.categories-table th:last-child { width: 52px; }
.categories-table td { color: var(--text-primary); font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.categories-table tr + tr td { border-top: 1px solid var(--border-light); }
.category-entry:last-child td:first-child { border-end-start-radius: var(--radius-xl); }
.category-entry:last-child td:last-child { border-end-end-radius: var(--radius-xl); }
.category-entry:is(:hover, :focus-within) td { background: var(--control-bg); }
.category-entry small { display: block; margin-top: 2px; color: var(--text-secondary); font-size: 13px; }
.category-entry__name {
  position: relative; display: inline-flex; align-items: center; gap: 9px;
  max-width: 100%; min-height: 32px; padding: 0; border: 0; border-radius: 3px;
  color: inherit; background: transparent; text-align: start; line-height: inherit;
  font-family: inherit; font-size: 14px; font-weight: var(--admin-weight-medium); overflow-wrap: anywhere;
}
.category-entry__name img { width: 36px; height: 36px; flex: none; border-radius: 6px; object-fit: contain; }
.category-entry__name:hover span { text-decoration: underline; text-underline-offset: 3px; }
.categories-table .category-entry--child td.category-entry__identity { padding-inline-start: 44px; }
.category-entry--child .category-entry__name { font-weight: var(--admin-weight-regular); }
.category-entry--child .category-entry__name::before {
  content: ''; position: absolute; inset-inline-start: -18px; inset-block-end: 50%;
  width: 10px; height: 10px; border-inline-start: 1px solid var(--border); border-block-end: 1px solid var(--border);
  border-end-start-radius: 3px;
}
.category-entry__mobile-label { display: none; }
.category-status { display: inline-flex; align-items: center; gap: 7px; }
.category-status::before { content: ''; flex: 0 0 6px; height: 6px; border-radius: 50%; background: var(--text-tertiary); }
.category-status--visible::before { background: var(--success); }
.categories-table .category-entry__actions { padding-inline: 2px 12px; text-align: end; }
.categories-table .categories-empty { padding: 38px 16px; text-align: center; color: var(--text-secondary); }

@container categories (max-width: 640px) {
  .categories-toolbar { padding: 12px; }
  .categories-table, .categories-table tbody { display: block; }
  .categories-table thead { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }
  .categories-table .category-entry {
    display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .85fr) 32px;
    grid-template-areas: 'name status actions' 'placement priority priority';
    align-items: start; gap: 4px 8px; padding: 12px; border-top: 1px solid var(--border-light);
  }
  .category-entry:is(:hover, :focus-within) { background: var(--control-bg); }
  .categories-table .category-entry td { padding: 0; border: 0; background: transparent; }
  .category-entry__identity { grid-area: name; align-self: center; }
  .category-entry__placement { grid-area: placement; }
  .category-entry__priority { grid-area: priority; }
  .category-entry__status { grid-area: status; align-self: center; }
  .category-entry__actions { grid-area: actions; }
  .categories-table .category-entry--child td.category-entry__identity { padding-inline-start: 18px; }
  .category-entry__mobile-label { display: block; color: var(--text-secondary); font-size: 12px; }
  .categories-empty { display: block; }
}
@container categories (max-width: 350px) {
  .categories-toolbar { flex-wrap: wrap; }
  .categories-toolbar .products-search { flex-basis: 100%; max-width: none; }
}
