/* Minimales, eigenes CSS für das eingebettete DataForge-Testfrontend - bewusst ohne Bootstrap
   oder sonstige CDN-Abhängigkeit, damit der Host keine zusätzlichen Assets braucht. */

:root {
    --df-primary: #1b6ec2;
    --df-primary-dark: #14568f;
    --df-bg: #f5f7fb;
    --df-border: #d8dce3;
    --df-text: #1f2430;
    --df-text-muted: #6c757d;
    --df-radius: 0.5rem;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--df-bg);
    color: var(--df-text);
    font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.df-header {
    background: linear-gradient(90deg, #052767 0%, #3a0647 100%);
    color: #fff;
    padding: 0.85rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.df-nav a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    margin-left: 1.25rem;
    font-size: 0.9rem;
}

.df-nav a:first-child {
    margin-left: 0;
}

.df-nav a:hover {
    color: #fff;
    text-decoration: underline;
}

.df-brand {
    font-weight: 600;
    font-size: 1.15rem;
}

.df-brand-sub {
    color: rgba(255, 255, 255, 0.65);
    font-weight: 400;
    font-size: 0.95rem;
    margin-left: 0.5rem;
}

.df-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1.75rem 3rem;
}

.df-title {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 0 0 1.25rem;
}

.df-subheading {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--df-text-muted);
    margin: 0 0 0.9rem;
}

/* Karten */

.df-card {
    background: #fff;
    border: 1px solid var(--df-border);
    border-radius: var(--df-radius);
    box-shadow: 0 1px 2px rgba(20, 30, 60, 0.05);
    margin-bottom: 1.5rem;
}

.df-header-card {
    background: #fff;
}

.df-card-header {
    padding: 0.75rem 1.1rem;
    border-bottom: 1px solid var(--df-border);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.df-card-body {
    padding: 1.1rem;
}

.df-input-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Formular */

.df-form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.df-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.df-input, .df-textarea {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--df-border);
    border-radius: 0.35rem;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
    color: var(--df-text);
}

.df-textarea {
    resize: vertical;
    margin-bottom: 0.9rem;
}

.df-input[readonly] {
    background: #eef0f4;
    color: var(--df-text-muted);
}

.df-hint {
    font-size: 0.78rem;
    color: var(--df-text-muted);
    margin-top: 0.3rem;
}

.df-examples-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--df-text-muted);
    margin: 0 0 0.5rem;
}

.df-example-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 1rem;
}

.df-example-chip {
    background: #eef0f4;
    color: var(--df-text);
    border: 1px solid var(--df-border);
    border-radius: 1rem;
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.df-example-chip:hover {
    background: rgba(27, 110, 194, 0.1);
    border-color: var(--df-primary);
    color: var(--df-primary-dark);
}

.df-options-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--df-text-muted);
    margin: 0.75rem 0 0.4rem;
}

.df-options-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1rem;
    margin-bottom: 0.5rem;
}

@media (max-width: 600px) {
    .df-options-grid {
        grid-template-columns: 1fr;
    }
}

.df-checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.df-checkbox-row label {
    font-size: 0.9rem;
}

/* Buttons */

.df-btn {
    background: var(--df-primary);
    color: #fff;
    border: none;
    border-radius: 0.35rem;
    padding: 0.55rem 1.25rem;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.15s ease;
}

.df-btn:hover:not(:disabled) {
    background: var(--df-primary-dark);
}

.df-btn:disabled {
    background: #b7c0cb;
    cursor: not-allowed;
}

.df-btn-submit {
    margin-top: auto;
    align-self: flex-start;
}

.df-btn-outline {
    background: transparent;
    color: var(--df-primary);
    border: 1px solid var(--df-primary);
    padding: 0.35rem 0.85rem;
    font-size: 0.85rem;
}

.df-btn-outline:hover:not(:disabled) {
    background: rgba(27, 110, 194, 0.08);
    color: var(--df-primary-dark);
}

.df-spinner {
    width: 0.9rem;
    height: 0.9rem;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    display: inline-block;
    animation: df-spin 0.7s linear infinite;
}

@keyframes df-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Alerts */

.df-alert-danger {
    background: #fdecea;
    color: #7a1f1a;
    border: 1px solid #f4c7c3;
    border-radius: 0.35rem;
    padding: 0.65rem 0.9rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* Layout */

.df-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
}

.df-result-column {
    display: flex;
    flex-direction: column;
}

@media (min-width: 992px) {
    .df-grid {
        grid-template-columns: 5fr 7fr;
    }
}

.df-muted {
    color: var(--df-text-muted);
    font-style: italic;
}

/* DIN-5008-Block */

.df-din-block {
    background: #fff;
    border: 1px solid var(--df-border);
    border-radius: 0.35rem;
    padding: 1rem 1.25rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 24rem;
}

.df-domestic-hint {
    color: var(--df-text-muted);
}

