/* Shared administration UI. Preferences and presentation stay in the browser. */
[data-view-panel="admin"] {
  --admin-accent: #2563eb;
  --admin-line: #e2e8f0;
  --admin-muted: #64748b;
  --admin-surface: #f8fafc;
  color: #182438;
}
[data-view-panel="admin"] .admin-view-heading { margin-bottom: 18px; }
[data-view-panel="admin"] .admin-view-heading h1 { font-size: 30px; letter-spacing: -.8px; }
[data-view-panel="admin"] .eyebrow { color: var(--admin-accent); }
.admin-workspace-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0 18px; margin-bottom: 22px; border-bottom: 1px solid var(--admin-line); }
.admin-workspace-favorites,.admin-workspace-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.admin-workspace-tools { flex-shrink: 0; }
[data-view-panel="admin"] #provider-compact-toggle { display: none; }
.admin-favorite,.admin-tool,.admin-quick-jump,.admin-filter-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 34px; padding: 7px 11px; border: 1px solid var(--admin-line); border-radius: 8px; background: #fff; color: #475569; font: inherit; font-size: 12px; cursor: pointer; }
.admin-favorite { border-color: transparent; background: var(--admin-surface); }
.admin-favorite.active,.admin-status-item.active { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.admin-tool[aria-pressed="true"] { border-color: #bfdbfe; color: #1d4ed8; background: #eff6ff; }
.admin-tool[data-workspace-pin] { font-size: 18px; width: 34px; padding: 0; }
.admin-quick-jump { background: #17243b; color: #fff; border-color: #17243b; }
.admin-quick-jump kbd { padding: 1px 4px; border: 1px solid #ffffff40; border-radius: 4px; color: #cbd5e1; font: 10px ui-monospace,monospace; }
[data-view-panel="admin"] .admin-panel { min-width: 0; }
[data-view-panel="admin"] .admin-panel-heading { gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 16px; }
[data-view-panel="admin"] .admin-panel-heading h2 { margin: 0 0 6px; font-size: 20px; color: #182438; }
[data-view-panel="admin"] .admin-panel-heading p { color: var(--admin-muted); line-height: 1.65; max-width: 760px; }
[data-view-panel="admin"] .admin-panel-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
[data-view-panel="admin"] .admin-panel-heading .primary-button { background: #2563eb; border-color: #2563eb; color: #fff; }
.admin-context-bar { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin: 0 0 14px; }
.admin-page-context { font-size: 12px; color: var(--admin-muted); }
.admin-filter-toggle { min-height: 30px; padding: 5px 10px; }
[data-view-panel="admin"] [class*="filter-bar"] { padding: 16px; border: 1px solid var(--admin-line); border-radius: 12px; background: var(--admin-surface); gap: 12px; margin-bottom: 16px; }
[data-view-panel="admin"] [class*="filter-bar"] input,[data-view-panel="admin"] [class*="filter-bar"] select { min-height: 38px; border: 1px solid #d6dee9; border-radius: 7px; background: #fff; color: #182438; box-shadow: none; }
[data-view-panel="admin"] [class*="filter-bar"] label { color: #526178; font-size: 12px; }
[data-view-panel="admin"] [data-filters-collapsed="true"] [class*="filter-bar"] { display: none !important; }
.admin-filter-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.admin-filter-chip { display: inline-flex; align-items: center; gap: 12px; min-height: 30px; max-width: 100%; padding: 5px 9px; border: 1px solid #bfdbfe; background: #eff6ff; color: #1d4ed8; border-radius: 7px; font: inherit; font-size: 12px; cursor: pointer; }
.admin-filter-chip span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 440px; }
.admin-filter-chip b { font-size: 16px; font-weight: 400; }
.admin-resource-visual { padding: 16px 18px; border: 1px solid var(--admin-line); border-radius: 12px; background: #fff; margin-bottom: 16px; }
.admin-visual-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 12px; margin-bottom: 12px; }
.admin-visual-heading strong { font-size: 13px; }
.admin-visual-heading span { color: var(--admin-muted); }
.admin-status-track { display: flex; height: 7px; overflow: hidden; background: #edf2f7; border-radius: 8px; gap: 3px; }
.admin-status-track span { min-width: 3px; flex-basis: 0; }
.admin-tone-good { background: #10b981; }.admin-tone-bad { background: #ef4444; }.admin-tone-warning { background: #f59e0b; }.admin-tone-blue { background: #3b82f6; }.admin-tone-muted { background: #94a3b8; }
.admin-status-legend { display: flex; flex-wrap: wrap; gap: 7px 10px; margin-top: 12px; }
.admin-status-item { display: inline-flex; align-items: center; gap: 7px; border: 1px solid transparent; border-radius: 6px; padding: 5px 7px; color: #526178; background: none; font: inherit; font-size: 12px; }
button.admin-status-item { cursor: pointer; }
.admin-status-item i { width: 7px; height: 7px; border-radius: 50%; }
.admin-status-item strong { color: #182438; font-variant-numeric: tabular-nums; }
.admin-unbound-status { margin-left: auto; color: #b45309; background: #fffbeb; border-color: #fde68a; }
[data-view-panel="admin"] .table-wrap { position: relative; overflow: auto; max-height: min(72vh,840px); border: 1px solid var(--admin-line); border-radius: 12px; background: #fff; scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
[data-view-panel="admin"] table { margin: 0; border-collapse: separate; border-spacing: 0; width: 100%; }
[data-view-panel="admin"] table th { position: sticky; top: 0; z-index: 2; background: #f8fafc; color: #64748b; border-bottom: 1px solid var(--admin-line); font-size: 11px; font-weight: 600; letter-spacing: .02em; padding: 13px 16px; }
[data-view-panel="admin"] table td { padding: 16px; border-bottom: 1px solid #eef2f7; font-size: 12px; transition: background .12s ease; }
[data-view-panel="admin"] table tr:last-child td { border-bottom: 0; }
[data-view-panel="admin"] :is(.channel-admin-table,.admin-user-table,.admin-key-table,.redemption-table,.subscription-plan-table) { min-width: 1100px; }
[data-view-panel="admin"] .status-pill { white-space: nowrap; }
[data-view-panel="admin"] table .admin-cell-actions { position: sticky; right: 0; z-index: 1; background: #fff; border-left: 1px solid #eef2f7; box-shadow: -6px 0 12px #0f172a04; }
[data-view-panel="admin"] table th.admin-cell-actions { z-index: 3; background: #f8fafc; }
[data-view-panel="admin"] table tbody tr:hover td { background: #f8fbff; }
[data-view-panel="admin"] table tbody tr.admin-row-selected td { background: #eff6ff; }
[data-view-panel="admin"] input[type="checkbox"] { accent-color: #2563eb; }
[data-view-panel="admin"][data-admin-density="compact"] table td { padding: 9px 12px; font-size: 11px; }
[data-view-panel="admin"][data-admin-density="compact"] table th { padding: 10px 12px; }
[data-view-panel="admin"] table td[colspan] { text-align: center; padding: 40px 18px; color: #64748b; }
[data-view-panel="admin"] .provider-bulk-bar { position: sticky; top: 8px; z-index: 5; border: 1px solid #bfdbfe; border-radius: 10px; background: #eff6ff; box-shadow: 0 5px 20px #1e3a8a0c; margin: 12px 0; flex-wrap: wrap; gap: 12px; }
[data-view-panel="admin"] [class*="pagination"] { gap: 12px; flex-wrap: wrap; }
[data-view-panel="admin"] .metric-card { border: 1px solid var(--admin-line); border-radius: 12px; background: #fff; box-shadow: 0 3px 12px #18243803; }
[data-view-panel="admin"] .metric-card > strong { color: #182438; font-variant-numeric: tabular-nums; }
[data-view-panel="admin"] .admin-overview-metrics article { position: relative; padding-bottom: 44px; border: 1px solid var(--admin-line); border-radius: 12px; background: #fff; box-shadow: 0 3px 12px #18243803; }
[data-view-panel="admin"] .admin-overview-chart-grid,[data-view-panel="admin"] .admin-overview-breakdowns { gap: 16px; }
[data-view-panel="admin"] .admin-overview-chart,[data-view-panel="admin"] .admin-overview-breakdowns > section { padding: 18px; border: 1px solid var(--admin-line); border-radius: 12px; background: #fff; }
.admin-metric-link { position: absolute; bottom: 13px; right: 16px; border: 0; padding: 3px 0; background: none; color: #2563eb; cursor: pointer; font: inherit; font-size: 11px; }
[data-view-panel="admin"] .usage-chart-column { cursor: crosshair; border-radius: 5px; }
[data-view-panel="admin"] .usage-chart-column:hover,[data-view-panel="admin"] .usage-chart-column:focus-visible { background: #eff6ff; }
.admin-chart-readout { margin: 8px 0 0; min-height: 18px; font-size: 11px; color: #475569; text-align: center; }
.admin-section-search { display: grid !important; gap: 6px; padding: 6px 5px 12px; margin-bottom: 8px; border-bottom: 1px solid #e2e8f0; }
.admin-section-search > span { font-size: 11px; font-weight: 600; color: #64748b; }
.admin-section-search input { width: 100%; min-width: 0; min-height: 34px; border: 1px solid #d6dee9; border-radius: 7px; padding: 7px 9px; font: inherit; font-size: 12px; background: #fff; color: #182438; }
.admin-section-search small { font-size: 11px; color: #64748b; }
.admin-section-search small:empty { display: none; }
[data-section-match="false"] { display: none !important; }
.admin-ui-dialog { border-color: #d6dee9; box-shadow: 0 24px 100px #0f172a30; }
.admin-ui-dialog::backdrop,.admin-command-dialog::backdrop { background: #0f172a66; backdrop-filter: blur(3px); }
.admin-ui-dialog .provider-editor-header { background: #fff; border-bottom-color: #e2e8f0; }
.admin-ui-dialog .provider-editor-nav { background: #f8fafc; border-right-color: #e2e8f0; }
.admin-ui-dialog .provider-editor-nav button.active,[data-view-panel="admin"] .global-settings-nav button.active { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.admin-ui-dialog .provider-editor-footer { background: #fff; border-top-color: #e2e8f0; box-shadow: 0 -6px 18px #0f172a04; }
.admin-ui-dialog :is(input,select,textarea):focus-visible,[data-view-panel="admin"] :is(input,select,textarea,button,a,[tabindex]):focus-visible,.admin-command-dialog :is(input,button):focus-visible { outline: 2px solid #2563eb; outline-offset: 3px; }
[data-view-panel="admin"] .global-settings-nav { background: #f8fafc; border-radius: 12px; padding: 12px; border: 1px solid var(--admin-line); }
[data-view-panel="admin"] .global-settings-section { border-radius: 12px; }
.admin-command-dialog { width: min(620px,calc(100vw - 32px)); max-height: min(650px,85vh); margin: 9vh auto auto; padding: 0; border: 1px solid #e2e8f0; border-radius: 16px; background: #fff; color: #182438; box-shadow: 0 24px 100px #0f172a40; }
.admin-command-header { display: flex; align-items: center; justify-content: space-between; padding: 17px 20px 8px; }
.admin-command-header h2 { margin: 0; font-size: 15px; color: #182438; }
.admin-command-close { background: #f1f5f9; color: #64748b; border: 0; border-radius: 6px; width: 28px; height: 28px; font-size: 20px; cursor: pointer; }
.admin-command-search { display: block; margin: 8px 20px 14px; }
.admin-command-search input { width: 100%; min-height: 44px; padding: 10px 13px; border: 1px solid #d6dee9; border-radius: 9px; font: inherit; font-size: 14px; background: #f8fafc; color: #182438; }
#admin-command-results { max-height: min(390px,48vh); overflow: auto; padding: 0 10px; }
.admin-command-result { display: flex; align-items: center; gap: 13px; width: 100%; padding: 11px; border: 1px solid transparent; border-radius: 9px; background: #fff; color: #182438; text-align: left; font: inherit; cursor: pointer; }
.admin-command-result.active,.admin-command-result:hover { background: #eff6ff; border-color: #dbeafe; }
.admin-command-symbol { display: grid; place-items: center; width: 30px; height: 30px; flex-shrink: 0; border-radius: 7px; background: #f1f5f9; color: #64748b; }
.admin-command-result strong { display: block; font-size: 13px; font-weight: 600; }
.admin-command-result small { display: block; margin-top: 3px; font-size: 11px; color: #64748b; line-height: 1.4; }
.admin-command-help { margin: 12px 0 0; padding: 12px 20px; background: #f8fafc; border-top: 1px solid #e2e8f0; font-size: 11px; color: #64748b; }
.admin-command-empty { padding: 30px 10px; text-align: center; color: #64748b; font-size: 13px; }
@media (max-width: 1100px) {
  .admin-workspace-toolbar { align-items: flex-start; flex-direction: column; }
  [data-view-panel="admin"] [class*="filter-bar"] { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 700px) {
  [data-view-panel="admin"] .admin-view-heading h1 { font-size: 25px; }
  .admin-workspace-toolbar { margin-bottom: 18px; gap: 10px; }
  .admin-workspace-favorites { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 4px; }
  .admin-favorite { white-space: nowrap; }
  .admin-workspace-tools { width: 100%; }.admin-quick-jump { margin-left: auto; }
  [data-view-panel="admin"] [class*="filter-bar"] { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 12px; }
  [data-view-panel="admin"] [class*="filter-bar"] > * { grid-column: auto; min-width: 0; }
  [data-view-panel="admin"] [class*="filter-bar"] > [class*="search"] { grid-column: 1 / -1; }
  .admin-resource-visual { padding: 13px; }.admin-unbound-status { margin-left: 0; }
  [data-view-panel="admin"] .admin-panel-heading > div { max-width: 100%; }
  [data-view-panel="admin"] .table-wrap { max-height: 65vh; }
  .admin-command-dialog { margin-top: 4vh; }
}
@media (max-width: 820px) {
  .admin-ui-dialog.provider-editor-dialog { width: 100%; max-width: 100%; }
  .admin-ui-dialog :is(.provider-editor-nav,.model-editor-nav),[data-view-panel="admin"] .global-settings-nav { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-content: start; gap: 6px; padding: 10px; max-height: 32vh; min-height: 0; overflow: auto; }
  .admin-ui-dialog :is(.provider-editor-nav,.model-editor-nav) .admin-section-search,[data-view-panel="admin"] .global-settings-nav .admin-section-search { grid-column: 1 / -1; width: 100%; min-width: 0; padding: 0 0 10px; margin: 0 0 4px; }
  .admin-ui-dialog :is(.provider-editor-nav,.model-editor-nav) button,[data-view-panel="admin"] .global-settings-nav button { display: flex; align-items: center; gap: 7px; min-width: 0; width: 100%; min-height: 38px; padding: 8px; }
  .admin-ui-dialog :is(.provider-editor-nav,.model-editor-nav) button small { display: none; }
  .admin-ui-dialog :is(.provider-editor-nav,.model-editor-nav) button svg { flex-shrink: 0; margin: 0; }
}
@media (max-width: 560px) {
  [data-view-panel="admin"] .table-wrap:has(> .provider-admin-table) { max-height: none; overflow: visible; border: 0; border-radius: 0; }
  [data-view-panel="admin"] .provider-admin-table td.admin-cell-actions { position: static; box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  [data-view-panel="admin"] * { transition: none !important; scroll-behavior: auto !important; }
}
