/* ────────────────────────────────────────────────────────────
   SERAWEB Scanner – UI-Styles mit Dark/Light-Mode
   Dark ist Default. Light aktiviert sich via <html data-theme="light">
   ──────────────────────────────────────────────────────────── */

/* ─── Theme-Tokens: DARK (Default) ─── */
:root {
    --c-primary:    #49c7c0;
    --c-primary-hover: #3aaaa4;
    --c-secondary:  #49c7c0;
    --c-accent-1:   #262a32;
    --c-accent-2:   #e83970;
    --c-accent-3:   #f0b51d;

    /* Marineblau-Palette: tief, edel, harmoniert mit #102c56 (Primärfarbe der Agentur) */
    --c-bg:         #001024;
    --c-bg-2:       #04152a;
    --c-card:       #061a32;
    --c-card-2:     #0a2341;
    --c-border:     #143058;
    --c-text:       #e5e7eb;
    --c-text-muted: #9ca3af;
    --c-text-dim:   #6b7280;

    --c-pass:       #22c55e;
    --c-warn:       #f59e0b;
    --c-fail:       #ef4444;
    --c-info:       #38bdf8;

    --c-pass-bg:    rgba(34,197,94,.12);
    --c-warn-bg:    rgba(245,158,11,.12);
    --c-fail-bg:    rgba(239,68,68,.12);
    --c-info-bg:    rgba(56,189,248,.12);

    --c-howto-bg:   rgba(73,199,192,.06);

    --radius-sm: 6px;
    --radius:    10px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow:    0 4px 16px rgba(0, 0, 0, .45);
}

/* ─── Theme-Tokens: LIGHT ─── */
html[data-theme="light"] {
    --c-primary:    #102c56;
    --c-primary-hover: #0c2344;
    --c-secondary:  #49c7c0;
    --c-accent-1:   #262a32;
    --c-accent-2:   #e83970;
    --c-accent-3:   #f0b51d;

    --c-bg:         #f7f8fa;
    --c-bg-2:       #102c56;
    --c-card:       #ffffff;
    --c-card-2:     #f7f8fa;
    --c-border:     #e5e7eb;
    --c-text:       #1a1f2e;
    --c-text-muted: #6b7280;
    --c-text-dim:   #9ca3af;

    --c-pass:       #16a34a;
    --c-warn:       #f59e0b;
    --c-fail:       #dc2626;
    --c-info:       #0ea5e9;

    --c-pass-bg:    #dcfce7;
    --c-warn-bg:    #fef3c7;
    --c-fail-bg:    #fee2e2;
    --c-info-bg:    #dbeafe;

    --c-howto-bg:   #f7f8fa;

    --shadow-sm: 0 1px 2px rgba(16, 44, 86, .05);
    --shadow:    0 4px 12px rgba(16, 44, 86, .08);
}

