.category-page {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: clamp(12px, 1.5vw, 24px);
}

.category-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 132px;
  padding: 22px 24px;
  border-radius: 18px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, .96), rgba(20, 116, 106, .94)),
    #0f172a;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .18);
}

.category-kicker {
  display: inline-flex;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
  color: #b7f7ed;
}

.category-hero h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 38px);
  font-weight: 900;
}

.category-hero p {
  max-width: 680px;
  margin: 8px 0 0;
  color: rgba(255, 255, 255, .82);
}

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

.category-hero .btn {
  min-height: 42px;
  border: 0;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .18);
}

.category-grid {
  display: grid;
  grid-template-columns: minmax(330px, 420px) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.category-panel {
  overflow: hidden;
  border: 1px solid #e4eaf2;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .07);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid #edf1f6;
  background: linear-gradient(180deg, #fff, #f8fafc);
}

.panel-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  color: #0f172a;
}

.panel-head p {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 13px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  font-size: 12px;
  font-weight: 900;
}

.form-stack {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.field-box {
  display: grid;
  gap: 7px;
  margin: 0;
}

.field-box > span,
.category-switch strong {
  color: #243044;
  font-size: 13px;
  font-weight: 900;
}

.field-box small,
.category-switch small {
  color: #64748b;
  font-size: 12px;
}

.category-page .form-control,
.category-page .form-select,
.category-page .select2-container .select2-selection--single {
  min-height: 42px;
  border-color: #dbe3ef;
  border-radius: 12px;
}

.category-page .select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 40px;
}

.category-page .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 40px;
}

.category-switch {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e4eaf2;
  border-radius: 14px;
  background: #f8fafc;
}

.category-switch span {
  display: grid;
  gap: 3px;
}

.form-actions {
  display: flex;
  gap: 10px;
  padding: 0 16px 16px;
  flex-wrap: wrap;
}

.form-actions .btn {
  min-height: 40px;
  border-radius: 11px;
  font-weight: 800;
}

.list-head {
  align-items: center;
}

.category-search {
  position: relative;
  width: min(420px, 100%);
}

.category-search i {
  position: absolute;
  top: 50%;
  inset-inline-start: 13px;
  transform: translateY(-50%);
  color: #64748b;
}

.category-search input {
  width: 100%;
  min-height: 42px;
  padding: 8px 42px 8px 12px;
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  background: #fff;
  outline: 0;
}

.category-search input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

.category-table-wrap {
  max-width: 100%;
  overflow: auto;
}

.category-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.category-table th {
  padding: 12px 14px;
  color: #334155;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  border-bottom: 1px solid #dfe7f1;
}

.category-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #edf1f6;
  vertical-align: middle;
}

.category-table tr {
  cursor: pointer;
}

.category-table tbody tr:hover td {
  background: #f1f7ff;
}

.cat-code {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 8px;
  color: #1d4ed8;
  background: #eff6ff;
  font-weight: 900;
}

.cat-name {
  color: #0f172a;
  font-weight: 900;
}

.cat-parent {
  color: #64748b;
}

.cat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.cat-badge.active {
  color: #047857;
  background: #d1fae5;
}

.cat-badge.inactive {
  color: #475569;
  background: #e2e8f0;
}

.cat-empty {
  padding: 34px 16px;
  color: #64748b;
  text-align: center;
}

.category-option-main {
  color: #111827;
  font-weight: 800;
}

.category-option-meta {
  margin-top: 2px;
  color: #64748b;
  font-size: 12px;
}

.select2-container--default .select2-results__option--highlighted .category-option-main,
.select2-container--default .select2-results__option--highlighted .category-option-meta {
  color: #fff;
}

@media (max-width: 1100px) {
  .category-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .category-page {
    padding: 10px;
  }

  .category-hero,
  .panel-head,
  .list-head {
    align-items: stretch;
    flex-direction: column;
  }

  .category-hero-actions,
  .category-hero-actions .btn,
  .category-search,
  .form-actions .btn {
    width: 100%;
  }
}
