/* Design tokens live in tokens.css (loaded before this file). */

* {
  box-sizing: border-box;
}


body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--soft);
}

a {
  text-decoration: none;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    linear-gradient(90deg, rgba(23, 5, 31, .94), rgba(75, 20, 111, .82)),
    url("../../banner_uitmmemory.jpg") center top / cover;
  padding: 1.25rem;
}

.auth-shell {
  width: min(100%, 460px);
}

.auth-panel {
  background: rgba(255, 255, 255, .98);
  border-top: 5px solid var(--uitm-gold);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 2rem;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: .85rem;
  color: var(--uitm-purple-dark);
}

.auth-brand:hover {
  color: var(--uitm-purple-dark);
}

.auth-brand strong,
.admin-user span,
.metric-card strong,
.layout-card strong {
  display: block;
}

.auth-brand strong {
  font-size: 1.15rem;
  font-weight: 600;
}

.auth-brand small,
.admin-user small {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
}

.brand-mark {
  width: 56px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: var(--uitm-purple-dark);
  background: linear-gradient(135deg, var(--uitm-gold), #ffe28a);
  border: 1px solid rgba(200, 149, 22, .4);
  font-weight: 700;
  font-size: .9rem;
}

.auth-heading,
.content-heading {
  margin-top: 2rem;
}

.auth-heading p,
.content-heading p,
.work-panel p {
  margin: 0 0 .45rem;
  color: var(--teal);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.auth-heading h1,
.content-heading h1 {
  margin: 0;
  color: var(--uitm-purple-dark);
  font-weight: 600;
  letter-spacing: 0;
}

.auth-form {
  margin-top: 1.5rem;
}

.auth-form label {
  display: block;
  margin-bottom: .45rem;
  font-weight: 600;
}

.auth-form .input-group-text,
.auth-form .form-control {
  border-color: var(--line);
  min-height: 48px;
}

.auth-form .form-control:focus {
  border-color: var(--uitm-purple);
  box-shadow: 0 0 0 .2rem rgba(75, 20, 111, .13);
}

.btn-auth {
  width: 100%;
  margin-top: 1rem;
  border-radius: 8px;
  border: 0;
  background: var(--uitm-purple);
  color: #fff;
  font-weight: 600;
  padding: .75rem 1rem;
}

.btn-auth:hover {
  background: var(--uitm-purple-dark);
  color: #fff;
}

.admin-topbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 1rem 1.5rem;
}

.admin-user {
  display: flex;
  align-items: center;
  gap: .85rem;
  text-align: right;
}

.admin-user .btn {
  background: var(--uitm-purple);
  border-color: var(--uitm-purple);
}

.admin-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: calc(100vh - 78px);
}

.admin-sidebar {
  background: var(--uitm-purple-deep);
  padding: 1rem;
}

.admin-sidebar nav {
  display: grid;
  gap: .35rem;
}

.admin-sidebar a {
  display: flex;
  align-items: center;
  gap: .65rem;
  color: rgba(255, 255, 255, .78);
  border-radius: 8px;
  font-weight: 600;
  padding: .8rem .9rem;
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
  background: rgba(244, 196, 48, .15);
  color: #fff;
}

.admin-content {
  padding: 2rem;
}

.metric-grid,
.layout-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.metric-card,
.layout-card,
.work-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(42, 11, 63, .07);
}

.metric-card {
  padding: 1.25rem;
}

.metric-card span,
.layout-card span {
  color: var(--muted);
  font-size: .9rem;
  font-weight: 600;
}

.metric-card {
  display: grid;
  gap: .35rem;
}

.metric-card strong {
  margin-top: .35rem;
  color: var(--uitm-purple-dark);
  font-size: 2rem;
  line-height: 1;
}


.work-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
  padding: 1.35rem;
}

.work-panel h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.work-panel .btn-auth {
  width: auto;
  margin: 0;
}

.layout-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.layout-card {
  padding: 1.25rem;
}

.layout-card i {
  color: var(--teal);
  font-size: 1.8rem;
}