/* ─── Inter Font ─── */
@font-face {
    font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap;
    src: url('../fonts/Inter-Regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap;
    src: url('../fonts/Inter-Medium.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap;
    src: url('../fonts/Inter-SemiBold.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap;
    src: url('../fonts/Inter-Bold.woff2') format('woff2');
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--c-bg);
    color: var(--c-text);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    transition: background-color .2s ease, color .2s ease;
}

a { color: var(--c-secondary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Header ─── */
.app-header {
    background: var(--c-bg-2);
    color: #fff;
    padding: 18px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--c-border);
}
html[data-theme="light"] .app-header {
    background: var(--c-primary);
    border-bottom-color: transparent;
}
.app-header .logo img { height: 36px; display: block; }
.app-header .header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.app-header .subtitle {
    font-size: 12px;
    color: var(--c-secondary);
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 600;
}

/* ─── Theme-Toggle ─── */
.theme-toggle {
    background: transparent;
    border: 1px solid rgba(255,255,255,.15);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, border-color .15s;
    padding: 0;
}
.theme-toggle:hover { background: rgba(255,255,255,.08); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
html[data-theme="light"] .theme-toggle .icon-sun  { display: block; }
html[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* ─── Container ─── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}
.container--narrow { max-width: 680px; }

/* ─── Landing Form ─── */
.hero { text-align: center; padding: 32px 0 16px; }
.hero h1 {
    font-size: 34px;
    font-weight: 700;
    color: var(--c-text);
    margin: 0 0 12px;
    letter-spacing: -.02em;
}
html[data-theme="light"] .hero h1 { color: var(--c-primary); }

.hero p {
    font-size: 17px;
    color: var(--c-text-muted);
    margin: 0 auto;
    max-width: 520px;
}

.scan-form {
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-top: 28px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.scan-form input[type="url"],
.scan-form input[type="text"] {
    flex: 1 1 300px;
    padding: 14px 18px;
    font: inherit;
    color: var(--c-text);
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius);
    background: var(--c-card-2);
    transition: border-color .15s, box-shadow .15s;
}
.scan-form input::placeholder { color: var(--c-text-dim); }
.scan-form input[type="url"]:focus,
.scan-form input[type="text"]:focus {
    outline: none;
    border-color: var(--c-secondary);
    box-shadow: 0 0 0 3px rgba(73, 199, 192, .15);
}

/* ─── Buttons ─── */
.btn {
    padding: 14px 28px;
    font: inherit;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    background: var(--c-primary);
    color: #0f1218;
    cursor: pointer;
    transition: background .15s, transform .05s, color .15s, border-color .15s;
    text-decoration: none;
    display: inline-block;
}
.btn:hover { background: var(--c-primary-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }

/* Light Mode: gefüllter Primary-Button bekommt weiße Schrift */
html[data-theme="light"] .btn { color: #fff; }

.btn--ghost {
    background: transparent;
    color: var(--c-text);
    border: 1.5px solid var(--c-border);
}
.btn--ghost:hover { background: var(--c-card-2); color: var(--c-text); }

/* Light Mode: Ghost-Button MUSS explizit den Text wieder dunkel setzen,
   sonst erbt er das weiße color vom .btn-Override darüber */
html[data-theme="light"] .btn--ghost {
    color: var(--c-text);
    border-color: var(--c-border);
}
html[data-theme="light"] .btn--ghost:hover {
    background: var(--c-card-2);
    color: var(--c-primary);
    border-color: var(--c-primary);
}
.btn[disabled] { opacity: .6; cursor: not-allowed; }

/* ─── Boxes ─── */
.info-box {
    background: var(--c-warn-bg);
    border-left: 4px solid var(--c-accent-3);
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-top: 24px;
    font-size: 14px;
    color: var(--c-text);
}
.info-box strong { color: var(--c-accent-3); }

.error-box {
    background: var(--c-fail-bg);
    border-left: 4px solid var(--c-fail);
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-top: 24px;
    font-size: 14px;
    color: var(--c-text);
}
.error-box strong { color: var(--c-fail); }

/* ─── Loading ─── */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 80px 20px;
    text-align: center;
}
.loading .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--c-border);
    border-top-color: var(--c-secondary);
    border-radius: 50%;
    animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading h2 { margin: 0; color: var(--c-text); font-size: 22px; }
.loading p  { color: var(--c-text-muted); margin: 0; }

/* ─── Report Header ─── */
.report-header {
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
    box-shadow: var(--shadow-sm);
}
.report-header h1 {
    font-size: 22px;
    margin: 0 0 4px;
    color: var(--c-text);
    word-break: break-all;
}
.report-header .meta {
    font-size: 13px;
    color: var(--c-text-muted);
}
.report-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ─── Score Cards ─── */
.scores {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.score-card {
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 22px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.score-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--accent-color, var(--c-border));
}
.score-card.score--pass { --accent-color: var(--c-pass); }
.score-card.score--warn { --accent-color: var(--c-warn); }
.score-card.score--fail { --accent-color: var(--c-fail); }
.score-card.score--info { --accent-color: var(--c-text-dim); }

.score-card .score {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 6px;
}
.score-card .label {
    font-size: 12px;
    color: var(--c-text-muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 600;
}
.score--pass .score { color: var(--c-pass); }
.score--warn .score { color: var(--c-warn); }
.score--fail .score { color: var(--c-fail); }
.score--info .score { color: var(--c-text-dim); }

/* ─── Summary Bar ─── */
.summary-bar {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding: 16px 22px;
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    margin-bottom: 28px;
}
.summary-bar .chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 14px;
    color: var(--c-text-muted);
}
.summary-bar .chip strong { color: var(--c-text); font-weight: 600; }
.summary-bar .dot { width: 10px; height: 10px; border-radius: 50%; }
.dot--pass { background: var(--c-pass); }
.dot--warn { background: var(--c-warn); }
.dot--fail { background: var(--c-fail); }
.dot--info { background: var(--c-info); }

/* ─── Gruppen + Audits ─── */
.group {
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.group-header {
    padding: 16px 24px;
    background: var(--c-card-2);
    color: var(--c-text);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: .02em;
    border-bottom: 1px solid var(--c-border);
}
html[data-theme="light"] .group-header {
    background: var(--c-accent-1);
    color: #fff;
    border-bottom-color: transparent;
}

.audit {
    border-top: 1px solid var(--c-border);
    padding: 18px 24px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: flex-start;
}
.audit:first-of-type { border-top: none; }
.audit .icon {
    width: 26px; height: 26px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; color: #fff;
    flex-shrink: 0;
}
.icon--pass { background: var(--c-pass); }
.icon--warn { background: var(--c-warn); color: #1a1f2e; }
.icon--fail { background: var(--c-fail); }
.icon--info { background: var(--c-info); color: #0f1218; }

.audit h3 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
    color: var(--c-text);
}
.audit .value   { color: var(--c-text-muted); font-size: 13px; }
.audit .details { margin: 8px 0 0; font-size: 14px; color: var(--c-text); }

.audit .howto {
    margin-top: 10px;
    padding: 10px 14px;
    background: var(--c-howto-bg);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--c-text-muted);
    border-left: 3px solid var(--c-secondary);
}
.audit .howto strong { color: var(--c-secondary); }

.status-tag {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}
.tag--pass { background: var(--c-pass-bg); color: var(--c-pass); }
.tag--warn { background: var(--c-warn-bg); color: var(--c-warn); }
.tag--fail { background: var(--c-fail-bg); color: var(--c-fail); }
.tag--info { background: var(--c-info-bg); color: var(--c-info); }

/* ─── Footer ─── */
.app-footer {
    margin-top: 60px;
    padding: 24px;
    text-align: center;
    color: var(--c-text-muted);
    font-size: 13px;
    border-top: 1px solid var(--c-border);
}

/* ─── Responsive ─── */
@media (max-width: 640px) {
    .app-header { padding: 14px 20px; }
    .app-header .subtitle { display: none; }
    .hero h1 { font-size: 26px; }
    .audit { grid-template-columns: auto 1fr; }
    .audit .status-tag { grid-column: 2; justify-self: start; }
    .scan-form { padding: 18px; }
    .scan-form .btn { flex: 1 1 100%; }
}

/* ────────────────────────────────────────────────────────────
   PHASE 2 – Dashboard, History, Diff, Forms
   ──────────────────────────────────────────────────────────── */

/* ─── Navigation im Header ─── */
.header-left { display: flex; align-items: center; gap: 24px; }
.main-nav { display: flex; gap: 4px; }
.main-nav a {
    color: rgba(255,255,255,.7);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: background .15s, color .15s;
    text-decoration: none;
}
.main-nav a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.main-nav a.active { background: rgba(255,255,255,.12); color: #fff; }

/* ─── Breadcrumb ─── */
.breadcrumb {
    font-size: 13px;
    color: var(--c-text-muted);
    margin-bottom: 20px;
}
.breadcrumb a { color: var(--c-text-muted); }
.breadcrumb a:hover { color: var(--c-secondary); text-decoration: none; }
.breadcrumb .bc-sep { margin: 0 8px; color: var(--c-text-dim); }

/* ─── Dashboard Header ─── */
.dashboard-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 20px; flex-wrap: wrap; margin-bottom: 28px;
}
.dashboard-header h1 { margin: 0 0 4px; color: var(--c-text); font-size: 28px; letter-spacing: -.02em; }
.dashboard-header .dash-sub { color: var(--c-text-muted); font-size: 14px; margin: 0; }

/* ─── Empty State ─── */
.empty-state {
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 60px 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}
.empty-state h2 { margin: 0 0 8px; color: var(--c-text); font-size: 20px; }
.empty-state p { margin: 0 0 20px; color: var(--c-text-muted); }

/* ─── Domain Cards ─── */
.domain-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
}
.domain-card {
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
    transition: transform .12s, box-shadow .12s, border-color .12s;
}
.domain-card:hover {
    transform: translateY(-2px);
    border-color: var(--c-secondary);
    box-shadow: var(--shadow);
}
.domain-card-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 12px; margin-bottom: 14px;
}
.domain-card-title { min-width: 0; flex: 1; }
.domain-card-title h3 {
    margin: 0 0 2px;
    font-size: 16px;
    color: var(--c-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.domain-card-url {
    font-size: 12px;
    color: var(--c-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.domain-card-meta {
    font-size: 13px;
    color: var(--c-text-muted);
    margin-bottom: 14px;
}
.domain-card-meta--empty { font-style: italic; color: var(--c-text-dim); }
.domain-card-actions-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* Kleiner Icon-Button */
.icon-btn {
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 8px;
    color: var(--c-text-muted);
    transition: background .15s, color .15s;
    text-decoration: none;
}
.icon-btn:hover { background: var(--c-card-2); color: var(--c-secondary); text-decoration: none; }
.icon-btn svg { width: 16px; height: 16px; }
html[data-theme="light"] .icon-btn { color: var(--c-text-muted); }
html[data-theme="light"] .icon-btn:hover { color: var(--c-primary); }

/* ─── Formulare ─── */
.form-label {
    display: block;
    margin-bottom: 14px;
}
.form-label > span {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--c-text);
}
.form-label input,
.form-label textarea {
    width: 100%;
    padding: 12px 14px;
    font: inherit;
    color: var(--c-text);
    background: var(--c-card-2);
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius);
    font-family: inherit;
}
.form-label input:focus,
.form-label textarea:focus {
    outline: none;
    border-color: var(--c-secondary);
    box-shadow: 0 0 0 3px rgba(73, 199, 192, .15);
}
.form-label textarea { resize: vertical; min-height: 80px; }
.form-actions { display: flex; gap: 10px; margin-top: 12px; }

/* Kleine Button-Variante */
.btn--sm { padding: 8px 14px; font-size: 13px; }

.btn--secondary {
    background: var(--c-secondary);
    color: #0f1218;
}
.btn--secondary:hover { background: #3aaaa4; color: #0f1218; }
html[data-theme="light"] .btn--secondary { color: #0f1218; }
html[data-theme="light"] .btn--secondary:hover { color: #0f1218; }

.btn--danger {
    background: var(--c-fail);
    color: #fff;
}
.btn--danger:hover { background: #b91c1c; color: #fff; }
html[data-theme="light"] .btn--danger { color: #fff; }

.btn--danger-ghost {
    background: transparent;
    color: var(--c-fail);
    border: 1.5px solid var(--c-fail);
}
.btn--danger-ghost:hover { background: var(--c-fail-bg); color: var(--c-fail); }
html[data-theme="light"] .btn--danger-ghost { color: var(--c-fail); }
html[data-theme="light"] .btn--danger-ghost:hover { color: var(--c-fail); }

.danger-zone { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--c-border); text-align: center; }

/* ─── History-Tabelle ─── */
.history-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}
.history-table th {
    text-align: left;
    padding: 12px 20px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--c-text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--c-border);
    background: var(--c-card-2);
}
.history-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--c-border);
    font-size: 14px;
    vertical-align: middle;
}
.history-table tbody tr:last-child td { border-bottom: none; }
.history-table tbody tr:hover { background: var(--c-card-2); }

.history-link { color: var(--c-text); text-decoration: none; display: inline-block; }
.history-link:hover { color: var(--c-secondary); text-decoration: none; }
.history-link strong { display: block; font-weight: 600; }
.history-link .history-time { font-size: 12px; color: var(--c-text-muted); }

.badge-latest {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .05em;
    background: var(--c-secondary);
    color: #0f1218;
    border-radius: 999px;
    font-weight: 600;
    vertical-align: middle;
}

.col-scores { white-space: nowrap; }
.col-counts { white-space: nowrap; }
.col-dur    { color: var(--c-text-muted); font-variant-numeric: tabular-nums; }
.col-actions { text-align: right; white-space: nowrap; }
.col-actions .btn { margin-left: 4px; }

/* Mini-Scores in der Historie */
.mini-score {
    display: inline-block;
    min-width: 34px;
    padding: 3px 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    border-radius: 6px;
    margin-right: 2px;
}
.mini-score.score--pass { background: var(--c-pass-bg); color: var(--c-pass); }
.mini-score.score--warn { background: var(--c-warn-bg); color: var(--c-warn); }
.mini-score.score--fail { background: var(--c-fail-bg); color: var(--c-fail); }
.mini-score.score--info { background: var(--c-info-bg); color: var(--c-text-muted); }

/* Chip-XS für Counts in Tabellen */
.chip-xs {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    margin-right: 8px;
    color: var(--c-text);
}
.chip-xs .dot { width: 8px; height: 8px; }

/* ─── Diff/Vergleich ─── */
.score-compare {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    font-size: 24px;
    font-weight: 600;
    line-height: 1;
    margin-bottom: 4px;
}
.score-compare .score-old { color: var(--c-text-muted); font-size: 20px; }
.score-compare .score-arrow { color: var(--c-text-dim); font-size: 18px; }
.score-compare .score-new { color: var(--c-text); font-size: 30px; font-weight: 700; }

.score-delta {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}
.delta--pass { color: var(--c-pass); }
.delta--warn { color: var(--c-warn); }
.delta--fail { color: var(--c-fail); }
.delta--info { color: var(--c-text-muted); }

.chip-delta {
    display: inline-block;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 999px;
    background: var(--c-card-2);
    margin: 0 4px;
}

.audit--diff .diff-status-change {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    flex-wrap: wrap;
}
.diff-arrow { color: var(--c-text-dim); font-size: 16px; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .main-nav { gap: 0; }
    .main-nav a { padding: 6px 10px; font-size: 13px; }
    .domain-grid { grid-template-columns: 1fr; }
    .history-table { font-size: 13px; }
    .history-table th, .history-table td { padding: 10px 12px; }
}
@media (max-width: 520px) {
    .header-left { gap: 12px; }
    .main-nav a { padding: 4px 8px; }
    .dashboard-header h1 { font-size: 22px; }
}

/* ─── Bulk-Delete in History-Tabelle ─── */
.group-header--flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.bulk-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 400;
    font-size: 13px;
}
.bulk-count {
    color: var(--c-text-muted);
    font-size: 13px;
}
html[data-theme="light"] .group-header--flex .bulk-count { color: rgba(255,255,255,.85); }
html[data-theme="light"] .group-header--flex .btn--danger-ghost {
    color: #fff;
    border-color: rgba(255,255,255,.5);
    background: transparent;
}
html[data-theme="light"] .group-header--flex .btn--danger-ghost:hover {
    background: rgba(255,255,255,.1);
    color: #fff;
}

.col-check { width: 36px; text-align: center; }
.col-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--c-secondary);
    vertical-align: middle;
}

/* Responsive: Checkbox-Spalte schmaler */
@media (max-width: 520px) {
    .col-check { width: 28px; }
}

/* ────────────────────────────────────────────────────────────
   Scan-Overlay mit Progress-Bar
   ──────────────────────────────────────────────────────────── */
.scan-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 16, 36, .9);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: overlayFadeIn .25s ease-out;
}
html[data-theme="light"] .scan-overlay {
    background: rgba(16, 44, 86, .8);
}
.scan-overlay.active { display: flex; }

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.scan-overlay-card {
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 40px 36px 32px;
    max-width: 460px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
    animation: overlayCardIn .35s cubic-bezier(.2, .9, .3, 1.15);
}
@keyframes overlayCardIn {
    from { transform: scale(.92) translateY(8px); opacity: 0; }
    to   { transform: scale(1)    translateY(0);  opacity: 1; }
}

