/* Services & Credential Admin Modern UI - Master-Detail Rebuild.
   Shell, header, breadcrumb, focus, and button rules come from catalog.css.
   This file is limited to service administration content. */

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
}

.page-header h1 {
  font-size: clamp(24px, 2.5vw, 32px);
  font-weight: 750;
  color: var(--ink, #0f172a);
  margin: 0 0 6px 0;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.page-eyebrow {
  margin: 0 0 6px;
  color: var(--blue, #2563d9);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .12em;
}

.page-header__description {
  margin: 0;
  font-size: 14px;
  color: var(--muted, #64748b);
  line-height: 1.5;
}

.header-badge-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}

.env-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #1e40af;
  background: #dbeafe;
  border: 1px solid #bfdbfe;
  border-radius: 20px;
}

/* 1. Top Query Filter Panel */
.query-panel {
  margin-top: 10px;
  margin-bottom: 24px;
  padding: 20px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.query-panel__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.query-panel__heading h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.query-panel__hint {
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
}

.query-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.query-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.query-form .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.query-form .field > span {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
}

.query-form input[type="search"],
.query-form input[type="text"],
.query-form select {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  font-size: 13px;
  color: #0f172a;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
}

.query-form input:focus-visible,
.query-form select:focus-visible {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  outline: none;
}

.input-readonly {
  background-color: #f8fafc !important;
  color: #475569 !important;
  cursor: default;
}

.query-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.button--ghost {
  background: transparent;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.button--ghost:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.button--xs {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 6px;
}

.button--sm {
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 7px;
}

/* 2. Master-Detail Vertical Layout Workspace */
.master-detail-workspace {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.panel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

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

.panel-subtext {
  margin: 4px 0 0 0;
  font-size: 13px;
  color: #64748b;
}

.panel-count {
  font-size: 13px;
  font-weight: 700;
  color: #2563eb;
  background: #eff6ff;
  padding: 4px 12px;
  border-radius: 16px;
}

/* Master Table Styling */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.table-wrap caption {
  display: none;
}

.table-wrap th {
  padding: 10px 14px;
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  font-size: 12px;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.table-wrap td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

.table-wrap tbody tr {
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.table-wrap tbody tr:hover {
  background: #f8fafc;
}

.table-wrap tbody tr.service-row--selected {
  background: #eff6ff;
  box-shadow: inset 4px 0 0 #2563eb;
}

.table-wrap tbody tr.service-row--selected td.cell-code {
  font-weight: 800;
  color: #1d4ed8;
}

.table-wrap tbody tr:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
  background: #f0f7ff;
}

.cell-select {
  width: 70px;
}

.cell-code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-weight: 600;
}

.cell-name {
  font-weight: 600;
}

.cell-clientid {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  color: #475569;
}

/* Detail Panel Styling */
.detail-panel {
  border-top: 3px solid #2563eb;
}

.detail-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-empty-panel {
  padding: 48px 24px;
  text-align: center;
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  margin-top: 8px;
}

.detail-empty-panel .empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.detail-empty-panel h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 700;
  color: #334155;
}

.detail-empty-panel p {
  margin: 0;
  font-size: 14px;
  color: #64748b;
}

.detail-workbench {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 12px;
}

.detail-section {
  padding: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.detail-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.detail-section__header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 750;
  color: #0f172a;
}

.service-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.service-detail-item {
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.service-detail-item span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.service-detail-item strong {
  display: block;
  font-size: 13px;
  color: #0f172a;
  overflow-wrap: anywhere;
}

.service-detail-block {
  padding: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.endpoint-lists {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.endpoint-block strong {
  display: block;
  font-size: 12px;
  color: #475569;
  margin-bottom: 6px;
}

.service-list {
  margin: 0;
  padding-left: 18px;
  color: #334155;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
}

.list-empty {
  list-style-type: none;
  margin-left: -18px;
  color: #94a3b8;
  font-style: italic;
}

/* Credential Section */
.credential-section {
  background: #ffffff;
  border: 1px solid #bfdbfe;
}

/* State Badges */
.state-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 12px;
  letter-spacing: 0.02em;
}

.state-badge--active {
  color: #15803d;
  background: #dcfce7;
}

.state-badge--suspended {
  color: #b45309;
  background: #fef3c7;
}

.state-badge--revoked {
  color: #b91c1c;
  background: #fee2e2;
}

.state-badge--inactive {
  color: #475569;
  background: #f1f5f9;
}

/* Modal Dialogs */
.action-dialog {
  width: min(540px, calc(100vw - 32px));
  margin: auto;
  padding: 0;
  color: #0f172a;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
}

.action-dialog[data-dragged="true"],
.action-dialog.is-dragged {
  /* Position offset is smoothly handled by transform: translate3d without disrupting dialog centering */
}

.modal-dialog--lg {
  width: min(720px, calc(100vw - 32px));
}

.action-dialog::backdrop {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  pointer-events: auto;
}

.action-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.action-dialog__header.is-draggable-header {
  cursor: move;
  user-select: none;
  touch-action: none;
  position: relative;
}

.action-dialog__header.is-draggable-header h2::before {
  content: ":: ";
  color: #94a3b8;
  font-weight: 400;
  margin-right: 4px;
}

.dialog-close-button {
  background: transparent;
  border: 0;
  color: #64748b;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.dialog-close-button:hover,
.dialog-close-button:focus-visible {
  color: #0f172a;
  background: #f1f5f9;
  outline: none;
}

.action-dialog__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  max-height: 85vh;
  overflow-y: auto;
}

.action-dialog h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 750;
  color: #0f172a;
}

.action-dialog__description {
  margin: -6px 0 4px 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field--wide {
  grid-column: span 2;
}

.action-dialog .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.action-dialog .field > span {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
}

.action-dialog input[type="text"],
.action-dialog input:not([type]),
.action-dialog textarea,
.action-dialog select {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  font-size: 13px;
  color: #0f172a;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-family: inherit;
}

.action-dialog textarea {
  resize: vertical;
  min-height: 72px;
}

.action-dialog small {
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}

.action-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
}

.required-mark {
  color: #ef4444;
}

.security-tip {
  font-size: 12px;
  color: #0369a1;
  background: #e0f2fe;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #bae6fd;
}

.one-time-secret__value {
  display: block;
  padding: 8px 12px;
  color: #065f46;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
  user-select: all;
}

/* Scope picker in credential and permission-change modals */
.scope-picker {
  border: 0;
  padding: 0;
  margin: 0;
}

.scope-picker legend {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.scope-picker__options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.scope-picker__option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  cursor: pointer;
}

.scope-picker__option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.credential-scope-reference {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: 220px;
  overflow-y: auto;
  padding: 2px;
}

.scope-reference-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 9px 11px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}

.scope-reference-summary__count {
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.credential-scope-reference__content {
  display: grid;
  gap: 3px;
}

.credential-scope-reference__content small {
  color: #64748b;
  font-family: inherit;
  font-size: 10px;
  line-height: 1.35;
}

.credential-scope-reference .list-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 12px;
}

.scope-change-picker {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.scope-change-picker legend {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 750;
}

.scope-change-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 9px 11px;
  background: #f0f7ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
}

.scope-selection-summary {
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
}

.scope-change-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.scope-change-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 9px 11px;
  background: #f0f7ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
}

.scope-selection-summary {
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
}

.scope-change-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

@media (max-width: 640px) {
  .scope-change-group__header,
  .scope-change-group__options {
    grid-template-columns: 20px minmax(124px, .9fr) minmax(0, 1.4fr) 38px;
    column-gap: 10px;
  }

  .scope-change-option {
    padding-inline: 10px;
  }

  .scope-change-option::after {
    right: 58px;
    left: 10px;
  }
}

.scope-selected-summary {
  margin-top: 10px;
  padding: 9px 11px;
  color: #334155;
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 7px;
  font-size: 11px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.scope-picker-error {
  margin: 7px 0 0;
}

.scope-change-options[aria-invalid="true"] {
  outline: 2px solid #fca5a5;
  outline-offset: 3px;
}

/* Data-first density: keep the service rows and values as the visual priority. */
.page-header {
  gap: 12px;
  margin-bottom: 10px;
}

.page-eyebrow {
  margin-bottom: 2px;
  font-size: 10px;
  line-height: 1.2;
}

.page-header h1 {
  font-size: clamp(21px, 2.1vw, 28px);
  line-height: 1.1;
  margin-bottom: 3px;
}

.page-header__description {
  font-size: 12px;
  line-height: 1.35;
}

.query-panel {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 9px;
}

.query-panel__heading {
  gap: 10px;
  margin-bottom: 8px;
  padding-bottom: 7px;
}

.query-panel__heading h2,
.panel-heading h2 {
  font-size: 15px;
}

.query-panel__hint,
.panel-subtext {
  font-size: 11px;
}

.query-form,
.query-form-grid {
  gap: 8px;
}

.query-form .field {
  gap: 3px;
}

.query-form .field > span {
  font-size: 11px;
}

.query-form input[type="search"],
.query-form input[type="text"],
.query-form select {
  padding: 6px 9px;
  font-size: 12px;
  border-radius: 6px;
}

.query-actions {
  gap: 6px;
}

.master-detail-workspace {
  gap: 12px;
}

.panel {
  padding: 12px 14px;
  border-radius: 9px;
}

.panel-heading {
  gap: 10px;
  margin-bottom: 8px;
}

.panel-count {
  padding: 3px 9px;
  font-size: 11px;
}

.table-wrap table {
  font-size: 12px;
}

.table-wrap th {
  padding: 7px 10px;
  font-size: 11px;
}

.table-wrap td {
  padding: 7px 10px;
}

.detail-empty-panel {
  padding: 24px 16px;
  margin-top: 4px;
}

.detail-empty-panel .empty-icon {
  font-size: 28px;
  margin-bottom: 6px;
}

.detail-empty-panel h3 {
  margin-bottom: 4px;
  font-size: 14px;
}

.detail-empty-panel p {
  font-size: 12px;
}

.detail-workbench {
  gap: 10px;
  margin-top: 6px;
}

.detail-section {
  padding: 10px;
  border-radius: 8px;
}

.detail-section__header {
  gap: 8px;
  margin-bottom: 7px;
}

.detail-section__header h3 {
  font-size: 13px;
}

.service-detail-grid {
  gap: 7px;
}

.service-detail-item,
.service-detail-block {
  padding: 7px 9px;
  border-radius: 6px;
}

.service-detail-item span {
  margin-bottom: 2px;
  font-size: 10px;
}

.service-detail-item strong {
  font-size: 12px;
}

.endpoint-lists {
  gap: 10px;
}

.detail-section .panel-subtext {
  display: inline;
  margin: 0 0 0 6px;
}

@media (max-width: 640px) {
  .page-header { margin-bottom: 8px; }
  .query-panel, .panel { padding: 10px; }
  .query-panel__heading { align-items: flex-start; flex-direction: column; }
  .detail-section .panel-subtext { display: block; margin: 2px 0 0; }
}

/* Responsive Rules */
@media (max-width: 980px) {
  .query-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .page-header {
    flex-direction: column;
  }

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

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

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

  .query-actions {
    width: 100%;
  }

  .query-actions .button {
    flex: 1;
    text-align: center;
    justify-content: center;
  }

  .detail-header-actions {
    width: 100%;
  }

  .detail-header-actions .button {
    flex: 1;
  }

  .scope-picker__options {
    grid-template-columns: 1fr;
  }

  .scope-change-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .scope-change-toolbar__actions {
    width: 100%;
  }

  .scope-change-toolbar__actions .button {
    flex: 1;
  }

  .scope-change-group__header,
  .scope-change-group__options {
    grid-template-columns: 20px minmax(124px, .9fr) minmax(0, 1.4fr) 38px;
    column-gap: 8px;
  }

  .action-dialog__actions {
    flex-direction: column-reverse;
  }

  .action-dialog__actions .button {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .scope-change-group__header,
  .scope-change-group__options {
    grid-template-columns: 18px minmax(104px, .9fr) minmax(0, 1fr) 32px;
    column-gap: 6px;
  }

  .scope-change-option__description {
    font-size: 10px;
  }

  .scope-change-group__header {
    font-size: 9px;
  }

  .scope-change-option::after {
    right: 48px;
  }
}

/* ==========================================================================
   Full Width & 8px Spacing Strict Responsive Layout Override (OBPS Admin)
   ========================================================================== */
.query-panel {
  margin-top: 0 !important;
  margin-bottom: 8px !important;
  padding: 10px 14px !important;
  border-radius: 8px !important;
}

.query-panel__heading {
  gap: 8px !important;
  margin-bottom: 8px !important;
  padding-bottom: 8px !important;
}

.query-form,
.query-form-grid {
  gap: 8px !important;
}

.query-actions,
.detail-header-actions,
.action-dialog__actions,
.form-actions,
.action-row {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  margin-top: 8px !important;
  margin-left: auto !important;
}

.master-detail-workspace {
  display: flex;
  flex-direction: column;
  gap: 8px !important;
}

.panel {
  padding: 10px 14px !important;
  border-radius: 8px !important;
}

.panel-heading {
  gap: 8px !important;
  margin-bottom: 8px !important;
}

.table-wrap {
  border-radius: 8px !important;
}

.detail-empty-panel {
  padding: 18px 14px !important;
  margin-top: 8px !important;
}

.detail-workbench {
  gap: 8px !important;
  margin-top: 8px !important;
}

.detail-section {
  padding: 10px 12px !important;
  border-radius: 8px !important;
}

.detail-section__header {
  gap: 8px !important;
  margin-bottom: 8px !important;
}

.service-detail-grid {
  gap: 8px !important;
}

.service-detail-item {
  padding: 8px 10px !important;
  border-radius: 6px !important;
}

.service-detail-block {
  padding: 8px 10px !important;
  border-radius: 6px !important;
}

.endpoint-lists {
  gap: 8px !important;
}

.query-form input[type="search"],
.query-form input[type="text"],
.query-form input:not([type]),
.query-form select,
.field input,
.field select,
.button {
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  box-sizing: border-box !important;
  padding: 6px 12px !important;
  font-size: 13px !important;
  line-height: 1.4 !important;
  vertical-align: middle !important;
}

/* ==========================================================================
   Button Hover & Cursor & Click Event Strict Control (Active vs Disabled)
   ========================================================================== */
/* 1. Enabled / Active Buttons */
button:not(:disabled):not([disabled]):not([aria-disabled="true"]),
.button:not(:disabled):not([disabled]):not([aria-disabled="true"]),
input[type="submit"]:not(:disabled),
input[type="button"]:not(:disabled) {
  cursor: pointer !important;
  pointer-events: auto !important;
  user-select: none;
}

button:not(:disabled):not([disabled]):not([aria-disabled="true"]):hover,
.button:not(:disabled):not([disabled]):not([aria-disabled="true"]):hover {
  transform: translateY(-1px) !important;
  filter: brightness(1.05) !important;
}

button:not(:disabled):not([disabled]):not([aria-disabled="true"]):active,
.button:not(:disabled):not([disabled]):not([aria-disabled="true"]):active {
  transform: translateY(0) !important;
  filter: brightness(0.95) !important;
}

/* 2. Disabled / Inactive Buttons */
button:disabled,
button[disabled],
button[aria-disabled="true"],
.button:disabled,
.button[disabled],
.button[aria-disabled="true"],
.button--disabled {
  cursor: not-allowed !important;
  pointer-events: none !important;
  opacity: 0.5 !important;
  box-shadow: none !important;
  transform: none !important;
  filter: none !important;
}

/* Register Modal Compact Fitting (No Scrollbar) */
#register-dialog {
  width: min(820px, calc(100vw - 32px)) !important;
  max-height: 94vh !important;
  border-radius: 12px !important;
}

#register-dialog .action-dialog__form {
  padding: 14px 18px !important;
  gap: 8px !important;
  max-height: 94vh !important;
  overflow: hidden !important;
}

#register-dialog h2 {
  font-size: 17px !important;
  margin-bottom: 2px !important;
}

#register-dialog .action-dialog__description {
  font-size: 11.5px !important;
  margin: 0 0 6px 0 !important;
}

#register-dialog .form-grid {
  gap: 8px 12px !important;
}