.layout-card strong {
  margin-top: .8rem;
  margin-bottom: .35rem;
  color: var(--uitm-purple-dark);
}

@media (max-width: 900px) {
  .admin-layout,
  .metric-grid,
  .layout-grid {
    grid-template-columns: 1fr;
  }

  .admin-sidebar nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .auth-panel,
  .admin-content {
    padding: 1.25rem;
  }

  .admin-topbar,
  .admin-user,
  .work-panel {
    align-items: flex-start;
    flex-direction: column;
    text-align: left;
  }

  .admin-sidebar nav {
    grid-template-columns: 1fr;
  }
}


.compact-heading {
  margin-top: 0;
  margin-bottom: 1.25rem;
}

.admin-alert {
  border-radius: 8px;
  margin-bottom: 1rem;
}

.admin-form {
  display: grid;
  gap: 1rem;
  max-width: 1120px;
}

.form-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 10px 24px rgba(42, 11, 63, .05);
}

.form-section-title {
  margin-bottom: 1rem;
  color: var(--uitm-purple-dark);
  font-size: .92rem;
  font-weight: 650;
}

.form-grid {
  display: grid;
  gap: 1rem;
}

.two-col {
  grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr);
}

.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: .4rem;
}

.field.wide {
  grid-column: 1 / -1;
}

.field label {
  color: #3f3449;
  font-size: .9rem;
  font-weight: 600;
}

.admin-form .form-control,
.admin-form .form-select {
  border-color: var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: .95rem;
  min-height: 42px;
}

.admin-form textarea.form-control {
  line-height: 1.6;
  resize: vertical;
}

.admin-form .form-control:focus,
.admin-form .form-select:focus {
  border-color: var(--uitm-purple);
  box-shadow: 0 0 0 .18rem rgba(75, 20, 111, .1);
}

.layout-choice-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .85rem;
}

.layout-choice {
  position: relative;
  min-height: 214px;
  display: grid;
  grid-template-rows: 104px 1fr;
  gap: .8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  padding: .8rem;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.layout-choice:hover {
  border-color: rgba(75, 20, 111, .35);
  box-shadow: 0 10px 24px rgba(42, 11, 63, .06);
}

.layout-choice input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.layout-preview {
  display: grid;
  gap: .45rem;
  border: 1px solid rgba(75, 20, 111, .12);
  border-radius: 8px;
  background: #fbf8fc;
  padding: .6rem;
  overflow: hidden;
}

.preview-hero,
.preview-body span,
.preview-media span {
  display: block;
  border-radius: 4px;
}

.preview-hero {
  min-height: 28px;
  background: linear-gradient(90deg, var(--uitm-purple), var(--teal));
  border-bottom: 3px solid var(--uitm-gold);
}

.preview-body {
  display: grid;
  gap: .28rem;
}

.preview-body span {
  height: 6px;
  background: rgba(35, 21, 46, .18);
}

.preview-body span:nth-child(2) {
  width: 82%;
}

.preview-body span:nth-child(3) {
  width: 58%;
}

.preview-media {
  display: none;
  gap: .3rem;
}

.preview-media span {
  min-height: 18px;
  background: rgba(8, 125, 129, .18);
  border: 1px solid rgba(8, 125, 129, .16);
}

.layout-copy {
  display: grid;
  gap: .3rem;
}

.layout-name {
  color: var(--uitm-purple-dark);
  font-size: .92rem;
  font-weight: 600;
  line-height: 1.25;
}

.layout-desc {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 400;
  line-height: 1.45;
}

.layout-choice:has(input:checked) {
  border-color: rgba(75, 20, 111, .75);
  background: #fffdf4;
  box-shadow: 0 0 0 3px rgba(244, 196, 48, .16);
}

.layout-choice:has(input:checked)::after {
  content: "";
  position: absolute;
  inset-block-start: .75rem;
  inset-inline-end: .75rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--uitm-gold);
  box-shadow: 0 0 0 3px rgba(244, 196, 48, .2);
}

.layout-image_story .layout-preview {
  grid-template-columns: 1.2fr .8fr;
  grid-template-rows: 1fr;
}