.scan-overlay-logo {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--c-secondary);
    border-radius: 14px;
    animation: logoPulse 2s ease-in-out infinite;
}
.scan-overlay-logo img { width: 40px; height: auto; }
@keyframes logoPulse {
    0%, 100% { transform: scale(1);    box-shadow: 0 0 0 0 rgba(73, 199, 192, .4); }
    50%      { transform: scale(1.05); box-shadow: 0 0 0 14px rgba(73, 199, 192, 0); }
}

.scan-overlay-card h2 {
    margin: 0 0 6px;
    color: var(--c-text);
    font-size: 22px;
    font-weight: 700;
}
.scan-overlay-phase {
    margin: 0 0 22px;
    color: var(--c-text-muted);
    font-size: 14px;
    min-height: 1.4em; /* verhindert Layout-Sprung bei Phasenwechsel */
    transition: color .2s;
}

/* ─── Progress Bar ─── */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--c-card-2);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 18px;
}
.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg,
        var(--c-secondary) 0%,
        #5ee0d8 50%,
        var(--c-secondary) 100%);
    background-size: 200% 100%;
    border-radius: 999px;
    transition: width .15s ease-out;
    animation: progressShimmer 2.5s linear infinite;
}
@keyframes progressShimmer {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}
.progress-bar-fill--pulse {
    animation: progressShimmer 2.5s linear infinite, progressPulse 1.5s ease-in-out infinite;
}
@keyframes progressPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: .65; }
}