#register-dialog .field {
  gap: 2px !important;
}

#register-dialog .field > span {
  font-size: 11.5px !important;
  font-weight: 700 !important;
}

#register-dialog input[type="text"],
#register-dialog input:not([type]),
#register-dialog select {
  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
  padding: 4px 8px !important;
  font-size: 12px !important;
}

#register-dialog textarea {
  min-height: 44px !important;
  max-height: 44px !important;
  padding: 4px 8px !important;
  font-size: 11.5px !important;
  line-height: 1.3 !important;
}

#register-dialog small {
  font-size: 10.5px !important;
  margin-top: 1px !important;
  line-height: 1.2 !important;
}

#register-dialog .action-dialog__actions {
  margin-top: 6px !important;
  padding-top: 8px !important;
}

#register-dialog .action-dialog__actions .button {
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  padding: 6px 18px !important;
  font-size: 13px !important;
}

/* Scope Change Modal Redesign (Authentic Table Row Layout) */
/* Scope Change Modal Redesign (Extreme Ultra-Compact Density & Zero-Waste Spacing) */
#scope-dialog {
  width: min(840px, calc(100vw - 32px)) !important;
  max-height: 94vh !important;
  border-radius: 10px !important;
}

#scope-dialog .action-dialog__form {
  padding: 12px 18px !important;
  gap: 6px !important;
  max-height: 94vh !important;
  overflow: hidden !important;
}