.layout-image_story .preview-hero {
  min-height: 72px;
}

.layout-image_story .preview-body {
  align-content: center;
}

.layout-gallery_article .layout-preview {
  grid-template-rows: 28px 1fr;
}

.layout-gallery_article .preview-media {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.layout-gallery_article .preview-body {
  display: none;
}

.layout-archive_record .layout-preview {
  grid-template-columns: .65fr 1.35fr;
  grid-template-rows: 1fr;
}

.layout-archive_record .preview-hero {
  min-height: 72px;
  background: linear-gradient(180deg, var(--uitm-purple), var(--uitm-purple-dark));
}

.layout-archive_record .preview-body {
  align-content: center;
  border-left: 3px solid var(--uitm-gold);
  padding-left: .45rem;
}

.layout-document_focus .layout-preview {
  grid-template-columns: .85fr 1.15fr;
  grid-template-rows: 1fr;
}

.layout-document_focus .preview-hero {
  min-height: 72px;
  background: #fff;
  border: 1px solid rgba(75, 20, 111, .18);
  border-top: 8px solid var(--uitm-gold);
}

.layout-document_focus .preview-body {
  align-content: center;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
}

.form-actions .btn {
  border-radius: 8px;
  min-width: 132px;
  padding: .65rem 1rem;
}

.form-actions .btn-auth {
  width: auto;
  margin: 0;
}

@media (max-width: 1100px) {
  .layout-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .three-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .two-col,
  .three-col,
  .layout-choice-grid {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .form-actions .btn,
  .form-actions .btn-auth {
    width: 100%;
  }
}


.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin: 0 0 1rem;
}

.editor-toolbar .btn {
  border-radius: 8px;
  font-weight: 600;
}

.block-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
  gap: 1rem;
  align-items: start;
  max-width: 1280px;
}

.block-list-panel {
  position: sticky;
  top: 1rem;
}

.block-list {
  display: grid;
  gap: .75rem;
}

.block-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px 42px;
  gap: .75rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf8fc;
  padding: .75rem;
}

.block-row-main {
  min-width: 0;
}

.block-row-main strong,
.block-row-main small,
.block-type {
  display: block;
}

.block-type {
  width: fit-content;
  margin-bottom: .35rem;
  border-radius: 8px;
  background: rgba(8, 125, 129, .1);
  color: var(--teal);
  font-size: .76rem;
  font-weight: 700;
  padding: .18rem .45rem;
}

.block-row-main strong {
  color: var(--uitm-purple-dark);
  font-size: .96rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.block-row-main small,
.block-row-order label,
.empty-block-state p,
.empty-admin-panel p {
  color: var(--muted);
}

.block-row-order {
  display: grid;
  gap: .25rem;
}

.block-row-order label {
  font-size: .76rem;
  font-weight: 700;
}

.block-row .btn {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  padding: 0;
}

.block-actions {
  margin-top: 1rem;
}

.empty-block-state,
.empty-admin-panel {
  border: 1px dashed rgba(75, 20, 111, .22);
  border-radius: 8px;
  background: #fbf8fc;
  padding: 1.25rem;
  text-align: center;
}

.empty-block-state i,
.empty-admin-panel i {
  color: var(--teal);
  font-size: 2rem;
}

.empty-block-state p {
  margin: .6rem 0 0;
  line-height: 1.55;
}

.empty-admin-panel {
  max-width: 680px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(42, 11, 63, .05);
}

.empty-admin-panel h1 {
  margin: .75rem 0 .35rem;
  color: var(--uitm-purple-dark);
  font-weight: 650;
}

.empty-admin-panel .btn-auth {
  width: auto;
}

@media (max-width: 1040px) {
  .block-editor-grid {
    grid-template-columns: 1fr;
  }

  .block-list-panel {
    position: static;
  }
}

@media (max-width: 560px) {
  .block-row {
    grid-template-columns: 1fr;
  }

  .block-row .btn {
    width: 100%;
  }
}


.ai-status {
  min-height: 42px;
  display: flex;
  align-items: center;
  border-radius: 8px;
  font-weight: 650;
  padding: .55rem .75rem;
}

.ai-status.is-ready {
  border: 1px solid rgba(8, 125, 129, .25);
  background: rgba(8, 125, 129, .1);
  color: var(--teal);
}

.ai-status.is-missing {
  border: 1px solid rgba(244, 196, 48, .45);
  background: #fff8df;
  color: #7a5a00;
}

.ai-context-list {
  display: grid;
  gap: .75rem;
}

.ai-context-list div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: .65rem;
}

