/* Task-oriented navigation uses the established management palette. */
.admin-breadcrumb {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 20px;
  min-height: 44px;
}

.admin-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 14px;
}

.admin-breadcrumb li + li::before {
  content: "/";
  color: #8a9bae;
  margin-right: 8px;
}

.admin-breadcrumb a {
  color: #52677d;
  text-decoration: none;
}

.admin-breadcrumb a:hover {
  color: var(--blue);
}

.admin-breadcrumb a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

@media (max-width: 600px) {
  .admin-breadcrumb {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
  }
}

.admin-body .workspace-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-padding-inline: 8px;
  padding: 4px 3px 12px;
  margin: 0 0 24px;
  border-bottom: 1px solid var(--line);
}

.admin-body .workspace-tabs:empty {
  display: none;
}

.workspace-tabs a {
  display: inline-flex;
  flex-shrink: 0;
  white-space: nowrap;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
  color: #40566d;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 550;
}

.workspace-tabs a:hover {
  background: #eaf2fd;
  color: var(--blue);
}

.workspace-tabs a[aria-current="page"] {
  color: var(--blue);
  background: #eaf2fd;
  box-shadow: inset 0 -2px var(--blue);
}

.workspace-tabs a:focus-visible,
.admin-account-menu summary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.admin-account-menu {
  position: relative;
}

.admin-account-menu > summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  list-style: none;
}

.admin-account-menu > summary::-webkit-details-marker {
  display: none;
}

.admin-account-popover {
  position: absolute;
  right: 0;
  top: 100%;
  width: 156px;
  padding: 8px;
  background: #11263e;
  border-radius: 4px;
  box-shadow: 0 8px 24px #11263e33;
  z-index: 100;
}

.admin-header .admin-account-popover a,
.admin-header .admin-account-popover button {
  display: block;
  width: 100%;
  text-align: left;
  min-height: 44px;
  padding: 12px;
  color: #fff;
}

.admin-account-popover :is(a, button):hover {
  background: #223c58;
}

.history-details > summary {
  cursor: pointer;
  padding: 4px 0;
  min-height: 44px;
  font-size: 18px;
  font-weight: 600;
}

.history-details .form-grid {
  margin-top: 20px;
}

.content-editor-context p {
  margin: 2px 0 24px;
  padding: 12px 16px;
  border-left: 3px solid var(--blue);
  background: #eef5fc;
  color: #405a74;
  line-height: 1.65;
}

.dashboard-intro {
  margin-bottom: 26px;
}

.dashboard-intro p {
  margin-top: 8px;
  color: #5b6e82;
}

.workbench-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.85fr);
  align-items: stretch;
  gap: 24px;
}

.workbench-tasks,
.workbench-shortcuts,
.workbench-summary {
  padding: 28px;
  border: 1px solid #dce5ef;
  border-radius: var(--radius);
  background: #fff;
}

.workbench-section-heading h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.workbench-section-heading p {
  margin: 0 0 20px;
  color: #5b6e82;
  font-size: 14px;
}

.workbench-tasks {
  display: flex;
  flex-direction: column;
}

.workbench-task {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 24px;
  min-height: 96px;
  padding: 16px 0;
  border-top: 1px solid #e2e9f1;
  color: #17324e;
}

.workbench-task-name {
  font-size: 17px;
  font-weight: 600;
}

.workbench-task-name small {
  display: block;
  margin-top: 5px;
  color: #64778b;
  font-size: 13px;
  font-weight: 400;
}

.workbench-task strong {
  color: var(--blue);
  font-size: 28px;
  font-variant-numeric: tabular-nums;
}

.workbench-task-action {
  color: var(--blue);
  white-space: nowrap;
}

.workbench-task:hover .workbench-task-name,
.workbench-task:focus-visible .workbench-task-name {
  color: var(--blue);
}

.workbench-empty {
  margin: 0;
  padding: 22px 0;
  border-top: 1px solid #e2e9f1;
  color: #60748a;
}

.workbench-shortcuts nav {
  display: grid;
  border-top: 1px solid #e2e9f1;
}

.workbench-shortcuts nav a {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  min-height: 44px;
  padding: 10px 0;
  border-bottom: 1px solid #e2e9f1;
  color: #17324e;
}

