:root {
    --brand: #3056d3;
    --ink: #162033;
    --line: #e2e8f5;
    --soft: #eef4ff;
}

html {
    scroll-behavior: smooth;
}

body {
    color: var(--ink);
    background: #f7f9fc;
    font-family: system-ui, "Segoe UI", Arial, sans-serif;
}

[hidden] {
    display: none !important;
}

.navbar {
    box-shadow: 0 1px 0 rgba(31, 55, 92, .04);
}

.navbar-brand {
    color: var(--ink);
    font-weight: 700;
}

.brand-mark {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    background: var(--soft);
    border-radius: 10px;
}

.env-banner {
    color: #ecfdf5;
    background: #064e3b;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .075em;
    text-transform: uppercase;
}

.tool-hero {
    background: linear-gradient(180deg, #edf3ff 0, #f7f9fc 100%);
    border-bottom: 1px solid #e5ecff;
}

.hero-copy {
    max-width: 720px;
    color: #48566f;
}

.shadow-soft {
    box-shadow: 0 12px 28px rgba(30, 60, 114, .08);
}

.card {
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(30, 60, 114, .05);
}

.card-body {
    padding: 1.2rem;
}

.btn {
    border-radius: 10px;
    white-space: nowrap;
}

.btn-pill,
.nav-tabs .nav-link {
    border-radius: 999px;
}

.btn-primary {
    background: var(--brand);
    border-color: var(--brand);
    box-shadow: 0 8px 16px rgba(48, 86, 211, .18);
}

.form-control {
    padding: .7rem .85rem;
    border-color: #d8e1f3;
    border-radius: 10px;
}

.form-control:focus {
    border-color: #9db4ff;
    box-shadow: 0 0 0 .2rem rgba(48, 86, 211, .12);
}

.btn-ai {
    white-space: nowrap;
}

.btn-ai-filled,
.badge-ai {
    color: #fff;
    background: #6f42c1;
    border-color: #6f42c1;
}

.btn-ai-filled:hover,
.btn-ai-filled:focus {
    color: #fff;
    background: #5a32a3;
    border-color: #5a32a3;
}

.badge-soft {
    color: #3b5bcc;
    background: #eef2ff;
    border: 1px solid #dde5ff;
}

.dropzone {
    border: 1px dashed #b9c8e6;
    border-radius: 12px;
    background: #fbfdff;
}

.test-output {
    padding: 1rem;
    color: #14532d;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    animation: panel-in .16s ease;
}

.test-output-list {
    display: grid;
    gap: .45rem;
    padding-left: 0;
    list-style: none;
}

.test-output-list li {
    display: flex;
    align-items: center;
}

.result-area {
    scroll-margin-top: 105px;
}

.progress {
    height: 10px;
}

.progress-bar {
    width: 0;
}

.progress-bar.progress-25 { width: 25%; }
.progress-bar.progress-55 { width: 55%; }
.progress-bar.progress-80 { width: 80%; }
.progress-bar.progress-100 { width: 100%; }

.step-number {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--brand);
    border-radius: 999px;
    font-weight: 700;
}

.admin-shell {
    max-width: 1480px;
    margin: 0 auto;
}

.demo-modal-overlay {
    position: fixed;
    z-index: 1080;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(15, 23, 42, .48);
    backdrop-filter: blur(3px);
}

.demo-modal-card {
    width: min(560px, 100%);
    padding: 1.5rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .24);
}

.nav-tabs {
    gap: .35rem;
    flex-wrap: wrap;
    border-bottom: 1px solid #dfe7f6;
}

.nav-tabs .nav-link {
    margin-bottom: .4rem;
    color: #52627a;
    background: #fff;
    border: 1px solid #dfe7f6;
}

.nav-tabs .nav-link.active {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
}

.table {
    margin-bottom: 0;
    table-layout: auto;
}

.table thead th {
    color: #4e5d75;
    border-bottom-color: #dfe7f6;
    font-size: .82rem;
    letter-spacing: .02em;
    text-transform: uppercase;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
    word-break: break-word;
}

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

.demo-table-wrap .table {
    min-width: 1080px;
}

.account-table {
    min-width: 720px;
}

.account-table th,
.account-table td {
    white-space: nowrap;
    word-break: normal;
}

.recognition-table {
    min-width: 940px;
}

.action-group {
    flex-wrap: wrap;
}

.detail-row > td {
    border-top: 0;
}

.collapse-panel,
.ai-report-card {
    animation: panel-in .16s ease;
}

@keyframes panel-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
}

.ai-report-title {
    color: #6f42c1;
    font-weight: 700;
    text-decoration: underline;
}

.ai-report-card {
    border-color: #6f42c1 !important;
}

.kbd,
.code-cell {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.code-cell {
    white-space: pre-wrap;
}

code {
    color: #c7254e;
}

.badge-exception {
    color: #fff;
    background: #fd7e14;
    border: 1px solid #e66f0d;
}

.exception-summary {
    background: #fffaf3;
    border: 1px solid #ffd39b;
}

.exception-summary[open] {
    box-shadow: 0 8px 20px rgba(180, 95, 6, .08);
}

.exception-summary summary {
    cursor: pointer;
    list-style: none;
}

.exception-summary summary::-webkit-details-marker {
    display: none;
}

.exception-summary summary::after {
    margin-left: auto;
    color: #9a4d00;
    content: "Details anzeigen";
    font-size: .82rem;
    font-weight: 600;
}

.exception-summary[open] summary::after {
    content: "Details ausblenden";
}

.metric-tile {
    height: 100%;
    padding: 1rem;
    background: #f8fbff;
    border: 1px solid #e3ebfb;
    border-radius: 12px;
}

.metric-value {
    color: var(--ink);
    font-size: 1.35rem;
    font-weight: 700;
}

.metric-label {
    color: #66758d;
    font-size: .82rem;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.status-dot {
    display: inline-block;
    width: .85rem;
    height: .85rem;
    border-radius: 999px;
}

.status-ok {
    background: #198754;
}

.macro-removing {
    opacity: 0;
    transform: translateX(10px);
    transition: .16s ease;
}

.toast {
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 14px 32px rgba(22, 32, 51, .16);
}

.toast.show {
    display: block;
    animation: toast-in .16s ease;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
}

@media (max-width: 767.98px) {
    .navbar > .container,
    .navbar > .container-fluid {
        align-items: flex-start;
    }

    .navbar-brand {
        font-size: 1rem;
    }

    .demo-nav {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    main.container-fluid {
        padding-right: 1rem !important;
        padding-left: 1rem !important;
    }

    .table {
        font-size: .9rem;
    }

    .card-body {
        padding: 1rem;
    }

    .env-banner {
        padding-right: .75rem;
        padding-left: .75rem;
        font-size: .68rem;
    }

    .exception-summary summary {
        align-items: flex-start !important;
        flex-direction: column;
    }

    .exception-summary summary::after {
        margin-left: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
