/* Seitenwacht V0.11 — Brand- und Dashboard-Redesign */
/* Lokal geladen: keine Font-Anfrage an fremde Server. */
@font-face {
  font-family: Inter;
  src: url('/static/InterVariable.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --ink: #0f172a;
  --muted: #64708b;
  --paper: #f6f8fd;
  --card: #ffffff;
  --green: #15805d;
  --lime: #dff8ed;
  --line: #e5e7eb;
  --red: #dc4c4c;
  --amber: #c18418;
  --indigo: #1e2a8a;
  --cobalt: #3b82f6;
  --violet: #8b5cf6;
  --slate: #0f172a;
  --mist: #e5e7eb;
  --soft-indigo: #eef1ff;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(30,42,138,.045);
  --shadow-md: 0 18px 50px rgba(18,28,82,.09);
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body,
body.app-body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 95% 3%, rgba(139,92,246,.07), transparent 24rem),
    var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -.005em;
}

a { color: var(--indigo); }
h1,h2,h3,h4 { color: var(--ink); font-family: inherit; letter-spacing: -.035em; }
h1 { margin: 6px 0 10px; font-size: clamp(34px,4vw,50px); font-weight: 750; line-height: 1.05; }
h2 { margin: 0 0 14px; font-size: 24px; font-weight: 750; line-height: 1.2; }
h3 { font-size: 18px; }
.eyebrow { margin: 0 0 8px; color: #6474a5; font-size: 12px; font-weight: 800; letter-spacing: .2em; }
.hint,.muted { color: var(--muted); }

.app-layout { display: grid; grid-template-columns: 256px minmax(0,1fr); min-height: 100vh; }
.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: 256px;
  display: flex;
  flex-direction: column;
  padding: 22px 18px;
  background:
    radial-gradient(circle at 110% 85%, rgba(139,92,246,.32), transparent 48%),
    linear-gradient(160deg,#111a4d 0%,#0b1336 58%,#080e27 100%);
  color: #fff;
  box-shadow: 12px 0 40px rgba(11,19,54,.08);
}
.brand-lockup {
  display: flex;
  height: 68px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 15px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 8px 25px rgba(0,0,0,.12);
}
.brand-lockup img { display: block; width: 220px; height: auto; }
.sidebar-label { margin: 34px 14px 12px; color: #8e99c9; font-size: 11px; font-weight: 800; letter-spacing: .2em; }
.side-nav { display: grid; gap: 7px; }
.side-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 13px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #cfd6fa;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  transition: background .18s ease,color .18s ease,transform .18s ease;
}
.side-nav a:hover { background: rgba(255,255,255,.075); color: #fff; transform: translateX(2px); }
.side-nav a.active { border-color: rgba(139,92,246,.28); background: linear-gradient(110deg,rgba(59,130,246,.2),rgba(139,92,246,.16)); color: #fff; box-shadow: inset 3px 0 var(--cobalt); }
.nav-icon { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; color: #aebaff; font-size: 15px; }
.side-nav a.active .nav-icon { border-color: rgba(255,255,255,.19); background: rgba(255,255,255,.08); color: #fff; }
.sidebar-foot { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 16px 12px 2px; border-top: 1px solid rgba(255,255,255,.09); }
.sidebar-foot div { display: grid; }
.sidebar-foot strong { font-size: 13px; }
.sidebar-foot small { color: #8e99c9; font-size: 11px; }
.system-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: #28c68a; box-shadow: 0 0 0 5px rgba(40,198,138,.12); }

.app-workspace { grid-column: 2; min-width: 0; }
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  width: 100%;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
  padding: 0 clamp(24px,4vw,58px);
  border-bottom: 1px solid rgba(226,230,241,.85);
  background: rgba(250,251,255,.86);
  backdrop-filter: blur(16px);
}
.mobile-brand,.mobile-nav { display: none; }
.topbar-status { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; font-weight: 650; }
.app-topbar form { margin: 0; }
.account-button { display: flex; align-items: center; gap: 9px; padding: 0; border: 0; background: transparent; color: var(--ink); }
.account-button span { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 50%; background: linear-gradient(145deg,var(--indigo),#121a58); color: #fff; box-shadow: 0 6px 16px rgba(30,42,138,.24); }
.account-button i { color: var(--muted); font-size: 13px; font-style: normal; font-weight: 650; }

main,
.app-main { width: 100%; max-width: 1500px; margin: 0 auto; padding: 42px clamp(24px,4vw,58px) 80px; }
.app-main > section { margin: 0 0 38px; }
.app-footer { display: flex; justify-content: space-between; gap: 20px; padding: 24px clamp(24px,4vw,58px); border-top: 1px solid var(--line); color: #7d879f; font-size: 12px; }
.app-footer span:first-child { color: var(--indigo); font-weight: 800; }

button,.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: linear-gradient(135deg,var(--indigo),#3348c7);
  color: #fff;
  font: 750 14px/1.2 inherit;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(30,42,138,.16);
  cursor: pointer;
  transition: transform .16s ease,box-shadow .16s ease,border-color .16s ease;
}
button:hover,.button:hover { transform: translateY(-1px); box-shadow: 0 11px 24px rgba(30,42,138,.22); }
button.secondary,.button.secondary { border-color: #d8ddeb; background: #fff; color: var(--indigo); box-shadow: 0 4px 14px rgba(30,42,138,.055); }
button.danger-button,.danger-action { background: var(--red); }
.disabled-button { opacity: .55; cursor: not-allowed; }

.dashboard-heading,.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin: 0 0 26px; }
.dashboard-heading > div:first-child > p:last-child,.page-head p { margin: 0; color: var(--muted); font-size: 16px; }
.dashboard-actions,.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.dashboard-actions form,.actions form { margin: 0; }
.button-help { display: block; color: var(--muted); }

.status-ribbon {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  margin-bottom: 22px !important;
  padding: 13px 18px;
  border: 1px solid #e0e4f1;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.status-ribbon.active { border-color: #cfe9df; background: linear-gradient(90deg,#f3fcf8,#fff 52%); }
.status-ribbon .pulse-dot { width: 10px; height: 10px; border-radius: 50%; background: #9ca3af; }
.status-ribbon.active .pulse-dot { background: #20a979; box-shadow: 0 0 0 6px rgba(32,169,121,.12); }
.status-ribbon div { display: grid; }
.status-ribbon strong { font-size: 14px; }
.status-ribbon small { color: var(--muted); font-size: 12px; }
.status-ribbon a { color: var(--indigo); font-size: 13px; font-weight: 750; text-decoration: none; }

.primary-kpis { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.primary-kpis > a {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 12px;
  min-height: 132px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid #e2e6f0;
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease,border-color .16s ease,box-shadow .16s ease;
}
.primary-kpis > a:after { position: absolute; right: -22px; bottom: -30px; width: 90px; height: 90px; border-radius: 50%; background: rgba(59,130,246,.04); content: ""; }
.primary-kpis > a:hover { transform: translateY(-2px); border-color: #c8d1f3; box-shadow: var(--shadow-md); }
.primary-kpis div { display: grid; }
.primary-kpis small { color: #65708a; font-size: 13px; font-weight: 700; }
.primary-kpis strong { margin: 4px 0 -2px; font-size: 30px; line-height: 1; }
.primary-kpis p { margin: 7px 0 0; color: #7b859b; font-size: 12px; }
.primary-kpis b { color: #95a0ba; font-weight: 500; }
.kpi-icon { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 9px; font-size: 17px; }
.kpi-icon.cobalt { background: #eaf2ff; color: var(--cobalt); }
.kpi-icon.violet { background: #f1ebff; color: var(--violet); }
.kpi-icon.green { background: #e8f8f2; color: var(--green); }
.kpi-icon.red { background: #fff0f0; color: var(--red); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(300px,.75fr); align-items: start; gap: 22px; }
.section-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.section-title-row h2 { margin: 0; }
.section-title-row > a,.section-title-meta > a { color: var(--indigo); font-size: 13px; font-weight: 750; text-decoration: none; }
.site-status-list,.health-summary { overflow: hidden; border: 1px solid #e2e6f0; border-radius: 13px; background: #fff; box-shadow: var(--shadow-sm); }
.site-status-list > a { display: grid; grid-template-columns: auto minmax(120px,1fr) auto auto auto; align-items: center; gap: 13px; min-height: 72px; padding: 12px 16px; border-bottom: 1px solid #edf0f6; color: var(--ink); text-decoration: none; }
.site-status-list > a:last-child { border-bottom: 0; }
.site-status-list > a:hover { background: #f8f9ff; }
.site-status-list div { display: grid; min-width: 0; }
.site-status-list div strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.site-status-list div small,.site-meta { color: var(--muted); font-size: 12px; }
.site-avatar { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid #dfe4f6; border-radius: 50%; background: #f4f6ff; color: var(--indigo); font-size: 13px; font-weight: 800; }
.row-arrow { color: #9ba5ba; }
.health-summary { display: grid; grid-template-columns: 1fr 1fr; }
.health-summary a { display: flex; min-height: 82px; flex-direction: column; justify-content: center; padding: 14px 16px; border-right: 1px solid #edf0f6; border-bottom: 1px solid #edf0f6; color: var(--ink); text-decoration: none; }
.health-summary a:nth-child(2n) { border-right: 0; }
.health-summary a:nth-last-child(-n+2) { border-bottom: 0; }
.health-summary span { color: var(--muted); font-size: 12px; }
.health-summary strong { margin-top: 5px; font-size: 23px; }
.mailbox-mini { display: flex; gap: 13px; margin-top: 14px; padding: 17px; border: 1px solid #e0e4f1; border-radius: 13px; background: linear-gradient(135deg,#fff,#f4f6ff); }
.mailbox-mini > span { display: grid; flex: 0 0 auto; width: 38px; height: 38px; place-items: center; border-radius: 50%; background: var(--soft-indigo); color: var(--indigo); font-weight: 800; }
.mailbox-mini.ready > span { background: #e5f7ef; color: var(--green); }
.mailbox-mini div { min-width: 0; }
.mailbox-mini strong { font-size: 14px; }
.mailbox-mini p { margin: 3px 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.mailbox-mini a { font-size: 12px; font-weight: 750; text-decoration: none; }

.panel,.site-card,.form-card,.history article,.problem-list article,.recovery-list article,.redirect-list article,.visual-card {
  border: 1px solid #e2e6f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.panel { margin: 20px 0 34px; padding: 24px; }
.cards { gap: 14px; }
.site-card,.form-card { padding: 20px; }
.site-card:hover,.form-card:hover { border-color: #bfc9ef; box-shadow: var(--shadow-md); }
.site-card p,.form-card p { color: var(--muted); }
.site-health { display: block; margin-top: 10px; font-size: 13px; font-weight: 750; }

.table { border: 1px solid #e2e6f0; border-radius: 13px; background: #fff; box-shadow: var(--shadow-sm); }
.tr { min-height: 58px; align-items: center; padding: 13px 16px; border-color: #edf0f6; }
.tr:hover:not(.head) { background: #fafbff; }
.tr a { color: var(--indigo); font-weight: 650; text-decoration: none; }
.head { min-height: 44px; background: #f8f9fc; color: #7a849c; font-size: 11px; letter-spacing: .07em; }
.badge,.type { display: inline-flex; width: max-content; align-items: center; border-radius: 999px; padding: 5px 9px; font-size: 10px; letter-spacing: .03em; }
.badge.success { background: #e4f7ef; color: #137755; }
.badge.warning { background: #fff4db; color: #9c6811; }
.badge.failure { background: #ffe8e8; color: #bd3939; }
.badge.neutral { background: #edf0f5; color: #687287; }

.alert,.verified { border: 1px solid transparent; border-radius: 11px; padding: 14px 17px; }
.alert.success,.verified { border-color: #c8e9dc; background: #eefaf5; color: #116d4e; }
.alert.failure { border-color: #f2c7c7; background: #fff2f2; color: #b23434; }
.automation-status,.email-check-card,.schedule-summary,.current-note,.explain-warning,.skipped-links-notice,.resolved-box { border-radius: 13px; box-shadow: none; }

.page-head h1 { font-size: clamp(32px,4vw,46px); }
.page-head > div:first-child { min-width: 0; }
.page-head p { overflow-wrap: anywhere; }
.back { display: inline-flex; margin-bottom: 16px; color: var(--indigo); font-size: 13px; font-weight: 750; text-decoration: none; }
.page-tabs,.result-tabs,.report-tabs,.filter-bar,.result-website-tabs { scrollbar-width: thin; }
.page-tabs { gap: 4px; padding: 6px; border: 1px solid #e0e4ef; border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
.page-tabs a { border-radius: 8px; color: #69748b; font-size: 13px; font-weight: 700; }
.page-tabs a.active { background: linear-gradient(135deg,var(--indigo),#3348c7); color: #fff; box-shadow: 0 6px 16px rgba(30,42,138,.18); }
.page-tabs a strong { opacity: .75; }
.result-tabs { border-color: #e0e4ef; background: #fff; }
.result-tabs a,.filter-bar a,.report-tabs a,.result-website-tabs a { color: #68738b; }
.result-tabs a.active,.filter-bar a.active,.report-tabs a.active,.result-website-tabs a.active { color: var(--indigo); border-color: var(--indigo); background: #f1f3ff; }

label { color: #34405a; font-size: 13px; font-weight: 700; }
input,select,textarea { width: 100%; border: 1px solid #d7ddea; border-radius: 9px; background: #fff; color: var(--ink); font: inherit; outline: none; }
input,select { min-height: 44px; }
input:focus,select:focus,textarea:focus { border-color: var(--cobalt); box-shadow: 0 0 0 4px rgba(59,130,246,.11); }
input[type="checkbox"] { width: 18px; min-height: 18px; accent-color: var(--indigo); }
.check-settings,.settings-form { gap: 17px; }
.setting-group { border-color: #e4e8f2; border-radius: 12px; background: #fafbfe; }
.danger-zone { border-color: #f1d3d3; border-radius: 13px; background: #fff8f8; }

.visual-cards { gap: 18px; }
.visual-card { overflow: hidden; }
.visual-card > header { width: auto; height: auto; padding: 16px 18px; border-bottom: 1px solid #e9edf4; background: #fff; }
.visual-card > footer { border-top: 1px solid #e9edf4; background: #fafbfe; }
.screenshot-link { overflow: hidden; border: 1px solid #e0e4ed; border-radius: 10px; background: #f2f4f9; }
.screenshot-link img { transition: transform .25s ease; }
.screenshot-link:hover img { transform: scale(1.015); }

.history { gap: 11px; }
.history article { padding: 18px; }
.problem-list,.recovery-list,.redirect-list { gap: 10px; }
.problem-list article,.recovery-list article,.redirect-list article { padding: 18px; }
details summary { color: var(--indigo); font-weight: 700; cursor: pointer; }
pre { border: 1px solid #e0e4ed; border-radius: 9px; background: #f7f8fb; color: #47526a; }
.empty { border-color: #d7ddeb; border-radius: 13px; background: rgba(255,255,255,.65); }
.pagination a { border-color: #dce1ec; color: var(--indigo); }
.pagination a.active { background: var(--indigo); color: #fff; }

body:not(.app-body) { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: radial-gradient(circle at 15% 10%,rgba(59,130,246,.13),transparent 28rem),radial-gradient(circle at 90% 90%,rgba(139,92,246,.13),transparent 30rem),#f7f9fe; }
body:not(.app-body) main.container.login-shell { width: min(460px,100%); margin: 0; padding: 0; }
.login-panel { position: relative; padding: 40px; overflow: hidden; border: 1px solid rgba(210,216,235,.9); border-radius: 18px; box-shadow: 0 30px 80px rgba(20,31,92,.14); }
.login-panel:before { position: absolute; inset: 0 0 auto; height: 5px; background: linear-gradient(90deg,var(--indigo),var(--cobalt),var(--violet)); content: ""; }
.login-logo { display: block; width: min(320px,100%); height: auto; margin: -18px auto -8px; }
.login-panel h1 { margin-top: 10px; font-size: 38px; }
.login-panel .stack { gap: 16px; }
.login-panel button { width: 100%; margin-top: 5px; }

@media (max-width: 1180px) {
  .primary-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-side { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .dashboard-side > .section-title-row { grid-column: 1/-1; margin-bottom: 0; }
  .mailbox-mini { margin-top: 0; }
}

@media (max-width: 900px) {
  .app-layout { display: block; }
  .app-sidebar { display: none; }
  .app-workspace { min-width: 0; }
  .app-topbar { height: auto; min-height: 72px; flex-wrap: wrap; justify-content: space-between; padding: 9px 20px; }
  .mobile-brand { display: flex; width: 180px; height: 48px; align-items: center; overflow: hidden; }
  .mobile-brand img { width: 180px; height: auto; }
  .mobile-nav { order: 3; display: flex; width: 100%; gap: 4px; overflow-x: auto; padding-top: 7px; border-top: 1px solid #e7eaf1; }
  .mobile-nav a { flex: 1 0 auto; padding: 8px 10px; color: #59657e; font-size: 12px; font-weight: 700; text-align: center; text-decoration: none; }
  .topbar-status { display: none; }
  .account-button i { display: none; }
  .app-main { padding-top: 28px; }
  .dashboard-heading,.page-head { align-items: flex-start; flex-direction: column; }
  .dashboard-actions,.actions { width: 100%; justify-content: flex-start; }
  .page-tabs { overflow-x: auto; }
  .page-tabs a { flex: 0 0 auto; }
}

@media (max-width: 680px) {
  body,body.app-body { font-size: 16px; }
  .app-main { padding: 24px 16px 60px; }
  .app-footer { align-items: flex-start; flex-direction: column; padding: 22px 16px; }
  h1 { font-size: 34px; }
  h2 { font-size: 21px; }
  .dashboard-actions,.actions { display: grid; grid-template-columns: 1fr; }
  .dashboard-actions a,.dashboard-actions button,.actions button { width: 100%; }
  .primary-kpis { grid-template-columns: 1fr; }
  .primary-kpis > a { min-height: 108px; }
  .status-ribbon { grid-template-columns: auto 1fr; }
  .status-ribbon > a { grid-column: 2; }
  .dashboard-side { display: block; }
  .mailbox-mini { margin-top: 14px; }
  .site-status-list > a { grid-template-columns: auto minmax(0,1fr) auto; }
  .site-status-list .site-meta,.site-status-list .row-arrow { display: none; }
  .section-title-row { align-items: flex-start; flex-direction: column; gap: 6px; }
  .panel { padding: 18px; }
  .cards { grid-template-columns: 1fr; }
  .tr { grid-template-columns: minmax(0,1fr) auto; gap: 10px; }
  .tr > span:nth-child(2),.tr > span:nth-child(3) { display: none; }
  .visual-views { grid-template-columns: 1fr; }
  .login-panel { padding: 28px 22px; }
  .login-logo { margin-top: -10px; }
}