.workbench-shortcuts nav a:hover,
.workbench-shortcuts nav a:focus-visible {
  color: var(--blue);
}

.workbench-shortcuts nav span {
  color: #7795af;
}

.workbench-summary {
  margin-top: 24px;
}

.workbench-summary-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 28px;
}

.workbench-summary-list a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
  padding: 15px 0;
  border-top: 1px solid #e2e9f1;
  color: #50657b;
}

.workbench-summary-list a:hover,
.workbench-summary-list a:focus-visible {
  color: var(--blue);
}

.workbench-summary-list strong {
  color: #17324e;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.workspace-directory > a {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 56px;
  padding: 12px 0;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.workspace-directory > a:last-child {
  border-bottom: 0;
}

.workspace-directory > a > span:first-of-type {
  margin-left: auto;
  color: #52677d;
  font-size: 14px;
}

.workspace-directory > a > span:last-child {
  color: var(--blue);
}

.content-order-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.content-order-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.content-order-toolbar .button {
  flex-shrink: 0;
  min-height: 44px;
}

.content-order-cell {
  width: 112px;
}

.content-order-cell .content-order-input {
  width: 96px;
  min-height: 44px;
  padding: 8px 10px;
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.content-state-cell {
  white-space: nowrap;
}

.content-state-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  margin-left: 4px;
  padding: 6px 8px;
  border: 0;
  background: transparent;
  color: #155fba;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  vertical-align: middle;
  cursor: pointer;
}

.content-state-action:hover {
  text-decoration: underline;
}

.content-state-action:focus-visible {
  outline: 2px solid #155fba;
  outline-offset: 3px;
}

.content-state-action:disabled {
  cursor: wait;
  opacity: 0.55;
}

@media (max-width: 640px) {
  .content-order-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .content-order-toolbar .button {
    width: 100%;
  }
}

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

  .workbench-summary-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .admin-body .workspace-tabs {
    gap: 4px;
    margin-bottom: 20px;
  }

  .workspace-tabs a {
    font-size: 14px;
    padding: 8px 10px;
  }

  .workbench-tasks,
  .workbench-shortcuts,
  .workbench-summary {
    padding: 20px;
  }

  .workbench-task {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 16px;
  }

  .workbench-task-action {
    grid-column: 1 / -1;
  }

  .workbench-summary-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-account-popover {
    right: 0;
  }
}

/* Search, current state and counts have the same hierarchy across queues. */
.admin-body .admin-filter {
  align-items: flex-end;
}

.admin-body .admin-filter .filter-field {
  margin: 0;
  flex: 0 1 200px;
}

.admin-body .admin-filter .filter-search {
  flex: 1 1 280px;
}

.admin-body .admin-filter .filter-field :is(input, select) {
  width: 100%;
  min-width: 0;
}

.list-summary {
  margin: 0 0 16px;
  color: #40566d;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.admin-body .pagination:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 0;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.admin-body .pagination > :is(a, span) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 12px;
  line-height: 1.5;
}

.admin-body .pagination > a {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--blue);
  text-decoration: none;
}

.admin-body .pagination > span {
  color: var(--muted);
}

.admin-body .pagination > a:is(:hover, :focus-visible) {
  border-color: var(--blue);
  background: var(--admin-hover);
}

.admin-body .pagination > a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.admin-body .inquiry-meta {
  align-items: center;
  flex-wrap: wrap;
}

.status-badge[data-state="NEW"] {
  background: #e9f2ff;
  color: #174e94;
}

.status-badge[data-state="CONTACTED"],
.status-badge[data-state="REVIEWED"] {
  background: #eef4e7;
  color: #3c5c1d;
}

.status-badge[data-state="CLOSED"] {
  background: #edf0f3;
  color: #45576a;
}

.role-permissions > summary {
  cursor: pointer;
  min-height: 44px;
  padding: 10px 0;
  color: #40566d;
}

.role-permissions .permission-tags {
  padding: 8px 0 0;
}

.admin-main .table-scroll:focus-visible,
.role-permissions > summary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.empty-state {
  color: #40566d;
  padding: 20px 0;
}

.admin-body .admin-header :is(.admin-logo, nav > a) {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.admin-body .admin-main .text-link {
  min-width: 44px;
  justify-content: center;
}

.admin-body .page-row-actions {
  flex-wrap: wrap;
  gap: 8px 16px;
}

.admin-body .page-delete-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  color: #a32323;
}