.scan-overlay-hint {
    margin: 0 0 24px;
    font-size: 12px;
    color: var(--c-text-dim);
}

/* ─── Phasen-Steps ─── */
.scan-overlay-steps {
    list-style: none;
    padding: 20px 0 0;
    margin: 0;
    text-align: left;
    border-top: 1px solid var(--c-border);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 16px;
}
.scan-overlay-steps li {
    font-size: 12px;
    color: var(--c-text-dim);
    padding-left: 18px;
    position: relative;
    transition: color .2s;
}
.scan-overlay-steps li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1.5px solid var(--c-text-dim);
    background: transparent;
    transition: all .2s;
}
.scan-overlay-steps li.step-current {
    color: var(--c-text);
    font-weight: 600;
}
.scan-overlay-steps li.step-current::before {
    border-color: var(--c-secondary);
    background: var(--c-secondary);
    box-shadow: 0 0 0 3px rgba(73, 199, 192, .25);
    animation: stepCurrentPulse 1.2s ease-in-out infinite;
}
@keyframes stepCurrentPulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(73, 199, 192, .25); }
    50%      { box-shadow: 0 0 0 6px rgba(73, 199, 192, .1); }
}
.scan-overlay-steps li.step-done {
    color: var(--c-text-muted);
}
.scan-overlay-steps li.step-done::before {
    border-color: var(--c-pass);
    background: var(--c-pass);
}