.df-copy-feedback {
    font-size: 0.82rem;
    color: #2e7d32;
    margin-top: 0.5rem;
}

/* Tabelle */

.df-table-wrap {
    overflow-x: auto;
}

.df-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    margin-bottom: 0.75rem;
}

.df-table th, .df-table td {
    text-align: left;
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid #eef0f4;
    vertical-align: top;
}

.df-table th {
    color: var(--df-text-muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.df-muted-cell {
    color: var(--df-text-muted);
    white-space: nowrap;
}

/* Badges */

.df-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #fff;
}

.df-badge-validated { background: #2e7d32; }
.df-badge-corrected { background: #e58e00; color: #3a2600; }
.df-badge-derived { background: #1565c0; }
.df-badge-extracted { background: #6c757d; }
.df-badge-defaulted { background: #8ecae6; color: #023047; }
.df-badge-uncertain { background: #c62828; }
.df-badge-empty { background: #eef0f4; color: #999; border: 1px solid #ddd; }
.df-badge-review { background: #f9a825; color: #3a2600; }

/* Pflichtfeld-/Plausibilitätswarnungen (Erweiterung "Pflichtfeld-Validierung") */

.df-issues {
    background: #fdecea;
    border: 1px solid #f5c2bd;
    border-left: 4px solid #c62828;
    border-radius: var(--df-radius);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.df-issues-title {
    font-weight: 600;
    color: #7a1c1c;
    margin-bottom: 0.35rem;
}

.df-issues-list {
    margin: 0;
    padding-left: 1.25rem;
    color: #7a1c1c;
    font-size: 0.9rem;
}

/* Status-Dashboard (Health Checks) */

.df-status-summary {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.df-status-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}

.df-status-dot-healthy { background: #2e7d32; }
.df-status-dot-degraded { background: #f9a825; }
.df-status-dot-unhealthy { background: #c62828; }

.df-status-label {
    font-size: 1.1rem;
    font-weight: 600;
}

.df-status-updated {
    font-size: 0.8rem;
    color: var(--df-text-muted);
    margin-left: auto;
}

.df-status-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.25rem;
}

/* Meta-Zeile + Roh-JSON */

.df-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--df-text-muted);
    border-top: 1px solid #eef0f4;
    padding-top: 0.6rem;
}

.df-json-toggle {
    cursor: pointer;
    user-select: none;
}

.df-json {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 0.9rem;
    border-radius: 0.35rem;
    font-size: 0.8rem;
    max-height: 24rem;
    overflow: auto;
    margin: 0;
}

/* MCP-Anleitung */

.df-inline-code {
    background: #eef0f4;
    border: 1px solid var(--df-border);
    border-radius: 0.25rem;
    padding: 0.05rem 0.35rem;
    font-family: Consolas, 'Courier New', Courier, monospace;
    font-size: 0.85em;
    white-space: nowrap;
}

.df-guide-text {
    font-size: 0.92rem;
    line-height: 1.55;
    margin: 0 0 0.9rem;
}

.df-guide-list {
    font-size: 0.92rem;
    line-height: 1.55;
    margin: 0 0 0.9rem;
    padding-left: 1.4rem;
}

.df-guide-list li {
    margin-bottom: 0.35rem;
}

.df-code-block {
    position: relative;
    margin: 0 0 0.9rem;
}

.df-code-block .df-btn-copy {
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    background: rgba(255, 255, 255, 0.12);
    color: #d4d4d4;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 0.3rem;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    cursor: pointer;
}

.df-code-block .df-btn-copy:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

/* Login-Gate */

.df-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #052767 0%, #3a0647 100%);
}

.df-login-card {
    width: 100%;
    max-width: 26rem;
    margin-bottom: 0;
}

.df-login-card .df-brand {
    display: block;
    color: var(--df-text);
    margin-bottom: 0.35rem;
}

.df-login-lead {
    font-size: 0.92rem;
    color: var(--df-text-muted);
    margin: 0 0 1.25rem;
}

.df-login-btn {
    margin-top: 1rem;
    width: 100%;
    justify-content: center;
}

/* Header: Auth-Bereich (Key-Name + Abmelden) */

.df-header-auth {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.df-header-user {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.df-header-logout {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
}

.df-header-logout:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Beinahe-Treffer (CleanedField.PossibleMatches): rein informative Kandidaten unter einem
   "uncertain"-Feld — bewusst dezent, sie sind Diagnose, kein übernommener Wert. */
.df-possible-matches {
    list-style: none;
    margin: 0.25rem 0 0;
    padding: 0;
}

.df-possible-matches li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4rem;
    padding: 0.1rem 0;
}

.df-possible-value {
    color: var(--df-text);
}

.df-possible-score {
    font-variant-numeric: tabular-nums;
    opacity: 0.75;
}

.df-possible-evidence {
    opacity: 0.65;
}