.ai-context-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.ai-context-list strong {
  color: var(--uitm-purple-dark);
  font-weight: 650;
}

.ai-context-list span {
  color: var(--muted);
  font-weight: 600;
  text-align: right;
}

.ai-draft-panel {
  max-width: 1280px;
  margin-top: 1rem;
}

.ai-draft-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: .85rem;
}

.ai-draft-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf8fc;
  padding: .9rem;
}

.ai-draft-card strong,
.ai-draft-card small {
  display: block;
}

.ai-draft-card strong {
  margin-top: .55rem;
  color: var(--uitm-purple-dark);
  font-size: 1rem;
  font-weight: 650;
}

.ai-draft-card small {
  margin-top: .25rem;
  color: var(--muted);
  font-weight: 600;
}

.ai-draft-card p {
  margin: .65rem 0 0;
  color: #3f3449;
  line-height: 1.55;
}

.recent-items-panel {
  max-width: 1280px;
  margin-top: 1.25rem;
}

.recent-items-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.recent-items-title .btn,
.recent-item-actions .btn {
  border-radius: 8px;
  font-weight: 600;
}

.recent-items-list {
  display: grid;
  gap: .75rem;
}

.recent-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf8fc;
  padding: .85rem;
}

.recent-item-main {
  min-width: 0;
}

.recent-item-main strong,
.recent-item-main span {
  display: block;
}

.recent-item-main strong {
  color: var(--uitm-purple-dark);
  font-weight: 650;
  overflow-wrap: anywhere;
}

.recent-item-main span {
  margin-top: .25rem;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 600;
}

.recent-item-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .5rem;
}

@media (max-width: 760px) {
  .recent-items-title,
  .recent-item-row,
  .recent-item-actions {
    align-items: stretch;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .recent-items-title {
    flex-direction: column;
  }

  .recent-item-actions .btn,
  .recent-items-title .btn {
    width: 100%;
  }
}

.screen-links-panel {
  max-width: 1280px;
  margin-top: 1rem;
}

.screen-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: .65rem;
}

.screen-links-grid a {
  display: flex;
  align-items: center;
  gap: .55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf8fc;
  color: var(--uitm-purple-dark);
  font-weight: 650;
  padding: .7rem .8rem;
}

.screen-links-grid a:hover {
  border-color: rgba(75, 20, 111, .35);
  background: #fffdf4;
  color: var(--uitm-purple-dark);
}

.screen-links-grid i {
  color: var(--teal);
}

.admin-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.admin-heading-row .btn-auth,
.heading-actions .btn,
.work-actions .btn {
  width: auto;
  margin: 0;
  border-radius: 8px;
  font-weight: 600;
}

.heading-actions,
.work-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .55rem;
}

.article-filter-panel,
.article-list-panel {
  max-width: 1320px;
  margin-bottom: 1rem;
}

.article-filter-title,
.article-list-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.article-filter-title a,
.article-list-title small {
  color: var(--muted);
  font-size: .86rem;
  font-weight: 650;
}

.article-filter-grid {
  grid-template-columns: minmax(240px, 1.5fr) repeat(5, minmax(140px, 1fr));
  align-items: end;
}

.filter-submit .btn-auth {
  width: 100%;
  margin: 0;
  min-height: 42px;
}

.article-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.article-admin-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.article-admin-table th,
.article-admin-table td {
  border-bottom: 1px solid var(--line);
  padding: .85rem .75rem;
  vertical-align: top;
}

