*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #F4F2EE;
  --surface:   #FFFFFF;
  --card:      #FFFFFF;
  --sidebar:   #1A1916;
  --sidebar-h: #2A2824;
  --border:    #E2DED7;
  --text:      #1A1916;
  --muted:     #7A7670;
  --accent:    #2A5EF5;
  --accent-h:  #1A4ED8;
  --success:   #2E8B57;
  --warning:   #C47A1A;
  --danger:    #D94040;
  --radius:    10px;
  --sidebar-w: 260px;
  --topbar-h:  56px;
}

body {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar);
  color: #E8E5E0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.25s ease;
}

.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-icon svg { width: 17px; height: 17px; fill: #fff; }
.logo-name { font-size: 14px; font-weight: 600; color: #fff; }
.logo-env  { font-size: 10px; font-family: 'DM Mono', monospace; color: rgba(255,255,255,0.35); margin-top: 1px; }

.sidebar-section {
  padding: 16px 12px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  margin: 1px 8px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13.5px;
  color: rgba(255,255,255,0.65);
  transition: background 0.12s, color 0.12s;
  text-decoration: none;
}
.nav-item:hover { background: var(--sidebar-h); color: #fff; }
.nav-item.active { background: rgba(42,94,245,0.25); color: #fff; }
.nav-item svg { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.7; }
.nav-item.active svg, .nav-item:hover svg { opacity: 1; }

.nav-item-org {
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 25px;
  margin: -4px 8px 2px;
}

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-left: auto;
  flex-shrink: 0;
}
.status-dot.connected { background: #4CAF7D; }
.status-dot.error     { background: var(--danger); }
.status-dot.pending   { background: var(--warning); }

.sidebar-footer {
  margin-top: auto;
  padding: 12px 8px;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.add-site-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  background: rgba(42,94,245,0.15);
  border: 1px dashed rgba(42,94,245,0.4);
  border-radius: 7px;
  color: rgba(42,94,245,0.9);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s;
}
.add-site-btn:hover { background: rgba(42,94,245,0.25); }
.add-site-btn svg { width: 14px; height: 14px; }

/* ── Main ── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title { font-size: 15px; font-weight: 600; flex: 1; }
.topbar-url   { font-size: 12px; font-family: 'DM Mono', monospace; color: var(--muted); }

.topbar-actions { display: flex; gap: 8px; align-items: center; }
.btn-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  transition: background 0.12s, color 0.12s;
}
.btn-icon:hover { background: var(--bg); color: var(--text); }
.btn-icon svg { width: 16px; height: 16px; }

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}

.content { padding: 28px; flex: 1; }

/* ── Site Overview ── */
.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 16px;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.stat-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.stat-value { font-size: 22px; font-weight: 600; font-family: 'DM Mono', monospace; }
.stat-value.ok     { color: var(--success); }
.stat-value.warn   { color: var(--warning); }
.stat-value.error  { color: var(--danger); }

/* ── Module Cards ── */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.module-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 0.15s;
}
.module-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.07); }

.module-header { display: flex; align-items: flex-start; gap: 12px; }
.module-icon {
  width: 38px; height: 38px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.module-icon svg { width: 18px; height: 18px; }
.module-icon.blue   { background: #EEF2FF; color: var(--accent); }
.module-icon.green  { background: #EDFAF3; color: var(--success); }
.module-icon.orange { background: #FFF7ED; color: var(--warning); }
.module-icon.slate  { background: #F1F0EE; color: #555; }

.module-title { font-size: 14px; font-weight: 600; }
.module-desc  { font-size: 13px; color: var(--muted); line-height: 1.5; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  align-self: flex-start;
}
.badge.active  { background: #EDFAF3; color: var(--success); }
.badge.soon    { background: #F1F0EE; color: var(--muted); }
.badge.pending { background: #FFF7ED; color: var(--warning); }

/* ── WP Connection ── */
.connect-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 28px;
}
.connect-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.connect-desc  { font-size: 13.5px; color: var(--muted); margin-bottom: 18px; line-height: 1.6; }

.connect-steps {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.step-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.step-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.pair-form { display: flex; gap: 10px; flex-wrap: wrap; }
.pair-form input {
  flex: 1;
  min-width: 200px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 13.5px;
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.pair-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(42,94,245,0.12);
  background: #fff;
}
.btn-primary {
  padding: 9px 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s;
}
.btn-primary:hover { background: var(--accent-h); }

/* ── Activity log ── */
.activity-list { display: flex; flex-direction: column; gap: 1px; }
.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.activity-text { flex: 1; color: var(--text); }
.activity-time { font-size: 11.5px; font-family: 'DM Mono', monospace; color: var(--muted); }

/* ── Empty state ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  text-align: center;
  gap: 12px;
}
.empty-icon {
  width: 56px; height: 56px;
  background: var(--bg);
  border-radius: 14px;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}
.empty-icon svg { width: 24px; height: 24px; color: var(--muted); }
.empty-title { font-size: 16px; font-weight: 600; }
.empty-desc  { font-size: 13.5px; color: var(--muted); max-width: 320px; line-height: 1.6; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface);
  border-radius: 14px;
  padding: 32px;
  width: 100%;
  max-width: 440px;
  transform: scale(0.96);
  transition: transform 0.2s;
  box-shadow: 0 8px 40px rgba(0,0,0,0.15);
}
.modal-overlay.open .modal { transform: scale(1); }
.modal h2 { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.modal p  { font-size: 13.5px; color: var(--muted); margin-bottom: 20px; line-height: 1.6; }
.modal .field { margin-bottom: 14px; }
.modal label { display: block; font-size: 12.5px; font-weight: 500; margin-bottom: 5px; }
.modal input, .modal select {
  width: 100%;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 13.5px;
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.modal input:focus, .modal select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(42,94,245,0.12);
  background: #fff;
}
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.btn-secondary {
  padding: 9px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.12s;
}
.btn-secondary:hover { background: var(--bg); }

/* ── Notification ── */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--sidebar);
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  z-index: 999;
  transform: translateY(12px);
  opacity: 0;
  transition: all 0.25s;
  pointer-events: none;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ── Tabs ── */
.ctab {
  padding: 8px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .15s;
  font-family: inherit;
}
.ctab:hover { color: var(--text); }
.ctab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Animations ── */
@keyframes psSpin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes psPulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.55; }
}
.ps-spin {
  display: inline-block;
  animation: psSpin 1.0s linear infinite;
  font-style: normal;
}
.ps-running-label {
  animation: psPulse 1.6s ease-in-out infinite;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
}

/* ── Hover-Zeilenklassen (ersetzt alle onmouseover/onmouseout auf <tr>) ── */

/* Subtiles blaues Highlight — SEO-Seitenliste, Bulk-Scan, Kannibalisierung */
.tr-hover {
  cursor: pointer;
  transition: background 0.12s;
}
.tr-hover:hover {
  background: rgba(42, 94, 245, 0.06) !important;
}

/* Dunkles Highlight mit weißen Texten — Admin Organisations-Tabelle */
.tr-hover-dark {
  cursor: pointer;
  transition: background 0.12s;
}
.tr-hover-dark:hover {
  background: var(--sidebar-h) !important;
}
.tr-hover-dark:hover td,
.tr-hover-dark:hover button {
  color: #fff !important;
}

/* Roter Outline-Button (Website löschen) */
.btn-danger-outline {
  background: transparent;
  border: 1px solid #e53e3e;
  color: #e53e3e;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.btn-danger-outline:hover {
  background: #e53e3e;
  color: #fff;
}