#scope-dialog .page-eyebrow {
  margin-bottom: 0 !important;
  font-size: 9.5px !important;
  line-height: 1.1 !important;
}

#scope-dialog h2 {
  font-size: 16px !important;
  margin-bottom: 0 !important;
  line-height: 1.2 !important;
}

#scope-dialog .action-dialog__description {
  font-size: 11px !important;
  margin: 0 0 2px 0 !important;
  line-height: 1.25 !important;
}

#scope-dialog .scope-change-picker {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

#scope-dialog .scope-change-picker legend {
  font-size: 11.5px !important;
  font-weight: 700 !important;
  margin-bottom: 2px !important;
}

#scope-dialog .scope-change-toolbar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 4px 8px !important;
  margin-bottom: 4px !important;
  background: #f0f7ff !important;
  border: 1px solid #bae6fd !important;
  border-radius: 5px !important;
}

#scope-dialog .scope-selection-summary {
  font-size: 11.5px !important;
  font-weight: 750 !important;
  color: #0369a1 !important;
}

#scope-dialog #scope-picker-help {
  font-size: 10px !important;
  margin-top: 2px !important;
  line-height: 1.2 !important;
}

#scope-dialog .scope-change-options {
  max-height: 64vh !important;
  overflow-y: auto !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  background: #ffffff !important;
  padding: 0 !important;
}