.article-admin-table th {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.article-admin-table td {
  color: var(--ink);
  font-size: .92rem;
}

.article-admin-table tbody tr:hover {
  background: #fbf8fc;
}

.article-admin-table td strong,
.article-admin-table td span {
  display: block;
  max-width: 420px;
  overflow-wrap: anywhere;
}

.article-admin-table td strong {
  color: var(--uitm-purple-dark);
  font-weight: 650;
}

.article-admin-table td span:not(.status-pill) {
  margin-top: .2rem;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
}

.status-pill {
  width: fit-content;
  border-radius: 8px;
  font-size: .76rem;
  font-weight: 750;
  padding: .28rem .5rem;
}

.status-draft {
  background: #f3edf7;
  color: var(--uitm-purple-dark);
}

.status-published {
  background: #dff7f3;
  color: #055d60;
}

.article-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  min-width: 300px;
}

.article-row-actions form {
  margin: 0;
}

.article-row-actions .btn {
  border-radius: 8px;
  font-weight: 600;
}

.edit-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}

.edit-image-grid figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf8fc;
  padding: .5rem;
}

.edit-image-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
}

.edit-image-grid figcaption {
  margin-top: .45rem;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
  .article-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filter-search {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .admin-heading-row,
  .heading-actions,
  .work-actions,
  .article-filter-title,
  .article-list-title {
    flex-direction: column;
    align-items: stretch;
  }

  .article-filter-grid {
    grid-template-columns: 1fr;
  }

  .admin-heading-row .btn,
  .heading-actions .btn,
  .work-actions .btn {
    width: 100%;
  }

  .article-admin-table,
  .article-admin-table thead,
  .article-admin-table tbody,
  .article-admin-table th,
  .article-admin-table td,
  .article-admin-table tr {
    display: block;
    min-width: 0;
  }

  .article-admin-table thead {
    display: none;
  }

  .article-admin-table tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: .75rem;
    overflow: hidden;
  }

  .article-admin-table td {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: .75rem;
    border-bottom: 1px solid var(--line);
  }

  .article-admin-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: .76rem;
    font-weight: 750;
    text-transform: uppercase;
  }

  .article-admin-table td:last-child {
    border-bottom: 0;
  }

  .article-row-actions {
    min-width: 0;
  }

  .article-row-actions .btn,
  .article-row-actions form,
  .article-row-actions button {
    width: 100%;
  }
}

.category-admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  max-width: 1120px;
  margin-bottom: 1rem;
}

.category-admin-grid .admin-form {
  max-width: none;
}

.compact-fields {
  grid-template-columns: minmax(120px, .7fr) minmax(160px, 1fr);
}

.category-list-panel {
  max-width: 1320px;
}

.category-admin-table .form-control,
.category-admin-table .form-select {
  border-color: var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: .9rem;
  min-height: 38px;
}

.inline-category-form,
.inline-subcategory-form {
  display: grid;
  gap: .5rem;
  margin: 0;
}

.inline-subcategory-form {
  grid-template-columns: minmax(150px, .9fr) minmax(180px, 1fr) 82px minmax(110px, .75fr) 42px;
  align-items: center;
}

.subcategory-stack {
  display: grid;
  gap: .55rem;
  min-width: 680px;
}

.sort-input {
  max-width: 92px;
}

.muted-inline {
  color: var(--muted);
  font-size: .86rem;
  font-weight: 600;
}

.form-text a {
  color: var(--teal);
  font-weight: 650;
}

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

  .inline-subcategory-form {
    grid-template-columns: 1fr;
  }

  .subcategory-stack {
    min-width: 0;
  }

  .sort-input {
    max-width: none;
  }
}

.collection-create-panel {
  max-width: 1120px;
  margin-bottom: 1rem;
}

.collection-list-panel {
  max-width: 1320px;
}

.collection-admin-table .form-control,
.collection-admin-table .form-select {
  border-color: var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: .9rem;
  min-height: 38px;
}

.inline-collection-form {
  display: contents;
}

.icon-input {
  min-width: 130px;
}

@media (max-width: 760px) {
  .inline-collection-form {
    display: grid;
    gap: .55rem;
  }
}

