/* SEO & KI Autopilot 1.5.24 · Grundlage der Portalstruktur */
:root {
  --portal-navy: #001b2a;
  --portal-navy-blue: #00264d;
  --portal-primary: #003caa;
  --portal-primary-hover: #002e86;
  --portal-blue: #1f5ce0;
  --portal-blue-light: #4b7dff;
  --portal-cyan: #7cd7ff;
  --portal-mint: #a9f6e9;
  --portal-soft-blue: #e6edff;
  --portal-page: #f6f8fc;
  --portal-card: #fff;
  --portal-ink: #0f1b2d;
  --portal-text: #344258;
  --portal-muted: #66758c;
  --portal-line: #e4e9f2;
  --portal-line-strong: #d3dbea;
  --portal-sidebar-width: 268px;
  --portal-header-height: 72px;
  --portal-shadow: 0 7px 22px rgb(15 27 45 / 6%);
  --portal-shadow-lg: 0 18px 50px rgb(0 27 42 / 12%);
}

/* Main portal frame */
.app-body {
  margin: 0;
  background: var(--portal-page);
  color: var(--portal-text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
.app-body *, .app-body *::before, .app-body *::after { box-sizing: border-box; }
.app-body h1, .app-body h2, .app-body h3 { color: var(--portal-ink); font-family: "Plus Jakarta Sans", Inter, sans-serif; line-height: 1.2; letter-spacing: -.025em; }
.app-body h1 { font-size: clamp(1.7rem, 2.4vw, 2.15rem); font-weight: 800; }
.app-body h2 { font-size: clamp(1.2rem, 1.7vw, 1.48rem); font-weight: 700; }
.app-body h3 { font-size: 1rem; font-weight: 700; }
.app-body .brand-logo-frame img, .auth-body .brand-logo-frame img, .install-body .brand-logo-frame img { width: 75%; height: 75%; max-width: 100%; object-fit: contain; object-position: center; }
.app-shell { min-height: 100vh; grid-template-columns: var(--portal-sidebar-width) minmax(0, 1fr); grid-template-rows: var(--portal-header-height) minmax(0, 1fr); }
.app-header {
  position: sticky;
  top: 0;
  z-index: 160;
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  min-width: 0;
  min-height: var(--portal-header-height);
  align-items: center;
  gap: 18px;
  border: 0;
  border-bottom: 1px solid var(--portal-line);
  background: rgb(255 255 255 / 97%);
  padding: 0 clamp(16px, 2vw, 30px);
  box-shadow: 0 3px 18px rgb(15 27 45 / 5%);
  backdrop-filter: blur(14px);
}
.app-header-brand { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 10px; color: var(--portal-ink); text-decoration: none; }
.app-header-brand .brand-logo-frame { display: grid; width: 41px; height: 41px; place-items: center; overflow: hidden; border: 1px solid var(--portal-line); border-radius: 11px; background: #fff; box-shadow: 0 4px 13px rgb(15 27 45 / 7%); }
.app-header-brand img { width: 30px; height: 30px; object-fit: contain; }
.app-header-brand > span:last-child { display: grid; line-height: 1; }
.app-header-brand strong { color: var(--portal-navy); font-size: 15px; font-weight: 780; }
.app-header-brand small { margin-top: 4px; color: var(--portal-primary); font-size: 9.5px; font-weight: 760; letter-spacing: .12em; text-transform: uppercase; }
.context-picker { display: grid; min-width: 150px; border-left: 1px solid var(--portal-line); padding-left: 18px; line-height: 1.2; }
.context-picker strong { overflow: hidden; color: var(--portal-ink); font-size: 12.5px; font-weight: 690; text-overflow: ellipsis; white-space: nowrap; }
.context-picker span { overflow: hidden; margin-top: 4px; color: var(--portal-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.header-search { width: min(410px, 34vw); margin-right: auto; }
.search-input { width: 100%; min-height: 40px; border: 1px solid var(--portal-line); border-radius: 10px; background: var(--portal-page); padding: 9px 13px 9px 38px; color: var(--portal-ink); font: inherit; font-size: 12.5px; box-shadow: none; }
.header-search { position: relative; }
.header-search::before { position: absolute; top: 50%; left: 14px; z-index: 1; transform: translateY(-50%); color: var(--portal-muted); content: "⌕"; font-size: 17px; pointer-events: none; }
.search-input:focus { border-color: var(--portal-blue); outline: 3px solid rgb(31 92 224 / 12%); background: #fff; }
.header-actions { display: flex; min-width: 0; align-items: center; gap: 9px; }
.header-actions form { margin: 0; }
.icon-button { display: inline-grid; width: 39px; height: 39px; place-items: center; border: 1px solid var(--portal-line); border-radius: 10px; background: #fff; color: var(--portal-text); font: inherit; text-decoration: none; cursor: pointer; }
.mobile-nav-button { display: none; }
.icon-button:hover { border-color: #becdf0; background: var(--portal-soft-blue); color: var(--portal-primary); }
.notification-link { position: relative; }
.notification-count { position: absolute; top: -5px; right: -5px; display: grid; min-width: 18px; height: 18px; place-items: center; border: 2px solid #fff; border-radius: 999px; background: var(--portal-primary); color: #fff; font-size: 8px; font-weight: 800; }
.user-chip { display: inline-flex; min-width: 0; align-items: center; gap: 8px; border-radius: 10px; padding: 3px 7px 3px 3px; color: var(--portal-ink); font-size: 12px; font-weight: 650; text-decoration: none; }
.user-chip:hover { background: var(--portal-page); color: var(--portal-primary); }
.user-avatar { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: linear-gradient(145deg, var(--portal-primary), var(--portal-blue-light)); color: #fff; font-size: 12px; font-weight: 780; }

/* Dark Kompass-style navigation */
.app-sidebar {
  position: sticky;
  top: var(--portal-header-height);
  z-index: 140;
  grid-column: 1;
  grid-row: 2;
  height: calc(100vh - var(--portal-header-height));
  overflow-y: auto;
  border: 0;
  border-right: 1px solid rgb(255 255 255 / 8%);
  background: linear-gradient(180deg, var(--portal-navy) 0%, var(--portal-navy-blue) 100%);
  color: #c6d6e4;
  padding: 20px 14px 28px;
  box-shadow: 8px 0 28px rgb(0 27 42 / 8%);
  scrollbar-color: rgb(169 246 233 / 30%) transparent;
}
.sidebar-brand { display: none; }
.sidebar-close { display: none; }
.app-nav { display: grid; gap: 4px; margin: 0; }
.app-nav a { display: flex; min-height: 42px; align-items: center; gap: 11px; border: 1px solid transparent; border-radius: 10px; padding: 8px 11px; color: #c6d6e4; font-size: 12.5px; font-weight: 560; text-decoration: none; transition: background .14s ease, color .14s ease, transform .14s ease; }
.app-nav a:hover { transform: translateX(2px); background: rgb(255 255 255 / 8%); color: #fff; }
.app-nav a[aria-current="page"] { background: var(--portal-primary); color: #fff; font-weight: 700; box-shadow: 0 8px 18px rgb(0 12 30 / 22%); }
.nav-icon { display: grid; width: 25px; height: 25px; flex: 0 0 auto; place-items: center; border-radius: 7px; background: rgb(255 255 255 / 7%); color: var(--portal-cyan); font-size: 13px; line-height: 1; }
.app-nav a[aria-current="page"] .nav-icon { background: rgb(255 255 255 / 16%); color: var(--portal-mint); }
.nav-section { margin: 18px 10px 7px; color: #7190a8; font-size: 9.5px; font-weight: 760; letter-spacing: .13em; text-transform: uppercase; }
.nav-section:first-child { margin-top: 4px; }

/* Page canvas and reusable content */
.app-main { grid-column: 2; grid-row: 2; min-width: 0; background: var(--portal-page); padding: clamp(18px, 2.7vw, 36px); }
.app-body.has-platform-banner .app-main { padding-top: clamp(18px, 2.7vw, 36px); }
.app-main > .platform-status-banner { width: 100%; margin: 0 0 17px; }
.page-container { width: min(1540px, 100%); margin-inline: auto; }
.page-heading { position: relative; margin-bottom: 22px; border-bottom: 1px solid var(--portal-line); padding: 2px 0 18px 15px; }
.page-heading::before { position: absolute; top: 3px; bottom: 18px; left: 0; width: 4px; border-radius: 999px; background: linear-gradient(var(--portal-primary), var(--portal-cyan)); content: ""; }
.page-heading h1 { margin: 0 0 5px; }
.page-heading p { max-width: 82ch; margin: 0; color: var(--portal-muted); font-size: 13px; line-height: 1.55; }
.page-heading .button, .page-heading-actions { align-self: center; }
.content-grid { gap: 17px; }
.metric-grid { gap: 14px; margin-bottom: 18px; }
.panel, .metric-card {
  border: 1px solid var(--portal-line);
  border-radius: 14px;
  background: var(--portal-card);
  box-shadow: var(--portal-shadow);
}
.panel { padding: clamp(17px, 1.7vw, 23px); }
.panel[id] { scroll-margin-top: 90px; }
.metric-card { position: relative; overflow: hidden; min-height: 126px; padding: 19px; }
.metric-card::before { position: absolute; top: 0; right: 0; left: 0; height: 3px; background: linear-gradient(90deg, var(--portal-primary), var(--portal-cyan)); content: ""; opacity: .82; }
.metric-card p, .metric-card small { color: var(--portal-muted); }
.metric-card > p:first-child, .metric-label { color: var(--portal-muted); font-size: 10px; font-weight: 740; letter-spacing: .075em; text-transform: uppercase; }
.metric-value strong, .metric-card > strong { color: var(--portal-ink); font-size: clamp(1.55rem, 2.2vw, 2rem); font-weight: 740; letter-spacing: -.035em; }
.panel-header { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin: -2px 0 16px; border-bottom: 1px solid var(--portal-line); padding: 0 0 13px; }
.panel > summary.panel-header { cursor: pointer; }
.panel > summary.panel-header > span:first-child { display: grid; min-width: 0; gap: 5px; }
.panel > summary.panel-header > span:first-child > strong,
.panel > summary.panel-header > span:first-child > small { display: block; min-width: 0; overflow-wrap: anywhere; }
.panel > summary.panel-header > span:first-child > small { color: var(--portal-muted); font-size: 12px; font-weight: 520; line-height: 1.5; }
.panel-header h2, .panel-header h3 { margin: 0; color: var(--portal-ink); }
.panel-header p { margin: 4px 0 0; color: var(--portal-muted); font-size: 12px; }
.panel h2:first-child, .panel h3:first-child { color: var(--portal-ink); }
.panel-empty, .empty-state { border: 1px dashed var(--portal-line-strong); border-radius: 12px; background: var(--portal-page); color: var(--portal-muted); }
.status-badge, .badge { display: inline-flex; min-height: 24px; align-items: center; border: 1px solid #cbd8f4; border-radius: 999px; background: #edf2ff; padding: 3px 9px; color: var(--portal-primary); font-size: 9.5px; font-weight: 750; }
.status-success { border-color: #bceadd; background: #edfbf7; color: #08765f; }
.status-warning { border-color: #f1d7a6; background: #fff8e9; color: #8a5a00; }
.status-danger, .status-error { border-color: #f2c7ce; background: #fff1f3; color: #a32037; }
.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 9px; background: var(--portal-primary); padding: 9px 15px; color: #fff; font: inherit; font-size: 12px; font-weight: 700; line-height: 1.15; text-decoration: none; cursor: pointer; box-shadow: 0 7px 16px rgb(0 60 170 / 15%); }
.button:hover { background: var(--portal-primary-hover); color: #fff; }
.button-secondary, .button-outline { border-color: var(--portal-line-strong); background: #fff; color: var(--portal-primary); box-shadow: none; }
.button-secondary:hover, .button-outline:hover { border-color: #b8c8ed; background: var(--portal-soft-blue); color: var(--portal-primary-hover); }
.button-danger { background: #b4233a; color: #fff; }
.button-small { min-height: 33px; padding: 7px 11px; font-size: 10.5px; }
.field label, .form-field label { color: var(--portal-ink); font-size: 11.5px; font-weight: 680; }
.field input, .field select, .field textarea, .form-field input, .form-field select, .form-field textarea, .admin-control-row input, .admin-control-row select {
  border: 1px solid var(--portal-line-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--portal-ink);
  font: inherit;
  box-shadow: none;
}
.field input:focus, .field select:focus, .field textarea:focus, .form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--portal-blue); outline: 3px solid rgb(31 92 224 / 11%); }
.data-table-wrap, .table-wrap { overflow: auto; border: 1px solid var(--portal-line); border-radius: 12px; }
.data-table { width: 100%; border-collapse: collapse; background: #fff; font-size: 12px; }
.data-table th { background: #f1f4fa; color: #536278; font-size: 9.5px; font-weight: 770; letter-spacing: .05em; text-transform: uppercase; }
.data-table th, .data-table td { border-bottom: 1px solid var(--portal-line); padding: 11px 12px; text-align: left; vertical-align: middle; }
.data-table tbody tr:hover { background: #f8faff; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.admin-link-grid { gap: 10px; }
.admin-link-grid a { border: 1px solid var(--portal-line); border-radius: 11px; background: #fff; color: var(--portal-primary); font-size: 12px; font-weight: 680; box-shadow: 0 4px 12px rgb(15 27 45 / 4%); }
.admin-link-grid a:hover { transform: translateY(-1px); border-color: #b8c8ed; background: var(--portal-soft-blue); }
.admin-control-row { border-bottom-color: var(--portal-line); }
.admin-inline-editor > summary { color: var(--portal-primary); font-weight: 680; }
.admin-inline-editor > form { border: 1px solid var(--portal-line); border-radius: 13px; background: #fff; box-shadow: var(--portal-shadow-lg); }
.callout, .alert { border-radius: 11px; }
.tabs, .tab-list { border-bottom-color: var(--portal-line); }
.tabs a, .tab-list a { color: var(--portal-muted); }
.tabs a[aria-current="page"], .tab-list a[aria-current="page"] { border-color: var(--portal-primary); color: var(--portal-primary); }

/* Authentication in the same product family */
.auth-body-premium {
  min-height: 100vh;
  background:
    radial-gradient(circle at 84% 13%, rgb(124 215 255 / 20%), transparent 28%),
    linear-gradient(135deg, var(--portal-navy) 0%, var(--portal-navy-blue) 52%, var(--portal-primary) 150%);
  color: var(--portal-text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.auth-header { position: relative; z-index: 2; min-height: 72px; border-bottom: 1px solid rgb(255 255 255 / 12%); background: transparent; padding: 0 clamp(18px, 4vw, 56px); }
.auth-product-brand { color: #fff; }
.auth-product-brand strong { color: #fff; }
.auth-product-brand small { color: var(--portal-mint); }
.auth-product-brand .brand-logo-frame { border-color: rgb(255 255 255 / 18%); background: #fff; }
.auth-home-link { border: 1px solid rgb(255 255 255 / 25%); border-radius: 9px; padding: 8px 13px; color: #fff; text-decoration: none; }
.auth-home-link:hover { background: rgb(255 255 255 / 9%); color: var(--portal-mint); }
.auth-main { position: relative; z-index: 1; min-height: calc(100vh - 72px); padding: clamp(36px, 7vh, 74px) 18px; }
.auth-content-stack { width: min(500px, 100%); }
.auth-card { border: 1px solid rgb(255 255 255 / 50%); border-radius: 20px; background: #fff; box-shadow: 0 28px 70px rgb(0 12 30 / 32%); }
.auth-card h1 { color: var(--portal-ink); letter-spacing: -.035em; }
.auth-card h1, .auth-card h2, .auth-card h3 { font-family: "Plus Jakarta Sans", Inter, sans-serif; }
.auth-card p { color: var(--portal-muted); }
.auth-developer-proof { border: 1px solid #cddbf4; border-radius: 13px; background: #eef4ff; box-shadow: 0 7px 22px rgb(15 27 45 / 6%); }
.auth-developer-proof > span { background: var(--portal-mint); color: var(--portal-navy); }
.auth-developer-proof p, .auth-developer-proof small { color: var(--portal-muted); }
.auth-developer-proof strong { color: var(--portal-ink); }
.auth-legal-links, .auth-legal-links a { color: var(--portal-muted); }
.auth-legal-links a:hover { color: var(--portal-mint); }

/* Installer */
.install-body { background: var(--portal-page); color: var(--portal-text); font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.install-header { border-bottom: 1px solid var(--portal-line); background: #fff; box-shadow: 0 3px 18px rgb(15 27 45 / 5%); }
.install-header .eyebrow { color: var(--portal-primary); }
.install-shell { width: min(1320px, 100%); }
.install-intro h1 { color: var(--portal-ink); }
.install-intro h1, .install-panel h2, .install-panel h3, .success-panel h1 { font-family: "Plus Jakarta Sans", Inter, sans-serif; }
.install-panel, .success-panel { border: 1px solid var(--portal-line); border-radius: 16px; background: #fff; box-shadow: var(--portal-shadow); }
.step-number { border: 0; background: var(--portal-primary); color: #fff; }
.check-item, .database-card { border-color: var(--portal-line); border-radius: 12px; background: var(--portal-page); }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 236px minmax(0, 1fr); }
  .header-search { width: min(330px, 28vw); }
  .context-picker { min-width: 120px; }
  .user-chip > span:last-child { display: none; }
}

@media (max-width: 820px) {
  .app-shell { display: grid; grid-template-columns: 1fr; grid-template-rows: var(--portal-header-height) minmax(0, 1fr); }
  .app-header { grid-column: 1; }
  .app-sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 300; width: min(292px, 86vw); height: 100vh; transform: translateX(-105%); padding-top: 62px; box-shadow: 18px 0 55px rgb(0 12 30 / 35%); transition: transform .2s ease; }
  .app-sidebar[data-open="true"] { transform: translateX(0); }
  .sidebar-close { position: absolute; top: 12px; right: 12px; display: grid; border-color: rgb(255 255 255 / 15%); background: rgb(255 255 255 / 7%); color: #fff; }
  .mobile-nav-button { display: grid; flex: 0 0 auto; }
  .app-main { grid-column: 1; grid-row: 2; }
  .context-picker { display: none; }
  .header-search { width: min(340px, 42vw); }
}

@media (max-width: 600px) {
  .app-header { gap: 8px; padding: 0 11px; }
  .app-header-brand > span:last-child, .header-search { display: none; }
  .header-actions { margin-left: auto; }
  .header-actions > .status-badge, .header-actions > .user-chip { display: none; }
  .app-main { padding: 15px 12px 28px; }
  .page-heading { padding-left: 12px; }
  .metric-grid { grid-template-columns: 1fr; }
  .panel { padding: 15px 13px; }
  .panel-header { display: grid; gap: 10px; }
  .button { width: 100%; }
  .data-table-wrap, .table-wrap { margin-inline: -4px; }
  .auth-header { padding-inline: 14px; }
  .auth-home-link { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .app-body *, .auth-body *, .install-body * { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
