.category-list-page,
.category-editor-page {
  display: grid;
  gap: 20px;
}

.category-list-page .page-heading,
.category-editor-page .page-heading {
  margin-bottom: 0;
}

.category-create-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.category-create-action svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.category-section-switcher {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
}

.category-section-switcher > a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 14px 16px;
  border-right: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  transition: background .18s;
}

.category-section-switcher > a:last-child {
  border-right: 0;
}

.category-section-switcher > a:hover,
.category-section-switcher > a.active {
  background: color-mix(in srgb, var(--surface) 86%, var(--teal-soft));
}

.category-section-switcher > a.active {
  box-shadow: inset 0 -3px var(--teal);
}

.category-section-switcher svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: var(--teal);
  stroke-width: 1.8;
}

.category-section-switcher span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.category-section-switcher strong {
  font-size: 11px;
}

.category-section-switcher small {
  color: var(--muted);
  font-size: 9px;
}

.category-inline-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
}

.category-inline-summary span {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.category-inline-summary strong {
  color: var(--ink);
  font: 750 14px "Manrope";
}

.category-inline-summary i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--teal);
}

.category-directory-list {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--premium-shadow);
}

.category-list-columns,
.category-list-row {
  display: grid;
  grid-template-columns: minmax(245px, 1.2fr) minmax(180px, .8fr) minmax(220px, 1fr) auto 54px auto;
  align-items: center;
  gap: 18px;
}

.category-list-columns {
  padding: 11px 17px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.category-list-row {
  min-width: 0;
  padding: 16px 17px;
  border-bottom: 1px solid var(--line);
  transition: background .18s;
}

.category-list-row:last-child {
  border-bottom: 0;
}

.category-list-row:hover {
  background: color-mix(in srgb, var(--surface) 91%, var(--teal-soft));
}

.category-list-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.category-list-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--teal-soft);
  color: var(--teal);
}

.category-list-icon.attention {
  background: #e8f1fb;
  color: #226da6;
}

.category-list-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.category-list-identity > span:last-child,
.category-list-purpose,
.category-list-associations {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.category-list-identity small {
  color: var(--muted);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .08em;
}

.category-list-identity strong {
  font: 750 13px "Manrope";
}

.category-list-identity p,
.category-list-purpose small {
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-list-purpose strong {
  font-size: 10px;
}

.category-list-associations span {
  overflow: hidden;
  font-size: 9px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-list-associations small {
  color: var(--teal);
  font-size: 8px;
  font-weight: 750;
}

.category-list-associations em {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
}

.category-list-row > .status-pill {
  justify-self: start;
  white-space: nowrap;
}

.category-sort-order {
  text-align: center;
  font-size: 11px;
}

.category-list-empty {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 15px;
  background: var(--surface);
}

.category-list-empty h2 {
  margin: 0 0 4px;
  font: 750 16px "Manrope";
}

.category-list-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.category-editor-form {
  gap: 18px;
}

.category-assignment-editor {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
}

.category-assignment-editor > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.category-assignment-editor h2 {
  margin: 0 0 4px;
  font: 750 15px "Manrope";
}

.category-assignment-editor header p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}

.category-assignment-editor header > span {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 8px;
  font-weight: 800;
  white-space: nowrap;
}

.category-assignment-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.category-assignment-groups fieldset {
  min-width: 0;
  margin: 0;
  padding: 15px 17px 17px;
  border: 0;
  border-right: 1px solid var(--line);
}

.category-assignment-groups fieldset:last-child {
  border-right: 0;
}

.category-assignment-groups legend {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 0 10px;
  font-size: 10px;
  font-weight: 800;
}

.category-assignment-groups legend svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--teal);
  stroke-width: 1.8;
}

.category-assignment-groups legend b {
  margin-left: auto;
  color: var(--muted);
  font-size: 9px;
}

.category-assignment-groups fieldset > div {
  display: grid;
  gap: 7px;
}

.category-assignment-groups label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
}

.category-assignment-groups input {
  width: 15px;
  height: 15px;
  margin-top: 2px;
}

.category-assignment-groups label > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.category-assignment-groups label strong {
  font-size: 10px;
}

.category-assignment-groups label small,
.category-assignment-groups fieldset > p,
.category-assignment-empty {
  margin: 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.45;
}

.category-assignment-empty {
  padding: 18px;
}

@media (max-width: 1150px) {
  .category-list-columns {
    display: none;
  }

  .category-list-row {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr) auto;
  }

  .category-list-associations {
    grid-column: 1 / 3;
    padding-top: 10px;
    border-top: 1px solid var(--line);
  }

  .category-sort-order {
    display: none;
  }
}

@media (max-width: 700px) {
  .category-list-page .page-heading > .btn {
    width: 100%;
  }

  .category-section-switcher,
  .category-assignment-groups {
    grid-template-columns: minmax(0, 1fr);
  }

  .category-section-switcher > a,
  .category-assignment-groups fieldset {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .category-section-switcher > a:last-child,
  .category-assignment-groups fieldset:last-child {
    border-bottom: 0;
  }

  .category-list-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }

  .category-list-purpose,
  .category-list-associations {
    grid-column: 1 / -1;
  }

  .category-list-row > .btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .category-list-empty {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .category-list-empty > .btn {
    grid-column: 1 / -1;
    width: 100%;
  }
}