:is(.page-delete-dialog, .admin-confirm-dialog) {
  width: 420px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 16px 40px #10263d26;
}

:is(.page-delete-dialog, .admin-confirm-dialog)::backdrop {
  background: #10263d80;
}

:is(.page-delete-dialog, .admin-confirm-dialog) h2 {
  margin: 0;
  font-size: 20px;
}

:is(.page-delete-dialog, .admin-confirm-dialog) p {
  margin: 16px 0;
  overflow-wrap: anywhere;
}

:is(.page-delete-dialog-actions, .admin-confirm-actions) {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin: 24px 0 0;
}

:is(.page-delete-dialog .page-delete-confirm, .admin-confirm-danger) {
  background: #a32323;
  color: #fff;
}

:is(.page-delete-dialog .page-delete-confirm, .admin-confirm-danger):hover {
  background: #851b1b;
}

@media (max-width: 640px) {
  .admin-body .admin-filter .filter-field {
    flex: 1 1 100%;
  }

  .admin-body .admin-filter .filter-search {
    flex-basis: 100%;
  }

  .admin-body .inquiry-heading {
    flex-wrap: wrap;
    gap: 8px;
  }

  .admin-body .inquiry-heading h2 {
    overflow-wrap: anywhere;
  }
}

@media (max-width: 360px) {
  .admin-header nav > a[aria-label="查看官网"] {
    min-width: 44px;
    justify-content: center;
  }

  .admin-header nav > a[aria-label="查看官网"] > span {
    display: none;
  }
}

.brand-section-index {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.brand-section-index a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.brand-section-index a:hover {
  background: var(--soft);
  color: var(--blue);
}

.brand-language-section {
  margin-bottom: 36px;
  scroll-margin-top: 100px;
}

.brand-settings .brand-language-section h2 {
  margin-bottom: 0;
}

.brand-paired-field {
  padding: 20px 0 24px;
  border-bottom: 1px solid var(--line);
}

.brand-paired-field h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.brand-paired-field .form-grid {
  margin-bottom: 0;
}

.brand-paired-field label > span {
  display: block;
  margin-bottom: 6px;
}

.brand-paired-field label {
  margin-bottom: 0;
  min-width: 0;
}

.fixed-language {
  display: flex;
  gap: 24px;
  padding: 16px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.directory-table small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.directory-table .directory-url {
  overflow-wrap: anywhere;
}

.directory-table th:last-child {
  width: 160px;
}

.directory-table .page-row-actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 12px;
}

.directory-table .page-row-actions form {
  margin: 0;
}

.directory-table .page-delete-button {
  border: 0;
  background: transparent;
  padding: 8px;
  font: inherit;
}

.site-directory .admin-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 18px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.site-directory .admin-heading h2 {
  padding: 0;
  margin: 0;
  border: 0;
}

.site-directory .admin-heading > a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.site-directory .form-grid {
  gap: 20px;
}

.site-directory .form-grid label {
  margin-bottom: 0;
  min-width: 0;
}

.site-directory label > :is(input, select, .resource-field) {
  margin-top: 6px;
}

.partner-preview {
  width: 120px;
  height: 60px;
  object-fit: contain;
  background: white;
}

#language-editor,
#partner-editor {
  scroll-margin-top: 100px;
}

.company-metrics-editor,
#partner-list {
  scroll-margin-top: 100px;
}

.company-metric-editor {
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.company-metric-editor:first-of-type {
  padding-top: 0;
}

.company-metric-editor:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

.company-metric-editor label {
  margin-bottom: 0;
  min-width: 0;
}

.company-metric-editor h3 {
  margin: 0 0 16px;
  font-size: 16px;
}

.metric-controls {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 18px;
}

.company-metric-editor .metric-copy-pair {
  margin-bottom: 0;
}

.metric-copy-pair label > span {
  display: block;
  margin-bottom: 6px;
}

.metric-copy-pair textarea {
  min-height: 80px;
}

@media (max-width: 640px) {
  .metric-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .metric-copy-pair {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
}

@media (max-width: 640px) {
  .brand-paired-field .form-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .brand-language-section {
    margin-bottom: 28px;
  }
}