/* Mobile */
@media (max-width: 520px) {
    .scan-overlay-card { padding: 28px 22px 22px; }
    .scan-overlay-card h2 { font-size: 19px; }
    .scan-overlay-steps { grid-template-columns: 1fr; gap: 4px; }
}

/* ─── Mobile/Desktop Strategy Toggle ─── */
.strategy-toggle {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}
.strategy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--c-text-muted);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    border-radius: calc(var(--radius) - 4px);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.strategy-btn svg { width: 14px; height: 14px; }
.strategy-btn:hover { color: var(--c-text); background: var(--c-card-2); }
.strategy-btn--active {
    background: var(--c-secondary);
    color: #0f1218;
    font-weight: 600;
}
.strategy-btn--active:hover {
    background: var(--c-secondary);
    color: #0f1218;
}
html[data-theme="light"] .strategy-btn--active { color: #0f1218; }

/* Bei aktiver Desktop-Ansicht müssen wir nichts umschalten,
   das macht JS via display:none auf den Audit-Items */

/* Audit-Items mit data-strategy-item bekommen standardmäßig
   die Mobile-Ansicht (Desktop-Items werden per JS ausgeblendet).
   Das schadet auch ohne JS nicht – dann sind halt beide sichtbar. */

/* Strategy-Toggle als <a>-Link (für History-Seite) */
a.strategy-btn {
    text-decoration: none;
}
a.strategy-btn:hover {
    text-decoration: none;
}

/* ─── URL-Tabelle (Unterseiten) ─── */
.url-table .url-cell {
    max-width: 380px;
    min-width: 220px;
}
.url-table .url-cell strong {
    display: block;
    font-size: 14px;
    color: var(--c-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.url-table a.history-link strong { color: var(--c-text); }
.url-table a.history-link:hover strong { color: var(--c-secondary); }
.url-meta {
    font-size: 12px;
    color: var(--c-text-muted);
    margin-top: 2px;
}
.url-meta--empty {
    font-style: italic;
    color: var(--c-text-dim);
}

.col-src { white-space: nowrap; }

.source-tag {
    display: inline-block;
    padding: 3px 9px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 600;
    border-radius: 999px;
}
.source-tag--sitemap { background: var(--c-info-bg); color: var(--c-info); }
.source-tag--manual  { background: var(--c-card-2);  color: var(--c-text-muted); }
html[data-theme="light"] .source-tag--manual {
    background: #e5e7eb;
    color: #4b5563;
}

/* ─── Dashboard-Karten ─── */
a.domain-card {
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
}
a.domain-card:hover {
    text-decoration: none;
}
a.domain-card:focus-visible {
    outline: 2px solid var(--c-secondary);
    outline-offset: 2px;
}
/* Bearbeiten-Icon liegt optisch rechts in der Kachel */
.domain-card-edit {
    cursor: pointer;
}

/* ─── URL-Tabelle: Aktionen-Spalte ─── */
.url-table .col-actions,
.history-table .col-actions {
    text-align: right;
    padding-right: 16px;
    white-space: nowrap;
    vertical-align: middle;
}
.url-table .col-actions .btn,
.history-table .col-actions .btn {
    white-space: nowrap;
    margin-left: 4px;
    margin-bottom: 2px;
}
.url-table .col-actions > form,
.history-table .col-actions > form {
    display: inline-block;
}

/* ─── Mobile: Tabelle wird zu gestapelten Karten ─── */
@media (max-width: 900px) {
    .url-table,
    .url-table thead,
    .url-table tbody,
    .url-table tr,
    .url-table th,
    .url-table td {
        display: block;
        width: 100%;
    }
    /* Header in dieser Ansicht verstecken – Labels kommen per ::before */
    .url-table thead {
        position: absolute;
        left: -9999px;
    }
    .url-table tbody tr {
        border-bottom: 1px solid var(--c-border);
        padding: 16px 18px;
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 8px 14px;
        align-items: center;
    }
    .url-table tbody tr:last-child {
        border-bottom: none;
    }
    .url-table td {
        padding: 0;
        border-bottom: none;
        width: auto;
    }
    /* Checkbox in eigener Zelle links */
    .url-table .col-check {
        grid-column: 1;
        grid-row: 1 / span 2;
        align-self: start;
        padding-top: 2px;
    }
    /* URL-Zelle neben der Checkbox */
    .url-table .url-cell {
        grid-column: 2;
        grid-row: 1;
    }
    /* Scores unterhalb der URL, volle Breite */
    .url-table .col-scores,
    .url-table .col-counts,
    .url-table .col-src,
    .url-table .col-actions {
        grid-column: 1 / -1;
        text-align: left;
        padding-top: 4px;
    }
    .url-table .col-scores::before {
        content: "Scores: ";
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: .04em;
        color: var(--c-text-muted);
        margin-right: 6px;
    }
    .url-table .col-counts::before {
        content: "Ergebnis: ";
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: .04em;
        color: var(--c-text-muted);
        margin-right: 6px;
    }
    /* Source-Tag eigene Zeile */
    .url-table .col-src {
        padding-top: 6px;
    }
    /* Actions: Buttons nebeneinander, volle Breite */
    .url-table .col-actions {
        display: flex;
        gap: 6px;
        padding-top: 10px;
        border-top: 1px dashed var(--c-border);
        margin-top: 6px;
    }
    .url-table .col-actions .btn,
    .url-table .col-actions > form,
    .url-table .col-actions > form > .btn {
        flex: 1;
        margin: 0;
        text-align: center;
    }
}

/* History-Tabelle: gleiches Prinzip */
@media (max-width: 760px) {
    .history-table,
    .history-table thead,
    .history-table tbody,
    .history-table tr,
    .history-table th,
    .history-table td {
        display: block;
        width: 100%;
    }
    .history-table thead {
        position: absolute;
        left: -9999px;
    }
    .history-table tbody tr {
        border-bottom: 1px solid var(--c-border);
        padding: 16px 18px;
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 8px 14px;
    }
    .history-table tbody tr:last-child { border-bottom: none; }
    .history-table td {
        padding: 0;
        border-bottom: none;
        width: auto;
    }
    .history-table .col-check {
        grid-column: 1;
        grid-row: 1 / span 4;
        align-self: start;
        padding-top: 2px;
    }
    .history-table .col-scores,
    .history-table .col-counts,
    .history-table .col-dur,
    .history-table .col-actions {
        grid-column: 2;
    }
    .history-table .col-scores::before {
        content: "Scores: ";
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: .04em;
        color: var(--c-text-muted);
        margin-right: 6px;
    }
    .history-table .col-dur::before {
        content: "Dauer: ";
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: .04em;
        color: var(--c-text-muted);
        margin-right: 6px;
    }
    .history-table .col-actions {
        display: flex;
        gap: 6px;
        padding-top: 10px;
        border-top: 1px dashed var(--c-border);
        margin-top: 6px;
    }
    .history-table .col-actions .btn {
        flex: 1;
        margin: 0;
        text-align: center;
    }
}

/* ─── PDF-Buttons-Gruppe (Druck + Bildschirm) ─── */
.pdf-buttons {
    display: inline-flex;
    gap: 0;
    border-radius: var(--radius);
    overflow: hidden;
}
.pdf-buttons .btn {
    border-radius: 0;
    margin: 0;
}
.pdf-buttons .btn:first-child {
    border-top-left-radius: var(--radius);
    border-bottom-left-radius: var(--radius);
}
.pdf-buttons .btn:last-child {
    border-top-right-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
    border-left: 1px solid rgba(0,0,0,.15);
}
html[data-theme="light"] .pdf-buttons .btn:last-child {
    border-left: 1px solid rgba(255,255,255,.2);
}

/* ═══ Login-Seite ═══ */
.login-page {
    background: var(--c-bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.login-wrap {
    width: 100%;
    max-width: 420px;
}
.login-card {
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 32px 36px 28px;
    box-shadow: var(--shadow);
}
.login-logo {
    text-align: center;
    margin-bottom: 24px;
}
.login-logo img {
    max-width: 180px;
    height: auto;
}
.login-title {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 700;
    color: var(--c-text);
    text-align: center;
}
.login-sub {
    margin: 0 0 24px;
    color: var(--c-text-muted);
    font-size: 14px;
    text-align: center;
}
.login-error {
    padding: 12px 14px;
    background: var(--c-fail-bg);
    border-left: 3px solid var(--c-fail);
    border-radius: 6px;
    color: var(--c-text);
    font-size: 14px;
    margin-bottom: 18px;
}
.login-field {
    display: block;
    margin-bottom: 14px;
}
.login-field > span {
    display: block;
    font-size: 13px;
    color: var(--c-text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}
.login-field > input {
    width: 100%;
    padding: 11px 14px;
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: 8px;
    color: var(--c-text);
    font-size: 15px;
    font-family: inherit;
    transition: border-color .15s;
    box-sizing: border-box;
}
.login-field > input:focus {
    outline: none;
    border-color: var(--c-secondary);
}
.btn--block {
    display: block;
    width: 100%;
    margin-top: 8px;
}
.login-footer {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--c-border);
    color: var(--c-text-muted);
    font-size: 12px;
    text-align: center;
}
.login-footer a { color: var(--c-secondary); text-decoration: none; }

/* ═══ User-Chip im Header ═══ */
.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px 6px 12px;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--c-border);
    border-radius: 999px;
    color: var(--c-text);
    font-size: 13px;
    margin-right: 8px;
}
html[data-theme="light"] .user-chip {
    background: rgba(255,255,255,.12);
}
.user-chip-name {
    font-weight: 500;
}
.user-chip-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    color: var(--c-text-muted);
    transition: background .15s, color .15s;
    text-decoration: none;
}
.user-chip-logout:hover {
    background: var(--c-fail-bg);
    color: var(--c-fail);
}
@media (max-width: 640px) {
    .user-chip-name { display: none; }
    .user-chip { padding: 6px 8px; }
}

/* ═══ Gast-Banner ═══ */
.guest-banner {
    background: linear-gradient(to right, rgba(240,181,29,.12), rgba(240,181,29,.06));
    border-bottom: 1px solid rgba(240,181,29,.25);
    color: var(--c-accent-3);
}
html[data-theme="light"] .guest-banner {
    background: #fffbeb;
    border-bottom-color: #fde68a;
    color: #92400e;
}

/* Gast-Variante des User-Chips */
.user-chip--guest {
    background: rgba(240,181,29,.12);
    border-color: rgba(240,181,29,.35);
    color: var(--c-accent-3);
}
html[data-theme="light"] .user-chip--guest {
    background: #fef3c7;
    border-color: #fde68a;
    color: #92400e;
}

/* ═══ Gast-Token-UI (nur Admins) ═══ */
.token-success {
    background: rgba(73,199,192,.08);
    border: 1px solid rgba(73,199,192,.35);
    border-radius: var(--radius-lg);
    padding: 18px 22px;
    margin-bottom: 24px;
}
.token-success-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 12px;
}
.token-success-header strong {
    color: var(--c-secondary);
    font-size: 15px;
}
.token-success-note {
    color: var(--c-text-muted);
    font-size: 12px;
}
.token-url-wrap {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.token-url-input {
    flex: 1;
    padding: 10px 12px;
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: 8px;
    color: var(--c-text);
    font-family: ui-monospace, 'SF Mono', Monaco, monospace;
    font-size: 12px;
}

/* Gast-Token-Formular */
.guest-form-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 14px;
    margin-bottom: 16px;
}
.guest-form-field {
    display: block;
}
.guest-form-field > span {
    display: block;
    font-size: 12px;
    color: var(--c-text-muted);
    margin-bottom: 6px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .04em;
}
@media (max-width: 760px) {
    .guest-form-row {
        grid-template-columns: 1fr;
    }
}