.collection-icon-cell {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 210px;
}

.collection-icon-cell i {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--uitm-purple-dark);
  background: #fbf8fc;
  font-size: 1rem;
  flex: 0 0 auto;
}

.wysiwyg-editor {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.wysiwyg-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  border-bottom: 1px solid var(--line);
  background: #fbf8fc;
  padding: .55rem;
}

.wysiwyg-toolbar button {
  min-width: 34px;
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(75, 20, 111, .16);
  border-radius: 8px;
  background: #fff;
  color: var(--uitm-purple-dark);
  font-size: .86rem;
  font-weight: 700;
}

.wysiwyg-toolbar button:hover {
  border-color: rgba(75, 20, 111, .36);
  background: #fffdf4;
}

.wysiwyg-surface {
  min-height: 260px;
  padding: .95rem 1rem;
  color: var(--ink);
  font-size: .96rem;
  line-height: 1.7;
  outline: 0;
  overflow-wrap: anywhere;
}

.wysiwyg-surface:focus {
  box-shadow: inset 0 0 0 .18rem rgba(75, 20, 111, .1);
}

.wysiwyg-surface :where(h2, h3, h4, p, ul, ol, blockquote) {
  margin-top: 0;
}

.wysiwyg-surface blockquote {
  border-left: 4px solid var(--uitm-gold);
  color: var(--uitm-purple-dark);
  margin-left: 0;
  padding-left: 1rem;
}

.wysiwyg-source {
  display: none;
}

.wysiwyg-toolbar .wysiwyg-select {
  min-height: 34px;
  max-width: 170px;
  border: 1px solid rgba(75, 20, 111, .16);
  border-radius: 8px;
  background: #fff;
  color: var(--uitm-purple-dark);
  font-size: .86rem;
  font-weight: 650;
  padding: .35rem .6rem;
}

.wysiwyg-toolbar .wysiwyg-select.compact {
  max-width: 120px;
}

@media (max-width: 640px) {
  .wysiwyg-toolbar .wysiwyg-select,
  .wysiwyg-toolbar .wysiwyg-select.compact {
    max-width: none;
    flex: 1 1 140px;
  }
}


.wysiwyg-surface img {
  max-width: 100%;
}

.wysiwyg-image-frame {
  display: inline-block;
  max-width: 100%;
  min-width: 90px;
  min-height: 70px;
  margin: .35rem .5rem .35rem 0;
  resize: horizontal;
  overflow: auto;
  vertical-align: top;
  border: 1px dashed rgba(75, 20, 111, .28);
  border-radius: 8px;
  background: #fbf8fc;
  cursor: ew-resize;
}

.wysiwyg-image-frame.is-selected,
.wysiwyg-image-frame:focus {
  outline: 3px solid rgba(75, 20, 111, .18);
  border-color: var(--uitm-purple);
}

.wysiwyg-image-frame img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.wysiwyg-surface table {
  width: 100%;
  border-collapse: collapse;
  margin: .75rem 0 1rem;
  table-layout: fixed;
}

.wysiwyg-surface th,
.wysiwyg-surface td {
  min-width: 80px;
  border: 1px solid rgba(75, 20, 111, .22);
  padding: .5rem;
  vertical-align: top;
}

.wysiwyg-surface th {
  background: #fbf8fc;
  color: var(--uitm-purple-dark);
  font-weight: 800;
}

.wysiwyg-table-dialog {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  text-align: left;
}

.wysiwyg-table-dialog label {
  display: grid;
  gap: .35rem;
  color: var(--uitm-purple-dark);
  font-weight: 700;
}

.wysiwyg-table-dialog input {
  width: 100%;
  border: 1px solid rgba(75, 20, 111, .2);
  border-radius: 8px;
  padding: .45rem .55rem;
}

.admin-inline-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: .5rem;
  min-width: 420px;
}

.admin-inline-form .btn {
  justify-content: center;
}

@media (max-width: 768px) {
  .admin-inline-form {
    grid-template-columns: 1fr;
    min-width: 0;
  }
}