.excel-grid-table {
  width: 100% !important;
  border-collapse: collapse !important;
  table-layout: fixed !important;
  margin: 0 !important;
}

.excel-head-row {
  background: #f8fafc !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 10 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

.excel-head-row th {
  padding: 3px 8px !important;
  font-size: 11.5px !important;
  font-weight: 800 !important;
  color: #334155 !important;
  border-bottom: 2px solid #cbd5e1 !important;
  border-right: 1px solid #e2e8f0 !important;
  background: #f8fafc !important;
  line-height: 1.1 !important;
  height: 22px !important;
}

.excel-head-row th:last-child {
  border-right: none !important;
}

.excel-group-row td {
  padding: 2px 8px !important;
  background: #f1f5f9 !important;
  border-top: 1px solid #cbd5e1 !important;
  border-bottom: 1px solid #cbd5e1 !important;
  line-height: 1.1 !important;
  height: 18px !important;
}

.excel-group-label {
  font-size: 10px !important;
  font-weight: 850 !important;
  color: #1e40af !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
}

.excel-data-row {
  border-bottom: 1px solid #e2e8f0 !important;
  transition: background 0.1s ease !important;
  cursor: pointer !important;
  height: 20px !important;
  min-height: 20px !important;
  max-height: 20px !important;
}

.excel-data-row:hover {
  background: #f8fafc !important;
}

.excel-data-row.is-selected {
  background: #eff6ff !important;
}

.excel-data-row td {
  padding: 2px 6px !important;
  vertical-align: middle !important;
  border-right: 1px solid #f1f5f9 !important;
  height: 20px !important;
  box-sizing: border-box !important;
}

.excel-data-row td:last-child {
  border-right: none !important;
}

.excel-grid-table .cell-check {
  width: 38px !important;
  text-align: center !important;
}

.excel-grid-table .cell-code {
  width: 210px !important;
}

.excel-grid-table .cell-desc {
  width: auto !important;
}

.scope-check-label {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 !important;
  cursor: pointer !important;
  height: 16px !important;
  vertical-align: middle !important;
}

.scope-check-label input[type="checkbox"] {
  width: 15px !important;
  height: 15px !important;
  margin: 0 !important;
  padding: 0 !important;
  cursor: pointer !important;
  accent-color: #2563eb !important;
  vertical-align: middle !important;
  display: block !important;
}

.excel-code-text {
  display: inline-flex !important;
  align-items: center !important;
  height: 16px !important;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  white-space: nowrap !important;
  margin: 0 !important;
  padding: 0 !important;
  vertical-align: middle !important;
  line-height: 1 !important;
}

.excel-desc-text {
  display: inline-flex !important;
  align-items: center !important;
  height: 16px !important;
  font-size: 11.5px !important;
  color: #475569 !important;
  margin: 0 !important;
  padding: 0 !important;
  vertical-align: middle !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

#scope-dialog .scope-selected-summary {
  display: none !important;
}

/* Keep Scope edit interaction identical to Service Registration. */
#scope-dialog .scope-change-picker { display: flex; flex-direction: column; gap: 6px; }
#scope-dialog #scope-change-allowed-scopes { height: auto; min-height: 64px; max-height: 96px; margin-top: 2px; }
#scope-dialog .scope-selected-summary { display: block !important; margin-top: 0; padding: 7px 9px; font-size: 11px; }

/* Registration guidance: make the three integration decisions scannable. */
.input-with-action {
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-with-action input { min-width: 0; flex: 1; }
.input-with-action .button { flex: 0 0 auto; white-space: nowrap; }
.action-dialog code {
  padding: 1px 4px;
  color: #1d4ed8;
  background: #eff6ff;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.register-scope-picker { min-width: 0; }
.scope-group-picker { display: flex; align-items: center; gap: 8px; }
.scope-group-picker select { flex: 0 0 220px; }
.scope-group-picker__hint { color: #64748b; font-size: 11px; }
#register-allowed-scopes { height: auto; min-height: 64px; max-height: 96px; margin-top: 2px; }
#register-scope-error { margin: 5px 0 0; color: #b91c1c; font-size: 11px; }

@media (max-width: 640px) {
  .scope-group-picker { align-items: stretch; flex-direction: column; }
  .scope-group-picker select { flex-basis: auto; width: 100%; }
  .input-with-action { align-items: stretch; flex-direction: column; }
  .input-with-action .button { width: 100%; }
}

#scope-dialog .scope-selected-summary {
  display: none !important;
}

.dialog-error-text {
  margin: 8px 0 0 0;
  padding: 8px 12px;
  font-size: 13px;
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  font-weight: 500;
}
