/* AdminShell and Insights layout from boilerplateAmigo, adapted to Engine tokens. */
* { box-sizing: border-box; }
html { scroll-padding-top: 24px; }
body { margin: 0; background: var(--am-bg); color: var(--am-text); font: 15px/1.5 var(--am-font); }
a { color: inherit; }
a:focus-visible { outline: 3px solid var(--am-focus); outline-offset: 4px; }
.skip-link { position: fixed; z-index: 50; top: 8px; left: 8px; padding: 10px 16px; background: var(--am-accent); color: var(--am-on-accent); border-radius: var(--am-radius-sm); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100svh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; gap: 36px; height: 100svh; padding: 28px 16px 20px; border-right: 1px solid var(--am-border); background: var(--am-surface); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; text-decoration: none; font-weight: 650; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--am-accent); color: var(--am-on-accent); font-size: 28px; font-weight: 600; line-height: 1; }
.brand-mark { font-family: var(--am-heading-font); border-radius: 50%; }
.brand small { display: block; margin-top: 2px; color: var(--am-muted); font-size: 12px; font-weight: 400; letter-spacing: 0; }
.navigation { display: grid; gap: 6px; }
.group-label { padding: 0 12px 6px; color: var(--am-muted); font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.nav-link { display: flex; align-items: center; gap: 11px; min-height: 44px; padding: 10px 12px; border-radius: 8px; color: var(--am-muted); text-decoration: none; }
.nav-link:first-of-type { background: var(--am-accent-soft); color: var(--am-accent); font-weight: 600; }
.nav-link:hover { background: var(--am-surface-subtle); color: var(--am-text); }
body:has(.panel:target) .nav-link:first-of-type { background: transparent; color: var(--am-muted); font-weight: 400; }
body:has(#auftraege:target) .nav-link[href="#auftraege"], body:has(#anbindungen:target) .nav-link[href="#anbindungen"], body:has(#webflow:target) .nav-link[href="#webflow"], body:has(#freigaben:target) .nav-link[href="#freigaben"] { background: var(--am-accent-soft); color: var(--am-accent); font-weight: 600; }
.nav-icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-note { margin-top: auto; padding: 16px 8px 0; border-top: 1px solid var(--am-border); color: var(--am-muted); font-size: 12px; }
.sidebar-note p { max-width: 23ch; margin: 8px 0 0; }
.local-indicator { display: flex; align-items: center; gap: 7px; font-weight: 600; }
.local-indicator i { width: 6px; height: 6px; border-radius: 50%; background: var(--am-accent); }
.workspace { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; padding: 16px 40px; border-bottom: 1px solid var(--am-border); background: var(--am-surface); }
.topbar p { margin: 0; color: var(--am-muted); font-size: 13px; }
.topbar p span { margin: 0 12px; }
.topbar strong { color: var(--am-text); font-weight: 500; }
.environment { flex: none; padding: 5px 10px; border: 1px solid var(--am-border); border-radius: 6px; color: var(--am-muted); font-size: 12px; }
main { max-width: 1360px; margin: 0 auto; padding: 36px 40px 24px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 7px; color: var(--am-muted); font-size: 12px; font-weight: 600; }
h1 { margin: 0; font-size: clamp(26px, 3vw, 32px); line-height: 1.2; letter-spacing: -.035em; font-weight: 650; }
h1 { font-family: var(--am-heading-font); font-size: clamp(30px, 3.2vw, 40px); font-weight: 400; letter-spacing: -.035em; }
.intro { margin: 10px 0 0; color: var(--am-muted); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 14px; flex: none; min-height: 44px; padding: 10px 16px; border-radius: var(--am-radius-sm); background: var(--am-accent); color: var(--am-on-accent); font-size: 13px; font-weight: 600; text-decoration: none; }
.button:hover { background: var(--am-accent-hover); }
.button { border-radius: 80px; padding-inline: 22px; }
.database-status { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; font-size: 12px; font-weight: 600; color: var(--am-success); }
.database-status > span:last-child { margin-left: 6px; color: var(--am-muted); font-weight: 400; }
.status-dot, .state-dot { display: inline-block; width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--am-success); }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 26px; }
.metric { min-width: 0; padding: 22px 24px; border: 1px solid var(--am-border); border-radius: var(--am-radius-md); background: var(--am-surface); }
.metric-label { display: block; color: var(--am-muted); font-size: 13px; font-weight: 500; }
.metric strong { display: block; margin: 10px 0 5px; font-size: 34px; line-height: 1.2; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric p { margin: 0; color: var(--am-muted); font-size: 12px; }
.panels { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, 1fr); gap: 22px; align-items: start; }
.panel { min-width: 0; border: 1px solid var(--am-border); border-radius: var(--am-radius-md); background: var(--am-surface); scroll-margin-top: 24px; }
.panel-heading { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 22px 24px 18px; }
h2 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.015em; }
.panel-heading p { margin: 5px 0 0; color: var(--am-muted); font-size: 12px; }
.count-badge { padding: 4px 9px; border-radius: 6px; background: var(--am-surface-subtle); color: var(--am-muted); font-size: 11px; white-space: nowrap; }
.empty-state { margin: 0 24px 18px; padding: 12px; border-radius: 6px; background: var(--am-surface-subtle); color: var(--am-muted); font-size: 12px; }
.jobs-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.jobs-table th { padding: 9px 24px; border-top: 1px solid var(--am-border); border-bottom: 1px solid var(--am-border); background: var(--am-surface-subtle); color: var(--am-muted); text-align: left; font-size: 11px; font-weight: 500; }
.jobs-table td { padding: 11px 24px; border-bottom: 1px solid var(--am-border); }
.jobs-table tbody tr:last-child td { border-bottom: 0; }
.jobs-table th:last-child, .jobs-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.state-label { display: flex; align-items: center; gap: 10px; }
.state-dot { background: var(--am-muted); opacity: .65; }
.has-jobs .state-dot { background: var(--am-accent); opacity: 1; }
.is-rejected.has-jobs .state-dot { background: var(--am-danger); }
.is-rejected.has-jobs td:last-child { color: var(--am-danger); font-weight: 600; }
.panel-note { margin: 0; padding: 16px 24px; border-top: 1px solid var(--am-border); color: var(--am-muted); font-size: 12px; }
.adapter-list { margin: 0; padding: 0 24px; list-style: none; }
.adapter-list li { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 0; border-top: 1px solid var(--am-border); }
.adapter-name { display: block; font-size: 13px; font-weight: 600; }
.adapter-config { display: block; margin-top: 5px; color: var(--am-muted); font-size: 12px; overflow-wrap: anywhere; }
.adapter-status { flex: none; padding: 4px 8px; border-radius: 5px; background: var(--am-surface-subtle); color: var(--am-muted); font-size: 11px; }
.connection-note { margin: 8px 24px 24px; padding: 14px; border: 1px solid var(--am-border); border-radius: 6px; }
.connection-note strong { font-size: 12px; font-weight: 600; }
.connection-note p { margin: 6px 0 0; color: var(--am-muted); font-size: 12px; }
.page-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 26px; color: var(--am-muted); font-size: 11px; }
.page-footer p { margin: 0; }
.workflow-panels { margin-top: 22px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.workflow-panels h2 { font-family: var(--am-heading-font); font-size: 24px; font-weight: 400; }
.workflow-panels .eyebrow { margin-bottom: 8px; }
.workflow-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0 24px 24px; }
.workflow-counts dt { min-height: 36px; color: var(--am-muted); font-size: 12px; }
.workflow-counts dd { margin: 5px 0 0; font-size: 28px; font-variant-numeric: tabular-nums; }
.text-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--am-accent); font-size: 13px; text-underline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.error-page { display: grid; min-height: 100svh; place-items: center; padding: 24px; }
.error-state { width: 100%; max-width: 540px; margin: 0; padding: 32px; border: 1px solid var(--am-border); border-radius: var(--am-radius-md); background: var(--am-surface); }
.error-state h1 { margin: 16px 0; font-size: 26px; }
.error-state p { color: var(--am-muted); }
.error-label { color: var(--am-danger); font-size: 12px; font-weight: 600; }
.error-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; margin-top: 24px; }
.error-actions > a:last-child { min-height: 44px; display: inline-flex; align-items: center; color: var(--am-accent); font-size: 13px; }
@media (max-width: 1160px) {
  .topbar { padding-inline: 28px; }
  main { padding-inline: 28px; }
  .panels { grid-template-columns: minmax(0, 1fr); }
  .adapter-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
  .adapter-list li { align-items: start; flex-direction: column; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; gap: 18px; padding: 18px 24px 12px; border-right: 0; border-bottom: 1px solid var(--am-border); }
  .brand { padding: 0; }
  .navigation { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .group-label, .sidebar-note { display: none; }
  .nav-link { justify-content: center; gap: 7px; padding: 10px 6px; font-size: 13px; }
  .nav-icon { width: 16px; height: 16px; }
  .topbar { min-height: 62px; padding-inline: 24px; }
  main { padding: 28px 24px; }
}
@media (max-width: 600px) {
  .sidebar { padding-inline: 16px; }
  .topbar { padding-inline: 16px; }
  .topbar p { font-size: 12px; }
  .topbar p span { margin-inline: 6px; }
  main { padding: 24px 16px; }
  .page-heading { align-items: start; flex-direction: column; gap: 18px; }
  .database-status { align-items: start; }
  .database-status > span:last-child { flex-basis: 100%; margin-left: 15px; }
  .metrics { gap: 10px; }
  .metric { padding: 15px 12px; }
  .metric strong { font-size: 28px; }
  .metric p { font-size: 11px; }
  .metric-label { font-size: 12px; }
  .panel-heading { padding: 20px 18px 16px; }
  .jobs-table td, .jobs-table th { padding-inline: 18px; }
  .empty-state { margin-inline: 18px; }
  .panel-note { padding-inline: 18px; }
  .adapter-list { display: block; padding-inline: 18px; }
  .adapter-list li { flex-direction: row; align-items: center; }
  .connection-note { margin-inline: 18px; }
  .workflow-counts { padding-inline: 18px; gap: 10px; }
  .error-state { padding: 24px; }
}
@media (max-width: 360px) {
  .metrics { grid-template-columns: minmax(0, 1fr); }
  .metric { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; }
  .metric strong { grid-column: 2; grid-row: 1 / 3; align-self: center; margin: 0; }
  .nav-link { font-size: 12px; }
}
