/**
 * Kalamos Admin Control Center — aligned with knowledge/copylibrary workbench shell.
 */

.admin-control-center-screen {
  --copylibrary-list-width: 340px;
  --copylibrary-hover-surface: color-mix(in srgb, var(--text-primary) 3.5%, transparent);
  --copylibrary-smart-view-active-surface: color-mix(in srgb, var(--text-primary) 14%, var(--page));
}

.admin-control-center-screen.knowledge-screen {
  padding: 8px 7px;
}

.admin-workbench-frame {
  min-height: 0;
}

.admin-header-toolbar {
  min-height: 52px;
}

.admin-header-leading {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 18px;
}

.admin-header-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.admin-header-title-group h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 560;
  letter-spacing: -0.01em;
}

.admin-header-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.admin-header-badge.admin-fixture-badge {
  background: color-mix(in srgb, #c9a227 22%, transparent);
  color: var(--text-primary);
}

.admin-control-center-screen .admin-tab-switcher--inline {
  position: relative;
  display: inline-flex;
  min-width: 0;
  width: max-content;
  max-width: 100%;
  align-items: center;
  gap: 2px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent !important;
  box-shadow: none;
}

.admin-control-center-screen .admin-tab-switcher--inline .copylibrary-smart-view {
  min-height: 32px;
  padding: 0 12px;
}

.admin-control-center-screen .admin-tab-switcher--inline .copylibrary-smart-view .icon {
  color: inherit;
}

.admin-workbench-shell {
  min-height: 0;
}

.admin-workbench-shell--single {
  display: flex;
  flex-direction: column;
  grid-template-columns: unset;
}

.admin-workbench-shell--passes {
  display: block;
}

.admin-detail-panel {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.admin-governance-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: .5px solid var(--border);
  background: color-mix(in srgb, var(--surface-2) 55%, var(--surface-1));
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.admin-banner-icon {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
  margin-top: 1px;
}

.admin-banner-icon .icon {
  color: inherit;
}

.admin-banner-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.admin-detail-scroll.admin-main-viewport {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
}

.admin-section-header {
  margin: 0 0 16px;
  padding-inline: 0;
  border-bottom: none;
  min-height: auto;
  height: auto;
}

.admin-section-header--split {
  justify-content: space-between;
}

.admin-section-header .knowledge-detail-title-row h2 {
  font-size: 14px;
  font-weight: 600;
}

.admin-section-header .knowledge-detail-title-row p {
  font-size: 11px;
}

.admin-section-header .knowledge-file-icon .icon {
  font-size: 18px;
  width: 18px;
  height: 18px;
}

/* Models Layout */
.admin-models-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 960px;
  margin: 0 auto;
}

.admin-card {
  border: .5px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-1) 92%, var(--page));
  padding: 16px 18px 18px;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

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

.admin-field span {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.admin-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Tables */
.admin-table-container {
  overflow-x: auto;
  border: .5px solid var(--border);
  border-radius: var(--radius-md);
}

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

.admin-table th,
.admin-table td {
  padding: 10px 14px;
  border-bottom: .5px solid var(--border);
}

.admin-table th {
  background: color-mix(in srgb, var(--surface-2) 70%, var(--surface-1));
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 11px;
}

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

.admin-row-actions {
  display: flex;
  gap: 6px;
}

/* Passes Layout (Master-Detail) */
.admin-passes-layout {
  display: grid;
  grid-template-columns: var(--copylibrary-list-width) minmax(0, 1fr);
  gap: 0;
  min-height: 100%;
}

.admin-batches-column {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  border-right: .5px solid var(--border);
  border-radius: 0;
  background: color-mix(in srgb, var(--surface-1) 64%, var(--page));
}

.admin-batches-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  flex: 1;
  padding: 8px;
}

.admin-batch-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: .5px solid var(--border);
  background: var(--surface-1);
  text-align: left;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.admin-batch-item:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.admin-batch-item.is-selected {
  background: color-mix(in srgb, var(--text-primary) 6%, var(--surface-1));
  border-color: color-mix(in srgb, var(--text-primary) 18%, var(--border));
}

.admin-batch-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.admin-batch-item-header strong {
  font-size: 12px;
  font-weight: 600;
}

.admin-batch-item-meta {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-muted);
}

.admin-batch-detail-column {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.admin-batch-detail-column .admin-section-header {
  padding: 10px 16px;
  margin: 0;
  border-bottom: .5px solid var(--border);
  min-height: 52px;
  box-sizing: border-box;
}

.admin-entitlements-table-wrapper {
  flex: 1;
  min-height: 0;
  padding: 20px;
}

.admin-subtab-nav {
  margin-bottom: 14px;
  width: fit-content;
}

.admin-subtab-content {
  flex: 1;
  overflow-y: auto;
}

/* Modals */
.admin-wizard-dialog,
.admin-reveal-dialog {
  max-width: 520px;
  width: 100%;
  padding: 24px;
}

.admin-wizard-header,
.admin-reveal-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.admin-wizard-header h2,
.admin-reveal-header h2 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
}

.admin-wizard-header p {
  margin: 0;
  font-size: 11.5px;
  color: var(--text-muted);
}

.admin-reveal-warning {
  margin: 0;
  font-size: 11.5px;
  color: var(--accent);
  font-weight: 500;
}

.admin-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.admin-risk-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  margin: 14px 0;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-2) 75%, transparent);
  border: .5px solid var(--border);
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.admin-plaintext-textarea {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  width: 100%;
  resize: none;
}

.admin-reveal-actions-row {
  display: flex;
  gap: 10px;
  margin: 14px 0;
}

.admin-fixture-hint {
  display: block;
  margin-top: 6px;
}

.admin-empty-pane {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.admin-main-viewport .model-registry,
.admin-main-viewport .pass-server-screen {
  height: 100%;
  overflow: auto;
}

.admin-main-viewport .pass-branded-admin {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.admin-main-viewport .pass-branded-master-detail {
  flex: 1;
  min-height: 0;
}

@media (max-width: 900px) {
  .admin-header-leading {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .admin-passes-layout {
    grid-template-columns: 1fr;
  }

  .admin-batches-column {
    border-right: 0;
    border-bottom: .5px solid var(--border);
  }
}
